diff options
author | Serge Krot <Serge.Krot@cib.de> | 2017-11-17 16:21:31 +0100 |
---|---|---|
committer | Thorsten Behrens <Thorsten.Behrens@CIB.de> | 2017-11-19 00:49:57 +0100 |
commit | 2865210607364feaff2c0275b7cd6c5439f5f070 (patch) | |
tree | 1e6b63e4c90247000e71eb1c43349ac5aea7ebec /sc | |
parent | 63bd6ee2c49f2d0c77c542778fc43ad476f6451b (diff) |
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/44886
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
Diffstat (limited to 'sc')
-rw-r--r-- | sc/sdi/cellsh.sdi | 1 | ||||
-rw-r--r-- | sc/sdi/drtxtob.sdi | 1 | ||||
-rw-r--r-- | sc/sdi/editsh.sdi | 1 | ||||
-rw-r--r-- | sc/source/ui/app/scdll.cxx | 1 | ||||
-rw-r--r-- | sc/source/ui/drawfunc/drtxtob.cxx | 6 | ||||
-rw-r--r-- | sc/source/ui/drawfunc/drtxtob2.cxx | 1 | ||||
-rw-r--r-- | sc/source/ui/view/cellsh.cxx | 4 | ||||
-rw-r--r-- | sc/source/ui/view/cellsh1.cxx | 16 | ||||
-rw-r--r-- | sc/source/ui/view/editsh.cxx | 14 | ||||
-rw-r--r-- | sc/source/ui/view/tabview3.cxx | 1 |
10 files changed, 46 insertions, 0 deletions
diff --git a/sc/sdi/cellsh.sdi b/sc/sdi/cellsh.sdi index 90b62dae89df..22a66319cd53 100644 --- a/sc/sdi/cellsh.sdi +++ b/sc/sdi/cellsh.sdi @@ -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; ] diff --git a/sc/sdi/drtxtob.sdi b/sc/sdi/drtxtob.sdi index 2ba4c89e8699..1cf966be6ffa 100644 --- a/sc/sdi/drtxtob.sdi +++ b/sc/sdi/drtxtob.sdi @@ -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; ] diff --git a/sc/sdi/editsh.sdi b/sc/sdi/editsh.sdi index ac96dbd04695..f854fe897191 100644 --- a/sc/sdi/editsh.sdi +++ b/sc/sdi/editsh.sdi @@ -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; ] diff --git a/sc/source/ui/app/scdll.cxx b/sc/source/ui/app/scdll.cxx index 4f71ed9c7188..0f398c5d4170 100644 --- a/sc/source/ui/app/scdll.cxx +++ b/sc/source/ui/app/scdll.cxx @@ -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 ); diff --git a/sc/source/ui/drawfunc/drtxtob.cxx b/sc/source/ui/drawfunc/drtxtob.cxx index cdbbba7a8185..feb264f6ae49 100644 --- a/sc/source/ui/drawfunc/drtxtob.cxx +++ b/sc/source/ui/drawfunc/drtxtob.cxx @@ -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; diff --git a/sc/source/ui/drawfunc/drtxtob2.cxx b/sc/source/ui/drawfunc/drtxtob2.cxx index 28050513064b..192f05e6bd34 100644 --- a/sc/source/ui/drawfunc/drtxtob2.cxx +++ b/sc/source/ui/drawfunc/drtxtob2.cxx @@ -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: { diff --git a/sc/source/ui/view/cellsh.cxx b/sc/source/ui/view/cellsh.cxx index da7d1d30eeb4..086c33e4fa3d 100644 --- a/sc/source/ui/view/cellsh.cxx +++ b/sc/source/ui/view/cellsh.cxx @@ -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 ); diff --git a/sc/source/ui/view/cellsh1.cxx b/sc/source/ui/view/cellsh1.cxx index 8794364f80eb..455c3ac3b1cd 100644 --- a/sc/source/ui/view/cellsh1.cxx +++ b/sc/source/ui/view/cellsh1.cxx @@ -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: diff --git a/sc/source/ui/view/editsh.cxx b/sc/source/ui/view/editsh.cxx index 632876d3d9f5..9cbac20a0fc8 100644 --- a/sc/source/ui/view/editsh.cxx +++ b/sc/source/ui/view/editsh.cxx @@ -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; diff --git a/sc/source/ui/view/tabview3.cxx b/sc/source/ui/view/tabview3.cxx index d31146d1a81a..5ea1054821a0 100644 --- a/sc/source/ui/view/tabview3.cxx +++ b/sc/source/ui/view/tabview3.cxx @@ -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 ); |