Kaydet (Commit) ffb4d7b1 authored tarafından Jan Holesovsky's avatar Jan Holesovsky

Word 2013 and 2016 does not honor the <w:view> setting, let's ignore it too.

In other words, let's open documents in the non-web view even when saved with
<w:view w:val="web"/>.

The behavior I see in Word 2013 (and it's documented that his happens in 2016
too) is that the setting is not a document setting any more, but user's
setting.  Ie. regardless of what is written in the file, the .docx document
opens in the Print Layout if the Word was in the Print Layout until now, and
in the Web Layout if it was that mode.

We handle the non-web layout much better than the web layout, so let's just
default to the normal layout on load.

Change-Id: Ieba7ddc280b9b79501a6b89ff21b03a86356583c
Reviewed-on: https://gerrit.libreoffice.org/42414Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarJan Holesovsky <kendy@collabora.com>
üst 0ecd541c
......@@ -735,8 +735,11 @@ DECLARE_OOXMLEXPORT_TEST(testTdf99074, "tdf99074.docx")
xModel->getCurrentController(), uno::UNO_QUERY);
uno::Reference<beans::XPropertySet> const xViewSettings(
xController->getViewSettings());
// This was false, Web Layout was ignored on import.
CPPUNIT_ASSERT(getProperty<bool>(xViewSettings, "ShowOnlineLayout"));
// The behavior changed - Word 2013 and 2016 ignore this setting on
// import, and instead honor the user's setting.
// Let's ignore the <w:view w:val="web"/> too.
CPPUNIT_ASSERT(!getProperty<bool>(xViewSettings, "ShowOnlineLayout"));
}
DECLARE_OOXMLEXPORT_TEST(testDefaultSectBreakCols, "default-sect-break-cols.docx")
......
......@@ -5231,10 +5231,6 @@ void DomainMapper_Impl::ApplySettingsTable()
aViewProps.emplace_back("VisibleBottom", -1, uno::makeAny(sal_Int32(0)), beans::PropertyState_DIRECT_VALUE);
aViewProps.emplace_back("ZoomType", -1, uno::makeAny(sal_Int16(0)), beans::PropertyState_DIRECT_VALUE);
}
if (m_pSettingsTable->GetView())
{
aViewProps.emplace_back("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(comphelper::containerToSequence(aViewProps)));
uno::Reference<container::XIndexAccess> xIndexAccess(xBox, uno::UNO_QUERY);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment