sw/source/filter/ww8/docxexport.cxx |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

New commits:
commit d2c71e9b6054fae66a553da869e752f8c55f76d5
Author:     Noel Grandin <[email protected]>
AuthorDate: Tue Oct 28 15:03:04 2025 +0200
Commit:     Noel Grandin <[email protected]>
CommitDate: Fri Oct 31 08:19:23 2025 +0100

    mso-test: do not emit empty cryptAlgorithmSid attribute
    
    which is not valid.
    
    When loading and then saving the forum-mso-en4-551337.docx document.
    
    Change-Id: Id67844b25b264e937b3bcdbf7a9dcbea76c2cd40
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/193092
    Tested-by: Jenkins CollaboraOffice <[email protected]>
    Reviewed-by: Michael Stahl <[email protected]>

diff --git a/sw/source/filter/ww8/docxexport.cxx 
b/sw/source/filter/ww8/docxexport.cxx
index cc720ddffd04..5a24c0597868 100644
--- a/sw/source/filter/ww8/docxexport.cxx
+++ b/sw/source/filter/ww8/docxexport.cxx
@@ -1315,7 +1315,10 @@ void DocxExport::WriteSettings()
                 if (sal_Int32 nToken = DocxStringGetToken(aTokens, 
rAttribute.Name))
                 {
                     OUString sValue = rAttribute.Value.get<OUString>();
-                    xAttributeList->add(FSNS(XML_w, nToken), sValue.toUtf8());
+                    if (nToken == XML_cryptAlgorithmSid && sValue.isEmpty())
+                        ; // ignore, empty is not valid OOXML
+                    else
+                        xAttributeList->add(FSNS(XML_w, nToken), 
sValue.toUtf8());
                     if ( nToken == XML_edit && sValue == "trackedChanges" )
                         bIsProtectionTrackChanges = true;
                     else if ( nToken == XML_edit && sValue == "readOnly" )

Reply via email to