From 4b8186dbe41677c5c7ee156c586f3295dab7528c Mon Sep 17 00:00:00 2001 From: Kohei Yoshida Date: Thu, 3 May 2012 14:48:34 -0400 Subject: Add menu entries for sheet name and date field items. Change-Id: I5ae910d455a7364209a203c2e3567a902e1f01a2 --- .../data/org/openoffice/Office/UI/CalcCommands.xcu | 9 ++++++-- sc/inc/sc.hrc | 3 ++- sc/sdi/editsh.sdi | 3 ++- sc/sdi/scalc.sdi | 26 +++++++++++++++++++++- sc/source/ui/src/popup.src | 9 ++++++-- sc/source/ui/view/editsh.cxx | 12 ++++++++-- 6 files changed, 53 insertions(+), 9 deletions(-) diff --git a/officecfg/registry/data/org/openoffice/Office/UI/CalcCommands.xcu b/officecfg/registry/data/org/openoffice/Office/UI/CalcCommands.xcu index c1f1aa30ea78..97fcfc86e4e8 100644 --- a/officecfg/registry/data/org/openoffice/Office/UI/CalcCommands.xcu +++ b/officecfg/registry/data/org/openoffice/Office/UI/CalcCommands.xcu @@ -1514,9 +1514,14 @@ 1 - + - Insert Field Test + Insert Sheet Name Field + + + + + Insert Date Field (variable) diff --git a/sc/inc/sc.hrc b/sc/inc/sc.hrc index 1e8b0330e1da..f7a556d0594d 100644 --- a/sc/inc/sc.hrc +++ b/sc/inc/sc.hrc @@ -716,7 +716,8 @@ #define SID_DELETE_SCENARIO (SID_NEW_SLOTS+95) #define SID_EDIT_SCENARIO (SID_NEW_SLOTS+96) -#define SID_INSERT_FIELD_TEST (SID_NEW_SLOTS+97) +#define SID_INSERT_FIELD_SHEET (SID_NEW_SLOTS+97) +#define SID_INSERT_FIELD_DATE_VAR (SID_NEW_SLOTS+98) // idl parameter diff --git a/sc/sdi/editsh.sdi b/sc/sdi/editsh.sdi index c896cc4bdc7c..d306091fa94b 100644 --- a/sc/sdi/editsh.sdi +++ b/sc/sdi/editsh.sdi @@ -99,7 +99,8 @@ interface TableText SID_INSERT_ZWSP [ ExecMethod = Execute; StateMethod = GetState; Export = FALSE; ] SID_INSERT_ZWNBSP [ ExecMethod = Execute; StateMethod = GetState; Export = FALSE; ] - SID_INSERT_FIELD_TEST [ ExecMethod = Execute; StateMethod = GetState; ] + SID_INSERT_FIELD_SHEET [ ExecMethod = Execute; StateMethod = GetState; ] + SID_INSERT_FIELD_DATE_VAR [ ExecMethod = Execute; StateMethod = GetState; ] } diff --git a/sc/sdi/scalc.sdi b/sc/sdi/scalc.sdi index 9ca1858f4ec8..e9a0b7a5c383 100644 --- a/sc/sdi/scalc.sdi +++ b/sc/sdi/scalc.sdi @@ -8001,7 +8001,31 @@ SfxVoidItem SetTabBgColor FID_TAB_MENU_SET_TAB_BG_COLOR GroupId = GID_FORMAT; ] -SfxVoidItem InsertFieldTest SID_INSERT_FIELD_TEST +SfxVoidItem InsertFieldSheet SID_INSERT_FIELD_SHEET +() +[ + /* flags: */ + AutoUpdate = FALSE, + Cachable = Cachable, + FastCall = FALSE, + HasCoreId = FALSE, + HasDialog = FALSE, + ReadOnlyDoc = TRUE, + Toggle = FALSE, + Container = FALSE, + RecordAbsolute = FALSE, + RecordPerSet; + Synchron; + + /* config: */ + AccelConfig = TRUE, + MenuConfig = TRUE, + StatusBarConfig = FALSE, + ToolBoxConfig = FALSE, + GroupId = GID_OPTIONS; +] + +SfxVoidItem InsertFieldDateVariable SID_INSERT_FIELD_DATE_VAR () [ /* flags: */ diff --git a/sc/source/ui/src/popup.src b/sc/source/ui/src/popup.src index 66e84bf61a64..67f4089a3380 100644 --- a/sc/source/ui/src/popup.src +++ b/sc/source/ui/src/popup.src @@ -438,8 +438,13 @@ Menu RID_POPUP_EDIT { MenuItem { - Identifier = SID_INSERT_FIELD_TEST ; - Text [ en-US ] = "Test Field"; + Identifier = SID_INSERT_FIELD_DATE_VAR ; + Text [ en-US ] = "Date" ; + }; + MenuItem + { + Identifier = SID_INSERT_FIELD_SHEET ; + Text [ en-US ] = "Sheet Name" ; }; }; }; diff --git a/sc/source/ui/view/editsh.cxx b/sc/source/ui/view/editsh.cxx index cf479772b8b5..adb60bb5a485 100644 --- a/sc/source/ui/view/editsh.cxx +++ b/sc/source/ui/view/editsh.cxx @@ -614,13 +614,20 @@ void ScEditShell::Execute( SfxRequest& rReq ) case SID_INSERT_ZWNBSP: lclInsertCharacter( pTableView, pTopView, CHAR_ZWNBSP ); break; - case SID_INSERT_FIELD_TEST: + case SID_INSERT_FIELD_SHEET: { SvxTableField aField(pViewData->GetTabNo()); SvxFieldItem aItem(aField, EE_FEATURE_FIELD); pTableView->InsertField(aItem); } break; + case SID_INSERT_FIELD_DATE_VAR: + { + SvxDateField aField; + SvxFieldItem aItem(aField, EE_FEATURE_FIELD); + pTableView->InsertField(aItem); + } + break; } pHdl->DataChanged(); @@ -721,7 +728,8 @@ void ScEditShell::GetState( SfxItemSet& rSet ) rSet.DisableItem( SID_THES ); } break; - case SID_INSERT_FIELD_TEST: + case SID_INSERT_FIELD_SHEET: + case SID_INSERT_FIELD_DATE_VAR: break; } -- cgit v1.2.3