vcl/jsdialog/executor.cxx | 17 +++++++++++++++++ 1 file changed, 17 insertions(+)
New commits: commit a1549c122724733f51096611486a26dcad7321fe Author: Mert Tumer <mert.tu...@collabora.com> AuthorDate: Wed Dec 16 23:01:25 2020 +0300 Commit: Mert Tumer <mert.tu...@collabora.com> CommitDate: Tue Jan 12 09:41:31 2021 +0100 jsdialogs: send click pos for drawingarea Change-Id: I91aae808fe17f47fe9fa75dca069e4919c2ce4c3 Signed-off-by: Mert Tumer <mert.tu...@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108685 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com> diff --git a/vcl/jsdialog/executor.cxx b/vcl/jsdialog/executor.cxx index 62e6c2b660fd..f33eeb4b086a 100644 --- a/vcl/jsdialog/executor.cxx +++ b/vcl/jsdialog/executor.cxx @@ -118,6 +118,23 @@ bool ExecuteAction(sal_uInt64 nWindowId, const OString& rWidget, StringMap& rDat { if (sAction == "click") { + int separatorPos = rData["data"].indexOf(';'); + if (separatorPos > 0) + { + // x;y + OString clickPosX = OUStringToOString(rData["data"].copy(0, separatorPos), RTL_TEXTENCODING_ASCII_US); + OString clickPosY = OUStringToOString(rData["data"].copy(separatorPos + 1), RTL_TEXTENCODING_ASCII_US); + if (!clickPosX.isEmpty() && !clickPosY.isEmpty()) + { + double posX = std::atof(clickPosX.getStr()); + double posY = std::atof(clickPosY.getStr()); + Size size = pArea->get_size_request(); + posX = posX * size.Width(); + posY = posY * size.Height(); + LOKTrigger::trigger_click(*pArea, Point(posX, posY)); + return true; + } + } LOKTrigger::trigger_click(*pArea, Point(10, 10)); return true; } _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits