summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2022-08-07 21:00:01 +0300
committerMike Kaganski <mike.kaganski@collabora.com>2022-08-07 21:14:12 +0200
commit47b4c9bb7f0ef0175e55acaf22c740d11f6e9474 (patch)
tree69d821b256ee667e639e038505b03627361ac828 /sw
parentb1cefa026d52fad4557d10c721fe9d5e57200bd6 (diff)
tdf#150293: setPropertyValue(WID_TXTCOL_LINE_WIDTH) takes mm100
Before commit 95ebd24a629b4c8cd62cc20c0701683512cc8fa0 Author Mike Kaganski <mike.kaganski@collabora.com> Date Thu May 27 13:00:10 2021 +0300 editengine-columns: ODF support [API CHANGE] SwXTextColumns crtor took SwFormatCol, and stored line width in the same units as in SwFormatCol - in twips; conversion to mm100 only happened at export stage in SwXTextColumns::getPropertyValue. The mentioned commit changed to SvxXTextColumns::setPropertyValue, passing the line width from SwFormatCol also without any conversion; but SvxXTextColumns::setPropertyValue expects mm100, so the result was wrong. So perform the proper conversion at SwFormatCol::QueryValue and SwFormatCol::PutValue, and also store the line width in mm100 in SvxXTextColumns, to avoid useless extra conversion. Change-Id: Idfd62a7563f9d3aa5947c1149572a8b8b696b179 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137931 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'sw')
-rw-r--r--sw/source/core/layout/atrfrm.cxx4
1 files changed, 3 insertions, 1 deletions
diff --git a/sw/source/core/layout/atrfrm.cxx b/sw/source/core/layout/atrfrm.cxx
index ad1c1c399291..775fe203c661 100644
--- a/sw/source/core/layout/atrfrm.cxx
+++ b/sw/source/core/layout/atrfrm.cxx
@@ -1114,7 +1114,8 @@ bool SwFormatCol::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const
}
}
uno::Any aVal;
- aVal <<= o3tl::narrowing<sal_Int32>(GetLineWidth());
+ aVal <<= o3tl::narrowing<sal_Int32>(
+ o3tl::convert(GetLineWidth(), o3tl::Length::twip, o3tl::Length::mm100));
xProps->setPropertyValue(UNO_NAME_SEPARATOR_LINE_WIDTH, aVal);
aVal <<= GetLineColor();
xProps->setPropertyValue(UNO_NAME_SEPARATOR_LINE_COLOR, aVal);
@@ -1204,6 +1205,7 @@ bool SwFormatCol::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
{
xProps->getPropertyValue(UNO_NAME_IS_AUTOMATIC) >>= m_bOrtho;
xProps->getPropertyValue(UNO_NAME_SEPARATOR_LINE_WIDTH) >>= m_nLineWidth;
+ m_nLineWidth = o3tl::toTwips(m_nLineWidth, o3tl::Length::mm100);
xProps->getPropertyValue(UNO_NAME_SEPARATOR_LINE_COLOR) >>= m_aLineColor;
if (sal_Int32 nHeight;
xProps->getPropertyValue(UNO_NAME_SEPARATOR_LINE_RELATIVE_HEIGHT) >>= nHeight)