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>
This commit is contained in:
parent
e30f3bcd25
commit
5b5706f41f
42 changed files with 164 additions and 566 deletions
|
@ -17,8 +17,6 @@ namespace LibreOfficeKit
|
|||
|
||||
static bool g_bActive(false);
|
||||
|
||||
static bool g_bViewCallback(true);
|
||||
|
||||
void setActive(bool bActive)
|
||||
{
|
||||
g_bActive = bActive;
|
||||
|
@ -29,16 +27,6 @@ bool isActive()
|
|||
return g_bActive;
|
||||
}
|
||||
|
||||
void setViewCallback(bool bViewCallback)
|
||||
{
|
||||
g_bViewCallback = bViewCallback;
|
||||
}
|
||||
|
||||
bool isViewCallback()
|
||||
{
|
||||
return g_bViewCallback;
|
||||
}
|
||||
|
||||
static void (*pStatusIndicatorCallback)(void *data, statusIndicatorCallbackType type, int percent)(nullptr);
|
||||
static void *pStatusIndicatorCallbackData(nullptr);
|
||||
|
||||
|
|
|
@ -13,4 +13,3 @@ LibreOfficeKit
|
|||
--------------
|
||||
|
||||
LOK_DEBUG - Draw a small red rectangle in the top left corner so that it's easy to see where a new tile begins.
|
||||
LOK_MODEL_CALLBACK - Use old document-global callback instead of multiple per-view ones.
|
||||
|
|
|
@ -1342,25 +1342,11 @@ static void doc_registerCallback(LibreOfficeKitDocument* pThis,
|
|||
SolarMutexGuard aGuard;
|
||||
LibLODocument_Impl* pDocument = static_cast<LibLODocument_Impl*>(pThis);
|
||||
|
||||
std::size_t nView = comphelper::LibreOfficeKit::isViewCallback() ? SfxLokHelper::getView() : 0;
|
||||
std::size_t nView = SfxLokHelper::getView();
|
||||
pDocument->mpCallbackFlushHandlers[nView].reset(new CallbackFlushHandler(pThis, pCallback, pData));
|
||||
|
||||
if (comphelper::LibreOfficeKit::isViewCallback())
|
||||
{
|
||||
if (SfxViewShell* pViewShell = SfxViewFrame::Current()->GetViewShell())
|
||||
pViewShell->registerLibreOfficeKitViewCallback(CallbackFlushHandler::callback, pDocument->mpCallbackFlushHandlers[nView].get());
|
||||
}
|
||||
else
|
||||
{
|
||||
ITiledRenderable* pDoc = getTiledRenderable(pThis);
|
||||
if (!pDoc)
|
||||
{
|
||||
gImpl->maLastExceptionMsg = "Document doesn't support tiled rendering";
|
||||
return;
|
||||
}
|
||||
|
||||
pDoc->registerCallback(CallbackFlushHandler::callback, pDocument->mpCallbackFlushHandlers[nView].get());
|
||||
}
|
||||
if (SfxViewShell* pViewShell = SfxViewFrame::Current()->GetViewShell())
|
||||
pViewShell->registerLibreOfficeKitViewCallback(CallbackFlushHandler::callback, pDocument->mpCallbackFlushHandlers[nView].get());
|
||||
}
|
||||
|
||||
static void doc_postKeyEvent(LibreOfficeKitDocument* pThis, int nType, int nCharCode, int nKeyCode)
|
||||
|
@ -1441,7 +1427,7 @@ static void doc_postUnoCommand(LibreOfficeKitDocument* pThis, const char* pComma
|
|||
|
||||
bool bResult = false;
|
||||
|
||||
std::size_t nView = comphelper::LibreOfficeKit::isViewCallback() ? SfxLokHelper::getView() : 0;
|
||||
std::size_t nView = SfxLokHelper::getView();
|
||||
if (bNotifyWhenFinished && pDocument->mpCallbackFlushHandlers[nView])
|
||||
{
|
||||
bResult = comphelper::dispatchCommand(aCommand, comphelper::containerToSequence(aPropertyValuesVector),
|
||||
|
@ -1477,7 +1463,7 @@ static void doc_postMouseEvent(LibreOfficeKitDocument* pThis, int nType, int nX,
|
|||
}
|
||||
|
||||
LibLODocument_Impl* pLib = static_cast<LibLODocument_Impl*>(pThis);
|
||||
std::size_t nView = comphelper::LibreOfficeKit::isViewCallback() ? SfxLokHelper::getView() : 0;
|
||||
std::size_t nView = SfxLokHelper::getView();
|
||||
if (pLib->mpCallbackFlushHandlers[nView])
|
||||
{
|
||||
pLib->mpCallbackFlushHandlers[nView]->queue(LOK_CALLBACK_MOUSE_POINTER, aPointerString.getStr());
|
||||
|
@ -2136,9 +2122,6 @@ static int lo_initialize(LibreOfficeKit* pThis, const char* pAppPath, const char
|
|||
if (eStage != SECOND_INIT)
|
||||
comphelper::LibreOfficeKit::setActive();
|
||||
|
||||
static bool bViewCallback = !getenv("LOK_MODEL_CALLBACK");
|
||||
comphelper::LibreOfficeKit::setViewCallback(bViewCallback);
|
||||
|
||||
if (eStage != PRE_INIT)
|
||||
comphelper::LibreOfficeKit::setStatusIndicatorCallback(lo_status_indicator_callback, pLib);
|
||||
|
||||
|
|
|
@ -117,7 +117,7 @@ void LOKInteractionHandler::postError(css::task::InteractionClassification class
|
|||
std::stringstream aStream;
|
||||
boost::property_tree::write_json(aStream, aTree);
|
||||
|
||||
std::size_t nView = (comphelper::LibreOfficeKit::isViewCallback() && SfxViewShell::Current()) ? SfxLokHelper::getView() : 0;
|
||||
std::size_t nView = SfxViewShell::Current() ? SfxLokHelper::getView() : 0;
|
||||
if (m_pLOKDocument && m_pLOKDocument->mpCallbackFlushHandlers.size() > nView && m_pLOKDocument->mpCallbackFlushHandlers[nView])
|
||||
m_pLOKDocument->mpCallbackFlushHandlers[nView]->queue(LOK_CALLBACK_ERROR, aStream.str().c_str());
|
||||
else if (m_pLOKit->mpCallback)
|
||||
|
|
|
@ -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());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -36,11 +36,6 @@ COMPHELPER_DLLPUBLIC void setStatusIndicatorCallback(void (*callback)(void *data
|
|||
// Check whether the code is running as invoked through LibreOfficeKit.
|
||||
COMPHELPER_DLLPUBLIC bool isActive();
|
||||
|
||||
/// Check whether clients register a callback for each view.
|
||||
COMPHELPER_DLLPUBLIC bool isViewCallback();
|
||||
/// Set whether clients register a callback for each view.
|
||||
COMPHELPER_DLLPUBLIC void setViewCallback(bool bViewCallback);
|
||||
|
||||
// Status indicator handling. Even if in theory there could be several status indicators active at
|
||||
// the same time, in practice there is only one at a time, so we don't handle any identification of
|
||||
// status indicator in this API.
|
||||
|
|
|
@ -1314,15 +1314,13 @@ static GtkWidget* createWindow(TiledWindow& rWindow)
|
|||
gtk_toolbar_insert(GTK_TOOLBAR(pUpperToolbar), pUnoCmdDebugger, -1);
|
||||
g_signal_connect(G_OBJECT(pUnoCmdDebugger), "clicked", G_CALLBACK(unoCommandDebugger), nullptr);
|
||||
|
||||
static bool bViewCallback = !getenv("LOK_MODEL_CALLBACK");
|
||||
if (bViewCallback)
|
||||
{
|
||||
GtkToolItem* pNewViewButton = gtk_tool_button_new( nullptr, nullptr);
|
||||
gtk_tool_button_set_icon_name(GTK_TOOL_BUTTON (pNewViewButton), "view-continuous-symbolic");
|
||||
gtk_tool_item_set_tooltip_text(pNewViewButton, "New View");
|
||||
gtk_toolbar_insert(GTK_TOOLBAR(pUpperToolbar), pNewViewButton, -1);
|
||||
g_signal_connect(G_OBJECT(pNewViewButton), "clicked", G_CALLBACK(createView), nullptr);
|
||||
}
|
||||
// New view button.
|
||||
GtkToolItem* pNewViewButton = gtk_tool_button_new( nullptr, nullptr);
|
||||
gtk_tool_button_set_icon_name(GTK_TOOL_BUTTON (pNewViewButton), "view-continuous-symbolic");
|
||||
gtk_tool_item_set_tooltip_text(pNewViewButton, "New View");
|
||||
gtk_toolbar_insert(GTK_TOOLBAR(pUpperToolbar), pNewViewButton, -1);
|
||||
g_signal_connect(G_OBJECT(pNewViewButton), "clicked", G_CALLBACK(createView), nullptr);
|
||||
|
||||
gtk_box_pack_start(GTK_BOX(rWindow.m_pVBox), pUpperToolbar, FALSE, FALSE, 0 ); // Adds to top.
|
||||
|
||||
// Lower toolbar.
|
||||
|
|
|
@ -533,8 +533,7 @@ public:
|
|||
static void SetUserList( const ScUserList* pNewList );
|
||||
SC_DLLPUBLIC static const OUString& GetRscString( sal_uInt16 nIndex );
|
||||
/// Open the specified URL.
|
||||
/// If pDrawLayer is specified, check if tiled-rendering, and leave clients to handle the openURL action if that's the case.
|
||||
static void OpenURL(const OUString& rURL, const OUString& rTarget, const SdrModel* pDrawLayer = nullptr);
|
||||
static void OpenURL(const OUString& rURL, const OUString& rTarget);
|
||||
SC_DLLPUBLIC static OUString GetAbsDocName( const OUString& rFileName,
|
||||
SfxObjectShell* pShell );
|
||||
SC_DLLPUBLIC static OUString GetDocTabName( const OUString& rFileName,
|
||||
|
|
|
@ -1321,16 +1321,11 @@ bool ScDocument::SearchAndReplace(
|
|||
rSearchItem, nCol, nRow );
|
||||
|
||||
// notify LibreOfficeKit about changed page
|
||||
if ( comphelper::LibreOfficeKit::isActive() )
|
||||
if (comphelper::LibreOfficeKit::isActive())
|
||||
{
|
||||
OString aPayload = OString::number(nTab);
|
||||
if (comphelper::LibreOfficeKit::isViewCallback())
|
||||
{
|
||||
if(SfxViewShell* pViewShell = SfxViewShell::Current())
|
||||
pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_SET_PART, aPayload.getStr());
|
||||
}
|
||||
else
|
||||
GetDrawLayer()->libreOfficeKitCallback(LOK_CALLBACK_SET_PART, aPayload.getStr());
|
||||
if (SfxViewShell* pViewShell = SfxViewShell::Current())
|
||||
pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_SET_PART, aPayload.getStr());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1357,16 +1352,11 @@ bool ScDocument::SearchAndReplace(
|
|||
rSearchItem, nCol, nRow );
|
||||
|
||||
// notify LibreOfficeKit about changed page
|
||||
if ( comphelper::LibreOfficeKit::isActive() )
|
||||
if (comphelper::LibreOfficeKit::isActive())
|
||||
{
|
||||
OString aPayload = OString::number(nTab);
|
||||
if (comphelper::LibreOfficeKit::isViewCallback())
|
||||
{
|
||||
if(SfxViewShell* pViewShell = SfxViewShell::Current())
|
||||
pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_SET_PART, aPayload.getStr());
|
||||
}
|
||||
else
|
||||
GetDrawLayer()->libreOfficeKitCallback(LOK_CALLBACK_SET_PART, aPayload.getStr());
|
||||
if(SfxViewShell* pViewShell = SfxViewShell::Current())
|
||||
pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_SET_PART, aPayload.getStr());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -586,17 +586,12 @@ bool ScDocument::InsertTab(
|
|||
|
||||
if (comphelper::LibreOfficeKit::isActive() && GetDrawLayer())
|
||||
{
|
||||
if (comphelper::LibreOfficeKit::isViewCallback())
|
||||
SfxViewShell* pViewShell = SfxViewShell::GetFirst();
|
||||
while (pViewShell)
|
||||
{
|
||||
SfxViewShell* pViewShell = SfxViewShell::GetFirst();
|
||||
while (pViewShell)
|
||||
{
|
||||
pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_DOCUMENT_SIZE_CHANGED, "");
|
||||
pViewShell = SfxViewShell::GetNext(*pViewShell);
|
||||
}
|
||||
pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_DOCUMENT_SIZE_CHANGED, "");
|
||||
pViewShell = SfxViewShell::GetNext(*pViewShell);
|
||||
}
|
||||
else
|
||||
GetDrawLayer()->libreOfficeKitCallback(LOK_CALLBACK_DOCUMENT_SIZE_CHANGED, "");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -762,19 +757,14 @@ bool ScDocument::DeleteTab( SCTAB nTab )
|
|||
// sheet names of references are not valid until sheet is deleted
|
||||
pChartListenerCollection->UpdateScheduledSeriesRanges();
|
||||
|
||||
if (comphelper::LibreOfficeKit::isActive() && GetDrawLayer())
|
||||
if (comphelper::LibreOfficeKit::isActive())
|
||||
{
|
||||
if (comphelper::LibreOfficeKit::isViewCallback())
|
||||
SfxViewShell* pViewShell = SfxViewShell::GetFirst();
|
||||
while (pViewShell)
|
||||
{
|
||||
SfxViewShell* pViewShell = SfxViewShell::GetFirst();
|
||||
while (pViewShell)
|
||||
{
|
||||
pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_DOCUMENT_SIZE_CHANGED, "");
|
||||
pViewShell = SfxViewShell::GetNext(*pViewShell);
|
||||
}
|
||||
pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_DOCUMENT_SIZE_CHANGED, "");
|
||||
pViewShell = SfxViewShell::GetNext(*pViewShell);
|
||||
}
|
||||
else
|
||||
GetDrawLayer()->libreOfficeKitCallback(LOK_CALLBACK_DOCUMENT_SIZE_CHANGED, "");
|
||||
}
|
||||
|
||||
bValid = true;
|
||||
|
@ -864,19 +854,14 @@ bool ScDocument::DeleteTabs( SCTAB nTab, SCTAB nSheets )
|
|||
// sheet names of references are not valid until sheet is deleted
|
||||
pChartListenerCollection->UpdateScheduledSeriesRanges();
|
||||
|
||||
if (comphelper::LibreOfficeKit::isActive() && GetDrawLayer())
|
||||
if (comphelper::LibreOfficeKit::isActive())
|
||||
{
|
||||
if (comphelper::LibreOfficeKit::isViewCallback())
|
||||
SfxViewShell* pViewShell = SfxViewShell::GetFirst();
|
||||
while (pViewShell)
|
||||
{
|
||||
SfxViewShell* pViewShell = SfxViewShell::GetFirst();
|
||||
while (pViewShell)
|
||||
{
|
||||
pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_DOCUMENT_SIZE_CHANGED, "");
|
||||
pViewShell = SfxViewShell::GetNext(*pViewShell);
|
||||
}
|
||||
pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_DOCUMENT_SIZE_CHANGED, "");
|
||||
pViewShell = SfxViewShell::GetNext(*pViewShell);
|
||||
}
|
||||
else
|
||||
GetDrawLayer()->libreOfficeKitCallback(LOK_CALLBACK_DOCUMENT_SIZE_CHANGED, "");
|
||||
}
|
||||
|
||||
bValid = true;
|
||||
|
@ -923,17 +908,12 @@ bool ScDocument::RenameTab( SCTAB nTab, const OUString& rName, bool /* bUpdateRe
|
|||
|
||||
if (comphelper::LibreOfficeKit::isActive() && GetDrawLayer())
|
||||
{
|
||||
if (comphelper::LibreOfficeKit::isViewCallback())
|
||||
SfxViewShell* pViewShell = SfxViewShell::GetFirst();
|
||||
while (pViewShell)
|
||||
{
|
||||
SfxViewShell* pViewShell = SfxViewShell::GetFirst();
|
||||
while (pViewShell)
|
||||
{
|
||||
pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_DOCUMENT_SIZE_CHANGED, "");
|
||||
pViewShell = SfxViewShell::GetNext(*pViewShell);
|
||||
}
|
||||
pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_DOCUMENT_SIZE_CHANGED, "");
|
||||
pViewShell = SfxViewShell::GetNext(*pViewShell);
|
||||
}
|
||||
else
|
||||
GetDrawLayer()->libreOfficeKitCallback(LOK_CALLBACK_DOCUMENT_SIZE_CHANGED, "");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -878,23 +878,12 @@ bool ScGlobal::EETextObjEqual( const EditTextObject* pObj1,
|
|||
return false;
|
||||
}
|
||||
|
||||
void ScGlobal::OpenURL(const OUString& rURL, const OUString& rTarget, const SdrModel* pDrawLayer)
|
||||
void ScGlobal::OpenURL(const OUString& rURL, const OUString& rTarget)
|
||||
{
|
||||
if (comphelper::LibreOfficeKit::isActive())
|
||||
{
|
||||
if (comphelper::LibreOfficeKit::isViewCallback())
|
||||
{
|
||||
if(SfxViewShell* pViewShell = SfxViewShell::Current())
|
||||
pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_HYPERLINK_CLICKED, rURL.toUtf8().getStr());
|
||||
}
|
||||
else
|
||||
{
|
||||
if (pDrawLayer)
|
||||
{
|
||||
pDrawLayer->libreOfficeKitCallback(LOK_CALLBACK_HYPERLINK_CLICKED, rURL.toUtf8().getStr());
|
||||
return;
|
||||
}
|
||||
}
|
||||
if(SfxViewShell* pViewShell = SfxViewShell::Current())
|
||||
pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_HYPERLINK_CLICKED, rURL.toUtf8().getStr());
|
||||
}
|
||||
|
||||
// OpenURL is always called in the GridWindow by mouse clicks in some way or another.
|
||||
|
|
|
@ -1878,18 +1878,11 @@ void ScInputHandler::UpdateActiveView()
|
|||
pTableView = nullptr;
|
||||
|
||||
// setup the pTableView editeng for tiled rendering to get cursor and selections
|
||||
if (pActiveViewSh && pTableView)
|
||||
if (pTableView && pActiveViewSh)
|
||||
{
|
||||
ScDocShell* pDocShell = pActiveViewSh->GetViewData().GetDocShell();
|
||||
if (comphelper::LibreOfficeKit::isActive())
|
||||
{
|
||||
if (comphelper::LibreOfficeKit::isViewCallback())
|
||||
pTableView->registerLibreOfficeKitViewCallback(pActiveViewSh);
|
||||
else
|
||||
{
|
||||
ScDrawLayer *pDrawLayer = pDocShell->GetDocument().GetDrawLayer();
|
||||
pTableView->registerLibreOfficeKitCallback(pDrawLayer);
|
||||
}
|
||||
pTableView->registerLibreOfficeKitViewCallback(pActiveViewSh);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2296,17 +2289,10 @@ void ScInputHandler::DataChanged( bool bFromTopNotify, bool bSetModified )
|
|||
if ( pInputWin )
|
||||
pInputWin->SetTextString( aText );
|
||||
|
||||
ScDocShell* pDocSh = pActiveViewSh->GetViewData().GetDocShell();
|
||||
ScDocument& rDoc = pDocSh->GetDocument();
|
||||
if ( comphelper::LibreOfficeKit::isActive() )
|
||||
if (comphelper::LibreOfficeKit::isActive())
|
||||
{
|
||||
if (comphelper::LibreOfficeKit::isViewCallback())
|
||||
{
|
||||
if (pActiveViewSh)
|
||||
pActiveViewSh->libreOfficeKitViewCallback(LOK_CALLBACK_CELL_FORMULA, aText.toUtf8().getStr());
|
||||
}
|
||||
else
|
||||
rDoc.GetDrawLayer()->libreOfficeKitCallback(LOK_CALLBACK_CELL_FORMULA, aText.toUtf8().getStr());
|
||||
if (pActiveViewSh)
|
||||
pActiveViewSh->libreOfficeKitViewCallback(LOK_CALLBACK_CELL_FORMULA, aText.toUtf8().getStr());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -3653,15 +3639,10 @@ void ScInputHandler::NotifyChange( const ScInputHdlState* pState,
|
|||
|
||||
if ( pInputWin )
|
||||
pInputWin->SetTextString(aString);
|
||||
else if ( comphelper::LibreOfficeKit::isActive() )
|
||||
else if (comphelper::LibreOfficeKit::isActive())
|
||||
{
|
||||
if (comphelper::LibreOfficeKit::isViewCallback())
|
||||
{
|
||||
if (pActiveViewSh)
|
||||
pActiveViewSh->libreOfficeKitViewCallback(LOK_CALLBACK_CELL_FORMULA, aString.toUtf8().getStr());
|
||||
}
|
||||
else
|
||||
rDoc.GetDrawLayer()->libreOfficeKitCallback(LOK_CALLBACK_CELL_FORMULA, aString.toUtf8().getStr());
|
||||
if (pActiveViewSh)
|
||||
pActiveViewSh->libreOfficeKitViewCallback(LOK_CALLBACK_CELL_FORMULA, aString.toUtf8().getStr());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -165,19 +165,14 @@ void ScDocShell::PostPaint( const ScRangeList& rRanges, sal_uInt16 nPart, sal_uI
|
|||
|
||||
// LOK: we are supposed to update the row / columns headers (and actually
|
||||
// the document size too - cell size affects that, obviously)
|
||||
if ((nPart & (PAINT_TOP | PAINT_LEFT)) && comphelper::LibreOfficeKit::isActive() && aDocument.GetDrawLayer())
|
||||
if ((nPart & (PAINT_TOP | PAINT_LEFT)) && comphelper::LibreOfficeKit::isActive())
|
||||
{
|
||||
if (comphelper::LibreOfficeKit::isViewCallback())
|
||||
SfxViewShell* pViewShell = SfxViewShell::GetFirst();
|
||||
while (pViewShell)
|
||||
{
|
||||
SfxViewShell* pViewShell = SfxViewShell::GetFirst();
|
||||
while (pViewShell)
|
||||
{
|
||||
pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_DOCUMENT_SIZE_CHANGED, "");
|
||||
pViewShell = SfxViewShell::GetNext(*pViewShell);
|
||||
}
|
||||
pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_DOCUMENT_SIZE_CHANGED, "");
|
||||
pViewShell = SfxViewShell::GetNext(*pViewShell);
|
||||
}
|
||||
else
|
||||
aDocument.GetDrawLayer()->libreOfficeKitCallback(LOK_CALLBACK_DOCUMENT_SIZE_CHANGED, "");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -867,10 +867,7 @@ void ScModelObj::resetSelection()
|
|||
pViewShell->Unmark();
|
||||
|
||||
// and hide the cell and text selection
|
||||
if (comphelper::LibreOfficeKit::isViewCallback())
|
||||
pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_TEXT_SELECTION, "");
|
||||
else
|
||||
pDocShell->GetDocument().GetDrawLayer()->libreOfficeKitCallback(LOK_CALLBACK_TEXT_SELECTION, "");
|
||||
pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_TEXT_SELECTION, "");
|
||||
}
|
||||
|
||||
void ScModelObj::setClipboard(const uno::Reference<datatransfer::clipboard::XClipboard>& xClipboard)
|
||||
|
|
|
@ -2334,7 +2334,7 @@ void ScGridWindow::MouseButtonUp( const MouseEvent& rMEvt )
|
|||
// ScGlobal::OpenURL() only understands Calc A1 style syntax.
|
||||
// Convert it to Calc A1 before calling OpenURL().
|
||||
if (pDoc->GetAddressConvention() == formula::FormulaGrammar::CONV_OOO)
|
||||
ScGlobal::OpenURL(aUrl, aTarget, pViewData->GetDocument()->GetDrawLayer());
|
||||
ScGlobal::OpenURL(aUrl, aTarget);
|
||||
else
|
||||
{
|
||||
ScAddress aTempAddr;
|
||||
|
@ -5717,17 +5717,8 @@ OString ScGridWindow::getCellCursor(const Fraction& rZoomX, const Fraction& rZoo
|
|||
void ScGridWindow::updateLibreOfficeKitCellCursor()
|
||||
{
|
||||
OString aCursor = getCellCursor(pViewData->GetZoomX(), pViewData->GetZoomY());
|
||||
if (comphelper::LibreOfficeKit::isViewCallback())
|
||||
{
|
||||
ScTabViewShell* pViewShell = pViewData->GetViewShell();
|
||||
pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_CELL_CURSOR, aCursor.getStr());
|
||||
}
|
||||
else
|
||||
{
|
||||
ScDocument* pDoc = pViewData->GetDocument();
|
||||
ScDrawLayer* pDrawLayer = pDoc->GetDrawLayer();
|
||||
pDrawLayer->libreOfficeKitCallback(LOK_CALLBACK_CELL_CURSOR, aCursor.getStr());
|
||||
}
|
||||
ScTabViewShell* pViewShell = pViewData->GetViewShell();
|
||||
pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_CELL_CURSOR, aCursor.getStr());
|
||||
}
|
||||
|
||||
void ScGridWindow::CursorChanged()
|
||||
|
@ -5770,17 +5761,8 @@ void ScGridWindow::UpdateAllOverlays()
|
|||
|
||||
void ScGridWindow::DeleteCursorOverlay()
|
||||
{
|
||||
if (comphelper::LibreOfficeKit::isViewCallback())
|
||||
{
|
||||
ScTabViewShell* pViewShell = pViewData->GetViewShell();
|
||||
pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_CELL_CURSOR, "EMPTY");
|
||||
}
|
||||
else
|
||||
{
|
||||
ScDocument* pDoc = pViewData->GetDocument();
|
||||
ScDrawLayer* pDrawLayer = pDoc->GetDrawLayer();
|
||||
pDrawLayer->libreOfficeKitCallback(LOK_CALLBACK_CELL_CURSOR, "EMPTY");
|
||||
}
|
||||
ScTabViewShell* pViewShell = pViewData->GetViewShell();
|
||||
pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_CELL_CURSOR, "EMPTY");
|
||||
mpOOCursors.reset();
|
||||
}
|
||||
|
||||
|
@ -5851,7 +5833,7 @@ void ScGridWindow::UpdateCopySourceOverlay()
|
|||
*
|
||||
* @param pLogicRects - if not 0, then don't invoke the callback, just collect the rectangles in the pointed vector.
|
||||
*/
|
||||
static void updateLibreOfficeKitSelection(ScViewData* pViewData, ScDrawLayer* pDrawLayer, const std::vector<Rectangle>& rRectangles, std::vector<Rectangle>* pLogicRects = nullptr)
|
||||
static void updateLibreOfficeKitSelection(ScViewData* pViewData, const std::vector<Rectangle>& rRectangles, std::vector<Rectangle>* pLogicRects = nullptr)
|
||||
{
|
||||
if (!comphelper::LibreOfficeKit::isActive())
|
||||
return;
|
||||
|
@ -5894,19 +5876,10 @@ static void updateLibreOfficeKitSelection(ScViewData* pViewData, ScDrawLayer* pD
|
|||
// the selection itself
|
||||
OString aSelection = comphelper::string::join("; ", aRectangles).getStr();
|
||||
|
||||
if (comphelper::LibreOfficeKit::isViewCallback())
|
||||
{
|
||||
ScTabViewShell* pViewShell = pViewData->GetViewShell();
|
||||
pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_TEXT_SELECTION_START, aStart.toString().getStr());
|
||||
pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_TEXT_SELECTION_END, aEnd.toString().getStr());
|
||||
pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_TEXT_SELECTION, aSelection.getStr());
|
||||
}
|
||||
else
|
||||
{
|
||||
pDrawLayer->libreOfficeKitCallback(LOK_CALLBACK_TEXT_SELECTION_START, aStart.toString().getStr());
|
||||
pDrawLayer->libreOfficeKitCallback(LOK_CALLBACK_TEXT_SELECTION_END, aEnd.toString().getStr());
|
||||
pDrawLayer->libreOfficeKitCallback(LOK_CALLBACK_TEXT_SELECTION, aSelection.getStr());
|
||||
}
|
||||
ScTabViewShell* pViewShell = pViewData->GetViewShell();
|
||||
pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_TEXT_SELECTION_START, aStart.toString().getStr());
|
||||
pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_TEXT_SELECTION_END, aEnd.toString().getStr());
|
||||
pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_TEXT_SELECTION, aSelection.getStr());
|
||||
}
|
||||
|
||||
void ScGridWindow::UpdateCursorOverlay()
|
||||
|
@ -6068,7 +6041,7 @@ void ScGridWindow::UpdateCursorOverlay()
|
|||
mpOOCursors->append(*pOverlay);
|
||||
|
||||
// notify the LibreOfficeKit too
|
||||
updateLibreOfficeKitSelection(pViewData, pDoc->GetDrawLayer(), aPixelRects);
|
||||
updateLibreOfficeKitSelection(pViewData, aPixelRects);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -6081,7 +6054,7 @@ void ScGridWindow::GetCellSelection(std::vector<Rectangle>& rLogicRects)
|
|||
{
|
||||
std::vector<Rectangle> aPixelRects;
|
||||
GetSelectionRects(aPixelRects);
|
||||
updateLibreOfficeKitSelection(pViewData, pViewData->GetDocument()->GetDrawLayer(), aPixelRects, &rLogicRects);
|
||||
updateLibreOfficeKitSelection(pViewData, aPixelRects, &rLogicRects);
|
||||
}
|
||||
|
||||
void ScGridWindow::DeleteSelectionOverlay()
|
||||
|
@ -6144,21 +6117,13 @@ void ScGridWindow::UpdateSelectionOverlay()
|
|||
mpOOSelection->append(*pOverlay);
|
||||
|
||||
// notify the LibreOfficeKit too
|
||||
updateLibreOfficeKitSelection(pViewData, pDoc->GetDrawLayer(), aPixelRects);
|
||||
updateLibreOfficeKitSelection(pViewData, aPixelRects);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (comphelper::LibreOfficeKit::isViewCallback())
|
||||
{
|
||||
ScTabViewShell* pViewShell = pViewData->GetViewShell();
|
||||
pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_TEXT_SELECTION, "EMPTY");
|
||||
}
|
||||
else
|
||||
{
|
||||
ScDocument* pDoc = pViewData->GetDocument();
|
||||
pDoc->GetDrawLayer()->libreOfficeKitCallback(LOK_CALLBACK_TEXT_SELECTION, "EMPTY");
|
||||
}
|
||||
ScTabViewShell* pViewShell = pViewData->GetViewShell();
|
||||
pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_TEXT_SELECTION, "EMPTY");
|
||||
}
|
||||
|
||||
if ( aOldMode != aDrawMode )
|
||||
|
|
|
@ -1026,13 +1026,8 @@ void ScGridWindow::LogicInvalidate(const Rectangle* pRectangle)
|
|||
sRectangle = aRectangle.toString();
|
||||
}
|
||||
|
||||
if (comphelper::LibreOfficeKit::isViewCallback())
|
||||
{
|
||||
ScTabViewShell* pViewShell = pViewData->GetViewShell();
|
||||
pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_INVALIDATE_TILES, sRectangle.getStr());
|
||||
}
|
||||
else
|
||||
pViewData->GetDocument()->GetDrawLayer()->libreOfficeKitCallback(LOK_CALLBACK_INVALIDATE_TILES, sRectangle.getStr());
|
||||
ScTabViewShell* pViewShell = pViewData->GetViewShell();
|
||||
pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_INVALIDATE_TILES, sRectangle.getStr());
|
||||
}
|
||||
|
||||
void ScGridWindow::SetCellSelectionPixel(int nType, int nPixelX, int nPixelY)
|
||||
|
|
|
@ -419,10 +419,7 @@ void ScTabControl::SwitchToPageId(sal_uInt16 nId)
|
|||
{
|
||||
// notify LibreOfficeKit about changed page
|
||||
OString aPayload = OString::number(nId - 1);
|
||||
if (comphelper::LibreOfficeKit::isViewCallback())
|
||||
pViewData->GetViewShell()->libreOfficeKitViewCallback(LOK_CALLBACK_SET_PART, aPayload.getStr());
|
||||
else
|
||||
pViewData->GetDocument()->GetDrawLayer()->libreOfficeKitCallback(LOK_CALLBACK_SET_PART, aPayload.getStr());
|
||||
pViewData->GetViewShell()->libreOfficeKitViewCallback(LOK_CALLBACK_SET_PART, aPayload.getStr());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -322,10 +322,7 @@ void ScTabView::SetCursor( SCCOL nPosX, SCROW nPosY, bool bNew )
|
|||
|
||||
if (pDocSh)
|
||||
{
|
||||
if (comphelper::LibreOfficeKit::isViewCallback())
|
||||
aViewData.GetViewShell()->libreOfficeKitViewCallback(LOK_CALLBACK_DOCUMENT_SIZE_CHANGED, "");
|
||||
else
|
||||
pDocSh->libreOfficeKitCallback(LOK_CALLBACK_DOCUMENT_SIZE_CHANGED, "");
|
||||
aViewData.GetViewShell()->libreOfficeKitViewCallback(LOK_CALLBACK_DOCUMENT_SIZE_CHANGED, "");
|
||||
|
||||
// New area extended to the right of the sheet after last column
|
||||
// including overlapping area with aNewRowArea
|
||||
|
@ -337,19 +334,13 @@ void ScTabView::SetCursor( SCCOL nPosX, SCROW nPosY, bool bNew )
|
|||
// Only invalidate if spreadsheet extended to the right
|
||||
if (aNewColArea.getWidth())
|
||||
{
|
||||
if (comphelper::LibreOfficeKit::isViewCallback())
|
||||
aViewData.GetViewShell()->libreOfficeKitViewCallback(LOK_CALLBACK_INVALIDATE_TILES, aNewColArea.toString().getStr());
|
||||
else
|
||||
pDocSh->libreOfficeKitCallback(LOK_CALLBACK_INVALIDATE_TILES, aNewColArea.toString().getStr());
|
||||
aViewData.GetViewShell()->libreOfficeKitViewCallback(LOK_CALLBACK_INVALIDATE_TILES, aNewColArea.toString().getStr());
|
||||
}
|
||||
|
||||
// Only invalidate if spreadsheet extended to the bottom
|
||||
if (aNewRowArea.getHeight())
|
||||
{
|
||||
if (comphelper::LibreOfficeKit::isViewCallback())
|
||||
aViewData.GetViewShell()->libreOfficeKitViewCallback(LOK_CALLBACK_INVALIDATE_TILES, aNewRowArea.toString().getStr());
|
||||
else
|
||||
pDocSh->libreOfficeKitCallback(LOK_CALLBACK_INVALIDATE_TILES, aNewRowArea.toString().getStr());
|
||||
aViewData.GetViewShell()->libreOfficeKitViewCallback(LOK_CALLBACK_INVALIDATE_TILES, aNewRowArea.toString().getStr());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -310,13 +310,8 @@ void ScTabView::TabChanged( bool bSameTabButMoved )
|
|||
std::stringstream ss;
|
||||
ss << aDocSize.Width() << ", " << aDocSize.Height();
|
||||
OString sRect = ss.str().c_str();
|
||||
if (comphelper::LibreOfficeKit::isViewCallback())
|
||||
{
|
||||
ScTabViewShell* pViewShell = aViewData.GetViewShell();
|
||||
pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_DOCUMENT_SIZE_CHANGED, sRect.getStr());
|
||||
}
|
||||
else
|
||||
pDocSh->libreOfficeKitCallback(LOK_CALLBACK_DOCUMENT_SIZE_CHANGED, sRect.getStr());
|
||||
ScTabViewShell* pViewShell = aViewData.GetViewShell();
|
||||
pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_DOCUMENT_SIZE_CHANGED, sRect.getStr());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -945,12 +945,9 @@ void ScViewData::SetEditEngine( ScSplitPos eWhich,
|
|||
{
|
||||
pEditView[eWhich] = new EditView( pNewEngine, pWin );
|
||||
|
||||
if (pDoc->GetDrawLayer() && comphelper::LibreOfficeKit::isActive())
|
||||
if (comphelper::LibreOfficeKit::isActive())
|
||||
{
|
||||
if (comphelper::LibreOfficeKit::isViewCallback())
|
||||
pEditView[eWhich]->registerLibreOfficeKitViewCallback(pViewShell);
|
||||
else
|
||||
pEditView[eWhich]->registerLibreOfficeKitCallback(pDoc->GetDrawLayer());
|
||||
pEditView[eWhich]->registerLibreOfficeKitViewCallback(pViewShell);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1790,10 +1790,7 @@ bool ScViewFunc::SearchAndReplace( const SvxSearchItem* pSearchItem,
|
|||
GetFrameWin()->LeaveWait();
|
||||
if (!bIsApi)
|
||||
{
|
||||
if (comphelper::LibreOfficeKit::isViewCallback())
|
||||
GetViewData().GetViewShell()->libreOfficeKitViewCallback(LOK_CALLBACK_SEARCH_NOT_FOUND, pSearchItem->GetSearchString().toUtf8().getStr());
|
||||
else
|
||||
rDoc.GetDrawLayer()->libreOfficeKitCallback(LOK_CALLBACK_SEARCH_NOT_FOUND, pSearchItem->GetSearchString().toUtf8().getStr());
|
||||
GetViewData().GetViewShell()->libreOfficeKitViewCallback(LOK_CALLBACK_SEARCH_NOT_FOUND, pSearchItem->GetSearchString().toUtf8().getStr());
|
||||
SvxSearchDialogWrapper::SetSearchLabel(SL_NotFound);
|
||||
}
|
||||
|
||||
|
@ -1822,15 +1819,9 @@ bool ScViewFunc::SearchAndReplace( const SvxSearchItem* pSearchItem,
|
|||
}
|
||||
|
||||
// Avoid LOK selection notifications before we have all the results.
|
||||
if (comphelper::LibreOfficeKit::isViewCallback())
|
||||
GetViewData().GetViewShell()->setTiledSearching(true);
|
||||
else
|
||||
rDoc.GetDrawLayer()->setTiledSearching(true);
|
||||
GetViewData().GetViewShell()->setTiledSearching(true);
|
||||
MarkDataChanged();
|
||||
if (comphelper::LibreOfficeKit::isViewCallback())
|
||||
GetViewData().GetViewShell()->setTiledSearching(false);
|
||||
else
|
||||
rDoc.GetDrawLayer()->setTiledSearching(false);
|
||||
GetViewData().GetViewShell()->setTiledSearching(false);
|
||||
|
||||
if ( bFound )
|
||||
{
|
||||
|
@ -1882,13 +1873,8 @@ bool ScViewFunc::SearchAndReplace( const SvxSearchItem* pSearchItem,
|
|||
std::stringstream aStream;
|
||||
boost::property_tree::write_json(aStream, aTree);
|
||||
OString aPayload = aStream.str().c_str();
|
||||
if (comphelper::LibreOfficeKit::isViewCallback())
|
||||
{
|
||||
SfxViewShell* pViewShell = GetViewData().GetViewShell();
|
||||
pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_SEARCH_RESULT_SELECTION, aPayload.getStr());
|
||||
}
|
||||
else
|
||||
rDoc.GetDrawLayer()->libreOfficeKitCallback(LOK_CALLBACK_SEARCH_RESULT_SELECTION, aPayload.getStr());
|
||||
SfxViewShell* pViewShell = GetViewData().GetViewShell();
|
||||
pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_SEARCH_RESULT_SELECTION, aPayload.getStr());
|
||||
|
||||
// Trigger LOK_CALLBACK_TEXT_SELECTION now.
|
||||
MarkDataChanged();
|
||||
|
|
|
@ -377,20 +377,14 @@ void SdDrawDocument::InsertPage(SdrPage* pPage, sal_uInt16 nPos)
|
|||
if (!bLast)
|
||||
UpdatePageRelativeURLs(static_cast<SdPage*>( pPage ), nPos, 1);
|
||||
|
||||
if (comphelper::LibreOfficeKit::isActive() &&
|
||||
static_cast<SdPage*>(pPage)->GetPageKind() == PK_STANDARD)
|
||||
if (comphelper::LibreOfficeKit::isActive() && static_cast<SdPage*>(pPage)->GetPageKind() == PK_STANDARD)
|
||||
{
|
||||
if (comphelper::LibreOfficeKit::isViewCallback())
|
||||
SfxViewShell* pViewShell = SfxViewShell::GetFirst();
|
||||
while (pViewShell)
|
||||
{
|
||||
SfxViewShell* pViewShell = SfxViewShell::GetFirst();
|
||||
while (pViewShell)
|
||||
{
|
||||
pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_DOCUMENT_SIZE_CHANGED, "");
|
||||
pViewShell = SfxViewShell::GetNext(*pViewShell);
|
||||
}
|
||||
pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_DOCUMENT_SIZE_CHANGED, "");
|
||||
pViewShell = SfxViewShell::GetNext(*pViewShell);
|
||||
}
|
||||
else
|
||||
libreOfficeKitCallback(LOK_CALLBACK_DOCUMENT_SIZE_CHANGED, "");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -416,20 +410,14 @@ SdrPage* SdDrawDocument::RemovePage(sal_uInt16 nPgNum)
|
|||
if (!bLast)
|
||||
UpdatePageRelativeURLs(static_cast<SdPage*>(pPage), nPgNum, -1);
|
||||
|
||||
if (comphelper::LibreOfficeKit::isActive() &&
|
||||
static_cast<SdPage*>(pPage)->GetPageKind() == PK_STANDARD)
|
||||
if (comphelper::LibreOfficeKit::isActive() && static_cast<SdPage*>(pPage)->GetPageKind() == PK_STANDARD)
|
||||
{
|
||||
if (comphelper::LibreOfficeKit::isViewCallback())
|
||||
SfxViewShell* pViewShell = SfxViewShell::GetFirst();
|
||||
while (pViewShell)
|
||||
{
|
||||
SfxViewShell* pViewShell = SfxViewShell::GetFirst();
|
||||
while (pViewShell)
|
||||
{
|
||||
pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_DOCUMENT_SIZE_CHANGED, "");
|
||||
pViewShell = SfxViewShell::GetNext(*pViewShell);
|
||||
}
|
||||
pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_DOCUMENT_SIZE_CHANGED, "");
|
||||
pViewShell = SfxViewShell::GetNext(*pViewShell);
|
||||
}
|
||||
else
|
||||
libreOfficeKitCallback(LOK_CALLBACK_DOCUMENT_SIZE_CHANGED, "");
|
||||
}
|
||||
|
||||
return pPage;
|
||||
|
|
|
@ -278,13 +278,8 @@ bool FuSelection::MouseButtonDown(const MouseEvent& rMEvt)
|
|||
// If tiled rendering, let client handles URL execution and early returns.
|
||||
if (comphelper::LibreOfficeKit::isActive())
|
||||
{
|
||||
if (comphelper::LibreOfficeKit::isViewCallback())
|
||||
{
|
||||
SfxViewShell& rSfxViewShell = mpViewShell->GetViewShellBase();
|
||||
rSfxViewShell.libreOfficeKitViewCallback(LOK_CALLBACK_HYPERLINK_CLICKED, aVEvt.pURLField->GetURL().toUtf8().getStr());
|
||||
}
|
||||
else
|
||||
mpDoc->libreOfficeKitCallback(LOK_CALLBACK_HYPERLINK_CLICKED, aVEvt.pURLField->GetURL().toUtf8().getStr());
|
||||
SfxViewShell& rSfxViewShell = mpViewShell->GetViewShellBase();
|
||||
rSfxViewShell.libreOfficeKitViewCallback(LOK_CALLBACK_HYPERLINK_CLICKED, aVEvt.pURLField->GetURL().toUtf8().getStr());
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
@ -620,16 +620,10 @@ bool Outliner::SearchAndReplaceAll()
|
|||
{
|
||||
// Disable selection change notifications during search all.
|
||||
SfxViewShell& rSfxViewShell = pViewShell->GetViewShellBase();
|
||||
if (comphelper::LibreOfficeKit::isViewCallback())
|
||||
rSfxViewShell.setTiledSearching(true);
|
||||
else
|
||||
pViewShell->GetDoc()->setTiledSearching(true);
|
||||
comphelper::ScopeGuard aGuard([pViewShell, &rSfxViewShell]()
|
||||
rSfxViewShell.setTiledSearching(true);
|
||||
comphelper::ScopeGuard aGuard([&rSfxViewShell]()
|
||||
{
|
||||
if (comphelper::LibreOfficeKit::isViewCallback())
|
||||
rSfxViewShell.setTiledSearching(false);
|
||||
else
|
||||
pViewShell->GetDoc()->setTiledSearching(false);
|
||||
rSfxViewShell.setTiledSearching(false);
|
||||
});
|
||||
|
||||
// Go to beginning/end of document.
|
||||
|
@ -680,10 +674,7 @@ bool Outliner::SearchAndReplaceAll()
|
|||
std::stringstream aStream;
|
||||
boost::property_tree::write_json(aStream, aTree);
|
||||
OString aPayload = aStream.str().c_str();
|
||||
if (comphelper::LibreOfficeKit::isViewCallback())
|
||||
rSfxViewShell.libreOfficeKitViewCallback(LOK_CALLBACK_SEARCH_RESULT_SELECTION, aPayload.getStr());
|
||||
else
|
||||
pViewShell->GetDoc()->libreOfficeKitCallback(LOK_CALLBACK_SEARCH_RESULT_SELECTION, aPayload.getStr());
|
||||
rSfxViewShell.libreOfficeKitViewCallback(LOK_CALLBACK_SEARCH_RESULT_SELECTION, aPayload.getStr());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -693,13 +684,8 @@ bool Outliner::SearchAndReplaceAll()
|
|||
{
|
||||
// Find-all, tiled rendering and we have at least one match.
|
||||
OString aPayload = OString::number(mnStartPageIndex);
|
||||
if (comphelper::LibreOfficeKit::isViewCallback())
|
||||
{
|
||||
SfxViewShell& rSfxViewShell = pViewShell->GetViewShellBase();
|
||||
rSfxViewShell.libreOfficeKitViewCallback(LOK_CALLBACK_SET_PART, aPayload.getStr());
|
||||
}
|
||||
else
|
||||
pViewShell->GetDoc()->libreOfficeKitCallback(LOK_CALLBACK_SET_PART, aPayload.getStr());
|
||||
SfxViewShell& rSfxViewShell = pViewShell->GetViewShellBase();
|
||||
rSfxViewShell.libreOfficeKitViewCallback(LOK_CALLBACK_SET_PART, aPayload.getStr());
|
||||
|
||||
// Emit a selection callback here:
|
||||
// 1) The original one is no longer valid, as we there was a SET_PART in between
|
||||
|
@ -712,13 +698,7 @@ bool Outliner::SearchAndReplaceAll()
|
|||
aRectangles.push_back(rSelection.m_aRectangles);
|
||||
}
|
||||
OString sRectangles = comphelper::string::join("; ", aRectangles);
|
||||
if (comphelper::LibreOfficeKit::isViewCallback())
|
||||
{
|
||||
SfxViewShell& rSfxViewShell = pViewShell->GetViewShellBase();
|
||||
rSfxViewShell.libreOfficeKitViewCallback(LOK_CALLBACK_TEXT_SELECTION, sRectangles.getStr());
|
||||
}
|
||||
else
|
||||
pViewShell->GetDoc()->libreOfficeKitCallback(LOK_CALLBACK_TEXT_SELECTION, sRectangles.getStr());
|
||||
rSfxViewShell.libreOfficeKitViewCallback(LOK_CALLBACK_TEXT_SELECTION, sRectangles.getStr());
|
||||
}
|
||||
|
||||
mnStartPageIndex = (sal_uInt16)-1;
|
||||
|
@ -824,13 +804,8 @@ bool Outliner::SearchAndReplaceOnce(std::vector<SearchSelection>* pSelections)
|
|||
{
|
||||
// notify LibreOfficeKit about changed page
|
||||
OString aPayload = OString::number(maCurrentPosition.mnPageIndex);
|
||||
if (comphelper::LibreOfficeKit::isViewCallback())
|
||||
{
|
||||
SfxViewShell& rSfxViewShell = pViewShell->GetViewShellBase();
|
||||
rSfxViewShell.libreOfficeKitViewCallback(LOK_CALLBACK_SET_PART, aPayload.getStr());
|
||||
}
|
||||
else
|
||||
pViewShell->GetDoc()->libreOfficeKitCallback(LOK_CALLBACK_SET_PART, aPayload.getStr());
|
||||
SfxViewShell& rSfxViewShell = pViewShell->GetViewShellBase();
|
||||
rSfxViewShell.libreOfficeKitViewCallback(LOK_CALLBACK_SET_PART, aPayload.getStr());
|
||||
|
||||
// also about search result selections
|
||||
boost::property_tree::ptree aTree;
|
||||
|
@ -847,13 +822,7 @@ bool Outliner::SearchAndReplaceOnce(std::vector<SearchSelection>* pSelections)
|
|||
std::stringstream aStream;
|
||||
boost::property_tree::write_json(aStream, aTree);
|
||||
aPayload = aStream.str().c_str();
|
||||
if (comphelper::LibreOfficeKit::isViewCallback())
|
||||
{
|
||||
SfxViewShell& rSfxViewShell = pViewShell->GetViewShellBase();
|
||||
rSfxViewShell.libreOfficeKitViewCallback(LOK_CALLBACK_SEARCH_RESULT_SELECTION, aPayload.getStr());
|
||||
}
|
||||
else
|
||||
pViewShell->GetDoc()->libreOfficeKitCallback(LOK_CALLBACK_SEARCH_RESULT_SELECTION, aPayload.getStr());
|
||||
rSfxViewShell.libreOfficeKitViewCallback(LOK_CALLBACK_SEARCH_RESULT_SELECTION, aPayload.getStr());
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -1201,17 +1170,12 @@ void Outliner::ShowEndOfSearchDialog()
|
|||
if (!mbStringFound)
|
||||
{
|
||||
SvxSearchDialogWrapper::SetSearchLabel(SL_NotFound);
|
||||
if (comphelper::LibreOfficeKit::isViewCallback())
|
||||
std::shared_ptr<ViewShell> pViewShell(mpWeakViewShell.lock());
|
||||
if (pViewShell)
|
||||
{
|
||||
std::shared_ptr<ViewShell> pViewShell(mpWeakViewShell.lock());
|
||||
if (pViewShell)
|
||||
{
|
||||
SfxViewShell& rSfxViewShell = pViewShell->GetViewShellBase();
|
||||
rSfxViewShell.libreOfficeKitViewCallback(LOK_CALLBACK_SEARCH_NOT_FOUND, mpSearchItem->GetSearchString().toUtf8().getStr());
|
||||
}
|
||||
SfxViewShell& rSfxViewShell = pViewShell->GetViewShellBase();
|
||||
rSfxViewShell.libreOfficeKitViewCallback(LOK_CALLBACK_SEARCH_NOT_FOUND, mpSearchItem->GetSearchString().toUtf8().getStr());
|
||||
}
|
||||
else
|
||||
mpDrawDocument->libreOfficeKitCallback(LOK_CALLBACK_SEARCH_NOT_FOUND, mpSearchItem->GetSearchString().toUtf8().getStr());
|
||||
}
|
||||
|
||||
// don't do anything else for search
|
||||
|
|
|
@ -929,13 +929,8 @@ bool DrawViewShell::SwitchPage(sal_uInt16 nSelectedPage)
|
|||
{
|
||||
// notify LibreOfficeKit about changed page
|
||||
OString aPayload = OString::number(nSelectedPage);
|
||||
if (comphelper::LibreOfficeKit::isViewCallback())
|
||||
{
|
||||
if (SfxViewShell* pViewShell = GetViewShell())
|
||||
pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_SET_PART, aPayload.getStr());
|
||||
}
|
||||
else
|
||||
GetDoc()->libreOfficeKitCallback(LOK_CALLBACK_SET_PART, aPayload.getStr());
|
||||
if (SfxViewShell* pViewShell = GetViewShell())
|
||||
pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_SET_PART, aPayload.getStr());
|
||||
}
|
||||
|
||||
rtl::Reference< sd::SlideShow > xSlideshow( SlideShow::GetSlideShow( GetDoc() ) );
|
||||
|
|
|
@ -1017,13 +1017,8 @@ void Window::LogicInvalidate(const Rectangle* pRectangle)
|
|||
aRectangle = OutputDevice::LogicToLogic(aRectangle, MAP_100TH_MM, MAP_TWIP);
|
||||
sRectangle = aRectangle.toString();
|
||||
}
|
||||
if (comphelper::LibreOfficeKit::isViewCallback())
|
||||
{
|
||||
SfxViewShell& rSfxViewShell = mpViewShell->GetViewShellBase();
|
||||
rSfxViewShell.libreOfficeKitViewCallback(LOK_CALLBACK_INVALIDATE_TILES, sRectangle.getStr());
|
||||
}
|
||||
else
|
||||
mpViewShell->GetDoc()->libreOfficeKitCallback(LOK_CALLBACK_INVALIDATE_TILES, sRectangle.getStr());
|
||||
SfxViewShell& rSfxViewShell = mpViewShell->GetViewShellBase();
|
||||
rSfxViewShell.libreOfficeKitViewCallback(LOK_CALLBACK_INVALIDATE_TILES, sRectangle.getStr());
|
||||
}
|
||||
|
||||
} // end of namespace sd
|
||||
|
|
|
@ -1992,16 +1992,8 @@ void SfxDispatcher::ExecutePopup( const OUString& rResName, vcl::Window *pWin, c
|
|||
|
||||
std::stringstream aStream;
|
||||
boost::property_tree::write_json(aStream, aRoot, true);
|
||||
if (comphelper::LibreOfficeKit::isViewCallback())
|
||||
{
|
||||
if (SfxViewShell* pViewShell = xImp->pFrame->GetViewShell())
|
||||
pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_CONTEXT_MENU, aStream.str().c_str());
|
||||
}
|
||||
else
|
||||
{
|
||||
const SfxObjectShell* objSh = xImp->pFrame->GetObjectShell();
|
||||
objSh->libreOfficeKitCallback(LOK_CALLBACK_CONTEXT_MENU, aStream.str().c_str());
|
||||
}
|
||||
if (SfxViewShell* pViewShell = xImp->pFrame->GetViewShell())
|
||||
pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_CONTEXT_MENU, aStream.str().c_str());
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -1032,16 +1032,8 @@ static void InterceptLOKStateChangeEvent(const SfxViewFrame* pViewFrame, const c
|
|||
return;
|
||||
}
|
||||
OUString payload = aBuffer.makeStringAndClear();
|
||||
if (comphelper::LibreOfficeKit::isViewCallback())
|
||||
{
|
||||
if (const SfxViewShell* pViewShell = pViewFrame->GetViewShell())
|
||||
pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_STATE_CHANGED, payload.toUtf8().getStr());
|
||||
}
|
||||
else
|
||||
{
|
||||
const SfxObjectShell* pObjectShell = pViewFrame->GetObjectShell();
|
||||
pObjectShell->libreOfficeKitCallback(LOK_CALLBACK_STATE_CHANGED, payload.toUtf8().getStr());
|
||||
}
|
||||
if (const SfxViewShell* pViewShell = pViewFrame->GetViewShell())
|
||||
pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_STATE_CHANGED, payload.toUtf8().getStr());
|
||||
}
|
||||
|
||||
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|
||||
|
|
|
@ -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()));
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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())
|
||||
{
|
||||
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
|
||||
{
|
||||
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())
|
||||
{
|
||||
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
|
||||
{
|
||||
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");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2138,10 +2138,7 @@ void SwCursorShell::ShowCursor()
|
|||
|
||||
if (comphelper::LibreOfficeKit::isActive())
|
||||
{
|
||||
if (comphelper::LibreOfficeKit::isViewCallback())
|
||||
GetSfxViewShell()->libreOfficeKitViewCallback(LOK_CALLBACK_CURSOR_VISIBLE, OString::boolean(true).getStr());
|
||||
else
|
||||
libreOfficeKitCallback(LOK_CALLBACK_CURSOR_VISIBLE, OString::boolean(true).getStr());
|
||||
GetSfxViewShell()->libreOfficeKitViewCallback(LOK_CALLBACK_CURSOR_VISIBLE, OString::boolean(true).getStr());
|
||||
}
|
||||
|
||||
UpdateCursor();
|
||||
|
@ -2160,10 +2157,7 @@ void SwCursorShell::HideCursor()
|
|||
|
||||
if (comphelper::LibreOfficeKit::isActive())
|
||||
{
|
||||
if (comphelper::LibreOfficeKit::isViewCallback())
|
||||
GetSfxViewShell()->libreOfficeKitViewCallback(LOK_CALLBACK_CURSOR_VISIBLE, OString::boolean(false).getStr());
|
||||
else
|
||||
libreOfficeKitCallback(LOK_CALLBACK_CURSOR_VISIBLE, OString::boolean(false).getStr());
|
||||
GetSfxViewShell()->libreOfficeKitViewCallback(LOK_CALLBACK_CURSOR_VISIBLE, OString::boolean(false).getStr());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -189,19 +189,13 @@ void SwVisibleCursor::SetPosAndShow()
|
|||
{
|
||||
m_nPageLastTime = nPage;
|
||||
OString aPayload = OString::number(nPage - 1);
|
||||
if (comphelper::LibreOfficeKit::isViewCallback())
|
||||
m_pCursorShell->GetSfxViewShell()->libreOfficeKitViewCallback(LOK_CALLBACK_SET_PART, aPayload.getStr());
|
||||
else
|
||||
m_pCursorShell->libreOfficeKitCallback(LOK_CALLBACK_SET_PART, aPayload.getStr());
|
||||
m_pCursorShell->GetSfxViewShell()->libreOfficeKitViewCallback(LOK_CALLBACK_SET_PART, aPayload.getStr());
|
||||
}
|
||||
|
||||
// notify about the cursor position & size
|
||||
Rectangle aSVRect(aRect.Pos().getX(), aRect.Pos().getY(), aRect.Pos().getX() + aRect.SSize().Width(), aRect.Pos().getY() + aRect.SSize().Height());
|
||||
OString sRect = aSVRect.toString();
|
||||
if (comphelper::LibreOfficeKit::isViewCallback())
|
||||
m_pCursorShell->GetSfxViewShell()->libreOfficeKitViewCallback(LOK_CALLBACK_INVALIDATE_VISIBLE_CURSOR, sRect.getStr());
|
||||
else
|
||||
m_pCursorShell->libreOfficeKitCallback(LOK_CALLBACK_INVALIDATE_VISIBLE_CURSOR, sRect.getStr());
|
||||
m_pCursorShell->GetSfxViewShell()->libreOfficeKitViewCallback(LOK_CALLBACK_INVALIDATE_VISIBLE_CURSOR, sRect.getStr());
|
||||
}
|
||||
|
||||
if ( !m_pCursorShell->IsCursorReadonly() || m_pCursorShell->GetViewOptions()->IsSelectionInReadonly() )
|
||||
|
@ -382,18 +376,12 @@ void SwSelPaintRects::Show(std::vector<OString>* pSelectionRectangles)
|
|||
if (aStartRect.HasArea())
|
||||
{
|
||||
OString sRect = aStartRect.SVRect().toString();
|
||||
if (comphelper::LibreOfficeKit::isViewCallback())
|
||||
GetShell()->GetSfxViewShell()->libreOfficeKitViewCallback(LOK_CALLBACK_TEXT_SELECTION_START, sRect.getStr());
|
||||
else
|
||||
GetShell()->libreOfficeKitCallback(LOK_CALLBACK_TEXT_SELECTION_START, sRect.getStr());
|
||||
GetShell()->GetSfxViewShell()->libreOfficeKitViewCallback(LOK_CALLBACK_TEXT_SELECTION_START, sRect.getStr());
|
||||
}
|
||||
if (aEndRect.HasArea())
|
||||
{
|
||||
OString sRect = aEndRect.SVRect().toString();
|
||||
if (comphelper::LibreOfficeKit::isViewCallback())
|
||||
GetShell()->GetSfxViewShell()->libreOfficeKitViewCallback(LOK_CALLBACK_TEXT_SELECTION_END, sRect.getStr());
|
||||
else
|
||||
GetShell()->libreOfficeKitCallback(LOK_CALLBACK_TEXT_SELECTION_END, sRect.getStr());
|
||||
GetShell()->GetSfxViewShell()->libreOfficeKitViewCallback(LOK_CALLBACK_TEXT_SELECTION_END, sRect.getStr());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -406,10 +394,7 @@ void SwSelPaintRects::Show(std::vector<OString>* pSelectionRectangles)
|
|||
OString sRect = comphelper::string::join("; ", aRect);
|
||||
if (!pSelectionRectangles)
|
||||
{
|
||||
if (comphelper::LibreOfficeKit::isViewCallback())
|
||||
GetShell()->GetSfxViewShell()->libreOfficeKitViewCallback(LOK_CALLBACK_TEXT_SELECTION, sRect.getStr());
|
||||
else
|
||||
GetShell()->libreOfficeKitCallback(LOK_CALLBACK_TEXT_SELECTION, sRect.getStr());
|
||||
GetShell()->GetSfxViewShell()->libreOfficeKitViewCallback(LOK_CALLBACK_TEXT_SELECTION, sRect.getStr());
|
||||
}
|
||||
else
|
||||
pSelectionRectangles->push_back(sRect);
|
||||
|
@ -616,10 +601,7 @@ void SwShellCursor::Show()
|
|||
aRect.push_back(rSelectionRectangle);
|
||||
}
|
||||
OString sRect = comphelper::string::join("; ", aRect);
|
||||
if (comphelper::LibreOfficeKit::isViewCallback())
|
||||
GetShell()->GetSfxViewShell()->libreOfficeKitViewCallback(LOK_CALLBACK_TEXT_SELECTION, sRect.getStr());
|
||||
else
|
||||
GetShell()->libreOfficeKitCallback(LOK_CALLBACK_TEXT_SELECTION, sRect.getStr());
|
||||
GetShell()->GetSfxViewShell()->libreOfficeKitViewCallback(LOK_CALLBACK_TEXT_SELECTION, sRect.getStr());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1023,10 +1023,7 @@ void SwViewShell::SizeChgNotify()
|
|||
std::stringstream ss;
|
||||
ss << aDocSize.Width() + 2L * DOCUMENTBORDER << ", " << aDocSize.Height() + 2L * DOCUMENTBORDER;
|
||||
OString sRect = ss.str().c_str();
|
||||
if (comphelper::LibreOfficeKit::isViewCallback())
|
||||
GetSfxViewShell()->libreOfficeKitViewCallback(LOK_CALLBACK_DOCUMENT_SIZE_CHANGED, sRect.getStr());
|
||||
else
|
||||
libreOfficeKitCallback(LOK_CALLBACK_DOCUMENT_SIZE_CHANGED, sRect.getStr());
|
||||
GetSfxViewShell()->libreOfficeKitViewCallback(LOK_CALLBACK_DOCUMENT_SIZE_CHANGED, sRect.getStr());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -57,10 +57,7 @@ void SidebarScrollBar::LogicInvalidate(const Rectangle* pRectangle)
|
|||
|
||||
OString sRectangle = aRectangle.toString();
|
||||
SwWrtShell& rWrtShell = m_rView.GetWrtShell();
|
||||
if (comphelper::LibreOfficeKit::isViewCallback())
|
||||
rWrtShell.GetSfxViewShell()->libreOfficeKitViewCallback(LOK_CALLBACK_INVALIDATE_TILES, sRectangle.getStr());
|
||||
else
|
||||
rWrtShell.libreOfficeKitCallback(LOK_CALLBACK_INVALIDATE_TILES, sRectangle.getStr());
|
||||
rWrtShell.GetSfxViewShell()->libreOfficeKitViewCallback(LOK_CALLBACK_INVALIDATE_TILES, sRectangle.getStr());
|
||||
}
|
||||
|
||||
void SidebarScrollBar::MouseButtonUp(const MouseEvent& /*rMouseEvent*/)
|
||||
|
|
|
@ -213,10 +213,7 @@ void SidebarTextControl::LogicInvalidate(const Rectangle* pRectangle)
|
|||
|
||||
OString sRectangle = aRectangle.toString();
|
||||
SwWrtShell& rWrtShell = mrDocView.GetWrtShell();
|
||||
if (comphelper::LibreOfficeKit::isViewCallback())
|
||||
rWrtShell.GetSfxViewShell()->libreOfficeKitViewCallback(LOK_CALLBACK_INVALIDATE_TILES, sRectangle.getStr());
|
||||
else
|
||||
rWrtShell.libreOfficeKitCallback(LOK_CALLBACK_INVALIDATE_TILES, sRectangle.getStr());
|
||||
rWrtShell.GetSfxViewShell()->libreOfficeKitViewCallback(LOK_CALLBACK_INVALIDATE_TILES, sRectangle.getStr());
|
||||
}
|
||||
|
||||
void SidebarTextControl::KeyInput( const KeyEvent& rKeyEvt )
|
||||
|
|
|
@ -614,13 +614,7 @@ void SwSidebarWin::InitControls()
|
|||
if (comphelper::LibreOfficeKit::isActive())
|
||||
{
|
||||
// If there is a callback already registered, inform the new outliner view about it.
|
||||
if (comphelper::LibreOfficeKit::isViewCallback())
|
||||
mpOutlinerView->registerLibreOfficeKitViewCallback(&mrView);
|
||||
else
|
||||
{
|
||||
SwDrawModel* pDrawModel = mrView.GetWrtShellPtr()->getIDocumentDrawModelAccess().GetDrawModel();
|
||||
mpOutlinerView->registerLibreOfficeKitCallback(pDrawModel);
|
||||
}
|
||||
mpOutlinerView->registerLibreOfficeKitViewCallback(&mrView);
|
||||
}
|
||||
|
||||
//create Scrollbars
|
||||
|
|
|
@ -6397,13 +6397,7 @@ void SwEditWin::LogicInvalidate(const Rectangle* pRectangle)
|
|||
else
|
||||
sRectangle = pRectangle->toString();
|
||||
|
||||
if (comphelper::LibreOfficeKit::isViewCallback())
|
||||
m_rView.libreOfficeKitViewCallback(LOK_CALLBACK_INVALIDATE_TILES, sRectangle.getStr());
|
||||
else
|
||||
{
|
||||
if (m_rView.GetWrtShellPtr())
|
||||
m_rView.GetWrtShell().libreOfficeKitCallback(LOK_CALLBACK_INVALIDATE_TILES, sRectangle.getStr());
|
||||
}
|
||||
m_rView.libreOfficeKitViewCallback(LOK_CALLBACK_INVALIDATE_TILES, sRectangle.getStr());
|
||||
}
|
||||
|
||||
void SwEditWin::LogicMouseButtonDown(const MouseEvent& rMouseEvent)
|
||||
|
|
|
@ -134,10 +134,7 @@ static void lcl_emitSearchResultCallbacks(SvxSearchItem* pSearchItem, SwWrtShell
|
|||
boost::property_tree::write_json(aStream, aTree);
|
||||
OString aPayload = aStream.str().c_str();
|
||||
|
||||
if (comphelper::LibreOfficeKit::isViewCallback())
|
||||
pWrtShell->GetSfxViewShell()->libreOfficeKitViewCallback(LOK_CALLBACK_SEARCH_RESULT_SELECTION, aPayload.getStr());
|
||||
else
|
||||
pWrtShell->libreOfficeKitCallback(LOK_CALLBACK_SEARCH_RESULT_SELECTION, aPayload.getStr());
|
||||
pWrtShell->GetSfxViewShell()->libreOfficeKitViewCallback(LOK_CALLBACK_SEARCH_RESULT_SELECTION, aPayload.getStr());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -266,26 +263,16 @@ void SwView::ExecSearch(SfxRequest& rReq)
|
|||
case SvxSearchCmd::FIND_ALL:
|
||||
{
|
||||
// Disable LOK selection notifications during search.
|
||||
SwDrawModel* pModel = m_pWrtShell->getIDocumentDrawModelAccess().GetDrawModel();
|
||||
if (comphelper::LibreOfficeKit::isViewCallback())
|
||||
m_pWrtShell->GetSfxViewShell()->setTiledSearching(true);
|
||||
else if (pModel)
|
||||
pModel->setTiledSearching(true);
|
||||
m_pWrtShell->GetSfxViewShell()->setTiledSearching(true);
|
||||
bool bRet = SearchAll();
|
||||
if (comphelper::LibreOfficeKit::isViewCallback())
|
||||
m_pWrtShell->GetSfxViewShell()->setTiledSearching(false);
|
||||
else if (pModel)
|
||||
pModel->setTiledSearching(false);
|
||||
m_pWrtShell->GetSfxViewShell()->setTiledSearching(false);
|
||||
|
||||
if( !bRet )
|
||||
{
|
||||
#if HAVE_FEATURE_DESKTOP
|
||||
if( !bQuiet )
|
||||
{
|
||||
if (comphelper::LibreOfficeKit::isViewCallback())
|
||||
m_pWrtShell->GetSfxViewShell()->libreOfficeKitViewCallback(LOK_CALLBACK_SEARCH_NOT_FOUND, m_pSrchItem->GetSearchString().toUtf8().getStr());
|
||||
else
|
||||
m_pWrtShell->libreOfficeKitCallback(LOK_CALLBACK_SEARCH_NOT_FOUND, m_pSrchItem->GetSearchString().toUtf8().getStr());
|
||||
m_pWrtShell->GetSfxViewShell()->libreOfficeKitViewCallback(LOK_CALLBACK_SEARCH_NOT_FOUND, m_pSrchItem->GetSearchString().toUtf8().getStr());
|
||||
SvxSearchDialogWrapper::SetSearchLabel(SL_NotFound);
|
||||
}
|
||||
#endif
|
||||
|
@ -406,10 +393,7 @@ void SwView::ExecSearch(SfxRequest& rReq)
|
|||
#if HAVE_FEATURE_DESKTOP
|
||||
if( !bQuiet )
|
||||
{
|
||||
if (comphelper::LibreOfficeKit::isViewCallback())
|
||||
m_pWrtShell->GetSfxViewShell()->libreOfficeKitViewCallback(LOK_CALLBACK_SEARCH_NOT_FOUND, m_pSrchItem->GetSearchString().toUtf8().getStr());
|
||||
else
|
||||
m_pWrtShell->libreOfficeKitCallback(LOK_CALLBACK_SEARCH_NOT_FOUND, m_pSrchItem->GetSearchString().toUtf8().getStr());
|
||||
m_pWrtShell->GetSfxViewShell()->libreOfficeKitViewCallback(LOK_CALLBACK_SEARCH_NOT_FOUND, m_pSrchItem->GetSearchString().toUtf8().getStr());
|
||||
SvxSearchDialogWrapper::SetSearchLabel(SL_NotFound);
|
||||
}
|
||||
#endif
|
||||
|
@ -605,10 +589,7 @@ bool SwView::SearchAndWrap(bool bApi)
|
|||
if( !bApi )
|
||||
{
|
||||
#if HAVE_FEATURE_DESKTOP
|
||||
if (comphelper::LibreOfficeKit::isViewCallback())
|
||||
m_pWrtShell->GetSfxViewShell()->libreOfficeKitViewCallback(LOK_CALLBACK_SEARCH_NOT_FOUND, m_pSrchItem->GetSearchString().toUtf8().getStr());
|
||||
else
|
||||
m_pWrtShell->libreOfficeKitCallback(LOK_CALLBACK_SEARCH_NOT_FOUND, m_pSrchItem->GetSearchString().toUtf8().getStr());
|
||||
m_pWrtShell->GetSfxViewShell()->libreOfficeKitViewCallback(LOK_CALLBACK_SEARCH_NOT_FOUND, m_pSrchItem->GetSearchString().toUtf8().getStr());
|
||||
SvxSearchDialogWrapper::SetSearchLabel(SL_NotFound);
|
||||
#endif
|
||||
}
|
||||
|
@ -661,10 +642,7 @@ bool SwView::SearchAndWrap(bool bApi)
|
|||
}
|
||||
else if(!bApi)
|
||||
{
|
||||
if (comphelper::LibreOfficeKit::isViewCallback())
|
||||
m_pWrtShell->GetSfxViewShell()->libreOfficeKitViewCallback(LOK_CALLBACK_SEARCH_NOT_FOUND, m_pSrchItem->GetSearchString().toUtf8().getStr());
|
||||
else
|
||||
m_pWrtShell->libreOfficeKitCallback(LOK_CALLBACK_SEARCH_NOT_FOUND, m_pSrchItem->GetSearchString().toUtf8().getStr());
|
||||
m_pWrtShell->GetSfxViewShell()->libreOfficeKitViewCallback(LOK_CALLBACK_SEARCH_NOT_FOUND, m_pSrchItem->GetSearchString().toUtf8().getStr());
|
||||
SvxSearchDialogWrapper::SetSearchLabel(SL_NotFound);
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -473,10 +473,7 @@ void LoadURL( SwViewShell& rVSh, const OUString& rURL, sal_uInt16 nFilter,
|
|||
// We are doing tiledRendering, let the client handles the URL loading.
|
||||
if (comphelper::LibreOfficeKit::isActive())
|
||||
{
|
||||
if (comphelper::LibreOfficeKit::isViewCallback())
|
||||
rVSh.GetSfxViewShell()->libreOfficeKitViewCallback(LOK_CALLBACK_HYPERLINK_CLICKED, rURL.toUtf8().getStr());
|
||||
else
|
||||
rVSh.libreOfficeKitCallback(LOK_CALLBACK_HYPERLINK_CLICKED, rURL.toUtf8().getStr());
|
||||
rVSh.GetSfxViewShell()->libreOfficeKitViewCallback(LOK_CALLBACK_HYPERLINK_CLICKED, rURL.toUtf8().getStr());
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue