diff options
Diffstat (limited to 'sw/source/filter/xml/xmlimp.cxx')
-rw-r--r-- | sw/source/filter/xml/xmlimp.cxx | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/sw/source/filter/xml/xmlimp.cxx b/sw/source/filter/xml/xmlimp.cxx index c7e33d926357..e88f90e2c621 100644 --- a/sw/source/filter/xml/xmlimp.cxx +++ b/sw/source/filter/xml/xmlimp.cxx @@ -588,6 +588,32 @@ void SwXMLImport::startDocument() m_bOrganizerMode = true; } } + + // default document properties + const OUString sDefSettings("DefaultDocumentSettings"); + if (xPropertySetInfo->hasPropertyByName(sDefSettings)) + { + aAny = xImportInfo->getPropertyValue(sDefSettings); + Sequence<PropertyValue> aProps; + if (aAny >>= aProps) + { + Reference<lang::XMultiServiceFactory> xFac(GetModel(), UNO_QUERY); + Reference<XPropertySet> xProps( + xFac->createInstance("com.sun.star.document.Settings"), UNO_QUERY); + Reference<XPropertySetInfo> xInfo(xProps->getPropertySetInfo()); + + if (xProps.is() && xInfo.is()) + { + for (const auto& rProp : aProps) + { + if (xInfo->hasPropertyByName(rProp.Name)) + { + xProps->setPropertyValue(rProp.Name, rProp.Value); + } + } + } + } + } } // There only is a text cursor by now if we are in insert mode. In any |