Kaydet (Commit) 710d768a authored tarafından Noel Power's avatar Noel Power

add for calc extra paste ctx menu with options to paste text or formula only

üst f826a5b5
...@@ -160,6 +160,9 @@ interface CellSelection ...@@ -160,6 +160,9 @@ interface CellSelection
SID_COPY [ ExecMethod = ExecuteEdit; StateMethod = GetBlockState; ] SID_COPY [ ExecMethod = ExecuteEdit; StateMethod = GetBlockState; ]
SID_PASTE [ ExecMethod = ExecuteEdit; StateMethod = GetClipState; ] SID_PASTE [ ExecMethod = ExecuteEdit; StateMethod = GetClipState; ]
SID_PASTE_SPECIAL [ 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_CLIPBOARD_FORMAT_ITEMS [ ExecMethod = ExecuteEdit; StateMethod = GetClipState; ]
SID_EXTERNAL_SOURCE [ ExecMethod = ExecuteEdit; StateMethod = GetBlockState; ] SID_EXTERNAL_SOURCE [ ExecMethod = ExecuteEdit; StateMethod = GetBlockState; ]
FID_MERGE_ON [ ExecMethod = Execute; StateMethod = GetState; ] FID_MERGE_ON [ ExecMethod = Execute; StateMethod = GetState; ]
......
...@@ -133,6 +133,31 @@ Menu RID_POPUP_CELLS ...@@ -133,6 +133,31 @@ Menu RID_POPUP_CELLS
HelpId = CMD_SID_PASTE_SPECIAL ; HelpId = CMD_SID_PASTE_SPECIAL ;
Text [ en-US ] = "P~aste 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 ; }; MenuItem { Separator = TRUE ; };
//------------------------------ //------------------------------
......
...@@ -449,6 +449,8 @@ IMPL_LINK( ScCellShell, ClipboardChanged, TransferableDataHelper*, pDataHelper ) ...@@ -449,6 +449,8 @@ IMPL_LINK( ScCellShell, ClipboardChanged, TransferableDataHelper*, pDataHelper )
SfxBindings& rBindings = GetViewData()->GetBindings(); SfxBindings& rBindings = GetViewData()->GetBindings();
rBindings.Invalidate( SID_PASTE ); rBindings.Invalidate( SID_PASTE );
rBindings.Invalidate( SID_PASTE_SPECIAL ); rBindings.Invalidate( SID_PASTE_SPECIAL );
rBindings.Invalidate( SID_PASTE_ONLY_TEXT );
rBindings.Invalidate( SID_PASTE_ONLY_FORMULA );
rBindings.Invalidate( SID_CLIPBOARD_FORMAT_ITEMS ); rBindings.Invalidate( SID_CLIPBOARD_FORMAT_ITEMS );
} }
return 0; return 0;
...@@ -537,6 +539,8 @@ void ScCellShell::GetClipState( SfxItemSet& rSet ) ...@@ -537,6 +539,8 @@ void ScCellShell::GetClipState( SfxItemSet& rSet )
{ {
rSet.DisableItem( SID_PASTE ); rSet.DisableItem( SID_PASTE );
rSet.DisableItem( SID_PASTE_SPECIAL ); rSet.DisableItem( SID_PASTE_SPECIAL );
rSet.DisableItem( SID_PASTE_ONLY_TEXT );
rSet.DisableItem( SID_PASTE_ONLY_FORMULA );
rSet.DisableItem( SID_CLIPBOARD_FORMAT_ITEMS ); rSet.DisableItem( SID_CLIPBOARD_FORMAT_ITEMS );
} }
else if ( rSet.GetItemState( SID_CLIPBOARD_FORMAT_ITEMS ) != SFX_ITEM_UNKNOWN ) else if ( rSet.GetItemState( SID_CLIPBOARD_FORMAT_ITEMS ) != SFX_ITEM_UNKNOWN )
......
...@@ -1331,9 +1331,11 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq ) ...@@ -1331,9 +1331,11 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq )
if ( bAsLink && bOtherDoc ) if ( bAsLink && bOtherDoc )
pTabViewShell->PasteFromSystem(SOT_FORMATSTR_ID_LINK); // DDE insert pTabViewShell->PasteFromSystem(SOT_FORMATSTR_ID_LINK); // DDE insert
else else
{
pTabViewShell->PasteFromClip( nFlags, pOwnClip->GetDocument(), pTabViewShell->PasteFromClip( nFlags, pOwnClip->GetDocument(),
nFunction, bSkipEmpty, bTranspose, bAsLink, nFunction, bSkipEmpty, bTranspose, bAsLink,
eMoveMode, IDF_NONE, sal_True ); // allow warning dialog eMoveMode, IDF_NONE, sal_True ); // allow warning dialog
}
} }
if( !pReqArgs ) if( !pReqArgs )
...@@ -1367,7 +1369,27 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq ) ...@@ -1367,7 +1369,27 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq )
} }
pTabViewShell->CellContentChanged(); // => PasteFromXXX ??? pTabViewShell->CellContentChanged(); // => PasteFromXXX ???
break; break;
case SID_PASTE_ONLY_TEXT:
case SID_PASTE_ONLY_FORMULA:
{
Window* pWin = GetViewData()->GetActiveWin();
if ( ScTransferObj::GetOwnClipboard( pWin ) ) // own cell data
{
rReq.SetSlot( FID_INS_CELL_CONTENTS );
rtl::OUString aFlags;
if ( nSlot == SID_PASTE_ONLY_TEXT )
aFlags = "VDS";
else
aFlags = "F";
rReq.AppendItem( SfxStringItem( FID_INS_CELL_CONTENTS, aFlags ) );
ExecuteSlot( rReq, GetInterface() );
rReq.SetReturnValue(SfxInt16Item(nSlot, 1)); // 1 = success
pTabViewShell->CellContentChanged();
}
else
rReq.SetReturnValue(SfxInt16Item(nSlot, 0)); // 0 = fail
break;
}
case SID_PASTE_SPECIAL: case SID_PASTE_SPECIAL:
// differentiate between own cell data and draw objects/external data // differentiate between own cell data and draw objects/external data
// this makes FID_INS_CELL_CONTENTS superfluous // this makes FID_INS_CELL_CONTENTS superfluous
......
...@@ -201,6 +201,9 @@ ...@@ -201,6 +201,9 @@
#define CMD_SID_PASTE ".uno:Paste" #define CMD_SID_PASTE ".uno:Paste"
#define CMD_SID_CLIPBOARD_FORMAT_ITEMS ".uno:ClipboardFormatItems" #define CMD_SID_CLIPBOARD_FORMAT_ITEMS ".uno:ClipboardFormatItems"
#define CMD_SID_PASTE_SPECIAL ".uno:PasteSpecial" #define CMD_SID_PASTE_SPECIAL ".uno:PasteSpecial"
#define CMD_SID_PASTE_ONLY ".uno:PasteOnly"
#define CMD_SID_PASTE_ONLY_TEXT ".uno:PasteOnlyText"
#define CMD_SID_PASTE_ONLY_FORMULA ".uno:PasteOnlyFormula"
#define CMD_SID_DOCPATH ".uno:DocPath" #define CMD_SID_DOCPATH ".uno:DocPath"
#define CMD_SID_PICKLIST ".uno:PickList" #define CMD_SID_PICKLIST ".uno:PickList"
#define CMD_SID_PLUGINS_ACTIVE ".uno:PlugInsActive" #define CMD_SID_PLUGINS_ACTIVE ".uno:PlugInsActive"
......
...@@ -536,9 +536,9 @@ ...@@ -536,9 +536,9 @@
// default-ids for macros // default-ids for macros
#define SID_RECORDING_FLOATWINDOW (SID_SFX_START + 800) #define SID_RECORDING_FLOATWINDOW (SID_SFX_START + 800)
#define SID_RECORDMACRO (SID_SFX_START + 1669) #define SID_RECORDMACRO (SID_SFX_START + 1669)
// FREE: SID_SFX_START + 801 #define SID_PASTE_ONLY (SID_SFX_START + 801)
// FREE: SID_SFX_START + 802 #define SID_PASTE_ONLY_TEXT (SID_SFX_START + 802)
// FREE: SID_SFX_START + 803 #define SID_PASTE_ONLY_FORMULA (SID_SFX_START + 803)
// FREE: SID_SFX_START + 804 // FREE: SID_SFX_START + 804
// FREE: SID_SFX_START + 805 // FREE: SID_SFX_START + 805
// FREE: SID_SFX_START + 806 // FREE: SID_SFX_START + 806
......
...@@ -4630,6 +4630,78 @@ SfxInt16Item PasteSpecial SID_PASTE_SPECIAL ...@@ -4630,6 +4630,78 @@ SfxInt16Item PasteSpecial SID_PASTE_SPECIAL
GroupId = GID_EDIT; GroupId = GID_EDIT;
] ]
SfxVoidItem PasteOnly SID_PASTE_ONLY
()
[
/* flags: */
AutoUpdate = FALSE,
Cachable = Cachable,
FastCall = FALSE,
HasCoreId = FALSE,
HasDialog = FALSE,
ReadOnlyDoc = FALSE,
Toggle = FALSE,
Container = FALSE,
RecordAbsolute = FALSE,
RecordPerSet;
Synchron;
/* config: */
AccelConfig = TRUE,
MenuConfig = TRUE,
StatusBarConfig = FALSE,
ToolBoxConfig = TRUE,
GroupId = GID_EDIT;
]
SfxVoidItem PasteOnlyText SID_PASTE_ONLY_TEXT
[
/* 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;
]
SfxVoidItem PasteOnlyFormula SID_PASTE_ONLY_FORMULA
[
/* 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 SfxStringItem DocPath SID_DOCPATH
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment