[Libreoffice-commits] core.git: sc/qa sc/source
Andreas Heinisch (via logerrit)
logerrit at kemper.freedesktop.org
Mon May 3 09:28:26 UTC 2021
sc/qa/extras/macros-test.cxx | 35 ++++++++++++++++++++++++++++++++
sc/qa/extras/testdocuments/tdf90278.xls |binary
sc/source/ui/vba/vbaborders.cxx | 2 -
3 files changed, 36 insertions(+), 1 deletion(-)
New commits:
commit 357b36c7797ca7ac249714e5ddca1f04e0228c0e
Author: Andreas Heinisch <andreas.heinisch at yahoo.de>
AuthorDate: Sat May 1 23:43:58 2021 +0200
Commit: Andreas Heinisch <andreas.heinisch at yahoo.de>
CommitDate: Mon May 3 11:27:49 2021 +0200
tdf#90278 - Set the vba border to the default border
The default border width in calc is 0.75[pt] * 1/72[inch] * 2.54[cm/inch]
= 0.0264[cm] set in 2f527738ea4f8e93acafdd7f0ae06de1678cfdd8 which
contradicts the border setting of OOLineThin used in order to parse vba
borders. The latter was set to 1.00[pt] * 1/72[inch] * 2.54[cm/inch] =
0.0352[cm]. This mismatch leads to an exception when the corresponding
weight of a cell is parsed.
Change-Id: I945d8aecdf31e5ad76d0d04e76eaaf4668e3d8ea
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114980
Tested-by: Jenkins
Reviewed-by: Andreas Heinisch <andreas.heinisch at yahoo.de>
diff --git a/sc/qa/extras/macros-test.cxx b/sc/qa/extras/macros-test.cxx
index fa58d7e51f33..751e31a28eda 100644
--- a/sc/qa/extras/macros-test.cxx
+++ b/sc/qa/extras/macros-test.cxx
@@ -13,6 +13,7 @@
#include <sal/log.hxx>
#include <unotools/tempfile.hxx>
#include <vcl/svapp.hxx>
+#include <editeng/borderline.hxx>
#include <docsh.hxx>
#include <document.hxx>
@@ -57,6 +58,7 @@ public:
void testTdf133889();
void testTdf138646();
void testTdf105558();
+ void testTdf90278();
CPPUNIT_TEST_SUITE(ScMacrosTest);
CPPUNIT_TEST(testStarBasic);
@@ -81,6 +83,7 @@ public:
CPPUNIT_TEST(testTdf133889);
CPPUNIT_TEST(testTdf138646);
CPPUNIT_TEST(testTdf105558);
+ CPPUNIT_TEST(testTdf90278);
CPPUNIT_TEST_SUITE_END();
};
@@ -1050,6 +1053,38 @@ void ScMacrosTest::testTdf105558()
xCloseable->close(true);
}
+void ScMacrosTest::testTdf90278()
+{
+ OUString aFileName;
+ createFileURL(u"tdf90278.xls", aFileName);
+ auto xComponent = loadFromDesktop(aFileName, "com.sun.star.sheet.SpreadsheetDocument");
+ CPPUNIT_ASSERT(xComponent);
+
+ SfxObjectShell* pFoundShell = SfxObjectShell::GetShellFromComponent(xComponent);
+ CPPUNIT_ASSERT(pFoundShell);
+
+ ScDocShellRef xDocSh = dynamic_cast<ScDocShell*>(pFoundShell);
+ CPPUNIT_ASSERT(xDocSh);
+
+ Any aRet;
+ Sequence<sal_Int16> aOutParamIndex;
+ Sequence<Any> aOutParam;
+ Sequence<uno::Any> aParams;
+
+ // Without the fix in place, changing the border weight
+ // would cause a Basic exception/error in the following script.
+ SfxObjectShell::CallXScript(
+ xComponent,
+ "vnd.sun.Star.script:VBAProject.Module1.BorderWeight?language=Basic&location=document",
+ aParams, aRet, aOutParamIndex, aOutParam);
+
+ // Check the border weight of the corresponding cell in the test document
+ sal_Int32 aReturnValue;
+ aRet >>= aReturnValue;
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(2), aReturnValue);
+
+ xDocSh->DoClose();
+}
ScMacrosTest::ScMacrosTest()
: UnoApiTest("/sc/qa/extras/testdocuments")
diff --git a/sc/qa/extras/testdocuments/tdf90278.xls b/sc/qa/extras/testdocuments/tdf90278.xls
new file mode 100644
index 000000000000..2d794555666d
Binary files /dev/null and b/sc/qa/extras/testdocuments/tdf90278.xls differ
diff --git a/sc/source/ui/vba/vbaborders.cxx b/sc/source/ui/vba/vbaborders.cxx
index b4366a4e1897..34f2f0fe3f42 100644
--- a/sc/source/ui/vba/vbaborders.cxx
+++ b/sc/source/ui/vba/vbaborders.cxx
@@ -45,7 +45,7 @@ const sal_Int16 supportedIndexTable[] = { XlBordersIndex::xlEdgeLeft, XlBorders
constexpr OUStringLiteral sTableBorder = u"TableBorder";
// Equiv widths in 1/100 mm
-const sal_Int32 OOLineThin = 35;
+const sal_Int32 OOLineThin = 26;
const sal_Int32 OOLineMedium = 88;
const sal_Int32 OOLineThick = 141;
const sal_Int32 OOLineHairline = 2;
More information about the Libreoffice-commits
mailing list