diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2024-06-29 22:37:09 +0500 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2024-06-29 22:47:33 +0200 |
commit | 203bd3f6744649638703d1b4f7f9d517226557ce (patch) | |
tree | 4133720eb20b4afec346e58004b76ced6902463f /sw | |
parent | c910d8cd67a042ce722c416f879f566bca5bdd81 (diff) |
Fix VBA get*Padding, which returns a floating-point value
Introduced in commit f3234f4f14702da71528561418f07ee6670a8c2a (VBA
Add Padding properties to XTable, 2022-08-05). The unit test is
edited to test that the value returned by the methods is equal to
the initially set value, with precision of 0.1 pt.
Change-Id: I24144cd0e3c1e72bd2664a2a052ac3c7006595ff
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169762
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Tested-by: Jenkins
Diffstat (limited to 'sw')
-rw-r--r-- | sw/qa/core/data/docm/testTables.docm | bin | 28077 -> 27711 bytes | |||
-rw-r--r-- | sw/qa/core/macros-test.cxx | 5 | ||||
-rw-r--r-- | sw/source/ui/vba/vbatable.cxx | 8 |
3 files changed, 6 insertions, 7 deletions
diff --git a/sw/qa/core/data/docm/testTables.docm b/sw/qa/core/data/docm/testTables.docm Binary files differindex 5d4502ade055..d78f9a0abcfa 100644 --- a/sw/qa/core/data/docm/testTables.docm +++ b/sw/qa/core/data/docm/testTables.docm diff --git a/sw/qa/core/macros-test.cxx b/sw/qa/core/macros-test.cxx index 0e764eb1f3aa..21798735cd09 100644 --- a/sw/qa/core/macros-test.cxx +++ b/sw/qa/core/macros-test.cxx @@ -116,7 +116,7 @@ void SwMacrosTest::testVba() OUString("testFontColor.docm"), OUString("vnd.sun.Star.script:Project.ThisDocument.testAll?language=Basic&location=document") - } + }, // TODO - make these pass in Writer { OUString("testSentences.docm"), @@ -133,8 +133,7 @@ void SwMacrosTest::testVba() { u"testTables.docm"_ustr, u"vnd.sun.Star.script:Project.ThisDocument.TestAll?language=Basic&location=document"_ustr - } - + }, }; for (auto const & [ sFileBaseName, sMacroUrl ] : testInfo) { diff --git a/sw/source/ui/vba/vbatable.cxx b/sw/source/ui/vba/vbatable.cxx index 0cec73e88975..599991a8564b 100644 --- a/sw/source/ui/vba/vbatable.cxx +++ b/sw/source/ui/vba/vbatable.cxx @@ -101,7 +101,7 @@ SwVbaTable::getBottomPadding() uno::Reference< beans::XPropertySet > xPropertySet( mxTextTable, uno::UNO_QUERY_THROW); table::TableBorderDistances aTableBorderDistances; xPropertySet->getPropertyValue(u"TableBorderDistances"_ustr) >>= aTableBorderDistances; - return convertMm100ToPoint(aTableBorderDistances.BottomDistance); + return convertMm100ToPoint<double>(aTableBorderDistances.BottomDistance); } void SAL_CALL @@ -120,7 +120,7 @@ SwVbaTable::getLeftPadding() uno::Reference< beans::XPropertySet > xPropertySet( mxTextTable, uno::UNO_QUERY_THROW); table::TableBorderDistances aTableBorderDistances; xPropertySet->getPropertyValue(u"TableBorderDistances"_ustr) >>= aTableBorderDistances; - return convertMm100ToPoint(aTableBorderDistances.LeftDistance); + return convertMm100ToPoint<double>(aTableBorderDistances.LeftDistance); } void SAL_CALL @@ -139,7 +139,7 @@ SwVbaTable::getRightPadding() uno::Reference< beans::XPropertySet > xPropertySet( mxTextTable, uno::UNO_QUERY_THROW); table::TableBorderDistances aTableBorderDistances; xPropertySet->getPropertyValue(u"TableBorderDistances"_ustr) >>= aTableBorderDistances; - return convertMm100ToPoint(aTableBorderDistances.RightDistance); + return convertMm100ToPoint<double>(aTableBorderDistances.RightDistance); } void SAL_CALL @@ -158,7 +158,7 @@ SwVbaTable::getTopPadding() uno::Reference< beans::XPropertySet > xPropertySet( mxTextTable, uno::UNO_QUERY_THROW); table::TableBorderDistances aTableBorderDistances; xPropertySet->getPropertyValue(u"TableBorderDistances"_ustr) >>= aTableBorderDistances; - return convertMm100ToPoint(aTableBorderDistances.TopDistance); + return convertMm100ToPoint<double>(aTableBorderDistances.TopDistance); } void SAL_CALL |