summaryrefslogtreecommitdiff
path: root/editeng/source/editeng/impedit2.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'editeng/source/editeng/impedit2.cxx')
-rw-r--r--editeng/source/editeng/impedit2.cxx62
1 files changed, 16 insertions, 46 deletions
diff --git a/editeng/source/editeng/impedit2.cxx b/editeng/source/editeng/impedit2.cxx
index 603290f9609b..f85c9138ef44 100644
--- a/editeng/source/editeng/impedit2.cxx
+++ b/editeng/source/editeng/impedit2.cxx
@@ -121,7 +121,6 @@ ImpEditEngine::ImpEditEngine( EditEngine* pEE, SfxItemPool* pItemPool ) :
nCurTextHeight = 0;
nCurTextHeightNTP = 0;
- nBlockNotifications = 0;
nBigTextObjectStart = 20;
nStretchX = 100;
@@ -175,6 +174,18 @@ void ImpEditEngine::Dispose()
pSharedVCL.reset();
}
+void ImpEditEngine::SendNotifications()
+{
+ while(!aNotifyCache.empty())
+ {
+ GetNotifyHdl().Call( aNotifyCache[0] );
+ aNotifyCache.erase(aNotifyCache.begin());
+ }
+
+ EENotify aNotify(EE_NOTIFY_PROCESSNOTIFICATIONS);
+ GetNotifyHdl().Call(aNotify);
+}
+
ImpEditEngine::~ImpEditEngine()
{
aStatusTimer.Stop();
@@ -625,9 +636,7 @@ bool ImpEditEngine::MouseMove( const MouseEvent& rMEvt, EditView* pView )
EditPaM ImpEditEngine::InsertText(const EditSelection& aSel, const OUString& rStr)
{
- EnterBlockNotifications();
EditPaM aPaM = ImpInsertText( aSel, rStr );
- LeaveBlockNotifications();
return aPaM;
}
@@ -732,7 +741,7 @@ void ImpEditEngine::TextModified()
if ( GetNotifyHdl().IsSet() )
{
EENotify aNotify( EE_NOTIFY_TEXTMODIFIED );
- CallNotify( aNotify );
+ QueueNotify( aNotify );
}
}
@@ -2200,7 +2209,7 @@ EditSelection ImpEditEngine::ImpMoveParagraphs( Range aOldPositions, sal_Int32 n
aNotify.nParagraph = nNewPos;
aNotify.nParam1 = aOldPositions.Min();
aNotify.nParam2 = aOldPositions.Max();
- CallNotify( aNotify );
+ QueueNotify( aNotify );
}
aEditDoc.SetModified( true );
@@ -3406,7 +3415,6 @@ void ImpEditEngine::UpdateSelections()
}
}
}
-
aDeletedNodes.clear();
}
@@ -4392,47 +4400,9 @@ bool ImpEditEngine::DoVisualCursorTraveling()
}
-void ImpEditEngine::CallNotify( EENotify& rNotify )
-{
- if ( !nBlockNotifications )
- GetNotifyHdl().Call( rNotify );
- else
- aNotifyCache.push_back(rNotify);
-}
-
-void ImpEditEngine::EnterBlockNotifications()
+void ImpEditEngine::QueueNotify( EENotify& rNotify )
{
- if( !nBlockNotifications )
- {
- // #109864# Send out START notification immediately, to allow
- // external, non-queued events to be captured as well from
- // client side
- EENotify aNotify( EE_NOTIFY_BLOCKNOTIFICATION_START );
- GetNotifyHdl().Call( aNotify );
- }
-
- nBlockNotifications++;
-}
-
-void ImpEditEngine::LeaveBlockNotifications()
-{
- OSL_ENSURE( nBlockNotifications, "LeaveBlockNotifications - Why?" );
-
- nBlockNotifications--;
- if ( !nBlockNotifications )
- {
- // Call blocked notify events...
- while(!aNotifyCache.empty())
- {
- EENotify aNotify(aNotifyCache[0]);
- // Remove from list before calling, maybe we enter LeaveBlockNotifications while calling the handler...
- aNotifyCache.erase(aNotifyCache.begin());
- GetNotifyHdl().Call( aNotify );
- }
-
- EENotify aNotify( EE_NOTIFY_BLOCKNOTIFICATION_END );
- GetNotifyHdl().Call( aNotify );
- }
+ aNotifyCache.push_back(rNotify);
}
IMPL_LINK_NOARG(ImpEditEngine, DocModified, LinkParamNone*, void)