sw/Library_sw.mk                                         |    1 
 sw/inc/OnlineAccessibilityCheck.hxx                      |    6 
 sw/inc/cmdid.h                                           |    1 
 sw/inc/ndtxt.hxx                                         |   13 --
 sw/inc/node.hxx                                          |   21 +++
 sw/sdi/_viewsh.sdi                                       |    6 
 sw/sdi/swriter.sdi                                       |   17 ++
 sw/sdi/viewsh.sdi                                        |    6 
 sw/source/core/txtnode/OnlineAccessibilityCheck.cxx      |   95 +++++++++------
 sw/source/uibase/app/swmodule.cxx                        |    2 
 sw/source/uibase/inc/AccessibilityStatusBarControl.hxx   |   30 ++++
 sw/source/uibase/uiview/view2.cxx                        |   19 +++
 sw/source/uibase/utlui/AccessibilityStatusBarControl.cxx |   46 +++++++
 sw/uiconfig/sglobal/statusbar/statusbar.xml              |    1 
 sw/uiconfig/swriter/statusbar/statusbar.xml              |    1 
 15 files changed, 209 insertions(+), 56 deletions(-)

New commits:
commit 160381ff036585b7f57c4f01ba482f1d2e128d33
Author:     Tomaž Vajngerl <[email protected]>
AuthorDate: Mon Oct 24 09:46:43 2022 +0200
Commit:     Tomaž Vajngerl <[email protected]>
CommitDate: Mon Dec 12 14:15:51 2022 +0000

    sw: Run a11y check for all content nodes
    
    Change-Id: Icc3ff1be31a01b22242c48dec6d830e645ecb310
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141784
    Tested-by: Jenkins
    Reviewed-by: Tomaž Vajngerl <[email protected]>
    (cherry picked from commit fad326833699293e5f4e3254881cb56889a220c0)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143703
    Tested-by: Jenkins CollaboraOffice <[email protected]>

diff --git a/sw/inc/OnlineAccessibilityCheck.hxx 
b/sw/inc/OnlineAccessibilityCheck.hxx
index f27f867ce96b..48a639b9d656 100644
--- a/sw/inc/OnlineAccessibilityCheck.hxx
+++ b/sw/inc/OnlineAccessibilityCheck.hxx
@@ -26,11 +26,11 @@ class OnlineAccessibilityCheck : public SvtListener
 private:
     SwDoc& m_rDocument;
     sw::AccessibilityCheck m_aAccessibilityCheck;
-    SwTextNode* m_pCurrentTextNode;
-    SwNodeOffset m_aCurrentNodeIndex;
+    SwContentNode* m_pPreviousNode;
+    SwNodeOffset m_nPreviousNodeIndex;
     sal_Int32 m_nAccessibilityIssues;
 
-    void runCheck(SwTextNode* pTextNode);
+    void runCheck(SwContentNode* pNode);
 
 public:
     OnlineAccessibilityCheck(SwDoc& rDocument);
diff --git a/sw/inc/ndtxt.hxx b/sw/inc/ndtxt.hxx
index 22c84d38c641..1ed4cff26f7c 100644
--- a/sw/inc/ndtxt.hxx
+++ b/sw/inc/ndtxt.hxx
@@ -34,7 +34,6 @@
 #include <memory>
 #include <vector>
 #include <functional>
-#include <sfx2/AccessibilityIssue.hxx>
 
 class SfxHint;
 class SwNumRule;
@@ -96,12 +95,6 @@ struct ParagraphIdleData
     bool bAutoComplDirty = true;               ///< auto complete list dirty
 };
 
-struct AccessibilityCheckStatus
-{
-    std::unique_ptr<sfx::AccessibilityIssueCollection> pCollection;
-    bool bDirty = true;
-};
-
 } // end namespace sw
 
 /// SwTextNode is a paragraph in the document model.
@@ -127,7 +120,6 @@ class SW_DLLPUBLIC SwTextNode final
     OUString m_Text;
 
     mutable sw::ParagraphIdleData m_aParagraphIdleData;
-    mutable sw::AccessibilityCheckStatus m_aAccessibilityCheckStatus;
 
     /** Some of the chars this para are hidden. Paragraph has to be reformatted
        on changing the view to print preview. */
@@ -233,11 +225,6 @@ public:
 
     /// End: Data collected during idle time
 
-    sw::AccessibilityCheckStatus& getAccessibilityCheckStatus()
-    {
-        return m_aAccessibilityCheckStatus;
-    }
-
 public:
     using SwContentNode::GetAttr;
     /// for hanging TextFormatCollections somewhere else (Outline-Numbering!)
diff --git a/sw/inc/node.hxx b/sw/inc/node.hxx
index bdcc9c801a49..eae16fe70550 100644
--- a/sw/inc/node.hxx
+++ b/sw/inc/node.hxx
@@ -30,6 +30,8 @@
 #include "fmtcol.hxx"
 #include "nodeoffset.hxx"
 
+#include <sfx2/AccessibilityIssue.hxx>
+
 #include <memory>
 #include <vector>
 
@@ -355,6 +357,18 @@ class SwEndNode final : public SwNode
     SwEndNode & operator= ( const SwEndNode & rNode ) = delete;
 };
 
+// Accessibiity check
+
+namespace sw
+{
+struct AccessibilityCheckStatus
+{
+    std::unique_ptr<sfx::AccessibilityIssueCollection> pCollection;
+    bool bDirty = true;
+};
+
+}
+
 // SwContentNode
 
 class SW_DLLPUBLIC SwContentNode: public sw::BroadcastingModify, public 
SwNode, public SwIndexReg
@@ -364,6 +378,8 @@ class SW_DLLPUBLIC SwContentNode: public 
sw::BroadcastingModify, public SwNode,
     SwFormatColl* m_pCondColl;
     mutable bool mbSetModifyAtAttr;
 
+    mutable sw::AccessibilityCheckStatus m_aAccessibilityCheckStatus;
+
 protected:
     SwContentNode( const SwNodeIndex &rWhere, const SwNodeType nNodeType,
                 SwFormatColl *pFormatColl );
@@ -480,6 +496,11 @@ public:
 
     void UpdateAttr(const SwUpdateAttr&);
 
+    sw::AccessibilityCheckStatus& getAccessibilityCheckStatus()
+    {
+        return m_aAccessibilityCheckStatus;
+    }
+
 private:
     SwContentNode( const SwContentNode & rNode ) = delete;
     SwContentNode & operator= ( const SwContentNode & rNode ) = delete;
diff --git a/sw/source/core/txtnode/OnlineAccessibilityCheck.cxx 
b/sw/source/core/txtnode/OnlineAccessibilityCheck.cxx
index a26be4e6e0ec..e34738466d99 100644
--- a/sw/source/core/txtnode/OnlineAccessibilityCheck.cxx
+++ b/sw/source/core/txtnode/OnlineAccessibilityCheck.cxx
@@ -32,17 +32,19 @@ namespace sw
 OnlineAccessibilityCheck::OnlineAccessibilityCheck(SwDoc& rDocument)
     : m_rDocument(rDocument)
     , m_aAccessibilityCheck(&m_rDocument)
-    , m_pCurrentTextNode(nullptr)
-    , m_aCurrentNodeIndex(-1)
+    , m_pPreviousNode(nullptr)
+    , m_nPreviousNodeIndex(-1)
     , m_nAccessibilityIssues(0)
 {
 }
 
-void OnlineAccessibilityCheck::runCheck(SwTextNode* pTextNode)
+void OnlineAccessibilityCheck::runCheck(SwContentNode* pContentNode)
 {
-    m_aAccessibilityCheck.checkNode(pTextNode);
+    m_aAccessibilityCheck.getIssueCollection().clear();
+
+    m_aAccessibilityCheck.checkNode(pContentNode);
 
-    for (SwFrameFormat* const& pFrameFormat : pTextNode->GetAnchoredFlys())
+    for (SwFrameFormat* const& pFrameFormat : pContentNode->GetAnchoredFlys())
     {
         SdrObject* pObject = pFrameFormat->FindSdrObject();
         if (pObject)
@@ -51,17 +53,17 @@ void OnlineAccessibilityCheck::runCheck(SwTextNode* 
pTextNode)
 
     auto aCollection = m_aAccessibilityCheck.getIssueCollection();
 
-    pTextNode->getAccessibilityCheckStatus().pCollection
+    pContentNode->getAccessibilityCheckStatus().pCollection
         = std::make_unique<sfx::AccessibilityIssueCollection>(aCollection);
 
     m_nAccessibilityIssues = 0;
     auto const& pNodes = m_rDocument.GetNodes();
     for (SwNodeOffset n(0); n < pNodes.Count(); ++n)
     {
-        SwNode* pNode = pNodes[n];
-        if (pNode && pNode->IsTextNode())
+        SwNode* pCurrent = pNodes[n];
+        if (pCurrent && pCurrent->IsTextNode())
         {
-            auto* pCurrentTextNode = pNode->GetTextNode();
+            auto* pCurrentTextNode = pCurrent->GetTextNode();
             auto& rStatus = pCurrentTextNode->getAccessibilityCheckStatus();
             if (rStatus.pCollection)
                 m_nAccessibilityIssues += 
rStatus.pCollection->getIssues().size();
@@ -83,49 +85,56 @@ void OnlineAccessibilityCheck::update(const SwPosition& 
rNewPos)
     if (!bOnlineCheckStatus)
         return;
 
+    auto nCurrenNodeIndex = rNewPos.GetNodeIndex();
+    if (!rNewPos.GetNode().IsContentNode())
+        return;
+
+    auto* pCurrentNode = rNewPos.GetNode().GetContentNode();
+
+    // Check if previous node was deleted
     if (!HasBroadcaster())
     {
-        m_pCurrentTextNode = nullptr;
-        m_aCurrentNodeIndex = SwNodeOffset(-1);
+        EndListeningAll();
+        StartListening(pCurrentNode->GetNotifier());
+        m_pPreviousNode = pCurrentNode;
+        m_nPreviousNodeIndex = nCurrenNodeIndex;
+        return;
     }
 
-    auto aNodeIndex = rNewPos.GetNodeIndex();
-
-    m_aAccessibilityCheck.getIssueCollection().clear();
+    // Check if node index changed
+    if (nCurrenNodeIndex == m_nPreviousNodeIndex)
+        return;
 
-    SwTextNode* pTextNode = rNewPos.GetNode().GetTextNode();
-    if (!pTextNode)
+    // Check previous node is valid
+    if (m_nPreviousNodeIndex < SwNodeOffset(0)
+        || m_nPreviousNodeIndex >= rNewPos.GetNode().GetNodes().Count())
     {
-        m_pCurrentTextNode = nullptr;
-        m_aCurrentNodeIndex = SwNodeOffset(-1);
+        EndListeningAll();
+        StartListening(pCurrentNode->GetNotifier());
+        m_pPreviousNode = pCurrentNode;
+        m_nPreviousNodeIndex = nCurrenNodeIndex;
         return;
     }
 
-    if (pTextNode == m_pCurrentTextNode)
-    {
-        if (m_aCurrentNodeIndex != aNodeIndex && m_aCurrentNodeIndex >= 
SwNodeOffset(0)
-            && m_aCurrentNodeIndex < pTextNode->GetNodes().Count())
-        {
-            pTextNode = 
pTextNode->GetNodes()[m_aCurrentNodeIndex]->GetTextNode();
+    // Get the real previous node from index
+    SwNode* pNode = rNewPos.GetNode().GetNodes()[m_nPreviousNodeIndex];
 
-            if (pTextNode)
-            {
-                runCheck(pTextNode);
-            }
-        }
-    }
-    else if (m_pCurrentTextNode)
+    if (pNode && pNode->IsContentNode())
     {
-        runCheck(m_pCurrentTextNode);
-    }
+        auto* pContentNode = pNode->GetContentNode();
 
-    m_aCurrentNodeIndex = aNodeIndex;
+        runCheck(pContentNode);
 
-    if (pTextNode && m_pCurrentTextNode != pTextNode)
-    {
+        // Assign previous node and index
         EndListeningAll();
-        StartListening(pTextNode->GetNotifier());
-        m_pCurrentTextNode = pTextNode;
+        StartListening(pCurrentNode->GetNotifier());
+        m_pPreviousNode = pCurrentNode;
+        m_nPreviousNodeIndex = nCurrenNodeIndex;
+    }
+    else
+    {
+        m_pPreviousNode = nullptr;
+        m_nPreviousNodeIndex = SwNodeOffset(-1);
     }
 }
 
commit 2dcda11cb4a0935c58a0f4cd13218fe17588b3d0
Author:     Tomaž Vajngerl <[email protected]>
AuthorDate: Thu Oct 20 22:35:52 2022 +0200
Commit:     Tomaž Vajngerl <[email protected]>
CommitDate: Mon Dec 12 14:15:42 2022 +0000

    sw: add accessibility check statusbar control
    
    A11y check statusbar control, which reports the current status of
    the online a11y check.
    
    Change-Id: I07528f39ed84136f99bc1ce07c10aa6163649305
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141605
    Tested-by: Jenkins
    Reviewed-by: Tomaž Vajngerl <[email protected]>
    (cherry picked from commit e340b81d9d75d3aacfa941df4b531c6a9f5aaffa)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143702
    Tested-by: Tomaž Vajngerl <[email protected]>

diff --git a/sw/Library_sw.mk b/sw/Library_sw.mk
index b0f11424f422..52f2d55bf64a 100644
--- a/sw/Library_sw.mk
+++ b/sw/Library_sw.mk
@@ -762,6 +762,7 @@ $(eval $(call gb_Library_add_exception_objects,sw,\
     sw/source/uibase/uno/unotxdoc \
     sw/source/uibase/uno/loktxdoc \
     sw/source/uibase/uno/unotxvw \
+    sw/source/uibase/utlui/AccessibilityStatusBarControl \
     sw/source/uibase/utlui/attrdesc \
     sw/source/uibase/utlui/bookctrl \
     sw/source/uibase/utlui/condedit \
diff --git a/sw/inc/cmdid.h b/sw/inc/cmdid.h
index 3ca95a5a4453..fc22a240fdac 100644
--- a/sw/inc/cmdid.h
+++ b/sw/inc/cmdid.h
@@ -848,6 +848,7 @@
 #define FN_STAT_SELMODE             (FN_STAT + 5)
 #define FN_STAT_BOOKMARK            (FN_STAT + 8)  /* For Popup Bookmarks*/
 #define FN_STAT_WORDCOUNT           (FN_STAT + 9)
+#define FN_STAT_ACCESSIBILITY_CHECK (FN_STAT + 10)
 
 // Region: Page preview
 #define FN_SHOW_TWO_PAGES           (FN_PGPREVIEW + 1)
diff --git a/sw/sdi/_viewsh.sdi b/sw/sdi/_viewsh.sdi
index 7129c7cd99d4..42d4565d0f48 100644
--- a/sw/sdi/_viewsh.sdi
+++ b/sw/sdi/_viewsh.sdi
@@ -394,6 +394,11 @@ interface BaseTextEditView
         ExecMethod = ExecuteStatusLine ;
         StateMethod = StateStatusLine ;
     ]
+    FN_STAT_ACCESSIBILITY_CHECK // status()
+    [
+        ExecMethod = ExecuteStatusLine;
+        StateMethod = StateStatusLine;
+    ]
     FN_STAT_BOOKMARK // status()
     [
         ExecMethod = ExecuteStatusLine ;
@@ -982,4 +987,3 @@ interface BaseTextEditView
     ]
 
 }
-
diff --git a/sw/sdi/swriter.sdi b/sw/sdi/swriter.sdi
index 35bb66c84b42..d09534ae3686 100644
--- a/sw/sdi/swriter.sdi
+++ b/sw/sdi/swriter.sdi
@@ -5956,6 +5956,23 @@ SfxStringItem StateWordCount FN_STAT_WORDCOUNT
     GroupId = SfxGroupId::View;
 ]
 
+SfxStringItem StateAccessibilityCheck FN_STAT_ACCESSIBILITY_CHECK
+
+[
+    AutoUpdate = FALSE,
+    FastCall = FALSE,
+    ReadOnlyDoc = TRUE,
+    Toggle = FALSE,
+    Container = FALSE,
+    RecordAbsolute = FALSE,
+    RecordPerSet;
+
+    AccelConfig = FALSE,
+    MenuConfig = FALSE,
+    ToolBoxConfig = FALSE,
+    GroupId = SfxGroupId::View;
+]
+
 SfxBoolItem SubScript FN_SET_SUB_SCRIPT
 
 [
diff --git a/sw/sdi/viewsh.sdi b/sw/sdi/viewsh.sdi
index cb02b883ba65..e4f3c0a362e0 100644
--- a/sw/sdi/viewsh.sdi
+++ b/sw/sdi/viewsh.sdi
@@ -464,6 +464,11 @@ interface TextPrintPreview
         ExecMethod = Execute ;
         StateMethod = GetState ;
     ]
+    FN_STAT_ACCESSIBILITY_CHECK // status()
+    [
+        ExecMethod = Execute ;
+        StateMethod = GetState ;
+    ]
     SID_JUMP_TO_SPECIFIC_PAGE // status()
     [
         ExecMethod = Execute ;
@@ -477,4 +482,3 @@ shell SwPagePreview
 {
     import TextPrintPreview;
 }
-
diff --git a/sw/source/core/txtnode/OnlineAccessibilityCheck.cxx 
b/sw/source/core/txtnode/OnlineAccessibilityCheck.cxx
index 109bac52545b..a26be4e6e0ec 100644
--- a/sw/source/core/txtnode/OnlineAccessibilityCheck.cxx
+++ b/sw/source/core/txtnode/OnlineAccessibilityCheck.cxx
@@ -21,6 +21,10 @@
 #include <doc.hxx>
 #include <pam.hxx>
 #include <txtfrm.hxx>
+#include <sfx2/bindings.hxx>
+#include <sfx2/dispatch.hxx>
+#include <docsh.hxx>
+#include <cmdid.h>
 #include <officecfg/Office/Common.hxx>
 
 namespace sw
@@ -63,6 +67,12 @@ void OnlineAccessibilityCheck::runCheck(SwTextNode* 
pTextNode)
                 m_nAccessibilityIssues += 
rStatus.pCollection->getIssues().size();
         }
     }
+
+    SfxBindings* pBindings = m_rDocument.GetDocShell() && 
m_rDocument.GetDocShell()->GetDispatcher()
+                                 ? 
m_rDocument.GetDocShell()->GetDispatcher()->GetBindings()
+                                 : nullptr;
+    if (pBindings)
+        pBindings->Invalidate(FN_STAT_ACCESSIBILITY_CHECK);
 }
 
 void OnlineAccessibilityCheck::update(const SwPosition& rNewPos)
