summaryrefslogtreecommitdiff
path: root/writerfilter
diff options
context:
space:
mode:
authorZolnai Tamás <zolnaitamas2000@gmail.com>2013-09-08 10:46:12 +0200
committerZolnai Tamás <zolnaitamas2000@gmail.com>2013-09-08 11:23:46 +0200
commit05e1439107deacb8416c9aee1b6fb2c72a171eaf (patch)
tree333dc102d1faf5144b859e964b4a534f25e2f508 /writerfilter
parentcfc64c7e895d990023400573d8416ce80cf0da29 (diff)
CharBrd 9.3: RTF filters
-Use sprm:CBrc attribute for all MS filter (for ooxml too). -Extract general code to FormatCharBorder() method, it selects the border side and decides whether add shadow to the border. -RTF export has a color table, which must be filled with border colors before the actual export.temp Change-Id: Ic3ceae6e19ddc2ed5aaa8de85617f9a592289b4f
Diffstat (limited to 'writerfilter')
-rw-r--r--writerfilter/source/rtftok/rtfdocumentimpl.cxx17
-rw-r--r--writerfilter/source/rtftok/rtfdocumentimpl.hxx3
2 files changed, 19 insertions, 1 deletions
diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
index b0835e1b0573..d73c5bd600fe 100644
--- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx
+++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
@@ -140,6 +140,15 @@ static void lcl_putBorderProperty(std::stack<RTFParserState>& aStates, Id nId, R
rAttributes.set(nId, pValue);
}
}
+ else if (aStates.top().nBorderState == BORDER_CHARACTER)
+ {
+ RTFValue::Pointer_t pPointer = aStates.top().aCharacterSprms.find(NS_ooxml::LN_EG_RPrBase_bdr);
+ if (pPointer.get())
+ {
+ RTFSprms& rAttributes = pPointer->getAttributes();
+ rAttributes.set(nId, pValue);
+ }
+ }
// Attributes of the last border type
else if (aStates.top().nBorderState == BORDER_PARAGRAPH)
pAttributes = &lcl_getLastAttributes(aStates.top().aParagraphSprms, NS_ooxml::LN_CT_PrBase_pBdr);
@@ -2414,6 +2423,14 @@ int RTFDocumentImpl::dispatchFlag(RTFKeyword nKeyword)
m_aStates.top().nBorderState = BORDER_PARAGRAPH;
}
break;
+ case RTF_CHBRDR:
+ {
+ RTFSprms aAttributes;
+ RTFValue::Pointer_t pValue(new RTFValue(aAttributes));
+ m_aStates.top().aCharacterSprms.set(NS_ooxml::LN_EG_RPrBase_bdr, pValue);
+ m_aStates.top().nBorderState = BORDER_CHARACTER;
+ }
+ break;
case RTF_CLVMGF:
{
RTFValue::Pointer_t pValue(new RTFValue(NS_ooxml::LN_Value_ST_Merge_restart));
diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.hxx b/writerfilter/source/rtftok/rtfdocumentimpl.hxx
index 276ca933a6c5..a0b1076f3a03 100644
--- a/writerfilter/source/rtftok/rtfdocumentimpl.hxx
+++ b/writerfilter/source/rtftok/rtfdocumentimpl.hxx
@@ -36,7 +36,8 @@ namespace writerfilter {
BORDER_PARAGRAPH,
BORDER_PARAGRAPH_BOX,
BORDER_CELL,
- BORDER_PAGE
+ BORDER_PAGE,
+ BORDER_CHARACTER
};
/// Minimalistic buffer of elements for nested cells.