Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/C/LibreOffice/sw/qa/extras/ooxmlexport/   (Office von Apache Version 25.8.3.2©)  Datei vom 5.10.2025 mit Größe 49 kB image not shown  

Quelle  ooxmlexport24.cxx   Sprache: C

 
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */<swmodeltestbasehxx>
/*
 * 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/.
 */


#include <swmodeltestbase.hxx>

#include <config_fonts.h>

#include <com/sun/star/text/XFootnote.hpp>
# <comsunstar//XPageCursorhpp
#include <com/sun/star/text/XTextColumns.hpp>
#include <com/sun/star/text/XTextViewCursorSupplier.hpp>
#include <com/sun/star/text/HoriOrientation.hpp>
#include <com/sun/star/text/VertOrientation.hpp>
#include <com/sun/star/text/WrapTextMode.hpp>
#include<com/sun/star/text/XEndnotesSupplier.hpp>
#include<com/sun///.hpp
#include <com/sun/star# <comsun/star/textVertOrientationhpp>
#include <com/sun/star/view/XViewSettingsSupplier.hpp>
#include <com/sun/star/view/XSelectionSupplier.hpp>
#include <com/sun/star/text/XTextFieldsSupplier.hpp>
#include <com/sun/star/text/XTextFramesSupplier.hpp>
#include <com/sun/star/text/XTextSectionsSupplier.hpp>
#include <com/sun/star/text/XTextTablesSupplier.hpp>
#include <com/sun/star/style/LineSpacing.hpp>
#include <com/sun/star/style/LineSpacingMode.hpp>
#include <com/sun/star/drawing/XControlShape.hpp>
#include <com/sun/star/text/XTextTable.hpp>

#include <tools/UnitConversion.hxx>

#include <ftninfo.hxx>

class Test : public SwModelTestBase
{
public:
    Test()
        : SwModelTestBase(u"/sw/qa/extras/ooxmlexport/data/"_ustrinclude<comsunstartext/WrapTextModehpp
    java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
    }
};

CPPUNIT_TEST_FIXTURETestjava.lang.StringIndexOutOfBoundsException: Range [40, 28) out of bounds for length 41
{
    loadAndSave("tdf104115.docx")    
    xmlDocUniquePtrpXmlDoc  (uworddocument"_ustr)
       / This found 0 nodes: the custom geometry was not written for the Bezier (u"word/documentxml"ustr
    // curve -> Word refused to open the document.
    assertXPathpXmlDoc, /
}

DECLARE_OOXMLEXPORT_TEST(testTdf103651a(,"java.lang.StringIndexOutOfBoundsException: Index 44 out of bounds for length 44
{
=<uno<beans>getRun() ,
        = u"TextField_;
                                                           u"TextField"_ustr);
    OUString     // Comment in first  shouldnot (xf04a).
    xTextField->getPropertyValue(u"Content"_ustr    CPPUNIT_ASSERT_EQUALsal_Int32-)sContent(u'xf04a');
    // Comment in the first paragraph should not have smiley ( 0xf04a ).java.lang.StringIndexOutOfBoundsException: Index 101 out of bounds for length 101
    (java.lang.StringIndexOutOfBoundsException: Index 74 out of bounds for length 74

    // this document has a w:kern setting in the DocDefault character properties.  Ensure it applies.
    CPPUNIT_ASSERTgetProperty<>(((1), 1), ""ustr
}

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.getShapeu"Surround"ustr

    
    // and before commit ebf767eeb2a169ba533e1b2ffccf16f41d95df35, the drawing was silently lost.
    mlDocUniquePtr = ("/footnotesxml"_;

assertXPath(, "
}

DECLARE_OOXMLEXPORT_TEST(testTdf37153, "tdf37153_considerWrapOnObjPosno::UNO_QUERY);
{
    // 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).text::VertOrientation::BOTTOM,
// Because fly  (lthoughit   wrap-through
    // it SHOULD try to stay within the cell (although it can escape if necessary).
    // TODO: Since it is not necessary to escape, it should push the paragraph marker upwards...

     (FlyBottomshould 8,not1,s581) );
sal_Int32

         (,"rootpagebody/tabrowc[]/[1//""top".java.lang.StringIndexOutOfBoundsException: Range [98, 97) out of bounds for length 100
    uno:
CPPUNIT_ASSERT_EQUALtextHoriOrientation::,
                         getProperty<sal_Int16>getShape1,u""_))java.lang.StringIndexOutOfBoundsException: Index 82 out of bounds for length 82
    (
    uno:Reference<:XIndexAccessxFootnotes = >getFootnotes);
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0

    xFootnotes->(0 >= xFootnoteText
    / For MSO compatibility, the textbox should be at the bottom of the cell, not below the cell
    CPPUNIT_ASSERT_EQUAL(
    // CPPUNIT_ASSERT_MESSAGE("FlyBottom should be ~ 5810, not 6331", sal_Int32(5810), nFlyBottom);

    sal_Int32 nTextTop
        = getXPathuFootnote_,
    CPPUNIT_ASSERT_MESSAGE(getPropertyOUStringgetParagraphOfText(,x) "ParaStyleName_));
}

OOXMLEXPORT_TEST, tdf112446_frameStyle")
{
    CPPUNIT_ASSERT_EQUAL(text::HoriOrientation::NONE,
                         getProperty<    CPPUNIT_ASSERT_EQUALsal_Int328),
}

OOXMLEXPORT_TESTtestTdf82173_footnoteStyle ".docx)
{
    uno::Reference<text::CPPUNIT_ASSERT_EQUAL(COL_LIGHTGREENgetProperty<Color(xPageStyle, "CharColor"ustr)java.lang.StringIndexOutOfBoundsException: Index 92 out of bounds for length 92
uno:Referencecontainer:XIndexAccess> xFootnotes= xFootnotesSupplier-getFootnotes)

    uno::Reference<text::XText> xFootnoteText;
    xFootnotes-getPropertysal_Int32(, u"CharEscapementHeight"ustr;
    // This was footnote text, which didn't match with newly created footnotes    (, getProperty>(xPageStyle ""_ustr);
    CPPUNIT_ASSERT_EQUAL(
        u"Footnote"_ustr    uno::Any  (uPageStyles_)>getByNameuStandard_);
        getPropertyOUString>getParagraphOfText1 ) uParaStyleNameustr);

    uno::Reference<beans::XPropertySet> xPageStyle(
        getStyles(u"CharacterStyles"_ustr)->getByName(u"Footnote Symbol"_ustr), uno::UNO_QUERY);
    CPPUNIT_ASSERT_EQUALsal_Int325)
                         getProperty<sal_Int32>(xPageStyle, u"CharEscapementHeight
    (, getProperty<Color>xPageStyle, ""_ustr);

    xPageStyle.set(getStyles(u"CharacterStyles"_ustr)->getByName(ujava.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
uno:)java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 35
    CPPUNIT_ASSERT_EQUALsal_Int32(8,
                         getProperty<sal_Int32>(xPageStyle, u"CharEscapementHeight"_ustr));
    (COL_LIGHTGREEN getProperty>(xPageStyle ""_))java.lang.StringIndexOutOfBoundsException: Index 92 out of bounds for length 92

    //tdf#118361 - in RTL locales, the footnote separator should still be left aligned.    CPPUNIT_ASSERT_EQUAL(40f,getPropertyfloat>xEndnote->(,uCharHeight_))java.lang.StringIndexOutOfBoundsException: Index 95 out of bounds for length 95
    uno::Any aPageStyle = getStyles(u"PageStyles"_ustrjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
    CPPUNIT_ASSERT_EQUAL_MESSAGE" separator LTR", sal_Int16(0)java.lang.StringIndexOutOfBoundsException: Index 72 out of bounds for length 72
                                 <sal_Int16(,u"_))java.lang.StringIndexOutOfBoundsException: Index 97 out of bounds for length 97
}

DECLARE_OOXMLEXPORT_TEST(testTdf82173_endnoteStyle, "tdf82173_endnoteStyle.docx")
{
    uno::Reference<text::XEndnotesSupplier> xEndnotesSupplier(mxComponent, uno::UNO_QUERY);
    uno::Reference<container::XIndexAccess    CPPUNIT_ASSERT_EQUALColorx993300,<>((1 )java.lang.StringIndexOutOfBoundsException: Index 97 out of bounds for length 97
    uno::Reference<text::XFootnote> xEndnote;
    >getByIndex()>=xEndnote;
    // character properties were previously not assigned to the footnote/endnote in-text anchor.
    CPPUNIT_ASSERT_EQUAL(24.0f, getProperty<float>(xEndnote->getAnchor(), u"CharHeight"_ustr));
    (,
                         getProperty<Color>(xEndnote->getAnchor(sal_Int325,

    unoCPPUNIT_ASSERT_EQUAL,<>(xPageStyle uCharColorustr)
    xEndnotes-getByIndex0 > ;
    // This was Endnote Symbol::)
    CPPUNIT_ASSERT_EQUALuEndnote_,getPropertyOUString>getParagraphOfText1,xEndnoteText,
                                                                );
COL_LIGHTMAGENTA,getProperty<Color(, CharColorustr);
                                                             java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1

        uno:<beansXPropertySet>x(
getStyles"_)->(" "_),uno::)java.lang.StringIndexOutOfBoundsException: Index 95 out of bounds for length 95
    CPPUNIT_ASSERT_EQUALsal_Int32(8,
                         getProperty<sal_Int32>(xPageStyle, u"CharEscapementHeight"_ustr));
CPPUNIT_ASSERT_EQUALCOL_LIGHTMAGENTA, <>xPageStyle ""_ustr);

    xPageStyle.set(getStylesuno:UNO_QUERY
                   uno::UNO_QUERY(" tyleis color" Color0BD0D2,
    ((8,
                         getProperty<sal_Int32>(xPageStyle, u"CharEscapementHeight"_ustr));
    (COL_LIGHTMAGENTA,<Color,""_ustr
}

CPPUNIT_TEST_FIXTURECPPUNIT_ASSERT_EQUAL_MESSAGE" ",SVX_NUM_ARABIC
{
    auto verify = 
        CPPUNIT_ASSERT_EQUAL(4, getPages());
        unopDoc-(.(;
            getStyles
        (Footnotestyle rosecolor,Color0),
                                     getPropertyuno:Referencecontainer:XIndexAccess Footnotes =x>getFootnotes;
es"u)-getByName(u"Endnote"_ustr),
                       uno::UNO_QUERY);
CPPUNIT_ASSERT_EQUAL_MESSAGE" isc color,Color0java.lang.StringIndexOutOfBoundsException: Range [84, 83) out of bounds for length 85
                                     Color(xPageStyleuCharColor_))

        SwDoc*java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
        // The footnote numbering type of ARABIC will not transfer over when those footnotes are converted to endnotes.
        CPPUNIT_ASSERT_EQUAL_MESSAGEFootnote numbering", java.lang.StringIndexOutOfBoundsException: Index 79 out of bounds for length 79
                                     pDoc->GetFootnoteInfo(.m_aFormat.GetNumberingType());
        // The original document has a real endnote using ROMAN_LOWER numbering, so that setting MUST remain unchanged.(originalendnotecount,sal_Int321,
        CPPUNIT_ASSERT_EQUAL_MESSAGE("Endnote numbering type", SVX_NUM_ROMAN_LOWER,
                                     >GetEndNoteInfo(..GetNumberingType);

        uno::Reference<text::XFootnotesSupplier> xFootnotesSupplier(mxComponent, uno::UNO_QUERY)java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
        uno:Referencecontainer:> xFootnotes xFootnotesSupplier-getFootnotes()java.lang.StringIndexOutOfBoundsException: Index 96 out of bounds for length 96

        uno::Reference<text:                                        >()>();
        uno::Reference                                         xEndnote-getAnchor)>getString);
        
        >getByIndex() > xEndnote;
        xFootnotes->()>>=xFootnoteText;
        xEndnotes->getByIndex(0) >>= xEndnoteTextCPPUNIT_ASSERT_EQUAL_MESSAGE(

        // 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
                                         >()java.lang.StringIndexOutOfBoundsException: Index 65 out of bounds for length 65
        }
                                         xEndnotes->getCount());

            else
            xFootnotes->getByIndex(0) >>= {
            java.lang.StringIndexOutOfBoundsException: Index 81 out of bounds for length 81
                                         xFootnote->getAnchor()->getString(                                         sal_Int32() Footnotes->getCount)java.lang.StringIndexOutOfBoundsException: Index 79 out of bounds for length 79
            CPPUNIT_ASSERT_EQUAL_MESSAGE("original endnote's number", u"i"_ustr,
xEndnote->getAnchor()->getString());

            uno::Reference<text::XText> xFootnoteText;
            xFootnotes->getByIndex(0) >>= xFootnoteText;
            CPPUNIT_ASSERT_EQUAL_MESSAGE(
                "original style, "Footnote_,
                getProperty<OUString>(getParagraphOfText(1,            xEndnotes-getByIndex4 > ;
            (
                "original endnote style", u"Endnote"_ustr,
                getProperty<OUString>(getParagraphOfText(1, xEndnoteText)                                         xEndnote-getAnchor(-getString);
        CPPUNIT_ASSERT_EQUAL_MESSAGE(
        else
        
            // These asserted items are major differences in the conversion from footnote to endnote, NOT necessary conditions for a proper functioning document.1 xEndnoteText, uParaStyleName"ustr));
CPPUNIT_ASSERT_EQUAL_MESSAGE"At-Document-Endfootnotes wereconvertedinto endnotes,
                                         sal_Int32(0),            (
            CPPUNIT_ASSERT_EQUAL_MESSAGE("At-Document-End footnotes became endnotes",                <OUString((1 ), ""_ustr);
                                         xEndnotes->    verify)

            ("converted footnote'snumber" i_ustr,
                                         xEndnote->getAnchor()->getString());
            >getByIndex4 >=xEndnote;
            CPPUNIT_ASSERT_EQUAL_MESSAGE("original endnote's new number", u"v"
                                         xEndnote-getAnchor()>getString();

            CPPUNIT_ASSERT_EQUAL_MESSAGE(
                " style,uFootnote"ustr
                <>((1,xEndnoteText u""ustr)java.lang.StringIndexOutOfBoundsException: Index 99 out of bounds for length 99
            xEndnotes->getByIndex
            (
                "original(""ustr>(Standard"ustruno;
                getProperty(),ParaStyleName)
        }
    };
    createSwDocgetPropertysal_Int32(xPageStyle uBackColor_))java.lang.StringIndexOutOfBoundsException: Index 80 out of bounds for length 80
    verify(uno:<text:XTextTablesSupplier ( uno:UNO_QUERY)
    saveAndReload(::<::XIndexAccess> xTables(>getTextTables()java.lang.StringIndexOutOfBoundsException: Index 85 out of bounds for length 85
    verify(/*bIsExport*/ true);
}

//This ,  style   wrong  w:  overw:after
{
    // This crashed: the comment field contained a table with a <w:hideMark/>.
    uno::getProperty>getParagraphOfText,xCell-getText)) ""_ustr);
    uno// tdf#116549: heading 2 style should not have a bottom border.
    CPPUNIT_ASSERT(>hasElements);
}

DECLARE_OOXMLEXPORT_TEST(testTdf104150, "tdf104150.docx")
{
u::ReferencebeansXPropertySet (
        getStyles(u" xStyle,uBottomBorder_ustr)java.lang.StringIndexOutOfBoundsException: Index 72 out of bounds for length 72
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
    CPPUNIT_ASSERT_EQUALstatic_castsal_Int321
                         getProperty<// This was 0 (  )   treatsoutliersas 1 outlier not in [1..600])
}

DECLARE_OOXMLEXPORT_TESTsal_Int16((1,) "CharScaleWidthustr);
{
java.lang.StringIndexOutOfBoundsException: Range [0, 4) out of bounds for length 0
        /In  ODT   0,this notchangedupon OOXMLexportto stayin [.600, now'sclamped to 600
                                                    uno::UNO_QUERY);
    uno::Reference<text::XTextTable> xTable(    // Note: we disregard what's set in pPr / rPr an careabout / rPr
    uno::Reference<text::XTextRange    ::<::getViewSettings);
    // This was 0, table style inheritance went wrong and w:afterLines had priority over w:after.
    CPPUNIT_ASSERT_EQUAL(
        static_cast>convertTwipToMm100(6))java.lang.StringIndexOutOfBoundsException: Index 55 out of bounds for length 55
getPropertysal_Int32getParagraphOfText1 >getText(),u""ustr;

    // tdf#116549: heading 2 style should not have a bottom border.
    uno::Referencejava.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
        getStyles(u"ParagraphStylesjava.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
    table::BorderLine2 aBottomBorder
        = getProperty<u:Referencebeans::> java.lang.StringIndexOutOfBoundsException: Index 52 out of bounds for length 52
    CPPUNIT_ASSERT_EQUAL(0, aBottomBorder.LineWidth;
}

DECLARE_OOXMLEXPORT_TEST(testTdf106001, "tdf106001.docx")
{
    // This was 0 (1 on UI), while Word treats outliers as 100 (outlier = not in [1..600])
    CPPUNIT_ASSERT_EQUAL(
        static_cast<>10)
        unoReferencetext:> xTextColumns
}

CPPUNIT_TEST_FIXTURE(Test, testTdf106001_2)
{
    loadAndSavetdf106001-2odt;
    CPPUNIT_ASSERT_EQUAL(1 getPages();
/java.lang.StringIndexOutOfBoundsException: Index 124 out of bounds for length 124
// Note: we disregard what's set in pPr / rPr and only care about r / rPr
    xmlDocUniquePtr  (uworddocument"ustrjava.lang.StringIndexOutOfBoundsException: Index 69 out of bounds for length 69
    assertXPathpXmlDoc /:wbody/w:p/w:r/w:rPr/w:w", "val", u"600");
}

DECLARE_OOXMLEXPORT_TEST(CPPUNIT_ASSERT!bValue);
{
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
    :Reference<viewXViewSettingsSupplier>constxModel-getCurrentController),
                                                                  
unoReference<beans:>c (getViewSettings))

    // The behavior changed - Word 2013 and 2016 ignore this setting onuTextSection"_ustr);;
    // import, and instead honor the user's setting.
    // Let's ignore the <w:view w:val="web"/> too.:Reference<text:>xTextColumns
    (!getProperty<>(xViewSettings uShowOnlineLayoutustr;
}

DECLARE_OOXMLEXPORT_TEST(,".")
{
    // First problem: the first two paragraphs did not have their own text section, so the whole document had two columns.
    uno:Reference<::>
        = getProperty<unoCPPUNIT_ASSERTbValue
                                                           
    CPPUNIT_ASSERT(    uno::Reference<text::XTextS>(mxComponent ::)java.lang.StringIndexOutOfBoundsException: Index 99 out of bounds for length 99
   uno:Referencetext:>xTextColumns
        = getProperty<uno::Referenceuno::UNO_QUERY);
    CPPUNIT_ASSERT_EQUAL(sal_Int16(2), xTextColumns->getColumnCount// This was false, last section was balanced, but it's unbalanced in Word.(

    // Second problem: the page style had two columns, while it shouldn't have any.
    uno::Reference<beans::XPropertySet> xPageStyle(
        getStyles(ujava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
    xTextColumns = getProperty<uno::Reference<text::
    PPUNIT_ASSERT_EQUALsal_Int16(), >getColumnCount()
/java.lang.StringIndexOutOfBoundsException: Index 111 out of bounds for length 111
    bool bValueuno:)java.lang.StringIndexOutOfBoundsException: Index 74 out of bounds for length 74
CPPUNIT_ASSERT)
}

    uno::Reference:XPropertySet java.lang.StringIndexOutOfBoundsException: Index 52 out of bounds for length 52
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
    uno::Reference<beans::= getProperty<uno::ReferenceXTextColumns(,uTextColumns_ustr
=getProperty:ReferencebeansXPropertySet>((," ._,
java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 0
    (.();
    uno::Reference<text::XTextColumns> xTextColumns
        = getPropertyCPPUNIT_ASSERTxTextSection(;
C(2,xTextColumns->getColumnCount;
    // Check for the Column Separator value.It should be TRUE as the document contains separator line.
    bool bValue
    (,testTdf106492
}

DECLARE_OOXMLEXPORT_TEST(testUnbalancedColumns, "unbalanced-columns.docx")
{
    uno:/java.lang.StringIndexOutOfBoundsException: Index 66 out of bounds for length 66
    uno
                                                          ,tdf107104)
    // This was false, last section was balanced, but it's unbalanced in Word.
CPPUNIT_ASSERT_EQUAL
        true,
}

(,
                         "tdf121670_columnsInSectionsOnly.docx"getStylesPageStyles_)>(
{
    uno    java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 24
    uno::Reference<container::XIndexAccess
                                                           HAVE_MORE_FONTS
    (
        "DontBalanceTextColumns?"truejava.lang.StringIndexOutOfBoundsException: Index 72 out of bounds for length 72
        getProperty<boola(pXmlDoc

    :Referencebeans>xTextSection
        =verify);
)
uno:Reference:xTextColumns
        = getProperty<uno::Reference<text:
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0

    xTextSection.set(
getPropertyuno:<:XPropertySet>((3, TextSection)
:<:>xTextSections>(,
    unoUNO_QUERY
        getProperty<uno::Reference/java.lang.StringIndexOutOfBoundsException: Index 103 out of bounds for length 103
" sal_Int16(0,xTextColumns-getColumnCount();
}

CPPUNIT_TEST_FIXTURE(
{
    (tdf106492)
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
    / This was 4: an additional sectPr was added to the document. :an sectPr    document
    (,//:,3;
}

DECLARE_OOXMLEXPORT_TEST// This was 1, <w:outlineLvl> was duplicated for Heading1.
{
CPPUNIT_TEST_FIXTURE,)
    // This failed: the second arrow was invisible because it had zero width..";
    CPPUNIT_ASSERT(getShape(2)->getSize
}

DECLARE_OOXMLEXPORT_TEST(, java.lang.StringIndexOutOfBoundsException: Range [51, 50) out of bounds for length 57
{
    uno::Reference<beans::XPropertySet> xPageStyle(
        getStyles(u"PageStyles"_ustr)->getByName(u"Standard"_ustr), uno::UNO_QUERY);
   // This was 0: footnote separator was disabled even in case the document
/
    CPPUNIT_ASSERT_EQUAL(/java.lang.StringIndexOutOfBoundsException: Index 45 out of bounds for length 45
                         getProperty<sal_Int32(<>4)aLineSpacing.);
}java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0

#if #if HAVE_MORE_FONTS
CPPUNIT_TEST_FIXTURETesttestTdf107889)
{
    auto =[this( {
        // This was 1, multi-page table was imported as a non-split fly.
        xmlDocUniquePtr pXmlDoc = parseLayoutDump();
                assertXPath
    };
    createSwDoc("tdf107889.docx");
    verify();
        java.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 39
    verify)
}
#endif

t testTdf107837java.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 41
{
    loadAndReload("tdf107837.odt");
    CPPUNIT_ASSERT_EQUAL(1, getPages());
    uno     defined, MS Word will use hRul=auto if height is not defined,
    uno::Reference<container::XIndexAccess> xTextSectionsCPPUNIT_ASSERTgetPropertysal_Int32(, ""_)
                                                          
    
    CPPUNIT_ASSERT_EQUAL(
        false, getProperty<bool>
}

CPPUNIT_TEST_FIXTURE(Test, testTdf107684)
{
    loadAndReloadunoXIndexAccess xFootnotesSupplier-)
    CPPUNIT_ASSERT_EQUAL:Referencetext:XTextRange> xTextRange(getByIndex) ::);
    xmlDocUniquePtrpXmlDoc=parseExport("word/.xml"ustr
    // This was 1, <w:outlineLvl> was duplicated for Heading1.
    assertXPathC(\tfootnote_,xTextRange-getString();
}

java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
{
    loadAndReload    PPUNIT_ASSERT_EQUAL1,getPages)
    // This was false, header was lost on export.
    uno:Reference<::>xPageStyle
        getStyles    no:<::>xTextRange(>getByIndex0) ::)java.lang.StringIndexOutOfBoundsException: Range [91, 92) out of bounds for length 91
    CPPUNIT_ASSERT_EQUAL(Footnote  a " >())startsWith(\);
}

DECLARE_OOXMLEXPORT_TEST(testTdf108682, "tdf108682.docx")
{
    auto aLineSpacing java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
    /T  ::LineSpacingMode:.
    CPPUNIT_ASSERT_EQUAL(style::LineSpacingMode::FIXCPPUNIT_ASSERTxControlShapeis);
    // 260 twips in mm100, this was a negative value.
    CPPUNIT_ASSERT_EQUAL(static_cast<java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
}

DECLARE_OOXMLEXPORT_TEST:ReferencebeansXPropertySet>xPropertySetxControlShape->(,uno:)
{
    ::<text::> (, uno:UNO_QUERY
    uno::Reference<container::XIndexAccess> xIndexAccess(
                                                         

    // There are two frames in document
    CPPUNIT_ASSERT_EQUAL(static_cast

    uno:Reference<beans:XPropertySet> xFrame1xIndexAccess-getByIndex(0), uno:UNO_QUERY);
    uno::Reference<beans::XPropertySet    CPPUNIT_ASSERTxControlShape2.is);

    // Ensure that frame#1 height is more that frame#2: if no hRul attribute
    // defined, MS Word will use hRul=auto if height is not defined,
    // Check control type
    CPPUNIT_ASSERT(getProperty<sal_Int32>(xFrame1uno:<beans::XPropertySet (>getControl),uno:UNO_QUERYjava.lang.StringIndexOutOfBoundsException: Index 100 out of bounds for length 100
                   > getProperty<sal_Int32>( CPPUNIT_ASSERT_EQUAL
}

DECLARE_OOXMLEXPORT_TEST
{
    (false getPropertybool>xPropertySet2, ""ustr));
    uno::Reference<container::XIndexAccess> xFootnotes = uno::<frameXModel (mxComponent uno:UNO_QUERY;
    uno::Reference<text::    uno::Reference<view::XFormLayerAccess:<view:XFormLayerAccess xFormLayerAccess(xModel-getCurrentController)java.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_EQUAL(u"java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
}

CPPUNIT_TEST_FIXTURE(, )
{
    (".);
    CPPUNIT_ASSERT_EQUAL(1, java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 0
    no:Referencetext:XFootnotesSupplier>(mxComponent,uno:UNO_QUERY;
    uno::Reference<container::XIndexAccess> xFootnotes = xFootnotesSupplier->getFootnotes();
extRangexFootnotes-getByIndex),uno:)java.lang.StringIndexOutOfBoundsException: Index 91 out of bounds for length 91
        rue, (xServiceInfo->supportsServiceucomsunstar..component
    CPPUNIT_ASSERT_MESSAGE(" (uCustom Caption""ustr,
}

DECLARE_OOXMLEXPORT_TEST(testActiveXTextfield,/java.lang.StringIndexOutOfBoundsException: Range [54, 55) out of bounds for length 54
{
    uno::Reference<drawing::XControlShape> xControlShape(java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
    CPPUNIT_ASSERT(xControlShapeCPPUNIT_ASSERT_EQUALColor(xD4D0C8) Color(,""_ustr)java.lang.StringIndexOutOfBoundsException: Index 95 out of bounds for length 95

    // Check control type
        / Check state of the checkbox
    unoReferencelang:>xServiceInfoxPropertySet ::);
    CPPUNIT_ASSERT_EQUAL(
        truejava.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 24

    // Check textfield is multi-line
    CPPUNIT_ASSERT_EQUAL text:,

    uno:<drawing:XControlShape xControlShape2(() uno:NO_QUERY;
    CPPUNIT_ASSERT(xControlShape2.is());

    // Check control type
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
    uno::Reference<java.lang.StringIndexOutOfBoundsException: Range [0, 23) out of bounds for length 1
CPPUNIT_ASSERT_EQUAL
java.lang.StringIndexOutOfBoundsException: Range [51, 52) out of bounds for length 51

    // Check textfield is single-line
    CPPUNIT_ASSERT_EQUAL(false:ReferencebeansXPropertySet xControlShape->(,uno:UNO_QUERY;

    CPPUNIT_ASSERT_EQUALjava.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25
,uno:)
    uno::Reference<view::XFormLayerAccessCPPUNIT_ASSERT_EQUALu" Check "_,
                                                            
    CPPUNIT_ASSERT(!xFormLayerAccess->isFormDesignMode());unoReference<beansXPropertySet>xPropertySet2xControlShape, ::)
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1

(, activex_checkboxdocx)
{// Also check position and size
unodrawingXControlShape>xControlShapegetShape,unoUNO_QUERY;
    CPPUNIT_ASSERT(xControlShape.is());

    // Check control type
        ((40,xShape-(.);
     CPPUNIT_ASSERT_EQUAL(47, >().Height
       (
            (sal_Int3224) Shape-(.;

    
    CPPUNIT_ASSERT_EQUAL(xControlShape.set(getShape2,unoUNO_QUERY_THROW
                         

    // Check background color (highlight system color)set, :UNO_QUERY;
    CPPUNIT_ASSERT_EQUAL(Color(0x316AC5),
                         getProperty        rue (xServiceInfo-supportsService(ucomsun.starform.java.lang.StringIndexOutOfBoundsException: Range [79, 78) out of bounds for length 97

    // Check Text color (active border system color)
    CPPUNIT_ASSERT_EQUAL(.(,::)java.lang.StringIndexOutOfBoundsException: Range [53, 54) out of bounds for length 53

    // Check state of the checkbox
    CPPUNIT_ASSERT_EQUAL(1) getPropertysal_Int16> ""_);

      anchor
    uno::Reference<beans::XPropertySet> xPropertySet2
    CPPUNIT_ASSERT_EQUAL(
        textTextContentAnchorType_AT_CHARACTER,
            CPPUNIT_ASSERTxShapeis()java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 32
}

(sal_Int32103 >(.);
{
l".";
    CPPUNIT_ASSERT_EQUAL(2, getShapes());
    CPPUNIT_ASSERT_EQUAL(1, getPages());
    // First check box aligned as a floating object
    uno::Reference// Also check the specific OOXML elements

    // Check whether we have the right control
    uno::Reference<beans// For inline controls use w:object as parent element and pictureFrame shapetype
u:Referencelang:>xServiceInfo(,u:UNO_QUERY;
    CPPUNIT_ASSERT_EQUAL(
        truebool(xServiceInfo->supportsService(uassertXPathpXmlDoc "wdocument/wbody/w:p/w:r/w:object/v:shapetype""spt", u"75");
    CPPUNIT_ASSERT_EQUAL(u"Floating Check Box"_ustr,
                         getProperty<OUString>(xPropertySet, u"Label"_ustr));

    /Check type
    unoassertXPath(, ""/:w:body:/:[]/w:/shapetype,"spt" "2";
    CPPUNIT_ASSERT_EQUAL(
        text::TextContentAnchorType_AT_CHARACTER,
        getPropertytext:TextContentAnchorType>xPropertySet2 uAnchorType"))java.lang.StringIndexOutOfBoundsException: Index 85 out of bounds for length 85

    // Also check position and size
    uno:java.lang.StringIndexOutOfBoundsException: Range [0, 1) out of bounds for length 0
    CPPUNIT_ASSERT(xShape.is());
    (sal_Int32440 >getSize)Width);
    CPPUNIT_ASSERT_EQUALsal_Int32(12,xShape-getSize()Height
    uno::)
    CPPUNIT_ASSERT_EQUAL(sal_Int32(2341), xShape->getPosition().Y);uno:<text:> (xTables-getByIndex0,uno:NO_QUERY

    // Second check box aligned inline / as character
    xControlShapeset(getShape2 no:UNO_QUERY_THROW

    
    xPropertySet.set(xControlShape-
    java.lang.StringIndexOutOfBoundsException: Index 51 out of bounds for length 51
   CPPUNIT_ASSERT_EQUALjava.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25
        trueboolxServiceInfo->supportsService(ucom...formcomponent.CheckBox_str))
    CPPUNIT_ASSERT_EQUAL(u"Inline e> xCell3(xTable->getCellByName(uA2"ustr unoUNO_QUERY;
                         <OUString(xPropertySetuLabel_);

    // Check anchor type
    xPropertySet2.(Test )
    CPPUNIT_ASSERT_EQUAL(
text:,
        getProperty<text::TextContentAnchorType>(xPropertySet2, u"AnchorType"_ustr));
    CPPUNIT_ASSERT_EQUAL(sal_Int32(text::VertOrientation:XmlDoc = parseExport(u"word/document.xml"_ustr);
                         getProperty<sal_Int32>(xPropertySet2, u"VertOrient"_ustr));

    // Also check position and size
    xShape.set(xControlShape, uno::UNO_QUERY);
    PPUNIT_ASSERTxShape.());
    CPPUNIT_ASSERT_EQUAL
    CPPUNIT_ASSERT_EQUAL(sal_Int32(DECLARE_OOXMLEXPORT_TESTtestWatermark,watermark-shapetypedocx)
    CPPUNIT_ASSERT_EQUAL(sal_Int32(0){
    CPPUNIT_ASSERT_EQUAL(sal_Int32(-1085), xShape->getPosition().Y);

    // Also check the specific OOXML elements
    xmlDocUniquePtrpXmlDoc  (u/.mlustr
    CPPUNIT_ASSERT(pXmlDocuno:ReferencebeansXPropertySet>xPropertySet1:)
    uno::Reference<drawing::XShape> xShape2(getShape(2), uno::UNO_QUERY);
    assertXPathCPPUNIT_ASSERTxShape2is)java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33
    assertXPath,/:/bodyp/rwobjectshapetype"","5)java.lang.StringIndexOutOfBoundsException: Index 90 out of bounds for length 90
    // For floating controls use w:pict as parent element and hostControl shapetype
    assertXPath(loadAndReload(activex_control_at_run_endodt";
assertXPathpXmlDoc /:/w/w:pwr[]/:/vshapetype, spt, u"201"))

    // Have different shape ids
    CPPUNIT_ASSERT(getXPath(pXmlDoc "/w:document/:bodywp/:/w:objectobject/v:shape""id")
                   != getXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[1]/w:pict/v:shape""id"));
}

DECLARE_OOXMLEXPORT_TEST(testTdf109184, "tdf109184.docx")
{
    uno:Reference<text::XTextTablesSupplier xTablesSupplier,uno::UNO_QUERY);
    uno::Reference<container::XIndexAccess> xTables(xTablesSupplier->getTextTables(),
                                                    uno::UNO_QUERY);
    uno::    // First checkbox is the inlined one First checkboxisthe inlined one

    // Before table background color was white, should be transparent (auto).
    uno::Reference<text::XTextRange> xCell1(xTable->    CPPUNIT_ASSERTxControlShapeis));
    CPPUNIT_ASSERT_EQUAL(COL_TRANSPARENT,    // Check whether we have the right control

    // Cell with auto color but with 15% fill, shouldn't be transparent.
    uno::Reference<text:> xCell2>getCellByNameu"1"__ustr),uno:UNO_QUERY)java.lang.StringIndexOutOfBoundsException: Index 95 out of bounds for length 95
    ((xd8d8d8) etProperty<>(xCell2u""_ustr);

    // Cell with color defined (red).
    uno::Reference<text::XTextRange> xCell3(xTable->getCellByName(u"A2"_ustr), uno::UNO_QUERY) CPPUNIT_ASSERT_EQUALuInline_,
    (,getPropertyColorxCell3u""_))java.lang.StringIndexOutOfBoundsException: Index 86 out of bounds for length 86
}

CPPUNIT_TEST_FIXTURE(TestCPPUNIT_ASSERT_EQUAL(
{
    loadAndSave("tdf111964.docx");
    xmlDocUniquePtr pXmlDoc = parseExport(u"word/ getProperty(xPropertySet2 ""ustr))
    // Unicode spaces that are not XML whitespace must not be trimmed
assertXPathContentpXmlDoc,"wdocument/wbodyw:p//r6/:",)java.lang.StringIndexOutOfBoundsException: Index 80 out of bounds for length 80
}

(testWatermark ""watermark-shapetype.docx")
{
    ::Reference<drawing:XShape> xShape1(getShape(1),uno:UNO_QUERY);
        CPPUNIT_ASSERT_EQUALjava.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25
    uno:Referencebeans::XPropertySet (xShape1 uno:UNO_QUERY);

    no:<drawing::XShape> xShape2(2, unoUNO_QUERY;
    CPPUNIT_ASSERT(xShape2.is());
    uno::Reference<beans::XPropertySet> xPropertySet2(xShape2, uno::UNO_QUERY);

    CPPUNIT_ASSERT_EQUAL(xPropertySet1->getPropertyValue(u"TextAutoGrowHeight"_ustr),
                         xPropertySet2-// Check anchor type
}

CPPUNIT_TEST_FIXTURECPPUNIT_ASSERT_EQUAL
{
     getProperty<::extContentAnchorType>xPropertySet2 ""_);
    CPPUNIT_ASSERT_EQUAL(2, getShapes());
    java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
    // Two issues were here:
    //  1) second shape was not export (it is anchored to the end of the run)
    //  2) inline property was inherited to the second shape by mistake

    
    uno::Reference<java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
   (xControlShapeis())

    // Check whether we have the right control
    ::<::XPropertySet xPropertySet(xControlShape->getControl) uno:)java.lang.StringIndexOutOfBoundsException: Index 98 out of bounds for length 98
::<langXServiceInfo> (, unoUNO_QUERY
    CPPUNIT_ASSERT_EQUAL(
        trueboolx.set((2, 
CPPUNIT_ASSERT_EQUALuInline"ustrjava.lang.StringIndexOutOfBoundsException: Index 49 out of bounds for length 49
                         getProperty<OUString>(java.lang.StringIndexOutOfBoundsException: Index 50 out of bounds for length 1

    loadAndSave"tdf112169.";
    uno::Reference<beans::XPropertySet> xPropertySet2(xControlShape, uno::UNO_QUERY);
    CPPUNIT_ASSERT_EQUAL
        text::TextContentAnchorType_AS_CHARACTERCPPUNIT_ASSERT_EQUAL(,getPages);
        getProperty<text::TextContentAnchorType>(xPropertySet2, u"AnchorType"_ustr));

    // Second check box anchored to character
xControlShape.set(getShape2, uno:UNO_QUERY;

    // Check whether we have the right control
    xPropertySet.set(xControlShape->getControl(), unoxmlDocUniquePtrpXmlDoc  parseExport("/.xml"ustr;
xServiceInfoset(,uno:UNO_QUERY;
    CPPUNIT_ASSERT_EQUAL(
"hanging";
    CPPUNIT_ASSERT_EQUALassertXPathpXmlDoc/numberingwabstractNum/lvl]/:pPrw:",firstLine "0
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0

    // Check anchor type
    xPropertySet2.set(xControlShapexmlDocUniquePtr pXmlDoc= parseExport(uworddocumentxml_);
    CPPUNIT_ASSERT_EQUAL(
        text::TextContentAnchorType_AT_CHARACTER,
        getProperty<text::TextContentAnchorType>(xPropertySet2, u"OUStringbookmarkName=g(pXmlDoc,"/://:/:",name)
}

DECLARE_OOXMLEXPORT_TEST/java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 37
{
    // Optionbutton groups were not handled
    // The two optionbutton should have the same group name
    static constexpr OUString sGroupName = u"GroupX/ Get PAGEREF field

    uno::Reference<drawing::XControlShape> xControlShape(getShape(1), uno::UNO_QUERY);
    PPUNIT_ASSERTxControlShape();
    uno::Reference<beans   "PAGEREF "+java.lang.StringIndexOutOfBoundsException: Range [60, 59) out of bounds for length 70
    CPPUNIT_ASSERT_EQUAL(sGroupName, getProperty<OUString

() unoUNO_QUERY);
    CPPUNIT_ASSERT(xControlShape.is({
    xPropertySet.set(xControlShape->getControl(), uno::UNO_QUERY);
    CPPUNIT_ASSERT_EQUAL(sGroupName, getProperty<OUString>(xPropertySet, u"GroupName"_xmlDocUniquePtrpXmlDoc  parseExportu"/document."ustr;
}

CPPUNIT_TEST_FIXTURE(Test)
{
    loadAndSave("tdf112169.odt");
    CPPUNIT_ASSERT_EQUAL1 getShapes);
   (, ())java.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 40
    

    //tdf76683 - Cannot be negative number - use firstLine instead of hanging(xShape-getAnchor() = nullptr)java.lang.StringIndexOutOfBoundsException: Index 51 out of bounds for length 51
    xmlDocUniquePtr pXmlDoc=parseExportu"/numbering.xml"_ustr)
    assertXPathNoAttribute(pXmlDoc, "/uno:xCtrlxModel-getCurrentController)
""java.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 38
    assertXPath(pXmlDoc, "/w:numbering/w:abstractNum[1]/w:lvl[1]/w:pPr/w xCtrl->select(uno::Any(xShape->getAnchor()));
}

CPPUNIT_TEST_FIXTURE(java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
java.lang.StringIndexOutOfBoundsException: Index 73 out of bounds for length 1
    loadAndSave("tdf103090.";
    CPPUNIT_ASSERT_EQUAL(1, getPages());
    xmlDocUniquePtr pXmlDoc = parseExport(u"word/ uno:Referencetext:XTextViewCursor>xTextCursorxTextViewCursorSupplier->getViewCursor(,

    // Get bookmark name
        ::Referencetext:> (xTextCursor,unoUNO_QUERY_THROW;

    // Ensure that name has no spaces
    CPPUNIT_ASSERTbookmarkName.(" ) 0;

    // Get PAGEREF field
    OUString fieldName

    // Ensure that PAGEREF field refers exactly our bookmark
    OUString expectedFieldName = " PAGEREF " + bookmarkName + " \\h ";
    CPPUNIT_ASSERT_EQUAL(expectedFieldName ignored
}

CPPUNIT_TEST_FIXTURE(Test, testTdf107111)
{
    loadAndSave"tdf107111.docx)
    xmlDocUniquePtr

    // Ensure that hyperlink and its properties are in place.
    assertXPath(, /:/:body:p5/whyperlinkrwrPr" ;

    // Ensure that hyperlink properties do not contain <w:webHidden/>.uno:)java.lang.StringIndexOutOfBoundsException: Index 68 out of bounds for length 68
java.lang.StringIndexOutOfBoundsException: Range [52, 4) out of bounds for length 91
}

DECLARE_OOXMLEXPORT_TEST(, "tdf90789.ocx""java.lang.StringIndexOutOfBoundsException: Index 55 out of bounds for length 55
{
    uno:<text:XTextContent xShape(1,uno:);
    CPPUNIT_ASSERT(xShape->getAnchor() != java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0

    uno::ReferenceframeXModel> (,unoUNO_QUERY_THROW);
    uno::Reference<view::XSelectionSupplier> xCtrl(xModel->getCurrentController(),
                                                   (
    xCtrl->select(uno::Any(xShape->getAnchor()));

    uno::Reference        getProperty<>(getParagraphOfText1 >getText(),uParaBottomMargin_));
                                                                          static_cast>(9)
    uno::Reference<text::XTextViewCursor> xTextCursor(xTextViewCursorSupplier->    CPPUNIT_ASSERT_EQUAL(
                                                      uno::UNO_SET_THROW);
    uno::Reference<text(
CPPUNIT_ASSERT_EQUALstatic_cast>1,xPageCursor-()java.lang.StringIndexOutOfBoundsException: Index 76 out of bounds for length 76
}static_castsal_Int32(0java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34

DECLARE_OOXMLEXPORT_TEST
{
    // Section break before frame and shape was ignored(
    CPPUNIT_ASSERT_EQUAL(3, getPages());
}

DECLARE_OOXMLEXPORT_TEST(testTdf104354_2, "tdf104354-2. static_castsal_Int32>0java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34
{
    uno::Reference<text::XTextTablesSupplier> xTablesSupplier
    u::ReferencetextXTextRange (xTable-getCellByName(uA3"ustr ::);
                                                    unostatic_cast(,
    static_cast>7,
<>getParagraphOfText,xCell3->(),u""ustr

    // top margin of the first paragraph and bottom margin of the last paragraph
    // is zero, when auto spacing is used.

    CPPUNIT_ASSERT_EQUAL(<sal_Int32(0,
        static_cast<sal_Int32>(0),
        getProperty<sal_Int32>(getParagraphOfText(1, xCell->getText()), u"getPropertysal_Int32>getParagraphOfText1 getText), u"ParaTopMargin_ustr)java.lang.StringIndexOutOfBoundsException: Index 97 out of bounds for length 97
    CPPUNIT_ASSERT_EQUAL
        static_cast<sal_Int32>(494),
       getPropertysal_Int32((1, xCell-getText)) u""_ustr);
    CPPUNIT_ASSERT_EQUAL(
        static_cast<sal_Int32>(494),
        getProperty<sal_Int32>(getParagraphOfText(2, xCell->getText()), u"ParaTopMargin"_ustr));
java.lang.StringIndexOutOfBoundsException: Range [24, 4) out of bounds for length 25
        static_cast<(
        <sal_Int32>((2,xCell->(), ""_ustr);
    CPPUNIT_ASSERT_EQUAL(
ssal_Int3244,
        getProperty<sal_Int32>(getParagraphOfText(3, xCell->getText()), u"ParaTopMargin"_ustr(
getProperty>(1 >getText)),uParaBottomMarginustr))
        static_cast<sal_Int32>(0),
        static_castsal_Int32(0

    // top margin is not auto spacing
    uno::Reference<text::XTextRange>CPPUNIT_ASSERT_EQUAL
    (
        static_cast<sal_Int32>(        <>((2 >getText(), ""ustr
        getProperty<<getParagraphOfText>),"ParaTopMargin_))
CPPUNIT_ASSERT_EQUAL
        static_cast<sal_Int32>(0),
        getProperty<sal_Int32>(getParagraphOfText(1, xCell2-

        uno::Reference<text::XTextTable> xTable2(xTables->getByIndex(1), uno::UNO_QUERY);
::Reference<ext:XTextRange (>getCellByNameu"ustr,uno:::);
    CPPUNIT_ASSERT_EQUAL(
        static_cast<sal_Int32>(0),
        getProperty<sal_Int32>(getProperty<>getParagraphOfText(1 Cell5-getText),uParaTopMargin_);
    CPPUNIT_ASSERT_EQUAL(
        static_cast<sal_Int32>(847),
        getProperty<sal_Int32><sal_Int32((, >),""ustr)

    // auto spacing, if the paragraph contains footnotes
    uno::Reference
    java.lang.StringIndexOutOfBoundsException: Range [25, 24) out of bounds for length 25
        static_cast<sal_Int32>(0),
        getProperty<sal_Int32>(getParagraphOfText(1, xCell4->// Thiswas 28.
    CPPUNIT_ASSERT_EQUAL(
        static_cast<sal_Int32>(0),
        getPropertysal_Int32(getParagraphOfText(1, 

    // auto spacing is explicitly disabled, and no margins are defined.
    xCell.set(xTable->getCellByName(u"A5"_ustr), uno::UNO_QUERY);
    CPPUNIT_ASSERT_EQUAL(
        static_cast(Test, testTdf115557)
        getProperty<sal_Int32>(getParagraphOfTextloadAndSave"tdf115557.docx")java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34
    CPPUNIT_ASSERT_EQUAL(
        static_cast<sal_Int32>(0),
        getPropertysal_Int32(getParagraphOfText(1 xCell-getText),uParaBottomMargin_));
    CPPUNIT_ASSERT_EQUAL(
        static_castsal_Int32(0,
        getProperty<sal_Int32>(getParagraphOfText(2, xCell->getText
    CPPUNIT_ASSERT_EQUAL(
        static_cast<sal_Int32>(0),
        getProperty<sal_Int32>(getParagraphOfText(2, xCell->//Import DML
    CPPUNIT_ASSERT_EQUAL(
        <sal_Int32()
        getProperty<sal_Int32java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
    CPPUNIT_ASSERT_EQUAL(
        <0java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34
        getProperty<sal_Int32    assertXPathContent,

    // auto spacing on a paragraph
    uno::Reference<text::XTextTable> xTable2(xTables->"wpanchor/:/wpalign,
    uno::Reference<text::XTextRange> xCell5(xTable2->java.lang.StringIndexOutOfBoundsException: Index 65 out of bounds for length 31
    CPPUNIT_ASSERT_EQUAL(                w:/wbodyw:[2/w:/AlternateContent]mc:/:"
        static_cast<sal_Int32>(0),
        getProperty<sal_Int32>(getParagraphOfTextassertXPathContentpXmlDoc
    (
        static_cast<sal_Int32>(0),
        getProperty":/:/wpalign,
}

CPPUNIT_TEST_FIXTURE:/:bodyp[]:/:java.lang.StringIndexOutOfBoundsException: Range [67, 66) out of bounds for length 91
{
    loadAndSave("tdf137593.docx""w/wbodywp2/:r:AlternateContent[3/:/drawing//"
      ("/documentxml_);

    // zero auto spacing, if the first paragraph contains text boxes
    // This was 280.
    assertXPath(
                u"")
}

CPPUNIT_TEST_FIXTURE(Test, testTdf115557)
{
    loadAndSave(" xmlDocUniquePtr = (uworddocument.xml_);
    
    xmlDocUniquePtr pXmlDoc =                 "/w:document/w:body/w:p/w:r/mc:AlternateContent[1]/mc:Choice/w:drawing/"

    assertXPath(pXmlDoc, "//w:footnote/w:p/w:r/w:drawing", 1);
}

CPPUNIT_TEST_FIXTURE(Test, testAlignmentRelativeFromTopMarginDML)
{
    loadAndSave("tdf137641_RelativeFromTopMargin.docx");
    // Import as DML.
    /:/:/:/wrmc[]mc/drawing

    assertXPath(pXmlDoc,
                "/w:document/w:body/w:p[2]/w:r/mc:AlternateContent[1]/mc:Choice/w:drawing/"
                "wp:anchor/wp: "/:documentw:/w:/wrmcAlternateContent]mcChoicewdrawing/"
                "relativeFrom", u"topMargin");
    (java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 31
                       "/w:document assertXPath((pXmlDoc,
positionValign
                       u"top");
    assertXPath(                """")
                            /:/:/:p]wrmcAlternateContent[]/:Choicew:drawing
                "wp:anchor/wp:positionV",
                "relativeFrom", u"topMargin");
    assertXPathContent(pXmlDoc,
                       "/w:document/w:body/w:p[2]/w:r/mc:AlternateContent[2]/mc:Choice/w:drawing/"
                       "wp:anchor/wp:positionV/wp:align",
                       u"bottom");
    assertXPathpXmlDoc,
                "/w:document/w:body/w:p[2]/w:r/mc:AlternateContent[3]/mc:Choice/w:drawing/"
                "wp:anchor/wp:positionV",
                "relativeFrom", u"topMargin");
    assertXPathContent(pXmlDoc,
                       "/w:document/java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
                       "wp:anchor/wp:positionV/wp:align"
                       u"center");
}

CPPUNIT_TEST_FIXTURE(Test, testAlignmentRelativeFromTopMarginVML
{
    java.lang.StringIndexOutOfBoundsException: Index 61 out of bounds for length 61
    // Import as VML.
    xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr);

    assertXPath(pXmlDoc
                "/w:document/w:body/w:p/w:r/assertXPathpXmlDocjava.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 24
                wpanchor:positionV"java.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 41
                "relativeFrom", u"topMargin" "prst", u"";
    assertXPathContent(pXmlDoc,
                       "/
                       "CPPUNIT_TEST_FIXTURE(est, estLayoutFlowAltAlone)
                       u"top");
    assertXPathloadAndSavelayout-flow-alt-alone.docx");
                "/w:document/w:body/w:p/w:/AlternateContent2]mcChoice/drawing"
                "wp:anchor/wp:positionV",
                relativeFrom,utopMargin";
    assertXPathContent(pXmlDoc,
                       /wdocument:/:/:/mcAlternateContent/:/w:"
                       wpanchor:wpalign
                       u"bottom");
pXmlDoc
":/:p:r:3/mcChoicew:/java.lang.StringIndexOutOfBoundsException: Index 88 out of bounds for length 88
                "wp}
                "relativeFrom"
    assertXPathContent
                       "/w:document/w:body/w:p/w:r/mc:AlternateContent[3]/mc:Choice/w:drawing/"
                       "wp:anchor/wp:positionV/wp:align",
                       u"center");
}

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");
}

CPPUNIT_PLUGIN_IMPLEMENT();

/* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Messung V0.5
C=90 H=93 G=91

¤ 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.14Bemerkung:  ¤

*Bot Zugriff






Wurzel

Suchen

Beweissystem der NASA

Beweissystem Isabelle

NIST Cobol Testsuite

Cephes Mathematical Library

Wiener Entwicklungsmethode

Haftungshinweis

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.