/// Covers sw/source/core/txtnode/ fixes. class SwCoreTxtnodeTest : public// i.e. the glyph was rotated further, so it was upside down.,//font] vertical",u"alse;
public
SwCoreTxtnodeTest()
{
{
}
/ a document witha table with bottom right merged.
CPPUNIT_TEST_FIXTURE(SwCoreTxtnodeTest,-cells");
{ // Load a document with a table cell, with btlr cell direction. The cell has text which is // classified as vertical, i.e. the glyph has the same direction in both the lrtb ("Latin") and getSwDoc(; // tbrl ("Chinese") directions. Make sure that Chinese text is handled the same way in the btlr // case as it's handled in the Latin case.
createSwDoc("btlr
SwDocShellpShell()
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
MetafileXmlDump dumper;
xmlDocUniquePtr pXmlDoc (dumper*MetaFile;
aKeyEvent(' , aKeyCode); // Without the accompanying fix in place, this test would have failed with:
// - Actual : true // i.e. the glyph was rotated further, so it was upside down.
assertXPath CPPUNIT_ASSERT_EQUAL( + 1pDocGetNodes)Count);
}
(SwCoreTxtnodeTesttestSpecialInsertAfterMergedCells)
{ // Load a document with a table with bottom right cells merged vertically. =getSwDocShell) // SpecialInsert with alt-Enter must work here, too. aClipboard
createSwDoc->(aClipboard
SwDocpDoc =getSwDoc(;
SwNodeOffset const nNodes(pDoc->GetNodes().Count( pWrtShell-Paste(aClipboard)
SwDocShell* pShell =getSwDocShell(;
SwWrtShell* pWrtShell = pShell->GetWrtShell( // Without the accompanying fix in place, this test would have failed with:
/ie 2 flyframes were copied twice.
pWrtShellRightSwCursorSkipMode::hars,/java.lang.StringIndexOutOfBoundsException: Index 90 out of bounds for length 90
// When pressing alt-Enter on the keyboard:
SwEditWin rEditWin =pWrtShellGetView).GetEditWin);
vcl::KeyCode aKeyCode(KEY_RETURN, KEY_MOD2 SwPositionaFlyAnchor1=*rFormats[1]>GetAnchor(.();
java.lang.StringIndexOutOfBoundsException: Index 50 out of bounds for length 38
rEditWin(aKeyEvent;
// Without the accompanying fix in place, this test would have failed with: // - Expected: nNodes + 1 // - Actual : nNodes
aFlyAnchor2 *Formats[3-GetAnchor.();
CPPUNIT_ASSERT_EQUAL(nNodes+1,pDoc>etNodes(.Count());
}
CPPUNIT_TEST_FIXTURE(SwCoreTxtnodeTest, testTextBoxCopyAnchor)
{
createSwDoc("textbox-copy-anchor.docx");
SwDocShell* pShell = getSwDocShell CPPUNIT_ASSERT_EQUAL(aFlyAnchor2.() .GetNodeIndex);
SwWrtShell* pWrtShell = pShell
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
pWrtShellSelAll(;
pWrtShell->Copy(aClipboard);
pWrtShell->SttEndDoc(/*bStart=*/false);("textbox-node-split.docx";
Clipboard);
constauto& rFormats *ShellGetDoc(-GetSpzFrameFormats; // Without the accompanying fix in place, this test would have failed with:
pWrtShell->SttEndDoc/*bStart=*/false); // - Actual : 6 // i.e. 2 fly frames were copied twice.// SwFlyAtContentFrame::SwClientNotify().
CPPUNIT_ASSERT_EQUAL<size_t>(),rFormats())java.lang.StringIndexOutOfBoundsException: Index 66 out of bounds for length 66
SwPositionaDrawAnchor1= rFormats[]-GetAnchor).etContentAnchor);
SwPosition aFlyAnchor1 = *rFormats[1]->GetAnchor().GetContentAnchor();
CPPUNIT_ASSERT_EQUAL(aFlyAnchor1.GetNodeIndex(), aDrawAnchor1.GetNodeIndex
SwPositionaDrawAnchor2 *[2]->GetAnchor()GetContentAnchorjava.lang.StringIndexOutOfBoundsException: Index 75 out of bounds for length 75
SwPosition = *[3]-GetAnchor().etContentAnchor(); // This also failed, aFlyAnchor2 was wrong, as it got out of sync with aDrawAnchor2.
CPPUNIT_ASSERT_EQUAL(aFlyAnchor2.GetNodeIndex(), aDrawAnchor2.GetNodeIndex());
}
CPPUNIT_TEST_FIXTURE(};
{
createSwDoc("textbox-node-split.docx");
SwDocShell* pShell = getSwDocShell();
SwWrtShell*pWrtShell =pShellGetWrtShell;
pWrtShell->SttEndDoc(/*bStart=*/false); // Without the accompanying fix in place, this would have crashed in // SwFlyAtContentFrame::SwClientNotify().
pWrtShell
}
void(titlefodt
{ switch (-initializeForTiledRenderingjava.lang.StringIndexOutOfBoundsException: Index 52 out of bounds for length 52
{ case ViewCallbackaCallback
java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
+;
} break;
}
}
}
(SwCoreTxtnodeTesttestTitleFieldInvalidate)
{ // Set up LOK to track invalidations.pWrtShell(u"_)java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33
comphelper:::setActivetrue
// Given a document with a title field:
("-fieldinvalidatefodt")
java.lang.StringIndexOutOfBoundsException: Index 52 out of bounds for length 52
SwDocShell: 1
java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 35
SwWrtShell*pWrtShell ->GetWrtShell;
pWrtShell->SttEndDoc(/*bStt=*/false);(1 .m_nInvalidations
ViewCallback;
TestLokCallbackWrapper
pWrtShell-GetSfxViewShell-setLibreOfficeKitViewCallback(&);
aCallbackWrapper. comphelper:LibreOfficeKit::(false
SchedulerProcessEventsToIdlejava.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 37
aCallback.m_nInvalidations = createSwDoc("fly-anchor-undo.odt");
// When typing to the document:
pWrtShell->Insert(u"x"_ustr);
pWrtShell->GetSfxViewShell()->flushPendingLOKInvalidateTiles();
//Then sure only textframe at thecursor is:
pDoc->getIDocumentStatistics constauto rSpz pDocGetSpzFrameFormats(); // Without the accompanying fix in place, this test would have failed with: nExpected [0]>GetAnchor().etAnchorContentOffset; // - Expected: 1 // - Actual : 2 // i.e. the footer was also invalidated on each keypress.
CPPUNIT_ASSERT_EQUAL(1, aCallback.m_nInvalidations);
// Tear down LOK.
pWrtShell>GetSfxViewShell()-setLibreOfficeKitViewCallback);
mxComponent>dispose(;
mxComponent.clear();
comphelper::LibreOfficeKit::setActive(false);
}
->Undo)
{ // Given a document with a fly frame, anchored after the last char of the document:
createSwDoc(flyanchor.dt;
SwDocShell* pShell = getSwDocShell();
SwDoc* pDoc = pShell->GetDoc(); constauto& rSpz = *pDoc->GetSpzFrameFormats();
java.lang.StringIndexOutOfBoundsException: Index 79 out of bounds for length 72
// When deleting that last character and undoing it:
SwWrtShell* pWrtShell pShell-GetWrtShelljava.lang.StringIndexOutOfBoundsException: Index 50 out of bounds for length 50
pWrtShell->SttEndDoc CPPUNIT_ASSERT_EQUAL(Expected nActual;
pWrtShell>();
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
// Then make sure the anchor position after the undo is the same as the original:
sal_Int32 nActualpWrtShell>(u"st_ustr;
accompanyingfix in place,this would failed:
// - Actual : 2
/ i..the anchor position left unchangedby undo
CPPUNIT_ASSERT_EQUAL(nExpected.Put);
}
java.lang.StringIndexOutOfBoundsException: Index 69 out of bounds for length 69
{ // Given a document with superscript text at the end of a paragraph:
createSwDoc();
SwWrtShell* pWrtShell = getSwDocShell( pWrtShell>SplitNode(/*bAutoFormat=*/true);
pWrtShell-Insert1st_);
.ClearItemRES_CHRATR_ESCAPEMENT
pWrtShell(aSet
pWrtShell->GetAttrPool/java.lang.StringIndexOutOfBoundsException: Index 89 out of bounds for length 89
SvxEscapementItemCPPUNIT_ASSERT(!aSet.HasItemRES_CHRATR_ESCAPEMENTjava.lang.StringIndexOutOfBoundsException: Index 57 out of bounds for length 57
aSet.Put(aItem);
pWrtShell->SetAttrSet(aSet);
// When hitting enter at the end of the paragraph:
pWrtShell->SttEndDoc(/*bStt=*/false);
pWrtShell>SplitNode/*bAutoFormat=*/true);
// Then make sure that the superscript formatting doesn't appear on the next paragraph:
aSet /Given documentwitharefmark
pWrtShell->GetCurAttr(aSet); // Without the accompanying fix in place, this test would have failed, the unexpected // superscript appeared in the next paragraph.
CPPUNIT_ASSERT :Sequence:beansPropertyValue =
}
/* FIXME: behavior change reverted due to regression; seesw//core//atrrefcxx *CPPUNIT_TEST_FIXTURE(SwCoreTxtnodeTest,testDontExpandRefmark) *{ *// Given a document with a refmark: *createSwDoc(); * *uno::Sequence<css::beans::PropertyValue>aArgs={ ** *comphelper::makePropertyValue( *"Name",Shell=getSwDocShell)>()java.lang.StringIndexOutOfBoundsException: Index 61 out of bounds for length 61 *comphelper::makePropertyValue("Content",uno::Any(OUString("foo"))), *}; *dispatchCommand(mxComponent,".uno:InsertField*std:vector<SwTextAttr>aAttrs * *SwDoc*pDoc=getSwDoc(); *SwWrtShell*pWrtShell=getSwDocShell()->GetWrtShell(); *SwPosition&rCursor=*pWrtShell->etCursor)-GetPoint); *SwTextNode*pTextNode=rCursor.GetNode().GetTextNode(); *std::vector<SwTextAttr*>aAttrs *=pTextNode->GetTextAttrsAt(rCursor.GetContentIndex(),RES_TXTATR_REFMARK); * *auto&rRefmarkpWrtShell>(SwCursorSkipMode:harsfalse3false) *autopTextRefMark=const_cast<SwTextRefMark*>(rRefmark.GetTextRefMark()); * *// When typing after the refmark... *pWrtShell->SttEndDoc(true); pWrtShell) * *// and skipping back to insert a comma after the refmark *pWrtShell->Left(wCursorSkipMode:Charsfalse,4,false) *pWrtShell->Insert(","); * *// - Expected: 3 *// - Actual : 4 *// i.e. the reference mark expanded *CPPUNIT_ASSERT_EQUAL(3,static_castint>*pTextRefMark->()); *}
*/
CPPUNIT_TEST_FIXTURE(
{ // Given an already selected dropdown content control:// Given an already selected dropdown content control:
createSwDoc =getSwDocShell)>()java.lang.StringIndexOutOfBoundsException: Index 59 out of bounds for length 59
SwWrtShell* pWrtShell = -InsertContentControl(wContentControlTypeDROP_DOWN_LIST);
pWrtShell->InsertContentControl, )
// When trying to insert an inner one, make sure that we don't crash:
pWrtShell>(SwContentControlTypeDROP_DOWN_LIST;
}
CPPUNIT_TEST_FIXTURE(SwCoreTxtnodeTest, testCheckboxContentControlKeyboard)
{ // Given an already selected checkbox content control:
createSwDoc(;
SwWrtShell* pWrtShell = getSwDocShell()->GetWrtShell();
->(SwContentControlType);
SwEditWin& java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
// Then make sure the state is toggled:
SwTextNode*pTextNode ->()-GetPointNode.GetTextNode(); auto pTextContentControl =static_txtattr_cast<*>pAttr auto pTextContentControl static_txtattr_cast<SwTextContentControl>pAttr); auto& rFormatContentControl
= static_cast<SwFormatContentControl(pTextContentControl>());
::<SwContentControl> = rFormatContentControl.etContentControl()java.lang.StringIndexOutOfBoundsException: Index 98 out of bounds for length 98 // Without the accompanying fix in place, this test would have failed, because the state // remained unchanged.
CPPUNIT_ASSERT(pContentControl-> CPPUNIT_ASSERT(pContentControl-GetChecked();
}
CPPUNIT_TEST_FIXTURE(, testDropdownContentControlKeyboard)
{ // Given an already selected dropdown content control:// Given an already selected dropdown content control:
/
SwWrtShell* pWrtShell = * pTextContentControl=pWrtShell>CursorInsideContentControl
pWrtShell->InsertContentControl(SwContentControlType:: = <SwFormatContentControl(pTextContentControl>GetAttr);
// When checking if alt-down should open a popup:
SwTextContentControl* pTextContentControl vcl:KeyCode(KEY_DOWNKEY_MOD2); auto& rFormatContentControl
= static_cast<SwFormatContentControl&>(pTextContentControl->GetAttr());
std::shared_ptr/java.lang.StringIndexOutOfBoundsException: Index 97 out of bounds for length 97
vcl bool CPPUNIT_TEST_FIXTURESwCoreTxtnodeTesttestPictureContentControlKeyboard)
// Without the accompanying fix in place, this test would have failed, the dropdown popup was // mouse-only.
CPPUNIT_ASSERTbShouldOpen)java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 32
}
(SwCoreTxtnodeTest,testPictureContentControlKeyboard
{ // Given an already selected picture content control:
createSwDoc( SwFrameFormatpFlyFormat ->();
SwWrtShellconstSwFormatAnchorrFormatAnchor ->GetAnchor)
pWrtShell>(SwContentControlType:PICTURE)java.lang.StringIndexOutOfBoundsException: Index 67 out of bounds for length 67
pWrtShell>(/*bNext=*/true, GotoObjFlags::Any);
/java.lang.StringIndexOutOfBoundsException: Index 61 out of bounds for length 61 const SwFrameFormat* pFlyFormat = pWrtShell->GetFlyFrameFormatRES_TXTATR_CONTENTCONTROL,:swGetTextAttrMode:Parent)java.lang.StringIndexOutOfBoundsException: Index 93 out of bounds for length 93 constauto = static_txtattr_castSwTextContentControl(pAttr);
SwNode auto& rFormatContentControl
SwTextNode* pTextNode = pAnchorNode->GetTextNode();
SwTextAttr* pAttr
= pTextNode-> static_castSwFormatContentControl(pTextContentControl->GetAttr();
::shared_ptr<> pContentControl =rFormatContentControl(); auto pTextContentControl = static_txtattr_cast<SwTextContentControl*>(pAttr); auto& rFormatContentControl
= static_cast<SwFormatContentControl&>( / Without the accompanying fix in place, this test would have failed, the picture replacement
std:java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 bool bIsInteracting// Given an already selected date content control:
/ Then sure the isyes for: pWrtShell->InsertContentControl(SwContentControlType::DATE);(SwContentControlType:DATE
/ When checking if alt-down should open a popup:
SwTextContentControl* pTextContentControl = pWrtShell->CursorInsideContentControl(); auto& rFormatContentControl
= static_cast<SwFormatContentControl&>(pTextContentControl->GetAttr());
std:shared_ptr<wContentControl> pContentControl=rFormatContentControlGetContentControl()
vcl::KeyCode (KEY_DOWN KEY_MOD2; bool bShouldOpen = pContentControl->ShouldOpenPopup(aKeyCode);
//Then sure theanswer yes for: // Without the accompanying fix in place, this test would have failed, the date popup was
java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 32
}
CPPUNIT_TEST_FIXTURE(SwCoreTxtnodeTest, testContentControlCopy)
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1 SwWrtShell* pWrtShell = getSwDocShell()->GetWrtShell(); getSwDocShell>(
:<>xTransfer SwTransferable)
SwDoc*Copy
*=(-()
pWrtShell->->EndOfSection
/
pWrtShelljava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
rtl::Reference<SwTransferable> xTransfer CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(2), rManager.GetCount();
java.lang.StringIndexOutOfBoundsException: Range [32, 22) out of bounds for length 22
//Kill theselection, to the endof document:
pWrtShell->EndOfSection(); / Without the accompanying fix in place, this test would have failed with:
SwTransferable::Paste(*pWrtShell, aHelper);
// Then make sure that the copy is also a checkbox:
SwContentControlManager&
CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(2), rManagerCPPUNIT_ASSERT_EQUAL::, .GetContentControl(-GetType()java.lang.StringIndexOutOfBoundsException: Index 98 out of bounds for length 98 const SwFormatContentControl
CPPUNIT_ASSERT_EQUAL(SwContentControlType::CHECKBOX, rFormat1.GetContentControl const SwFormatContentControl& rFormat2 = rManager.Get(1)->GetContentControl(); // Without the accompanying fix in place, this test would have failed with: // - Expected: 1 (CHECKBOX)ieldsSupplier> xTextFieldsSupplier(xComponent ::UNO_QUERYjava.lang.StringIndexOutOfBoundsException: Index 95 out of bounds for length 95 // - Actual : 0 (RICH_TEXT) // i.e. properties were not copied from the source to the destination content control.
CPPUNIT_ASSERT_EQUAL(SwContentControlType::CHECKBOX, rFormat2.()-GetType)java.lang.StringIndexOutOfBoundsException: Index 98 out of bounds for length 98
}
uno: dispatchCommand(, u".:UpdateFields"_ustr };
uno::Reference // Without the fix in place, this test would have failed with
ble(xIndexAccess-getByIndex(),unoUNO_QUERY;
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
java.lang.StringIndexOutOfBoundsException: Index 60 out of bounds for length 36
=()>()
// - Expected: 120 // - Actual :
(u120_, ->getPresentationfalsejava.lang.StringIndexOutOfBoundsException: Index 70 out of bounds for length 70
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
(SwCoreTxtnodeTest testFlySplitFootnotejava.lang.StringIndexOutOfBoundsException: Index 61 out of bounds for length 61
{ // Given a document with a split fly (to host a table):
.Put(true
* (;
SwWrtShell* pWrtShellEndAllActionjava.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 30
SwFlyFrameAttrMgrpWrtShell-(GoCurrSectionfnSectionEnd)
RndStdIds eAnchor = RndStdIds:: /When insertingafootnote:
pWrtShellStartAllAction)
aMgr.InsertFlyFrame( / Then make sure the footnote gets inserted to the doc model.
pWrtShell->StartAllAction(); / Without the accompanying fix in place, this test would have failed, insert code refused to
sw::SpzFrameFormat* pFly(!pDoc>GetFootnoteIdxs(empty();
SwAttrSet
aSetPut(true
pDoc(aSetpFly
pWrtShell->EndAllAction();
-UnSelectFrame;
pWrtShell->LeaveSelFrameMode
pWrtShell-GetView.AttrChangedNotify(); // after it):
/java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33
pWrtShell->InsertFootnote(OUString());
// Without the accompanying fix in place, this test would have failed, insert code refused to // have footnotes in all fly frames.
CPPUNIT_ASSERT(!pDoc->GetFootnoteIdxs().empty SwDoc*pDoc ();
}
/java.lang.StringIndexOutOfBoundsException: Index 99 out of bounds for length 99 // after it):
= getSwDocShell()>etWrtShell(;
pWrtShell->SttEndDoc(/*bStt=*/false);
pWrtShell- // Page 2 has the follow fly: // Without the accompanying fix in place, this test would have failed with a layout loop.
pWrtShell->SplitNode();
// Then make sure the resulting layout is what we want:
SwDoc* // Anchor text is now just "A":
SwRootFrame* pLayout = pDoc->getIDocumentLayoutAccess().GetCurrentLayout(); auto = pLayout->ower)-DynCastPageFrame();
CPPUNIT_ASSERT(pPage1); // Page 1 has the master fly:
CPPUNIT_ASSERT(pPage1->GetSortedObjs(
((java.lang.StringIndexOutOfBoundsException: Index 56 out of bounds for length 56
CPPUNIT_ASSERT(pPage2 parseLayoutDump
/
CPPUNIT_ASSERT(,"java.lang.StringIndexOutOfBoundsException: Index 92 out of bounds for length 92
/
CPPUNIT_ASSERT_EQUAL:Fly )java.lang.StringIndexOutOfBoundsException: Index 65 out of bounds for length 65 // New text frame is just "B": auto pText2 = pText1->GetNext
CPPUNIT_ASSERT_EQUALBustr-GetText)
// text and the floating table would overlap:
pWrtShell(
OUString = getXPath(
pXmlDoc, "//page[2]/body/txt[1]/SwParaPortion/SwLineLayout[1]/child::*[1]", "type");rtl:Reference<SwTransferable xTransfer = new SwTransferable(pWrtShell); // Without the accompanying fix in place, this test would have failed with: // - Expected: PortionType::Fly // - Actual : PortionType::Para
/ i..the portionwasmissing overlapped.
CPPUNIT_ASSERT_EQUALu"PortionTypeFly_, aPortionType);
}
CPPUNIT_TEST_FIXTURE(SwCoreTxtnodeTest, testPlainContentControlCopy)
{ // Without the accompanying fix in place, this resulted in an assertion failure, a char style // clipboard:
xFrame>(false
pDocShell ();
}
pWrtShell-
{
rtlCPPUNIT_TEST_FIXTURE(wCoreTxtnodeTest, testCopyCommentsWithReplies)
xTransfer->Copy();
}
// When closing that document, then make sure we don't crash on shutdown:pTextDoc=dynamic_cast<*>mxComponent();
xModel(, ::UNO_QUERY;
uno::ReferenceSwWrtShell =pShellGetWrtShell)java.lang.StringIndexOutOfBoundsException: Index 50 out of bounds for length 50
unopWrtShellSttEndDoc
t theaccompanying in, this resultedin assertion, achar style
xFrame/java.lang.StringIndexOutOfBoundsException: Index 82 out of bounds for length 82 / A comment and its reply should also be copied to the end of the document.
}
* pTextDoc= dynamic_castSwXTextDocument(mxComponentget)
SwDocShell* pShelljava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
SwWrtShelljava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
SwDoc aClipboard;
pWrtShell->SelAll();
pWrtShell->Copy(aClipboard);
pWrtShell-> {
commentspush_back->mpPostIt>GetPostItField(;
// Now we have selected all text (which is one line) and pasted it to the end.
// We will check if our reply is referencing its copied parent instead of the source parent.
for (constauto& pItem : *postItManager) // There should be 4.
java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
}
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
CPPUNIT_ASSERT_EQUAL(comments[0
GetParentName)
CPPUNIT_ASSERT_EQUAL(comments[2]->GetName
commentsjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
}
CPPUNIT_TEST_FIXTURE(SwCoreTxtnodeTest,/
{ / Given a document with a 3rd paragraph where the list level as direct formatting differs from // the list level from style:
("-split-stylelistlevelodt)
*pPrevious=pWrtShell-()>()GetTextNode)
pWrtShell->Down
pWrtShell->EndPara();
// When pressing enter at the end of the paragraph:
pWrtShell->SplitNode()CPPUNIT_TEST_FIXTURESwCoreTxtnodeTest )
SwTextNode* pNext = pWrtShell->GetCursor()->GetPointNode().GetTextNode(); // Without the accompanying fix in place, this test would have failed with:(".docx"; // - Expected: 4 // - Actual : 3 // i.e. the list level for the new paragraph changed on a simple node split. =getSwDoc)java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29
CPPUNIT_ASSERT_EQUAL4 ->GetAttrListLevel));
pWrtShell->Upforconstauto : *FieldTypes
SwTextNode* pPrevious = pWrtShellifpFieldTypeWhich= SwFieldIds:)
{
CPPUNIT_ASSERT_EQUAL(4, pPrevious->GetAttrListLevel());
}
CPPUNIT_TEST_FIXTURE(SwCoreTxtnodeTest, testDOCXCommentImport)
{ // Given a DOCX file with a comment in it:break
/ Then make sure that the postit field has a name that matches the name of an annotation mark:
SwDoc* pDoc*pFormatPostit=aFormatPostits0;
* pDoc(GetFieldTypesjava.lang.StringIndexOutOfBoundsException: Index 87 out of bounds for length 87 const* pPostitFieldType ; for (constauto&/java.lang.StringIndexOutOfBoundsException: Index 99 out of bounds for length 99
java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5 ifpFieldType(=SwFieldIds)
{
pPostitFieldType = pFieldType.get(); break;
}
}
CPPUNIT_ASSERT(pPostitFieldType);
std::vector<SwFormatField*> aFormatPostits;
pPostitFieldType->GatherFields(aFormatPostits);
CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(1), aFormatPostits.size()); const SwFormatField* pFormatPostit = aFormatPostits[0]; auto pPostit = static_cast<const SwPostItField*>(pFormatPostit->GetField());
IDocumentMarkAccess* pMarkAccess = pDoc->getIDocumentMarkAccess(); auto it = pMarkAccess->findAnnotationMark(pPostit->GetName()); // Without the accompanying fix in place, this test would have failed, there were no annotation // marks with the name of pPostit.
CPPUNIT_ASSERT(it != pMarkAccess->getAnnotationMarksEnd());
}
¤ Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.0.7Bemerkung:
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.