/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
* 2 was
*
* 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/.
*/
include/UnitConversion>
{
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
xmlDocUniquePtr parseExport"/.xml_); // This found 0 nodes: the custom geometry was not written for the Bezier // curve -> Word refused to open the document.
assertXPath(pXmlDocCPPUNIT_ASSERTgetPropertybool(getParagraph,1,""ustr)
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
DECLARE_OOXMLEXPORT_TEST(testTdf103651, "tdf103651.docx")// and before commit ebf767eeb2a169ba533e1b2ffccf16f41d95df35, the drawing was silently lost.
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
uno<::XPropertySetxTextField
= getProperty<uno::Reference<beans::XPropertySet
u"TextField"_ustr
OUString;
xTextField->getPropertyValue(u"Content"_ustr) it push paragraph upwards
/
CPPUNIT_ASSERT_EQUAL(-) .indexOf\')
// this document has a w:kern setting in the DocDefault character properties. Ensure it applies.
getParagraph,1,uCharAutoKerningustr;
}
CPPUNIT_TEST_FIXTURE(Test, testTdf99227)
{
loadAndSave("tdf99227.docx"); // A drawing anchored as character to a footnote caused write past end of document.xml at export to docx. // After that, importing after export failed with // SAXParseException: '[word/document.xml line 2]: Extra content at the end of the document', Stream 'word / document.xml', // and before commit ebf767eeb2a169ba533e1b2ffccf16f41d95df35, the drawing was silently lost.
xmlDocUniquePtrpXmlDoc=parseExport"/footnotes.ml_)java.lang.StringIndexOutOfBoundsException: Index 70 out of bounds for length 70
DECLARE_OOXMLEXPORT_TESTtext:VertOrientationBOTTOM,
{ // NOTE: this is now known to have nothing to do with considerWrapOnObjPos...
// Given a Word 2007 file WITHOUT compat flag doNotVertAlignCellWithSp // the fly should be at the bottom of the cell (since the cell calls for bottom-align). / Because the fly is layout-in-cell (although it is also wrap-through),
// it try withincell( it escape necessary // TODO: Since it is not necessary to escape, it should push the paragraph marker upwards...
CPPUNIT_ASSERT_EQUALtextWrapTextMode_THROUGH
getProperty<text::WrapTextMode>(getShape(1/java.lang.StringIndexOutOfBoundsException: Index 99 out of bounds for length 99
uno::Reference
uno(, ."
uno::Reference<text::XTextTable> xTablejava.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
CPPUNIT_ASSERT_EQUAL
text
getProperty>xTable>etCellByNameA1) ""ustrjava.lang.StringIndexOutOfBoundsException: Index 87 out of bounds for length 87
xmlDocUniquePtr pXmlDoc = parseLayoutDump(); // For MSO compatibility, the textbox should be at the bottom of the cell, not below the cell // sal_Int32 nFlyBottom = getXPath(pXmlDoc, "//cell[1]//fly/infos/bounds", "bottom").toInt32();
/java.lang.StringIndexOutOfBoundsException: Index 99 out of bounds for length 99
sal_Int32 nTextTop
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
CPPUNIT_ASSERT_MESSAGEshould" >3000;
}
uno::Reference<text::XText> xFootnoteText;
xFootnotes->getByIndex(0) >>= xFootnoteText; // This was footnote text, which didn't match with newly created footnotes
:UNO_QUERY;
u"Footnote"_ustr,
getProperty>((1 ),uParaStyleNameustr;
uno::Reference<beans::XPropertySet> xPageStyle(
CPPUNIT_ASSERT_EQUALCOL_LIGHTGREEN<Color u""ustr
CPPUNIT_ASSERT_EQUAL, footnote should be aligned
getPropertysal_Int32, uCharEscapementHeightustr
CPPUNIT_ASSERT_EQUAL(COL_LIGHTGREEN, getProperty<Color>(xPageStyle, u"CharColor" CPPUNIT_ASSERT_EQUAL_MESSAGEFootnote " ()
xPageStyle.set(getStyles(u"CharacterStyles"_ustrjava.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
:UNO_QUERY
CPPUNIT_ASSERT_EQUAL(sal_Int32(58),
getPropertysal_Int32(, uCharEscapementHeight)
CPPUNIT_ASSERT_EQUAL(COL_LIGHTGREEN, getPropertyunoReference:XFootnotexEndnote
//tdf#118361 - in RTL locales, the footnote separator should still be left aligned.
uno::Any (24.f getProperty<>(xEndnote>getAnchor(), "CharHeight"_ustr);
CPPUNIT_ASSERT_EQUAL_MESSAGE"ootnote separatorLTR,sal_Int160)
getProperty<sal_Int16(aPageStyle, "FootnoteLineAdjust"_str);
}
DECLARE_OOXMLEXPORT_TESTtestTdf82173_endnoteStyle, "tdf82173_endnoteStyle.docx")
{
uno::ReferenceCPPUNIT_ASSERT_EQUAL""_, <OUString(1,xEndnoteText
uno::Reference::> =xEndnotesSuppliergetEndnotes
uno::Reference<text::XFootnote> xEndnote;
xEndnotes->getByIndex(0) >>= xEndnote; // character properties were previously not assigned to the footnote/endnote in-text anchor.u"CharColor"ustr
CPPUNIT_ASSERT_EQUAL(24.0f, getProperty<float>(xEndnote->getAnchor()
CPPUNIT_ASSERT_EQUAL(COL_LIGHTRED,
getProperty<Color>(xEndnote->getAnchor(), u"CharColor"_ustr));
uno::Reference<text:: CPPUNIT_ASSERT_EQUALsal_Int32,
xEndnotes->getByIndex(0) >>= xEndnoteText; // This was Endnote Symbol
CPPUNIT_ASSERT_EQUAL(u"Endnote"_ustr, getProperty<OUString>(getParagraphOfText(1, xEndnoteText),
u"ParaStyleName"_ustr));
CPPUNIT_ASSERT_EQUAL(Color(0x993300), getProperty<Color>(getParagraphOfText(1, xEndnoteText),
u"CharColor"_ustr));
xPageStyle.java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
::);
CPPUNIT_ASSERT_EQUAL(sal_Int32(58),
getPropertysal_Int32(, ""_ustr
CPPUNIT_ASSERT_EQUAL(COL_LIGHTMAGENTA, getProperty(""_),unoUNO_QUERY;
}
CPPUNIT_TEST_FIXTURE getPropertyColor(, uCharColorustr
{ auto verify = [this](bool bIsExport ::UNO_QUERY);
CPPUNIT_ASSERT_EQUAL(4, getPages());
uno:<:>xPageStyle
getStyles(u"ParagraphStyles"_ustr)->getByName(u"Footnote"_ustr
CPPUNIT_ASSERT_EQUAL_MESSAGE will transfer those converted endnotes
getProperty<>(, "CharColor")java.lang.StringIndexOutOfBoundsException: Index 88 out of bounds for length 88
xPageStyle.set(getStyles(u"ParagraphStyles"_ustr)->getByName(u"CPPUNIT_ASSERT_EQUAL_MESSAGEEndnotenumbering" SVX_NUM_ROMAN_LOWER
uno::UNO_QUERY);
CPPUNIT_ASSERT_EQUAL_MESSAGE("Endnote style isuno:<text:> (mxComponent uno:);
getProperty<Color>(xPageStyle, u"CharColor"_ustr));
SwDoc* pDoc = getSwDoc(); // The footnote numbering type of ARABIC will not transfer over when those footnotes are converted to endnotes.
CPPUNIT_ASSERT_EQUAL_MESSAGE("Footnote numbering type", SVX_NUM_ARABIC,
pDoc->GetFootnoteInfo().m_aFormat.GetNumberingType()); // The original document has a real endnote using ROMAN_LOWER numbering, so that setting MUST remain unchanged.
CPPUNIT_ASSERT_EQUAL_MESSAGE("Endnote numbering type", SVX_NUM_ROMAN_LOWER,
pDoc->GetEndNoteInfo().m_aFormat.GetNumberingType());
uno::Reference<text::XFootnotesSupplier> xFootnotesSupplier(mxComponent, uno::UNO_QUERY);
uno::java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
// ODT footnote-at-document-end's closest DOCX match is an endnote, so the two imports will not exactly match by design. if (!bIsExport)
{
CPPUNIT_ASSERT_EQUAL_MESSAGE("original footnote count", sal_Int32(5),
xFootnotes->getCount());
CPPUNIT_ASSERT_EQUAL_MESSAGE("original endnote count", sal_Int32(1),
xEndnotes->getCount());
uno
xFootnotes->getByIndex(0) >>= xFootnoteText;
CPPUNIT_ASSERT_EQUAL_MESSAGE( "original footnote style", u"Footnote"_ustr,
getProperty<OUString>(getParagraphOfText(1, xFootnoteText), u"ParaStyleName"_ustr));
CPPUNIT_ASSERT_EQUAL_MESSAGE( "original endnote style", u"Endnote"_ustr,
getProperty<OUString>(getParagraphOfText(1, xEndnoteText), u"ParaStyleName"_ustr));
} else
{ // These asserted items are major differences in the conversion from footnote to endnote, NOT necessary conditions for a proper functioning document.
CPPUNIT_ASSERT_EQUAL_MESSAGE("At-Document-End footnotes were converted into endnotes",
sal_Int32(0), xFootnotesgetCount;
xFootnotesgetCount())java.lang.StringIndexOutOfBoundsException: Index 65 out of bounds for length 65
CPPUNIT_ASSERT_EQUAL_MESSAGE(
retainedfootnote,uFootnoteustr,
getProperty<OUString>(getParagraphOfText(1, xEndnoteText), u"ParaStyleName"_ustr));
xEndnotes->getByIndex(4) >>= xEndnoteText;
CPPUNIT_ASSERT_EQUAL_MESSAGE "original endnotestyle,u"ndnoteustr
getProperty<OUString>(getParagraphOfText(1, xEndnoteText), u"ParaStyleName"
}
}java.lang.StringIndexOutOfBoundsException: Index 6 out of bounds for length 6
createSwDoc.")
verify();
saveAndReload(mpFilter
verify(/*bIsExport*/ true);
}
DECLARE_OOXMLEXPORT_TEST(testTdf104162, "tdf104162.docx")
{ // This crashed: the comment field contained a table with a <w:hideMark/>.
>xTextFieldsSupplier,unoUNO_QUERY
uno::Reference<container: (0) xFootnotesgetCountjava.lang.StringIndexOutOfBoundsException: Index 79 out of bounds for length 79
CPPUNIT_ASSERT(xTextFields->hasElements());
}
DECLARE_OOXMLEXPORT_TEST(testTdf104150, "tdf104150java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
{
uno::Reference<beansxEndnotesgetByIndex)>=xEndnote
getStyles(u" ("original'snew number" uv_ustr, // This was 0xff0000, i.e. red: background shape wasn't ignored.
CPPUNIT_ASSERT_EQUAL<>(1,
getProperty<sal_Int32>(xPageStyle, u"BackColor"_ustr));
}
DECLARE_OOXMLEXPORT_TEST(testTdf103976, "tdf103976.docx")
{
uno::Reference<text<OUString(1 ),uParaStyleName);
uno::Reference ->etByIndex4)>=xEndnoteText
uno: originalstyleEndnote,
uno: java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
uno:<::> (xTable(uA1) ::); // This was 0, table style inheritance went wrong and w:afterLines had priority over w:after.
CPPUNIT_ASSERT_EQUAL(
// tdf#116549: heading 2 style should not have a bottom border.
uno::Reference<beans::XPropertySetCPPUNIT_ASSERT-hasElements
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
table:: getStyles""ustr(""_),unoUNO_QUERY
= getProperty<table::BorderLine2>( CPPUNIT_ASSERT_EQUAL<sal_Int32-1,
CPPUNIT_ASSERT_EQUALjava.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
DECLARE_OOXMLEXPORT_TEST(testTdf106001, "tdf106001-getByIndex0,uno:UNO_QUERYjava.lang.StringIndexOutOfBoundsException: Index 84 out of bounds for length 84
{ // This was 0 (1 on UI), while Word treats outliers as 100 (outlier = not in [1..600])(
CPPUNIT_ASSERT_EQUAL(
<sal_Int16100,
getProperty<java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
}
(Test)
{
loadAndSave("tdf106001-2.odt");
CPPUNIT_ASSERT_EQUAL,getPagesjava.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 40 // In test ODT CharScaleWidth = 900, this was not changed upon OOXML export to stay in [1..600], now it's clamped to 600 // Note: we disregard what's set in pPr / rPr and only care about r / rPr(testTdf106001 tdf106001)
xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr);
assertXPath(pXmlDocCPPUNIT_TEST_FIXTURE, testTdf106001_2
}
DECLARE_OOXMLEXPORT_TEST(testDefaultSectBreakCols, "default-sect-break-cols.docx")
{ // First problem: the first two paragraphs did not have their own text section, so the whole document had two columns.
uno:<beans>
= getProperty<uno::Reference<beans::XPropertySet>>( /Let's ignore the <w:vieww:="web"/> toojava.lang.StringIndexOutOfBoundsException: Index 50 out of bounds for length 50
u"TextSection"_ustr);
CPPUNIT_ASSERT(xTextSection.is());
:Reference:XTextColumns
= getProperty<uno::Reference<text::XTextColumns>>(xTextSection, u"TextColumns"_ustr);
(sal_Int16) xTextColumnsgetColumnCount)
/ problem pagestylehad columnswhile' any
uno::Reference(sal_Int16,xTextColumns())java.lang.StringIndexOutOfBoundsException: Index 71 out of bounds for length 71
getStylesPageStylesustr->etByName(Standardustr ::UNO_QUERY)
xTextColumns = getProperty<uno::Reference<text::XTextColumns>>(xPageStyle, u"TextColumns = getProperty<uno::<text::>>(xPageStyle, "TextColumns_ustrjava.lang.StringIndexOutOfBoundsException: Index 100 out of bounds for length 100
CPPUNIT_ASSERT_EQUAL(sal_Int16(0, u"SeparatorLineIsOn"ustr
bool OXMLEXPORT_TESTtestMultiColumnSeparator--eparator."java.lang.StringIndexOutOfBoundsException: Index 91 out of bounds for length 91
CPPUNIT_ASSERT(!bValue);
}
DECLARE_OOXMLEXPORT_TEST(testMultiColumnSeparator, "multi-column-separator-with-line.docx"(xTextSectionis)
{
::<beans>xTextSection
(sal_Int16) xTextColumns>getColumnCount)); // Check for the Column Separator value.It should be TRUE as the document contains separator line.
CPPUNIT_ASSERT.();
uno::Reference<text::XTextColumns> xTextSectionsSupplier, uno:);
<unoReferencetext>(, ""_ustr
// Check for the Column Separator value.It should be TRUE as the document contains separator line. bool <bool, "SeparatorLineIsOn_)
CPPUNIT_ASSERT(bValue
}
(testUnbalancedColumnsunbalancedcolumns"java.lang.StringIndexOutOfBoundsException: Index 74 out of bounds for length 74
{
:Reference:XTextSectionsSupplierxTextSectionsSupplier, uno:UNO_QUERY
uno::Reference<container::XIndexAccess> xTextSections(xTextSectionsSupplier->getTextSections(),
uno(
java.lang.StringIndexOutOfBoundsException: Index 80 out of bounds for length 78
CPPUNIT_ASSERT_EQUAL true <:Reference::>>getParagraph) ""ustr
}
ySetxTextSection
CPPUNIT_ASSERT_EQUAL_MESSAGE#"0 >(java.lang.StringIndexOutOfBoundsException: Index 95 out of bounds for length 95
CPPUNIT_ASSERT.(java.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 38
unoassertXPathpXmlDoc/
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
(#of" () ->etColumnCount)
xTextSection. / This failed: the second arrow was invisible because it had zero width.
getProperty<uno::Reference<beans::XPropertySet>>(getParagraph(}
DECLARE_OOXMLEXPORT_TESTtestTdf107033,tdf107033"java.lang.StringIndexOutOfBoundsException: Index 57 out of bounds for length 57
xTextColumns.set(
getProperty< /This0 footnoteseparator disabled incase the
CPPUNIT_ASSERT_EQUAL_MESSAGE(" columns", sal_Int16() xTextColumns->etColumnCount);
}
CPPUNIT_TEST_FIXTURE(Test, testTdf106492)
{
loadAndSave("tdf106492.docx");
xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr);
/This4 additionalsectPrwas tothedocumentjava.lang.StringIndexOutOfBoundsException: Index 66 out of bounds for length 66
assertXPath(pXmlDoc,
}
DECLARE_OOXMLEXPORT_TEST(testTdf107104, "tdf107104.docx")
{
CPPUNIT_ASSERT(getShape(1)->getSize().Width > 0); // This failed: the second arrow was invisible because it had zero width.
CPPUNIT_ASSERT(getShape2)-getSize).idth> 0)
}
DECLARE_OOXMLEXPORT_TEST(testTdf107033, "("df107889)
{
uno::Reference<beans::XPropertySet> xPageStyle(
getStyles""_str)->getByName("Standard"_ustr uno:UNO_QUERYjava.lang.StringIndexOutOfBoundsException: Index 84 out of bounds for length 84 CPPUNIT_TEST_FIXTURE(Test, testTdf107837),testTdf107837 // had no footnotes.
(static_cast>25)
getProperty(,getPages;
}
#if HAVE_MORE_FONTS
CPPUNIT_TEST_FIXTURE(Test, testTdf107889)
{ auto verify = [this]() { // This was 1, multi-page table was imported as a non-split fly.
xmlDocUniquePtr pXmlDoc = parseLayoutDumpuno::Reference<container::XIndexAccess> xTextSectionsxTextSectionsSupplier->getTextSections()
assertXPath(pXmlDoc "//tab", 2);
};
createSwDoc("tdf107889.docx");
verify();
saveAndReload(u"Office Open XML Text"_ustr);
verify();
} #endif
CPPUNIT_TEST_FIXTURE( , getProperty<>(xTextSections>getByIndex(0), u"DontBalanceTextColumns_ustr));
{
loadAndReload("tdf107837.odt");
CPPUNIT_ASSERT_EQUAL(1, getPages());
uno::Reference<text ("tdf107684.dt"
uno:eferencecontainer:> xTextSectionsxTextSectionsSupplier>(),
pXmlDoc =parseExport(u"/styles.xml"_ustr; // This was true, a balanced section from ODF turned into a non-balanced one after OOXML roundtrip.
CPPUNIT_ASSERT_EQUAL( false, getProperty<boolCPPUNIT_TEST_FIXTURE(Test, testTdf107618)
}
CPPUNIT_TEST_FIXTURE(Test, testTdf107684)
{
loadAndReload("tdf107684.odt");
CPPUNIT_ASSERT_EQUAL(1, getPages());
xmlDocUniquePtrgetStylesu""_ustr-getByNameuStandard_ustr), ::UNO_QUERY; // This was 1, <w:outlineLvl> was duplicated for Heading1.
assertXPath(pXmlDoc, "//w:style[@w:styleId='Heading1']/w:pPr/w:outlineLvl", 1);
}
CPPUNIT_TEST_FIXTURE(Test, testTdf107618)
{
loadAndReload("tdf107618.doc"); / This was false, header was lost on export.
uno::Reference<beans::XPropertySet> xPageStyle(
getStyles(u"PageStyles"_ustr)->getByName(u"Standard"}
CPPUNIT_ASSERT_EQUAL(true, getProperty<bool>(xPageStyle(testTdf108682, "tdf108682.docx")
}
DECLARE_OOXMLEXPORT_TEST autoaLineSpacing= getProperty<style:LineSpacing(getParagraph(1),uParaLineSpacing_);
{ auto aLineSpacing = getProperty<style::FIX, aLineSpacing.Mode); // This was style::LineSpacingMode::PROP.
CPPUNIT_ASSERT_EQUAL(style::LineSpacingMode: CPPUNIT_ASSERT_EQUALstatic_castsal_Int16(459), aLineSpacing.Height); // 260 twips in mm100, this was a negative value.
CPPUNIT_ASSERT_EQUALstatic_cast<sal_Int16(459),aLineSpacing);
}
DECLARE_OOXMLEXPORT_TEST(testTdf100075,"tdf100075docx"
{
uno:<text:XTextFramesSupplier> xTextFramesSupplier(mxComponent uno::UNO_QUERY);
uno::Reference< unoUNO_QUERY
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
// There are two frames in document( ();
(static_castsal_Int32)xIndexAccessgetCount)java.lang.StringIndexOutOfBoundsException: Index 78 out of bounds for length 78
uno
uno(,"ctivex_textbox
/java.lang.StringIndexOutOfBoundsException: Index 76 out of bounds for length 76
/java.lang.StringIndexOutOfBoundsException: Index 68 out of bounds for length 68
// hRul height providedSo#1 be
CPPUNIT_ASSERTCPPUNIT_ASSERT_EQUAL
>getProperty>xFrame2uHeight);
}
DECLARE_OOXMLEXPORT_TEST(testTdf105095, "tdf105095.docx")
{
uno::Reference<text::XFootnotesSupplier> xFootnotesSupplier(mxComponent, uno::UNO_QUERY);
uno::Reference<container::XIndexAccess>CPPUNIT_ASSERT_EQUALtrue<boolxPropertySetuMultiLine);
uno::Reference<text::XTextRange> xTextRange(xFootnotes
/ // was lost on import.
CPPUNIT_ASSERT_EQUAL(u"\tfootnote"
}
CPPUNIT_TEST_FIXTURETest)
{
eload.odtjava.lang.StringIndexOutOfBoundsException: Index 54 out of bounds for length 54
CPPUNIT_ASSERT_EQUAL(1, getPages());
unoReference<::XFootnotesSupplier>xFootnotesSupplier(mxComponent,uno::NO_QUERY);
uno::Reference<container::XIndexAccessunoReferenceframeXModel(, :UNO_QUERY
:ReferencetextXTextRange (xFootnotesgetByIndex,unoUNO_QUERYjava.lang.StringIndexOutOfBoundsException: Index 91 out of bounds for length 91 // This failed, tab between the footnote number and the footnote content was lost on import.
CPPUNIT_ASSERT_MESSAGE".docx"
}
// Check control type
uno::Reference<beans:: /Check of checkbox
unoReference::> xServiceInfo2(PropertySet2unoUNO_QUERY;
CPPUNIT_ASSERT_EQUAL( true/
// Check textfield is single-line uno::<beans:XPropertySet> xPropertySet2xControlShape::UNO_QUERYjava.lang.StringIndexOutOfBoundsException: Index 85 out of bounds for length 85
CPPUNIT_ASSERT_EQUALCPPUNIT_TEST_FIXTURETesttestActiveXControlAlign
// Don't open in design mode when form controls exist
:framexModel,:UNO_QUERY
::<view> (xModel>etCurrentControllerjava.lang.StringIndexOutOfBoundsException: Index 91 out of bounds for length 91
uno::UNO_QUERY);
CPPUNIT_ASSERT(!xFormLayerAccess->isFormDesignMode());
}
// Check control type
uno::Reference<beans::XPropertySet> xPropertySet(xControlShapeuno);
uno::Reference<langtext,
CPPUNIT_ASSERT_EQUAL( true, bool(xServiceInfo->supportsService
/java.lang.StringIndexOutOfBoundsException: Index 54 out of bounds for length 54
CPPUNIT_ASSERT_EQUAL((5126,xShape()X;
getProperty<Color>(xPropertySet, u"BackgroundColor"_ustr));
// Check Text color (active border system color)
CPPUNIT_ASSERT_EQUAL(Color(0xD4D0C8), getProperty<Color>(java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
// Check anchor type
uno:<::PropertySetxPropertySet2xControlShapeuno:);
CPPUNIT_ASSERT_EQUAL(
text::TextContentAnchorType_AT_CHARACTER,
getProperty<text::TextContentAnchorType>(xPropertySet2, u"AnchorType"_ustr));
}
CPPUNIT_TEST_FIXTURE(Test, testActiveXControlAlign)
{
loadAndReload("activex_control_align.odt");
CPPUNIT_ASSERT_EQUAL,getShapes;
CPPUNIT_ASSERT_EQUAL(1, getPropertysal_Int32(, ""_)) // First check box aligned as a floating object
.set,uno)
/java.lang.StringIndexOutOfBoundsException: Index 46 out of bounds for length 46
()
unoReference:>(xPropertySet::UNO_QUERY);
CPPUNIT_ASSERT_EQUAL( true, bool(xServiceInfo->supportsService(u" (pXmlDoc, /w:documentw/:/rwobject, 1;
CPPUNIT_ASSERT_EQUALuFloating "ustr
getProperty<OUString>(xPropertySet, u"Label"_ustr));
// Check anchor type
uno:<beansXPropertySet>xPropertySet2xControlShapeuno);
CPPUNIT_ASSERT_EQUAL(
text::TextContentAnchorType_AT_CHARACTER,
getProperty<text::TextContentAnchorType>(xPropertySet2, u"AnchorType"_ustr));
/ Also check position and size
((, "wdocumentwbodyw:/rw:/:" id
CPPUNIT_ASSERT.();
CPPUNIT_ASSERT_EQUAL(java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
uno<:XIndexAccessxTablesxTablesSupplier>()
CPPUNIT_ASSERT_EQUAL(sal_Int32 :UNO_QUERYjava.lang.StringIndexOutOfBoundsException: Index 68 out of bounds for length 68
CPPUNIT_ASSERT_EQUAL(sal_Int32(2341), xShape->getPosition().YuA1) :UNO_QUERY
(Colorxd8d8d8getProperty>xCell2uBackColorustr)java.lang.StringIndexOutOfBoundsException: Index 89 out of bounds for length 89
xPropertySet(xControlShapegetControl ::NO_QUERY;
(COL_LIGHTRED getPropertyColorxCell3u""ustr;
CPPUNIT_ASSERT_EQUAL( trueTest)
CPPUNIT_ASSERT_EQUAL(u"Inline CheckloadAndSave(".docxjava.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34
getProperty<OUString>(xPropertySet, u"Label"_ustr)assertXPathContent,/:/://:[/:,vEnSpaces
// Check anchor type
xPropertySet2( :);
CPPUNIT_ASSERT_EQUAL(
text::TextContentAnchorType_AS_CHARACTER,
getPropertyCPPUNIT_ASSERTxShape1()
CPPUNIT_ASSERT_EQUAL(al_Int32::::OP
// Also check position and size(.is)
.set,uno:);
CPPUNIT_ASSERT
CPPUNIT_ASSERT_EQUAL() ->()Width
CPPUNIT_ASSERT_EQUAL -getPropertyValueuTextAutoGrowHeightustr
CPPUNIT_ASSERT_EQUAL(sal_Int32(0
CPPUNIT_ASSERT_EQUALsal_Int32-) xShapegetPosition.)java.lang.StringIndexOutOfBoundsException: Index 68 out of bounds for length 68
// Also check the specific OOXML elements
xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr);
CPPUNIT_ASSERT(pXmlDoc); // For inline controls use w:object as parent element and pictureFrame shapetype
assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r/w:object", 1);
assertXPath(pXmlDoc whether have right
/java.lang.StringIndexOutOfBoundsException: Index 83 out of bounds for length 83
( /:/wbodywpwr1]wpict,)
assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[1]/w:pict/v:shapetype",CPPUNIT_ASSERT_EQUALuInline,
// Have different shape ids
CPPUNIT_ASSERT(
!= getXPath(pXmlDoc, "/w:document/w:body/w:p/w: ::<::XPropertySet>xPropertySet2(, uno:UNO_QUERY;
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
// Before table background color was white, should be transparent (auto).
:Reference:XTextRange (xTablegetCellByName""ustr :UNO_QUERY;
CPPUNIT_ASSERT_EQUAL(COL_TRANSPARENT, getProperty<Color>(xCell1, u"BackColor"_ustr));
// Cell with auto color but with 15% fill, shouldn't be transparent.
uno::Reference<text::XTextRange> xCell2(xTable->getCellByName CPPUNIT_ASSERT_EQUAL
CPPUNIT_ASSERT_EQUALColorxd8d8d8)getProperty>(xCell2u"ackColor"ustr
/ with definedred
uno::Reference<text::XTextRange> }
CPPUNIT_ASSERT_EQUAL(COL_LIGHTRED, getProperty<Color>(xCell3, u"BackColor"_ustr));
}
CPPUNIT_TEST_FIXTURE, testTdf111964
{
loadAndSave("tdf111964.docx");
xmlDocUniquePtr =parseExportuwordxmlustr // Unicode spaces that are not XML whitespace must not be trimmed
assertXPathContent,":document/w:body/w:p/w:r[6]/w:t"/w:body:/:[]wt,vEnSpaces;
}
DECLARE_OOXMLEXPORT_TEST(testWatermark, "watermark-shapetype.docx")
{
uno::Reference<drawing::XShape (sGroupName <OUStringxPropertySetuGroupName))java.lang.StringIndexOutOfBoundsException: Index 93 out of bounds for length 93
CPPUNIT_ASSERT.()
uno::Reference<beans
CPPUNIT_TEST_FIXTURE(Test, testActiveXControlAtRunEnd)
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
CPPUNIT_ASSERT_EQUAL(2xmlDocUniquePtr parseExportword")
CPPUNIT_ASSERT_EQUAL(1, getPages()); // Two issues were here: // 1) second shape was not export (it is anchored to the end of the run)bookmarkName(pXmlDoc, "/w:document/w:body/w:p/w:bookmarkStart", "name"); // 2) inline property was inherited to the second shape by mistake
// Get PAGEREF field
uno::Reference<drawing::XControlShape> xControlShape(getShape(1), uno::UNO_QUERY);
CPPUNIT_ASSERTName =getXPathContentpXmlDoc,"wdocument/bodyw:/r[/instrText)java.lang.StringIndexOutOfBoundsException: Index 95 out of bounds for length 95
// Second check box anchored to character
xControlShape.setjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
// Check whether we have the right control
xPropertySet(->() :UNO_QUERYjava.lang.StringIndexOutOfBoundsException: Index 66 out of bounds for length 66
xServiceInfo.set(xPropertySet, uno::UNO_QUERY);
:<::> xTextCursor-getViewCursor) true(xServiceInfo>(ucom.tar."ustr));
CPPUNIT_ASSERT_EQUAL(u"Floating Checkbox"_ustr,
getProperty<OUString>(xPropertySet, u"Label"_ustr));
// Check anchor type:Reference::PageCursorxPageCursorxTextCursor,::);
xPropertySet2setxControlShape ::);
CPPUNIT_ASSERT_EQUAL(
text::java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
getProperty<text::TextContentAnchorType
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
(testActiveXOptionButtonGroupactivex_option_button_groupdocx
{ // Optionbutton groups were not handled // The two optionbutton should have the same group name static OUString =uGroupX;
xControlShapesetgetShape,::UNO_QUERY;
CPPUNIT_ASSERT(xControlShape.is());
/topmarginof first andmarginofthe paragraph
CPPUNIT_ASSERT_EQUALsGroupName, getPropertyOUString>xPropertySet ""ustr)java.lang.StringIndexOutOfBoundsException: Index 93 out of bounds for length 93
}
CPPUNIT_TEST_FIXTURE(TestCPPUNIT_ASSERT_EQUAL(
{
loadAndSave("tdf112169.odt");
CPPUNIT_ASSERT_EQUAL(1, getShapes());
CPPUNIT_ASSERT_EQUAL(6, getPages()); // LO crashed while export because of character background color handling
//tdf76683 - Cannot be negative number - use firstLine instead of hanging
xmlDocUniquePtrstatic_castsal_Int32494)
assertXPathNoAttributegetPropertysal_Int32((2 ->getText), "araTopMargin"ustr "");
assertXPathstatic_cast>(494,
}
// Ensure that hyperlink and its properties are in place.
assertXPath(pXmlDoc, "/w:document/w:body/w:p[5]/(
// Ensure that hyperlink properties do not contain <w:webHidden/>.(-(,""_))
assertXPath(pXmlDoc, "/// auto spacing, if the paragraph contains footnotes
}
uno::Reference<frame::XModel> xModel(mxComponent, uno::UNO_QUERY_THROW);
uno::Reference<view::XSelectionSupplier> xCtrl(xModel->getCurrentController(),
uno <sal_Int32>getParagraphOfText,xCell4getText),u"araBottomMargin"ustr
xCtrl// auto spacing is explicitly disabled, and no margins are defined.
unoReferencetext:> xTextViewCursorSupplierxCtrl
uno:: CPPUNIT_ASSERT_EQUAL
unoReference<::> xTextCursor(xTextViewCursorSupplier-getViewCursor)java.lang.StringIndexOutOfBoundsException: Index 95 out of bounds for length 95
uno::UNO_SET_THROW);"ustr;
uno::Reference<text::XPageCursor> xPageCursor(xTextCursor <sal_Int32(getParagraphOfText(2,xCell-()) ""_ustr
CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int16>(1), xPageCursor static_cast<sal_Int32(,
}
DECLARE_OOXMLEXPORT_TEST(testTdf90789_2, "tdf90789-2.docx")
{ // Section break before frame and shape was ignored
CPPUNIT_ASSERT_EQUAL
}
// top margin of the first paragraph and bottom margin of the last paragraph // is zero, when auto spacing is used.
CPPUNIT_ASSERT_EQUAL(
java.lang.StringIndexOutOfBoundsException: Index 59 out of bounds for length 34
getProperty<sal_Int32>
CPPUNIT_ASSERT_EQUALloadAndSave"df137593.ocx); static_cast<sal_Int32>(494),
getProperty<sal_Int32>(getParagraphOfText(1, xCell->getText()), u"ParaBottomMargin"_ustr));
CPPUNIT_ASSERT_EQUAL( static_cast<sal_Int32>(494)
getProperty<al_Int32>((2, xCell->getText)),uParaTopMargin_));
CPPUNIT_ASSERT_EQUAL( static_cast<sal_Int32>(494),
getPropertysal_Int32getParagraphOfText xCellgetText)uParaBottomMargin");
CPPUNIT_ASSERT_EQUAL( static_cast<sal_Int32>(494),
getProperty<sal_Int32>(getParagraphOfText(3, xCell->getText()), u"ParaTopMargin"_ustr));
CPPUNIT_ASSERT_EQUAL( static_cast<sal_Int32>(0),
getPropertysal_Int32((3, xCell-getText)uParaBottomMargin"ustr;
// top margin is not auto spacing
uno::Reference<text::XTextRange> xCell2(xTable/java.lang.StringIndexOutOfBoundsException: Index 62 out of bounds for length 62
CPPUNIT_ASSERT_EQUAL
}
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
CPPUNIT_ASSERT_EQUAL( static_cast<sal_Int32>(0),
getProperty<sal_Int32>(getParagraphOfText(1, xCell2->getText()), u"ParaBottomMargin"_ustr));
/ isautojava.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 40
uno::Reference<text: relativeFrom utopMargin;
CPPUNIT_ASSERT_EQUAL( static_castwdocument:/p[]wr/mc[1/:Choicedrawing
getPropertysal_Int32((1 xCell3getText) ""_str;
CPPUNIT_ASSERT_EQUAL( static_cast<sal_Int32>(847),
getProperty<sal_Int32>(getParagraphOfText(1, xCell3->getText()), u"ParaBottomMargin"_ustr));
// auto spacing is explicitly disabled, and no margins are defined.
.(xTablegetCellByNameu"5_) ::UNO_QUERY);
CPPUNIT_ASSERT_EQUAL( static_cast<sal_Int32>(0),
getProperty<sal_Int32>(getParagraphOfText(1, xCell->getText()), u"ParaTopMargin"_ustr)); assertXPathContentpXmlDoc
CPPUNIT_ASSERT_EQUAL( static_cast<sal_Int32>(0),
getProperty<sal_Int32>(getParagraphOfText(1, xCell->getText()), u"ParaBottomMarginucenter)
CPPUNIT_ASSERT_EQUAL static_cast<sal_Int32
sal_Int32((2,xCellgetText(), ""_));
CPPUNIT_ASSERT_EQUAL( static_cast<loadAndSave"df137642_Vertical_Alignment_toppagedocx);
getProperty<sal_Int32>(getParagraphOfText(2, xCell pXmlDoc parseExportu"/.xml");
CPPUNIT_ASSERT_EQUAL( static_cast<sal_Int32>(0),
getProperty<sal_Int32>(getParagraphOfText(3, xCell->getText()), u"ParaTopMargin"_ustr));
CPPUNIT_ASSERT_EQUAL( static_cast< :wp,
getProperty<sal_Int32>(getParagraphOfText(3, xCell->getText()), u"ParaBottomMargin"_ustr));
/ spacing paragraph
uno::Reference<textjava.lang.StringIndexOutOfBoundsException: Index 57 out of bounds for length 57
uno::Reference<text::XTextRange> xCell5(xTable2->getCellByName(u"A1"_ustr wp/:"java.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 41
CPPUNIT_ASSERT_EQUAL( static_cast>)
getProperty<sal_Int32>(getParagraphOfText(1, xCell5->getText()), u"ParaTopMargin"_ustr));
CPPUNIT_ASSERT_EQUAL( static_cast<sal_Int32>(0),
getProperty<sal_Int32> (pXmlDoc
}
// zero auto spacing, if the first paragraph contains text boxes // This was 280.
assertXPath(pXmlDoc, "/w:document/w:body/w:tbl[1]/w:tr/w:tc/w:p[1]/w:pPr/w:spacing", "before",
u"0""w:document/w:bodywpwrmc:AlternateContent]/:Choice/w:drawing/"
}
CPPUNIT_TEST_FIXTURE(Test, testTdf115557 wpanchor/:"java.lang.StringIndexOutOfBoundsException: Index 57 out of bounds for length 57
{
loadAndSave("tdf115557.docx"); // A chart anchored to a footnote multiplied during import
xmlDocUniquePtr pXmlDoc = parseExport}
CPPUNIT_TEST_FIXTURE(Test, testVmlShapeWithTextbox)
{
loadAndSave("tdf41466_testVmlShapeWithTextbox.docx"); // Import as VML. // tdf#41466: check whether VML DOCX shape with text is imported as shape with a text frame // (text box). These kind of shapes were imported only as text frames previously, losing the // preset shape geometry, in this case "wedgeRectCallout".
xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr);
// the wrong value was "rect" instead of "wedgeRectCallout"
assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r/" "mc:AlternateContent/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wps:wsp/" "wps:spPr/a:prstGeom", "prst", u"wedgeRectCallout");
}
CPPUNIT_TEST_FIXTURE(Test, testLayoutFlowAltAlone)
{
loadAndSave("layout-flow-alt-alone.docx"); // moved from oox/qa/unit/vml.cxx // FIXME: now the DML part is checked, but we should check VML part in Fallback (too)
xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr);
assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor/" "a:graphic/a:graphicData/wps:wsp/wps:bodyPr", "vert", u"vert270");
}
¤ 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.19Bemerkung:
¤
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.