Tor Lillqvist wrote:
Now what it's the right flag to use to surround a debug specific code: OSL_DEBUG_LEVEL > 1 or DBG_UTIL ?

I recently did a build with --enable-dbgutil so that it would use the debugging 
C++ library on Windows. (As such that was mostly useless, it didn't help me 
find the cause of the problem I was seeing.)

(I did not use --enable-debug or any debug=x options to individual build 
commands, which would have set OSL_DEBUG_LEVEL, too.)

That build revealed several places in the code where as far as I could see 
there was a mixup between these two things and I got compilation errors. I 
fixed things up so that my --enable-dbgutil build compiled and linked. But it 
is entirely possible that this then broken stuff for a build with just 
--enable-debug or debug=true but not --enable-dbgutil.

I confess I'm a little confused :-).

So am I, and disgusted. I am not sure at all that we really want to keep this 
distinction between --enable-dbgutil and --enable-debug (and then there is also 
--enable-symbols) in LibreOffice. Nobody understands it.

I added a patch that should refine the work started by tml and others
re: DBG_UTIL <-> OSL_DEBUG_LEVEL mixup.

The patch changes some of the DBG_UTIL to OSL_DEBUG_LEVEL, so they won't
break the build with debug=true.

Though a couple of warning popped up while building in debug mode.

beppec56.

--
Kind Regards,
Giuseppe Castagno
Acca Esse http://www.acca-esse.eu
giuseppe.castagno at acca-esse.eu
beppec56 at openoffice.org



>From 6e5352223ce2000bfe188ffa8285c219b99e618f Mon Sep 17 00:00:00 2001
From: Giuseppe Castagno <giuseppe.casta...@acca-esse.eu>
Date: Tue, 16 Nov 2010 16:46:13 +0100
Subject: [PATCH] Fixed DBG_UTIL vs. OSL_DEBUG_LEVEL mixup.

---
 sw/inc/crsrsh.hxx                  |    2 +-
 sw/source/core/text/txtfly.cxx     |    2 +-
 sw/source/filter/html/htmltabw.cxx |    2 +-
 sw/source/ui/dbui/dbinsdlg.cxx     |    2 +-
 sw/source/ui/dbui/mmoutputpage.cxx |    2 +-
 sw/source/ui/dialog/swdlgfact.cxx  |    2 +-
 sw/source/ui/docvw/srcedtw.cxx     |    2 +-
 7 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/sw/inc/crsrsh.hxx b/sw/inc/crsrsh.hxx
index 8f84a8f..7f61680 100644
--- a/sw/inc/crsrsh.hxx
+++ b/sw/inc/crsrsh.hxx
@@ -109,7 +109,7 @@ struct SwContentAtPos
         SW_CONTENT_CHECK    = 0x0400,
         SW_SMARTTAG         = 0x0800,
         SW_FORMCTRL         = 0x1000
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
         ,SW_CURR_ATTRS      = 0x4000        // only for debugging
         ,SW_TABLEBOXVALUE   = 0x8000        // only for debugging
 #endif
diff --git a/sw/source/core/text/txtfly.cxx b/sw/source/core/text/txtfly.cxx
index 51c5975..a2c2360 100644
--- a/sw/source/core/text/txtfly.cxx
+++ b/sw/source/core/text/txtfly.cxx
@@ -82,7 +82,7 @@
 #include <svx/svdoedge.hxx>
 #include "doc.hxx"
 
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
 #include "viewopt.hxx"	// SwViewOptions, nur zum Testen (Test2)
 #endif
 
diff --git a/sw/source/filter/html/htmltabw.cxx b/sw/source/filter/html/htmltabw.cxx
index c5c20a0..42ecb62 100644
--- a/sw/source/filter/html/htmltabw.cxx
+++ b/sw/source/filter/html/htmltabw.cxx
@@ -63,7 +63,7 @@
 #include <htmlnum.hxx>
 #include <wrthtml.hxx>
 #include <wrtswtbl.hxx>
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
 #include <viewsh.hxx>
 #include <viewopt.hxx>
 #endif
diff --git a/sw/source/ui/dbui/dbinsdlg.cxx b/sw/source/ui/dbui/dbinsdlg.cxx
index 093adfd..6656e40 100644
--- a/sw/source/ui/dbui/dbinsdlg.cxx
+++ b/sw/source/ui/dbui/dbinsdlg.cxx
@@ -1181,7 +1181,7 @@ void SwInsertDBColAutoPilot::DataToDoc( const Sequence<Any>& rSelection,
                     }
                 }
                 catch(Exception&
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
                             aExcept
 #endif
                 )
diff --git a/sw/source/ui/dbui/mmoutputpage.cxx b/sw/source/ui/dbui/mmoutputpage.cxx
index 78e87c3..fd473ab 100644
--- a/sw/source/ui/dbui/mmoutputpage.cxx
+++ b/sw/source/ui/dbui/mmoutputpage.cxx
@@ -1219,7 +1219,7 @@ IMPL_LINK(SwMailMergeOutputPage, SendDocumentsHdl_Impl, PushButton*, pButton)
         }
         xTempDocShell->DoClose();
 
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
         sal_Int32 nTarget =
 #endif
                 rConfigItem.MoveResultSet(rInfo.nDBRow);
diff --git a/sw/source/ui/dialog/swdlgfact.cxx b/sw/source/ui/dialog/swdlgfact.cxx
index 3ccb52e..06f3604 100644
--- a/sw/source/ui/dialog/swdlgfact.cxx
+++ b/sw/source/ui/dialog/swdlgfact.cxx
@@ -583,7 +583,7 @@ long AbstractMailMergeWizard_Impl::GetResult()
     return pDlg->GetResult();
 }
 
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
 IMPL_LINK( AbstractMailMergeWizard_Impl, EndDialogHdl, SwMailMergeWizard*, pDialog )
 #else
 IMPL_LINK( AbstractMailMergeWizard_Impl, EndDialogHdl, SwMailMergeWizard*, EMPTYARG )
diff --git a/sw/source/ui/docvw/srcedtw.cxx b/sw/source/ui/docvw/srcedtw.cxx
index 8f77957..4ed4c7d 100644
--- a/sw/source/ui/docvw/srcedtw.cxx
+++ b/sw/source/ui/docvw/srcedtw.cxx
@@ -660,7 +660,7 @@ void SwSrcEditWindow::ImpDoHighlight( const String& rSource, USHORT nLineOff )
         // optimiert das die TextEngine.
         USHORT nLastEnd = 0;
 
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
         USHORT nLine = aPortionList[0].nLine;
 #endif
         for ( USHORT i = 0; i < nCount; i++ )
-- 
1.6.3.3




_______________________________________________
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice

Reply via email to