[Libreoffice-commits] core.git: vcl/source

Chris Sherlock chris.sherlock79 at gmail.com
Sat Mar 29 23:15:45 PDT 2014


 vcl/source/filter/graphicfilter.cxx |   32 +++++++++++++++++++++++++++++++-
 1 file changed, 31 insertions(+), 1 deletion(-)

New commits:
commit b6a43bcbbf9e9a5655fd36fd4c8ef72d585f67b0
Author: Chris Sherlock <chris.sherlock79 at gmail.com>
Date:   Sun Mar 30 17:11:01 2014 +1100

    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

diff --git a/vcl/source/filter/graphicfilter.cxx b/vcl/source/filter/graphicfilter.cxx
index 6a2efe7..56c50e4 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;
 }


More information about the Libreoffice-commits mailing list