diff options
Diffstat (limited to 'sw/source/uibase/shells/basesh.cxx')
-rw-r--r-- | sw/source/uibase/shells/basesh.cxx | 24 |
1 files changed, 21 insertions, 3 deletions
diff --git a/sw/source/uibase/shells/basesh.cxx b/sw/source/uibase/shells/basesh.cxx index c9e5a8ec15bf..07ba572b15d2 100644 --- a/sw/source/uibase/shells/basesh.cxx +++ b/sw/source/uibase/shells/basesh.cxx @@ -258,7 +258,8 @@ void SwBaseShell::ExecClpbrd(SfxRequest &rReq) SwWrtShell &rSh = GetShell(); sal_uInt16 nId = rReq.GetSlot(); bool bIgnore = false; - bool bPasteNestedTable = false; + PasteTableType ePasteTable = PasteTableType::PASTE_DEFAULT; + switch( nId ) { case SID_CUT: @@ -282,7 +283,22 @@ void SwBaseShell::ExecClpbrd(SfxRequest &rReq) return; case FN_PASTE_NESTED_TABLE: - bPasteNestedTable = true; + case FN_TABLE_PASTE_ROW_BEFORE: + case FN_TABLE_PASTE_COL_BEFORE: + switch ( nId ) + { + case FN_PASTE_NESTED_TABLE: + ePasteTable = PasteTableType::PASTE_TABLE; + break; + case FN_TABLE_PASTE_ROW_BEFORE: + ePasteTable = PasteTableType::PASTE_ROW; + break; + case FN_TABLE_PASTE_COL_BEFORE: + ePasteTable = PasteTableType::PASTE_COLUMN; + break; + default: + ; + } [[fallthrough]]; case SID_PASTE: { @@ -303,7 +319,7 @@ void SwBaseShell::ExecClpbrd(SfxRequest &rReq) const SfxBoolItem* pIgnoreComments = rReq.GetArg<SfxBoolItem>(FN_PARAM_2); if (pIgnoreComments) bIgnoreComments = pIgnoreComments->GetValue(); - SwTransferable::Paste(rSh, aDataHelper, nAnchorType, bIgnoreComments, bPasteNestedTable); + SwTransferable::Paste(rSh, aDataHelper, nAnchorType, bIgnoreComments, ePasteTable); if( rSh.IsFrameSelected() || rSh.IsObjSelected() ) rSh.EnterSelFrameMode(); @@ -471,6 +487,8 @@ void SwBaseShell::StateClpbrd(SfxItemSet &rSet) break; case FN_PASTE_NESTED_TABLE: + case FN_TABLE_PASTE_ROW_BEFORE: + case FN_TABLE_PASTE_COL_BEFORE: if( !rSh.IsCursorInTable() || !GetView().IsPasteSpecialAllowed() || rSh.CursorInsideInputField() |