summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAron Budea <aron.budea@collabora.com>2017-06-06 23:10:02 +0200
committerAndras Timar <andras.timar@collabora.com>2017-06-10 15:57:21 +0200
commit470c2926e863a41e68adef31d7cb0ba9266dbd5f (patch)
tree0778d239ac355d0960250dc3359b7f31475530e2
parent6b978332b603f1dd4ded536d4ab3150a95e2e8a3 (diff)
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@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> (cherry picked from commit 4df450c276a7895c24ed022a23d236cd88dbad1c) Reviewed-on: https://gerrit.libreoffice.org/38564 Reviewed-by: Andras Timar <andras.timar@collabora.com>
-rw-r--r--sw/qa/extras/ooxmlexport/data/tdf99074.docx (renamed from sw/qa/extras/ooxmlimport/data/tdf99074.docx)bin12608 -> 12608 bytes
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlexport9.cxx12
-rw-r--r--sw/qa/extras/ooxmlimport/ooxmlimport.cxx12
-rw-r--r--sw/source/filter/ww8/docxexport.cxx6
4 files changed, 18 insertions, 12 deletions
diff --git a/sw/qa/extras/ooxmlimport/data/tdf99074.docx b/sw/qa/extras/ooxmlexport/data/tdf99074.docx
index d7be418fb153..d7be418fb153 100644
--- a/sw/qa/extras/ooxmlimport/data/tdf99074.docx
+++ b/sw/qa/extras/ooxmlexport/data/tdf99074.docx
Binary files differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx
index 66711fbc21e3..38582f9f93f0 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx
@@ -22,6 +22,7 @@
#include <com/sun/star/style/PageStyleLayout.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>
@@ -488,6 +489,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(testDefaultSectBreakCols, "default-sect-break-cols.docx")
{
// First problem: the first two paragraphs did not have their own text section, so the whole document had two columns.
diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
index 3610004c1d0d..45ddf31920b4 100644
--- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
+++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
@@ -47,7 +47,6 @@
#include <com/sun/star/style/ParagraphAdjust.hpp>
#include <com/sun/star/text/SizeType.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>
@@ -1207,17 +1206,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 b765a99b7f8d..67d96a7e362d 100644
--- a/sw/source/filter/ww8/docxexport.cxx
+++ b/sw/source/filter/ww8/docxexport.cxx
@@ -839,6 +839,12 @@ void DocxExport::WriteSettings()
FSNS( XML_xmlns, XML_w ), OUStringToOString(m_pFilter->getNamespaceURL(OOX_NS(doc)), RTL_TEXTENCODING_UTF8).getStr(),
FSEND );
+ // View
+ if (pViewShell && pViewShell->GetViewOptions()->getBrowseMode())
+ {
+ pFS->singleElementNS(XML_w, XML_view, FSNS(XML_w, XML_val), "web", FSEND);
+ }
+
// Zoom
if (pViewShell)
{