Version 7.6.3.2-android, tag libreoffice-7.6.3.2-android
[LibreOffice.git] / sw / qa / core / objectpositioning / objectpositioning.cxx
blob4e0db43c475fdab49c8d9cbf18712aa989b2900f
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 */
10 #include <swmodeltestbase.hxx>
12 #include <com/sun/star/text/VertOrientation.hpp>
13 #include <com/sun/star/drawing/XDrawPageSupplier.hpp>
15 #include <editeng/ulspitem.hxx>
17 #include <wrtsh.hxx>
18 #include <unotxdoc.hxx>
19 #include <docsh.hxx>
20 #include <IDocumentLayoutAccess.hxx>
21 #include <rootfrm.hxx>
22 #include <pagefrm.hxx>
23 #include <sortedobjs.hxx>
24 #include <anchoredobject.hxx>
25 #include <flyfrm.hxx>
26 #include <frmatr.hxx>
28 namespace
30 /// Covers sw/source/core/objectpositioning/ fixes.
31 class Test : public SwModelTestBase
33 public:
34 Test()
35 : SwModelTestBase("/sw/qa/core/objectpositioning/data/")
40 CPPUNIT_TEST_FIXTURE(Test, testOverlapCrash)
42 // Load a document with 2 images.
43 createSwDoc("overlap-crash.odt");
45 // Change their anchor type to to-char.
46 uno::Reference<beans::XPropertySet> xShape1(getShape(1), uno::UNO_QUERY);
47 xShape1->setPropertyValue("AnchorType", uno::Any(text::TextContentAnchorType_AT_CHARACTER));
48 uno::Reference<beans::XPropertySet> xShape2(getShape(1), uno::UNO_QUERY);
49 xShape2->setPropertyValue("AnchorType", uno::Any(text::TextContentAnchorType_AT_CHARACTER));
51 // Insert a new paragraph at the start.
52 SwXTextDocument* pTextDoc = dynamic_cast<SwXTextDocument*>(mxComponent.get());
53 SwDocShell* pDocShell = pTextDoc->GetDocShell();
54 SwWrtShell* pWrtShell = pDocShell->GetWrtShell();
55 // Without the accompanying fix in place, this test would have crashed.
56 pWrtShell->SplitNode();
59 CPPUNIT_TEST_FIXTURE(Test, testVertPosFromBottom)
61 // Create a document, insert a shape and position it 1cm above the bottom of the body area.
62 createSwDoc();
63 uno::Reference<css::lang::XMultiServiceFactory> xFactory(mxComponent, uno::UNO_QUERY);
64 uno::Reference<drawing::XShape> xShape(
65 xFactory->createInstance("com.sun.star.drawing.RectangleShape"), uno::UNO_QUERY);
66 xShape->setSize(awt::Size(10000, 10000));
67 uno::Reference<beans::XPropertySet> xShapeProps(xShape, uno::UNO_QUERY);
68 xShapeProps->setPropertyValue("AnchorType", uno::Any(text::TextContentAnchorType_AT_CHARACTER));
69 xShapeProps->setPropertyValue("VertOrient", uno::Any(text::VertOrientation::NONE));
70 xShapeProps->setPropertyValue("VertOrientRelation",
71 uno::Any(text::RelOrientation::PAGE_PRINT_AREA_BOTTOM));
72 xShapeProps->setPropertyValue("VertOrientPosition", uno::Any(static_cast<sal_Int32>(-11000)));
73 uno::Reference<drawing::XDrawPageSupplier> xDrawPageSupplier(mxComponent, uno::UNO_QUERY);
74 xDrawPageSupplier->getDrawPage()->add(xShape);
76 // Verify that the distance between the body and anchored object bottom is indeed around 1cm.
77 xmlDocUniquePtr pXmlDoc = parseLayoutDump();
78 sal_Int32 nBodyBottom = getXPath(pXmlDoc, "//body/infos/bounds", "bottom").toInt32();
79 sal_Int32 nAnchoredBottom
80 = getXPath(pXmlDoc, "//anchored/SwAnchoredDrawObject/bounds", "bottom").toInt32();
81 // Without the accompanying fix in place, this test would have failed with:
82 // - Expected: 565
83 // - Actual : 9035
84 // i.e. the vertical position was from-top, not from-bottom.
85 CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(565), nBodyBottom - nAnchoredBottom);
88 CPPUNIT_TEST_FIXTURE(Test, testVertAlignBottomMargin)
90 // Create a document, insert three shapes and align it the bottom,center,top of page print area bottom.
91 // The size of shapes are 284 ~ 0.5cm
92 // The height of page print area bottom is 1134 ~ 2cm
93 createSwDoc();
94 uno::Reference<css::lang::XMultiServiceFactory> xFactory(mxComponent, uno::UNO_QUERY);
96 //Create first shape and align bottom of page print area bottom.
97 uno::Reference<drawing::XShape> xShapeBottom(
98 xFactory->createInstance("com.sun.star.drawing.RectangleShape"), uno::UNO_QUERY);
99 xShapeBottom->setSize(awt::Size(500, 500));
100 uno::Reference<beans::XPropertySet> xShapePropsBottom(xShapeBottom, uno::UNO_QUERY);
101 xShapePropsBottom->setPropertyValue("AnchorType",
102 uno::Any(text::TextContentAnchorType_AT_CHARACTER));
103 xShapePropsBottom->setPropertyValue("VertOrient", uno::Any(text::VertOrientation::BOTTOM));
104 xShapePropsBottom->setPropertyValue("VertOrientRelation",
105 uno::Any(text::RelOrientation::PAGE_PRINT_AREA_BOTTOM));
106 uno::Reference<drawing::XDrawPageSupplier> xDrawPageSupplierBottom(mxComponent, uno::UNO_QUERY);
107 xDrawPageSupplierBottom->getDrawPage()->add(xShapeBottom);
109 //Create second shape and align center of page print area bottom.
110 uno::Reference<drawing::XShape> xShapeCenter(
111 xFactory->createInstance("com.sun.star.drawing.RectangleShape"), uno::UNO_QUERY);
112 xShapeCenter->setSize(awt::Size(500, 500));
113 uno::Reference<beans::XPropertySet> xShapePropsCenter(xShapeCenter, uno::UNO_QUERY);
114 xShapePropsCenter->setPropertyValue("AnchorType",
115 uno::Any(text::TextContentAnchorType_AT_CHARACTER));
116 xShapePropsCenter->setPropertyValue("VertOrient", uno::Any(text::VertOrientation::CENTER));
117 xShapePropsCenter->setPropertyValue("VertOrientRelation",
118 uno::Any(text::RelOrientation::PAGE_PRINT_AREA_BOTTOM));
119 uno::Reference<drawing::XDrawPageSupplier> xDrawPageSupplierCenter(mxComponent, uno::UNO_QUERY);
120 xDrawPageSupplierCenter->getDrawPage()->add(xShapeCenter);
122 //Create third shape and align top of page print area bottom.
123 uno::Reference<drawing::XShape> xShapeTop(
124 xFactory->createInstance("com.sun.star.drawing.RectangleShape"), uno::UNO_QUERY);
125 xShapeTop->setSize(awt::Size(500, 500));
126 uno::Reference<beans::XPropertySet> xShapePropsTop(xShapeTop, uno::UNO_QUERY);
127 xShapePropsTop->setPropertyValue("AnchorType",
128 uno::Any(text::TextContentAnchorType_AT_CHARACTER));
129 xShapePropsTop->setPropertyValue("VertOrient", uno::Any(text::VertOrientation::TOP));
130 xShapePropsTop->setPropertyValue("VertOrientRelation",
131 uno::Any(text::RelOrientation::PAGE_PRINT_AREA_BOTTOM));
132 uno::Reference<drawing::XDrawPageSupplier> xDrawPageSupplierTop(mxComponent, uno::UNO_QUERY);
133 xDrawPageSupplierTop->getDrawPage()->add(xShapeTop);
135 xmlDocUniquePtr pXmlDoc = parseLayoutDump();
136 sal_Int32 nBodyBottom = getXPath(pXmlDoc, "//body/infos/bounds", "bottom").toInt32(); //14989
137 sal_Int32 nPageBottom = getXPath(pXmlDoc, "//page/infos/bounds", "bottom").toInt32(); //16123
138 sal_Int32 nFirstShapeBottom
139 = getXPath(pXmlDoc, "//anchored/SwAnchoredDrawObject[1]/bounds", "bottom")
140 .toInt32(); //16124
141 sal_Int32 nSecondShapeBottom
142 = getXPath(pXmlDoc, "//anchored/SwAnchoredDrawObject[2]/bounds", "bottom")
143 .toInt32(); //15699
144 sal_Int32 nSecondShapeTop
145 = getXPath(pXmlDoc, "//anchored/SwAnchoredDrawObject[2]/bounds", "top").toInt32(); //15414
146 sal_Int32 nThirdShapeTop
147 = getXPath(pXmlDoc, "//anchored/SwAnchoredDrawObject[3]/bounds", "top").toInt32(); //14989
149 // Verify that the distance between the bottom of page and bottom of first shape is around 0cm. (align=bottom)
150 CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(1), nFirstShapeBottom - nPageBottom);
151 // Verify that the distance between the bottom of page and bottom of second shape is around 0.75cm and
152 // verify that the distance between the bottom of body and top of second shape is around 0.75cm.(align=center)
153 CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(424), nPageBottom - nSecondShapeBottom);
154 CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(425), nSecondShapeTop - nBodyBottom);
155 // Verify that the distance between the bottom of body and top of third shape is around 0cm. (align=top)
156 CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(0), nThirdShapeTop - nBodyBottom);
159 CPPUNIT_TEST_FIXTURE(Test, testVertAlignBottomMarginWithFooter)
161 // Load an empty document with footer.
162 createSwDoc("bottom-margin-with-footer.docx");
163 uno::Reference<css::lang::XMultiServiceFactory> xFactory(mxComponent, uno::UNO_QUERY);
165 // Insert three shapes and align it the bottom,center,top of page print area bottom.
166 // The height of page print area bottom is 2268 ~ 4cm.
167 // The size of shapes are 567 ~ 1cm
168 // Create first shape and align bottom of page print area bottom.
169 uno::Reference<drawing::XShape> xShapeBottom(
170 xFactory->createInstance("com.sun.star.drawing.RectangleShape"), uno::UNO_QUERY);
171 xShapeBottom->setSize(awt::Size(1000, 1000));
172 uno::Reference<beans::XPropertySet> xShapePropsBottom(xShapeBottom, uno::UNO_QUERY);
173 xShapePropsBottom->setPropertyValue("AnchorType",
174 uno::Any(text::TextContentAnchorType_AT_CHARACTER));
175 xShapePropsBottom->setPropertyValue("VertOrient", uno::Any(text::VertOrientation::BOTTOM));
176 xShapePropsBottom->setPropertyValue("VertOrientRelation",
177 uno::Any(text::RelOrientation::PAGE_PRINT_AREA_BOTTOM));
178 uno::Reference<drawing::XDrawPageSupplier> xDrawPageSupplierBottom(mxComponent, uno::UNO_QUERY);
179 xDrawPageSupplierBottom->getDrawPage()->add(xShapeBottom);
181 // Create second shape and align center of page print area bottom.
182 uno::Reference<drawing::XShape> xShapeCenter(
183 xFactory->createInstance("com.sun.star.drawing.RectangleShape"), uno::UNO_QUERY);
184 xShapeCenter->setSize(awt::Size(1000, 1000));
185 uno::Reference<beans::XPropertySet> xShapePropsCenter(xShapeCenter, uno::UNO_QUERY);
186 xShapePropsCenter->setPropertyValue("AnchorType",
187 uno::Any(text::TextContentAnchorType_AT_CHARACTER));
188 xShapePropsCenter->setPropertyValue("VertOrient", uno::Any(text::VertOrientation::CENTER));
189 xShapePropsCenter->setPropertyValue("VertOrientRelation",
190 uno::Any(text::RelOrientation::PAGE_PRINT_AREA_BOTTOM));
191 uno::Reference<drawing::XDrawPageSupplier> xDrawPageSupplierCenter(mxComponent, uno::UNO_QUERY);
192 xDrawPageSupplierCenter->getDrawPage()->add(xShapeCenter);
194 // Create third shape and align top of page print area bottom.
195 uno::Reference<drawing::XShape> xShapeTop(
196 xFactory->createInstance("com.sun.star.drawing.RectangleShape"), uno::UNO_QUERY);
197 xShapeTop->setSize(awt::Size(1000, 1000));
198 uno::Reference<beans::XPropertySet> xShapePropsTop(xShapeTop, uno::UNO_QUERY);
199 xShapePropsTop->setPropertyValue("AnchorType",
200 uno::Any(text::TextContentAnchorType_AT_CHARACTER));
201 xShapePropsTop->setPropertyValue("VertOrient", uno::Any(text::VertOrientation::TOP));
202 xShapePropsTop->setPropertyValue("VertOrientRelation",
203 uno::Any(text::RelOrientation::PAGE_PRINT_AREA_BOTTOM));
204 uno::Reference<drawing::XDrawPageSupplier> xDrawPageSupplierTop(mxComponent, uno::UNO_QUERY);
205 xDrawPageSupplierTop->getDrawPage()->add(xShapeTop);
207 xmlDocUniquePtr pXmlDoc = parseLayoutDump();
208 sal_Int32 nBodyBottom = getXPath(pXmlDoc, "//body/infos/bounds", "bottom").toInt32(); //14853
209 sal_Int32 nPageBottom = getXPath(pXmlDoc, "//page/infos/bounds", "bottom").toInt32(); //17121
210 sal_Int32 nFirstShapeBottom
211 = getXPath(pXmlDoc, "//anchored/SwAnchoredDrawObject[1]/bounds", "bottom")
212 .toInt32(); //17122
213 sal_Int32 nSecondShapeTop
214 = getXPath(pXmlDoc, "//anchored/SwAnchoredDrawObject[2]/bounds", "top").toInt32(); //15703
215 sal_Int32 nSecondShapeBottom
216 = getXPath(pXmlDoc, "//anchored/SwAnchoredDrawObject[2]/bounds", "bottom")
217 .toInt32(); //16272
218 sal_Int32 nThirdShapeTop
219 = getXPath(pXmlDoc, "//anchored/SwAnchoredDrawObject[3]/bounds", "top").toInt32(); //14853
221 // Verify that the distance between the bottom of page and bottom of first shape is around 0cm. (align=bottom)
222 CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(1), nFirstShapeBottom - nPageBottom);
223 // Verify that the distance between the bottom of page and bottom of second shape is around 1.5cm and
224 // verify that the distance between the bottom of body and top of second shape is around 1.5cm.(align=center)
225 CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(849), nPageBottom - nSecondShapeBottom);
226 CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(850), nSecondShapeTop - nBodyBottom);
227 // Verify that the distance between the bottom of body and top of third shape is around 0cm. (align=top)
228 CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(0), nThirdShapeTop - nBodyBottom);
231 CPPUNIT_TEST_FIXTURE(Test, testInsideOutsideVertAlignBottomMargin)
233 // Load a document, with two shapes.
234 // The shapes align the outside and inside of page print area bottom.
235 createSwDoc("inside-outside-vert-align.docx");
237 xmlDocUniquePtr pXmlDoc = parseLayoutDump();
238 sal_Int32 nBodyBottom = getXPath(pXmlDoc, "//body/infos/bounds", "bottom").toInt32(); //15704
239 sal_Int32 nPageBottom = getXPath(pXmlDoc, "//page/infos/bounds", "bottom").toInt32(); //17121
240 sal_Int32 nFirstShapeOutside
241 = getXPath(pXmlDoc, "//anchored/SwAnchoredDrawObject[1]/bounds", "bottom")
242 .toInt32(); //17098
243 sal_Int32 nSecondShapeInside
244 = getXPath(pXmlDoc, "//anchored/SwAnchoredDrawObject[2]/bounds", "top").toInt32(); //15694
246 // Verify that the distance between the bottom of page and bottom of first shape is around 0cm. (align=outside)
247 CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(3), nPageBottom - nFirstShapeOutside);
248 // Verify that the distance between the bottom of body and top of second shape is around 0cm. (align=inside)
249 CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(0), nBodyBottom - nSecondShapeInside);
252 CPPUNIT_TEST_FIXTURE(Test, testVMLVertAlignBottomMargin)
254 // Load a document, with five shapes.
255 // The shapes align the top,center,bottom,outside and inside of page print area bottom.
256 // The height of page print area bottom is 4320 ~ 7.62cm.
257 // The size of shapes are 442 ~ 0.78cm
258 createSwDoc("vml-vertical-alignment.docx");
260 xmlDocUniquePtr pXmlDoc = parseLayoutDump();
261 sal_Int32 nBodyBottom = getXPath(pXmlDoc, "//body/infos/bounds", "bottom").toInt32(); //11803
262 sal_Int32 nPageBottom = getXPath(pXmlDoc, "//page/infos/bounds", "bottom").toInt32(); //16123
264 sal_Int32 nFirstVMLShapeInside
265 = getXPath(pXmlDoc, "//anchored/SwAnchoredDrawObject[1]/bounds", "top").toInt32(); //11802
266 sal_Int32 nSecondVMLShapeBottom
267 = getXPath(pXmlDoc, "//anchored/SwAnchoredDrawObject[2]/bounds", "bottom")
268 .toInt32(); //16124
269 sal_Int32 nThirdVMLShapeCenterBottom
270 = getXPath(pXmlDoc, "//anchored/SwAnchoredDrawObject[3]/bounds", "bottom")
271 .toInt32(); //14185
272 sal_Int32 nThirdVMLShapeCenterTop
273 = getXPath(pXmlDoc, "//anchored/SwAnchoredDrawObject[3]/bounds", "top").toInt32(); //13741
274 sal_Int32 nFourthVMLShapeTop
275 = getXPath(pXmlDoc, "//anchored/SwAnchoredDrawObject[4]/bounds", "top").toInt32(); //11802
276 sal_Int32 nFifthVMLShapeOutside
277 = getXPath(pXmlDoc, "//anchored/SwAnchoredDrawObject[5]/bounds", "bottom")
278 .toInt32(); //16124
280 // Verify that the distance between the bottom of body and top of first VMLshape is around 0cm. (align=inside)
281 CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(1), nBodyBottom - nFirstVMLShapeInside);
282 // Verify that the distance between the bottom of page and bottom of second VMLshape is around 0cm. (align=bottom)
283 CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(1), nSecondVMLShapeBottom - nPageBottom);
284 // Verify that the distance between the bottom of page and bottom of third VMLshape is around 3.4cm and
285 // verify that the distance between the bottom of body and top of third shape is around 3.4cm.(align=center)
286 CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(1938), nPageBottom - nThirdVMLShapeCenterBottom);
287 CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(1938), nThirdVMLShapeCenterTop - nBodyBottom);
288 // Verify that the distance between the bottom of body and top of fourth VMLshape is around 0cm. (align=top)
289 CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(1), nBodyBottom - nFourthVMLShapeTop);
290 // Verify that the distance between the bottom of page and bottom of fifth shape is around 0cm. (align=outside)
291 CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(1), nFifthVMLShapeOutside - nPageBottom);
294 CPPUNIT_TEST_FIXTURE(Test, testFloatingTableOverlapNever)
296 // Given a document with two floating tables, positioned in a way that normally these would
297 // overlap, but SwFormatWrapInfluenceOnObjPos::mbAllowOverlap == false explicitly asks to avoid
298 // overlaps:
299 createSwDoc("floattable-tbl-overlap.docx");
301 // When laying out that document:
302 calcLayout();
304 // Then make sure no overlap happens:
305 SwDoc* pDoc = getSwDoc();
306 SwRootFrame* pLayout = pDoc->getIDocumentLayoutAccess().GetCurrentLayout();
307 auto pPage1 = dynamic_cast<SwPageFrame*>(pLayout->Lower());
308 CPPUNIT_ASSERT(pPage1);
309 CPPUNIT_ASSERT(pPage1->GetSortedObjs());
310 const SwSortedObjs& rPage1Objs = *pPage1->GetSortedObjs();
311 CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(2), rPage1Objs.size());
312 auto pFlyFrame1 = rPage1Objs[0]->DynCastFlyFrame();
313 auto pFlyFrame2 = rPage1Objs[1]->DynCastFlyFrame();
314 // Without the accompanying fix in place, this test would have failed with:
315 // - Expected greater than: 2291
316 // - Actual : 2175
317 // i.e. the 2nd floating table overlapped with the first one.
318 CPPUNIT_ASSERT_GREATER(pFlyFrame1->getFrameArea().Bottom(), pFlyFrame2->getFrameArea().Top());
321 CPPUNIT_TEST_FIXTURE(Test, testFloatingTableVertOrientTop)
323 // Given a document with a vert-orient=from-top anchored floating table:
324 createSwDoc("floattable-vert-orient-top.odt");
326 // When laying out that document:
327 calcLayout();
329 // Then make sure we correctly split the table to two pages:
330 // Without the accompanying fix in place, this test would have produced a layout loop.
331 SwDoc* pDoc = getSwDoc();
332 SwRootFrame* pLayout = pDoc->getIDocumentLayoutAccess().GetCurrentLayout();
333 auto pPage1 = pLayout->Lower()->DynCastPageFrame();
334 CPPUNIT_ASSERT(pPage1);
335 CPPUNIT_ASSERT(pPage1->GetSortedObjs());
336 const SwSortedObjs& rPage1Objs = *pPage1->GetSortedObjs();
337 CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(1), rPage1Objs.size());
338 auto pPage2 = pPage1->GetNext()->DynCastPageFrame();
339 CPPUNIT_ASSERT(pPage2);
340 CPPUNIT_ASSERT(pPage2->GetSortedObjs());
341 const SwSortedObjs& rPage2Objs = *pPage2->GetSortedObjs();
342 CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(1), rPage2Objs.size());
345 CPPUNIT_TEST_FIXTURE(Test, testFloatingTableFollowWrongPage)
347 // Given a document with text on 2 pages, the first page has a fly frame that can split:
348 createSwDoc("floattable-follow-on-wrong-page.odt");
350 // When increasing the top and bottom margins from 0.5cm to 2.5cm:
351 SwDoc* pDoc = getSwDoc();
352 SwPageDesc aStandard(pDoc->GetPageDesc(0));
353 SvxULSpaceItem aPageMargin(aStandard.GetMaster().GetULSpace());
354 aPageMargin.SetUpper(1417);
355 aPageMargin.SetLower(1417);
356 aStandard.GetMaster().SetFormatAttr(aPageMargin);
357 pDoc->ChgPageDesc(0, aStandard);
359 // Then make sure the first and second page has fly frames:
360 SwRootFrame* pLayout = pDoc->getIDocumentLayoutAccess().GetCurrentLayout();
361 auto pPage1 = pLayout->Lower()->DynCastPageFrame();
362 CPPUNIT_ASSERT(pPage1);
363 CPPUNIT_ASSERT(pPage1->GetSortedObjs());
364 const SwSortedObjs& rPage1Objs = *pPage1->GetSortedObjs();
365 CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(1), rPage1Objs.size());
366 auto pPage2 = pPage1->GetNext()->DynCastPageFrame();
367 CPPUNIT_ASSERT(pPage2);
368 // Without the accompanying fix in place, this test would have failed, page 2 had no fly frame
369 // (page 3 had one).
370 CPPUNIT_ASSERT(pPage2->GetSortedObjs());
371 const SwSortedObjs& rPage2Objs = *pPage2->GetSortedObjs();
372 CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(1), rPage2Objs.size());
376 CPPUNIT_PLUGIN_IMPLEMENT();
378 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */