[Libreoffice-commits] core.git: vcl/source

Tomaž Vajngerl (via logerrit) logerrit at kemper.freedesktop.org
Sun Apr 12 08:12:20 UTC 2020


 vcl/source/gdi/impgraph.cxx |   48 ++------------------------------------------
 1 file changed, 3 insertions(+), 45 deletions(-)

New commits:
commit 0f586493da9a1ac359dff9fe9110e60880610eb6
Author:     Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
AuthorDate: Sat Apr 11 22:28:25 2020 +0200
Commit:     Tomaž Vajngerl <quikee at gmail.com>
CommitDate: Sun Apr 12 10:11:41 2020 +0200

    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 at gmail.com>

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));
                 }
             }
         }


More information about the Libreoffice-commits mailing list