[Libreoffice-commits] core.git: sd/source

Tamás Zolnai tamas.zolnai at collabora.com
Fri Oct 27 21:24:19 UTC 2017


 sd/source/ui/func/futext.cxx |   20 +++++++++++++++++---
 1 file changed, 17 insertions(+), 3 deletions(-)

New commits:
commit e142027a26634f51b0fc0903076f980d4a37496a
Author: Tamás Zolnai <tamas.zolnai at collabora.com>
Date:   Fri Oct 27 18:48:51 2017 +0200

    tdf#110002: Sidebar shows 2 as font height for some specific...
    
    ... Impress tables cells
    
    While clicking inside a table we can avoid to unmark and
    remark the corresponding table. This unneccessary
    unmark\remark operations trigger a lot of useless updating
    stuff.
    For example it regenerate the whole sidebar while we still in
    the table so the sidebar's context did not actually change.
    
    Change-Id: I4c56b87b032e3cced3f09801147784dd2baaf9ef
    Reviewed-on: https://gerrit.libreoffice.org/43961
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Tamás Zolnai <tamas.zolnai at collabora.com>

diff --git a/sd/source/ui/func/futext.cxx b/sd/source/ui/func/futext.cxx
index 03baf601f141..19f18efa9906 100644
--- a/sd/source/ui/func/futext.cxx
+++ b/sd/source/ui/func/futext.cxx
@@ -299,13 +299,26 @@ bool FuText::MouseButtonDown(const MouseEvent& rMEvt)
             }
             else
             {
+                // Don't remark table when clicking in it, mark change triggers a lot of updating
+                bool bMarkChanges = true;
+                rtl::Reference< sdr::SelectionController > xSelectionController(mpView->getSelectionController());
+                if (eHit == SdrHitKind::TextEditObj && xSelectionController.is())
+                {
+                    const SdrMarkList& rMarkList = mpView->GetMarkedObjectList();
+                    if (rMarkList.GetMarkCount() == 1 && rMarkList.GetMark(0)->GetMarkedSdrObj() == aVEvt.pRootObj)
+                        bMarkChanges = false;
+                }
+
                 if (eHit != SdrHitKind::Handle)
                 {
                     // deselect selection
                     if (!rMEvt.IsShift() && eHit == SdrHitKind::TextEditObj)
                     {
-                        mpView->UnmarkAll();
-                        mpView->SetDragMode(SdrDragMode::Move);
+                        if(bMarkChanges)
+                        {
+                            mpView->UnmarkAll();
+                            mpView->SetDragMode(SdrDragMode::Move);
+                        }
                     }
                 }
 
@@ -321,7 +334,8 @@ bool FuText::MouseButtonDown(const MouseEvent& rMEvt)
                     {
                         /* hit text of unmarked object:
                            select object and set to EditMode */
-                        mpView->MarkObj(aVEvt.pRootObj, pPV);
+                        if (bMarkChanges)
+                            mpView->MarkObj(aVEvt.pRootObj, pPV);
 
                         if (aVEvt.pObj && dynamic_cast< const SdrTextObj *>( aVEvt.pObj ) !=  nullptr)
                         {


More information about the Libreoffice-commits mailing list