summaryrefslogtreecommitdiff
path: root/sd/source/ui/unoidl/unomodel.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'sd/source/ui/unoidl/unomodel.cxx')
-rw-r--r--sd/source/ui/unoidl/unomodel.cxx24
1 files changed, 22 insertions, 2 deletions
diff --git a/sd/source/ui/unoidl/unomodel.cxx b/sd/source/ui/unoidl/unomodel.cxx
index cfc6ec8266b5..c9b69575ff49 100644
--- a/sd/source/ui/unoidl/unomodel.cxx
+++ b/sd/source/ui/unoidl/unomodel.cxx
@@ -127,6 +127,7 @@
#include <sfx2/LokControlHandler.hxx>
#include <tools/gen.hxx>
#include <tools/debug.hxx>
+#include <tools/urlobj.hxx>
#include <comphelper/diagnose_ex.hxx>
#include <tools/json_writer.hxx>
#include <tools/UnitConversion.hxx>
@@ -2701,9 +2702,28 @@ void SdXImpressDocument::setTextSelection(int nType, int nX, int nY)
}
}
-OUString SdXImpressDocument::hyperlinkInfoAtPosition(int /*x*/, int /*y*/)
+OUString SdXImpressDocument::hyperlinkInfoAtPosition(int x, int y)
{
- // To be implemented..
+ ::sd::ViewShell* viewSh = GetViewShell();
+
+ if (viewSh)
+ {
+ Point point(x, y);
+ point = o3tl::convert(point, o3tl::Length::twip, o3tl::Length::mm100);
+ SdrView* pSdrView = SfxViewShell::Current()->GetDrawView();
+
+ if (pSdrView)
+ {
+ SdrViewEvent aVEvt;
+ pSdrView->PickAnything(point, aVEvt);
+ if (aVEvt.mpURLField)
+ {
+ OUString aURL = INetURLObject::decode(aVEvt.mpURLField->GetURL(), INetURLObject::DecodeMechanism::WithCharset);
+ return aURL;
+ }
+ }
+ }
+
return OUString();
}