summaryrefslogtreecommitdiff
path: root/sc/source
diff options
context:
space:
mode:
authorJochen Nitschke <j.nitschke+logerrit@ok.de>2016-07-22 10:22:14 +0200
committerJochen Nitschke <j.nitschke+logerrit@ok.de>2016-07-22 10:33:28 +0000
commit2a5a69de7f4696e5bf6e2e1ada414b46c6a4d983 (patch)
treed4c9cb0f65a452edce6a19d03d9424842f145008 /sc/source
parent99833c2d6c9882bfad17e3e7fb659f5a81184a3f (diff)
sc: convert SC_CLONECELL_... to typed_flags
Change-Id: I4ce14eecaa9fbdc007bbb39f0543099c75f2ffcb Reviewed-on: https://gerrit.libreoffice.org/27428 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Jenkins <ci@libreoffice.org>
Diffstat (limited to 'sc/source')
-rw-r--r--sc/source/core/data/cellvalue.cxx2
-rw-r--r--sc/source/core/data/colorscale.cxx4
-rw-r--r--sc/source/core/data/column.cxx12
-rw-r--r--sc/source/core/data/documen4.cxx4
-rw-r--r--sc/source/core/data/formulacell.cxx12
-rw-r--r--sc/source/core/data/table2.cxx2
-rw-r--r--sc/source/ui/undo/undocell.cxx4
7 files changed, 16 insertions, 24 deletions
diff --git a/sc/source/core/data/cellvalue.cxx b/sc/source/core/data/cellvalue.cxx
index d6b71f111fb9..25ed7d705726 100644
--- a/sc/source/core/data/cellvalue.cxx
+++ b/sc/source/core/data/cellvalue.cxx
@@ -308,7 +308,7 @@ void ScCellValue::assign( const ScDocument& rDoc, const ScAddress& rPos )
}
}
-void ScCellValue::assign( const ScCellValue& rOther, ScDocument& rDestDoc, int nCloneFlags )
+void ScCellValue::assign(const ScCellValue& rOther, ScDocument& rDestDoc, ScCloneFlags nCloneFlags)
{
clear();
diff --git a/sc/source/core/data/colorscale.cxx b/sc/source/core/data/colorscale.cxx
index 72c016ce421b..da7f42e680fe 100644
--- a/sc/source/core/data/colorscale.cxx
+++ b/sc/source/core/data/colorscale.cxx
@@ -165,7 +165,7 @@ ScColorScaleEntry::ScColorScaleEntry(const ScColorScaleEntry& rEntry):
{
if(rEntry.mpCell)
{
- mpCell.reset(new ScFormulaCell(*rEntry.mpCell, *rEntry.mpCell->GetDocument(), rEntry.mpCell->aPos, SC_CLONECELL_NOMAKEABS_EXTERNAL));
+ mpCell.reset(new ScFormulaCell(*rEntry.mpCell, *rEntry.mpCell->GetDocument(), rEntry.mpCell->aPos, ScCloneFlags::NoMakeAbsExternal));
mpCell->StartListeningTo( mpCell->GetDocument() );
mpListener.reset(new ScFormulaListener(mpCell.get()));
}
@@ -179,7 +179,7 @@ ScColorScaleEntry::ScColorScaleEntry(ScDocument* pDoc, const ScColorScaleEntry&
{
if(rEntry.mpCell)
{
- mpCell.reset(new ScFormulaCell(*rEntry.mpCell, *rEntry.mpCell->GetDocument(), rEntry.mpCell->aPos, SC_CLONECELL_NOMAKEABS_EXTERNAL));
+ mpCell.reset(new ScFormulaCell(*rEntry.mpCell, *rEntry.mpCell->GetDocument(), rEntry.mpCell->aPos, ScCloneFlags::NoMakeAbsExternal));
mpCell->StartListeningTo( pDoc );
mpListener.reset(new ScFormulaListener(mpCell.get()));
}
diff --git a/sc/source/core/data/column.cxx b/sc/source/core/data/column.cxx
index 3bc430ada2c0..183327a5334b 100644
--- a/sc/source/core/data/column.cxx
+++ b/sc/source/core/data/column.cxx
@@ -1381,7 +1381,7 @@ class CopyByCloneHandler
InsertDeleteFlags mnCopyFlags;
sc::StartListeningType meListenType;
- int mnFormulaCellCloneFlags;
+ ScCloneFlags mnFormulaCellCloneFlags;
void setDefaultAttrToDest(size_t nRow)
{
@@ -1502,7 +1502,7 @@ public:
mpSharedStringPool(pSharedStringPool),
mnCopyFlags(nCopyFlags),
meListenType(sc::SingleCellListening),
- mnFormulaCellCloneFlags(bGlobalNamesToLocal ? SC_CLONECELL_NAMES_TO_LOCAL : 0)
+ mnFormulaCellCloneFlags(bGlobalNamesToLocal ? ScCloneFlags::NamesToLocal : ScCloneFlags::Default)
{
if (mpDestPos)
maDestPos = *mpDestPos;
@@ -1763,9 +1763,6 @@ void ScColumn::CopyScenarioFrom( const ScColumn& rSrcCol )
UpdateReferenceOnCopy(aRefCxt);
UpdateCompile();
}
-
- //TODO: make CopyToColumn "const" !!! (obsolete comment ?)
-
pPattern = aAttrIter.Next( nStart, nEnd );
}
}
@@ -1784,8 +1781,6 @@ void ScColumn::CopyScenarioTo( ScColumn& rDestCol ) const
sc::CopyToDocContext aCxt(*rDestCol.pDocument);
CopyToColumn(aCxt, nStart, nEnd, InsertDeleteFlags::CONTENTS, false, rDestCol);
- // UpdateUsed not needed, is already done in TestCopyScenario (obsolete comment ?)
-
sc::RefUpdateContext aRefCxt(*pDocument);
aRefCxt.meMode = URM_COPY;
aRefCxt.maRange = ScRange(rDestCol.nCol, nStart, rDestCol.nTab, rDestCol.nCol, nEnd, rDestCol.nTab);
@@ -1793,9 +1788,6 @@ void ScColumn::CopyScenarioTo( ScColumn& rDestCol ) const
rDestCol.UpdateReferenceOnCopy(aRefCxt);
rDestCol.UpdateCompile();
}
-
- //TODO: make CopyToColumn "const" !!! (obsolete comment ?)
-
pPattern = aAttrIter.Next( nStart, nEnd );
}
}
diff --git a/sc/source/core/data/documen4.cxx b/sc/source/core/data/documen4.cxx
index 3f91377c7d02..d2dcdb28c8bd 100644
--- a/sc/source/core/data/documen4.cxx
+++ b/sc/source/core/data/documen4.cxx
@@ -297,7 +297,7 @@ void ScDocument::InsertMatrixFormula(SCCOL nCol1, SCROW nRow1,
maTabs[*itr]->SetFormulaCell(
nCol1, nRow1,
new ScFormulaCell(
- *pCell, *this, ScAddress(nCol1, nRow1, *itr), SC_CLONECELL_STARTLISTENING));
+ *pCell, *this, ScAddress(nCol1, nRow1, *itr), ScCloneFlags::StartListening));
}
ScAddress aBasePos(nCol1, nRow1, nTab1);
@@ -435,7 +435,7 @@ void ScDocument::InsertTableOp(const ScTabOpParam& rParam, // multiple (repeate
for (; itr != itrEnd && *itr < nMax; ++itr)
if( maTabs[*itr] )
maTabs[*itr]->SetFormulaCell(
- j, k, new ScFormulaCell(aRefCell, *this, ScAddress(j, k, *itr), SC_CLONECELL_STARTLISTENING));
+ j, k, new ScFormulaCell(aRefCell, *this, ScAddress(j, k, *itr), ScCloneFlags::StartListening));
}
}
diff --git a/sc/source/core/data/formulacell.cxx b/sc/source/core/data/formulacell.cxx
index 407cd47003b7..25a527ffa60a 100644
--- a/sc/source/core/data/formulacell.cxx
+++ b/sc/source/core/data/formulacell.cxx
@@ -804,7 +804,7 @@ ScFormulaCell::ScFormulaCell(
pDocument->AddSubTotalCell(this);
}
-ScFormulaCell::ScFormulaCell( const ScFormulaCell& rCell, ScDocument& rDoc, const ScAddress& rPos, int nCloneFlags ) :
+ScFormulaCell::ScFormulaCell(const ScFormulaCell& rCell, ScDocument& rDoc, const ScAddress& rPos, ScCloneFlags nCloneFlags) :
SvtListener(),
aResult( rCell.aResult ),
eTempGrammar( rCell.eTempGrammar),
@@ -852,7 +852,7 @@ ScFormulaCell::ScFormulaCell( const ScFormulaCell& rCell, ScDocument& rDoc, cons
{
if (!pDocument->IsClipboardSource() || aPos.Tab() != rCell.aPos.Tab())
{
- bool bGlobalNamesToLocal = ((nCloneFlags & SC_CLONECELL_NAMES_TO_LOCAL) != 0);
+ bool bGlobalNamesToLocal = ((nCloneFlags & ScCloneFlags::NamesToLocal) != ScCloneFlags::Default);
formula::FormulaToken* pToken = nullptr;
while((pToken = pCode->GetNextName())!= nullptr)
{
@@ -865,7 +865,7 @@ ScFormulaCell::ScFormulaCell( const ScFormulaCell& rCell, ScDocument& rDoc, cons
}
bool bCopyBetweenDocs = pDocument->GetPool() != rCell.pDocument->GetPool();
- if (bCopyBetweenDocs && !(nCloneFlags & SC_CLONECELL_NOMAKEABS_EXTERNAL))
+ if (bCopyBetweenDocs && !(nCloneFlags & ScCloneFlags::NoMakeAbsExternal))
{
pCode->ReadjustAbsolute3DReferences( rCell.pDocument, &rDoc, rCell.aPos);
}
@@ -880,7 +880,7 @@ ScFormulaCell::ScFormulaCell( const ScFormulaCell& rCell, ScDocument& rDoc, cons
pCode->AdjustReferenceOnCopy( aPos);
}
- if ( nCloneFlags & SC_CLONECELL_ADJUST3DREL )
+ if ( nCloneFlags & ScCloneFlags::Adjust3Drel )
pCode->ReadjustRelative3DReferences( rCell.aPos, aPos );
if( !bCompile )
@@ -930,7 +930,7 @@ ScFormulaCell::ScFormulaCell( const ScFormulaCell& rCell, ScDocument& rDoc, cons
}
}
- if( nCloneFlags & SC_CLONECELL_STARTLISTENING )
+ if( nCloneFlags & ScCloneFlags::StartListening )
StartListeningTo( &rDoc );
if (bSubTotal)
@@ -962,7 +962,7 @@ ScFormulaCell* ScFormulaCell::Clone() const
ScFormulaCell* ScFormulaCell::Clone( const ScAddress& rPos ) const
{
- return new ScFormulaCell(*this, *pDocument, rPos, SC_CLONECELL_DEFAULT);
+ return new ScFormulaCell(*this, *pDocument, rPos, ScCloneFlags::Default);
}
size_t ScFormulaCell::GetHash() const
diff --git a/sc/source/core/data/table2.cxx b/sc/source/core/data/table2.cxx
index 788ce139eb48..1f9ac65938bf 100644
--- a/sc/source/core/data/table2.cxx
+++ b/sc/source/core/data/table2.cxx
@@ -806,7 +806,7 @@ public:
}
ScFormulaCell* pNew = new ScFormulaCell(
- *p, mrClipTab.GetDoc(), getDestPos(nRow), SC_CLONECELL_STARTLISTENING);
+ *p, mrClipTab.GetDoc(), getDestPos(nRow), ScCloneFlags::StartListening);
// rotate reference
// for Cut, the referneces are later adjusted through UpdateTranspose
diff --git a/sc/source/ui/undo/undocell.cxx b/sc/source/ui/undo/undocell.cxx
index 74711df2388a..8e3c685ddd3c 100644
--- a/sc/source/ui/undo/undocell.cxx
+++ b/sc/source/ui/undo/undocell.cxx
@@ -230,7 +230,7 @@ void ScUndoEnterData::Undo()
for (Value & rVal : maOldValues)
{
ScCellValue aNewCell;
- aNewCell.assign(rVal.maCell, rDoc, SC_CLONECELL_STARTLISTENING);
+ aNewCell.assign(rVal.maCell, rDoc, ScCloneFlags::StartListening);
ScAddress aPos = maPos;
aPos.SetTab(rVal.mnTab);
aNewCell.release(rDoc, aPos);
@@ -342,7 +342,7 @@ void ScUndoEnterValue::Undo()
ScDocument& rDoc = pDocShell->GetDocument();
ScCellValue aNewCell;
- aNewCell.assign(maOldCell, rDoc, SC_CLONECELL_STARTLISTENING);
+ aNewCell.assign(maOldCell, rDoc, ScCloneFlags::StartListening);
aNewCell.release(rDoc, aPos);
pDocShell->PostPaintCell( aPos );