diff --git a/sw/source/uibase/app/swmodule.cxx 
b/sw/source/uibase/app/swmodule.cxx
index 51052b8f82b6..dfa2c4562b2a 100644
--- a/sw/source/uibase/app/swmodule.cxx
+++ b/sw/source/uibase/app/swmodule.cxx
@@ -82,6 +82,7 @@
 #include <svx/zoomsliderctrl.hxx>
 #include <zoomctrl.hxx>
 #include <wordcountctrl.hxx>
+#include <AccessibilityStatusBarControl.hxx>
 #include <workctrl.hxx>
 #include <fldwrap.hxx>
 #include <redlndlg.hxx>
@@ -280,6 +281,7 @@ void SwDLL::RegisterControls()
     SvxSelectionModeControl::RegisterControl(FN_STAT_SELMODE, pMod );
     XmlSecStatusBarControl::RegisterControl( SID_SIGNATURE, pMod );
     SwWordCountStatusBarControl::RegisterControl(FN_STAT_WORDCOUNT, pMod);
+    
sw::AccessibilityStatusBarControl::RegisterControl(FN_STAT_ACCESSIBILITY_CHECK, 
pMod);
 
     SwBookmarkControl::RegisterControl(FN_STAT_PAGE, pMod );
     SwTemplateControl::RegisterControl(FN_STAT_TEMPLATE, pMod );
