Kaydet (Commit) 43b88364 authored tarafından Miklos Vajna's avatar Miklos Vajna

RTF import: fix as-char anchored OLE objects

Regression from 2a35f5c7 (DOCX OLE
import: inherit anchor type from replacement graphic, 2014-02-18), then
problem was that dmapper expected that the anchor type of the
replacement graphic is set, but the RTF tokenizer wasn't adapted to
fulfill this requirement.

Change-Id: I0f7e1a71052f337793d6f844fe5476c3868c03f4
üst 3743f9da
...@@ -81,6 +81,7 @@ using namespace css; ...@@ -81,6 +81,7 @@ using namespace css;
#if 1 #if 1
#define DECLARE_OOXMLIMPORT_TEST(TestName, filename) DECLARE_SW_IMPORT_TEST(TestName, filename, Test) #define DECLARE_OOXMLIMPORT_TEST(TestName, filename) DECLARE_SW_IMPORT_TEST(TestName, filename, Test)
#define DECLARE_OOXMLEXPORT_TEST(TestName, filename) DECLARE_SW_ROUNDTRIP_TEST(TestName, filename, Test) #define DECLARE_OOXMLEXPORT_TEST(TestName, filename) DECLARE_SW_ROUNDTRIP_TEST(TestName, filename, Test)
#define DECLARE_RTFIMPORT_TEST(TestName, filename) DECLARE_SW_IMPORT_TEST(TestName, filename, Test)
// For testing during development of a test, you want to use // For testing during development of a test, you want to use
// DECLARE_OOXMLEXPORT_TEST_ONLY, and change the above to #if 0 // DECLARE_OOXMLEXPORT_TEST_ONLY, and change the above to #if 0
...@@ -88,10 +89,12 @@ using namespace css; ...@@ -88,10 +89,12 @@ using namespace css;
#else #else
#define DECLARE_OOXMLIMPORT_TEST_ONLY(TestName, filename) DECLARE_SW_IMPORT_TEST(TestName, filename, Test) #define DECLARE_OOXMLIMPORT_TEST_ONLY(TestName, filename) DECLARE_SW_IMPORT_TEST(TestName, filename, Test)
#define DECLARE_OOXMLEXPORT_TEST_ONLY(TestName, filename) DECLARE_SW_ROUNDTRIP_TEST(TestName, filename, Test) #define DECLARE_OOXMLEXPORT_TEST_ONLY(TestName, filename) DECLARE_SW_ROUNDTRIP_TEST(TestName, filename, Test)
#define DECLARE_RTFIMPORT_TEST_ONLY(TestName, filename) DECLARE_SW_IMPORT_TEST(TestName, filename, Test)
#undef DECLARE_OOXMLEXPORT_TEST #undef DECLARE_OOXMLEXPORT_TEST
#define DECLARE_OOXMLIMPORT_TEST(TestName, filename) class disabled##TestName : public Test { void disabled(); }; void disabled##TestName::disabled() #define DECLARE_OOXMLIMPORT_TEST(TestName, filename) class disabled##TestName : public Test { void disabled(); }; void disabled##TestName::disabled()
#define DECLARE_OOXMLEXPORT_TEST(TestName, filename) class disabled##TestName : public Test { void disabled(); }; void disabled##TestName::disabled() #define DECLARE_OOXMLEXPORT_TEST(TestName, filename) class disabled##TestName : public Test { void disabled(); }; void disabled##TestName::disabled()
#define DECLARE_RTFIMPORT_TEST(TestName, filename) class disabled##TestName : public Test { void disabled(); }; void disabled##TestName::disabled()
#endif #endif
#define DECLARE_SW_IMPORT_TEST(TestName, filename, BaseClass) \ #define DECLARE_SW_IMPORT_TEST(TestName, filename, BaseClass) \
......
This diff is collapsed.
...@@ -110,8 +110,6 @@ protected: ...@@ -110,8 +110,6 @@ protected:
AllSettings m_aSavedSettings; AllSettings m_aSavedSettings;
}; };
#define DECLARE_RTFIMPORT_TEST(TestName, filename) DECLARE_SW_IMPORT_TEST(TestName, filename, Test)
#if !defined(WNT) #if !defined(WNT)
DECLARE_RTFIMPORT_TEST(testFdo45553, "fdo45553.rtf") DECLARE_RTFIMPORT_TEST(testFdo45553, "fdo45553.rtf")
...@@ -1863,6 +1861,12 @@ DECLARE_RTFIMPORT_TEST(testUnbalancedColumnsCompat, "unbalanced-columns-compat.r ...@@ -1863,6 +1861,12 @@ DECLARE_RTFIMPORT_TEST(testUnbalancedColumnsCompat, "unbalanced-columns-compat.r
CPPUNIT_ASSERT_EQUAL(true, getProperty<bool>(xTextSections->getByIndex(0), "DontBalanceTextColumns")); CPPUNIT_ASSERT_EQUAL(true, getProperty<bool>(xTextSections->getByIndex(0), "DontBalanceTextColumns"));
} }
DECLARE_RTFIMPORT_TEST(testOleInline, "ole-inline.rtf")
{
// Problem was that inline shape had at-page anchor.
CPPUNIT_ASSERT_EQUAL(text::TextContentAnchorType_AS_CHARACTER, getProperty<text::TextContentAnchorType>(getShape(1), "AnchorType"));
}
CPPUNIT_PLUGIN_IMPLEMENT(); CPPUNIT_PLUGIN_IMPLEMENT();
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
...@@ -807,6 +807,9 @@ int RTFDocumentImpl::resolvePict(bool const bInline, uno::Reference<drawing::XSh ...@@ -807,6 +807,9 @@ int RTFDocumentImpl::resolvePict(bool const bInline, uno::Reference<drawing::XSh
aSize.Height = (m_aStates.top().aPicture.nGoalHeight ? m_aStates.top().aPicture.nGoalHeight : m_aStates.top().aPicture.nHeight); aSize.Height = (m_aStates.top().aPicture.nGoalHeight ? m_aStates.top().aPicture.nGoalHeight : m_aStates.top().aPicture.nHeight);
xShape->setSize(aSize); xShape->setSize(aSize);
// Replacement graphic is inline by default, see oox::vml::SimpleShape::implConvertAndInsert().
xPropertySet->setPropertyValue("AnchorType", uno::makeAny(text::TextContentAnchorType_AS_CHARACTER));
RTFValue::Pointer_t pShapeValue(new RTFValue(xShape)); RTFValue::Pointer_t pShapeValue(new RTFValue(xShape));
m_aObjectAttributes.set(NS_ooxml::LN_shape, pShapeValue); m_aObjectAttributes.set(NS_ooxml::LN_shape, pShapeValue);
return 0; return 0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment