[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-5.3' - sw/qa sw/source

Aron Budea aron.budea at collabora.com
Fri Jun 9 07:42:58 UTC 2017


 sw/qa/extras/ooxmlexport/ooxmlexport9.cxx |   12 ++++++++++++
 sw/qa/extras/ooxmlimport/ooxmlimport.cxx  |   12 ------------
 sw/source/filter/ww8/docxexport.cxx       |    6 ++++++
 3 files changed, 18 insertions(+), 12 deletions(-)

New commits:
commit 320179612c6dc8be39eaf27de0fc7c8575e160ff
Author: Aron Budea <aron.budea at collabora.com>
Date:   Tue Jun 6 23:10:02 2017 +0200

    tdf#99074: export Web view to DOCX
    
    ...so document saved in Web view shows in Web Layout in Word.
    
    Change-Id: If39d566be02966fe5d22f74aee46e6d5452a9451
    Reviewed-on: https://gerrit.libreoffice.org/38469
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Miklos Vajna <vmiklos at collabora.co.uk>
    Reviewed-on: https://gerrit.libreoffice.org/38587
    Tested-by: Miklos Vajna <vmiklos at collabora.co.uk>

diff --git a/sw/qa/extras/ooxmlimport/data/tdf99074.docx b/sw/qa/extras/ooxmlexport/data/tdf99074.docx
similarity index 100%
rename from sw/qa/extras/ooxmlimport/data/tdf99074.docx
rename to sw/qa/extras/ooxmlexport/data/tdf99074.docx
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx
index d1c70ba69a7c..4877c57639c2 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx
@@ -21,6 +21,7 @@
 #include <com/sun/star/graphic/XGraphic.hpp>
 #include <com/sun/star/text/HoriOrientation.hpp>
 #include <com/sun/star/text/RelOrientation.hpp>
+#include <com/sun/star/view/XViewSettingsSupplier.hpp>
 
 #include <sfx2/docfile.hxx>
 #include <sfx2/docfilt.hxx>
@@ -280,6 +281,17 @@ DECLARE_OOXMLEXPORT_TEST(testTdf106001_2, "tdf106001-2.odt")
     assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r/w:rPr/w:w","val","600");
 }
 
+DECLARE_OOXMLEXPORT_TEST(testTdf99074, "tdf99074.docx")
+{
+    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>(xViewSettings, "ShowOnlineLayout"));
+}
+
 DECLARE_OOXMLEXPORT_TEST(testTdf107104, "tdf107104.docx")
 {
     CPPUNIT_ASSERT(getShape(1)->getSize().Width > 0);
diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
index 1ce389416b2d..2e900ba0b83c 100644
--- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
+++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
@@ -47,7 +47,6 @@
 #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>
@@ -1302,17 +1301,6 @@ DECLARE_OOXMLIMPORT_TEST(testTdf98882, "tdf98882.docx")
     CPPUNIT_ASSERT_EQUAL(nFlyHeight, nContentHeight);
 }
 
-DECLARE_OOXMLIMPORT_TEST(testTdf99074, "tdf99074.docx")
-{
-    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>(xViewSettings, "ShowOnlineLayout"));
-}
-
 DECLARE_OOXMLIMPORT_TEST(testTdf100830, "tdf100830.docx")
 {
     // FillTransparence wasn't imported, this was 0.
diff --git a/sw/source/filter/ww8/docxexport.cxx b/sw/source/filter/ww8/docxexport.cxx
index 50048c8adcaa..b7cda742afb9 100644
--- a/sw/source/filter/ww8/docxexport.cxx
+++ b/sw/source/filter/ww8/docxexport.cxx
@@ -825,6 +825,12 @@ void DocxExport::WriteSettings()
             FSNS( XML_xmlns, XML_w ), "http://schemas.openxmlformats.org/wordprocessingml/2006/main",
             FSEND );
 
+    // View
+    if (pViewShell && pViewShell->GetViewOptions()->getBrowseMode())
+    {
+        pFS->singleElementNS(XML_w, XML_view, FSNS(XML_w, XML_val), "web", FSEND);
+    }
+
     // Zoom
     if (pViewShell)
     {


More information about the Libreoffice-commits mailing list