cool#15331: add a unit test

Change-Id: I31f0618717ac7c54bde598bf08653b33dc7a807f
Reviewed-on: https://gerrit.collaboraoffice.com/c/core/+/204
Tested-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
(cherry picked from commit 170391fc3cf26c48647681cb7a5d9f861df99309)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/203635
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
This commit is contained in:
Mike Kaganski
2026-04-16 08:57:42 +02:00
committed by Xisco Fauli
parent d7b5a9deea
commit 5062e5faaf
3 changed files with 15 additions and 1 deletions
+1 -1
View File
@@ -708,7 +708,7 @@ public:
/// Update content of all charts for table with given name.
void UpdateCharts( const UIName& rName );
OUString GetCurWord() const;
SW_DLLPUBLIC OUString GetCurWord() const; // used in CppunitTest_sw_uiwriter9
/** Glossary from glossary document in current document.
Styles only if not already existent. */
+14
View File
@@ -1864,6 +1864,20 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest9, testTdf168355)
CPPUNIT_ASSERT_EQUAL(sal_uInt16(1), pPageFrm->GetVirtPageNum());
}
CPPUNIT_TEST_FIXTURE(SwUiWriterTest9, testSplitFloattableGetCurWord)
{
// Given a document with a floating table that splits across pages: the anchor paragraph has
// text; it's split together with its floating table; and its first frame has no SwParaPortion
// (only the last follow frame has it).
createSwDoc("floattable-nosection-7in.docx");
SwWrtShell* pWrtShell = getSwDocShell()->GetWrtShell();
// Go to end (the anchor paragraph for the floating table)
pWrtShell->SttEndDoc(/*bStt=*/false);
// Without the fix this would crash
CPPUNIT_ASSERT_EQUAL(u"End"_ustr, pWrtShell->GetCurWord());
}
} // end of anonymous namespace
CPPUNIT_PLUGIN_IMPLEMENT();