[Libreoffice-commits] .: sc/sdi sc/source sfx2/inc sfx2/sdi
sc/sdi/cellsh.sdi |1 + sc/source/ui/src/popup.src|6 ++ sc/source/ui/view/cellsh.cxx |2 ++ sc/source/ui/view/cellsh1.cxx |7 +-- sfx2/inc/sfx2/sfxcommands.h |1 + sfx2/inc/sfx2/sfxsids.hrc |2 +- sfx2/sdi/sfx.sdi | 24 7 files changed, 40 insertions(+), 3 deletions(-) New commits: commit 60cea1f49ec6781e541fbd7949c4271d213d3e0d Author: Noel Power noel.po...@novell.com Date: Mon Apr 23 23:14:13 2012 +0100 tweak paste-only context menu ( add paste only number ) changed the text to really only paste text, also added pasteonly | number diff --git a/sc/sdi/cellsh.sdi b/sc/sdi/cellsh.sdi index 4f586e8..ebcf86e 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 de6fba5..6e27ce3 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 0d76bb7..bb18878 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 35c162f..7c650c4 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 e6e22c2..cb41efe 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
[Libreoffice-commits] .: sc/sdi sc/source sfx2/inc sfx2/sdi
sc/sdi/cellsh.sdi |3 + sc/source/ui/src/popup.src| 25 ++ sc/source/ui/view/cellsh.cxx |4 ++ sc/source/ui/view/cellsh1.cxx | 24 +- sfx2/inc/sfx2/sfxcommands.h |3 + sfx2/inc/sfx2/sfxsids.hrc |6 +-- sfx2/sdi/sfx.sdi | 72 ++ 7 files changed, 133 insertions(+), 4 deletions(-) New commits: commit 710d768aafd6b2c1fdc5627bede25000c3e346d5 Author: Noel Power noel.po...@novell.com Date: Thu Mar 29 19:42:54 2012 +0100 add for calc extra paste ctx menu with options to paste text or formula only diff --git a/sc/sdi/cellsh.sdi b/sc/sdi/cellsh.sdi index ce942e2..4f586e8 100644 --- a/sc/sdi/cellsh.sdi +++ b/sc/sdi/cellsh.sdi @@ -160,6 +160,9 @@ interface CellSelection SID_COPY[ ExecMethod = ExecuteEdit; StateMethod = GetBlockState; ] SID_PASTE [ ExecMethod = ExecuteEdit; StateMethod = GetClipState; ] SID_PASTE_SPECIAL [ ExecMethod = ExecuteEdit; StateMethod = GetClipState; ] +SID_PASTE_ONLY [ ExecMethod = ExecuteEdit; StateMethod = GetClipState; ] +SID_PASTE_ONLY_TEXT [ ExecMethod = ExecuteEdit; StateMethod = GetClipState; ] +SID_PASTE_ONLY_FORMULA [ 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 441c336..de6fba5 100644 --- a/sc/source/ui/src/popup.src +++ b/sc/source/ui/src/popup.src @@ -133,6 +133,31 @@ Menu RID_POPUP_CELLS HelpId = CMD_SID_PASTE_SPECIAL ; Text [ en-US ] = P~aste Special... ; }; + +MenuItem +{ +Identifier = SID_PASTE_ONLY ; +HelpId = CMD_SID_PASTE_ONLY ; +Text [ en-US ] = Paste O~nly ; +SubMenu = Menu +{ +ItemList = +{ +MenuItem +{ +Identifier = SID_PASTE_ONLY_TEXT ; +HelpId = CMD_SID_PASTE_ONLY_TEXT ; +Text [ en-US ] = ~Text ; +}; +MenuItem +{ +Identifier = SID_PASTE_ONLY_FORMULA ; +HelpId = CMD_SID_PASTE_ONLY_FORMULA ; +Text [ en-US ] = ~Formula ; +}; +}; +}; +}; //-- MenuItem { Separator = TRUE ; }; //-- diff --git a/sc/source/ui/view/cellsh.cxx b/sc/source/ui/view/cellsh.cxx index c1e5670..0d76bb7 100644 --- a/sc/source/ui/view/cellsh.cxx +++ b/sc/source/ui/view/cellsh.cxx @@ -449,6 +449,8 @@ IMPL_LINK( ScCellShell, ClipboardChanged, TransferableDataHelper*, pDataHelper ) SfxBindings rBindings = GetViewData()-GetBindings(); rBindings.Invalidate( SID_PASTE ); rBindings.Invalidate( SID_PASTE_SPECIAL ); +rBindings.Invalidate( SID_PASTE_ONLY_TEXT ); +rBindings.Invalidate( SID_PASTE_ONLY_FORMULA ); rBindings.Invalidate( SID_CLIPBOARD_FORMAT_ITEMS ); } return 0; @@ -537,6 +539,8 @@ void ScCellShell::GetClipState( SfxItemSet rSet ) { rSet.DisableItem( SID_PASTE ); rSet.DisableItem( SID_PASTE_SPECIAL ); +rSet.DisableItem( SID_PASTE_ONLY_TEXT ); +rSet.DisableItem( SID_PASTE_ONLY_FORMULA ); rSet.DisableItem( SID_CLIPBOARD_FORMAT_ITEMS ); } else if ( rSet.GetItemState( SID_CLIPBOARD_FORMAT_ITEMS ) != SFX_ITEM_UNKNOWN ) diff --git a/sc/source/ui/view/cellsh1.cxx b/sc/source/ui/view/cellsh1.cxx index 3c6807f..99921c7 100644 --- a/sc/source/ui/view/cellsh1.cxx +++ b/sc/source/ui/view/cellsh1.cxx @@ -1331,9 +1331,11 @@ void ScCellShell::ExecuteEdit( SfxRequest rReq ) if ( bAsLink bOtherDoc ) pTabViewShell-PasteFromSystem(SOT_FORMATSTR_ID_LINK); // DDE insert else +{ pTabViewShell-PasteFromClip( nFlags, pOwnClip-GetDocument(), nFunction, bSkipEmpty, bTranspose, bAsLink, eMoveMode, IDF_NONE, sal_True );// allow warning dialog +} } if( !pReqArgs ) @@ -1367,7 +1369,27 @@ void ScCellShell::ExecuteEdit( SfxRequest rReq ) } pTabViewShell-CellContentChanged();// = PasteFromXXX ??? break; - +case SID_PASTE_ONLY_TEXT: +case SID_PASTE_ONLY_FORMULA: +{ +Window* pWin =