Kaydet (Commit) c8ae30a7 authored tarafından Michael Stahl's avatar Michael Stahl

svx: ExternalToolEdit: check that temp file is actually created

Change-Id: I03e49493c549561b4dc806f1e191a73d06733cff
üst e437b130
...@@ -106,11 +106,23 @@ void ExternalToolEdit::Edit(GraphicObject const*const pGraphicObject) ...@@ -106,11 +106,23 @@ void ExternalToolEdit::Edit(GraphicObject const*const pGraphicObject)
OUString aTempFileName; OUString aTempFileName;
oslFileHandle pHandle; 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 // Move it to a file name with image extension properly set
aTempFileName = aTempFileBase + "." + OUString(fExtension); 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 //Write Graphic to the Temp File
GraphicFilter& rGraphicFilter = GraphicFilter::GetGraphicFilter(); GraphicFilter& rGraphicFilter = GraphicFilter::GetGraphicFilter();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment