diff options
author | Miklos Vajna <vmiklos@collabora.com> | 2020-03-19 17:54:26 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.com> | 2020-03-19 21:28:38 +0100 |
commit | 52ed1091be05d5a07a021403095c52f0f3986ed6 (patch) | |
tree | 9cf9171625c5ebb6ab27018b2417c14ef99d023d /writerfilter/source/dmapper/NumberingManager.cxx | |
parent | 4054a30e2b2fa254dfb20718ce757ceb2f638fd5 (diff) |
sw pad-to-3 numbering: add DOCX filter
There is no NS_ooxml::LN_Value_ST_NumberFormat_foo code for this on the
import side, rather the number format code is set to
NS_ooxml::LN_Value_ST_NumberFormat_custom, then a separate
NS_ooxml::LN_CT_NumFmt_format contains the number format string.
Declare w14 as an XML namespace on the export side, even if we write no
<w14:something> elements. This is needed by <mc:Choice Requires="w14">,
which refers to an XML namespace in the OOXML markup. (Interestingly
officeotron doesn't check for this, though.)
Change-Id: If5fbcea4f163bd4d1a1ed820e15ceb61dc9c0519
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90761
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins
Diffstat (limited to 'writerfilter/source/dmapper/NumberingManager.cxx')
-rw-r--r-- | writerfilter/source/dmapper/NumberingManager.cxx | 25 |
1 files changed, 22 insertions, 3 deletions
diff --git a/writerfilter/source/dmapper/NumberingManager.cxx b/writerfilter/source/dmapper/NumberingManager.cxx index 9c337708d255..3c927b828a2a 100644 --- a/writerfilter/source/dmapper/NumberingManager.cxx +++ b/writerfilter/source/dmapper/NumberingManager.cxx @@ -125,6 +125,8 @@ void ListLevel::SetValue( Id nId, sal_Int32 nValue ) m_bHasValues = true; } +void ListLevel::SetCustomNumberFormat(const OUString& rValue) { m_aCustomNumberFormat = rValue; } + bool ListLevel::HasValues() const { return m_bHasValues; @@ -235,7 +237,15 @@ uno::Sequence<beans::PropertyValue> ListLevel::GetLevelProperties(bool bDefaults if( m_nIStartAt >= 0) aNumberingProperties.push_back(lcl_makePropVal<sal_Int16>(PROP_START_WITH, m_nIStartAt) ); - sal_Int16 nNumberFormat = ConversionHelper::ConvertNumberingType(m_nNFC); + sal_Int16 nNumberFormat = -1; + if (m_nNFC == NS_ooxml::LN_Value_ST_NumberFormat_custom) + { + nNumberFormat = ConversionHelper::ConvertCustomNumberFormat(m_aCustomNumberFormat); + } + else + { + nNumberFormat = ConversionHelper::ConvertNumberingType(m_nNFC); + } if( m_nNFC >= 0) { if (m_xGraphicBitmap.is()) @@ -743,8 +753,17 @@ void ListsManager::lcl_attribute( Id nName, Value& rVal ) case NS_ooxml::LN_CT_Lvl_isLgl: case NS_ooxml::LN_CT_Lvl_legacy: if ( pCurrentLvl.get( ) ) - pCurrentLvl->SetValue( nName, sal_Int32( nIntValue ) ); - break; + { + if (nName == NS_ooxml::LN_CT_NumFmt_format) + { + pCurrentLvl->SetCustomNumberFormat(rVal.getString()); + } + else + { + pCurrentLvl->SetValue(nName, sal_Int32(nIntValue)); + } + } + break; case NS_ooxml::LN_CT_Num_numId: m_pCurrentDefinition->SetId( rVal.getString().toInt32( ) ); break; |