summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJustin Luth <justin.luth@collabora.com>2018-10-18 21:15:13 +0300
committerAndras Timar <andras.timar@collabora.com>2018-10-20 22:59:22 +0200
commit587527b4738e1f99e49959a6ea0de407802e9cb4 (patch)
treea8052a97331162fbb9512659131519045275a3a6
parent7139f926dd933e9d6cda196fcfe7463c2dd11772 (diff)
NFC ww8 cleanup: remove unused variables, simplify, whitespace
Change-Id: Ib4f100d4019643cde893ef1d8643a5c08b55ff8f Reviewed-on: https://gerrit.libreoffice.org/61951 Tested-by: Jenkins Reviewed-by: Justin Luth <justin_luth@sil.org> (cherry picked from commit 2ec0cf500222aef55d02df80154b47fbb92970c9)
-rw-r--r--sw/source/filter/ww8/wrtww8.cxx11
-rw-r--r--sw/source/filter/ww8/ww8par.cxx20
2 files changed, 9 insertions, 22 deletions
diff --git a/sw/source/filter/ww8/wrtww8.cxx b/sw/source/filter/ww8/wrtww8.cxx
index 374665f56ec8..525d630424cd 100644
--- a/sw/source/filter/ww8/wrtww8.cxx
+++ b/sw/source/filter/ww8/wrtww8.cxx
@@ -497,14 +497,9 @@ static void WriteDop( WW8Export& rWrt )
OSL_ENSURE(pDocShell, "no SwDocShell");
uno::Reference<document::XDocumentProperties> xDocProps;
uno::Reference<beans::XPropertySet> xProps;
- if (pDocShell) {
- 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");
+ if ( pDocShell )
+ {
+ xProps.set(pDocShell->GetModel(), uno::UNO_QUERY);
rDop.lKeyProtDoc = pDocShell->GetModifyPasswordHash();
}
diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx
index a1dd150e18d3..05bf0966dcac 100644
--- a/sw/source/filter/ww8/ww8par.cxx
+++ b/sw/source/filter/ww8/ww8par.cxx
@@ -1889,22 +1889,14 @@ void SwWW8ImplReader::ImportDop()
// disable form design mode to be able to use imported controls directly
// #i31239# always disable form design mode, not only in protected docs
+ uno::Reference<beans::XPropertySet> xDocProps(m_pDocShell->GetModel(), uno::UNO_QUERY);
+ if (xDocProps.is())
{
- uno::Reference<lang::XComponent> xModelComp(m_pDocShell->GetModel(),
- uno::UNO_QUERY);
- uno::Reference<beans::XPropertySet> xDocProps(xModelComp,
- uno::UNO_QUERY);
- if (xDocProps.is())
+ uno::Reference<beans::XPropertySetInfo> xInfo = xDocProps->getPropertySetInfo();
+ if (xInfo.is())
{
- uno::Reference<beans::XPropertySetInfo> xInfo =
- xDocProps->getPropertySetInfo();
- if (xInfo.is())
- {
- if (xInfo->hasPropertyByName("ApplyFormDesignMode"))
- {
- xDocProps->setPropertyValue("ApplyFormDesignMode", css::uno::makeAny(false));
- }
- }
+ if (xInfo->hasPropertyByName("ApplyFormDesignMode"))
+ xDocProps->setPropertyValue("ApplyFormDesignMode", css::uno::makeAny(false));
}
}