diff options
author | Mark Page <aptitude@btconnect.com> | 2016-06-16 13:31:34 +0100 |
---|---|---|
committer | jan iversen <jani@documentfoundation.org> | 2016-07-05 06:36:05 +0000 |
commit | 308a088211a0df6a75a1f5cd63aa7ee9dcb54536 (patch) | |
tree | 66f6de21fdaab8d2ce9c73e9466ee2268a4bdca7 | |
parent | dac06d9cb05552022ef8ee958c75297ed58c01b8 (diff) |
Remove unused DELEGATE_PLUGGABLE_RENDERER to simplify mtf code
The code was added July 2008 as a way to delegate mtf action
rendering to external services.
Change-Id: I5b2277fada1a8ad85e82cb2c10c822df09da836a
Reviewed-on: https://gerrit.libreoffice.org/26371
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: jan iversen <jani@documentfoundation.org>
Tested-by: jan iversen <jani@documentfoundation.org>
-rw-r--r-- | include/vcl/gdimtf.hxx | 2 | ||||
-rw-r--r-- | vcl/source/gdi/gdimtf.cxx | 81 |
2 files changed, 1 insertions, 82 deletions
diff --git a/include/vcl/gdimtf.hxx b/include/vcl/gdimtf.hxx index e75107f1b4e1..06826326ff49 100644 --- a/include/vcl/gdimtf.hxx +++ b/include/vcl/gdimtf.hxx @@ -97,8 +97,6 @@ private: const Gradient& rGrad ); SAL_DLLPRIVATE bool ImplPlayWithRenderer( OutputDevice* pOut, const Point& rPos, Size rLogicDestSize ); - SAL_DLLPRIVATE void ImplDelegate2PluggableRenderer( const MetaCommentAction* pAct, OutputDevice* pOut ); - protected: diff --git a/vcl/source/gdi/gdimtf.cxx b/vcl/source/gdi/gdimtf.cxx index 64811b3769e7..b2bdcd113667 100644 --- a/vcl/source/gdi/gdimtf.cxx +++ b/vcl/source/gdi/gdimtf.cxx @@ -355,15 +355,7 @@ void GDIMetaFile::Play( OutputDevice* pOut, size_t nPos ) { if( pAction ) { - if( pAction->GetType() == MetaActionType::COMMENT && - static_cast<MetaCommentAction*>(pAction)->GetComment() == "DELEGATE_PLUGGABLE_RENDERER" ) - { - ImplDelegate2PluggableRenderer(static_cast<MetaCommentAction*>(pAction), pOut); - } - else - { - pAction->Execute( pOut ); - } + pAction->Execute( pOut ); // flush output from time to time if( i++ > nSyncCount ) @@ -450,77 +442,6 @@ bool GDIMetaFile::ImplPlayWithRenderer( OutputDevice* pOut, const Point& rPos, S return false; } -void GDIMetaFile::ImplDelegate2PluggableRenderer( const MetaCommentAction* pAct, OutputDevice* pOut ) -{ - OSL_ASSERT( pAct->GetComment() == "DELEGATE_PLUGGABLE_RENDERER" ); - - // read payload - string of service name, followed by raw render input - const sal_uInt8* pData = pAct->GetData(); - const sal_uInt8* const pEndData = pData + pAct->GetDataSize(); - if( !pData ) - return; - - OUStringBuffer aBuffer; - while( pData<pEndData && *pData ) - aBuffer.append(static_cast<sal_Unicode>(*pData++)); - const OUString aRendererServiceName=aBuffer.makeStringAndClear(); - ++pData; - - while( pData<pEndData && *pData ) - aBuffer.append(static_cast<sal_Unicode>(*pData++)); - const OUString aGraphicServiceName=aBuffer.makeStringAndClear(); - ++pData; - - uno::Reference< lang::XMultiServiceFactory > xFactory = comphelper::getProcessServiceFactory(); - if( pData<pEndData ) - { - try - { - // instantiate render service - uno::Sequence<uno::Any> aRendererArgs(1); - aRendererArgs[0] = makeAny(uno::Reference<awt::XGraphics>(pOut->CreateUnoGraphics())); - uno::Reference<graphic::XGraphicRenderer> xRenderer( - xFactory->createInstanceWithArguments( - aRendererServiceName, - aRendererArgs), - uno::UNO_QUERY ); - - // instantiate graphic service - uno::Reference<graphic::XGraphic> xGraphic( - xFactory->createInstance( - aGraphicServiceName), - uno::UNO_QUERY ); - - uno::Reference<lang::XInitialization> xInit( - xGraphic, uno::UNO_QUERY); - - if(xGraphic.is() && xRenderer.is() && xInit.is()) - { - // delay initialization of XGraphic, to only expose - // XGraphic-generating services to arbitrary binary data - uno::Sequence< sal_Int8 > aSeq( - reinterpret_cast<sal_Int8 const *>(pData), pEndData-pData ); - uno::Sequence<uno::Any> aGraphicsArgs(1); - aGraphicsArgs[0] = makeAny(aSeq); - xInit->initialize(aGraphicsArgs); - - xRenderer->render(xGraphic); - } - } - catch (const uno::RuntimeException&) - { - // runtime errors are fatal - throw; - } - catch (const uno::Exception& e) - { - // ignore errors, no way of reporting them here - SAL_WARN("vcl", "GDIMetaFile::ImplDelegate2PluggableRenderer:" - " exception: " << e.Message); - } - } -} - void GDIMetaFile::Play( OutputDevice* pOut, const Point& rPos, const Size& rSize ) { |