summaryrefslogtreecommitdiff
path: root/sw/qa/extras/uiwriter/uiwriter.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'sw/qa/extras/uiwriter/uiwriter.cxx')
-rw-r--r--sw/qa/extras/uiwriter/uiwriter.cxx283
1 files changed, 264 insertions, 19 deletions
diff --git a/sw/qa/extras/uiwriter/uiwriter.cxx b/sw/qa/extras/uiwriter/uiwriter.cxx
index 7e28d0f57ead..d01f6260c8fe 100644
--- a/sw/qa/extras/uiwriter/uiwriter.cxx
+++ b/sw/qa/extras/uiwriter/uiwriter.cxx
@@ -129,6 +129,9 @@
#include <iodetect.hxx>
#include <wrthtml.hxx>
#include <dbmgr.hxx>
+#include <swdtflvr.hxx>
+#include <sortedobjs.hxx>
+#include <txtfrm.hxx>
namespace
{
@@ -590,7 +593,7 @@ public:
CPPUNIT_TEST(testTdf59666);
CPPUNIT_TEST_SUITE_END();
-private:
+protected:
SwDoc* createDoc(const char* pName = nullptr);
std::unique_ptr<SwTextBlocks> readDOCXAutotext(const OUString& sFileName, bool bEmpty = false);
};
@@ -1271,7 +1274,7 @@ void SwUiWriterTest::testFdo74981()
SwDoc* pDoc = createDoc();
SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell();
SwInputField aField(static_cast<SwInputFieldType*>(pWrtShell->GetFieldType(0, SwFieldIds::Input)), "foo", "bar", 0, 0);
- pWrtShell->Insert(aField);
+ pWrtShell->InsertField2(aField);
{
// expect hints
@@ -1302,10 +1305,10 @@ void SwUiWriterTest::testTdf98512()
SwInputFieldType *const pType(static_cast<SwInputFieldType*>(
pWrtShell->GetFieldType(0, SwFieldIds::Input)));
SwInputField aField1(pType, "foo", "bar", INP_TXT, 0);
- pWrtShell->Insert(aField1);
+ pWrtShell->InsertField2(aField1);
pWrtShell->SttEndDoc(/*bStt=*/true);
SwInputField aField2(pType, "baz", "quux", INP_TXT, 0);
- pWrtShell->Insert(aField2);
+ pWrtShell->InsertField2(aField2);
pWrtShell->SttEndDoc(/*bStt=*/true);
pWrtShell->SetMark();
pWrtShell->SttEndDoc(/*bStt=*/false);
@@ -1783,7 +1786,7 @@ void SwUiWriterTest::testBookmarkUndo()
CPPUNIT_ASSERT(bool(pMarkAccess->findMark("Mark") == pMarkAccess->getAllMarksEnd()));
CPPUNIT_ASSERT(pMarkAccess->findMark("Mark_") != pMarkAccess->getAllMarksEnd());
- pMarkAccess->deleteMark( pMarkAccess->findMark("Mark_") );
+ pMarkAccess->deleteMark(pMarkAccess->findMark("Mark_"), false);
CPPUNIT_ASSERT_EQUAL(sal_Int32(0), pMarkAccess->getAllMarksCount());
rUndoManager.Undo();
CPPUNIT_ASSERT_EQUAL(sal_Int32(1), pMarkAccess->getAllMarksCount());
@@ -2001,7 +2004,7 @@ void SwUiWriterTest::testTdf51741()
CPPUNIT_ASSERT(bool(pMarkAccess->findMark("Mark") == pMarkAccess->getAllMarksEnd()));
CPPUNIT_ASSERT(pMarkAccess->findMark("Mark_") != pMarkAccess->getAllMarksEnd());
//Modification 7
- pMarkAccess->deleteMark( pMarkAccess->findMark("Mark_") );
+ pMarkAccess->deleteMark(pMarkAccess->findMark("Mark_"), false);
CPPUNIT_ASSERT(pWrtShell->IsModified());
pWrtShell->ResetModified();
CPPUNIT_ASSERT_EQUAL(sal_Int32(0), pMarkAccess->getAllMarksCount());
@@ -2756,14 +2759,14 @@ void SwUiWriterTest::testTdf77342()
pWrtShell->StartOfSection();
//inserting reference field 1
SwGetRefField aField1(pRefType, "", "", REF_FOOTNOTE, sal_uInt16(0), REF_CONTENT);
- pWrtShell->Insert(aField1);
+ pWrtShell->InsertField2(aField1);
//inserting second footnote
pWrtShell->InsertFootnote("");
pWrtShell->StartOfSection();
pCursor->Move(fnMoveForward);
//inserting reference field 2
SwGetRefField aField2(pRefType, "", "", REF_FOOTNOTE, sal_uInt16(1), REF_CONTENT);
- pWrtShell->Insert(aField2);
+ pWrtShell->InsertField2(aField2);
//inserting third footnote
pWrtShell->InsertFootnote("");
pWrtShell->StartOfSection();
@@ -2771,7 +2774,7 @@ void SwUiWriterTest::testTdf77342()
pCursor->Move(fnMoveForward);
//inserting reference field 3
SwGetRefField aField3(pRefType, "", "", REF_FOOTNOTE, sal_uInt16(2), REF_CONTENT);
- pWrtShell->Insert(aField3);
+ pWrtShell->InsertField2(aField3);
//updating the fields
IDocumentFieldsAccess& rField(pDoc->getIDocumentFieldsAccess());
rField.UpdateExpFields(nullptr, true);
@@ -2992,38 +2995,38 @@ void SwUiWriterTest::testTdf63553()
//inserting sequence field 1
SwSetExpFieldType* pSeqType = static_cast<SwSetExpFieldType*>(pWrtShell->GetFieldType(SwFieldIds::SetExp, "Illustration"));
SwSetExpField aSetField1(pSeqType, "", SVX_NUM_ARABIC);
- pWrtShell->Insert(aSetField1);
+ pWrtShell->InsertField2(aSetField1);
SwGetRefFieldType* pRefType = static_cast<SwGetRefFieldType*>(pWrtShell->GetFieldType(0, SwFieldIds::GetRef));
//moving cursor to the starting of document
pWrtShell->StartOfSection();
//inserting reference field 1
SwGetRefField aGetField1(pRefType, "Illustration", "", REF_SEQUENCEFLD, sal_uInt16(0), REF_CONTENT);
- pWrtShell->Insert(aGetField1);
+ pWrtShell->InsertField2(aGetField1);
//now we have ref1-seq1
//moving the cursor
pCursor->Move(fnMoveForward);
//inserting sequence field 2
SwSetExpField aSetField2(pSeqType, "", SVX_NUM_ARABIC);
- pWrtShell->Insert(aSetField2);
+ pWrtShell->InsertField2(aSetField2);
//moving the cursor
pWrtShell->StartOfSection();
pCursor->Move(fnMoveForward);
//inserting reference field 2
SwGetRefField aGetField2(pRefType, "Illustration", "", REF_SEQUENCEFLD, sal_uInt16(1), REF_CONTENT);
- pWrtShell->Insert(aGetField2);
+ pWrtShell->InsertField2(aGetField2);
//now we have ref1-ref2-seq1-seq2
//moving the cursor
pCursor->Move(fnMoveForward);
pCursor->Move(fnMoveForward);
//inserting sequence field 3
SwSetExpField aSetField3(pSeqType, "", SVX_NUM_ARABIC);
- pWrtShell->Insert(aSetField3);
+ pWrtShell->InsertField2(aSetField3);
pWrtShell->StartOfSection();
pCursor->Move(fnMoveForward);
pCursor->Move(fnMoveForward);
//inserting reference field 3
SwGetRefField aGetField3(pRefType, "Illustration", "", REF_SEQUENCEFLD, sal_uInt16(2), REF_CONTENT);
- pWrtShell->Insert(aGetField3);
+ pWrtShell->InsertField2(aGetField3);
//now after insertion we have ref1-ref2-ref3-seq1-seq2-seq3
//updating the fields
IDocumentFieldsAccess& rField(pDoc->getIDocumentFieldsAccess());
@@ -3831,7 +3834,7 @@ void SwUiWriterTest::testUndoDelAsCharTdf107512()
CPPUNIT_ASSERT(rIDCO.InsertGraphicObject(*pShell->GetCursor(), grf, &frameSet, &grfSet));
CPPUNIT_ASSERT_EQUAL(size_t(2), pDoc->GetFlyCount(FLYCNTTYPE_GRF));
SvxCharHiddenItem hidden(true, RES_CHRATR_HIDDEN);
- pShell->SelectText(1, 4);
+ pShell->SelectTextModel(1, 4);
rIDCO.InsertPoolItem(*pShell->GetCursor(), hidden);
// now we have "\1foo\1" with the "foo" hidden
CPPUNIT_ASSERT(pShell->GetCursor()->GetNode().GetTextNode()->GetTextAttrForCharAt(0, RES_TXTATR_FLYCNT));
@@ -3845,7 +3848,7 @@ void SwUiWriterTest::testUndoDelAsCharTdf107512()
query.ClearItem(RES_CHRATR_HIDDEN);
// delete from the start
- pShell->SelectText(0, 4);
+ pShell->SelectTextModel(0, 4);
rIDCO.DeleteAndJoin(*pShell->GetCursor());
CPPUNIT_ASSERT(pShell->GetCursor()->GetNode().GetTextNode()->GetTextAttrForCharAt(0, RES_TXTATR_FLYCNT));
CPPUNIT_ASSERT_EQUAL(size_t(1), pDoc->GetFlyCount(FLYCNTTYPE_GRF));
@@ -3888,7 +3891,7 @@ void SwUiWriterTest::testUndoDelAsCharTdf107512()
query.ClearItem(RES_CHRATR_HIDDEN);
// delete from the end
- pShell->SelectText(1, 5);
+ pShell->SelectTextModel(1, 5);
rIDCO.DeleteAndJoin(*pShell->GetCursor());
CPPUNIT_ASSERT(pShell->GetCursor()->GetNode().GetTextNode()->GetTextAttrForCharAt(0, RES_TXTATR_FLYCNT));
CPPUNIT_ASSERT_EQUAL(size_t(1), pDoc->GetFlyCount(FLYCNTTYPE_GRF));
@@ -4147,6 +4150,229 @@ static void lcl_dispatchCommand(const uno::Reference<lang::XComponent>& xCompone
xDispatchHelper->executeDispatch(xFrame, rCommand, OUString(), 0, rPropertyValues);
}
+CPPUNIT_TEST_FIXTURE(SwUiWriterTest, testTdf149548)
+{
+ SwDoc* pDoc = createDoc("forum-mso-en-13192-min.docx");
+
+ for (SwRangeRedline const*const pRedline : pDoc->getIDocumentRedlineAccess().GetRedlineTable())
+ {
+ if (pRedline->GetType() == RedlineType::Delete)
+ {
+ int nLevel(0);
+ for (SwNodeIndex index = pRedline->Start()->nNode; index <= pRedline->End()->nNode; ++index)
+ {
+ switch (index.GetNode().GetNodeType())
+ {
+ case SwNodeType::Start:
+ case SwNodeType::Table:
+ case SwNodeType::Section:
+ ++nLevel;
+ break;
+ case SwNodeType::End:
+ CPPUNIT_ASSERT_MESSAGE("bad overlapping redline", nLevel != 0);
+ --nLevel;
+ break;
+ default:
+ break;
+ }
+ }
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("bad overlapping redline", int(0), nLevel);
+ }
+ }
+
+ SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell();
+
+ lcl_dispatchCommand(mxComponent, ".uno:SelectAll", {});
+
+ rtl::Reference<SwTransferable> pTransfer = new SwTransferable(*pWrtShell);
+ pTransfer->Copy();
+
+ TransferableDataHelper aHelper(pTransfer.get());
+ // this was a use-after-free on nodes deleted by Copy
+ SwTransferable::Paste(*pWrtShell, aHelper);
+}
+
+CPPUNIT_TEST_FIXTURE(SwUiWriterTest, testTdf149595)
+{
+ SwDoc* pDoc = createDoc("demo91.fodt");
+
+ SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell();
+
+ // all 4 shapes are on the 2nd paragraph
+ CPPUNIT_ASSERT(pWrtShell->GetLayout()->GetLower()->GetLower()->GetLower()->GetDrawObjs() == nullptr);
+ CPPUNIT_ASSERT(pWrtShell->GetLayout()->GetLower()->GetLower()->GetLower()->GetNext()->GetDrawObjs() != nullptr);
+ CPPUNIT_ASSERT_EQUAL(size_t(4), pWrtShell->GetLayout()->GetLower()->GetLower()->GetLower()->GetNext()->GetDrawObjs()->size());
+
+ {
+ pWrtShell->Down(false);
+ pWrtShell->EndPara(/*bSelect=*/true);
+ rtl::Reference<SwTransferable> pTransfer = new SwTransferable(*pWrtShell);
+ pTransfer->Cut();
+
+ // one shape is anchored in the middle, others at the start/end/at-para
+ CPPUNIT_ASSERT(pWrtShell->GetLayout()->GetLower()->GetLower()->GetLower()->GetDrawObjs() == nullptr);
+ CPPUNIT_ASSERT(pWrtShell->GetLayout()->GetLower()->GetLower()->GetLower()->GetNext()->GetDrawObjs() != nullptr);
+ CPPUNIT_ASSERT_EQUAL(size_t(3), pWrtShell->GetLayout()->GetLower()->GetLower()->GetLower()->GetNext()->GetDrawObjs()->size());
+
+ pWrtShell->Up(false);
+ TransferableDataHelper aHelper(pTransfer.get());
+ SwTransferable::Paste(*pWrtShell, aHelper);
+
+ CPPUNIT_ASSERT(pWrtShell->GetLayout()->GetLower()->GetLower()->GetLower()->GetDrawObjs() != nullptr);
+ CPPUNIT_ASSERT_EQUAL(size_t(1), pWrtShell->GetLayout()->GetLower()->GetLower()->GetLower()->GetDrawObjs()->size());
+ CPPUNIT_ASSERT(pWrtShell->GetLayout()->GetLower()->GetLower()->GetLower()->GetNext()->GetDrawObjs() != nullptr);
+ CPPUNIT_ASSERT_EQUAL(size_t(3), pWrtShell->GetLayout()->GetLower()->GetLower()->GetLower()->GetNext()->GetDrawObjs()->size());
+
+ pWrtShell->Undo();
+ pWrtShell->Undo();
+
+ CPPUNIT_ASSERT(pWrtShell->GetLayout()->GetLower()->GetLower()->GetLower()->GetDrawObjs() == nullptr);
+ CPPUNIT_ASSERT(pWrtShell->GetLayout()->GetLower()->GetLower()->GetLower()->GetNext()->GetDrawObjs() != nullptr);
+ CPPUNIT_ASSERT_EQUAL(size_t(4), pWrtShell->GetLayout()->GetLower()->GetLower()->GetLower()->GetNext()->GetDrawObjs()->size());
+ }
+
+ // now try the same with redlining enabled - should be the same result
+ lcl_dispatchCommand(mxComponent, ".uno:ShowTrackedChanges", {});
+ lcl_dispatchCommand(mxComponent, ".uno:TrackChanges", {});
+ {
+ pWrtShell->Down(false);
+ pWrtShell->SttPara(/*bSelect=*/false);
+ pWrtShell->EndPara(/*bSelect=*/true);
+ rtl::Reference<SwTransferable> pTransfer = new SwTransferable(*pWrtShell);
+ pTransfer->Cut();
+
+ CPPUNIT_ASSERT(pWrtShell->GetLayout()->GetLower()->GetLower()->GetLower()->GetDrawObjs() == nullptr);
+ CPPUNIT_ASSERT(pWrtShell->GetLayout()->GetLower()->GetLower()->GetLower()->GetNext()->GetDrawObjs() != nullptr);
+ // problem was that this deleted all at-char flys, even at the start/end
+ CPPUNIT_ASSERT_EQUAL(size_t(3), pWrtShell->GetLayout()->GetLower()->GetLower()->GetLower()->GetNext()->GetDrawObjs()->size());
+
+ pWrtShell->Up(false);
+ TransferableDataHelper aHelper(pTransfer.get());
+ SwTransferable::Paste(*pWrtShell, aHelper);
+
+ CPPUNIT_ASSERT(pWrtShell->GetLayout()->GetLower()->GetLower()->GetLower()->GetDrawObjs() != nullptr);
+ CPPUNIT_ASSERT_EQUAL(size_t(1), pWrtShell->GetLayout()->GetLower()->GetLower()->GetLower()->GetDrawObjs()->size());
+ CPPUNIT_ASSERT(pWrtShell->GetLayout()->GetLower()->GetLower()->GetLower()->GetNext()->GetDrawObjs() != nullptr);
+ CPPUNIT_ASSERT_EQUAL(size_t(3), pWrtShell->GetLayout()->GetLower()->GetLower()->GetLower()->GetNext()->GetDrawObjs()->size());
+
+ pWrtShell->Undo();
+ pWrtShell->Undo();
+
+ CPPUNIT_ASSERT(pWrtShell->GetLayout()->GetLower()->GetLower()->GetLower()->GetDrawObjs() == nullptr);
+ CPPUNIT_ASSERT(pWrtShell->GetLayout()->GetLower()->GetLower()->GetLower()->GetNext()->GetDrawObjs() != nullptr);
+ CPPUNIT_ASSERT_EQUAL(size_t(4), pWrtShell->GetLayout()->GetLower()->GetLower()->GetLower()->GetNext()->GetDrawObjs()->size());
+ }
+}
+
+CPPUNIT_TEST_FIXTURE(SwUiWriterTest, testTdf147220)
+{
+ SwDoc* pDoc = createDoc();
+ SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell();
+
+ pWrtShell->Insert(u"él");
+
+ // hide and enable
+ lcl_dispatchCommand(mxComponent, ".uno:ShowTrackedChanges", {});
+ lcl_dispatchCommand(mxComponent, ".uno:TrackChanges", {});
+ CPPUNIT_ASSERT(pDoc->getIDocumentRedlineAccess().IsRedlineOn());
+ CPPUNIT_ASSERT(
+ IDocumentRedlineAccess::IsShowChanges(pDoc->getIDocumentRedlineAccess().GetRedlineFlags()));
+ CPPUNIT_ASSERT(pWrtShell->GetLayout()->IsHideRedlines());
+
+ pWrtShell->GoStartSentence();
+ pWrtShell->SetMark();
+ pWrtShell->GoEndSentence();
+
+ // this did not remove the original text from the layout
+ pWrtShell->Replace(u"Él", false);
+
+ // currently the deleted text is before the replacement text, not sure if
+ // that is really required
+ CPPUNIT_ASSERT_EQUAL(OUString(u"élÉl"),
+ pWrtShell->GetCursor()->GetPoint()->nNode.GetNode().GetTextNode()->GetText());
+ CPPUNIT_ASSERT_EQUAL(OUString(u"Él"),
+ static_cast<SwTextFrame const*>(pWrtShell->GetCursor()->GetPoint()->nNode.GetNode().GetTextNode()->getLayoutFrame(nullptr))->GetText());
+
+ SwRedlineTable const& rRedlines(pDoc->getIDocumentRedlineAccess().GetRedlineTable());
+ CPPUNIT_ASSERT_EQUAL(SwRedlineTable::size_type(2), rRedlines.size());
+ CPPUNIT_ASSERT_EQUAL(RedlineType::Delete, rRedlines[0]->GetType());
+ CPPUNIT_ASSERT_EQUAL(OUString(u"él"), rRedlines[0]->GetText());
+ CPPUNIT_ASSERT_EQUAL(RedlineType::Insert, rRedlines[1]->GetType());
+ CPPUNIT_ASSERT_EQUAL(OUString(u"Él"), rRedlines[1]->GetText());
+}
+
+CPPUNIT_TEST_FIXTURE(SwUiWriterTest, testTdf135978)
+{
+ SwDoc* pDoc = createDoc();
+ SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell();
+
+ pWrtShell->Insert("foobar");
+ pWrtShell->SplitNode();
+ pWrtShell->Insert("bazquux");
+
+ CPPUNIT_ASSERT(pWrtShell->IsEndOfDoc());
+
+ SwFormatAnchor anchor(RndStdIds::FLY_AT_CHAR);
+ anchor.SetAnchor(pWrtShell->GetCursor()->GetPoint());
+ SfxItemSet flySet(pDoc->GetAttrPool(), svl::Items<RES_ANCHOR, RES_ANCHOR>{});
+ flySet.Put(anchor);
+ SwFlyFrameFormat const* pFly = dynamic_cast<SwFlyFrameFormat const*>(
+ pWrtShell->NewFlyFrame(flySet, /*bAnchValid=*/true));
+ CPPUNIT_ASSERT(pFly != nullptr);
+ CPPUNIT_ASSERT(pFly->GetFrame() != nullptr);
+ // move cursor back to body
+ pWrtShell->SttEndDoc(/*bStt=*/false);
+
+ // hide and enable
+ lcl_dispatchCommand(mxComponent, ".uno:ShowTrackedChanges", {});
+ lcl_dispatchCommand(mxComponent, ".uno:TrackChanges", {});
+
+ CPPUNIT_ASSERT(pDoc->getIDocumentRedlineAccess().IsRedlineOn());
+ CPPUNIT_ASSERT(
+ IDocumentRedlineAccess::IsShowChanges(pDoc->getIDocumentRedlineAccess().GetRedlineFlags()));
+ CPPUNIT_ASSERT(pWrtShell->GetLayout()->IsHideRedlines());
+
+ pWrtShell->Left(CRSR_SKIP_CHARS, /*bSelect=*/false, 4, /*bBasicCall=*/false);
+ pWrtShell->Left(CRSR_SKIP_CHARS, /*bSelect=*/true, 6, /*bBasicCall=*/false);
+ pWrtShell->Delete();
+
+ // now split
+ pWrtShell->SttEndDoc(/*bStt=*/true);
+ pWrtShell->SplitNode();
+ CPPUNIT_ASSERT(pFly->GetFrame() != nullptr);
+
+ // the problem was that undo removed the fly frame from the layout
+ pWrtShell->Undo();
+ CPPUNIT_ASSERT(pFly->GetFrame() != nullptr);
+
+ pWrtShell->Redo();
+ CPPUNIT_ASSERT(pFly->GetFrame() != nullptr);
+
+ pWrtShell->Undo();
+ CPPUNIT_ASSERT(pFly->GetFrame() != nullptr);
+}
+
+CPPUNIT_TEST_FIXTURE(SwUiWriterTest, testTdf139843)
+{
+ load(DATA_DIRECTORY, "tdf139843.odt");
+
+// int nPages = getPages();
+
+ lcl_dispatchCommand(mxComponent, ".uno:SelectAll", {});
+ Scheduler::ProcessEventsToIdle();
+
+ lcl_dispatchCommand(mxComponent, ".uno:Cut", {});
+ Scheduler::ProcessEventsToIdle();
+
+ CPPUNIT_ASSERT_EQUAL(1, getPages());
+
+ // Without the fix in place, this test would have crashed here
+ lcl_dispatchCommand(mxComponent, ".uno:Paste", {});
+ Scheduler::ProcessEventsToIdle();
+
+//FIXME? CPPUNIT_ASSERT_EQUAL(nPages, getPages());
+}
+
CPPUNIT_TEST_FIXTURE(SwUiWriterTest, testTdf134252)
{
load(DATA_DIRECTORY, "tdf134252.fodt");
@@ -7131,7 +7357,7 @@ void SwUiWriterTest::testTdf115013()
// Insert the field into document
SwDBField aField(pFieldType);
- pWrtShell->Insert(aField);
+ pWrtShell->InsertField2(aField);
}
// Save it as DOCX & load it again
reload("Office Open XML Text", "mm-field.docx");
@@ -7640,6 +7866,25 @@ void SwUiWriterTest::testTdf38394()
CPPUNIT_ASSERT_EQUAL(sReplaced, static_cast<SwTextNode*>(pDoc->GetNodes()[nIndex])->GetText());
}
+CPPUNIT_TEST_FIXTURE(SwUiWriterTest, testTdf148868)
+{
+ SwDoc* pDoc = createDoc("tdf148868.odt");
+ SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell();
+
+ CPPUNIT_ASSERT_EQUAL(1, getShapes());
+ CPPUNIT_ASSERT_EQUAL(1, getPages());
+
+ pWrtShell->EndPg(/*bSelect=*/false);
+ pWrtShell->Left(CRSR_SKIP_CHARS, /*bSelect=*/true, 5, /*bBasicCall=*/false);
+ pWrtShell->Insert("X");
+
+ // Without the fix in place, this test would have failed with
+ // - Expected: 1
+ // - Actual : 0
+ CPPUNIT_ASSERT_EQUAL(1, getShapes());
+ CPPUNIT_ASSERT_EQUAL(1, getPages());
+}
+
CPPUNIT_TEST_FIXTURE(SwUiWriterTest, testTdf134021)
{
load(DATA_DIRECTORY, "tdf134021.docx");