summaryrefslogtreecommitdiff
path: root/sw/qa
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2014-08-29 14:26:11 +0200
committerMiklos Vajna <vmiklos@collabora.co.uk>2014-09-08 12:46:27 +0200
commit5a43ee13e3d1153939bc6bbdcf948806e164d757 (patch)
tree5d1d4d77c7077552b115e93cae5f7fa2271699ac /sw/qa
parentedbeda30c40e98b1ce771c3090148776f442b6a7 (diff)
fdo#32613 RTF export: implemented anchored picture export
RTF originally didn't support anchored pictures: they were always inline. Then it was invented that pictures can be exported anchored, if they are in fact shapes, but their "pib" property is set to the hexdump of the picture contents. The RTF importer handled this situation for quite some time, but not the exporter -- this commit implements that. (cherry picked from commit cb01957aa0ac3caea8e87522116086ac256d4ee2) Conflicts: sw/qa/extras/inc/swmodeltestbase.hxx sw/qa/extras/rtfexport/rtfexport.cxx sw/source/filter/ww8/rtfattributeoutput.cxx Change-Id: I173ad9f4f2e24620508ca63c0b892b7d5da4e5b2
Diffstat (limited to 'sw/qa')
-rw-r--r--sw/qa/extras/inc/swmodeltestbase.hxx12
-rw-r--r--sw/qa/extras/rtfexport/data/fdo32613.odtbin0 -> 10434 bytes
-rw-r--r--sw/qa/extras/rtfexport/rtfexport.cxx11
3 files changed, 20 insertions, 3 deletions
diff --git a/sw/qa/extras/inc/swmodeltestbase.hxx b/sw/qa/extras/inc/swmodeltestbase.hxx
index dc5a750e864a..f59d14e8af18 100644
--- a/sw/qa/extras/inc/swmodeltestbase.hxx
+++ b/sw/qa/extras/inc/swmodeltestbase.hxx
@@ -70,6 +70,18 @@ using namespace com::sun::star;
CPPUNIT_TEST_SUITE_REGISTRATION(TestName); \
void TestName::verify()
+#if 1
+#define DECLARE_RTFEXPORT_TEST(TestName, filename) DECLARE_SW_ROUNDTRIP_TEST(TestName, filename, Test)
+
+// For testing during development of a test, you want to use
+// DECLARE_OOXMLEXPORT_TEST_ONLY, and change the above to #if 0
+// Of course, don't forget to set back to #if 1 when you are done :-)
+#else
+#define DECLARE_RTFEXPORT_TEST_ONLY(TestName, filename) DECLARE_SW_ROUNDTRIP_TEST(TestName, filename, Test)
+
+#define DECLARE_RTFEXPORT_TEST(TestName, filename) class disabled##TestName : public Test { void disabled(); }; void disabled##TestName::disabled()
+#endif
+
#define DECLARE_SW_IMPORT_TEST(TestName, filename, BaseClass) \
class TestName : public BaseClass { \
public:\
diff --git a/sw/qa/extras/rtfexport/data/fdo32613.odt b/sw/qa/extras/rtfexport/data/fdo32613.odt
new file mode 100644
index 000000000000..bd1e950607f9
--- /dev/null
+++ b/sw/qa/extras/rtfexport/data/fdo32613.odt
Binary files differ
diff --git a/sw/qa/extras/rtfexport/rtfexport.cxx b/sw/qa/extras/rtfexport/rtfexport.cxx
index 5b026c686c13..c10def0222e8 100644
--- a/sw/qa/extras/rtfexport/rtfexport.cxx
+++ b/sw/qa/extras/rtfexport/rtfexport.cxx
@@ -17,11 +17,12 @@
#include <com/sun/star/frame/XStorable.hpp>
#include <com/sun/star/table/BorderLine2.hpp>
#include <com/sun/star/table/ShadowFormat.hpp>
+#include <com/sun/star/text/RelOrientation.hpp>
+#include <com/sun/star/text/TextContentAnchorType.hpp>
#include <com/sun/star/text/XFootnotesSupplier.hpp>
#include <com/sun/star/text/XPageCursor.hpp>
#include <com/sun/star/text/XTextViewCursorSupplier.hpp>
#include <com/sun/star/view/XViewSettingsSupplier.hpp>
-#include <com/sun/star/text/RelOrientation.hpp>
#include <vcl/svapp.hxx>
@@ -49,8 +50,6 @@ public:
}
};
-#define DECLARE_RTFEXPORT_TEST(TestName, filename) DECLARE_SW_ROUNDTRIP_TEST(TestName, filename, Test)
-
DECLARE_RTFEXPORT_TEST(testZoom, "zoom.rtf")
{
uno::Reference<frame::XModel> xModel(mxComponent, uno::UNO_QUERY);
@@ -612,6 +611,12 @@ DECLARE_RTFEXPORT_TEST(testFdo77600, "fdo77600.rtf")
CPPUNIT_ASSERT_EQUAL(OUString("Arial"), getProperty<OUString>(getRun(getParagraph(1), 3), "CharFontName"));
}
+DECLARE_RTFEXPORT_TEST(testFdo32613, "fdo32613.odt")
+{
+ // This was AS_CHARACTER, RTF export did not support writing anchored pictures.
+ CPPUNIT_ASSERT_EQUAL(text::TextContentAnchorType_AT_CHARACTER, getProperty<text::TextContentAnchorType>(getShape(1), "AnchorType"));
+}
+
#endif
CPPUNIT_PLUGIN_IMPLEMENT();