diff --git a/sw/source/uibase/inc/AccessibilityStatusBarControl.hxx 
b/sw/source/uibase/inc/AccessibilityStatusBarControl.hxx
new file mode 100644
index 000000000000..52e64b99f5ac
--- /dev/null
+++ b/sw/source/uibase/inc/AccessibilityStatusBarControl.hxx
@@ -0,0 +1,30 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+#pragma once
+
+#include <sfx2/stbitem.hxx>
+
+namespace sw
+{
+class AccessibilityStatusBarControl final : public SfxStatusBarControl
+{
+public:
+    SFX_DECL_STATUSBAR_CONTROL();
+
+    AccessibilityStatusBarControl(sal_uInt16 nSlotId, sal_uInt16 nId, 
StatusBar& rStb);
+    virtual ~AccessibilityStatusBarControl() override;
+
+    virtual void StateChangedAtStatusBarControl(sal_uInt16 nSID, SfxItemState 
eState,
+                                                const SfxPoolItem* pState) 
override;
+};
+
+} // end sw
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/uibase/uiview/view2.cxx 
b/sw/source/uibase/uiview/view2.cxx
index 60c2395293b6..3472bf63ef0e 100644
--- a/sw/source/uibase/uiview/view2.cxx
+++ b/sw/source/uibase/uiview/view2.cxx
@@ -127,6 +127,7 @@
 #include <unotextrange.hxx>
 #include <docstat.hxx>
 #include <wordcountdialog.hxx>
