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 35f624d893d532c4c83b836c46ef02afe4b17501
Author: Jim Jagielski <[email protected]>
AuthorDate: Wed Oct 28 08:17:01 2026 -0400

    xmloff: don't write zero border line widths in ODF 1.2 strict mode
---
 main/xmloff/source/style/bordrhdl.cxx | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/main/xmloff/source/style/bordrhdl.cxx 
b/main/xmloff/source/style/bordrhdl.cxx
index 0f50379254..3b149b3258 100644
--- a/main/xmloff/source/style/bordrhdl.cxx
+++ b/main/xmloff/source/style/bordrhdl.cxx
@@ -29,6 +29,7 @@
 #include <xmloff/xmltoken.hxx>
 #include <xmloff/xmluconv.hxx>
 #include <rtl/ustrbuf.hxx>
+#include <unotools/saveopt.hxx>
 #include <com/sun/star/uno/Any.hxx>
 #include <com/sun/star/table/BorderLine.hpp>
 
@@ -292,6 +293,11 @@ sal_Bool XMLBorderWidthHdl::exportXML( OUString& 
rStrExpValue, const uno::Any& r
        if( aBorderLine.LineDistance == 0 && aBorderLine.InnerLineWidth == 0)
                return sal_False;
 
+       // strict ODF 1.2 wants three positive lengths; a zero part is dropped 
on reload
+       if( ( aBorderLine.LineDistance == 0 || aBorderLine.InnerLineWidth == 0 
|| aBorderLine.OuterLineWidth == 0 ) &&
+               SvtSaveOptions().GetODFDefaultVersion() == 
SvtSaveOptions::ODFVER_012 )
+               return sal_False;
+
        rUnitConverter.convertMeasure( aOut, aBorderLine.InnerLineWidth );
        aOut.append( sal_Unicode( ' ' ) );
        rUnitConverter.convertMeasure( aOut, aBorderLine.LineDistance );

Reply via email to