include/test/bootstrapfixture.hxx                    |    9 
 include/test/unoapi_test.hxx                         |    9 
 officecfg/registry/data/org/openoffice/Office/UI.xcu |    2 
 sc/qa/extras/macros-test.cxx                         |    6 
 sw/qa/core/macros-test.cxx                           |    3 
 test/source/bootstrapfixture.cxx                     |  164 ---------------
 test/source/unoapi_test.cxx                          |  197 ++++++++++++++++++-
 7 files changed, 210 insertions(+), 180 deletions(-)

New commits:
commit c2a951efef5a89d4d287fb5e35de3459cae93b38
Author:     Xisco Fauli <[email protected]>
AuthorDate: Mon Feb 2 14:44:15 2026 +0100
Commit:     Tomaž Vajngerl <[email protected]>
CommitDate: Mon Mar 9 14:25:04 2026 +0100

    UnoApiTest: call validate from saveWithParams
    
    Some tests call saveWithParams directly
    
    Change-Id: I5a0cfaaa0693c6a7a41d69a8863d90f209021abc
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/198549
    Reviewed-by: Xisco Fauli <[email protected]>
    Tested-by: Jenkins
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/201178
    Reviewed-by: Tomaž Vajngerl <[email protected]>
    Tested-by: Jenkins CollaboraOffice <[email protected]>

diff --git a/test/source/unoapi_test.cxx b/test/source/unoapi_test.cxx
index b8a64649f9c6..e249c2e1a5bb 100644
--- a/test/source/unoapi_test.cxx
+++ b/test/source/unoapi_test.cxx
@@ -350,15 +350,29 @@ void UnoApiTest::save(TestFilter eFilter, const char* 
pPassword)
     }
 
     saveWithParams(aMediaDescriptor.getAsConstPropertyValueList());
-
-    if (!mbSkipValidation)
-        validate(maTempFile.GetFileName(), eFilter);
 }
 
 void UnoApiTest::saveWithParams(const uno::Sequence<beans::PropertyValue>& 
rParams)
 {
     css::uno::Reference<frame::XStorable> xStorable(mxComponent, 
css::uno::UNO_QUERY_THROW);
     xStorable->storeToURL(maTempFile.GetURL(), rParams);
+
+    if (!mbSkipValidation)
+    {
+        ::comphelper::SequenceAsHashMap aParamsHash(rParams);
+        OUString aFilterName;
+        aParamsHash.getValue(u"FilterName"_ustr) >>= aFilterName;
+        TestFilter eFilter = TestFilter::NONE;
+        for (const auto & [ key, value ] : TestFilterNames)
+        {
+            if (value == aFilterName)
+            {
+                eFilter = key;
+                break;
+            }
+        }
+        validate(maTempFile.GetFileName(), eFilter);
+    }
 }
 
 void UnoApiTest::saveAndReload(TestFilter eFilter, const char* pPassword)
commit d99ee8cdba2025a96611bf66edb184cd37b2f7c5
Author:     Xisco Fauli <[email protected]>
AuthorDate: Mon Mar 9 04:35:30 2026 +0000
Commit:     Tomaž Vajngerl <[email protected]>
CommitDate: Mon Mar 9 14:24:59 2026 +0100

    BootstrapFixture: move validate to UnoApiTest and adapt it a bit
    
    it's the only place where it's used
    
    Change-Id: Iaf74e959dcedc27ab1781157e1d2f01a41be5e8c
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/198590
    Tested-by: Jenkins
    Reviewed-by: Xisco Fauli <[email protected]>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/201177
    Reviewed-by: Tomaž Vajngerl <[email protected]>
    Tested-by: Jenkins CollaboraOffice <[email protected]>

diff --git a/include/test/bootstrapfixture.hxx 
b/include/test/bootstrapfixture.hxx
index e310cb1948a3..8302ff81d80a 100644
--- a/include/test/bootstrapfixture.hxx
+++ b/include/test/bootstrapfixture.hxx
@@ -18,13 +18,6 @@
 
 namespace test
 {
-enum ValidationFormat
-{
-    OOXML,
-    ODF,
-    MSBINARY
-};
-
 // Class to do lots of heavy-lifting UNO & environment
 // bootstrapping for unit tests, such that we can use
 // almost an entire LibreOffice during compile - so
@@ -53,8 +46,6 @@ public:
 
     virtual void setUp() override;
 
-    void validate(const OUString& rURL, std::u16string_view rFilter) const;
-
     // Allows to exclude tests dependent on color depth of the default virtual 
device
     static sal_uInt16 getDefaultDeviceBitCount();
 };
