diff options
author | Noel Grandin <noelgrandin@gmail.com> | 2016-06-12 20:11:20 +0200 |
---|---|---|
committer | Noel Grandin <noelgrandin@gmail.com> | 2016-06-17 06:38:57 +0000 |
commit | 9c79945ca62b18213728cdd23d9f390304aee1de (patch) | |
tree | 94bb9cc30cbb5bb5508875d80fcf975b673fe0ac /vcl/source/outdev | |
parent | 29e91d5eedd2bf20504ce9ada625d33fec19dc9e (diff) |
convert DBG_ASSERT in vcl
Change-Id: I732fb1a789f90ca7a7f393cc41a6afe84fecf3d3
Reviewed-on: https://gerrit.libreoffice.org/26200
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'vcl/source/outdev')
-rw-r--r-- | vcl/source/outdev/font.cxx | 4 | ||||
-rw-r--r-- | vcl/source/outdev/map.cxx | 4 | ||||
-rw-r--r-- | vcl/source/outdev/outdev.cxx | 2 | ||||
-rw-r--r-- | vcl/source/outdev/pixel.cxx | 2 | ||||
-rw-r--r-- | vcl/source/outdev/text.cxx | 14 |
5 files changed, 13 insertions, 13 deletions
diff --git a/vcl/source/outdev/font.cxx b/vcl/source/outdev/font.cxx index 388b9b566886..48e16525ad39 100644 --- a/vcl/source/outdev/font.cxx +++ b/vcl/source/outdev/font.cxx @@ -1523,8 +1523,8 @@ sal_Int32 OutputDevice::HasGlyphs( const vcl::Font& rTempFont, const OUString& r else nEnd = std::min( rStr.getLength(), nIndex + nLen ); - DBG_ASSERT( nIndex < nEnd, "StartPos >= EndPos?" ); - DBG_ASSERT( nEnd <= rStr.getLength(), "String too short" ); + SAL_WARN_IF( nIndex >= nEnd, "vcl", "StartPos >= EndPos?" ); + SAL_WARN_IF( nEnd > rStr.getLength(), "vcl", "String too short" ); // to get the map temporarily set font const vcl::Font aOrigFont = GetFont(); diff --git a/vcl/source/outdev/map.cxx b/vcl/source/outdev/map.cxx index af4c2a82a6b2..871407dec5d3 100644 --- a/vcl/source/outdev/map.cxx +++ b/vcl/source/outdev/map.cxx @@ -1518,8 +1518,8 @@ static void verifyUnitSourceDest( MapUnit eUnitSource, MapUnit eUnitDest ) #define ENTER3( eUnitSource, eUnitDest ) \ long nNumerator = 1; \ long nDenominator = 1; \ - DBG_ASSERT( eUnitSource < s_ImplArySize, "Invalid source map unit"); \ - DBG_ASSERT( eUnitDest < s_ImplArySize, "Invalid destination map unit"); \ + SAL_WARN_IF( eUnitSource >= s_ImplArySize, "vcl", "Invalid source map unit"); \ + SAL_WARN_IF( eUnitDest >= s_ImplArySize, "vcl", "Invalid destination map unit"); \ if( (eUnitSource < s_ImplArySize) && (eUnitDest < s_ImplArySize) ) \ { \ nNumerator = aImplNumeratorAry[eUnitSource] * \ diff --git a/vcl/source/outdev/outdev.cxx b/vcl/source/outdev/outdev.cxx index 4c32c66c3165..e8bd5f434823 100644 --- a/vcl/source/outdev/outdev.cxx +++ b/vcl/source/outdev/outdev.cxx @@ -634,7 +634,7 @@ void OutputDevice::drawOutDevDirect( const OutputDevice* pSrcDev, SalTwoRect& rP if ( !AcquireGraphics() ) return; } - DBG_ASSERT( mpGraphics && pSrcDev->mpGraphics, + SAL_WARN_IF( !mpGraphics || !pSrcDev->mpGraphics, "vcl", "OutputDevice::DrawOutDev(): We need more than one Graphics" ); } } diff --git a/vcl/source/outdev/pixel.cxx b/vcl/source/outdev/pixel.cxx index ff9772aff3e3..478a693e068b 100644 --- a/vcl/source/outdev/pixel.cxx +++ b/vcl/source/outdev/pixel.cxx @@ -121,7 +121,7 @@ void OutputDevice::DrawPixel( const tools::Polygon& rPts, const Color* pColors ) } else { - DBG_ASSERT( pColors, "OutputDevice::DrawPixel: No color array specified" ); + SAL_WARN_IF( !pColors, "vcl", "OutputDevice::DrawPixel: No color array specified" ); const sal_uInt16 nSize = rPts.GetSize(); diff --git a/vcl/source/outdev/text.cxx b/vcl/source/outdev/text.cxx index 114b35b09a22..2de235bf5ceb 100644 --- a/vcl/source/outdev/text.cxx +++ b/vcl/source/outdev/text.cxx @@ -524,7 +524,7 @@ long OutputDevice::ImplGetTextLines( ImplMultiTextLineInfo& rLineInfo, { nSoftBreak = nPos; } - DBG_ASSERT( nSoftBreak < nBreakPos, "Break?!" ); + SAL_WARN_IF( nSoftBreak >= nBreakPos, "vcl", "Break?!" ); css::i18n::LineBreakHyphenationOptions aHyphOptions( xHyph, css::uno::Sequence <css::beans::PropertyValue>(), 1 ); css::i18n::LineBreakUserOptions aUserOptions; css::i18n::LineBreakResults aLBR = xBI->getLineBreak( rStr, nSoftBreak, rDefLocale, nPos, aHyphOptions, aUserOptions ); @@ -547,13 +547,13 @@ long OutputDevice::ImplGetTextLines( ImplMultiTextLineInfo& rLineInfo, css::i18n::Boundary aBoundary = xBI->getWordBoundary( rStr, nBreakPos, rDefLocale, css::i18n::WordType::DICTIONARY_WORD, true ); sal_Int32 nWordStart = nPos; sal_Int32 nWordEnd = aBoundary.endPos; - DBG_ASSERT( nWordEnd > nWordStart, "ImpBreakLine: Start >= End?" ); + SAL_WARN_IF( nWordEnd <= nWordStart, "vcl", "ImpBreakLine: Start >= End?" ); sal_Int32 nWordLen = nWordEnd - nWordStart; if ( ( nWordEnd >= nSoftBreak ) && ( nWordLen > 3 ) ) { // #104415# May happen, because getLineBreak may differ from getWordBoudary with DICTIONARY_WORD - // DBG_ASSERT( nWordEnd >= nMaxBreakPos, "Hyph: Break?" ); + // SAL_WARN_IF( nWordEnd < nMaxBreakPos, "vcl", "Hyph: Break?" ); OUString aWord = rStr.copy( nWordStart, nWordLen ); sal_Int32 nMinTrail = nWordEnd-nSoftBreak+1; //+1: Before the "broken off" char css::uno::Reference< css::linguistic2::XHyphenatedWord > xHyphWord; @@ -611,7 +611,7 @@ long OutputDevice::ImplGetTextLines( ImplMultiTextLineInfo& rLineInfo, ++nTxtEnd; } - DBG_ASSERT( ( nAltEnd - nAltStart ) == 1, "Alternate: Wrong assumption!" ); + SAL_WARN_IF( ( nAltEnd - nAltStart ) != 1, "vcl", "Alternate: Wrong assumption!" ); if ( nTxtEnd > nTxtStart ) cAlternateReplChar = aAlt[ nAltStart ]; @@ -676,8 +676,8 @@ long OutputDevice::ImplGetTextLines( ImplMultiTextLineInfo& rLineInfo, { ImplTextLineInfo* pLine = rLineInfo.GetLine( nL ); OUString aLine = rStr.copy( pLine->GetIndex(), pLine->GetLen() ); - DBG_ASSERT( aLine.indexOf( '\r' ) == -1, "ImplGetTextLines - Found CR!" ); - DBG_ASSERT( aLine.indexOf( '\n' ) == -1, "ImplGetTextLines - Found LF!" ); + SAL_WARN_IF( aLine.indexOf( '\r' ) != -1, "vcl", "ImplGetTextLines - Found CR!" ); + SAL_WARN_IF( aLine.indexOf( '\n' ) != -1, "vcl", "ImplGetTextLines - Found LF!" ); } #endif @@ -2186,7 +2186,7 @@ void OutputDevice::DrawCtrlText( const Point& rPos, const OUString& rStr, { if( nMnemonicPos < (nIndex+nLen) ) --nLen; - DBG_ASSERT( nMnemonicPos < (nIndex+nLen), "Mnemonic underline marker after last character" ); + SAL_WARN_IF( nMnemonicPos >= (nIndex+nLen), "vcl", "Mnemonic underline marker after last character" ); } bool bInvalidPos = false; |