summaryrefslogtreecommitdiff
path: root/desktop
diff options
context:
space:
mode:
authorMarco Cecchetti <marco.cecchetti@collabora.com>2023-03-23 08:33:16 +0100
committerMarco Cecchetti <marco.cecchetti@collabora.com>2023-05-05 08:55:06 +0200
commit190f7caa9e5c565168a45fd198585526573d966d (patch)
tree665e8371547a0e8a9077d3a5f1e712efedb6daa9 /desktop
parent1cd8599ca911133a5dcecb517127ce6e6d29b0dc (diff)
lok: accessibility event listener for focused paragraph
LOKDocumentFocusListener keeps track of the currently focused paragraph. Change-Id: I0fa400694f3129608228ade0b96e0b4e0aee87e2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151363 Reviewed-by: Michael Meeks <michael.meeks@collabora.com> Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Diffstat (limited to 'desktop')
-rw-r--r--desktop/qa/desktop_lib/test_desktop_lib.cxx4
-rw-r--r--desktop/source/lib/init.cxx17
2 files changed, 18 insertions, 3 deletions
diff --git a/desktop/qa/desktop_lib/test_desktop_lib.cxx b/desktop/qa/desktop_lib/test_desktop_lib.cxx
index 3f5ca1f96fb4..55ef248ec932 100644
--- a/desktop/qa/desktop_lib/test_desktop_lib.cxx
+++ b/desktop/qa/desktop_lib/test_desktop_lib.cxx
@@ -3640,9 +3640,11 @@ void DesktopLOKTest::testABI()
CPPUNIT_ASSERT_EQUAL(documentClassOffset(67), offsetof(struct _LibreOfficeKitDocumentClass, getEditMode));
CPPUNIT_ASSERT_EQUAL(documentClassOffset(68),
offsetof(struct _LibreOfficeKitDocumentClass, setViewTimezone));
+ CPPUNIT_ASSERT_EQUAL(documentClassOffset(69),
+ offsetof(struct _LibreOfficeKitDocumentClass, setAccessibilityState));
// As above
- CPPUNIT_ASSERT_EQUAL(documentClassOffset(69), sizeof(struct _LibreOfficeKitDocumentClass));
+ CPPUNIT_ASSERT_EQUAL(documentClassOffset(70), sizeof(struct _LibreOfficeKitDocumentClass));
}
CPPUNIT_TEST_SUITE_REGISTRATION(DesktopLOKTest);
diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 949af11504ed..b3350be8e8aa 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -1311,6 +1311,7 @@ static void doc_sendContentControlEvent(LibreOfficeKitDocument* pThis, const cha
static void doc_setViewTimezone(LibreOfficeKitDocument* pThis, int nId, const char* timezone);
+static void doc_setAccessibilityState(LibreOfficeKitDocument* pThis, int nId, bool bEnabled);
} // extern "C"
namespace {
@@ -1460,6 +1461,8 @@ LibLODocument_Impl::LibLODocument_Impl(uno::Reference <css::lang::XComponent> xC
m_pDocumentClass->setViewTimezone = doc_setViewTimezone;
+ m_pDocumentClass->setAccessibilityState = doc_setAccessibilityState;
+
gDocumentClass = m_pDocumentClass;
}
pClass = m_pDocumentClass.get();
@@ -6398,12 +6401,13 @@ static void doc_setViewLanguage(SAL_UNUSED_PARAMETER LibreOfficeKitDocument* /*p
SolarMutexGuard aGuard;
SetLastExceptionMsg();
+ SAL_DEBUG("doc_setViewLanguage: nId: " << nId);
OUString sLanguage = OStringToOUString(language, RTL_TEXTENCODING_UTF8);
SfxLokHelper::setViewLanguage(nId, sLanguage);
SfxLokHelper::setViewLocale(nId, sLanguage);
-}
-
+ SfxLokHelper::setAccessibilityState(nId, true);
+}
unsigned char* doc_renderFont(LibreOfficeKitDocument* pThis,
const char* pFontName,
@@ -6946,6 +6950,15 @@ static void doc_setViewTimezone(SAL_UNUSED_PARAMETER LibreOfficeKitDocument* /*p
}
}
+static void doc_setAccessibilityState(SAL_UNUSED_PARAMETER LibreOfficeKitDocument* /*pThis*/, int nId, bool nEnabled)
+{
+ SolarMutexGuard aGuard;
+ if (gImpl)
+ gImpl->maLastExceptionMsg.clear();
+
+ SfxLokHelper::setAccessibilityState(nId, nEnabled);
+}
+
static char* lo_getError (LibreOfficeKit *pThis)
{
comphelper::ProfileZone aZone("lo_getError");