Branch data Line data Source code
1 : : /*
2 : : * Version: MPL 1.1 / GPLv3+ / LGPLv3+
3 : : *
4 : : * The contents of this file are subject to the Mozilla Public License Version
5 : : * 1.1 (the "License"); you may not use this file except in compliance with
6 : : * the License. You may obtain a copy of the License at
7 : : * http://www.mozilla.org/MPL/
8 : : *
9 : : * Software distributed under the License is distributed on an "AS IS" basis,
10 : : * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
11 : : * for the specific language governing rights and limitations under the
12 : : * License.
13 : : *
14 : : * The Initial Developer of the Original Code is
15 : : * Miklos Vajna <vmiklos@suse.cz> (SUSE, Inc.)
16 : : * Portions created by the Initial Developer are Copyright (C) 2012 the
17 : : * Initial Developer. All Rights Reserved.
18 : : *
19 : : * Contributor(s):
20 : : *
21 : : * Alternatively, the contents of this file may be used under the terms of
22 : : * either the GNU General Public License Version 3 or later (the "GPLv3+"), or
23 : : * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"),
24 : : * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
25 : : * instead of those above.
26 : : */
27 : :
28 : : #include "../swmodeltestbase.hxx"
29 : : #include "bordertest.hxx"
30 : :
31 : : #include <com/sun/star/drawing/XDrawPageSupplier.hpp>
32 : : #include <com/sun/star/graphic/GraphicType.hpp>
33 : : #include <com/sun/star/lang/XServiceInfo.hpp>
34 : : #include <com/sun/star/style/CaseMap.hpp>
35 : : #include <com/sun/star/style/LineSpacing.hpp>
36 : : #include <com/sun/star/style/LineSpacingMode.hpp>
37 : : #include <com/sun/star/table/BorderLine2.hpp>
38 : : #include <com/sun/star/table/BorderLineStyle.hpp>
39 : : #include <com/sun/star/text/RelOrientation.hpp>
40 : : #include <com/sun/star/text/SizeType.hpp>
41 : : #include <com/sun/star/text/TextContentAnchorType.hpp>
42 : : #include <com/sun/star/text/XFootnotesSupplier.hpp>
43 : : #include <com/sun/star/text/XPageCursor.hpp>
44 : : #include <com/sun/star/text/XTextGraphicObjectsSupplier.hpp>
45 : : #include <com/sun/star/text/XTextFieldsSupplier.hpp>
46 : : #include <com/sun/star/text/XTextFramesSupplier.hpp>
47 : : #include <com/sun/star/text/XTextTablesSupplier.hpp>
48 : : #include <com/sun/star/text/XTextTable.hpp>
49 : : #include <com/sun/star/text/XTextViewCursorSupplier.hpp>
50 : : #include <com/sun/star/util/XNumberFormatsSupplier.hpp>
51 : :
52 : : #include <rtl/oustringostreaminserter.hxx>
53 : : #include <vcl/outdev.hxx>
54 : : #include <vcl/svapp.hxx>
55 : :
56 : : #define TWIP_TO_MM100(TWIP) ((TWIP) >= 0 ? (((TWIP)*127L+36L)/72L) : (((TWIP)*127L-36L)/72L))
57 : :
58 : : using rtl::OString;
59 : : using rtl::OUString;
60 : : using rtl::OUStringBuffer;
61 : :
62 [ - + ]: 396 : class Test : public SwModelTestBase
63 : : {
64 : : public:
65 : : void testFdo45553();
66 : : void testN192129();
67 : : void testFdo45543();
68 : : void testN695479();
69 : : void testFdo42465();
70 : : void testFdo45187();
71 : : void testFdo46662();
72 : : void testN750757();
73 : : void testFdo45563();
74 : : void testFdo43965();
75 : : void testN751020();
76 : : void testFdo47326();
77 : : void testFdo47036();
78 : : void testFdo46955();
79 : : void testFdo45394();
80 : : void testFdo48104();
81 : : void testFdo47107();
82 : : void testFdo45182();
83 : : void testFdo44176();
84 : : void testFdo39053();
85 : : void testFdo48356();
86 : : void testFdo48023();
87 : : void testFdo48876();
88 : : void testFdo48193();
89 : : void testFdo44211();
90 : : void testFdo48037();
91 : : void testFdo47764();
92 : : void testFdo38786();
93 : : void testN757651();
94 : : void testFdo49501();
95 : : void testFdo49271();
96 : : void testFdo49692();
97 : : void testFdo45190();
98 : : void testFdo50539();
99 : : void testFdo50665();
100 : : void testFdo49659();
101 : : void testFdo46966();
102 : : void testFdo52066();
103 : : void testFdo48033();
104 : : void testFdo36089();
105 : : void testFdo49892();
106 : : void testFdo48446();
107 : : void testFdo47495();
108 : : void testAllGapsWord();
109 : :
110 [ + - ][ + - ]: 6 : CPPUNIT_TEST_SUITE(Test);
[ + - ][ + - ]
[ # # ]
111 : : #if !defined(MACOSX) && !defined(WNT)
112 [ + - ][ + - ]: 3 : CPPUNIT_TEST(testFdo45553);
[ + - ][ + - ]
[ + - ][ + - ]
113 [ + - ][ + - ]: 3 : CPPUNIT_TEST(testN192129);
[ + - ][ + - ]
[ + - ][ + - ]
114 [ + - ][ + - ]: 3 : CPPUNIT_TEST(testFdo45543);
[ + - ][ + - ]
[ + - ][ + - ]
115 [ + - ][ + - ]: 3 : CPPUNIT_TEST(testN695479);
[ + - ][ + - ]
[ + - ][ + - ]
116 [ + - ][ + - ]: 3 : CPPUNIT_TEST(testFdo42465);
[ + - ][ + - ]
[ + - ][ + - ]
117 [ + - ][ + - ]: 3 : CPPUNIT_TEST(testFdo45187);
[ + - ][ + - ]
[ + - ][ + - ]
118 [ + - ][ + - ]: 3 : CPPUNIT_TEST(testFdo46662);
[ + - ][ + - ]
[ + - ][ + - ]
119 [ + - ][ + - ]: 3 : CPPUNIT_TEST(testN750757);
[ + - ][ + - ]
[ + - ][ + - ]
120 [ + - ][ + - ]: 3 : CPPUNIT_TEST(testFdo45563);
[ + - ][ + - ]
[ + - ][ + - ]
121 [ + - ][ + - ]: 3 : CPPUNIT_TEST(testFdo43965);
[ + - ][ + - ]
[ + - ][ + - ]
122 [ + - ][ + - ]: 3 : CPPUNIT_TEST(testN751020);
[ + - ][ + - ]
[ + - ][ + - ]
123 [ + - ][ + - ]: 3 : CPPUNIT_TEST(testFdo47326);
[ + - ][ + - ]
[ + - ][ + - ]
124 [ + - ][ + - ]: 3 : CPPUNIT_TEST(testFdo47036);
[ + - ][ + - ]
[ + - ][ + - ]
125 [ + - ][ + - ]: 3 : CPPUNIT_TEST(testFdo46955);
[ + - ][ + - ]
[ + - ][ + - ]
126 [ + - ][ + - ]: 3 : CPPUNIT_TEST(testFdo45394);
[ + - ][ + - ]
[ + - ][ + - ]
127 [ + - ][ + - ]: 3 : CPPUNIT_TEST(testFdo48104);
[ + - ][ + - ]
[ + - ][ + - ]
128 [ + - ][ + - ]: 3 : CPPUNIT_TEST(testFdo47107);
[ + - ][ + - ]
[ + - ][ + - ]
129 [ + - ][ + - ]: 3 : CPPUNIT_TEST(testFdo45182);
[ + - ][ + - ]
[ + - ][ + - ]
130 [ + - ][ + - ]: 3 : CPPUNIT_TEST(testFdo44176);
[ + - ][ + - ]
[ + - ][ + - ]
131 [ + - ][ + - ]: 3 : CPPUNIT_TEST(testFdo39053);
[ + - ][ + - ]
[ + - ][ + - ]
132 [ + - ][ + - ]: 3 : CPPUNIT_TEST(testFdo48356);
[ + - ][ + - ]
[ + - ][ + - ]
133 [ + - ][ + - ]: 3 : CPPUNIT_TEST(testFdo48023);
[ + - ][ + - ]
[ + - ][ + - ]
134 [ + - ][ + - ]: 3 : CPPUNIT_TEST(testFdo48876);
[ + - ][ + - ]
[ + - ][ + - ]
135 [ + - ][ + - ]: 3 : CPPUNIT_TEST(testFdo48193);
[ + - ][ + - ]
[ + - ][ + - ]
136 [ + - ][ + - ]: 3 : CPPUNIT_TEST(testFdo44211);
[ + - ][ + - ]
[ + - ][ + - ]
137 [ + - ][ + - ]: 3 : CPPUNIT_TEST(testFdo48037);
[ + - ][ + - ]
[ + - ][ + - ]
138 [ + - ][ + - ]: 3 : CPPUNIT_TEST(testFdo47764);
[ + - ][ + - ]
[ + - ][ + - ]
139 [ + - ][ + - ]: 3 : CPPUNIT_TEST(testFdo38786);
[ + - ][ + - ]
[ + - ][ + - ]
140 [ + - ][ + - ]: 3 : CPPUNIT_TEST(testN757651);
[ + - ][ + - ]
[ + - ][ + - ]
141 [ + - ][ + - ]: 3 : CPPUNIT_TEST(testFdo49501);
[ + - ][ + - ]
[ + - ][ + - ]
142 [ + - ][ + - ]: 3 : CPPUNIT_TEST(testFdo49271);
[ + - ][ + - ]
[ + - ][ + - ]
143 [ + - ][ + - ]: 3 : CPPUNIT_TEST(testFdo49692);
[ + - ][ + - ]
[ + - ][ + - ]
144 [ + - ][ + - ]: 3 : CPPUNIT_TEST(testFdo45190);
[ + - ][ + - ]
[ + - ][ + - ]
145 [ + - ][ + - ]: 3 : CPPUNIT_TEST(testFdo50539);
[ + - ][ + - ]
[ + - ][ + - ]
146 [ + - ][ + - ]: 3 : CPPUNIT_TEST(testFdo50665);
[ + - ][ + - ]
[ + - ][ + - ]
147 [ + - ][ + - ]: 3 : CPPUNIT_TEST(testFdo49659);
[ + - ][ + - ]
[ + - ][ + - ]
148 [ + - ][ + - ]: 3 : CPPUNIT_TEST(testFdo46966);
[ + - ][ + - ]
[ + - ][ + - ]
149 [ + - ][ + - ]: 3 : CPPUNIT_TEST(testFdo52066);
[ + - ][ + - ]
[ + - ][ + - ]
150 [ + - ][ + - ]: 3 : CPPUNIT_TEST(testFdo48033);
[ + - ][ + - ]
[ + - ][ + - ]
151 [ + - ][ + - ]: 3 : CPPUNIT_TEST(testFdo36089);
[ + - ][ + - ]
[ + - ][ + - ]
152 [ + - ][ + - ]: 3 : CPPUNIT_TEST(testFdo49892);
[ + - ][ + - ]
[ + - ][ + - ]
153 [ + - ][ + - ]: 3 : CPPUNIT_TEST(testFdo48446);
[ + - ][ + - ]
[ + - ][ + - ]
154 [ + - ][ + - ]: 3 : CPPUNIT_TEST(testFdo47495);
[ + - ][ + - ]
[ + - ][ + - ]
155 [ + - ][ + - ]: 3 : CPPUNIT_TEST(testAllGapsWord);
[ + - ][ + - ]
[ + - ][ + - ]
[ + - ]
156 : : #endif
157 [ + - ][ + - ]: 6 : CPPUNIT_TEST_SUITE_END();
[ + - ][ + - ]
[ + - ][ + - ]
[ + - ][ + - ]
158 : :
159 : : private:
160 : : /// Load an RTF file and make the document available via mxComponent.
161 : : void load(const OUString& rURL);
162 : : /// Get page count.
163 : : int getPages();
164 : : };
165 : :
166 : 132 : void Test::load(const OUString& rFilename)
167 : : {
168 [ + - ][ + - ]: 132 : mxComponent = loadFromDesktop(getURLFromSrc("/sw/qa/extras/rtfimport/data/") + rFilename);
169 : 132 : }
170 : :
171 : 6 : int Test::getPages()
172 : : {
173 [ + - ]: 6 : uno::Reference<frame::XModel> xModel(mxComponent, uno::UNO_QUERY);
174 [ + - ][ + - ]: 6 : uno::Reference<text::XTextViewCursorSupplier> xTextViewCursorSupplier(xModel->getCurrentController(), uno::UNO_QUERY);
[ + - ]
175 [ + - ][ + - ]: 6 : uno::Reference<text::XPageCursor> xCursor(xTextViewCursorSupplier->getViewCursor(), uno::UNO_QUERY);
[ + - ]
176 [ + - ][ + - ]: 6 : xCursor->jumpToLastPage();
177 [ + - ][ + - ]: 6 : return xCursor->getPage();
178 : : }
179 : :
180 : 3 : void Test::testFdo45553()
181 : : {
182 [ + - ]: 3 : load("fdo45553.rtf");
183 : :
184 [ + - ]: 3 : uno::Reference<text::XTextDocument> xTextDocument(mxComponent, uno::UNO_QUERY);
185 [ + - ][ + - ]: 3 : uno::Reference<container::XEnumerationAccess> xParaEnumAccess(xTextDocument->getText(), uno::UNO_QUERY);
[ + - ]
186 [ + - ][ + - ]: 3 : uno::Reference<container::XEnumeration> xParaEnum = xParaEnumAccess->createEnumeration();
187 [ + - ][ + - ]: 9 : while (xParaEnum->hasMoreElements())
[ + + ]
188 : : {
189 [ + - ][ + - ]: 6 : uno::Reference<container::XEnumerationAccess> xRangeEnumAccess(xParaEnum->nextElement(), uno::UNO_QUERY);
[ + - ]
190 [ + - ][ + - ]: 6 : uno::Reference<container::XEnumeration> xRangeEnum = xRangeEnumAccess->createEnumeration();
191 [ + - ][ + - ]: 12 : while (xRangeEnum->hasMoreElements())
[ + + ]
192 : : {
193 [ + - ][ + - ]: 6 : uno::Reference<text::XTextRange> xRange(xRangeEnum->nextElement(), uno::UNO_QUERY);
[ + - ]
194 [ + - ][ + - ]: 6 : OUString aStr = xRange->getString();
195 [ + + ]: 6 : if ( aStr == "space-before" )
196 : : {
197 : 3 : sal_Int32 nMargin = 0;
198 [ + - ]: 3 : uno::Reference<beans::XPropertySet> xPropertySet(xRange, uno::UNO_QUERY);
199 [ + - ][ + - ]: 3 : xPropertySet->getPropertyValue("ParaTopMargin") >>= nMargin;
200 [ + - ][ + - ]: 3 : CPPUNIT_ASSERT_EQUAL(sal_Int32(TWIP_TO_MM100(120)), nMargin);
[ + - ][ + - ]
[ + - ]
201 : : }
202 [ + - ]: 3 : else if ( aStr == "space-after" )
203 : : {
204 : 3 : sal_Int32 nMargin = 0;
205 [ + - ]: 3 : uno::Reference<beans::XPropertySet> xPropertySet(xRange, uno::UNO_QUERY);
206 [ + - ][ + - ]: 3 : xPropertySet->getPropertyValue("ParaBottomMargin") >>= nMargin;
207 [ + - ][ + - ]: 3 : CPPUNIT_ASSERT_EQUAL(sal_Int32(TWIP_TO_MM100(240)), nMargin);
[ + - ][ + - ]
[ + - ]
208 : : }
209 : 6 : }
210 : 9 : }
211 : 3 : }
212 : :
213 : 3 : void Test::testN192129()
214 : : {
215 [ + - ]: 3 : load("n192129.rtf");
216 : :
217 : : // We expect that the result will be 16x16px.
218 : 3 : Size aExpectedSize(16, 16);
219 [ + - ]: 3 : MapMode aMap(MAP_100TH_MM);
220 [ + - ][ + - ]: 3 : aExpectedSize = Application::GetDefaultDevice()->PixelToLogic( aExpectedSize, aMap );
221 : :
222 [ + - ]: 3 : uno::Reference<text::XTextGraphicObjectsSupplier> xTextGraphicObjectsSupplier(mxComponent, uno::UNO_QUERY);
223 [ + - ][ + - ]: 3 : uno::Reference<container::XIndexAccess> xIndexAccess(xTextGraphicObjectsSupplier->getGraphicObjects(), uno::UNO_QUERY);
[ + - ]
224 [ + - ][ + - ]: 3 : uno::Reference<drawing::XShape> xShape(xIndexAccess->getByIndex(0), uno::UNO_QUERY);
[ + - ]
225 [ + - ][ + - ]: 3 : awt::Size aActualSize(xShape->getSize());
226 : :
227 [ + - ][ + - ]: 3 : CPPUNIT_ASSERT_EQUAL(sal_Int32(aExpectedSize.Width()), aActualSize.Width);
[ + - ][ + - ]
[ + - ]
228 [ + - ][ + - ]: 3 : CPPUNIT_ASSERT_EQUAL(sal_Int32(aExpectedSize.Height()), aActualSize.Height);
[ + - ][ + - ]
[ + - ][ + - ]
229 : 3 : }
230 : :
231 : 3 : void Test::testFdo45543()
232 : : {
233 [ + - ]: 3 : load("fdo45543.rtf");
234 [ + - ][ + - ]: 3 : CPPUNIT_ASSERT_EQUAL(5, getLength());
[ + - ][ + - ]
[ + - ][ + - ]
235 : 3 : }
236 : :
237 : 3 : void Test::testN695479()
238 : : {
239 [ + - ]: 3 : load("n695479.rtf");
240 : :
241 [ + - ]: 3 : uno::Reference<text::XTextFramesSupplier> xTextFramesSupplier(mxComponent, uno::UNO_QUERY);
242 [ + - ][ + - ]: 3 : uno::Reference<container::XIndexAccess> xIndexAccess(xTextFramesSupplier->getTextFrames(), uno::UNO_QUERY);
[ + - ]
243 [ + - ][ + - ]: 3 : uno::Reference<beans::XPropertySet> xPropertySet(xIndexAccess->getByIndex(0), uno::UNO_QUERY);
[ + - ]
244 : :
245 : : // Negative ABSH should mean fixed size.
246 : 3 : sal_Int16 nSizeType = 0;
247 [ + - ][ + - ]: 3 : xPropertySet->getPropertyValue("SizeType") >>= nSizeType;
248 [ + - ][ + - ]: 3 : CPPUNIT_ASSERT_EQUAL(text::SizeType::FIX, nSizeType);
[ + - ][ + - ]
[ + - ]
249 : 3 : sal_Int32 nHeight = 0;
250 [ + - ][ + - ]: 3 : xPropertySet->getPropertyValue("Height") >>= nHeight;
251 [ + - ][ + - ]: 3 : CPPUNIT_ASSERT_EQUAL(sal_Int32(TWIP_TO_MM100(300)), nHeight);
[ + - ][ + - ]
[ + - ]
252 : :
253 [ + - ]: 3 : uno::Reference<drawing::XDrawPageSupplier> xDrawPageSupplier(mxComponent, uno::UNO_QUERY);
254 [ + - ][ + - ]: 3 : uno::Reference<container::XIndexAccess> xDraws(xDrawPageSupplier->getDrawPage(), uno::UNO_QUERY);
[ + - ]
255 : 3 : bool bFrameFound = false, bDrawFound = false;
256 [ + - ][ + - ]: 12 : for (int i = 0; i < xDraws->getCount(); ++i)
[ + + ]
257 : : {
258 [ + - ][ + - ]: 9 : uno::Reference<lang::XServiceInfo> xServiceInfo(xDraws->getByIndex(i), uno::UNO_QUERY);
[ + - ]
259 [ + - ][ + + ]: 9 : if (xServiceInfo->supportsService("com.sun.star.text.TextFrame"))
[ + - ]
260 : : {
261 : : // Both frames should be anchored to the first paragraph.
262 : 6 : bFrameFound = true;
263 [ + - ]: 6 : uno::Reference<text::XTextContent> xTextContent(xServiceInfo, uno::UNO_QUERY);
264 [ + - ][ + - ]: 6 : uno::Reference<text::XTextRange> xRange(xTextContent->getAnchor(), uno::UNO_QUERY);
[ + - ]
265 [ + - ][ + - ]: 6 : uno::Reference<text::XText> xText(xRange->getText(), uno::UNO_QUERY);
[ + - ]
266 [ + - ][ + - ]: 6 : CPPUNIT_ASSERT_EQUAL(OUString("plain"), xText->getString());
[ + - ][ + - ]
[ + - ][ + - ]
[ + - ]
267 : :
268 [ + + ]: 6 : if (i == 0)
269 : : {
270 : : // Additonally, the frist frame should have double border at the bottom.
271 : 3 : table::BorderLine2 aBorder;
272 [ + - ][ + - ]: 3 : xPropertySet->getPropertyValue("BottomBorder") >>= aBorder;
[ + - ]
273 [ + - ][ + - ]: 3 : CPPUNIT_ASSERT_EQUAL(table::BorderLineStyle::DOUBLE, aBorder.LineStyle);
[ + - ][ + - ]
[ + - ]
274 : 6 : }
275 : : }
276 [ + - ][ + - ]: 3 : else if (xServiceInfo->supportsService("com.sun.star.drawing.LineShape"))
[ + - ]
277 : : {
278 : : // The older "drawing objects" syntax should be recognized.
279 : 3 : bDrawFound = true;
280 [ + - ]: 3 : xPropertySet.set(xServiceInfo, uno::UNO_QUERY);
281 : 3 : sal_Int16 nHori = 0;
282 [ + - ][ + - ]: 3 : xPropertySet->getPropertyValue("HoriOrientRelation") >>= nHori;
283 [ + - ][ + - ]: 3 : CPPUNIT_ASSERT_EQUAL(text::RelOrientation::PAGE_PRINT_AREA, nHori);
[ + - ][ + - ]
[ + - ]
284 : 3 : sal_Int16 nVert = 0;
285 [ + - ][ + - ]: 3 : xPropertySet->getPropertyValue("VertOrientRelation") >>= nVert;
286 [ + - ][ + - ]: 3 : CPPUNIT_ASSERT_EQUAL(text::RelOrientation::PAGE_FRAME, nVert);
[ + - ][ + - ]
[ + - ]
287 : : }
288 : 9 : }
289 [ + - ][ + - ]: 3 : CPPUNIT_ASSERT(bFrameFound);
[ + - ][ + - ]
[ + - ][ + - ]
[ + - ][ + - ]
290 [ + - ][ + - ]: 3 : CPPUNIT_ASSERT(bDrawFound);
[ + - ][ + - ]
[ + - ][ + - ]
[ + - ][ + - ]
291 : 3 : }
292 : :
293 : 3 : void Test::testFdo42465()
294 : : {
295 [ + - ]: 3 : load("fdo42465.rtf");
296 [ + - ][ + - ]: 3 : CPPUNIT_ASSERT_EQUAL(3, getLength());
[ + - ][ + - ]
[ + - ][ + - ]
297 : 3 : }
298 : :
299 : 3 : void Test::testFdo45187()
300 : : {
301 [ + - ]: 3 : load("fdo45187.rtf");
302 : :
303 [ + - ]: 3 : uno::Reference<drawing::XDrawPageSupplier> xDrawPageSupplier(mxComponent, uno::UNO_QUERY);
304 [ + - ][ + - ]: 3 : uno::Reference<container::XIndexAccess> xDraws(xDrawPageSupplier->getDrawPage(), uno::UNO_QUERY);
[ + - ]
305 : : // There should be two shapes.
306 [ + - ][ + - ]: 3 : CPPUNIT_ASSERT_EQUAL(sal_Int32(2), xDraws->getCount());
[ + - ][ + - ]
[ + - ][ + - ]
[ + - ]
307 : : // They should be anchored to different paragraphs.
308 [ + - ][ + - ]: 3 : uno::Reference<beans::XPropertySet> xPropertySet(xDraws->getByIndex(0), uno::UNO_QUERY);
[ + - ]
309 : 3 : awt::Point aFirstPoint;
310 [ + - ][ + - ]: 3 : xPropertySet->getPropertyValue("AnchorPosition") >>= aFirstPoint;
[ + - ]
311 [ + - ][ + - ]: 3 : xPropertySet.set(xDraws->getByIndex(1), uno::UNO_QUERY);
[ + - ]
312 : 3 : awt::Point aSecondPoint;
313 [ + - ][ + - ]: 3 : xPropertySet->getPropertyValue("AnchorPosition") >>= aSecondPoint;
[ + - ]
314 [ + - ][ + - ]: 3 : CPPUNIT_ASSERT(aFirstPoint.Y != aSecondPoint.Y);
[ + - ][ + - ]
[ + - ][ + - ]
[ + - ][ + - ]
315 : 3 : }
316 : :
317 : 3 : void Test::testFdo46662()
318 : : {
319 [ + - ]: 3 : load("fdo46662.rtf");
320 : :
321 [ + - ][ + - ]: 3 : uno::Reference<beans::XPropertySet> xPropertySet(getStyles("NumberingStyles")->getByName("WWNum3"), uno::UNO_QUERY);
[ + - ][ + - ]
322 [ + - ][ + - ]: 3 : uno::Reference<container::XIndexAccess> xLevels(xPropertySet->getPropertyValue("NumberingRules"), uno::UNO_QUERY);
[ + - ]
323 [ + - ]: 3 : uno::Sequence<beans::PropertyValue> aProps;
324 [ + - ][ + - ]: 3 : xLevels->getByIndex(1) >>= aProps; // 2nd level
[ + - ]
325 : :
326 [ + + ]: 39 : for (int i = 0; i < aProps.getLength(); ++i)
327 : : {
328 [ + - ]: 36 : const beans::PropertyValue& rProp = aProps[i];
329 : :
330 [ + + ]: 36 : if ( rProp.Name == "ParentNumbering" )
331 : : {
332 : : sal_Int16 nValue;
333 : 3 : rProp.Value >>= nValue;
334 [ + - ][ + - ]: 3 : CPPUNIT_ASSERT_EQUAL(sal_Int16(2), nValue);
[ + - ][ + - ]
[ + - ]
335 : : }
336 [ + + ]: 33 : else if ( rProp.Name == "Suffix" )
337 : : {
338 : 3 : rtl::OUString sValue;
339 : 3 : rProp.Value >>= sValue;
340 [ + - ][ + - ]: 3 : CPPUNIT_ASSERT_EQUAL(sal_Int32(0), sValue.getLength());
[ + - ][ + - ]
[ + - ]
341 : : }
342 [ + - ]: 3 : }
343 : 3 : }
344 : :
345 : 3 : void Test::testN750757()
346 : : {
347 [ + - ]: 3 : load("n750757.rtf");
348 [ + - ]: 3 : uno::Reference<text::XTextDocument> xTextDocument(mxComponent, uno::UNO_QUERY);
349 [ + - ][ + - ]: 3 : uno::Reference<container::XEnumerationAccess> xParaEnumAccess(xTextDocument->getText(), uno::UNO_QUERY);
[ + - ]
350 [ + - ][ + - ]: 3 : uno::Reference<container::XEnumeration> xParaEnum = xParaEnumAccess->createEnumeration();
351 : :
352 [ + - ][ + - ]: 3 : uno::Reference<beans::XPropertySet> xPropertySet(xParaEnum->nextElement(), uno::UNO_QUERY);
[ + - ]
353 : : sal_Bool bValue;
354 [ + - ][ + - ]: 3 : xPropertySet->getPropertyValue("ParaContextMargin") >>= bValue;
355 [ + - ][ + - ]: 3 : CPPUNIT_ASSERT_EQUAL(sal_Bool(false), bValue);
[ + - ][ + - ]
[ + - ]
356 : :
357 [ + - ][ + - ]: 3 : xPropertySet.set(xParaEnum->nextElement(), uno::UNO_QUERY);
[ + - ]
358 [ + - ][ + - ]: 3 : xPropertySet->getPropertyValue("ParaContextMargin") >>= bValue;
359 [ + - ][ + - ]: 3 : CPPUNIT_ASSERT_EQUAL(sal_Bool(true), bValue);
[ + - ][ + - ]
[ + - ]
360 : 3 : }
361 : :
362 : 3 : void Test::testFdo45563()
363 : : {
364 [ + - ]: 3 : load("fdo45563.rtf");
365 [ + - ]: 3 : uno::Reference<text::XTextDocument> xTextDocument(mxComponent, uno::UNO_QUERY);
366 [ + - ][ + - ]: 3 : uno::Reference<container::XEnumerationAccess> xParaEnumAccess(xTextDocument->getText(), uno::UNO_QUERY);
[ + - ]
367 [ + - ][ + - ]: 3 : uno::Reference<container::XEnumeration> xParaEnum = xParaEnumAccess->createEnumeration();
368 : 3 : int i = 0;
369 [ + - ][ + - ]: 15 : while (xParaEnum->hasMoreElements())
[ + + ]
370 : : {
371 [ + - ][ + - ]: 12 : xParaEnum->nextElement();
372 : 12 : i++;
373 : : }
374 [ + - ][ + - ]: 3 : CPPUNIT_ASSERT_EQUAL(4, i);
[ + - ][ + - ]
[ + - ]
375 : 3 : }
376 : :
377 : 3 : void Test::testFdo43965()
378 : : {
379 [ + - ]: 3 : load("fdo43965.rtf");
380 [ + - ]: 3 : uno::Reference<text::XTextDocument> xTextDocument(mxComponent, uno::UNO_QUERY);
381 [ + - ][ + - ]: 3 : uno::Reference<container::XEnumerationAccess> xParaEnumAccess(xTextDocument->getText(), uno::UNO_QUERY);
[ + - ]
382 [ + - ][ + - ]: 3 : uno::Reference<container::XEnumeration> xParaEnum = xParaEnumAccess->createEnumeration();
383 : :
384 : : // First paragraph: the parameter of \up was ignored
385 [ + - ][ + - ]: 3 : uno::Reference<container::XEnumerationAccess> xRangeEnumAccess(xParaEnum->nextElement(), uno::UNO_QUERY);
[ + - ]
386 [ + - ][ + - ]: 3 : uno::Reference<container::XEnumeration> xRangeEnum = xRangeEnumAccess->createEnumeration();
387 [ + - ][ + - ]: 3 : uno::Reference<beans::XPropertySet> xPropertySet(xRangeEnum->nextElement(), uno::UNO_QUERY);
[ + - ]
388 : : sal_Int32 nValue;
389 [ + - ][ + - ]: 3 : xPropertySet->getPropertyValue("CharEscapement") >>= nValue;
390 [ + - ][ + - ]: 3 : CPPUNIT_ASSERT_EQUAL(sal_Int32(36), nValue);
[ + - ][ + - ]
[ + - ]
391 [ + - ][ + - ]: 3 : xPropertySet->getPropertyValue("CharEscapementHeight") >>= nValue;
392 [ + - ][ + - ]: 3 : CPPUNIT_ASSERT_EQUAL(sal_Int32(100), nValue);
[ + - ][ + - ]
[ + - ]
393 : :
394 : : // Second paragraph: Word vs Writer border default problem
395 [ + - ][ + - ]: 3 : xPropertySet.set(xParaEnum->nextElement(), uno::UNO_QUERY);
[ + - ]
396 : 3 : table::BorderLine2 aBorder;
397 [ + - ][ + - ]: 3 : xPropertySet->getPropertyValue("TopBorder") >>= aBorder;
[ + - ]
398 [ + - ][ + - ]: 3 : CPPUNIT_ASSERT_EQUAL(sal_uInt32(26), aBorder.LineWidth);
[ + - ][ + - ]
[ + - ]
399 : :
400 : : // Finally, make sure that we have two pages
401 [ + - ][ + - ]: 3 : CPPUNIT_ASSERT_EQUAL(2, getPages());
[ + - ][ + - ]
[ + - ][ + - ]
402 : 3 : }
403 : :
404 : 3 : void Test::testN751020()
405 : : {
406 [ + - ]: 3 : load("n751020.rtf");
407 [ + - ]: 3 : uno::Reference<text::XTextDocument> xTextDocument(mxComponent, uno::UNO_QUERY);
408 [ + - ][ + - ]: 3 : uno::Reference<container::XEnumerationAccess> xParaEnumAccess(xTextDocument->getText(), uno::UNO_QUERY);
[ + - ]
409 [ + - ][ + - ]: 3 : uno::Reference<container::XEnumeration> xParaEnum = xParaEnumAccess->createEnumeration();
410 [ + - ][ + - ]: 3 : CPPUNIT_ASSERT(xParaEnum->hasMoreElements());
[ + - ][ + - ]
[ + - ][ + - ]
[ + - ][ + - ]
[ + - ][ + - ]
411 [ + - ][ + - ]: 3 : uno::Reference<beans::XPropertySet> xPropertySet(xParaEnum->nextElement(), uno::UNO_QUERY);
[ + - ]
412 : 3 : sal_Int32 nValue = 0;
413 [ + - ][ + - ]: 3 : xPropertySet->getPropertyValue("ParaBottomMargin") >>= nValue;
414 [ + - ][ + - ]: 3 : CPPUNIT_ASSERT_EQUAL(sal_Int32(TWIP_TO_MM100(200)), nValue);
[ + - ][ + - ]
[ + - ]
415 : 3 : }
416 : :
417 : 3 : void Test::testFdo47326()
418 : : {
419 [ + - ]: 3 : load("fdo47326.rtf");
420 : : // This was 15 only, as \super buffered text, then the contents of it got lost.
421 [ + - ][ + - ]: 3 : CPPUNIT_ASSERT_EQUAL(19, getLength());
[ + - ][ + - ]
[ + - ][ + - ]
422 : 3 : }
423 : :
424 : 3 : void Test::testFdo47036()
425 : : {
426 [ + - ]: 3 : load("fdo47036.rtf");
427 : :
428 [ + - ]: 3 : uno::Reference<drawing::XDrawPageSupplier> xDrawPageSupplier(mxComponent, uno::UNO_QUERY);
429 [ + - ][ + - ]: 3 : uno::Reference<container::XIndexAccess> xDraws(xDrawPageSupplier->getDrawPage(), uno::UNO_QUERY);
[ + - ]
430 : 3 : int nAtCharacter = 0;
431 [ + - ][ + - ]: 15 : for (int i = 0; i < xDraws->getCount(); ++i)
[ + + ]
432 : : {
433 [ + - ][ + - ]: 12 : uno::Reference<beans::XPropertySet> xPropertySet(xDraws->getByIndex(i), uno::UNO_QUERY);
[ + - ]
434 : : text::TextContentAnchorType eValue;
435 [ + - ][ + - ]: 12 : xPropertySet->getPropertyValue("AnchorType") >>= eValue;
[ + - ]
436 [ + + ]: 12 : if (eValue == text::TextContentAnchorType_AT_CHARACTER)
437 : 3 : nAtCharacter++;
438 : 12 : }
439 : : // The image at the document start was ignored.
440 [ + - ][ + - ]: 3 : CPPUNIT_ASSERT_EQUAL(1, nAtCharacter);
[ + - ][ + - ]
[ + - ]
441 : :
442 : : // There should be 2 textboxes, not 4
443 [ + - ]: 3 : uno::Reference<text::XTextFramesSupplier> xTextFramesSupplier(mxComponent, uno::UNO_QUERY);
444 [ + - ][ + - ]: 3 : uno::Reference<container::XIndexAccess> xIndexAccess(xTextFramesSupplier->getTextFrames(), uno::UNO_QUERY);
[ + - ]
445 [ + - ][ + - ]: 3 : CPPUNIT_ASSERT_EQUAL(sal_Int32(2), xIndexAccess->getCount());
[ + - ][ + - ]
[ + - ][ + - ]
[ + - ]
446 : 3 : }
447 : :
448 : 3 : void Test::testFdo46955()
449 : : {
450 [ + - ]: 3 : load("fdo46955.rtf");
451 : :
452 [ + - ]: 3 : uno::Reference<text::XTextDocument> xTextDocument(mxComponent, uno::UNO_QUERY);
453 [ + - ][ + - ]: 3 : uno::Reference<container::XEnumerationAccess> xParaEnumAccess(xTextDocument->getText(), uno::UNO_QUERY);
[ + - ]
454 [ + - ][ + - ]: 3 : uno::Reference<container::XEnumeration> xParaEnum = xParaEnumAccess->createEnumeration();
455 [ + - ][ + - ]: 6 : while (xParaEnum->hasMoreElements())
[ + + ]
456 : : {
457 [ + - ][ + - ]: 3 : uno::Reference<container::XEnumerationAccess> xRangeEnumAccess(xParaEnum->nextElement(), uno::UNO_QUERY);
[ + - ]
458 [ + - ][ + - ]: 3 : uno::Reference<container::XEnumeration> xRangeEnum = xRangeEnumAccess->createEnumeration();
459 [ + - ][ + - ]: 6 : while (xRangeEnum->hasMoreElements())
[ + + ]
460 : : {
461 [ + - ][ + - ]: 3 : uno::Reference<beans::XPropertySet> xPropertySet(xRangeEnum->nextElement(), uno::UNO_QUERY);
[ + - ]
462 : : sal_Int16 nValue;
463 [ + - ][ + - ]: 3 : xPropertySet->getPropertyValue("CharCaseMap") >>= nValue;
464 [ + - ][ + - ]: 3 : CPPUNIT_ASSERT_EQUAL(style::CaseMap::UPPERCASE, nValue);
[ + - ][ + - ]
[ + - ]
465 : 3 : }
466 : 6 : }
467 : 3 : }
468 : :
469 : 3 : void Test::testFdo45394()
470 : : {
471 [ + - ]: 3 : load("fdo45394.rtf");
472 : :
473 [ + - ][ + - ]: 3 : uno::Reference<beans::XPropertySet> xPropertySet(getStyles("PageStyles")->getByName("Default"), uno::UNO_QUERY);
[ + - ][ + - ]
474 [ + - ][ + - ]: 3 : uno::Reference<text::XText> xHeaderText(xPropertySet->getPropertyValue("HeaderText"), uno::UNO_QUERY);
[ + - ]
475 [ + - ][ + - ]: 3 : OUString aActual = xHeaderText->getString();
476 : : // Encoding in the header was wrong.
477 [ + - ]: 3 : OUString aExpected("ПК РИК", 11, RTL_TEXTENCODING_UTF8);
478 [ + - ][ + - ]: 3 : CPPUNIT_ASSERT_EQUAL(aExpected, aActual);
[ + - ][ + - ]
[ + - ]
479 : :
480 [ + - ]: 3 : uno::Reference<text::XTextTablesSupplier> xTextTablesSupplier(mxComponent, uno::UNO_QUERY);
481 [ + - ][ + - ]: 3 : uno::Reference<container::XIndexAccess> xIndexAccess(xTextTablesSupplier->getTextTables(), uno::UNO_QUERY);
[ + - ]
482 [ + - ][ + - ]: 3 : CPPUNIT_ASSERT_EQUAL(sal_Int32(1), xIndexAccess->getCount());
[ + - ][ + - ]
[ + - ][ + - ]
[ + - ]
483 : 3 : }
484 : :
485 : 3 : void Test::testFdo48104()
486 : : {
487 [ + - ]: 3 : load("fdo48104.rtf");
488 [ + - ][ + - ]: 3 : CPPUNIT_ASSERT_EQUAL(2, getPages());
[ + - ][ + - ]
[ + - ][ + - ]
489 : 3 : }
490 : :
491 : 3 : void Test::testFdo47107()
492 : : {
493 [ + - ]: 3 : load("fdo47107.rtf");
494 : :
495 [ + - ]: 3 : uno::Reference<container::XNameAccess> xNumberingStyles(getStyles("NumberingStyles"));
496 : : // Make sure numbered and bullet legacy syntax is recognized, this used to throw a NoSuchElementException
497 [ + - ][ + - ]: 3 : xNumberingStyles->getByName("WWNum1");
498 [ + - ][ + - ]: 3 : xNumberingStyles->getByName("WWNum2");
499 : 3 : }
500 : :
501 : 3 : void Test::testFdo45182()
502 : : {
503 [ + - ]: 3 : load("fdo45182.rtf");
504 : :
505 [ + - ]: 3 : uno::Reference<text::XFootnotesSupplier> xFootnotesSupplier(mxComponent, uno::UNO_QUERY);
506 [ + - ][ + - ]: 3 : uno::Reference<container::XIndexAccess> xFootnotes(xFootnotesSupplier->getFootnotes(), uno::UNO_QUERY);
[ + - ]
507 [ + - ][ + - ]: 3 : uno::Reference<text::XTextRange> xTextRange(xFootnotes->getByIndex(0), uno::UNO_QUERY);
[ + - ]
508 : : // Encoding in the footnote was wrong.
509 [ + - ]: 3 : OUString aExpected("živností", 10, RTL_TEXTENCODING_UTF8);
510 [ + - ][ + - ]: 3 : CPPUNIT_ASSERT_EQUAL(aExpected, xTextRange->getString());
[ + - ][ + - ]
[ + - ][ + - ]
[ + - ]
511 : 3 : }
512 : :
513 : 3 : void Test::testFdo44176()
514 : : {
515 [ + - ]: 3 : load("fdo44176.rtf");
516 : :
517 [ + - ]: 3 : uno::Reference<container::XNameAccess> xPageStyles(getStyles("PageStyles"));
518 [ + - ][ + - ]: 3 : uno::Reference<beans::XPropertySet> xFirstPage(xPageStyles->getByName("First Page"), uno::UNO_QUERY);
[ + - ]
519 [ + - ][ + - ]: 3 : uno::Reference<beans::XPropertySet> xDefault(xPageStyles->getByName("Default"), uno::UNO_QUERY);
[ + - ]
520 : 3 : sal_Int32 nFirstTop = 0, nDefaultTop = 0, nDefaultHeader = 0;
521 [ + - ][ + - ]: 3 : xFirstPage->getPropertyValue("TopMargin") >>= nFirstTop;
522 [ + - ][ + - ]: 3 : xDefault->getPropertyValue("TopMargin") >>= nDefaultTop;
523 [ + - ][ + - ]: 3 : xDefault->getPropertyValue("HeaderHeight") >>= nDefaultHeader;
524 [ + - ][ + - ]: 3 : CPPUNIT_ASSERT_EQUAL(nFirstTop, nDefaultTop + nDefaultHeader);
[ + - ][ + - ]
[ + - ]
525 : 3 : }
526 : :
527 : 3 : void Test::testFdo39053()
528 : : {
529 [ + - ]: 3 : load("fdo39053.rtf");
530 : :
531 [ + - ]: 3 : uno::Reference<drawing::XDrawPageSupplier> xDrawPageSupplier(mxComponent, uno::UNO_QUERY);
532 [ + - ][ + - ]: 3 : uno::Reference<container::XIndexAccess> xDraws(xDrawPageSupplier->getDrawPage(), uno::UNO_QUERY);
[ + - ]
533 : 3 : int nAsCharacter = 0;
534 [ + - ][ + - ]: 9 : for (int i = 0; i < xDraws->getCount(); ++i)
[ + + ]
535 : : {
536 [ + - ][ + - ]: 6 : uno::Reference<beans::XPropertySet> xPropertySet(xDraws->getByIndex(i), uno::UNO_QUERY);
[ + - ]
537 : : text::TextContentAnchorType eValue;
538 [ + - ][ + - ]: 6 : xPropertySet->getPropertyValue("AnchorType") >>= eValue;
[ + - ]
539 [ + + ]: 6 : if (eValue == text::TextContentAnchorType_AS_CHARACTER)
540 : 3 : nAsCharacter++;
541 : 6 : }
542 : : // The image in binary format was ignored.
543 [ + - ][ + - ]: 3 : CPPUNIT_ASSERT_EQUAL(1, nAsCharacter);
[ + - ][ + - ]
[ + - ]
544 : 3 : }
545 : :
546 : 3 : void Test::testFdo48356()
547 : : {
548 [ + - ]: 3 : load("fdo48356.rtf");
549 : :
550 [ + - ]: 3 : uno::Reference<text::XTextDocument> xTextDocument(mxComponent, uno::UNO_QUERY);
551 [ + - ][ + - ]: 3 : uno::Reference<container::XEnumerationAccess> xParaEnumAccess(xTextDocument->getText(), uno::UNO_QUERY);
[ + - ]
552 [ + - ][ + - ]: 3 : uno::Reference<container::XEnumeration> xParaEnum = xParaEnumAccess->createEnumeration();
553 : 3 : OUStringBuffer aBuf;
554 : 3 : int i = 0;
555 [ + - ][ + - ]: 6 : while (xParaEnum->hasMoreElements())
[ + + ]
556 : : {
557 [ + - ][ + - ]: 3 : xParaEnum->nextElement();
558 : 3 : i++;
559 : : }
560 : : // The document used to be imported as two paragraphs.
561 [ + - ][ + - ]: 3 : CPPUNIT_ASSERT_EQUAL(1, i);
[ + - ][ + - ]
[ + - ]
562 : 3 : }
563 : :
564 : 3 : void Test::testFdo48023()
565 : : {
566 : 3 : lang::Locale aLocale;
567 : 3 : aLocale.Language = "ru";
568 [ + - ][ + - ]: 3 : AllSettings aSettings(Application::GetSettings());
569 [ + - ]: 3 : AllSettings aSavedSettings(aSettings);
570 [ + - ]: 3 : aSettings.SetLocale(aLocale);
571 [ + - ]: 3 : Application::SetSettings(aSettings);
572 [ + - ]: 3 : load("fdo48023.rtf");
573 [ + - ]: 3 : Application::SetSettings(aSavedSettings);
574 : :
575 [ + - ]: 3 : uno::Reference<text::XTextDocument> xTextDocument(mxComponent, uno::UNO_QUERY);
576 [ + - ][ + - ]: 3 : uno::Reference<container::XEnumerationAccess> xParaEnumAccess(xTextDocument->getText(), uno::UNO_QUERY);
[ + - ]
577 [ + - ][ + - ]: 3 : uno::Reference<container::XEnumeration> xParaEnum = xParaEnumAccess->createEnumeration();
578 [ + - ][ + - ]: 3 : uno::Reference<container::XEnumerationAccess> xRangeEnumAccess(xParaEnum->nextElement(), uno::UNO_QUERY);
[ + - ]
579 [ + - ][ + - ]: 3 : uno::Reference<container::XEnumeration> xRangeEnum = xRangeEnumAccess->createEnumeration();
580 [ + - ][ + - ]: 3 : uno::Reference<text::XTextRange> xTextRange(xRangeEnum->nextElement(), uno::UNO_QUERY);
[ + - ]
581 : :
582 : : // Implicit encoding detection based on locale was missing
583 [ + - ]: 3 : OUString aExpected("Программист", 22, RTL_TEXTENCODING_UTF8);
584 [ + - ][ + - ]: 3 : CPPUNIT_ASSERT_EQUAL(aExpected, xTextRange->getString());
[ + - ][ + - ]
[ + - ][ + - ]
[ + - ][ + - ]
[ + - ]
585 : 3 : }
586 : :
587 : 3 : void Test::testFdo48876()
588 : : {
589 [ + - ]: 3 : load("fdo48876.rtf");
590 [ + - ]: 3 : uno::Reference<text::XTextDocument> xTextDocument(mxComponent, uno::UNO_QUERY);
591 [ + - ][ + - ]: 3 : uno::Reference<container::XEnumerationAccess> xParaEnumAccess(xTextDocument->getText(), uno::UNO_QUERY);
[ + - ]
592 [ + - ][ + - ]: 3 : uno::Reference<container::XEnumeration> xParaEnum = xParaEnumAccess->createEnumeration();
593 [ + - ][ + - ]: 3 : CPPUNIT_ASSERT(xParaEnum->hasMoreElements());
[ + - ][ + - ]
[ + - ][ + - ]
[ + - ][ + - ]
[ + - ][ + - ]
594 [ + - ][ + - ]: 3 : uno::Reference<beans::XPropertySet> xPropertySet(xParaEnum->nextElement(), uno::UNO_QUERY);
[ + - ]
595 : 3 : style::LineSpacing aSpacing;
596 [ + - ][ + - ]: 3 : xPropertySet->getPropertyValue("ParaLineSpacing") >>= aSpacing;
[ + - ]
597 [ + - ][ + - ]: 3 : CPPUNIT_ASSERT_EQUAL(style::LineSpacingMode::MINIMUM, aSpacing.Mode);
[ + - ][ + - ]
[ + - ]
598 : 3 : }
599 : :
600 : 3 : void Test::testFdo48193()
601 : : {
602 [ + - ]: 3 : load("fdo48193.rtf");
603 [ + - ][ + - ]: 3 : CPPUNIT_ASSERT_EQUAL(7, getLength());
[ + - ][ + - ]
[ + - ][ + - ]
604 : 3 : }
605 : :
606 : 3 : void Test::testFdo44211()
607 : : {
608 : 3 : lang::Locale aLocale;
609 : 3 : aLocale.Language = "lt";
610 [ + - ][ + - ]: 3 : AllSettings aSettings(Application::GetSettings());
611 [ + - ]: 3 : AllSettings aSavedSettings(aSettings);
612 [ + - ]: 3 : aSettings.SetLocale(aLocale);
613 [ + - ]: 3 : Application::SetSettings(aSettings);
614 [ + - ]: 3 : load("fdo44211.rtf");
615 [ + - ]: 3 : Application::SetSettings(aSavedSettings);
616 : :
617 [ + - ]: 3 : uno::Reference<text::XTextDocument> xTextDocument(mxComponent, uno::UNO_QUERY);
618 [ + - ][ + - ]: 3 : uno::Reference<container::XEnumerationAccess> xParaEnumAccess(xTextDocument->getText(), uno::UNO_QUERY);
[ + - ]
619 [ + - ][ + - ]: 3 : uno::Reference<container::XEnumeration> xParaEnum = xParaEnumAccess->createEnumeration();
620 [ + - ][ + - ]: 3 : uno::Reference<container::XEnumerationAccess> xRangeEnumAccess(xParaEnum->nextElement(), uno::UNO_QUERY);
[ + - ]
621 [ + - ][ + - ]: 3 : uno::Reference<container::XEnumeration> xRangeEnum = xRangeEnumAccess->createEnumeration();
622 [ + - ][ + - ]: 3 : uno::Reference<text::XTextRange> xTextRange(xRangeEnum->nextElement(), uno::UNO_QUERY);
[ + - ]
623 : :
624 [ + - ]: 3 : OUString aExpected("ąčę", 6, RTL_TEXTENCODING_UTF8);
625 [ + - ][ + - ]: 3 : CPPUNIT_ASSERT_EQUAL(aExpected, xTextRange->getString());
[ + - ][ + - ]
[ + - ][ + - ]
[ + - ][ + - ]
[ + - ]
626 : 3 : }
627 : :
628 : 3 : void Test::testFdo48037()
629 : : {
630 [ + - ]: 3 : load("fdo48037.rtf");
631 : :
632 [ + - ]: 3 : uno::Reference<util::XNumberFormatsSupplier> xNumberSupplier(mxComponent, uno::UNO_QUERY_THROW);
633 : 3 : lang::Locale aUSLocale, aFRLocale;
634 : 3 : aUSLocale.Language = "en";
635 : 3 : aFRLocale.Language = "fr";
636 [ + - ][ + - ]: 3 : sal_Int32 nExpected = xNumberSupplier->getNumberFormats()->addNewConverted("d MMMM yyyy", aUSLocale, aFRLocale);
[ + - ][ + - ]
637 : :
638 [ + - ]: 3 : uno::Reference<text::XTextFieldsSupplier> xTextFieldsSupplier(mxComponent, uno::UNO_QUERY);
639 [ + - ][ + - ]: 3 : uno::Reference<container::XEnumerationAccess> xFieldsAccess(xTextFieldsSupplier->getTextFields());
640 [ + - ][ + - ]: 3 : uno::Reference<container::XEnumeration> xFields(xFieldsAccess->createEnumeration());
641 [ + - ][ + - ]: 3 : uno::Reference<beans::XPropertySet> xPropertySet(xFields->nextElement(), uno::UNO_QUERY);
[ + - ]
642 : 3 : sal_Int32 nActual = 0;
643 [ + - ][ + - ]: 3 : xPropertySet->getPropertyValue("NumberFormat") >>= nActual;
644 : :
645 [ + - ][ + - ]: 3 : CPPUNIT_ASSERT_EQUAL(nExpected, nActual);
[ + - ][ + - ]
[ + - ]
646 : 3 : }
647 : :
648 : 3 : void Test::testFdo47764()
649 : : {
650 [ + - ]: 3 : load("fdo47764.rtf");
651 : :
652 [ + - ]: 3 : uno::Reference<text::XTextDocument> xTextDocument(mxComponent, uno::UNO_QUERY);
653 [ + - ][ + - ]: 3 : uno::Reference<container::XEnumerationAccess> xParaEnumAccess(xTextDocument->getText(), uno::UNO_QUERY);
[ + - ]
654 [ + - ][ + - ]: 3 : uno::Reference<container::XEnumeration> xParaEnum = xParaEnumAccess->createEnumeration();
655 [ + - ][ + - ]: 3 : uno::Reference<beans::XPropertySet> xPropertySet(xParaEnum->nextElement(), uno::UNO_QUERY);
[ + - ]
656 : 3 : sal_Int32 nValue = 0;
657 : : // \cbpat with zero argument should mean the auto (-1) color, not a default color (black)
658 [ + - ][ + - ]: 3 : xPropertySet->getPropertyValue("ParaBackColor") >>= nValue;
659 [ + - ][ + - ]: 3 : CPPUNIT_ASSERT_EQUAL(sal_Int32(-1), nValue);
[ + - ][ + - ]
[ + - ]
660 : 3 : }
661 : :
662 : 3 : void Test::testFdo38786()
663 : : {
664 [ + - ]: 3 : load("fdo38786.rtf");
665 : :
666 [ + - ]: 3 : uno::Reference<text::XTextFieldsSupplier> xTextFieldsSupplier(mxComponent, uno::UNO_QUERY);
667 [ + - ][ + - ]: 3 : uno::Reference<container::XEnumerationAccess> xFieldsAccess(xTextFieldsSupplier->getTextFields());
668 [ + - ][ + - ]: 3 : uno::Reference<container::XEnumeration> xFields(xFieldsAccess->createEnumeration());
669 : : // \chpgn was ignored, so exception was thrown
670 [ + - ][ + - ]: 3 : xFields->nextElement();
671 : 3 : }
672 : :
673 : 3 : void Test::testN757651()
674 : : {
675 [ + - ]: 3 : load("n757651.rtf");
676 : :
677 : : // The bug was that due to buggy layout the text expanded to two pages.
678 [ + - ][ + - ]: 3 : if (Application::GetDefaultDevice()->IsFontAvailable(OUString("Times New Roman")))
[ + - ][ - + ]
[ + - ]
679 [ # # ][ # # ]: 0 : CPPUNIT_ASSERT_EQUAL(1, getPages());
[ # # ][ # # ]
[ # # ][ # # ]
680 : 3 : }
681 : :
682 : 3 : void Test::testFdo49501()
683 : : {
684 [ + - ]: 3 : load("fdo49501.rtf");
685 : :
686 [ + - ][ + - ]: 3 : uno::Reference<beans::XPropertySet> xStyle(getStyles("PageStyles")->getByName("Default"), uno::UNO_QUERY);
[ + - ][ + - ]
687 : :
688 : 3 : sal_Bool bIsLandscape = sal_False;
689 [ + - ][ + - ]: 3 : xStyle->getPropertyValue("IsLandscape") >>= bIsLandscape;
690 [ + - ][ + - ]: 3 : CPPUNIT_ASSERT_EQUAL(sal_True, bIsLandscape);
[ + - ][ + - ]
[ + - ]
691 : 3 : sal_Int32 nExpected(TWIP_TO_MM100(567));
692 : 3 : sal_Int32 nValue = 0;
693 [ + - ][ + - ]: 3 : xStyle->getPropertyValue("LeftMargin") >>= nValue;
694 [ + - ][ + - ]: 3 : CPPUNIT_ASSERT_EQUAL(nExpected, nValue);
[ + - ][ + - ]
[ + - ]
695 [ + - ][ + - ]: 3 : xStyle->getPropertyValue("RightMargin") >>= nValue;
696 [ + - ][ + - ]: 3 : CPPUNIT_ASSERT_EQUAL(nExpected, nValue);
[ + - ][ + - ]
[ + - ]
697 [ + - ][ + - ]: 3 : xStyle->getPropertyValue("TopMargin") >>= nValue;
698 [ + - ][ + - ]: 3 : CPPUNIT_ASSERT_EQUAL(nExpected, nValue);
[ + - ][ + - ]
[ + - ]
699 [ + - ][ + - ]: 3 : xStyle->getPropertyValue("BottomMargin") >>= nValue;
700 [ + - ][ + - ]: 3 : CPPUNIT_ASSERT_EQUAL(nExpected, nValue);
[ + - ][ + - ]
[ + - ]
701 : 3 : }
702 : :
703 : 3 : void Test::testFdo49271()
704 : : {
705 [ + - ]: 3 : load("fdo49271.rtf");
706 : :
707 [ + - ]: 3 : uno::Reference<text::XTextDocument> xTextDocument(mxComponent, uno::UNO_QUERY);
708 [ + - ][ + - ]: 3 : uno::Reference<container::XEnumerationAccess> xParaEnumAccess(xTextDocument->getText(), uno::UNO_QUERY);
[ + - ]
709 [ + - ][ + - ]: 3 : uno::Reference<container::XEnumeration> xParaEnum = xParaEnumAccess->createEnumeration();
710 [ + - ][ + - ]: 3 : xParaEnum->nextElement();
711 [ + - ][ + - ]: 3 : uno::Reference<beans::XPropertySet> xPropertySet(xParaEnum->nextElement(), uno::UNO_QUERY);
[ + - ]
712 : 3 : float fValue = 0;
713 [ + - ][ + - ]: 3 : xPropertySet->getPropertyValue("CharHeight") >>= fValue;
714 : :
715 [ + - ][ + - ]: 3 : CPPUNIT_ASSERT_EQUAL(25.f, fValue);
[ + - ][ + - ]
[ + - ]
716 : 3 : }
717 : :
718 : 3 : void Test::testFdo49692()
719 : : {
720 [ + - ]: 3 : load("fdo49692.rtf");
721 : :
722 [ + - ][ + - ]: 3 : uno::Reference<beans::XPropertySet> xPropertySet(getStyles("NumberingStyles")->getByName("WWNum1"), uno::UNO_QUERY);
[ + - ][ + - ]
723 [ + - ][ + - ]: 3 : uno::Reference<container::XIndexAccess> xLevels(xPropertySet->getPropertyValue("NumberingRules"), uno::UNO_QUERY);
[ + - ]
724 [ + - ]: 3 : uno::Sequence<beans::PropertyValue> aProps;
725 [ + - ][ + - ]: 3 : xLevels->getByIndex(0) >>= aProps; // 1st level
[ + - ]
726 : :
727 [ + + ]: 39 : for (int i = 0; i < aProps.getLength(); ++i)
728 : : {
729 [ + - ]: 36 : const beans::PropertyValue& rProp = aProps[i];
730 : :
731 [ + + ]: 36 : if (rProp.Name == "Suffix")
732 : : {
733 : 3 : rtl::OUString sValue;
734 : 3 : rProp.Value >>= sValue;
735 : :
736 [ + - ][ + - ]: 3 : CPPUNIT_ASSERT_EQUAL(sal_Int32(0), sValue.getLength());
[ + - ][ + - ]
[ + - ]
737 : : }
738 [ + - ]: 3 : }
739 : 3 : }
740 : :
741 : 3 : void Test::testFdo45190()
742 : : {
743 [ + - ]: 3 : load("fdo45190.rtf");
744 : :
745 [ + - ]: 3 : uno::Reference<text::XTextDocument> xTextDocument(mxComponent, uno::UNO_QUERY);
746 [ + - ][ + - ]: 3 : uno::Reference<container::XEnumerationAccess> xParaEnumAccess(xTextDocument->getText(), uno::UNO_QUERY);
[ + - ]
747 [ + - ][ + - ]: 3 : uno::Reference<container::XEnumeration> xParaEnum = xParaEnumAccess->createEnumeration();
748 : :
749 : : // inherited \fi should be reset
750 [ + - ][ + - ]: 3 : uno::Reference<beans::XPropertySet> xPropertySet(xParaEnum->nextElement(), uno::UNO_QUERY);
[ + - ]
751 : 3 : sal_Int32 nValue = 0;
752 [ + - ][ + - ]: 3 : xPropertySet->getPropertyValue("ParaFirstLineIndent") >>= nValue;
753 [ + - ][ + - ]: 3 : CPPUNIT_ASSERT_EQUAL(sal_Int32(0), nValue);
[ + - ][ + - ]
[ + - ]
754 : :
755 : : // but direct one not
756 [ + - ][ + - ]: 3 : xPropertySet.set(xParaEnum->nextElement(), uno::UNO_QUERY);
[ + - ]
757 [ + - ][ + - ]: 3 : xPropertySet->getPropertyValue("ParaFirstLineIndent") >>= nValue;
758 [ + - ][ + - ]: 3 : CPPUNIT_ASSERT_EQUAL(sal_Int32(TWIP_TO_MM100(-100)), nValue);
[ + - ][ + - ]
[ + - ]
759 : 3 : }
760 : :
761 : 3 : void Test::testFdo50539()
762 : : {
763 [ + - ]: 3 : load("fdo50539.rtf");
764 : :
765 [ + - ]: 3 : uno::Reference<text::XTextDocument> xTextDocument(mxComponent, uno::UNO_QUERY);
766 [ + - ][ + - ]: 3 : uno::Reference<container::XEnumerationAccess> xParaEnumAccess(xTextDocument->getText(), uno::UNO_QUERY);
[ + - ]
767 [ + - ][ + - ]: 3 : uno::Reference<container::XEnumeration> xParaEnum = xParaEnumAccess->createEnumeration();
768 [ + - ][ + - ]: 3 : uno::Reference<container::XEnumerationAccess> xRunEnumAccess(xParaEnum->nextElement(), uno::UNO_QUERY);
[ + - ]
769 [ + - ][ + - ]: 3 : uno::Reference<container::XEnumeration> xRunEnum = xRunEnumAccess->createEnumeration();
770 [ + - ][ + - ]: 3 : uno::Reference<beans::XPropertySet> xPropertySet(xRunEnum->nextElement(), uno::UNO_QUERY);
[ + - ]
771 : 3 : sal_Int32 nValue = 0;
772 : : // \chcbpat with zero argument should mean the auto (-1) color, not a default color (black)
773 [ + - ][ + - ]: 3 : xPropertySet->getPropertyValue("CharBackColor") >>= nValue;
774 [ + - ][ + - ]: 3 : CPPUNIT_ASSERT_EQUAL(sal_Int32(-1), nValue);
[ + - ][ + - ]
[ + - ]
775 : 3 : }
776 : :
777 : 3 : void Test::testFdo50665()
778 : : {
779 [ + - ]: 3 : load("fdo50665.rtf");
780 [ + - ]: 3 : uno::Reference<text::XTextDocument> xTextDocument(mxComponent, uno::UNO_QUERY);
781 [ + - ][ + - ]: 3 : uno::Reference<container::XEnumerationAccess> xParaEnumAccess(xTextDocument->getText(), uno::UNO_QUERY);
[ + - ]
782 [ + - ][ + - ]: 3 : uno::Reference<container::XEnumeration> xParaEnum(xParaEnumAccess->createEnumeration());
783 [ + - ][ + - ]: 3 : uno::Reference<container::XEnumerationAccess> xRunEnumAccess(xParaEnum->nextElement(), uno::UNO_QUERY);
[ + - ]
784 [ + - ][ + - ]: 3 : uno::Reference<container::XEnumeration> xRunEnum(xRunEnumAccess->createEnumeration());
785 : :
786 : : // Access the second run, which is a textfield
787 [ + - ][ + - ]: 3 : xRunEnum->nextElement();
788 [ + - ][ + - ]: 3 : uno::Reference<beans::XPropertySet> xRun(xRunEnum->nextElement(), uno::UNO_QUERY);
[ + - ]
789 : 3 : OUString aValue;
790 [ + - ][ + - ]: 3 : xRun->getPropertyValue("CharFontName") >>= aValue;
791 : : // This used to be the default, as character properties were ignored.
792 [ + - ][ + - ]: 3 : CPPUNIT_ASSERT_EQUAL(OUString("Book Antiqua"), aValue);
[ + - ][ + - ]
[ + - ]
793 : 3 : }
794 : :
795 : 3 : void Test::testFdo49659()
796 : : {
797 [ + - ]: 3 : load("fdo49659.rtf");
798 : :
799 : : // Both tables were ignored: 1) was in the header, 2) was ignored due to missing empty par at the end of the doc
800 [ + - ]: 3 : uno::Reference<text::XTextTablesSupplier> xTextTablesSupplier(mxComponent, uno::UNO_QUERY);
801 [ + - ][ + - ]: 3 : uno::Reference<container::XIndexAccess> xIndexAccess(xTextTablesSupplier->getTextTables(), uno::UNO_QUERY);
[ + - ]
802 [ + - ][ + - ]: 3 : CPPUNIT_ASSERT_EQUAL(sal_Int32(2), xIndexAccess->getCount());
[ + - ][ + - ]
[ + - ][ + - ]
[ + - ]
803 : :
804 : : // The graphic was also empty
805 [ + - ]: 3 : uno::Reference<drawing::XDrawPageSupplier> xDrawPageSupplier(mxComponent, uno::UNO_QUERY);
806 [ + - ][ + - ]: 3 : uno::Reference<container::XIndexAccess> xDraws(xDrawPageSupplier->getDrawPage(), uno::UNO_QUERY);
[ + - ]
807 [ + - ][ + - ]: 3 : uno::Reference<beans::XPropertySet> xPropertySet(xDraws->getByIndex(0), uno::UNO_QUERY);
[ + - ]
808 : 3 : uno::Reference<beans::XPropertySet> xGraphic;
809 [ + - ][ + - ]: 3 : xPropertySet->getPropertyValue("Graphic") >>= xGraphic;
[ + - ]
810 : 3 : sal_Int8 nValue = 0;
811 [ + - ][ + - ]: 3 : xGraphic->getPropertyValue("GraphicType") >>= nValue;
812 [ + - ][ + - ]: 3 : CPPUNIT_ASSERT_EQUAL(graphic::GraphicType::PIXEL, nValue);
[ + - ][ + - ]
[ + - ]
813 : 3 : }
814 : :
815 : 3 : void Test::testFdo46966()
816 : : {
817 : : /*
818 : : * The problem was the top margin was 1440 (1 inch), but it should be 720 (0.5 inch).
819 : : *
820 : : * xray ThisComponent.StyleFamilies.PageStyles.Default.TopMargin
821 : : */
822 [ + - ]: 3 : load("fdo46966.rtf");
823 : :
824 [ + - ][ + - ]: 3 : uno::Reference<beans::XPropertySet> xPropertySet(getStyles("PageStyles")->getByName("Default"), uno::UNO_QUERY);
[ + - ][ + - ]
825 : 3 : sal_Int32 nValue = 0;
826 [ + - ][ + - ]: 3 : xPropertySet->getPropertyValue("TopMargin") >>= nValue;
827 [ + - ][ + - ]: 3 : CPPUNIT_ASSERT_EQUAL(sal_Int32(TWIP_TO_MM100(720)), nValue);
[ + - ][ + - ]
[ + - ]
828 : 3 : }
829 : :
830 : 3 : void Test::testFdo52066()
831 : : {
832 : : /*
833 : : * The problem was that the height of the shape was too big.
834 : : *
835 : : * xray ThisComponent.DrawPage(0).Size.Height
836 : : */
837 [ + - ]: 3 : load("fdo52066.rtf");
838 : :
839 [ + - ]: 3 : uno::Reference<drawing::XDrawPageSupplier> xDrawPageSupplier(mxComponent, uno::UNO_QUERY);
840 [ + - ][ + - ]: 3 : uno::Reference<container::XIndexAccess> xDraws(xDrawPageSupplier->getDrawPage(), uno::UNO_QUERY);
[ + - ]
841 [ + - ][ + - ]: 3 : uno::Reference<drawing::XShape> xShape(xDraws->getByIndex(0), uno::UNO_QUERY);
[ + - ]
842 [ + - ][ + - ]: 3 : CPPUNIT_ASSERT_EQUAL(sal_Int32(TWIP_TO_MM100(19)), xShape->getSize().Height);
[ + - ][ + - ]
[ + - ][ + - ]
[ + - ]
843 : 3 : }
844 : :
845 : 3 : void Test::testFdo48033()
846 : : {
847 : : /*
848 : : * The problem was that the picture was in the first cell, instead of the second one.
849 : : *
850 : : * oTable = ThisComponent.TextTables(0)
851 : : * oParas = oTable.getCellByName("B1").Text.createEnumeration
852 : : * oPara = oParas.nextElement
853 : : * oRuns = oPara.createEnumeration
854 : : * oRun = oRuns.nextElement
855 : : * xray oRun.TextPortionType ' Frame, was Text
856 : : */
857 [ + - ]: 3 : load("fdo48033.rtf");
858 [ + - ]: 3 : uno::Reference<text::XTextTablesSupplier> xTextTablesSupplier(mxComponent, uno::UNO_QUERY);
859 [ + - ][ + - ]: 3 : uno::Reference<container::XIndexAccess> xTables(xTextTablesSupplier->getTextTables(), uno::UNO_QUERY);
[ + - ]
860 [ + - ][ + - ]: 3 : uno::Reference<text::XTextTable> xTable(xTables->getByIndex(0), uno::UNO_QUERY);
[ + - ]
861 [ + - ][ + - ]: 3 : uno::Reference<text::XTextRange> xCell(xTable->getCellByName("B1"), uno::UNO_QUERY);
[ + - ]
862 [ + - ][ + - ]: 3 : uno::Reference<container::XEnumerationAccess> xParaEnumAccess(xCell->getText(), uno::UNO_QUERY);
[ + - ]
863 [ + - ][ + - ]: 3 : uno::Reference<container::XEnumeration> xParaEnum = xParaEnumAccess->createEnumeration();
864 [ + - ][ + - ]: 3 : uno::Reference<text::XTextRange> xPara(xParaEnum->nextElement(), uno::UNO_QUERY);
[ + - ]
865 [ + - ][ + - ]: 3 : CPPUNIT_ASSERT_EQUAL(OUString("Frame"), getProperty<OUString>(getRun(xPara, 1), "TextPortionType"));
[ + - ][ + - ]
[ + - ][ + - ]
[ + - ]
866 : 3 : }
867 : :
868 : 3 : void Test::testFdo36089()
869 : : {
870 [ + - ]: 3 : load("fdo36089.rtf");
871 [ + - ][ + - ]: 3 : CPPUNIT_ASSERT_EQUAL(sal_Int16(-50), getProperty<sal_Int16>(getRun(getParagraph(1), 2), "CharEscapement"));
[ + - ][ + - ]
[ + - ][ + - ]
[ + - ][ + - ]
872 : 3 : }
873 : :
874 : 3 : void Test::testFdo49892()
875 : : {
876 [ + - ]: 3 : load("fdo49892.rtf");
877 [ + - ]: 3 : uno::Reference<drawing::XDrawPageSupplier> xDrawPageSupplier(mxComponent, uno::UNO_QUERY);
878 [ + - ][ + - ]: 3 : uno::Reference<container::XIndexAccess> xDraws(xDrawPageSupplier->getDrawPage(), uno::UNO_QUERY);
[ + - ]
879 [ + - ][ + - ]: 18 : for (int i = 0; i < xDraws->getCount(); ++i)
[ + + ]
880 : : {
881 [ + - ][ + - ]: 15 : OUString aDescription = getProperty<OUString>(xDraws->getByIndex(i), "Description");
[ + - ]
882 [ + + ]: 15 : if (aDescription == "red")
883 [ + - ][ + - ]: 3 : CPPUNIT_ASSERT_EQUAL(sal_Int32(0), getProperty<sal_Int32>(xDraws->getByIndex(i), "ZOrder"));
[ + - ][ + - ]
[ + - ][ + - ]
[ + - ][ + - ]
884 [ + + ]: 12 : else if (aDescription == "green")
885 [ + - ][ + - ]: 3 : CPPUNIT_ASSERT_EQUAL(sal_Int32(1), getProperty<sal_Int32>(xDraws->getByIndex(i), "ZOrder"));
[ + - ][ + - ]
[ + - ][ + - ]
[ + - ][ + - ]
886 [ + + ]: 9 : else if (aDescription == "blue")
887 [ + - ][ + - ]: 3 : CPPUNIT_ASSERT_EQUAL(sal_Int32(2), getProperty<sal_Int32>(xDraws->getByIndex(i), "ZOrder"));
[ + - ][ + - ]
[ + - ][ + - ]
[ + - ][ + - ]
888 [ + + ]: 6 : else if (aDescription == "rect")
889 : : {
890 [ + - ][ + - ]: 3 : CPPUNIT_ASSERT_EQUAL(text::RelOrientation::PAGE_FRAME, getProperty<sal_Int16>(xDraws->getByIndex(i), "HoriOrientRelation"));
[ + - ][ + - ]
[ + - ][ + - ]
[ + - ][ + - ]
891 [ + - ][ + - ]: 3 : CPPUNIT_ASSERT_EQUAL(text::RelOrientation::PAGE_FRAME, getProperty<sal_Int16>(xDraws->getByIndex(i), "VertOrientRelation"));
[ + - ][ + - ]
[ + - ][ + - ]
[ + - ][ + - ]
892 : : }
893 : 18 : }
894 : 3 : }
895 : :
896 : 3 : void Test::testFdo48446()
897 : : {
898 [ + - ]: 3 : load("fdo48446.rtf");
899 : :
900 [ + - ]: 3 : OUString aExpected("Имя", 6, RTL_TEXTENCODING_UTF8);
901 [ + - ]: 3 : getParagraph(1, aExpected);
902 : 3 : }
903 : :
904 : 3 : void Test::testFdo47495()
905 : : {
906 [ + - ]: 3 : load("fdo47495.rtf");
907 : : // Used to have 4 paragraphs, as a result the original bugdoc had 2 pages instead of 1.
908 [ + - ][ + - ]: 3 : CPPUNIT_ASSERT_EQUAL(2, getParagraphs());
[ + - ][ + - ]
[ + - ][ + - ]
909 : 3 : }
910 : :
911 : 3 : void Test::testAllGapsWord()
912 : : {
913 [ + - ]: 3 : load("all_gaps_word.rtf");
914 : 3 : BorderTest borderTest;
915 [ + - ]: 3 : borderTest.testTheBorders(mxComponent);
916 : 3 : }
917 : :
918 : 3 : CPPUNIT_TEST_SUITE_REGISTRATION(Test);
919 : :
920 [ + - ][ + - ]: 12 : CPPUNIT_PLUGIN_IMPLEMENT();
[ + - ][ + - ]
[ + - ][ # # ]
921 : :
922 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|