[PATCH] Convert from EMFP_DEBUG to SAL_INFO

Chris Sherlock (via Code Review) gerrit at gerrit.libreoffice.org
Wed May 1 09:09:19 PDT 2013


Hi,

I have submitted a patch for review:

    https://gerrit.libreoffice.org/3726

To pull it, you can do:

    git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/26/3726/1

Convert from EMFP_DEBUG to SAL_INFO

* Change to SAL_INFO instead of EMFP_DEBUG in implrenderer.cxx
* Add new log area cppcanvas.emf
* Update comment in log.hxx to reference the new location of log-areas.dox

Change-Id: I5d710725339f58a111a2f3494c3a72f685624322
---
M cppcanvas/source/mtfrenderer/implrenderer.cxx
M include/sal/log-areas.dox
M include/sal/log.hxx
3 files changed, 8 insertions(+), 13 deletions(-)



diff --git a/cppcanvas/source/mtfrenderer/implrenderer.cxx b/cppcanvas/source/mtfrenderer/implrenderer.cxx
index 6d355a8..635a5fb 100644
--- a/cppcanvas/source/mtfrenderer/implrenderer.cxx
+++ b/cppcanvas/source/mtfrenderer/implrenderer.cxx
@@ -81,12 +81,6 @@
 #include "outdevstate.hxx"
 #include <basegfx/matrix/b2dhommatrixtools.hxx>
 
-#if OSL_DEBUG_LEVEL > 1
-#define EMFP_DEBUG(x) x
-#else
-#define EMFP_DEBUG(x)
-#endif
-
 using namespace ::com::sun::star;
 
 
@@ -1326,7 +1320,7 @@
                 // - SetFont to process font metric specific actions
                 pCurrAct->Execute( &rVDev );
 
-                EMFP_DEBUG(printf("MTF\trecord type: 0x%x (%d)\n", pCurrAct->GetType(), pCurrAct->GetType()));
+                SAL_INFO("cppcanvas.emf", "MTF\trecord type: 0x" << pCurrAct->GetType() << " (" << pCurrAct->GetType() << ")");
 
                 switch( pCurrAct->GetType() )
                 {
@@ -1834,22 +1828,22 @@
                                 count = 0;
                                 if (char *env = getenv ("EMF_PLUS_LIMIT")) {
                                     limit = atoi (env);
-                                    EMFP_DEBUG (printf ("EMF+ records limit: %d\n", limit));
+                                    SAL_INFO ("cppcanvas.emf", "EMF+ records limit: " << limit);
                                 }
                             }
-                            EMFP_DEBUG (printf ("EMF+ passed to canvas mtf renderer, size: %u\n", (unsigned int)pAct->GetDataSize ()));
+                            SAL_INFO ("cppcanvas.emf", "EMF+ passed to canvas mtf renderer, size: " << pAct->GetDataSize ());
                             if (count < limit)
                                 processEMFPlus( pAct, rFactoryParms, rStates.getState(), rCanvas );
                             count ++;
                         } else if( pAct->GetComment().equalsL(RTL_CONSTASCII_STRINGPARAM("EMF_PLUS_HEADER_INFO")) ) {
-                            EMFP_DEBUG (printf ("EMF+ passed to canvas mtf renderer - header info, size: %u\n", (unsigned int)pAct->GetDataSize ()));
+                            SAL_INFO ("cppcanvas.emf", "EMF+ passed to canvas mtf renderer - header info, size: " << pAct->GetDataSize ());
 
                             SvMemoryStream rMF ((void*) pAct->GetData (), pAct->GetDataSize (), STREAM_READ);
 
                             rMF >> nFrameLeft >> nFrameTop >> nFrameRight >> nFrameBottom;
-                            EMFP_DEBUG (printf ("EMF+ picture frame: %d,%d - %d,%d\n", (int)nFrameLeft, (int)nFrameTop, (int)nFrameRight, (int)nFrameBottom));
+                            SAL_INFO ("cppcanvas.emf", "EMF+ picture frame: " << nFrameLeft << "," << nFrameTop << " - " << nFrameRight << "," << nFrameBottom);
                             rMF >> nPixX >> nPixY >> nMmX >> nMmY;
-                            EMFP_DEBUG (printf ("EMF+ ref device pixel size: %dx%d mm size: %dx%d\n", (int)nPixX, (int)nPixY, (int)nMmX, (int)nMmY));
+                            SAL_INFO ("cppcanvas.emf", "EMF+ ref device pixel size: " << nPixX << "x" << nPixY << " mm size: " << nMmX << "x" << nMmY);
 
                             rMF >> aBaseTransform;
                             //aWorldTransform.Set (aBaseTransform);
diff --git a/include/sal/log-areas.dox b/include/sal/log-areas.dox
index 44549e7..5f9039d 100644
--- a/include/sal/log-areas.dox
+++ b/include/sal/log-areas.dox
@@ -330,6 +330,7 @@
 @li @c comphelper
 @li @c configmgr
 @li @c cppcanvas
+ at li @c cppcanvas.emf
 @li @c cppuhelper
 @li @c cppu
 @li @c forms
diff --git a/include/sal/log.hxx b/include/sal/log.hxx
index 6eae1b5..80721d0 100644
--- a/include/sal/log.hxx
+++ b/include/sal/log.hxx
@@ -203,7 +203,7 @@
     @endverbatim
 
     For a list of areas used see @ref sal_log_areas "SAL debug areas". Whenever
-    you use a new log area, add it to the file sal/inc/sal/log-areas.dox .
+    you use a new log area, add it to the file include/sal/log-areas.dox .
 
     Whether these macros generate any log output is controlled in a two-stage
     process.

-- 
To view, visit https://gerrit.libreoffice.org/3726
To unsubscribe, visit https://gerrit.libreoffice.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I5d710725339f58a111a2f3494c3a72f685624322
Gerrit-PatchSet: 1
Gerrit-Project: core
Gerrit-Branch: master
Gerrit-Owner: Chris Sherlock <chris.sherlock79 at gmail.com>



More information about the LibreOffice mailing list