diff options
author | Zolnai Tamás <zolnaitamas2000@gmail.com> | 2013-09-08 10:46:12 +0200 |
---|---|---|
committer | Zolnai Tamás <zolnaitamas2000@gmail.com> | 2013-09-08 11:23:46 +0200 |
commit | 05e1439107deacb8416c9aee1b6fb2c72a171eaf (patch) | |
tree | 333dc102d1faf5144b859e964b4a534f25e2f508 /writerfilter | |
parent | CharBrd 9.2: DOCX filters (diff) | |
download | core-05e1439107deacb8416c9aee1b6fb2c72a171eaf.tar.gz core-05e1439107deacb8416c9aee1b6fb2c72a171eaf.zip |
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.cxx | 17 | ||||
-rw-r--r-- | writerfilter/source/rtftok/rtfdocumentimpl.hxx | 3 |
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. |