Date: prev next · Thread: first prev next last
2013 Archives by date, by thread · List index


Hi,

I have submitted a patch for review:

    https://gerrit.libreoffice.org/2053

To pull it, you can do:

    git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/53/2053/1

calc : multiple tabs can be hidden at once

Change-Id: I445eccc188f1817006cb425dc9a0e92a25350ec8
---
M sc/source/ui/view/tabvwshf.cxx
1 file changed, 22 insertions(+), 23 deletions(-)



diff --git a/sc/source/ui/view/tabvwshf.cxx b/sc/source/ui/view/tabvwshf.cxx
index 89585dd..3a66768 100644
--- a/sc/source/ui/view/tabvwshf.cxx
+++ b/sc/source/ui/view/tabvwshf.cxx
@@ -109,33 +109,33 @@
                 ScMarkData& rMark = pViewData->GetMarkData();
                 SCTAB nTabSelCount = rMark.GetSelectCount();
                 sal_uInt16 nVis = 0;
-                for ( SCTAB i=0; i < nTabCount && nVis<2; i++ )
+                for ( SCTAB i=0; i < nTabCount && nVis<nTabSelCount + 1; i++ )
                     if (pDoc->IsVisible(i))
                         ++nVis;
-                if ( nVis<2 || !pDoc->IsDocEditable() || nTabSelCount > 1 )
+                if ( nVis<=nTabSelCount || !pDoc->IsDocEditable() )
                     break;
 
-
                 rtl::OUString aName;
-                if( pReqArgs != NULL )
-                {
-                    const SfxPoolItem* pItem;
-                    if( pReqArgs->HasItem( FID_TABLE_HIDE, &pItem ) )
-                        aName = ((const SfxStringItem*)pItem)->GetValue();
-                }
-
-                if (aName.isEmpty())
-                {
-                    pDoc->GetName( nCurrentTab, aName );        // aktuelle Tabelle
-                    rReq.AppendItem( SfxStringItem( FID_TABLE_HIDE, aName ) );
-                }
-
                 SCTAB nHideTab;
-                if (pDoc->GetTable( aName, nHideTab ))
-                    HideTable( nHideTab );
+                ScMarkData::MarkedTabsType selectedTabs = rMark.GetSelectedTabs();
 
-                if( ! rReq.IsAPI() )
-                    rReq.Done();
+                ScMarkData::MarkedTabsType::const_iterator it;
+                it = selectedTabs.begin();
+                while (it != selectedTabs.end())
+                {
+                    nHideTab = *it;
+
+                    pDoc->GetName( nHideTab, aName );
+                    rReq.AppendItem( SfxStringItem( FID_TABLE_HIDE, aName ) );
+
+                    if (pDoc->GetTable( aName, nHideTab ))
+                        HideTable( nHideTab );
+
+                    if( ! rReq.IsAPI() )
+                        rReq.Done();
+
+                    it++;
+                }
             }
             break;
 
@@ -841,11 +841,10 @@
             case FID_TABLE_HIDE:
                 {
                     sal_uInt16 nVis = 0;
-                    for ( SCTAB i=0; i < nTabCount && nVis<2; i++ )
+                    for ( SCTAB i=0; i < nTabCount && nVis<nTabSelCount + 1; i++ )
                         if (pDoc->IsVisible(i))
                             ++nVis;
-
-                    if ( nVis<2 || !pDoc->IsDocEditable() || nTabSelCount > 1 )
+                    if ( nVis<=nTabSelCount || !pDoc->IsDocEditable() )
                         rSet.DisableItem( nWhich );
                 }
                 break;

-- 
To view, visit https://gerrit.libreoffice.org/2053
To unsubscribe, visit https://gerrit.libreoffice.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I445eccc188f1817006cb425dc9a0e92a25350ec8
Gerrit-PatchSet: 1
Gerrit-Project: core
Gerrit-Branch: master
Gerrit-Owner: Laurent Godard <lgodard.libre@laposte.net>

Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.