diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2016-06-17 11:45:02 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2016-06-17 12:47:46 +0000 |
commit | 5b5706f41f97998785e1e7ad356580772da80c42 (patch) | |
tree | 90fbc80386ed79b12bd5fce299c7a139384d9e0b /editeng | |
parent | Revert "fdo#38913: Prevent invalid parameter handler crashes" (diff) | |
download | core-5b5706f41f97998785e1e7ad356580772da80c42.tar.gz core-5b5706f41f97998785e1e7ad356580772da80c42.zip |
comphelper lok: remove the g_bViewCallback global
Its purpose was to allow incrementally migrate all callers of
SdrModel::libreOfficeKitCallback() to use
SfxViewShell::libreOfficeKitViewCallback() (which allows notifying only
the currently active or all views) instead. That is done by now, so it
can go.
Change-Id: I521bbbe5c638dfd844ebf025153459a37362d3c3
Reviewed-on: https://gerrit.libreoffice.org/26413
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Jenkins <ci@libreoffice.org>
Diffstat (limited to 'editeng')
-rw-r--r-- | editeng/source/editeng/editview.cxx | 10 | ||||
-rw-r--r-- | editeng/source/editeng/impedit.cxx | 24 |
2 files changed, 6 insertions, 28 deletions
diff --git a/editeng/source/editeng/editview.cxx b/editeng/source/editeng/editview.cxx index e203ed904bac..20f8b482bcaf 100644 --- a/editeng/source/editeng/editview.cxx +++ b/editeng/source/editeng/editview.cxx @@ -403,10 +403,7 @@ void EditView::ShowCursor( bool bGotoCursor, bool bForceVisCursor ) if (comphelper::LibreOfficeKit::isActive()) { - if (comphelper::LibreOfficeKit::isViewCallback()) - pImpEditView->libreOfficeKitViewCallback(LOK_CALLBACK_CURSOR_VISIBLE, OString::boolean(true).getStr()); - else - pImpEditView->libreOfficeKitCallback(LOK_CALLBACK_CURSOR_VISIBLE, OString::boolean(true).getStr()); + pImpEditView->libreOfficeKitViewCallback(LOK_CALLBACK_CURSOR_VISIBLE, OString::boolean(true).getStr()); } } } @@ -417,10 +414,7 @@ void EditView::HideCursor() if (comphelper::LibreOfficeKit::isActive()) { - if (comphelper::LibreOfficeKit::isViewCallback()) - pImpEditView->libreOfficeKitViewCallback(LOK_CALLBACK_CURSOR_VISIBLE, OString::boolean(false).getStr()); - else - pImpEditView->libreOfficeKitCallback(LOK_CALLBACK_CURSOR_VISIBLE, OString::boolean(false).getStr()); + pImpEditView->libreOfficeKitViewCallback(LOK_CALLBACK_CURSOR_VISIBLE, OString::boolean(false).getStr()); } } diff --git a/editeng/source/editeng/impedit.cxx b/editeng/source/editeng/impedit.cxx index d2e4ff30c9f4..0641e74b7466 100644 --- a/editeng/source/editeng/impedit.cxx +++ b/editeng/source/editeng/impedit.cxx @@ -120,15 +120,11 @@ void ImpEditView::SetBackgroundColor( const Color& rColor ) void ImpEditView::registerLibreOfficeKitCallback(OutlinerSearchable* pSearchable) { - // Per-view callbacks should always invoke ImpEditView::registerLibreOfficeKitViewCallback(). - assert(!comphelper::LibreOfficeKit::isViewCallback()); mpLibreOfficeKitSearchable = pSearchable; } void ImpEditView::libreOfficeKitCallback(int nType, const char* pPayload) const { - // Per-view callbacks should always invoke ImpEditView::libreOfficeKitViewCallback(). - assert(!comphelper::LibreOfficeKit::isViewCallback()); if (mpLibreOfficeKitSearchable) mpLibreOfficeKitSearchable->libreOfficeKitCallback(nType, pPayload); } @@ -402,10 +398,7 @@ void ImpEditView::DrawSelection( EditSelection aTmpSel, vcl::Region* pRegion, Ou aStart = OutputDevice::LogicToLogic(aStart, MAP_100TH_MM, MAP_TWIP); aStart.Move(aOrigin.getX(), aOrigin.getY()); - if (comphelper::LibreOfficeKit::isViewCallback()) - libreOfficeKitViewCallback(LOK_CALLBACK_TEXT_SELECTION_START, aStart.toString().getStr()); - else - libreOfficeKitCallback(LOK_CALLBACK_TEXT_SELECTION_START, aStart.toString().getStr()); + libreOfficeKitViewCallback(LOK_CALLBACK_TEXT_SELECTION_START, aStart.toString().getStr()); Rectangle& rEnd = aRectangles.back(); Rectangle aEnd = Rectangle(rEnd.Right() - 1, rEnd.Top(), rEnd.Right(), rEnd.Bottom()); @@ -413,10 +406,7 @@ void ImpEditView::DrawSelection( EditSelection aTmpSel, vcl::Region* pRegion, Ou aEnd = OutputDevice::LogicToLogic(aEnd, MAP_100TH_MM, MAP_TWIP); aEnd.Move(aOrigin.getX(), aOrigin.getY()); - if (comphelper::LibreOfficeKit::isViewCallback()) - libreOfficeKitViewCallback(LOK_CALLBACK_TEXT_SELECTION_END, aEnd.toString().getStr()); - else - libreOfficeKitCallback(LOK_CALLBACK_TEXT_SELECTION_END, aEnd.toString().getStr()); + libreOfficeKitViewCallback(LOK_CALLBACK_TEXT_SELECTION_END, aEnd.toString().getStr()); } std::vector<OString> v; @@ -430,10 +420,7 @@ void ImpEditView::DrawSelection( EditSelection aTmpSel, vcl::Region* pRegion, Ou sRectangle = comphelper::string::join("; ", v); } - if (comphelper::LibreOfficeKit::isViewCallback()) - libreOfficeKitViewCallback(LOK_CALLBACK_TEXT_SELECTION, sRectangle.getStr()); - else - libreOfficeKitCallback(LOK_CALLBACK_TEXT_SELECTION, sRectangle.getStr()); + libreOfficeKitViewCallback(LOK_CALLBACK_TEXT_SELECTION, sRectangle.getStr()); pOutWin->Pop(); } @@ -1030,10 +1017,7 @@ void ImpEditView::ShowCursor( bool bGotoCursor, bool bForceVisCursor ) aRect.setWidth(0); OString sRect = aRect.toString(); - if (comphelper::LibreOfficeKit::isViewCallback()) - libreOfficeKitViewCallback(LOK_CALLBACK_INVALIDATE_VISIBLE_CURSOR, sRect.getStr()); - else - libreOfficeKitCallback(LOK_CALLBACK_INVALIDATE_VISIBLE_CURSOR, sRect.getStr()); + libreOfficeKitViewCallback(LOK_CALLBACK_INVALIDATE_VISIBLE_CURSOR, sRect.getStr()); } CursorDirection nCursorDir = CursorDirection::NONE; |