[Libreoffice-commits] core.git: svx/inc svx/source

Marco Cecchetti marco.cecchetti at collabora.com
Fri Apr 7 15:52:06 UTC 2017


 svx/inc/sdr/contact/viewcontactofsdrole2obj.hxx    |    2 ++
 svx/source/sdr/contact/viewcontactofsdrole2obj.cxx |    7 ++++++-
 2 files changed, 8 insertions(+), 1 deletion(-)

New commits:
commit 5991304ede33b112b7700b2b9f0e18f6c523a0e8
Author: Marco Cecchetti <marco.cecchetti at collabora.com>
Date:   Fri Apr 7 11:58:52 2017 +0200

    LOK - Calc: charts are misplaced
    
    We need to update the transformation primitive wrapping the chart when
    the grid offset is changed.
    
    Change-Id: I42179fdc7cc806c5757a125881f08279767ccbcc
    Reviewed-on: https://gerrit.libreoffice.org/36255
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Jan Holesovsky <kendy at collabora.com>

diff --git a/svx/inc/sdr/contact/viewcontactofsdrole2obj.hxx b/svx/inc/sdr/contact/viewcontactofsdrole2obj.hxx
index 8d94c6115aa6..a00b95b1661d 100644
--- a/svx/inc/sdr/contact/viewcontactofsdrole2obj.hxx
+++ b/svx/inc/sdr/contact/viewcontactofsdrole2obj.hxx
@@ -33,6 +33,8 @@ class ViewContactOfSdrOle2Obj : public ViewContactOfSdrRectObj
 private:
     // #i123539# allow local buffering of chart data (if chart)
     drawinglayer::primitive2d::Primitive2DReference mxChartContent;
+    // used to check if we need to re-calc the transformation
+    Point maGridOffset;
 
 protected:
     // Create a Object-Specific ViewObjectContact, set ViewContact and
diff --git a/svx/source/sdr/contact/viewcontactofsdrole2obj.cxx b/svx/source/sdr/contact/viewcontactofsdrole2obj.cxx
index 874b982c1dbf..d70b9b48761a 100644
--- a/svx/source/sdr/contact/viewcontactofsdrole2obj.cxx
+++ b/svx/source/sdr/contact/viewcontactofsdrole2obj.cxx
@@ -100,12 +100,17 @@ drawinglayer::primitive2d::Primitive2DContainer ViewContactOfSdrOle2Obj::createP
         // #i123539# allow buffering and reuse of local chart data to not need to rebuild it
         // on every ViewObjectContact::getPrimitive2DSequence call. TTTT: Not needed for
         // aw080, there this mechanism alraedy works differently
-        if(mxChartContent.is())
+        if(mxChartContent.is()
+                // check if we need to update the transformation primitive wrapping the chart
+                && maGridOffset == GetOle2Obj().GetGridOffset())
         {
             xContent = mxChartContent;
         }
         else
         {
+            // update grid offset
+            const_cast< ViewContactOfSdrOle2Obj* >(this)->maGridOffset = GetOle2Obj().GetGridOffset();
+
             // try to get chart primitives and chart range directly from xChartModel
             basegfx::B2DRange aChartContentRange;
             const drawinglayer::primitive2d::Primitive2DContainer aChartSequence(


More information about the Libreoffice-commits mailing list