Debian Codegraph @

sw/qa/writerfilter/dmapper/TableManager.cxx

raw
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
4 *
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 */
9
10 #include <test/unoapi_test.hxx>
11
12 #include <com/sun/star/text/XTextFramesSupplier.hpp>
13
14 using namespace com::sun::star;
15
16 namespace
17 {
18 /// Tests for sw/source/writerfilter/dmapper/TableManager.cxx.
19 class Test : public UnoApiTest
20 {
21 public:
22 Test()
23 : UnoApiTest(u"/sw/qa/writerfilter/dmapper/data/"_ustr)
24 {
25 }
26 };
27
28 CPPUNIT_TEST_FIXTURE(Test, testFloattableNestedCellStartDOCXImport)
29 {
30 // Given a document with a nested floating table at cell start and an other inner floating table:
31 // When importing that document:
32 loadFromFile(u"floattable-nested-cellstart.docx");
33
34 // Then make sure that both inner tables are floating:
35 uno::Reference<text::XTextFramesSupplier> xFramesSupplier(mxComponent, uno::UNO_QUERY);
36 uno::Reference<container::XIndexAccess> xFrames(xFramesSupplier->getTextFrames(),
37 uno::UNO_QUERY);
38 // Without the accompanying fix in place, this test would have failed with:
39 // - Expected: 2
40 // - Actual : 1
41 // i.e. the first inner table was not floating.
42 CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(2), xFrames->getCount());
43 }
44 }
45
46 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */