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

Tor Lillqvist tml at collabora.com
Fri Apr 17 07:34:10 PDT 2015


 chart2/source/view/diagram/VDiagram.cxx |   24 +++++++++++++++++++++---
 svx/source/engine3d/dragmt3d.cxx        |    5 +++++
 svx/source/engine3d/e3dundo.cxx         |    4 ++++
 svx/source/engine3d/obj3d.cxx           |    3 +++
 svx/source/engine3d/scene3d.cxx         |    2 ++
 svx/source/svdraw/svdundo.cxx           |    4 ++++
 6 files changed, 39 insertions(+), 3 deletions(-)

New commits:
commit ba397fc65fa4a21742b62c5b3f796b3535263ef4
Author: Tor Lillqvist <tml at collabora.com>
Date:   Fri Apr 17 17:15:32 2015 +0300

    Revert "WaE: unused variables"
    
    See 3ac1584549364c573d4d4e3baed9ad39ad6ce8e4.
    
    This reverts commit 7bcf9131032cbcdb162f33d03230e43d4f1db2aa.
    This reverts commit 063aec33f029f1fbdd1b1ee274e94a00f256465e.

diff --git a/chart2/source/view/diagram/VDiagram.cxx b/chart2/source/view/diagram/VDiagram.cxx
index ae8a165..9f5db99 100644
--- a/chart2/source/view/diagram/VDiagram.cxx
+++ b/chart2/source/view/diagram/VDiagram.cxx
@@ -209,6 +209,24 @@ void VDiagram::createShapes_2d()
     adjustPosAndSize_2d( m_aAvailablePosIncludingAxes, m_aAvailableSizeIncludingAxes );
 }
 
+E3dScene* lcl_getE3dScene( const uno::Reference< drawing::XShape >& xShape )
+{
+    E3dScene* pRet=NULL;
+    uno::Reference< lang::XUnoTunnel > xUnoTunnel( xShape, uno::UNO_QUERY );
+    uno::Reference< lang::XTypeProvider > xTypeProvider( xShape, uno::UNO_QUERY );
+    if(xUnoTunnel.is()&&xTypeProvider.is())
+    {
+        SvxShape* pSvxShape = reinterpret_cast<SvxShape*>(xUnoTunnel->getSomething( SvxShape::getUnoTunnelId() ));
+        if(pSvxShape)
+        {
+            SdrObject* pObj = pSvxShape->GetSdrObject();
+            if( pObj && pObj->ISA(E3dScene) )
+                pRet = static_cast<E3dScene*>(pObj);
+        }
+    }
+    return pRet;
+}
+
 void lcl_setLightSources(
     const uno::Reference< beans::XPropertySet > & xSource,
     const uno::Reference< beans::XPropertySet > & xDest )
@@ -419,8 +437,7 @@ void VDiagram::adjustAspectRatio3d( const awt::Size& rAvailableSize )
             // To get the 3D aspect ratio's effect on the 2D scene size, the scene's 2D size needs to be adapted to
             // 3D content changes here. The tooling class remembers the current 3D transformation stack
             // and in its destructor, calculates a new 2D SnapRect for the scene and it's modified 3D geometry.
-
-            // Unclear whether the above comment refers to an unused variable that was removed, or to the below code
+            E3DModifySceneSnapRectUpdater aUpdater(lcl_getE3dScene( m_xOuterGroupShape ));
 
             m_xAspectRatio3D->setPropertyValue( UNO_NAME_3D_TRANSFORM_MATRIX
                 , uno::makeAny(BaseGFXHelper::B3DHomMatrixToHomogenMatrix( aResult )) );
@@ -585,7 +602,7 @@ void VDiagram::createShapes_3d()
                 aEffectiveTranformation.shearXY(m_fYAnglePi,-m_fXAnglePi);
 
             //#i98497# 3D charts are rendered with wrong size
-
+            E3DModifySceneSnapRectUpdater aUpdater(lcl_getE3dScene( m_xOuterGroupShape ));
             xDestProp->setPropertyValue( UNO_NAME_3D_TRANSFORM_MATRIX,
                     uno::makeAny( BaseGFXHelper::B3DHomMatrixToHomogenMatrix( aEffectiveTranformation ) ) );
         }
