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

fix import of RTF_PARD inside RTF_SHPTXT

Change-Id: Id722b61cec9b8ae6550122e192affecadfcb1217
üst 76737b0f
{\rtf1
first par
\par
{\shp
{\*\shpinst\shpleft1371\shptop6712\shpright2453\shpbottom6887\shpfhdr0\shpbxpage\shpbxignore\shpbypara\shpbyignore\shpwr3\shpwrk0\shpfblwtxt0\shpz0\shplid1026
{\sp
{\sn shapeType}
{\sv 1}
}
{\shptxt \ltrpar
\pard\plain \ltrpar\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af31507\afs22\alang1025 \ltrch\fcs0 \fs22\lang1033\langfe1033\loch\af31506\hich\af31506\dbch\af31505\cgrid\langnp1033\langfenp1033
\rtlch\fcs1
\af0\afs16\alang1037 \ltrch\fcs0 \f0\fs16\insrsid11286377 \hich\af0\dbch\af31505\loch\f0 shape text
\par
}
}
}
second par\par
}
...@@ -115,6 +115,7 @@ public: ...@@ -115,6 +115,7 @@ public:
void testFdo52475(); void testFdo52475();
void testFdo55493(); void testFdo55493();
void testCopyPastePageStyle(); void testCopyPastePageStyle();
void testShptxtPard();
CPPUNIT_TEST_SUITE(Test); CPPUNIT_TEST_SUITE(Test);
#if !defined(MACOSX) && !defined(WNT) #if !defined(MACOSX) && !defined(WNT)
...@@ -169,6 +170,7 @@ public: ...@@ -169,6 +170,7 @@ public:
CPPUNIT_TEST(testFdo52475); CPPUNIT_TEST(testFdo52475);
CPPUNIT_TEST(testFdo55493); CPPUNIT_TEST(testFdo55493);
CPPUNIT_TEST(testCopyPastePageStyle); CPPUNIT_TEST(testCopyPastePageStyle);
CPPUNIT_TEST(testShptxtPard);
#endif #endif
CPPUNIT_TEST_SUITE_END(); CPPUNIT_TEST_SUITE_END();
...@@ -893,6 +895,16 @@ void Test::testCopyPastePageStyle() ...@@ -893,6 +895,16 @@ void Test::testCopyPastePageStyle()
CPPUNIT_ASSERT_EQUAL(sal_Int32(21001), getProperty<sal_Int32>(xPropertySet, "Width")); // Was letter, i.e. 21590 CPPUNIT_ASSERT_EQUAL(sal_Int32(21001), getProperty<sal_Int32>(xPropertySet, "Width")); // Was letter, i.e. 21590
} }
void Test::testShptxtPard()
{
// The problem was that \pard inside \shptxt caused loss of shape text
load("shptxt-pard.rtf");
uno::Reference<drawing::XDrawPageSupplier> xDrawPageSupplier(mxComponent, uno::UNO_QUERY);
uno::Reference<container::XIndexAccess> xDraws(xDrawPageSupplier->getDrawPage(), uno::UNO_QUERY);
uno::Reference<text::XText> xText(xDraws->getByIndex(0), uno::UNO_QUERY);
CPPUNIT_ASSERT_EQUAL(OUString("shape text"), xText->getString());
}
CPPUNIT_TEST_SUITE_REGISTRATION(Test); CPPUNIT_TEST_SUITE_REGISTRATION(Test);
CPPUNIT_PLUGIN_IMPLEMENT(); CPPUNIT_PLUGIN_IMPLEMENT();
......
...@@ -2001,7 +2001,8 @@ int RTFDocumentImpl::dispatchFlag(RTFKeyword nKeyword) ...@@ -2001,7 +2001,8 @@ int RTFDocumentImpl::dispatchFlag(RTFKeyword nKeyword)
m_aStates.top().aParagraphSprms = m_aDefaultState.aParagraphSprms; m_aStates.top().aParagraphSprms = m_aDefaultState.aParagraphSprms;
m_aStates.top().aParagraphAttributes = m_aDefaultState.aParagraphAttributes; m_aStates.top().aParagraphAttributes = m_aDefaultState.aParagraphAttributes;
m_aStates.top().resetFrame(); m_aStates.top().resetFrame();
m_pCurrentBuffer = 0; if (m_aStates.top().nDestinationState != DESTINATION_SHAPETEXT)
m_pCurrentBuffer = 0;
break; break;
case RTF_SECTD: case RTF_SECTD:
m_aStates.top().aSectionSprms = m_aDefaultState.aSectionSprms; m_aStates.top().aSectionSprms = m_aDefaultState.aSectionSprms;
......
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