diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2015-03-13 17:23:02 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2015-03-16 09:38:11 +0100 |
commit | af379e99eb83fab544565d34f11f38241d0d4e8d (patch) | |
tree | ed8f32a0c830654ede609bf656fa0c46407e7c3f /editeng | |
parent | 13a06aad7c4696e0ae48bfdbdabab18eb9f81d38 (diff) |
ImpEditView::DrawSelection: emit TEXT_SELECTION LOK callback
With this, if one double-clicks on a word in an editeng text, we emit
the correct selection rectangle list callback. No start/end rectangles
yet, though.
Change-Id: Ie05f6f4a44dc638076527f21a4b6a44e9bf63ecb
Diffstat (limited to 'editeng')
-rw-r--r-- | editeng/source/editeng/impedit.cxx | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/editeng/source/editeng/impedit.cxx b/editeng/source/editeng/impedit.cxx index 0c54e5e23ad6..ed456a19cccd 100644 --- a/editeng/source/editeng/impedit.cxx +++ b/editeng/source/editeng/impedit.cxx @@ -179,6 +179,14 @@ void ImpEditView::DrawSelection( EditSelection aTmpSel, vcl::Region* pRegion, Ou // but someone switches the update mode! // pRegion: When not NULL, then only calculate Region. + + vcl::Region aRegion; + if (isTiledRendering()) + { + assert(!pRegion); + pRegion = &aRegion; + } + tools::PolyPolygon* pPolyPoly = NULL; if ( pRegion ) pPolyPoly = new tools::PolyPolygon; @@ -313,6 +321,24 @@ void ImpEditView::DrawSelection( EditSelection aTmpSel, vcl::Region* pRegion, Ou if ( pRegion ) { *pRegion = vcl::Region( *pPolyPoly ); + + if (isTiledRendering()) + { + std::vector<Rectangle> aRectangles; + pRegion->GetRegionRectangles(aRectangles); + std::stringstream ss; + + for (size_t i = 0; i < aRectangles.size(); ++i) + { + const Rectangle& rRectangle = aRectangles[i]; + if (i) + ss << "; "; + ss << rRectangle.toString().getStr(); + } + OString sRectangle = ss.str().c_str(); + libreOfficeKitCallback(LOK_CALLBACK_TEXT_SELECTION, sRectangle.getStr()); + } + delete pPolyPoly; } else |