[Libreoffice-commits] core.git: 2 commits - sc/source
Eike Rathke
erack at redhat.com
Wed May 6 10:17:59 PDT 2015
sc/source/core/tool/token.cxx | 104 ++++++++++++++++++++++++++++++++++--------
1 file changed, 85 insertions(+), 19 deletions(-)
New commits:
commit 4a53021f0662e08b56fd076f78ac182634fcec4c
Author: Eike Rathke <erack at redhat.com>
Date: Wed May 6 19:13:39 2015 +0200
assume modified if an index has no corresponding ScDBData (anymore)
Change-Id: I16cbc7d772f39c8778b8ba21a629ced6b0dbedeb
diff --git a/sc/source/core/tool/token.cxx b/sc/source/core/tool/token.cxx
index 4b82778..53fc62b 100644
--- a/sc/source/core/tool/token.cxx
+++ b/sc/source/core/tool/token.cxx
@@ -2684,7 +2684,7 @@ bool isDBDataModified( const ScDocument& rDoc, const formula::FormulaToken& rTok
// Check if this DBData has been modified.
const ScDBData* pDBData = rDoc.GetDBCollection()->getNamedDBs().findByIndex( rToken.GetIndex());
if (!pDBData)
- return false;
+ return true;
return pDBData->IsModified();
}
commit 595b2bbaedf730efc487fd9901365ffe03591e13
Author: Eike Rathke <erack at redhat.com>
Date: Wed May 6 19:07:38 2015 +0200
now also ocTableRef is DBData, tdf#91078 related
Change-Id: I70d3f595b3fe26b77788a668a430d4d777320754
diff --git a/sc/source/core/tool/token.cxx b/sc/source/core/tool/token.cxx
index 67d45da..4b82778 100644
--- a/sc/source/core/tool/token.cxx
+++ b/sc/source/core/tool/token.cxx
@@ -2827,9 +2827,20 @@ sc::RefUpdateResult ScTokenArray::AdjustReferenceOnShift( const sc::RefUpdateCon
break;
case svIndex:
{
- if (((*p)->GetOpCode() == ocName && isNameModified(rCxt.maUpdatedNames, rOldPos.Tab(), **p)) ||
- ((*p)->GetOpCode() == ocDBArea && isDBDataModified(rCxt.mrDoc, **p)))
- aRes.mbNameModified = true;
+ switch ((*p)->GetOpCode())
+ {
+ case ocName:
+ if (isNameModified(rCxt.maUpdatedNames, rOldPos.Tab(), **p))
+ aRes.mbNameModified = true;
+ break;
+ case ocDBArea:
+ case ocTableRef:
+ if (isDBDataModified(rCxt.mrDoc, **p))
+ aRes.mbNameModified = true;
+ break;
+ default:
+ ; // nothing
+ }
}
break;
default:
@@ -2896,9 +2907,20 @@ sc::RefUpdateResult ScTokenArray::AdjustReferenceOnMove(
break;
case svIndex:
{
- if (((*p)->GetOpCode() == ocName && isNameModified(rCxt.maUpdatedNames, rOldPos.Tab(), **p)) ||
- ((*p)->GetOpCode() == ocDBArea && isDBDataModified(rCxt.mrDoc, **p)))
- aRes.mbNameModified = true;
+ switch ((*p)->GetOpCode())
+ {
+ case ocName:
+ if (isNameModified(rCxt.maUpdatedNames, rOldPos.Tab(), **p))
+ aRes.mbNameModified = true;
+ break;
+ case ocDBArea:
+ case ocTableRef:
+ if (isDBDataModified(rCxt.mrDoc, **p))
+ aRes.mbNameModified = true;
+ break;
+ default:
+ ; // nothing
+ }
}
break;
default:
@@ -2952,9 +2974,20 @@ sc::RefUpdateResult ScTokenArray::MoveReference( const ScAddress& rPos, const sc
break;
case svIndex:
{
- if (((*p)->GetOpCode() == ocName && isNameModified(rCxt.maUpdatedNames, aOldRange.aStart.Tab(), **p)) ||
- ((*p)->GetOpCode() == ocDBArea && isDBDataModified(rCxt.mrDoc, **p)))
- aRes.mbNameModified = true;
+ switch ((*p)->GetOpCode())
+ {
+ case ocName:
+ if (isNameModified(rCxt.maUpdatedNames, aOldRange.aStart.Tab(), **p))
+ aRes.mbNameModified = true;
+ break;
+ case ocDBArea:
+ case ocTableRef:
+ if (isDBDataModified(rCxt.mrDoc, **p))
+ aRes.mbNameModified = true;
+ break;
+ default:
+ ; // nothing
+ }
}
break;
default:
@@ -3469,9 +3502,20 @@ sc::RefUpdateResult ScTokenArray::AdjustReferenceOnDeletedTab( sc::RefUpdateDele
break;
case svIndex:
{
- if (((*p)->GetOpCode() == ocName && isNameModified(rCxt.maUpdatedNames, rOldPos.Tab(), **p)) ||
- ((*p)->GetOpCode() == ocDBArea && isDBDataModified(rCxt.mrDoc, **p)))
- aRes.mbNameModified = true;
+ switch ((*p)->GetOpCode())
+ {
+ case ocName:
+ if (isNameModified(rCxt.maUpdatedNames, rOldPos.Tab(), **p))
+ aRes.mbNameModified = true;
+ break;
+ case ocDBArea:
+ case ocTableRef:
+ if (isDBDataModified(rCxt.mrDoc, **p))
+ aRes.mbNameModified = true;
+ break;
+ default:
+ ; // nothing
+ }
}
break;
default:
@@ -3514,9 +3558,20 @@ sc::RefUpdateResult ScTokenArray::AdjustReferenceOnInsertedTab( sc::RefUpdateIns
break;
case svIndex:
{
- if (((*p)->GetOpCode() == ocName && isNameModified(rCxt.maUpdatedNames, rOldPos.Tab(), **p)) ||
- ((*p)->GetOpCode() == ocDBArea && isDBDataModified(rCxt.mrDoc, **p)))
- aRes.mbNameModified = true;
+ switch ((*p)->GetOpCode())
+ {
+ case ocName:
+ if (isNameModified(rCxt.maUpdatedNames, rOldPos.Tab(), **p))
+ aRes.mbNameModified = true;
+ break;
+ case ocDBArea:
+ case ocTableRef:
+ if (isDBDataModified(rCxt.mrDoc, **p))
+ aRes.mbNameModified = true;
+ break;
+ default:
+ ; // nothing
+ }
}
break;
default:
@@ -3580,9 +3635,20 @@ sc::RefUpdateResult ScTokenArray::AdjustReferenceOnMovedTab( sc::RefUpdateMoveTa
break;
case svIndex:
{
- if (((*p)->GetOpCode() == ocName && isNameModified(rCxt.maUpdatedNames, rOldPos.Tab(), **p)) ||
- ((*p)->GetOpCode() == ocDBArea && isDBDataModified(rCxt.mrDoc, **p)))
- aRes.mbNameModified = true;
+ switch ((*p)->GetOpCode())
+ {
+ case ocName:
+ if (isNameModified(rCxt.maUpdatedNames, rOldPos.Tab(), **p))
+ aRes.mbNameModified = true;
+ break;
+ case ocDBArea:
+ case ocTableRef:
+ if (isDBDataModified(rCxt.mrDoc, **p))
+ aRes.mbNameModified = true;
+ break;
+ default:
+ ; // nothing
+ }
}
break;
default:
More information about the Libreoffice-commits
mailing list