diff options
author | Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk> | 2020-04-11 22:28:25 +0200 |
---|---|---|
committer | Tomaž Vajngerl <quikee@gmail.com> | 2020-04-12 10:11:41 +0200 |
commit | 0f586493da9a1ac359dff9fe9110e60880610eb6 (patch) | |
tree | 50e97d4390f27340230d435ed20103776c624341 | |
parent | cc2b4b89684d82c69e8c4e696e626949de17c963 (diff) |
graphic: use UCBContentHelper to delete files
Change-Id: Ibfec031daaa3b92d2286113c3ef981cfa6d09f05
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92072
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
-rw-r--r-- | vcl/source/gdi/impgraph.cxx | 48 |
1 files changed, 3 insertions, 45 deletions
diff --git a/vcl/source/gdi/impgraph.cxx b/vcl/source/gdi/impgraph.cxx index 5751ecba700c..c6f08ec2130f 100644 --- a/vcl/source/gdi/impgraph.cxx +++ b/vcl/source/gdi/impgraph.cxx @@ -21,12 +21,11 @@ #include <sal/log.hxx> #include <comphelper/fileformat.h> -#include <comphelper/processfactory.hxx> #include <tools/fract.hxx> #include <tools/vcompat.hxx> #include <tools/urlobj.hxx> #include <tools/stream.hxx> -#include <ucbhelper/content.hxx> +#include <unotools/ucbhelper.hxx> #include <unotools/ucbstreamhelper.hxx> #include <unotools/tempfile.hxx> #include <vcl/outdev.hxx> @@ -37,8 +36,6 @@ #include <vcl/graph.hxx> #include <vcl/metaact.hxx> #include <impgraph.hxx> -#include <com/sun/star/ucb/CommandAbortedException.hpp> -#include <com/sun/star/ucb/ContentCreationException.hpp> #include <com/sun/star/graphic/XPrimitive2D.hpp> #include <vcl/dibtools.hxx> #include <map> @@ -355,26 +352,7 @@ void ImpGraphic::ImplClearGraphics() ImpSwapFile::~ImpSwapFile() { - try - { - ::ucbhelper::Content aCnt( aSwapURL.GetMainURL( INetURLObject::DecodeMechanism::NONE ), - css::uno::Reference< css::ucb::XCommandEnvironment >(), - comphelper::getProcessComponentContext() ); - - aCnt.executeCommand( "delete", css::uno::makeAny( true ) ); - } - catch( const css::ucb::ContentCreationException& ) - { - } - catch( const css::uno::RuntimeException& ) - { - } - catch( const css::ucb::CommandAbortedException& ) - { - } - catch( const css::uno::Exception& ) - { - } + utl::UCBContentHelper::Kill(aSwapURL.GetMainURL(INetURLObject::DecodeMechanism::NONE)); } void ImpGraphic::ImplSetPrepared(bool bAnimated, const Size* pSizeHint) @@ -1335,27 +1313,7 @@ bool ImpGraphic::ImplSwapOut() else { xOStm.reset(); - - try - { - ::ucbhelper::Content aCnt( aTmpURL.GetMainURL( INetURLObject::DecodeMechanism::NONE ), - css::uno::Reference< css::ucb::XCommandEnvironment >(), - comphelper::getProcessComponentContext() ); - - aCnt.executeCommand( "delete", css::uno::makeAny( true ) ); - } - catch( const css::ucb::ContentCreationException& ) - { - } - catch( const css::uno::RuntimeException& ) - { - } - catch( const css::ucb::CommandAbortedException& ) - { - } - catch( const css::uno::Exception& ) - { - } + utl::UCBContentHelper::Kill(aTmpURL.GetMainURL(INetURLObject::DecodeMechanism::NONE)); } } } |