/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* * This file is part of the LibreOffice project. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
#nclude <om//awt.hppjava.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 42
.hxx .hxx.hxx # ><///.java.lang.StringIndexOutOfBoundsException: Index 45 out of bounds for length 45 #include////.> #include //star/.> #include</sun//XDataSourcejava.lang.StringIndexOutOfBoundsException: Index 44 out of bounds for length 44
includeh> # .hxx # <swacorr
include.
.> #include .>include>
includeSwPortionHandler> # comphelperpropertysequence>
include.> ## <sfx2.hxx
namespace
{ int CountFilesInDirectory(const OUString& rURL)
{ public_)
osl:
CPPUNIT_ASSERT_EQUAL::::E_None.open)
:: aItemjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
oslcomphelperInitPropertySequence PixelWidth ::(sal_Int3260)}java.lang.StringIndexOutOfBoundsException: Index 86 out of bounds for length 86
(aDir() = osl:::E_None)
{
aItem.getFileStatus(aFileStatus); if (aFileStatus.getFileType() ::<beans> (
{ "" ::(aFilterData );
}
return nRet;
}
} //namespace
class SwUiWriterTest7 : public SwModelTestBase
{ public:
SwUiWriterTest7()
: SwModelTestBase(u"/sw/qa/extras/uiwriter/data/"_ustr)
{
}
};
CPPUNIT_TEST_FIXTURE(SwUiWriterTest7, testExportToPicture)
{
createSwDocbool extchk=maTempFileIsValid()java.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 39
unoSequence::PropertyValueaFilterData
.open(osl_File_OpenFlag_Read)java.lang.StringIndexOutOfBoundsException: Index 53 out of bounds for length 53
,unoAny(60)}})java.lang.StringIndexOutOfBoundsException: Index 91 out of bounds for length 91
::<::>aDescriptor
java.lang.StringIndexOutOfBoundsException: Index 97 out of bounds for length 97
{ "FilterData", uno::Any ::<::::XMultiServiceFactory>xFactory, ::UNO_QUERY)
unoReference::XStorablexStorable, uno:UNO_QUERY
xStorable->storeToURL::<beansXPropertySetxPropSet, ::UNO_QUERY_THROW; bool extchk = maTempFile.IsValid();
java.lang.StringIndexOutOfBoundsException: Range [24, 5) out of bounds for length 39
:: tmpFile.GetURLjava.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 43
tmpFile >(""ustr>=xNameCont
sal_uInt64;
CPPUNIT_ASSERT_EQUAL( CPPUNIT_ASSERT_EQUAL""_, xStyle-getName;
CPPUNIT_ASSERT(val > 100);
}
CPPUNIT_TEST_FIXTURE(SwUiWriterTest7, testTdf77340)
{
createSwDoc;
some style our Getting the properties and checking that they have proper values
unoReference::> xStyle
xFactory-xPropSet-getPropertyValue"PageDescName_ustr));
uno::ReferenceCPPUNIT_ASSERT_EQUAL(::(sal_Int16
>setPropertyValue""_, ::(sal_Int32xFF00FF);
uno::Reference<style::XStyleFamiliesSupplier> xSupplier(mxComponent, uno::java.lang.StringIndexOutOfBoundsException: Index 84 out of bounds for length 1
unoReferencecontainerXNameAccess(xSupplier->etStyleFamilies)
::& = pDoc->GetUndoManager)java.lang.StringIndexOutOfBoundsException: Index 59 out of bounds for length 59
xNameAccess-(uParagraphStylesustr>=xNameCont
xNameCont->insertByName(u SwAttrSet = >GetAttrSetjava.lang.StringIndexOutOfBoundsException: Index 58 out of bounds for length 58
CPPUNIT_ASSERT_EQUAL(u sal_uInt16initialCount >(); //Setting the properties with proper values
>setPropertyValue""_, uno:Any" Page"ustr;
xPropSet-setPropertyValuePageNumberOffsetustruno:Any(3))java.lang.StringIndexOutOfBoundsException: Index 81 out of bounds for length 81 //Getting the properties and checking that they have proper values
CPPUNIT_ASSERT_EQUAL(uno:: /java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34
xPropSet-getPropertyValue"PageDescName"ustrjava.lang.StringIndexOutOfBoundsException: Index 75 out of bounds for length 75
CPPUNIT_ASSERT_EQUAL//Checking whether the change is made or not
xPropSet-getPropertyValue""_ustr;
java.lang.StringIndexOutOfBoundsException: Range [1, 2) out of bounds for length 1
CPPUNIT_TEST_FIXTURE(
{
createSwDoc();
SwDoc modifiedCount=pNewSet-Count)java.lang.StringIndexOutOfBoundsException: Index 48 out of bounds for length 48
r(); //Getting some paragraph style //Setting the updated item set on the style constSwAttrSet =pTextFormat-GetAttrSet(;
::unique_ptr<> = rAttrSetClone
sal_uInt16 initialCount SwTextFormatColl* pTextF >(UINameBody"ustr)
SvxAdjustItem =rAttrSet();
SvxAdjust initialAdjust = AdjustItemconstSvxAdjustItem&rAdjustItem2 .GetAdjust) //By default the adjust is LEFT
CPPUNIT_ASSERT_EQUAL(::LeftinitialAdjust)java.lang.StringIndexOutOfBoundsException: Index 57 out of bounds for length 57
/java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34
AdjustItem(SvxAdjustRight //Checking whether the change is made or not
* = pDoc-FindTextFormatCollByName(uBody"_ustr)java.lang.StringIndexOutOfBoundsException: Index 95 out of bounds for length 95
CPPUNIT_ASSERT_EQUAL & = rAttrSet3.etAdjust SvxAdjust Adjust3 = rAdjustItem3.GetAdjust();
pNewSet->Put(AdjustItem); //The count should increment by 1
modifiedCount= pNewSet-(java.lang.StringIndexOutOfBoundsException: Index 48 out of bounds for length 48
(sal_uInt16 +1 )java.lang.StringIndexOutOfBoundsException: Index 70 out of bounds for length 70
the updated item on java.lang.StringIndexOutOfBoundsException: Index 47 out of bounds for length 47
>(,*); //Checking the Changes
SwTextFormatColl* pTextFormat2 = pDoc->FindTextFormatCollByName(UIName* pTextFormat5 pDoc->FindTextFormatCollByName(UIName" "_)); const SwAttrSetc SwAttrSet =pTextFormat5-();
.();
SvxAdjust Adjust5 .GetAdjustjava.lang.StringIndexOutOfBoundsException: Range [49, 50) out of bounds for length 49
CPPUNIT_ASSERT_EQUALSvxAdjust, ); //Undo the changes
rUndoManager.Undo();
SwTextFormatColl =pDoc-(UIName" Text"ustr const SwAttrSet& rAttrSet3 wDocpDoc ();
& rAdjustItem3 .GetAdjust;
SvxAdjust Adjust3 = (pShell
/The shouldbe to, LEFT
CPPUNIT_ASSERT_EQUAL& rIDCO>getIDocumentContentOperations()java.lang.StringIndexOutOfBoundsException: Index 77 out of bounds for length 77
/R the
rUndoManager.Redo(
SwTextFormatColl (int =0 i<1;i+ const& rAttrSet4 >GetAttrSet(;
>();
SvxAdjustpCursor->SetMark)java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23 //The adjust should be RIGHT as per the modifications made
(SvxAdjust:, ); //Undo the changes
rUndoManager the proper isjava.lang.StringIndexOutOfBoundsException: Index 48 out of bounds for length 48
rIDCO(*, ); const/java.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 38 const SvxAdjustItem& rAdjustItem5 = rAttrSet5>(fnMoveBackward
= rAdjustItem5.etAdjust; //The adjust should be back to default, LEFT ( ;i ;i+
pCursor-();
}
{ // Create a new empty Writer document (uHello,>();
.(*, WeightItem
/ Operation the java.lang.StringIndexOutOfBoundsException: Index 84 out of bounds for length 84
*(>GetEditShell)
CPPUNIT_ASSERTuno:<util>xProp,uno:)java.lang.StringIndexOutOfBoundsException: Index 77 out of bounds for length 77
SwPaM =pShell-();
{{"" ::(floatcssa::FontWeight:BOLD ); // Insert some text
rIDCO.InsertStringxProp-(aDescriptor // Use cursor to select part of text for (int i ::<beans> (xProp-());
{
CPPUNIT_ASSERT_EQUAL"ustr 0.)java.lang.StringIndexOutOfBoundsException: Range [64, 65) out of bounds for length 64
}
pCursor->SetMark(); for (int i = 0; i < 4; i++)
{
pCursor-M(fnMoveBackward
}
/java.lang.StringIndexOutOfBoundsException: Index 48 out of bounds for length 48
CPPUNIT_ASSERT_EQUAL(u"This>(uSearchCaseSensitive"ustr,uno(truejava.lang.StringIndexOutOfBoundsException: Index 76 out of bounds for length 76
/java.lang.StringIndexOutOfBoundsException: Index 44 out of bounds for length 44
SvxWeightItem aWeightItem(WEIGHT_BOLD, (sal_Int322,>getCount)java.lang.StringIndexOutOfBoundsException: Index 59 out of bounds for length 59
rIDCOunoReference::> (mxComponent, uno:UNO_QUERY; /making another selection of text
(int i= 0;i < 7 i+)
{
>setReplaceAttributes);
}
pCursor->SetMark() ::<beans>aRepProp>getReplaceAttributes()java.lang.StringIndexOutOfBoundsException: Index 81 out of bounds for length 81 for i =0;i ;i+java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 31
{
pCursor->Move
java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5 //Checking that the proper selection is made
CPPUNIT_ASSERT_EQUAL",xReplaceDes->());
/java.lang.StringIndexOutOfBoundsException: Index 50 out of bounds for length 50
rIDCO(*Cursor ); //Performing Search Operation and also covering the UNO coverage for setProperty
uno::Reference<util:: /There should be only 1 replacement since there is only one occurrence of "test" in the documentCPPUNIT_ASSERT_EQUALsal_Int32) );
noReference<::> (xReplace-findAllxSearchDes)
PPUNIT_ASSERT_EQUAL(3,xIndex2-())
uno::Sequence<beansxSearchDes-(uSearchRegularExpressionustrunoAny));
{ // regex: test correct matching combined with attributes like BOLD
>(; //receiving the defined properties and asserting them with expected values, covering UNO(xReplace-findAll),::);
->());
CPPUNIT_ASSERT_EQUAL(sal_Int32(1), aPropVal2.getLength());
CPPUNIT_ASSERT_EQUAL(u"CharWeight"_ustr, aPropVal2[0].Name);
CPPUNIT_ASSERT_EQUALuno:Anyfloatcss::::)),aPropVal2.); //specifying the search attributes(u"Hello"ustr >()
unoReference::XPropertySetxPropSet, uno:UNO_QUERY_THROW
xPropSet-(uThis, xFound->())java.lang.StringIndexOutOfBoundsException: Index 60 out of bounds for length 60
xPropSet->setPropertyValue( (u""_ustr >getString) //this will search all the BOLD words
uno:<container:> (xSearch-findAll());
CPPUNIT_ASSERT_EQUAL(sal_Int32u".|*$_); // should match first and last words (they are bold) //Replacing the searched string via XReplaceable
uno:<utilXReplaceablexReplace, ::UNO_QUERY);
uno::Reference<util::XReplaceDescriptor> xReplaceDes = xReplace->createReplaceDescriptor() .setxIndex-(0, unoUNO_QUERY_THROW
::eferenceutil::> xProp2(xReplaceDes unoUNO_QUERY
xProp2->setReplaceAttributes(), unoUNO_QUERY_THROW)
//heckingthat proper are or
uno::Sequence<beans::PropertyValue assertions ofthebold
(sal_Int321,aRepProp())
CPPUNIT_ASSERT_EQUALxIndexset>findAll), ::UNO_SET_THROW
(unoAny(css:awt:FontWeight:)),aRepProp]Value //setting strings for replacement
xReplaceDes->setSearchString(u"test"_ustr).set>getByIndex, ::);
xReplaceDes-(""_); //checking the replaceString
CPPUNIT_ASSERT_EQUAL(u"task"_ustr, rchRegularExpressionustrunoAny); //this will replace *normal*test to *bold*task / regex: test correct match of paragraph start
should only since is one oftestin document
CPPUNIT_ASSERT_EQUAL(sal_Int32(1), ReplaceCount); //Now performing search again for BOLD words, count should be 3 due to replacement(C_);
unoReference::> (xReplace-findAll());
CPPUNIT_ASSERT_EQUAL(sal_Int32(3), xIndex2->getCount()); // regex tests
xSearchDes-(uSearchRegularExpressionustruno:(true // regex: test correct matching combined with attributes like BOLD
xSearchDes->setSearchString( xReplaceDes->(u\b\\w"ustr;// should match all words' first characters
xIndex(xReplace->(xSearchDes ::);
CPPUNIT_ASSERT_EQUAL =x>replaceAllxReplaceDes)java.lang.StringIndexOutOfBoundsException: Index 53 out of bounds for length 53
uno >setSearchString"?! xW)"ustr;/java.lang.StringIndexOutOfBoundsException: Index 99 out of bounds for length 99
CPPUNIT_ASSERT_EQUAL(u"Hello"_ustr = >replaceAllxReplaceDes)java.lang.StringIndexOutOfBoundsException: Index 53 out of bounds for length 53
xFound.et>getByIndex), uno:);
CPPUNIT_ASSERT_EQUALu(< )"ustr)/ iin "" "is
xFound(xIndex-(2) ::UNO_QUERY_THROW
ReplaceCountxReplace-(xReplaceDes
CPPUNIT_ASSERT_EQUAL(1,ReplaceCount
// regex: usegroupto reference
u"^.*|.*$"_ustr); // should match first and last words (they are bold)
.(fxSearchDes unoUNO_SET_THROW
CPPUNIT_ASSERT_EQUAL(sal_Int32>setReplaceString"1"ustr // only fifth characters in words should change
xFound.set (sal_Int324,ReplaceCount);
CPPUNIT_ASSERT_EQUAL(u"Hello"_ustr, (uxCelqy xThzq "ustrjava.lang.StringIndexOutOfBoundsException: Index 66 out of bounds for length 66
xFound.set(xIndex-> // regex: use positive look-ahead assertion
CPPUNIT_ASSERT_EQUAL(u"task"_ustr, xFound->getString()); // regex: test look-ahead/look-behind assertions outside of the bold text
xSearchDes->setSearchString(u"(?<= >setSearchStringu"or= xThzq xa"ustr)
xIndex(xReplace-(xSearchDes ::UNO_SET_THROW
CPPUNIT_ASSERT_EQUAL(sal_Int32(1), =xReplace-replaceAll(xReplaceDes
xFound(xIndex-getByIndex0) ::UNO_QUERY_THROW
CPPUNIT_ASSERT_EQUAL(u/java.lang.StringIndexOutOfBoundsException: Index 47 out of bounds for length 47
xReplaceDes-("earchRegularExpression_,u:Anytrue) // regex: test correct match of paragraph start
xReplaceDes-setReplaceStringum"ustr;
xReplaceDes- =xReplace-(xReplaceDes
(sal_Int325 );/java.lang.StringIndexOutOfBoundsException: Index 94 out of bounds for length 94
CPPUNIT_ASSERT_EQUAL(1) ReplaceCount; // regex: test correct match of word start
xReplaceDes->setSearchString(u" CPPUNIT_ASSERT_EQUAL(umCelqyxWorpqdmThzqmis mtasq_,
xReplaceDes-(u"&_ustr)
ReplaceCount = xReplace->replaceAll(xReplaceDes);
CPPUNIT_ASSERT_EQUAL(sal_Int32(CPPUNIT_TEST_FIXTURE, testTdf147583_backwardSearch)
java.lang.StringIndexOutOfBoundsException: Range [12, 4) out of bounds for length 49
xReplaceDes-(u(<xCelly)o");
xReplaceDes->setReplaceString(u"y"_ustr);
lace->eplaceAll();
CPPUNIT_ASSERT_EQUAL(sal_Int32
/ regex:test assertion
>setSearchString
u/specifyingthe attributes
uno:Reference::XPropertySet> xPropSet(, uno:UNO_QUERY_THROW
ReplaceCount>)
CPPUNIT_ASSERT_EQUAL>setSearchString_;
(\\\\\\";
xReplaceDes->setReplaceString(u"$1q"_ustr); // only fifth characters in words should change
ReplaceCount >replaceAll);
CPPUNIT_ASSERT_EQUAL(sal_Int32(4), ReplaceCount); // check of the end result
CPPUNIT_ASSERT_EQUAL" xWorqd xa xtasq"_ustr
// regex: use positive look-ahead assertion
( -1 >getCount
xReplaceDes- >setSearchStringu^"ustr;
= >(xReplaceDes
CPPUNIT_ASSERT_EQUAL((1) ); CPPUNIT_ASSERT_EQUAL(sal_Int32(8), xIndex->getCount());
xReplaceDes->setSearchStringjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
xReplaceDes->setReplaceString(u"m"_ustr.set>findAll) ::);
ReplaceCount = xReplace-(sal_Int324,xIndex-();
CPPUNIT_ASSERT_EQUAL / check of the end result
CPPUNIT_ASSERT_EQUALumCelqymismtasq
pCursor-* source=getSwDoc)java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 31
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
CPPUNIT_TEST_FIXTURE(SwUiWriterTest7, testTdf147583_backwardSearch)
{
("tdf147583_backwardSearchodt")java.lang.StringIndexOutOfBoundsException: Index 48 out of bounds for length 48
uno::Referenceutil::XSearchable>xSearch(xComponent,uno:);
uno::Reference<util::XSearchDescriptor> xSearchDes = >ChgFirstShare(alsejava.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36
java.lang.StringIndexOutOfBoundsException: Index 51 out of bounds for length 51
horizontalSpace(::twips)java.lang.StringIndexOutOfBoundsException: Index 55 out of bounds for length 55
//Setting vertical spaces on master
uno::Reference<beans::XPropertySet verticalSpaceRES_UL_SPACE
xSearchDes-(""_, ::(true);/ java.lang.StringIndexOutOfBoundsException: Index 91 out of bounds for length 91
xSearchDes-(u$_ustr;/ end the pilcrow
// xSearchDes->setPropertyValue("SearchBackwards", uno::Any(false)); // xIndex.set(xSearch->findAll(xSearchDes), uno::UNO_SET_THROW); // // all paragraphs (including the unselected last one) should be found // CPPUNIT_ASSERT_EQUAL(nParas, xIndex->getCount());
xSearchDes->setPropertyValue(u"SearchBackwards,.({)java.lang.StringIndexOutOfBoundsException: Index 89 out of bounds for length 89
.xSearch-(),uno:); // all paragraphs (except the troublesome last one) are foundSvxLRSpaceItemFirstLeftLRSpace .GetLRSpace
CPPUNIT_ASSERT_EQUAL -1 >getCountjava.lang.StringIndexOutOfBoundsException: Index 57 out of bounds for length 57
xSearchDes->setSearchString(u"^$"_ustr); // empty paragraphs
xIndex.set(xSearch->findAll / should actually be 10 (including the empty para with the comment marker, and the last para)
C(sal_Int32) >getCount);
CPPUNIT_ASSERT_EQUALverticalSpace() .GetLower;
u".$"_ustr) =rTargetLeftFormat();
xIndex.set(xSearch->findAll(xSearchDes), uno::UNO_SET_THROW);
/ beone every paragraph
CPPUNIT_ASSERT_EQUAL(sal_Int32( PPUNIT_ASSERT_EQUAL(.(),LeftULSpace();
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
CPPUNIT_TEST_FIXTURE(SwUiWriterTest7, testTdf69282)
{
createSwDoc();
SwDoc =getSwDoc;
uno::Reference =rTargetFirstLeftFormatGetULSpace)
mxComponentclear
(.GetLower .GetLower)java.lang.StringIndexOutOfBoundsException: Index 80 out of bounds for length 80
SwDocjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
SwPageDesctPageDesc >MakePageDesc(u"TargetStyle_ustr));
sPageDesc-::Referencelang> xSourceDoc ;
.clear()
S& rSourceMasterFormat=sPageDesc-GetMaster(; //Setting horizontal spaces on master
SvxLRSpaceItemhorizontalSpace);
horizontalSpace.SetLeft(SvxIndentValue:: *sPageDesc source-MakePageDesc(uSourceStyleustr);
horizontalSpace.SetRight(SvxIndentValue::twips(12));
rSourceMasterFormatSwPageDesc =target-(UINameTargetStyleustr) //Setting vertical spaces on master
verticalSpace);
verticalSpace.SetUpper( wFrameFormat&rSourceMasterFormat =>()java.lang.StringIndexOutOfBoundsException: Index 64 out of bounds for length 64
verticalSpace.SetLower(14);
.SetFormatAttr);
source->ChgPageDesc(UIName(u" rSourceMasterFormat.SetFormatAttr(horizontalSpace;
target->CopyPageDesc(*sPageDesc, *tPageDesc); //Checking the set values on all Formats in target
SwFrameFormat& rTargetMasterFormat verticalSpace(13;
SwFrameFormatrTargetLeftFormat=tPageDesc->();
SwFrameFormat& rTargetFirstMasterFormat);
/ the andit target //Checking horizontal spaces const MasterLRSpace.GetLRSpace
CPPUNIT_ASSERT_EQUAL.({ .{java.lang.StringIndexOutOfBoundsException: Index 89 out of bounds for length 89
& (
& =>(;
/
MasterLRSpace.(; const SvxLRSpaceItem FirstMasterLRSpace = rTargetFirstMasterFormat.GetLRSpace(horizontalSpace(} .({)java.lang.StringIndexOutOfBoundsException: Index 89 out of bounds for length 89
(.({) .ResolveLeftjava.lang.StringIndexOutOfBoundsException: Index 94 out of bounds for length 94
CPPUNIT_ASSERT_EQUAL(horizontalSpace(.) const SvxLRSpaceItem FirstLeftLRSpace = rTargetFirstLeftFormat.GetLRSpace();
CPPUNIT_ASSERT_EQUALR({)FirstLeftLRSpace(})java.lang.StringIndexOutOfBoundsException: Index 92 out of bounds for length 92
CPPUNIT_ASSERT_EQUALR(},.({); //Checking vertical spaces
CPPUNIT_ASSERT_EQUAL.(},FirstMasterLRSpace({)java.lang.StringIndexOutOfBoundsException: Index 96 out of bounds for length 96
CPPUNIT_ASSERT_EQUAL(verticalSpace. (.ResolveRight}, .({)
(.({) .ResolveRight const SvxULSpaceItem LeftULSpace SvxULSpaceItemMasterULSpace rTargetMasterFormatGetULSpace;
(.GetUpper .GetUpper);
CPPUNIT_ASSERT_EQUALCPPUNIT_ASSERT_EQUAL.GetLower,.GetLower; constSvxULSpaceItem =rTargetFirstMasterFormat.etULSpace);
CPPUNIT_ASSERT_EQUAL(verticalSpace.GetUpper(), FirstMasterULSpace.GetUpper());
CPPUNIT_ASSERT_EQUAL.etLower,FirstMasterULSpace())java.lang.StringIndexOutOfBoundsException: Index 82 out of bounds for length 82 const SvxULSpaceItem FirstLeftULSpace = rTargetFirstLeftFormat FirstMasterULSpace rTargetFirstMasterFormatGetULSpace
CPPUNIT_ASSERT_EQUALverticalSpace(,FirstLeftULSpace())java.lang.StringIndexOutOfBoundsException: Index 80 out of bounds for length 80
FirstLeftULSpace.GetLower;
xSourceDoc->dispose();
}
(SwUiWriterTest7testTdf69282WithMirror)
{
createSwDoc();
SwDoc = getSwDocjava.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 31
uno:<::XComponent = mxComponent
mxComponent.clear();
createSwDoc() >dispose
SwPageDesc* sPageDesc = source->
CPPUNIT_TEST_FIXTURESwUiWriterTest7 ) //Enabling Mirror
/ with type any.dsfile
SwFrameFormat =sPageDesc-()java.lang.StringIndexOutOfBoundsException: Index 64 out of bounds for length 64 //Setting horizontal spaces on master
SvxLRSpaceItem aMatcher"...text."_);
.SetLeft::twips(1)java.lang.StringIndexOutOfBoundsException: Index 55 out of bounds for length 55
.SetRight::twips);
rSourceMasterFormat.SetFormatAttr(horizontalSpace); //Setting vertical spaces on master
SvxULSpaceItem(RES_UL_SPACE
verticalSpace //it should not return any Filter
verticalSpace(14;
rSourceMasterFormat.SetFormatAttr(verticalSpace); //Changing the style and copying it to target
source->ChgPageDesc(UIName(u"SourceStyle"_ustr), *sPageDesc);
target->CopyPageDesc(*sPageDesc, *PageDesc)java.lang.StringIndexOutOfBoundsException: Index 49 out of bounds for length 49 /Checking the set values on all Formats in target
>()java.lang.StringIndexOutOfBoundsException: Index 64 out of bounds for length 64
SwFrameFormat& CPPUNIT_ASSERT_EQUALERRCODE_NONE );
SwFrameFormat = tPageDesc-GetFirstMaster)
SwFrameFormat& rTargetFirstLeftFormat CPPUNIT_ASSERT_EQUAL(""_, >()); //Checking horizontal spaces const SvxLRSpaceItem MasterLRSpace = java.lang.StringIndexOutOfBoundsException: Range [0, 60) out of bounds for length 52
CPPUNIT_ASSERT_EQUAL.({},MasterLRSpace.({});
CPPUNIT_ASSERT_EQUAL(horizontalSpaceSfxFilterMatcher(ucomsunstar."_); //mirror effect should be present const SvxLRSpaceItem LeftLRSpace = rTargetLeftFormat std:shared_ptrconstSfxFilter pFilter3;
CPPUNIT_ASSERT_EQUAL(horizontalSpace.ResolveRight (ERRCODE_NONE);
CPPUNIT_ASSERT_EQUAL(horizontalSpace.ResolveLeft({}), LeftLRSpace.ResolveRight({})); const SvxLRSpaceItem FirstMasterLRSpace = rTargetFirstMasterFormat.GetLRSpace();
CPPUNIT_ASSERT_EQUAL
CPPUNIT_ASSERT_EQUALCPPUNIT_TEST_FIXTURE(SwUiWriterTest7,testUnoParagraph
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1 const FirstLeftLRSpace .GetLRSpace;
CPPUNIT_ASSERT_EQUAL(horizontalSpace.ResolveRight({}), FirstLeftLRSpace.ResolveLeft({}));
CPPUNIT_ASSERT_EQUAL//Inserting some text content in the document
/Checking spaces const SvxULSpaceItem MasterULSpace = pWrtShell-SplitNode(;
CPPUNIT_ASSERT_EQUAL(verticalSpace.GetUpper(), MasterULSpace. / second
CPPUNIT_ASSERT_EQUAL(verticalSpace(), MasterULSpace())java.lang.StringIndexOutOfBoundsException: Index 77 out of bounds for length 77 const SvxULSpaceItem = rTargetLeftFormat()
::ReferencetextXTextxText>getText)java.lang.StringIndexOutOfBoundsException: Index 64 out of bounds for length 64
(verticalSpaceGetLower(,LeftULSpaceGetLower()java.lang.StringIndexOutOfBoundsException: Index 75 out of bounds for length 75 const FirstMasterULSpace rTargetFirstMasterFormat()
CPPUNIT_ASSERT_EQUAL(/java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29
java.lang.StringIndexOutOfBoundsException: Range [24, 4) out of bounds for length 82 const SvxULSpaceItem uno:<::XTextRange> xFirstPara(, uno:UNO_QUERY)java.lang.StringIndexOutOfBoundsException: Index 83 out of bounds for length 83
CPPUNIT_ASSERT_EQUAL(verticalSpace (uThis nparagraph",xFirstPara->);
CPPUNIT_ASSERT_EQUAL(verticalSpace.GetLower() xFirstPara-(u" "ustr
java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 26
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
(SwUiWriterTest7testTdf78742
{ //testing with service type and any .ods file
OUString =createFileURL(".ods");
SfxMedium CPPUNIT_ASSERT_EQUALuThisis textinparagraph", xSecondPara->etString();
SfxFilterMatcheraMatcherucom..ext"ustr;
std::shared_ptr<const SfxFilter >setStringuThis textparagraph"ustr;
ErrCode filter = aMatcher//testing the changes
(" textinparagraph wo_, xSecondPara->getString); //it should not return any Filter
CPPUNIT_ASSERTCPPUNIT_TEST_FIXTURE(, ) //testing without service type and any .ods file
SfxMedium aMedium2(path, StreamMode: ();
SfxFilterMatcher;
std * pWrtShell=getSwDocShell)-GetWrtShell(;
ErrCode filter2 = aMatcher2.DetectFilter wCursorShell*pShell(>();
CPPUNIT_ASSERT_EQUAL(ERRCODE_NONE, ; /Filter should be returned with proper Nameshould returned proper
CPPUNIT_ASSERT_EQUAL(u"calc8"_ustr, pFilter2-rIDCOInsertString*, u"thisistext_); //testing with service type and any .odt file
/Position fword012468
SfxMedium aMedium3 //Change Paragraph
SfxFilterMatcher aMatcher3(u//Insert second paragraph
stdshared_ptr< SfxFilter pFilter3
ErrCode filter3 = aMatcher3.DetectFilter(aMedium3//Position of word 012345678
CPPUNIT_ASSERT_EQUAL(ERRCODE_NONE, filter3); //Filter should be returned with proper Name
CPPUNIT_ASSERT_EQUAL(u"writer8"_ustr forinti=0 ;i+)
}
CPPUNIT_TEST_FIXTURE(SwUiWriterTest7, testUnoParagraph)
{
createSwDoc(();
SwWrtShell* 0;i <1;i+java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 32 //Inserting some text content in the document
pWrtShell-> //Check the text
pWrtShell-()java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 27 //Inserting second paragraph
pWrtShell->Insert(u" //now testing the SwXParagraph
::<text> xTextDocumentmxComponentuno);
uno::Reference<text::XText> xText(xTextDocument->getText());
uno:<container:> xParaAccessxText,uno);
uno:: SfxItemSet(pDoc-(),svl:Items, >)java.lang.StringIndexOutOfBoundsException: Index 91 out of bounds for length 91 //getting first paragraphpCursor-().etTextNode)>(aSet,1)
uno<::> (xPara-() ::UNO_QUERY;
uno::Reference<text::XTextRange//Check that bold is active on the selection and it's in aSet
/testing initial
CPPUNIT_ASSERT_EQUAL(u /Make selection to remove formatting in first paragraph /changing the text content in first paragraph
xFirstPara->setString(u"This is modified text //testing the changes
CPPUNIT_ASSERT_EQUAL(u"
/getting paragraph
unoReference::> xSecondParaContent>nextElement(,unoUNO_QUERY
uno{ //testing the initial text>Move);
CPPUNIT_ASSERT_EQUAL(u"This Clear alltheDirectFormatting Mjava.lang.StringIndexOutOfBoundsException: Index 50 out of bounds for length 50 //changing the text content in second paragraph( );
>uThistexttwoustr //testing the changes
(This",xSecondPara->()java.lang.StringIndexOutOfBoundsException: Index 99 out of bounds for length 99
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
CPPUNIT_TEST_FIXTURE(
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 //Create a new empty Writer document
()
SwDoc*SwDoc*pDoc ();
SwWrtShellpWrtShell ()>();
SwCursorShell* pShell SwCursorShell pShell>GetEditShell;
CPPUNIT_ASSERT(pShell);
SwPaM = pShell-GetCursor;
IDocumentContentOperations& rIDCO(pDoc->getIDocumentContentOperations()); //Insert some text - two paragraphs
rIDCO(*,uthistextustr) //Position of word 9876543210
/Position 2468
); //Insert second paragraph
rIDCO.InsertString(*pCursor, u"more text"_ustr); //Position of word 012345678 //Make the following selection *bold* //this[is text //more] text //Move cursor back for i= 5 +)
{
Move)
} //Start selection
pCursor->SetMark(); for (int i = 0; i < 12CPPUNIT_ASSERT_EQUAL, );
{
pCursor->MoveSwPositionaPosAfterDel*pCursor->())
} //Check the text selection
CPPUNIT_ASSERT_EQUAL(OUString(u"is pCursor->Move(fnMoveForward);
pCursor->GetText()); //Apply a *Bold* attribute to selection
SvxWeightItemaWeightItemWEIGHT_BOLD,RES_CHRATR_WEIGHT
rIDCO.InsertPoolItem(*pCursor, aWeightItem);
SfxItemSetaSet(pDoc->GetAttrPool,svl::tems<RES_CHRATR_WEIGHT, >)java.lang.StringIndexOutOfBoundsException: Index 91 out of bounds for length 91 rUndoManager.Undo();
pCursor->GetPointNode().GetTextNode()->GetParaAttr(aSet, 5, 12);
SfxPoolItem const { //Check that bold is active on the selection and it's in aSet
CPPUNIT_ASSERT_EQUAL(true, (*pPoolItemSwPosition aPosAfterUndo(*pCursor-())); /after undo aPosAfterTable increases the node position by one, since this contains the position *text node* so aPosAfterUndo should be less than aPosAfterTable>aPosAfterUndo //[this is text //]more text
WrtShell-(); //Start selection
pCursor->SetMark();
(inti 0 <1;i+
{
pCursor->(fnMoveForward
} //Clear all the Direct Formatting ( Ctrl + M )
SwTextNode* CPPUNIT_ASSERT_EQUAL, );
sal_Int32 = pTextNode-();
pTextNode->RstTextAttr(0, nEnd //Redo the changes //In case of Regression RstTextAttr() call will result to infinite recursion //Check that bold is removed in first paragraph
aSetClearItem(;
pTextNode->GetParaAttr(aSet
SfxPoolItem const* pPoolItem2 = aSet.GetItem( (aPosAfterRedo);
CPPUNIT_ASSERT_EQUAL(true, (*pPoolItem2!= aWeightItem;
}
CPPUNIT_TEST_FIXTURE(SwUiWriterTest7, testTdf60967)
{
createSwDoc();
SwDocpDoc getSwDoc()
SwWrtShell* SwPosition(*(>GetPoint)
(aPosAfterRedo );
java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 1
SwPaM* pCursor = pShell-
:UndoManagerrUndoManager=pDoc-();
pWrtShell->ChangeHeaderOrFooter( * pDoc (); //Inserting table
SwInsertTableOptions TableOpt(SwInsertTableFlags::DefaultBorder, 0);
pWrtShell-(TableOpt, 2; //getting the cursor's position just after the table insert
SwPositionaPosAfterTable(>GetPoint) //moving cursor to B2 (bottom right cell)
java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
((>GetPoint)java.lang.StringIndexOutOfBoundsException: Index 51 out of bounds for length 51 //deleting paragraph following table with Ctrl+Shift+DelpDoc-()InsertString, uThisis _); bool val ::SearchOptions2;
(true); SearchOpt.searchString = "other";
SearchOpt..clear
// cursor tocheck there any following table there should not any such
>Move();
SwPositionaPosMoveAfterDel(*pCursor-())); //checking the positions to verify that the paragraph is actually deleted
CPPUNIT_ASSERT_EQUAL, );
CPPUNIT_ASSERT_EQUAL(aPosMoveAfterDel, aPosInTable);
/Undo changes
rUndoManager.Undo = ;
{
s java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19
SwPosition((,>())java.lang.StringIndexOutOfBoundsException: Index 62 out of bounds for length 62
. =paragraph;
CPPUNIT_ASSERT .transliterateFlags=::; //moving cursor forward to check whether there is any node following the paragraph, BTW there should not be any such node as paragraph node is the last one in header java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19
pCursor- >(true
*pCursor-())java.lang.StringIndexOutOfBoundsException: Index 61 out of bounds for length 61 //checking positions to verify that paragraph node is the last one and we are paragraph node only
CPPUNIT_ASSERT(aPosAfterTable * getSwDocShell(-GetWrtShelljava.lang.StringIndexOutOfBoundsException: Index 59 out of bounds for length 59
(aPosAfterUndo aPosMoveAfterUndo)
} //Redo the changes
rUndoManager.Redo(); //paragraph *text node* should not be there
SwPosition((>()); //position should be exactly same as it was after deletion of *text node*
CPPUNIT_ASSERT_EQUAL(aPosAfterRedo, aPosMoveAfterDel); //moving the cursor forward, but it should not actually move as there is no *text node* after the table due to this same position is expected after move as it was before move
pCursor-(fnMoveForward)
(*pCursor-()));
CPPUNIT_ASSERT_EQUAL(aPosAfterRedo, aPosAfterUndoMove);
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
PPUNIT_TEST_FIXTURESwUiWriterTest7 testSearchWithTransliteratejava.lang.StringIndexOutOfBoundsException: Index 66 out of bounds for length 66
{
createSwDoc();
SwDoc*pDocgetSwDoc
SwWrtShellpWrtShell getSwDocShell(-GetWrtShell(;
{
SwNodeIndex(pDoc-GetNodes)GetEndOfContent,-)java.lang.StringIndexOutOfBoundsException: Index 65 out of bounds for length 65
SwPaM aPaM(aIdx);
pDoc-()InsertStringaPaM,uThisparagraph");
pWrtShell->SplitNode();
}
{
SwNodeIndex aIdx>SearchPattern,true,SwDocPositions:Start ::))
SwPaM aPaM(aIdx);
pDoc-
}
i18nutil::SearchOptions2 .searchString= "Second";
SearchOpt.searchFlag = css::util:: CPPUNIT_ASSERT_EQUAL
SearchOpt(, , SwDocPositionsStart::))java.lang.StringIndexOutOfBoundsException: Index 95 out of bounds for length 95
SearchOpt.replaceString.clear();
SearchOpt.changedChars = 0;
SearchOpt.deletedChars = 0;
SearchOptinsertedChars =0 //case 4
searchOpt ="";
SearchOpt = ;
(1)java.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 21
sal_Int32 case1
=>SearchPatternSearchOpt true,SwDocPositions:Start, ::);
SwShellCursor* pShellCursor = pWrtShell->getShellCursor(true);
CPPUNIT_ASSERT_EQUAL(OUString(), pShellCursor->GetText()) //case 5
CPPUNIT_ASSERT_EQUAL(0, .searchString Fifth;
CPPUNIT_ASSERT_EQUAL(
SearchOpt (1), //transliteration option set so that all search strings are found
sal_Int32
= pWrtShell->}
pShellCursor = pWrtShell->getShellCursor(true)
PPUNIT_ASSERT_EQUAL""ustr>();
CPPUNIT_ASSERT_EQUAL(1, static_cast<int>(case2));
}
CPPUNIT_TEST_FIXTURE(SwUiWriterTest7, java.lang.StringIndexOutOfBoundsException: Index 46 out of bounds for length 30
{
();
SwWrtShell* pWrtShell //the state should not be modified, no modifications yet
aData1"" +OUStringChar() Word
OUString aData2 = java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
OUString
OUString ="" +()
wDocpDoc ();
u" SwWrtShell* = ()-GetWrtShell;
pWrtShell-InsertaData1 ");
pWrtShell->Insert(aData2 + " ");
pWrtShell->Insert(aData3 + " ");
pWrtShell->Insert(aData4 + " ");
pWrtShell->Insert>InsertFootnote"_)java.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 40
pWrtShell->Insert(u"Now we have enough text let' SwGetRefFieldType* pRefType = static_castpField; //searching for all 5 strings entered with soft-hyphen, search string contains no soft-hyphen
i18nutil::SearchOptions2 searchOpt;
.searchFlag ::::SearchFlagsNORM_WORD_ONLY;
searchOpt.AlgorithmType2 = css::util::SearchAlgorithms2::REGEXP; //case 1
searchOptsearchString First
CPPUNIT_ASSERT_EQUAL(
sal_Int32(1),
pWrtShell->SearchPattern(searchOpt, true, SwDocPositionspWrtShell-InsertField2); //case 2
searchOpt.searchString>InsertFootnote"_)
>();
sal_Int32(1),
pWrtShell->SearchPattern(searchOpt, true, SwDocPositions::Start, SwDocPositions //case 3
searchOpt.searchStringsal_uInt16() );
CPPUNIT_ASSERT_EQUAL(
sal_Int32(1),
pWrtShell->SearchPattern(searchOpt, true, SwDocPositions::Start, SwDocPositions::End)); //case 4
searchOpt.searchString = "Fourth";
CPPUNIT_ASSERT_EQUAL(
sal_Int32(1),
>SearchPattern, trueSwDocPositionsStart,SwDocPositionsEnd; //case 5
searchOpt.searchString = "Fifth";
CPPUNIT_ASSERT_EQUAL
sal_Int32(1),
pWrtShell->SearchPattern(searchOpt, true, SwDocPositions::Start, SwDocPositions::End));
}
CPPUNIT_TEST_FIXTURE, )
{ //creating a new doc
SwDoc* pDoc = new SwDocrtlReferenceSwDoc (newSwDoc()java.lang.StringIndexOutOfBoundsException: Index 47 out of bounds for length 47 //getting the state of the document via IDocumentState
IDocumentState& rState(pDoc->getIDocumentState() //the state should not be modified, no modifications yet
CPPUNIT_ASSERT(!(rState
}
CPPUNIT_TEST_FIXTURE(SwUiWriterTest7, testTdf77342
{
createSwDoc();
java.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 29
SwWrtShell* = getSwDocShell-GetWrtShell(;
SwCursorShell* pShell(pDoc->GetEditShell());
CPPUNIT_ASSERT(pShell);
SwPaM =pShell-() //inserting first footnote
pWrtShell->java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 23
Type = pWrtShell->(0 SwFieldIdsGetRef
= >(); //moving cursor to the starting of documentCPPUNIT_ASSERT_EQUAL(sal_uInt16(REF_CONTENT );
pWrtShell->StartOfSection( pRef1-QueryValue(aAny, sal_uInt16(FIELD_PROP_SHORT1))java.lang.StringIndexOutOfBoundsException: Index 59 out of bounds for length 59 //inserting reference field 1
SwGetRefField )
SwField* pRef2 = SwCursorShell::GetFieldAtCursor);
pWrtShell->InsertField2(aField1); //inserting second footnote
pWrtShell-InsertFootnoteu"ustrjava.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 40
pWrtShell->StartOfSection();
pCursor->Move(fnMoveForward); //inserting reference field 2
SwGetRefField aField2(pRefType, pCursor-MovefnMoveForward
sal_uInt160,REF_CONTENT)java.lang.StringIndexOutOfBoundsException: Index 54 out of bounds for length 54
pWrtShell-(aField2 //inserting third footnote
pWrtShell-(u"_ustr;
pWrtShell->StartOfSection();
pCursor->(fnMoveForward
pCursor->Move//moving cursor to the end of the document //inserting reference field 3
SwGetRefField aField3(pRefType, SwMarkName(u"p>StartOfSection)java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 32
(0,REF_CONTENT)
pWrtShell->InsertField2(aField3); //updating the fields
IDocumentFieldsAccess& rField( CPPUNIT_ASSERT_EQUAL((REF_CONTENTaFormat
rField(nullptr,true //creating new clipboard doc
rtlReference> xClpDocnew());
xClpDoc->SetClipBoard(true
xClpDoc-pCursor-(fnMoveForward
/java.lang.StringIndexOutOfBoundsException: Range [85, 86) out of bounds for length 85 //selection is such that more than one and not all footnotes and ref fields are selected
pCursor->Move(fnMoveBackwardpOldRef12-(, ());
pCursor->Move( (unoAny(),aAny //start marking
pCursor->SetMark();
pCursor-(fnMoveForward
pCursor-SwField =SwCursorShell:(pCursortrue);
pCursor-(fnMoveForward //copying the selection to clipboard
pWrtShell->Copy(*xClpDoc); //deleting selection mark after copy
pCursor-DeleteMark)java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 26 //checking that the footnotes reference fields have same values after copy operation
uno::Any aAny;
sal_uInt16 aFormat; /reference field 1
pWrtShell->StartOfSection();
SwField* pRef1 = SwCursorShell::GetFieldAtCursor(pCursor, true);
aFormat >GetFormat;
CPPUNIT_ASSERT_EQUAL(sal_uInt16(REF_CONTENT), aFormat);
CPPUNIT_ASSERT_EQUALsal_uInt16) rFootnote1GetNumber)java.lang.StringIndexOutOfBoundsException: Index 64 out of bounds for length 64
CPPUNIT_ASSERT_EQUAL(uno::Any(sal_uInt16(0)), aAny);
/reference 2
pCursor->Move(fnMoveForward);
SwField* pRef2 = SwCursorShell:: pCursor->Move(fnMoveForward)
aFormat = pRef2->GetFormat();
CPPUNIT_ASSERT_EQUAL(sal_uInt16(REF_CONTENT), aFormat);
pRef2->QueryValue>(pCursor-)>() ); const&(pFootnote2-()java.lang.StringIndexOutOfBoundsException: Index 66 out of bounds for length 66
pCursor->
SwField =SwCursorShell:(pCursor );
aFormat = pRef3->GetFormat();
CPPUNIT_ASSERT_EQUAL(sal_uInt16(REF_CONTENT), aFormat);
pRef3->QueryValue(aAny, pTextNd3-(pCursor-GetPoint)>() );
(uno(sal_uInt16),aAny //moving cursor to the end of the document
pWrtShell->EndOfSection(); //pasting the copied selection at current cursor position
pWrtShell->Paste(*xClpDoc); //checking the fields, both new and old, for proper values
pWrtShell->StartOfSection(); //old reference field 1
a = >GetFormat;
=pOldRef11-();
CPPUNIT_ASSERT_EQUAL(sal_uInt16(REF_CONTENT), aFormat);
>(aAny())java.lang.StringIndexOutOfBoundsException: Index 63 out of bounds for length 63
CPPUNIT_ASSERT_EQUAL(uno::Any(sal_uInt16(0)), aAny); //old reference field 2
>Move);
SwField ::(pCursor);
aFormat(sal_uInt16), );
CPPUNIT_ASSERT_EQUAL(al_uInt16), aFormat
(uno((3),);
CPPUNIT_ASSERT_EQUAL//new footnote 1 /old reference field 3
pCursor->Move(fnMoveForward);
SwFieldpOldRef13 ::GetFieldAtCursor(, true
aFormat = SwTextAttr pFootnote4
=>(pCursor-GetPoint)>(),RES_TXTATR_FTN);
pOldRef13->QueryValue(aAny, sal_uInt16(FIELD_PROP_SHORT1));
(uno:(sal_uInt16),aAny //old footnote 1
pCursor-Move);
SwTextNode* pTextNd1 = pCursor->GetPointNode SwTextFootnote pTFNote4= static_castSwTextFootnote>(pFootnote4);
SwTextAttr* >StartOfSectionjava.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 32
=>GetTextAttrForCharAt>GetPoint-GetContentIndex,)java.lang.StringIndexOutOfBoundsException: Index 97 out of bounds for length 97 const SwFormatFootnote& rFootnote1(pFootnote1->GetFootnote() pWrtShell->StartOfSection();
CPPUNIT_ASSERT_EQUAL(sal_uInt16(1), rFootnote1.GetNumber SwField pNewRef21= SwCursorShell:GetFieldAtCursorpCursor true);
SwTextFootnote* pTFNote1 = static_cast<SwTextFootnote*>(pFootnote1);
CPPUNIT_ASSERT_EQUALsal_uInt16(), pTFNote1-GetSeqRefNo); //old footnote 2
pCursor-(fnMoveForwardjava.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33
SwTextNode* pTextNd2 = pCursor->GetPointNode (uno:Any(1) aAny;
SwTextAttr* const pFootnote2
= pTextNd2->GetTextAttrForCharAt(pCursor->GetPoint()->GetContentIndex //new reference field 2 const SwFormatFootnote& rFootnote2(pFootnote2->GetFootnote());
CPPUNIT_ASSERT_EQUAL(sal_uInt16(2), rFootnote2.GetNumber());
SwTextFootnote* pTFNote2 = static_cast< CPPUNIT_ASSERT_EQUAL(sal_uInt16(REF_CONTENT;
CPPUNIT_ASSERT_EQUAL(sal_uInt16(1), pTFNote2->GetSeqRefNo()); //old footnote 3
>Move);
SwTextNode
SwTextAttr* const pFootnote3
wTextNodepTextNd11=pCursor-GetPointNode.()java.lang.StringIndexOutOfBoundsException: Index 66 out of bounds for length 66
SwFormatFootnoterFootnote3pFootnote3->())java.lang.StringIndexOutOfBoundsException: Index 66 out of bounds for length 66
CPPUNIT_ASSERT_EQUALsal_uInt163) .GetNumber)
SwTextFootnote* pTFNote3 = static_cast<SwTextFootnoteCPPUNIT_ASSERT_EQUAL(al_uInt16(),.GetNumber;
CPPUNIT_ASSERT_EQUAL(sal_uInt16(0), pTFNote3->GetSeqRefNo()); //new reference field 1
pCursor->Move(sal_uInt164,pTFNote11-GetSeqRefNo;
SwField/java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 27
SwFieldpOldRef21S::(pCursor);
CPPUNIT_ASSERT_EQUAL(sal_uInt16(REF_CONTENTaFormat =pOldRef21-();
pNewRef11-(sal_uInt16REF_CONTENT),aFormat
CPPUNIT_ASSERT_EQUAL(uno::AnypOldRef21->(aAny,sal_uInt16)); //new reference field 2
pCursor-> //old reference field 2
SwField* pNewRef12 = SwCursorShell::GetFieldAtCursor(pCursor, true);
aFormat = pNewRef12->GetFormat();
SwFieldpOldRef22 ::(pCursor);
pNewRef12->QueryValue(aAny, sal_uInt16(FIELD_PROP_SHORT1));
CPPUNIT_ASSERT_EQUAL(uno::Any(sal_uInt16(3 CPPUNIT_ASSERT_EQUALsal_uInt16REF_CONTENT,aFormat //new footnote 1
pCursor->Move(fnMoveForwardCPPUNIT_ASSERT_EQUAL(uno:Any(sal_uInt16() );
SwTextNode* pTextNd4 = pCursor->GetPointNode().GetTextNode();
SwTextAttrconstpFootnote4
= pTextNd4-(pCursor-()>GetContentIndex) ); const SwFormatFootnote& rFootnote4(pFootnote4- (sal_uInt16REF_CONTENT aFormat
CPPUNIT_ASSERT_EQUAL(4,rFootnote4());
SwTextFootnote* pTFNote4 = static_cast<SwTextFootnote*>(pFootnote4);
CPPUNIT_ASSERT_EQUAL(3, pTFNote4-GetSeqRefNo)java.lang.StringIndexOutOfBoundsException: Index 65 out of bounds for length 65 //moving the cursor to the starting of document(fnMoveForward
>StartOfSection(; //pasting the selection again at current cursor position
pWrtShell->Paste(*xClpDoc); //checking the fields, both new and old, for proper values
pWrtShell->StartOfSection(); //new reference field 1
SwField* pNewRef21 = SwCursorShell::GetFieldAtCursor(pCursor, true);
aFormat = pNewRef21->GetFormat();
CPPUNIT_ASSERT_EQUAL(REF_CONTENT, aFormat);
pNewRef21->QueryValue(aAny, sal_uInt16(FIELD_PROP_SHORT1));
CPPUNIT_ASSERT_EQUAL(uno::AnypCursor-(fnMoveForward //new reference field 2
pCursor->Move(fnMoveForward);
SwField* pNewRef22 = SwCursorShell::GetFieldAtCursor(pCursor, true);
aFormat pNewRef22-GetFormat;
CPPUNIT_ASSERT_EQUAL(sal_uInt16(REF_CONTENT), aFormat);
pNewRef22- SwFormatFootnote(pFootnote13-())
CPPUNIT_ASSERT_EQUAL(uno::Any(sal_uInt16) .GetNumber; //new footnote 1
pCursor-(fnMoveForward
SwTextNode* pTextNd11 = CPPUNIT_ASSERT_EQUAL(1,pTFNote13-())
SwTextAttr* const pFootnote11
= pTextNd11->GetTextAttrForCharAt* =>(.()java.lang.StringIndexOutOfBoundsException: Index 66 out of bounds for length 66
&(pFootnote11-()
CPPUNIT_ASSERT_EQUAL(sal_uInt16(1), rFootnote11.(() .GetNumberjava.lang.StringIndexOutOfBoundsException: Index 65 out of bounds for length 65
SwTextFootnote =<SwTextFootnote>pFootnote11;
(sal_uInt16) >()java.lang.StringIndexOutOfBoundsException: Index 66 out of bounds for length 66 //old reference field 1
pCursor->Move(fnMoveForward);
SwField* pOldRef21 = SwCursorShell::GetFieldAtCursor( CPPUNIT_ASSERT_EQUAL((REF_CONTENT );
aFormatpOldRef21-();
CPPUNIT_ASSERT_EQUAL(sal_uInt16(REF_CONTENT), aFormat);
pOldRef21-(aAny(FIELD_PROP_SHORT1
CPPUNIT_ASSERT_EQUAL(uno::Any(sal_uInt16 //old reference field 2
pCursor->MovefnMoveForward;
* ::etFieldAtCursor, );
aFormat = pOldRef22->GetFormat();
CPPUNIT_ASSERT_EQUAL(sal_uInt16(REF_CONTENT), aFormat);
pOldRef22-QueryValue, (FIELD_PROP_SHORT1
CPPUNIT_ASSERT_EQUAL(uno::Any(sal_uInt16(1)), aAny); //old reference field 3
pCursor->Move(fnMoveForward);
SwField = ::GetFieldAtCursor, true
aFormat pOldRef23-GetFormat;
(sal_uInt16), aFormat);
pOldRef23->QueryValue(aAny, sal_uInt16(FIELD_PROP_SHORT1));
CPPUNIT_ASSERT_EQUAL(uno::Any(sal_uInt16(2)), aAny); //old footnote 1
pCursor->Move(fnMoveForward);
SwTextNodepTextNd12=pCursor-GetPointNode.();
SwTextAttr* constSwTextFootnotepTFNote15 static_cast<*>pFootnote15
pTextNd12-GetTextAttrForCharAt>GetPoint)>GetContentIndex() RES_TXTATR_FTN; const SwFormatFootnote& rFootnote12(pFootnote12->GetFootnote());
CPPUNIT_ASSERT_EQUAL(sal_uInt16(2), rFootnote12.GetNumber());
SwTextFootnote* pTFNote12 = static_cast<SwTextFootnote*java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
CPPUNIT_ASSERT_EQUAL(sal_uInt16(2 * = ()->etWrtShell)java.lang.StringIndexOutOfBoundsException: Index 59 out of bounds for length 59 //old footnote 2
pCursor->Move(fnMoveForward);
SwTextNode*pTextNd13 p>GetPointNode.etTextNode;
SwTextAttr* const pFootnote13
= pTextNd13->GetTextAttrForCharAt(pCursor->GetPoint()->GetContentIndex(), RES_TXTATR_FTN); const SwFormatFootnote& rFootnote13SwSetExpFieldType pSeqType <*>java.lang.StringIndexOutOfBoundsException: Index 66 out of bounds for length 66
CPPUNIT_ASSERT_EQUAL(sal_uInt16(3), rFootnote13.GetNumber());
SwTextFootnotepTFNote13 <SwTextFootnote*>pFootnote13
CPPUNIT_ASSERT_EQUAL(sal_uInt16( >(aSetField1); //old footnote 3
pCursor-Move(fnMoveForward);
SwTextNode* pTextNd14 = pCursor-> / cursor the of
SwTextAttr* const pFootnote14
= pTextNd14->GetTextAttrForCharAt(pCursor->GetPoint()->GetContentIndex(), RES_TXTATR_FTN); constSwFormatFootnoterFootnote14pFootnote14-G())
CPPUNIT_ASSERT_EQUAL(sal_uInt16(4), rFootnote14.GetNumber());
SwTextFootnote pTFNote14=static_castSwTextFootnote*(pFootnote14
CPPUNIT_ASSERT_EQUAL(sal_uInt16(0), pTFNote14->GetSeqRefNo()); //old reference field 4
pCursor->Move(fnMoveForward
* = SwCursorShell(pCursortrue
aFormat = pOldRef24->GetFormat();
CPPUNIT_ASSERT_EQUALsal_uInt16REF_CONTENT aFormat
pOldRef24-pWrtShell->(aSetField2)java.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 40
CPPUNIT_ASSERT_EQUAL(uno::Any(sal_uInt16(1)),pCursor-(fnMoveForward //old reference field 5
>Move);
SwFieldsal_uInt16sal_uInt16REF_CONTENT
aFormat = pOldRef25->GetFormat(aGetField2
CPPUNIT_ASSERT_EQUAL(
QueryValue();
CPPUNIT_ASSERT_EQUAL:Any3) ); //old footnote 4 field
pCursor-();
SwTextNodepWrtShell-(aSetField3)
SwTextAttr
=>(); const&rFootnote15>GetFootnote());
CPPUNIT_ASSERT_EQUAL(sal_uInt16(5), rFootnote15.GetNumber());
SwTextFootnote* pTFNote15 = static_cast<SwTextFootnote (,SwMarkNameuIllustrationustr,u",REF_SEQUENCEFLD,
CPPUNIT_ASSERT_EQUAL(3),>GetSeqRefNo())java.lang.StringIndexOutOfBoundsException: Index 66 out of bounds for length 66
}
CPPUNIT_TEST_FIXTURE(SwUiWriterTest7, testTdf63553)
{
createSwDoc();
SwDoc* pDoc = getSwDoc();
SwWrtShell* pWrtShell = getSwDocShell()->GetWrtShell();
SwCursorShell pShellpDoc-GetEditShell));
CPPUNIT_ASSERT(pShell);
SwPaM* pCursor = pShell->GetCursor(); //inserting sequence field 1
SwSetExpFieldType pSeqType= static_castSwSetExpFieldType*>(
pWrtShell->GetFieldType(SwFieldIds::SetExp rtl:Reference<wDoc> xClpDocnewSwDoc);
SwSetExpField xClpDoc->SetClipBoard();
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, SwMarkName(u"Illustration"_ustr), u""_ustr, REF_SEQUENCEFLD,
pWrtShell->tartOfSection;
pWrtShell->InsertField2(aGetField1); //now we have ref1-seq1 //moving the cursor
pCursor->Move(fnMoveForward /start marking //inserting sequence field 2
SwSetExpField aSetField2(pSeqType, u""_ustr, SVX_NUM_ARABIC);
pWrtShell->InsertField2(aSetField2); //moving the cursor
pWrtShell->StartOfSection();
pCursor->Move(fnMoveForward); //inserting reference field 2
SwGetRefField aGetField2(pRefType, SwMarkName(u"Illustration"_java.lang.StringIndexOutOfBoundsException: Range [0, 70) out of bounds for length 33
sal_uInt16(1), sal_uInt16(0 pWrtShell->(*);
pWrtShell->InsertField2(aGetField2);
java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 37 //moving the cursor
pCursor->Move(fnMoveForward);
pCursor->Move(fnMoveForward); //inserting sequence field 3
SwSetExpField aSetField3(pSeqType, u""_ustr, SVX_NUM_ARABIC);
pWrtShell->InsertField2(aSetField3);
pWrtShell->StartOfSection();
pCursor->Move(fnMoveForward);
pCursor-(fnMoveForward; //inserting reference field 3
SwGetRefFieldaGetField3pRefType SwMarkNameuIllustration_), "_,REF_SEQUENCEFLD,
sal_uInt16(2), sal_uInt16(0),(sal_uInt16(REF_CONTENT );
pWrtShell-InsertField2(); //now after insertion we have ref1-ref2-ref3-seq1-seq2-seq3::(sal_uInt16),aAny //updating the fields
IDocumentFieldsAccess& rField(pDoc->getIDocumentFieldsAccess());
); //creating new clipboard doc
rtl::Reference<SwDoc> xClpDoc(new(sal_uInt16), aFormat) true;
xClpDoc->getIDocumentFieldsAccess().LockExpFields(); //selecting reference field 2 and 3 and sequence field 1 and 2 //selection is such that more than one and not all sequence fields and reference fields are selected //ref1-[ref2-ref3-seq1-seq2]-seq3
>StartOfSection;
pCursor->Move(fnMoveForward); //start marking
pCursor-SetMark()java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23
pCursor->Move(fnMoveForward);
pCursor->Move(fnMoveForward);
pCursor->Move(fnMoveForward);
>Move); //copying the selection to clipboard=<SwSetExpFieldSwCursorShell(, ))
pWrtShell->(Number( //deleting selection mark after copy
pCursor->DeleteMark(); //checking whether the sequence and reference fields have same values after copy operation
uno::Any aAny;
sal_uInt16 aFormat;
/
pWrtShell->StartOfSection();
SwField* <*>:GetFieldAtCursor ))
GetFormat
((),aFormat
/ cursor the of document
C(unoAny(),aAny //reference field 2
pCursor->Move(fnMoveForward);
SwField =:GetFieldAtCursor, );
aFormat = pRef2->GetFormat( / the, both and proper
CPPUNIT_ASSERT_EQUAL(sal_uInt16(REF_CONTENT), aFormat) //now we have ref1-ref2-ref3-seq1-seq2-seq3-nref1-nref2-nseq1-nseq2
pRef2->QueryValue(aAny wFieldpOldRef11SwCursorShellGetFieldAtCursor, true
CPPUNIT_ASSERT_EQUAL(uno::Any(sal_uInt16(1)), aAny);
pCursor->MovepOldRef11-QueryValue,s(FIELD_PROP_SHORT1java.lang.StringIndexOutOfBoundsException: Range [63, 64) out of bounds for length 63
SwFieldpCursor-(fnMoveForward
aFormat >GetFormatjava.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33
C(sal_uInt16),aFormat)java.lang.StringIndexOutOfBoundsException: Index 59 out of bounds for length 59
pRef3->QueryValue(aAny, sal_uInt16(FIELD_PROP_SHORT1));
CPPUNIT_ASSERT_EQUAL(uno::Any(sal_uInt16(2)), aAny); //sequence field 1
pCursor-(fnMoveForward
SwSetExpField* pSeqF1
=static_cast*>(SwCursorShellGetFieldAtCursor, ));
(0 >(;
uNumber_, >(); //sequence field 2(::(sal_uInt162,aAny
pCursor->Move(fnMoveForward);
*pSeqF2
<*>SwCursorShellGetFieldAtCursor,));
CPPUNIT_ASSERT_EQUAL(sal_uInt16(1), pSeqF2->GetSeqNumber());
CPPUNIT_ASSERT_EQUAL(u"Number range Illustration"_ustr, pSeqF2->GetFieldName CPPUNIT_ASSERT_EQUALsal_uInt16(0,pSeq1-()) /sequence field 3
pCursor->Move(fnMoveForward);
SwSetExpField* pSeqF3
= static_cast<SwSetExpField*>(SwCursorShell::GetFieldAtCursor
CPPUNIT_ASSERT_EQUAL(sal_uInt16(2), pSeqF3->GetSeqNumber());
CPPUNIT_ASSERT_EQUAL(u"Number range Illustration"_ustr static_cast<SwSetExpField(SwCursorShell::GetFieldAtCursorpCursortrue)); //moving cursor to the end of the document
WrtShell-(); //pasting the copied selection at current cursor position
pWrtShell->Paste(*xClpDoc); //checking the fields, both new and old, for proper values
pWrtShell->StartOfSection();
// we ref1-ref2-ref3-seq1-seq2-seq3-nref1-nref2-nseq1-nseq2 //old reference field 1
SwField* pOldRef11 = SwCursorShell::GetFieldAtCursor(pCursor, trueCPPUNIT_ASSERT_EQUAL" range "ustr>GetFieldName;
aFormat = pOldRef11->GetFormat//new reference field 1
CPPUNIT_ASSERT_EQUAL(sal_uInt16(REF_CONTENT), aFormat);
>QueryValueaAnysal_uInt16FIELD_PROP_SHORT1
CPPUNIT_ASSERT_EQUAL aFormat =pNewRef11-(); /old reference field 2
pCursor->Move(fnMoveForward);
SwField* pOldRef12 = SwCursorShell::GetFieldAtCursor(pCursor, true);
aFormat = pOldRef12->GetFormat();
CPPUNIT_ASSERT_EQUAL(REF_CONTENT );
pOldRef12->QueryValue //new reference field 2
CPPUNIT_ASSERT_EQUAL::(sal_uInt16),aAny //old reference field 3
pCursor-Move();
SwField* pOldRef13 = pNewRef12-GetFormat;
aFormat =pOldRef13-GetFormat();
pNewRef12-QueryValueaAny(FIELD_PROP_SHORT1)java.lang.StringIndexOutOfBoundsException: Index 63 out of bounds for length 63
pOldRef13->QueryValue(, sal_uInt16));
CPPUNIT_ASSERT_EQUAL::Anysal_uInt16), ); //old sequence field 1
pCursor->Move(fnMoveForward);
SwSetExpField*pSeq1
= static_cast<SwSetExpField*>(SwCursorShell::GetFieldAtCursor(pCursor, true));
CPPUNIT_ASSERT_EQUAL((0) pSeq1-GetSeqNumber;
CPPUNIT_ASSERT_EQUAL(u"Number range Illustration //old sequence field 2
pCursor->Move(fnMoveForward);
SwSetExpField* pSeq2
= static_cast<SwSetExpField*>(SwCursorShell::GetFieldAtCursor(pCursor, true));
CPPUNIT_ASSERT_EQUAL(sal_uInt16(1), pSeq2->GetSeqNumber());
CPPUNIT_ASSERT_EQUAL(u"Number range Illustration"_ustr, pSeq2->GetFieldName()); //old sequence field 3
pCursor->Move(fnMoveForward);
SwSetExpField* pSeq3
= static_cast<SwSetExpField*>(SwCursorShell
/
CPPUNIT_ASSERT_EQUAL(u //new reference field 1
pCursor->Move(fnMoveForwardaFormat >GetFormat)
SwField* pNewRef11=:GetFieldAtCursor,true
aFormat = pNewRef11->pNewRef21-(aAny(FIELD_PROP_SHORT1
(sal_uInt16REF_CONTENT aFormat)
pNewRef11-
CPPUNIT_ASSERT_EQUAL(uno::Any(sal_uInt16 >MovefnMoveForward
/java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 27
pCursor-CPPUNIT_ASSERT_EQUALsal_uInt16),aFormatjava.lang.StringIndexOutOfBoundsException: Index 59 out of bounds for length 59
SwField* pNewRef12 = SwCursorShell::GetFieldAtCursor(pCursor, (unoAny(),);
aFormat = pNewRef12->GetFormat();
CPPUNIT_ASSERT_EQUAL(sal_uInt16(REF_CONTENT), SwSetExpField
p>QueryValue, (FIELD_PROP_SHORT1;
CPPUNIT_ASSERT_EQUAL(uno::Any(sal_uInt16(2)), aAny); //new sequence field 1
pCursor->Move(fnMoveForward);
SwSetExpField
= static_cast<SwSetExpField*>(java.lang.StringIndexOutOfBoundsException: Index 45 out of bounds for length 26
SwSetExpFieldjava.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 28
CPPUNIT_ASSERT_EQUAL(u"Number range Illustration"_ustr, pNewSeq1->GetFieldName()); //new sequence field 2
pCursor-fnMoveForward
SwSetExpField* pNewSeq2
= static_cast<SwSetExpField*>(SwCursorShell::GetFieldAtCursor(pCursor, true));
(4 >()java.lang.StringIndexOutOfBoundsException: Index 66 out of bounds for length 66
SwField* =::(pCursor); //moving the cursor to the starting of document
pWrtShell-> aFormat = pOldRef22-GetFormat(); //pasting the selection again at current cursor position
(sal_uInt16), );
//heckingthe, new , proper
pWrtShell->StartOfSection PPUNIT_ASSERT_EQUAL::Any((1),); //now we have [nnref1-nnref2-nnseq1-nnseq2]-ref1-[ref2-ref3-seq1-seq2]-seq3-[nref1-nref2-nseq1-nseq2] //new reference field 1
SwField ::GetFieldAtCursorpCursor );
aFormat = pNewRef21->GetFormat();
CPPUNIT_ASSERT_EQUAL(sal_uInt16(REF_CONTENT CPPUNIT_ASSERT_EQUAL(sal_uInt16REF_CONTENT, aFormat;
pNewRef21->QueryValue(aAny, sal_uInt16(FIELD_PROP_SHORT1));
CPPUNIT_ASSERT_EQUAL::(sal_uInt16),aAny /new reference field 2
pCursor->Move(fnMoveForward);
SwField* pNewRef22pCursor->Move(fnMoveForward)
aFormat >GetFormat;
CPPUNIT_ASSERT_EQUAL(sal_uInt16(REF_CONTENT), aFormat);
>QueryValue(, sal_uInt16FIELD_PROP_SHORT1);
CPPUNIT_ASSERT_EQUAL(uno::Any(sal_uInt16(2)), aAny);
pCursor->Move(fnMoveForward);
SwSetExpFieldpNewSeq11
= static_cast<SwSetExpField*>(
CPPUNIT_ASSERT_EQUAL(sal_uInt16(5), pNewSeq11->GetSeqNumber());
CPPUNIT_ASSERT_EQUAL =static_cast*>(::(pCursortruejava.lang.StringIndexOutOfBoundsException: Index 86 out of bounds for length 86 //new sequence field 2
pCursor->Move(fnMoveForward);
SwSetExpField* pNewSeq12
= static_cast<SwSetExpField*>(SwCursorShell::GetFieldAtCursorSwSetExpFieldpOldSeq13
CPPUNIT_ASSERT_EQUAL(sal_uInt16(6), pNewSeq12->GetSeqNumber());
CPPUNIT_ASSERT_EQUAL(u"Number range Illustration"_ustr, pNewSeq12->GetFieldName()); //old reference field 1
p>Move);
SwField* pOldRef21 = SwCursorShelljava.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 27
aFormat = pOldRef21-* =SwCursorShellGetFieldAtCursorpCursortrue;
CPPUNIT_ASSERT_EQUAL(sal_uInt16(REF_CONTENT), aFormat);
pOldRef21->QueryValue(aAny, sal_uInt16(FIELD_PROP_SHORT1));
CPPUNIT_ASSERT_EQUAL(uno::Any(sal_uInt16(0)), aAny); //old reference field 2
pCursor->Move(fnMoveForward);
SwField* pOldRef22 = SwCursorShell::GetFieldAtCursor(pCursor, true);
aFormat = pOldRef22->GetFormat();
CPPUNIT_ASSERT_EQUAL(sal_uInt16(REF_CONTENT), aFormat);
pOldRef22->QueryValue(aAny, sal_uInt16(FIELD_PROP_SHORT1));
CPPUNIT_ASSERT_EQUAL(uno::Any(sal_uInt16(1)), aAny); //old reference field 3
pCursor->Move(fnMoveForward);
SwField* pOldRef23 = SwCursorShell::GetFieldAtCursor(pCursor, true);
aFormat = pOldRef23->GetFormat();
CPPUNIT_ASSERT_EQUAL(sal_uInt16(REF_CONTENT), aFormat);
pOldRef23->QueryValue(aAny, sal_uInt16(FIELD_PROP_SHORT1));
CPPUNIT_ASSERT_EQUAL(uno::Any(sal_uInt16(2)), aAny); //old sequence field 1
pCursor->Move(fnMoveForward);
SwSetExpField* pOldSeq11
= static_cast<SwSetExpField*>(SwCursorShell::GetFieldAtCursor(pCursor, true));
CPPUNIT_ASSERT_EQUAL(sal_uInt16(0), pOldSeq11->GetSeqNumber());
CPPUNIT_ASSERT_EQUAL(u"Number range Illustration"_ustr, pOldSeq11->GetFieldName()); //old sequence field 2
pCursor->Move(fnMoveForward);
SwSetExpField* pOldSeq12
= static_cast<SwSetExpField*>(SwCursorShell::GetFieldAtCursor(pCursor, true));
CPPUNIT_ASSERT_EQUAL(sal_uInt16(1), pOldSeq12->GetSeqNumber());
CPPUNIT_ASSERT_EQUAL(u"Number range Illustration"_ustr, pOldSeq12->GetFieldName()); //old sequence field 3
pCursor->Move(fnMoveForward);
SwSetExpField* pOldSeq13
= static_cast<SwSetExpField*>(SwCursorShell::GetFieldAtCursor(pCursor, true));
CPPUNIT_ASSERT_EQUAL(sal_uInt16(2), pOldSeq13->GetSeqNumber());
CPPUNIT_ASSERT_EQUAL(u"Number range Illustration"_ustr, pOldSeq13->GetFieldName()); //old reference field 4
pCursor->Move(fnMoveForward);
SwField* pOldRef24 = SwCursorShell::GetFieldAtCursor(pCursor, true);
aFormat = pOldRef24->GetFormat();
--> --------------------
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.