diff options
-rw-r--r-- | sw/CppunitTest_sw_rtfimport.mk | 1 | ||||
-rw-r--r-- | sw/qa/extras/rtfimport/data/fdo68291-paste.rtf | 17 | ||||
-rw-r--r-- | sw/qa/extras/rtfimport/data/fdo68291.odt | bin | 0 -> 8237 bytes | |||
-rw-r--r-- | sw/qa/extras/rtfimport/rtfimport.cxx | 13 | ||||
-rw-r--r-- | writerfilter/source/dmapper/PropertyMap.cxx | 2 |
5 files changed, 32 insertions, 1 deletions
diff --git a/sw/CppunitTest_sw_rtfimport.mk b/sw/CppunitTest_sw_rtfimport.mk index 8cedeeb1e082..be6613adf2ff 100644 --- a/sw/CppunitTest_sw_rtfimport.mk +++ b/sw/CppunitTest_sw_rtfimport.mk @@ -75,6 +75,7 @@ $(eval $(call gb_CppunitTest_use_components,sw_rtfimport,\ unotools/util/utl \ unoxml/source/service/unoxml \ writerfilter/util/writerfilter \ + xmloff/util/xo \ )) $(eval $(call gb_CppunitTest_use_configuration,sw_rtfimport)) diff --git a/sw/qa/extras/rtfimport/data/fdo68291-paste.rtf b/sw/qa/extras/rtfimport/data/fdo68291-paste.rtf new file mode 100644 index 000000000000..cb86b608438c --- /dev/null +++ b/sw/qa/extras/rtfimport/data/fdo68291-paste.rtf @@ -0,0 +1,17 @@ +{\rtf1\ansi\deff3\adeflang1025 +{\fonttbl{\f0\froman\fprq2\fcharset0 Times New Roman;}{\f1\froman\fprq2\fcharset2 Symbol;}{\f2\fswiss\fprq2\fcharset0 Arial;}{\f3\froman\fprq2\fcharset0 Times New Roman;}{\f4\fswiss\fprq2\fcharset0 Arial;}{\f5\fnil\fprq2\fcharset0 DejaVu Sans;}} +{\colortbl;\red0\green0\blue0;\red128\green128\blue128;} +{\stylesheet{\s0\snext0\nowidctlpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf0\kerning1\dbch\af5\langfe2052\dbch\af5\alang1081\fs24\lang1038 Normal;} +{\s15\sbasedon0\snext15\noline Index;} +{\s16\sbasedon0\snext16\sb120\sa120\noline\i\afs24\ai\fs24 Caption;} +{\s17\sbasedon18\snext17\sb0\sa120 List;} +{\s18\sbasedon0\snext18\sb0\sa120 Text Body;} +{\s19\sbasedon0\snext18\sb240\sa120\keepn\dbch\af5\dbch\af5\afs28\loch\f4\fs28 Heading;} +}{\info{\comment LibreOffice}{\vern67239936}}\deftab709 + +{\*\pgdsctbl +{\pgdsc0\pgdscuse451\pgwsxn11906\pghsxn16838\marglsxn1134\margrsxn1134\margtsxn1134\margbsxn1134\pgdscnxt0 Default Style;}} +\formshade\paperh16838\paperw11906\margl1134\margr1134\margt1134\margb1134\sectd\sbknone\sectunlocked1\pgndec\pgwsxn11906\pghsxn16838\marglsxn1134\margrsxn1134\margtsxn1134\margbsxn1134\ftnbj\ftnstart1\ftnrstcont\ftnnar\aenddoc\aftnrstcont\aftnstart1\aftnnrlc +\pgndec\pard\plain \s0\nowidctlpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf0\kerning1\dbch\af5\langfe2052\dbch\af5\alang1081\fs24\lang1038{\rtlch \ltrch\loch +aaa} +\par } diff --git a/sw/qa/extras/rtfimport/data/fdo68291.odt b/sw/qa/extras/rtfimport/data/fdo68291.odt Binary files differnew file mode 100644 index 000000000000..ddf7d309e4df --- /dev/null +++ b/sw/qa/extras/rtfimport/data/fdo68291.odt diff --git a/sw/qa/extras/rtfimport/rtfimport.cxx b/sw/qa/extras/rtfimport/rtfimport.cxx index 0041729b7d1a..c5dfd255a617 100644 --- a/sw/qa/extras/rtfimport/rtfimport.cxx +++ b/sw/qa/extras/rtfimport/rtfimport.cxx @@ -165,6 +165,7 @@ public: void testGroupshapeRotation(); void testFdo44715(); void testFdo68076(); + void testFdo68291(); CPPUNIT_TEST_SUITE(Test); #if !defined(MACOSX) && !defined(WNT) @@ -315,6 +316,7 @@ void Test::run() {"groupshape-rotation.rtf", &Test::testGroupshapeRotation}, {"fdo44715.rtf", &Test::testFdo44715}, {"fdo68076.rtf", &Test::testFdo68076}, + {"fdo68291.odt", &Test::testFdo68291}, }; header(); for (unsigned int i = 0; i < SAL_N_ELEMENTS(aMethods); ++i) @@ -1512,6 +1514,17 @@ void Test::testFdo68076() getParagraph(1, aExpected); } +void Test::testFdo68291() +{ + uno::Reference<text::XTextDocument> xTextDocument(mxComponent, uno::UNO_QUERY); + uno::Reference<text::XTextRange> xText(xTextDocument->getText(), uno::UNO_QUERY); + uno::Reference<text::XTextRange> xEnd = xText->getEnd(); + paste("fdo68291-paste.rtf", xEnd); + + // This was "Standard", causing an unwanted page break on next paste. + CPPUNIT_ASSERT_EQUAL(OUString(), getProperty<OUString>(getParagraph(1), "PageDescName")); +} + CPPUNIT_TEST_SUITE_REGISTRATION(Test); CPPUNIT_PLUGIN_IMPLEMENT(); diff --git a/writerfilter/source/dmapper/PropertyMap.cxx b/writerfilter/source/dmapper/PropertyMap.cxx index 91ab0147c22c..c3a6523d711c 100644 --- a/writerfilter/source/dmapper/PropertyMap.cxx +++ b/writerfilter/source/dmapper/PropertyMap.cxx @@ -1084,7 +1084,7 @@ void SectionPropertyMap::CloseSectionGroup( DomainMapper_Impl& rDM_Impl ) 0 - No break 1 - New Column 2 - New page 3 - Even page 4 - odd page */ if ((m_bTitlePage && m_bIsFirstSection) || !m_bTitlePage) { - if (xRangeProperties.is()) + if (xRangeProperties.is() && rDM_Impl.IsNewDoc()) xRangeProperties->setPropertyValue(rPropNameSupplier.GetName( PROP_PAGE_DESC_NAME ), uno::makeAny( m_bTitlePage ? m_sFirstPageStyleName : m_sFollowPageStyleName )); } |