Re: [Libreoffice] [PATCH] resubmitted: Some more OSL_* love and debug.hxx removal in writer/sw

2011-05-17 Thread Kohei Yoshida
On Fri, 2011-05-13 at 12:43 +0200, Jacek Wolszczak wrote:
 Resubmitting the mail in case it got lost somewhere in the spam filter.

Just let you know that I've reviewed and checked in the first of your
patches.  I haven't had a chance to review your 2nd and 3rd ones but I
plan to do that shortly (unless someone beats me to it).

Kohei

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


Re: [Libreoffice] [PATCH] resubmitted: Some more OSL_* love and debug.hxx removal in writer/sw

2011-05-17 Thread Kohei Yoshida
On Fri, 2011-05-13 at 12:43 +0200, Jacek Wolszczak wrote:

 BTW, do you think I should create a bug in bugzilla for align ASSERT (
 friends) macro foo easy hack?

Hmm... This I'm not sure.  I don't have a strong opinion either way.
Bjoern?

-- 
Kohei Yoshida, LibreOffice hacker, Calc
kyosh...@novell.com

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


[Libreoffice] [PATCH] resubmitted: Some more OSL_* love and debug.hxx removal in writer/sw

2011-05-13 Thread Jacek Wolszczak
Resubmitting the mail in case it got lost somewhere in the spam filter.

BTW, do you think I should create a bug in bugzilla for align ASSERT (
friends) macro foo easy hack?

Jacek
 Wiadomość przekazywana --
Od: Jacek Wolszczak shutdownrun...@gmail.com
Do: libreoffice-dev libreoffice@lists.freedesktop.org
Temat: [Libreoffice] [PATCH] Some more OSL_* love and debug.hxx removal
in writer/sw
Data: Tue, 10 May 2011 13:01:32 +0200

Hi,

Attached hereto are 3 patches:
- 0001 replaces #ifdef DEBUG with #if OSL_DEBUG_LEVEL  1
- 0002 removes unused (most probably) debug function from acccontext.cxx
- 0003 removes debug.hxx includes from several files in writer/sw. There
are stil a few debug.hxx left as there are some macros from other repos
used therein that contain DBG_ASSERT.

Hope you'll find it useful. As always LGPL3+/MPL.

Jacek

From 14c35419426a941b96eed4890f6e2e6f37af6382 Mon Sep 17 00:00:00 2001
From: Jacek Wolszczak shutdownrun...@gmail.com
Date: Tue, 10 May 2011 09:56:23 +0200
Subject: [PATCH 1/3] Replace #ifdef DEBUG with #if OSL_DEBUG_LEVEL  1

---
 sw/inc/dbgoutsw.hxx|4 +-
 sw/source/core/doc/dbgoutsw.cxx|2 +-
 sw/source/core/doc/docbm.cxx   |2 +-
 sw/source/core/doc/docredln.cxx|4 +-
 sw/source/core/edit/edlingu.cxx|2 +-
 sw/source/core/text/inftxt.cxx |4 +-
 sw/source/core/txtnode/txtedt.cxx  |2 +-
 sw/source/core/undo/SwUndoPageDesc.cxx |   12 
 sw/source/core/unocore/unotext.cxx |4 +-
 sw/source/core/view/printdata.cxx  |2 +-
 sw/source/filter/ww8/WW8Sttbf.cxx  |6 ++--
 sw/source/filter/ww8/WW8TableInfo.cxx  |   46 
 sw/source/filter/ww8/rtfexport.cxx |4 +-
 sw/source/filter/ww8/wrtw8nds.cxx  |   10 +++
 sw/source/filter/ww8/wrtww8.cxx|   40 ++--
 sw/source/filter/ww8/ww8par.cxx|4 +-
 sw/source/ui/lingu/hhcwrp.cxx  |   10 +++---
 sw/source/ui/lingu/olmenu.cxx  |5 +---
 18 files changed, 79 insertions(+), 84 deletions(-)

