summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2024-06-29 18:00:51 +0500
committerMike Kaganski <mike.kaganski@collabora.com>2024-06-29 18:03:21 +0200
commit2adf50be3df057e36562af1bf69ffc26c012d1f1 (patch)
tree3e05f89264cd4739b2e57d7fc1a8437c7f298872
parent102cbf4626dc80191a21af53c65f4817a0baef9b (diff)
Rename some ConversionHelper functions
Make their names more explicit. This avoids ambiguity; previously, convertTwipToMM100 was very similar to tools' convertTwipToMm100, provoking the former function's use where the latter is better. Drop convertTwipToMM100WithoutLimit, and use the unconstrained function from tools directly instead. Change-Id: Icdd1a67721cdd8a578bc786fda67c341b07ec84a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169759 Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com> Tested-by: Jenkins
-rw-r--r--sw/qa/writerfilter/misc/misc.cxx32
-rw-r--r--sw/source/writerfilter/dmapper/BorderHandler.cxx2
-rw-r--r--sw/source/writerfilter/dmapper/CellMarginHandler.cxx2
-rw-r--r--sw/source/writerfilter/dmapper/ConversionHelper.cxx24
-rw-r--r--sw/source/writerfilter/dmapper/ConversionHelper.hxx7
-rw-r--r--sw/source/writerfilter/dmapper/DomainMapper.cxx70
-rw-r--r--sw/source/writerfilter/dmapper/DomainMapperTableManager.cxx4
-rw-r--r--sw/source/writerfilter/dmapper/DomainMapper_Impl.cxx17
-rw-r--r--sw/source/writerfilter/dmapper/GraphicImport.cxx28
-rw-r--r--sw/source/writerfilter/dmapper/MeasureHandler.cxx2
-rw-r--r--sw/source/writerfilter/dmapper/NumberingManager.cxx8
-rw-r--r--sw/source/writerfilter/dmapper/PropertyMap.cxx6
-rw-r--r--sw/source/writerfilter/dmapper/SectionColumnHandler.cxx6
-rw-r--r--sw/source/writerfilter/dmapper/SettingsTable.cxx2
-rw-r--r--sw/source/writerfilter/dmapper/TablePositionHandler.cxx16
15 files changed, 115 insertions, 111 deletions
diff --git a/sw/qa/writerfilter/misc/misc.cxx b/sw/qa/writerfilter/misc/misc.cxx
index 1063cfd7fadc..506fc282999d 100644
--- a/sw/qa/writerfilter/misc/misc.cxx
+++ b/sw/qa/writerfilter/misc/misc.cxx
@@ -37,22 +37,22 @@ public:
void WriterfilterMiscTest::testTwipConversions()
{
- using writerfilter::dmapper::ConversionHelper::convertTwipToMM100;
- using writerfilter::dmapper::ConversionHelper::convertTwipToMM100Unsigned;
-
- CPPUNIT_ASSERT_EQUAL(sal_Int32(-2), convertTwipToMM100(-1));
- CPPUNIT_ASSERT_EQUAL(sal_Int32(-17639), convertTwipToMM100(-10000));
- CPPUNIT_ASSERT_EQUAL(sal_Int32(-70556), convertTwipToMM100(-40000));
- CPPUNIT_ASSERT_EQUAL(sal_Int32(2), convertTwipToMM100(1));
- CPPUNIT_ASSERT_EQUAL(sal_Int32(17639), convertTwipToMM100(10000));
- CPPUNIT_ASSERT_EQUAL(sal_Int32(0), convertTwipToMM100(40000));
-
- CPPUNIT_ASSERT_EQUAL(sal_uInt32(0), convertTwipToMM100Unsigned(-1));
- CPPUNIT_ASSERT_EQUAL(sal_uInt32(0), convertTwipToMM100Unsigned(-10000));
- CPPUNIT_ASSERT_EQUAL(sal_uInt32(0), convertTwipToMM100Unsigned(-40000));
- CPPUNIT_ASSERT_EQUAL(sal_uInt32(2), convertTwipToMM100Unsigned(1));
- CPPUNIT_ASSERT_EQUAL(sal_uInt32(17639), convertTwipToMM100Unsigned(10000));
- CPPUNIT_ASSERT_EQUAL(sal_uInt32(0), convertTwipToMM100Unsigned(40000));
+ using writerfilter::dmapper::ConversionHelper::convertTwipToMm100_Limited;
+ using writerfilter::dmapper::ConversionHelper::convertTwipToMm100_LimitedUnsigned;
+
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(-2), convertTwipToMm100_Limited(-1));
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(-17639), convertTwipToMm100_Limited(-10000));
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(-70556), convertTwipToMm100_Limited(-40000));
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(2), convertTwipToMm100_Limited(1));
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(17639), convertTwipToMm100_Limited(10000));
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(0), convertTwipToMm100_Limited(40000));
+
+ CPPUNIT_ASSERT_EQUAL(sal_uInt32(0), convertTwipToMm100_LimitedUnsigned(-1));
+ CPPUNIT_ASSERT_EQUAL(sal_uInt32(0), convertTwipToMm100_LimitedUnsigned(-10000));
+ CPPUNIT_ASSERT_EQUAL(sal_uInt32(0), convertTwipToMm100_LimitedUnsigned(-40000));
+ CPPUNIT_ASSERT_EQUAL(sal_uInt32(2), convertTwipToMm100_LimitedUnsigned(1));
+ CPPUNIT_ASSERT_EQUAL(sal_uInt32(17639), convertTwipToMm100_LimitedUnsigned(10000));
+ CPPUNIT_ASSERT_EQUAL(sal_uInt32(0), convertTwipToMm100_LimitedUnsigned(40000));
}
void WriterfilterMiscTest::testFieldParameters()
diff --git a/sw/source/writerfilter/dmapper/BorderHandler.cxx b/sw/source/writerfilter/dmapper/BorderHandler.cxx
index ad37a1d46c35..c007ecf5e515 100644
--- a/sw/source/writerfilter/dmapper/BorderHandler.cxx
+++ b/sw/source/writerfilter/dmapper/BorderHandler.cxx
@@ -69,7 +69,7 @@ void BorderHandler::lcl_attribute(Id rName, Value & rVal)
appendGrabBag(u"color"_ustr, msfilter::util::ConvertColorOU(Color(ColorTransparency, nIntValue)));
break;
case NS_ooxml::LN_CT_Border_space: // border distance in points
- m_nLineDistance = ConversionHelper::convertTwipToMM100( nIntValue * 20 );
+ m_nLineDistance = ConversionHelper::convertTwipToMm100_Limited(nIntValue * 20);
appendGrabBag(u"space"_ustr, OUString::number(nIntValue));
break;
case NS_ooxml::LN_CT_Border_shadow:
diff --git a/sw/source/writerfilter/dmapper/CellMarginHandler.cxx b/sw/source/writerfilter/dmapper/CellMarginHandler.cxx
index 8c014c093cf2..4f4b3011663a 100644
--- a/sw/source/writerfilter/dmapper/CellMarginHandler.cxx
+++ b/sw/source/writerfilter/dmapper/CellMarginHandler.cxx
@@ -55,7 +55,7 @@ void CellMarginHandler::lcl_attribute(Id rName, Value & rVal)
{
case NS_ooxml::LN_CT_TblWidth_w:
m_nWidth = nIntValue;
- m_nValue = ConversionHelper::convertTwipToMM100Unsigned( nIntValue );
+ m_nValue = ConversionHelper::convertTwipToMm100_LimitedUnsigned(nIntValue);
break;
case NS_ooxml::LN_CT_TblWidth_type:
SAL_WARN_IF(NS_ooxml::LN_Value_ST_TblWidth_dxa != sal::static_int_cast<Id>(nIntValue), "writerfilter", "CellMarginHandler: cell margins work for absolute values only");
diff --git a/sw/source/writerfilter/dmapper/ConversionHelper.cxx b/sw/source/writerfilter/dmapper/ConversionHelper.cxx
index 7f3f11544c85..a4a784dccab0 100644
--- a/sw/source/writerfilter/dmapper/ConversionHelper.cxx
+++ b/sw/source/writerfilter/dmapper/ConversionHelper.cxx
@@ -16,6 +16,11 @@
* except in compliance with the License. You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
+
+#include <sal/config.h>
+
+#include <cmath>
+
#include "ConversionHelper.hxx"
#include <com/sun/star/table/BorderLine2.hpp>
#include <com/sun/star/lang/Locale.hpp>
@@ -266,7 +271,7 @@ void MakeBorderLine( sal_Int32 nLineThickness, sal_Int32 nLineToken,
double const fConverted( (SvxBorderLineStyle::NONE == nLineStyle) ? 0.0 :
::editeng::ConvertBorderWidthFromWord(nLineStyle, nLineThickness,
nLineType));
- rToFill.LineWidth = convertTwipToMM100(fConverted);
+ rToFill.LineWidth = convertTwipToMm100_Limited(fConverted);
rToFill.Color = nLineColor;
}
@@ -415,7 +420,7 @@ OUString ConvertMSFormatStringToSO(
}
-sal_Int32 convertTwipToMM100(sal_Int32 _t)
+sal_Int32 convertTwipToMm100_Limited(sal_Int32 _t)
{
// It appears that MSO handles large twip values specially, probably legacy 16bit handling,
// anything that's bigger than 32767 appears to be simply ignored.
@@ -424,25 +429,20 @@ sal_Int32 convertTwipToMM100(sal_Int32 _t)
return ::convertTwipToMm100( _t );
}
-sal_Int32 convertTwipToMM100WithoutLimit(sal_Int32 _t)
-{
- return ::convertTwipToMm100(_t);
-}
-
-double convertTwipToMM100Double(sal_Int32 _t)
+sal_Int32 convertTwipToMm100_LimitedRoundUp(sal_Int32 _t)
{
// It appears that MSO handles large twip values specially, probably legacy 16bit handling,
// anything that's bigger than 32767 appears to be simply ignored.
if( _t >= 0x8000 )
- return 0.0;
- return o3tl::convert<double>(_t, o3tl::Length::twip, o3tl::Length::mm100);
+ return 0;
+ return std::ceil(::convertTwipToMm100<double>(_t));
}
-sal_uInt32 convertTwipToMM100Unsigned(sal_Int32 _t)
+sal_uInt32 convertTwipToMm100_LimitedUnsigned(sal_Int32 _t)
{
if( _t < 0 )
return 0;
- return convertTwipToMM100( _t );
+ return convertTwipToMm100_Limited(_t);
}
text::RubyAdjust convertRubyAlign( sal_Int32 nIntValue )
diff --git a/sw/source/writerfilter/dmapper/ConversionHelper.hxx b/sw/source/writerfilter/dmapper/ConversionHelper.hxx
index c14c8033ea58..a4c67ce8d2b1 100644
--- a/sw/source/writerfilter/dmapper/ConversionHelper.hxx
+++ b/sw/source/writerfilter/dmapper/ConversionHelper.hxx
@@ -45,10 +45,9 @@ namespace writerfilter::dmapper::ConversionHelper{
//convert the number format string form MS format to SO format
OUString ConvertMSFormatStringToSO(const OUString& rFormat, css::lang::Locale& rLocale, bool bHijri);
// export just for test
- SAL_DLLPUBLIC_EXPORT sal_Int32 convertTwipToMM100(sal_Int32 _t);
- sal_Int32 convertTwipToMM100WithoutLimit(sal_Int32 _t);
- double convertTwipToMM100Double(sal_Int32 _t);
- SAL_DLLPUBLIC_EXPORT sal_uInt32 convertTwipToMM100Unsigned(sal_Int32 _t);
+ SAL_DLLPUBLIC_EXPORT sal_Int32 convertTwipToMm100_Limited(sal_Int32 _t);
+ sal_Int32 convertTwipToMm100_LimitedRoundUp(sal_Int32 _t);
+ SAL_DLLPUBLIC_EXPORT sal_uInt32 convertTwipToMm100_LimitedUnsigned(sal_Int32 _t);
sal_Int16 convertTableJustification( sal_Int32 nIntValue );
css::text::RubyAdjust convertRubyAlign( sal_Int32 nIntValue );
sal_Int16 ConvertNumberingType(const sal_Int32 nFmt, const sal_Int16 nDefault = css::style::NumberingType::ARABIC);
diff --git a/sw/source/writerfilter/dmapper/DomainMapper.cxx b/sw/source/writerfilter/dmapper/DomainMapper.cxx
index 71760a6e3b56..6b60dd3bdffe 100644
--- a/sw/source/writerfilter/dmapper/DomainMapper.cxx
+++ b/sw/source/writerfilter/dmapper/DomainMapper.cxx
@@ -410,7 +410,7 @@ void DomainMapper::lcl_attribute(Id nName, Value & val)
m_pImpl->m_aCurrentTabStop.FillChar = getFillCharFromValue(nIntValue);
break;
case NS_ooxml::LN_CT_TabStop_pos:
- m_pImpl->m_aCurrentTabStop.Position = ConversionHelper::convertTwipToMM100(nIntValue);
+ m_pImpl->m_aCurrentTabStop.Position = ConversionHelper::convertTwipToMm100_Limited(nIntValue);
break;
case NS_ooxml::LN_CT_Fonts_ascii:
@@ -480,14 +480,14 @@ void DomainMapper::lcl_attribute(Id nName, Value & val)
// NS_ooxml::LN_CT_Spacing_before in parent styles before style
// sheet support can be enabled.
if (m_pImpl->GetTopContext() && !IsStyleSheetImport())
- m_pImpl->GetTopContext()->Insert(PROP_PARA_TOP_MARGIN, uno::Any(ConversionHelper::convertTwipToMM100(nIntValue * nSingleLineSpacing / 100)), false);
+ m_pImpl->GetTopContext()->Insert(PROP_PARA_TOP_MARGIN, uno::Any(ConversionHelper::convertTwipToMm100_Limited(nIntValue * nSingleLineSpacing / 100)), false);
break;
case NS_ooxml::LN_CT_Spacing_after:
m_pImpl->appendGrabBag(m_pImpl->m_aSubInteropGrabBag, u"after"_ustr, OUString::number(nIntValue));
if (m_pImpl->GetTopContext())
{
// Don't overwrite NS_ooxml::LN_CT_Spacing_afterAutospacing.
- m_pImpl->GetTopContext()->Insert(PROP_PARA_BOTTOM_MARGIN, uno::Any( ConversionHelper::convertTwipToMM100( nIntValue ) ), false);
+ m_pImpl->GetTopContext()->Insert(PROP_PARA_BOTTOM_MARGIN, uno::Any( ConversionHelper::convertTwipToMm100_Limited( nIntValue ) ), false);
uno::Any aContextualSpacingFromStyle = m_pImpl->GetPropertyFromParaStyleSheet(PROP_PARA_CONTEXT_MARGIN);
if (aContextualSpacingFromStyle.hasValue())
@@ -502,7 +502,7 @@ void DomainMapper::lcl_attribute(Id nName, Value & val)
// NS_ooxml::LN_CT_Spacing_after in parent styles before style
// sheet support can be enabled.
if (m_pImpl->GetTopContext() && !IsStyleSheetImport())
- m_pImpl->GetTopContext()->Insert(PROP_PARA_BOTTOM_MARGIN, uno::Any(ConversionHelper::convertTwipToMM100(nIntValue * nSingleLineSpacing / 100)), false);
+ m_pImpl->GetTopContext()->Insert(PROP_PARA_BOTTOM_MARGIN, uno::Any(ConversionHelper::convertTwipToMm100_Limited(nIntValue * nSingleLineSpacing / 100)), false);
break;
case NS_ooxml::LN_CT_Spacing_line: //91434
case NS_ooxml::LN_CT_Spacing_lineRule: //91435
@@ -518,7 +518,7 @@ void DomainMapper::lcl_attribute(Id nName, Value & val)
{
//default to single line spacing
aSpacing.Mode = style::LineSpacingMode::FIX;
- aSpacing.Height = sal_Int16(ConversionHelper::convertTwipToMM100( nSingleLineSpacing ));
+ aSpacing.Height = convertTwipToMm100(nSingleLineSpacing);
}
if( nName == NS_ooxml::LN_CT_Spacing_line )
{
@@ -527,7 +527,7 @@ void DomainMapper::lcl_attribute(Id nName, Value & val)
if( aSpacing.Mode == style::LineSpacingMode::PROP )
aSpacing.Height = sal_Int16(nIntValue * 100 / nSingleLineSpacing );
else
- aSpacing.Height = sal_Int16(ConversionHelper::convertTwipToMM100( nIntValue ));
+ aSpacing.Height = sal_Int16(ConversionHelper::convertTwipToMm100_Limited( nIntValue ));
}
else //NS_ooxml::LN_CT_Spacing_lineRule:
{
@@ -539,7 +539,7 @@ void DomainMapper::lcl_attribute(Id nName, Value & val)
{
aSpacing.Mode = style::LineSpacingMode::PROP;
//reinterpret the already set value
- aSpacing.Height = sal_Int16( aSpacing.Height * 100 / ConversionHelper::convertTwipToMM100( nSingleLineSpacing ));
+ aSpacing.Height = sal_Int16( aSpacing.Height * 100 / ConversionHelper::convertTwipToMm100_Limited( nSingleLineSpacing ));
}
else
{
@@ -573,7 +573,7 @@ void DomainMapper::lcl_attribute(Id nName, Value & val)
sal_Int32 nFirstLineIndent = m_pImpl->getCurrentNumberingProperty(u"FirstLineIndent"_ustr);
sal_Int32 nIndentAt = m_pImpl->getCurrentNumberingProperty(u"IndentAt"_ustr);
- sal_Int32 nParaLeftMargin = ConversionHelper::convertTwipToMM100(nIntValue);
+ sal_Int32 nParaLeftMargin = ConversionHelper::convertTwipToMm100_Limited(nIntValue);
if (nParaLeftMargin != 0 && nIndentAt == nParaLeftMargin)
// Avoid direct left margin when it's the same as from the
// numbering.
@@ -601,14 +601,14 @@ void DomainMapper::lcl_attribute(Id nName, Value & val)
m_pImpl->GetTopContext()->Insert(PROP_PARA_LEFT_MARGIN, uno::Any(nParaLeftMargin), /*bOverwrite=*/false);
m_pImpl->GetTopContext()->Insert(
- PROP_PARA_RIGHT_MARGIN, uno::Any( ConversionHelper::convertTwipToMM100(nIntValue ) ));
+ PROP_PARA_RIGHT_MARGIN, uno::Any( ConversionHelper::convertTwipToMm100_Limited(nIntValue ) ));
}
m_pImpl->appendGrabBag(m_pImpl->m_aSubInteropGrabBag, u"right"_ustr, OUString::number(nIntValue));
break;
case NS_ooxml::LN_CT_Ind_hanging:
if (m_pImpl->GetTopContext())
{
- sal_Int32 nValue = ConversionHelper::convertTwipToMM100( nIntValue );
+ sal_Int32 nValue = ConversionHelper::convertTwipToMm100_Limited(nIntValue);
m_pImpl->GetTopContext()->Insert(
PROP_PARA_FIRST_LINE_INDENT, uno::Any( - nValue ));
@@ -623,7 +623,7 @@ void DomainMapper::lcl_attribute(Id nName, Value & val)
{
sal_Int32 nFirstLineIndent
= m_pImpl->getCurrentNumberingProperty(u"FirstLineIndent"_ustr);
- sal_Int32 nParaFirstLineIndent = ConversionHelper::convertTwipToMM100(nIntValue);
+ sal_Int32 nParaFirstLineIndent = ConversionHelper::convertTwipToMm100_Limited(nIntValue);
if (nParaFirstLineIndent != 0 && nFirstLineIndent == nParaFirstLineIndent)
// Avoid direct first margin when it's the same as from the
// numbering.
@@ -667,7 +667,7 @@ void DomainMapper::lcl_attribute(Id nName, Value & val)
break;
case NS_ooxml::LN_CT_PageSz_h:
{
- sal_Int32 nHeight = ConversionHelper::convertTwipToMM100WithoutLimit(nIntValue);
+ sal_Int32 nHeight = convertTwipToMm100(nIntValue);
CT_PageSz.h = PaperInfo::sloppyFitPageDimension(nHeight);
}
break;
@@ -676,7 +676,7 @@ void DomainMapper::lcl_attribute(Id nName, Value & val)
break;
case NS_ooxml::LN_CT_PageSz_w:
{
- sal_Int32 nWidth = ConversionHelper::convertTwipToMM100WithoutLimit(nIntValue);
+ sal_Int32 nWidth = convertTwipToMm100(nIntValue);
CT_PageSz.w = PaperInfo::sloppyFitPageDimension(nWidth);
}
break;
@@ -759,43 +759,43 @@ void DomainMapper::lcl_attribute(Id nName, Value & val)
// See SwWW8ImplReader::GetParagraphAutoSpace() on why these are 100 and 280
case NS_ooxml::LN_CT_Spacing_beforeAutospacing:
{
- sal_Int32 default_spacing = -1;
+ sal_Int32 default_spacing = convertTwipToMm100(-1);
if (nIntValue)
{
m_pImpl->SetParaAutoBefore(true);
- default_spacing = 100;
+ default_spacing = convertTwipToMm100(100);
if (!m_pImpl->GetSettingsTable()->GetDoNotUseHTMLParagraphAutoSpacing())
{
// 49 is just the old value that should be removed, once the
// root cause in SwTabFrm::MakeAll() is fixed.
if (m_pImpl->GetSettingsTable()->GetView() == NS_ooxml::LN_Value_doc_ST_View_web)
- default_spacing = 49;
+ default_spacing = convertTwipToMm100(49);
else
- default_spacing = 280;
+ default_spacing = convertTwipToMm100(280);
}
// required at export (here mainly for StyleSheets) to determine if the setting has changed from grab_bag
- m_pImpl->GetTopContext()->Insert(PROP_PARA_TOP_MARGIN, uno::Any(ConversionHelper::convertTwipToMM100(default_spacing)));
+ m_pImpl->GetTopContext()->Insert(PROP_PARA_TOP_MARGIN, uno::Any(default_spacing));
}
- m_pImpl->GetTopContext()->Insert( PROP_PARA_TOP_MARGIN_BEFORE_AUTO_SPACING, uno::Any( ConversionHelper::convertTwipToMM100(default_spacing) ),true, PARA_GRAB_BAG );
+ m_pImpl->GetTopContext()->Insert( PROP_PARA_TOP_MARGIN_BEFORE_AUTO_SPACING, uno::Any( default_spacing ),true, PARA_GRAB_BAG );
}
break;
case NS_ooxml::LN_CT_Spacing_afterAutospacing:
{
- sal_Int32 default_spacing = -1;
+ sal_Int32 default_spacing = convertTwipToMm100(-1);
if (nIntValue)
{
- default_spacing = 100;
+ default_spacing = convertTwipToMm100(100);
if (!m_pImpl->GetSettingsTable()->GetDoNotUseHTMLParagraphAutoSpacing())
{
if (m_pImpl->GetSettingsTable()->GetView() == NS_ooxml::LN_Value_doc_ST_View_web)
- default_spacing = 49;
+ default_spacing = convertTwipToMm100(49);
else
- default_spacing = 280;
+ default_spacing = convertTwipToMm100(280);
}
- m_pImpl->GetTopContext()->Insert(PROP_PARA_BOTTOM_MARGIN, uno::Any(ConversionHelper::convertTwipToMM100(default_spacing)));
+ m_pImpl->GetTopContext()->Insert(PROP_PARA_BOTTOM_MARGIN, uno::Any(default_spacing));
}
- m_pImpl->GetTopContext()->Insert( PROP_PARA_BOTTOM_MARGIN_AFTER_AUTO_SPACING, uno::Any( ConversionHelper::convertTwipToMM100(default_spacing) ),true, PARA_GRAB_BAG );
+ m_pImpl->GetTopContext()->Insert( PROP_PARA_BOTTOM_MARGIN_AFTER_AUTO_SPACING, uno::Any( default_spacing ),true, PARA_GRAB_BAG );
}
break;
case NS_ooxml::LN_CT_SmartTagRun_uri:
@@ -906,7 +906,7 @@ void DomainMapper::lcl_attribute(Id nName, Value & val)
break;
case NS_ooxml::LN_CT_FramePr_x:
pParaProperties->props().Setx(
- ConversionHelper::convertTwipToMM100(nIntValue ));
+ ConversionHelper::convertTwipToMm100_Limited(nIntValue));
pParaProperties->props().SetxAlign( text::HoriOrientation::NONE );
break;
case NS_ooxml::LN_CT_FramePr_xAlign:
@@ -923,7 +923,7 @@ void DomainMapper::lcl_attribute(Id nName, Value & val)
break;
case NS_ooxml::LN_CT_FramePr_y:
pParaProperties->props().Sety(
- ConversionHelper::convertTwipToMM100(nIntValue ));
+ ConversionHelper::convertTwipToMm100_Limited(nIntValue));
pParaProperties->props().SetyAlign( text::VertOrientation::NONE );
break;
case NS_ooxml::LN_CT_FramePr_yAlign:
@@ -996,19 +996,19 @@ void DomainMapper::lcl_attribute(Id nName, Value & val)
break;
case NS_ooxml::LN_CT_FramePr_w:
pParaProperties->props().Setw(
- ConversionHelper::convertTwipToMM100(nIntValue));
+ ConversionHelper::convertTwipToMm100_Limited(nIntValue));
break;
case NS_ooxml::LN_CT_FramePr_h:
pParaProperties->props().Seth(
- ConversionHelper::convertTwipToMM100(nIntValue));
+ ConversionHelper::convertTwipToMm100_Limited(nIntValue));
break;
case NS_ooxml::LN_CT_FramePr_hSpace:
pParaProperties->props().SethSpace(
- ConversionHelper::convertTwipToMM100(nIntValue ));
+ ConversionHelper::convertTwipToMm100_Limited(nIntValue));
break;
case NS_ooxml::LN_CT_FramePr_vSpace:
pParaProperties->props().SetvSpace(
- ConversionHelper::convertTwipToMM100(nIntValue ));
+ ConversionHelper::convertTwipToMm100_Limited(nIntValue));
break;
default:;
}
@@ -1059,7 +1059,7 @@ void DomainMapper::lcl_attribute(Id nName, Value & val)
pSectionContext->SetLnnMin( nIntValue );
break;
case NS_ooxml::LN_CT_LineNumber_distance:
- aSettings.nDistance = ConversionHelper::convertTwipToMM100( nIntValue );
+ aSettings.nDistance = ConversionHelper::convertTwipToMm100_Limited(nIntValue);
OSL_ENSURE(pSectionContext, "SectionContext unavailable!");
if( pSectionContext )
pSectionContext->SetdxaLnn( nIntValue );
@@ -1087,7 +1087,7 @@ void DomainMapper::lcl_attribute(Id nName, Value & val)
OSL_ENSURE(pSectionContext, "SectionContext unavailable!");
if(pSectionContext)
{
- pSectionContext->SetGridLinePitch( ConversionHelper::convertTwipToMM100( nIntValue ) );
+ pSectionContext->SetGridLinePitch( ConversionHelper::convertTwipToMm100_Limited( nIntValue ) );
}
}
break;
@@ -2195,7 +2195,7 @@ void DomainMapper::sprmWithProps( Sprm& rSprm, const PropertyMapPtr& rContext )
//Kerning half point values
//TODO: there are two kerning values -
// in ww8par6.cxx NS_sprm::LN_CHpsKern is used as boolean AutoKerning
- sal_Int16 nResult = static_cast<sal_Int16>(ConversionHelper::convertTwipToMM100(nIntValue));
+ sal_Int16 nResult = static_cast<sal_Int16>(ConversionHelper::convertTwipToMm100_Limited(nIntValue));
if (m_pImpl->IsInComments())
{
nResult = static_cast<sal_Int16>(nIntValue);
@@ -2280,7 +2280,7 @@ void DomainMapper::sprmWithProps( Sprm& rSprm, const PropertyMapPtr& rContext )
case 165:
{
//page height, rounded to default values, default: 0x3dc0 twip
- sal_Int32 nHeight = ConversionHelper::convertTwipToMM100( nIntValue );
+ sal_Int32 nHeight = ConversionHelper::convertTwipToMm100_Limited(nIntValue);
rContext->Insert( PROP_HEIGHT, uno::Any( PaperInfo::sloppyFitPageDimension( nHeight ) ) );
}
break;
diff --git a/sw/source/writerfilter/dmapper/DomainMapperTableManager.cxx b/sw/source/writerfilter/dmapper/DomainMapperTableManager.cxx
index c38b6ae09e46..1ccdc5533645 100644
--- a/sw/source/writerfilter/dmapper/DomainMapperTableManager.cxx
+++ b/sw/source/writerfilter/dmapper/DomainMapperTableManager.cxx
@@ -621,7 +621,7 @@ void DomainMapperTableManager::endOfRowAction()
}
if (m_nTableWidth)
// convert sum of grid twip values to 1/100 mm with rounding up to avoid table width loss
- m_nTableWidth = static_cast<sal_Int32>(ceil(ConversionHelper::convertTwipToMM100Double(m_nTableWidth)));
+ m_nTableWidth = ConversionHelper::convertTwipToMm100_LimitedRoundUp(m_nTableWidth);
if (m_nTableWidth > 0 && !m_bTableSizeTypeInserted)
{
@@ -780,7 +780,7 @@ void DomainMapperTableManager::endOfRowAction()
* If table width property set earlier is smaller than the current table row width,
* then replace the TABLE_WIDTH property, set earlier.
*/
- sal_Int32 nFullWidth = static_cast<sal_Int32>(ceil(ConversionHelper::convertTwipToMM100Double(nFullWidthRelative)));
+ sal_Int32 nFullWidth = ConversionHelper::convertTwipToMm100_LimitedRoundUp(nFullWidthRelative);
sal_Int32 nTableWidth(0);
sal_Int32 nTableWidthType(text::SizeType::VARIABLE);
pTablePropMap->getValue(TablePropertyMap::TABLE_WIDTH, nTableWidth);
diff --git a/sw/source/writerfilter/dmapper/DomainMapper_Impl.cxx b/sw/source/writerfilter/dmapper/DomainMapper_Impl.cxx
index 4053baee1164..0f864625dc75 100644
--- a/sw/source/writerfilter/dmapper/DomainMapper_Impl.cxx
+++ b/sw/source/writerfilter/dmapper/DomainMapper_Impl.cxx
@@ -100,6 +100,7 @@
#include <utility>
#include <xmloff/odffields.hxx>
#include <rtl/uri.hxx>
+#include <tools/UnitConversion.hxx>
#include <unotools/ucbstreamhelper.hxx>
#include <unotools/streamwrap.hxx>
#include <comphelper/scopeguard.hxx>
@@ -2345,7 +2346,7 @@ void DomainMapper_Impl::finishParagraph( const PropertyMapPtr& pPropertyMap, con
GetAnyProperty(PROP_PARA_TOP_MARGIN_BEFORE_AUTO_SPACING, pPropertyMap) >>= nBeforeAutospacing;
// tdf#137655 only w:beforeAutospacing=0 was specified, but not PARA_TOP_MARGIN
// (see default_spacing = -1 in processing of LN_CT_Spacing_beforeAutospacing)
- if ( bNoTopmargin && nBeforeAutospacing == ConversionHelper::convertTwipToMM100(-1) )
+ if (bNoTopmargin && nBeforeAutospacing == convertTwipToMm100(-1))
{
sal_Int32 nStyleAuto = -1;
GetPropertyFromParaStyleSheet(PROP_PARA_TOP_MARGIN_BEFORE_AUTO_SPACING) >>= nStyleAuto;
@@ -2379,7 +2380,7 @@ void DomainMapper_Impl::finishParagraph( const PropertyMapPtr& pPropertyMap, con
if (bIsAutoSet || bNoBottomMargin)
{
GetAnyProperty(PROP_PARA_BOTTOM_MARGIN_AFTER_AUTO_SPACING, pPropertyMap) >>= nAfterAutospacing;
- if (bNoBottomMargin && nAfterAutospacing == ConversionHelper::convertTwipToMM100(-1))
+ if (bNoBottomMargin && nAfterAutospacing == convertTwipToMm100(-1))
{
sal_Int32 nStyleAuto = -1;
GetPropertyFromParaStyleSheet(PROP_PARA_BOTTOM_MARGIN_AFTER_AUTO_SPACING) >>= nStyleAuto;
@@ -9457,7 +9458,7 @@ void DomainMapper_Impl::SetLineNumbering( sal_Int32 nLnnMod, sal_uInt32 nLnc, sa
xProperties->setPropertyValue( getPropertyName( PROP_COUNT_EMPTY_LINES ), aTrue );
xProperties->setPropertyValue( getPropertyName( PROP_COUNT_LINES_IN_FRAMES ), uno::Any( false ) );
xProperties->setPropertyValue( getPropertyName( PROP_INTERVAL ), uno::Any( static_cast< sal_Int16 >( nLnnMod )));
- xProperties->setPropertyValue( getPropertyName( PROP_DISTANCE ), uno::Any( ConversionHelper::convertTwipToMM100(ndxaLnn) ));
+ xProperties->setPropertyValue( getPropertyName( PROP_DISTANCE ), uno::Any( ConversionHelper::convertTwipToMm100_Limited(ndxaLnn) ));
xProperties->setPropertyValue( getPropertyName( PROP_NUMBER_POSITION ), uno::Any( style::LineNumberPosition::LEFT));
xProperties->setPropertyValue( getPropertyName( PROP_NUMBERING_TYPE ), uno::Any( style::NumberingType::ARABIC));
xProperties->setPropertyValue( getPropertyName( PROP_RESTART_AT_EACH_PAGE ), uno::Any( nLnc == NS_ooxml::LN_Value_ST_LineNumberRestart_newPage ));
@@ -9476,7 +9477,7 @@ void DomainMapper_Impl::SetLineNumbering( sal_Int32 nLnnMod, sal_uInt32 nLnc, sa
void DomainMapper_Impl::SetPageMarginTwip( PageMarElement eElement, sal_Int32 nValue )
{
- nValue = ConversionHelper::convertTwipToMM100(nValue);
+ nValue = ConversionHelper::convertTwipToMm100_Limited(nValue);
switch(eElement)
{
case PAGE_MAR_TOP : m_aPageMargins.top = nValue; break;
@@ -9501,13 +9502,13 @@ void DomainMapper_Impl::SetPaperSource(PaperSourceElement eElement, sal_Int32 nV
PageMar::PageMar()
- : top(ConversionHelper::convertTwipToMM100( sal_Int32(1440)))
+ : top(convertTwipToMm100(1440))
// This is strange, the RTF spec says it's 1800, but it's clearly 1440 in Word
// OOXML seems not to specify a default value
- , right(ConversionHelper::convertTwipToMM100( sal_Int32(1440)))
+ , right(convertTwipToMm100(1440))
, bottom(top)
, left(right)
- , header(ConversionHelper::convertTwipToMM100(sal_Int32(720)))
+ , header(convertTwipToMm100(720))
, footer(header)
, gutter(0)
{
@@ -9701,7 +9702,7 @@ void DomainMapper_Impl::ApplySettingsTable()
if (m_pSettingsTable->GetLinkStyles())
{
// If linked styles are enabled, set paragraph defaults from Word's default template
- xTextDefaults->setPropertyValue(getPropertyName(PROP_PARA_BOTTOM_MARGIN), uno::Any(ConversionHelper::convertTwipToMM100(200)));
+ xTextDefaults->setPropertyValue(getPropertyName(PROP_PARA_BOTTOM_MARGIN), uno::Any(sal_Int32(convertTwipToMm100(200))));
style::LineSpacing aSpacing;
aSpacing.Mode = style::LineSpacingMode::PROP;
aSpacing.Height = sal_Int16(115);
diff --git a/sw/source/writerfilter/dmapper/GraphicImport.cxx b/sw/source/writerfilter/dmapper/GraphicImport.cxx
index b05e3f2334d5..d516d59c2120 100644
--- a/sw/source/writerfilter/dmapper/GraphicImport.cxx
+++ b/sw/source/writerfilter/dmapper/GraphicImport.cxx
@@ -795,12 +795,12 @@ void GraphicImport::lcl_attribute(Id nName, Value& rValue)
}
break;
case NS_ooxml::LN_CT_Point2D_x:
- m_pImpl->m_nLeftPosition = ConversionHelper::convertTwipToMM100(nIntValue);
+ m_pImpl->m_nLeftPosition = ConversionHelper::convertTwipToMm100_Limited(nIntValue);
m_pImpl->m_nHoriRelation = text::RelOrientation::PAGE_FRAME;
m_pImpl->m_nHoriOrient = text::HoriOrientation::NONE;
break;
case NS_ooxml::LN_CT_Point2D_y:
- m_pImpl->m_nTopPosition = ConversionHelper::convertTwipToMM100(nIntValue);
+ m_pImpl->m_nTopPosition = ConversionHelper::convertTwipToMm100_Limited(nIntValue);
m_pImpl->m_nVertRelation = text::RelOrientation::PAGE_FRAME;
m_pImpl->m_nVertOrient = text::VertOrientation::NONE;
break;
@@ -1029,10 +1029,10 @@ void GraphicImport::lcl_attribute(Id nName, Value& rValue)
if(pShape && pShape->IsGroupObject())
{
tools::Rectangle aSnapRect = pShape->GetSnapRect(); // Twips
- m_pImpl->m_nLeftPosition = ConversionHelper::convertTwipToMM100(aSnapRect.Left());
- m_pImpl->m_nTopPosition = ConversionHelper::convertTwipToMM100(aSnapRect.Top());
- aLOSize.Width = ConversionHelper::convertTwipToMM100(aSnapRect.getOpenWidth());
- aLOSize.Height = ConversionHelper::convertTwipToMM100(aSnapRect.getOpenHeight());
+ m_pImpl->m_nLeftPosition = ConversionHelper::convertTwipToMm100_Limited(aSnapRect.Left());
+ m_pImpl->m_nTopPosition = ConversionHelper::convertTwipToMm100_Limited(aSnapRect.Top());
+ aLOSize.Width = ConversionHelper::convertTwipToMm100_Limited(aSnapRect.getOpenWidth());
+ aLOSize.Height = ConversionHelper::convertTwipToMm100_Limited(aSnapRect.getOpenHeight());
}
else
{
@@ -1097,10 +1097,10 @@ void GraphicImport::lcl_attribute(Id nName, Value& rValue)
if (pShape)
{
tools::Rectangle aSnapRect = pShape->GetSnapRect(); // Twip
- aLOSnapRect.X = ConversionHelper::convertTwipToMM100(aSnapRect.Left());
- aLOSnapRect.Y = ConversionHelper::convertTwipToMM100(aSnapRect.Top());
- aLOSnapRect.Width = ConversionHelper::convertTwipToMM100(aSnapRect.getOpenWidth());
- aLOSnapRect.Height = ConversionHelper::convertTwipToMM100(aSnapRect.getOpenHeight());
+ aLOSnapRect.X = ConversionHelper::convertTwipToMm100_Limited(aSnapRect.Left());
+ aLOSnapRect.Y = ConversionHelper::convertTwipToMm100_Limited(aSnapRect.Top());
+ aLOSnapRect.Width = ConversionHelper::convertTwipToMm100_Limited(aSnapRect.getOpenWidth());
+ aLOSnapRect.Height = ConversionHelper::convertTwipToMm100_Limited(aSnapRect.getOpenHeight());
}
m_pImpl->m_nLeftMargin += aLOSnapRect.X - aMSOBaseLeftTop.X;
@@ -1139,10 +1139,10 @@ void GraphicImport::lcl_attribute(Id nName, Value& rValue)
if (pShape)
{
tools::Rectangle aBoundRect = pShape->GetCurrentBoundRect(); // Twip
- aLOBoundRect.X = ConversionHelper::convertTwipToMM100(aBoundRect.Left());
- aLOBoundRect.Y = ConversionHelper::convertTwipToMM100(aBoundRect.Top());
- aLOBoundRect.Width = ConversionHelper::convertTwipToMM100(aBoundRect.getOpenWidth());
- aLOBoundRect.Height = ConversionHelper::convertTwipToMM100(aBoundRect.getOpenHeight());
+ aLOBoundRect.X = ConversionHelper::convertTwipToMm100_Limited(aBoundRect.Left());
+ aLOBoundRect.Y = ConversionHelper::convertTwipToMm100_Limited(aBoundRect.Top());
+ aLOBoundRect.Width = ConversionHelper::convertTwipToMm100_Limited(aBoundRect.getOpenWidth());
+ aLOBoundRect.Height = ConversionHelper::convertTwipToMm100_Limited(aBoundRect.getOpenHeight());
}
m_pImpl->m_nLeftMargin += aLOBoundRect.X - aMSOBaseLeftTop.X;
diff --git a/sw/source/writerfilter/dmapper/MeasureHandler.cxx b/sw/source/writerfilter/dmapper/MeasureHandler.cxx
index 85aae7602732..63b719b790f5 100644
--- a/sw/source/writerfilter/dmapper/MeasureHandler.cxx
+++ b/sw/source/writerfilter/dmapper/MeasureHandler.cxx
@@ -109,7 +109,7 @@ sal_Int32 MeasureHandler::getMeasureValue() const
// TODO m_nUnit 3 - twip, other values unknown :-(
if( m_nUnit == 3 || sal::static_int_cast<Id>(m_nUnit) == NS_ooxml::LN_Value_ST_TblWidth_dxa)
{
- nRet = ConversionHelper::convertTwipToMM100( m_nMeasureValue );
+ nRet = ConversionHelper::convertTwipToMm100_Limited(m_nMeasureValue);
}
//todo: handle additional width types:
//NS_ooxml::LN_Value_ST_TblWidth_nil, NS_ooxml::LN_Value_ST_TblWidth_pct,
diff --git a/sw/source/writerfilter/dmapper/NumberingManager.cxx b/sw/source/writerfilter/dmapper/NumberingManager.cxx
index 3c4c89f156e5..726ba50dbdc0 100644
--- a/sw/source/writerfilter/dmapper/NumberingManager.cxx
+++ b/sw/source/writerfilter/dmapper/NumberingManager.cxx
@@ -780,17 +780,17 @@ void ListsManager::lcl_attribute( Id nName, Value& rVal )
case NS_ooxml::LN_CT_Ind_left:
if ( pCurrentLvl )
pCurrentLvl->Insert(
- PROP_INDENT_AT, uno::Any( ConversionHelper::convertTwipToMM100( nIntValue ) ));
+ PROP_INDENT_AT, uno::Any( ConversionHelper::convertTwipToMm100_Limited( nIntValue ) ));
break;
case NS_ooxml::LN_CT_Ind_hanging:
if ( pCurrentLvl )
pCurrentLvl->Insert(
- PROP_FIRST_LINE_INDENT, uno::Any( - ConversionHelper::convertTwipToMM100( nIntValue ) ));
+ PROP_FIRST_LINE_INDENT, uno::Any( - ConversionHelper::convertTwipToMm100_Limited( nIntValue ) ));
break;
case NS_ooxml::LN_CT_Ind_firstLine:
if ( pCurrentLvl )
pCurrentLvl->Insert(
- PROP_FIRST_LINE_INDENT, uno::Any( ConversionHelper::convertTwipToMM100( nIntValue ) ));
+ PROP_FIRST_LINE_INDENT, uno::Any( ConversionHelper::convertTwipToMm100_Limited( nIntValue ) ));
break;
case NS_ooxml::LN_CT_Lvl_tplc: //template code - unsupported
case NS_ooxml::LN_CT_Lvl_tentative: //marks level as unused in the document - unsupported
@@ -800,7 +800,7 @@ void ListsManager::lcl_attribute( Id nName, Value& rVal )
//no paragraph attributes in ListTable char style sheets
if ( pCurrentLvl )
pCurrentLvl->SetValue( nName,
- ConversionHelper::convertTwipToMM100( nIntValue ) );
+ ConversionHelper::convertTwipToMm100_Limited( nIntValue ) );
}
break;
case NS_ooxml::LN_CT_TabStop_val:
diff --git a/sw/source/writerfilter/dmapper/PropertyMap.cxx b/sw/source/writerfilter/dmapper/PropertyMap.cxx
index 91d7acc7f4ca..3eeaf79ce4f8 100644
--- a/sw/source/writerfilter/dmapper/PropertyMap.cxx
+++ b/sw/source/writerfilter/dmapper/PropertyMap.cxx
@@ -1825,7 +1825,7 @@ void SectionPropertyMap::CloseSectionGroup( DomainMapper_Impl& rDM_Impl )
{
double fHeight = 0;
if ( pPropHeight->second >>= fHeight )
- nCharWidth = ConversionHelper::convertTwipToMM100( static_cast<tools::Long>(fHeight * 20.0 + 0.5) );
+ nCharWidth = ConversionHelper::convertTwipToMm100_Limited( static_cast<sal_Int32>(fHeight * 20.0 + 0.5) );
}
}
@@ -1836,11 +1836,11 @@ void SectionPropertyMap::CloseSectionGroup( DomainMapper_Impl& rDM_Impl )
//main lives in top 20 bits, and is signed.
sal_Int32 nMain = (nCharSpace & 0xFFFFF000);
nMain /= 0x1000;
- nCharWidth += ConversionHelper::convertTwipToMM100( nMain * 20 );
+ nCharWidth += ConversionHelper::convertTwipToMm100_Limited(nMain * 20);
sal_Int32 nFraction = (nCharSpace & 0x00000FFF);
nFraction = (nFraction * 20) / 0xFFF;
- nCharWidth += ConversionHelper::convertTwipToMM100( nFraction );
+ nCharWidth += ConversionHelper::convertTwipToMm100_Limited(nFraction);
}
if ( m_nPageNumberType >= 0 )
diff --git a/sw/source/writerfilter/dmapper/SectionColumnHandler.cxx b/sw/source/writerfilter/dmapper/SectionColumnHandler.cxx
index 9fed9c34a68e..363eee499d62 100644
--- a/sw/source/writerfilter/dmapper/SectionColumnHandler.cxx
+++ b/sw/source/writerfilter/dmapper/SectionColumnHandler.cxx
@@ -46,7 +46,7 @@ void SectionColumnHandler::lcl_attribute(Id rName, Value& rVal)
m_bEqualWidth = (nIntValue != 0);
break;
case NS_ooxml::LN_CT_Columns_space:
- m_nSpace = ConversionHelper::convertTwipToMM100(nIntValue);
+ m_nSpace = ConversionHelper::convertTwipToMm100_Limited(nIntValue);
break;
case NS_ooxml::LN_CT_Columns_num:
m_nNum = nIntValue;
@@ -56,10 +56,10 @@ void SectionColumnHandler::lcl_attribute(Id rName, Value& rVal)
break;
case NS_ooxml::LN_CT_Column_w:
- m_aTempColumn.nWidth = ConversionHelper::convertTwipToMM100(nIntValue);
+ m_aTempColumn.nWidth = ConversionHelper::convertTwipToMm100_Limited(nIntValue);
break;
case NS_ooxml::LN_CT_Column_space:
- m_aTempColumn.nSpace = ConversionHelper::convertTwipToMM100(nIntValue);
+ m_aTempColumn.nSpace = ConversionHelper::convertTwipToMm100_Limited(nIntValue);
break;
default:
OSL_FAIL("SectionColumnHandler: unknown attribute");
diff --git a/sw/source/writerfilter/dmapper/SettingsTable.cxx b/sw/source/writerfilter/dmapper/SettingsTable.cxx
index fa67518ced65..dcf42d370371 100644
--- a/sw/source/writerfilter/dmapper/SettingsTable.cxx
+++ b/sw/source/writerfilter/dmapper/SettingsTable.cxx
@@ -468,7 +468,7 @@ void SettingsTable::lcl_entry(const writerfilter::Reference<Properties>::Pointer
//returns default TabStop in 1/100th mm
int SettingsTable::GetDefaultTabStop() const
{
- return ConversionHelper::convertTwipToMM100( m_pImpl->m_nDefaultTabStop );
+ return ConversionHelper::convertTwipToMm100_Limited(m_pImpl->m_nDefaultTabStop);
}
bool SettingsTable::GetLinkStyles() const
diff --git a/sw/source/writerfilter/dmapper/TablePositionHandler.cxx b/sw/source/writerfilter/dmapper/TablePositionHandler.cxx
index 97b531d2f9af..176dea0a877f 100644
--- a/sw/source/writerfilter/dmapper/TablePositionHandler.cxx
+++ b/sw/source/writerfilter/dmapper/TablePositionHandler.cxx
@@ -80,12 +80,14 @@ uno::Sequence<beans::PropertyValue> TablePositionHandler::getTablePosition() con
aFrameProperties[u"TopBorderDistance"_ustr] <<= sal_Int32(0);
aFrameProperties[u"BottomBorderDistance"_ustr] <<= sal_Int32(0);
- aFrameProperties[u"LeftMargin"_ustr] <<= ConversionHelper::convertTwipToMM100(m_nLeftFromText);
+ aFrameProperties[u"LeftMargin"_ustr]
+ <<= ConversionHelper::convertTwipToMm100_Limited(m_nLeftFromText);
aFrameProperties[u"RightMargin"_ustr]
- <<= ConversionHelper::convertTwipToMM100(m_nRightFromText);
- aFrameProperties[u"TopMargin"_ustr] <<= ConversionHelper::convertTwipToMM100(m_nTopFromText);
+ <<= ConversionHelper::convertTwipToMm100_Limited(m_nRightFromText);
+ aFrameProperties[u"TopMargin"_ustr]
+ <<= ConversionHelper::convertTwipToMm100_Limited(m_nTopFromText);
aFrameProperties[u"BottomMargin"_ustr]
- <<= ConversionHelper::convertTwipToMM100(m_nBottomFromText);
+ <<= ConversionHelper::convertTwipToMm100_Limited(m_nBottomFromText);
table::BorderLine2 aEmptyBorder;
aFrameProperties[u"TopBorder"_ustr] <<= aEmptyBorder;
@@ -116,7 +118,8 @@ uno::Sequence<beans::PropertyValue> TablePositionHandler::getTablePosition() con
aFrameProperties[u"HoriOrient"_ustr] <<= nHoriOrient;
aFrameProperties[u"HoriOrientRelation"_ustr] <<= nHoriOrientRelation;
- aFrameProperties[u"HoriOrientPosition"_ustr] <<= ConversionHelper::convertTwipToMM100(m_nX);
+ aFrameProperties[u"HoriOrientPosition"_ustr]
+ <<= ConversionHelper::convertTwipToMm100_Limited(m_nX);
// Vertical positioning
sal_Int16 nVertOrient = text::VertOrientation::NONE;
@@ -138,7 +141,8 @@ uno::Sequence<beans::PropertyValue> TablePositionHandler::getTablePosition() con
aFrameProperties[u"VertOrient"_ustr] <<= nVertOrient;
aFrameProperties[u"VertOrientRelation"_ustr] <<= nVertOrientRelation;
- aFrameProperties[u"VertOrientPosition"_ustr] <<= ConversionHelper::convertTwipToMM100(m_nY);
+ aFrameProperties[u"VertOrientPosition"_ustr]
+ <<= ConversionHelper::convertTwipToMm100_Limited(m_nY);
aFrameProperties[u"FillTransparence"_ustr] <<= sal_Int32(100);
if (m_nTableOverlap == NS_ooxml::LN_Value_ST_TblOverlap_never)