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

New commits:
commit 695d36f31cf3d56f97ef04e8503854ebb9e57846
Author: Marco Cecchetti <marco.cecche...@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/36257
    Reviewed-by: Jan Holesovsky <ke...@collabora.com>
    Tested-by: Jan Holesovsky <ke...@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 630c869a43c8..6c05ce59ef9b 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(
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to