diff options
Diffstat (limited to 'sw/qa')
-rw-r--r-- | sw/qa/extras/inc/swmodeltestbase.hxx | 17 | ||||
-rw-r--r-- | sw/qa/extras/odfexport/data/sha1_correct.odt | bin | 0 -> 8587 bytes | |||
-rw-r--r-- | sw/qa/extras/odfexport/data/sha1_wrong.odt | bin | 0 -> 8435 bytes | |||
-rw-r--r-- | sw/qa/extras/odfexport/odfexport.cxx | 10 |
4 files changed, 22 insertions, 5 deletions
diff --git a/sw/qa/extras/inc/swmodeltestbase.hxx b/sw/qa/extras/inc/swmodeltestbase.hxx index 7cf82ad81311..6a0d6a1ff316 100644 --- a/sw/qa/extras/inc/swmodeltestbase.hxx +++ b/sw/qa/extras/inc/swmodeltestbase.hxx @@ -688,11 +688,18 @@ protected: aMediaDescriptor["FilterOptions"] <<= maFilterOptions; if (pPassword) { - OUString sPassword = OUString::createFromAscii(pPassword); - css::uno::Sequence<css::beans::NamedValue> aEncryptionData { - { "OOXPassword", css::uno::makeAny(sPassword) } - }; - aMediaDescriptor[utl::MediaDescriptor::PROP_ENCRYPTIONDATA()] <<= aEncryptionData; + if (strcmp(pFilter, "Office Open XML Text")) + { + aMediaDescriptor["Password"] <<= OUString::createFromAscii(pPassword); + } + else + { + OUString sPassword = OUString::createFromAscii(pPassword); + css::uno::Sequence<css::beans::NamedValue> aEncryptionData { + { "OOXPassword", css::uno::makeAny(sPassword) } + }; + aMediaDescriptor[utl::MediaDescriptor::PROP_ENCRYPTIONDATA()] <<= aEncryptionData; + } } xStorable->storeToURL(maTempFile.GetURL(), aMediaDescriptor.getAsConstPropertyValueList()); uno::Reference<lang::XComponent> xComponent(xStorable, uno::UNO_QUERY); diff --git a/sw/qa/extras/odfexport/data/sha1_correct.odt b/sw/qa/extras/odfexport/data/sha1_correct.odt Binary files differnew file mode 100644 index 000000000000..01cbb0a073b2 --- /dev/null +++ b/sw/qa/extras/odfexport/data/sha1_correct.odt diff --git a/sw/qa/extras/odfexport/data/sha1_wrong.odt b/sw/qa/extras/odfexport/data/sha1_wrong.odt Binary files differnew file mode 100644 index 000000000000..94032025b3d9 --- /dev/null +++ b/sw/qa/extras/odfexport/data/sha1_wrong.odt diff --git a/sw/qa/extras/odfexport/odfexport.cxx b/sw/qa/extras/odfexport/odfexport.cxx index 4e57a415e786..d4f8991b56de 100644 --- a/sw/qa/extras/odfexport/odfexport.cxx +++ b/sw/qa/extras/odfexport/odfexport.cxx @@ -384,6 +384,16 @@ DECLARE_ODFEXPORT_TEST(testFramebackgrounds, "framebackgrounds.odt") } } +DECLARE_SW_ROUNDTRIP_TEST(testSHA1Correct, "sha1_correct.odt", "1012345678901234567890123456789012345678901234567890", Test) +{ // tdf#114939 this has both an affected password as well as content.xml + getParagraph(1, "012"); +} + +DECLARE_SW_ROUNDTRIP_TEST(testSHA1Wrong, "sha1_wrong.odt", "1012345678901234567890123456789012345678901234567890", Test) +{ // tdf#114939 this has both an affected password as well as content.xml + getParagraph(1, "012"); +} + DECLARE_ODFEXPORT_TEST(testOOoxmlEmbedded, "oooxml_embedded.sxw") { uno::Reference<text::XTextEmbeddedObjectsSupplier> xTEOSupplier(mxComponent, uno::UNO_QUERY); |