[Libreoffice-commits] core.git: sc/inc sc/source unusedcode.easy

2014-11-15 Thread Noel Grandin
 sc/inc/compiler.hxx   |   32 ++
 sc/source/core/tool/token.cxx |   74 --
 unusedcode.easy   |2 -
 3 files changed, 4 insertions(+), 104 deletions(-)

New commits:
commit 1866d90d81d6ed3f4700e8b6a9021cd4afd84d9e
Author: Noel Grandin 
Date:   Fri Nov 14 09:53:59 2014 +0200

remove unused code in ScRawToken

Change-Id: I8f644ac7f7bbdd2c9cb6f5a41709e41efa737885
Reviewed-on: https://gerrit.libreoffice.org/12423
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 

diff --git a/sc/inc/compiler.hxx b/sc/inc/compiler.hxx
index 85e9cc0..93246cd 100644
--- a/sc/inc/compiler.hxx
+++ b/sc/inc/compiler.hxx
@@ -35,9 +35,6 @@
 
 #include 
 
-#include 
-#include 
-
 // constants and data types also for external modules (ScInterpreter et al)
 
 #define MAXSTRLEN1024   /* maximum length of input string of one symbol */
@@ -89,8 +86,6 @@ class CompileFormulaContext;
 /*
 OpCode  eOp;// OpCode
 formula::StackVar   eType;  // type of data
-sal_uInt16  nRefCnt;// reference count
-boolbRaw;   // not cloned yet and trimmed to real size
  */
 
 struct ScRawTokenBase
@@ -98,8 +93,6 @@ struct ScRawTokenBase
 protected:
 OpCode   eOp;
 formula::StackVar eType;
-mutable sal_uInt16   nRefCnt;
-bool bRaw;
 };
 
 struct ScDoubleRawToken: private ScRawTokenBase
@@ -154,19 +147,15 @@ public:
 shortnJump[ FORMULA_MAXJUMPCOUNT + 1 ]; // If/Chose token
 };
 
-//! other members not initialized
-ScRawToken() { bRaw = true; }
+//! members not initialized
+ScRawToken() {}
 private:
 ~ScRawToken() {}//! only delete via Delete()
 public:
 DECL_FIXEDMEMPOOL_NEWDEL( ScRawToken );
-formula::StackVarGetType()   const   { return (formula::StackVar) 
eType; }
-OpCode  GetOpCode() const   { return (OpCode)   eOp;   }
+formula::StackVarGetType()   const   { return eType; }
+OpCode  GetOpCode() const   { return eOp; }
 voidNewOpCode( OpCode e )   { eOp = e; }
-voidIncRef(){ nRefCnt++;   }
-voidDecRef(){ if( !--nRefCnt ) Delete(); }
-sal_uInt16  GetRef() const  { return nRefCnt; }
-SC_DLLPUBLIC void   Delete();
 
 // Use these methods only on tokens that are not part of a token array,
 // since the reference count is cleared!
@@ -192,7 +181,6 @@ public:
  */
 bool IsValidReference() const;
 
-ScRawToken* Clone() const;  // real copy!
 formula::FormulaToken* CreateToken() const;   // create typified token
 void Load( SvStream&, sal_uInt16 nVer );
 
@@ -203,18 +191,6 @@ public:
 { return GetStrLenBytes( GetStrLen( pStr ) ); }
 };
 
-inline void intrusive_ptr_add_ref(ScRawToken* p)
-{
-p->IncRef();
-}
-
-inline void intrusive_ptr_release(ScRawToken* p)
-{
-p->DecRef();
-}
-
-typedef ::boost::intrusive_ptr ScRawTokenRef;
-
 class SC_DLLPUBLIC ScCompiler : public formula::FormulaCompiler
 {
 public:
diff --git a/sc/source/core/tool/token.cxx b/sc/source/core/tool/token.cxx
index 6bf5f4c..28bb7a1 100644
--- a/sc/source/core/tool/token.cxx
+++ b/sc/source/core/tool/token.cxx
@@ -174,14 +174,12 @@ void ScRawToken::SetOpCode( OpCode e )
 sbyte.cByte = 0;
 sbyte.bHasForceArray = ScParameterClassification::HasForceArray( 
eOp);
 }
