From c8ae30a720474db8efed3db31348f8ae52c149c3 Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Mon, 19 Jan 2015 12:31:03 +0100 Subject: svx: ExternalToolEdit: check that temp file is actually created Change-Id: I03e49493c549561b4dc806f1e191a73d06733cff --- svx/source/core/extedit.cxx | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'svx') diff --git a/svx/source/core/extedit.cxx b/svx/source/core/extedit.cxx index 7cc8b5f70211..b49125332b29 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(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(); -- cgit