diff options
author | Marco Cecchetti <marco.cecchetti@collabora.com> | 2020-01-14 14:35:11 +0100 |
---|---|---|
committer | Jan Holesovsky <kendy@collabora.com> | 2020-01-28 10:18:47 +0100 |
commit | de2a7a66658e283021725eeaeb0961e2962151f9 (patch) | |
tree | e5c8565633dfc589e67388d22dc5518ed01e010d /editeng | |
parent | 832997c849f166a808009494fb5004cfa6e10b4e (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>
Diffstat (limited to 'editeng')
-rw-r--r-- | editeng/source/editeng/impedit.cxx | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/editeng/source/editeng/impedit.cxx b/editeng/source/editeng/impedit.cxx index 7b920638537c..c9ad00241a55 100644 --- a/editeng/source/editeng/impedit.cxx +++ b/editeng/source/editeng/impedit.cxx @@ -379,6 +379,33 @@ void ImpEditView::DrawSelectionXOR( EditSelection aTmpSel, vcl::Region* pRegion, if (comphelper::LibreOfficeKit::isActive() && mpViewShell && !pOldRegion) { + 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); + delete pPolyPoly; + return; + } + pOutWin->Push(PushFlags::MAPMODE); if (pOutWin->GetMapMode().GetMapUnit() == MapUnit::MapTwip) { @@ -1745,6 +1772,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 ) |