summaryrefslogtreecommitdiff
path: root/basic/source/inc
diff options
context:
space:
mode:
authorArnaud Versini <arnaud.versini@gmail.com>2016-03-13 18:25:00 +0100
committerArnaud Versini <arnaud.versini@libreoffice.org>2016-03-20 12:56:04 +0000
commitbb3930bb91c776e6853ee7bcd4db26b1bcc47348 (patch)
treeea5f1b82c7d108565fadef80d76f4727d8db20b3 /basic/source/inc
parente8aea8fd732763f0b808c88debcc99522672fbd8 (diff)
BASIC : Use std::vector in SbiRuntime to save references
Change-Id: Ica819538b39e58416825e651d057620a66f731cd Reviewed-on: https://gerrit.libreoffice.org/23193 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Arnaud Versini <arnaud.versini@libreoffice.org>
Diffstat (limited to 'basic/source/inc')
-rw-r--r--basic/source/inc/runtime.hxx35
1 files changed, 1 insertions, 34 deletions
diff --git a/basic/source/inc/runtime.hxx b/basic/source/inc/runtime.hxx
index 94e2aeb72943..b7374eaa5f99 100644
--- a/basic/source/inc/runtime.hxx
+++ b/basic/source/inc/runtime.hxx
@@ -210,16 +210,6 @@ public:
LanguageType* peFormatterLangType=nullptr, DateFormat* peFormatterDateFormat=nullptr );
};
-// chainable items to keep references temporary
-struct RefSaveItem
-{
- SbxVariableRef xRef;
- RefSaveItem* pNext;
-
- RefSaveItem() { pNext = nullptr; }
-};
-
-
// There's one instance of this class for every executed sub-program.
// This instance is the heart of the BASIC-machine and contains only local data.
@@ -274,30 +264,7 @@ class SbiRuntime
sal_uInt16 nOps; // opcode counter
sal_uInt32 m_nLastTime;
- RefSaveItem* pRefSaveList; // #74254 save temporary references
- RefSaveItem* pItemStoreList; // keep unused items
- void SaveRef( SbxVariable* pVar )
- {
- RefSaveItem* pItem = pItemStoreList;
- if( pItem )
- pItemStoreList = pItem->pNext;
- else
- pItem = new RefSaveItem();
- pItem->pNext = pRefSaveList;
- pItem->xRef = pVar;
- pRefSaveList = pItem;
- }
- void ClearRefs()
- {
- while( pRefSaveList )
- {
- RefSaveItem* pToClearItem = pRefSaveList;
- pRefSaveList = pToClearItem->pNext;
- pToClearItem->xRef = nullptr;
- pToClearItem->pNext = pItemStoreList;
- pItemStoreList = pToClearItem;
- }
- }
+ std::vector<SbxVariableRef> aRefSaved; // #74254 save temporary references
SbxVariable* FindElement
( SbxObject* pObj, sal_uInt32 nOp1, sal_uInt32 nOp2, SbError, bool bLocal, bool bStatic = false );