diff options
author | Chris Sherlock <chris.sherlock79@gmail.com> | 2014-03-30 17:11:01 +1100 |
---|---|---|
committer | Chris Sherlock <chris.sherlock79@gmail.com> | 2014-03-30 17:11:01 +1100 |
commit | b6a43bcbbf9e9a5655fd36fd4c8ef72d585f67b0 (patch) | |
tree | 91bcd28cdbe9a7a4a94d6080ec864835bc045e5e /vcl | |
parent | 654cea3304572e4d33030c8e60503750b06156a3 (diff) |
Clarify warning in graphicsfilter
In GraphicFilter::LoadGraphic() it reports an error code, but that's
particularly unhelpful. Change the warning to actually make sense: I
decode the error code to English.
Change-Id: I3ead54295eda63a8808bb24732d23aa95db0f5fb
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/source/filter/graphicfilter.cxx | 32 |
1 files changed, 31 insertions, 1 deletions
diff --git a/vcl/source/filter/graphicfilter.cxx b/vcl/source/filter/graphicfilter.cxx index 6a2efe709e00..56c50e436229 100644 --- a/vcl/source/filter/graphicfilter.cxx +++ b/vcl/source/filter/graphicfilter.cxx @@ -2280,7 +2280,37 @@ int GraphicFilter::LoadGraphic( const OUString &rPath, const OUString &rFilterNa else nRes = pFilter->ImportGraphic( rGraphic, rPath, *pStream, nFilter, pDeterminedFormat ); - SAL_WARN_IF( nRes, "vcl.filter", "GrafikFehler [" << nRes << "] - [" << rPath << "]" ); + OUString aReturnString; + + switch (nRes) + { + case GRFILTER_OPENERROR: + aReturnString="open error"; + break; + case GRFILTER_IOERROR: + aReturnString="IO error"; + break; + case GRFILTER_FORMATERROR: + aReturnString="format error"; + break; + case GRFILTER_VERSIONERROR: + aReturnString="version error"; + break; + case GRFILTER_FILTERERROR: + aReturnString="filter error"; + break; + case GRFILTER_ABORT: + aReturnString="import aborted"; + break; + case GRFILTER_TOOBIG: + aReturnString="graphic is too big"; + break; + default: + // nothing more to do + break; + } + + SAL_WARN_IF( nRes, "vcl.filter", "Problem importing graphic " << rPath << ". Reason: " << aReturnString ); return nRes; } |