CharBrd 8.2: Tests for UNO API and ODF filter
Use just those API tests which still alive. Export filter test use import so no need for distinct import tests. Change-Id: Idddc2ece10e20027551538f4e8c224edffa9bfe8
This commit is contained in:
parent
47e24bfed8
commit
ea358f5d5b
@ -134,6 +134,15 @@
|
|||||||
"SwXCellRange";"com::sun::star::style::CharacterProperties";"CharStyleNames#optional"
|
"SwXCellRange";"com::sun::star::style::CharacterProperties";"CharStyleNames#optional"
|
||||||
"SwXCellRange";"com::sun::star::style::CharacterProperties";"CharHidden#optional"
|
"SwXCellRange";"com::sun::star::style::CharacterProperties";"CharHidden#optional"
|
||||||
"SwXCellRange";"com::sun::star::style::CharacterProperties";"TextUserDefinedAttributes#optional"
|
"SwXCellRange";"com::sun::star::style::CharacterProperties";"TextUserDefinedAttributes#optional"
|
||||||
|
"SwXCellRange";"com::sun::star::style::CharacterProperties";"CharLeftBorder#optional"
|
||||||
|
"SwXCellRange";"com::sun::star::style::CharacterProperties";"CharRightBorder#optional"
|
||||||
|
"SwXCellRange";"com::sun::star::style::CharacterProperties";"CharBottomBorder#optional"
|
||||||
|
"SwXCellRange";"com::sun::star::style::CharacterProperties";"CharTopBorder#optional"
|
||||||
|
"SwXCellRange";"com::sun::star::style::CharacterProperties";"CharBorderDistance#optional"
|
||||||
|
"SwXCellRange";"com::sun::star::style::CharacterProperties";"CharLeftBorderDistance#optional"
|
||||||
|
"SwXCellRange";"com::sun::star::style::CharacterProperties";"CharRightBorderDistance#optional"
|
||||||
|
"SwXCellRange";"com::sun::star::style::CharacterProperties";"CharBottomBorderDistance#optional"
|
||||||
|
"SwXCellRange";"com::sun::star::style::CharacterProperties";"CharTopBorderDistance#optional"
|
||||||
"SwXCellRange";"com::sun::star::sheet::XCellRangeData#optional";"getDataArray()"
|
"SwXCellRange";"com::sun::star::sheet::XCellRangeData#optional";"getDataArray()"
|
||||||
"SwXCellRange";"com::sun::star::sheet::XCellRangeData#optional";"setDataArray()"
|
"SwXCellRange";"com::sun::star::sheet::XCellRangeData#optional";"setDataArray()"
|
||||||
"SwXCellRange";"com::sun::star::style::ParagraphPropertiesAsian#optional";"ParaIsHangingPunctuation"
|
"SwXCellRange";"com::sun::star::style::ParagraphPropertiesAsian#optional";"ParaIsHangingPunctuation"
|
||||||
|
|
@ -156,6 +156,15 @@
|
|||||||
"SwXTextCursor";"com::sun::star::style::CharacterProperties";"CharStyleNames#optional"
|
"SwXTextCursor";"com::sun::star::style::CharacterProperties";"CharStyleNames#optional"
|
||||||
"SwXTextCursor";"com::sun::star::style::CharacterProperties";"CharHidden#optional"
|
"SwXTextCursor";"com::sun::star::style::CharacterProperties";"CharHidden#optional"
|
||||||
"SwXTextCursor";"com::sun::star::style::CharacterProperties";"TextUserDefinedAttributes#optional"
|
"SwXTextCursor";"com::sun::star::style::CharacterProperties";"TextUserDefinedAttributes#optional"
|
||||||
|
"SwXTextCursor";"com::sun::star::style::CharacterProperties";"CharLeftBorder#optional"
|
||||||
|
"SwXTextCursor";"com::sun::star::style::CharacterProperties";"CharRightBorder#optional"
|
||||||
|
"SwXTextCursor";"com::sun::star::style::CharacterProperties";"CharBottomBorder#optional"
|
||||||
|
"SwXTextCursor";"com::sun::star::style::CharacterProperties";"CharTopBorder#optional"
|
||||||
|
"SwXTextCursor";"com::sun::star::style::CharacterProperties";"CharBorderDistance#optional"
|
||||||
|
"SwXTextCursor";"com::sun::star::style::CharacterProperties";"CharLeftBorderDistance#optional"
|
||||||
|
"SwXTextCursor";"com::sun::star::style::CharacterProperties";"CharRightBorderDistance#optional"
|
||||||
|
"SwXTextCursor";"com::sun::star::style::CharacterProperties";"CharBottomBorderDistance#optional"
|
||||||
|
"SwXTextCursor";"com::sun::star::style::CharacterProperties";"CharTopBorderDistance#optional"
|
||||||
"SwXTextCursor";"com::sun::star::document::XDocumentInsertable#optional";"insertDocumentFromURL()"
|
"SwXTextCursor";"com::sun::star::document::XDocumentInsertable#optional";"insertDocumentFromURL()"
|
||||||
"SwXTextCursor";"com::sun::star::beans::XPropertySet";"getPropertySetInfo()"
|
"SwXTextCursor";"com::sun::star::beans::XPropertySet";"getPropertySetInfo()"
|
||||||
"SwXTextCursor";"com::sun::star::beans::XPropertySet";"setPropertyValue()"
|
"SwXTextCursor";"com::sun::star::beans::XPropertySet";"setPropertyValue()"
|
||||||
|
|
@ -130,6 +130,15 @@
|
|||||||
"SwXTextRange";"com::sun::star::style::CharacterProperties";"CharStyleNames#optional"
|
"SwXTextRange";"com::sun::star::style::CharacterProperties";"CharStyleNames#optional"
|
||||||
"SwXTextRange";"com::sun::star::style::CharacterProperties";"CharHidden#optional"
|
"SwXTextRange";"com::sun::star::style::CharacterProperties";"CharHidden#optional"
|
||||||
"SwXTextRange";"com::sun::star::style::CharacterProperties";"TextUserDefinedAttributes#optional"
|
"SwXTextRange";"com::sun::star::style::CharacterProperties";"TextUserDefinedAttributes#optional"
|
||||||
|
"SwXTextRange";"com::sun::star::style::CharacterProperties";"CharLeftBorder#optional"
|
||||||
|
"SwXTextRange";"com::sun::star::style::CharacterProperties";"CharRightBorder#optional"
|
||||||
|
"SwXTextRange";"com::sun::star::style::CharacterProperties";"CharBottomBorder#optional"
|
||||||
|
"SwXTextRange";"com::sun::star::style::CharacterProperties";"CharTopBorder#optional"
|
||||||
|
"SwXTextRange";"com::sun::star::style::CharacterProperties";"CharBorderDistance#optional"
|
||||||
|
"SwXTextRange";"com::sun::star::style::CharacterProperties";"CharLeftBorderDistance#optional"
|
||||||
|
"SwXTextRange";"com::sun::star::style::CharacterProperties";"CharRightBorderDistance#optional"
|
||||||
|
"SwXTextRange";"com::sun::star::style::CharacterProperties";"CharBottomBorderDistance#optional"
|
||||||
|
"SwXTextRange";"com::sun::star::style::CharacterProperties";"CharTopBorderDistance#optional"
|
||||||
"SwXTextRange";"com::sun::star::beans::XPropertySet";"getPropertySetInfo()"
|
"SwXTextRange";"com::sun::star::beans::XPropertySet";"getPropertySetInfo()"
|
||||||
"SwXTextRange";"com::sun::star::beans::XPropertySet";"setPropertyValue()"
|
"SwXTextRange";"com::sun::star::beans::XPropertySet";"setPropertyValue()"
|
||||||
"SwXTextRange";"com::sun::star::beans::XPropertySet";"getPropertyValue()"
|
"SwXTextRange";"com::sun::star::beans::XPropertySet";"getPropertyValue()"
|
||||||
|
|
@ -133,6 +133,15 @@
|
|||||||
"SwXTextTableCursor";"com::sun::star::style::CharacterProperties";"CharStyleNames#optional"
|
"SwXTextTableCursor";"com::sun::star::style::CharacterProperties";"CharStyleNames#optional"
|
||||||
"SwXTextTableCursor";"com::sun::star::style::CharacterProperties";"CharHidden#optional"
|
"SwXTextTableCursor";"com::sun::star::style::CharacterProperties";"CharHidden#optional"
|
||||||
"SwXTextTableCursor";"com::sun::star::style::CharacterProperties";"TextUserDefinedAttributes#optional"
|
"SwXTextTableCursor";"com::sun::star::style::CharacterProperties";"TextUserDefinedAttributes#optional"
|
||||||
|
"SwXTextTableCursor";"com::sun::star::style::CharacterProperties";"CharLeftBorder#optional"
|
||||||
|
"SwXTextTableCursor";"com::sun::star::style::CharacterProperties";"CharRightBorder#optional"
|
||||||
|
"SwXTextTableCursor";"com::sun::star::style::CharacterProperties";"CharBottomBorder#optional"
|
||||||
|
"SwXTextTableCursor";"com::sun::star::style::CharacterProperties";"CharTopBorder#optional"
|
||||||
|
"SwXTextTableCursor";"com::sun::star::style::CharacterProperties";"CharBorderDistance#optional"
|
||||||
|
"SwXTextTableCursor";"com::sun::star::style::CharacterProperties";"CharLeftBorderDistance#optional"
|
||||||
|
"SwXTextTableCursor";"com::sun::star::style::CharacterProperties";"CharRightBorderDistance#optional"
|
||||||
|
"SwXTextTableCursor";"com::sun::star::style::CharacterProperties";"CharBottomBorderDistance#optional"
|
||||||
|
"SwXTextTableCursor";"com::sun::star::style::CharacterProperties";"CharTopBorderDistance#optional"
|
||||||
"SwXTextTableCursor";"com::sun::star::beans::XPropertySet";"getPropertySetInfo()"
|
"SwXTextTableCursor";"com::sun::star::beans::XPropertySet";"getPropertySetInfo()"
|
||||||
"SwXTextTableCursor";"com::sun::star::beans::XPropertySet";"setPropertyValue()"
|
"SwXTextTableCursor";"com::sun::star::beans::XPropertySet";"setPropertyValue()"
|
||||||
"SwXTextTableCursor";"com::sun::star::beans::XPropertySet";"getPropertyValue()"
|
"SwXTextTableCursor";"com::sun::star::beans::XPropertySet";"getPropertyValue()"
|
||||||
|
|
@ -166,6 +166,15 @@
|
|||||||
"SwXTextViewCursor";"com::sun::star::style::CharacterProperties";"CharStyleNames#optional"
|
"SwXTextViewCursor";"com::sun::star::style::CharacterProperties";"CharStyleNames#optional"
|
||||||
"SwXTextViewCursor";"com::sun::star::style::CharacterProperties";"CharHidden#optional"
|
"SwXTextViewCursor";"com::sun::star::style::CharacterProperties";"CharHidden#optional"
|
||||||
"SwXTextViewCursor";"com::sun::star::style::CharacterProperties";"TextUserDefinedAttributes#optional"
|
"SwXTextViewCursor";"com::sun::star::style::CharacterProperties";"TextUserDefinedAttributes#optional"
|
||||||
|
"SwXTextViewCursor";"com::sun::star::style::CharacterProperties";"CharLeftBorder#optional"
|
||||||
|
"SwXTextViewCursor";"com::sun::star::style::CharacterProperties";"CharRightBorder#optional"
|
||||||
|
"SwXTextViewCursor";"com::sun::star::style::CharacterProperties";"CharBottomBorder#optional"
|
||||||
|
"SwXTextViewCursor";"com::sun::star::style::CharacterProperties";"CharTopBorder#optional"
|
||||||
|
"SwXTextViewCursor";"com::sun::star::style::CharacterProperties";"CharBorderDistance#optional"
|
||||||
|
"SwXTextViewCursor";"com::sun::star::style::CharacterProperties";"CharLeftBorderDistance#optional"
|
||||||
|
"SwXTextViewCursor";"com::sun::star::style::CharacterProperties";"CharRightBorderDistance#optional"
|
||||||
|
"SwXTextViewCursor";"com::sun::star::style::CharacterProperties";"CharBottomBorderDistance#optional"
|
||||||
|
"SwXTextViewCursor";"com::sun::star::style::CharacterProperties";"CharTopBorderDistance#optional"
|
||||||
"SwXTextViewCursor";"com::sun::star::document::XDocumentInsertable#optional";"insertDocumentFromURL()"
|
"SwXTextViewCursor";"com::sun::star::document::XDocumentInsertable#optional";"insertDocumentFromURL()"
|
||||||
"SwXTextViewCursor";"com::sun::star::beans::XPropertySet";"getPropertySetInfo()"
|
"SwXTextViewCursor";"com::sun::star::beans::XPropertySet";"getPropertySetInfo()"
|
||||||
"SwXTextViewCursor";"com::sun::star::beans::XPropertySet";"setPropertyValue()"
|
"SwXTextViewCursor";"com::sun::star::beans::XPropertySet";"setPropertyValue()"
|
||||||
|
|
@ -92,6 +92,15 @@
|
|||||||
"CharacterStyle";"com::sun::star::style::CharacterProperties";"CharStyleNames#optional"
|
"CharacterStyle";"com::sun::star::style::CharacterProperties";"CharStyleNames#optional"
|
||||||
"CharacterStyle";"com::sun::star::style::CharacterProperties";"CharHidden#optional"
|
"CharacterStyle";"com::sun::star::style::CharacterProperties";"CharHidden#optional"
|
||||||
"CharacterStyle";"com::sun::star::style::CharacterProperties";"TextUserDefinedAttributes#optional"
|
"CharacterStyle";"com::sun::star::style::CharacterProperties";"TextUserDefinedAttributes#optional"
|
||||||
|
"CharacterStyle";"com::sun::star::style::CharacterProperties";"CharLeftBorder#optional"
|
||||||
|
"CharacterStyle";"com::sun::star::style::CharacterProperties";"CharRightBorder#optional"
|
||||||
|
"CharacterStyle";"com::sun::star::style::CharacterProperties";"CharBottomBorder#optional"
|
||||||
|
"CharacterStyle";"com::sun::star::style::CharacterProperties";"CharTopBorder#optional"
|
||||||
|
"CharacterStyle";"com::sun::star::style::CharacterProperties";"CharBorderDistance#optional"
|
||||||
|
"CharacterStyle";"com::sun::star::style::CharacterProperties";"CharLeftBorderDistance#optional"
|
||||||
|
"CharacterStyle";"com::sun::star::style::CharacterProperties";"CharRightBorderDistance#optional"
|
||||||
|
"CharacterStyle";"com::sun::star::style::CharacterProperties";"CharBottomBorderDistance#optional"
|
||||||
|
"CharacterStyle";"com::sun::star::style::CharacterProperties";"CharTopBorderDistance#optional"
|
||||||
"CharacterStyle";"com::sun::star::beans::XPropertySet";"getPropertySetInfo()"
|
"CharacterStyle";"com::sun::star::beans::XPropertySet";"getPropertySetInfo()"
|
||||||
"CharacterStyle";"com::sun::star::beans::XPropertySet";"setPropertyValue()"
|
"CharacterStyle";"com::sun::star::beans::XPropertySet";"setPropertyValue()"
|
||||||
"CharacterStyle";"com::sun::star::beans::XPropertySet";"getPropertyValue()"
|
"CharacterStyle";"com::sun::star::beans::XPropertySet";"getPropertyValue()"
|
||||||
|
|
@ -10,12 +10,15 @@
|
|||||||
#include <com/sun/star/container/XContentEnumerationAccess.hpp>
|
#include <com/sun/star/container/XContentEnumerationAccess.hpp>
|
||||||
#include <com/sun/star/frame/Desktop.hpp>
|
#include <com/sun/star/frame/Desktop.hpp>
|
||||||
#include <com/sun/star/style/XStyleFamiliesSupplier.hpp>
|
#include <com/sun/star/style/XStyleFamiliesSupplier.hpp>
|
||||||
|
#include <com/sun/star/style/XAutoStylesSupplier.hpp>
|
||||||
|
#include <com/sun/star/style/XAutoStyleFamily.hpp>
|
||||||
#include <com/sun/star/text/XPageCursor.hpp>
|
#include <com/sun/star/text/XPageCursor.hpp>
|
||||||
#include <com/sun/star/text/XTextDocument.hpp>
|
#include <com/sun/star/text/XTextDocument.hpp>
|
||||||
#include <com/sun/star/text/XTextRange.hpp>
|
#include <com/sun/star/text/XTextRange.hpp>
|
||||||
#include <com/sun/star/text/XTextTable.hpp>
|
#include <com/sun/star/text/XTextTable.hpp>
|
||||||
#include <com/sun/star/text/XTextViewCursorSupplier.hpp>
|
#include <com/sun/star/text/XTextViewCursorSupplier.hpp>
|
||||||
#include <com/sun/star/table/XCell.hpp>
|
#include <com/sun/star/table/XCell.hpp>
|
||||||
|
#include <com/sun/star/table/BorderLine2.hpp>
|
||||||
|
|
||||||
#include <test/bootstrapfixture.hxx>
|
#include <test/bootstrapfixture.hxx>
|
||||||
#include <unotest/macros_test.hxx>
|
#include <unotest/macros_test.hxx>
|
||||||
@ -120,6 +123,15 @@ protected:
|
|||||||
return xStyleFamily;
|
return xStyleFamily;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Get a family of auto styles, see com.sun.star.style.StyleFamilies for possible values.
|
||||||
|
uno::Reference<style::XAutoStyleFamily> getAutoStyles(OUString aFamily)
|
||||||
|
{
|
||||||
|
uno::Reference< style::XAutoStylesSupplier > xAutoStylesSupplier(mxComponent, uno::UNO_QUERY);
|
||||||
|
uno::Reference< style::XAutoStyles > xAutoStyles(xAutoStylesSupplier->getAutoStyles());
|
||||||
|
uno::Reference< style::XAutoStyleFamily > xAutoStyleFamily(xAutoStyles->getByName(aFamily), uno::UNO_QUERY);
|
||||||
|
return xAutoStyleFamily;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Extract a value from the layout dump using an XPath expression and an attribute name.
|
* Extract a value from the layout dump using an XPath expression and an attribute name.
|
||||||
*
|
*
|
||||||
@ -326,6 +338,21 @@ protected:
|
|||||||
return xCursor->getPage();
|
return xCursor->getPage();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void assertEqualBorder(
|
||||||
|
const table::BorderLine2& rLeft, const sal_Int32 nLeftDist,
|
||||||
|
const table::BorderLine2& rRight, const sal_Int32 nRightDist )
|
||||||
|
{
|
||||||
|
// Border
|
||||||
|
CPPUNIT_ASSERT_EQUAL(rLeft.Color, rRight.Color);
|
||||||
|
CPPUNIT_ASSERT_EQUAL(rLeft.InnerLineWidth, rRight.InnerLineWidth);
|
||||||
|
CPPUNIT_ASSERT_EQUAL(rLeft.LineDistance, rRight.LineDistance);
|
||||||
|
CPPUNIT_ASSERT_EQUAL(rLeft.LineStyle, rRight.LineStyle);
|
||||||
|
CPPUNIT_ASSERT_EQUAL(rLeft.LineWidth, rRight.LineWidth);
|
||||||
|
CPPUNIT_ASSERT_EQUAL(rLeft.OuterLineWidth, rRight.OuterLineWidth);
|
||||||
|
// Padding
|
||||||
|
CPPUNIT_ASSERT_EQUAL(nLeftDist, nRightDist);
|
||||||
|
}
|
||||||
|
|
||||||
uno::Reference<lang::XComponent> mxComponent;
|
uno::Reference<lang::XComponent> mxComponent;
|
||||||
xmlBufferPtr mpXmlBuffer;
|
xmlBufferPtr mpXmlBuffer;
|
||||||
|
|
||||||
|
BIN
sw/qa/extras/odfexport/data/charborder.odt
Normal file
BIN
sw/qa/extras/odfexport/data/charborder.odt
Normal file
Binary file not shown.
@ -19,6 +19,7 @@ public:
|
|||||||
void testTextframeGradient();
|
void testTextframeGradient();
|
||||||
void testFdo60769();
|
void testFdo60769();
|
||||||
void testFdo58949();
|
void testFdo58949();
|
||||||
|
void testCharacterBorder();
|
||||||
|
|
||||||
CPPUNIT_TEST_SUITE(Test);
|
CPPUNIT_TEST_SUITE(Test);
|
||||||
#if !defined(MACOSX) && !defined(WNT)
|
#if !defined(MACOSX) && !defined(WNT)
|
||||||
@ -38,6 +39,7 @@ void Test::run()
|
|||||||
{"textframe-gradient.odt", &Test::testTextframeGradient},
|
{"textframe-gradient.odt", &Test::testTextframeGradient},
|
||||||
{"fdo60769.odt", &Test::testFdo60769},
|
{"fdo60769.odt", &Test::testFdo60769},
|
||||||
{"fdo58949.docx", &Test::testFdo58949},
|
{"fdo58949.docx", &Test::testFdo58949},
|
||||||
|
{"charborder.odt", &Test::testCharacterBorder },
|
||||||
};
|
};
|
||||||
header();
|
header();
|
||||||
for (unsigned int i = 0; i < SAL_N_ELEMENTS(aMethods); ++i)
|
for (unsigned int i = 0; i < SAL_N_ELEMENTS(aMethods); ++i)
|
||||||
@ -162,6 +164,180 @@ void Test::testFdo58949()
|
|||||||
CPPUNIT_ASSERT_EQUAL(true, bool(xNameAccess->hasByName("Obj102")));
|
CPPUNIT_ASSERT_EQUAL(true, bool(xNameAccess->hasByName("Obj102")));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Test::testCharacterBorder()
|
||||||
|
{
|
||||||
|
// Make sure paragraph and character attributes don't interfere
|
||||||
|
// First paragraph has a paragraph border and a character border included by the paragraph style
|
||||||
|
|
||||||
|
// Paragraph border of first paragraph
|
||||||
|
{
|
||||||
|
const table::BorderLine2 aFirstParTopBorder(6711039,0,26,26,7,53);
|
||||||
|
const sal_Int32 aFirstParTopPadding(150);
|
||||||
|
uno::Reference<beans::XPropertySet> xSet(getParagraph(1), uno::UNO_QUERY);
|
||||||
|
|
||||||
|
// Top border
|
||||||
|
assertEqualBorder(
|
||||||
|
aFirstParTopBorder, aFirstParTopPadding,
|
||||||
|
getProperty<table::BorderLine2>(xSet,"TopBorder"),
|
||||||
|
getProperty<sal_Int32>(xSet,"TopBorderDistance"));
|
||||||
|
|
||||||
|
// Bottom border (same as top border)
|
||||||
|
assertEqualBorder(
|
||||||
|
aFirstParTopBorder, aFirstParTopPadding,
|
||||||
|
getProperty<table::BorderLine2>(xSet,"BottomBorder"),
|
||||||
|
getProperty<sal_Int32>(xSet,"BottomBorderDistance"));
|
||||||
|
|
||||||
|
// Left border (same as top border)
|
||||||
|
assertEqualBorder(
|
||||||
|
aFirstParTopBorder, aFirstParTopPadding,
|
||||||
|
getProperty<table::BorderLine2>(xSet,"LeftBorder"),
|
||||||
|
getProperty<sal_Int32>(xSet,"LeftBorderDistance"));
|
||||||
|
|
||||||
|
// Right border (same as top border)
|
||||||
|
assertEqualBorder(
|
||||||
|
aFirstParTopBorder, aFirstParTopPadding,
|
||||||
|
getProperty<table::BorderLine2>(xSet,"RightBorder"),
|
||||||
|
getProperty<sal_Int32>(xSet,"RightBorderDistance"));
|
||||||
|
}
|
||||||
|
|
||||||
|
// Character border for first paragraph
|
||||||
|
{
|
||||||
|
const table::BorderLine2 aFirstParCharTopBorder(16724787,0,37,0,2,37);
|
||||||
|
const sal_Int32 aFirstParCharTopPadding(450);
|
||||||
|
uno::Reference<beans::XPropertySet> xSet(getParagraph(1), uno::UNO_QUERY);
|
||||||
|
|
||||||
|
// Top border
|
||||||
|
assertEqualBorder(
|
||||||
|
aFirstParCharTopBorder, aFirstParCharTopPadding,
|
||||||
|
getProperty<table::BorderLine2>(xSet,"CharTopBorder"),
|
||||||
|
getProperty<sal_Int32>(xSet,"CharTopBorderDistance"));
|
||||||
|
|
||||||
|
// Bottom border (same as top border)
|
||||||
|
assertEqualBorder(
|
||||||
|
aFirstParCharTopBorder, aFirstParCharTopPadding,
|
||||||
|
getProperty<table::BorderLine2>(xSet,"CharBottomBorder"),
|
||||||
|
getProperty<sal_Int32>(xSet,"CharBottomBorderDistance"));
|
||||||
|
|
||||||
|
// Left border (same as top border)
|
||||||
|
assertEqualBorder(
|
||||||
|
aFirstParCharTopBorder, aFirstParCharTopPadding,
|
||||||
|
getProperty<table::BorderLine2>(xSet,"CharLeftBorder"),
|
||||||
|
getProperty<sal_Int32>(xSet,"CharLeftBorderDistance"));
|
||||||
|
|
||||||
|
// Right border (same as top border)
|
||||||
|
assertEqualBorder(
|
||||||
|
aFirstParCharTopBorder, aFirstParCharTopPadding,
|
||||||
|
getProperty<table::BorderLine2>(xSet,"CharRightBorder"),
|
||||||
|
getProperty<sal_Int32>(xSet,"CharRightBorderDistance"));
|
||||||
|
|
||||||
|
// Check autostyle
|
||||||
|
{
|
||||||
|
uno::Reference< style::XAutoStyleFamily > xAutoStyleFamily(getAutoStyles("ParagraphStyles"));
|
||||||
|
uno::Reference < container::XEnumeration > xAutoStylesEnum( xAutoStyleFamily->createEnumeration() );
|
||||||
|
CPPUNIT_ASSERT_EQUAL((bool)xAutoStylesEnum->hasMoreElements(), true);
|
||||||
|
|
||||||
|
// First paragraph autostyle
|
||||||
|
uno::Reference < beans::XPropertySet > xPSet( xAutoStylesEnum->nextElement(), uno::UNO_QUERY );
|
||||||
|
|
||||||
|
// Top border
|
||||||
|
assertEqualBorder(
|
||||||
|
aFirstParCharTopBorder, aFirstParCharTopPadding,
|
||||||
|
getProperty<table::BorderLine2>(xSet,"CharTopBorder"),
|
||||||
|
getProperty<sal_Int32>(xSet,"CharTopBorderDistance"));
|
||||||
|
|
||||||
|
// Bottom border
|
||||||
|
assertEqualBorder(
|
||||||
|
aFirstParCharTopBorder, aFirstParCharTopPadding,
|
||||||
|
getProperty<table::BorderLine2>(xSet,"CharBottomBorder"),
|
||||||
|
getProperty<sal_Int32>(xSet,"CharBottomBorderDistance"));
|
||||||
|
|
||||||
|
// Left border
|
||||||
|
assertEqualBorder(
|
||||||
|
aFirstParCharTopBorder, aFirstParCharTopPadding,
|
||||||
|
getProperty<table::BorderLine2>(xSet,"CharLeftBorder"),
|
||||||
|
getProperty<sal_Int32>(xSet,"CharLeftBorderDistance"));
|
||||||
|
|
||||||
|
// Right border
|
||||||
|
assertEqualBorder(
|
||||||
|
aFirstParCharTopBorder, aFirstParCharTopPadding,
|
||||||
|
getProperty<table::BorderLine2>(xSet,"CharRightBorder"),
|
||||||
|
getProperty<sal_Int32>(xSet,"CharRightBorderDistance"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Second paragraph's second text portion has a character style named CharDiffBor
|
||||||
|
// This style includes border with different sides
|
||||||
|
{
|
||||||
|
|
||||||
|
table::BorderLine2 aBorderArray[4] =
|
||||||
|
{
|
||||||
|
table::BorderLine2(16724787,26,2,4,13,35), // Top
|
||||||
|
table::BorderLine2(10092390,26,26,53,11,106), // Bottom
|
||||||
|
table::BorderLine2(6711039,9,26,9,12,71), // Left
|
||||||
|
table::BorderLine2(0,0,0,0,0,0) // Right
|
||||||
|
};
|
||||||
|
|
||||||
|
sal_Int32 aDistances[4] = { 400 /*Top*/, 300 /*Bottom*/, 250 /*Left*/, 0 /*Right*/ };
|
||||||
|
|
||||||
|
// Get second text portion of second paragraph
|
||||||
|
uno::Reference < beans::XPropertySet > xSet( getRun(getParagraph(2),2), uno::UNO_QUERY );
|
||||||
|
|
||||||
|
// Top border
|
||||||
|
assertEqualBorder(
|
||||||
|
aBorderArray[0], aDistances[0],
|
||||||
|
getProperty<table::BorderLine2>(xSet,"CharTopBorder"),
|
||||||
|
getProperty<sal_Int32>(xSet,"CharTopBorderDistance"));
|
||||||
|
|
||||||
|
// Bottom border
|
||||||
|
assertEqualBorder(
|
||||||
|
aBorderArray[1], aDistances[1],
|
||||||
|
getProperty<table::BorderLine2>(xSet,"CharBottomBorder"),
|
||||||
|
getProperty<sal_Int32>(xSet,"CharBottomBorderDistance"));
|
||||||
|
|
||||||
|
// Left border
|
||||||
|
assertEqualBorder(
|
||||||
|
aBorderArray[2], aDistances[2],
|
||||||
|
getProperty<table::BorderLine2>(xSet,"CharLeftBorder"),
|
||||||
|
getProperty<sal_Int32>(xSet,"CharLeftBorderDistance"));
|
||||||
|
|
||||||
|
// Right border
|
||||||
|
assertEqualBorder(
|
||||||
|
aBorderArray[3], aDistances[3],
|
||||||
|
getProperty<table::BorderLine2>(xSet,"CharRightBorder"),
|
||||||
|
getProperty<sal_Int32>(xSet,"CharRightBorderDistance"));
|
||||||
|
|
||||||
|
// Check character style
|
||||||
|
{
|
||||||
|
uno::Reference< container::XNameAccess > xStyleFamily(getStyles("CharacterStyles"), uno::UNO_QUERY);
|
||||||
|
uno::Reference < beans::XPropertySet > xStyleSet(xStyleFamily->getByName("CharDiffBor"), uno::UNO_QUERY);
|
||||||
|
|
||||||
|
// Top border
|
||||||
|
assertEqualBorder(
|
||||||
|
aBorderArray[0], aDistances[0],
|
||||||
|
getProperty<table::BorderLine2>(xStyleSet,"CharTopBorder"),
|
||||||
|
getProperty<sal_Int32>(xStyleSet,"CharTopBorderDistance"));
|
||||||
|
|
||||||
|
// Bottom border
|
||||||
|
assertEqualBorder(
|
||||||
|
aBorderArray[1], aDistances[1],
|
||||||
|
getProperty<table::BorderLine2>(xStyleSet,"CharBottomBorder"),
|
||||||
|
getProperty<sal_Int32>(xStyleSet,"CharBottomBorderDistance"));
|
||||||
|
|
||||||
|
// Left border
|
||||||
|
assertEqualBorder(
|
||||||
|
aBorderArray[2], aDistances[2],
|
||||||
|
getProperty<table::BorderLine2>(xStyleSet,"CharLeftBorder"),
|
||||||
|
getProperty<sal_Int32>(xStyleSet,"CharLeftBorderDistance"));
|
||||||
|
|
||||||
|
// Right border
|
||||||
|
assertEqualBorder(
|
||||||
|
aBorderArray[3], aDistances[3],
|
||||||
|
getProperty<table::BorderLine2>(xStyleSet,"CharRightBorder"),
|
||||||
|
getProperty<sal_Int32>(xStyleSet,"CharRightBorderDistance"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
CPPUNIT_TEST_SUITE_REGISTRATION(Test);
|
CPPUNIT_TEST_SUITE_REGISTRATION(Test);
|
||||||
|
|
||||||
CPPUNIT_PLUGIN_IMPLEMENT();
|
CPPUNIT_PLUGIN_IMPLEMENT();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user