Mercurial > projects > dwt-addons
diff dwtx/dwtxhelper/mangoicu/UBreakIterator.d @ 98:95307ad235d9
Added Draw2d code, still work in progress
author | Frank Benoit <benoit@tionex.de> |
---|---|
date | Sun, 03 Aug 2008 00:52:14 +0200 |
parents | f05207c07a98 |
children | 1a5b8f8129df |
line wrap: on
line diff
--- a/dwtx/dwtxhelper/mangoicu/UBreakIterator.d Sat Jul 26 14:39:08 2008 +0200 +++ b/dwtx/dwtxhelper/mangoicu/UBreakIterator.d Sun Aug 03 00:52:14 2008 +0200 @@ -366,25 +366,29 @@ ***********************************************************************/ - static UBreakIterator openWordIterator( ULocale locale, char[] str ){ + static UBreakIterator openWordIterator( ULocale locale, char[] str = null ){ UBreakIterator res; - res.ut.openUTF8(str); auto e = ICU.UErrorCode.OK; res.handle = ubrk_open( Type.Word, locale.name.ptr, null, 0, e); ICU.testError (e, "failed to open word iterator"); - ubrk_setUText( res.handle, & res.ut, e); - ICU.testError (e, "failed to set text in iterator"); + if( str ) { + res.ut.openUTF8(str); + ubrk_setUText( res.handle, & res.ut, e); + ICU.testError (e, "failed to set text in iterator"); + } return res; } - static UBreakIterator openLineIterator( ULocale locale, char[] str ){ + static UBreakIterator openLineIterator( ULocale locale, char[] str = null ){ UBreakIterator res; - res.ut.openUTF8(str); auto e = ICU.UErrorCode.OK; res.handle = ubrk_open( Type.Line, locale.name.ptr, null, 0, e); ICU.testError (e, "failed to open line iterator"); - ubrk_setUText( res.handle, & res.ut, e); - ICU.testError (e, "failed to set text in iterator"); + if( str ) { + res.ut.openUTF8(str); + ubrk_setUText( res.handle, & res.ut, e); + ICU.testError (e, "failed to set text in iterator"); + } return res; }