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

LOK: add LOK_CALLBACK_TEXT_SELECTION and implement it in sw

Change-Id: I31662cb06add0d1a1c517b5f5416703aeaae1e77
üst 17be6dab
...@@ -57,7 +57,7 @@ typedef enum ...@@ -57,7 +57,7 @@ typedef enum
* Any tiles which are over the rectangle described in the payload are no * Any tiles which are over the rectangle described in the payload are no
* longer valid. * longer valid.
* *
* Rectangle format: "width,height,x,y", where all numbers are document * Rectangle format: "width, height, x, y", where all numbers are document
* coordinates, in twips. * coordinates, in twips.
*/ */
LOK_CALLBACK_INVALIDATE_TILES, LOK_CALLBACK_INVALIDATE_TILES,
...@@ -66,7 +66,16 @@ typedef enum ...@@ -66,7 +66,16 @@ typedef enum
* *
* Rectangle format is the same as LOK_CALLBACK_INVALIDATE_TILES. * Rectangle format is the same as LOK_CALLBACK_INVALIDATE_TILES.
*/ */
LOK_CALLBACK_INVALIDATE_VISIBLE_CURSOR LOK_CALLBACK_INVALIDATE_VISIBLE_CURSOR,
/**
* The list of rectangles representing the current text selection changed.
*
* List format is "rectangle1[; rectangle2[; ...]]" (without quotes and
* brackets), where rectangleN has the same format as
* LOK_CALLBACK_INVALIDATE_TILES. When there is no selection, an empty
* string is provided.
*/
LOK_CALLBACK_TEXT_SELECTION
} }
LibreOfficeKitCallbackType; LibreOfficeKitCallbackType;
......
...@@ -314,6 +314,20 @@ void SwSelPaintRects::Show() ...@@ -314,6 +314,20 @@ void SwSelPaintRects::Show()
} }
} }
if (GetShell()->isTiledRendering())
{
std::stringstream ss;
for (size_type i = 0; i < size(); ++i)
{
const SwRect& rRect = (*this)[i];
if (i)
ss << "; ";
ss << rRect.Width() << ", " << rRect.Height() << ", " << rRect.Left() << ", " << rRect.Top();
}
OString sRect = ss.str().c_str();
GetShell()->libreOfficeKitCallback(LOK_CALLBACK_TEXT_SELECTION, sRect.getStr());
}
HighlightInputFld(); HighlightInputFld();
#else #else
......
...@@ -2007,8 +2007,12 @@ void SwRootFrm::CalcFrmRects(SwShellCrsr &rCrsr) ...@@ -2007,8 +2007,12 @@ void SwRootFrm::CalcFrmRects(SwShellCrsr &rCrsr)
SwViewShell *pSh = GetCurrShell(); SwViewShell *pSh = GetCurrShell();
bool bIgnoreVisArea = false;
if (pSh)
bIgnoreVisArea = pSh->GetViewOptions()->IsPDFExport() || pSh->isTiledRendering();
// #i12836# enhanced pdf // #i12836# enhanced pdf
SwRegionRects aRegion( pSh && !pSh->GetViewOptions()->IsPDFExport() ? SwRegionRects aRegion( !bIgnoreVisArea ?
pSh->VisArea() : pSh->VisArea() :
Frm() ); Frm() );
if( !pStartPos->nNode.GetNode().IsCntntNode() || if( !pStartPos->nNode.GetNode().IsCntntNode() ||
......
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