summaryrefslogtreecommitdiff
path: root/sc/source/ui/app/inputwin.cxx
diff options
context:
space:
mode:
authorSzymon Kłos <szymon.klos@collabora.com>2022-04-09 22:51:49 +0200
committerSzymon Kłos <szymon.klos@collabora.com>2022-04-30 11:47:53 +0200
commitcdf2a60de28d7f36b5404451474cadb65db40a11 (patch)
tree66c824bb4a2154d2978a273eb301f15db32d4f08 /sc/source/ui/app/inputwin.cxx
parent460951403745c2d08094f707e884ee99ab5b9364 (diff)
jsdialog: used for formulabar
- do not block painting - use welded wrappers to send JSON - don't send tunneled dialog Change-Id: I54c3cd02ab63bad4a50a3623a32f13b0c94a3595 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132757 Reviewed-by: Mert Tumer <mert.tumer@collabora.com> Tested-by: Szymon Kłos <szymon.klos@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133651 Tested-by: Jenkins Reviewed-by: Szymon Kłos <szymon.klos@collabora.com>
Diffstat (limited to 'sc/source/ui/app/inputwin.cxx')
-rw-r--r--sc/source/ui/app/inputwin.cxx86
1 files changed, 2 insertions, 84 deletions
diff --git a/sc/source/ui/app/inputwin.cxx b/sc/source/ui/app/inputwin.cxx
index aae96bbf281d..ff717e5acf44 100644
--- a/sc/source/ui/app/inputwin.cxx
+++ b/sc/source/ui/app/inputwin.cxx
@@ -308,11 +308,8 @@ void ScInputWindow::dispose()
if (comphelper::LibreOfficeKit::isActive())
{
- if(const vcl::ILibreOfficeKitNotifier* pNotifier = GetLOKNotifier())
- {
- pNotifier->notifyWindow(GetLOKWindowId(), "close");
+ if (GetLOKNotifier())
ReleaseLOKNotifier();
- }
}
mxTextWindow.disposeAndClear();
@@ -419,24 +416,6 @@ void ScInputWindow::Select()
}
}
-void ScInputWindow::Paint(vcl::RenderContext& rRenderContext, const tools::Rectangle& rRect)
-{
- if (comphelper::LibreOfficeKit::isActive() && !comphelper::LibreOfficeKit::isDialogPainting())
- return;
-
- ToolBox::Paint(rRenderContext, rRect);
-
- if (!comphelper::LibreOfficeKit::isActive())
- {
- // draw a line at the bottom to distinguish that from the grid
- // const StyleSettings& rStyleSettings = rRenderContext.GetSettings().GetStyleSettings();
- // rRenderContext.SetLineColor(rStyleSettings.GetShadowColor());
- // Size aSize = GetSizePixel();
- // rRenderContext.DrawLine(Point(0, aSize.Height() - 1),
- // Point(aSize.Width() - 1, aSize.Height() - 1));
- }
-}
-
void ScInputWindow::PixelInvalidate(const tools::Rectangle* pRectangle)
{
if (comphelper::LibreOfficeKit::isDialogPainting() || !comphelper::LibreOfficeKit::isActive())
@@ -476,20 +455,6 @@ void ScInputWindow::SetSizePixel( const Size& rNewSize )
ToolBox::SetSizePixel(rNewSize);
}
-void ScInputWindow::setPosSizePixel(tools::Long nX, tools::Long nY, tools::Long nWidth, tools::Long nHeight, PosSizeFlags nFlags)
-{
- ToolBox::setPosSizePixel(nX, nY, nWidth, nHeight, nFlags);
- if (const vcl::ILibreOfficeKitNotifier* pNotifier = GetLOKNotifier())
- {
- std::vector<vcl::LOKPayloadItem> aItems;
- aItems.emplace_back(std::make_pair("position", Point(GetOutOffXPixel(), GetOutOffYPixel()).toString()));
- aItems.emplace_back("size", GetSizePixel().toString());
- aItems.emplace_back("lines", OString::number(mxTextWindow->GetNumLines()));
- pNotifier->notifyWindow(GetLOKWindowId(), "size_changed", aItems);
- Invalidate();
- }
-}
-
void ScInputWindow::Resize()
{
ToolBox::Resize();
@@ -520,15 +485,6 @@ void ScInputWindow::Resize()
}
SetSizePixel(aSize);
- if (const vcl::ILibreOfficeKitNotifier* pNotifier = GetLOKNotifier())
- {
- std::vector<vcl::LOKPayloadItem> aItems;
- aItems.emplace_back(std::make_pair("position", Point(GetOutOffXPixel(), GetOutOffYPixel()).toString()));
- aItems.emplace_back("size", GetSizePixel().toString());
- aItems.emplace_back("lines", OString::number(mxTextWindow->GetNumLines()));
- pNotifier->notifyWindow(GetLOKWindowId(), "size_changed", aItems);
- }
-
Invalidate();
}
@@ -536,21 +492,6 @@ void ScInputWindow::NotifyLOKClient()
{
if (comphelper::LibreOfficeKit::isActive() && !GetLOKNotifier() && mpViewShell)
SetLOKNotifier(mpViewShell);
-
- const vcl::ILibreOfficeKitNotifier* pNotifier = GetLOKNotifier();
- if (!pNotifier)
- return;
-
- Size aSize = GetSizePixel();
- if (!aSize.IsEmpty())
- {
- std::vector<vcl::LOKPayloadItem> aItems;
- aItems.emplace_back("type", "calc-input-win");
- aItems.emplace_back(std::make_pair("position", Point(GetOutOffXPixel(), GetOutOffYPixel()).toString()));
- aItems.emplace_back(std::make_pair("size", aSize.toString()));
- aItems.emplace_back("lines", OString::number(mxTextWindow->GetNumLines()));
- pNotifier->notifyWindow(GetLOKWindowId(), "created", aItems);
- }
}
void ScInputWindow::SetFuncString( const OUString& rString, bool bDoEdit )
@@ -881,7 +822,7 @@ void ScInputWindow::AutoSum( bool& bRangeFinder, bool& bSubTotal, OpCode eCode )
}
ScInputBarGroup::ScInputBarGroup(vcl::Window* pParent, ScTabViewShell* pViewSh)
- : InterimItemWindow(pParent, "modules/scalc/ui/inputbar.ui", "InputBar")
+ : InterimItemWindow(pParent, "modules/scalc/ui/inputbar.ui", "InputBar", true, reinterpret_cast<sal_uInt64>(pViewSh))
, mxBackground(m_xBuilder->weld_container("background"))
, mxTextWndGroup(new ScTextWndGroup(*this, pViewSh))
, mxButtonUp(m_xBuilder->weld_button("up"))
@@ -1300,9 +1241,6 @@ IMPL_LINK_NOARG(ScTextWndGroup, Impl_ScrollHdl, weld::ScrolledWindow&, void)
void ScTextWnd::Paint( vcl::RenderContext& rRenderContext, const tools::Rectangle& rRect )
{
- if (comphelper::LibreOfficeKit::isActive() && !comphelper::LibreOfficeKit::isDialogPainting())
- return;
-
const StyleSettings& rStyleSettings = Application::GetSettings().GetStyleSettings();
Color aBgColor = rStyleSettings.GetWindowColor();
rRenderContext.SetBackground(aBgColor);
@@ -1331,26 +1269,6 @@ void ScTextWnd::Paint( vcl::RenderContext& rRenderContext, const tools::Rectangl
}
else
WeldEditView::Paint(rRenderContext, rRect);
-
- if (!comphelper::LibreOfficeKit::isActive())
- return;
-
- bool bIsFocused = false;
- if (HasFocus())
- {
- vcl::Cursor* pCursor = m_xEditView->GetCursor();
- if (pCursor)
- bIsFocused = true;
- }
-
- VclPtr<vcl::Window> pParent = mrGroupBar.GetVclParent().GetParentWithLOKNotifier();
- if (!pParent)
- return;
-
- const vcl::ILibreOfficeKitNotifier* pNotifier = pParent->GetLOKNotifier();
- std::vector<vcl::LOKPayloadItem> aItems;
- aItems.emplace_back("visible", bIsFocused ? "true" : "false");
- pNotifier->notifyWindow(pParent->GetLOKWindowId(), "cursor_visible", aItems);
}
EditView* ScTextWnd::GetEditView() const