[Libreoffice-commits] core.git: Branch 'libreoffice-7-1' - sc/qa sc/source

Andreas Heinisch (via logerrit) logerrit at kemper.freedesktop.org
Mon May 3 15:11:22 UTC 2021


 sc/qa/extras/macros-test.cxx            |   36 ++++++++++++++++++++++++++++++++
 sc/qa/extras/testdocuments/tdf90278.xls |binary
 sc/source/ui/vba/vbaborders.cxx         |    2 -
 3 files changed, 37 insertions(+), 1 deletion(-)

New commits:
commit 3958431dffc5f588de7d96e3356ea301bd03f2a6
Author:     Andreas Heinisch <andreas.heinisch at yahoo.de>
AuthorDate: Sat May 1 23:43:58 2021 +0200
Commit:     Xisco Fauli <xiscofauli at libreoffice.org>
CommitDate: Mon May 3 17:10:50 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>
    Signed-off-by: Xisco Fauli <xiscofauli at libreoffice.org>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115035

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
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 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;


More information about the Libreoffice-commits mailing list