[Libreoffice-commits] core.git: Branch 'libreoffice-4-4' - svx/source

Michael Stahl mstahl at redhat.com
Mon Jan 19 04:29:41 PST 2015


 svx/source/core/extedit.cxx |   16 ++++++++++++++--
 1 file changed, 14 insertions(+), 2 deletions(-)

New commits:
commit ef490df2119523e1761f99b5fdbb387c2c71608d
Author: Michael Stahl <mstahl at redhat.com>
Date:   Mon Jan 19 12:31:03 2015 +0100

    svx: ExternalToolEdit: check that temp file is actually created
    
    (cherry picked from commit c8ae30a720474db8efed3db31348f8ae52c149c3)
    
    Conflicts:
    	svx/source/core/extedit.cxx
    
    Change-Id: I03e49493c549561b4dc806f1e191a73d06733cff
    Reviewed-on: https://gerrit.libreoffice.org/13996
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/svx/source/core/extedit.cxx b/svx/source/core/extedit.cxx
index 14d12b1..e32b163 100644
--- a/svx/source/core/extedit.cxx
+++ b/svx/source/core/extedit.cxx
@@ -106,11 +106,23 @@ void ExternalToolEdit::Edit(GraphicObject const*const pGraphicObject)
     OUString aTempFileName;
 
     oslFileHandle pHandle;
-    osl::FileBase::createTempFile(0, &pHandle, &aTempFileBase);
+    osl::FileBase::RC rc =
+        osl::FileBase::createTempFile(0, &pHandle, &aTempFileBase);
+    if (osl::FileBase::E_None != rc)
+    {
+        SAL_WARN("svx", "ExternalToolEdit::Edit: cannot create temp file");
+        return;
+    }
 
     // Move it to a file name with image extension properly set
     aTempFileName = aTempFileBase + OUString('.') + OUString(fExtension);
-    osl::File::move(aTempFileBase, aTempFileName);
+    // FIXME: this is pretty stupid, need a better osl temp file API
+    rc = osl::File::move(aTempFileBase, aTempFileName);
+    if (osl::FileBase::E_None != rc)
+    {
+        SAL_WARN("svx", "ExternalToolEdit::Edit: cannot move temp file");
+        return;
+    }
 
     //Write Graphic to the Temp File
     GraphicFilter& rGraphicFilter = GraphicFilter::GetGraphicFilter();


More information about the Libreoffice-commits mailing list