[Libreoffice-commits] core.git: Branch 'libreoffice-5-2' - sc/source
sll
trtle at yahoo.com
Wed Feb 15 16:43:57 UTC 2017
sc/source/ui/navipi/navipi.cxx | 28 ++++++++++++++++++++++------
1 file changed, 22 insertions(+), 6 deletions(-)
New commits:
commit 95c1c7d3b085541735f964ac3c1fff9d286baa16
Author: sll <trtle at yahoo.com>
Date: Tue Sep 6 18:18:02 2016 +0200
tdf#98493 UI : "SCENARIO SELECTION IN NAVIGATOR (sheet group)"
Change-Id: I71071ba71ce05487273ce66e64f930cd2ec7b8d0
Reviewed-on: https://gerrit.libreoffice.org/28697
Reviewed-by: Eike Rathke <erack at redhat.com>
Tested-by: Eike Rathke <erack at redhat.com>
(cherry picked from commit 1eebbd48fabbefaa52f5f223649c8d591915a884)
Reviewed-on: https://gerrit.libreoffice.org/33953
Reviewed-by: Jean-Sébastien B. <realitix at gmail.com>
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice at googlemail.com>
diff --git a/sc/source/ui/navipi/navipi.cxx b/sc/source/ui/navipi/navipi.cxx
index ce339cc..8ed6c481 100644
--- a/sc/source/ui/navipi/navipi.cxx
+++ b/sc/source/ui/navipi/navipi.cxx
@@ -958,16 +958,32 @@ void ScNavigatorDlg::SetCurrentTableStr( const OUString& rName )
if (!GetViewData()) return;
ScDocument* pDoc = pViewData->GetDocument();
- SCTAB nCount = pDoc->GetTableCount();
+ SCTAB nCount = pDoc->GetTableCount();
OUString aTabName;
+ SCTAB nLastSheet = 0;
- for ( SCTAB i=0; i<nCount; i++ )
+ for (SCTAB i = 0; i<nCount; i++)
{
- pDoc->GetName( i, aTabName );
- if ( aTabName.equals(rName) )
+ pDoc->GetName(i, aTabName);
+ if (aTabName.equals(rName))
{
- SetCurrentTable( i );
- return;
+ // Check if this is a Scenario sheet and if so select the sheet
+ // where it belongs to, which is the previous non-Scenario sheet.
+ if (pDoc->IsScenario(i))
+ {
+ SetCurrentTable(nLastSheet);
+ return;
+ }
+ else
+ {
+ SetCurrentTable(i);
+ return;
+ }
+ }
+ else
+ {
+ if (!pDoc->IsScenario(i))
+ nLastSheet = i;
}
}
}
More information about the Libreoffice-commits
mailing list