summaryrefslogtreecommitdiff
path: root/sw/source
diff options
context:
space:
mode:
Diffstat (limited to 'sw/source')
-rw-r--r--sw/source/writerfilter/dmapper/DomainMapper.cxx3
-rw-r--r--sw/source/writerfilter/dmapper/DomainMapper_Impl.cxx19
-rw-r--r--sw/source/writerfilter/dmapper/DomainMapper_Impl.hxx2
3 files changed, 19 insertions, 5 deletions
diff --git a/sw/source/writerfilter/dmapper/DomainMapper.cxx b/sw/source/writerfilter/dmapper/DomainMapper.cxx
index 13ffe529d09d..8854e7ed9ece 100644
--- a/sw/source/writerfilter/dmapper/DomainMapper.cxx
+++ b/sw/source/writerfilter/dmapper/DomainMapper.cxx
@@ -2423,7 +2423,8 @@ void DomainMapper::sprmWithProps( Sprm& rSprm, const PropertyMapPtr& rContext )
else if (aInheritedSpacing.Mode == style::LineSpacingMode::MINIMUM)
nLineRule = NS_ooxml::LN_Value_doc_ST_LineSpacingRule_atLeast;
- m_pImpl->SetLineSpacing(NS_ooxml::LN_CT_Spacing_lineRule, nLineRule);
+ const bool bNegativeFlip = nLineRule != NS_ooxml::LN_Value_doc_ST_LineSpacingRule_exact;
+ m_pImpl->SetLineSpacing(NS_ooxml::LN_CT_Spacing_lineRule, nLineRule, bNegativeFlip);
}
m_pImpl->appendGrabBag(m_pImpl->m_aInteropGrabBag, u"spacing"_ustr, m_pImpl->m_aSubInteropGrabBag);
diff --git a/sw/source/writerfilter/dmapper/DomainMapper_Impl.cxx b/sw/source/writerfilter/dmapper/DomainMapper_Impl.cxx
index df28343d3186..83a9301c0738 100644
--- a/sw/source/writerfilter/dmapper/DomainMapper_Impl.cxx
+++ b/sw/source/writerfilter/dmapper/DomainMapper_Impl.cxx
@@ -5092,7 +5092,7 @@ bool DomainMapper_Impl::IsDiscardHeaderFooter() const
return m_bDiscardHeaderFooter;
}
-void DomainMapper_Impl::SetLineSpacing(const Id nName, sal_Int32 nIntValue)
+void DomainMapper_Impl::SetLineSpacing(const Id nName, sal_Int32 nIntValue, bool bNegativeFlip)
{
static const int nSingleLineSpacing = 240;
@@ -5142,12 +5142,25 @@ void DomainMapper_Impl::SetLineSpacing(const Id nName, sal_Int32 nIntValue)
== NS_ooxml::LN_Value_doc_ST_LineSpacingRule_atLeast)
{
appendGrabBag(m_aSubInteropGrabBag, u"lineRule"_ustr, u"atLeast"_ustr);
- aSpacing.Mode = style::LineSpacingMode::MINIMUM;
+ if (aSpacing.Height < 0)
+ {
+ aSpacing.Mode = style::LineSpacingMode::FIX;
+ aSpacing.Height *= -1;
+ }
+ else
+ aSpacing.Mode = style::LineSpacingMode::MINIMUM;
}
else // NS_ooxml::LN_Value_doc_ST_LineSpacingRule_exact
{
appendGrabBag(m_aSubInteropGrabBag, u"lineRule"_ustr, u"exact"_ustr);
- aSpacing.Mode = style::LineSpacingMode::FIX;
+ if (aSpacing.Height < 0)
+ {
+ if (bNegativeFlip)
+ aSpacing.Mode = style::LineSpacingMode::MINIMUM;
+ aSpacing.Height *= -1;
+ }
+ else
+ aSpacing.Mode = style::LineSpacingMode::FIX;
}
}
if (pTopContext)
diff --git a/sw/source/writerfilter/dmapper/DomainMapper_Impl.hxx b/sw/source/writerfilter/dmapper/DomainMapper_Impl.hxx
index e63c64778b09..5646d8cf13b2 100644
--- a/sw/source/writerfilter/dmapper/DomainMapper_Impl.hxx
+++ b/sw/source/writerfilter/dmapper/DomainMapper_Impl.hxx
@@ -1222,7 +1222,7 @@ public:
void SetSpacingHadLine(bool bSet) { m_bSpacingHadLine = bSet; }
bool GetSpacingHadLineRule() const { return m_bSpacingHadLineRule; }
void SetSpacingHadLineRule(bool bSet) { m_bSpacingHadLineRule = bSet; }
- void SetLineSpacing(const Id nName, sal_Int32 nIntValue);
+ void SetLineSpacing(const Id nName, sal_Int32 nIntValue, bool bNegativeFlip = true);
/// Forget about the previous paragraph, as it's not inside the same
/// start/end node.