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:
Zolnai Tamás 2013-08-13 18:04:14 +02:00
parent 47e24bfed8
commit ea358f5d5b
9 changed files with 257 additions and 0 deletions

View File

@ -134,6 +134,15 @@
"SwXCellRange";"com::sun::star::style::CharacterProperties";"CharStyleNames#optional"
"SwXCellRange";"com::sun::star::style::CharacterProperties";"CharHidden#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";"setDataArray()"
"SwXCellRange";"com::sun::star::style::ParagraphPropertiesAsian#optional";"ParaIsHangingPunctuation"

1 SwXCellRange com::sun::star::style::CharacterPropertiesAsian CharHeightAsian
134 SwXCellRange com::sun::star::style::CharacterProperties CharStyleNames#optional
135 SwXCellRange com::sun::star::style::CharacterProperties CharHidden#optional
136 SwXCellRange com::sun::star::style::CharacterProperties TextUserDefinedAttributes#optional
137 SwXCellRange com::sun::star::style::CharacterProperties CharLeftBorder#optional
138 SwXCellRange com::sun::star::style::CharacterProperties CharRightBorder#optional
139 SwXCellRange com::sun::star::style::CharacterProperties CharBottomBorder#optional
140 SwXCellRange com::sun::star::style::CharacterProperties CharTopBorder#optional
141 SwXCellRange com::sun::star::style::CharacterProperties CharBorderDistance#optional
142 SwXCellRange com::sun::star::style::CharacterProperties CharLeftBorderDistance#optional
143 SwXCellRange com::sun::star::style::CharacterProperties CharRightBorderDistance#optional
144 SwXCellRange com::sun::star::style::CharacterProperties CharBottomBorderDistance#optional
145 SwXCellRange com::sun::star::style::CharacterProperties CharTopBorderDistance#optional
146 SwXCellRange com::sun::star::sheet::XCellRangeData#optional getDataArray()
147 SwXCellRange com::sun::star::sheet::XCellRangeData#optional setDataArray()
148 SwXCellRange com::sun::star::style::ParagraphPropertiesAsian#optional ParaIsHangingPunctuation

View File

@ -156,6 +156,15 @@
"SwXTextCursor";"com::sun::star::style::CharacterProperties";"CharStyleNames#optional"
"SwXTextCursor";"com::sun::star::style::CharacterProperties";"CharHidden#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::beans::XPropertySet";"getPropertySetInfo()"
"SwXTextCursor";"com::sun::star::beans::XPropertySet";"setPropertyValue()"

1 SwXTextCursor com::sun::star::style::CharacterPropertiesAsian#optional CharHeightAsian
156 SwXTextCursor com::sun::star::style::CharacterProperties CharStyleNames#optional
157 SwXTextCursor com::sun::star::style::CharacterProperties CharHidden#optional
158 SwXTextCursor com::sun::star::style::CharacterProperties TextUserDefinedAttributes#optional
159 SwXTextCursor com::sun::star::style::CharacterProperties CharLeftBorder#optional
160 SwXTextCursor com::sun::star::style::CharacterProperties CharRightBorder#optional
161 SwXTextCursor com::sun::star::style::CharacterProperties CharBottomBorder#optional
162 SwXTextCursor com::sun::star::style::CharacterProperties CharTopBorder#optional
163 SwXTextCursor com::sun::star::style::CharacterProperties CharBorderDistance#optional
164 SwXTextCursor com::sun::star::style::CharacterProperties CharLeftBorderDistance#optional
165 SwXTextCursor com::sun::star::style::CharacterProperties CharRightBorderDistance#optional
166 SwXTextCursor com::sun::star::style::CharacterProperties CharBottomBorderDistance#optional
167 SwXTextCursor com::sun::star::style::CharacterProperties CharTopBorderDistance#optional
168 SwXTextCursor com::sun::star::document::XDocumentInsertable#optional insertDocumentFromURL()
169 SwXTextCursor com::sun::star::beans::XPropertySet getPropertySetInfo()
170 SwXTextCursor com::sun::star::beans::XPropertySet setPropertyValue()

View File

@ -130,6 +130,15 @@
"SwXTextRange";"com::sun::star::style::CharacterProperties";"CharStyleNames#optional"
"SwXTextRange";"com::sun::star::style::CharacterProperties";"CharHidden#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";"setPropertyValue()"
"SwXTextRange";"com::sun::star::beans::XPropertySet";"getPropertyValue()"

