officecfg/registry/data/org/openoffice/Office/Accelerators.xcu | 6 +++ sc/sdi/cellsh.sdi | 1 sc/sdi/drtxtob.sdi | 1 sc/sdi/editsh.sdi | 1 sc/source/ui/app/scdll.cxx | 1 sc/source/ui/drawfunc/drtxtob.cxx | 6 +++ sc/source/ui/drawfunc/drtxtob2.cxx | 1 sc/source/ui/view/cellsh.cxx | 4 ++ sc/source/ui/view/cellsh1.cxx | 16 ++++++++++ sc/source/ui/view/editsh.cxx | 14 ++++++++ sc/source/ui/view/tabview3.cxx | 1 11 files changed, 52 insertions(+)
New commits: commit 2cd9b67b41e33d66cacb99dd5d2cfaf700fb71e9 Author: Serge Krot <serge.k...@cib.de> Date: Fri Nov 17 16:21:31 2017 +0100 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. Reviewed-on: https://gerrit.libreoffice.org/44886 Tested-by: Jenkins <c...@libreoffice.org> Reviewed-by: Thorsten Behrens <thorsten.behr...@cib.de> Conflicts: sc/sdi/cellsh.sdi Change-Id: I2b2d1b02e33288bc058c773431f029fb1d33d3be diff --git a/officecfg/registry/data/org/openoffice/Office/Accelerators.xcu b/officecfg/registry/data/org/openoffice/Office/Accelerators.xcu index 2f6a4dcaccae..595bc0c716ad 100644 --- a/officecfg/registry/data/org/openoffice/Office/Accelerators.xcu +++ b/officecfg/registry/data/org/openoffice/Office/Accelerators.xcu @@ -1273,6 +1273,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> diff --git a/sc/sdi/cellsh.sdi b/sc/sdi/cellsh.sdi index cf94574c44fc..f2dc1e020451 100644 --- a/sc/sdi/cellsh.sdi +++ b/sc/sdi/cellsh.sdi @@ -171,6 +171,7 @@ interface CellSelection SID_PASTE [ ExecMethod = ExecuteEdit; StateMethod = GetClipState; ] SID_PASTE_SPECIAL [ ExecMethod = ExecuteEdit; StateMethod = GetClipState; ] SID_PASTE_ONLY [ 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 928ffd61bdfa..1c0d5d6f0245 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 7b0bbff9dc50..7eb1767b0db1 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 087477f69c6f..390b1ca35492 100644 --- a/sc/source/ui/app/scdll.cxx +++ b/sc/source/ui/app/scdll.cxx @@ -168,6 +168,7 @@ void ScDLL::Init() SvxFrameLineStyleToolBoxControl ::RegisterControl(SID_FRAME_LINESTYLE, pMod); SvxColorToolBoxControl ::RegisterControl(SID_FRAME_LINECOLOR, 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 ee4d1ec01480..7519cf7ef591 100644 --- a/sc/source/ui/drawfunc/drtxtob.cxx +++ b/sc/source/ui/drawfunc/drtxtob.cxx @@ -200,6 +200,10 @@ void ScDrawTextObjectBar::Execute( SfxRequest &rReq ) ExecutePasteContents( rReq ); break; + case SID_PASTE_UNFORMATTED: + pOutView->Paste(); + break; + case SID_SELECTALL: { sal_Int32 nCount = pOutliner->GetParagraphCount(); @@ -480,6 +484,7 @@ IMPL_LINK_TYPED( ScDrawTextObjectBar, ClipboardChanged, TransferableDataHelper*, SfxBindings& rBindings = pViewData->GetBindings(); rBindings.Invalidate( SID_PASTE ); rBindings.Invalidate( SID_PASTE_SPECIAL ); + rBindings.Invalidate( SID_PASTE_UNFORMATTED ); rBindings.Invalidate( SID_CLIPBOARD_FORMAT_ITEMS ); } @@ -513,6 +518,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 9a97a6aed7af..e16ffd716dd2 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 f8bcb6f6e4ce..d4b78caa5fbb 100644 --- a/sc/source/ui/view/cellsh.cxx +++ b/sc/source/ui/view/cellsh.cxx @@ -220,6 +220,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: @@ -492,6 +493,7 @@ IMPL_LINK_TYPED( ScCellShell, ClipboardChanged, TransferableDataHelper*, pDataHe 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 ); @@ -548,6 +550,7 @@ void ScCellShell::GetClipState( SfxItemSet& rSet ) { // SID_PASTE // SID_PASTE_SPECIAL +// SID_PASTE_UNFORMATTED // SID_CLIPBOARD_FORMAT_ITEMS if ( !pImpl->m_pClipEvtLstnr ) @@ -584,6 +587,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 19a1618545bd..5e4d470c8373 100644 --- a/sc/source/ui/view/cellsh1.cxx +++ b/sc/source/ui/view/cellsh1.cxx @@ -1640,6 +1640,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 92f211e13d71..5f4084cb8dde 100644 --- a/sc/source/ui/view/editsh.cxx +++ b/sc/source/ui/view/editsh.cxx @@ -307,6 +307,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(); @@ -804,6 +816,7 @@ IMPL_LINK_TYPED( ScEditShell, ClipboardChanged, TransferableDataHelper*, pDataHe SfxBindings& rBindings = pViewData->GetBindings(); rBindings.Invalidate( SID_PASTE ); rBindings.Invalidate( SID_PASTE_SPECIAL ); + rBindings.Invalidate( SID_PASTE_UNFORMATTED ); rBindings.Invalidate( SID_CLIPBOARD_FORMAT_ITEMS ); } @@ -830,6 +843,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 ef6ac76f0721..57bf4d68b290 100644 --- a/sc/source/ui/view/tabview3.cxx +++ b/sc/source/ui/view/tabview3.cxx @@ -448,6 +448,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 ); _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits