summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--desktop/source/lib/init.cxx2
-rw-r--r--sc/source/ui/app/inputwin.cxx86
-rw-r--r--sc/source/ui/inc/inputwin.hxx3
-rw-r--r--vcl/inc/jsdialog/jsdialogbuilder.hxx7
-rw-r--r--vcl/jsdialog/jsdialogbuilder.cxx34
-rw-r--r--vcl/source/window/builder.cxx11
6 files changed, 52 insertions, 91 deletions
diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 462e2e5d25af..914885b30065 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -4057,6 +4057,8 @@ static void lcl_sendDialogEvent(unsigned long long int nWindowId, const char* pA
bFoundWeldedControl = jsdialog::ExecuteAction(std::to_string(nCurrentShellId) + "sidebar", sControlId, aMap);
if (!bFoundWeldedControl)
bFoundWeldedControl = jsdialog::ExecuteAction(std::to_string(nCurrentShellId) + "notebookbar", sControlId, aMap);
+ if (!bFoundWeldedControl)
+ bFoundWeldedControl = jsdialog::ExecuteAction(std::to_string(nCurrentShellId) + "formulabar", sControlId, aMap);
if (!bFoundWeldedControl && !SfxViewShell::Current())
{
// this is needed for dialogs shown before document is loaded: MacroWarning dialog, etc...
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
diff --git a/sc/source/ui/inc/inputwin.hxx b/sc/source/ui/inc/inputwin.hxx
index 0e056fa22c29..507d91ce5c4a 100644
--- a/sc/source/ui/inc/inputwin.hxx
+++ b/sc/source/ui/inc/inputwin.hxx
@@ -288,10 +288,7 @@ public:
virtual ~ScInputWindow() override;
virtual void dispose() override;
- virtual void Paint( vcl::RenderContext& rRenderContext, const tools::Rectangle& rRect ) override;
virtual void PixelInvalidate(const tools::Rectangle* pRectangle) override;
- virtual void setPosSizePixel( tools::Long nX, tools::Long nY, tools::Long nWidth, tools::Long nHeight,
- PosSizeFlags nFlags = PosSizeFlags::All ) override;
virtual void SetSizePixel( const Size& rNewSize ) override;
virtual void Resize() override;
virtual void Select() override;
diff --git a/vcl/inc/jsdialog/jsdialogbuilder.hxx b/vcl/inc/jsdialog/jsdialogbuilder.hxx
index e0232e32f241..08b16124a7e2 100644
--- a/vcl/inc/jsdialog/jsdialogbuilder.hxx
+++ b/vcl/inc/jsdialog/jsdialogbuilder.hxx
@@ -242,6 +242,9 @@ public:
JSInstanceBuilder(vcl::Window* pParent, const OUString& rUIRoot, const OUString& rUIFile,
const css::uno::Reference<css::frame::XFrame>& rFrame,
sal_uInt64 nWindowId = 0);
+ /// used for formulabar
+ JSInstanceBuilder(vcl::Window* pParent, const OUString& rUIRoot, const OUString& rUIFile,
+ sal_uInt64 nLOKWindowId);
static std::unique_ptr<JSInstanceBuilder>
CreateDialogBuilder(weld::Widget* pParent, const OUString& rUIRoot, const OUString& rUIFile);
@@ -255,6 +258,10 @@ public:
sal_uInt64 nLOKWindowId = 0);
static std::unique_ptr<JSInstanceBuilder>
CreatePopupBuilder(weld::Widget* pParent, const OUString& rUIRoot, const OUString& rUIFile);
+ static std::unique_ptr<JSInstanceBuilder> CreateFormulabarBuilder(vcl::Window* pParent,
+ const OUString& rUIRoot,
+ const OUString& rUIFile,
+ sal_uInt64 nLOKWindowId);
virtual ~JSInstanceBuilder() override;
virtual std::unique_ptr<weld::MessageDialog> weld_message_dialog(const OString& id) override;
diff --git a/vcl/jsdialog/jsdialogbuilder.cxx b/vcl/jsdialog/jsdialogbuilder.cxx
index 056a986ccf1f..f89d0ca0fc13 100644
--- a/vcl/jsdialog/jsdialogbuilder.cxx
+++ b/vcl/jsdialog/jsdialogbuilder.cxx
@@ -479,7 +479,8 @@ void JSDropTarget::fire_dragEnter(const css::datatransfer::dnd::DropTargetDragEn
std::string JSInstanceBuilder::getMapIdFromWindowId() const
{
- if (m_sTypeOfJSON == "sidebar" || m_sTypeOfJSON == "notebookbar")
+ if (m_sTypeOfJSON == "sidebar" || m_sTypeOfJSON == "notebookbar"
+ || m_sTypeOfJSON == "formulabar")
return std::to_string(m_nWindowId) + m_sTypeOfJSON;
else
return std::to_string(m_nWindowId);
@@ -585,6 +586,30 @@ JSInstanceBuilder::JSInstanceBuilder(vcl::Window* pParent, const OUString& rUIRo
initializeSender(GetNotifierWindow(), GetContentWindow(), GetTypeOfJSON());
}
+// used for formulabar
+JSInstanceBuilder::JSInstanceBuilder(vcl::Window* pParent, const OUString& rUIRoot,
+ const OUString& rUIFile, sal_uInt64 nLOKWindowId)
+ : SalInstanceBuilder(pParent, rUIRoot, rUIFile)
+ , m_nWindowId(nLOKWindowId)
+ , m_aParentDialog(nullptr)
+ , m_aContentWindow(nullptr)
+ , m_sTypeOfJSON("formulabar")
+ , m_bHasTopLevelDialog(false)
+ , m_bIsNotebookbar(false)
+ , m_aWindowToRelease(nullptr)
+{
+ vcl::Window* pRoot = m_xBuilder->get_widget_root();
+ m_aContentWindow = pParent;
+ if (pRoot && pRoot->GetParent())
+ {
+ m_aParentDialog = pRoot->GetParent()->GetParentWithLOKNotifier();
+ InsertWindowToMap(getMapIdFromWindowId());
+ }
+
+ initializeSender(GetNotifierWindow(), GetContentWindow(), GetTypeOfJSON());
+ sendFullUpdate();
+}
+
std::unique_ptr<JSInstanceBuilder> JSInstanceBuilder::CreateDialogBuilder(weld::Widget* pParent,
const OUString& rUIRoot,
const OUString& rUIFile)
@@ -614,6 +639,13 @@ std::unique_ptr<JSInstanceBuilder> JSInstanceBuilder::CreatePopupBuilder(weld::W
return std::make_unique<JSInstanceBuilder>(pParent, rUIRoot, rUIFile, true);
}
+std::unique_ptr<JSInstanceBuilder>
+JSInstanceBuilder::CreateFormulabarBuilder(vcl::Window* pParent, const OUString& rUIRoot,
+ const OUString& rUIFile, sal_uInt64 nLOKWindowId)
+{
+ return std::make_unique<JSInstanceBuilder>(pParent, rUIRoot, rUIFile, nLOKWindowId);
+}
+
JSInstanceBuilder::~JSInstanceBuilder()
{
if (m_aWindowToRelease)
diff --git a/vcl/source/window/builder.cxx b/vcl/source/window/builder.cxx
index fbbbb678de37..021250bed594 100644
--- a/vcl/source/window/builder.cxx
+++ b/vcl/source/window/builder.cxx
@@ -198,9 +198,14 @@ std::unique_ptr<weld::Builder> Application::CreateBuilder(weld::Widget* pParent,
std::unique_ptr<weld::Builder> Application::CreateInterimBuilder(vcl::Window* pParent, const OUString &rUIFile, bool bAllowCycleFocusOut, sal_uInt64 nLOKWindowId)
{
- // Notebookbar sub controls
- if (comphelper::LibreOfficeKit::isActive() && jsdialog::isInterimBuilderEnabledForNotebookbar(rUIFile))
- return JSInstanceBuilder::CreateNotebookbarBuilder(pParent, AllSettings::GetUIRootDir(), rUIFile, css::uno::Reference<css::frame::XFrame>(), nLOKWindowId);
+ if (comphelper::LibreOfficeKit::isActive())
+ {
+ // Notebookbar sub controls
+ if (jsdialog::isInterimBuilderEnabledForNotebookbar(rUIFile))
+ return JSInstanceBuilder::CreateNotebookbarBuilder(pParent, AllSettings::GetUIRootDir(), rUIFile, css::uno::Reference<css::frame::XFrame>(), nLOKWindowId);
+ else if (rUIFile == u"modules/scalc/ui/inputbar.ui")
+ return JSInstanceBuilder::CreateFormulabarBuilder(pParent, AllSettings::GetUIRootDir(), rUIFile, nLOKWindowId);
+ }
return ImplGetSVData()->mpDefInst->CreateInterimBuilder(pParent, AllSettings::GetUIRootDir(), rUIFile, bAllowCycleFocusOut, nLOKWindowId);
}