summaryrefslogtreecommitdiff
path: root/editeng
diff options
context:
space:
mode:
authorAugust Sodora <augsod@gmail.com>2012-01-14 15:11:10 -0500
committerAugust Sodora <augsod@gmail.com>2012-01-14 15:13:05 -0500
commit3447718347c6ffe4135fb3d3faeff367401e25f4 (patch)
tree65f4a86a9eab5968a6d7d9df6bfc3179397866b0 /editeng
parent440a7c9b92822206db52861dc79d053450004a9f (diff)
SV_DECL_PTRARR_DEL->std::vector
Diffstat (limited to 'editeng')
-rw-r--r--editeng/source/editeng/impedit.hxx6
-rw-r--r--editeng/source/editeng/impedit2.cxx16
-rw-r--r--editeng/source/outliner/outleeng.hxx3
-rw-r--r--editeng/source/outliner/outliner.cxx18
4 files changed, 12 insertions, 31 deletions
diff --git a/editeng/source/editeng/impedit.hxx b/editeng/source/editeng/impedit.hxx
index c05b83eedf8c..39107a43fc62 100644
--- a/editeng/source/editeng/impedit.hxx
+++ b/editeng/source/editeng/impedit.hxx
@@ -78,10 +78,6 @@ DBG_NAMEEX( EditEngine )
#define LINE_SEP 0x0A
-typedef EENotify* EENotifyPtr;
-SV_DECL_PTRARR_DEL( NotifyList, EENotifyPtr, 1, 1 ) // IMPL is in outliner.cxx, move to EE later and share declaration, or use BlockNotifications from EE directly
-
-
class EditView;
class EditEngine;
class SvxFontTable;
@@ -440,7 +436,7 @@ private:
ImplIMEInfos* mpIMEInfos;
- NotifyList aNotifyCache;
+ std::vector<EENotify> aNotifyCache;
XubString aWordDelimiters;
XubString aGroupChars;
diff --git a/editeng/source/editeng/impedit2.cxx b/editeng/source/editeng/impedit2.cxx
index b344b3a8157c..a53c670fa85a 100644
--- a/editeng/source/editeng/impedit2.cxx
+++ b/editeng/source/editeng/impedit2.cxx
@@ -4383,14 +4383,9 @@ sal_Bool ImpEditEngine::DoVisualCursorTraveling( const ContentNode* )
void ImpEditEngine::CallNotify( EENotify& rNotify )
{
if ( !nBlockNotifications )
- {
GetNotifyHdl().Call( &rNotify );
- }
else
- {
- EENotify* pNewNotify = new EENotify( rNotify );
- aNotifyCache.Insert( pNewNotify, aNotifyCache.Count() );
- }
+ aNotifyCache.push_back(rNotify);
}
void ImpEditEngine::EnterBlockNotifications()
@@ -4416,13 +4411,12 @@ void ImpEditEngine::LeaveBlockNotifications()
if ( !nBlockNotifications )
{
// Call blocked notify events...
- while ( aNotifyCache.Count() )
+ while(!aNotifyCache.empty())
{
- EENotify* pNotify = aNotifyCache[0];
+ EENotify aNotify(aNotifyCache[0]);
// Remove from list before calling, maybe we enter LeaveBlockNotifications while calling the handler...
- aNotifyCache.Remove( 0 );
- GetNotifyHdl().Call( pNotify );
- delete pNotify;
+ aNotifyCache.erase(aNotifyCache.begin());
+ GetNotifyHdl().Call( &aNotify );
}
EENotify aNotify( EE_NOTIFY_BLOCKNOTIFICATION_END );
diff --git a/editeng/source/outliner/outleeng.hxx b/editeng/source/outliner/outleeng.hxx
index 59124b83042d..14051c3e5e10 100644
--- a/editeng/source/outliner/outleeng.hxx
+++ b/editeng/source/outliner/outleeng.hxx
@@ -31,8 +31,7 @@
#include <editeng/outliner.hxx>
#include <editeng/editeng.hxx>
-typedef EENotify* EENotifyPtr;
-SV_DECL_PTRARR_DEL( NotifyList, EENotifyPtr, 1, 1 )
+typedef std::vector<EENotify> NotifyList;
class OutlinerEditEng : public EditEngine
{
diff --git a/editeng/source/outliner/outliner.cxx b/editeng/source/outliner/outliner.cxx
index 37a569e5948d..f62cec68311b 100644
--- a/editeng/source/outliner/outliner.cxx
+++ b/editeng/source/outliner/outliner.cxx
@@ -2039,8 +2039,6 @@ void Outliner::SetLevelDependendStyleSheet( sal_uInt16 nPara )
pEditEngine->SetParaAttribs( nPara, aOldAttrs );
}
-SV_IMPL_PTRARR( NotifyList, EENotifyPtr );
-
void Outliner::ImplBlockInsertionCallbacks( sal_Bool b )
{
if ( b )
@@ -2054,13 +2052,12 @@ void Outliner::ImplBlockInsertionCallbacks( sal_Bool b )
if ( !bBlockInsCallback )
{
// Call blocked notify events...
- while ( pEditEngine->aNotifyCache.Count() )
+ while(!pEditEngine->aNotifyCache.empty())
{
- EENotify* pNotify = pEditEngine->aNotifyCache[0];
+ EENotify aNotify(pEditEngine->aNotifyCache.front());
// Remove from list before calling, maybe we enter LeaveBlockNotifications while calling the handler...
- pEditEngine->aNotifyCache.Remove( 0 );
- pEditEngine->aOutlinerNotifyHdl.Call( pNotify );
- delete pNotify;
+ pEditEngine->aNotifyCache.erase(pEditEngine->aNotifyCache.begin());
+ pEditEngine->aOutlinerNotifyHdl.Call( &aNotify );
}
}
}
@@ -2069,14 +2066,9 @@ void Outliner::ImplBlockInsertionCallbacks( sal_Bool b )
IMPL_LINK( Outliner, EditEngineNotifyHdl, EENotify*, pNotify )
{
if ( !bBlockInsCallback )
- {
pEditEngine->aOutlinerNotifyHdl.Call( pNotify );
- }
else
- {
- EENotify* pNewNotify = new EENotify( *pNotify );
- pEditEngine->aNotifyCache.Insert( pNewNotify, pEditEngine->aNotifyCache.Count() );
- }
+ pEditEngine->aNotifyCache.push_back(*pNotify);
return 0;
}