summaryrefslogtreecommitdiff
path: root/sw/qa
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2017-01-18 18:25:46 +0100
committerMichael Stahl <mstahl@redhat.com>2017-01-18 22:05:09 +0100
commit2dce8dd41c208ecda40c054635f3736147ec8914 (patch)
tree20972c5ed1f89123cbea290e7f9f4a31cc6c1fd8 /sw/qa
parent7667675397c98bb38cdd14dd689a32e9f8a986d3 (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. Change-Id: I842845d09a7b3fe81e27a1ed8ac8a8594da7f4e8
Diffstat (limited to 'sw/qa')
-rw-r--r--sw/qa/extras/ooxmlimport/ooxmlimport.cxx10
1 files changed, 7 insertions, 3 deletions
diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
index 97a0991eab72..786c686570f7 100644
--- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
+++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
@@ -46,6 +46,7 @@
#include <com/sun/star/text/SizeType.hpp>
#include <com/sun/star/style/PageStyleLayout.hpp>
#include <com/sun/star/util/DateTime.hpp>
+#include <com/sun/star/view/XViewSettingsSupplier.hpp>
#include <com/sun/star/document/XFilter.hpp>
#include <com/sun/star/document/XImporter.hpp>
#include <vcl/bitmapaccess.hxx>
@@ -1321,10 +1322,13 @@ DECLARE_OOXMLIMPORT_TEST(testTdf98882, "tdf98882.docx")
DECLARE_OOXMLIMPORT_TEST(testTdf99074, "tdf99074.docx")
{
- uno::Reference<lang::XMultiServiceFactory> xFactory(mxComponent, uno::UNO_QUERY);
- uno::Reference<uno::XInterface> xSettings = xFactory->createInstance("com.sun.star.document.Settings");
+ uno::Reference<frame::XModel> xModel(mxComponent, uno::UNO_QUERY);
+ uno::Reference<view::XViewSettingsSupplier> const xController(
+ 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>(xSettings, "InBrowseMode"));
+ CPPUNIT_ASSERT(getProperty<bool>(xViewSettings, "ShowOnlineLayout"));
}
DECLARE_OOXMLIMPORT_TEST(testTdf100830, "tdf100830.docx")