summaryrefslogtreecommitdiff
path: root/svx
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2016-06-17 11:45:02 +0200
committerAshod Nakashian <ashod.nakashian@collabora.co.uk>2016-07-20 01:33:09 -0400
commit2a03b0e6fe09ba8ce02977d50814800e720b8d46 (patch)
treee623bffcb0793a320a414fa537e7519c3976d96f /svx
parentb91d37bcab9a6ab734c96b9e0ca59c49a75e0ed2 (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> (cherry picked from commit 5b5706f41f97998785e1e7ad356580772da80c42)
Diffstat (limited to 'svx')
-rw-r--r--svx/source/svdraw/svdedxv.cxx5
-rw-r--r--svx/source/svdraw/svdmodel.cxx5
-rw-r--r--svx/source/svdraw/svdmrkv.cxx43
-rw-r--r--svx/source/table/tablecontroller.cxx34
4 files changed, 18 insertions, 69 deletions
diff --git a/svx/source/svdraw/svdedxv.cxx b/svx/source/svdraw/svdedxv.cxx
index 5428909654f6..7fe6dd3840c8 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 8ea9245c496d..7121dcb5d098 100644
--- a/svx/source/svdraw/svdmodel.cxx
+++ b/svx/source/svdraw/svdmodel.cxx
@@ -824,9 +824,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)
@@ -845,13 +842,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 56591e8870c4..db1b683f14e9 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());
}
}
@@ -718,13 +713,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;
}
@@ -744,13 +734,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;
}
}
@@ -779,21 +764,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 f91daa0cf85e..0890d67e55fb 100644
--- a/svx/source/table/tablecontroller.cxx
+++ b/svx/source/table/tablecontroller.cxx
@@ -2175,20 +2175,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());
}
}
}
@@ -2206,20 +2197,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");
}
}
}