summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2022-06-04 21:10:16 +0100
committerCaolán McNamara <caolanm@redhat.com>2022-06-05 18:31:16 +0200
commit3cca2c605313576187878a195fb612eb25bd6150 (patch)
treeaefde04eed4c4d81a6512057f7eeb09eb21de575 /sc
parente6b5c2dc0bb12c7e0d23857bdd0e22076d587ca3 (diff)
restore %PRODUCTNAME to accessible descriptions that need them
The original problem was that %PRODUCTNAME wasn't replaced for accessibility descriptions (which are reused for extended tips) under gtk. Universally querying all a11y descs on load to potentially replace %PRODUCTNAME in a11y descs at runtime led to tdf146971 which was a huge startup slowdown. The half way 7.3 fix was to leave a11y descs alone, but do the replacement when querying for the extended tip case. So the extended tooltips were ok, but screen readers would still say a raw "%PRODUCTNAME" text, hence the rewording effort to remove %PRODUCTNAME from the a11y descs entirely for 7.4. But there is now a few cases where some options paths exists in the a11y descs which is not exactly correct wrt to the text shown in the options dialog. Reworking the options dialog to not have %PRODUCTNAME there at all and updating everything to fit that sort of change would not be popular. So move the cases where a11y descs really should have %PRODUCTNAME in them out of the .ui files and into .hrc files and use specific set_accessibility_description calls for them via ResID which will do the %PRODUCTNAME replacement automatically. Hopefully the a11y runtime cost for just this handful of cases is negligible in the overall scheme of things. Change-Id: Ieb17d26fd581cd5804a52b371b3bb5ea43023aa3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135432 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sc')
-rw-r--r--sc/inc/strings.hrc6
-rw-r--r--sc/source/ui/dbgui/tpsort.cxx1
-rw-r--r--sc/source/ui/dbgui/tpsubt.cxx2
-rw-r--r--sc/source/ui/optdlg/tpview.cxx2
-rw-r--r--sc/uiconfig/scalc/ui/sortoptionspage.ui1
-rw-r--r--sc/uiconfig/scalc/ui/subtotaloptionspage.ui10
-rw-r--r--sc/uiconfig/scalc/ui/tpviewpage.ui5
7 files changed, 11 insertions, 16 deletions
diff --git a/sc/inc/strings.hrc b/sc/inc/strings.hrc
index 8f94d9a94104..90c1a91e5f8d 100644
--- a/sc/inc/strings.hrc
+++ b/sc/inc/strings.hrc
@@ -382,4 +382,10 @@
#define STR_BORDER_DOUBLE_3 NC_("STR_BORDER_DOUBLE_3", "Medium/Hairline (%s pt)")
#define STR_BORDER_DOUBLE_4 NC_("STR_BORDER_DOUBLE_4", "Medium/Medium (%s pt)")
+// acccessibility descriptions that use %PRODUCTNAME, we set these explicitly because querying a11y descs
+// in order to change %PRODUCTNAME at runtime is expensive, so limit doing that as much as possible.
+#define STR_A11Y_DESC_SORTUSER NC_("sortoptionspage|extended_tip|sortuserlb", "Select the custom sort order that you want to apply. To define a custom sort order, choose Tools - Options - %PRODUCTNAME Calc - Sort Lists.")
+#define STR_A11Y_DESC_USERDEF NC_("subtotaloptionspage|extended_tip|lbuserdef", "Uses a custom sorting order that you defined in the Options dialog box at %PRODUCTNAME Calc - Sort Lists.")
+#define STR_A11Y_DESC_ANNOT NC_("extended_tip|annot", "Specifies that a small rectangle in the top right corner of the cell indicates that a comment exists. The comment will be shown only when you enable tips under %PRODUCTNAME - General in the Options dialog box.")
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/dbgui/tpsort.cxx b/sc/source/ui/dbgui/tpsort.cxx
index 9fa00704d148..3455f11006cf 100644
--- a/sc/source/ui/dbgui/tpsort.cxx
+++ b/sc/source/ui/dbgui/tpsort.cxx
@@ -511,6 +511,7 @@ ScTabPageSortOptions::ScTabPageSortOptions(weld::Container* pPage, weld::DialogC
, m_xBtnIncImages(m_xBuilder->weld_check_button("includeimages"))
{
m_xLbSortUser->set_size_request(m_xLbSortUser->get_approximate_digit_width() * 50, -1);
+ m_xLbSortUser->set_accessible_description(ScResId(STR_A11Y_DESC_SORTUSER));
Init();
SetExchangeSupport();
}
diff --git a/sc/source/ui/dbgui/tpsubt.cxx b/sc/source/ui/dbgui/tpsubt.cxx
index aa5f38862701..01431c8156c6 100644
--- a/sc/source/ui/dbgui/tpsubt.cxx
+++ b/sc/source/ui/dbgui/tpsubt.cxx
@@ -454,6 +454,8 @@ ScTpSubTotalOptions::ScTpSubTotalOptions(weld::Container* pPage, weld::DialogCon
, m_xBtnUserDef(m_xBuilder->weld_check_button("btnuserdef"))
, m_xLbUserDef(m_xBuilder->weld_combo_box("lbuserdef"))
{
+ m_xLbUserDef->set_accessible_description(ScResId(STR_A11Y_DESC_USERDEF));
+ m_xBtnUserDef->set_accessible_description(ScResId(STR_A11Y_DESC_USERDEF));
Init();
}
diff --git a/sc/source/ui/optdlg/tpview.cxx b/sc/source/ui/optdlg/tpview.cxx
index 4809061b4005..d7cd46303a26 100644
--- a/sc/source/ui/optdlg/tpview.cxx
+++ b/sc/source/ui/optdlg/tpview.cxx
@@ -25,6 +25,7 @@
#include <scresid.hxx>
#include <docsh.hxx>
#include <sc.hrc>
+#include <strings.hrc>
#include <units.hrc>
#include <appoptio.hxx>
#include <scmod.hxx>
@@ -71,6 +72,7 @@ ScTpContentOptions::ScTpContentOptions(weld::Container* pPage, weld::DialogContr
m_xFormulaCB->connect_toggled(aCBHdl);
m_xNilCB->connect_toggled(aCBHdl);
m_xAnnotCB->connect_toggled(aCBHdl);
+ m_xAnnotCB->set_accessible_description(ScResId(STR_A11Y_DESC_ANNOT));
m_xValueCB->connect_toggled(aCBHdl);
m_xAnchorCB->connect_toggled(aCBHdl);
m_xClipMarkCB->connect_toggled(aCBHdl);
diff --git a/sc/uiconfig/scalc/ui/sortoptionspage.ui b/sc/uiconfig/scalc/ui/sortoptionspage.ui
index 0ad1ba655dc7..9f3f427f780a 100644
--- a/sc/uiconfig/scalc/ui/sortoptionspage.ui
+++ b/sc/uiconfig/scalc/ui/sortoptionspage.ui
@@ -207,7 +207,6 @@
<child internal-child="accessible">
<object class="AtkObject" id="sortuserlb-atkobject">
<property name="AtkObject::accessible-name" translatable="yes" context="sortoptionspage|sortuserlb-atkobject">Custom sort order</property>
- <property name="AtkObject::accessible-description" translatable="yes" context="sortoptionspage|extended_tip|sortuserlb">Select the custom sort order that you want to apply. To define a custom sort order, choose Tools - Options - Calc - Sort Lists.</property>
</object>
</child>
</object>
diff --git a/sc/uiconfig/scalc/ui/subtotaloptionspage.ui b/sc/uiconfig/scalc/ui/subtotaloptionspage.ui
index f7620b8f4ae5..d81fb987be61 100644
--- a/sc/uiconfig/scalc/ui/subtotaloptionspage.ui
+++ b/sc/uiconfig/scalc/ui/subtotaloptionspage.ui
@@ -196,11 +196,6 @@
<accessibility>
<relation type="label-for" target="lbuserdef"/>
</accessibility>
- <child internal-child="accessible">
- <object class="AtkObject" id="btnuserdef-atkobject">
- <property name="AtkObject::accessible-description" translatable="yes" context="subtotaloptionspage|extended_tip|btnuserdef">Uses a custom sorting order that you defined in the Options dialog box at Calc - Sort Lists.</property>
- </object>
- </child>
</object>
<packing>
<property name="left_attach">0</property>
@@ -215,11 +210,6 @@
<accessibility>
<relation type="labelled-by" target="btnuserdef"/>
</accessibility>
- <child internal-child="accessible">
- <object class="AtkObject" id="lbuserdef-atkobject">
- <property name="AtkObject::accessible-description" translatable="yes" context="subtotaloptionspage|extended_tip|lbuserdef">Uses a custom sorting order that you defined in the Options dialog box at Calc - Sort Lists.</property>
- </object>
- </child>
</object>
<packing>
<property name="left_attach">0</property>
diff --git a/sc/uiconfig/scalc/ui/tpviewpage.ui b/sc/uiconfig/scalc/ui/tpviewpage.ui
index 032f94da3188..18acb5e2fadb 100644
--- a/sc/uiconfig/scalc/ui/tpviewpage.ui
+++ b/sc/uiconfig/scalc/ui/tpviewpage.ui
@@ -72,11 +72,6 @@
<property name="receives-default">False</property>
<property name="use-underline">True</property>
<property name="draw-indicator">True</property>
- <child internal-child="accessible">
- <object class="AtkObject" id="annot-atkobject">
- <property name="AtkObject::accessible-description" translatable="yes" context="extended_tip|annot">Specifies that a small rectangle in the top right corner of the cell indicates that a comment exists. The comment will be shown only when you enable tips under General in the Options dialog box.</property>
- </object>
- </child>
</object>
<packing>
<property name="left-attach">0</property>