Kaydet (Commit) 28652106 authored tarafından Serge Krot's avatar Serge Krot Kaydeden (comit) Thorsten Behrens

tdf#50746 Make "paste unformatted text" work for Calc

The same command with the same Ctrl+Shift+Alt+V hot-key
was already added inside Writer. So now Calc has it too.

Change-Id: I2b2d1b02e33288bc058c773431f029fb1d33d3be
Reviewed-on: https://gerrit.libreoffice.org/44886Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarThorsten Behrens <Thorsten.Behrens@CIB.de>
üst 63bd6ee2
......@@ -1294,6 +1294,12 @@
<value xml:lang="en-US">.uno:PasteSpecial</value>
</prop>
</node>
<node oor:name="V_SHIFT_MOD1_MOD2" oor:op="replace">
<prop oor:name="Command">
<value xml:lang="x-no-translate">I10N SHORTCUTS - NO TRANSLATE</value>
<value xml:lang="en-US">.uno:PasteUnformatted</value>
</prop>
</node>
<node oor:name="Z_SHIFT_MOD1" oor:op="replace">
<prop oor:name="Command">
<value xml:lang="x-no-translate">I10N SHORTCUTS - NO TRANSLATE</value>
......
......@@ -171,6 +171,7 @@ interface CellSelection
SID_COPY [ ExecMethod = ExecuteEdit; StateMethod = GetBlockState; ]
SID_PASTE [ ExecMethod = ExecuteEdit; StateMethod = GetClipState; ]
SID_PASTE_SPECIAL [ ExecMethod = ExecuteEdit; StateMethod = GetClipState; ]
SID_PASTE_UNFORMATTED [ 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; ]
......
......@@ -52,6 +52,7 @@ interface TableDrawText
SID_COPY [ ExecMethod = Execute; StateMethod = GetState; Export = FALSE; ]
SID_PASTE [ ExecMethod = Execute; StateMethod = GetClipState; Export = FALSE; ]
SID_PASTE_SPECIAL [ ExecMethod = Execute; StateMethod = GetClipState; Export = FALSE; ]
SID_PASTE_UNFORMATTED [ ExecMethod = Execute; StateMethod = GetClipState; Export = FALSE; ]
SID_CLIPBOARD_FORMAT_ITEMS [ ExecMethod = Execute; StateMethod = GetClipState; Export = FALSE; ]
SID_SELECTALL [ ExecMethod = Execute; StateMethod = GetState; Export = FALSE; ]
SID_CHARMAP [ ExecMethod = Execute; StateMethod = GetState; Export = FALSE; ]
......
......@@ -32,6 +32,7 @@ interface TableText
SID_COPY [ ExecMethod = Execute; StateMethod = GetState; Export = FALSE; ]
SID_PASTE [ ExecMethod = Execute; StateMethod = GetClipState; Export = FALSE; ]
SID_PASTE_SPECIAL [ ExecMethod = Execute; StateMethod = GetClipState; Export = FALSE; ]
SID_PASTE_UNFORMATTED [ ExecMethod = Execute; StateMethod = GetClipState; Export = FALSE; ]
SID_CLIPBOARD_FORMAT_ITEMS [ ExecMethod = Execute; StateMethod = GetClipState; Export = FALSE; ]
SID_SELECTALL [ ExecMethod = Execute; StateMethod = GetState; Export = FALSE; ]
SID_CHARMAP [ ExecMethod = Execute; StateMethod = GetState; Export = FALSE; ]
......
......@@ -161,6 +161,7 @@ void ScDLL::Init()
SvxLineWidthToolBoxControl ::RegisterControl(0, pMod);
SvxStyleToolBoxControl ::RegisterControl(SID_STYLE_APPLY, pMod);
SvxClipBoardControl ::RegisterControl(SID_PASTE, pMod );
SvxClipBoardControl ::RegisterControl(SID_PASTE_UNFORMATTED, pMod );
SvxUndoRedoControl ::RegisterControl(SID_UNDO, pMod );
SvxUndoRedoControl ::RegisterControl(SID_REDO, pMod );
svx::ParaLineSpacingPopup ::RegisterControl(SID_ATTR_PARA_LINESPACE, pMod );
......
......@@ -196,6 +196,10 @@ void ScDrawTextObjectBar::Execute( SfxRequest &rReq )
ExecutePasteContents( rReq );
break;
case SID_PASTE_UNFORMATTED:
pOutView->Paste();
break;
case SID_SELECTALL:
{
sal_Int32 nCount = pOutliner->GetParagraphCount();
......@@ -476,6 +480,7 @@ IMPL_LINK( ScDrawTextObjectBar, ClipboardChanged, TransferableDataHelper*, pData
SfxBindings& rBindings = pViewData->GetBindings();
rBindings.Invalidate( SID_PASTE );
rBindings.Invalidate( SID_PASTE_SPECIAL );
rBindings.Invalidate( SID_PASTE_UNFORMATTED );
rBindings.Invalidate( SID_CLIPBOARD_FORMAT_ITEMS );
}
......@@ -509,6 +514,7 @@ void ScDrawTextObjectBar::GetClipState( SfxItemSet& rSet )
{
case SID_PASTE:
case SID_PASTE_SPECIAL:
case SID_PASTE_UNFORMATTED:
if( !bPastePossible )
rSet.DisableItem( nWhich );
break;
......
......@@ -75,6 +75,7 @@ void ScDrawTextObjectBar::ExecuteGlobal( SfxRequest &rReq )
case SID_PASTE:
case SID_PASTE_SPECIAL:
case SID_PASTE_UNFORMATTED:
case SID_CLIPBOARD_FORMAT_ITEMS:
case SID_HYPERLINK_SETLINK:
{
......
......@@ -222,6 +222,7 @@ void ScCellShell::GetBlockState( SfxItemSet& rSet )
case SID_PASTE:
case SID_PASTE_SPECIAL:
case SID_PASTE_UNFORMATTED:
case SID_PASTE_ONLY_VALUE:
case SID_PASTE_ONLY_TEXT:
case SID_PASTE_ONLY_FORMULA:
......@@ -520,6 +521,7 @@ IMPL_LINK( ScCellShell, ClipboardChanged, TransferableDataHelper*, pDataHelper,
SfxBindings& rBindings = GetViewData()->GetBindings();
rBindings.Invalidate( SID_PASTE );
rBindings.Invalidate( SID_PASTE_SPECIAL );
rBindings.Invalidate( SID_PASTE_UNFORMATTED );
rBindings.Invalidate( SID_PASTE_ONLY_VALUE );
rBindings.Invalidate( SID_PASTE_ONLY_TEXT );
rBindings.Invalidate( SID_PASTE_ONLY_FORMULA );
......@@ -576,6 +578,7 @@ void ScCellShell::GetClipState( SfxItemSet& rSet )
{
// SID_PASTE
// SID_PASTE_SPECIAL
// SID_PASTE_UNFORMATTED
// SID_CLIPBOARD_FORMAT_ITEMS
if ( !pImpl->m_xClipEvtLstnr.is() )
......@@ -634,6 +637,7 @@ void ScCellShell::GetClipState( SfxItemSet& rSet )
{
rSet.DisableItem( SID_PASTE );
rSet.DisableItem( SID_PASTE_SPECIAL );
rSet.DisableItem( SID_PASTE_UNFORMATTED );
rSet.DisableItem( SID_PASTE_ONLY_VALUE );
rSet.DisableItem( SID_PASTE_ONLY_TEXT );
rSet.DisableItem( SID_PASTE_ONLY_FORMULA );
......
......@@ -1641,6 +1641,22 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq )
pTabViewShell->CellContentChanged(); // => PasteFromSystem() ???
break;
case SID_PASTE_UNFORMATTED:
// differentiate between own cell data and draw objects/external data
// this makes FID_INS_CELL_CONTENTS superfluous
{
WaitObject aWait( GetViewData()->GetDialogParent() );
bool bRet = pTabViewShell->PasteFromSystem(SotClipboardFormatId::STRING, true); // TRUE: no error messages
if ( bRet )
{
rReq.SetReturnValue(SfxInt16Item(nSlot, bRet ? 1 : 0)); // 1 = success, 0 = fail
rReq.Done();
}
pTabViewShell->CellContentChanged(); // => PasteFromSystem() ???
}
break;
// other
case FID_INS_ROWBRK:
......
......@@ -310,6 +310,18 @@ void ScEditShell::Execute( SfxRequest& rReq )
}
break;
case SID_PASTE_UNFORMATTED:
{
pTableView->Paste();
if (pTopView)
{
pTopView->Paste();
pTopView->GetWindow()->GrabFocus();
}
}
break;
case SID_SELECTALL:
{
sal_Int32 nPar = pEngine->GetParagraphCount();
......@@ -807,6 +819,7 @@ IMPL_LINK( ScEditShell, ClipboardChanged, TransferableDataHelper*, pDataHelper,
SfxBindings& rBindings = pViewData->GetBindings();
rBindings.Invalidate( SID_PASTE );
rBindings.Invalidate( SID_PASTE_SPECIAL );
rBindings.Invalidate( SID_PASTE_UNFORMATTED );
rBindings.Invalidate( SID_CLIPBOARD_FORMAT_ITEMS );
}
......@@ -836,6 +849,7 @@ void ScEditShell::GetClipState( SfxItemSet& rSet )
{
case SID_PASTE:
case SID_PASTE_SPECIAL:
case SID_PASTE_UNFORMATTED:
if( !bPastePossible )
rSet.DisableItem( nWhich );
break;
......
......@@ -519,6 +519,7 @@ void ScTabView::SelectionChanged()
rBindings.Invalidate( SID_COPY );
rBindings.Invalidate( SID_PASTE );
rBindings.Invalidate( SID_PASTE_SPECIAL );
rBindings.Invalidate( SID_PASTE_UNFORMATTED );
rBindings.Invalidate( FID_INS_ROW );
rBindings.Invalidate( FID_INS_COLUMN );
......
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