officecfg/registry/data/org/openoffice/Office/PresenterScreen.xcu |    2 
 sd/source/console/PresenterAccessibility.cxx                      |   11 ---
 sd/source/console/PresenterController.cxx                         |   33 
++--------
 sd/source/console/PresenterController.hxx                         |    3 
 sd/source/console/PresenterPaneContainer.cxx                      |    2 
 sd/source/console/PresenterPaneContainer.hxx                      |    3 
 6 files changed, 15 insertions(+), 39 deletions(-)

New commits:
commit dc44fd91ed42a719a6580d412b09fb77da0ffaf4
Author:     Michael Weghorn <m.wegh...@posteo.de>
AuthorDate: Wed May 14 17:31:42 2025 +0200
Commit:     Michael Weghorn <m.wegh...@posteo.de>
CommitDate: Thu May 15 06:51:07 2025 +0200

    sd a11y: Drop XConfigurationController check
    
    PresenterAccessible never makes any direct use of
    XConfigurationController, so checking a non-null one
    can be retrieved from the presentation controller seems
    unnecessary. Drop that.
    
    Change-Id: Ic18a6a1ac0b399e9485653b923bc816451be5e73
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/185326
    Tested-by: Jenkins
    Reviewed-by: Michael Weghorn <m.wegh...@posteo.de>

diff --git a/sd/source/console/PresenterAccessibility.cxx 
b/sd/source/console/PresenterAccessibility.cxx
index 2d76ced8d317..173e8353c6a0 100644
--- a/sd/source/console/PresenterAccessibility.cxx
+++ b/sd/source/console/PresenterAccessibility.cxx
@@ -126,11 +126,6 @@ void PresenterAccessible::UpdateAccessibilityHierarchy()
     if ( ! mpPresenterController.is())
         return;
 
-    Reference<drawing::framework::XConfigurationController> 
xConfigurationController(
-        mpPresenterController->GetConfigurationController());
-    if ( ! xConfigurationController.is())
-        return;
-
     rtl::Reference<PresenterPaneContainer> pPaneContainer (
         mpPresenterController->GetPaneContainer());
     if ( ! pPaneContainer.is())
commit c8fc4db4bffaa0405f47f60a8dca32d3dc91591a
Author:     Michael Weghorn <m.wegh...@posteo.de>
AuthorDate: Wed May 14 17:16:19 2025 +0200
Commit:     Michael Weghorn <m.wegh...@posteo.de>
CommitDate: Thu May 15 06:51:01 2025 +0200

    sd presenter a11y: Stop tracking a11y state in controller
    
    Stop tracking whether a11y is active in
    PresenterController. So far, this was the case once
    PresenterAccessible::getAccessibleContext was called
    for the first time, at which point that method was calling
    PresenterController::SetAccessibilityActiveState.
    
    Instead, let PresenterController call methods on its
    a11y object unconditionally.
    The object is already created unconditionally in
    PresenterController::InitializeMainPane, and the
    corresponding PresenterAccessible methods still don't
    do much as long as PresenterAccessible::getAccessibleContext
    hasn't been called, because PresenterAccessible::mpAccessibleConsole
    is only created in there.
    
    What's new is that PresenterController::notifyConfigurationChange
    now unconditionally calls
    
        UpdateCurrentSlide(0);
    
    for the ConfigurationUpdateEndEventType case, but making sure the
    slide references are up to date seems reasonable to me.
    
    Change-Id: Ifbc78578caf68323699b54b883e42ffd9295fff9
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/185325
    Tested-by: Jenkins
    Reviewed-by: Michael Weghorn <m.wegh...@posteo.de>

diff --git a/sd/source/console/PresenterAccessibility.cxx 
b/sd/source/console/PresenterAccessibility.cxx
index 336b7a387b19..2d76ced8d317 100644
--- a/sd/source/console/PresenterAccessibility.cxx
+++ b/sd/source/console/PresenterAccessibility.cxx
@@ -293,8 +293,6 @@ Reference<XAccessibleContext> SAL_CALL 
PresenterAccessible::getAccessibleContext
         mpAccessibleConsole->SetWindow(mxMainWindow, nullptr);
         mpAccessibleConsole->SetAccessibleParent(mxAccessibleParent);
         UpdateAccessibilityHierarchy();
