basctl/Library_basctl.mk |1
basctl/inc/strings.hrc|1
basctl/sdi/baside.sdi |1
basctl/source/basicide/LineStatusControl.cxx | 45
basctl/source/basicide/baside2.cxx| 12 +++
basctl/source/basicide/basidesh.cxx |2
basctl/source/basicide/moduldl2.cxx | 31 +++-
basctl/source/basicide/moduldlg.hxx |8 +-
basctl/source/inc/LineStatusControl.hxx | 30
basctl/uiconfig/basicide/ui/gotolinedialog.ui | 92 +++---
10 files changed, 162 insertions(+), 61 deletions(-)
New commits:
commit d9d9ec70395ed5ad8ac4b985b8c9215af7436258
Author: Rafael Lima
AuthorDate: Mon Jan 15 18:08:12 2024 +0100
Commit: Rafael Lima
CommitDate: Tue Jan 23 12:11:33 2024 +0100
tdf#158749 Open "Go to Line" dialog from the statusbar in Basic IDE
With this change, if the user clicks the StatusGetPosition item in the
status bar, the Go To Line dialog will be shown.
Change-Id: Iba75e2dbf6ba83fce24e1af237bdf9813d4ecb69
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162108
Tested-by: Jenkins
Reviewed-by: Heiko Tietze
diff --git a/basctl/Library_basctl.mk b/basctl/Library_basctl.mk
index 13d3bce29e41..cb41fa9e461c 100644
--- a/basctl/Library_basctl.mk
+++ b/basctl/Library_basctl.mk
@@ -95,6 +95,7 @@ $(eval $(call gb_Library_add_exception_objects,basctl,\
basctl/source/basicide/iderdll \
basctl/source/basicide/layout \
basctl/source/basicide/linenumberwindow \
+ basctl/source/basicide/LineStatusControl \
basctl/source/basicide/localizationmgr \
basctl/source/basicide/macrodlg \
basctl/source/basicide/moduldl2 \
diff --git a/basctl/inc/strings.hrc b/basctl/inc/strings.hrc
index 44efc2f52ed8..ee83fbb543b0 100644
--- a/basctl/inc/strings.hrc
+++ b/basctl/inc/strings.hrc
@@ -113,6 +113,7 @@
#define RID_STR_READONLYNC_("RID_STR_READONLY",
"Read-only")
#define RID_STR_MODULE_READONLY NC_("RID_STR_READONLY_WARNING",
"This module is read-only and cannot be edited.")
#define RID_STR_DIALOG_READONLY NC_("RID_STR_READONLY_WARNING",
"This dialog is read-only and cannot be edited.")
+#define RID_LINE_STATUS_CONTROL NC_("RID_LINE_STATUS_CONTROL",
"Current line and character. Click to open 'Go to Line' dialog.")
// Color scheme names
#define RID_STR_COLORSCHEME_DEFAULT NC_("RID_STR_COLORSCHEME_DEFAULT",
"Default")
diff --git a/basctl/sdi/baside.sdi b/basctl/sdi/baside.sdi
index 40ddd8b3bfd7..74b425cf6db4 100644
--- a/basctl/sdi/baside.sdi
+++ b/basctl/sdi/baside.sdi
@@ -618,6 +618,7 @@ shell basctl_Shell
SID_BASICIDE_STAT_POS
[
+ExecMethod = ExecuteGlobal;
StateMethod = GetState;
]
diff --git a/basctl/source/basicide/LineStatusControl.cxx
b/basctl/source/basicide/LineStatusControl.cxx
new file mode 100644
index ..fd716b3901f7
--- /dev/null
+++ b/basctl/source/basicide/LineStatusControl.cxx
@@ -0,0 +1,45 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+#include
+#include
+#include
+#include
+#include
+
+namespace basctl
+{
+SFX_IMPL_STATUSBAR_CONTROL(LineStatusControl, SfxStringItem);
+
+LineStatusControl::LineStatusControl(sal_uInt16 _nSlotId, sal_uInt16 _nId,
StatusBar& rStb)
+: SfxStatusBarControl(_nSlotId, _nId, rStb)
+{
+}
+
+LineStatusControl::~LineStatusControl() {}
+
+void LineStatusControl::StateChangedAtStatusBarControl(sal_uInt16 /*nSID*/,
SfxItemState eState,
+ const SfxPoolItem*
pState)
+{
+if (eState == SfxItemState::DEFAULT)
+{
+// Can access pState
+GetStatusBar().SetItemText(GetId(), static_cast(pState)->GetValue());
+GetStatusBar().SetQuickHelpText(GetId(),
IDEResId(RID_LINE_STATUS_CONTROL));
+}
+else
+{
+GetStatusBar().SetItemText(GetId(), u""_ustr);
+GetStatusBar().SetQuickHelpText(GetId(), u""_ustr);
+}
+}
+
+} // namespace basctl
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/basctl/source/basicide/baside2.cxx
b/basctl/source/basicide/baside2.cxx
index 74c25d6f4631..98f016a57236 100644
--- a/basctl/source/basicide/baside2.cxx
+++ b/basctl/source/basicide/baside2.cxx
@@ -25,6 +25,7 @@
#include
#include
#include "moduldlg.hxx"
+#include
#include
#include
#include
@@ -1027,12 +1028,15 @@ void ModulWindow::ExecuteCommand (SfxRequest& rReq)
break;
case SID_GOTOLINE:
{
-GotoLineDialog aGotoDlg(GetFrameWeld());
+