From b6a43bcbbf9e9a5655fd36fd4c8ef72d585f67b0 Mon Sep 17 00:00:00 2001 From: Chris Sherlock Date: Sun, 30 Mar 2014 17:11:01 +1100 Subject: [PATCH] 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 --- vcl/source/filter/graphicfilter.cxx | 32 ++++++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) 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; }