diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2016-04-23 20:34:57 +0200 |
---|---|---|
committer | Andras Timar <andras.timar@collabora.com> | 2016-06-11 15:01:43 +0200 |
commit | 278967e03360f78796ec7eff38c8dfd91e1ec107 (patch) | |
tree | 15c8de2269bdeca40a97a394631e7111c704374f /writerfilter | |
parent | fe932b941d3b1df2ffdbe3a3c3227c41ad12beca (diff) |
Related: tdf#65642 RTF filter: import \pgndec
This as a side effect also implements support for DOCX <w:pgNumType
w:fmt="decimal" .../>.
Reviewed-on: https://gerrit.libreoffice.org/24457
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Jenkins <ci@libreoffice.org>
(cherry picked from commit b94d753ac9e3894da055d31bbb7bb20e11b97b5a)
Change-Id: I747c3f610dc13f614b6f962c2a498c987765ebb6
Diffstat (limited to 'writerfilter')
-rw-r--r-- | writerfilter/source/dmapper/DomainMapper.cxx | 4 | ||||
-rw-r--r-- | writerfilter/source/rtftok/rtfdocumentimpl.cxx | 7 |
2 files changed, 10 insertions, 1 deletions
diff --git a/writerfilter/source/dmapper/DomainMapper.cxx b/writerfilter/source/dmapper/DomainMapper.cxx index 22a9653d6e36..f00326dcdd8b 100644 --- a/writerfilter/source/dmapper/DomainMapper.cxx +++ b/writerfilter/source/dmapper/DomainMapper.cxx @@ -969,6 +969,10 @@ void DomainMapper::lcl_attribute(Id nName, Value & val) { switch (nIntValue) { + case NS_ooxml::LN_Value_ST_NumberFormat_decimal: + // 1, 2, ... + pSectionContext->SetPageNumberType(style::NumberingType::ARABIC); + break; case NS_ooxml::LN_Value_ST_NumberFormat_upperLetter: // A, B, ... pSectionContext->SetPageNumberType(style::NumberingType::CHARS_UPPER_LETTER_N); diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx b/writerfilter/source/rtftok/rtfdocumentimpl.cxx index 42377c2133c8..a80980262f97 100644 --- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx +++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx @@ -3286,7 +3286,6 @@ RTFError RTFDocumentImpl::dispatchFlag(RTFKeyword nKeyword) m_aStates.top().aSectionSprms.set(NS_ooxml::LN_EG_SectPrContents_formProt, pValue); } break; - case RTF_PGNDEC: case RTF_PGNBIDIA: case RTF_PGNBIDIB: // These should be mapped to NS_ooxml::LN_EG_SectPrContents_pgNumType, but dmapper has no API for that at the moment. @@ -3628,6 +3627,12 @@ RTFError RTFDocumentImpl::dispatchFlag(RTFKeyword nKeyword) lcl_putNestedAttribute(m_aStates.top().aSectionSprms, NS_ooxml::LN_EG_SectPrContents_pgNumType, NS_ooxml::LN_CT_PageNumber_fmt, pIntValue); } break; + case RTF_PGNDEC: + { + auto pIntValue = std::make_shared<RTFValue>(NS_ooxml::LN_Value_ST_NumberFormat_decimal); + lcl_putNestedAttribute(m_aStates.top().aSectionSprms, NS_ooxml::LN_EG_SectPrContents_pgNumType, NS_ooxml::LN_CT_PageNumber_fmt, pIntValue); + } + break; default: { SAL_INFO("writerfilter", "TODO handle flag '" << lcl_RtfToString(nKeyword) << "'"); |