summaryrefslogtreecommitdiff
path: root/sc/source/core/data
diff options
context:
space:
mode:
Diffstat (limited to 'sc/source/core/data')
-rw-r--r--sc/source/core/data/autonamecache.cxx6
-rw-r--r--sc/source/core/data/dociter.cxx44
-rw-r--r--sc/source/core/data/documen3.cxx4
-rw-r--r--sc/source/core/data/document.cxx10
-rw-r--r--sc/source/core/data/formulaiter.cxx10
-rw-r--r--sc/source/core/data/table2.cxx2
6 files changed, 38 insertions, 38 deletions
diff --git a/sc/source/core/data/autonamecache.cxx b/sc/source/core/data/autonamecache.cxx
index bd30352f1d1f..a2be03c25796 100644
--- a/sc/source/core/data/autonamecache.cxx
+++ b/sc/source/core/data/autonamecache.cxx
@@ -24,8 +24,8 @@
#include <formulacell.hxx>
#include <editutil.hxx>
-ScAutoNameCache::ScAutoNameCache( ScDocument* pD ) :
- pDoc( pD ),
+ScAutoNameCache::ScAutoNameCache( ScDocument& rD ) :
+ rDoc( rD ),
nCurrentTab( 0 ) // doesn't matter - aNames is empty
{
}
@@ -49,7 +49,7 @@ const ScAutoNameAddresses& ScAutoNameCache::GetNameOccurrences( const OUString&
ScAutoNameAddresses& rAddresses = aNames[rName];
- ScCellIterator aIter( pDoc, ScRange( 0, 0, nCurrentTab, pDoc->MaxCol(), pDoc->MaxRow(), nCurrentTab ) );
+ ScCellIterator aIter( rDoc, ScRange( 0, 0, nCurrentTab, rDoc.MaxCol(), rDoc.MaxRow(), nCurrentTab ) );
for (bool bHasCell = aIter.first(); bHasCell; bHasCell = aIter.next())
{
// don't check code length here, always use the stored result
diff --git a/sc/source/core/data/dociter.cxx b/sc/source/core/data/dociter.cxx
index d7ff6613eecc..58594fd35d7d 100644
--- a/sc/source/core/data/dociter.cxx
+++ b/sc/source/core/data/dociter.cxx
@@ -831,8 +831,8 @@ sc::FormulaGroupEntry* ScFormulaGroupIterator::next()
return &maEntries[mnIndex++];
}
-ScCellIterator::ScCellIterator( ScDocument* pDoc, const ScRange& rRange, SubtotalFlags nSubTotalFlags ) :
- mpDoc(pDoc),
+ScCellIterator::ScCellIterator( ScDocument& rDoc, const ScRange& rRange, SubtotalFlags nSubTotalFlags ) :
+ mrDoc(rDoc),
maStartPos(rRange.aStart),
maEndPos(rRange.aEnd),
mnSubTotalFlags(nSubTotalFlags)
@@ -869,36 +869,36 @@ void ScCellIterator::setPos(size_t nPos)
const ScColumn* ScCellIterator::getColumn() const
{
- return &mpDoc->maTabs[maCurPos.Tab()]->aCol[maCurPos.Col()];
+ return &mrDoc.maTabs[maCurPos.Tab()]->aCol[maCurPos.Col()];
}
void ScCellIterator::init()
{
- SCTAB nDocMaxTab = mpDoc->GetTableCount() - 1;
+ SCTAB nDocMaxTab = mrDoc.GetTableCount() - 1;
PutInOrder(maStartPos, maEndPos);
- if (!mpDoc->ValidCol(maStartPos.Col())) maStartPos.SetCol(mpDoc->MaxCol());
- if (!mpDoc->ValidCol(maEndPos.Col())) maEndPos.SetCol(mpDoc->MaxCol());
- if (!mpDoc->ValidRow(maStartPos.Row())) maStartPos.SetRow(mpDoc->MaxRow());
- if (!mpDoc->ValidRow(maEndPos.Row())) maEndPos.SetRow(mpDoc->MaxRow());
+ if (!mrDoc.ValidCol(maStartPos.Col())) maStartPos.SetCol(mrDoc.MaxCol());
+ if (!mrDoc.ValidCol(maEndPos.Col())) maEndPos.SetCol(mrDoc.MaxCol());
+ if (!mrDoc.ValidRow(maStartPos.Row())) maStartPos.SetRow(mrDoc.MaxRow());
+ if (!mrDoc.ValidRow(maEndPos.Row())) maEndPos.SetRow(mrDoc.MaxRow());
if (!ValidTab(maStartPos.Tab(), nDocMaxTab)) maStartPos.SetTab(nDocMaxTab);
if (!ValidTab(maEndPos.Tab(), nDocMaxTab)) maEndPos.SetTab(nDocMaxTab);
- while (maEndPos.Tab() > 0 && !mpDoc->maTabs[maEndPos.Tab()])
+ while (maEndPos.Tab() > 0 && !mrDoc.maTabs[maEndPos.Tab()])
maEndPos.IncTab(-1); // Only the tables in use
if (maStartPos.Tab() > maEndPos.Tab())
maStartPos.SetTab(maEndPos.Tab());
- if (!mpDoc->maTabs[maStartPos.Tab()])
+ if (!mrDoc.maTabs[maStartPos.Tab()])
{
assert(!"Table not found");
- maStartPos = ScAddress(mpDoc->MaxCol()+1, mpDoc->MaxRow()+1, MAXTAB+1); // -> Abort on GetFirst.
+ maStartPos = ScAddress(mrDoc.MaxCol()+1, mrDoc.MaxRow()+1, MAXTAB+1); // -> Abort on GetFirst.
}
else
{
- maStartPos.SetCol(mpDoc->maTabs[maStartPos.Tab()]->ClampToAllocatedColumns(maStartPos.Col()));
+ maStartPos.SetCol(mrDoc.maTabs[maStartPos.Tab()]->ClampToAllocatedColumns(maStartPos.Col()));
}
maCurPos = maStartPos;
@@ -924,7 +924,7 @@ bool ScCellIterator::getCurrent()
do
{
maCurPos.IncCol();
- if (maCurPos.Col() >= mpDoc->GetAllocatedColumnsCount(maCurPos.Tab())
+ if (maCurPos.Col() >= mrDoc.GetAllocatedColumnsCount(maCurPos.Tab())
|| maCurPos.Col() > maEndPos.Col())
{
maCurPos.SetCol(maStartPos.Col());
@@ -982,7 +982,7 @@ bool ScCellIterator::getCurrent()
OUString ScCellIterator::getString() const
{
- return maCurCell.getString(mpDoc);
+ return maCurCell.getString(&mrDoc);
}
ScCellValue ScCellIterator::getCellValue() const
@@ -1023,7 +1023,7 @@ bool ScCellIterator::isEmpty() const
bool ScCellIterator::equalsWithoutFormat( const ScAddress& rPos ) const
{
- ScRefCellValue aOther(*mpDoc, rPos);
+ ScRefCellValue aOther(mrDoc, rPos);
return maCurCell.equalsWithoutFormat(aOther);
}
@@ -2628,21 +2628,21 @@ bool ScUsedAreaIterator::GetNext()
return bFound;
}
-ScDocAttrIterator::ScDocAttrIterator(ScDocument* pDocument, SCTAB nTable,
+ScDocAttrIterator::ScDocAttrIterator(ScDocument& rDocument, SCTAB nTable,
SCCOL nCol1, SCROW nRow1,
SCCOL nCol2, SCROW nRow2) :
- pDoc( pDocument ),
+ rDoc( rDocument ),
nTab( nTable ),
nEndCol( nCol2 ),
nStartRow( nRow1 ),
nEndRow( nRow2 ),
nCol( nCol1 )
{
- if ( ValidTab(nTab) && nTab < pDoc->GetTableCount() && pDoc->maTabs[nTab]
- && nCol < pDoc->maTabs[nTab]->GetAllocatedColumnsCount())
+ if ( ValidTab(nTab) && nTab < rDoc.GetTableCount() && rDoc.maTabs[nTab]
+ && nCol < rDoc.maTabs[nTab]->GetAllocatedColumnsCount())
{
- nEndCol = pDoc->maTabs[nTab]->ClampToAllocatedColumns(nEndCol);
- pColIter = pDoc->maTabs[nTab]->aCol[nCol].CreateAttrIterator( nStartRow, nEndRow );
+ nEndCol = rDoc.maTabs[nTab]->ClampToAllocatedColumns(nEndCol);
+ pColIter = rDoc.maTabs[nTab]->aCol[nCol].CreateAttrIterator( nStartRow, nEndRow );
}
}
@@ -2663,7 +2663,7 @@ const ScPatternAttr* ScDocAttrIterator::GetNext( SCCOL& rCol, SCROW& rRow1, SCRO
++nCol;
if ( nCol <= nEndCol )
- pColIter = pDoc->maTabs[nTab]->aCol[nCol].CreateAttrIterator( nStartRow, nEndRow );
+ pColIter = rDoc.maTabs[nTab]->aCol[nCol].CreateAttrIterator( nStartRow, nEndRow );
else
pColIter.reset();
}
diff --git a/sc/source/core/data/documen3.cxx b/sc/source/core/data/documen3.cxx
index f0d1e28c1947..a278e2af7355 100644
--- a/sc/source/core/data/documen3.cxx
+++ b/sc/source/core/data/documen3.cxx
@@ -762,7 +762,7 @@ bool ScDocument::DoSubTotals( SCTAB nTab, ScSubTotalParam& rParam )
bool ScDocument::HasSubTotalCells( const ScRange& rRange )
{
- ScCellIterator aIter( this, rRange );
+ ScCellIterator aIter(*this, rRange);
for (bool bHas = aIter.first(); bHas; bHas = aIter.next())
{
if (aIter.getType() != CELLTYPE_FORMULA)
@@ -1655,7 +1655,7 @@ void ScDocument::GetFormulaEntries( ScTypedCaseStrSet& rStrings )
{
const ScRangePair & rPair = (*pList)[i];
const ScRange & rRange = rPair.GetRange(0);
- ScCellIterator aIter( this, rRange );
+ ScCellIterator aIter( *this, rRange );
for (bool bHas = aIter.first(); bHas; bHas = aIter.next())
{
if (!aIter.hasString())
diff --git a/sc/source/core/data/document.cxx b/sc/source/core/data/document.cxx
index 553b7e5f42af..00080411135d 100644
--- a/sc/source/core/data/document.cxx
+++ b/sc/source/core/data/document.cxx
@@ -3978,7 +3978,7 @@ void ScDocument::CompileXML()
// set AutoNameCache to speed up automatic name lookup
OSL_ENSURE( !pAutoNameCache, "AutoNameCache already set" );
- pAutoNameCache.reset( new ScAutoNameCache( this ) );
+ pAutoNameCache.reset( new ScAutoNameCache( *this ) );
if (pRangeName)
pRangeName->CompileUnresolvedXML(aCxt);
@@ -4653,7 +4653,7 @@ SCROW ScDocument::GetNextDifferentChangedRow( SCTAB nTab, SCROW nStart) const
void ScDocument::GetColDefault( SCTAB nTab, SCCOL nCol, SCROW nLastRow, SCROW& nDefault)
{
nDefault = 0;
- ScDocAttrIterator aDocAttrItr(this, nTab, nCol, 0, nCol, nLastRow);
+ ScDocAttrIterator aDocAttrItr(*this, nTab, nCol, 0, nCol, nLastRow);
SCCOL nColumn;
SCROW nStartRow;
SCROW nEndRow;
@@ -6407,9 +6407,9 @@ void ScDocument::RemoveSubTotalCell(ScFormulaCell* pCell)
namespace {
-bool lcl_hasDirtyRange(const ScDocument* pDoc, ScFormulaCell* pCell, const ScRange& rDirtyRange)
+bool lcl_hasDirtyRange(const ScDocument& rDoc, ScFormulaCell* pCell, const ScRange& rDirtyRange)
{
- ScDetectiveRefIter aRefIter(pDoc, pCell);
+ ScDetectiveRefIter aRefIter(rDoc, pCell);
ScRange aRange;
while (aRefIter.GetNextRef(aRange))
{
@@ -6433,7 +6433,7 @@ void ScDocument::SetSubTotalCellsDirty(const ScRange& rDirtyRange)
if (pCell->IsSubTotal())
{
aNewSet.insert(pCell);
- if (lcl_hasDirtyRange(this, pCell, rDirtyRange))
+ if (lcl_hasDirtyRange(*this, pCell, rDirtyRange))
pCell->SetDirty();
}
}
diff --git a/sc/source/core/data/formulaiter.cxx b/sc/source/core/data/formulaiter.cxx
index f05eea9e2d99..d7f183b2a0a2 100644
--- a/sc/source/core/data/formulaiter.cxx
+++ b/sc/source/core/data/formulaiter.cxx
@@ -26,8 +26,8 @@
using namespace formula;
-ScDetectiveRefIter::ScDetectiveRefIter( const ScDocument* pDoc, ScFormulaCell* pCell ) :
- mpDoc(pDoc),
+ScDetectiveRefIter::ScDetectiveRefIter( const ScDocument& rDoc, ScFormulaCell* pCell ) :
+ mrDoc(rDoc),
maIter(*pCell->GetCode()),
aPos(pCell->aPos)
{
@@ -56,8 +56,8 @@ bool ScDetectiveRefIter::GetNextRef( ScRange& rRange )
if( p )
{
SingleDoubleRefProvider aProv( *p );
- rRange.aStart = aProv.Ref1.toAbs(*mpDoc, aPos);
- rRange.aEnd = aProv.Ref2.toAbs(*mpDoc, aPos);
+ rRange.aStart = aProv.Ref1.toAbs(mrDoc, aPos);
+ rRange.aEnd = aProv.Ref2.toAbs(mrDoc, aPos);
bRet = true;
}
@@ -67,7 +67,7 @@ bool ScDetectiveRefIter::GetNextRef( ScRange& rRange )
formula::FormulaToken* ScDetectiveRefIter::GetNextRefToken()
{
formula::FormulaToken* p = maIter.GetNextReferenceRPN();
- while (p && lcl_ScDetectiveRefIter_SkipRef(*mpDoc, p, aPos))
+ while (p && lcl_ScDetectiveRefIter_SkipRef(mrDoc, p, aPos))
{
p = maIter.GetNextReferenceRPN();
}
diff --git a/sc/source/core/data/table2.cxx b/sc/source/core/data/table2.cxx
index 3f91e77fab27..c64dbf9b0d72 100644
--- a/sc/source/core/data/table2.cxx
+++ b/sc/source/core/data/table2.cxx
@@ -2239,7 +2239,7 @@ void ScTable::FindMaxRotCol( RowInfo* pRowInfo, SCSIZE nArrCount, SCCOL nX1, SCC
if (!ColHidden(nCol))
{
SCSIZE nArrY = 0;
- ScDocAttrIterator aIter( &rDocument, nTab, nCol, nY1, nCol, nY2 );
+ ScDocAttrIterator aIter( rDocument, nTab, nCol, nY1, nCol, nY2 );
SCCOL nAttrCol;
SCROW nAttrRow1, nAttrRow2;
const ScPatternAttr* pPattern = aIter.GetNext( nAttrCol, nAttrRow1, nAttrRow2 );