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
This commit is contained in:
@@ -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
|
|||||||
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
|
||||||
|
Reference in New Issue
Block a user