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

fdo#68291 RTF paste: don't set PageDescName during paste

In general, paste should not deal with page styles. In this case, it
even caused an additional page break.

Change-Id: Ia7c5a9ad844821b6622babfbd94469ec3c04cf0a
üst 2e08ed63
...@@ -75,6 +75,7 @@ $(eval $(call gb_CppunitTest_use_components,sw_rtfimport,\ ...@@ -75,6 +75,7 @@ $(eval $(call gb_CppunitTest_use_components,sw_rtfimport,\
unotools/util/utl \ unotools/util/utl \
unoxml/source/service/unoxml \ unoxml/source/service/unoxml \
writerfilter/util/writerfilter \ writerfilter/util/writerfilter \
xmloff/util/xo \
)) ))
$(eval $(call gb_CppunitTest_use_configuration,sw_rtfimport)) $(eval $(call gb_CppunitTest_use_configuration,sw_rtfimport))
......
{\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 }
...@@ -165,6 +165,7 @@ public: ...@@ -165,6 +165,7 @@ public:
void testGroupshapeRotation(); void testGroupshapeRotation();
void testFdo44715(); void testFdo44715();
void testFdo68076(); void testFdo68076();
void testFdo68291();
CPPUNIT_TEST_SUITE(Test); CPPUNIT_TEST_SUITE(Test);
#if !defined(MACOSX) && !defined(WNT) #if !defined(MACOSX) && !defined(WNT)
...@@ -315,6 +316,7 @@ void Test::run() ...@@ -315,6 +316,7 @@ void Test::run()
{"groupshape-rotation.rtf", &Test::testGroupshapeRotation}, {"groupshape-rotation.rtf", &Test::testGroupshapeRotation},
{"fdo44715.rtf", &Test::testFdo44715}, {"fdo44715.rtf", &Test::testFdo44715},
{"fdo68076.rtf", &Test::testFdo68076}, {"fdo68076.rtf", &Test::testFdo68076},
{"fdo68291.odt", &Test::testFdo68291},
}; };
header(); header();
for (unsigned int i = 0; i < SAL_N_ELEMENTS(aMethods); ++i) for (unsigned int i = 0; i < SAL_N_ELEMENTS(aMethods); ++i)
...@@ -1512,6 +1514,17 @@ void Test::testFdo68076() ...@@ -1512,6 +1514,17 @@ void Test::testFdo68076()
getParagraph(1, aExpected); 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_TEST_SUITE_REGISTRATION(Test);
CPPUNIT_PLUGIN_IMPLEMENT(); CPPUNIT_PLUGIN_IMPLEMENT();
......
...@@ -1084,7 +1084,7 @@ void SectionPropertyMap::CloseSectionGroup( DomainMapper_Impl& rDM_Impl ) ...@@ -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 */ 0 - No break 1 - New Column 2 - New page 3 - Even page 4 - odd page */
if ((m_bTitlePage && m_bIsFirstSection) || !m_bTitlePage) if ((m_bTitlePage && m_bIsFirstSection) || !m_bTitlePage)
{ {
if (xRangeProperties.is()) if (xRangeProperties.is() && rDM_Impl.IsNewDoc())
xRangeProperties->setPropertyValue(rPropNameSupplier.GetName( PROP_PAGE_DESC_NAME ), xRangeProperties->setPropertyValue(rPropNameSupplier.GetName( PROP_PAGE_DESC_NAME ),
uno::makeAny( m_bTitlePage ? m_sFirstPageStyleName : m_sFollowPageStyleName )); uno::makeAny( m_bTitlePage ? m_sFirstPageStyleName : m_sFollowPageStyleName ));
} }
......
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