[Libreoffice-commits] core.git: Branch 'feature/tiled-editing' - 2 commits - editeng/source sw/source

Miklos Vajna vmiklos at collabora.co.uk
Fri Mar 13 09:51:28 PDT 2015


 editeng/source/editeng/impedit.cxx |   26 ++++++++++++++++++++++++++
 sw/source/core/crsr/viscrs.cxx     |    6 +++++-
 2 files changed, 31 insertions(+), 1 deletion(-)

New commits:
commit 1ee40fe9333fbea44db1fa16185356e62fd09543
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date:   Fri Mar 13 17:23:02 2015 +0100

    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

diff --git a/editeng/source/editeng/impedit.cxx b/editeng/source/editeng/impedit.cxx
index 0c54e5e..ed456a1 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
commit ddd7636318bb5c57cab2e6832e972c5e1edacc81
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date:   Fri Mar 13 17:07:37 2015 +0100

    SwSelPaintRects::Show: silence LOK callback till draw edit is active
    
    Change-Id: I84c1567efd2e7e6bcd09086ecce5041c2929c1b4

diff --git a/sw/source/core/crsr/viscrs.cxx b/sw/source/core/crsr/viscrs.cxx
index cbb55e8..3eb2551 100644
--- a/sw/source/core/crsr/viscrs.cxx
+++ b/sw/source/core/crsr/viscrs.cxx
@@ -339,7 +339,11 @@ void SwSelPaintRects::Show()
             }
         }
 
-        if (GetShell()->isTiledRendering())
+        // Tiled editing does not expose the draw and writer cursor, it just
+        // talks about "the" cursor at the moment. As long as that's true,
+        // don't say anything about the Writer cursor till a draw object is
+        // being edited.
+        if (GetShell()->isTiledRendering() && !pView->GetTextEditObject())
         {
             if (!empty())
             {


More information about the Libreoffice-commits mailing list