diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2016-04-23 20:34:57 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2016-04-28 07:45:15 +0000 |
commit | b94d753ac9e3894da055d31bbb7bb20e11b97b5a (patch) | |
tree | ce338cefa0b09ec94f92dff09e0bad423258dac1 /writerfilter | |
parent | 12694155608762056d5cbf0f89dd1675a7aefb45 (diff) |
Related: tdf#65642 RTF filter: import \pgndec
This as a side effect also implements support for DOCX <w:pgNumType
w:fmt="decimal" .../>.
Change-Id: I747c3f610dc13f614b6f962c2a498c987765ebb6
Reviewed-on: https://gerrit.libreoffice.org/24457
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Jenkins <ci@libreoffice.org>
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 6a9cc8f0d8c0..acc320af7c83 100644 --- a/writerfilter/source/dmapper/DomainMapper.cxx +++ b/writerfilter/source/dmapper/DomainMapper.cxx @@ -989,6 +989,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 459f0a1076dd..9559e8d832f0 100644 --- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx +++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx @@ -3281,7 +3281,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. @@ -3623,6 +3622,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) << "'"); |