summaryrefslogtreecommitdiff
path: root/sc/source/ui/view/gridwin.cxx
diff options
context:
space:
mode:
authorMert Tumer <mert.tumer@collabora.com>2020-02-20 18:33:04 +0300
committerAndras Timar <andras.timar@collabora.com>2020-02-29 19:38:03 +0100
commit91228affd8996d9690b0abfa9544a18701ee3ec3 (patch)
treebbad701427e85a80e9bc009486c82f323b35787f /sc/source/ui/view/gridwin.cxx
parentff0f684393b56182e01614d23d4ef836338d3517 (diff)
send hyperlinkclicked callback on calc mobile
for opening links ctrl+click must be pressed but in mobile this cant be done This patch allows it to send the callback and also cell coordinates for hyperlink popup Change-Id: I8c0fac167627ef449d9cf20a36a7a5a77978ae0f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89121 Reviewed-by: Michael Meeks <michael.meeks@collabora.com> Tested-by: Michael Meeks <michael.meeks@collabora.com> (cherry picked from commit 9bfa939f87f28cdaed2a24c3dc5f9a21004b19da) Blind build fix for Android After 9bfa939f87f28cdaed2a24c3dc5f9a21004b19da Also, replace chained OStringBuffer::append() with operator+ Change-Id: I7012667b3c4173cc0193720e0197992e5942bc7d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89164 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89693 Tested-by: Jenkins Reviewed-by: Andras Timar <andras.timar@collabora.com>
Diffstat (limited to 'sc/source/ui/view/gridwin.cxx')
-rw-r--r--sc/source/ui/view/gridwin.cxx21
1 files changed, 20 insertions, 1 deletions
diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx
index ef07ea912115..5ca54bae2a93 100644
--- a/sc/source/ui/view/gridwin.cxx
+++ b/sc/source/ui/view/gridwin.cxx
@@ -2206,7 +2206,26 @@ void ScGridWindow::MouseButtonUp( const MouseEvent& rMEvt )
// ScGlobal::OpenURL() only understands Calc A1 style syntax.
// Convert it to Calc A1 before calling OpenURL().
if (pDoc->GetAddressConvention() == formula::FormulaGrammar::CONV_OOO)
- ScGlobal::OpenURL(aUrl, aTarget);
+ {
+ // in mobile view there is no ctrl+click and for hyperlink popup
+ // the cell coordinates must be sent along with click position for elegance
+ if (comphelper::LibreOfficeKit::isActive() &&
+ comphelper::LibreOfficeKit::isMobile(SfxLokHelper::getView()))
+ {
+ ScTabViewShell* pViewShell = pViewData->GetViewShell();
+ Point aPos = rMEvt.GetPosPixel();
+ SCCOL nPosX;
+ SCROW nPosY;
+ pViewData->GetPosFromPixel( aPos.X(), aPos.Y(), eWhich, nPosX, nPosY );
+ auto pForTabView = dynamic_cast<const ScTabViewShell *>(pViewShell);
+ OString aCursor = pForTabView->GetViewData().describeCellCursorAt(nPosX, nPosY);
+ double fPPTX = pForTabView->GetViewData().GetPPTX();
+ int mouseX = aPos.X() / fPPTX;
+ OString aMsg(aUrl.toUtf8() + " coordinates: " + aCursor + ", " + OString::number(mouseX));
+ pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_HYPERLINK_CLICKED, aMsg.getStr());
+ } else
+ ScGlobal::OpenURL(aUrl, aTarget);
+ }
else
{
ScAddress aTempAddr;