diff options
author | Michael Stahl <mstahl@redhat.com> | 2017-01-18 18:25:46 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2017-01-19 15:43:56 +0000 |
commit | 8c940adc98ed9e5844506d5b66a0cdf57f9e1e7c (patch) | |
tree | d65ec7005900c845240e3362e04f4dd51d1b6a68 /writerfilter | |
parent | 2671816be19e541941b9b3cbd3f085ea3748261d (diff) |
tdf#99074 sw: remove duplicate property "IsBrowseMode" again
Commit e0f9bb795251d950b5dd960fcd030170c8eb67aa added the property
"IsBrowseMode" to SwXDocumentSettings, but it is already available in
the API as SwXViewSettings property "ShowOnlineLayout".
The problem is that both of these properties get exported in ODF into
settings.xml, so it contains "IsBrowseMode" twice.
Unfortunately the SwXViewSettings are not available in writerfilter,
because the XModel::getCurrentController() is null, the view is created
after the import.
But there is already a way to store ViewData in the SfxBaseModel, which
is then used by SfxBaseController::ConnectSfxFrame_Impl() when creating
the view. This applies the property at just the right time.
(cherry picked from commit 2dce8dd41c208ecda40c054635f3736147ec8914)
Change-Id: I842845d09a7b3fe81e27a1ed8ac8a8594da7f4e8
Reviewed-on: https://gerrit.libreoffice.org/33285
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Diffstat (limited to 'writerfilter')
-rw-r--r-- | writerfilter/source/dmapper/DomainMapper_Impl.cxx | 27 |
1 files changed, 14 insertions, 13 deletions
diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx index 855c131d2ab3..4d7d277abe68 100644 --- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx +++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx @@ -67,6 +67,7 @@ #include <com/sun/star/drawing/XControlShape.hpp> #include <com/sun/star/text/ControlCharacter.hpp> #include <com/sun/star/text/XTextColumns.hpp> + #include <oox/mathml/import.hxx> #include <GraphicHelpers.hxx> #include <dmapper/GraphicZOrderHelper.hxx> @@ -5030,18 +5031,21 @@ void DomainMapper_Impl::ApplySettingsTable() xTextDefaults->setPropertyValue(getPropertyName(PROP_PARA_LINE_SPACING), uno::makeAny(aSpacing)); } - if (m_pSettingsTable->GetZoomFactor()) + if (m_pSettingsTable->GetZoomFactor() || m_pSettingsTable->GetView()) { - 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); - + std::vector<beans::PropertyValue> aViewProps; + if (m_pSettingsTable->GetZoomFactor()) + { + aViewProps.push_back(beans::PropertyValue("ZoomFactor", -1, uno::makeAny(m_pSettingsTable->GetZoomFactor()), beans::PropertyState_DIRECT_VALUE)); + aViewProps.push_back(beans::PropertyValue("VisibleBottom", -1, uno::makeAny(sal_Int32(0)), beans::PropertyState_DIRECT_VALUE)); + aViewProps.push_back(beans::PropertyValue("ZoomType", -1, uno::makeAny(sal_Int16(0)), beans::PropertyState_DIRECT_VALUE)); + } + if (m_pSettingsTable->GetView()) + { + aViewProps.push_back(beans::PropertyValue("ShowOnlineLayout", -1, uno::makeAny(m_pSettingsTable->GetView() == NS_ooxml::LN_Value_doc_ST_View_web), beans::PropertyState_DIRECT_VALUE)); + } uno::Reference<container::XIndexContainer> xBox = document::IndexedPropertyValues::create(m_xComponentContext); - xBox->insertByIndex(sal_Int32(0), uno::makeAny(aViewProps)); + xBox->insertByIndex(sal_Int32(0), uno::makeAny(comphelper::containerToSequence(aViewProps))); uno::Reference<container::XIndexAccess> xIndexAccess(xBox, uno::UNO_QUERY); uno::Reference<document::XViewDataSupplier> xViewDataSupplier(m_xTextDocument, uno::UNO_QUERY); xViewDataSupplier->setViewData(xIndexAccess); @@ -5055,9 +5059,6 @@ void DomainMapper_Impl::ApplySettingsTable() if( m_pSettingsTable->GetEmbedSystemFonts()) xSettings->setPropertyValue( getPropertyName( PROP_EMBED_SYSTEM_FONTS ), uno::makeAny(true) ); xSettings->setPropertyValue("AddParaTableSpacing", uno::makeAny(m_pSettingsTable->GetDoNotUseHTMLParagraphAutoSpacing())); - // Web Layout. - if (m_pSettingsTable->GetView() == NS_ooxml::LN_Value_doc_ST_View_web) - xSettings->setPropertyValue("InBrowseMode", uno::makeAny(true)); if( m_pSettingsTable->GetProtectForm() ) xSettings->setPropertyValue("ProtectForm", uno::makeAny( true )); } |