[Libreoffice-commits] core.git: cui/qa sw/source

Miklos Vajna (via logerrit) logerrit at kemper.freedesktop.org
Wed Jan 29 08:09:15 UTC 2020


 cui/qa/uitest/dialogs/chardlg.py |   33 +++++++++++++++++++++++++++++++++
 sw/source/ui/chrdlg/chardlg.cxx  |    3 ++-
 2 files changed, 35 insertions(+), 1 deletion(-)

New commits:
commit 6d6e80435fd7f71342c429a67759a7b7b280cc55
Author:     Miklos Vajna <vmiklos at collabora.com>
AuthorDate: Tue Jan 28 21:21:19 2020 +0100
Commit:     Miklos Vajna <vmiklos at collabora.com>
CommitDate: Wed Jan 29 09:08:40 2020 +0100

    sw: add UI for semi-transparent text
    
    Somewhat surprisingly the test passed without the fix, i.e. the uitest
    operated happily on a hidden widget; so explicitly assert that it's
    visible.
    
    Change-Id: I321c7e0e3cb2d67a07724523c885d50577a116a5
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87656
    Tested-by: Jenkins
    Reviewed-by: Miklos Vajna <vmiklos at collabora.com>

diff --git a/cui/qa/uitest/dialogs/chardlg.py b/cui/qa/uitest/dialogs/chardlg.py
index 59cf10d18c29..26aff0f4a5be 100644
--- a/cui/qa/uitest/dialogs/chardlg.py
+++ b/cui/qa/uitest/dialogs/chardlg.py
@@ -7,6 +7,7 @@
 from libreoffice.uno.propertyvalue import mkPropertyValues
 from uitest.framework import UITestCase
 from uitest.uihelper.common import select_pos
+from uitest.uihelper.common import get_state_as_dict
 
 # Test for cui/source/tabpages/chardlg.cxx.
 class Test(UITestCase):
@@ -46,4 +47,36 @@ class Test(UITestCase):
         self.assertEqual(shape.CharTransparence, 5)
         self.ui_test.close_doc()
 
+    def testSvxCharEffectsPageWriter(self):
+        # Start Writer.
+        self.ui_test.create_doc_in_start_center("writer")
+        doc = self.xUITest.getTopFocusWindow()
+        editWin = doc.getChild("writer_edit")
+        # Type a character and select it.
+        editWin.executeAction("TYPE", mkPropertyValues({"KEYCODE": "TAB"}))
+        editWin.executeAction("TYPE", mkPropertyValues({"TEXT": "t"}))
+        self.xUITest.executeCommand(".uno:SelectAll")
+
+        # Now 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")
+        xFontTransparency = xDialog.getChild("fonttransparencymtr")
+        # Without the accompanying fix in place, this test would have failed with:
+        # AssertionError: 'false' != 'true'
+        # i.e. the transparency widget was hidden.
+        self.assertEqual(get_state_as_dict(xFontTransparency)["Visible"], "true")
+        for _ in range(5):
+            xFontTransparency.executeAction("UP", tuple())
+        self.ui_test.close_dialog_through_button(xDialog.getChild("ok"))
+
+        # Verify the result.
+        component = self.ui_test.get_component()
+        paragraph = component.Text.createEnumeration().nextElement()
+
+        self.assertEqual(paragraph.CharTransparence, 5)
+        self.ui_test.close_doc()
+
 # vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sw/source/ui/chrdlg/chardlg.cxx b/sw/source/ui/chrdlg/chardlg.cxx
index 95be6a1c4bf9..d3b779b9de7f 100644
--- a/sw/source/ui/chrdlg/chardlg.cxx
+++ b/sw/source/ui/chrdlg/chardlg.cxx
@@ -112,7 +112,8 @@ void SwCharDlg::PageCreated(const OString& rId, SfxTabPage &rPage)
     }
     else if (rId == "fonteffects")
     {
-        aSet.Put (SfxUInt32Item(SID_FLAG_TYPE,SVX_PREVIEW_CHARACTER|SVX_ENABLE_FLASH));
+        aSet.Put(SfxUInt32Item(SID_FLAG_TYPE, SVX_PREVIEW_CHARACTER | SVX_ENABLE_FLASH
+                                                  | SVX_ENABLE_CHAR_TRANSPARENCY));
         rPage.PageCreated(aSet);
     }
     else if (rId == "position")


More information about the Libreoffice-commits mailing list