summaryrefslogtreecommitdiff
path: root/editeng/source
diff options
context:
space:
mode:
authorMarco Cecchetti <marco.cecchetti@collabora.com>2020-01-14 14:35:11 +0100
committerMarco Cecchetti <marco.cecchetti@collabora.com>2020-03-06 10:42:46 +0100
commit6fdd5e3ec95712d03b30fc32acffa358b7fef46e (patch)
tree6f32792244fff8ac5ebec8417673efb294a82a00 /editeng/source
parent300e65cc47f3d6ae1563350757dbfadc080d7452 (diff)
lok: calc: send text selection rectangles for the input bar
Change-Id: I3caeaddd7a5ddc6e496650539b88e2fd81b37e6e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86790 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Jan Holesovsky <kendy@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90069 Tested-by: Jenkins Reviewed-by: Marco Cecchetti <marco.cecchetti@collabora.com>
Diffstat (limited to 'editeng/source')
-rw-r--r--editeng/source/editeng/impedit.cxx40
1 files changed, 40 insertions, 0 deletions
diff --git a/editeng/source/editeng/impedit.cxx b/editeng/source/editeng/impedit.cxx
index 53900c16aa76..0162856b0e36 100644
--- a/editeng/source/editeng/impedit.cxx
+++ b/editeng/source/editeng/impedit.cxx
@@ -382,6 +382,33 @@ void ImpEditView::DrawSelectionXOR( EditSelection aTmpSel, vcl::Region* pRegion,
if (comphelper::LibreOfficeKit::isActive() && mpViewShell && !pOldRegion && pOutWin)
{
+ VclPtr<vcl::Window> pParent = pOutWin->GetParentWithLOKNotifier();
+ if (pParent && pParent->GetLOKWindowId() != 0)
+ {
+ const long nX = pOutWin->GetOutOffXPixel() - pParent->GetOutOffXPixel();
+ const long nY = pOutWin->GetOutOffYPixel() - pParent->GetOutOffYPixel();
+
+ std::vector<tools::Rectangle> aRectangles;
+ pRegion->GetRegionRectangles(aRectangles);
+
+ std::vector<OString> v;
+ for (tools::Rectangle & rRectangle : aRectangles)
+ {
+ rRectangle = pOutWin->LogicToPixel(rRectangle);
+ rRectangle.Move(nX, nY);
+ v.emplace_back(rRectangle.toString().getStr());
+ }
+ OString sRectangle = comphelper::string::join("; ", v);
+
+ const vcl::ILibreOfficeKitNotifier* pNotifier = pParent->GetLOKNotifier();
+ const OUString rAction("text_selection");
+ std::vector<vcl::LOKPayloadItem> aItems;
+ aItems.emplace_back("rectangles", sRectangle);
+ pNotifier->notifyWindow(pParent->GetLOKWindowId(), rAction, aItems);
+ pPolyPoly.reset();
+ return;
+ }
+
pOutWin->Push(PushFlags::MAPMODE);
if (pOutWin->GetMapMode().GetMapUnit() == MapUnit::MapTwip)
{
@@ -1743,6 +1770,19 @@ void ImpEditView::DeselectAll()
aNewSelection.Min() = aNewSelection.Max();
SetEditSelection(aNewSelection);
// const_cast<EditPaM&>(GetEditSelection().Min()) = GetEditSelection().Max();
+
+ if (comphelper::LibreOfficeKit::isActive() && mpViewShell)
+ {
+ VclPtr<vcl::Window> pParent = pOutWin->GetParentWithLOKNotifier();
+ if (pParent && pParent->GetLOKWindowId())
+ {
+ const vcl::ILibreOfficeKitNotifier* pNotifier = pParent->GetLOKNotifier();
+ const OUString rAction("text_selection");
+ std::vector<vcl::LOKPayloadItem> aItems;
+ aItems.emplace_back("rectangles", "");
+ pNotifier->notifyWindow(pParent->GetLOKWindowId(), rAction, aItems);
+ }
+ }
}
bool ImpEditView::IsSelectionAtPoint( const Point& rPosPixel )