summaryrefslogtreecommitdiff
path: root/svx
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2015-01-19 12:31:03 +0100
committerCaolán McNamara <caolanm@redhat.com>2015-01-19 12:29:07 +0000
commitef490df2119523e1761f99b5fdbb387c2c71608d (patch)
tree3f206905d17422cdfd631f006e85e3d6364f81f8 /svx
parent0e0595c59ba399b265146c256bf0e0631623e898 (diff)
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@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'svx')
-rw-r--r--svx/source/core/extedit.cxx16
1 files changed, 14 insertions, 2 deletions
diff --git a/svx/source/core/extedit.cxx b/svx/source/core/extedit.cxx
index 14d12b10d9dd..e32b163bad0a 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();