dev/null                             |binary
 sw/qa/extras/ww8import/ww8import.cxx |   23 -----------------------
 sw/source/filter/ww8/ww8par.cxx      |    3 ---
 3 files changed, 26 deletions(-)

New commits:
commit df00cd5cf77eb2322f53b80296862940ba815d9a
Author:     Paris Oplopoios <paris.oplopo...@collabora.com>
AuthorDate: Tue Jul 18 01:58:14 2023 +0300
Commit:     Paris Oplopoios <parisop...@gmail.com>
CommitDate: Tue Jul 18 17:54:37 2023 +0200

    Revert "ww8import create a pagedesc if continuous section changes margins"
    
    This reverts commit c5ed52b1cd6f22787c94bec035ceecf9e1da3271.
    
    The reverted commit would insert a pagebreak on section breaks if the
    margin before and after the section break was different. While this
    means a table after the section break will get the correct margin, it
    would also create a page which is very breaking - it shouldn't be the
    case in documents that have multiple continuous section breaks in a
    single page that a new page is created for each of those breaks if the
    margins are different - there are documents where this happens and in
    those documents a single page gets converted to multiple messy pages.
    Thus the table margins being correct after a section break with a margin
    change should be fixed in a different way.
    
    Change-Id: Ia5d5b98ddbd021803a6a9f80762b97db5808509f
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154565
    Tested-by: Jenkins
    Tested-by: Paris Oplopoios <parisop...@gmail.com>
    Reviewed-by: Paris Oplopoios <parisop...@gmail.com>

diff --git a/sw/qa/extras/ww8import/data/floating-table-section-margins.doc 
b/sw/qa/extras/ww8import/data/floating-table-section-margins.doc
deleted file mode 100644
index f414be7f1ec8..000000000000
Binary files a/sw/qa/extras/ww8import/data/floating-table-section-margins.doc 
and /dev/null differ
diff --git a/sw/qa/extras/ww8import/ww8import.cxx 
b/sw/qa/extras/ww8import/ww8import.cxx
index 82b4c74253dd..47a9e41f5352 100644
--- a/sw/qa/extras/ww8import/ww8import.cxx
+++ b/sw/qa/extras/ww8import/ww8import.cxx
@@ -37,29 +37,6 @@ public:
     }
 };
 
-CPPUNIT_TEST_FIXTURE(Test, testFloatingTableSectionMargins)
-{
-    createSwDoc("floating-table-section-margins.doc");
-    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("//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<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());
-}
-
 CPPUNIT_TEST_FIXTURE(Test, testN816593)
 {
     createSwDoc("n816593.doc");
diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx
index abd7cf4c0345..04c00b90b78e 100644
--- a/sw/source/filter/ww8/ww8par.cxx
+++ b/sw/source/filter/ww8/ww8par.cxx
@@ -4527,9 +4527,6 @@ void wwSectionManager::InsertSegments()
 
         bool bInsertSection = (aIter != aStart) && aIter->IsContinuous() &&  
bThisAndPreviousAreCompatible;
         bool bInsertPageDesc = !bInsertSection;
-        // HACK Force new pagedesc if left/right margins change, otherwise 
e.g. floating tables may be anchored improperly.
-        if( aIter->maSep.dxaLeft != aPrev->maSep.dxaLeft || 
aIter->maSep.dxaRight != aPrev->maSep.dxaRight )
-            bInsertPageDesc = true;
         bool bProtected = SectionIsProtected(*aIter); // do we really  need 
this ?? I guess I have a different logic in editshell which disables this...
 
         if (bInsertPageDesc)

Reply via email to