sw/qa/extras/ww8import/data/bnc875715.doc |binary sw/qa/extras/ww8import/ww8import.cxx | 8 ++++++ sw/source/filter/ww8/ww8par.cxx | 37 +++++++++++++++--------------- 3 files changed, 27 insertions(+), 18 deletions(-)
New commits: commit 970883e70cfed3bfddd424aa897377f14ddbd667 Author: LuboÅ¡ LuÅák <l.lu...@collabora.com> Date: Tue Jun 24 14:14:14 2014 +0200 fix reading of section margins (bnc#875715) The reason the section ended up with incorrect margins was because that is computed as 'page margin' - 'section offset', and the order of setting these up was backwards: First InsertSection() created the section using the page margin of the old page, and only afterwards SetSwFmtPageDesc() set the page margin that should be used. Conflicts: sw/source/filter/ww8/ww8par.cxx Change-Id: I18ddcb0b5928879a2297b6caca766eab979abd45 Reviewed-on: https://gerrit.libreoffice.org/9879 Reviewed-by: Caolán McNamara <caol...@redhat.com> Tested-by: Caolán McNamara <caol...@redhat.com> diff --git a/sw/qa/extras/ww8import/data/bnc875715.doc b/sw/qa/extras/ww8import/data/bnc875715.doc new file mode 100644 index 0000000..af15e14 Binary files /dev/null and b/sw/qa/extras/ww8import/data/bnc875715.doc differ diff --git a/sw/qa/extras/ww8import/ww8import.cxx b/sw/qa/extras/ww8import/ww8import.cxx index dea54e5..db1ca82 100644 --- a/sw/qa/extras/ww8import/ww8import.cxx +++ b/sw/qa/extras/ww8import/ww8import.cxx @@ -270,6 +270,14 @@ DECLARE_WW8IMPORT_TEST(testBnc863018, "bnc863018.doc") CPPUNIT_ASSERT_EQUAL(sal_Int32(5002), getProperty<sal_Int32>(xTable, "TopMargin")); } +DECLARE_WW8IMPORT_TEST(testBnc875715, "bnc875715.doc") +{ + uno::Reference<text::XTextSectionsSupplier> xTextSectionsSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference<container::XIndexAccess> xSections(xTextSectionsSupplier->getTextSections(), uno::UNO_QUERY); + // Was incorrectly set as -1270. + CPPUNIT_ASSERT_EQUAL(0, getProperty<sal_Int32>(xSections->getByIndex(0), "SectionLeftMargin")); +} + #endif CPPUNIT_PLUGIN_IMPLEMENT(); diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx index 0725a9a..7312c7b 100644 --- a/sw/source/filter/ww8/ww8par.cxx +++ b/sw/source/filter/ww8/ww8par.cxx @@ -4495,24 +4495,6 @@ void wwSectionManager::InsertSegments() aSectPaM.GetPoint()->nContent.Assign( aSectPaM.GetCntntNode(), 0); - // End getting the bounds of this section, quite a job eh? - SwSectionFmt *pRet = InsertSection(aSectPaM, *aIter); - // The last section if continous is always unbalanced - if (pRet) - { - // Set the columns to be UnBalanced if that compatability option is set - if (mrReader.pWDop->fNoColumnBalance) - pRet->SetFmtAttr(SwFmtNoBalancedColumns(true)); - else - { - // Otherwise set to unbalanced if the following section is - // not continuous, (which also means that the last section - // is unbalanced) - if (aNext == aEnd || !aNext->IsContinuous()) - pRet->SetFmtAttr(SwFmtNoBalancedColumns(true)); - } - } - bool bHasOwnHdFt = false; /* In this nightmare scenario the continuous section has its own @@ -4558,6 +4540,25 @@ void wwSectionManager::InsertSegments() aIter->mpPage = pOrig; } } + + // End getting the bounds of this section, quite a job eh? + SwSectionFmt *pRet = InsertSection(aSectPaM, *aIter); + // The last section if continous is always unbalanced + if (pRet) + { + // Set the columns to be UnBalanced if that compatability option is set + if (mrReader.pWDop->fNoColumnBalance) + pRet->SetFmtAttr(SwFmtNoBalancedColumns(true)); + else + { + // Otherwise set to unbalanced if the following section is + // not continuous, (which also means that the last section + // is unbalanced) + if (aNext == aEnd || !aNext->IsContinuous()) + pRet->SetFmtAttr(SwFmtNoBalancedColumns(true)); + } + } + } if (pTxtNd)
_______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits