[PATCH] remove dead code in calc core data

pjacquod pjacquod at alumni.ethz.ch
Sun Nov 21 03:06:01 PST 2010


and some comments translation
---
 sc/source/core/data/documen5.cxx |   23 +++++------------------
 sc/source/core/data/dptabsrc.cxx |   17 ++---------------
 2 files changed, 7 insertions(+), 33 deletions(-)

diff --git a/sc/source/core/data/documen5.cxx b/sc/source/core/data/documen5.cxx
index 8a2ea15..c9884b5 100644
--- a/sc/source/core/data/documen5.cxx
+++ b/sc/source/core/data/documen5.cxx
@@ -233,7 +233,7 @@ BOOL ScDocument::HasChartAtPoint( SCTAB nTab, const Point& rPos, String* pName )
 
     if (pName)
         pName->Erase();
-    return FALSE;					// nix gefunden
+    return FALSE;					// nothing found
 }
 
 void ScDocument::UpdateChartArea( const String& rChartName,
@@ -434,10 +434,7 @@ void ScDocument::UpdateChartArea( const String& rChartName,
 
                     pChartListenerCollection->ChangeListening( rChartName, aNewRanges );
 
-                    // ((SdrOle2Obj*)pObject)->GetNewReplacement();
-                    // pObject->ActionChanged();
-
-                    return;			// nicht weitersuchen
+                    return;			// do not search anymore
                 }
             }
             pObject = aIter.Next();
@@ -555,9 +552,6 @@ void ScDocument::UpdateChartRef( UpdateRefMode eUpdateRefMode,
         if ( bChanged )
         {
             {
-//				SetChartRangeList( pChartListener->GetString(), aNewRLR );
-//				pChartListener->ChangeListening( aNewRLR, bDataChanged );
-
                 // Force the chart to be loaded now, so it registers itself for UNO events.
                 // UNO broadcasts are done after UpdateChartRef, so the chart will get this
                 // reference change.
@@ -683,7 +677,7 @@ void ScDocument::UpdateChartListenerCollection()
     else
     {
         ScRange aRange;
-        // Range fuer Suche unwichtig
+        // Range for searching is not important
         ScChartListener aCLSearcher( EMPTY_STRING, this, aRange );
         for (SCTAB nTab=0; nTab<=MAXTAB; nTab++)
         {
@@ -732,20 +726,13 @@ void ScDocument::UpdateChartListenerCollection()
                                 // unable to set the data. So a chart from the
                                 // same document is treated like a chart with
                                 // own data for the time being.
-#if 0
+
                                 // data provider
-                                uno::Reference< chart2::data::XDataProvider > xDataProvider = new
-                                    ScChart2DataProvider( this );
-                                xReceiver->attachDataProvider( xDataProvider );
                                 // number formats supplier
-                                uno::Reference< util::XNumberFormatsSupplier > xNumberFormatsSupplier( pShell->GetModel(), uno::UNO_QUERY );
-                                xReceiver->attachNumberFormatsSupplier( xNumberFormatsSupplier );
+
                                 // data ?
                                 // how to set?? Defined in XML-file, which is already loaded!!!
                                 // => we have to do this stuff here, BEFORE the chart is actually loaded
-
-                                bIsChart = true;
-#endif
                             }
 
                             if (!bIsChart)
diff --git a/sc/source/core/data/dptabsrc.cxx b/sc/source/core/data/dptabsrc.cxx
index b0d7c71..b75dd43 100644
--- a/sc/source/core/data/dptabsrc.cxx
+++ b/sc/source/core/data/dptabsrc.cxx
@@ -301,7 +301,6 @@ void ScDPSource::SetOrientation(long nColumn, USHORT nNew)
         case sheet::DataPilotFieldOrientation_PAGE:
             nPageDims[nPageDimCount++] = nColumn;
             break;
-            // Wang Xu Ming -- 2009-9-1
             // DataPilot Migration - Cache&&Performance
         case sheet::DataPilotFieldOrientation_HIDDEN:
             break;
@@ -906,8 +905,8 @@ void ScDPSource::CreateRes_Impl()
                 aInitState.AddMember( nPageDims[i], GetMemberId( nPageDims[i],  pDim->GetSelectedData() ) );
         }
 
-        pColResRoot = new ScDPResultMember( pResData, /*NULL, NULL, NULL, */bColumnGrand );
-        pRowResRoot = new ScDPResultMember( pResData, /*NULL, NULL, NULL, */bRowGrand );
+        pColResRoot = new ScDPResultMember( pResData, bColumnGrand );
+        pRowResRoot = new ScDPResultMember( pResData, bRowGrand );
 
         FillCalcInfo(false, aInfo, bHasAutoShow);
         long nColLevelCount = aInfo.aColLevels.size();
@@ -1089,8 +1088,6 @@ void ScDPSource::FillMemberResults()
             for (long i=0; i<nColLevelCount; i++)
                 pColResults[i].realloc(nColDimSize);
 
-            // ScDPResultDimension* pColResDim = pColResRoot->GetChildDimension();
-            // pColResDim->FillMemberResults( pColResults, 0, pResData->GetColStartMeasure() );
             long nPos = 0;
             pColResRoot->FillMemberResults( pColResults, nPos, pResData->GetColStartMeasure(),
                                             TRUE, NULL, NULL );
@@ -1105,8 +1102,6 @@ void ScDPSource::FillMemberResults()
             for (long i=0; i<nRowLevelCount; i++)
                 pRowResults[i].realloc(nRowDimSize);
 
-            // ScDPResultDimension* pRowResDim = pRowResRoot->GetChildDimension();
-            // pRowResDim->FillMemberResults( pRowResults, 0, pResData->GetRowStartMeasure() );
             long nPos = 0;
             pRowResRoot->FillMemberResults( pRowResults, nPos, pResData->GetRowStartMeasure(),
                                             TRUE, NULL, NULL );
@@ -1466,7 +1461,6 @@ long ScDPDimension::getUsedHierarchy() const
 void ScDPDimension::setUsedHierarchy(long /* nNew */)
 {
     // #i52547# don't use the incomplete date hierarchy implementation - ignore the call
-    // nUsedHier = nNew;
 }
 
 ScDPDimension* ScDPDimension::CreateCloneObject()
@@ -1761,14 +1755,7 @@ ScDPHierarchies::ScDPHierarchies( ScDPSource* pSrc, long nD ) :
 {
     //!	hold pSource
 
-#if 0
     //	date columns have 3 hierarchies (flat/quarter/week), other columns only one
-    long nSrcDim = pSource->GetSourceDim( nDim );
-    if ( pSource->IsDateDimension( nSrcDim ) )
-        nHierCount = SC_DAPI_DATE_HIERARCHIES;
-    else
-        nHierCount = 1;
-#endif
 
     // #i52547# don't offer the incomplete date hierarchy implementation
     nHierCount = 1;
-- 
1.7.1


--------------070700000809000708090304--


More information about the LibreOffice mailing list