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

fdo#44174 RTF_TITLEPG when title page has no header

Change-Id: Ida6566b38ceaca30441a029c73bd1f52d93bbb3b
üst 7e043ead
{\rtf1
\titlepg
First page has no header.
\pagebb
Second page has a header.
\par }
......@@ -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();
......
......@@ -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 )
......
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