sd/qa/unit/export-tests.cxx |   14 ++++++++++++++
 test/source/unoapi_test.cxx |    3 ++-
 2 files changed, 16 insertions(+), 1 deletion(-)

New commits:
commit 958c08ad86d56839faf28a02097500bad7b1eb76
Author:     Xisco Fauli <xiscofa...@libreoffice.org>
AuthorDate: Tue Nov 29 12:29:43 2022 +0100
Commit:     Xisco Fauli <xiscofa...@libreoffice.org>
CommitDate: Tue Nov 29 14:04:50 2022 +0100

    sd: test exporting to odp/pptx with password protection
    
    exporting to ppt with password protection is not supported
    
    Change-Id: Ic04c0046b91b76688c947bb4ae3b3cf90046080c
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143459
    Tested-by: Jenkins
    Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org>

diff --git a/sd/qa/unit/export-tests.cxx b/sd/qa/unit/export-tests.cxx
index a6efbee97477..4e781dd2d05c 100644
--- a/sd/qa/unit/export-tests.cxx
+++ b/sd/qa/unit/export-tests.cxx
@@ -61,6 +61,7 @@ public:
     void testFillBitmapUnused();
     void testFdo84043();
     void testTdf97630();
+    void testImpressPasswordExport();
     void testSwappedOutImageExport();
     void testOOoXMLAnimations();
     void testBnc480256();
@@ -111,6 +112,7 @@ public:
     CPPUNIT_TEST(testFillBitmapUnused);
     CPPUNIT_TEST(testFdo84043);
     CPPUNIT_TEST(testTdf97630);
+    CPPUNIT_TEST(testImpressPasswordExport);
     CPPUNIT_TEST(testSwappedOutImageExport);
     CPPUNIT_TEST(testOOoXMLAnimations);
     CPPUNIT_TEST(testBnc480256);
@@ -512,6 +514,18 @@ void SdExportTest::testTdf97630()
                 1);
 }
 
+void SdExportTest::testImpressPasswordExport()
+{
+    std::vector<OUString> vFormat{ "impress8", "Impress Office Open XML" };
+
+    for (size_t i = 0; i < vFormat.size(); i++)
+    {
+        createSdImpressDoc();
+
+        saveAndReload(vFormat[i], /*pPassword*/ "test");
+    }
+}
+
 void SdExportTest::testSwappedOutImageExport()
 {
     // Problem was with the swapped out images, which were not swapped in 
during export.
diff --git a/test/source/unoapi_test.cxx b/test/source/unoapi_test.cxx
index 60c010c17e98..e8198876537a 100644
--- a/test/source/unoapi_test.cxx
+++ b/test/source/unoapi_test.cxx
@@ -152,7 +152,8 @@ void UnoApiTest::save(const OUString& rFilter, const char* 
pPassword)
 
     if (pPassword)
     {
-        if (rFilter != "Office Open XML Text" && rFilter != "Calc Office Open 
XML")
+        if (rFilter != "Office Open XML Text" && rFilter != "Calc Office Open 
XML"
+            && rFilter != "Impress Office Open XML")
         {
             aMediaDescriptor["Password"] <<= 
OUString::createFromAscii(pPassword);
         }

Reply via email to