summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorGökay Şatır <gokaysatir@collabora.com>2023-11-28 14:32:59 +0300
committerGökay ŞATIR <gokaysatir@collabora.com>2023-12-28 13:33:59 +0100
commit6fc77c2fa419137abe6e1950eda3d4a0bffe105e (patch)
tree81a3e4eddae0c321340ff5f4a6568c5d597217d9 /sw
parenta22ac6caece8da5add6800bdfba9865bdcfde064 (diff)
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 <gokaysatir@collabora.com> Change-Id: I886ea22a7097aac73ade0da78a88ddfc95ad819c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160022 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161372 Tested-by: Jenkins
Diffstat (limited to 'sw')
-rw-r--r--sw/inc/unotxdoc.hxx2
-rw-r--r--sw/source/uibase/uno/unotxdoc.cxx5
2 files changed, 7 insertions, 0 deletions
diff --git a/sw/inc/unotxdoc.hxx b/sw/inc/unotxdoc.hxx
index 4fce95eda9ec..65728f403e15 100644
--- a/sw/inc/unotxdoc.hxx
+++ b/sw/inc/unotxdoc.hxx
@@ -445,6 +445,8 @@ public:
virtual void postMouseEvent(int nType, int nX, int nY, int nCount, int nButtons, int nModifier) override;
/// @see vcl::ITiledRenderable::setTextSelection().
virtual void setTextSelection(int nType, int nX, int nY) override;
+ /// @see vcl::ITiledRenderable::hyperlinkInfoAtPosition().
+ virtual OUString hyperlinkInfoAtPosition(int x, int y) override;
/// @see vcl::ITiledRenderable::getSelection().
virtual css::uno::Reference<css::datatransfer::XTransferable> getSelection() override;
/// @see vcl::ITiledRenderable::setGraphicSelection().
diff --git a/sw/source/uibase/uno/unotxdoc.cxx b/sw/source/uibase/uno/unotxdoc.cxx
index 5b7e3533fbe6..7dc4f1ccdeeb 100644
--- a/sw/source/uibase/uno/unotxdoc.cxx
+++ b/sw/source/uibase/uno/unotxdoc.cxx
@@ -3711,6 +3711,11 @@ void SwXTextDocument::setTextSelection(int nType, int nX, int nY)
}
}
+OUString SwXTextDocument::hyperlinkInfoAtPosition(int x, int y)
+{
+ return OUString::createFromAscii(std::to_string(x + y));
+}
+
uno::Reference<datatransfer::XTransferable> SwXTextDocument::getSelection()
{
SolarMutexGuard aGuard;