[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.2' - cui/qa cui/source

Miklos Vajna (via logerrit) logerrit at kemper.freedesktop.org
Mon Feb 24 08:16:43 UTC 2020


 cui/qa/uitest/dialogs/chardlg.py |   21 +++++++++++++++++++++
 cui/source/tabpages/chardlg.cxx  |    2 +-
 2 files changed, 22 insertions(+), 1 deletion(-)

New commits:
commit 59edfb81f05da304b49609a239961607db6f6900
Author:     Miklos Vajna <vmiklos at collabora.com>
AuthorDate: Mon Feb 17 21:31:10 2020 +0100
Commit:     Miklos Vajna <vmiklos at collabora.com>
CommitDate: Mon Feb 24 09:16:09 2020 +0100

    tdf#130384 cui: fix automatic color showing up as white in the char dlg
    
    Regression from commit b4554b8eddd048532269df610e89ae739c46fab7 (cui:
    add UI for semi-transparent shape text, 2019-11-22), the problem was
    that COL_AUTO has the alpha channel set to 0xff, and we should not clear
    that, otherwise the color list box will present the automatic color as
    white.
    
    Change-Id: I6eae788606b003eec014c0c4a22b40053ff534d5
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/88884
    Tested-by: Jenkins
    Reviewed-by: Miklos Vajna <vmiklos at collabora.com>
    (cherry picked from commit 8553024059f934aaf8bc488f01869fdc6922c120)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89224
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>

diff --git a/cui/qa/uitest/dialogs/chardlg.py b/cui/qa/uitest/dialogs/chardlg.py
index 26aff0f4a5be..2545d268274a 100644
--- a/cui/qa/uitest/dialogs/chardlg.py
+++ b/cui/qa/uitest/dialogs/chardlg.py
@@ -79,4 +79,25 @@ class Test(UITestCase):
         self.assertEqual(paragraph.CharTransparence, 5)
         self.ui_test.close_doc()
 
+    def testSvxCharEffectsPageWriterAutomatic(self):
+        # Start Writer.
+        self.ui_test.create_doc_in_start_center("writer")
+        doc = self.xUITest.getTopFocusWindow()
+        editWin = doc.getChild("writer_edit")
+
+        # Use Format -> Character.
+        self.ui_test.execute_dialog_through_command(".uno:FontDialog")
+        xDialog = self.xUITest.getTopFocusWindow()
+        xTabs = xDialog.getChild("tabcontrol")
+        # Select RID_SVXPAGE_CHAR_EFFECTS.
+        select_pos(xTabs, "1")
+        xFontColorLB = xDialog.getChild("fontcolorlb")
+        # Without the accompanying fix in place, this test would have failed with:
+        # AssertionError: 'White' != 'Automatic'
+        # i.e. the auto color lost its alpha component and appeared as white.
+        self.assertEqual(get_state_as_dict(xFontColorLB)["Text"], "Automatic")
+
+        self.ui_test.close_dialog_through_button(xDialog.getChild("ok"))
+        self.ui_test.close_doc()
+
 # vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/cui/source/tabpages/chardlg.cxx b/cui/source/tabpages/chardlg.cxx
index 067f1c773ec0..1a2c6a3bb2fa 100644
--- a/cui/source/tabpages/chardlg.cxx
+++ b/cui/source/tabpages/chardlg.cxx
@@ -1584,7 +1584,7 @@ void SvxCharEffectsPage::ResetColor_Impl( const SfxItemSet& rSet )
             m_aPreviewWin.Invalidate();
 
             Color aRGBColor = aColor;
-            if (aRGBColor.GetTransparency())
+            if (aRGBColor.GetTransparency() && aColor != COL_AUTO)
             {
                 aRGBColor.SetTransparency(0);
             }


More information about the Libreoffice-commits mailing list