core.git: desktop/qa desktop/source include/LibreOfficeKit include/vcl sc/inc sc/source sd/source sw/inc sw/source

2024-03-06 Thread Gökay Şatır (via logerrit)
 desktop/qa/desktop_lib/test_desktop_lib.cxx |5 +
 desktop/source/lib/init.cxx |   18 --
 include/LibreOfficeKit/LibreOfficeKit.h |3 ---
 include/LibreOfficeKit/LibreOfficeKit.hxx   |5 -
 include/vcl/ITiledRenderable.hxx|6 --
 sc/inc/docuno.hxx   |3 ---
 sc/source/ui/unoobj/docuno.cxx  |   18 --
 sd/source/ui/inc/unomodel.hxx   |2 --
 sd/source/ui/unoidl/unomodel.cxx|   25 -
 sw/inc/unotxdoc.hxx |2 --
 sw/source/uibase/uno/unotxdoc.cxx   |   19 ---
 11 files changed, 1 insertion(+), 105 deletions(-)

New commits:
commit 693b7fcf7aef50ef6a55c170880f2854afd8fb12
Author: Gökay Şatır 
AuthorDate: Wed Feb 14 12:08:17 2024 +0300
Commit: Miklos Vajna 
CommitDate: Thu Mar 7 08:12:11 2024 +0100

Revert hyperlinkInfoAtPositon changes.

Revert "Implement hyperlinkInfoAtPosition for Impress."

This reverts commit 876543305c78cb596720da087454a5c54e5feb06.

Revert "Readonly Hyperlink Info - normalize the clicked coordinates."

This reverts commit 322669725b771f5fa2b3c10c5fb73238ca3713f6.

Revert "Implement hyperlinkInfoAtPosition function for Calc."

This reverts commit be01dd78c47b51b19603a6259504e29b11979b0b.

Revert "Implement hyperlinkInfoAtPosition for Writer."

This reverts commit 6773c8929690f557d29bc282dd8f5c4381da3484.

Revert "In readonly mode, we restrict many events like click."

This reverts commit a4f3b97e506f38e0c43d6fbf1192cc523750a9fd.

(cherry picked from commit c3f1d63178d6aaa0888085c7b641eb6d49a18276)

Conflicts:
sc/source/ui/unoobj/docuno.cxx
sd/source/ui/unoidl/unomodel.cxx
sw/source/uibase/uno/unotxdoc.cxx

Change-Id: Ie821a4bca6e6b4649cea17748c44af105cd45d30
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164481
Tested-by: Jenkins
Reviewed-by: Miklos Vajna 

diff --git a/desktop/qa/desktop_lib/test_desktop_lib.cxx 
b/desktop/qa/desktop_lib/test_desktop_lib.cxx
index c9f276a67eeb..87afe69166a8 100644
--- a/desktop/qa/desktop_lib/test_desktop_lib.cxx
+++ b/desktop/qa/desktop_lib/test_desktop_lib.cxx
@@ -3682,11 +3682,8 @@ void DesktopLOKTest::testABI()
 CPPUNIT_ASSERT_EQUAL(documentClassOffset(71),
  offsetof(struct _LibreOfficeKitDocumentClass, 
getA11yCaretPosition));
 
-CPPUNIT_ASSERT_EQUAL(documentClassOffset(72),
- offsetof(struct _LibreOfficeKitDocumentClass, 
hyperlinkInfoAtPosition));
-
 // As above
-CPPUNIT_ASSERT_EQUAL(documentClassOffset(73), sizeof(struct 
_LibreOfficeKitDocumentClass));
+CPPUNIT_ASSERT_EQUAL(documentClassOffset(72), sizeof(struct 
_LibreOfficeKitDocumentClass));
 }
 
 CPPUNIT_TEST_SUITE_REGISTRATION(DesktopLOKTest);
diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 93efef57d138..92f3d52affef 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -1138,9 +1138,6 @@ static void 
doc_postWindowExtTextInputEvent(LibreOfficeKitDocument* pThis,
 unsigned nWindowId,
 int nType,
 const char* pText);
