summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Heinisch <andreas.heinisch@yahoo.de>2021-05-01 23:43:58 +0200
committerXisco Fauli <xiscofauli@libreoffice.org>2021-05-03 17:10:50 +0200
commit3958431dffc5f588de7d96e3356ea301bd03f2a6 (patch)
treef56ef3db4312a5f025bfed5124eeeee9c942bb3a
parenttdf#141556 Fix 100% CPU usage in Writer idle loop (diff)
downloadcore-3958431dffc5f588de7d96e3356ea301bd03f2a6.tar.gz
core-3958431dffc5f588de7d96e3356ea301bd03f2a6.zip
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@yahoo.de> Signed-off-by: Xisco Fauli <xiscofauli@libreoffice.org> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115035
-rw-r--r--sc/qa/extras/macros-test.cxx36
-rw-r--r--sc/qa/extras/testdocuments/tdf90278.xlsbin0 -> 31744 bytes
-rw-r--r--sc/source/ui/vba/vbaborders.cxx2
3 files changed, 37 insertions, 1 deletions
diff --git a/sc/qa/extras/macros-test.cxx b/sc/qa/extras/macros-test.cxx
index fce7684e53a4..9322a3eab7cd 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>
@@ -53,6 +54,7 @@ public:
void testTdf71271();
void testTdf43003();
void testTdf138646();
+ void testTdf90278();
CPPUNIT_TEST_SUITE(ScMacrosTest);
CPPUNIT_TEST(testStarBasic);
@@ -72,6 +74,7 @@ public:
CPPUNIT_TEST(testTdf71271);
CPPUNIT_TEST(testTdf43003);
CPPUNIT_TEST(testTdf138646);
+ CPPUNIT_TEST(testTdf90278);
CPPUNIT_TEST_SUITE_END();
};
@@ -912,6 +915,39 @@ void ScMacrosTest::testTdf138646()
pDocSh->DoClose();
}
+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
--- /dev/null
+++ b/sc/qa/extras/testdocuments/tdf90278.xls
Binary files differ
diff --git a/sc/source/ui/vba/vbaborders.cxx b/sc/source/ui/vba/vbaborders.cxx
index 97034dec7a0b..7db67fa3eefb 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
const char sTableBorder[] = "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;