-nRefCnt = 0;
 }
 
 void ScRawToken::SetString( rtl_uString* pData, rtl_uString* pDataIgoreCase )
 {
 eOp   = ocPush;
 eType = svString;
-nRefCnt = 0;
 
 sharedstring.mpData = pData;
 sharedstring.mpDataIgnoreCase = pDataIgoreCase;
@@ -193,7 +191,6 @@ void ScRawToken::SetSingleReference( const ScSingleRefData& 
rRef )
 eType = svSingleRef;
 aRef.Ref1 =
 aRef.Ref2 = rRef;
-nRefCnt   = 0;
 }
 
 void ScRawToken::SetDoubleReference( const ScComplexRefData& rRef )
@@ -201,7 +198,6 @@ void ScRawToken::SetDoubleReference( const 
ScComplexRefData& rRef )
 eOp   = ocPush;
 eType = svDoubleRef;
 aRef  = rRef;
-nRefCnt = 0;
 }
 
 void ScRawToken::SetDouble(double rVal)
@@ -209,7 +205,6 @@ void ScRawToken::SetDouble(double rVal)
 eOp   = ocPush;
 eType = svDouble;
 nValue = rVal;
-nRefCnt = 0;
 }
 
 void ScRawToken::SetErrorConstant( sal_uInt16 nErr )
@@ -217,14 +212,12 @@ void ScRawToken::SetErrorConstant( sal_uInt16 nErr )
 eOp   = ocPush;
 eType = svError;
 nError = nErr;
-nRefCnt = 0;
 }
 
 void ScRawToken::SetName(bool bGlobal, sal_uInt16 nIndex)
 {
 eOp = ocName;
 eType = svIndex;
-nRefCnt = 0;
 
 name.bGlobal = bGlobal;
 name.nIndex = nIndex;
@@ -234,7 +227,6 @@ void ScRawToken::SetExternalSingleRef( sal_uInt16 nFileId, 
const OUString& rTabN
 {
 eOp = ocPush;
 eType = svExter

[Libreoffice-commits] core.git: sc/inc sc/source unusedcode.easy

2014-11-05 Thread Noel Grandin
 sc/inc/column.hxx  |2 --
 sc/source/core/data/column.cxx |   27 ---
 unusedcode.easy|1 -
 3 files changed, 30 deletions(-)

New commits:
commit befb92a8c4dc9c9f0349e701fd3d22cc49564d21
Author: Noel Grandin 
Date:   Thu Nov 6 09:19:13 2014 +0200

sc: remove some unused code

Change-Id: If64738067e3b35523272285ae2606c6c06d4c121

diff --git a/sc/inc/column.hxx b/sc/inc/column.hxx
index ec05b13..4ff3c9e 100644
--- a/sc/inc/column.hxx
+++ b/sc/inc/column.hxx
@@ -285,8 +285,6 @@ public:
 voidSwapCol(ScColumn& rCol);
 voidMoveTo(SCROW nStartRow, SCROW nEndRow, ScColumn& rCol);
 
-void MarkSubTotalCells( sc::ColumnSpanSet& rSet, SCROW nRow1, SCROW nRow2, 
bool bVal ) const;
-
 bool HasEditCells(SCROW nStartRow, SCROW nEndRow, SCROW& rFirst);
 
 bool SetString(
diff --git a/sc/source/core/data/column.cxx b/sc/source/core/data/column.cxx
index 9aa3532..bd6ea31 100644
--- a/sc/source/core/data/column.cxx
+++ b/sc/source/core/data/column.cxx
@@ -1920,33 +1920,6 @@ void ScColumn::MoveTo(SCROW nStartRow, SCROW nEndRow, 
ScColumn& rCol)
 
 namespace {
 
-class SubTotalCellPicker
-{
-sc::ColumnSpanSet& mrSet;
-SCTAB mnTab;
-SCCOL mnCol;
-bool mbVal;
-public:
-SubTotalCellPicker(sc::ColumnSpanSet& rSet, SCTAB nTab, SCCOL nCol, bool 
bVal) :
-mrSet(rSet), mnTab(nTab), mnCol(nCol), mbVal(bVal) {}
-
-void operator() (size_t nRow, const ScFormulaCell* pCell)
-{
-if (pCell->IsSubTotal())
-mrSet.set(mnTab, mnCol, nRow, mbVal);
-}
-};
-
-}
-
-void ScColumn::MarkSubTotalCells( sc::ColumnSpanSet& rSet, SCROW nRow1, SCROW 
nRow2, bool bVal ) const
-{
-SubTotalCellPicker aFunc(rSet, nTab, nCol, bVal);
-sc::ParseFormula(maCells.begin(), maCells, nRow1, nRow2, aFunc);
-}
-
-namespace {
-
 class SharedTopFormulaCellPicker : 
std::unary_function
 {
 public:
diff --git a/unusedcode.easy b/unusedcode.easy
index f22f7b1..66de7df 100644
--- a/unusedcode.easy
+++ b/unusedcode.easy
@@ -20,7 +20,6 @@ Primitive2dXmlDump::filterActionType(unsigned short, bool)
 Primitive2dXmlDump::filterAllActionTypes()
 SalGraphics::drawTransformedBitmap(basegfx::B2DPoint const&, basegfx::B2DPoint 
const&, basegfx::B2DPoint const&, SalBitmap const&, SalBitmap const*)
 ScBroadcastAreaSlotMachine::AreaBroadcastInRange(ScRange const&, ScHint 
const&) const
-ScColumn::MarkSubTotalCells(sc::ColumnSpanSet&, int, int, bool) const
 ScDocument::CreateFormatTable() const
 ScFormulaCellGroup::scheduleCompilation()
 ScRawToken::Clone() const
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: sc/inc sc/source unusedcode.easy

2014-11-04 Thread Noel Grandin
 sc/inc/document.hxx  |3 --
 sc/inc/table.hxx |2 -
 sc/source/core/data/documen7.cxx |   48 ---
 sc/source/core/data/table3.cxx   |   30 
 sc/source/ui/inc/tabview.hxx |2 -
 sc/source/ui/inc/undobase.hxx|2 -
 sc/source/ui/undo/undobase.cxx   |6 
 sc/source/ui/view/tabview5.cxx   |   33 --
 unusedcode.easy  |4 ---
 9 files changed, 130 deletions(-)

New commits:
commit 389875573012c6373d95ef31b12fe8e8104b1233
Author: Noel Grandin 
Date:   Tue Nov 4 11:42:49 2014 +0200

remove some unused code in sc

Change-Id: I6cd2acaf361ae1947787b5aacc86b75a6e21c379

diff --git a/sc/inc/document.hxx b/sc/inc/document.hxx
index e593387..47387bd 100644
--- a/sc/inc/document.hxx
+++ b/sc/inc/document.hxx
@@ -1864,9 +1864,6 @@ public:
 
 /// only area, no cell broadcast
 voidAreaBroadcast( const ScHint& rHint );
-/// only areas in range, no cell broadcasts
-voidAreaBroadcastInRange( const ScRange& rRange,
-  const ScHint& rHint );
 voidDelBroadcastAreasInRange( const ScRange& rRange );
 voidUpdateBroadcastAreas( UpdateRefMode eUpdateRefMode,
 const ScRange& rRange,
diff --git a/sc/inc/table.hxx b/sc/inc/table.hxx
index b65f829..d396402 100644
--- a/sc/inc/table.hxx
+++ b/sc/inc/table.hxx
@@ -246,8 +246,6 @@ public:
 voidRemoveSubTotals( ScSubTotalParam& rParam );
 boolDoSubTotals( ScSubTotalParam& rParam );
 
-void MarkSubTotalCells( sc::ColumnSpanSet& rSet, SCCOL nCol1, SCROW nRow1, 
SCCOL nCol2, SCROW nRow2, bool bVal ) const;
-
 const ScSheetEvents* GetSheetEvents() const  { return 
pSheetEvents; }
 voidSetSheetEvents( const ScSheetEvents* pNew );
 
diff --git a/sc/source/core/data/documen7.cxx b/sc/source/core/data/documen7.cxx
index 2e71884..af09c83 100644
--- a/sc/source/core/data/documen7.cxx
+++ b/sc/source/core/data/documen7.cxx
@@ -233,54 +233,6 @@ void ScDocument::AreaBroadcast( const ScHint& rHint )
 }
 }
 
-void ScDocument::AreaBroadcastInRange( const ScRange& rRange, const ScHint& 
rHint )
-{
-if ( !pBASM )
-return ;// Clipboard or Undo
-if ( !bHardRecalcState )
-{
-ScBulkBroadcast aBulkBroadcast( pBASM); // scoped bulk broadcast
-if ( pBASM->AreaBroadcastInRange( rRange, rHint ) )
-TrackFormulas( rHint.GetId() );
-}
-
-// Repaint for conditional formats containing relative references.
-//! This is _THE_ bottle neck!
-TableContainer::iterator itr = maTabs.begin();
-for(; itr != maTabs.end(); ++itr)
-{
-if(!*itr)
-continue;
-
-ScConditionalFormatList* pCondFormList = (*itr)->GetCondFormList();
-if ( pCondFormList )
-{
-SCCOL nCol1;
-SCROW nRow1;
-SCTAB nTab1;
-SCCOL nCol2;
-SCROW nRow2;
-SCTAB nTab2;
-rRange.GetVars( nCol1, nRow1, nTab1, nCol2, nRow2, nTab2 );
-ScAddress aAddress( rRange.aStart );
-for ( SCTAB nTab = nTab1; nTab <= nTab2; ++nTab )
-{
-aAddress.SetTab( nTab );
-for ( SCCOL nCol = nCol1; nCol <= nCol2; ++nCol )
-{
-aAddress.SetCol( nCol );
-for ( SCROW nRow = nRow1; nRow <= nRow2; ++nRow )
-{
-aAddress.SetRow( nRow );
-pCondFormList->SourceChanged( aAddress );
-}
-}
-}
-}
-
-}
-}
-
 void ScDocument::DelBroadcastAreasInRange( const ScRange& rRange )
 {
 if ( pBASM )
diff --git a/sc/source/core/data/table3.cxx b/sc/source/core/data/table3.cxx
index b7661fe..f7c6118 100644
--- a/sc/source/core/data/table3.cxx
+++ b/sc/source/core/data/table3.cxx
@@ -1804,36 +1804,6 @@ bool ScTable::DoSubTotals( ScSubTotalParam& rParam )
 return bSpaceLeft;
 }
 
-void ScTable::MarkSubTotalCells(
-sc::ColumnSpanSet& rSet, SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW 
nRow2, bool bVal ) const
-{
-if (!ValidCol(nCol1) || !ValidCol(nCol2))
-return;
-
-// Pick up all subtotal formula cells.
-for (SCCOL nCol = nCol1; nCol <= nCol2; ++nCol)
-aCol[nCol].MarkSubTotalCells(rSet, nRow1, nRow2, bVal);
-
-// Pick up all filtered rows.
-ScFlatBoolRowSegments::RangeData aFilteredSpan;
-SCROW nRow = nRow1;
-while (nRow <= nRow2)
-{
-if (!mpFilteredRows->getRangeData(nRow, aFilteredSpan))
-// Failed for whatever reason.
-return;
-
-if (aFilteredSpan.mbValue)
-{
-// Filtered span found.
-for (SCCOL nCol = nCol1; 

[Libreoffice-commits] core.git: sc/inc sc/source unusedcode.easy

2014-04-28 Thread Julien Nabet
 sc/inc/formulacell.hxx  |1 
 sc/source/core/data/formulacell.cxx |   41 
 unusedcode.easy |1 
 3 files changed, 43 deletions(-)

New commits:
commit 531f283b3d80b8bffeb1ac39a4656e27511fdaff
Author: Julien Nabet 
Date:   Mon Apr 28 22:46:59 2014 +0200

unusedcode.easy: remove SwapWithinGroup

Cleanup after 3f41b12c6685b82b5c2674bd9b9d5991adebeaf9 "SwapRow() is no 
more!"

Change-Id: If0e76e442bcee37c3136665e598038ab19a436bb

diff --git a/sc/inc/formulacell.hxx b/sc/inc/formulacell.hxx
index 71389ea..91a3625 100644
--- a/sc/inc/formulacell.hxx
+++ b/sc/inc/formulacell.hxx
@@ -209,7 +209,6 @@ public:
 voidSetDirtyAfterLoad();
 void ResetTableOpDirtyVar();
 voidSetTableOpDirty();
-boolSwapWithinGroup( ScFormulaCell *pSwap );
 boolIsDirtyOrInTableOpDirty() const;
 bool GetDirty() const;
 void ResetDirty();
diff --git a/sc/source/core/data/formulacell.cxx 
b/sc/source/core/data/formulacell.cxx
index 45ff164..aa52450 100644
--- a/sc/source/core/data/formulacell.cxx
+++ b/sc/source/core/data/formulacell.cxx
@@ -2020,47 +2020,6 @@ bool ScFormulaCell::IsDirtyOrInTableOpDirty() const
 return bDirty || (bTableOpDirty && pDocument->IsInInterpreterTableOp());
 }
 
-/** Exchange formulae cell result data inside a formula
-group if possible. Return true if both Formula cells
-are inside the same formula group and the data has
-been successfully exchanged; otherwise false - leaving
-the formulae untouched.
- */
-bool ScFormulaCell::SwapWithinGroup( ScFormulaCell *pSwap )
-{
-if (!mxGroup || // ungrouped
- mxGroup != pSwap->mxGroup)
-return false;
-
-if (pDocument != pSwap->pDocument ||
-nSeenInIteration != pSwap->nSeenInIteration ||
-eTempGrammar != pSwap->eTempGrammar ||
-cMatrixFlag != pSwap->cMatrixFlag ||
-nFormatType != pSwap->nFormatType ||
-bDirty != pSwap->bDirty ||
-bChanged != pSwap->bChanged ||
-bRunning != pSwap->bRunning ||
-bCompile != pSwap->bCompile ||
-bSubTotal != pSwap->bSubTotal ||
-bIsIterCell != pSwap->bIsIterCell ||
-bInChangeTrack != pSwap->bInChangeTrack ||
-bTableOpDirty != pSwap->bTableOpDirty ||
-bNeedListening != pSwap->bNeedListening ||
-mbNeedsNumberFormat != pSwap->mbNeedsNumberFormat ||
-mbPostponedDirty != pSwap->mbPostponedDirty
-)
-return false; // we are paranoid for good reason.
-
-// retain aPos as is.
-
-// swap result value
-ScFormulaResult aTemp(aResult);
-aResult = pSwap->aResult;
-pSwap->aResult.Assign(aTemp);
-
-return true;
-}
-
 void ScFormulaCell::SetResultDouble( double n )
 {
 aResult.SetDouble(n);
diff --git a/unusedcode.easy b/unusedcode.easy
index 4ba0403..4f5c4c2 100644
--- a/unusedcode.easy
+++ b/unusedcode.easy
@@ -41,7 +41,6 @@ ScBitMaskCompressedArray::GetFirstForCondition(int, int, uns
 ScDocument::CreateFormatTable() const
 ScDocument::GetRowFlagsArray(short) const
 ScExtIButton::GetSelected() const
-ScFormulaCell::SwapWithinGroup(ScFormulaCell*)
 ScFormulaCellGroup::scheduleCompilation()
 ScTable::GetCellTextAttr(short, int) const
 ScTable::TransferCellValuesFrom(short, int, sc::CellValues&)
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits