Bump version to 5.0-14
[LibreOffice.git] / sc / qa / unit / bugfix-test.cxx
bloba6a30abc09b7174902b720678f196d5e0102881d
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 <sal/config.h>
11 #include <unotest/filters-test.hxx>
12 #include <test/bootstrapfixture.hxx>
13 #include <rtl/strbuf.hxx>
14 #include <osl/file.hxx>
16 #include <sfx2/app.hxx>
17 #include <sfx2/docfilt.hxx>
18 #include <sfx2/docfile.hxx>
19 #include <sfx2/sfxmodelfactory.hxx>
20 #include <svl/stritem.hxx>
21 #include <svx/svdograf.hxx>
23 #include "drwlayer.hxx"
24 #include <svx/svdpage.hxx>
25 #include <svx/svdoole2.hxx>
26 #include <editeng/wghtitem.hxx>
27 #include <editeng/postitem.hxx>
28 #include <editeng/udlnitem.hxx>
29 #include <editeng/editobj.hxx>
30 #include <editeng/borderline.hxx>
31 #include <editeng/flditem.hxx>
32 #include <dbdata.hxx>
33 #include "validat.hxx"
34 #include "formulacell.hxx"
35 #include "userdat.hxx"
36 #include "dpobject.hxx"
37 #include "dpsave.hxx"
38 #include "stlsheet.hxx"
39 #include "docfunc.hxx"
40 #include "markdata.hxx"
41 #include "colorscale.hxx"
42 #include "olinetab.hxx"
43 #include "patattr.hxx"
44 #include "scitems.hxx"
45 #include "docsh.hxx"
46 #include "editutil.hxx"
47 #include "cellvalue.hxx"
48 #include "attrib.hxx"
49 #include "dpshttab.hxx"
50 #include <scopetools.hxx>
51 #include <columnspanset.hxx>
52 #include <tokenstringcontext.hxx>
54 #include <com/sun/star/drawing/XDrawPageSupplier.hpp>
55 #include <com/sun/star/drawing/XControlShape.hpp>
56 #include <com/sun/star/sheet/XSpreadsheetDocument.hpp>
57 #include <com/sun/star/sheet/DataPilotFieldOrientation.hpp>
58 #include <com/sun/star/sheet/DataPilotFieldGroupBy.hpp>
59 #include <com/sun/star/sheet/GeneralFunction.hpp>
60 #include <com/sun/star/container/XIndexAccess.hpp>
61 #include <com/sun/star/frame/XModel.hpp>
62 #include <com/sun/star/text/textfield/Type.hpp>
63 #include <com/sun/star/chart2/XChartDocument.hpp>
64 #include <com/sun/star/chart2/data/XDataReceiver.hpp>
66 #include "helper/qahelper.hxx"
67 #include "helper/shared_test_impl.hxx"
69 using namespace ::com::sun::star;
70 using namespace ::com::sun::star::uno;
72 class ScFiltersTest : public ScBootstrapFixture
74 public:
76 ScFiltersTest();
78 virtual void setUp() SAL_OVERRIDE;
79 virtual void tearDown() SAL_OVERRIDE;
81 void testTdf64229();
82 void testTdf36933();
83 void testTdf43700();
84 void testTdf43534();
85 // void testTdf40110();
87 CPPUNIT_TEST_SUITE(ScFiltersTest);
88 CPPUNIT_TEST(testTdf64229);
89 CPPUNIT_TEST(testTdf36933);
90 CPPUNIT_TEST(testTdf43700);
91 CPPUNIT_TEST(testTdf43534);
92 // CPPUNIT_TEST(testTdf40110);
93 CPPUNIT_TEST_SUITE_END();
94 private:
95 uno::Reference<uno::XInterface> m_xCalcComponent;
98 void ScFiltersTest::testTdf64229()
100 ScDocShellRef xDocSh = loadDoc("fdo64229b.", ODS);
102 xDocSh->DoHardRecalc(true);
104 CPPUNIT_ASSERT_MESSAGE("Failed to load fdo64229b.*", xDocSh.Is());
105 ScDocument& rDoc = xDocSh->GetDocument();
106 OUString aCSVFileName;
108 //test hard recalc: document has an incorrect cached formula result
109 //hard recalc should have updated to the correct result
110 createCSVPath(OUString("fdo64229b."), aCSVFileName);
111 testFile(aCSVFileName, rDoc, 0);
113 xDocSh->DoClose();
116 void ScFiltersTest::testTdf36933()
118 ScDocShellRef xDocSh = loadDoc("fdo36933test.", ODS);
120 xDocSh->DoHardRecalc(true);
122 CPPUNIT_ASSERT_MESSAGE("Failed to load fdo36933test.*", xDocSh.Is());
123 ScDocument& rDoc = xDocSh->GetDocument();
124 OUString aCSVFileName;
126 //test hard recalc: document has an incorrect cached formula result
127 //hard recalc should have updated to the correct result
128 createCSVPath(OUString("fdo36933test."), aCSVFileName);
129 testFile(aCSVFileName, rDoc, 0);
131 xDocSh->DoClose();
134 void ScFiltersTest::testTdf43700()
136 ScDocShellRef xDocSh = loadDoc("fdo43700test.", ODS);
138 xDocSh->DoHardRecalc(true);
140 CPPUNIT_ASSERT_MESSAGE("Failed to load fdo43700test.*", xDocSh.Is());
141 ScDocument& rDoc = xDocSh->GetDocument();
142 OUString aCSVFileName;
144 //test hard recalc: document has an incorrect cached formula result
145 //hard recalc should have updated to the correct result
146 createCSVPath(OUString("fdo43700test."), aCSVFileName);
147 testFile(aCSVFileName, rDoc, 0);
149 xDocSh->DoClose();
152 void ScFiltersTest::testTdf43534()
154 ScDocShellRef xDocSh = loadDoc("fdo43534test.", ODS);
156 xDocSh->DoHardRecalc(true);
158 CPPUNIT_ASSERT_MESSAGE("Failed to load fdo43534test.*", xDocSh.Is());
159 // ScDocument& rDoc = xDocSh->GetDocument();
160 OUString aCSVFileName;
162 //test hard recalc: document has an incorrect cached formula result
163 //hard recalc should have updated to the correct result
164 createCSVPath(OUString("fdo43534test."), aCSVFileName);
165 // testFile(aCSVFileName, rDoc, 0);
167 xDocSh->DoClose();
171 void ScFiltersTest::testTdf40110()
173 ScDocShellRef xDocSh = loadDoc("fdo40110test.", ODS);
175 CPPUNIT_ASSERT_MESSAGE("Failed to load fdo40110test.*", xDocSh.Is());
176 xDocSh->DoHardRecalc(true);
178 ScDocument& rDoc = xDocSh->GetDocument();
179 OUString aCSVFileName;
181 //test hard recalc: document has an incorrect cached formula result
182 //hard recalc should have updated to the correct result
183 createCSVPath(OUString("fdo40110test."), aCSVFileName);
184 testFile(aCSVFileName, rDoc, 0);
186 xDocSh->DoClose();
191 ScFiltersTest::ScFiltersTest()
192 : ScBootstrapFixture( "/sc/qa/unit/data" )
196 void ScFiltersTest::setUp()
198 test::BootstrapFixture::setUp();
200 // This is a bit of a fudge, we do this to ensure that ScGlobals::ensure,
201 // which is a private symbol to us, gets called
202 m_xCalcComponent =
203 getMultiServiceFactory()->createInstance("com.sun.star.comp.Calc.SpreadsheetDocument");
204 CPPUNIT_ASSERT_MESSAGE("no calc component!", m_xCalcComponent.is());
207 void ScFiltersTest::tearDown()
209 uno::Reference< lang::XComponent >( m_xCalcComponent, UNO_QUERY_THROW )->dispose();
210 test::BootstrapFixture::tearDown();
213 CPPUNIT_TEST_SUITE_REGISTRATION(ScFiltersTest);
215 CPPUNIT_PLUGIN_IMPLEMENT();
217 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */