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

bnc#823655 RTF import: ignore styles without a type

Regression from 29dcdf6b.

Change-Id: I970c0e7b3652d7e6f093815b90e04e0c45904b28
üst 1b3692c6
{\rtf1
{\stylesheet
{\ql \li0\ri0\sa200\sl276\slmult1
\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \af31507\afs22\alang1025 \ltrch\fcs0 \fs22\lang4105\langfe4105\loch\f31506\hich\af31506\dbch\af31505\cgrid\langnp4105\langfenp4105 \snext0 \sqformat \spriority0 Normal;}
{\*\cs10 \additive \ssemihidden \sunhideused \spriority1 Default Paragraph Font;}
{\*
\ts11\tsrowd\trftsWidthB3\trpaddl108\trpaddr108\trpaddfl3\trpaddft3\trpaddfb3\trpaddfr3\trcbpat1\trcfpat1\tblind0\tblindtype3\tsvertalt\tsbrdrt\tsbrdrl\tsbrdrb\tsbrdrr\tsbrdrdgl\tsbrdrdgr\tsbrdrh\tsbrdrv \ql \li0\ri0\sa200\sl276\slmult1
\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \af31507\afs22\alang1025 \ltrch\fcs0 \fs22\lang4105\langfe4105\loch\f31506\hich\af31506\dbch\af31505\cgrid\langnp4105\langfenp4105 \snext11 \ssemihidden \sunhideused
Normal Table;}
}
\pard \ltrpar\ql \li720\ri0\sb1\sl-179\slmult0\nowidctlpar\tx9924\wrapdefault\faauto\rin0\lin720\itap0
{\rtlch\fcs1 \af0\afs16 \ltrch\fcs0 \f0\fs16\expnd-1\expndtw-5\cf1\insrsid10962741 \hich\af0\dbch\af31505\loch\f0 hello
\par }
}
...@@ -143,6 +143,7 @@ public: ...@@ -143,6 +143,7 @@ public:
void testFdo62044(); void testFdo62044();
void testPoshPosv(); void testPoshPosv();
void testN825305(); void testN825305();
void testParaBottomMargin();
CPPUNIT_TEST_SUITE(Test); CPPUNIT_TEST_SUITE(Test);
#if !defined(MACOSX) && !defined(WNT) #if !defined(MACOSX) && !defined(WNT)
...@@ -273,6 +274,7 @@ void Test::run() ...@@ -273,6 +274,7 @@ void Test::run()
{"fdo62044.rtf", &Test::testFdo62044}, {"fdo62044.rtf", &Test::testFdo62044},
{"posh-posv.rtf", &Test::testPoshPosv}, {"posh-posv.rtf", &Test::testPoshPosv},
{"n825305.rtf", &Test::testN825305}, {"n825305.rtf", &Test::testN825305},
{"para-bottom-margin.rtf", &Test::testParaBottomMargin},
}; };
header(); header();
for (unsigned int i = 0; i < SAL_N_ELEMENTS(aMethods); ++i) for (unsigned int i = 0; i < SAL_N_ELEMENTS(aMethods); ++i)
...@@ -1298,6 +1300,12 @@ void Test::testN825305() ...@@ -1298,6 +1300,12 @@ void Test::testN825305()
CPPUNIT_ASSERT_EQUAL(beans::PropertyState_DIRECT_VALUE, ePropertyState); CPPUNIT_ASSERT_EQUAL(beans::PropertyState_DIRECT_VALUE, ePropertyState);
} }
void Test::testParaBottomMargin()
{
// This was 353, i.e. bottom margin of the paragraph was 0.35cm instead of 0.
CPPUNIT_ASSERT_EQUAL(sal_Int32(0), getProperty<sal_Int32>(getParagraph(1), "ParaBottomMargin"));
}
CPPUNIT_TEST_SUITE_REGISTRATION(Test); CPPUNIT_TEST_SUITE_REGISTRATION(Test);
CPPUNIT_PLUGIN_IMPLEMENT(); CPPUNIT_PLUGIN_IMPLEMENT();
......
...@@ -1028,6 +1028,7 @@ void RTFDocumentImpl::text(OUString& rString) ...@@ -1028,6 +1028,7 @@ void RTFDocumentImpl::text(OUString& rString)
break; break;
case DESTINATION_STYLESHEET: case DESTINATION_STYLESHEET:
case DESTINATION_STYLEENTRY: case DESTINATION_STYLEENTRY:
if (m_aStates.top().aTableAttributes.find(NS_rtf::LN_SGC))
{ {
RTFValue::Pointer_t pValue(new RTFValue(m_aStates.top().aDestinationText.makeStringAndClear())); RTFValue::Pointer_t pValue(new RTFValue(m_aStates.top().aDestinationText.makeStringAndClear()));
m_aStates.top().aTableAttributes.set(NS_rtf::LN_XSTZNAME1, pValue); m_aStates.top().aTableAttributes.set(NS_rtf::LN_XSTZNAME1, pValue);
...@@ -1037,6 +1038,8 @@ void RTFDocumentImpl::text(OUString& rString) ...@@ -1037,6 +1038,8 @@ void RTFDocumentImpl::text(OUString& rString)
); );
m_aStyleTableEntries.insert(make_pair(m_nCurrentStyleIndex, pProp)); m_aStyleTableEntries.insert(make_pair(m_nCurrentStyleIndex, pProp));
} }
else
SAL_INFO("writerfilter", "no RTF style type defined, ignoring");
break; break;
case DESTINATION_REVISIONTABLE: case DESTINATION_REVISIONTABLE:
case DESTINATION_REVISIONENTRY: case DESTINATION_REVISIONENTRY:
......
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