[Libreoffice-commits] .: sw/qa sw/source
Miklos Vajna
vmiklos at kemper.freedesktop.org
Fri May 11 01:09:02 PDT 2012
sw/qa/extras/rtfexport/data/fdo44174.rtf | 6 ++++++
sw/qa/extras/rtfexport/rtfexport.cxx | 16 ++++++++++++++++
sw/source/filter/ww8/rtfexport.cxx | 1 +
3 files changed, 23 insertions(+)
New commits:
commit b22749fd9f9cd9206549367d2b619690b87414fc
Author: Miklos Vajna <vmiklos at suse.cz>
Date: Fri May 11 09:38:03 2012 +0200
fdo#44174 RTF_TITLEPG when title page has no header
Change-Id: Ida6566b38ceaca30441a029c73bd1f52d93bbb3b
diff --git a/sw/qa/extras/rtfexport/data/fdo44174.rtf b/sw/qa/extras/rtfexport/data/fdo44174.rtf
new file mode 100644
index 0000000..5186193
--- /dev/null
+++ b/sw/qa/extras/rtfexport/data/fdo44174.rtf
@@ -0,0 +1,6 @@
+{\rtf1
+\titlepg
+First page has no header.
+\pagebb
+Second page has a header.
+\par }
diff --git a/sw/qa/extras/rtfexport/rtfexport.cxx b/sw/qa/extras/rtfexport/rtfexport.cxx
index 74b0ca8..a78fb9f 100644
--- a/sw/qa/extras/rtfexport/rtfexport.cxx
+++ b/sw/qa/extras/rtfexport/rtfexport.cxx
@@ -30,6 +30,8 @@
#include <com/sun/star/frame/XStorable.hpp>
#include <com/sun/star/view/XViewSettingsSupplier.hpp>
#include <com/sun/star/document/XDocumentPropertiesSupplier.hpp>
+#include <com/sun/star/text/XPageCursor.hpp>
+#include <com/sun/star/text/XTextViewCursorSupplier.hpp>
#include <unotools/tempfile.hxx>
#include <vcl/svapp.hxx>
@@ -44,12 +46,14 @@ public:
void testZoom();
void testFdo38176();
void testFdo49683();
+ void testFdo44174();
CPPUNIT_TEST_SUITE(Test);
#if !defined(MACOSX) && !defined(WNT)
CPPUNIT_TEST(testZoom);
CPPUNIT_TEST(testFdo38176);
CPPUNIT_TEST(testFdo49683);
+ CPPUNIT_TEST(testFdo44174);
#endif
CPPUNIT_TEST_SUITE_END();
@@ -100,6 +104,18 @@ void Test::testFdo49683()
CPPUNIT_ASSERT_EQUAL(OUString("two"), aKeywords[1]);
}
+void Test::testFdo44174()
+{
+ roundtrip("fdo44174.rtf");
+
+ uno::Reference<frame::XModel> xModel(mxComponent, uno::UNO_QUERY);
+ uno::Reference<text::XTextViewCursorSupplier> xTextViewCursorSupplier(xModel->getCurrentController(), uno::UNO_QUERY);
+ uno::Reference<beans::XPropertySet> xPropertySet(xTextViewCursorSupplier->getViewCursor(), uno::UNO_QUERY);
+ OUString aValue;
+ xPropertySet->getPropertyValue("PageStyleName") >>= aValue;
+ CPPUNIT_ASSERT_EQUAL(OUString("First Page"), aValue);
+}
+
CPPUNIT_TEST_SUITE_REGISTRATION(Test);
CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/sw/source/filter/ww8/rtfexport.cxx b/sw/source/filter/ww8/rtfexport.cxx
index 801ed5b..95f8350 100644
--- a/sw/source/filter/ww8/rtfexport.cxx
+++ b/sw/source/filter/ww8/rtfexport.cxx
@@ -1188,6 +1188,7 @@ void RtfExport::OutPageDescription( const SwPageDesc& rPgDsc, sal_Bool bWriteRes
// title page
if( pAktPageDesc != &rPgDsc )
{
+ Strm() << OOO_STRING_SVTOOLS_RTF_TITLEPG;
pAktPageDesc = &rPgDsc;
if( pAktPageDesc->GetMaster().GetAttrSet().GetItemState( RES_HEADER,
sal_False, &pItem ) == SFX_ITEM_SET )
More information about the Libreoffice-commits
mailing list