summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsll <trtle@yahoo.com>2016-09-06 18:18:02 +0200
committerEike Rathke <erack@redhat.com>2016-09-16 15:01:46 +0000
commit1eebbd48fabbefaa52f5f223649c8d591915a884 (patch)
treeaa5be56dc6fb57f2248e5969cc7a0aae8455e3cc
parentd9cff00683d31fbd4b3c4c2d6afbe164f4a85d47 (diff)
tdf#98493 UI : "SCENARIO SELECTION IN NAVIGATOR (sheet group)"
Change-Id: I71071ba71ce05487273ce66e64f930cd2ec7b8d0 Reviewed-on: https://gerrit.libreoffice.org/28697 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Eike Rathke <erack@redhat.com>
-rw-r--r--sc/source/ui/navipi/navipi.cxx28
1 files changed, 22 insertions, 6 deletions
diff --git a/sc/source/ui/navipi/navipi.cxx b/sc/source/ui/navipi/navipi.cxx
index 10573c15681f..73ee425b8ada 100644
--- a/sc/source/ui/navipi/navipi.cxx
+++ b/sc/source/ui/navipi/navipi.cxx
@@ -955,16 +955,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;
}
}
}