cui/source/tabpages/chardlg.cxx | 5 +---- sc/qa/uitest/chart/chartAxes.py | 13 +++++++++++++ 2 files changed, 14 insertions(+), 4 deletions(-)
New commits: commit d5a43da338e4afe3630a072351516e39865a1f2f Author: Miklos Vajna <vmik...@collabora.com> AuthorDate: Mon Sep 25 20:08:53 2023 +0200 Commit: Miklos Vajna <vmik...@collabora.com> CommitDate: Tue Sep 26 08:18:22 2023 +0200 tdf#148959 cui: fix hiding semi-transparent UI for chart axis font Regression from commit b4554b8eddd048532269df610e89ae739c46fab7 (cui: add UI for semi-transparent shape text, 2019-11-22), the trouble was that even if semi-transparent text UI is meant to be opt in, we enabled it by accident also for charts. This happens because I assumed that we always get a SID_FLAG_TYPE, and then we can hide the not wanted UI in case SVX_ENABLE_CHAR_TRANSPARENCY is not in the flags, but even SID_FLAG_TYPE can be missing. Fix the problem by assuming that in case SID_FLAG_TYPE is not provided, that means no flags. An alternative would be to actually add support for semi-transparent text in chart2/, which is doable, but chart::wrapper::ItemConverter::ApplyItemSet() assumes that each pool item can be mapped to exactly one UNO property, which is not the case for SvxColorItem (it would have to map to CharColor and CharTransparence), so don't do that yet. Change-Id: I825ca56b2e03d48c8acff93e1deadf8f86b0dcb0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157258 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmik...@collabora.com> diff --git a/cui/source/tabpages/chardlg.cxx b/cui/source/tabpages/chardlg.cxx index 3245f516338c..56eb92e9b172 100644 --- a/cui/source/tabpages/chardlg.cxx +++ b/cui/source/tabpages/chardlg.cxx @@ -2389,10 +2389,7 @@ void SvxCharEffectsPage::PageCreated(const SfxAllItemSet& aSet) if (pDisableCtlItem) DisableControls(pDisableCtlItem->GetValue()); - if (!pFlagItem) - return; - - sal_uInt32 nFlags=pFlagItem->GetValue(); + sal_uInt32 nFlags = pFlagItem ? pFlagItem->GetValue() : 0; if ( ( nFlags & SVX_PREVIEW_CHARACTER ) == SVX_PREVIEW_CHARACTER ) // the writer uses SID_ATTR_BRUSH as font background m_bPreviewBackgroundToCharacter = true; diff --git a/sc/qa/uitest/chart/chartAxes.py b/sc/qa/uitest/chart/chartAxes.py index a4ca1d8a1c35..4a5cbab2e5ef 100644 --- a/sc/qa/uitest/chart/chartAxes.py +++ b/sc/qa/uitest/chart/chartAxes.py @@ -10,6 +10,7 @@ from uitest.framework import UITestCase from uitest.uihelper.common import get_state_as_dict, get_url_for_data_file from libreoffice.uno.propertyvalue import mkPropertyValues +from uitest.uihelper.common import select_pos # Chart Enable Axes dialog @@ -55,5 +56,17 @@ class chartAxes(UITestCase): self.assertEqual(get_state_as_dict(secondaryX)["Selected"], "true") self.assertEqual(get_state_as_dict(secondaryY)["Selected"], "true") + # Test Format -> Axis -> X Axis...: the child name is generated in + # lcl_getAxisCIDForCommand(). + xAxisX = xChartMain.getChild("CID/D=0:CS=0:Axis=0,0") + with self.ui_test.execute_dialog_through_action(xAxisX, "COMMAND", mkPropertyValues({"COMMAND": "DiagramAxisX"})) as xDialog: + xTabs = xDialog.getChild("tabcontrol") + # Select RID_SVXPAGE_CHAR_EFFECTS, see the SchAttribTabDlg ctor. + select_pos(xTabs, "6") + xFontTransparency = xDialog.getChild("fonttransparencymtr") + # Without the accompanying fix in place, this test would have failed, the + # semi-transparent text UI was visible, but then it was lost on save. + self.assertEqual(get_state_as_dict(xFontTransparency)["Visible"], "false") + # vim: set shiftwidth=4 softtabstop=4 expandtab: