diff options
-rw-r--r-- | writerfilter/source/dmapper/DomainMapper_Impl.cxx | 20 | ||||
-rw-r--r-- | writerfilter/source/dmapper/SettingsTable.cxx | 16 | ||||
-rw-r--r-- | writerfilter/source/dmapper/SettingsTable.hxx | 3 |
3 files changed, 33 insertions, 6 deletions
diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx index de03396973c1..3c4e8eb97894 100644 --- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx +++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx @@ -74,6 +74,8 @@ #include <com/sun/star/util/XNumberFormatsSupplier.hpp> #include <com/sun/star/util/XNumberFormats.hpp> #include <com/sun/star/embed/XEmbeddedObject.hpp> +#include <com/sun/star/document/XViewDataSupplier.hpp> +#include <com/sun/star/container/XIndexContainer.hpp> #include <rtl/ustrbuf.hxx> #include <rtl/string.h> #include <rtl/oustringostreaminserter.hxx> @@ -3543,6 +3545,24 @@ void DomainMapper_Impl::ApplySettingsTable() aSpacing.Height = sal_Int16(115); xTextDefaults->setPropertyValue(rSupplier.GetName(PROP_PARA_LINE_SPACING), uno::makeAny(aSpacing)); } + + if (m_pSettingsTable->GetZoomFactor()) + { + uno::Sequence<beans::PropertyValue> aViewProps(3); + aViewProps[0].Name = "ZoomFactor"; + aViewProps[0].Value <<= m_pSettingsTable->GetZoomFactor(); + aViewProps[1].Name = "VisibleBottom"; + aViewProps[1].Value <<= sal_Int32(0); + aViewProps[2].Name = "ZoomType"; + aViewProps[2].Value <<= sal_Int16(0); + + uno::Reference<container::XIndexContainer> xBox(m_xComponentContext->getServiceManager()->createInstanceWithContext("com.sun.star.document.IndexedPropertyValues", + m_xComponentContext), uno::UNO_QUERY ); + xBox->insertByIndex(sal_Int32(0), uno::makeAny(aViewProps)); + uno::Reference<container::XIndexAccess> xIndexAccess(xBox, uno::UNO_QUERY); + uno::Reference<document::XViewDataSupplier> xViewDataSupplier(m_xTextDocument, uno::UNO_QUERY); + xViewDataSupplier->setViewData(xIndexAccess); + } } catch(const uno::Exception& ) { diff --git a/writerfilter/source/dmapper/SettingsTable.cxx b/writerfilter/source/dmapper/SettingsTable.cxx index 870ce6fa5568..1012d7bc5825 100644 --- a/writerfilter/source/dmapper/SettingsTable.cxx +++ b/writerfilter/source/dmapper/SettingsTable.cxx @@ -75,6 +75,7 @@ struct SettingsTable_Impl ::rtl::OUString m_sHash; ::rtl::OUString m_sSalt; bool m_bLinkStyles; + sal_Int16 m_nZoomFactor; SettingsTable_Impl( DomainMapper& rDMapper, const uno::Reference< lang::XMultiServiceFactory > xTextFactory ) : m_rDMapper( rDMapper ) @@ -92,6 +93,7 @@ struct SettingsTable_Impl , m_nCryptAlgorithmType(NS_ooxml::LN_Value_wordprocessingml_ST_AlgType_typeAny) , m_nCryptSpinCount(0) , m_bLinkStyles(false) + , m_nZoomFactor(0) {} }; @@ -111,16 +113,13 @@ SettingsTable::~SettingsTable() void SettingsTable::lcl_attribute(Id nName, Value & val) { - (void) nName; int nIntValue = val.getInt(); - (void)nIntValue; - ::rtl::OUString sValue = val.getString(); - (void)sValue; switch(nName) { - //case NS_ooxml::: - //break; + case NS_ooxml::LN_CT_Zoom_percent: + m_pImpl->m_nZoomFactor = nIntValue; + break; default: { #ifdef DEBUG_DMAPPER_SETTINGS_TABLE @@ -226,6 +225,11 @@ bool SettingsTable::GetLinkStyles() const return m_pImpl->m_bLinkStyles; } +sal_Int16 SettingsTable::GetZoomFactor() const +{ + return m_pImpl->m_nZoomFactor; +} + void SettingsTable::ApplyProperties( uno::Reference< text::XTextDocument > xDoc ) { uno::Reference< beans::XPropertySet> xDocProps( xDoc, uno::UNO_QUERY ); diff --git a/writerfilter/source/dmapper/SettingsTable.hxx b/writerfilter/source/dmapper/SettingsTable.hxx index 79e095a12b3c..3d9a5603f321 100644 --- a/writerfilter/source/dmapper/SettingsTable.hxx +++ b/writerfilter/source/dmapper/SettingsTable.hxx @@ -67,6 +67,9 @@ class WRITERFILTER_DLLPRIVATE SettingsTable : public LoggedProperties, public Lo /// Automatically update styles from document template? bool GetLinkStyles() const; + /// What's the zoom factor set in percents? + sal_Int16 GetZoomFactor() const; + void ApplyProperties( uno::Reference< text::XTextDocument > xDoc ); private: |