-
-static char* doc_hyperlinkInfoAtPosition(LibreOfficeKitDocument *pThis, int x, 
int y);
-
 static void doc_removeTextContext(LibreOfficeKitDocument* pThis,
   unsigned nLOKWindowId,
   int nCharBefore,
@@ -1426,7 +1423,6 @@ LibLODocument_Impl::LibLODocument_Impl(uno::Reference 
 xC
 m_pDocumentClass->registerCallback = doc_registerCallback;
 m_pDocumentClass->postKeyEvent = doc_postKeyEvent;
 m_pDocumentClass->postWindowExtTextInputEvent = 
doc_postWindowExtTextInputEvent;
-m_pDocumentClass->hyperlinkInfoAtPosition = 
doc_hyperlinkInfoAtPosition;
 m_pDocumentClass->removeTextContext = doc_removeTextContext;
 m_pDocumentClass->postWindowKeyEvent = doc_postWindowKeyEvent;
 m_pDocumentClass->postMouseEvent = doc_postMouseEvent;
@@ -4718,20 +4714,6 @@ static void 
doc_postWindowExtTextInputEvent(LibreOfficeKitDocument* pThis, unsig
 SfxLokHelper::postExtTextEventAsync(pWindow, nType, 
OUString::fromUtf8(std::string_view(pText, strlen(pText;
 }
 
-static char* doc_hyperlinkInfoAtPosition(LibreOfficeKitDocument* pThis, int x, 
int y)
-{
-SolarMutexGuard aGuard;
-
-ITiledRenderable* pDoc = getTiledRenderable(pThis);
-if (!pDoc)
-{
-SetLastExceptionMsg("Document doesn't support tiled rendering");
-return nullptr;
-}
-
-return convertOUString(pDoc->hyperlinkInfoAtPosition(x, y));
-}
-
 static void doc_removeTextContext(LibreOfficeKitDocument* pThis, unsigned 
nLOKWindowId, int 

core.git: desktop/qa desktop/source include/LibreOfficeKit include/vcl sc/inc sc/source sd/source sw/inc sw/source

2023-12-28 Thread Gökay Şatır (via logerrit)
 desktop/qa/desktop_lib/test_desktop_lib.cxx |5 -
 desktop/source/lib/init.cxx |   18 ++
 include/LibreOfficeKit/LibreOfficeKit.h |3 +++
 include/LibreOfficeKit/LibreOfficeKit.hxx   |5 +
 include/vcl/ITiledRenderable.hxx|6 ++
 sc/inc/docuno.hxx   |3 +++
 sc/source/ui/unoobj/docuno.cxx  |6 ++
 sd/source/ui/inc/unomodel.hxx   |2 ++
 sd/source/ui/unoidl/unomodel.cxx|6 ++
 sw/inc/unotxdoc.hxx |2 ++
 sw/source/uibase/uno/unotxdoc.cxx   |5 +
 11 files changed, 60 insertions(+), 1 deletion(-)

New commits:
commit 6fc77c2fa419137abe6e1950eda3d4a0bffe105e
Author: Gökay Şatır 
AuthorDate: Tue Nov 28 14:32:59 2023 +0300
Commit: Gökay ŞATIR 
CommitDate: Thu Dec 28 13:33:59 2023 +0100

In readonly mode, we restrict many events like click.

In readonly mode, Online users need to be able to click on a hyperlink and 
get the related info.

For this purpose, this PR adds a new function template that sends the 
hyperlink info if there is any at the clicked position.

I will send the implementation with the next commit.

Signed-off-by: Gökay Şatır 
Change-Id: I886ea22a7097aac73ade0da78a88ddfc95ad819c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160022
Tested-by: Jenkins CollaboraOffice 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161372
Tested-by: Jenkins

diff --git a/desktop/qa/desktop_lib/test_desktop_lib.cxx 
b/desktop/qa/desktop_lib/test_desktop_lib.cxx
index b3410bd8eb49..cc4360807717 100644
--- a/desktop/qa/desktop_lib/test_desktop_lib.cxx
+++ b/desktop/qa/desktop_lib/test_desktop_lib.cxx
@@ -3702,8 +3702,11 @@ void DesktopLOKTest::testABI()
 CPPUNIT_ASSERT_EQUAL(documentClassOffset(71),
  offsetof(struct _LibreOfficeKitDocumentClass, 
getA11yCaretPosition));
 
+CPPUNIT_ASSERT_EQUAL(documentClassOffset(72),
+ offsetof(struct _LibreOfficeKitDocumentClass, 
hyperlinkInfoAtPosition));
+
 // As above
-CPPUNIT_ASSERT_EQUAL(documentClassOffset(72), sizeof(struct 
_LibreOfficeKitDocumentClass));
+CPPUNIT_ASSERT_EQUAL(documentClassOffset(73), sizeof(struct 
_LibreOfficeKitDocumentClass));
 }
 
 CPPUNIT_TEST_SUITE_REGISTRATION(DesktopLOKTest);
diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 76772b4162be..2f82ab48225d 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -1139,6 +1139,9 @@ static void 
doc_postWindowExtTextInputEvent(LibreOfficeKitDocument* pThis,
 unsigned nWindowId,
 int nType,
 const char* pText);
+
+static char* doc_hyperlinkInfoAtPosition(LibreOfficeKitDocument *pThis, int x, 
int y);
+
 static void doc_removeTextContext(LibreOfficeKitDocument* pThis,
   unsigned nLOKWindowId,
   int nCharBefore,
@@ -1424,6 +1427,7 @@ LibLODocument_Impl::LibLODocument_Impl(uno::Reference 
 xC
 m_pDocumentClass->registerCallback = doc_registerCallback;
 m_pDocumentClass->postKeyEvent = doc_postKeyEvent;
 m_pDocumentClass->postWindowExtTextInputEvent = 
doc_postWindowExtTextInputEvent;
+m_pDocumentClass->hyperlinkInfoAtPosition = 
doc_hyperlinkInfoAtPosition;
 m_pDocumentClass->removeTextContext = doc_removeTextContext;
 m_pDocumentClass->postWindowKeyEvent = doc_postWindowKeyEvent;
 m_pDocumentClass->postMouseEvent = doc_postMouseEvent;
@@ -4693,6 +4697,20 @@ static void 
doc_postWindowExtTextInputEvent(LibreOfficeKitDocument* pThis, unsig
 SfxLokHelper::postExtTextEventAsync(pWindow, nType, 
OUString::fromUtf8(std::string_view(pText, strlen(pText;
 }
 
+static char* doc_hyperlinkInfoAtPosition(LibreOfficeKitDocument* pThis, int x, 
int y)
+{
+SolarMutexGuard aGuard;
+
+ITiledRenderable* pDoc = getTiledRenderable(pThis);
+if (!pDoc)
+{
+SetLastExceptionMsg("Document doesn't support tiled rendering");
+return nullptr;
+}
+
+return convertOUString(pDoc->hyperlinkInfoAtPosition(x, y));
+}
+
 static void doc_removeTextContext(LibreOfficeKitDocument* pThis, unsigned 
nLOKWindowId, int nCharBefore, int nCharAfter)
 {
 SolarMutexGuard aGuard;
diff --git a/include/LibreOfficeKit/LibreOfficeKit.h 
b/include/LibreOfficeKit/LibreOfficeKit.h
index 96d6a3d3aca7..ed7f4e7f2d28 100644
--- a/include/LibreOfficeKit/LibreOfficeKit.h
+++ b/include/LibreOfficeKit/LibreOfficeKit.h
@@ -511,6 +511,9 @@ struct _LibreOfficeKitDocumentClass
 /// @see lok::Document::getA11yCaretPosition.
 int (*getA11yCaretPosition) (LibreOfficeKitDocument* pThis);
 
+/// @see lok::Document::hyperlinkInfoAtPosition().
+char* (*hyperlinkInfoAtPosition)