summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sw/qa/extras/ww8export/ww8export3.cxx5
-rw-r--r--sw/source/filter/ww8/wrtww8.cxx6
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();
}