[Libreoffice-commits] core.git: sc/inc sc/sdi sc/source sc/uiconfig

gdm.manmeet gdm.manmeet at gmail.com
Wed Mar 19 10:58:38 PDT 2014


 sc/inc/globstr.hrc                        |    4 +++-
 sc/inc/sc.hrc                             |    1 +
 sc/sdi/cellsh.sdi                         |    1 +
 sc/sdi/scalc.sdi                          |   26 ++++++++++++++++++++++++++
 sc/source/ui/src/globstr.src              |    4 ++++
 sc/source/ui/view/cellsh.cxx              |   20 ++++++++++++++++++++
 sc/source/ui/view/preview.cxx             |    1 +
 sc/source/ui/view/tabview3.cxx            |    3 +++
 sc/source/ui/view/viewfun2.cxx            |    1 +
 sc/uiconfig/scalc/statusbar/statusbar.xml |    1 +
 10 files changed, 61 insertions(+), 1 deletion(-)

New commits:
commit 82b5ded699fcc03a09b0930213da204a332285e6
Author: gdm.manmeet <gdm.manmeet at gmail.com>
Date:   Tue Mar 18 13:21:39 2014 +0530

    fdo#64290 ui:count selected rows and columns
    
    Change-Id: Ie6443fd9b1ac6332b4937c4b6b5d565cca1fe612

diff --git a/sc/inc/globstr.hrc b/sc/inc/globstr.hrc
index c402de2..3dfb79b 100644
--- a/sc/inc/globstr.hrc
+++ b/sc/inc/globstr.hrc
@@ -687,7 +687,9 @@
 #define STR_CTRLCLICKHYPERLINK      526
 #define STR_CLICKHYPERLINK          527
 
-#define SC_GLOBSTR_STR_COUNT        528     /**< the count of permanently resident strings */
+#define STR_ROWCOL_SELCOUNT         528
+
+#define SC_GLOBSTR_STR_COUNT        529     /**< the count of permanently resident strings */
 
 #endif
 
diff --git a/sc/inc/sc.hrc b/sc/inc/sc.hrc
index c776750..507255b 100644
--- a/sc/inc/sc.hrc
+++ b/sc/inc/sc.hrc
@@ -242,6 +242,7 @@
 #define SC_HINT_DOC_SAVED       (SC_MESSAGE_START + 35)
 #define SC_HINT_FORCESETTAB     (SC_MESSAGE_START + 36)
 #define SID_ENTER_STRING        (SC_MESSAGE_START + 37)
+#define SID_ROWCOL_SELCOUNT     (SC_MESSAGE_START + 38)
 
 // messages for opening dialogs:
 #define SID_OPENDLG_CONSOLIDATE     (SC_MESSAGE_START + 50)
diff --git a/sc/sdi/cellsh.sdi b/sc/sdi/cellsh.sdi
index 3e18a13..65ff899 100644
--- a/sc/sdi/cellsh.sdi
+++ b/sc/sdi/cellsh.sdi
@@ -404,6 +404,7 @@ interface CellMovement
     SID_SELECTALL   [ ExecMethod = Execute;     StateMethod = GetState;       ]
     SID_STATUS_SUM      [ ExecMethod = Execute; StateMethod = GetState; ]
     SID_STATUS_DOCPOS   [ ExecMethod = Execute; StateMethod = GetState; ]
+    SID_ROWCOL_SELCOUNT [ ExecMethod = Execute; StateMethod = GetState; ]
     SID_STATUS_SELMODE  [ ExecMethod = Execute; StateMethod = GetState; ]
     SID_STATUS_SELMODE_ERG  [ ExecMethod = Execute; ]
     SID_STATUS_SELMODE_ERW  [ ExecMethod = Execute; ]
diff --git a/sc/sdi/scalc.sdi b/sc/sdi/scalc.sdi
index ca7b225..fac4558 100644
--- a/sc/sdi/scalc.sdi
+++ b/sc/sdi/scalc.sdi
@@ -7003,6 +7003,32 @@ SfxStringItem StatusDocPos SID_STATUS_DOCPOS
     GroupId = GID_VIEW;
 ]
 
+SfxStringItem RowColSelCount SID_ROWCOL_SELCOUNT
+
+[
+    /* flags: */
+    AutoUpdate = FALSE,
+    Cachable = Cachable,
+    FastCall = FALSE,
+    HasCoreId = FALSE,
+    HasDialog = FALSE,
+    ReadOnlyDoc = TRUE,
+    Toggle = FALSE,
+    Container = FALSE,
+    RecordAbsolute = FALSE,
+    RecordPerSet;
+    Synchron;
+
+    Readonly = TRUE,
+
+    /* config: */
+    AccelConfig = FALSE,
+    MenuConfig = FALSE,
+    StatusBarConfig = TRUE,
+    ToolBoxConfig = FALSE,
+    GroupId = GID_VIEW;
+]
+
 
 SfxStringItem StatusFunction SID_STATUS_SUM
 
diff --git a/sc/source/ui/src/globstr.src b/sc/source/ui/src/globstr.src
index 47c5d94..82eb914 100644
--- a/sc/source/ui/src/globstr.src
+++ b/sc/source/ui/src/globstr.src
@@ -585,6 +585,10 @@ Resource RID_GLOBSTR
     {
         Text [ en-US ] = "Sheet" ;
     };
+    String STR_ROWCOL_SELCOUNT
+    {
+        Text [ en-US ] = "Selected $1 rows, $2 columns";
+    };
     String STR_COLUMN
     {
         Text [ en-US ] = "Column" ;
diff --git a/sc/source/ui/view/cellsh.cxx b/sc/source/ui/view/cellsh.cxx
index dfea350..3cd823c 100644
--- a/sc/source/ui/view/cellsh.cxx
+++ b/sc/source/ui/view/cellsh.cxx
@@ -679,6 +679,26 @@ void ScCellShell::GetState(SfxItemSet &rSet)
                 }
                 break;
 
+            case SID_ROWCOL_SELCOUNT:
+                {
+                    ScRange aMarkRange;
+                    GetViewData()->GetSimpleArea( aMarkRange );
+                    SCCOL nCol1, nCol2;
+                    SCROW nRow1, nRow2;
+                    nCol1 = aMarkRange.aStart.Col();
+                    nRow1 = aMarkRange.aStart.Row();
+                    nCol2 = aMarkRange.aEnd.Col();
+                    nRow2 = aMarkRange.aEnd.Row();
+                    if( nCol2 != nCol1 || nRow1 != nRow2 )
+                    {
+                        OUString aStr = ScGlobal::GetRscString( STR_ROWCOL_SELCOUNT );
+                        aStr = aStr.replaceAll( "$1", OUString::number( nRow2 - nRow1 + 1 ));
+                        aStr = aStr.replaceAll( "$2", OUString::number( nCol2 - nCol1 + 1 ));
+                        rSet.Put( SfxStringItem( nWhich, aStr ) );
+                    }
+                }
+                break;
+
             //  calculations etc. with date/time/Fail/position&size together
 
             // #i34458# The SfxStringItem belongs only into SID_TABLE_CELL. It no longer has to be
diff --git a/sc/source/ui/view/preview.cxx b/sc/source/ui/view/preview.cxx
index 013d92b..5d2b015 100644
--- a/sc/source/ui/view/preview.cxx
+++ b/sc/source/ui/view/preview.cxx
@@ -867,6 +867,7 @@ void ScPreview::StaticInvalidate()
 
     SfxBindings& rBindings = pViewFrm->GetBindings();
     rBindings.Invalidate(SID_STATUS_DOCPOS);
+    rBindings.Invalidate(SID_ROWCOL_SELCOUNT);
     rBindings.Invalidate(SID_STATUS_PAGESTYLE);
     rBindings.Invalidate(SID_PREVIEW_PREVIOUS);
     rBindings.Invalidate(SID_PREVIEW_NEXT);
