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 /svx/source | |
parent | e30f3bcd25762236eb739584dc71691123527c9f (diff) |
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 'svx/source')
-rw-r--r-- | svx/source/svdraw/svdedxv.cxx | 5 | ||||
-rw-r--r-- | svx/source/svdraw/svdmodel.cxx | 5 | ||||
-rw-r--r-- | svx/source/svdraw/svdmrkv.cxx | 43 | ||||
-rw-r--r-- | svx/source/table/tablecontroller.cxx | 34 |
4 files changed, 18 insertions, 69 deletions
diff --git a/svx/source/svdraw/svdedxv.cxx b/svx/source/svdraw/svdedxv.cxx index cb88a6c79a88..c5f60854a78f 100644 --- a/svx/source/svdraw/svdedxv.cxx +++ b/svx/source/svdraw/svdedxv.cxx @@ -461,10 +461,7 @@ OutlinerView* SdrObjEditView::ImpMakeOutlinerView(vcl::Window* pWin, bool /*bNoP } pOutlView->SetControlWord(nStat); pOutlView->SetBackgroundColor( aBackground ); - if (comphelper::LibreOfficeKit::isViewCallback()) - pOutlView->registerLibreOfficeKitViewCallback(SfxViewShell::Current()); - else - pOutlView->registerLibreOfficeKitCallback(GetModel()); + pOutlView->registerLibreOfficeKitViewCallback(SfxViewShell::Current()); if (pText!=nullptr) { pOutlView->SetAnchorMode((EVAnchorMode)(pText->GetOutlinerViewAnchorMode())); diff --git a/svx/source/svdraw/svdmodel.cxx b/svx/source/svdraw/svdmodel.cxx index 7d4d5cd6d85b..721a63a9c9a3 100644 --- a/svx/source/svdraw/svdmodel.cxx +++ b/svx/source/svdraw/svdmodel.cxx @@ -816,9 +816,6 @@ void SdrModel::registerLibreOfficeKitCallback(LibreOfficeKitCallback pCallback, void SdrModel::libreOfficeKitCallback(int nType, const char* pPayload) const { - // Per-view callbacks should always invoke SfxViewShell::libreOfficeKitViewCallback(). - assert(!comphelper::LibreOfficeKit::isViewCallback()); - if (mbTiledSearching) { switch (nType) @@ -837,13 +834,11 @@ void SdrModel::libreOfficeKitCallback(int nType, const char* pPayload) const void SdrModel::setTiledSearching(bool bTiledSearching) { - assert(!comphelper::LibreOfficeKit::isViewCallback()); mbTiledSearching = bTiledSearching; } bool SdrModel::isTiledSearching() const { - assert(!comphelper::LibreOfficeKit::isViewCallback()); return mbTiledSearching; } diff --git a/svx/source/svdraw/svdmrkv.cxx b/svx/source/svdraw/svdmrkv.cxx index 5cb8371b6757..94d2c9ae2de6 100644 --- a/svx/source/svdraw/svdmrkv.cxx +++ b/svx/source/svdraw/svdmrkv.cxx @@ -230,13 +230,8 @@ void SdrMarkView::ModelHasChanged() sSelection = aSelection.toString(); } - if (comphelper::LibreOfficeKit::isViewCallback()) - { - if(SfxViewShell* pViewShell = SfxViewShell::Current()) - pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_INVALIDATE_TILES, sSelection.getStr()); - } - else - GetModel()->libreOfficeKitCallback(LOK_CALLBACK_INVALIDATE_TILES, sSelection.getStr()); + if(SfxViewShell* pViewShell = SfxViewShell::Current()) + pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_INVALIDATE_TILES, sSelection.getStr()); } } @@ -712,13 +707,8 @@ void SdrMarkView::SetMarkHandles() if (bTiledRendering) { // Suppress handles -> empty graphic selection. - if (comphelper::LibreOfficeKit::isViewCallback()) - { - if(SfxViewShell* pViewShell = SfxViewShell::Current()) - pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_GRAPHIC_SELECTION, "EMPTY"); - } - else - GetModel()->libreOfficeKitCallback(LOK_CALLBACK_GRAPHIC_SELECTION, "EMPTY"); + if(SfxViewShell* pViewShell = SfxViewShell::Current()) + pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_GRAPHIC_SELECTION, "EMPTY"); } return; } @@ -738,13 +728,8 @@ void SdrMarkView::SetMarkHandles() if (xController.is() && xController->hasSelectedCells()) { // The table shape has selected cells, which provide text selection already -> no graphic selection. - if (comphelper::LibreOfficeKit::isViewCallback()) - { - if(SfxViewShell* pViewShell = SfxViewShell::Current()) - pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_GRAPHIC_SELECTION, "EMPTY"); - } - else - GetModel()->libreOfficeKitCallback(LOK_CALLBACK_GRAPHIC_SELECTION, "EMPTY"); + if(SfxViewShell* pViewShell = SfxViewShell::Current()) + pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_GRAPHIC_SELECTION, "EMPTY"); return; } } @@ -773,21 +758,11 @@ void SdrMarkView::SetMarkHandles() sSelection = aSelection.toString(); // hide the text selection too - if (comphelper::LibreOfficeKit::isViewCallback()) - { - if(SfxViewShell* pViewShell = SfxViewShell::Current()) - pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_TEXT_SELECTION, ""); - } - else - GetModel()->libreOfficeKitCallback(LOK_CALLBACK_TEXT_SELECTION, ""); - } - if (comphelper::LibreOfficeKit::isViewCallback()) - { if(SfxViewShell* pViewShell = SfxViewShell::Current()) - pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_GRAPHIC_SELECTION, sSelection.getStr()); + pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_TEXT_SELECTION, ""); } - else - GetModel()->libreOfficeKitCallback(LOK_CALLBACK_GRAPHIC_SELECTION, sSelection.getStr()); + if(SfxViewShell* pViewShell = SfxViewShell::Current()) + pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_GRAPHIC_SELECTION, sSelection.getStr()); } if (bFrmHdl) diff --git a/svx/source/table/tablecontroller.cxx b/svx/source/table/tablecontroller.cxx index 699fd142c5f4..5aff1044a7a9 100644 --- a/svx/source/table/tablecontroller.cxx +++ b/svx/source/table/tablecontroller.cxx @@ -2169,20 +2169,11 @@ void SvxTableController::updateSelectionOverlay() aSelection = OutputDevice::LogicToLogic(aSelection, MAP_100TH_MM, MAP_TWIP); } - if (comphelper::LibreOfficeKit::isViewCallback()) - { - if(SfxViewShell* pViewShell = SfxViewShell::Current()) - { - pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_TEXT_SELECTION_START, aSelectionStart.toString().getStr()); - pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_TEXT_SELECTION_END, aSelectionEnd.toString().getStr()); - pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_TEXT_SELECTION, aSelection.toString().getStr()); - } - } - else + if(SfxViewShell* pViewShell = SfxViewShell::Current()) { - pTableObj->GetModel()->libreOfficeKitCallback(LOK_CALLBACK_TEXT_SELECTION_START, aSelectionStart.toString().getStr()); - pTableObj->GetModel()->libreOfficeKitCallback(LOK_CALLBACK_TEXT_SELECTION_END, aSelectionEnd.toString().getStr()); - pTableObj->GetModel()->libreOfficeKitCallback(LOK_CALLBACK_TEXT_SELECTION, aSelection.toString().getStr()); + pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_TEXT_SELECTION_START, aSelectionStart.toString().getStr()); + pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_TEXT_SELECTION_END, aSelectionEnd.toString().getStr()); + pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_TEXT_SELECTION, aSelection.toString().getStr()); } } } @@ -2200,20 +2191,11 @@ void SvxTableController::destroySelectionOverlay() if (comphelper::LibreOfficeKit::isActive()) { // Clear the LOK text selection so far provided by this table. - if (comphelper::LibreOfficeKit::isViewCallback()) - { - if(SfxViewShell* pViewShell = SfxViewShell::Current()) - { - pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_TEXT_SELECTION_START, "EMPTY"); - pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_TEXT_SELECTION_END, "EMPTY"); - pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_TEXT_SELECTION, "EMPTY"); - } - } - else + if(SfxViewShell* pViewShell = SfxViewShell::Current()) { - mxTableObj->GetModel()->libreOfficeKitCallback(LOK_CALLBACK_TEXT_SELECTION_START, "EMPTY"); - mxTableObj->GetModel()->libreOfficeKitCallback(LOK_CALLBACK_TEXT_SELECTION_END, "EMPTY"); - mxTableObj->GetModel()->libreOfficeKitCallback(LOK_CALLBACK_TEXT_SELECTION, "EMPTY"); + pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_TEXT_SELECTION_START, "EMPTY"); + pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_TEXT_SELECTION_END, "EMPTY"); + pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_TEXT_SELECTION, "EMPTY"); } } } |