summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfvroman <fvroman@linagora.com>2017-03-30 18:32:31 +0200
committerBevilacqua Jean-Sebastien <realitix@gmail.com>2018-05-14 10:58:52 +0200
commitb64679d5c804020e2a269c5aee67aa5390d89307 (patch)
treee5019a2efcfcc1b5444ee06023693ac8184720d9
parent2a81a01374d7aac7cab3e9df5fe245e9a38b6a42 (diff)
RTF fixes: Port LO 4.3.7.2 Linagora patch
0004-2014011410000016-import-rtf-sautpage-orientation.patch
-rw-r--r--writerfilter/source/rtftok/rtfdispatchsymbol.cxx1
-rw-r--r--writerfilter/source/rtftok/rtfdispatchvalue.cxx5
-rw-r--r--writerfilter/source/rtftok/rtfdocumentimpl.cxx3
-rw-r--r--writerfilter/source/rtftok/rtfdocumentimpl.hxx1
4 files changed, 10 insertions, 0 deletions
diff --git a/writerfilter/source/rtftok/rtfdispatchsymbol.cxx b/writerfilter/source/rtftok/rtfdispatchsymbol.cxx
index 68c43c40cefe..6b9e9c3ac0d7 100644
--- a/writerfilter/source/rtftok/rtfdispatchsymbol.cxx
+++ b/writerfilter/source/rtftok/rtfdispatchsymbol.cxx
@@ -99,6 +99,7 @@ RTFError RTFDocumentImpl::dispatchSymbol(RTFKeyword nKeyword)
{
if (m_aStates.top().eDestination == Destination::FOOTNOTESEPARATOR)
break; // just ignore it - only thing we read in here is CHFTNSEP
+ m_bNeedTableBreak = false;
checkFirstRun();
bool bNeedPap = m_bNeedPap;
checkNeedPap();
diff --git a/writerfilter/source/rtftok/rtfdispatchvalue.cxx b/writerfilter/source/rtftok/rtfdispatchvalue.cxx
index 3e1fd25b7b6a..445e9f3ca9aa 100644
--- a/writerfilter/source/rtftok/rtfdispatchvalue.cxx
+++ b/writerfilter/source/rtftok/rtfdispatchvalue.cxx
@@ -793,6 +793,11 @@ RTFError RTFDocumentImpl::dispatchValue(RTFKeyword nKeyword, int nParam)
break;
case RTF_CELLX:
{
+ if(m_bNeedTableBreak && !m_bFirstRun)
+ dispatchSymbol(RTF_PAR);
+
+ m_bNeedTableBreak = false;
+
int& rCurrentCellX((Destination::NESTEDTABLEPROPERTIES == m_aStates.top().eDestination) ? m_nNestedCurrentCellX : m_nTopLevelCurrentCellX);
int nCellX = nParam - rCurrentCellX;
const int COL_DFLT_WIDTH = 41; // sw/source/filter/inc/wrtswtbl.hxx, minimal possible width of cells.
diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
index af8ef382b53a..a929a5423b1b 100644
--- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx
+++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
@@ -259,6 +259,7 @@ RTFDocumentImpl::RTFDocumentImpl(uno::Reference<uno::XComponentContext> const& x
m_bNeedCrOrig(false),
m_bNeedPar(true),
m_bNeedFinalPar(false),
+ m_bNeedTableBreak(false),
m_nNestedCells(0),
m_nTopLevelCells(0),
m_nInheritingCells(0),
@@ -628,6 +629,8 @@ void RTFDocumentImpl::sectBreak(bool bFinal)
Mapper().endSectionGroup();
m_bNeedPar = false;
m_bNeedSect = false;
+
+ m_bNeedTableBreak = true;
}
sal_uInt32 RTFDocumentImpl::getColorTable(sal_uInt32 nIndex)
diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.hxx b/writerfilter/source/rtftok/rtfdocumentimpl.hxx
index 06c9ba62ffeb..03ca21dbd87c 100644
--- a/writerfilter/source/rtftok/rtfdocumentimpl.hxx
+++ b/writerfilter/source/rtftok/rtfdocumentimpl.hxx
@@ -528,6 +528,7 @@ private:
bool m_bFirstRun;
/// If paragraph properties should be emitted on next run.
bool m_bNeedPap;
+ bool m_bNeedTableBreak;
/// If we need to emit a CR at the end of substream.
bool m_bNeedCr;
/// Original value of m_bNeedCr -- saved/restored before/after textframes.