diff options
-rw-r--r-- | sw/source/filter/ww8/wrtww8.cxx | 11 | ||||
-rw-r--r-- | sw/source/filter/ww8/ww8par.cxx | 20 |
2 files changed, 9 insertions, 22 deletions
diff --git a/sw/source/filter/ww8/wrtww8.cxx b/sw/source/filter/ww8/wrtww8.cxx index 6451b5c92377..29259003ab88 100644 --- a/sw/source/filter/ww8/wrtww8.cxx +++ b/sw/source/filter/ww8/wrtww8.cxx @@ -498,14 +498,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 54bf8e6aeaa7..70f3cdf41f6c 100644 --- a/sw/source/filter/ww8/ww8par.cxx +++ b/sw/source/filter/ww8/ww8par.cxx @@ -1905,22 +1905,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)); } } |