summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@frugalware.org>2012-01-20 01:36:25 +0100
committerMiklos Vajna <vmiklos@frugalware.org>2012-01-20 01:38:03 +0100
commit370fc96b92e59d35c2eb2e14fd77eb14bfc72fd4 (patch)
treeab6f7fce22af37d5be6b402d588b5feb63f7ef7d
parentc571e8777d15fd1c3f8730a7c1325d75c746333d (diff)
Fix RTF import of dotted and word underline
The problem was that these are flags, not toggles.
-rw-r--r--writerfilter/source/rtftok/rtfdocumentimpl.cxx19
1 files changed, 16 insertions, 3 deletions
diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
index b2e2f7dcac4b..0a1fafbd489c 100644
--- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx
+++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
@@ -1450,6 +1450,21 @@ int RTFDocumentImpl::dispatchFlag(RTFKeyword nKeyword)
checkUnicode();
RTFSkipDestination aSkip(*this);
int nParam = -1;
+ int nSprm = -1;
+
+ // Map all underline flags to a single sprm.
+ switch (nKeyword)
+ {
+ case RTF_ULD: nSprm = 4; break;
+ case RTF_ULW: nSprm = 2; break;
+ default: break;
+ }
+ if (nSprm >= 0)
+ {
+ RTFValue::Pointer_t pValue(new RTFValue(nSprm));
+ m_aStates.top().aCharacterSprms->push_back(make_pair(NS_sprm::LN_CKul, pValue));
+ return 0;
+ }
// Indentation
switch (nKeyword)
@@ -2565,11 +2580,10 @@ int RTFDocumentImpl::dispatchToggle(RTFKeyword nKeyword, bool bParam, int nParam
int nSprm = -1;
RTFValue::Pointer_t pBoolValue(new RTFValue(!bParam || nParam != 0));
- // Map all underline keywords to a single sprm.
+ // Map all underline toggles to a single sprm.
switch (nKeyword)
{
case RTF_UL: nSprm = 1; break;
- case RTF_ULD: nSprm = 4; break;
case RTF_ULDASH: nSprm = 7; break;
case RTF_ULDASHD: nSprm = 9; break;
case RTF_ULDASHDD: nSprm = 10; break;
@@ -2583,7 +2597,6 @@ int RTFDocumentImpl::dispatchToggle(RTFKeyword nKeyword, bool bParam, int nParam
case RTF_ULTHDASHDD: nSprm = 26; break;
case RTF_ULTHLDASH: nSprm = 55; break;
case RTF_ULULDBWAVE: nSprm = 43; break;
- case RTF_ULW: nSprm = 2; break;
case RTF_ULWAVE: nSprm = 11; break;
default: break;
}