1 SwXTextRange com::sun::star::style::CharacterPropertiesAsian#optional CharHeightAsian
130 SwXTextRange com::sun::star::style::CharacterProperties CharStyleNames#optional
131 SwXTextRange com::sun::star::style::CharacterProperties CharHidden#optional
132 SwXTextRange com::sun::star::style::CharacterProperties TextUserDefinedAttributes#optional
133 SwXTextRange com::sun::star::style::CharacterProperties CharLeftBorder#optional
134 SwXTextRange com::sun::star::style::CharacterProperties CharRightBorder#optional
135 SwXTextRange com::sun::star::style::CharacterProperties CharBottomBorder#optional
136 SwXTextRange com::sun::star::style::CharacterProperties CharTopBorder#optional
137 SwXTextRange com::sun::star::style::CharacterProperties CharBorderDistance#optional
138 SwXTextRange com::sun::star::style::CharacterProperties CharLeftBorderDistance#optional
139 SwXTextRange com::sun::star::style::CharacterProperties CharRightBorderDistance#optional
140 SwXTextRange com::sun::star::style::CharacterProperties CharBottomBorderDistance#optional
141 SwXTextRange com::sun::star::style::CharacterProperties CharTopBorderDistance#optional
142 SwXTextRange com::sun::star::beans::XPropertySet getPropertySetInfo()
143 SwXTextRange com::sun::star::beans::XPropertySet setPropertyValue()
144 SwXTextRange com::sun::star::beans::XPropertySet getPropertyValue()

View File

@ -133,6 +133,15 @@
"SwXTextTableCursor";"com::sun::star::style::CharacterProperties";"CharStyleNames#optional"
"SwXTextTableCursor";"com::sun::star::style::CharacterProperties";"CharHidden#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";"setPropertyValue()"
"SwXTextTableCursor";"com::sun::star::beans::XPropertySet";"getPropertyValue()"

1 SwXTextTableCursor com::sun::star::style::CharacterPropertiesAsian CharHeightAsian
133 SwXTextTableCursor com::sun::star::style::CharacterProperties CharStyleNames#optional
134 SwXTextTableCursor com::sun::star::style::CharacterProperties CharHidden#optional
135 SwXTextTableCursor com::sun::star::style::CharacterProperties TextUserDefinedAttributes#optional
136 SwXTextTableCursor com::sun::star::style::CharacterProperties CharLeftBorder#optional
137 SwXTextTableCursor com::sun::star::style::CharacterProperties CharRightBorder#optional
138 SwXTextTableCursor com::sun::star::style::CharacterProperties CharBottomBorder#optional
139 SwXTextTableCursor com::sun::star::style::CharacterProperties CharTopBorder#optional
140 SwXTextTableCursor com::sun::star::style::CharacterProperties CharBorderDistance#optional
141 SwXTextTableCursor com::sun::star::style::CharacterProperties CharLeftBorderDistance#optional
142 SwXTextTableCursor com::sun::star::style::CharacterProperties CharRightBorderDistance#optional
143 SwXTextTableCursor com::sun::star::style::CharacterProperties CharBottomBorderDistance#optional
144 SwXTextTableCursor com::sun::star::style::CharacterProperties CharTopBorderDistance#optional
145 SwXTextTableCursor com::sun::star::beans::XPropertySet getPropertySetInfo()
146 SwXTextTableCursor com::sun::star::beans::XPropertySet setPropertyValue()
147 SwXTextTableCursor com::sun::star::beans::XPropertySet getPropertyValue()

View File

@ -166,6 +166,15 @@
"SwXTextViewCursor";"com::sun::star::style::CharacterProperties";"CharStyleNames#optional"
"SwXTextViewCursor";"com::sun::star::style::CharacterProperties";"CharHidden#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::beans::XPropertySet";"getPropertySetInfo()"
"SwXTextViewCursor";"com::sun::star::beans::XPropertySet";"setPropertyValue()"

