diff options
author | Miklos Vajna <vmiklos@suse.cz> | 2013-03-20 10:43:57 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@suse.cz> | 2013-03-20 11:35:24 +0100 |
commit | 19802872052aaed9d3deff02b882b2043239a406 (patch) | |
tree | e0f323e8a99c53e99fc62dcc1eec520cb4de34eb /sw | |
parent | c426df5086785807972c1a8d2788567f2842a395 (diff) |
fdo#60769 implement odf export of multi-paragraph comment ranges
Change-Id: Ifb850438586eb6589fde79d10ed9eef727368f42
Diffstat (limited to 'sw')
-rw-r--r-- | sw/qa/extras/odfexport/data/fdo60769.odt | bin | 0 -> 9482 bytes | |||
-rw-r--r-- | sw/qa/extras/odfexport/odfexport.cxx | 28 |
2 files changed, 28 insertions, 0 deletions
diff --git a/sw/qa/extras/odfexport/data/fdo60769.odt b/sw/qa/extras/odfexport/data/fdo60769.odt Binary files differnew file mode 100644 index 000000000000..b3c39376b82c --- /dev/null +++ b/sw/qa/extras/odfexport/data/fdo60769.odt diff --git a/sw/qa/extras/odfexport/odfexport.cxx b/sw/qa/extras/odfexport/odfexport.cxx index 4ed23f1a401f..e121c2f2f378 100644 --- a/sw/qa/extras/odfexport/odfexport.cxx +++ b/sw/qa/extras/odfexport/odfexport.cxx @@ -35,6 +35,7 @@ public: void testFdo38244(); void testFirstHeaderFooter(); void testTextframeGradient(); + void testFdo60769(); CPPUNIT_TEST_SUITE(Test); #if !defined(MACOSX) && !defined(WNT) @@ -52,6 +53,7 @@ void Test::run() {"fdo38244.odt", &Test::testFdo38244}, {"first-header-footer.odt", &Test::testFirstHeaderFooter}, {"textframe-gradient.odt", &Test::testTextframeGradient}, + {"fdo60769.odt", &Test::testFdo60769}, }; header(); for (unsigned int i = 0; i < SAL_N_ELEMENTS(aMethods); ++i) @@ -133,6 +135,32 @@ void Test::testTextframeGradient() CPPUNIT_ASSERT_EQUAL(awt::GradientStyle_AXIAL, aGradient.Style); } +void Test::testFdo60769() +{ + // Test multi-paragraph comment range feature. + uno::Reference<text::XTextDocument> xTextDocument(mxComponent, uno::UNO_QUERY); + uno::Reference<container::XEnumerationAccess> xParaEnumAccess(xTextDocument->getText(), uno::UNO_QUERY); + uno::Reference<container::XEnumeration> xParaEnum = xParaEnumAccess->createEnumeration(); + uno::Reference<container::XEnumerationAccess> xRunEnumAccess(xParaEnum->nextElement(), uno::UNO_QUERY); + uno::Reference<container::XEnumeration> xRunEnum = xRunEnumAccess->createEnumeration(); + while (xRunEnum->hasMoreElements()) + { + uno::Reference<beans::XPropertySet> xPropertySet(xRunEnum->nextElement(), uno::UNO_QUERY); + OUString aType = getProperty<OUString>(xPropertySet, "TextPortionType"); + // First paragraph: no field end, no anchor + CPPUNIT_ASSERT(aType == "Text" || aType == "TextFieldStart"); + } + + xRunEnumAccess.set(xParaEnum->nextElement(), uno::UNO_QUERY); + while (xRunEnum->hasMoreElements()) + { + uno::Reference<beans::XPropertySet> xPropertySet(xRunEnum->nextElement(), uno::UNO_QUERY); + OUString aType = getProperty<OUString>(xPropertySet, "TextPortionType"); + // Second paragraph: no field start + CPPUNIT_ASSERT(aType == "Text" || aType == "TextFieldEnd" || aType == "TextFieldEnd"); + } +} + CPPUNIT_TEST_SUITE_REGISTRATION(Test); CPPUNIT_PLUGIN_IMPLEMENT(); |