sc/source/ui/dbgui/validate.cxx |   12 +++++++++++-
 sc/source/ui/view/cellsh2.cxx   |    2 --
 2 files changed, 11 insertions(+), 3 deletions(-)

New commits:
commit 8cdb25a38530319e0b08d97d2706ff019797fe08
Author: Laurent Balland-Poirier <laurent.balland-poir...@laposte.net>
Date:   Sat Sep 27 07:59:04 2014 +0200

    fdo#53920 Switch back tab at RefButton closure time
    
    Bug occurs because visible tab is not the initial tab. So, instead of
    switching back to initial tab at dialog closure time (removed from
    cellsh2.cxx), this commit proposes that switching back to initial tab
    is operate when expanding the RefButton shrink dialog.
    
    Reviewed-on: https://gerrit.libreoffice.org/11660
    Reviewed-by: Kohei Yoshida <libreoff...@kohei.us>
    Tested-by: Kohei Yoshida <libreoff...@kohei.us>
    (cherry picked from commit 31432c4469e7e0d05516143533d6b5e0b411dda3)
    
    Change-Id: I3cf7ed14054fa69881d4ecbc55c48dfbfc4356aa

diff --git a/sc/source/ui/dbgui/validate.cxx b/sc/source/ui/dbgui/validate.cxx
index 84a62f88..055e81c 100644
--- a/sc/source/ui/dbgui/validate.cxx
+++ b/sc/source/ui/dbgui/validate.cxx
@@ -145,11 +145,21 @@ void            ScTPValidationValue::RefInputDonePostHdl()
     }
 
     if ( ScValidationDlg *pValidationDlg = GetValidationDlg() )
+    {
         pValidationDlg->get_refinput_shrink_parent()->Hide();
+        ScViewData* pViewData = 
pValidationDlg->GetTabViewShell()->GetViewData();
+        SCTAB nCurTab = pViewData->GetTabNo();
+        SCTAB nRefTab = pViewData->GetRefTabNo();
+        // If RefInput switched to a different sheet from the data sheet,
+        // switch back: fdo#53920
+        if ( nCurTab != nRefTab )
+        {
+             pViewData->GetViewShell()->SetTabNo( nRefTab );
+        }
+    }
 
     if( m_pRefEdit && !m_pRefEdit->HasFocus() )
         m_pRefEdit->GrabFocus();
-
 }
 
 sal_Bool ScValidationDlg::Close()
diff --git a/sc/source/ui/view/cellsh2.cxx b/sc/source/ui/view/cellsh2.cxx
index a93761c..2e95cf1 100644
--- a/sc/source/ui/view/cellsh2.cxx
+++ b/sc/source/ui/view/cellsh2.cxx
@@ -852,8 +852,6 @@ void ScCellShell::ExecuteDB( SfxRequest& rReq )
                     OSL_ENSURE(pDlg, "Dialog create fail!");
 
                     short nResult = pDlg->Execute();
-                    //When picking Cell Range, other Tab may be switched. Need 
restore the correct tab
-                    pTabViewShell->SetTabNo( nTab );
                     if ( nResult == RET_OK )
                     {
                         const SfxItemSet* pOutSet = pDlg->GetOutputItemSet();
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to