Queue notifications only once

AccessibleTextHelper already queues notifications, so another queue in
editeng isn't needed.

Change-Id: I31c69a21e2379da99cba559208eb5475ddccddfe
Reviewed-on: https://gerrit.libreoffice.org/60918
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
diff --git a/editeng/source/editeng/editeng.cxx b/editeng/source/editeng/editeng.cxx
index 40a1dcb..e082645 100644
--- a/editeng/source/editeng/editeng.cxx
+++ b/editeng/source/editeng/editeng.cxx
@@ -2482,7 +2482,7 @@ void EditEngine::ParagraphInserted( sal_Int32 nPara )
    {
        EENotify aNotify( EE_NOTIFY_PARAGRAPHINSERTED );
        aNotify.nParagraph = nPara;
        pImpEditEngine->QueueNotify( aNotify );
        pImpEditEngine->GetNotifyHdl().Call( aNotify );
    }
}

@@ -2493,7 +2493,7 @@ void EditEngine::ParagraphDeleted( sal_Int32 nPara )
    {
        EENotify aNotify( EE_NOTIFY_PARAGRAPHREMOVED );
        aNotify.nParagraph = nPara;
        pImpEditEngine->QueueNotify( aNotify );
        pImpEditEngine->GetNotifyHdl().Call( aNotify );
    }
}
void EditEngine::ParagraphConnected( sal_Int32 /*nLeftParagraph*/, sal_Int32 /*nRightParagraph*/ )
@@ -2515,7 +2515,7 @@ void EditEngine::ParagraphHeightChanged( sal_Int32 nPara )
    {
        EENotify aNotify( EE_NOTIFY_TextHeightChanged );
        aNotify.nParagraph = nPara;
        pImpEditEngine->QueueNotify( aNotify );
        pImpEditEngine->GetNotifyHdl().Call( aNotify );
    }
}

diff --git a/editeng/source/editeng/impedit.cxx b/editeng/source/editeng/impedit.cxx
index 7d14198..042b0a3 100644
--- a/editeng/source/editeng/impedit.cxx
+++ b/editeng/source/editeng/impedit.cxx
@@ -148,10 +148,13 @@ void ImpEditView::SetEditSelection( const EditSelection& rEditSelection )
            eNotifyType = EE_NOTIFY_TEXTVIEWSELECTIONCHANGED;
        }
        EENotify aNotify( eNotifyType );
        pEditEngine->pImpEditEngine->QueueNotify( aNotify );
        pEditEngine->pImpEditEngine->GetNotifyHdl().Call( aNotify );
    }
    if(pEditEngine->pImpEditEngine->IsFormatted())
        pEditEngine->pImpEditEngine->SendNotifications();
    {
        EENotify aNotify(EE_NOTIFY_PROCESSNOTIFICATIONS);
        pEditEngine->pImpEditEngine->GetNotifyHdl().Call(aNotify);
    }
}

/// Translate absolute <-> relative twips: LOK wants absolute coordinates as output and gives absolute coordinates as input.
@@ -1274,7 +1277,7 @@ Pair ImpEditView::Scroll( long ndX, long ndY, ScrollRangeCheck nRangeCheck )
        if ( pEditEngine->pImpEditEngine->GetNotifyHdl().IsSet() )
        {
            EENotify aNotify( EE_NOTIFY_TEXTVIEWSCROLLED );
            pEditEngine->pImpEditEngine->QueueNotify( aNotify );
            pEditEngine->pImpEditEngine->GetNotifyHdl().Call( aNotify );
        }
    }

diff --git a/editeng/source/editeng/impedit.hxx b/editeng/source/editeng/impedit.hxx
index 5945e9d..16deb64 100644
--- a/editeng/source/editeng/impedit.hxx
+++ b/editeng/source/editeng/impedit.hxx
@@ -455,8 +455,6 @@ private:

    std::unique_ptr<ImplIMEInfos> mpIMEInfos;

    std::vector<EENotify> aNotifyCache;

    OUString            aWordDelimiters;

    EditSelFunctionSet  aSelFuncSet;
@@ -915,9 +913,6 @@ public:
    void                CallStatusHdl();
    void                DelayedCallStatusHdl()  { aStatusTimer.Start(); }

    void                QueueNotify( EENotify& rNotify );
    void                SendNotifications();

    void                UndoActionStart( sal_uInt16 nId );
    void                UndoActionStart( sal_uInt16 nId, const ESelection& rSel );
    void                UndoActionEnd();
diff --git a/editeng/source/editeng/impedit2.cxx b/editeng/source/editeng/impedit2.cxx
index f85c913..9b62005 100644
--- a/editeng/source/editeng/impedit2.cxx
+++ b/editeng/source/editeng/impedit2.cxx
@@ -174,18 +174,6 @@ 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();
@@ -741,7 +729,7 @@ void ImpEditEngine::TextModified()
    if ( GetNotifyHdl().IsSet() )
    {
        EENotify aNotify( EE_NOTIFY_TEXTMODIFIED );
        QueueNotify( aNotify );
        GetNotifyHdl().Call( aNotify );
    }
}

@@ -2209,7 +2197,7 @@ EditSelection ImpEditEngine::ImpMoveParagraphs( Range aOldPositions, sal_Int32 n
        aNotify.nParagraph = nNewPos;
        aNotify.nParam1 = aOldPositions.Min();
        aNotify.nParam2 = aOldPositions.Max();
        QueueNotify( aNotify );
        GetNotifyHdl().Call( aNotify );
    }

    aEditDoc.SetModified( true );
@@ -4399,12 +4387,6 @@ bool ImpEditEngine::DoVisualCursorTraveling()
    return IsVisualCursorTravelingEnabled();
}


void ImpEditEngine::QueueNotify( EENotify& rNotify )
{
    aNotifyCache.push_back(rNotify);
}

IMPL_LINK_NOARG(ImpEditEngine, DocModified, LinkParamNone*, void)
{
    aModifyHdl.Call( nullptr /*GetEditEnginePtr()*/ ); // NULL, because also used for Outliner
diff --git a/editeng/source/editeng/impedit3.cxx b/editeng/source/editeng/impedit3.cxx
index 320707e..6d2a129 100644
--- a/editeng/source/editeng/impedit3.cxx
+++ b/editeng/source/editeng/impedit3.cxx
@@ -4238,7 +4238,8 @@ void ImpEditEngine::FormatAndUpdate( EditView* pCurView, bool bCalledFromUndo )
        UpdateViews( pCurView );
    }

    SendNotifications();
    EENotify aNotify(EE_NOTIFY_PROCESSNOTIFICATIONS);
    GetNotifyHdl().Call(aNotify);
}

void ImpEditEngine::SetFlatMode( bool bFlat )