diff options
author | Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk> | 2018-04-13 16:58:49 +0900 |
---|---|---|
committer | Tomaž Vajngerl <quikee@gmail.com> | 2018-04-16 02:52:02 +0200 |
commit | 9fb7aaf570c03c8a26d763f1205fb8c890e8211a (patch) | |
tree | 8f4466b24d9fcae2da5043479a57fabc662a2c43 /sfx2/source/appl/fileobj.cxx | |
parent | ba69036c8e889237da4bb312d7c5c94066abbfd3 (diff) |
Make linked graphic register into LinkedManager again
Change-Id: I16b162f86d6221d120f6355f9a52c1abfcd0ac73
Reviewed-on: https://gerrit.libreoffice.org/52911
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Diffstat (limited to 'sfx2/source/appl/fileobj.cxx')
-rw-r--r-- | sfx2/source/appl/fileobj.cxx | 100 |
1 files changed, 5 insertions, 95 deletions
diff --git a/sfx2/source/appl/fileobj.cxx b/sfx2/source/appl/fileobj.cxx index f19e7f9acc72..371d8839f75a 100644 --- a/sfx2/source/appl/fileobj.cxx +++ b/sfx2/source/appl/fileobj.cxx @@ -76,7 +76,7 @@ SvFileObject::~SvFileObject() bool SvFileObject::GetData( css::uno::Any & rData, const OUString & rMimeType, - bool bGetSynchron ) + bool /*bGetSynchron*/ ) { SotClipboardFormatId nFmt = SotExchange::RegisterFormatMimeType( rMimeType ); switch( nType ) @@ -92,101 +92,11 @@ bool SvFileObject::GetData( css::uno::Any & rData, break; case FILETYPE_GRF: - if( !bLoadError ) + if (SotClipboardFormatId::GDIMETAFILE == nFmt + || SotClipboardFormatId::BITMAP == nFmt + || SotClipboardFormatId::SVXB == nFmt) { - tools::SvRef<SfxMedium> xTmpMed; - - if( SotClipboardFormatId::GDIMETAFILE == nFmt || SotClipboardFormatId::BITMAP == nFmt || - SotClipboardFormatId::SVXB == nFmt ) - { - Graphic aGrf; - - // If the native format is requested, has to be reset at the - // end of the flag. Is solely in the sw/ndgrf.cxx used when - // the link is removed form GraphicNode. - bool bOldNativFormat = bNativFormat; - - // If about to print, waiting for the data to be available - if( bGetSynchron ) - { - // call a LoadFile every second time to test the loading - if( !xMed.is() ) - LoadFile_Impl(); - - if( !bInCallDownload ) - { - xTmpMed = xMed; - while( bWaitForData ) - Application::Reschedule(); - - xMed = xTmpMed; - bClearMedium = true; - } - } - - if( !bWaitForData && ( xMed.is() || // was loaded as URL - ( bSynchron && LoadFile_Impl() && xMed.is() ) ) ) - { - // If it was loaded from the Internet, do not retry - if( !bGetSynchron ) - bLoadAgain = !xMed->IsRemote(); - bLoadError = !GetGraphic_Impl( aGrf, xMed->GetInStream() ); - } - else if( !LoadFile_Impl() || - !GetGraphic_Impl( aGrf, xMed.is() ? xMed->GetInStream() : nullptr )) - { - if( !xMed.is() ) - break; - aGrf.SetDefaultType(); - } - - if( SotClipboardFormatId::SVXB != nFmt ) - nFmt = (bLoadError || GraphicType::Bitmap == aGrf.GetType()) - ? SotClipboardFormatId::BITMAP - : SotClipboardFormatId::GDIMETAFILE; - - SvMemoryStream aMemStm( 0, 65535 ); - switch ( nFmt ) - { - case SotClipboardFormatId::SVXB: - if( GraphicType::NONE != aGrf.GetType() ) - { - aMemStm.SetVersion( SOFFICE_FILEFORMAT_50 ); - WriteGraphic( aMemStm, aGrf ); - } - break; - - case SotClipboardFormatId::BITMAP: - { - const Bitmap aBitmap(aGrf.GetBitmap()); - - if(!aBitmap.IsEmpty()) - { - WriteDIB(aBitmap, aMemStm, false, true); - } - - break; - } - - default: - if( aGrf.GetGDIMetaFile().GetActionSize() ) - { - GDIMetaFile aMeta( aGrf.GetGDIMetaFile() ); - aMeta.Write( aMemStm ); - } - } - rData <<= css::uno::Sequence< sal_Int8 >( static_cast<sal_Int8 const *>(aMemStm.GetData()), - aMemStm.Seek( STREAM_SEEK_TO_END ) ); - - bNativFormat = bOldNativFormat; - - // Everything ready? - if( xMed.is() && !bSynchron && bClearMedium ) - { - xMed.clear(); - bClearMedium = false; - } - } + rData <<= sFileNm; } break; case FILETYPE_OBJECT: |