diff options
author | Miklos Vajna <vmiklos@suse.cz> | 2012-06-26 12:36:32 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@suse.cz> | 2012-06-26 12:39:20 +0200 |
commit | 89f208c0f634f3e6fb909c6f1510b0e4c31871f7 (patch) | |
tree | b2b768cfca96d81a67e8912e25bc3958aafce53c /writerfilter | |
parent | 6f93ad70a850e4a993565b9d02599d57ac06b8ec (diff) |
n#766487 dmapper: FirstLineIndent should be always inherited from numbering
Change-Id: I1eb5946d23cd3ff635d436adbd59bf007333aa60
Diffstat (limited to 'writerfilter')
-rw-r--r-- | writerfilter/source/dmapper/DomainMapper.cxx | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/writerfilter/source/dmapper/DomainMapper.cxx b/writerfilter/source/dmapper/DomainMapper.cxx index 45dd5d3aed9b..5ecceba11cc5 100644 --- a/writerfilter/source/dmapper/DomainMapper.cxx +++ b/writerfilter/source/dmapper/DomainMapper.cxx @@ -1043,8 +1043,44 @@ void DomainMapper::lcl_attribute(Id nName, Value & val) case NS_ooxml::LN_CT_Ind_start: case NS_ooxml::LN_CT_Ind_left: if (m_pImpl->GetTopContext()) + { + // Word inherits FirstLineIndent property of the numbering, even if ParaLeftMargin is set, Writer does not. + // So copy it explicitly, if necessary. + PropertyMapPtr pContext = m_pImpl->GetTopContext(); + sal_Int32 nFirstLineIndent = 0; + + // See if we have a FirstLineIndent + PropertyMap::iterator it = pContext->find(PropertyDefinition( PROP_NUMBERING_RULES, true ) ); + uno::Reference<container::XIndexAccess> xNumberingRules; + if (it != pContext->end()) + xNumberingRules.set(it->second, uno::UNO_QUERY); + it = pContext->find(PropertyDefinition( PROP_NUMBERING_LEVEL, true ) ); + sal_Int32 nNumberingLevel = -1; + if (it != pContext->end()) + it->second >>= nNumberingLevel; + if (xNumberingRules.is() && nNumberingLevel != -1) + { + uno::Sequence<beans::PropertyValue> aProps; + xNumberingRules->getByIndex(nNumberingLevel) >>= aProps; + for (int i = 0; i < aProps.getLength(); ++i) + { + const beans::PropertyValue& rProp = aProps[i]; + + if (rProp.Name == "FirstLineIndent") + { + rProp.Value >>= nFirstLineIndent; + break; + } + } + } + + // Then copy it over. + if (nFirstLineIndent != 0) + m_pImpl->GetTopContext()->Insert(PROP_PARA_FIRST_LINE_INDENT, true, uno::makeAny(nFirstLineIndent)); + m_pImpl->GetTopContext()->Insert( PROP_PARA_LEFT_MARGIN, true, uno::makeAny( ConversionHelper::convertTwipToMM100(nIntValue ) )); + } break; case NS_ooxml::LN_CT_Ind_end: case NS_ooxml::LN_CT_Ind_right: |