[Libreoffice-commits] core.git: sc/source
Caolán McNamara (via logerrit)
logerrit at kemper.freedesktop.org
Fri Sep 18 17:56:24 UTC 2020
sc/source/ui/inc/navipi.hxx | 1 +
sc/source/ui/navipi/navipi.cxx | 18 +++++++++++++-----
2 files changed, 14 insertions(+), 5 deletions(-)
New commits:
commit 78c255519aac33b14c6d46fb963f8ecbbb80e67c
Author: Caolán McNamara <caolanm at redhat.com>
AuthorDate: Fri Sep 18 12:45:30 2020 +0100
Commit: Caolán McNamara <caolanm at redhat.com>
CommitDate: Fri Sep 18 19:55:41 2020 +0200
ScViewData may not be available in ScNavigatorDlg ctor
e.g. launching the floating navigator before a document has been
loaded.
probably a problem since...
commit 94512c499d678e9eeca05e84361d846bbd3b6950
Date: Tue May 26 21:03:25 2020 +0200
sc: rowcol: convert more use of MAXROWCOUNT
Change-Id: I9f987c66b5a89f23e0ca02775d3bdb7b4dbf553a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103002
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm at redhat.com>
diff --git a/sc/source/ui/inc/navipi.hxx b/sc/source/ui/inc/navipi.hxx
index 903b8a7f483e..43d48dc74f59 100644
--- a/sc/source/ui/inc/navipi.hxx
+++ b/sc/source/ui/inc/navipi.hxx
@@ -147,6 +147,7 @@ private:
static ScNavigatorSettings* GetNavigatorSettings();
ScViewData* GetViewData();
+ void UpdateSheetLimits();
void UpdateColumn ( const SCCOL* pCol = nullptr );
void UpdateRow ( const SCROW* pRow = nullptr );
diff --git a/sc/source/ui/navipi/navipi.cxx b/sc/source/ui/navipi/navipi.cxx
index 1ff33a64cfd4..64b12b05902f 100644
--- a/sc/source/ui/navipi/navipi.cxx
+++ b/sc/source/ui/navipi/navipi.cxx
@@ -346,15 +346,11 @@ ScNavigatorDlg::ScNavigatorDlg(SfxBindings* pB, vcl::Window* pParent)
{
set_id("NavigatorPanelParent"); // for uitests
- GetViewData();
- ScDocument& rDoc = pViewData->GetDocument();
- m_xEdRow->set_range(1, SCNAV_MAXROW(rDoc.GetSheetLimits()));
+ UpdateSheetLimits();
m_xEdRow->set_width_chars(5);
//max rows is 1,000,000, which is too long for typical use
m_xEdRow->connect_activate(LINK(this, ScNavigatorDlg, ExecuteRowHdl));
- m_xEdCol->set_range(1, SCNAV_MAXCOL(rDoc.GetSheetLimits()));
- m_xEdCol->set_width_chars(SCNAV_COLDIGITS(rDoc.GetSheetLimits())); // 1...256...18278 or A...IV...ZZZ
m_xEdCol->connect_activate(LINK(this, ScNavigatorDlg, ExecuteColHdl));
m_xEdCol->connect_output(LINK(this, ScNavigatorDlg, FormatRowOutputHdl));
m_xEdCol->connect_input(LINK(this, ScNavigatorDlg, ParseRowInputHdl));
@@ -423,6 +419,17 @@ ScNavigatorDlg::ScNavigatorDlg(SfxBindings* pB, vcl::Window* pParent)
aExpandedSize = GetOptimalSize();
}
+void ScNavigatorDlg::UpdateSheetLimits()
+{
+ if (ScViewData* pData = GetViewData())
+ {
+ ScDocument& rDoc = pData->GetDocument();
+ m_xEdRow->set_range(1, SCNAV_MAXROW(rDoc.GetSheetLimits()));
+ m_xEdCol->set_range(1, SCNAV_MAXCOL(rDoc.GetSheetLimits()));
+ m_xEdCol->set_width_chars(SCNAV_COLDIGITS(rDoc.GetSheetLimits())); // 1...256...18278 or A...IV...ZZZ
+ }
+}
+
void ScNavigatorDlg::StateChanged(StateChangedType nStateChange)
{
PanelLayout::StateChanged(nStateChange);
@@ -474,6 +481,7 @@ void ScNavigatorDlg::Notify( SfxBroadcaster&, const SfxHint& rHint )
{
if (pHint->GetEventId() == SfxEventHintId::ActivateDoc)
{
+ UpdateSheetLimits();
m_xLbEntries->ActiveDocChanged();
UpdateAll();
}
More information about the Libreoffice-commits
mailing list