diff --git a/include/test/unoapi_test.hxx b/include/test/unoapi_test.hxx
index d589e2e59c36..140d8ead3fe7 100644
--- a/include/test/unoapi_test.hxx
+++ b/include/test/unoapi_test.hxx
@@ -22,6 +22,13 @@
 #include <unotools/tempfile.hxx>
 #include <vcl/filter/PDFiumLibrary.hxx>
 
+enum ValidationFormat
+{
+    OOXML,
+    ODF,
+    MSBINARY
+};
+
 enum class TestFilter
 {
     NONE,
@@ -171,6 +178,8 @@ private:
     void setTestInteractionHandler(const char* pPassword,
                                    std::vector<css::beans::PropertyValue>& 
rFilterOptions);
 
+    void validate(const OUString& rURL, TestFilter eFilter) const;
+
     bool mbSkipValidation;
     OUString m_aBaseString;
     OUString maFilterOptions;
diff --git a/test/source/bootstrapfixture.cxx b/test/source/bootstrapfixture.cxx
index 05a0fe8536f1..5ef50f0c2c34 100644
--- a/test/source/bootstrapfixture.cxx
+++ b/test/source/bootstrapfixture.cxx
@@ -24,7 +24,6 @@
 #include <vcl/graphicfilter.hxx>
 #include <osl/file.hxx>
 #include <osl/process.h>
-#include <unotest/getargument.hxx>
 #include <unotools/tempfile.hxx>
 #include <vcl/salgtype.hxx>
 #include <vcl/scheduler.hxx>
@@ -119,169 +118,6 @@ test::BootstrapFixture::~BootstrapFixture()
 {
 }
 
-#if HAVE_EXPORT_VALIDATION
-namespace {
-
-OString loadFile(const OUString& rURL)
-{
-    osl::File aFile(rURL);
-    osl::FileBase::RC eStatus = aFile.open(osl_File_OpenFlag_Read);
-    CPPUNIT_ASSERT_EQUAL(osl::FileBase::E_None, eStatus);
-    sal_uInt64 nSize;
-    aFile.getSize(nSize);
-    std::unique_ptr<char[]> aBytes(new char[nSize]);
-    sal_uInt64 nBytesRead;
-    aFile.read(aBytes.get(), nSize, nBytesRead);
-    CPPUNIT_ASSERT_EQUAL(nSize, nBytesRead);
-    OString aContent(aBytes.get(), nBytesRead);
-
-    return aContent;
-}
-
-constexpr std::u16string_view grand_total = u"Grand total of errors in 
submitted package: ";
-
-}
-#endif
-
-void test::BootstrapFixture::validate(const OUString& rPath, 
std::u16string_view rFilter) const
-{
-    test::ValidationFormat eFormat = test::ODF;
-    if (rFilter == u"Calc Office Open XML")
-        eFormat = test::OOXML;
-    else if (rFilter == u"Office Open XML Text")
-        eFormat = test::OOXML;
-    else if (rFilter == u"Impress Office Open XML")
-        eFormat = test::OOXML;
-    else if (rFilter == u"writer8")
-        eFormat = test::ODF;
-    else if (rFilter == u"calc8")
-        eFormat = test::ODF;
-    else if (rFilter == u"impress8")
-        eFormat = test::ODF;
-    else if (rFilter == u"draw8")
-        eFormat = test::ODF;
-    else if (rFilter == u"OpenDocument Text Flat XML")
-        eFormat = test::ODF;
-    else if (rFilter == u"MS Word 97")
-        eFormat = test::MSBINARY;
-    else if (rFilter == u"MS Excel 97")
-        eFormat = test::MSBINARY;
-    else if (rFilter == u"MS PowerPoint 97")
-        eFormat = test::MSBINARY;
-    else
-    {
-        SAL_INFO("test", "BootstrapFixture::validate: unknown filter");
-        return;
-    }
-
-#if HAVE_EXPORT_VALIDATION
-    OUString var;
-    if( eFormat == test::OOXML )
-    {
-        var = "OFFICEOTRON";
-    }
-    else if ( eFormat == test::ODF )
-    {
-        var = "ODFVALIDATOR";
-    }
-    else if ( eFormat == test::MSBINARY )
-    {
-#if HAVE_BFFVALIDATOR
-        var = "BFFVALIDATOR";
-#else
-        // Binary Format Validator is disabled
-        return;
-#endif
-    }
-    OUString aValidator;
-    oslProcessError e = osl_getEnvironment(var.pData, &aValidator.pData);
-    CPPUNIT_ASSERT_EQUAL_MESSAGE(
-        OUString("cannot get env var " + var).toUtf8().getStr(),
-        osl_Process_E_None, e);
-    CPPUNIT_ASSERT_MESSAGE(
-        OUString("empty get env var " + var).toUtf8().getStr(),
-        !aValidator.isEmpty());
-
-    if (eFormat == test::ODF)
-    {
-        // invoke without -e so that we know when something new is written
-        // in loext namespace that isn't yet in the custom schema
-        aValidator += " -M "
-            + 
m_directories.getPathFromSrc(u"/schema/libreoffice/OpenDocument-v1.4+libreoffice-manifest-schema.rng")
-            + " -D "
-            + 
m_directories.getPathFromSrc(u"/schema/libreoffice/OpenDocument-v1.4+libreoffice-dsig-schema.rng")
-            + " -O "
-            + 
m_directories.getPathFromSrc(u"/schema/libreoffice/OpenDocument-v1.4+libreoffice-schema.rng")
-            + " -m "
-            + m_directories.getPathFromSrc(u"/schema/mathml2/mathml2.xsd");
-    }
-
-    utl::TempFileNamed aOutput;
-    aOutput.EnableKillingFile();
-    OUString aOutputFile = aOutput.GetFileName();
-    OUString aCommand = aValidator + " " + rPath + " > " + aOutputFile + " 
2>&1";
-
-#if !defined _WIN32
-    // For now, this is only needed by some Linux ASan builds, so keep it 
simply and disable it on
-    // Windows (which doesn't support the relevant shell syntax for 
(un-)setting environment
-    // variables).
-    OUString env;
-    if (test::getArgument(u"env", &env)) {
-        auto const n = env.indexOf('=');
-        if (n == -1) {
-            aCommand = "unset -v " + env + " && " + aCommand;
-        } else {
-            aCommand = env + " " + aCommand;
-        }
-    }
-#endif
-
-    SAL_INFO("test", "BootstrapFixture::validate: executing '" << aCommand << 
"'");
-    int returnValue = system(OUStringToOString(aCommand, 
RTL_TEXTENCODING_UTF8).getStr());
-
-    OString aContentString = loadFile(aOutput.GetURL());
-    OUString aContentOUString = OStringToOUString(aContentString, 
RTL_TEXTENCODING_UTF8);
-
-    if( eFormat == test::OOXML && !aContentOUString.isEmpty() )
-    {
-        // check for validation errors here
-        sal_Int32 nIndex = aContentOUString.lastIndexOf(grand_total);
-        if(nIndex == -1)
-        {
-            SAL_WARN("test", "no summary line");
-        }
-        else
-        {
-            sal_Int32 nStartOfNumber = nIndex + grand_total.size();
-            std::u16string_view aNumber = 
aContentOUString.subView(nStartOfNumber);
-            sal_Int32 nErrors = o3tl::toInt32(aNumber);
-            OString aMsg = "validation error in OOXML export: Errors: " + 
OString::number(nErrors);
-            if(nErrors)
-            {
-                SAL_WARN("test", aContentOUString);
-            }
-            CPPUNIT_ASSERT_EQUAL_MESSAGE(aMsg.getStr(), sal_Int32(0), nErrors);
-        }
-    }
-    else if( eFormat == test::ODF && !aContentOUString.isEmpty() )
-    {
-        if( aContentOUString.indexOf("Error") != -1 || 
aContentOUString.indexOf("Fatal") != -1 )
-        {
-            SAL_WARN("test", aContentOUString);
-            CPPUNIT_FAIL(aContentString.getStr());
-        }
-    }
-    CPPUNIT_ASSERT_EQUAL_MESSAGE(
-        OString(
-            "failed to execute: " + OUStringToOString(aCommand, 
RTL_TEXTENCODING_UTF8) + "
"
-            + OUStringToOString(aContentOUString, 
RTL_TEXTENCODING_UTF8)).getStr(),
-        0, returnValue);
-#else
-    (void)rPath;
-    (void)eFormat;
-#endif
-}
-
 IMPL_STATIC_LINK(
         test::BootstrapFixture, ImplInitFilterHdl, ConvertData&, rData, bool)
 {
diff --git a/test/source/unoapi_test.cxx b/test/source/unoapi_test.cxx
index 2a9194a75d4b..b8a64649f9c6 100644
--- a/test/source/unoapi_test.cxx
+++ b/test/source/unoapi_test.cxx
@@ -7,6 +7,8 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
  */
 
+#include <config_validation.h>
+
 #include <test/unoapi_test.hxx>
 
 #include <com/sun/star/beans/NamedValue.hpp>
@@ -15,10 +17,14 @@
 #include <comphelper/processfactory.hxx>
 #include <comphelper/propertyvalue.hxx>
 #include <comphelper/sequence.hxx>
+#include <comphelper/sequenceashashmap.hxx>
+#include <o3tl/string_view.hxx>
 #include <osl/file.hxx>
+#include <osl/process.h>
 
 #include <sfx2/app.hxx>
 #include <sfx2/objsh.hxx>
+#include <unotest/getargument.hxx>
 #include <unotools/mediadescriptor.hxx>
 #include <utility>
 
@@ -81,6 +87,171 @@ void UnoApiTest::setTestInteractionHandler(const char* 
pPassword,
     rPropertyValue.Value <<= 
css::uno::Reference<task::XInteractionHandler2>(xInteractionHandler);
 }
 
+#if HAVE_EXPORT_VALIDATION
+namespace
+{
+OString loadFile(const OUString& rURL)
+{
+    osl::File aFile(rURL);
+    osl::FileBase::RC eStatus = aFile.open(osl_File_OpenFlag_Read);
+    CPPUNIT_ASSERT_EQUAL(osl::FileBase::E_None, eStatus);
+    sal_uInt64 nSize;
+    aFile.getSize(nSize);
+    std::unique_ptr<char[]> aBytes(new char[nSize]);
+    sal_uInt64 nBytesRead;
+    aFile.read(aBytes.get(), nSize, nBytesRead);
+    CPPUNIT_ASSERT_EQUAL(nSize, nBytesRead);
+    OString aContent(aBytes.get(), nBytesRead);
+
+    return aContent;
+}
+
+constexpr std::u16string_view grand_total = u"Grand total of errors in 
submitted package: ";
+}
+#endif
+
+void UnoApiTest::validate(const OUString& rPath, TestFilter eFilter) const
+{
+    ValidationFormat eFormat = ValidationFormat::ODF;
+    if (eFilter == TestFilter::XLSX)
+        eFormat = ValidationFormat::OOXML;
+    else if (eFilter == TestFilter::DOCX)
+        eFormat = ValidationFormat::OOXML;
+    else if (eFilter == TestFilter::PPTX)
+        eFormat = ValidationFormat::OOXML;
+    else if (eFilter == TestFilter::ODT)
+        eFormat = ValidationFormat::ODF;
+    else if (eFilter == TestFilter::ODS)
+        eFormat = ValidationFormat::ODF;
+    else if (eFilter == TestFilter::ODP)
+        eFormat = ValidationFormat::ODF;
+    else if (eFilter == TestFilter::ODG)
+        eFormat = ValidationFormat::ODF;
+    else if (eFilter == TestFilter::DOC)
+        eFormat = ValidationFormat::MSBINARY;
+    else if (eFilter == TestFilter::XLS)
+        eFormat = ValidationFormat::MSBINARY;
+    else if (eFilter == TestFilter::PPT)
+        eFormat = ValidationFormat::MSBINARY;
+    else
+    {
+        SAL_INFO("test", "UnoApiTest::validate: unknown filter");
+        return;
+    }
+
+#if HAVE_EXPORT_VALIDATION
+    OUString var;
+    if (eFormat == ValidationFormat::OOXML)
+    {
+        var = "OFFICEOTRON";
+    }
+    else if (eFormat == ValidationFormat::ODF)
+    {
+        var = "ODFVALIDATOR";
+    }
+    else if (eFormat == ValidationFormat::MSBINARY)
+    {
+#if HAVE_BFFVALIDATOR
+        var = "BFFVALIDATOR";
+#else
+        // Binary Format Validator is disabled
+        return;
+#endif
+    }
+    OUString aValidator;
+    oslProcessError e = osl_getEnvironment(var.pData, &aValidator.pData);
+    CPPUNIT_ASSERT_EQUAL_MESSAGE(OUString("cannot get env var " + 
var).toUtf8().getStr(),
+                                 osl_Process_E_None, e);
+    CPPUNIT_ASSERT_MESSAGE(OUString("empty get env var " + 
var).toUtf8().getStr(),
+                           !aValidator.isEmpty());
+
+    if (eFormat == ValidationFormat::ODF)
+    {
+        // invoke without -e so that we know when something new is written
+        // in loext namespace that isn't yet in the custom schema
+        aValidator
+            += " -M "
+               + m_directories.getPathFromSrc(
+                     
u"/schema/libreoffice/OpenDocument-v1.4+libreoffice-manifest-schema.rng")
+               + " -D "
+               + m_directories.getPathFromSrc(
+                     
u"/schema/libreoffice/OpenDocument-v1.4+libreoffice-dsig-schema.rng")
+               + " -O "
+               + m_directories.getPathFromSrc(
+                     
u"/schema/libreoffice/OpenDocument-v1.4+libreoffice-schema.rng")
+               + " -m " + 
m_directories.getPathFromSrc(u"/schema/mathml2/mathml2.xsd");
+    }
+
+    utl::TempFileNamed aOutput;
+    aOutput.EnableKillingFile();
+    OUString aOutputFile = aOutput.GetFileName();
+    OUString aCommand = aValidator + " " + rPath + " > " + aOutputFile + " 
2>&1";
+
+#if !defined _WIN32
+    // For now, this is only needed by some Linux ASan builds, so keep it 
simply and disable it on
+    // Windows (which doesn't support the relevant shell syntax for 
(un-)setting environment
+    // variables).
+    OUString env;
+    if (test::getArgument(u"env", &env))
+    {
+        auto const n = env.indexOf('=');
+        if (n == -1)
+        {
+            aCommand = "unset -v " + env + " && " + aCommand;
+        }
+        else
+        {
+            aCommand = env + " " + aCommand;
+        }
+    }
+#endif
+
+    SAL_INFO("test", "UnoApiTest::validate: executing '" << aCommand << "'");
+    int returnValue = system(OUStringToOString(aCommand, 
RTL_TEXTENCODING_UTF8).getStr());
+
+    OString aContentString = loadFile(aOutput.GetURL());
+    OUString aContentOUString = OStringToOUString(aContentString, 
RTL_TEXTENCODING_UTF8);
+
+    if (eFormat == ValidationFormat::OOXML && !aContentOUString.isEmpty())
+    {
+        // check for validation errors here
+        sal_Int32 nIndex = aContentOUString.lastIndexOf(grand_total);
+        if (nIndex == -1)
+        {
+            SAL_WARN("test", "no summary line");
+        }
+        else
+        {
+            sal_Int32 nStartOfNumber = nIndex + grand_total.size();
+            std::u16string_view aNumber = 
aContentOUString.subView(nStartOfNumber);
+            sal_Int32 nErrors = o3tl::toInt32(aNumber);
+            OString aMsg = "validation error in OOXML export: Errors: " + 
OString::number(nErrors);
+            if (nErrors)
+            {
+                SAL_WARN("test", aContentOUString);
+            }
+            CPPUNIT_ASSERT_EQUAL_MESSAGE(aMsg.getStr(), sal_Int32(0), nErrors);
+        }
+    }
+    else if (eFormat == ValidationFormat::ODF && !aContentOUString.isEmpty())
+    {
+        if (aContentOUString.indexOf("Error") != -1 || 
aContentOUString.indexOf("Fatal") != -1)
+        {
+            SAL_WARN("test", aContentOUString);
+            CPPUNIT_FAIL(aContentString.getStr());
+        }
+    }
+    CPPUNIT_ASSERT_EQUAL_MESSAGE(
+        OString("failed to execute: " + OUStringToOString(aCommand, 
RTL_TEXTENCODING_UTF8) + "
"
+                + OUStringToOString(aContentOUString, RTL_TEXTENCODING_UTF8))
+            .getStr(),
+        0, returnValue);
+#else
+    (void)rPath;
+    (void)eFormat;
+#endif
+}
+
 void UnoApiTest::loadFromURL(OUString const& rURL, const char* pPassword)
 {
     std::vector<beans::PropertyValue> aFilterOptions;
@@ -181,7 +352,7 @@ void UnoApiTest::save(TestFilter eFilter, const char* 
pPassword)
     saveWithParams(aMediaDescriptor.getAsConstPropertyValueList());
 
     if (!mbSkipValidation)
-        validate(maTempFile.GetFileName(), aFilter);
+        validate(maTempFile.GetFileName(), eFilter);
 }
 
 void UnoApiTest::saveWithParams(const uno::Sequence<beans::PropertyValue>& 
rParams)
commit ca2bc65800f3857b26ae88394c4533994ae5d336
Author:     Samuel Mehrbrodt <[email protected]>
AuthorDate: Mon Feb 23 16:02:06 2026 +0100
Commit:     Samuel Mehrbrodt <[email protected]>
CommitDate: Mon Mar 9 14:24:55 2026 +0100

    Fix duplicate filters in text document class
    
    * Remove duplicate WordPerfect entry
    * Remove writerglobal8 and writerweb8_writer_template
      which already belong to their own GlobalDocument and WebDocument global 
filter classes
    
    This fixes warnings like:
      
warn:sfx.dialog:1688061:1688061:sfx2/source/dialog/filtergrouping.cxx:357: 
already have an element for WordPerfect
      
warn:sfx.dialog:1688061:1688061:sfx2/source/dialog/filtergrouping.cxx:357: 
already have an element for writerweb8_writer_template
      
warn:sfx.dialog:1688061:1688061:sfx2/source/dialog/filtergrouping.cxx:357: 
already have an element for writerglobal8
    
    Change-Id: I6fd0527d943224de76a1b72eabcb2ba0aea2af1c
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/200066
    Tested-by: Jenkins
    Reviewed-by: Samuel Mehrbrodt <[email protected]>
    (cherry picked from commit df5fd71899304f310ff931f73eed497c28fd8b66)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/201258
    Tested-by: Jenkins CollaboraOffice <[email protected]>

diff --git a/officecfg/registry/data/org/openoffice/Office/UI.xcu 
b/officecfg/registry/data/org/openoffice/Office/UI.xcu
index 17e4de678e27..d60b4b19e9d4 100644
--- a/officecfg/registry/data/org/openoffice/Office/UI.xcu
+++ b/officecfg/registry/data/org/openoffice/Office/UI.xcu
@@ -26,7 +26,7 @@
             <value xml:lang="en-US">Text documents (Writer)</value>
           </prop>
           <prop oor:name="Filters">
-            <value oor:separator=";">AportisDoc Palm DB;HTML 
(StarWriter);LotusWordPro;MS Word 2003 XML;MS Word 2007 XML;MS Word 2007 XML 
Template;MS Word 97;MS Word 97 Vorlage;MS_Works;Office Open XML Text;Office 
Open XML Text Template;OpenDocument Text Flat XML;PocketWord File;Rich Text 
Format;StarOffice XML 
(Writer);Markdown;Text;WordPerfect;WordPerfect;writer_MIZI_Hwp_97;writer_StarOffice_XML_Writer_Template;writer8;writer8_template;writerglobal8;writerweb8_writer_template</value>
+            <value oor:separator=";">AportisDoc Palm DB;HTML 
(StarWriter);LotusWordPro;MS Word 2003 XML;MS Word 2007 XML;MS Word 2007 XML 
Template;MS Word 97;MS Word 97 Vorlage;MS_Works;Office Open XML Text;Office 
Open XML Text Template;OpenDocument Text Flat XML;PocketWord File;Rich Text 
Format;StarOffice XML 
(Writer);Markdown;Text;WordPerfect;writer_MIZI_Hwp_97;writer_StarOffice_XML_Writer_Template;writer8;writer8_template</value>
           </prop>
         </node>
         <node oor:name="com.sun.star.sheet.SpreadsheetDocument" 
oor:op="replace">
commit 427cca5066e833e193244630fb2c83f7a9f3cb66
Author:     Xisco Fauli <[email protected]>
AuthorDate: Mon Mar 9 04:32:43 2026 +0000
Commit:     Tomaž Vajngerl <[email protected]>
CommitDate: Mon Mar 9 14:24:49 2026 +0100

    resolves tdf#149567: odfvalidator: do not validate password protected files
    
    Running "java -jar odfvalidator-0.9.0-jar-with-dependencies.jar test.odt"
    it fails with "The document is encrypted. Validation of encrypted documents
    is not supported."
    
    Move skipValidation() out of the OOXML-only block so it applies to all
    password-protected exports, and add explicit skipValidation() calls in
    tests that load password-protected documents before saving.
    
    (cherry picked from commit 374e7cd1a48d9f564e50d6036afbb68b7fdf6add)
    
    Change-Id: I185e9cd5227a07cd7fd07379c8925b9a8296d0a3
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/201239
    Reviewed-by: Tomaž Vajngerl <[email protected]>
    Tested-by: Tomaž Vajngerl <[email protected]>

diff --git a/sc/qa/extras/macros-test.cxx b/sc/qa/extras/macros-test.cxx
index 7a3f514b659e..f83606184f8d 100644
--- a/sc/qa/extras/macros-test.cxx
+++ b/sc/qa/extras/macros-test.cxx
@@ -300,6 +300,9 @@ CPPUNIT_TEST_FIXTURE(ScMacrosTest, 
testPasswordProtectedUnicodeString)
     xLC->loadLibrary(sLibName);
     CPPUNIT_ASSERT(xLC->isLibraryLoaded(sLibName));
 
+    // Password protected documents can't be validated
+    skipValidation();
+
     // Now check that saving stores Unicode data correctly in image's string 
pool
     saveAndReload(TestFilter::ODS);
 
@@ -340,6 +343,9 @@ CPPUNIT_TEST_FIXTURE(ScMacrosTest, 
testPasswordProtectedArrayInUserType)
     xLC->loadLibrary(sLibName);
     CPPUNIT_ASSERT(xLC->isLibraryLoaded(sLibName));
 
+    // Password protected documents can't be validated
+    skipValidation();
+
     // Now check that saving stores array bounds correctly
     saveAndReload(TestFilter::ODS);
 
diff --git a/sw/qa/core/macros-test.cxx b/sw/qa/core/macros-test.cxx
index d6c260992de2..51c30ade0012 100644
--- a/sw/qa/core/macros-test.cxx
+++ b/sw/qa/core/macros-test.cxx
@@ -452,6 +452,9 @@ void SwMacrosTest::testFdo87530()
         xBasLibPwd->changeLibraryPassword(u"BarLibrary"_ustr, u""_ustr, 
u"foo"_ustr);
     }
 
+    // Password protected documents can't be validated
+    skipValidation();
+
     saveAndReload(TestFilter::ODT);
 
     {
diff --git a/test/source/bootstrapfixture.cxx b/test/source/bootstrapfixture.cxx
index a30b10057738..05a0fe8536f1 100644
--- a/test/source/bootstrapfixture.cxx
+++ b/test/source/bootstrapfixture.cxx
@@ -265,7 +265,7 @@ void test::BootstrapFixture::validate(const OUString& 
rPath, std::u16string_view
     }
     else if( eFormat == test::ODF && !aContentOUString.isEmpty() )
     {
-        if( aContentOUString.indexOf("Error") != -1 )
+        if( aContentOUString.indexOf("Error") != -1 || 
aContentOUString.indexOf("Fatal") != -1 )
         {
             SAL_WARN("test", aContentOUString);
             CPPUNIT_FAIL(aContentString.getStr());
diff --git a/test/source/unoapi_test.cxx b/test/source/unoapi_test.cxx
index e9c71a12c143..2a9194a75d4b 100644
--- a/test/source/unoapi_test.cxx
+++ b/test/source/unoapi_test.cxx
@@ -172,10 +172,10 @@ void UnoApiTest::save(TestFilter eFilter, const char* 
pPassword)
                 { u"OOXPassword"_ustr, uno::Any(sPassword) }
             };
             aMediaDescriptor[utl::MediaDescriptor::PROP_ENCRYPTIONDATA] <<= 
aEncryptionData;
-
-            // validation fails with "zip END header not found"
-            skipValidation();
         }
+
+        // Password protected documents can't be validated
+        skipValidation();
     }
 
     saveWithParams(aMediaDescriptor.getAsConstPropertyValueList());

Reply via email to