1 SwXTextViewCursor com::sun::star::style::CharacterPropertiesAsian#optional CharHeightAsian
166 SwXTextViewCursor com::sun::star::style::CharacterProperties CharStyleNames#optional
167 SwXTextViewCursor com::sun::star::style::CharacterProperties CharHidden#optional
168 SwXTextViewCursor com::sun::star::style::CharacterProperties TextUserDefinedAttributes#optional
169 SwXTextViewCursor com::sun::star::style::CharacterProperties CharLeftBorder#optional
170 SwXTextViewCursor com::sun::star::style::CharacterProperties CharRightBorder#optional
171 SwXTextViewCursor com::sun::star::style::CharacterProperties CharBottomBorder#optional
172 SwXTextViewCursor com::sun::star::style::CharacterProperties CharTopBorder#optional
173 SwXTextViewCursor com::sun::star::style::CharacterProperties CharBorderDistance#optional
174 SwXTextViewCursor com::sun::star::style::CharacterProperties CharLeftBorderDistance#optional
175 SwXTextViewCursor com::sun::star::style::CharacterProperties CharRightBorderDistance#optional
176 SwXTextViewCursor com::sun::star::style::CharacterProperties CharBottomBorderDistance#optional
177 SwXTextViewCursor com::sun::star::style::CharacterProperties CharTopBorderDistance#optional
178 SwXTextViewCursor com::sun::star::document::XDocumentInsertable#optional insertDocumentFromURL()
179 SwXTextViewCursor com::sun::star::beans::XPropertySet getPropertySetInfo()
180 SwXTextViewCursor com::sun::star::beans::XPropertySet setPropertyValue()

View File

@ -92,6 +92,15 @@
"CharacterStyle";"com::sun::star::style::CharacterProperties";"CharStyleNames#optional"
"CharacterStyle";"com::sun::star::style::CharacterProperties";"CharHidden#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";"setPropertyValue()"
"CharacterStyle";"com::sun::star::beans::XPropertySet";"getPropertyValue()"

1 CharacterStyle com::sun::star::style::CharacterPropertiesAsian CharHeightAsian
92 CharacterStyle com::sun::star::style::CharacterProperties CharStyleNames#optional
93 CharacterStyle com::sun::star::style::CharacterProperties CharHidden#optional
94 CharacterStyle com::sun::star::style::CharacterProperties TextUserDefinedAttributes#optional
95 CharacterStyle com::sun::star::style::CharacterProperties CharLeftBorder#optional
96 CharacterStyle com::sun::star::style::CharacterProperties CharRightBorder#optional
97 CharacterStyle com::sun::star::style::CharacterProperties CharBottomBorder#optional
98 CharacterStyle com::sun::star::style::CharacterProperties CharTopBorder#optional
99 CharacterStyle com::sun::star::style::CharacterProperties CharBorderDistance#optional
100 CharacterStyle com::sun::star::style::CharacterProperties CharLeftBorderDistance#optional
101 CharacterStyle com::sun::star::style::CharacterProperties CharRightBorderDistance#optional
102 CharacterStyle com::sun::star::style::CharacterProperties CharBottomBorderDistance#optional
103 CharacterStyle com::sun::star::style::CharacterProperties CharTopBorderDistance#optional
104 CharacterStyle com::sun::star::beans::XPropertySet getPropertySetInfo()
105 CharacterStyle com::sun::star::beans::XPropertySet setPropertyValue()
106 CharacterStyle com::sun::star::beans::XPropertySet getPropertyValue()

View File

@ -10,12 +10,15 @@
#include <com/sun/star/container/XContentEnumerationAccess.hpp>
#include <com/sun/star/frame/Desktop.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/XTextDocument.hpp>
#include <com/sun/star/text/XTextRange.hpp>
#include <com/sun/star/text/XTextTable.hpp>
#include <com/sun/star/text/XTextViewCursorSupplier.hpp>
#include <com/sun/star/table/XCell.hpp>
#include <com/sun/star/table/BorderLine2.hpp>
#include <test/bootstrapfixture.hxx>
#include <unotest/macros_test.hxx>
@ -120,6 +123,15 @@ protected:
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.
*
@ -326,6 +338,21 @@ protected:
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;
xmlBufferPtr mpXmlBuffer;

Binary file not shown.

View File

@ -19,6 +19,7 @@ public:
void testTextframeGradient();
void testFdo60769();
void testFdo58949();
void testCharacterBorder();
CPPUNIT_TEST_SUITE(Test);
#if !defined(MACOSX) && !defined(WNT)
@ -38,6 +39,7 @@ void Test::run()
{"textframe-gradient.odt", &Test::testTextframeGradient},
{"fdo60769.odt", &Test::testFdo60769},
{"fdo58949.docx", &Test::testFdo58949},
{"charborder.odt", &Test::testCharacterBorder },
};
header();
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")));
}
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_PLUGIN_IMPLEMENT();