[Libreoffice-commits] core.git: 2 commits - sc/qa vcl/skia

Luboš Luňák (via logerrit) logerrit at kemper.freedesktop.org
Mon May 24 08:58:26 UTC 2021


 sc/qa/unit/uicalc/uicalc.cxx |   30 ++++++++++++++++++++++++++++++
 vcl/skia/x11/textrender.cxx  |    3 +--
 2 files changed, 31 insertions(+), 2 deletions(-)

New commits:
commit 2dc3097702c3b0b9225b5abadc94b90d63e628e7
Author:     Luboš Luňák <l.lunak at collabora.com>
AuthorDate: Wed May 5 19:51:35 2021 +0200
Commit:     Luboš Luňák <l.lunak at collabora.com>
CommitDate: Mon May 24 10:57:53 2021 +0200

    fix skia/x11 text artifical italic
    
    This is supposed to be floating-point division. Also, the 0x6000
    value comes from cairo text rendering, but it seems to be too much,
    0x4000 visually seems to give a better result (and also avoid
    clipping in some cases).
    
    Change-Id: Idd99c64ba897eed211e227a88a40b06dbdfd5614
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115617
    Tested-by: Jenkins
    Reviewed-by: Luboš Luňák <l.lunak at collabora.com>

diff --git a/vcl/skia/x11/textrender.cxx b/vcl/skia/x11/textrender.cxx
index e8596641c052..7021d9794f5e 100644
--- a/vcl/skia/x11/textrender.cxx
+++ b/vcl/skia/x11/textrender.cxx
@@ -50,9 +50,8 @@ void SkiaTextRender::DrawTextLayout(const GenericSalLayout& rLayout, const SalGr
         = SkFontMgr_createTypefaceFromFcPattern(fontManager, rFont.GetFontOptions()->GetPattern());
     SkFont font(typeface, nHeight);
     font.setScaleX(1.0 * nWidth / nHeight);
-    // TODO are these correct?
     if (rFont.NeedsArtificialItalic())
-        font.setSkewX(-0x6000L / 0x10000L);
+        font.setSkewX(1.0 * -0x4000L / 0x10000L);
     if (rFont.NeedsArtificialBold())
         font.setEmbolden(true);
     font.setEdging(rFont.GetAntialiasAdvice() ? SkFont::Edging::kAntiAlias
commit 27192c82ab143287327367d6165737086613021f
Author:     Xisco Fauli <xiscofauli at libreoffice.org>
AuthorDate: Mon May 24 09:30:01 2021 +0200
Commit:     Xisco Fauli <xiscofauli at libreoffice.org>
CommitDate: Mon May 24 10:57:41 2021 +0200

    tdf#134675: sc_uicalc: Add unittest
    
    Change-Id: Ie76152ca1b1b80d60fcd891548c5eb4f32bcb40c
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116033
    Tested-by: Jenkins
    Reviewed-by: Xisco Fauli <xiscofauli at libreoffice.org>

diff --git a/sc/qa/unit/uicalc/uicalc.cxx b/sc/qa/unit/uicalc/uicalc.cxx
index e86bfbfa62a7..aa5d8b5fcd02 100644
--- a/sc/qa/unit/uicalc/uicalc.cxx
+++ b/sc/qa/unit/uicalc/uicalc.cxx
@@ -1566,6 +1566,36 @@ CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf123202)
     CPPUNIT_ASSERT(pDoc->RowHidden(2, 0));
 }
 
+CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf134675)
+{
+    mxComponent = loadFromDesktop("private:factory/scalc");
+    ScModelObj* pModelObj = dynamic_cast<ScModelObj*>(mxComponent.get());
+    CPPUNIT_ASSERT(pModelObj);
+    ScDocument* pDoc = pModelObj->GetDocument();
+    CPPUNIT_ASSERT(pDoc);
+    insertStringToCell(*pModelObj, "A1", "A");
+
+    // Select column A
+    goToCell("A:A");
+
+    dispatchCommand(mxComponent, ".uno:Copy", {});
+    Scheduler::ProcessEventsToIdle();
+
+    // Select column B to Z
+    goToCell("B:Z");
+
+    dispatchCommand(mxComponent, ".uno:Paste", {});
+    Scheduler::ProcessEventsToIdle();
+
+    for (size_t i = 1; i < 24; ++i)
+    {
+        // Without the fix in place, this test would have failed here with
+        // - Expected: A
+        // - Actual  :
+        CPPUNIT_ASSERT_EQUAL(OUString("A"), pDoc->GetString(ScAddress(i, 0, 0)));
+    }
+}
+
 CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf116215)
 {
     mxComponent = loadFromDesktop("private:factory/scalc");


More information about the Libreoffice-commits mailing list