-        if (mpPresenterController.is())
-            mpPresenterController->SetAccessibilityActiveState(true);
     }
     return mpAccessibleConsole;
 }
diff --git a/sd/source/console/PresenterController.cxx 
b/sd/source/console/PresenterController.cxx
index afa9ddcdfddf..271cf7bc2961 100644
--- a/sd/source/console/PresenterController.cxx
+++ b/sd/source/console/PresenterController.cxx
@@ -100,8 +100,7 @@ PresenterController::PresenterController (
       mnCurrentSlideIndex(-1),
       mpWindowManager(new 
PresenterWindowManager(rxContext,mpPaneContainer,this)),
       mpCanvasHelper(std::make_shared<PresenterCanvasHelper>()),
-      mnPendingSlideNumber(-1),
-      mbIsAccessibilityActive(false)
+      mnPendingSlideNumber(-1)
 {
     OSL_ASSERT(mxController.is());
 
@@ -220,10 +219,8 @@ void PresenterController::UpdateCurrentSlide (const 
sal_Int32 nOffset)
     UpdateViews();
 
     // Update the accessibility object.
-    if (IsAccessibilityActive())
-    {
+    if (mpAccessibleObject.is())
         mpAccessibleObject->NotifyCurrentSlideChange();
-    }
 }
 
 void PresenterController::GetSlides (const sal_Int32 nOffset)
@@ -593,12 +590,6 @@ bool PresenterController::HasCustomAnimation 
(Reference<drawing::XDrawPage> cons
     return bCustomAnimation;
 }
 
-void PresenterController::SetAccessibilityActiveState (const bool bIsActive)
-{
-    mbIsAccessibilityActive = bIsActive;
-}
-
-
 void PresenterController::HandleMouseClick (const awt::MouseEvent& rEvent)
 {
     if (!mxSlideShowController.is())
@@ -740,11 +731,9 @@ void SAL_CALL 
PresenterController::notifyConfigurationChange (
             break;
 
         case ConfigurationUpdateEndEventType:
-            if (IsAccessibilityActive())
-            {
+            if (mpAccessibleObject.is())
                 mpAccessibleObject->UpdateAccessibilityHierarchy();
-                UpdateCurrentSlide(0);
-            }
+            UpdateCurrentSlide(0);
             break;
     }
 }
diff --git a/sd/source/console/PresenterController.hxx 
b/sd/source/console/PresenterController.hxx
index 6a407f7d296e..76d9367f5372 100644
--- a/sd/source/console/PresenterController.hxx
+++ b/sd/source/console/PresenterController.hxx
@@ -121,8 +121,6 @@ public:
     const css::uno::Reference<css::drawing::XDrawPage>& GetCurrentSlide() 
const;
     static bool HasTransition (css::uno::Reference<css::drawing::XDrawPage> 
const & rxPage);
     static bool HasCustomAnimation 
(css::uno::Reference<css::drawing::XDrawPage> const & rxPage);
-    void SetAccessibilityActiveState (const bool bIsActive);
-    bool IsAccessibilityActive() const { return mbIsAccessibilityActive;}
 
     void HandleMouseClick (const css::awt::MouseEvent& rEvent);
     void UpdatePaneTitles();
@@ -197,7 +195,6 @@ private:
     sal_Int32 mnPendingSlideNumber;
     css::uno::Reference<css::util::XURLTransformer> mxUrlTransformer;
     ::rtl::Reference<PresenterAccessible> mpAccessibleObject;
-    bool mbIsAccessibilityActive;
     IPresentationTime* mpPresentationTime;
 
     void GetSlides (const sal_Int32 nOffset);
commit bfedefe5161f7755bfff914d418eee18600c28e7
Author:     Michael Weghorn <m.wegh...@posteo.de>
AuthorDate: Wed May 14 16:39:57 2025 +0200
Commit:     Michael Weghorn <m.wegh...@posteo.de>
CommitDate: Thu May 15 06:50:54 2025 +0200

    sd presenter a11y: Decouple displayed pane title from a11y name
    
    So far, the title displayed for a pane in the Impress Presenter
    Console was always the same as the accessible name.
    
    For the "Current slide" pane in the presenter console, the
    title was different depending on whether or not accessibility
    was enabled, as different templates were used, see the
    "Title" and "AccessibleTitle" entries in
    officecfg/registry/data/org/openoffice/Office/PresenterScreen.xcu:
    
    With a11 disabled,
    "Current Slide (%CURRENT_SLIDE_NUMBER% of %SLIDE_COUNT%)"
    was used, with a11y enabled,
    "Current Slide, %CURRENT_SLIDE_NAME%, %CURRENT_SLIDE_NUMBER% of 
%SLIDE_COUNT%"
    was used, i.e. if a11y is enabled, the slide title is displayed in
    addition.
    
    No more make what's displayed on screen dependent on that,
    but use the "accessible title" for the accessible name instead,
    so it still e.g. gets announced by the Orca screen reader when
    switching between slides.
    
    Introduce PaneDescriptor::msAccessibleName to hold the
    accessible name.
    
    Adjust PresenterController::UpdatePaneTitles
    to always process both properties.
    
    Rename PaneDescriptor::msAccessibleTitleTemplate to
    PaneDescriptor::msAccessibleNameTemplate for consistency.
    
    Drop call to PresenterController::UpdatePaneTitles from
    PresenterController::SetAccessibilityActiveState as that
    should be unnecessary, now that
    PresenterController::UpdatePaneTitles behavior no longer
    depends on whether or not accessibility is considered
    enabled or not.
    
    Also adjust the template used for the accessible name to
    first announce the text that is displayed on screen
    (e.g. "Current Slide (2 of 4)"), then the slide name, and
    add brackets + remove comma to align it more with the
    displayed title.
    
    Whether it generally makes sense to use string templates
    read from the config for such a purpose may be a valid question,
    but leave that general approach unchanged at least for now.
    
    Change-Id: I52b2d014086e1532b0fb958e15ad915234e4718a
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/185324
    Tested-by: Jenkins
    Reviewed-by: Michael Weghorn <m.wegh...@posteo.de>

diff --git a/officecfg/registry/data/org/openoffice/Office/PresenterScreen.xcu 
b/officecfg/registry/data/org/openoffice/Office/PresenterScreen.xcu
index 520bcaaa456b..f89c549e4117 100644
--- a/officecfg/registry/data/org/openoffice/Office/PresenterScreen.xcu
+++ b/officecfg/registry/data/org/openoffice/Office/PresenterScreen.xcu
@@ -1882,7 +1882,7 @@
           <value xml:lang="en-US">Current Slide (%CURRENT_SLIDE_NUMBER% of 
%SLIDE_COUNT%)</value>
         </prop>
         <prop oor:name="AccessibleTitle">
-          <value xml:lang="en-US">Current Slide, %CURRENT_SLIDE_NAME%, 
%CURRENT_SLIDE_NUMBER% of %SLIDE_COUNT%</value>
+          <value xml:lang="en-US">Current Slide (%CURRENT_SLIDE_NUMBER% of 
%SLIDE_COUNT%), %CURRENT_SLIDE_NAME%</value>
         </prop>
         <prop oor:name="IsOpaque">
           <value>true</value>
diff --git a/sd/source/console/PresenterAccessibility.cxx 
b/sd/source/console/PresenterAccessibility.cxx
index 3631bb279232..336b7a387b19 100644
--- a/sd/source/console/PresenterAccessibility.cxx
+++ b/sd/source/console/PresenterAccessibility.cxx
@@ -163,7 +163,7 @@ void PresenterAccessible::UpdateAccessibilityHierarchy()
     UpdateAccessibilityHierarchy(
         pPreviewPane ? pPreviewPane->mxContentWindow : 
Reference<awt::XWindow>(),
         pPreviewPane ? pPreviewPane->mxBorderWindow : 
Reference<awt::XWindow>(),
-        pPreviewPane ? pPreviewPane->msTitle : OUString(),
+        pPreviewPane ? pPreviewPane->msAccessibleName : OUString(),
         pNotesPane ? pNotesPane->mxContentWindow : Reference<awt::XWindow>(),
         pNotesPane ? pNotesPane->mxBorderWindow : Reference<awt::XWindow>(),
         pNotesView.is()
@@ -233,7 +233,7 @@ void PresenterAccessible::NotifyCurrentSlideChange ()
     {
         PresenterPaneContainer::SharedPaneDescriptor pPreviewPane 
(GetPreviewPane());
         mpAccessiblePreview->SetAccessibleName(
-            pPreviewPane ? pPreviewPane->msTitle : OUString());
+            pPreviewPane ? pPreviewPane->msAccessibleName : OUString());
     }
 
     // Play some focus ping-pong to trigger AT tools.
diff --git a/sd/source/console/PresenterController.cxx 
b/sd/source/console/PresenterController.cxx
index bfa766f4a8fb..afa9ddcdfddf 100644
--- a/sd/source/console/PresenterController.cxx
+++ b/sd/source/console/PresenterController.cxx
@@ -360,13 +360,13 @@ void PresenterController::UpdatePaneTitles()
     {
         OSL_ASSERT(rxPane != nullptr);
 
-        OUString sTemplate (IsAccessibilityActive()
-            ? rxPane->msAccessibleTitleTemplate
-            : rxPane->msTitleTemplate);
-        if (sTemplate.isEmpty())
+        rxPane->msAccessibleName = 
lcl_replacePlaceholders(rxPane->msAccessibleNameTemplate, sCurrentSlideNumber,
+                                                           sCurrentSlideName, 
sSlideCount);
+
+        if (rxPane->msTitleTemplate.isEmpty())
             continue;
 
-        rxPane->msTitle = lcl_replacePlaceholders(sTemplate, 
sCurrentSlideNumber, sCurrentSlideName,
+        rxPane->msTitle = lcl_replacePlaceholders(rxPane->msTitleTemplate, 
sCurrentSlideNumber, sCurrentSlideName,
                                                   sSlideCount);
         if (rxPane->mxPane.is())
             rxPane->mxPane->SetTitle(rxPane->msTitle);
@@ -595,11 +595,7 @@ bool PresenterController::HasCustomAnimation 
(Reference<drawing::XDrawPage> cons
 
 void PresenterController::SetAccessibilityActiveState (const bool bIsActive)
 {
-    if ( mbIsAccessibilityActive != bIsActive)
-    {
-        mbIsAccessibilityActive = bIsActive;
-        UpdatePaneTitles();
-    }
+    mbIsAccessibilityActive = bIsActive;
 }
 
 
diff --git a/sd/source/console/PresenterPaneContainer.cxx 
b/sd/source/console/PresenterPaneContainer.cxx
index 6d81dfa370ed..9b71efc7349d 100644
--- a/sd/source/console/PresenterPaneContainer.cxx
+++ b/sd/source/console/PresenterPaneContainer.cxx
@@ -65,7 +65,7 @@ void PresenterPaneContainer::PreparePane (
         pDescriptor->msTitleTemplate = rsTitle;
         pDescriptor->msTitle.clear();
     }
-    pDescriptor->msAccessibleTitleTemplate = rsAccessibleTitle;
+    pDescriptor->msAccessibleNameTemplate = rsAccessibleTitle;
     pDescriptor->maViewInitialization = rViewInitialization;
     pDescriptor->mbIsActive = true;
     pDescriptor->mbIsOpaque = bIsOpaque;
diff --git a/sd/source/console/PresenterPaneContainer.hxx 
b/sd/source/console/PresenterPaneContainer.hxx
index e999b4b74e4d..f2de216a15f1 100644
--- a/sd/source/console/PresenterPaneContainer.hxx
+++ b/sd/source/console/PresenterPaneContainer.hxx
@@ -77,8 +77,9 @@ public:
         css::uno::Reference<css::awt::XWindow> mxContentWindow;
         css::uno::Reference<css::awt::XWindow> mxBorderWindow;
         OUString msTitleTemplate;
-        OUString msAccessibleTitleTemplate;
+        OUString msAccessibleNameTemplate;
         OUString msTitle;
+        OUString msAccessibleName;
         ViewInitializationFunction maViewInitialization;
         bool mbIsActive;
         bool mbIsOpaque;

Reply via email to