diff --git a/sw/inc/dbgoutsw.hxx b/sw/inc/dbgoutsw.hxx
index dad9e50..b111808 100644
--- a/sw/inc/dbgoutsw.hxx
+++ b/sw/inc/dbgoutsw.hxx
@@ -28,7 +28,7 @@
 #ifndef __DBGOUTSW_HXX
 #define __DBGOUTSW_HXX
 
-#ifdef DEBUG
+#if OSL_DEBUG_LEVEL  1
 
 #include boost/unordered_map.hpp
 #include tox.hxx
@@ -124,7 +124,7 @@ const char * dbg_out(const boost::unordered_maptKey, tMember, fHashFunction 
 }
 SW_DLLPUBLIC const char * dbg_out(const SwFormToken  rToken);
 SW_DLLPUBLIC const char * dbg_out(const SwFormTokens  rTokens);
-#endif // DEBUG
+#endif // OSL_DEBUG_LEVEL  1
 #endif // __DBGOUTSW_HXX
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/doc/dbgoutsw.cxx b/sw/source/core/doc/dbgoutsw.cxx
index 9b83b52..2ca96f6 100644
--- a/sw/source/core/doc/dbgoutsw.cxx
+++ b/sw/source/core/doc/dbgoutsw.cxx
@@ -28,7 +28,7 @@
 
 // MARKER(update_precomp.py): autogen include statement, do not remove
 #include precompiled_sw.hxx
-#ifdef DEBUG
+#if OSL_DEBUG_LEVEL  1
 
 #include tools/string.hxx
 #include svl/poolitem.hxx
diff --git a/sw/source/core/doc/docbm.cxx b/sw/source/core/doc/docbm.cxx
index 5a3cf3e..7c03f51 100644
--- a/sw/source/core/doc/docbm.cxx
+++ b/sw/source/core/doc/docbm.cxx
@@ -750,7 +750,7 @@ namespace sw { namespace mark
 {
 m_vFieldmarks.clear();
 m_vBookmarks.clear();
-#ifdef DEBUG
+#if OSL_DEBUG_LEVEL  1
 for(iterator_t pBkmk = m_vMarks.begin();
 pBkmk != m_vMarks.end();
 ++pBkmk)
diff --git a/sw/source/core/doc/docredln.cxx b/sw/source/core/doc/docredln.cxx
index 5d5ffd1..e0f6c31 100644
--- a/sw/source/core/doc/docredln.cxx
+++ b/sw/source/core/doc/docredln.cxx
@@ -254,7 +254,7 @@ inline bool IsPrevPos( const SwPosition rPos1, const SwPosition rPos2 )
 : false;
 }
 
-#ifdef DEBUG
+#if OSL_DEBUG_LEVEL  1
 bool CheckPosition( const SwPosition* pStt, const SwPosition* pEnd )
 {
 int nError = 0;
@@ -2733,7 +2733,7 @@ sal_Bool SwRedlineTbl::InsertWithValidRanges( SwRedlinePtr p, sal_uInt16* pInsP
 }
 else
 aNewStt = *pNew-GetPoint();
-#ifdef DEBUG
+#if OSL_DEBUG_LEVEL  1
 CheckPosition( pNew-GetPoint(), pNew-GetMark() );
 #endif
 if( *pNew-GetPoint() != *pNew-GetMark() 
diff --git a/sw/source/core/edit/edlingu.cxx b/sw/source/core/edit/edlingu.cxx
index dcdc438..2464deb 100644
--- a/sw/source/core/edit/edlingu.cxx
+++ b/sw/source/core/edit/edlingu.cxx
@@ -1330,7 +1330,7 @@ void SwEditShell::ApplyChangedSentence(const ::svx::SpellPortions rNewPortions,
 }
 else
 {
-OSL_ENSURE( 0, ApplyChangedSentence: iterator positions broken );
+OSL_FAIL(ApplyChangedSentence: iterator positions broken );
 break;
 }