diff options
author | Andrzej Hunt <andrzej.hunt@collabora.com> | 2014-02-02 22:35:39 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2014-02-05 21:03:36 +0000 |
commit | 84b4b7b931b194fc4d1980d2fa9c7fd6e0c9134c (patch) | |
tree | c9ba999c1d4a8de32b595499b5e0629e0ac2797e /sd/source/ui/view | |
parent | 7cd90162f1c4a1d763e40c8f9972fd59e219ccd1 (diff) |
fdo#51525 Add Paste Unformatted Text to Impress.
Change-Id: I4eff66ee2990fd7bf6a9be6b9f0801e7a70206e9
Reviewed-on: https://gerrit.libreoffice.org/7783
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sd/source/ui/view')
-rw-r--r-- | sd/source/ui/view/drviews7.cxx | 4 | ||||
-rw-r--r-- | sd/source/ui/view/drviewse.cxx | 24 | ||||
-rw-r--r-- | sd/source/ui/view/outlnvs2.cxx | 2 | ||||
-rw-r--r-- | sd/source/ui/view/outlnvsh.cxx | 25 |
4 files changed, 55 insertions, 0 deletions
diff --git a/sd/source/ui/view/drviews7.cxx b/sd/source/ui/view/drviews7.cxx index 59819b0d9207..2ee338859dad 100644 --- a/sd/source/ui/view/drviews7.cxx +++ b/sd/source/ui/view/drviews7.cxx @@ -198,6 +198,7 @@ IMPL_LINK( DrawViewShell, ClipboardChanged, TransferableDataHelper*, pDataHelper SfxBindings& rBindings = GetViewFrame()->GetBindings(); rBindings.Invalidate( SID_PASTE ); rBindings.Invalidate( SID_PASTE_SPECIAL ); + rBindings.Invalidate( SID_PASTE_UNFORMATTED ); rBindings.Invalidate( SID_CLIPBOARD_FORMAT_ITEMS ); } return 0; @@ -601,6 +602,7 @@ void DrawViewShell::GetMenuState( SfxItemSet &rSet ) // clipboard (paste) if( SFX_ITEM_AVAILABLE == rSet.GetItemState( SID_PASTE ) || SFX_ITEM_AVAILABLE == rSet.GetItemState( SID_PASTE_SPECIAL ) || + SFX_ITEM_AVAILABLE == rSet.GetItemState( SID_PASTE_UNFORMATTED ) || SFX_ITEM_AVAILABLE == rSet.GetItemState( SID_CLIPBOARD_FORMAT_ITEMS ) ) { if ( !mpClipEvtLstnr ) @@ -627,6 +629,7 @@ void DrawViewShell::GetMenuState( SfxItemSet &rSet ) { rSet.DisableItem( SID_PASTE ); rSet.DisableItem( SID_PASTE_SPECIAL ); + rSet.DisableItem( SID_PASTE_UNFORMATTED ); rSet.DisableItem( SID_CLIPBOARD_FORMAT_ITEMS ); } else if( SFX_ITEM_AVAILABLE == rSet.GetItemState( SID_CLIPBOARD_FORMAT_ITEMS ) ) @@ -1062,6 +1065,7 @@ void DrawViewShell::GetMenuState( SfxItemSet &rSet ) { rSet.DisableItem( SID_PASTE ); rSet.DisableItem( SID_PASTE_SPECIAL ); + rSet.DisableItem( SID_PASTE_UNFORMATTED ); rSet.DisableItem( SID_CLIPBOARD_FORMAT_ITEMS ); rSet.DisableItem( SID_INSERT_FLD_DATE_FIX ); diff --git a/sd/source/ui/view/drviewse.cxx b/sd/source/ui/view/drviewse.cxx index 0c83d6c3a309..9ef7de839d39 100644 --- a/sd/source/ui/view/drviewse.cxx +++ b/sd/source/ui/view/drviewse.cxx @@ -798,6 +798,30 @@ void DrawViewShell::FuSupport(SfxRequest& rReq) } break; + case SID_PASTE_UNFORMATTED: + { + WaitObject aWait( (Window*)GetActiveWindow() ); + + if(HasCurrentFunction()) + { + GetCurrentFunction()->DoPasteUnformatted(); + } + else if(mpDrawView) + { + sal_Int8 nAction = DND_ACTION_COPY; + TransferableDataHelper aDataHelper( TransferableDataHelper::CreateFromSystemClipboard( GetActiveWindow() ) ); + if (aDataHelper.GetTransferable().is()) + { + mpDrawView->InsertData( aDataHelper, + GetActiveWindow()->PixelToLogic( Rectangle( Point(), GetActiveWindow()->GetOutputSizePixel() ).Center() ), + nAction, sal_False, FORMAT_STRING); + } + } + + rReq.Ignore (); + } + break; + case SID_CLIPBOARD_FORMAT_ITEMS: { WaitObject aWait( (Window*)GetActiveWindow() ); diff --git a/sd/source/ui/view/outlnvs2.cxx b/sd/source/ui/view/outlnvs2.cxx index 1f2370a6a14e..8d1703c3bd06 100644 --- a/sd/source/ui/view/outlnvs2.cxx +++ b/sd/source/ui/view/outlnvs2.cxx @@ -331,6 +331,7 @@ void OutlineViewShell::FuTemporary(SfxRequest &rReq) Invalidate(SID_CUT); Invalidate(SID_COPY); Invalidate(SID_PASTE); + Invalidate(SID_PASTE_UNFORMATTED); } void OutlineViewShell::ShowSlideShow(SfxRequest& rReq) @@ -628,6 +629,7 @@ void OutlineViewShell::FuTemporaryModify(SfxRequest &rReq) Invalidate(SID_CUT); Invalidate(SID_COPY); Invalidate(SID_PASTE); + Invalidate(SID_PASTE_UNFORMATTED); } diff --git a/sd/source/ui/view/outlnvsh.cxx b/sd/source/ui/view/outlnvsh.cxx index c0e7ecd36ac1..cfdbfc7e8e48 100644 --- a/sd/source/ui/view/outlnvsh.cxx +++ b/sd/source/ui/view/outlnvsh.cxx @@ -475,6 +475,7 @@ void OutlineViewShell::FuSupport(SfxRequest &rReq) (nSlot == SID_TRANSLITERATE_KATAGANA) || (nSlot == SID_CUT) || (nSlot == SID_PASTE) || + (nSlot == SID_PASTE_UNFORMATTED) || (nSlot == SID_DELETE))) { aGuard.reset( new OutlineViewModelChangeGuard( *pOlView ) ); @@ -529,6 +530,29 @@ void OutlineViewShell::FuSupport(SfxRequest &rReq) } break; + case SID_PASTE_UNFORMATTED: + { + OutlineViewPageChangesGuard aGuard2(pOlView); + + if(HasCurrentFunction()) + { + GetCurrentFunction()->DoPasteUnformatted(); + } + else if(pOlView) + { + sal_Int8 nAction = DND_ACTION_COPY; + TransferableDataHelper aDataHelper( TransferableDataHelper::CreateFromSystemClipboard( GetActiveWindow() ) ); + if (aDataHelper.GetTransferable().is()) + { + pOlView->InsertData( aDataHelper, + GetActiveWindow()->PixelToLogic( Rectangle( Point(), GetActiveWindow()->GetOutputSizePixel() ).Center() ), + nAction, sal_False, FORMAT_STRING); + } + } + + rReq.Ignore (); + } + break; case SID_DELETE: { if( pOlView ) @@ -735,6 +759,7 @@ IMPL_LINK( OutlineViewShell, ClipboardChanged, TransferableDataHelper*, pDataHel SfxBindings& rBindings = GetViewFrame()->GetBindings(); rBindings.Invalidate( SID_PASTE ); rBindings.Invalidate( SID_PASTE_SPECIAL ); + rBindings.Invalidate( SID_PASTE_UNFORMATTED ); rBindings.Invalidate( SID_CLIPBOARD_FORMAT_ITEMS ); } return 0; |