summaryrefslogtreecommitdiff
path: root/sw/qa
diff options
context:
space:
mode:
authorMichael Meeks <michael.meeks@suse.com>2013-04-30 17:31:12 +0100
committerMichael Meeks <michael.meeks@suse.com>2013-04-30 17:32:20 +0100
commit06a8ebc878ff9bcab26556d5b5a46532e232d416 (patch)
tree57b426a4e47bd3ef165265eb0e78e4032c916f1e /sw/qa
parent102f68ea54e7b9420a8f13605289a5411db5512b (diff)
fdo#62336 - unit test for conversion failure.
Turns out this depends on not doing layout, and so is a real corner-case. Change-Id: If9d2db6b1a0df94fc809fb353f2dbf2cf9ac1c9a
Diffstat (limited to 'sw/qa')
-rw-r--r--sw/qa/extras/htmlexport/data/fdo62336.docxbin0 -> 21361 bytes
-rw-r--r--sw/qa/extras/htmlexport/htmlexport.cxx56
-rw-r--r--sw/qa/extras/inc/swmodeltestbase.hxx6
-rw-r--r--sw/qa/extras/odfexport/odfexport.cxx1
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlexport.cxx1
5 files changed, 62 insertions, 2 deletions
diff --git a/sw/qa/extras/htmlexport/data/fdo62336.docx b/sw/qa/extras/htmlexport/data/fdo62336.docx
new file mode 100644
index 000000000000..f14a0e001962
--- /dev/null
+++ b/sw/qa/extras/htmlexport/data/fdo62336.docx
Binary files differ
diff --git a/sw/qa/extras/htmlexport/htmlexport.cxx b/sw/qa/extras/htmlexport/htmlexport.cxx
new file mode 100644
index 000000000000..34cd2ee0b4e4
--- /dev/null
+++ b/sw/qa/extras/htmlexport/htmlexport.cxx
@@ -0,0 +1,56 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+#include <swmodeltestbase.hxx>
+#include <com/sun/star/awt/Gradient.hpp>
+#include <com/sun/star/drawing/FillStyle.hpp>
+
+class Test : public SwModelTestBase
+{
+public:
+ void testFdo62336();
+
+ CPPUNIT_TEST_SUITE(Test);
+#if !defined(MACOSX) && !defined(WNT)
+ CPPUNIT_TEST(run);
+#endif
+ CPPUNIT_TEST_SUITE_END();
+
+private:
+ void run();
+};
+
+void Test::run()
+{
+ MethodEntry<Test> aMethods[] = {
+ {"fdo62336.docx", &Test::testFdo62336},
+ };
+ header();
+ for (unsigned int i = 0; i < SAL_N_ELEMENTS(aMethods); ++i)
+ {
+ MethodEntry<Test>& rEntry = aMethods[i];
+ load("/sw/qa/extras/htmlexport/data/", rEntry.pName,
+ false /* not doing layout is required for this test */);
+ utl::TempFile aFile;
+ save("HTML", aFile);
+ (this->*rEntry.pMethod)();
+ finish();
+ }
+}
+
+void Test::testFdo62336()
+{
+ // The problem was essentially a crash during table export as docx/rtf/html
+}
+
+CPPUNIT_TEST_SUITE_REGISTRATION(Test);
+
+CPPUNIT_PLUGIN_IMPLEMENT();
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/qa/extras/inc/swmodeltestbase.hxx b/sw/qa/extras/inc/swmodeltestbase.hxx
index 5419a8c8a503..fc8682d39f1c 100644
--- a/sw/qa/extras/inc/swmodeltestbase.hxx
+++ b/sw/qa/extras/inc/swmodeltestbase.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* This file is part of the LibreOffice project.
*
@@ -259,13 +260,14 @@ protected:
fprintf(stderr, "File tested,Execution Time (ms)\n");
}
- void load(const char* pDir, const char* pName)
+ void load(const char* pDir, const char* pName, bool bCalcLayout = true)
{
// Output name early, so in the case of a hang, the name of the hanging input file is visible.
fprintf(stderr, "%s,", pName);
m_nStartTime = osl_getGlobalTimer();
mxComponent = loadFromDesktop(getURLFromSrc(pDir) + OUString::createFromAscii(pName), "com.sun.star.text.TextDocument");
- calcLayout();
+ if (bCalcLayout)
+ calcLayout();
}
void reload(OUString aFilter)
diff --git a/sw/qa/extras/odfexport/odfexport.cxx b/sw/qa/extras/odfexport/odfexport.cxx
index 436759a2813f..09c342a65bac 100644
--- a/sw/qa/extras/odfexport/odfexport.cxx
+++ b/sw/qa/extras/odfexport/odfexport.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* This file is part of the LibreOffice project.
*
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
index 0def6ef93852..8dc69f2a197e 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* This file is part of the LibreOffice project.
*