diff --git a/sc/source/ui/view/tabview3.cxx b/sc/source/ui/view/tabview3.cxx
index 255dfb9..61d4520 100644
--- a/sc/source/ui/view/tabview3.cxx
+++ b/sc/source/ui/view/tabview3.cxx
@@ -355,6 +355,7 @@ void ScTabView::CellContentChanged()
     rBindings.Invalidate( SID_ATTR_SIZE );      // -> Fehlermeldungen anzeigen
     rBindings.Invalidate( SID_THESAURUS );
     rBindings.Invalidate( SID_HYPERLINK_GETLINK );
+    rBindings.Invalidate( SID_ROWCOL_SELCOUNT );
 
     InvalidateAttribs();                    // Attribut-Updates
 
@@ -385,6 +386,7 @@ void ScTabView::SelectionChanged()
     rBindings.Invalidate( FID_SHOW_NOTE );
     rBindings.Invalidate( FID_HIDE_NOTE );
     rBindings.Invalidate( SID_DELETE_NOTE );
+    rBindings.Invalidate( SID_ROWCOL_SELCOUNT );
 
         //  Funktionen, die evtl disabled werden muessen
 
@@ -1748,6 +1750,7 @@ void ScTabView::SetTabNo( SCTAB nTab, bool bNew, bool bExtendSelection, bool bSa
         rBindings.Invalidate( FID_DEL_MANUALBREAKS );
         rBindings.Invalidate( FID_RESET_PRINTZOOM );
         rBindings.Invalidate( SID_STATUS_DOCPOS );      // Statusbar
+        rBindings.Invalidate( SID_ROWCOL_SELCOUNT );    // Statusbar
         rBindings.Invalidate( SID_STATUS_PAGESTYLE );   // Statusbar
         rBindings.Invalidate( SID_CURRENTTAB );         // Navigator
         rBindings.Invalidate( SID_STYLE_FAMILY2 );  // Gestalter
diff --git a/sc/source/ui/view/viewfun2.cxx b/sc/source/ui/view/viewfun2.cxx
index 0ddaecf..22bdc79 100644
--- a/sc/source/ui/view/viewfun2.cxx
+++ b/sc/source/ui/view/viewfun2.cxx
@@ -1874,6 +1874,7 @@ void ScViewFunc::MakeScenario( const OUString& rName, const OUString& rComment,
     {
         SfxBindings& rBindings = GetViewData()->GetBindings();
         rBindings.Invalidate( SID_STATUS_DOCPOS );      // Statusbar
+        rBindings.Invalidate( SID_ROWCOL_SELCOUNT );    // Statusbar
         rBindings.Invalidate( SID_TABLES_COUNT );
         rBindings.Invalidate( SID_SELECT_SCENARIO );
         rBindings.Invalidate( FID_TABLE_SHOW );
diff --git a/sc/uiconfig/scalc/statusbar/statusbar.xml b/sc/uiconfig/scalc/statusbar/statusbar.xml
index 55d2f13..79a746f 100644
--- a/sc/uiconfig/scalc/statusbar/statusbar.xml
+++ b/sc/uiconfig/scalc/statusbar/statusbar.xml
@@ -19,6 +19,7 @@
 -->
 <statusbar:statusbar xmlns:statusbar="http://openoffice.org/2001/statusbar" xmlns:xlink="http://www.w3.org/1999/xlink">
  <statusbar:statusbaritem xlink:href=".uno:StatusDocPos" statusbar:align="left" statusbar:autosize="true" statusbar:width="58"/>
+ <statusbar:statusbaritem xlink:href=".uno:RowColSelCount" statusbar:align="left" statusbar:autosize="true" statusbar:width="58"/>
  <statusbar:statusbaritem xlink:href=".uno:StatusPageStyle" statusbar:align="left" statusbar:autosize="true" statusbar:width="83"/>
  <statusbar:statusbaritem xlink:href=".uno:InsertMode" statusbar:align="center" statusbar:width="55"/>
  <statusbar:statusbaritem xlink:href=".uno:StatusSelectionMode" statusbar:align="center" statusbar:ownerdraw="true" statusbar:width="16"/>


More information about the Libreoffice-commits mailing list