summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel Power <noel.power@novell.com>2012-04-23 23:14:13 +0100
committerNoel Power <noel.power@novell.com>2012-04-23 23:16:19 +0100
commit60cea1f49ec6781e541fbd7949c4271d213d3e0d (patch)
tree03e4f18cbe85adebf750443a22b9b75b21c86985
parentbf286107121648bb90c582ac2d56001161915ce4 (diff)
tweak paste-only context menu ( add paste only number )
changed the text to really only paste text, also added pasteonly | number
-rw-r--r--sc/sdi/cellsh.sdi1
-rw-r--r--sc/source/ui/src/popup.src6
-rw-r--r--sc/source/ui/view/cellsh.cxx2
-rw-r--r--sc/source/ui/view/cellsh1.cxx7
-rw-r--r--sfx2/inc/sfx2/sfxcommands.h1
-rw-r--r--sfx2/inc/sfx2/sfxsids.hrc2
-rw-r--r--sfx2/sdi/sfx.sdi24
7 files changed, 40 insertions, 3 deletions
diff --git a/sc/sdi/cellsh.sdi b/sc/sdi/cellsh.sdi
index 4f586e88523a..ebcf86e11e67 100644
--- a/sc/sdi/cellsh.sdi
+++ b/sc/sdi/cellsh.sdi
@@ -163,6 +163,7 @@ interface CellSelection
SID_PASTE_ONLY [ ExecMethod = ExecuteEdit; StateMethod = GetClipState; ]
SID_PASTE_ONLY_TEXT [ ExecMethod = ExecuteEdit; StateMethod = GetClipState; ]
SID_PASTE_ONLY_FORMULA [ ExecMethod = ExecuteEdit; StateMethod = GetClipState; ]
+ SID_PASTE_ONLY_VALUE [ ExecMethod = ExecuteEdit; StateMethod = GetClipState; ]
SID_CLIPBOARD_FORMAT_ITEMS [ ExecMethod = ExecuteEdit; StateMethod = GetClipState; ]
SID_EXTERNAL_SOURCE [ ExecMethod = ExecuteEdit; StateMethod = GetBlockState; ]
FID_MERGE_ON [ ExecMethod = Execute; StateMethod = GetState; ]
diff --git a/sc/source/ui/src/popup.src b/sc/source/ui/src/popup.src
index de6fba55376e..6e27ce38ac49 100644
--- a/sc/source/ui/src/popup.src
+++ b/sc/source/ui/src/popup.src
@@ -151,6 +151,12 @@ Menu RID_POPUP_CELLS
};
MenuItem
{
+ Identifier = SID_PASTE_ONLY_VALUE ;
+ HelpId = CMD_SID_PASTE_ONLY_VALUE ;
+ Text [ en-US ] = "~Number" ;
+ };
+ MenuItem
+ {
Identifier = SID_PASTE_ONLY_FORMULA ;
HelpId = CMD_SID_PASTE_ONLY_FORMULA ;
Text [ en-US ] = "~Formula" ;
diff --git a/sc/source/ui/view/cellsh.cxx b/sc/source/ui/view/cellsh.cxx
index 0d76bb7494f5..bb1887847387 100644
--- a/sc/source/ui/view/cellsh.cxx
+++ b/sc/source/ui/view/cellsh.cxx
@@ -449,6 +449,7 @@ IMPL_LINK( ScCellShell, ClipboardChanged, TransferableDataHelper*, pDataHelper )
SfxBindings& rBindings = GetViewData()->GetBindings();
rBindings.Invalidate( SID_PASTE );
rBindings.Invalidate( SID_PASTE_SPECIAL );
+ rBindings.Invalidate( SID_PASTE_ONLY_VALUE );
rBindings.Invalidate( SID_PASTE_ONLY_TEXT );
rBindings.Invalidate( SID_PASTE_ONLY_FORMULA );
rBindings.Invalidate( SID_CLIPBOARD_FORMAT_ITEMS );
@@ -539,6 +540,7 @@ void ScCellShell::GetClipState( SfxItemSet& rSet )
{
rSet.DisableItem( SID_PASTE );
rSet.DisableItem( SID_PASTE_SPECIAL );
+ rSet.DisableItem( SID_PASTE_ONLY_VALUE );
rSet.DisableItem( SID_PASTE_ONLY_TEXT );
rSet.DisableItem( SID_PASTE_ONLY_FORMULA );
rSet.DisableItem( SID_CLIPBOARD_FORMAT_ITEMS );
diff --git a/sc/source/ui/view/cellsh1.cxx b/sc/source/ui/view/cellsh1.cxx
index 35c162f8b821..7c650c42b9d3 100644
--- a/sc/source/ui/view/cellsh1.cxx
+++ b/sc/source/ui/view/cellsh1.cxx
@@ -1369,6 +1369,7 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq )
}
pTabViewShell->CellContentChanged(); // => PasteFromXXX ???
break;
+ case SID_PASTE_ONLY_VALUE:
case SID_PASTE_ONLY_TEXT:
case SID_PASTE_ONLY_FORMULA:
{
@@ -1377,8 +1378,10 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq )
{
rReq.SetSlot( FID_INS_CELL_CONTENTS );
rtl::OUString aFlags;
- if ( nSlot == SID_PASTE_ONLY_TEXT )
- aFlags = "VDS";
+ if ( nSlot == SID_PASTE_ONLY_VALUE )
+ aFlags = "V";
+ else if ( nSlot == SID_PASTE_ONLY_TEXT )
+ aFlags = "S";
else
aFlags = "F";
rReq.AppendItem( SfxStringItem( FID_INS_CELL_CONTENTS, aFlags ) );
diff --git a/sfx2/inc/sfx2/sfxcommands.h b/sfx2/inc/sfx2/sfxcommands.h
index e6e22c296f00..cb41efe51182 100644
--- a/sfx2/inc/sfx2/sfxcommands.h
+++ b/sfx2/inc/sfx2/sfxcommands.h
@@ -202,6 +202,7 @@
#define CMD_SID_CLIPBOARD_FORMAT_ITEMS ".uno:ClipboardFormatItems"
#define CMD_SID_PASTE_SPECIAL ".uno:PasteSpecial"
#define CMD_SID_PASTE_ONLY ".uno:PasteOnly"
+#define CMD_SID_PASTE_ONLY_VALUE ".uno:PasteOnlyValue"
#define CMD_SID_PASTE_ONLY_TEXT ".uno:PasteOnlyText"
#define CMD_SID_PASTE_ONLY_FORMULA ".uno:PasteOnlyFormula"
#define CMD_SID_DOCPATH ".uno:DocPath"
diff --git a/sfx2/inc/sfx2/sfxsids.hrc b/sfx2/inc/sfx2/sfxsids.hrc
index 94b2ea6cbcbd..c6fbdc4dfa70 100644
--- a/sfx2/inc/sfx2/sfxsids.hrc
+++ b/sfx2/inc/sfx2/sfxsids.hrc
@@ -539,7 +539,7 @@
#define SID_PASTE_ONLY (SID_SFX_START + 801)
#define SID_PASTE_ONLY_TEXT (SID_SFX_START + 802)
#define SID_PASTE_ONLY_FORMULA (SID_SFX_START + 803)
- // FREE: SID_SFX_START + 804
+#define SID_PASTE_ONLY_VALUE (SID_SFX_START + 804)
// FREE: SID_SFX_START + 805
// FREE: SID_SFX_START + 806
// FREE: SID_SFX_START + 807
diff --git a/sfx2/sdi/sfx.sdi b/sfx2/sdi/sfx.sdi
index 00885e357990..7ae6fd27bbd8 100644
--- a/sfx2/sdi/sfx.sdi
+++ b/sfx2/sdi/sfx.sdi
@@ -4702,6 +4702,30 @@ SfxVoidItem PasteOnlyFormula SID_PASTE_ONLY_FORMULA
GroupId = GID_EDIT;
]
+SfxVoidItem PasteOnlyValue SID_PASTE_ONLY_VALUE
+
+[
+ /* 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 = TRUE,
+ GroupId = GID_EDIT;
+]
+
//--------------------------------------------------------------------------
SfxStringItem DocPath SID_DOCPATH