Kaydet (Commit) af379e99 authored tarafından Miklos Vajna's avatar Miklos Vajna

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
üst 13a06aad
...@@ -179,6 +179,14 @@ void ImpEditView::DrawSelection( EditSelection aTmpSel, vcl::Region* pRegion, Ou ...@@ -179,6 +179,14 @@ void ImpEditView::DrawSelection( EditSelection aTmpSel, vcl::Region* pRegion, Ou
// but someone switches the update mode! // but someone switches the update mode!
// pRegion: When not NULL, then only calculate Region. // pRegion: When not NULL, then only calculate Region.
vcl::Region aRegion;
if (isTiledRendering())
{
assert(!pRegion);
pRegion = &aRegion;
}
tools::PolyPolygon* pPolyPoly = NULL; tools::PolyPolygon* pPolyPoly = NULL;
if ( pRegion ) if ( pRegion )
pPolyPoly = new tools::PolyPolygon; pPolyPoly = new tools::PolyPolygon;
...@@ -313,6 +321,24 @@ void ImpEditView::DrawSelection( EditSelection aTmpSel, vcl::Region* pRegion, Ou ...@@ -313,6 +321,24 @@ void ImpEditView::DrawSelection( EditSelection aTmpSel, vcl::Region* pRegion, Ou
if ( pRegion ) if ( pRegion )
{ {
*pRegion = vcl::Region( *pPolyPoly ); *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; delete pPolyPoly;
} }
else else
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment