summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlexport4.cxx12
-rw-r--r--sw/source/core/layout/flowfrm.cxx5
2 files changed, 13 insertions, 4 deletions
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport4.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport4.cxx
index bc2eab2788df..a6282d6e3f64 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport4.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport4.cxx
@@ -362,9 +362,15 @@ DECLARE_OOXMLEXPORT_TEST(testColumnBreak_ColumnCountIsZero,"fdo74153.docx")
* The <w:br w:type="column" /> was missing after roundtrip
*/
xmlDocPtr pXmlDoc = parseExport("word/document.xml");
- if (!pXmlDoc)
- return;
- assertXPath(pXmlDoc, "/w:document/w:body/w:p[3]/w:r[1]/w:br","type","column");
+ if (pXmlDoc)
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[3]/w:r[1]/w:br","type","column");
+
+ //tdf76349 match Word's behavior of treating breaks in single columns as page breaks.
+ uno::Reference<frame::XModel> xModel(mxComponent, uno::UNO_QUERY);
+ uno::Reference<text::XTextViewCursorSupplier> xTextViewCursorSupplier(xModel->getCurrentController(), uno::UNO_QUERY);
+ uno::Reference<text::XPageCursor> xCursor(xTextViewCursorSupplier->getViewCursor(), uno::UNO_QUERY);
+ xCursor->jumpToLastPage();
+ CPPUNIT_ASSERT_EQUAL(sal_Int16(2), xCursor->getPage());
}
DECLARE_OOXMLEXPORT_TEST(testIndentation, "test_indentation.docx")
diff --git a/sw/source/core/layout/flowfrm.cxx b/sw/source/core/layout/flowfrm.cxx
index 7946f5b29c4c..dad6f97c0a89 100644
--- a/sw/source/core/layout/flowfrm.cxx
+++ b/sw/source/core/layout/flowfrm.cxx
@@ -1127,8 +1127,11 @@ bool SwFlowFrame::IsPageBreak( bool bAct ) const
return false;
}
+ //for compatibility, also break at column break if no columns exist
const SvxBreak eBreak = pSet->GetBreak().GetBreak();
- if ( eBreak == SVX_BREAK_PAGE_BEFORE || eBreak == SVX_BREAK_PAGE_BOTH )
+ if ( eBreak == SVX_BREAK_PAGE_BEFORE ||
+ eBreak == SVX_BREAK_PAGE_BOTH ||
+ (eBreak == SVX_BREAK_COLUMN_BEFORE && !m_rThis.FindColFrame()) )
return true;
else
{