diff options
author | gdm.manmeet <gdm.manmeet@gmail.com> | 2014-03-18 13:21:39 +0530 |
---|---|---|
committer | Jan Holesovsky <kendy@collabora.com> | 2014-03-19 18:58:09 +0100 |
commit | 82b5ded699fcc03a09b0930213da204a332285e6 (patch) | |
tree | 0f8a6f67fb330c64668b5e2e01f99e7d6c5e03c9 | |
parent | 5b3c93141253e224a8beaae415c88b6378c9919e (diff) |
fdo#64290 ui:count selected rows and columns
Change-Id: Ie6443fd9b1ac6332b4937c4b6b5d565cca1fe612
-rw-r--r-- | sc/inc/globstr.hrc | 4 | ||||
-rw-r--r-- | sc/inc/sc.hrc | 1 | ||||
-rw-r--r-- | sc/sdi/cellsh.sdi | 1 | ||||
-rw-r--r-- | sc/sdi/scalc.sdi | 26 | ||||
-rw-r--r-- | sc/source/ui/src/globstr.src | 4 | ||||
-rw-r--r-- | sc/source/ui/view/cellsh.cxx | 20 | ||||
-rw-r--r-- | sc/source/ui/view/preview.cxx | 1 | ||||
-rw-r--r-- | sc/source/ui/view/tabview3.cxx | 3 | ||||
-rw-r--r-- | sc/source/ui/view/viewfun2.cxx | 1 | ||||
-rw-r--r-- | sc/uiconfig/scalc/statusbar/statusbar.xml | 1 |
10 files changed, 61 insertions, 1 deletions
diff --git a/sc/inc/globstr.hrc b/sc/inc/globstr.hrc index c402de22d80a..3dfb79b3b6f8 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 c776750b9e13..507255bdb384 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 3e18a13ccd91..65ff8994e8e8 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 ca7b22563a39..fac4558e9d40 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 47c5d94f5d72..82eb914e14db 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 dfea35039125..3cd823c540ff 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 013d92bdd845..5d2b015dbed7 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 255dfb982218..61d4520355bb 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 0ddaecf34901..22bdc79ca58c 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 55d2f13f4ecc..79a746fa2e99 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"/> |