+#include <OnlineAccessibilityCheck.hxx>
 #include <sfx2/sidebar/Sidebar.hxx>
 
 #include <vcl/GraphicNativeTransform.hxx>
@@ -1611,6 +1612,24 @@ void SwView::StateStatusLine(SfxItemSet &rSet)
                     pWrdCnt->SetCounts(selectionStats, documentStats);
             }
             break;
+            case FN_STAT_ACCESSIBILITY_CHECK:
+            {
+                if (rShell.GetDoc()->getOnlineAccessibilityCheck())
+                {
+                    auto nIssues = 
rShell.GetDoc()->getOnlineAccessibilityCheck()->getNumberOfAccessibilityIssues();
+                    OUString aString;
+                    if (nIssues > 0)
+                    {
+                        aString = u"Issues: " + OUString::number(nIssues);
+                    }
+                    else
+                    {
+                        aString = u"No Issues";
+                    }
+                    rSet.Put(SfxStringItem(FN_STAT_ACCESSIBILITY_CHECK, 
aString));
+                }
+            }
+            break;
 
             case FN_STAT_TEMPLATE:
             {
diff --git a/sw/source/uibase/utlui/AccessibilityStatusBarControl.cxx 
b/sw/source/uibase/utlui/AccessibilityStatusBarControl.cxx
new file mode 100644
index 000000000000..55daee5d31d9
--- /dev/null
+++ b/sw/source/uibase/utlui/AccessibilityStatusBarControl.cxx
@@ -0,0 +1,46 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+#include <swtypes.hxx>
+#include <strings.hrc>
+#include <AccessibilityStatusBarControl.hxx>
+#include <svl/stritem.hxx>
+#include <vcl/status.hxx>
+
+SFX_IMPL_STATUSBAR_CONTROL(sw::AccessibilityStatusBarControl, SfxStringItem);
+
+namespace sw
+{
+AccessibilityStatusBarControl::AccessibilityStatusBarControl(sal_uInt16 
_nSlotId, sal_uInt16 _nId,
+                                                             StatusBar& rStb)
+    : SfxStatusBarControl(_nSlotId, _nId, rStb)
+{
+}
+
+AccessibilityStatusBarControl::~AccessibilityStatusBarControl() = default;
+
+void AccessibilityStatusBarControl::StateChangedAtStatusBarControl(sal_uInt16 
/*nSID*/,
+                                                                   
SfxItemState eState,
+                                                                   const 
SfxPoolItem* pState)
+{
+    if (eState == SfxItemState::DEFAULT) // Can access pState
+    {
+        GetStatusBar().SetItemText(GetId(), static_cast<const 
SfxStringItem*>(pState)->GetValue());
+        GetStatusBar().SetQuickHelpText(GetId(), SwResId(STR_WORDCOUNT_HINT));
+    }
+    else
+    {
+        GetStatusBar().SetItemText(GetId(), u"");
+        GetStatusBar().SetQuickHelpText(GetId(), u"");
+    }
+}
+
+} // end sw
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/uiconfig/sglobal/statusbar/statusbar.xml 
b/sw/uiconfig/sglobal/statusbar/statusbar.xml
index f85f07daa068..2f2e54f21c6d 100644
--- a/sw/uiconfig/sglobal/statusbar/statusbar.xml
+++ b/sw/uiconfig/sglobal/statusbar/statusbar.xml
@@ -20,6 +20,7 @@
 <statusbar:statusbar xmlns:statusbar="http://openoffice.org/2001/statusbar"; 
xmlns:xlink="http://www.w3.org/1999/xlink";>
  <statusbar:statusbaritem xlink:href=".uno:StatePageNumber" 
statusbar:align="left" statusbar:autosize="true" statusbar:mandatory="true" 
statusbar:width="54"/>
  <statusbar:statusbaritem xlink:href=".uno:StateWordCount" 
statusbar:align="left" statusbar:autosize="true"/>
+ <statusbar:statusbaritem xlink:href=".uno:StateAccessibilityCheck" 
statusbar:align="left" statusbar:width="50"/>
  <statusbar:statusbaritem xlink:href=".uno:PageStyleName" 
statusbar:align="left" statusbar:autosize="true" statusbar:width="79"/>
  <statusbar:statusbaritem xlink:href=".uno:LanguageStatus" 
statusbar:align="center" statusbar:autosize="true" statusbar:mandatory="false" 
statusbar:width="100"/>
  <statusbar:statusbaritem xlink:href=".uno:InsertMode" 
statusbar:align="center" statusbar:mandatory="false" statusbar:width="55"/>
diff --git a/sw/uiconfig/swriter/statusbar/statusbar.xml 
b/sw/uiconfig/swriter/statusbar/statusbar.xml
index cc20c57fa81e..090c44b1f941 100644
--- a/sw/uiconfig/swriter/statusbar/statusbar.xml
+++ b/sw/uiconfig/swriter/statusbar/statusbar.xml
@@ -21,6 +21,7 @@
  <statusbar:statusbaritem xlink:href=".uno:ModifiedStatus" 
statusbar:align="center" statusbar:ownerdraw="true" statusbar:mandatory="true" 
statusbar:width="16"/>
  <statusbar:statusbaritem xlink:href=".uno:StatePageNumber" 
statusbar:align="left" statusbar:autosize="true" statusbar:mandatory="true" 
statusbar:width="54"/>
  <statusbar:statusbaritem xlink:href=".uno:StateWordCount" 
statusbar:align="left" statusbar:autosize="true"/>
+<statusbar:statusbaritem xlink:href=".uno:StateAccessibilityCheck" 
statusbar:align="left" statusbar:width="50"/>
  <statusbar:statusbaritem xlink:href=".uno:PageStyleName" 
statusbar:align="left" statusbar:autosize="true" statusbar:width="79"/>
  <statusbar:statusbaritem xlink:href=".uno:LanguageStatus" 
statusbar:align="center" statusbar:autosize="true" statusbar:mandatory="false" 
statusbar:width="100"/>
  <statusbar:statusbaritem xlink:href=".uno:InsertMode" 
statusbar:align="center" statusbar:mandatory="false" statusbar:width="55"/>

Reply via email to