[PATCH] fdo#45190 import of RTF_LI should reset inherited RTF_FI
Miklos Vajna
vmiklos at suse.cz
Fri May 11 05:45:59 PDT 2012
Change-Id: I17c287fa4daa399876b34182c02d9cf928fe1b6f
---
writerfilter/source/rtftok/rtfdocumentimpl.cxx | 8 +++++++-
1 files changed, 7 insertions(+), 1 deletions(-)
diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
index 1250855..063d94b 100644
--- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx
+++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
@@ -2232,7 +2232,6 @@ int RTFDocumentImpl::dispatchValue(RTFKeyword nKeyword, int nParam)
switch (nKeyword)
{
case RTF_FI: nSprm = NS_sprm::LN_PDxaLeft1; break;
- case RTF_LI: nSprm = NS_sprm::LN_PDxaLeft; break;
case RTF_LIN: nSprm = 0x845e; break;
case RTF_RI: nSprm = NS_sprm::LN_PDxaRight; break;
case RTF_RIN: nSprm = 0x845d; break;
@@ -2847,6 +2846,13 @@ int RTFDocumentImpl::dispatchValue(RTFKeyword nKeyword, int nParam)
m_aStates.top().nInternalState = INTERNAL_BIN;
m_aStates.top().nBinaryToRead = nParam;
break;
+ case RTF_LI:
+ m_aStates.top().aParagraphSprms->push_back(make_pair(NS_sprm::LN_PDxaLeft, pIntValue));
+ // It turns out \li should reset the \fi inherited from the stylesheet.
+ // So set the direct formatting to zero, if we don't have such direct formatting yet.
+ if (!m_aStates.top().aParagraphSprms.find(NS_sprm::LN_PDxaLeft1).get())
+ m_aStates.top().aParagraphSprms->push_back(make_pair(NS_sprm::LN_PDxaLeft1, RTFValue::Pointer_t(new RTFValue(0))));
+ break;
default:
#if OSL_DEBUG_LEVEL > 1
OSL_TRACE("%s: TODO handle value '%s'", OSL_THIS_FUNC, lcl_RtfToString(nKeyword));
--
1.7.7
--O5XBE6gyVG5Rl6Rj--
More information about the LibreOffice
mailing list