diff --git a/sw/qa/extras/rtfexport/rtfexport6.cxx b/sw/qa/extras/rtfexport/rtfexport6.cxx index f4ff562c37e8..e65e57fd3192 100644 --- a/sw/qa/extras/rtfexport/rtfexport6.cxx +++ b/sw/qa/extras/rtfexport/rtfexport6.cxx @@ -172,6 +172,8 @@ DECLARE_RTFEXPORT_TEST(testTdf108505_fieldCharFormat, "tdf108505_fieldCharFormat CPPUNIT_ASSERT_EQUAL(awt::FontWeight::BOLD, getProperty(xRun, "CharWeight")); CPPUNIT_ASSERT_EQUAL(awt::FontSlant_NONE, getProperty(xRun, "CharPosture")); CPPUNIT_ASSERT_EQUAL(COL_LIGHTGREEN, getProperty(xRun, "CharColor")); + + CPPUNIT_ASSERT_EQUAL(OUString("Standard"), getProperty(xPara, "ParaStyleName")); } DECLARE_RTFEXPORT_TEST(testTdf108505_fieldCharFormat2, "tdf108505_fieldCharFormat2.rtf") diff --git a/writerfilter/source/rtftok/rtfdispatchflag.cxx b/writerfilter/source/rtftok/rtfdispatchflag.cxx index 23d8f5d1f59f..72c777aab1fb 100644 --- a/writerfilter/source/rtftok/rtfdispatchflag.cxx +++ b/writerfilter/source/rtftok/rtfdispatchflag.cxx @@ -579,8 +579,6 @@ RTFError RTFDocumentImpl::dispatchFlag(RTFKeyword nKeyword) dispatchSymbol(RTFKeyword::PAR); // \pard is allowed between \cell and \row, but in that case it should not reset the fact that we're inside a table. // It should not reset the paragraph style, either, so remember the old paragraph style. - RTFValue::Pointer_t pOldStyle - = m_aStates.top().getParagraphSprms().find(NS_ooxml::LN_CT_PPrBase_pStyle); m_aStates.top().getParagraphSprms() = m_aDefaultState.getParagraphSprms(); m_aStates.top().getParagraphAttributes() = m_aDefaultState.getParagraphAttributes(); @@ -593,19 +591,14 @@ RTFError RTFDocumentImpl::dispatchFlag(RTFKeyword nKeyword) { // We are still in a table. m_aStates.top().getParagraphSprms().set(NS_ooxml::LN_inTbl, new RTFValue(1)); - if (m_bAfterCellBeforeRow && pOldStyle) - // And we still have the same paragraph style. - m_aStates.top().getParagraphSprms().set(NS_ooxml::LN_CT_PPrBase_pStyle, - pOldStyle); // Ideally getDefaultSPRM() would take care of this, but it would not when we're buffering. m_aStates.top().getParagraphSprms().set(NS_ooxml::LN_CT_PPrBase_tabs, new RTFValue()); } resetFrame(); - // Reset currently selected paragraph style as well, unless we are in the special "after \cell, before \row" state. + // Reset currently selected paragraph style as well. // By default the style with index 0 is applied. - if (!m_bAfterCellBeforeRow) { OUString const aName = getStyleName(0); // But only in case it's not a character style. diff --git a/writerfilter/source/rtftok/rtfdispatchsymbol.cxx b/writerfilter/source/rtftok/rtfdispatchsymbol.cxx index d5b196790a50..61499aac04b5 100644 --- a/writerfilter/source/rtftok/rtfdispatchsymbol.cxx +++ b/writerfilter/source/rtftok/rtfdispatchsymbol.cxx @@ -180,9 +180,6 @@ RTFError RTFDocumentImpl::dispatchSymbol(RTFKeyword nKeyword) case RTFKeyword::CELL: case RTFKeyword::NESTCELL: { - if (nKeyword == RTFKeyword::CELL) - m_bAfterCellBeforeRow = true; - checkFirstRun(); if (m_bNeedPap) { @@ -236,7 +233,6 @@ RTFError RTFDocumentImpl::dispatchSymbol(RTFKeyword nKeyword) break; case RTFKeyword::ROW: { - m_bAfterCellBeforeRow = false; if (m_aStates.top().getTableRowWidthAfter() > 0) { // Add fake cellx / cell, RTF equivalent of diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx b/writerfilter/source/rtftok/rtfdocumentimpl.cxx index 76ab50135427..79b12dc0c7dd 100644 --- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx +++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx @@ -330,7 +330,6 @@ RTFDocumentImpl::RTFDocumentImpl(uno::Reference const& x , m_hasFHeader(false) , m_hasRFooter(false) , m_hasFFooter(false) - , m_bAfterCellBeforeRow(false) { OSL_ASSERT(xInputStream.is()); m_pInStream = utl::UcbStreamHelper::CreateStream(xInputStream, true); diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.hxx b/writerfilter/source/rtftok/rtfdocumentimpl.hxx index 47fedc431bfb..091739888089 100644 --- a/writerfilter/source/rtftok/rtfdocumentimpl.hxx +++ b/writerfilter/source/rtftok/rtfdocumentimpl.hxx @@ -988,9 +988,6 @@ private: bool m_hasFHeader; bool m_hasRFooter; bool m_hasFFooter; - - /// Are we after a \cell, but before a \row? - bool m_bAfterCellBeforeRow; }; } // namespace writerfilter::rtftok