diff options
author | Justin Luth <justin_luth@sil.org> | 2020-09-28 20:21:52 +0300 |
---|---|---|
committer | Andras Timar <andras.timar@collabora.com> | 2020-10-28 14:01:59 +0100 |
commit | fda7c92d2b71a5e0bb4366f4fba140104efcc554 (patch) | |
tree | f8abf93c8e1024eed156ce46bc36e31f3e60689a | |
parent | 2be854e8441b870a2e9bed2d583d4f7aeb73d5d9 (diff) |
tdf#136983 partial revert NFC ww8 cleanup: remove unused variables
This is a partial revert of LO 6.2
commit 2ec0cf500222aef55d02df80154b47fbb92970c9
I can't think of any excuse for how I possibly missed that
xDocProps was being defined/used outside of this clause.
Just plain stupid and blind.
The good news is that the create and modified date still
seem to be getting saved somehow/somewhere. So it isn't
the disaster that it looks like it could have been.
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103565
Tested-by: Jenkins
Reviewed-by: Justin Luth <justin_luth@sil.org>
(cherry picked from commit 1086654d6e8cc22f1f99195668db3f305437e570)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104495
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
(cherry picked from commit 19b8ded3ae18dd4070a3e21d7b980782a27e5547)
Change-Id: I72ef56fa50b9e92e4ce687b132b1919cfae6c1f6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104497
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104502
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Andras Timar <andras.timar@collabora.com>
-rw-r--r-- | sw/qa/extras/ww8export/ww8export3.cxx | 5 | ||||
-rw-r--r-- | sw/source/filter/ww8/wrtww8.cxx | 6 |
2 files changed, 10 insertions, 1 deletions
diff --git a/sw/qa/extras/ww8export/ww8export3.cxx b/sw/qa/extras/ww8export/ww8export3.cxx index 721fc95fa8a6..b9f8f668c7a7 100644 --- a/sw/qa/extras/ww8export/ww8export3.cxx +++ b/sw/qa/extras/ww8export/ww8export3.cxx @@ -12,6 +12,7 @@ #include <IDocumentSettingAccess.hxx> #include <com/sun/star/beans/XPropertySet.hpp> #include <com/sun/star/container/XIndexAccess.hpp> +#include <com/sun/star/document/XDocumentPropertiesSupplier.hpp> #include <com/sun/star/text/XFormField.hpp> #include <com/sun/star/text/XTextFramesSupplier.hpp> #include <com/sun/star/text/XTextTable.hpp> @@ -47,6 +48,10 @@ DECLARE_WW8EXPORT_TEST(testTdf37778_readonlySection, "tdf37778_readonlySection.d // The problem was that section protection was being enabled in addition to being read-only. // This created an explicit section with protection. There should be just the default, non-explicit section. CPPUNIT_ASSERT_EQUAL_MESSAGE("Number of Sections", sal_Int32(0), xSections->getCount()); + + // tdf#136983 + uno::Reference<document::XDocumentPropertiesSupplier> xDPS(mxComponent, uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Last printed date", sal_Int16(2009), xDPS->getDocumentProperties()->getPrintDate().Year); } DECLARE_WW8EXPORT_TEST(testArabicZeroNumbering, "arabic-zero-numbering.doc") diff --git a/sw/source/filter/ww8/wrtww8.cxx b/sw/source/filter/ww8/wrtww8.cxx index 096be4c81e4c..f3e8754fc28f 100644 --- a/sw/source/filter/ww8/wrtww8.cxx +++ b/sw/source/filter/ww8/wrtww8.cxx @@ -502,7 +502,11 @@ static void WriteDop( WW8Export& rWrt ) uno::Reference<beans::XPropertySet> xProps; if ( pDocShell ) { - xProps.set(pDocShell->GetModel(), uno::UNO_QUERY); + uno::Reference<lang::XComponent> xModelComp(pDocShell->GetModel(), uno::UNO_QUERY); + xProps.set(xModelComp, uno::UNO_QUERY); + uno::Reference<document::XDocumentPropertiesSupplier> xDPS(xModelComp, uno::UNO_QUERY_THROW); + xDocProps = xDPS->getDocumentProperties(); + OSL_ENSURE(xDocProps.is(), "DocumentProperties is null"); rDop.lKeyProtDoc = pDocShell->GetModifyPasswordHash(); } |