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

Marco Cecchetti marco.cecchetti at collabora.com
Mon Jul 9 15:43:31 UTC 2018


 sfx2/source/view/lokcharthelper.cxx |   20 +++++++++++++++-----
 1 file changed, 15 insertions(+), 5 deletions(-)

New commits:
commit 08db80ebb4e831d6501ea30de561b175819cc68c
Author: Marco Cecchetti <marco.cecchetti at collabora.com>
Date:   Mon Apr 16 12:31:21 2018 +0200

    lok: chart when edited is visible on other user's document parts
    
    - Open a spreadsheet with chart in multiple views.
    - With one view double-click in the chart.
    - With the other switch to a different sheet.
    
    => The chart is visible for the second view on the other sheet.
    
    The same is true in impress for slides.
    
    Change-Id: Ia3fe98b0a9fc94c7f3a8f59f28e3a8937eb51a2a
    Reviewed-on: https://gerrit.libreoffice.org/52960
    Tested-by: Jenkins
    Reviewed-by: Jan Holesovsky <kendy at collabora.com>

diff --git a/sfx2/source/view/lokcharthelper.cxx b/sfx2/source/view/lokcharthelper.cxx
index 820788a64195..04fade568a21 100644
--- a/sfx2/source/view/lokcharthelper.cxx
+++ b/sfx2/source/view/lokcharthelper.cxx
@@ -178,12 +178,17 @@ bool LokChartHelper::Hit(const Point& aPos)
 
 bool LokChartHelper::HitAny(const Point& aPos)
 {
+    SfxViewShell* pCurView = SfxViewShell::Current();
+    int nPartForCurView = pCurView ? pCurView->getPart() : -1;
     SfxViewShell* pViewShell = SfxViewShell::GetFirst();
     while (pViewShell)
     {
-        LokChartHelper aChartHelper(pViewShell);
-        if (aChartHelper.Hit(aPos))
-            return true;
+        if (pViewShell->getPart() == nPartForCurView)
+        {
+            LokChartHelper aChartHelper(pViewShell);
+            if (aChartHelper.Hit(aPos))
+                return true;
+        }
         pViewShell = SfxViewShell::GetNext(*pViewShell);
     }
     return false;
@@ -254,12 +259,17 @@ void LokChartHelper::PaintAllChartsOnTile(VirtualDevice& rDevice,
         aMapMode.SetScaleY(scaleY);
         rDevice.SetMapMode(aMapMode);
 
+        SfxViewShell* pCurView = SfxViewShell::Current();
+        int nPartForCurView = pCurView ? pCurView->getPart() : -1;
         tools::Rectangle aTileRect(Point(nTilePosX, nTilePosY), Size(nTileWidth, nTileHeight));
         SfxViewShell* pViewShell = SfxViewShell::GetFirst();
         while (pViewShell)
         {
-            LokChartHelper aChartHelper(pViewShell);
-            aChartHelper.PaintTile(rDevice, aTileRect);
+            if (pViewShell->getPart() == nPartForCurView)
+            {
+                LokChartHelper aChartHelper(pViewShell);
+                aChartHelper.PaintTile(rDevice, aTileRect);
+            }
             pViewShell = SfxViewShell::GetNext(*pViewShell);
         }
         rDevice.Pop();


More information about the Libreoffice-commits mailing list