diff options
author | Oliver Specht <oliver.specht@cib.de> | 2016-12-30 16:47:17 +0100 |
---|---|---|
committer | Thorsten Behrens <Thorsten.Behrens@CIB.de> | 2017-01-09 00:34:30 +0000 |
commit | 048e30c1f8231e6cd144a9251061f6fa127b353e (patch) | |
tree | 712f9d5cf96f28e01eb980f6314df855b619a7eb /sd | |
parent | 6f0993f2365cd8b6ce53f7a6e705c7fc9bd07ab6 (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>
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 f0a06b234fdd..796974590294 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 5edf2182b7ab..f91f0663ff81 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 602adf6f785b..908c96cbef89 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 6ffd4d6384df..3c1903637ca8 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 c095f87f28f8..b39c47547a99 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 ); |