summaryrefslogtreecommitdiff
path: root/writerfilter/source/rtftok/rtfdispatchflag.cxx
diff options
context:
space:
mode:
authorJustin Luth <justin.luth@collabora.com>2023-12-01 14:30:45 -0500
committerMiklos Vajna <vmiklos@collabora.com>2023-12-05 08:49:33 +0100
commitb63a12d481cd26f960f97f74e5a4d764966db338 (patch)
tree97a9141d207e7da5749bdda36f002844c27b7693 /writerfilter/source/rtftok/rtfdispatchflag.cxx
parentcaecfff1adbe9715260ef9e2009333e523d61123 (diff)
tdf#148540 Revert "tdf#109790 RTF import: keep remembering...
... paragraph style between \cell and \row" This reverts 5.4.1 commit aaa6a5202a447fb4e86d5f016d8e79fbc34a3ed7, and rtfexport7's tdf109790.rtf unit test still passes. I also did a visual test, which looks good. After \cell, we normally get more \cells, so an impending \row is completely unexpected most of the time. I'm not really sure why that patch was ever thought to be good. The problem was that \pard was not removing the paragraph style that was assigned to an earlier column. The end result seemed innocent (no bad formatting noticed), but that is probably based on other work done in the meantime which allows the unit test to still pass even after all of "its code" has been reverted. [If this causes a regression, perhaps m_pLastCharacterContext could be of value?] Change-Id: Ide9b65f5e5fa39c21bac6d8ed354bb88e0bbefe5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160233 Tested-by: Jenkins Reviewed-by: Justin Luth <jluth@mail.com>
Diffstat (limited to 'writerfilter/source/rtftok/rtfdispatchflag.cxx')
-rw-r--r--writerfilter/source/rtftok/rtfdispatchflag.cxx9
1 files changed, 1 insertions, 8 deletions
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.