diff options
author | László Németh <nemeth@numbertext.org> | 2019-02-20 12:32:21 +0100 |
---|---|---|
committer | László Németh <nemeth@numbertext.org> | 2019-02-21 10:51:45 +0100 |
commit | 4d32ad37b86200fe207dd1eda2bed11109b08d00 (patch) | |
tree | 54ea5133e54caa9e54fa94bc82963743fab283eb /writerfilter | |
parent | 30e7c7f2289cd59c36c00ba4defc52bf189ef77d (diff) |
tdf#123434 FILEOPEN: RTF: missing content in cells
Revert "tdf#122424 RTF import: ignore table row text outside the cells"
This reverts commit dc8fa612054363e1a871b0e413a59889fbdb156a.
Change-Id: Id68dc7ae55df013de64fb2d4955a412e4c046781
Reviewed-on: https://gerrit.libreoffice.org/68086
Reviewed-by: László Németh <nemeth@numbertext.org>
Tested-by: László Németh <nemeth@numbertext.org>
Diffstat (limited to 'writerfilter')
-rw-r--r-- | writerfilter/source/rtftok/rtfdispatchsymbol.cxx | 10 | ||||
-rw-r--r-- | writerfilter/source/rtftok/rtfdocumentimpl.cxx | 21 | ||||
-rw-r--r-- | writerfilter/source/rtftok/rtfdocumentimpl.hxx | 4 |
3 files changed, 3 insertions, 32 deletions
diff --git a/writerfilter/source/rtftok/rtfdispatchsymbol.cxx b/writerfilter/source/rtftok/rtfdispatchsymbol.cxx index 248b0a709bd0..e3b212a1dfdd 100644 --- a/writerfilter/source/rtftok/rtfdispatchsymbol.cxx +++ b/writerfilter/source/rtftok/rtfdispatchsymbol.cxx @@ -176,16 +176,7 @@ RTFError RTFDocumentImpl::dispatchSymbol(RTFKeyword nKeyword) case RTF_NESTCELL: { if (nKeyword == RTF_CELL) - { m_bAfterCellBeforeRow = true; - if (m_nCellsInRow != -1) - m_nCellsInRow++; - } - else - { - // in the case of nested tables, disable ignoring row text outside of cell content - m_nCellsInRow = -1; - } checkFirstRun(); if (m_bNeedPap) @@ -241,7 +232,6 @@ RTFError RTFDocumentImpl::dispatchSymbol(RTFKeyword nKeyword) case RTF_ROW: { m_bAfterCellBeforeRow = false; - m_nActualCellInRow = 0; if (m_aStates.top().nTableRowWidthAfter > 0) { // Add fake cellx / cell, RTF equivalent of diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx b/writerfilter/source/rtftok/rtfdocumentimpl.cxx index 9e2d9fea060b..2d2d63ca5a4e 100644 --- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx +++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx @@ -301,8 +301,6 @@ RTFDocumentImpl::RTFDocumentImpl(uno::Reference<uno::XComponentContext> const& x , m_hasRFooter(false) , m_hasFFooter(false) , m_bAfterCellBeforeRow(false) - , m_nCellsInRow(0) - , m_nActualCellInRow(0) { OSL_ASSERT(xInputStream.is()); m_pInStream = utl::UcbStreamHelper::CreateStream(xInputStream, true); @@ -1481,12 +1479,6 @@ void RTFDocumentImpl::text(OUString& rString) RTFBuffer_t* pCurrentBuffer = m_aStates.top().pCurrentBuffer; - if (m_nActualCellInRow > 0) - { - m_nActualCellInRow = 0; - m_nCellsInRow = 0; - } - if (!pCurrentBuffer && m_aStates.top().eDestination != Destination::FOOTNOTE) Mapper().startCharacterGroup(); else if (pCurrentBuffer) @@ -1628,7 +1620,6 @@ void RTFDocumentImpl::replayBuffer(RTFBuffer_t& rBuffer, RTFSprms* const pSprms, } else if (std::get<0>(aTuple) == BUFFER_CELLEND) { - m_nActualCellInRow++; assert(pSprms && pAttributes); auto pValue = new RTFValue(1); pSprms->set(NS_ooxml::LN_tblCell, pValue); @@ -1647,15 +1638,9 @@ void RTFDocumentImpl::replayBuffer(RTFBuffer_t& rBuffer, RTFSprms* const pSprms, } else if (std::get<0>(aTuple) == BUFFER_UTEXT) { - // ignore text outside the cell content in table rows - // except in the case of nested tables - if (m_nActualCellInRow == 0 || m_nActualCellInRow < m_nCellsInRow - || m_nCellsInRow == -1) - { - OUString const aString(std::get<1>(aTuple)->getString()); - Mapper().utext(reinterpret_cast<sal_uInt8 const*>(aString.getStr()), - aString.getLength()); - } + OUString const aString(std::get<1>(aTuple)->getString()); + Mapper().utext(reinterpret_cast<sal_uInt8 const*>(aString.getStr()), + aString.getLength()); } else if (std::get<0>(aTuple) == BUFFER_ENDRUN) Mapper().endCharacterGroup(); diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.hxx b/writerfilter/source/rtftok/rtfdocumentimpl.hxx index 25928dfd073e..cb957ef975b8 100644 --- a/writerfilter/source/rtftok/rtfdocumentimpl.hxx +++ b/writerfilter/source/rtftok/rtfdocumentimpl.hxx @@ -811,10 +811,6 @@ private: /// Are we after a \cell, but before a \row? bool m_bAfterCellBeforeRow; - /// cells in row, to ignore extra text content of the row - int m_nCellsInRow; - /// actual cell in row - int m_nActualCellInRow; }; } // namespace rtftok } // namespace writerfilter |