diff options
author | Oliver Specht <oliver.specht@cib.de> | 2016-12-30 16:47:17 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2017-01-26 12:01:21 +0000 |
commit | a6f3ca06100bc23eee5017d6cf53e89282dc580d (patch) | |
tree | aacf736ec60852bf8b72599e33afe479bc23d896 /sd | |
parent | 5891a45fa08729ba01f78bece9312b2c01d3a214 (diff) |
tdf#101828 handle rtf/richtext correctly
Change-Id: Id894f62a918bd6e6fa59f8d546307343bf2bd4b0
Reviewed-on: https://gerrit.libreoffice.org/32682
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
(cherry picked from commit 048e30c1f8231e6cd144a9251061f6fa127b353e)
Reviewed-on: https://gerrit.libreoffice.org/33567
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Diffstat (limited to 'sd')
-rw-r--r-- | sd/source/ui/app/sdxfer.cxx | 4 | ||||
-rw-r--r-- | sd/source/ui/func/fuinsert.cxx | 1 | ||||
-rw-r--r-- | sd/source/ui/view/drviews7.cxx | 1 | ||||
-rw-r--r-- | sd/source/ui/view/outlnvsh.cxx | 2 | ||||
-rw-r--r-- | sd/source/ui/view/sdview3.cxx | 15 |
5 files changed, 16 insertions, 7 deletions
diff --git a/sd/source/ui/app/sdxfer.cxx b/sd/source/ui/app/sdxfer.cxx index 12b55eeb1d8f..dc93f8975f17 100644 --- a/sd/source/ui/app/sdxfer.cxx +++ b/sd/source/ui/app/sdxfer.cxx @@ -445,8 +445,10 @@ void SdTransferable::AddSupportedFormats() AddFormat( SotClipboardFormatId::BITMAP ); } - if( lcl_HasOnlyOneTable( mpSdDrawDocument ) ) + if( lcl_HasOnlyOneTable( mpSdDrawDocument ) ) { AddFormat( SotClipboardFormatId::RTF ); + AddFormat( SotClipboardFormatId::RICHTEXT ); + } } if( mpImageMap ) diff --git a/sd/source/ui/func/fuinsert.cxx b/sd/source/ui/func/fuinsert.cxx index f68e92bfa0ca..c7ae0abcd395 100644 --- a/sd/source/ui/func/fuinsert.cxx +++ b/sd/source/ui/func/fuinsert.cxx @@ -253,6 +253,7 @@ void FuInsertClipboard::DoExecute( SfxRequest& ) pDlg->Insert( SotClipboardFormatId::STRING, OUString() ); pDlg->Insert( SotClipboardFormatId::HTML, OUString() ); pDlg->Insert( SotClipboardFormatId::RTF, OUString() ); + pDlg->Insert( SotClipboardFormatId::RICHTEXT, OUString() ); pDlg->Insert( SotClipboardFormatId::EDITENGINE, OUString() ); //TODO/MBA: testing diff --git a/sd/source/ui/view/drviews7.cxx b/sd/source/ui/view/drviews7.cxx index 9af3432cf119..f8570a42f411 100644 --- a/sd/source/ui/view/drviews7.cxx +++ b/sd/source/ui/view/drviews7.cxx @@ -157,6 +157,7 @@ using namespace ::com::sun::star::linguistic2; case SotClipboardFormatId::STRING: case SotClipboardFormatId::HTML: case SotClipboardFormatId::RTF: + case SotClipboardFormatId::RICHTEXT: case SotClipboardFormatId::EDITENGINE: pResult->AddClipbrdFormat(nTestFormat); break; diff --git a/sd/source/ui/view/outlnvsh.cxx b/sd/source/ui/view/outlnvsh.cxx index e9ab3e560e7b..5dfe6f600908 100644 --- a/sd/source/ui/view/outlnvsh.cxx +++ b/sd/source/ui/view/outlnvsh.cxx @@ -707,6 +707,7 @@ IMPL_LINK( OutlineViewShell, ClipboardChanged, TransferableDataHelper*, pDataHel bPastePossible = pDataHelper->GetFormatCount() != 0 && ( pDataHelper->HasFormat( SotClipboardFormatId::STRING ) || pDataHelper->HasFormat( SotClipboardFormatId::RTF ) || + pDataHelper->HasFormat( SotClipboardFormatId::RICHTEXT ) || pDataHelper->HasFormat( SotClipboardFormatId::HTML ) ); SfxBindings& rBindings = GetViewFrame()->GetBindings(); @@ -890,6 +891,7 @@ void OutlineViewShell::GetMenuState( SfxItemSet &rSet ) bPastePossible = ( aDataHelper.GetFormatCount() != 0 && ( aDataHelper.HasFormat( SotClipboardFormatId::STRING ) || aDataHelper.HasFormat( SotClipboardFormatId::RTF ) || + aDataHelper.HasFormat( SotClipboardFormatId::RICHTEXT ) || aDataHelper.HasFormat( SotClipboardFormatId::HTML ) ) ); } diff --git a/sd/source/ui/view/sdview3.cxx b/sd/source/ui/view/sdview3.cxx index 6490032b32c9..00eb9066d5e3 100644 --- a/sd/source/ui/view/sdview3.cxx +++ b/sd/source/ui/view/sdview3.cxx @@ -327,14 +327,16 @@ bool View::InsertData( const TransferableDataHelper& rDataHelper, bool bTable = false; // check special cases for pasting table formats as RTL - if( !bLink && (nFormat == SotClipboardFormatId::NONE || (nFormat == SotClipboardFormatId::RTF)) ) + if( !bLink && (nFormat == SotClipboardFormatId::NONE || (nFormat == SotClipboardFormatId::RTF) || (nFormat == SotClipboardFormatId::RICHTEXT)) ) { // if the objekt supports rtf and there is a table involved, default is to create a table - if( aDataHelper.HasFormat( SotClipboardFormatId::RTF ) && ! aDataHelper.HasFormat( SotClipboardFormatId::DRAWING ) ) + bool bIsRTF = aDataHelper.HasFormat( SotClipboardFormatId::RTF ); + if( ( bIsRTF || aDataHelper.HasFormat( SotClipboardFormatId::RICHTEXT ) ) + && ! aDataHelper.HasFormat( SotClipboardFormatId::DRAWING ) ) { ::tools::SvRef<SotStorageStream> xStm; - if( aDataHelper.GetSotStorageStream( SotClipboardFormatId::RTF, xStm ) ) + if( aDataHelper.GetSotStorageStream( bIsRTF ? SotClipboardFormatId::RTF : SotClipboardFormatId::RICHTEXT, xStm ) ) { xStm->Seek( 0 ); @@ -345,7 +347,7 @@ bool View::InsertData( const TransferableDataHelper& rDataHelper, if (x != -1) { bTable = true; - nFormat = SotClipboardFormatId::RTF; + nFormat = bIsRTF ? SotClipboardFormatId::RTF : SotClipboardFormatId::RICHTEXT; break; } } @@ -1419,11 +1421,12 @@ bool View::InsertData( const TransferableDataHelper& rDataHelper, } } - if(!bReturn && !bLink && CHECK_FORMAT_TRANS(SotClipboardFormatId::RTF)) + bool bIsRTF = false; + if(!bReturn && !bLink && (( bIsRTF = CHECK_FORMAT_TRANS(SotClipboardFormatId::RTF) ) || CHECK_FORMAT_TRANS(SotClipboardFormatId::RICHTEXT) )) { ::tools::SvRef<SotStorageStream> xStm; - if( aDataHelper.GetSotStorageStream( SotClipboardFormatId::RTF, xStm ) ) + if( aDataHelper.GetSotStorageStream( bIsRTF ? SotClipboardFormatId::RTF : SotClipboardFormatId::RICHTEXT, xStm ) ) { xStm->Seek( 0 ); |