@@ -642,6 +659,7 @@ void VDiagram::createShapes_3d()
                 ::basegfx::B3DHomMatrix aM;
                 aM.translate(GRID_TO_WALL_DISTANCE/fXScale, GRID_TO_WALL_DISTANCE/fYScale, GRID_TO_WALL_DISTANCE/fZScale);
                 aM.scale( fXScale, fYScale, fZScale );
+                E3DModifySceneSnapRectUpdater aUpdater(lcl_getE3dScene( m_xOuterGroupShape ));
                 xShapeProp->setPropertyValue( UNO_NAME_3D_TRANSFORM_MATRIX
                     , uno::makeAny(BaseGFXHelper::B3DHomMatrixToHomogenMatrix(aM)) );
             }
diff --git a/svx/source/engine3d/dragmt3d.cxx b/svx/source/engine3d/dragmt3d.cxx
index e02a6a7..39dd69f 100644
--- a/svx/source/engine3d/dragmt3d.cxx
+++ b/svx/source/engine3d/dragmt3d.cxx
@@ -159,6 +159,7 @@ bool E3dDragMethod::EndSdrDrag(bool /*bCopy*/)
         for(nOb=0;nOb<nCnt;nOb++)
         {
             E3dDragMethodUnit& rCandidate = maGrp[nOb];
+            E3DModifySceneSnapRectUpdater aUpdater(rCandidate.mp3DObj);
             rCandidate.mp3DObj->SetTransform(rCandidate.maTransform);
             if( bUndo )
             {
@@ -186,6 +187,7 @@ void E3dDragMethod::CancelSdrDrag()
             {
                 // Restore transformation
                 E3dDragMethodUnit& rCandidate = maGrp[nOb];
+                E3DModifySceneSnapRectUpdater aUpdater(rCandidate.mp3DObj);
                 rCandidate.mp3DObj->SetTransform(rCandidate.maInitTransform);
             }
         }
@@ -406,6 +408,7 @@ void E3dDragRotate::MoveSdrDrag(const Point& rPnt)
 
             if(mbMoveFull)
             {
+                E3DModifySceneSnapRectUpdater aUpdater(rCandidate.mp3DObj);
                 rCandidate.mp3DObj->SetTransform(rCandidate.maTransform);
             }
             else
@@ -555,6 +558,7 @@ void E3dDragMove::MoveSdrDrag(const Point& rPnt)
 
                 if(mbMoveFull)
                 {
+                    E3DModifySceneSnapRectUpdater aUpdater(rCandidate.mp3DObj);
                     rCandidate.mp3DObj->SetTransform(rCandidate.maTransform);
                 }
                 else
@@ -673,6 +677,7 @@ void E3dDragMove::MoveSdrDrag(const Point& rPnt)
 
                 if(mbMoveFull)
                 {
+                    E3DModifySceneSnapRectUpdater aUpdater(rCandidate.mp3DObj);
                     rCandidate.mp3DObj->SetTransform(rCandidate.maTransform);
                 }
                 else
diff --git a/svx/source/engine3d/e3dundo.cxx b/svx/source/engine3d/e3dundo.cxx
index 4f7a6dd..9d6dcfc 100644
--- a/svx/source/engine3d/e3dundo.cxx
+++ b/svx/source/engine3d/e3dundo.cxx
@@ -49,6 +49,7 @@ E3dRotateUndoAction::~E3dRotateUndoAction ()
 
 void E3dRotateUndoAction::Undo ()
 {
+    E3DModifySceneSnapRectUpdater aUpdater(pMy3DObj);
     pMy3DObj->SetTransform(aMyOldRotation);
 }
 
@@ -56,6 +57,7 @@ void E3dRotateUndoAction::Undo ()
 
 void E3dRotateUndoAction::Redo ()
 {
+    E3DModifySceneSnapRectUpdater aUpdater(pMy3DObj);
     pMy3DObj->SetTransform(aMyNewRotation);
 }
 
@@ -81,11 +83,13 @@ E3dAttributesUndoAction::~E3dAttributesUndoAction()
 
 void E3dAttributesUndoAction::Undo()
 {
+    E3DModifySceneSnapRectUpdater aUpdater(pObject);
     pObject->SetMergedItemSetAndBroadcast(aOldSet);
 }
 
 void E3dAttributesUndoAction::Redo()
 {
+    E3DModifySceneSnapRectUpdater aUpdater(pObject);
     pObject->SetMergedItemSetAndBroadcast(aNewSet);
 }
 
diff --git a/svx/source/engine3d/obj3d.cxx b/svx/source/engine3d/obj3d.cxx
index a701ad9..ef50b3d 100644
--- a/svx/source/engine3d/obj3d.cxx
+++ b/svx/source/engine3d/obj3d.cxx
@@ -374,6 +374,7 @@ void E3dObject::NbcResize(const Point& rRef, const Fraction& xFact, const Fracti
         basegfx::B3DHomMatrix mObjTrans(GetTransform());
         mObjTrans *= mTrans;
 
+        E3DModifySceneSnapRectUpdater aUpdater(this);
         SetTransform(mObjTrans);
     }
 }
