sc/source/ui/navipi/navipi.cxx | 28 ++++++++++++++++++++++------ 1 file changed, 22 insertions(+), 6 deletions(-)
New commits: commit 1eebbd48fabbefaa52f5f223649c8d591915a884 Author: sll <tr...@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 <er...@redhat.com> Tested-by: Eike Rathke <er...@redhat.com> diff --git a/sc/source/ui/navipi/navipi.cxx b/sc/source/ui/navipi/navipi.cxx index 10573c1..73ee425 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; } } } _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits