[Libreoffice-commits] core.git: Branch 'private/kohei/new-chart-type-skeleton' - 3 commits - chart2/source sc/source

Kohei Yoshida kohei.yoshida at collabora.com
Mon Mar 24 11:18:38 PDT 2014


 chart2/source/controller/chartapiwrapper/WrappedSplineProperties.cxx |    4 
 chart2/source/controller/dialogs/tp_ChartType.cxx                    |    7 +
 chart2/source/controller/dialogs/tp_ChartType.hxx                    |    1 
 sc/source/core/data/formulacell.cxx                                  |   44 ----------
 4 files changed, 10 insertions(+), 46 deletions(-)

New commits:
commit 9e1ba6209072db64cb5cf31dd64bc9cda76ceab8
Author: Kohei Yoshida <kohei.yoshida at collabora.com>
Date:   Mon Mar 24 13:03:16 2014 -0400

    coverity#1078504: Remove logically dead code.
    
    Change-Id: I6bb3ee8f604d9b79209cda13a48ccd7f2df4f26e

diff --git a/sc/source/core/data/formulacell.cxx b/sc/source/core/data/formulacell.cxx
index b5ec659..320a2c2 100644
--- a/sc/source/core/data/formulacell.cxx
+++ b/sc/source/core/data/formulacell.cxx
@@ -3233,7 +3233,6 @@ void ScFormulaCell::UpdateTranspose( const ScRange& rSource, const ScAddress& rD
     bool bRefChanged = false;
     ScToken* t;
 
-    ScRangeData* pShared = NULL;
     pCode->Reset();
     while( (t = static_cast<ScToken*>(pCode->GetNextReferenceOrName())) != NULL )
     {
@@ -3260,27 +3259,6 @@ void ScFormulaCell::UpdateTranspose( const ScRange& rSource, const ScAddress& rD
         }
     }
 
-    if (pShared) // Exchange Shared Formula with real Formula
-    {
-        pDocument->RemoveFromFormulaTree( this ); // update formula count
-        delete pCode;
-        pCode = new ScTokenArray( *pShared->GetCode() );
-        bRefChanged = true;
-        pCode->Reset();
-        while( (t = static_cast<ScToken*>(pCode->GetNextReference())) != NULL )
-        {
-            if( t->GetType() != svIndex )
-            {
-                SingleDoubleRefModifier aMod(*t);
-                ScComplexRefData& rRef = aMod.Ref();
-                ScRange aAbs = rRef.toAbs(aOldPos);
-                bool bMod = (ScRefUpdate::UpdateTranspose(pDocument, rSource, rDest, aAbs) != UR_NOTHING || bPosChanged);
-                if (bMod)
-                    rRef.SetRange(aAbs, aPos); // based on the new anchor position.
-            }
-        }
-    }
-
     if (bRefChanged)
     {
         if (pUndoDoc)
@@ -3308,7 +3286,6 @@ void ScFormulaCell::UpdateGrow( const ScRange& rArea, SCCOL nGrowX, SCROW nGrowY
 
     bool bRefChanged = false;
     ScToken* t;
-    ScRangeData* pShared = NULL;
 
     pCode->Reset();
     while( (t = static_cast<ScToken*>(pCode->GetNextReferenceOrName())) != NULL )
@@ -3336,27 +3313,6 @@ void ScFormulaCell::UpdateGrow( const ScRange& rArea, SCCOL nGrowX, SCROW nGrowY
         }
     }
 
-    if (pShared) // Exchange Shared Formula with real Formula
-    {
-        pDocument->RemoveFromFormulaTree( this ); // Update formula count
-        delete pCode;
-        pCode = new ScTokenArray( *pShared->GetCode() );
-        bRefChanged = true;
-        pCode->Reset();
-        while( (t = static_cast<ScToken*>(pCode->GetNextReference())) != NULL )
-        {
-            if( t->GetType() != svIndex )
-            {
-                SingleDoubleRefModifier aMod(*t);
-                ScComplexRefData& rRef = aMod.Ref();
-                ScRange aAbs = rRef.toAbs(aPos);
-                bool bMod = (ScRefUpdate::UpdateGrow(rArea, nGrowX, nGrowY, aAbs) != UR_NOTHING);
-                if (bMod)
-                    rRef.SetRange(aAbs, aPos);
-            }
-        }
-    }
-
     if (bRefChanged)
     {
         bCompile = true;
commit 0b85a6dd41e609c92688cee958867323b206f4e1
Author: Kohei Yoshida <kohei.yoshida at collabora.com>
Date:   Mon Mar 24 11:54:58 2014 -0400

    Turn this into a regular method.
    
    Change-Id: Idb4dc17971cd37a4cdf99b2c02e61fca14cb3ce2

diff --git a/chart2/source/controller/dialogs/tp_ChartType.cxx b/chart2/source/controller/dialogs/tp_ChartType.cxx
index 987f934..72694d5 100644
--- a/chart2/source/controller/dialogs/tp_ChartType.cxx
+++ b/chart2/source/controller/dialogs/tp_ChartType.cxx
@@ -829,6 +829,12 @@ IMPL_LINK_NOARG(ChartTypeTabPage, SelectSubTypeHdl)
 
 IMPL_LINK_NOARG(ChartTypeTabPage, SelectMainTypeHdl)
 {
+    selectMainType();
+    return 0;
+}
+
+void ChartTypeTabPage::selectMainType()
+{
     ChartTypeParameter aParameter( this->getCurrentParamter() );
 
     if( m_pCurrentMainType )
@@ -855,7 +861,6 @@ IMPL_LINK_NOARG(ChartTypeTabPage, SelectMainTypeHdl)
         uno::Reference< beans::XPropertySet > xTemplateProps( this->getCurrentTemplate(), uno::UNO_QUERY );
         m_pCurrentMainType->fillExtraControls(aParameter,m_xChartModel,xTemplateProps);
     }
-    return 0;
 }
 
 void ChartTypeTabPage::showAllControls( ChartTypeDialogController& rTypeController )
diff --git a/chart2/source/controller/dialogs/tp_ChartType.hxx b/chart2/source/controller/dialogs/tp_ChartType.hxx
index c796276..57520af 100644
--- a/chart2/source/controller/dialogs/tp_ChartType.hxx
+++ b/chart2/source/controller/dialogs/tp_ChartType.hxx
@@ -72,6 +72,7 @@ protected:
     virtual void stateChanged( ChangingResource* pResource );
 
     void commitToModel( const ChartTypeParameter& rParameter );
+    void selectMainType();
 
     DECL_LINK( SelectMainTypeHdl, void* );
     DECL_LINK( SelectSubTypeHdl, void* );
commit 12e86b01afdde5f9de0eba061746e6779f239161
Author: Kohei Yoshida <kohei.yoshida at collabora.com>
Date:   Mon Mar 24 11:37:37 2014 -0400

    Crash prevention by checking for NULL.
    
    Change-Id: I10a0c2dcee123b884c563c3e6f83e218747e792a

diff --git a/chart2/source/controller/chartapiwrapper/WrappedSplineProperties.cxx b/chart2/source/controller/chartapiwrapper/WrappedSplineProperties.cxx
index 498bd26..13a7560 100644
--- a/chart2/source/controller/chartapiwrapper/WrappedSplineProperties.cxx
+++ b/chart2/source/controller/chartapiwrapper/WrappedSplineProperties.cxx
@@ -63,7 +63,9 @@ public:
         {
             try
             {
-                ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > xChartTypePropertySet( aChartTypes[nN], ::com::sun::star::uno::UNO_QUERY );
+                uno::Reference<beans::XPropertySet> xChartTypePropertySet(aChartTypes[nN], uno::UNO_QUERY);
+                if (!xChartTypePropertySet.is())
+                    continue;
 
                 Any aSingleValue = this->convertInnerToOuterValue( xChartTypePropertySet->getPropertyValue(m_aOwnInnerName) );
                 PROPERTYTYPE aCurValue = PROPERTYTYPE();


More information about the Libreoffice-commits mailing list