@@ -426,6 +427,7 @@ void E3dObject::NbcMove(const Size& rSize)
         basegfx::B3DHomMatrix aTranslate;
         aTranslate.translate(aMove.getX() - aPos.getX(), aMove.getY() - aPos.getY(), aMove.getZ() - aPos.getZ());
 
+        E3DModifySceneSnapRectUpdater aUpdater(pScene);
         SetTransform(aTranslate * GetTransform());
     }
 }
@@ -737,6 +739,7 @@ void E3dObject::SaveGeoData(SdrObjGeoData& rGeo) const
 void E3dObject::RestGeoData(const SdrObjGeoData& rGeo)
 {
     maLocalBoundVol = static_cast<const E3DObjGeoData &>(rGeo).maLocalBoundVol;
+    E3DModifySceneSnapRectUpdater aUpdater(this);
     NbcSetTransform(static_cast<const E3DObjGeoData &>(rGeo).maTransformation);
     SdrAttrObj::RestGeoData (rGeo);
 }
diff --git a/svx/source/engine3d/scene3d.cxx b/svx/source/engine3d/scene3d.cxx
index 6140815..2876b4d 100644
--- a/svx/source/engine3d/scene3d.cxx
+++ b/svx/source/engine3d/scene3d.cxx
@@ -397,6 +397,8 @@ E3dScene* E3dScene::GetScene() const
 
 void E3dScene::removeAllNonSelectedObjects()
 {
+    E3DModifySceneSnapRectUpdater aUpdater(this);
+
     for(size_t a = 0; a < maSubList.GetObjCount(); ++a)
     {
         SdrObject* pObj = maSubList.GetObj(a);
diff --git a/svx/source/svdraw/svdundo.cxx b/svx/source/svdraw/svdundo.cxx
index 2e11ebc..12bf420 100644
--- a/svx/source/svdraw/svdundo.cxx
+++ b/svx/source/svdraw/svdundo.cxx
@@ -322,6 +322,7 @@ SdrUndoAttrObj::~SdrUndoAttrObj()
 
 void SdrUndoAttrObj::Undo()
 {
+    E3DModifySceneSnapRectUpdater aUpdater(pObj);
     bool bIs3DScene(pObj && pObj->ISA(E3dScene));
 
     // Trigger PageChangeCall
@@ -428,6 +429,7 @@ void SdrUndoAttrObj::Undo()
 
 void SdrUndoAttrObj::Redo()
 {
+    E3DModifySceneSnapRectUpdater aUpdater(pObj);
     bool bIs3DScene(pObj && pObj->ISA(E3dScene));
 
     if(!pUndoGroup || bIs3DScene)
@@ -741,6 +743,7 @@ void SdrUndoRemoveObj::Undo()
             aOwnerAnchorPos = pObjList->GetOwnerObj()->GetAnchorPos();
         }
 
+        E3DModifySceneSnapRectUpdater aUpdater(pObjList->GetOwnerObj());
         SdrInsertReason aReason(SDRREASON_UNDO);
         pObjList->InsertObject(pObj,nOrdNum,&aReason);
 
@@ -758,6 +761,7 @@ void SdrUndoRemoveObj::Redo()
     if (pObj->IsInserted())
     {
         ImplUnmarkObject( pObj );
+        E3DModifySceneSnapRectUpdater aUpdater(pObj);
         pObjList->RemoveObject(nOrdNum);
     }
 


More information about the Libreoffice-commits mailing list