diff options
author | Miklos Vajna <vmiklos@suse.cz> | 2013-01-07 09:13:02 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@suse.cz> | 2013-01-07 09:14:49 +0100 |
commit | 6e9ab7e0ca443cca46cd39a313583f4b90549e1c (patch) | |
tree | 545b9c44da8f1a24f66bf1e8eb938449f34a3915 /sw/source | |
parent | 504b6f0cec5cad01a64e723434d636bfb867ecfa (diff) |
WW8 filter: import zoom factor
Change-Id: I557cf89642ff618aaddb2f036652d126b25555c9
Diffstat (limited to 'sw/source')
-rw-r--r-- | sw/source/filter/ww8/ww8par.cxx | 21 | ||||
-rw-r--r-- | sw/source/filter/ww8/ww8scan.hxx | 2 |
2 files changed, 22 insertions, 1 deletions
diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx index 58970eb412ad..0db2f7f491f1 100644 --- a/sw/source/filter/ww8/ww8par.cxx +++ b/sw/source/filter/ww8/ww8par.cxx @@ -90,6 +90,7 @@ #include <com/sun/star/beans/PropertyAttribute.hpp> #include <com/sun/star/document/XDocumentPropertiesSupplier.hpp> +#include <com/sun/star/document/XViewDataSupplier.hpp> #include <svl/itemiter.hxx> //SfxItemIter #include <comphelper/processfactory.hxx> @@ -1491,6 +1492,26 @@ void SwWW8ImplReader::ImportDop() rDoc.GetAttrPool().SetPoolDefaultItem( aNewTab ); + // Import zoom factor. + if (pWDop->wScaleSaved) + { + uno::Sequence<beans::PropertyValue> aViewProps(3); + aViewProps[0].Name = "ZoomFactor"; + aViewProps[0].Value <<= sal_Int16(pWDop->wScaleSaved); + aViewProps[1].Name = "VisibleBottom"; + aViewProps[1].Value <<= sal_Int32(0); + aViewProps[2].Name = "ZoomType"; + aViewProps[2].Value <<= sal_Int16(0); + + uno::Reference< uno::XComponentContext > xComponentContext(comphelper::getProcessComponentContext()); + uno::Reference<container::XIndexContainer> xBox(xComponentContext->getServiceManager()->createInstanceWithContext("com.sun.star.document.IndexedPropertyValues", + 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(mpDocShell->GetModel(), uno::UNO_QUERY); + xViewDataSupplier->setViewData(xIndexAccess); + } + rDoc.set(IDocumentSettingAccess::USE_VIRTUAL_DEVICE, !pWDop->fUsePrinterMetrics); rDoc.set(IDocumentSettingAccess::USE_HIRES_VIRTUAL_DEVICE, true); rDoc.set(IDocumentSettingAccess::ADD_FLY_OFFSETS, true ); diff --git a/sw/source/filter/ww8/ww8scan.hxx b/sw/source/filter/ww8/ww8scan.hxx index 8f681d8f8bef..6913545d67bd 100644 --- a/sw/source/filter/ww8/ww8scan.hxx +++ b/sw/source/filter/ww8/ww8scan.hxx @@ -1583,7 +1583,7 @@ public: sal_Int32 cLinesFtnEdn; // count of paragraphs in footnotes and endnotes tallied by last Word Count operation sal_Int32 lKeyProtDoc; // document protection password key, only valid if dop.fProtEnabled, dop.fLockAtn or dop.fLockRev are 1. sal_uInt16 wvkSaved : 3; // document view kind: 0 Normal view, 1 Outline view, 2 Page View - sal_uInt16 wScaleSaved : 9; // + sal_uInt16 wScaleSaved : 9; ///< Specifies the zoom percentage that was in use when the document was saved. sal_uInt16 zkSaved : 2; sal_uInt16 fRotateFontW6 : 1; sal_uInt16 iGutterPos : 1 ; |