writerfilter/source/dmapper/DomainMapper.cxx | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-)
New commits: commit de516780bf2d5f74afe643033bfc528c53013902 Author: Miklos Vajna <[email protected]> Date: Wed Aug 28 11:43:36 2013 +0200 bnc#816593 DOCX import: let w:before not overwrite w:beforeAutospacing And do the same for w:after / w:afterAutospacing. The spec says that if w:beforeAutospacing is read, w:before should be ignored, this implies that if we already had w:beforeAutospacing, w:before should not overwrite the already existing top margin. Change-Id: I9437cb5c6fc352a360e27aa279d0a789706c5578 diff --git a/writerfilter/source/dmapper/DomainMapper.cxx b/writerfilter/source/dmapper/DomainMapper.cxx index 3fb5799..e592d89 100644 --- a/writerfilter/source/dmapper/DomainMapper.cxx +++ b/writerfilter/source/dmapper/DomainMapper.cxx @@ -971,13 +971,15 @@ void DomainMapper::lcl_attribute(Id nName, Value & val) break; case NS_ooxml::LN_CT_Spacing_before: if (m_pImpl->GetTopContext()) - m_pImpl->GetTopContext()->Insert(PROP_PARA_TOP_MARGIN, uno::makeAny( ConversionHelper::convertTwipToMM100( nIntValue ) )); + // Don't overwrite NS_ooxml::LN_CT_Spacing_beforeAutospacing. + m_pImpl->GetTopContext()->Insert(PROP_PARA_TOP_MARGIN, uno::makeAny( ConversionHelper::convertTwipToMM100( nIntValue ) ), false); break; case NS_ooxml::LN_CT_Spacing_beforeLines: break; case NS_ooxml::LN_CT_Spacing_after: if (m_pImpl->GetTopContext()) - m_pImpl->GetTopContext()->Insert(PROP_PARA_BOTTOM_MARGIN, uno::makeAny( ConversionHelper::convertTwipToMM100( nIntValue ) )); + // Don't overwrite NS_ooxml::LN_CT_Spacing_afterAutospacing. + m_pImpl->GetTopContext()->Insert(PROP_PARA_BOTTOM_MARGIN, uno::makeAny( ConversionHelper::convertTwipToMM100( nIntValue ) ), false); break; case NS_ooxml::LN_CT_Spacing_afterLines: break; commit 279ff2e03371542d014bf281e73282ba8080cf6b Author: Miklos Vajna <[email protected]> Date: Wed Aug 28 11:24:07 2013 +0200 bnc#816593 DOCX import: fix auto para spacing without compat option Paragraph auto spacing (before and after) without the w:doNotUseHTMLParagraphAutoSpacing compat option was incorrect. Change-Id: I56d6153f7c489de7fceaf6fab7325c42ee8f9cae diff --git a/writerfilter/source/dmapper/DomainMapper.cxx b/writerfilter/source/dmapper/DomainMapper.cxx index 59a3958..3fb5799 100644 --- a/writerfilter/source/dmapper/DomainMapper.cxx +++ b/writerfilter/source/dmapper/DomainMapper.cxx @@ -1155,17 +1155,16 @@ void DomainMapper::lcl_attribute(Id nName, Value & val) uno::makeAny( aLocale ) ); } break; -// This is the value when the compat option is not enabled. No idea where it comes from, the spec doesn't mention it. -#define AUTO_PARA_SPACING sal_Int32(49) + // See SwWW8ImplReader::GetParagraphAutoSpace() on why these are 100 and 280 case NS_ooxml::LN_CT_Spacing_beforeAutospacing: if (!m_pImpl->GetSettingsTable()->GetDoNotUseHTMLParagraphAutoSpacing()) - m_pImpl->GetTopContext()->Insert( PROP_PARA_TOP_MARGIN, uno::makeAny( AUTO_PARA_SPACING ) ); + m_pImpl->GetTopContext()->Insert( PROP_PARA_TOP_MARGIN, uno::makeAny( ConversionHelper::convertTwipToMM100(280) ) ); else m_pImpl->GetTopContext()->Insert( PROP_PARA_TOP_MARGIN, uno::makeAny( ConversionHelper::convertTwipToMM100(100) ) ); break; case NS_ooxml::LN_CT_Spacing_afterAutospacing: if (!m_pImpl->GetSettingsTable()->GetDoNotUseHTMLParagraphAutoSpacing()) - m_pImpl->GetTopContext()->Insert( PROP_PARA_BOTTOM_MARGIN, uno::makeAny( AUTO_PARA_SPACING ) ); + m_pImpl->GetTopContext()->Insert( PROP_PARA_BOTTOM_MARGIN, uno::makeAny( ConversionHelper::convertTwipToMM100(280) ) ); else m_pImpl->GetTopContext()->Insert( PROP_PARA_BOTTOM_MARGIN, uno::makeAny( ConversionHelper::convertTwipToMM100(100) ) ); break; _______________________________________________ Libreoffice-commits mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
