summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2015-02-06 12:12:02 +0100
committerMiklos Vajna <vmiklos@collabora.co.uk>2015-02-09 08:12:12 +0100
commit1b15f4863e6d4b0a280ccd61713cbb1209ffe33e (patch)
tree6bf9d6bda69b9d8593fa0d4639f8110a0191b38c
parent17be6dab4a349944448e06a2b71df312899b3351 (diff)
LOK: add LOK_CALLBACK_TEXT_SELECTION and implement it in sw
Change-Id: I31662cb06add0d1a1c517b5f5416703aeaae1e77
-rw-r--r--include/LibreOfficeKit/LibreOfficeKit.h13
-rw-r--r--sw/source/core/crsr/viscrs.cxx14
-rw-r--r--sw/source/core/layout/trvlfrm.cxx6
3 files changed, 30 insertions, 3 deletions
diff --git a/include/LibreOfficeKit/LibreOfficeKit.h b/include/LibreOfficeKit/LibreOfficeKit.h
index 0ee2883b4027..1ef70e513c19 100644
--- a/include/LibreOfficeKit/LibreOfficeKit.h
+++ b/include/LibreOfficeKit/LibreOfficeKit.h
@@ -57,7 +57,7 @@ typedef enum
* Any tiles which are over the rectangle described in the payload are no
* 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.
*/
LOK_CALLBACK_INVALIDATE_TILES,
@@ -66,7 +66,16 @@ typedef enum
*
* 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;
diff --git a/sw/source/core/crsr/viscrs.cxx b/sw/source/core/crsr/viscrs.cxx
index bb8f6d6571e4..6d7a96143cf8 100644
--- a/sw/source/core/crsr/viscrs.cxx
+++ b/sw/source/core/crsr/viscrs.cxx
@@ -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();
#else
diff --git a/sw/source/core/layout/trvlfrm.cxx b/sw/source/core/layout/trvlfrm.cxx
index d2f9418ff374..1bb917681767 100644
--- a/sw/source/core/layout/trvlfrm.cxx
+++ b/sw/source/core/layout/trvlfrm.cxx
@@ -2007,8 +2007,12 @@ void SwRootFrm::CalcFrmRects(SwShellCrsr &rCrsr)
SwViewShell *pSh = GetCurrShell();
+ bool bIgnoreVisArea = false;
+ if (pSh)
+ bIgnoreVisArea = pSh->GetViewOptions()->IsPDFExport() || pSh->isTiledRendering();
+
// #i12836# enhanced pdf
- SwRegionRects aRegion( pSh && !pSh->GetViewOptions()->IsPDFExport() ?
+ SwRegionRects aRegion( !bIgnoreVisArea ?
pSh->VisArea() :
Frm() );
if( !pStartPos->nNode.GetNode().IsCntntNode() ||