summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorKohei Yoshida <kohei.yoshida@collabora.com>2014-07-28 21:34:40 -0400
committerAndras Timar <andras.timar@collabora.com>2014-08-21 21:24:20 +0200
commit4326f42b47cfa493cf7093b2f558c445e22d1aeb (patch)
treeea89cd43a9c05b9acdc1a309d649816d231566ca /sc
parent19f89b8aa1fc5bb16d3c56dd09e0c803b39ecb82 (diff)
fdo#79578: Properly update formulas upon change in db collection.
Update it to handle formula groups correctly. (cherry picked from commit 300845922eec7a28bc1da337acd21f138685d759) Conflicts: sc/source/ui/docshell/dbdocfun.cxx sc/source/ui/docshell/docfunc.cxx sc/source/ui/docshell/docsh5.cxx sc/source/ui/undo/undocell.cxx sc/source/ui/undo/undodat.cxx sc/source/ui/unoobj/nameuno.cxx sc/source/ui/view/viewfunc.cxx sc/source/ui/view/dbfunc.cxx Change-Id: I009a7fcf3d3fb17ef6951c50534ca6bc1fffc259 Reviewed-on: https://gerrit.libreoffice.org/10605 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Eike Rathke <erack@redhat.com>
Diffstat (limited to 'sc')
-rw-r--r--sc/inc/column.hxx6
-rw-r--r--sc/inc/document.hxx8
-rw-r--r--sc/inc/formulacell.hxx1
-rw-r--r--sc/inc/table.hxx6
-rw-r--r--sc/source/core/data/column2.cxx22
-rw-r--r--sc/source/core/data/column4.cxx43
-rw-r--r--sc/source/core/data/documen4.cxx11
-rw-r--r--sc/source/core/data/document10.cxx17
-rw-r--r--sc/source/core/data/formulacell.cxx51
-rw-r--r--sc/source/core/data/table4.cxx6
-rw-r--r--sc/source/core/data/table7.cxx11
-rw-r--r--sc/source/ui/docshell/dbdocfun.cxx14
-rw-r--r--sc/source/ui/docshell/docfunc.cxx4
-rw-r--r--sc/source/ui/docshell/docsh5.cxx4
-rw-r--r--sc/source/ui/undo/undocell.cxx2
-rw-r--r--sc/source/ui/undo/undodat.cxx8
-rw-r--r--sc/source/ui/undo/undorangename.cxx2
-rw-r--r--sc/source/ui/unoobj/nameuno.cxx2
-rw-r--r--sc/source/ui/view/dbfunc.cxx4
-rw-r--r--sc/source/ui/view/viewfunc.cxx2
20 files changed, 85 insertions, 139 deletions
diff --git a/sc/inc/column.hxx b/sc/inc/column.hxx
index 1cac0446f5f2..89624227035b 100644
--- a/sc/inc/column.hxx
+++ b/sc/inc/column.hxx
@@ -373,9 +373,12 @@ public:
void PreprocessRangeNameUpdate(
sc::EndListeningContext& rEndListenCxt, sc::CompileFormulaContext& rCompileCxt );
- void PostprocessRangeNameUpdate(
+ void CompileHybridFormula(
sc::StartListeningContext& rStartListenCxt, sc::CompileFormulaContext& rCompileCxt );
+ void PreprocessDBDataUpdate(
+ sc::EndListeningContext& rEndListenCxt, sc::CompileFormulaContext& rCompileCxt );
+
const SfxPoolItem* GetAttr( SCROW nRow, sal_uInt16 nWhich ) const;
const ScPatternAttr* GetPattern( SCROW nRow ) const;
const ScPatternAttr* GetMostUsedPattern( SCROW nStartRow, SCROW nEndRow ) const;
@@ -480,7 +483,6 @@ public:
void CollectListeners( std::vector<SvtListener*>& rListeners, SCROW nRow1, SCROW nRow2 );
void CompileDBFormula( sc::CompileFormulaContext& rCxt );
- void CompileDBFormula( sc::CompileFormulaContext& rCxt, bool bCreateFormulaString );
void CompileColRowNameFormula( sc::CompileFormulaContext& rCxt );
sal_Int32 GetMaxStringLen( SCROW nRowStart, SCROW nRowEnd, rtl_TextEncoding eCharSet ) const;
diff --git a/sc/inc/document.hxx b/sc/inc/document.hxx
index c094ee74725e..1857e075c32e 100644
--- a/sc/inc/document.hxx
+++ b/sc/inc/document.hxx
@@ -518,11 +518,8 @@ public:
* Call this immediately before updating all named ranges.
*/
SC_DLLPUBLIC void PreprocessRangeNameUpdate();
-
- /**
- * Call this immediately after all named ranges have been updated.
- */
- SC_DLLPUBLIC void PostprocessRangeNameUpdate();
+ SC_DLLPUBLIC void PreprocessDBDataUpdate();
+ SC_DLLPUBLIC void CompileHybridFormula();
SCTAB GetMaxTableNumber() { return static_cast<SCTAB>(maTabs.size()) - 1; }
void SetMaxTableNumber(SCTAB nNumber) { nMaxTableNumber = nNumber; }
@@ -1967,7 +1964,6 @@ public:
void StartTrackTimer();
void CompileDBFormula();
- void CompileDBFormula( bool bCreateFormulaString );
void CompileColRowNameFormula();
/** Maximum string length of a column, e.g. for dBase export.
diff --git a/sc/inc/formulacell.hxx b/sc/inc/formulacell.hxx
index 9c7cd109cb3a..0a43f49258b5 100644
--- a/sc/inc/formulacell.hxx
+++ b/sc/inc/formulacell.hxx
@@ -310,7 +310,6 @@ public:
bool IsRunning() const;
void SetRunning( bool bVal );
void CompileDBFormula( sc::CompileFormulaContext& rCxt );
- void CompileDBFormula( sc::CompileFormulaContext& rCxt, bool bCreateFormulaString );
void CompileColRowNameFormula( sc::CompileFormulaContext& rCxt );
ScFormulaCell* GetPrevious() const;
ScFormulaCell* GetNext() const;
diff --git a/sc/inc/table.hxx b/sc/inc/table.hxx
index 2d00ebd9f843..ab354005cbc4 100644
--- a/sc/inc/table.hxx
+++ b/sc/inc/table.hxx
@@ -864,9 +864,12 @@ public:
void PreprocessRangeNameUpdate(
sc::EndListeningContext& rEndListenCxt, sc::CompileFormulaContext& rCompileCxt );
- void PostprocessRangeNameUpdate(
+ void CompileHybridFormula(
sc::StartListeningContext& rStartListenCxt, sc::CompileFormulaContext& rCompileCxt );
+ void PreprocessDBDataUpdate(
+ sc::EndListeningContext& rEndListenCxt, sc::CompileFormulaContext& rCompileCxt );
+
ScConditionalFormatList* GetCondFormList();
const ScConditionalFormatList* GetCondFormList() const;
void SetCondFormList( ScConditionalFormatList* pList );
@@ -1029,7 +1032,6 @@ private:
bool GetNextMarkedCell( SCCOL& rCol, SCROW& rRow, const ScMarkData& rMark ) const;
bool TestTabRefAbs(SCTAB nTable) const;
void CompileDBFormula( sc::CompileFormulaContext& rCxt );
- void CompileDBFormula( sc::CompileFormulaContext& rCxt, bool bCreateFormulaString );
void CompileColRowNameFormula( sc::CompileFormulaContext& rCxt );
void RebuildFormulaGroups();
diff --git a/sc/source/core/data/column2.cxx b/sc/source/core/data/column2.cxx
index 63c5e0f02fb1..a8ba0633f1f5 100644
--- a/sc/source/core/data/column2.cxx
+++ b/sc/source/core/data/column2.cxx
@@ -3218,21 +3218,6 @@ public:
}
};
-class CompileDBFormula2Handler
-{
- sc::CompileFormulaContext& mrCxt;
- bool mbCreateFormulaString;
-
-public:
- CompileDBFormula2Handler( sc::CompileFormulaContext& rCxt, bool bCreateFormulaString ) :
- mrCxt(rCxt), mbCreateFormulaString(bCreateFormulaString) {}
-
- void operator() (size_t, ScFormulaCell* p)
- {
- p->CompileDBFormula(mrCxt, mbCreateFormulaString);
- }
-};
-
struct CompileColRowNameFormulaHandler
{
sc::CompileFormulaContext& mrCxt;
@@ -3254,13 +3239,6 @@ void ScColumn::CompileDBFormula( sc::CompileFormulaContext& rCxt )
RegroupFormulaCells();
}
-void ScColumn::CompileDBFormula( sc::CompileFormulaContext& rCxt, bool bCreateFormulaString )
-{
- CompileDBFormula2Handler aFunc(rCxt, bCreateFormulaString);
- sc::ProcessFormula(maCells, aFunc);
- RegroupFormulaCells();
-}
-
void ScColumn::CompileColRowNameFormula( sc::CompileFormulaContext& rCxt )
{
CompileColRowNameFormulaHandler aFunc(rCxt);
diff --git a/sc/source/core/data/column4.cxx b/sc/source/core/data/column4.cxx
index 9a3ef12e6db3..bf3b8178b475 100644
--- a/sc/source/core/data/column4.cxx
+++ b/sc/source/core/data/column4.cxx
@@ -135,15 +135,19 @@ void ScColumn::DeleteBeforeCopyFromClip( sc::CopyFromClipContext& rCxt, const Sc
namespace {
-class PreRangeNameUpdateHandler
+class RecompileByOpcodeHandler
{
ScDocument* mpDoc;
+ const boost::unordered_set<OpCode>& mrOps;
sc::EndListeningContext& mrEndListenCxt;
sc::CompileFormulaContext& mrCompileFormulaCxt;
public:
- PreRangeNameUpdateHandler( ScDocument* pDoc, sc::EndListeningContext& rEndListenCxt, sc::CompileFormulaContext& rCompileCxt ) :
+ RecompileByOpcodeHandler(
+ ScDocument* pDoc, const boost::unordered_set<OpCode>& rOps,
+ sc::EndListeningContext& rEndListenCxt, sc::CompileFormulaContext& rCompileCxt ) :
mpDoc(pDoc),
+ mrOps(rOps),
mrEndListenCxt(rEndListenCxt),
mrCompileFormulaCxt(rCompileCxt) {}
@@ -163,12 +167,7 @@ public:
pTop = rEntry.mpCell;
ScTokenArray* pCode = pTop->GetCode();
-
- boost::unordered_set<OpCode> aOps;
- aOps.insert(ocBad);
- aOps.insert(ocColRowName);
- aOps.insert(ocName);
- bool bRecompile = pCode->HasOpCodes(aOps);
+ bool bRecompile = pCode->HasOpCodes(mrOps);
if (bRecompile)
{
@@ -204,14 +203,14 @@ public:
}
};
-class PostRangeNameUpdateHandler
+class CompileHybridFormulaHandler
{
ScDocument* mpDoc;
sc::StartListeningContext& mrStartListenCxt;
sc::CompileFormulaContext& mrCompileFormulaCxt;
public:
- PostRangeNameUpdateHandler( ScDocument* pDoc, sc::StartListeningContext& rStartListenCxt, sc::CompileFormulaContext& rCompileCxt ) :
+ CompileHybridFormulaHandler( ScDocument* pDoc, sc::StartListeningContext& rStartListenCxt, sc::CompileFormulaContext& rCompileCxt ) :
mpDoc(pDoc),
mrStartListenCxt(rStartListenCxt),
mrCompileFormulaCxt(rCompileCxt) {}
@@ -277,17 +276,35 @@ void ScColumn::PreprocessRangeNameUpdate(
// Collect all formula groups.
std::vector<sc::FormulaGroupEntry> aGroups = GetFormulaGroupEntries();
- PreRangeNameUpdateHandler aFunc(pDocument, rEndListenCxt, rCompileCxt);
+ boost::unordered_set<OpCode> aOps;
+ aOps.insert(ocBad);
+ aOps.insert(ocColRowName);
+ aOps.insert(ocName);
+ RecompileByOpcodeHandler aFunc(pDocument, aOps, rEndListenCxt, rCompileCxt);
+ std::for_each(aGroups.begin(), aGroups.end(), aFunc);
+}
+
+void ScColumn::PreprocessDBDataUpdate(
+ sc::EndListeningContext& rEndListenCxt, sc::CompileFormulaContext& rCompileCxt )
+{
+ // Collect all formula groups.
+ std::vector<sc::FormulaGroupEntry> aGroups = GetFormulaGroupEntries();
+
+ boost::unordered_set<OpCode> aOps;
+ aOps.insert(ocBad);
+ aOps.insert(ocColRowName);
+ aOps.insert(ocDBArea);
+ RecompileByOpcodeHandler aFunc(pDocument, aOps, rEndListenCxt, rCompileCxt);
std::for_each(aGroups.begin(), aGroups.end(), aFunc);
}
-void ScColumn::PostprocessRangeNameUpdate(
+void ScColumn::CompileHybridFormula(
sc::StartListeningContext& rStartListenCxt, sc::CompileFormulaContext& rCompileCxt )
{
// Collect all formula groups.
std::vector<sc::FormulaGroupEntry> aGroups = GetFormulaGroupEntries();
- PostRangeNameUpdateHandler aFunc(pDocument, rStartListenCxt, rCompileCxt);
+ CompileHybridFormulaHandler aFunc(pDocument, rStartListenCxt, rCompileCxt);
std::for_each(aGroups.begin(), aGroups.end(), aFunc);
}
diff --git a/sc/source/core/data/documen4.cxx b/sc/source/core/data/documen4.cxx
index 8a4e3ec1f6d1..03ee3efb3887 100644
--- a/sc/source/core/data/documen4.cxx
+++ b/sc/source/core/data/documen4.cxx
@@ -548,17 +548,6 @@ void ScDocument::CompileDBFormula()
}
}
-void ScDocument::CompileDBFormula( bool bCreateFormulaString )
-{
- sc::CompileFormulaContext aCxt(this);
- TableContainer::iterator it = maTabs.begin();
- for (;it != maTabs.end(); ++it)
- {
- if (*it)
- (*it)->CompileDBFormula(aCxt, bCreateFormulaString);
- }
-}
-
void ScDocument::CompileColRowNameFormula()
{
sc::CompileFormulaContext aCxt(this);
diff --git a/sc/source/core/data/document10.cxx b/sc/source/core/data/document10.cxx
index cb642216dd23..26f34db6de2d 100644
--- a/sc/source/core/data/document10.cxx
+++ b/sc/source/core/data/document10.cxx
@@ -57,7 +57,20 @@ void ScDocument::PreprocessRangeNameUpdate()
}
}
-void ScDocument::PostprocessRangeNameUpdate()
+void ScDocument::PreprocessDBDataUpdate()
+{
+ sc::EndListeningContext aEndListenCxt(*this);
+ sc::CompileFormulaContext aCompileCxt(this);
+
+ TableContainer::iterator it = maTabs.begin(), itEnd = maTabs.end();
+ for (; it != itEnd; ++it)
+ {
+ ScTable* p = *it;
+ p->PreprocessDBDataUpdate(aEndListenCxt, aCompileCxt);
+ }
+}
+
+void ScDocument::CompileHybridFormula()
{
sc::StartListeningContext aStartListenCxt(*this);
sc::CompileFormulaContext aCompileCxt(this);
@@ -65,7 +78,7 @@ void ScDocument::PostprocessRangeNameUpdate()
for (; it != itEnd; ++it)
{
ScTable* p = *it;
- p->PostprocessRangeNameUpdate(aStartListenCxt, aCompileCxt);
+ p->CompileHybridFormula(aStartListenCxt, aCompileCxt);
}
}
diff --git a/sc/source/core/data/formulacell.cxx b/sc/source/core/data/formulacell.cxx
index 18194e17a248..bbaff4f7756a 100644
--- a/sc/source/core/data/formulacell.cxx
+++ b/sc/source/core/data/formulacell.cxx
@@ -3496,57 +3496,6 @@ void ScFormulaCell::CompileDBFormula( sc::CompileFormulaContext& rCxt )
}
}
-void ScFormulaCell::CompileDBFormula( sc::CompileFormulaContext& rCxt, bool bCreateFormulaString )
-{
- // Two phases must be called after each other
- // 1. Formula String with old generated names
- // 2. Formula String with new generated names
- if ( bCreateFormulaString )
- {
- bool bRecompile = false;
- pCode->Reset();
- for ( FormulaToken* p = pCode->First(); p && !bRecompile; p = pCode->Next() )
- {
- switch ( p->GetOpCode() )
- {
- case ocBad: // DB Area eventually goes bad
- case ocColRowName: // in case of the same names
- case ocDBArea: // DB Area
- bRecompile = true;
- break;
- case ocName:
- if ( p->GetIndex() >= SC_START_INDEX_DB_COLL )
- bRecompile = true; // DB Area
- break;
- default:
- ; // nothing
- }
- }
- if ( bRecompile )
- {
- OUString aFormula = GetFormula(rCxt);
- if ( GetMatrixFlag() != MM_NONE && !aFormula.isEmpty() )
- {
- if ( aFormula[ aFormula.getLength()-1 ] == '}' )
- aFormula = aFormula.copy( 0, aFormula.getLength()-1 );
- if ( aFormula[0] == '{' )
- aFormula = aFormula.copy( 1 );
- }
- EndListeningTo( pDocument );
- pDocument->RemoveFromFormulaTree( this );
- pCode->Clear();
- SetHybridFormula(aFormula, rCxt.getGrammar());
- }
- }
- else if ( !pCode->GetLen() && !aResult.GetHybridFormula().isEmpty() )
- {
- rCxt.setGrammar(eTempGrammar);
- Compile(rCxt, aResult.GetHybridFormula(), false);
- aResult.SetToken( NULL);
- SetDirty();
- }
-}
-
void ScFormulaCell::CompileColRowNameFormula( sc::CompileFormulaContext& rCxt )
{
pCode->Reset();
diff --git a/sc/source/core/data/table4.cxx b/sc/source/core/data/table4.cxx
index bfefd3066aaa..aef4726f6afb 100644
--- a/sc/source/core/data/table4.cxx
+++ b/sc/source/core/data/table4.cxx
@@ -2062,12 +2062,6 @@ void ScTable::CompileDBFormula( sc::CompileFormulaContext& rCxt )
aCol[i].CompileDBFormula(rCxt);
}
-void ScTable::CompileDBFormula( sc::CompileFormulaContext& rCxt, bool bCreateFormulaString )
-{
- for (SCCOL i = 0; i <= MAXCOL; ++i)
- aCol[i].CompileDBFormula(rCxt, bCreateFormulaString);
-}
-
void ScTable::CompileColRowNameFormula( sc::CompileFormulaContext& rCxt )
{
for (SCCOL i = 0; i <= MAXCOL; ++i)
diff --git a/sc/source/core/data/table7.cxx b/sc/source/core/data/table7.cxx
index b42761722e20..1ede729829dc 100644
--- a/sc/source/core/data/table7.cxx
+++ b/sc/source/core/data/table7.cxx
@@ -50,11 +50,18 @@ void ScTable::PreprocessRangeNameUpdate(
aCol[i].PreprocessRangeNameUpdate(rEndListenCxt, rCompileCxt);
}
-void ScTable::PostprocessRangeNameUpdate(
+void ScTable::PreprocessDBDataUpdate(
+ sc::EndListeningContext& rEndListenCxt, sc::CompileFormulaContext& rCompileCxt )
+{
+ for (SCCOL i = 0; i <= MAXCOL; ++i)
+ aCol[i].PreprocessDBDataUpdate(rEndListenCxt, rCompileCxt);
+}
+
+void ScTable::CompileHybridFormula(
sc::StartListeningContext& rStartListenCxt, sc::CompileFormulaContext& rCompileCxt )
{
for (SCCOL i = 0; i <= MAXCOL; ++i)
- aCol[i].PostprocessRangeNameUpdate(rStartListenCxt, rCompileCxt);
+ aCol[i].CompileHybridFormula(rStartListenCxt, rCompileCxt);
}
void ScTable::UpdateScriptTypes( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2 )
diff --git a/sc/source/ui/docshell/dbdocfun.cxx b/sc/source/ui/docshell/dbdocfun.cxx
index 900bf3e27fd8..29d2da172569 100644
--- a/sc/source/ui/docshell/dbdocfun.cxx
+++ b/sc/source/ui/docshell/dbdocfun.cxx
@@ -79,7 +79,7 @@ bool ScDBDocFunc::AddDBRange( const OUString& rName, const ScRange& rRange, sal_
bool bCompile = !pDoc->IsImportingXML();
bool bOk;
if ( bCompile )
- pDoc->CompileDBFormula( sal_True ); // CreateFormulaString
+ pDoc->PreprocessDBDataUpdate();
if ( rName == STR_DB_LOCAL_NONAME )
{
pDoc->SetAnonymousDBData(rRange.aStart.Tab() , pNew);
@@ -90,7 +90,7 @@ bool ScDBDocFunc::AddDBRange( const OUString& rName, const ScRange& rRange, sal_
bOk = pDocColl->getNamedDBs().insert(pNew);
}
if ( bCompile )
- pDoc->CompileDBFormula( false ); // CompileFormulaString
+ pDoc->CompileHybridFormula();
if (!bOk)
{
@@ -128,9 +128,9 @@ bool ScDBDocFunc::DeleteDBRange(const OUString& rName)
if (bUndo)
pUndoColl = new ScDBCollection( *pDocColl );
- pDoc->CompileDBFormula( true ); // CreateFormulaString
+ pDoc->PreprocessDBDataUpdate();
rDBs.erase(*p);
- pDoc->CompileDBFormula( false ); // CompileFormulaString
+ pDoc->CompileHybridFormula();
if (bUndo)
{
@@ -164,13 +164,13 @@ bool ScDBDocFunc::RenameDBRange( const OUString& rOld, const OUString& rNew )
ScDBCollection* pUndoColl = new ScDBCollection( *pDocColl );
- pDoc->CompileDBFormula(true); // CreateFormulaString
+ pDoc->PreprocessDBDataUpdate();
rDBs.erase(*pOld);
bool bInserted = rDBs.insert(pNewData);
if (!bInserted) // Fehler -> alten Zustand wiederherstellen
pDoc->SetDBCollection(pUndoColl); // gehoert dann dem Dokument
- //
- pDoc->CompileDBFormula( false ); // CompileFormulaString
+
+ pDoc->CompileHybridFormula();
if (bInserted) // Einfuegen hat geklappt
{
diff --git a/sc/source/ui/docshell/docfunc.cxx b/sc/source/ui/docshell/docfunc.cxx
index 1454b89770ea..8958e42dd71f 100644
--- a/sc/source/ui/docshell/docfunc.cxx
+++ b/sc/source/ui/docshell/docfunc.cxx
@@ -4871,7 +4871,7 @@ bool ScDocFunc::SetNewRangeNames( ScRangeName* pNewRanges, bool bModifyDoc, SCTA
else
pDoc->SetRangeName( pNewRanges ); // takes ownership
if ( bCompile )
- pDoc->PostprocessRangeNameUpdate();
+ pDoc->CompileHybridFormula();
if (bModifyDoc)
{
@@ -4897,7 +4897,7 @@ void ScDocFunc::ModifyAllRangeNames( const boost::ptr_map<OUString, ScRangeName>
pDoc->PreprocessRangeNameUpdate();
pDoc->SetAllRangeNames(rRangeMap);
- pDoc->PostprocessRangeNameUpdate();
+ pDoc->CompileHybridFormula();
aModificator.SetDocumentModified();
SFX_APP()->Broadcast(SfxSimpleHint(SC_HINT_AREAS_CHANGED));
diff --git a/sc/source/ui/docshell/docsh5.cxx b/sc/source/ui/docshell/docsh5.cxx
index ee63dcf16d6a..3c65fc018049 100644
--- a/sc/source/ui/docshell/docsh5.cxx
+++ b/sc/source/ui/docshell/docsh5.cxx
@@ -256,7 +256,7 @@ ScDBData* ScDocShell::GetDBData( const ScRange& rMarked, ScGetDBMode eMode, ScGe
OUString aNewName;
if (eMode==SC_DB_IMPORT)
{
- aDocument.CompileDBFormula( sal_True ); // CreateFormulaString
+ aDocument.PreprocessDBDataUpdate();
pUndoColl = new ScDBCollection( *pColl ); // Undo fuer Import1-Bereich
OUString aImport = ScGlobal::GetRscString( STR_DBNAME_IMPORT );
@@ -289,7 +289,7 @@ ScDBData* ScDocShell::GetDBData( const ScRange& rMarked, ScGetDBMode eMode, ScGe
if ( pUndoColl )
{
- aDocument.CompileDBFormula( false ); // CompileFormulaString
+ aDocument.CompileHybridFormula();
ScDBCollection* pRedoColl = new ScDBCollection( *pColl );
GetUndoManager()->AddUndoAction( new ScUndoDBData( this, pUndoColl, pRedoColl ) );
diff --git a/sc/source/ui/undo/undocell.cxx b/sc/source/ui/undo/undocell.cxx
index 02f67a9c8c44..03f22882d7cb 100644
--- a/sc/source/ui/undo/undocell.cxx
+++ b/sc/source/ui/undo/undocell.cxx
@@ -1059,7 +1059,7 @@ void ScUndoRangeNames::DoChange( sal_Bool bUndo )
pDoc->SetRangeName( new ScRangeName( *pNewRanges ) );
}
- pDoc->PostprocessRangeNameUpdate();
+ pDoc->CompileHybridFormula();
SFX_APP()->Broadcast( SfxSimpleHint( SC_HINT_AREAS_CHANGED ) );
}
diff --git a/sc/source/ui/undo/undodat.cxx b/sc/source/ui/undo/undodat.cxx
index 57d08756b79e..32af832eb50a 100644
--- a/sc/source/ui/undo/undodat.cxx
+++ b/sc/source/ui/undo/undodat.cxx
@@ -1133,9 +1133,9 @@ void ScUndoDBData::Undo()
sal_Bool bOldAutoCalc = pDoc->GetAutoCalc();
pDoc->SetAutoCalc( false ); // Avoid unnecessary calculations
- pDoc->CompileDBFormula( sal_True ); // CreateFormulaString
+ pDoc->PreprocessDBDataUpdate();
pDoc->SetDBCollection( new ScDBCollection(*pUndoColl), sal_True );
- pDoc->CompileDBFormula( false ); // CompileFormulaString
+ pDoc->CompileHybridFormula();
pDoc->SetAutoCalc( bOldAutoCalc );
SFX_APP()->Broadcast( SfxSimpleHint( SC_HINT_DBAREAS_CHANGED ) );
@@ -1151,9 +1151,9 @@ void ScUndoDBData::Redo()
sal_Bool bOldAutoCalc = pDoc->GetAutoCalc();
pDoc->SetAutoCalc( false ); // Avoid unnecessary calculations
- pDoc->CompileDBFormula( sal_True ); // CreateFormulaString
+ pDoc->PreprocessDBDataUpdate();
pDoc->SetDBCollection( new ScDBCollection(*pRedoColl), sal_True );
- pDoc->CompileDBFormula( false ); // CompileFormulaString
+ pDoc->CompileHybridFormula();
pDoc->SetAutoCalc( bOldAutoCalc );
SFX_APP()->Broadcast( SfxSimpleHint( SC_HINT_DBAREAS_CHANGED ) );
diff --git a/sc/source/ui/undo/undorangename.cxx b/sc/source/ui/undo/undorangename.cxx
index 172f802dcbd0..9a92b77c4edf 100644
--- a/sc/source/ui/undo/undorangename.cxx
+++ b/sc/source/ui/undo/undorangename.cxx
@@ -79,7 +79,7 @@ void ScUndoAllRangeNames::DoChange(const boost::ptr_map<OUString, ScRangeName>&
rDoc.PreprocessRangeNameUpdate();
rDoc.SetAllRangeNames(rNames);
- rDoc.PostprocessRangeNameUpdate();
+ rDoc.CompileHybridFormula();
SFX_APP()->Broadcast(SfxSimpleHint(SC_HINT_AREAS_CHANGED));
}
diff --git a/sc/source/ui/unoobj/nameuno.cxx b/sc/source/ui/unoobj/nameuno.cxx
index 87ed766967e8..3c3273cdd75d 100644
--- a/sc/source/ui/unoobj/nameuno.cxx
+++ b/sc/source/ui/unoobj/nameuno.cxx
@@ -751,7 +751,7 @@ void ScNamedRangesObj::lock()
/** called from the XActionLockable interface methods on final unlock */
void ScNamedRangesObj::unlock()
{
- pDocShell->GetDocument()->PostprocessRangeNameUpdate();
+ pDocShell->GetDocument()->CompileHybridFormula();
}
// document::XActionLockable
diff --git a/sc/source/ui/view/dbfunc.cxx b/sc/source/ui/view/dbfunc.cxx
index e5ebd37a6e9c..1cd3223a85cc 100644
--- a/sc/source/ui/view/dbfunc.cxx
+++ b/sc/source/ui/view/dbfunc.cxx
@@ -224,9 +224,9 @@ void ScDBFunc::NotifyCloseDbNameDlg( const ScDBCollection& rNewColl, const std::
// register target in SBA no longer necessary
- pDoc->CompileDBFormula( sal_True ); // CreateFormulaString
+ pDoc->PreprocessDBDataUpdate();
pDoc->SetDBCollection( new ScDBCollection( rNewColl ) );
- pDoc->CompileDBFormula( false ); // CompileFormulaString
+ pDoc->CompileHybridFormula();
pOldColl = NULL;
pDocShell->PostPaint(ScRange(0, 0, 0, MAXCOL, MAXROW, MAXTAB), PAINT_GRID);
aModificator.SetDocumentModified();
diff --git a/sc/source/ui/view/viewfunc.cxx b/sc/source/ui/view/viewfunc.cxx
index e308caddf3ad..13a785b5971a 100644
--- a/sc/source/ui/view/viewfunc.cxx
+++ b/sc/source/ui/view/viewfunc.cxx
@@ -2805,7 +2805,7 @@ bool ScViewFunc::InsertName( const OUString& rName, const OUString& rSymbol,
bOk = true;
pNewEntry = NULL; // never delete, insert took ownership
- pDoc->PostprocessRangeNameUpdate();
+ pDoc->CompileHybridFormula();
aModificator.SetDocumentModified();
SFX_APP()->Broadcast( SfxSimpleHint( SC_HINT_AREAS_CHANGED ) );