[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.0' - sw/qa sw/source
Justin Luth (via logerrit)
logerrit at kemper.freedesktop.org
Tue Jun 4 13:18:50 UTC 2019
sw/qa/extras/ww8import/ww8import.cxx | 16 ++++++++++++++--
sw/source/filter/ww8/ww8par.cxx | 2 +-
2 files changed, 15 insertions(+), 3 deletions(-)
New commits:
commit 676ce0ce2a278a75c92fb5916f4add373f46f88d
Author: Justin Luth <justin_luth at sil.org>
AuthorDate: Fri Jan 11 13:01:26 2019 +0300
Commit: Aron Budea <aron.budea at collabora.com>
CommitDate: Tue Jun 4 14:46:40 2019 +0200
tdf#120145 ww8import: ignoreCols if section is inserted
Otherwise, the column setting is duplicated both in the section
and in the page style.
Change-Id: I14383c646e709a3653f1054f0d4170a2963529c1
Reviewed-on: https://gerrit.libreoffice.org/66151
Tested-by: Jenkins
Reviewed-by: Justin Luth <justin_luth at sil.org>
(cherry picked from commit 84fefd7c295fc05499ca222dff50c2fe4e0fb27e)
Reviewed-on: https://gerrit.libreoffice.org/66217
Reviewed-by: Miklos Vajna <vmiklos at collabora.com>
(cherry picked from commit 0e863f5529318e07f46568150e489cb0bef9b616)
diff --git a/sw/qa/extras/ww8import/ww8import.cxx b/sw/qa/extras/ww8import/ww8import.cxx
index 31cfce841d3c..abbdedbea194 100644
--- a/sw/qa/extras/ww8import/ww8import.cxx
+++ b/sw/qa/extras/ww8import/ww8import.cxx
@@ -9,6 +9,7 @@
#include <swmodeltestbase.hxx>
+#include <com/sun/star/text/XTextColumns.hpp>
#include <com/sun/star/text/XTextTablesSupplier.hpp>
#include <ndtxt.hxx>
#include <viscrs.hxx>
@@ -33,12 +34,23 @@ DECLARE_WW8IMPORT_TEST(testFloatingTableSectionMargins, "floating-table-section-
{
sal_Int32 pageLeft = parseDump("/root/page[2]/infos/bounds", "left").toInt32();
sal_Int32 pageWidth = parseDump("/root/page[2]/infos/bounds", "width").toInt32();
- sal_Int32 tableLeft = parseDump("/root/page[2]/body/column/body/section/column/body/txt[2]/anchored/fly/tab/infos/bounds", "left").toInt32();
- sal_Int32 tableWidth = parseDump("/root/page[2]/body/column/body/section/column/body/txt[2]/anchored/fly/tab/infos/bounds", "width").toInt32();
+ sal_Int32 tableLeft = parseDump("//tab/infos/bounds", "left").toInt32();
+ sal_Int32 tableWidth = parseDump("//tab/infos/bounds", "width").toInt32();
CPPUNIT_ASSERT( pageWidth > 0 );
CPPUNIT_ASSERT( tableWidth > 0 );
// The table's resulting position should be roughly centered.
CPPUNIT_ASSERT( abs(( pageLeft + pageWidth / 2 ) - ( tableLeft + tableWidth / 2 )) < 20 );
+
+ uno::Reference<beans::XPropertySet> xTextSection = getProperty< uno::Reference<beans::XPropertySet> >(getParagraph(2), "TextSection");
+ CPPUNIT_ASSERT(xTextSection.is());
+ uno::Reference<text::XTextColumns> xTextColumns = getProperty< uno::Reference<text::XTextColumns> >(xTextSection, "TextColumns");
+ OUString pageStyleName = getProperty<OUString>(getParagraph(2), "PageStyleName");
+ uno::Reference<style::XStyle> pageStyle( getStyles("PageStyles")->getByName(pageStyleName), uno::UNO_QUERY);
+ uno::Reference<beans::XPropertySet> xPageStyle(getStyles("PageStyles")->getByName(pageStyleName), uno::UNO_QUERY);
+ uno::Reference<text::XTextColumns> xPageColumns = getProperty< uno::Reference<text::XTextColumns> >(xPageStyle, "TextColumns");
+
+ //either one or the other should get the column's, not both.
+ CPPUNIT_ASSERT( xTextColumns->getColumnCount() != xPageColumns->getColumnCount());
}
DECLARE_WW8IMPORT_TEST(testN816593, "n816593.doc")
diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx
index b09cf7ded47f..ad340445d383 100644
--- a/sw/source/filter/ww8/ww8par.cxx
+++ b/sw/source/filter/ww8/ww8par.cxx
@@ -4480,7 +4480,7 @@ void wwSectionManager::InsertSegments()
descriptor.
*/
- bool bIgnoreCols = false;
+ bool bIgnoreCols = bInsertSection;
bool bThisAndNextAreCompatible = (aNext == aEnd) ||
((aIter->GetPageWidth() == aNext->GetPageWidth()) &&
(aIter->GetPageHeight() == aNext->GetPageHeight()) &&
More information about the Libreoffice-commits
mailing list