diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2011-11-22 09:34:46 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2011-11-22 09:41:47 +0100 |
commit | 70a6b9ffbd676a1384433a86205d2cd4f2d4f4b1 (patch) | |
tree | ffb31ef817b5f2037cf7c332da422b9179d613d5 /sw/source/ui | |
parent | f2972242673cc9608960e9ca70e82766be5275e3 (diff) |
New sal/log.h obsoletes osl/diagnose.h and tools/debug.hxx.
* New SAL_INFO..., SAL_WARN... macros.
* New SAL_STREAM supersedes OSL_FORMAT.
* oustringostreaminserter.hxx moved from unotest to rtl (and always UTF-8 now).
* TODO to enable GCC __attribute__((format)) in sal/log.h (requires call-site
cleanup).
* Further functionality in tools/debug.hxx (DBG_MEMTEST, DBG_CTOR, etc.) not yet
addressed.
* Some replacements tools String -> rtl::OUString.
Diffstat (limited to 'sw/source/ui')
-rw-r--r-- | sw/source/ui/docvw/srcedtw.cxx | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/sw/source/ui/docvw/srcedtw.cxx b/sw/source/ui/docvw/srcedtw.cxx index b80904fa2a03..04adab9ac1d4 100644 --- a/sw/source/ui/docvw/srcedtw.cxx +++ b/sw/source/ui/docvw/srcedtw.cxx @@ -33,7 +33,9 @@ #include <hintids.hxx> #include <cmdid.h> - +#include <rtl/oustringostreaminserter.hxx> +#include <rtl/ustring.hxx> +#include <sal/log.h> #include <svtools/textview.hxx> #include <svx/svxids.hrc> #include <vcl/scrbar.hxx> @@ -161,10 +163,10 @@ static void lcl_Highlight(const String& rSource, SwTextPortions& aPortionList) else { // what was that? -#if OSL_DEBUG_LEVEL > 1 - OSL_FAIL(OSL_FORMAT("Token %s not recognised!", - rtl::OUStringToOString(sToken, osl_getThreadTextEncoding()).getStr())); -#endif + SAL_WARN_S( + "sw.level2", + "Token " << rtl::OUString(sToken) + << " not recognised!"); } } @@ -539,7 +541,7 @@ IMPL_LINK(SwSrcEditWindow, ScrollHdl, ScrollBar*, pScroll) IMPL_LINK( SwSrcEditWindow, SyntaxTimerHdl, Timer *, pTimer ) { Time aSyntaxCheckStart; - OSL_ENSURE( pTextView, "Noch keine View, aber Syntax-Highlight ?!" ); + SAL_WARN_IF(pTextView == 0, "sw", "No View yet, but syntax highlighting?!"); bHighlighting = sal_True; sal_uInt16 nLine; @@ -665,10 +667,9 @@ void SwSrcEditWindow::ImpDoHighlight( const String& rSource, sal_uInt16 nLineOff for ( size_t i = 0; i < nCount; i++ ) { SwTextPortion& r = aPortionList[i]; -#if OSL_DEBUG_LEVEL > 1 - sal_uInt16 nLine = aPortionList[0].nLine; - OSL_ENSURE( r.nLine == nLine, "doch mehrere Zeilen ?" ); -#endif + SAL_WARN_IF( + r.nLine != aPortionList[0].nLine, "sw.level2", + "multiple lines after all?"); if ( r.nStart > r.nEnd ) // only until Bug from MD is resolved continue; |