diff options
| author | sll <trtle@yahoo.com> | 2016-09-06 18:18:02 +0200 |
|---|---|---|
| committer | Christian Lohmaier <lohmaier+LibreOffice@googlemail.com> | 2017-02-15 16:43:36 +0000 |
| commit | 95c1c7d3b085541735f964ac3c1fff9d286baa16 (patch) | |
| tree | ccc45569bc53f9875e29e322a6c8282b8f5d927f | |
| parent | 4f48bab920171cd62e99ff99f67ab67ea1c38b97 (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>
(cherry picked from commit 1eebbd48fabbefaa52f5f223649c8d591915a884)
Reviewed-on: https://gerrit.libreoffice.org/33953
Reviewed-by: Jean-Sébastien B. <realitix@gmail.com>
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com>
| -rw-r--r-- | sc/source/ui/navipi/navipi.cxx | 28 |
1 files changed, 22 insertions, 6 deletions
diff --git a/sc/source/ui/navipi/navipi.cxx b/sc/source/ui/navipi/navipi.cxx index ce339ccb5ef7..8ed6c4815c08 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; } } } |
