Date: prev next · Thread: first prev next last
2010 Archives by date, by thread · List index


Hello,
was just tired to try reading code like:
#if 0
        read a lot here
#else
        cool I will be compiled
#endif

So I started to track it down systematically. Just hope I was not to
much aggressive.

So I submit for review / proposal this first pack in little chunk. Will
be easier to reject some part...
regards

 ps : really boring to do this

#if 1
 ps2: never though there are so many places like this
#endif

From cfa7930b155c51906d2a5160f8a3412384b65892 Mon Sep 17 00:00:00 2001
From: pjacquod <pjacquod@alumni.ethz.ch>
Date: Sat, 20 Nov 2010 17:54:01 +0100
Subject: [PATCH 1/9] cleaning dead code in calc/scaddins

---
 scaddins/source/analysis/analysis.cxx       |   17 +---
 scaddins/source/analysis/analysisadd.idl    |    5 -
 scaddins/source/analysis/analysishelper.cxx |  153 +--------------------------
 scaddins/source/analysis/analysishelper.hxx |    3 -
 4 files changed, 3 insertions(+), 175 deletions(-)

diff --git a/scaddins/source/analysis/analysis.cxx b/scaddins/source/analysis/analysis.cxx
index ea1494c..5c146c8 100644
--- a/scaddins/source/analysis/analysis.cxx
+++ b/scaddins/source/analysis/analysis.cxx
@@ -234,9 +234,6 @@ AnalysisAddIn::~AnalysisAddIn()
     if( pCDL )
         delete pCDL;
 
-//     if( pResMgr )                   no delete, because _all_ resource managers are deleted 
_before_ this dtor is called
-//             delete pResMgr;
-
     if( pDefLocales )
         delete[] pDefLocales;
 }
@@ -420,7 +417,7 @@ STRING SAL_CALL AnalysisAddIn::getDisplayArgumentName( const STRING& aName, sal_
     if( p && nArg <= 0xFFFF )
     {
         sal_uInt16     nStr = p->GetStrIndex( sal_uInt16( nArg ) );
-        if( nStr /*&& nStr < 4*/ )
+        if( nStr )
             aRet = GetFuncDescrStr( p->GetDescrID(), nStr );
         else
             aRet = STRFROMANSI( "internal" );
@@ -438,7 +435,7 @@ STRING SAL_CALL AnalysisAddIn::getArgumentDescription( const STRING& aName, sal_
     if( p && nArg <= 0xFFFF )
     {
         sal_uInt16     nStr = p->GetStrIndex( sal_uInt16( nArg ) );
-        if( nStr /*&& nStr < 4*/ )
+        if( nStr )
             aRet = GetFuncDescrStr( p->GetDescrID(), nStr + 1 );
         else
             aRet = STRFROMANSI( "for internal use only" );
@@ -565,13 +562,6 @@ SEQofLocName SAL_CALL AnalysisAddIn::getCompatibilityNames( const STRING& 
aProgr
 
 // XAnalysis
 
-/*double SAL_CALL AnalysisAddIn::get_Test( constREFXPS&,
-    sal_Int32 nMode, double f1, double f2, double f3 ) THROWDEF_RTE
-{
-    return _Test( nMode, f1, f2, f3 );
-}*/
-
-
 /**
  * Workday
  */
@@ -793,7 +783,6 @@ double SAL_CALL AnalysisAddIn::getSeriessum( double fX, double fN, double fM, co
         sal_Int32              n1, n2;
         sal_Int32              nE1 = aCoeffList.getLength();
         sal_Int32              nE2;
-        //sal_Int32            nZ = 0;
 
         for( n1 = 0 ; n1 < nE1 ; n1++ )
         {
@@ -945,7 +934,6 @@ double SAL_CALL AnalysisAddIn::getBessely( double fNum, sal_Int32 nOrder ) THROW
     if( nOrder < 0 || fNum <= 0.0 )
         THROW_IAE;
 
-//     return yn( nOrder, fNum );
     double fRet = sca::analysis::BesselY( fNum, nOrder );
     RETURN_FINITE( fRet );
 }
@@ -1269,7 +1257,6 @@ STRING SAL_CALL AnalysisAddIn::getImsqrt( const STRING& aNum ) 
THROWDEF_RTE_IAE
 {
     Complex            z( aNum );
 
-//     z.Power( 0.5 );
     z.Sqrt();
 
     return z.GetString();
diff --git a/scaddins/source/analysis/analysisadd.idl b/scaddins/source/analysis/analysisadd.idl
index 32a94f7..2ebfd53 100644
--- a/scaddins/source/analysis/analysisadd.idl
+++ b/scaddins/source/analysis/analysisadd.idl
@@ -54,11 +54,6 @@ module addin
     */
     interface XAnalysis : com::sun::star::uno::XInterface
     {
-        /// _test.
-//      double get_Test(
-//                  [in] com::sun::star::beans::XPropertySet xOptions,
-//                  [in] long Mode, [in] double f1, [in] double f2, [in] double f3 );
-
         /// workday.
         long getWorkday(
                     [in] com::sun::star::beans::XPropertySet xOptions,
diff --git a/scaddins/source/analysis/analysishelper.cxx 
b/scaddins/source/analysis/analysishelper.cxx
index bf3c0f4..50075a9 100644
--- a/scaddins/source/analysis/analysishelper.cxx
+++ b/scaddins/source/analysis/analysishelper.cxx
@@ -51,8 +51,6 @@ using namespace                 ::com::sun::star;
 
 const FuncDataBase pFuncDatas[] =
 {
-    //                          UNIQUE or   INTPAR or
-    //         function name     DOUBLE      STDPAR     # of param  category
     FUNCDATA( Workday,          UNIQUE,     INTPAR,     3,          FDCat_DateTime ),
     FUNCDATA( Yearfrac,         UNIQUE,     INTPAR,     3,          FDCat_DateTime ),
     FUNCDATA( Edate,            UNIQUE,     INTPAR,     2,          FDCat_DateTime ),
@@ -282,7 +280,6 @@ sal_Int32 GetDiffDate360(
     {
         if( bUSAMethod && nDay1 != 30 )
         {
-            //aDate2 += 1;             -> 1.xx.yyyy
             nDay2 = 1;
             if( nMonth2 == 12 )
             {
@@ -433,7 +430,7 @@ sal_Int32 GetDiffDate( sal_Int32 nNullDate, sal_Int32 nStartDate, sal_Int32 nEnd
             DaysToDate( nEndDate, nD2, nM2, nY2 );
 
             sal_Bool           bLeap = IsLeapYear( nY1 );
-            sal_Int32          nDays, nMonths/*, nYears*/;
+            sal_Int32          nDays, nMonths;
 
             nMonths = nM2 - nM1;
             nDays = nD2 - nD1;
@@ -1013,71 +1010,6 @@ double GetOddfprice( sal_Int32 /*nNullDate*/, sal_Int32 /*nSettle*/, 
sal_Int32 /
     sal_Int32 /*nBase*/ ) THROWDEF_RTE_IAE
 {
     THROW_RTE;  // #87380#
-/*
-    double             fN = GetCoupnum( nNullDate, nSettle, nMat, nFreq, nBase ) - 1.0;
-    double             fNq = GetCoupnum( nNullDate, nSettle, nFirstCoup, nFreq, nBase ) - 1.0;
-    double             fDSC = GetCoupdaysnc( nNullDate, nSettle, nFirstCoup, nFreq, nBase );
-    double             fDSC_E = fDSC / GetCoupdays( nNullDate, nSettle, nMat, nFreq, nBase );
-    double             fNC = GetCoupnum( nNullDate, nIssue, nFirstCoup, nFreq, nBase );
-    sal_uInt32 nNC = sal_uInt32( fNC );
-    sal_uInt16 nMonthDelta = 12 / sal_uInt16( nFreq );
-
-    sal_uInt32 i;
-    double             f1YieldFreq = 1.0 + fYield / double( nFreq );
-    double             f100RateFreq = 100.0 * fRate / double( nFreq );
-
-    double*            pDC = new double[ nNC + 1 ];
-    double*            pNL = new double[ nNC + 1 ];
-    double*            pA = new double[ nNC + 1 ];
-
-    pDC[ 0 ] = pNL[ 0 ] = pA[ 0 ] = 1.0;
-
-    ScaDate aStartDate( nNullDate, nSettle, nBase );
-    ScaDate aNextCoup( nNullDate, nFirstCoup, nBase );
-    if( nNC )
-    {
-        pDC[ 1 ] = ScaDate::GetDiff( aStartDate, aNextCoup );
-        pNL[ 1 ] = GetCoupdays( nNullDate, nSettle, nFirstCoup, nFreq, nBase );
-        pA[ 1 ] = pDC[ 1 ];
-        ScaDate aPre;
-        for( i = 1 ; i <= nNC ; i++ )
-        {
-            aPre = aStartDate;
-            aStartDate.addMonths( nMonthDelta );
-            aNextCoup.addMonths( nMonthDelta );
-            pDC[ i ] = ScaDate::GetDiff( aPre, aStartDate );
-            pNL[ i ] = GetCoupdays( nNullDate, aStartDate.GetDate( nNullDate ), aNextCoup.GetDate( 
nNullDate ),
-                                        nFreq, nBase );
-            pA[ i ] = ScaDate::GetDiff( aStartDate, aNextCoup );
-        }
-    }
-
-    double             fT1 = fRedemp / pow( f1YieldFreq, fN + fNq + fDSC_E );
-
-    double             fT2 = 0.0;
-    for( i = 1 ; i <= nNC ; i++ )
-        fT2 += pDC[ i ] / pNL[ i ];
-    fT2 *= f100RateFreq / pow( f1YieldFreq, fNq + fDSC_E );
-
-    double             fT3 = 0.0;
-    for( double k = 2.0 ; k <= fN ; k++ )
-        fT3 += 1.0 / pow( f1YieldFreq, k - fNq + fDSC_E );
-    fT3 *= f100RateFreq;
-
-    double             fT4 = 0.0;
-    for( i = 1 ; i <= nNC ; i++ )
-        fT4 += pA[ i ] / pNL[ i ];
-    fT4 *= f100RateFreq;
-
-    if( nNC )
-    {
-        delete pDC;
-        delete pNL;
-        delete pA;
-    }
-
-    return fT1 + fT2 + fT3 - fT4;
-*/
 }
 
 
@@ -1161,56 +1093,6 @@ double GetOddfyield( sal_Int32 /*nNullDate*/, sal_Int32 /*nSettle*/, 
sal_Int32 /
     sal_Int32 /*nBase*/ ) THROWDEF_RTE_IAE
 {
     THROW_RTE;  // #87380#
-/*
-    //GetOddfprice( sal_Int32 nNullDate, sal_Int32 nSettle, sal_Int32 nMat, sal_Int32 nIssue,
-    //sal_Int32 nFirstCoup, double fRate, double fYield, double fRedemp, sal_Int32 nFreq,
-    //sal_Int32 nBase )
-    double             fPriceN = 0.0;
-    double             fYield1 = 0.0;
-    double             fYield2 = 1.0;
-    double             fPrice1 = GetOddfprice( nNullDate, nSettle, nMat, nIssue, nFirstCoup, 
fRate, fYield1, fRedemp, nFreq, nBase );
-    double             fPrice2 = GetOddfprice( nNullDate, nSettle, nMat, nIssue, nFirstCoup, 
fRate, fYield2, fRedemp, nFreq, nBase );
-    double             fYieldN = ( fYield2 - fYield1 ) * 0.5;
-
-    for( sal_uInt32 nIter = 0 ; nIter < 100 && fPriceN != fPrice ; nIter++ )
-    {
-        fPriceN = GetOddfprice( nNullDate, nSettle, nMat, nIssue, nFirstCoup, fRate, fYieldN, 
fRedemp, nFreq, nBase );
-
-        if( fPrice == fPrice1 )
-            return fYield1;
-        else if( fPrice == fPrice2 )
-            return fYield2;
-        else if( fPrice == fPriceN )
-            return fYieldN;
-        else if( fPrice < fPrice2 )
-        {
-            fYield2 *= 2.0;
-            fPrice2 = GetOddfprice( nNullDate, nSettle, nMat, nIssue, nFirstCoup, fRate, fYield2, 
fRedemp, nFreq, nBase );
-
-            fYieldN = ( fYield2 - fYield1 ) * 0.5;
-        }
-        else
-        {
-            if( fPrice < fPriceN )
-            {
-                fYield1 = fYieldN;
-                fPrice1 = fPriceN;
-            }
-            else
-            {
-                fYield2 = fYieldN;
-                fPrice2 = fPriceN;
-            }
-
-            fYieldN = fYield2 - ( fYield2 - fYield1 ) * ( ( fPrice - fPrice2 ) / ( fPrice1 - 
fPrice2 ) );
-        }
-    }
-
-    if( fabs( fPrice - fPriceN ) > fPrice / 100.0 )
-        THROW_IAE;             // result not precise enough
-
-    return fYieldN;
-*/
 }
 
 
@@ -1283,23 +1165,6 @@ double GetZw( double fZins, double fZzr, double fRmz, double fBw, sal_Int32 
nF )
 }
 
 
-/*double TBillYield( constREFXPS& xOpt, sal_Int32 nSettle, sal_Int32 nMat, double fPrice ) 
THROWDEF_RTE_IAE
-{
-    sal_Int32  nDiff = GetDiffDate360( xOpt, nSettle, nMat, sal_True );
-
-    if( fPrice <= 0.0 || nSettle >= nMat || nDiff > 360 )
-        THROW_IAE;
-
-    double             fRet = 100.0;
-    fRet /= fPrice;
-    fRet--;
-    fRet *= double( nDiff );
-    fRet /= 360.0;
-
-    return fRet;
-}*/
-
-
 //-----------------------------------------------------------------------------
 // financial functions COUP***
 
@@ -1515,7 +1380,6 @@ FuncData::FuncData( const FuncDataBase& r, ResMgr& rResMgr ) :
     eCat( r.eCat )
 {
     AnalysisRscStrArrLoader    aArrLoader( RID_ANALYSIS_DEFFUNCTION_NAMES, nCompID, rResMgr );
-//     ResStringArray          aDefFuncNameArray( AnalysisResId( nCompID, rResMgr ) );
     const ResStringArray&      rArr = aArrLoader.GetStringArray();
 
     sal_uInt16                         nCount = sal::static_int_cast<sal_uInt16>( rArr.Count() );
@@ -2252,12 +2116,6 @@ sal_Int16 ConvertData::GetMatchingLevel( const STRING& rRef ) const
                             n = INV_MATCHLEV;
             }
 
-// We could weed some nonsense out, ODFF doesn't say so though.
-#if 0
-            if (n < 0 && Class() == CDC_Information)
-                n = INV_MATCHLEV;   // milli-bits doesn't make sense
-#endif
-
 //! <HACK> #100616# "cm3" is not 10^-2 m^3 but 10^-6 m^3 !!! ------------------
             if( n != INV_MATCHLEV )
             {
@@ -2356,8 +2214,6 @@ double ConvertDataLinear::Convert(
 {
     if( Class() != r.Class() )
         THROW_IAE;
-
-//     return ::rtl::math::round( r.ConvertFromBase( ConvertToBase( f, nLevFrom ), nLevTo ), 13 );
     return r.ConvertFromBase( ConvertToBase( f, nLevFrom ), nLevTo );
 }
 
@@ -2462,14 +2318,12 @@ ConvertDataList::ConvertDataList( void )
     // ENERGY: 1 Joule is...
     NEWDP( "J",     1.0000000000000000E00,  CDC_Energy ); // Joule
     NEWDP( "e",     1.0000000000000000E07,  CDC_Energy ); // Erg  -> 
http://www.chemie.fu-berlin.de/chemistry/general/si.html
-//  NEWD( "e",      9.99999519343231E06,    CDC_Energy ); // Erg
     NEWDP( "c",     2.3900624947346700E-01, CDC_Energy ); // Thermodynamical Calorie
     NEWDP( "cal",   2.3884619064201700E-01, CDC_Energy ); // Calorie
     NEWDP( "eV",    6.2414570000000000E18,  CDC_Energy ); // Electronvolt
     NEWDP( "ev",    6.2414570000000000E18,  CDC_Energy ); // Electronvolt also
     NEWD( "HPh",    3.7250611111111111E-07, CDC_Energy ); // Horsepower Hours
     NEWD( "hh",     3.7250611111111111E-07, CDC_Energy ); // Horsepower Hours also
-//  NEWD( "HPh",    3.72506430801000E-07,   CDC_Energy ); // Horsepower Hours
     NEWDP( "Wh",    2.7777777777777778E-04, CDC_Energy ); // Watt Hours
     NEWDP( "wh",    2.7777777777777778E-04, CDC_Energy ); // Watt Hours also
     NEWD( "flb",    2.37304222192651E01,    CDC_Energy ); // Foot Pound
@@ -2482,7 +2336,6 @@ ConvertDataList::ConvertDataList( void )
     NEWD( "HP",     1.341022E-03,           CDC_Power ); // Horsepower
     NEWD( "h",      1.341022E-03,           CDC_Power ); // Horsepower also
     NEWD( "PS",     1.359622E-03,           CDC_Power ); // *** German Pferdestaerke
-//  NEWD( "HP",     1.4102006031908E-03,    CDC_Power ); // Excel seams to be a little bit 
wrong... either this doesn't fit to J -> HPh
 
     // MAGNETISM: 1 Tesla is...
     NEWDP( "T",     1.0000000000000000E00,  CDC_Magnetism ); // Tesla
@@ -2580,10 +2433,6 @@ ConvertDataList::~ConvertDataList()
 
 double ConvertDataList::Convert( double fVal, const STRING& rFrom, const STRING& rTo ) 
THROWDEF_RTE_IAE
 {
-// This will not catch illegal units
-//   if( rFrom == rTo )
-//       return fVal;
-
     ConvertData*       pFrom = NULL;
     ConvertData*       pTo = NULL;
     sal_Bool           bSearchFrom = sal_True;
diff --git a/scaddins/source/analysis/analysishelper.hxx 
b/scaddins/source/analysis/analysishelper.hxx
index 6ecb9eb..139f3d8 100644
--- a/scaddins/source/analysis/analysishelper.hxx
+++ b/scaddins/source/analysis/analysishelper.hxx
@@ -53,12 +53,10 @@ class ScaAnyConverter;
 
 #define        PI                      3.1415926535897932
 #define PI_2           (PI/2.0)
-//#define      EULER           2.7182818284590452
 #define        EOL                     ( ( const sal_Char* ) 1 )
 #define        EOE                     ( ( const sal_Char* ) 2 )
 
 
-//double                               _Test( sal_Int32 nMode, double f1, double f2, double f3 );
 inline sal_Bool     IsLeapYear( sal_uInt16 nYear );
 sal_uInt16                     DaysInMonth( sal_uInt16 nMonth, sal_uInt16 nYear );
 sal_Int32                      DateToDays( sal_uInt16 nDay, sal_uInt16 nMonth, sal_uInt16 nYear );
@@ -125,7 +123,6 @@ double                              GetOddlyield( sal_Int32 nNullDate, 
sal_Int32 nSettle, sal_Int32 nMat,
                                 double fRate, double fPrice, double fRedemp, sal_Int32 nFreq, 
sal_Int32 nBase ) THROWDEF_RTE_IAE;
 double                         GetRmz( double fZins, double fZzr, double fBw, double fZw, 
sal_Int32 nF );
 double                         GetZw( double fZins, double fZzr, double fRmz, double fBw, 
sal_Int32 nF );
-//double                               TBillYield( constREFXPS& xOpt, sal_Int32 nSettle, sal_Int32 
nMat, double fPrice )THROWDEF_RTE_IAE;
 
 double                         GetCouppcd( sal_Int32 nNullDate, sal_Int32 nSettle, sal_Int32 nMat, 
sal_Int32 nFreq,
                                 sal_Int32 nBase ) THROWDEF_RTE_IAE;
-- 
1.7.1

From 273aa296ba07b9ec2d3b64eab0adc2d2f990693d Mon Sep 17 00:00:00 2001
From: pjacquod <pjacquod@alumni.ethz.ch>
Date: Sat, 20 Nov 2010 18:05:05 +0100
Subject: [PATCH 2/9] remove dead code in calc/sc/inc

---
 sc/inc/global.hxx |   21 +--------------------
 1 files changed, 1 insertions(+), 20 deletions(-)

diff --git a/sc/inc/global.hxx b/sc/inc/global.hxx
index ee3eb79..0273d30 100644
--- a/sc/inc/global.hxx
+++ b/sc/inc/global.hxx
@@ -58,31 +58,12 @@ extern "C" {
 
 #endif
 
-#if 0
-// I18N doesn't get this right, can't specify more than one to ignore
-#define SC_COLLATOR_IGNORES ( \
-    ::com::sun::star::i18n::CollatorOptions::CollatorOptions_IGNORE_CASE | \
-    ::com::sun::star::i18n::CollatorOptions::CollatorOptions_IGNORE_KANA | \
-    ::com::sun::star::i18n::CollatorOptions::CollatorOptions_IGNORE_WIDTH )
-#else
 #define SC_COLLATOR_IGNORES ( \
     ::com::sun::star::i18n::CollatorOptions::CollatorOptions_IGNORE_CASE )
-#endif
-#if 0
-// #107998# Don't ignore Width and Kana. The issue was mainly with AutoInput,
-// but affects also comparison of names in general.
-#define SC_TRANSLITERATION_IGNORECASE ( \
-    ::com::sun::star::i18n::TransliterationModules_IGNORE_CASE | \
-    ::com::sun::star::i18n::TransliterationModules_IGNORE_KANA | \
-    ::com::sun::star::i18n::TransliterationModules_IGNORE_WIDTH )
-#define SC_TRANSLITERATION_CASESENSE ( \
-    ::com::sun::star::i18n::TransliterationModules_IGNORE_KANA | \
-    ::com::sun::star::i18n::TransliterationModules_IGNORE_WIDTH )
-#else
+
 #define SC_TRANSLITERATION_IGNORECASE ( \
     ::com::sun::star::i18n::TransliterationModules_IGNORE_CASE )
 #define SC_TRANSLITERATION_CASESENSE 0
-#endif
 
 //------------------------------------------------------------------------
 
-- 
1.7.1

From dc389a658445774163e653a7f9382f6ee39b30f6 Mon Sep 17 00:00:00 2001
From: pjacquod <pjacquod@alumni.ethz.ch>
Date: Sat, 20 Nov 2010 18:19:44 +0100
Subject: [PATCH 3/9] clean dead code in sc fileter excel

---
 sc/source/filter/excel/read.cxx     |    8 --------
 sc/source/filter/excel/xeescher.cxx |   19 -------------------
 sc/source/filter/excel/xestream.cxx |   13 +------------
 3 files changed, 1 insertions(+), 39 deletions(-)

diff --git a/sc/source/filter/excel/read.cxx b/sc/source/filter/excel/read.cxx
index e2737ec..3ca0bd5 100644
--- a/sc/source/filter/excel/read.cxx
+++ b/sc/source/filter/excel/read.cxx
@@ -865,7 +865,6 @@ FltError ImportExcel8::Read( void )
                     eAkt = EXC_STATE_SHEET;
                     aIn.SeekGlobalPosition();
                     continue;   // next iteration in while loop
-//                break;    // unxsols warning: statement unreachable
                 case EXC_STATE_SHEET:
                     Eof();
                     eAkt = EXC_STATE_END;
@@ -1276,13 +1275,6 @@ FltError ImportExcel8::Read( void )
             GetPivotTableManager().ConvertPivotTables();
 
         pProgress.reset();
-#if 0
-        // Excel documents look much better without this call; better in the
-        // sense that the row heights are identical to the original heights in
-        // Excel.
-        if (pD->IsAdjustHeightEnabled())
-            AdjustRowHeight();
-#endif
         PostDocLoad();
 
         pD->CalcAfterLoad();
diff --git a/sc/source/filter/excel/xeescher.cxx b/sc/source/filter/excel/xeescher.cxx
index efebe80..acf24d2 100644
--- a/sc/source/filter/excel/xeescher.cxx
+++ b/sc/source/filter/excel/xeescher.cxx
@@ -1119,7 +1119,6 @@ void XclExpChartObj::SaveXml( XclExpXmlStream& rStrm )
         nChartCount++;
         aChartExport.WriteChartObj( mxShape, nChartCount );
         // TODO: get the correcto chart number
-        //WriteChartObj( pDrawing, rStrm );
     }
 
     pDrawing->singleElement( FSNS( XML_xdr, XML_clientData),
@@ -1155,9 +1154,7 @@ void XclExpChartObj::WriteChartObj( sax_fastparser::FSHelperPtr pDrawing, 
XclExp
     pDrawing->endElement( FSNS( XML_xdr, XML_nvGraphicFramePr ) );
 
     // visual chart properties
-    //pDrawing->startElement( FSNS( XML_xdr, XML_xfrm ), FSEND );
     WriteShapeTransformation( pDrawing, mxShape );
-    //pDrawing->endElement( FSNS( XML_xdr, XML_xfrm ) );
 
     // writer chart object
     pDrawing->startElement( FSNS( XML_a, XML_graphic ), FSEND );
@@ -1260,13 +1257,6 @@ XclExpNote::XclExpNote( const XclExpRoot& rRoot, const ScAddress& rScPos,
                     // AutoFill style would change if Postit.cxx object creation values are changed
                     OUString aCol(((XFillColorItem &)GETITEM(aItemSet, XFillColorItem , 
XATTR_FILLCOLOR)).GetValue());
                     mbAutoFill  = !aCol.getLength() && (GETITEMVALUE(aItemSet, XFillStyleItem, 
XATTR_FILLSTYLE, ULONG) == XFILL_SOLID);
-#if 0
-                    // TODO: Get AutoLine bool
-                    aCol = OUString(((XLineStartItem &)GETITEM(aItemSet, XLineStartItem, 
XATTR_LINESTART)).GetValue());
-                    mbAutoLine = !aCol.getLength() &&
-                                 (GETITEMVALUE(aItemSet, XLineStartWidthItem, 
XATTR_LINESTARTWIDTH, ULONG) == 200) &&
-                                 (GETITEMBOOL(aItemSet, XATTR_LINESTARTCENTER) == FALSE);
-#endif
                     mbAutoLine  = true;
                     mbRowHidden = (rRoot.GetDoc().RowHidden(maScPos.Row(),maScPos.Tab()));
                     mbColHidden = (rRoot.GetDoc().ColHidden(maScPos.Col(),maScPos.Tab()));
@@ -1350,18 +1340,11 @@ void XclExpNote::WriteXml( sal_Int32 nAuthorId, XclExpXmlStream& rStrm )
     rComments->startElement( XML_comment,
             XML_ref,        XclXmlUtils::ToOString( maScPos ).getStr(),
             XML_authorId,   OString::valueOf( nAuthorId ).getStr(),
-            // OOXTODO: XML_guid,
             FSEND );
     rComments->startElement( XML_text, FSEND );
     // OOXTODO: phoneticPr, rPh, r
-#if 0
-    rComments->startElement( XML_t, FSEND );
-    rComments->writeEscaped( XclXmlUtils::ToOUString( maOrigNoteText ) );
-    rComments->endElement ( XML_t );
-#else
     if( mpNoteContents )
         mpNoteContents->WriteXml( rStrm );
-#endif
     rComments->endElement( XML_text );
 
 /*
@@ -1374,9 +1357,7 @@ void XclExpNote::WriteXml( sal_Int32 nAuthorId, XclExpXmlStream& rStrm )
         rComments->startElement( XML_commentPr,
                 XML_autoFill,       XclXmlUtils::ToPsz( mbAutoFill ),
                 XML_autoScale,      XclXmlUtils::ToPsz( mbAutoScale ),
-                // XML_autoLine,       XclXmlUtils::ToPsz( mbAutoLine ),
                 XML_colHidden,      XclXmlUtils::ToPsz( mbColHidden ),
-                // XML_defaultSize,    "true",
                 XML_locked,         XclXmlUtils::ToPsz( mbLocked ),
                 XML_rowHidden,      XclXmlUtils::ToPsz( mbRowHidden ),
                 XML_textHAlign,     ToHorizAlign( meTHA ),
diff --git a/sc/source/filter/excel/xestream.cxx b/sc/source/filter/excel/xestream.cxx
index b6d5051..92c8133 100644
--- a/sc/source/filter/excel/xestream.cxx
+++ b/sc/source/filter/excel/xestream.cxx
@@ -1110,18 +1110,7 @@ bool XclExpXmlStream::exportDocument() throw()
     mpRoot = &aRoot;
     aRoot.GetOldRoot().pER = &aRoot;
     aRoot.GetOldRoot().eDateiTyp = Biff8;
-#if 0 // FIXME: Re-write this block without using SotStorage.
-    if ( SvtFilterOptions* pOptions = SvtFilterOptions::Get() )
-        if ( pShell && pOptions->IsLoadExcelBasicStorage() )
-            if ( sal_uInt32 nError
-                 = SvxImportMSVBasic( *pShell, *rStorage,
-                                      pOptions->IsLoadExcelBasicCode(),
-                                      pOptions->IsLoadExcelBasicStorage() )
-                .SaveOrDelMSVBAStorage( true, EXC_STORAGE_VBA_PROJECT) )
-            {
-                pShell->SetError( nError, ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( 
OSL_LOG_PREFIX ) ) );
-            }
-#endif
+
     // Get the viewsettings before processing
     if( pShell->GetViewData() )
         pShell->GetViewData()->WriteExtOptions( mpRoot->GetExtDocOptions() );
-- 
1.7.1

From 1fbe6d775c12412a5c38ac9197ce11613b394d9c Mon Sep 17 00:00:00 2001
From: pjacquod <pjacquod@alumni.ethz.ch>
Date: Sat, 20 Nov 2010 21:25:42 +0100
Subject: [PATCH 4/9] removing dead code in calc docshell

---
 sc/source/ui/docshell/docfunc.cxx        |    7 -----
 sc/source/ui/docshell/docsh2.cxx         |   33 ------------------------
 sc/source/ui/docshell/docsh4.cxx         |   24 ------------------
 sc/source/ui/docshell/externalrefmgr.cxx |   40 ------------------------------
 sc/source/ui/docshell/tablink.cxx        |    4 ---
 5 files changed, 0 insertions(+), 108 deletions(-)

diff --git a/sc/source/ui/docshell/docfunc.cxx b/sc/source/ui/docshell/docfunc.cxx
index dd450e4..555a4da 100644
--- a/sc/source/ui/docshell/docfunc.cxx
+++ b/sc/source/ui/docshell/docfunc.cxx
@@ -3745,13 +3745,6 @@ BOOL ScDocFunc::AutoFormat( const ScRange& rRange, const ScMarkData* 
pTabMark,
 
         if (bSize)
         {
-/*                     SCCOL nCols[2];
-            nCols[0] = nStartCol;
-            nCols[1] = nEndCol;
-            SCROW nRows[2];
-            nRows[0] = nStartRow;
-            nRows[1] = nEndRow;
-*/
             SCCOLROW nCols[2] = { nStartCol, nEndCol };
             SCCOLROW nRows[2] = { nStartRow, nEndRow };
 
diff --git a/sc/source/ui/docshell/docsh2.cxx b/sc/source/ui/docshell/docsh2.cxx
index 8686cc7..03ed2e6 100644
--- a/sc/source/ui/docshell/docsh2.cxx
+++ b/sc/source/ui/docshell/docsh2.cxx
@@ -57,11 +57,6 @@
 #include <sfx2/app.hxx>
 
 // INCLUDE ---------------------------------------------------------------
-/*
-#include <svdrwetc.hxx>
-#include <svdrwobx.hxx>
-#include <sostor.hxx>
-*/
 #include "drwlayer.hxx"
 #include "stlpool.hxx"
 #include "docsh.hxx"
@@ -103,27 +98,6 @@ BOOL __EXPORT ScDocShell::InitNew( const uno::Reference < embed::XStorage >& xSt
 
     InitItems();
     CalcOutputFactor();
-#if 0
-    uno::Any aGlobs;
-        uno::Sequence< uno::Any > aArgs(1);
-        aArgs[ 0 ] <<= GetModel();
-    aGlobs <<= ::comphelper::getProcessServiceFactory()->createInstanceWithArguments( 
rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ooo.vba.excel.Globals" ) ), aArgs );
-    GetBasicManager()->SetGlobalUNOConstant( "VBAGlobals", aGlobs );
-        // Fake ThisComponent being setup by Activate ( which is a view 
-        // related thing ), 
-        //  a) if another document is opened then in theory  ThisComponent
-        //     will be reset as before, 
-        //  b) when this document is  'really' Activated then ThisComponent
-        //     again will be set as before
-        // The only wrinkle seems if this document is loaded 'InVisible'
-        // but.. I don't see that this is possible from the vba API 
-        // I could be wrong though
-        // There may be implications setting the current component
-        // too early :-/ so I will just manually set the Basic Variables
-        BasicManager* pAppMgr = SFX_APP()->GetBasicManager();
-        if ( pAppMgr )
-            pAppMgr->SetGlobalUNOConstant( "ThisExcelDoc", aArgs[ 0 ] );
-#endif
 
     return bRet;
 }
@@ -147,13 +121,8 @@ void ScDocShell::InitItems()
 {
     // AllItemSet fuer Controller mit benoetigten Items fuellen:
 
-    // if ( pImpl->pFontList )
-    //  delete pImpl->pFontList;
-
     // Druck-Optionen werden beim Drucken und evtl. in GetPrinter gesetzt
 
-    // pImpl->pFontList = new FontList( GetPrinter(), Application::GetDefaultDevice() );
-    //PutItem( SvxFontListItem( pImpl->pFontList, SID_ATTR_CHAR_FONTLIST ) );
     UpdateFontList();
 
     ScDrawLayer* pDrawLayer = aDocument.GetDrawLayer();
@@ -170,7 +139,6 @@ void ScDocShell::InitItems()
 
         pDrawLayer->SetNotifyUndoActionHdl( LINK( pDocFunc, ScDocFunc, NotifyDrawUndo ) );
 
-        //if (SfxObjectShell::HasSbxObject())
         pDrawLayer->UpdateBasic();                     // DocShell-Basic in DrawPages setzen
     }
     else
@@ -200,7 +168,6 @@ void ScDocShell::InitItems()
                     i18n::ForbiddenCharacters aForbidden;
                     aAsian.GetStartEndChars( pLocales[i], aForbidden.beginLine, aForbidden.endLine 
);
                     LanguageType eLang = SvxLocaleToLanguage(pLocales[i]);
-                    //pDoc->SetForbiddenCharacters( eLang, aForbidden );
 
                     xForbiddenTable->SetForbiddenCharacters( eLang, aForbidden );
                 }
diff --git a/sc/source/ui/docshell/docsh4.cxx b/sc/source/ui/docshell/docsh4.cxx
index f2bbb52..0814c05 100644
--- a/sc/source/ui/docshell/docsh4.cxx
+++ b/sc/source/ui/docshell/docsh4.cxx
@@ -309,7 +309,6 @@ void ScDocShell::Execute( SfxRequest& rReq )
             if (pReqArgs)
             {
                 ScDocument* pDoc = GetDocument();
-//                BOOL bUndo (pDoc->IsUndoEnabled());
                 const  SfxPoolItem* pItem;
                 String aChartName, aRangeName;
 
@@ -459,7 +458,6 @@ void ScDocShell::Execute( SfxRequest& rReq )
                 if (pBindings)
                 {
                     pBindings->Invalidate( FID_AUTO_CALC );
-//                                     pBindings->Invalidate( FID_RECALC );            // jetzt 
immer enabled
                 }
                 rReq.AppendItem( SfxBoolItem( FID_AUTO_CALC, bNewVal ) );
                 rReq.Done();
@@ -2127,22 +2125,6 @@ void ScDocShell::Print( SfxProgress& rProgress, PrintDialog* pPrintDialog,
                     delete pDrawView;
                 }
             }
-
-#if 0
-            if ( n+1 < nCollateCopies &&
-                 (pPrinter->GetDuplexMode() == DUPLEX_SHORTEDGE || pPrinter->GetDuplexMode() == 
DUPLEX_LONGEDGE) &&
-                 ( nPrinted % 2 ) == 1 )
-            {
-                // #105584# when several collated copies are printed in duplex mode, and there is
-                // an odd number of pages, print an empty page between copies, so the first page of
-                // the second copy isn't printed on the back of the last page of the first copy.
-                // (same as in Writer ViewShell::Prt)
-                
-                // FIXME: needs to be adapted to XRenderable interface
-                pPrinter->StartPage();
-                pPrinter->EndPage();
-            }
-#endif
         }
     }
 
@@ -2223,10 +2205,6 @@ void ScDocShell::GetState( SfxItemSet &rSet )
             // Wenn eine Formel editiert wird, muss FID_RECALC auf jeden Fall enabled sein.
             // Recalc fuer das Doc war mal wegen #29898# disabled, wenn AutoCalc an war,
             // ist jetzt wegen #41540# aber auch immer enabled.
-//                     case FID_RECALC:
-//                             if ( aDocument.GetAutoCalc() )
-//                                     rSet.DisableItem( nWhich );
-//                             break;
 
             case SID_TABLES_COUNT:
                 rSet.Put( SfxInt16Item( nWhich, aDocument.GetTableCount() ) );
@@ -2276,7 +2254,6 @@ void ScDocShell::GetSbxState( SfxItemSet &rSet )
 
 void __EXPORT ScDocShell::Draw( OutputDevice* pDev, const JobSetup & /* rSetup */, USHORT nAspect )
 {
-//     bIsOle = TRUE;          // jetzt ueber den CreateMode
 
     SCTAB nVisTab = aDocument.GetVisibleTab();
     if (!aDocument.HasTable(nVisTab))
@@ -2319,7 +2296,6 @@ Rectangle __EXPORT ScDocShell::GetVisArea( USHORT nAspect ) const
 
     if( nAspect == ASPECT_THUMBNAIL )
     {
-//             Rectangle aArea( 0,0, 3175,3175 );                                                  
    //      120x120 Pixel in 1:1
         Rectangle aArea( 0,0, SC_PREVIEW_SIZE_X,SC_PREVIEW_SIZE_Y );
         BOOL bNegativePage = aDocument.IsNegativePage( aDocument.GetVisibleTab() );
         if ( bNegativePage )
diff --git a/sc/source/ui/docshell/externalrefmgr.cxx b/sc/source/ui/docshell/externalrefmgr.cxx
index e1a9f37..5ca9b32 100644
--- a/sc/source/ui/docshell/externalrefmgr.cxx
+++ b/sc/source/ui/docshell/externalrefmgr.cxx
@@ -587,41 +587,6 @@ ScExternalRefCache::TokenArrayRef ScExternalRefCache::getCellRangeData(
         ScMatrixRef xMat = new ScMatrix(
             static_cast<SCSIZE>(nDataCol2-nDataCol1+1), 
static_cast<SCSIZE>(nDataRow2-nDataRow1+1));
 
-#if 0
-        // TODO: Switch to this code block once we have support for sparsely-filled
-        // matrices in ScMatrix.
-
-        // Only fill non-empty cells, for better performance.
-        vector<SCROW> aRows;
-        pTab->getAllRows(aRows, nDataRow1, nDataRow2);
-        for (vector<SCROW>::const_iterator itr = aRows.begin(), itrEnd = aRows.end(); itr != 
itrEnd; ++itr)
-        {
-            SCROW nRow = *itr;
-            vector<SCCOL> aCols;
-            pTab->getAllCols(nRow, aCols, nDataCol1, nDataCol2);
-            for (vector<SCCOL>::const_iterator itrCol = aCols.begin(), itrColEnd = aCols.end(); 
itrCol != itrColEnd; ++itrCol)
-            {
-                SCCOL nCol = *itrCol;
-                TokenRef pToken = pTab->getCell(nCol, nRow);
-                if (!pToken)
-                    // This should never happen!
-                    return TokenArrayRef();
-
-                SCSIZE nC = nCol - nDataCol1, nR = nRow - nDataRow1;
-                switch (pToken->GetType())
-                {
-                    case svDouble:
-                        xMat->PutDouble(pToken->GetDouble(), nC, nR);
-                    break;
-                    case svString:
-                        xMat->PutString(pToken->GetString(), nC, nR);
-                    break;
-                    default:
-                        ;
-                }
-            }
-        }
-#else
         vector<SCROW> aRows;
         pTab->getAllRows(aRows, nDataRow1, nDataRow2);
         if (aRows.empty())
@@ -654,7 +619,6 @@ ScExternalRefCache::TokenArrayRef ScExternalRefCache::getCellRangeData(
                 }
             }
         }
-#endif
 
         if (!bFirstTab)
             pArray->AddOpCode(ocSep);
@@ -1323,20 +1287,17 @@ static FormulaToken* lcl_convertToToken(ScBaseCell* pCell)
             static_cast<ScEditCell*>(pCell)->GetString(aStr);
             return new formula::FormulaStringToken(aStr);
         }
-        //break;
         case CELLTYPE_STRING:
         {
             String aStr;
             static_cast<ScStringCell*>(pCell)->GetString(aStr);
             return new formula::FormulaStringToken(aStr);
         }
-        //break;
         case CELLTYPE_VALUE:
         {
             double fVal = static_cast<ScValueCell*>(pCell)->GetValue();
             return new formula::FormulaDoubleToken(fVal);
         }
-        //break;
         case CELLTYPE_FORMULA:
         {
             ScFormulaCell* pFCell = static_cast<ScFormulaCell*>(pCell);
@@ -1355,7 +1316,6 @@ static FormulaToken* lcl_convertToToken(ScBaseCell* pCell)
                 return new formula::FormulaStringToken(aStr);
             }
         }
-        //break;
         default:
             DBG_ERROR("attempted to convert an unknown cell type.");
     }
diff --git a/sc/source/ui/docshell/tablink.cxx b/sc/source/ui/docshell/tablink.cxx
index 65f3119..a656ee0 100644
--- a/sc/source/ui/docshell/tablink.cxx
+++ b/sc/source/ui/docshell/tablink.cxx
@@ -404,7 +404,6 @@ BOOL ScTableLink::Refresh(const String& rNewFile, const String& rNewFilter,
 
     // aufraeumen
 
-//     pSrcShell->DoClose();
     aRef->DoClose();
 
     // Undo
@@ -577,9 +576,6 @@ ScDocumentLoader::ScDocumentLoader( const String& rFileName,
 
 ScDocumentLoader::~ScDocumentLoader()
 {
-/*  if ( pDocShell )
-        pDocShell->DoClose();
-*/
     if ( aRef.Is() )
         aRef->DoClose();
     else if ( pMedium )
-- 
1.7.1

From 86a2ba6dd5d6bd6e3c272bb732152d54edad8bbd Mon Sep 17 00:00:00 2001
From: pjacquod <pjacquod@alumni.ethz.ch>
Date: Sat, 20 Nov 2010 22:01:44 +0100
Subject: [PATCH 5/9] dead code removed in calc ui pagedlg

---
 sc/source/ui/pagedlg/areasdlg.cxx |    4 -
 sc/source/ui/pagedlg/tphfedit.cxx |  126 -------------------------------------
 2 files changed, 0 insertions(+), 130 deletions(-)

diff --git a/sc/source/ui/pagedlg/areasdlg.cxx b/sc/source/ui/pagedlg/areasdlg.cxx
index 5ff14b2..0df17bc 100644
--- a/sc/source/ui/pagedlg/areasdlg.cxx
+++ b/sc/source/ui/pagedlg/areasdlg.cxx
@@ -211,9 +211,6 @@ void ScPrintAreasDlg::SetReference( const ScRange& rRef, ScDocument* /* pDoc */
         if ( &aEdPrintArea == pRefInputEdit )
         {
             rRef.Format( aStr, SCR_ABS, pDoc, eConv );
-
-//                     aEdPrintArea.ReplaceSelected( aStr );
-
             String aVal = aEdPrintArea.GetText();
             Selection aSel = aEdPrintArea.GetSelection();
             aSel.Justify();
@@ -473,7 +470,6 @@ void ScPrintAreasDlg::Impl_FillLists()
     {
         String                 aName;
         String                 aSymbol;
-//        ScRange         aRange;
         ScRangeData*   pData = NULL;
 
         for ( USHORT i=0; i<nCount; i++ )
diff --git a/sc/source/ui/pagedlg/tphfedit.cxx b/sc/source/ui/pagedlg/tphfedit.cxx
index e6ec741..8dbbd4c 100644
--- a/sc/source/ui/pagedlg/tphfedit.cxx
+++ b/sc/source/ui/pagedlg/tphfedit.cxx
@@ -336,19 +336,16 @@ void __EXPORT ScEditWindow::LoseFocus()
     case Left:
         {
             sName = String(ScResId(STR_ACC_LEFTAREA_NAME));
-//            sDescription = String(ScResId(STR_ACC_LEFTAREA_DESCR));
         }
         break;
     case Center:
         {
             sName = String(ScResId(STR_ACC_CENTERAREA_NAME));
-//            sDescription = String(ScResId(STR_ACC_CENTERAREA_DESCR));
         }
         break;
     case Right:
         {
             sName = String(ScResId(STR_ACC_RIGHTAREA_NAME));
-//            sDescription = String(ScResId(STR_ACC_RIGHTAREA_DESCR));
         }
         break;
     }
@@ -359,38 +356,6 @@ void __EXPORT ScEditWindow::LoseFocus()
     return pAcc;
 }
 
-/*
-class ScExtIButton : public ImageButton
-{
-private:
-
-    Timer                      aTimer;
-    ScPopupMenu*       pPopupMenu;
-
-    DECL_LINK( TimerHdl, Timer*);
-
-    void                       DrawArrow();
-
-protected:
-
-    virtual void       MouseButtonDown( const MouseEvent& rMEvt );
-    virtual void       MouseButtonUp( const MouseEvent& rMEvt);
-
-    virtual void       StartPopup();
-
-public:
-
-    ScExtIButton(Window* pParent, const ResId& rResId );
-
-    void                       SetPopupMenu(ScPopupMenu* pPopUp);
-
-    USHORT                     GetSelected();
-
-    void            SetMenuHdl( const Link& rLink ) { aFxLink = rLink; }
-    const Link&     GetMenuHdl() const { return aFxLink; }
-
-}
-*/
 ScExtIButton::ScExtIButton(Window* pParent, const ResId& rResId )
 :      ImageButton(pParent,rResId),
     pPopupMenu(NULL)
@@ -398,8 +363,6 @@ ScExtIButton::ScExtIButton(Window* pParent, const ResId& rResId )
     nSelected=0;
     aTimer.SetTimeout(600);
     SetDropDown( TRUE);
-
-//     DrawArrow();
 }
 
 void ScExtIButton::SetPopupMenu(ScPopupMenu* pPopUp)
@@ -474,94 +437,5 @@ IMPL_LINK( ScExtIButton, TimerHdl, Timer*, EMPTYARG )
     return 0;
 }
 
-/*
-static void ImplDrawToolArrow( ToolBox* pBox, long nX, long nY, BOOL bBlack,
-                               BOOL bLeft = FALSE, BOOL bTop = FALSE )
-{
-    Color                      aOldFillColor = pBox->GetFillColor();
-    WindowAlign        eAlign = pBox->meAlign;
-    if ( bLeft )
-        eAlign = WINDOWALIGN_RIGHT;
-    else if ( bTop )
-        eAlign = WINDOWALIGN_BOTTOM;
-
-    switch ( eAlign )
-    {
-        case WINDOWALIGN_LEFT:
-            if ( bBlack )
-                pBox->SetFillColor( Color( COL_BLACK ) );
-            pBox->DrawRect( Rectangle( nX+0, nY+0, nX+0, nY+6 ) );
-            pBox->DrawRect( Rectangle( nX+1, nY+1, nX+1, nY+5 ) );
-            pBox->DrawRect( Rectangle( nX+2, nY+2, nX+2, nY+4 ) );
-            pBox->DrawRect( Rectangle( nX+3, nY+3, nX+3, nY+3 ) );
-            if ( bBlack )
-            {
-                pBox->SetFillColor( aOldFillColor );
-                pBox->DrawRect( Rectangle( nX+1, nY+2, nX+1, nY+4 ) );
-                pBox->DrawRect( Rectangle( nX+2, nY+3, nX+2, nY+3 ) );
-            }
-            break;
-        case WINDOWALIGN_TOP:
-            if ( bBlack )
-                pBox->SetFillColor( Color( COL_BLACK ) );
-            pBox->DrawRect( Rectangle( nX+0, nY+0, nX+6, nY+0 ) );
-            pBox->DrawRect( Rectangle( nX+1, nY+1, nX+5, nY+1 ) );
-            pBox->DrawRect( Rectangle( nX+2, nY+2, nX+4, nY+2 ) );
-            pBox->DrawRect( Rectangle( nX+3, nY+3, nX+3, nY+3 ) );
-            if ( bBlack )
-            {
-                pBox->SetFillColor( aOldFillColor );
-                pBox->DrawRect( Rectangle( nX+2, nY+1, nX+4, nY+1 ) );
-                pBox->DrawRect( Rectangle( nX+3, nY+2, nX+3, nY+2 ) );
-            }
-            break;
-        case WINDOWALIGN_RIGHT:
-            if ( bBlack )
-                pBox->SetFillColor( Color( COL_BLACK ) );
-            pBox->DrawRect( Rectangle( nX+3, nY+0, nX+3, nY+6 ) );
-            pBox->DrawRect( Rectangle( nX+2, nY+1, nX+2, nY+5 ) );
-            pBox->DrawRect( Rectangle( nX+1, nY+2, nX+1, nY+4 ) );
-            pBox->DrawRect( Rectangle( nX+0, nY+3, nX+0, nY+3 ) );
-            if ( bBlack )
-            {
-                pBox->SetFillColor( aOldFillColor );
-                pBox->DrawRect( Rectangle( nX+2, nY+2, nX+2, nY+4 ) );
-                pBox->DrawRect( Rectangle( nX+1, nY+3, nX+1, nY+3 ) );
-            }
-            break;
-        case WINDOWALIGN_BOTTOM:
-            if ( bBlack )
-                pBox->SetFillColor( Color( COL_BLACK ) );
-            pBox->DrawRect( Rectangle( nX+0, nY+3, nX+6, nY+3 ) );
-            pBox->DrawRect( Rectangle( nX+1, nY+2, nX+5, nY+2 ) );
-            pBox->DrawRect( Rectangle( nX+2, nY+1, nX+4, nY+1 ) );
-            pBox->DrawRect( Rectangle( nX+3, nY+0, nX+3, nY+0 ) );
-            if ( bBlack )
-            {
-                pBox->SetFillColor( aOldFillColor );
-                pBox->DrawRect( Rectangle( nX+2, nY+2, nX+4, nY+2 ) );
-                pBox->DrawRect( Rectangle( nX+3, nY+1, nX+3, nY+1 ) );
-            }
-            break;
-    }
-}
-Down
-    - Timer starten
-
-Click
-    - Timer abbrechen
-
-Timer
-    if ( ??? )
-    {
-    - SetPressed( TRUE );
-    - EndSelection();
-    - Menu anzeigen
-    - SetPressed( FALSE );
-    }
-
-
-*/
-
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
-- 
1.7.1

From 77d807285ed66bc8d9fe0a9df655e10531e6322d Mon Sep 17 00:00:00 2001
From: pjacquod <pjacquod@alumni.ethz.ch>
Date: Sat, 20 Nov 2010 22:07:51 +0100
Subject: [PATCH 6/9] remove dead code in calc ui inc

---
 sc/source/ui/inc/viewdata.hxx |    6 ------
 1 files changed, 0 insertions(+), 6 deletions(-)

diff --git a/sc/source/ui/inc/viewdata.hxx b/sc/source/ui/inc/viewdata.hxx
index bd3893a..a461d79 100644
--- a/sc/source/ui/inc/viewdata.hxx
+++ b/sc/source/ui/inc/viewdata.hxx
@@ -79,12 +79,6 @@ enum ScMarkType
         SC_MARK_FILTERED,  // 3
     SC_MARK_MULTI           = 4     // Multiple selection marks.
     /* TODO: if filtered multi-selection was implemented, this would be the value to use. */
-#if 0
-        ,
-    SC_MARK_MULTI_FILTERED  =       // Multiple selection marks containing filtered rows.
-        SC_MARK_MULTI |
-        SC_MARK_FILTERED   // 6
-#endif
 };
 
 enum ScPasteFlags
-- 
1.7.1

From 43904074fd2b558534ff57b54416b7e8a47e10ea Mon Sep 17 00:00:00 2001
From: pjacquod <pjacquod@alumni.ethz.ch>
Date: Sat, 20 Nov 2010 22:31:33 +0100
Subject: [PATCH 7/9] cleaned dead code in calc ui view

---
 sc/source/ui/view/printfun.cxx |   41 ---------------------------
 sc/source/ui/view/viewdata.cxx |    8 ++--
 sc/source/ui/view/viewfun3.cxx |   61 +---------------------------------------
 3 files changed, 5 insertions(+), 105 deletions(-)

diff --git a/sc/source/ui/view/printfun.cxx b/sc/source/ui/view/printfun.cxx
index 0f08fe0..a173b4f 100644
--- a/sc/source/ui/view/printfun.cxx
+++ b/sc/source/ui/view/printfun.cxx
@@ -519,7 +519,6 @@ void ScPrintFunc::DrawToDev( ScDocument* pDoc, OutputDevice* pDev, double /* nPr
 
     Rectangle aLines;
     ScRange aRange( nX1,nY1,nTab, nX2,nY2,nTab );
-//    BOOL bAddLines = pDoc->HasLines( aRange, aLines );
 
     long nTwipsSizeX = 0;
     for (SCCOL i=nX1; i<=nX2; i++)
@@ -553,9 +552,6 @@ void ScPrintFunc::DrawToDev( ScDocument* pDoc, OutputDevice* pDev, double /* nPr
     if (bEmbed)
         pDoc->SetEmbedded(aERange);
 
-/*     if (!bMetaFile)
-        pDev->SetMapMode(MAP_PIXEL);
-*/
     long nScrX = aRect.Left();
     long nScrY = aRect.Top();
 
@@ -798,7 +794,6 @@ long ScPrintFunc::TextHeight( const EditTextObject* pObject )
     if (!pObject)
         return 0;
 
-//     pEditEngine->SetPageNo( nTotalPages );
     pEditEngine->SetTextNewDefaults( *pObject, *pEditDefaults, FALSE );
 
     return (long) pEditEngine->GetTextHeight();
@@ -1024,8 +1019,6 @@ void ScPrintFunc::InitParam( const ScPrintOptions* pOptions )
         //     Die Tabellen-Abfrage ist schon in DocShell::Print, hier immer
         aAreaParam.aPrintArea.aStart.SetTab(nPrintTab);
         aAreaParam.aPrintArea.aEnd.SetTab(nPrintTab);
-
-//             lcl_LimitRange( aAreaParam.aPrintArea, nPrintTab );                     // ganze 
Zeilen/Spalten...
     }
     else if ( pDoc->HasPrintRange() )
     {
@@ -1183,7 +1176,6 @@ void lcl_DrawGraphic( const SvxBrushItem &rBrush, OutputDevice *pOut, 
OutputDevi
     Size aDrawSize = aGrfSize;
 
     bool bDraw = TRUE;
-//     bool bRetouche = TRUE;
     switch ( ePos )
     {
         case GPOS_LT: aPos = rOrg.TopLeft();
@@ -1218,7 +1210,6 @@ void lcl_DrawGraphic( const SvxBrushItem &rBrush, OutputDevice *pOut, 
OutputDevi
         case GPOS_AREA:
                       aPos = rOrg.TopLeft();
                       aDrawSize = rOrg.GetSize();
-//                                       bRetouche = FALSE;
                       break;
         case GPOS_TILED:
                     {
@@ -1268,7 +1259,6 @@ void lcl_DrawGraphic( const SvxBrushItem &rBrush, OutputDevice *pOut, 
OutputDevi
                         }
 
                         bDraw = FALSE;
-//                                             bRetouche = FALSE;
                     }
                     break;
 
@@ -1335,7 +1325,6 @@ void ScPrintFunc::DrawBorder( long nScrX, long nScrY, long nScrW, long nScrH,
 
     if ( pBackground && !bCellContrast )
     {
-//             Rectangle aBackRect( Point(nScrX+nLeft, nScrY+nTop), Size(nEffWidth,nEffHeight) );
         if (pBackground->GetGraphicPos() != GPOS_NONE)
         {
             OutputDevice* pRefDev;
@@ -1424,8 +1413,6 @@ void ScPrintFunc::DrawBorder( long nScrX, long nScrY, long nScrW, long nScrH,
                                     nScrX+nLeft, nScrY+nTop, 0,0, 0,0, nScaleX, nScaleY );
         aOutputData.SetUseStyleColor( bUseStyleColor );
 
-//             pDev->SetMapMode(aTwipMode);
-
         if (pBorderData)
             aOutputData.DrawFrame();
 
@@ -1683,42 +1670,25 @@ void ScPrintFunc::PrintArea( SCCOL nX1, SCROW nY1, SCCOL nX2, SCROW nY2,
             aOutputData.SetRefDevice( pRefDev );
     }
 
-//     aOutputData.SetMetaFileMode(TRUE);
     if( aTableParam.bCellContent )
         aOutputData.DrawBackground();
 
     pDev->SetClipRegion( Rectangle( aPos, Size( aOutputData.GetScrW(), aOutputData.GetScrH() ) ) );
     pDev->SetClipRegion();
 
-//     aOutputData.SetMetaFileMode(FALSE);
     if( aTableParam.bCellContent )
     {
         aOutputData.DrawExtraShadow( bShLeft, bShTop, bShRight, bShBottom );
         aOutputData.DrawFrame();
         aOutputData.DrawStrings();
-
-    // pDev->SetMapMode(aLogicMode);
         aOutputData.DrawEdit(FALSE);
     }
 
-//     pDev->SetMapMode(aOffsetMode);
     if (aTableParam.bGrid)
         aOutputData.DrawGrid( TRUE, FALSE );   // keine Seitenumbrueche
 
-/*!!!!!!!!!!!          Notizen in Tabelle markieren ??????????????????????????
-
-    if (aTableParam.bNotes)
-    {
-        pDev->SetMapMode(aOffsetMode);
-        aOutputData.PrintNoteMarks(aNotePosList);
-        pDev->SetMapMode(aLogicMode);
-    }
-*/
-
     aOutputData.AddPDFNotes();      // has no effect if not rendering PDF with notes enabled
 
-//     pDev->SetMapMode(aDrawMode);
-
     // test if all paint parts are hidden, then a paint is not necessary at all
     if(!bHideAllDrawingLayer)
     {
@@ -1941,7 +1911,6 @@ long ScPrintFunc::DoNotes( long nNoteStart, BOOL bDoPrint, 
ScPreviewLocationData
     Font aMarkFont;
     ScAutoFontColorMode eColorMode = bUseStyleColor ? SC_AUTOCOL_DISPLAY : SC_AUTOCOL_PRINT;
     ((const ScPatternAttr&)pDoc->GetPool()->GetDefaultItem(ATTR_PATTERN)).GetFont( aMarkFont, 
eColorMode );
-//?    aMarkFont.SetWeight( WEIGHT_BOLD );
     pDev->SetFont( aMarkFont );
     long nMarkLen = pDev->GetTextWidth(
             String::CreateFromAscii(RTL_CONSTASCII_STRINGPARAM("GW99999:")));
@@ -2045,7 +2014,6 @@ long ScPrintFunc::PrintNotes( long nPageNo, long nNoteStart, BOOL bDoPrint, 
ScPr
     if ( pPrinter && bDoPrint )
     {
         DBG_ERROR( "StartPage does not exist anymore" );
-        // pPrinter->StartPage();
     }
 
     if ( bDoPrint || pLocationData )
@@ -2069,7 +2037,6 @@ long ScPrintFunc::PrintNotes( long nPageNo, long nNoteStart, BOOL bDoPrint, 
ScPr
     if ( pPrinter && bDoPrint )
     {
         DBG_ERROR( "EndPage does not exist anymore" );
-        // pPrinter->EndPage();
     }
 
     return nCount;
@@ -2135,7 +2102,6 @@ void ScPrintFunc::PrintPage( long nPageNo, SCCOL nX1, SCROW nY1, SCCOL nX2, 
SCRO
     if ( pPrinter && bDoPrint )
     {
         DBG_ERROR( "StartPage does not exist anymore" );
-        // pPrinter->StartPage();
     }
 
     // Kopf- und Fusszeilen (ohne Zentrierung)
@@ -2229,9 +2195,6 @@ void ScPrintFunc::PrintPage( long nPageNo, SCCOL nX1, SCROW nY1, SCCOL nX2, 
SCRO
 
     long nStartX = ((long) ( nLeftSpace * nScaleX ));
     long nStartY = ((long) ( nTopSpace  * nScaleY ));
-//             nStartX -= aOffset.X();                 // schon im MapMode
-//             nStartY -= aOffset.Y();
-
     long nInnerStartX = nStartX;
     long nInnerStartY = nStartY;
     if (pBorderItem)
@@ -2420,7 +2383,6 @@ void ScPrintFunc::PrintPage( long nPageNo, SCCOL nX1, SCROW nY1, SCCOL nX2, 
SCRO
     if ( pPrinter && bDoPrint )
     {
         DBG_ERROR( "EndPage does not exist anymore" );
-        // pPrinter->EndPage();
     }
 
     aLastSourceRange = ScRange( nX1, nY1, nPrintTab, nX2, nY2, nPrintTab );
@@ -2566,7 +2528,6 @@ long ScPrintFunc::CountPages()                                                
    // setzt auch nPagesX, nPagesY
     }
     else
     {
-//             nZoom = 100;                                            // nZoom auf letztem Wert 
stehenlassen !!!
         nPagesX = nPagesY = nTotalY = 0;
         return 0;
     }
@@ -2646,8 +2607,6 @@ void ScPrintFunc::InitModes()                             // aus nZoom etc. 
die MapModes setzen
     aOffset = Point( aSrcOffset.X()*100/nZoom, aSrcOffset.Y()*100/nZoom );
 
     long nEffZoom = nZoom * (long) nManualZoom;
-
-//     nScaleX = nScaleY = 1.0;                        // Ausgabe in Twips
     nScaleX = nScaleY = HMM_PER_TWIPS; // Ausgabe in 1/100 mm
 
     Fraction aZoomFract( nEffZoom,10000 );
diff --git a/sc/source/ui/view/viewdata.cxx b/sc/source/ui/view/viewdata.cxx
index 130184f..3d4d046 100644
--- a/sc/source/ui/view/viewdata.cxx
+++ b/sc/source/ui/view/viewdata.cxx
@@ -1082,7 +1082,7 @@ void ScViewData::SetEditEngine( ScSplitPos eWhich,
     if (!bWasThere)
         pNewEngine->InsertView(pEditView[eWhich]);
 
-    //         Hintergrundfarbe der Zelle
+    //         background color of the cell
     Color aBackCol = ((const SvxBrushItem&)pPattern->GetItem(ATTR_BACKGROUND)).GetColor();
 
     ScModule* pScMod = SC_MOD();
@@ -1092,8 +1092,8 @@ void ScViewData::SetEditEngine( ScSplitPos eWhich,
     }
     pEditView[eWhich]->SetBackgroundColor( aBackCol );
 
-    pEditView[eWhich]->Invalidate();                   //      noetig ??
-    // noetig, wenn Position geaendert
+    pEditView[eWhich]->Invalidate();                   //      needed ??
+    // needed, wenn position changed
 }
 
 IMPL_LINK_INLINE_START( ScViewData, EmptyEditHdl, EditStatus *, EMPTYARG )
@@ -1593,7 +1593,7 @@ Point ScViewData::GetScrPos( SCCOL nWhereX, SCROW nWhereY, ScSplitPos eWhich,
 }
 
 //
-//             Anzahl Zellen auf einem Bildschirm
+//             Number of cells on a screen
 //
 
 SCCOL ScViewData::CellsAtX( SCsCOL nPosX, SCsCOL nDir, ScHSplitPos eWhichX, USHORT nScrSizeX ) 
const
diff --git a/sc/source/ui/view/viewfun3.cxx b/sc/source/ui/view/viewfun3.cxx
index e374252..eb23c96 100644
--- a/sc/source/ui/view/viewfun3.cxx
+++ b/sc/source/ui/view/viewfun3.cxx
@@ -58,18 +58,12 @@
 #define _MODALDLG_HXX
 #define _MOREBUTTON_HXX
 #define _OUTLINER_HXX
-//#define _PRNDLG_HXX
-//#define _POLY_HXX
 #define _PVRWIN_HXX
-//#define _QUEUE_HXX
 #define _RULER_HXX
 #define _SCRWIN_HXX
 #define _SETBRW_HXX
-//#define _STACK_HXX
-//#define _STATUS_HXX ***
 #define _STDCTRL_HXX
 #define _STDMENU_HXX
-//#define _TAB_HXX
 #define _TABBAR_HXX
 #define _TREELIST_HXX
 #define _VALUESET_HXX
@@ -80,38 +74,23 @@
 #define _VCONT_HXX
 #define _VDRWOBJ_HXX
 
-//#define _SELENG_HXX
-//#define _SOUND_HXX
-//#define _SYSDLG_HXX
-
-
-
-
 #define _PASSWD_HXX
 
 #define _SFX_DOCFILE_HXX
-//#define _SFX_DOCFILT_HXX
 #define _SFX_DOCINF_HXX
 #define _SFX_DOCSH_HXX
-//#define _SFXDOCFILT_HXX
-//#define _SFXDOCINF_HXX
-//#define _SFXDOCSH_HXX
 #define _SFX_PRNMON_HXX
 #define _SFX_RESMGR_HXX
 #define _SFX_TEMPLDLG_HXX
-//#define _SFXAPPWIN_HXX
 #define _SFXBASIC_HXX
 #define _SFXCTRLITEM
 #define _SFXDLGCFG_HXX
-//#define _SFXDISPATCH_HXX
 #define _SFXFILEDLG_HXX
-//#define _SFXIMGMGR_HXX
 #define _SFXIPFRM_HXX
 #define _SFX_MACRO_HXX
 #define _SFXMNUITEM_HXX
 #define _SFXMNUMGR_HXX
 #define _SFXMULTISEL_HXX
-//#define _SFXMSG_HXX
 #define _SFXMSGDESCR_HXX
 #define _SFXMSGPOOL_HXX
 #define _SFX_MINFITEM_HXX
@@ -124,14 +103,6 @@
 #define _SFXTBXMGR_HXX
 
 #define _SI_HXX
-//#define _SI_DLL_HXX
-//#define _SIDLL_HXX
-//#define _SI_NOITEMS
-//#define _SI_NOOTHERFORMS
-//#define _SI_NOSBXCONTROLS
-//#define _SINOSBXCONTROLS
-//#define _SI_NODRW
-//#define _SI_NOCONTROL
 
 #define _SVBOXITM_HXX
 #define _SVCONTNR_HXX    //
@@ -140,7 +111,6 @@
 
 #define _SVDRAG_HXX
 #define _SVINCVW_HXX
-//#define _SV_MULTISEL_HXX
 #define _SVRTV_HXX
 #define _SVTABBX_HXX
 #define _SVTREEBOX_HXX
@@ -211,7 +181,7 @@
 #include "drwtrans.hxx"
 #include "docuno.hxx"
 #include "clipparam.hxx"
-#include "undodat.hxx"   // Amelia Wang
+#include "undodat.hxx"
 
 using namespace com::sun::star;
 
@@ -722,13 +692,8 @@ void ScViewFunc::PasteFromSystem()
                 PasteFromSystem( SOT_FORMATSTR_ID_EMBED_SOURCE_OLE );
             else if (aDataHelper.HasFormat( SOT_FORMATSTR_ID_LINK_SOURCE_OLE ))
                 PasteFromSystem( SOT_FORMATSTR_ID_LINK_SOURCE_OLE );
-//                     else
-//                             ErrorMessage(STR_PASTE_ERROR);
         }
-//             else
-//                     ErrorMessage(STR_PASTE_ERROR);
     }
-
     // keine Fehlermeldung, weil SID_PASTE in der idl das FastCall-Flag hat,
     // also auch gerufen wird, wenn nichts im Clipboard steht (#42531#)
 }
@@ -1107,18 +1072,6 @@ BOOL ScViewFunc::PasteFromClip( USHORT nFlags, ScDocument* pClipDoc,
         {
             nUnfilteredRows += p->aEnd.Row() - p->aStart.Row() + 1;
         }
-#if 0
-        /* This isn't needed but could be a desired restriction. */
-        // For filtered, destination rows have to be an exact multiple of
-        // source rows. Note that nDestSizeY is size-1 (difference), so
-        // nDestSizeY==0 fits always.
-        if ((nUnfilteredRows % (nDestSizeY+1)) != 0)
-        {
-            /* FIXME: this should be a more descriptive error message then. */
-            ErrorMessage(STR_MSSG_PASTEFROMCLIP_0);
-            return FALSE;
-        }
-#endif
     }
 
     SCCOL nMarkAddX = 0;
@@ -1253,12 +1206,6 @@ BOOL ScViewFunc::PasteFromClip( USHORT nFlags, ScDocument* pClipDoc,
     nUndoEndCol = sal::static_int_cast<SCCOL>( nUndoEndCol + nEndCol );
     nUndoEndRow = sal::static_int_cast<SCROW>( nUndoEndRow + nEndRow ); // destination area, 
expanded for merged cells
 
-//     if (nUndoEndCol < nEndCol) nUndoEndCol = nEndCol;
-//     if (nUndoEndRow < nEndRow) nUndoEndRow = nEndRow;
-
-//     nUndoEndCol += nMarkAddX;
-//     nUndoEndRow += nMarkAddY;
-
     if (nUndoEndCol>MAXCOL || nUndoEndRow>MAXROW)
     {
         ErrorMessage(STR_PASTE_FULL);
@@ -1279,9 +1226,6 @@ BOOL ScViewFunc::PasteFromClip( USHORT nFlags, ScDocument* pClipDoc,
         //! Test auf Ueberlappung
         //! nur wirkliche Schnittmenge testen !!!!!!!
 
-    // pDoc->HasCommonAttr( StartCol,nStartRow, nUndoEndCol,nUndoEndRow, nStartTab,
-    //                                                 pClipDoc, nClipStartX, nClipStartY );
-
     ScDocFunc& rDocFunc = pDocSh->GetDocFunc();
     if ( bRecord )
     {
@@ -1434,9 +1378,6 @@ BOOL ScViewFunc::PasteFromClip( USHORT nFlags, ScDocument* pClipDoc,
                                 TRUE, FALSE, bIncludeFiltered );
     }
 
-    //
-    //
-    //
 
     pDocSh->UpdatePaintExt( nExtFlags, nStartCol, nStartRow, nStartTab,
                                        nEndCol,   nEndRow,   nEndTab );                // content 
after the change
-- 
1.7.1

From 7169ed92a49da6124c24d05d00528d4b10f6e615 Mon Sep 17 00:00:00 2001
From: pjacquod <pjacquod@alumni.ethz.ch>
Date: Sat, 20 Nov 2010 22:39:30 +0100
Subject: [PATCH 8/9] remove dead code in calc ui vbremove dead code in calc ui vbaa

---
 sc/source/ui/vba/service.cxx       |   25 -------------------------
 sc/source/ui/vba/vbarange.cxx      |   17 +----------------
 sc/source/ui/vba/vbawsfunction.cxx |   19 -------------------
 3 files changed, 1 insertions(+), 60 deletions(-)

diff --git a/sc/source/ui/vba/service.cxx b/sc/source/ui/vba/service.cxx
index 036f0d3..05dc4ab 100644
--- a/sc/source/ui/vba/service.cxx
+++ b/sc/source/ui/vba/service.cxx
@@ -89,35 +89,10 @@ extern "C"
         lang::XMultiServiceFactory * pServiceManager, registry::XRegistryKey * pRegistryKey )
     {
         OSL_TRACE("In component_writeInfo");
-#if 0
-    // Component registration
-        if ( component_writeInfoHelper( pServiceManager, pRegistryKey,
-        range::serviceDecl, workbook::serviceDecl, worksheet::serviceDecl, globals::serviceDecl, 
window::serviceDecl, hyperlink::serviceDecl, application::serviceDecl ) && 
component_writeInfoHelper( pServiceManager, pRegistryKey, vbaeventshelper::serviceDecl ) )
-        {
-            // Singleton registration
-            try
-            {
-                registry::XRegistryKey * pKey =
-                    reinterpret_cast< registry::XRegistryKey * >(pRegistryKey);
 
-                Reference< registry::XRegistryKey >xKey = pKey->createKey(
-                    rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( 
("ooo.vba.Globals/UNO/SINGLETONS/ooo.vba.theGlobals") )) );
-                xKey->setStringValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
-                    ("ooo.vba.Globals") )) );
-                return sal_True;
-            }
-            catch( uno::Exception& /*e*/ )
-            {
-                //recomp & friends will detect false returned and fail
-            }
-        }
-        return sal_False;
-#else
     // Component registration
         return component_writeInfoHelper( pServiceManager, pRegistryKey,
         range::serviceDecl, workbook::serviceDecl, worksheet::serviceDecl, globals::serviceDecl, 
window::serviceDecl, hyperlink::serviceDecl, application::serviceDecl ) && 
component_writeInfoHelper( pServiceManager, pRegistryKey, vbaeventshelper::serviceDecl, 
textframe::serviceDecl );
-#endif
-
     }
 
     SAL_DLLPUBLIC_EXPORT void * SAL_CALL component_getFactory(
diff --git a/sc/source/ui/vba/vbarange.cxx b/sc/source/ui/vba/vbarange.cxx
index a47069b..da141c3 100644
--- a/sc/source/ui/vba/vbarange.cxx
+++ b/sc/source/ui/vba/vbarange.cxx
@@ -3071,7 +3071,7 @@ ScVbaRange::Replace( const ::rtl::OUString& What, const ::rtl::OUString& 
Replace
     }
 
     // sanity check required params
-    if ( !What.getLength() /*|| !Replacement.getLength()*/ )
+    if ( !What.getLength()  )
         throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Range::Replace, 
missing params" )) , uno::Reference< uno::XInterface >() );
     rtl::OUString sWhat = VBAToRegexp( What);
     // #TODO #FIXME SearchFormat & ReplacesFormat are not processed
@@ -3425,15 +3425,6 @@ ScVbaRange::Sort( const uno::Any& Key1, const uno::Any& Order1, const 
uno::Any&
     // 2) #TODO #FIXME need to refactor this ( below ) into a IsSingleCell() method
     uno::Reference< table::XColumnRowRange > xColumnRowRange(mxRange, uno::UNO_QUERY_THROW );
 
-    // 'Fraid I don't remember what I was trying to achieve here ???
-/*
-    if (  isSingleCellRange() )
-    {
-        uno::Reference< XRange > xCurrent = CurrentRegion();
-        xCurrent->Sort( Key1, Order1, Key2, Type, Order2, Key3, Order3, Header, OrderCustom, 
MatchCase, Orientation, SortMethod, DataOption1, DataOption2, DataOption3 );
-        return;
-    }
-*/
     // set up defaults
 
     sal_Int16 nOrder1 = aSortParam.bAscending[0] ? excel::XlSortOrder::xlAscending : 
excel::XlSortOrder::xlDescending;
@@ -5205,12 +5196,6 @@ void ScVbaRange::setShowDetail(const uno::Any& aShowDetail) throw ( 
css::uno::Ru
 ::com::sun::star::uno::Reference< ::ooo::vba::excel::XQueryTable > SAL_CALL
 ScVbaRange::getQueryTable() throw (::com::sun::star::uno::RuntimeException)
 {
-    /*
-    if (m_pQueryTable == NULL)
-    {
-        m_pQueryTable = new ScVbaQueryTable(mxParent ,mxContext, getScDocument(), this); //add by 
limingl
-    }
-    //*/
     if (!m_xQueryTable.is())
     {
         m_xQueryTable = new ScVbaQueryTable(mxParent ,mxContext, getScDocument(), this); //add by 
limingl
diff --git a/sc/source/ui/vba/vbawsfunction.cxx b/sc/source/ui/vba/vbawsfunction.cxx
index b87ec85..f58c3cd 100644
--- a/sc/source/ui/vba/vbawsfunction.cxx
+++ b/sc/source/ui/vba/vbawsfunction.cxx
@@ -231,25 +231,6 @@ ScVbaWSFunction::invoke(const rtl::OUString& FunctionName, const uno::Sequence<
         }
     }
 
-#if 0
-    // MATCH function should alwayse return a double value, but currently if the first argument is 
XCellRange, MATCH function returns an array instead of a double value. Don't know why?
-    // To fix this issue in safe, current solution is to convert this array to a double value just 
for MATCH function.
-    String aUpper( FunctionName );
-    ScCompiler aCompiler( NULL, ScAddress() );
-    OpCode eOp = aCompiler.GetEnglishOpCode( aUpper.ToUpperAscii() );
-    if( eOp == ocMatch )
-    {
-        double fVal = 0.0;
-        if( aRet >>= fVal )
-            return aRet;
-        uno::Sequence< uno::Sequence< uno::Any > > aSequence;
-        if( !( ( aRet >>= aSequence ) && ( aSequence.getLength() > 0 ) &&
-            ( aSequence[0].getLength() > 0 ) && ( aSequence[0][0] >>= fVal ) ) )
-                throw uno::RuntimeException();
-        aRet <<= fVal;
-    }
-#endif
-
     return aRet;
 }
 
-- 
1.7.1

From 6db4aec8905d08ef113245b1ce5058421224ba08 Mon Sep 17 00:00:00 2001
From: pjacquod <pjacquod@alumni.ethz.ch>
Date: Sat, 20 Nov 2010 22:52:22 +0100
Subject: [PATCH 9/9] removed dead code in calc core tools

---
 sc/source/core/tool/compiler.cxx |    4 ----
 sc/source/core/tool/interpr5.cxx |    2 +-
 2 files changed, 1 insertions(+), 5 deletions(-)

diff --git a/sc/source/core/tool/compiler.cxx b/sc/source/core/tool/compiler.cxx
index e5eb562..002102a 100644
--- a/sc/source/core/tool/compiler.cxx
+++ b/sc/source/core/tool/compiler.cxx
@@ -528,11 +528,7 @@ ScCompiler::Convention::Convention( FormulaGrammar::AddressConvention eConv )
 /* ) */     t[41] |=   SC_COMPILER_C_WORD;
 /* * */     t[42] |=   SC_COMPILER_C_WORD;
 /* + */     t[43] |=   SC_COMPILER_C_WORD;
-#if 0 /* this really needs to be locale specific. */
-/* , */     t[44]  =   SC_COMPILER_C_CHAR | SC_COMPILER_C_WORD_SEP | SC_COMPILER_C_VALUE_SEP;
-#else
 /* , */     t[44] |=   SC_COMPILER_C_WORD;
-#endif
 /* - */     t[45] |=   SC_COMPILER_C_WORD;
 
 /* ; */     t[59] |=   SC_COMPILER_C_WORD;
diff --git a/sc/source/core/tool/interpr5.cxx b/sc/source/core/tool/interpr5.cxx
index c25f684..6ce149d 100644
--- a/sc/source/core/tool/interpr5.cxx
+++ b/sc/source/core/tool/interpr5.cxx
@@ -916,7 +916,7 @@ void ScInterpreter::ScMatInv()
                         for (SCSIZE i=0; i < nR; ++i)
                             pY->PutDouble( X[i], j, i);
                     }
-#if 0
+#if OSL_DEBUG_LEVEL > 1
                     /* Possible checks for ill-condition:
                      * 1. Scale matrix, invert scaled matrix. If there are
                      *    elements of the inverted matrix that are several
-- 
1.7.1


Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.