summaryrefslogtreecommitdiff
path: root/sc/source
diff options
context:
space:
mode:
authorscito <info@scito.ch>2021-04-30 14:41:00 +0200
committerHeiko Tietze <heiko.tietze@documentfoundation.org>2021-05-03 11:39:20 +0200
commit02b72784e5601636d26c8e4592958c262efb1a7d (patch)
treed8e69282a79d4e5e0193f3c1e0e618e27be54452 /sc/source
parent357b36c7797ca7ac249714e5ddca1f04e0228c0e (diff)
tdf#102255 add .uno:PasteTransposed
The transpose uno command is added to the same places as .uno:PasteOnlyValue: - menubar - cell - pagebreak The icons are added with tdf#141866 Change-Id: I35a54390ee82ab1059007545188e9d175c3ea750 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114911 Tested-by: Jenkins Reviewed-by: Heiko Tietze <heiko.tietze@documentfoundation.org>
Diffstat (limited to 'sc/source')
-rw-r--r--sc/source/ui/view/cellsh.cxx3
-rw-r--r--sc/source/ui/view/cellsh1.cxx15
2 files changed, 18 insertions, 0 deletions
diff --git a/sc/source/ui/view/cellsh.cxx b/sc/source/ui/view/cellsh.cxx
index 99478b302ec9..d677e6a33aca 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_ONLY_VALUE:
case SID_PASTE_ONLY_TEXT:
case SID_PASTE_ONLY_FORMULA:
+ case SID_PASTE_TRANSPOSED:
case SID_PASTE_TEXTIMPORT_DIALOG:
bDisable = GetViewData().SelectionForbidsCellFill();
break;
@@ -526,6 +527,7 @@ IMPL_LINK( ScCellShell, ClipboardChanged, TransferableDataHelper*, pDataHelper,
rBindings.Invalidate( SID_PASTE_ONLY_VALUE );
rBindings.Invalidate( SID_PASTE_ONLY_TEXT );
rBindings.Invalidate( SID_PASTE_ONLY_FORMULA );
+ rBindings.Invalidate( SID_PASTE_TRANSPOSED );
rBindings.Invalidate( SID_PASTE_TEXTIMPORT_DIALOG );
rBindings.Invalidate( SID_CLIPBOARD_FORMAT_ITEMS );
}
@@ -620,6 +622,7 @@ void ScCellShell::GetClipState( SfxItemSet& rSet )
rSet.DisableItem( SID_PASTE_ONLY_VALUE );
rSet.DisableItem( SID_PASTE_ONLY_TEXT );
rSet.DisableItem( SID_PASTE_ONLY_FORMULA );
+ rSet.DisableItem( SID_PASTE_TRANSPOSED );
rSet.DisableItem( SID_PASTE_TEXTIMPORT_DIALOG );
rSet.DisableItem( SID_CLIPBOARD_FORMAT_ITEMS );
}
diff --git a/sc/source/ui/view/cellsh1.cxx b/sc/source/ui/view/cellsh1.cxx
index fd329898818e..efa1e4dae4c8 100644
--- a/sc/source/ui/view/cellsh1.cxx
+++ b/sc/source/ui/view/cellsh1.cxx
@@ -1511,6 +1511,21 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq )
rReq.SetReturnValue(SfxInt16Item(nSlot, 0)); // 0 = fail
break;
}
+ case SID_PASTE_TRANSPOSED:
+ {
+ if (ScTransferObj::GetOwnClipboard(
+ ScTabViewShell::GetClipData(GetViewData().GetActiveWin()))) // own cell data
+ {
+ rReq.SetSlot(FID_INS_CELL_CONTENTS);
+ rReq.AppendItem(SfxBoolItem(FN_PARAM_3, true)); // transpose
+ ExecuteSlot(rReq, GetInterface());
+ rReq.SetReturnValue(SfxInt16Item(nSlot, 1)); // 1 = success
+ pTabViewShell->CellContentChanged();
+ }
+ else
+ rReq.SetReturnValue(SfxInt16Item(nSlot, 0)); // 0 = fail
+ break;
+ }
case SID_PASTE_TEXTIMPORT_DIALOG:
{
vcl::Window* pWin = GetViewData().GetActiveWin();