/* -*- 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/.
*/
namespace
{ class Test : public SwModelTestBase
{ public:
Test()
: SwModelTestBase(u"/sw/qa/extras/rtfimport/data/"_ustr, u"Rich Text Format"_ustr)
{
}
};
CPPUNIT_TEST_FIXTURE(Test, testColumnBreak)
{
createSwDoc("column-break.rtf"); // Column break at the very start of the document was ignored.
CPPUNIT_ASSERT_EQUAL(style::BreakType_COLUMN_BEFORE,
getProperty<style::BreakType>(getParagraph(2), u"BreakType"_ustr));
}
CPPUNIT_TEST_FIXTURE(Test, testUnbalancedColumnsCompat)
{
createSwDoc("unbalanced-columns-compat.rtf");
uno::Reference<text::XTextSectionsSupplier> xTextSectionsSupplier(mxComponent, uno::UNO_QUERY);
uno::Reference<container::XIndexAccess> xTextSections(xTextSectionsSupplier->getTextSections(),
uno::UNO_QUERY); // This was false, we ignored the relevant compat setting to make this non-last section unbalanced.
CPPUNIT_ASSERT_EQUAL( true, getProperty<bool>(xTextSections->getByIndex(0), u"DontBalanceTextColumns"_ustr));
}
CPPUNIT_TEST_FIXTURE(Test, testOleInline)
{
createSwDoc("ole-inline.rtf"); // Problem was that inline shape had at-page anchor.
CPPUNIT_ASSERT_EQUAL(text::TextContentAnchorType_AS_CHARACTER,
getProperty<text::TextContentAnchorType>(getShape(1), u"AnchorType"_ustr));
}
// Without the accompanying fix in place, this test would have failed with: // - Expected greater than: 6242 // - Actual : 3438 // i.e. the vertical flip was missing, and the y1 > y2 assert failed, because the line pointed // from top left to bottom right, not bottom left to top right.
CPPUNIT_ASSERT_GREATER(nY2, nY1);
}
CPPUNIT_TEST_FIXTURE(Test, testFdo80742)
{
createSwDoc("fdo80742.rtf");
uno::Reference<beans::XPropertySet> xPropertySet(
getStyles(u"ParagraphStyles"_ustr)->getByName(u"Heading 2"_ustr), uno::UNO_QUERY); // This was 0, outline level was body text.
CPPUNIT_ASSERT_EQUAL(sal_Int32(2), getProperty<sal_Int32>(xPropertySet, u"OutlineLevel"_ustr));
}
CPPUNIT_TEST_FIXTURE(Test, testBehindDoc)
{
createSwDoc("behind-doc.rtf"); // The problem was that "behind doc" didn't result in the shape being in the background, only in being wrapped as "through".
uno::Reference<drawing::XShape> xShape = getShape(1);
CPPUNIT_ASSERT_EQUAL(text::WrapTextMode_THROUGH,
getProperty<text::WrapTextMode>(xShape, u"Surround"_ustr)); // This was true.
CPPUNIT_ASSERT_EQUAL(false, getProperty<bool>(xShape, u"Opaque"_ustr));
}
CPPUNIT_TEST_FIXTURE(Test, testFdo82071)
{
createSwDoc("fdo82071.rtf"); // The problem was that in TOC, chapter names were underlined, but they should not be.
uno::Reference<text::XTextRange> xRun = getRun(getParagraph(1), 1); // Make sure we test the right text portion.
CPPUNIT_ASSERT_EQUAL(u"Chapter 1"_ustr, xRun->getString()); // This was awt::FontUnderline::SINGLE.
CPPUNIT_ASSERT_EQUAL(awt::FontUnderline::NONE,
getProperty<sal_Int16>(xRun, u"CharUnderline"_ustr));
}
CPPUNIT_TEST_FIXTURE(Test, testFdo85179)
{
createSwDoc("fdo85179.rtf"); // This was 0, border around the picture was ignored on import. // 360: EMU -> MM100
CPPUNIT_ASSERT_EQUAL(sal_uInt32(50800 / 360),
getProperty<table::BorderLine2>(getShape(1), u"TopBorder"_ustr).LineWidth);
}
CPPUNIT_TEST_FIXTURE(Test, testPasteFirstParaDirectFormat)
{ // Create a new document.
createSwDoc();
{ // Set some direct formatting on the first paragraph, but leave paragraph adjust at its // default (left).
uno::Reference<beans::XPropertySet> xParagraph(getParagraph(1), uno::UNO_QUERY);
xParagraph->setPropertyValue(u"PageNumberOffset"_ustr, uno::Any(static_cast<sal_Int16>(0)));
}
// Without the accompanying fix in place, this test would have failed with: // - Expected: 3 (center) // - Actual : 0 (left) // i.e. the inserted document's first paragraph's paragraph formatting was lost.
uno::Reference<beans::XPropertySet> xParagraph(getParagraph(1), uno::UNO_QUERY);
CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int16>(style::ParagraphAdjust_CENTER),
getProperty<sal_Int16>(xParagraph, u"ParaAdjust"_ustr));
}
CPPUNIT_TEST_FIXTURE(Test, testFdo82512)
{
createSwDoc("fdo82512.rtf"); // This was style::BreakType_NONE, column break was before the 3rd paragraph, not before the 2nd one.
CPPUNIT_ASSERT_EQUAL(style::BreakType_COLUMN_BEFORE,
getProperty<style::BreakType>(getParagraph(2), u"BreakType"_ustr));
}
CPPUNIT_TEST_FIXTURE(Test, testUnbalancedColumns)
{
createSwDoc("unbalanced-columns.rtf");
uno::Reference<text::XTextSectionsSupplier> xTextSectionsSupplier(mxComponent, uno::UNO_QUERY);
uno::Reference<container::XIndexAccess> xTextSections(xTextSectionsSupplier->getTextSections(),
uno::UNO_QUERY); // This was false, last section was balanced, but it's unbalanced in Word.
CPPUNIT_ASSERT_EQUAL( true, getProperty<bool>(xTextSections->getByIndex(0), u"DontBalanceTextColumns"_ustr));
}
CPPUNIT_TEST_FIXTURE(Test, testTdf126173)
{
createSwDoc("tdf126173.rtf"); // Without the accompanying fix in place, this test would have failed, as the TextFrame was lost // on import.
CPPUNIT_ASSERT(getShape(1).is());
}
CPPUNIT_TEST_FIXTURE(Test, testFdo84685)
{
createSwDoc("fdo84685.rtf"); // index mark was not imported
uno::Reference<text::XDocumentIndexMark> xMark(
getProperty<uno::Reference<text::XDocumentIndexMark>>(getRun(getParagraph(1), 1),
u"DocumentIndexMark"_ustr));
CPPUNIT_ASSERT(xMark.is());
CPPUNIT_ASSERT_EQUAL(u"Key the 1st"_ustr, getProperty<OUString>(xMark, u"PrimaryKey"_ustr)); // let's test toc entry too
uno::Reference<text::XDocumentIndexMark> xTOCMark(
getProperty<uno::Reference<text::XDocumentIndexMark>>(getRun(getParagraph(2), 1),
u"DocumentIndexMark"_ustr));
CPPUNIT_ASSERT(xTOCMark.is());
uno::Reference<lang::XServiceInfo> xTOCSI(xTOCMark, uno::UNO_QUERY);
CPPUNIT_ASSERT(xTOCSI->supportsService(u"com.sun.star.text.ContentIndexMark"_ustr));
}
// This testcase illustrate leveltext with multibyte strings coded in cp950 ( BIG5 ).
CPPUNIT_TEST_FIXTURE(Test, testCp950listleveltext1)
{
createSwDoc("cp950listleveltext1.rtf"); // suffix with Chinese only ( most common case generated by MSO2010 TC) // This is a dot that is generally used as suffix of Chinese list number static constexpr OUStringLiteral aExpectedNumbering = u"\u4e00\u3001";
// This testcase illustrate leveltext with multibyte strings coded in cp950 ( BIG5 ).
CPPUNIT_TEST_FIXTURE(Test, testCp950listleveltext2)
{
createSwDoc("cp950listleveltext2.rtf"); // Prefix and suffix with Chinese only ( tweaked from default in MSO2010 TC) static constexpr OUStringLiteral aExpectedNumbering = u"\u524d\u7f6e\u7532\u3001\u5f8c\u7f6e";
// This testcase illustrate leveltext with multibyte strings coded in cp950 ( BIG5 )
CPPUNIT_TEST_FIXTURE(Test, testCp950listleveltext3)
{
createSwDoc("cp950listleveltext3.rtf"); // Numbering is a mix Chinese and English ( tweaked from default in MSO2010 TC) static constexpr OUStringLiteral aExpectedNumbering = u"\u524da\u7f6eb\u7532\u3001" "c\u5f8cd\u7f6ee";
CPPUNIT_TEST_FIXTURE(Test, testTdf90046)
{
createSwDoc("tdf90046.rtf"); // this was crashing on importing the footnote
uno::Reference<text::XFootnotesSupplier> xFootnotesSupplier(mxComponent, uno::UNO_QUERY);
uno::Reference<container::XIndexAccess> xFootnotes = xFootnotesSupplier->getFootnotes();
uno::Reference<text::XTextRange> xTextRange(xFootnotes->getByIndex(0), uno::UNO_QUERY);
CPPUNIT_ASSERT_EQUAL(u"Ma"_ustr, xTextRange->getString());
}
CPPUNIT_TEST_FIXTURE(Test, testFdo49893)
{
createSwDoc("fdo49893.rtf"); // Image from shape was not loaded, invalid size of image after load
uno::Reference<drawing::XShape> xShape = getShape(2);
CPPUNIT_ASSERT(xShape.is());
CPPUNIT_ASSERT_EQUAL(sal_Int32(convertTwipToMm100(432)), xShape->getSize().Height);
CPPUNIT_ASSERT_EQUAL(sal_Int32(convertTwipToMm100(1296)), xShape->getSize().Width);
}
CPPUNIT_TEST_FIXTURE(Test, testFdo49893_3)
{
createSwDoc("fdo49893-3.rtf"); // No artifacts (black lines in left top corner) as shape #3 are expected
CPPUNIT_ASSERT_EQUAL(2, getShapes());
// Correct wrapping for shape
CPPUNIT_ASSERT_EQUAL(text::WrapTextMode_THROUGH,
getProperty<text::WrapTextMode>(getShape(2), u"Surround"_ustr));
}
CPPUNIT_TEST_FIXTURE(Test, testTdf119599)
{
createSwDoc("tdf119599.rtf");
uno::Reference<beans::XPropertyState> xRun(getRun(getParagraph(1), 1), uno::UNO_QUERY); // This was beans::PropertyState_DIRECT_VALUE, changing the font size in // the style had no effect on the rendering result.
CPPUNIT_ASSERT_EQUAL(beans::PropertyState_DEFAULT_VALUE,
xRun->getPropertyState(u"CharHeight"_ustr));
}
CPPUNIT_TEST_FIXTURE(Test, testTdf90315)
{
createSwDoc("tdf90315.rtf");
uno::Reference<text::XTextSectionsSupplier> xTextSectionsSupplier(mxComponent, uno::UNO_QUERY);
uno::Reference<container::XIndexAccess> xTextSections(xTextSectionsSupplier->getTextSections(),
uno::UNO_QUERY);
uno::Reference<beans::XPropertySet> xTextSection(xTextSections->getByIndex(0), uno::UNO_QUERY); // This was 0, but default should be 720 twips.
CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(1270),
getProperty<sal_Int32>(xTextSection->getPropertyValue(u"TextColumns"_ustr),
u"AutomaticDistance"_ustr));
}
CPPUNIT_TEST_FIXTURE(Test, testTdf59454)
{
createSwDoc("tdf59454.rtf"); // This was 1, section break was ignored right before a table.
CPPUNIT_ASSERT_EQUAL(2, getPages());
}
CPPUNIT_TEST_FIXTURE(Test, testTdf96308Tabpos)
{
createSwDoc("tdf96308-tabpos.rtf"); // Get the tab stops of the second para in the B1 cell of the first table in the document.
uno::Reference<text::XTextTablesSupplier> xTextTablesSupplier(mxComponent, uno::UNO_QUERY);
uno::Reference<container::XIndexAccess> xTables(xTextTablesSupplier->getTextTables(),
uno::UNO_QUERY);
uno::Reference<text::XTextTable> xTable(xTables->getByIndex(0), uno::UNO_QUERY);
uno::Reference<text::XTextRange> xCell(xTable->getCellByName(u"B1"_ustr), uno::UNO_QUERY);
uno::Reference<container::XEnumerationAccess> xParaEnumAccess(xCell->getText(), uno::UNO_QUERY);
uno::Reference<container::XEnumeration> xParaEnum = xParaEnumAccess->createEnumeration();
xParaEnum->nextElement();
uno::Reference<text::XTextRange> xPara(xParaEnum->nextElement(), uno::UNO_QUERY); auto aTabStops = getProperty<uno::Sequence<style::TabStop>>(xPara, u"ParaTabStops"_ustr); // This failed: tab stops were not deleted as direct formatting on the paragraph.
CPPUNIT_ASSERT(!aTabStops.hasElements());
}
// get a page cursor
uno::Reference<frame::XModel> xModel(mxComponent, uno::UNO_QUERY);
uno::Reference<text::XTextViewCursorSupplier> xTextViewCursorSupplier(
xModel->getCurrentController(), uno::UNO_QUERY);
uno::Reference<text::XPageCursor> xCursor(xTextViewCursorSupplier->getViewCursor(),
uno::UNO_QUERY);
// check that the first page has landscape flag
xCursor->jumpToFirstPage();
OUString pageStyleName = getProperty<OUString>(xCursor, u"PageStyleName"_ustr);
uno::Reference<style::XStyle> xStylePage(pageStyles->getByName(pageStyleName), uno::UNO_QUERY);
CPPUNIT_ASSERT_EQUAL(true, getProperty<bool>(xStylePage, u"IsLandscape"_ustr));
// check that the second page has no landscape flag
xCursor->jumpToPage(2);
pageStyleName = getProperty<OUString>(xCursor, u"PageStyleName"_ustr);
xStylePage.set(pageStyles->getByName(pageStyleName), uno::UNO_QUERY);
CPPUNIT_ASSERT_EQUAL(false, getProperty<bool>(xStylePage, u"IsLandscape"_ustr));
// check that the third page has landscape flag
xCursor->jumpToPage(3);
pageStyleName = getProperty<OUString>(xCursor, u"PageStyleName"_ustr);
xStylePage.set(pageStyles->getByName(pageStyleName), uno::UNO_QUERY);
CPPUNIT_ASSERT_EQUAL(true, getProperty<bool>(xStylePage, u"IsLandscape"_ustr));
// check that the last page has no landscape flag
xCursor->jumpToLastPage();
pageStyleName = getProperty<OUString>(xCursor, u"PageStyleName"_ustr);
xStylePage.set(pageStyles->getByName(pageStyleName), uno::UNO_QUERY);
CPPUNIT_ASSERT_EQUAL(false, getProperty<bool>(xStylePage, u"IsLandscape"_ustr));
}
// Table width was a tiny sub one char wide 145twips, it should now be a table wide // enough to see all the text in the first column without breaking into multiple lines
CPPUNIT_ASSERT_EQUAL(sal_Int32(7056),
getProperty<sal_Int32>(xTables->getByIndex(0), u"Width"_ustr));
}
// Not classified source, not classified destination: OK.
paste(u"rtfimport/data/classification-no.rtf", u"com.sun.star.comp.Writer.RtfFilter"_ustr,
xEnd);
CPPUNIT_ASSERT_EQUAL(u"classification-no"_ustr, getParagraph(2)->getString());
// Classified source, not classified destination: nothing should happen.
OUString aOld = xText->getString();
paste(u"rtfimport/data/classification-yes.rtf", u"com.sun.star.comp.Writer.RtfFilter"_ustr,
xEnd);
CPPUNIT_ASSERT_EQUAL(aOld, xText->getString());
}
CPPUNIT_TEST_FIXTURE(Test, testTdf90097)
{
createSwDoc("tdf90097.rtf"); // Get the second child of the group shape.
uno::Reference<container::XIndexAccess> xGroup(getShape(1), uno::UNO_QUERY);
uno::Reference<beans::XPropertySet> xShape(xGroup->getByIndex(0), uno::UNO_QUERY);
uno::Sequence<uno::Sequence<awt::Point>> aPolyPolySequence;
xShape->getPropertyValue(u"PolyPolygon"_ustr) >>= aPolyPolySequence; const uno::Sequence<awt::Point>& rPolygon = aPolyPolySequence[0];
// Vertical flip for the line shape was ignored, so Y coordinates were swapped.
CPPUNIT_ASSERT(rPolygon[0].Y > rPolygon[1].Y);
}
CPPUNIT_TEST_FIXTURE(Test, testTdf91684)
{
createSwDoc("tdf91684.rtf"); // Scaling of the group shape children were incorrect, this was 3203. // (Unit was assumed to be twips, but it was relative coordinates.)
CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(1337), getShape(1)->getSize().Height);
}
CPPUNIT_TEST_FIXTURE(Test, testTdf167710)
{
createSwDoc("tdf167710.rtf"); // problem was that text was erroneously imported
CPPUNIT_ASSERT(getParagraph(1)->getString().isEmpty());
}
CPPUNIT_TEST_FIXTURE(Test, testFlip)
{
createSwDoc("flip.rtf");
comphelper::SequenceAsHashMap aMap = getProperty<uno::Sequence<beans::PropertyValue>>(
getShapeByName(u"h-and-v"), u"CustomShapeGeometry"_ustr); // This resulted in a uno::RuntimeException, as MirroredX wasn't set at all, so could not extract void to boolean.
CPPUNIT_ASSERT_EQUAL(true, aMap[u"MirroredX"_ustr].get<bool>());
CPPUNIT_ASSERT_EQUAL(true, aMap[u"MirroredY"_ustr].get<bool>());
for (int i = 0; i < aProps.getLength(); ++i)
{ const beans::PropertyValue& rProp = aProps[i];
if (rProp.Name == "Suffix") // This was '0', invalid \levelnumbers wasn't ignored.
CPPUNIT_ASSERT(rProp.Value.get<OUString>().isEmpty());
}
xmlDocUniquePtr pLayout = parseLayoutDump(); // Ensure that there is a tabstop in the pseudo-numbering (numbering::NONE followed by tabstop)
assertXPath(pLayout, "//SwFixPortion", 1);
}
CPPUNIT_TEST_FIXTURE(Test, testTdf117403)
{
createSwDoc("tdf117403.rtf");
uno::Reference<text::XTextTablesSupplier> xTextTablesSupplier(mxComponent, uno::UNO_QUERY);
uno::Reference<container::XIndexAccess> xTables(xTextTablesSupplier->getTextTables(),
uno::UNO_QUERY);
uno::Reference<text::XTextTable> xTable(xTables->getByIndex(0), uno::UNO_QUERY);
uno::Reference<text::XTextRange> xCell(xTable->getCellByName(u"A1"_ustr), uno::UNO_QUERY);
CPPUNIT_ASSERT(xCell.is());
table::BorderLine2 aExpected(static_cast<sal_Int32>(COL_BLACK), 0, 4, 0,
table::BorderLineStyle::SOLID, 4); // This failed, border was not imported, OuterLineWidth was 0 instead of 4.
CPPUNIT_ASSERT_BORDER_EQUAL(aExpected,
getProperty<table::BorderLine2>(xCell, u"BottomBorder"_ustr));
}
CPPUNIT_TEST_FIXTURE(Test, testImportHeaderFooter)
{
createSwDoc("tdf108055.rtf"); // The RTF import sometimes added Header and Footer multiple Times // as well as added the Header to the document body.
uno::Reference<text::XTextDocument> xTextDocument(mxComponent, uno::UNO_QUERY);
uno::Reference<container::XEnumerationAccess> xParaEnumAccess(xTextDocument->getText(),
uno::UNO_QUERY);
uno::Reference<container::XEnumeration> xParaEnum = xParaEnumAccess->createEnumeration();
// Check if any Header or Footer text snuck into the TextBody
uno::Reference<text::XTextRange> paragraph = getParagraph(1);
OUString value = paragraph->getString();
CPPUNIT_ASSERT_EQUAL(u"First Page"_ustr, value);
paragraph = getParagraph(3);
value = paragraph->getString();
CPPUNIT_ASSERT_EQUAL(u"Second Page"_ustr, value);
paragraph = getParagraph(5);
value = paragraph->getString();
CPPUNIT_ASSERT_EQUAL(u"Third Page"_ustr, value);
//Check if Headers/Footers only contain what they should in this document
uno::Reference<text::XText> xHeaderText = getProperty<uno::Reference<text::XText>>(
getStyles(u"PageStyles"_ustr)->getByName(u"Standard"_ustr), u"HeaderTextFirst"_ustr);
OUString aActual = xHeaderText->getString();
CPPUNIT_ASSERT_EQUAL(u"First Page Header"_ustr, aActual);
CPPUNIT_TEST_FIXTURE(Test, testTdf108947)
{
createSwDoc("tdf108947.rtf"); //Check if Headers/Footers contain what they should in this document
uno::Reference<text::XText> xHeaderTextRight = getProperty<uno::Reference<text::XText>>(
getStyles(u"PageStyles"_ustr)->getByName(u"Standard"_ustr), u"HeaderTextRight"_ustr);
OUString aActual = xHeaderTextRight->getString();
CPPUNIT_ASSERT_EQUAL(u""_ustr, aActual);
//Document is very fragile, hence we need this guard. #if HAVE_MORE_FONTS
uno::Reference<text::XText> xHeaderTextLeft = getProperty<uno::Reference<text::XText>>(
getStyles(u"PageStyles"_ustr)->getByName(u"Standard"_ustr), u"HeaderTextLeft"_ustr);
aActual = xHeaderTextLeft->getString();
CPPUNIT_ASSERT_EQUAL(u"" SAL_NEWLINE_STRING "Header Page 2 ?"_ustr, aActual); #endif
}
CPPUNIT_TEST_FIXTURE(Test, testTdf104016)
{
createSwDoc("tdf104016.rtf");
uno::Reference<beans::XPropertyState> xParagraph(getParagraph(1), uno::UNO_QUERY); // This was beans::PropertyState_DIRECT_VALUE, leading to lack of // inheritance from numbering.
CPPUNIT_ASSERT_EQUAL(beans::PropertyState_DEFAULT_VALUE,
xParagraph->getPropertyState(u"ParaLeftMargin"_ustr));
}
CPPUNIT_TEST_FIXTURE(Test, testTdf115242)
{
createSwDoc("tdf115242.rtf"); // This was 0, overridden left margin was lost by too aggressive style // deduplication.
CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(2787),
getProperty<sal_Int32>(getParagraph(1), u"ParaLeftMargin"_ustr));
}
// TODO: Writer creates an empty page 1 here, which Word does not
assertXPath(pLayout, "/root/page[1]/footer", 0);
assertXPath(pLayout, "/root/page[2]/footer", 1); // the first page (2) has a page style applied, which has a follow page // style; the problem was that the follow page style had a footer.
assertXPath(pLayout, "/root/page[3]/footer", 0);
assertXPath(pLayout, "/root/page[4]/footer", 1);
// TODO exporting this, wrongly produces "even" footer from stashed one // TODO importing that, wrongly creates a footer even without evenAndOddHeaders
}
CPPUNIT_TEST_FIXTURE(Test, testDefaultValues)
{
createSwDoc("default-values.rtf"); // tdf#105910: control words without values must be treated as having default values, // instead of being silently ignored
// The reason why this is 0 despite the default style containing \sa200 // is that Word will actually interpret \basedonN // as "set style N and for every attribute of that style, // set an attribute with default value on the style"
uno::Reference<beans::XPropertySet> xPropertySet1(
getStyles(u"ParagraphStyles"_ustr)->getByName(u"Contents 1"_ustr), uno::UNO_QUERY);
CPPUNIT_ASSERT_EQUAL(sal_Int32(0),
getProperty<sal_Int32>(xPropertySet1, u"ParaBottomMargin"_ustr));
CPPUNIT_ASSERT_EQUAL(
style::LineSpacingMode::PROP,
getProperty<style::LineSpacing>(xPropertySet1, u"ParaLineSpacing"_ustr).Mode);
CPPUNIT_ASSERT_EQUAL(
sal_Int16(100),
getProperty<style::LineSpacing>(xPropertySet1, u"ParaLineSpacing"_ustr).Height); autoconst xPara(getParagraph(1));
CPPUNIT_ASSERT_EQUAL(sal_Int32(0), getProperty<sal_Int32>(xPara, u"ParaBottomMargin"_ustr));
CPPUNIT_ASSERT_EQUAL(style::LineSpacingMode::PROP, // 0 or 3 ???
getProperty<style::LineSpacing>(xPara, u"ParaLineSpacing"_ustr).Mode);
CPPUNIT_ASSERT_EQUAL(sal_Int16(100),
getProperty<style::LineSpacing>(xPara, u"ParaLineSpacing"_ustr).Height);
}
{ auto xPara(getParagraph(2)); auto fillColor = getProperty<Color>(xPara, u"FillColor"_ustr); auto fillStyle = getProperty<drawing::FillStyle>(xPara, u"FillStyle"_ustr);
{ auto xPara(getParagraph(5)); auto fillColor = getProperty<Color>(xPara, u"FillColor"_ustr); auto fillStyle = getProperty<drawing::FillStyle>(xPara, u"FillStyle"_ustr); auto tabStops = getProperty<uno::Sequence<style::TabStop>>(xPara, u"ParaTabStops"_ustr);
{ auto xPara(getParagraph(6)); auto fillStyle = getProperty<drawing::FillStyle>(xPara, u"FillStyle"_ustr); auto tabStops = getProperty<uno::Sequence<style::TabStop>>(xPara, u"ParaTabStops"_ustr);
CPPUNIT_TEST_FIXTURE(Test, test160553Tdf)
{
createSwDoc("tdf160553.rtf"); // new section should create second page
CPPUNIT_ASSERT_EQUAL(2, getPages());
}
CPPUNIT_TEST_FIXTURE(Test, test165805Tdf)
{
createSwDoc("165805.rtf"); //without page break there would be only one page
CPPUNIT_ASSERT_EQUAL(2, getPages());
}
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.