Kaydet (Commit) 0e863f55 authored tarafından Justin Luth's avatar Justin Luth Kaydeden (comit) Miklos Vajna

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: 's avatarJustin Luth <justin_luth@sil.org>
(cherry picked from commit 84fefd7c)
Reviewed-on: https://gerrit.libreoffice.org/66217Reviewed-by: 's avatarMiklos Vajna <vmiklos@collabora.com>
üst b8dbfe00
......@@ -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>
......@@ -28,12 +29,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")
......
......@@ -4496,7 +4496,7 @@ void wwSectionManager::InsertSegments()
descriptor.
*/
bool bIgnoreCols = false;
bool bIgnoreCols = bInsertSection;
bool bThisAndNextAreCompatible = (aNext == aEnd) ||
((aIter->GetPageWidth() == aNext->GetPageWidth()) &&
(aIter->GetPageHeight() == aNext->GetPageHeight()) &&
......
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