This is an automated email from the ASF dual-hosted git repository.

jimjag pushed a commit to branch odf-devel
in repository https://gitbox.apache.org/repos/asf/openoffice.git

commit d47ac291e9c4eaf6ac405411773c1434194d5cec
Author: Jim Jagielski <[email protected]>
AuthorDate: Thu Oct 22 16:26:37 2026 -0400

    xmloff: clamp exported opacity to 0-100%
---
 main/xmloff/source/style/xmlbahdl.cxx | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/main/xmloff/source/style/xmlbahdl.cxx 
b/main/xmloff/source/style/xmlbahdl.cxx
index 623330f45b..4ee38145f6 100644
--- a/main/xmloff/source/style/xmlbahdl.cxx
+++ b/main/xmloff/source/style/xmlbahdl.cxx
@@ -421,6 +421,13 @@ sal_Bool XMLNegPercentPropHdl::exportXML( OUString& 
rStrExpValue, const Any& rVa
 
        if( lcl_xmloff_getAny( rValue, nValue, nBytes ) )
        {
+               if( nBytes == 2 )
+               {
+                       if( nValue < 0 )
+                               nValue = 0;
+                       else if( nValue > 100 )
+                               nValue = 100;
+               }
                SvXMLUnitConverter::convertPercent( aOut, 100-nValue );
                rStrExpValue = aOut.makeStringAndClear();
 

Reply via email to