From 1df8f5979a818f10c3654a2a9bcb5c1184c53278 Mon Sep 17 00:00:00 2001 From: Michael Weghorn Date: Fri, 7 Feb 2025 13:16:32 +0100 Subject: [PATCH] a11y: Move EditBrowseBoxTableCell to svtools While the AccessibleBrowseBoxCell base class and other AccessibleBrowseBox* classes are used for both, SvHeaderTabListBox (in vcl) and BrowseBox (in svtools), EditBrowseBoxTableCell is only used for the latter, in order to make the currently active edit control accessible. Therefore, move the class to the svtools library, where BrowseBox is located as well. This is also in preparation of reworking how accessibility for BrowseBox's currently active control is implemented. Change-Id: Ia290df4b497baa66f98c1065c2425a0e2e079d13 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/181267 Tested-by: Jenkins Reviewed-by: Michael Weghorn --- include/svtools/strings.hrc | 3 +++ solenv/clang-format/excludelist | 4 ++-- svtools/Library_svt.mk | 1 + .../source/brwbox}/accessibleeditbrowseboxcell.cxx | 11 +++++------ .../source/brwbox}/accessibleeditbrowseboxcell.hxx | 2 +- svtools/source/brwbox/editbrowsebox2.cxx | 1 - svtools/source/brwbox/editbrowseboximpl.hxx | 2 +- vcl/Library_vcl.mk | 1 - vcl/inc/strings.hrc | 2 -- 9 files changed, 13 insertions(+), 14 deletions(-) rename {vcl/source/accessibility => svtools/source/brwbox}/accessibleeditbrowseboxcell.cxx (95%) rename {include/vcl/accessibility => svtools/source/brwbox}/accessibleeditbrowseboxcell.hxx (98%) diff --git a/include/svtools/strings.hrc b/include/svtools/strings.hrc index faa3e7cd4b2a..a4f5873ed0af 100644 --- a/include/svtools/strings.hrc +++ b/include/svtools/strings.hrc @@ -278,6 +278,9 @@ #define STR_WARNING_INVALIDJAVASETTINGS_TITLE NC_("STR_WARNING_INVALIDJAVASETTINGS_TITLE", "Select JRE") #define STR_ERROR_JVMCREATIONFAILED_TITLE NC_("STR_ERROR_JVMCREATIONFAILED_TITLE", "JRE is Defective") +#define STR_ACC_COLUMN_NUM NC_("STR_ACC_COLUMN_NUM", "Column %COLUMNNUMBER") +#define STR_ACC_ROW_NUM NC_("STR_ACC_ROW_NUM", "Row %ROWNUMBER") + // accessibility 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_OPTIONS NC_("printersetupdialog|extended_tip|options", "Opens the Printer Options dialog where you can override the global printer options set on the Tools - Options - %PRODUCTNAME Writer/Web - Print panel for the current document.") diff --git a/solenv/clang-format/excludelist b/solenv/clang-format/excludelist index 72ee3d33a11d..3b7235aecfee 100644 --- a/solenv/clang-format/excludelist +++ b/solenv/clang-format/excludelist @@ -6118,7 +6118,6 @@ include/vcl/accessibility/AccessibleBrowseBoxObjType.hxx include/vcl/accessibility/AccessibleBrowseBoxTable.hxx include/vcl/accessibility/AccessibleBrowseBoxTableBase.hxx include/vcl/accessibility/AccessibleBrowseBoxTableCell.hxx -include/vcl/accessibility/accessibleeditbrowseboxcell.hxx include/vcl/BitmapBuffer.hxx include/vcl/BitmapColor.hxx include/vcl/BitmapPalette.hxx @@ -10932,6 +10931,8 @@ svl/unx/source/svdde/ddedummy.cxx svtools/inc/strings.hxx svtools/inc/framestatuslistener.hxx svtools/langsupport/langsupport.cxx +svtools/source/brwbox/accessibleeditbrowseboxcell.cxx +svtools/source/brwbox/accessibleeditbrowseboxcell.hxx svtools/source/brwbox/brwbox1.cxx svtools/source/brwbox/brwbox2.cxx svtools/source/brwbox/brwbox3.cxx @@ -14125,7 +14126,6 @@ vcl/source/accessibility/AccessibleBrowseBoxTableBase.cxx vcl/source/accessibility/AccessibleBrowseBoxTableCell.cxx vcl/source/accessibility/acc_factory.cxx vcl/source/accessibility/accessiblebrowseboxcell.cxx -vcl/source/accessibility/accessibleeditbrowseboxcell.cxx vcl/source/accessibility/accessibleiconchoicectrl.cxx vcl/source/accessibility/accessibleiconchoicectrlentry.cxx vcl/source/accessibility/accessiblelistbox.cxx diff --git a/svtools/Library_svt.mk b/svtools/Library_svt.mk index 5782d70261ac..3fbae7468957 100644 --- a/svtools/Library_svt.mk +++ b/svtools/Library_svt.mk @@ -68,6 +68,7 @@ $(eval $(call gb_Library_use_externals,svt,\ )) $(eval $(call gb_Library_add_exception_objects,svt,\ + svtools/source/brwbox/accessibleeditbrowseboxcell \ svtools/source/brwbox/brwbox1 \ svtools/source/brwbox/brwbox2 \ svtools/source/brwbox/brwbox3 \ diff --git a/vcl/source/accessibility/accessibleeditbrowseboxcell.cxx b/svtools/source/brwbox/accessibleeditbrowseboxcell.cxx similarity index 95% rename from vcl/source/accessibility/accessibleeditbrowseboxcell.cxx rename to svtools/source/brwbox/accessibleeditbrowseboxcell.cxx index 6d6a99e12ed0..b3a185481956 100644 --- a/vcl/source/accessibility/accessibleeditbrowseboxcell.cxx +++ b/svtools/source/brwbox/accessibleeditbrowseboxcell.cxx @@ -17,13 +17,12 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#include -#include +#include "accessibleeditbrowseboxcell.hxx" #include -#include #include -#include +#include +#include using namespace com::sun::star::accessibility; using namespace ::com::sun::star::uno; @@ -109,8 +108,8 @@ OUString SAL_CALL EditBrowseBoxTableCell::getAccessibleName() SolarMethodGuard aGuard(getMutex()); ensureIsAlive(); - return VclResId(RID_STR_ACC_COLUMN_NUM).replaceAll("%COLUMNNUMBER", OUString::number(getColumnPos()-1)) + ", " - + VclResId(RID_STR_ACC_ROW_NUM).replaceAll("%ROWNUMBER", OUString::number(getRowPos())); + return SvtResId(STR_ACC_COLUMN_NUM).replaceAll("%COLUMNNUMBER", OUString::number(getColumnPos()-1)) + ", " + + SvtResId(STR_ACC_ROW_NUM).replaceAll("%ROWNUMBER", OUString::number(getRowPos())); } css::uno::Reference< css::accessibility::XAccessibleRelationSet > SAL_CALL EditBrowseBoxTableCell::getAccessibleRelationSet() diff --git a/include/vcl/accessibility/accessibleeditbrowseboxcell.hxx b/svtools/source/brwbox/accessibleeditbrowseboxcell.hxx similarity index 98% rename from include/vcl/accessibility/accessibleeditbrowseboxcell.hxx rename to svtools/source/brwbox/accessibleeditbrowseboxcell.hxx index 0c40aa7d2cf8..5a74a3873cb1 100644 --- a/include/vcl/accessibility/accessibleeditbrowseboxcell.hxx +++ b/svtools/source/brwbox/accessibleeditbrowseboxcell.hxx @@ -86,7 +86,7 @@ private: // = EditBrowseBoxTableCell // XAccessible providing an EditBrowseBoxTableCell -class VCL_DLLPUBLIC EditBrowseBoxTableCellAccess final +class EditBrowseBoxTableCellAccess final : public comphelper::WeakComponentImplHelper { css::uno::WeakReference< css::accessibility::XAccessibleContext > diff --git a/svtools/source/brwbox/editbrowsebox2.cxx b/svtools/source/brwbox/editbrowsebox2.cxx index 0c089650ac09..1d97e1283a58 100644 --- a/svtools/source/brwbox/editbrowsebox2.cxx +++ b/svtools/source/brwbox/editbrowsebox2.cxx @@ -24,7 +24,6 @@ #include #include #include -#include #include #include #include diff --git a/svtools/source/brwbox/editbrowseboximpl.hxx b/svtools/source/brwbox/editbrowseboximpl.hxx index b2780124833a..50a58886f199 100644 --- a/svtools/source/brwbox/editbrowseboximpl.hxx +++ b/svtools/source/brwbox/editbrowseboximpl.hxx @@ -18,7 +18,7 @@ */ #pragma once -#include +#include "accessibleeditbrowseboxcell.hxx" namespace svt { diff --git a/vcl/Library_vcl.mk b/vcl/Library_vcl.mk index b9fa3e21c996..08d4e550505c 100644 --- a/vcl/Library_vcl.mk +++ b/vcl/Library_vcl.mk @@ -108,7 +108,6 @@ $(eval $(call gb_Library_add_exception_objects,vcl,\ vcl/source/accessibility/AccessibleTextAttributeHelper \ vcl/source/accessibility/acc_factory \ vcl/source/accessibility/accessiblebrowseboxcell \ - vcl/source/accessibility/accessibleeditbrowseboxcell \ vcl/source/accessibility/accessibleiconchoicectrl \ vcl/source/accessibility/accessibleiconchoicectrlentry \ vcl/source/accessibility/AccessibleIconView \ diff --git a/vcl/inc/strings.hrc b/vcl/inc/strings.hrc index cdd231e842a4..c4f173fc0f40 100644 --- a/vcl/inc/strings.hrc +++ b/vcl/inc/strings.hrc @@ -135,8 +135,6 @@ #define RID_STR_ACC_SCROLLBAR_NAME_VERTICAL NC_("RID_STR_ACC_SCROLLBAR_NAME_VERTICAL", "Vertical scroll bar") #define RID_STR_ACC_SCROLLBAR_NAME_HORIZONTAL NC_("RID_STR_ACC_SCROLLBAR_NAME_HORIZONTAL", "Horizontal scroll bar") #define RID_STR_ACC_PANEL_DESCRIPTION NC_("RID_STR_ACC_PANEL_DESCRIPTION", "Please press enter to go into child control for more operations") -#define RID_STR_ACC_COLUMN_NUM NC_("RID_STR_ACC_COLUMN_NUM", "Column %COLUMNNUMBER") -#define RID_STR_ACC_ROW_NUM NC_("RID_STR_ACC_ROW_NUM", "Row %ROWNUMBER") #endif // INCLUDED_VCL_INC_STRINGS_HRC