@ -112,7 +112,7 @@ struct TypesetBookImpl : TypesetBook
Contents : : iterator i = mContents . insert ( mContents . end ( ) , Content ( text . first , text . second ) ) ;
Contents : : iterator i = mContents . insert ( mContents . end ( ) , Content ( text . first , text . second ) ) ;
if ( i - > empty ( ) )
if ( i - > empty ( ) )
return Range ( Utf8Point ( NULL ) , Utf8Point ( NULL ) ) ;
return Range ( Utf8Point ( nullptr ) , Utf8Point ( nullptr ) ) ;
Utf8Point begin = & i - > front ( ) ;
Utf8Point begin = & i - > front ( ) ;
Utf8Point end = & i - > front ( ) + i - > size ( ) ;
Utf8Point end = & i - > front ( ) + i - > size ( ) ;
@ -150,7 +150,7 @@ struct TypesetBookImpl : TypesetBook
template < typename Visitor >
template < typename Visitor >
void visitRuns ( int top , int bottom , Visitor const & visitor ) const
void visitRuns ( int top , int bottom , Visitor const & visitor ) const
{
{
visitRuns ( top , bottom , NULL , visitor ) ;
visitRuns ( top , bottom , nullptr , visitor ) ;
}
}
StyleImpl * hitTest ( int left , int top ) const
StyleImpl * hitTest ( int left , int top ) const
@ -187,7 +187,7 @@ struct TypesetBookImpl : TypesetBook
for ( Styles : : iterator i = mStyles . begin ( ) ; i ! = mStyles . end ( ) ; + + i )
for ( Styles : : iterator i = mStyles . begin ( ) ; i ! = mStyles . end ( ) ; + + i )
if ( & * i = = style )
if ( & * i = = style )
return i - > mFont ;
return i - > mFont ;
return NULL ;
return nullptr ;
}
}
struct Typesetter ;
struct Typesetter ;
@ -227,8 +227,8 @@ struct TypesetBookImpl::Typesetter : BookTypesetter
Typesetter ( size_t width , size_t height ) :
Typesetter ( size_t width , size_t height ) :
mPageWidth ( width ) , mPageHeight ( height ) ,
mPageWidth ( width ) , mPageHeight ( height ) ,
mSection ( NULL ) , mLine ( NULL ) , mRun ( NULL ) ,
mSection ( nullptr ) , mLine ( nullptr ) , mRun ( nullptr ) ,
mCurrentContent ( NULL ) ,
mCurrentContent ( nullptr ) ,
mCurrentAlignment ( AlignLeft )
mCurrentAlignment ( AlignLeft )
{
{
mBook = std : : make_shared < Book > ( ) ;
mBook = std : : make_shared < Book > ( ) ;
@ -306,7 +306,7 @@ struct TypesetBookImpl::Typesetter : BookTypesetter
void write ( Style * style , size_t begin , size_t end )
void write ( Style * style , size_t begin , size_t end )
{
{
assert ( mCurrentContent ! = NULL ) ;
assert ( mCurrentContent ! = nullptr ) ;
assert ( end < = mCurrentContent - > size ( ) ) ;
assert ( end < = mCurrentContent - > size ( ) ) ;
assert ( begin < = mCurrentContent - > size ( ) ) ;
assert ( begin < = mCurrentContent - > size ( ) ) ;
@ -322,8 +322,8 @@ struct TypesetBookImpl::Typesetter : BookTypesetter
add_partial_text ( ) ;
add_partial_text ( ) ;
mRun = NULL ;
mRun = nullptr ;
mLine = NULL ;
mLine = nullptr ;
}
}
void sectionBreak ( int margin )
void sectionBreak ( int margin )
@ -332,9 +332,9 @@ struct TypesetBookImpl::Typesetter : BookTypesetter
if ( mBook - > mSections . size ( ) > 0 )
if ( mBook - > mSections . size ( ) > 0 )
{
{
mRun = NULL ;
mRun = nullptr ;
mLine = NULL ;
mLine = nullptr ;
mSection = NULL ;
mSection = nullptr ;
if ( mBook - > mRect . bottom < ( mBook - > mSections . back ( ) . mRect . bottom + margin ) )
if ( mBook - > mRect . bottom < ( mBook - > mSections . back ( ) . mRect . bottom + margin ) )
mBook - > mRect . bottom = ( mBook - > mSections . back ( ) . mRect . bottom + margin ) ;
mBook - > mRect . bottom = ( mBook - > mSections . back ( ) . mRect . bottom + margin ) ;
@ -345,7 +345,7 @@ struct TypesetBookImpl::Typesetter : BookTypesetter
{
{
add_partial_text ( ) ;
add_partial_text ( ) ;
if ( mSection ! = NULL )
if ( mSection ! = nullptr )
mSectionAlignment . back ( ) = sectionAlignment ;
mSectionAlignment . back ( ) = sectionAlignment ;
mCurrentAlignment = sectionAlignment ;
mCurrentAlignment = sectionAlignment ;
}
}
@ -449,7 +449,7 @@ struct TypesetBookImpl::Typesetter : BookTypesetter
{
{
add_partial_text ( ) ;
add_partial_text ( ) ;
stream . consume ( ) ;
stream . consume ( ) ;
mLine = NULL , mRun = NULL ;
mLine = nullptr , mRun = nullptr ;
continue ;
continue ;
}
}
@ -508,7 +508,7 @@ struct TypesetBookImpl::Typesetter : BookTypesetter
if ( left + space_width + word_width > mPageWidth )
if ( left + space_width + word_width > mPageWidth )
{
{
mLine = NULL , mRun = NULL , left = 0 ;
mLine = nullptr , mRun = nullptr , left = 0 ;
}
}
else
else
{
{
@ -539,7 +539,7 @@ struct TypesetBookImpl::Typesetter : BookTypesetter
void append_run ( StyleImpl * style , Utf8Stream : : Point begin , Utf8Stream : : Point end , int pc , int right , int bottom )
void append_run ( StyleImpl * style , Utf8Stream : : Point begin , Utf8Stream : : Point end , int pc , int right , int bottom )
{
{
if ( mSection = = NULL )
if ( mSection = = nullptr )
{
{
mBook - > mSections . push_back ( Section ( ) ) ;
mBook - > mSections . push_back ( Section ( ) ) ;
mSection = & mBook - > mSections . back ( ) ;
mSection = & mBook - > mSections . back ( ) ;
@ -547,7 +547,7 @@ struct TypesetBookImpl::Typesetter : BookTypesetter
mSectionAlignment . push_back ( mCurrentAlignment ) ;
mSectionAlignment . push_back ( mCurrentAlignment ) ;
}
}
if ( mLine = = NULL )
if ( mLine = = nullptr )
{
{
mSection - > mLines . push_back ( Line ( ) ) ;
mSection - > mLines . push_back ( Line ( ) ) ;
mLine = & mSection - > mLines . back ( ) ;
mLine = & mSection - > mLines . back ( ) ;
@ -572,7 +572,7 @@ struct TypesetBookImpl::Typesetter : BookTypesetter
if ( mLine - > mRect . bottom < bottom )
if ( mLine - > mRect . bottom < bottom )
mLine - > mRect . bottom = bottom ;
mLine - > mRect . bottom = bottom ;
if ( mRun = = NULL | | mRun - > mStyle ! = style | | mRun - > mRange . second ! = begin )
if ( mRun = = nullptr | | mRun - > mStyle ! = style | | mRun - > mRange . second ! = begin )
{
{
int left = mRun ? mRun - > mRight : mLine - > mRect . left ;
int left = mRun ? mRun - > mRight : mLine - > mRect . left ;
@ -802,17 +802,17 @@ protected:
TextFormat ( MyGUI : : IFont * id , PageDisplay * display ) :
TextFormat ( MyGUI : : IFont * id , PageDisplay * display ) :
mFont ( id ) ,
mFont ( id ) ,
mCountVertex ( 0 ) ,
mCountVertex ( 0 ) ,
mTexture ( NULL ) ,
mTexture ( nullptr ) ,
mRenderItem ( NULL ) ,
mRenderItem ( nullptr ) ,
mDisplay ( display )
mDisplay ( display )
{
{
}
}
void createDrawItem ( MyGUI : : ILayerNode * node )
void createDrawItem ( MyGUI : : ILayerNode * node )
{
{
assert ( mRenderItem = = NULL ) ;
assert ( mRenderItem = = nullptr ) ;
if ( mTexture ! = NULL )
if ( mTexture ! = nullptr )
{
{
mRenderItem = node - > addToRenderItem ( mTexture , false , false ) ;
mRenderItem = node - > addToRenderItem ( mTexture , false , false ) ;
mRenderItem - > addDrawItem ( this , mCountVertex ) ;
mRenderItem - > addDrawItem ( this , mCountVertex ) ;
@ -821,12 +821,12 @@ protected:
void destroyDrawItem ( MyGUI : : ILayerNode * node )
void destroyDrawItem ( MyGUI : : ILayerNode * node )
{
{
assert ( mTexture ! = NULL ? mRenderItem ! = NULL : mRenderItem = = NULL ) ;
assert ( mTexture ! = nullptr ? mRenderItem ! = nullptr : mRenderItem = = nullptr ) ;
if ( mTexture ! = NULL )
if ( mTexture ! = nullptr )
{
{
mRenderItem - > removeDrawItem ( this ) ;
mRenderItem - > removeDrawItem ( this ) ;
mRenderItem = NULL ;
mRenderItem = nullptr ;
}
}
}
}
@ -879,9 +879,9 @@ public:
resetPage ( ) ;
resetPage ( ) ;
mViewTop = 0 ;
mViewTop = 0 ;
mViewBottom = 0 ;
mViewBottom = 0 ;
mFocusItem = NULL ;
mFocusItem = nullptr ;
mItemActive = false ;
mItemActive = false ;
mNode = NULL ;
mNode = nullptr ;
}
}
void dirtyFocusItem ( )
void dirtyFocusItem ( )
@ -999,14 +999,14 @@ public:
for ( ActiveTextFormats : : iterator i = mActiveTextFormats . begin ( ) ; i ! = mActiveTextFormats . end ( ) ; + + i )
for ( ActiveTextFormats : : iterator i = mActiveTextFormats . begin ( ) ; i ! = mActiveTextFormats . end ( ) ; + + i )
{
{
if ( mNode ! = NULL )
if ( mNode ! = nullptr )
i - > second - > destroyDrawItem ( mNode ) ;
i - > second - > destroyDrawItem ( mNode ) ;
delete i - > second ;
delete i - > second ;
}
}
mActiveTextFormats . clear ( ) ;
mActiveTextFormats . clear ( ) ;
if ( newBook ! = NULL )
if ( newBook ! = nullptr )
{
{
createActiveFormats ( newBook ) ;
createActiveFormats ( newBook ) ;
@ -1035,7 +1035,7 @@ public:
else
else
if ( mBook & & isPageDifferent ( newPage ) )
if ( mBook & & isPageDifferent ( newPage ) )
{
{
if ( mNode ! = NULL )
if ( mNode ! = nullptr )
for ( ActiveTextFormats : : iterator i = mActiveTextFormats . begin ( ) ; i ! = mActiveTextFormats . end ( ) ; + + i )
for ( ActiveTextFormats : : iterator i = mActiveTextFormats . begin ( ) ; i ! = mActiveTextFormats . end ( ) ; + + i )
mNode - > outOfDate ( i - > second - > mRenderItem ) ;
mNode - > outOfDate ( i - > second - > mRenderItem ) ;
@ -1083,7 +1083,7 @@ public:
{
{
newBook - > visitRuns ( 0 , 0x7FFFFFFF , CreateActiveFormat ( this ) ) ;
newBook - > visitRuns ( 0 , 0x7FFFFFFF , CreateActiveFormat ( this ) ) ;
if ( mNode ! = NULL )
if ( mNode ! = nullptr )
for ( ActiveTextFormats : : iterator i = mActiveTextFormats . begin ( ) ; i ! = mActiveTextFormats . end ( ) ; + + i )
for ( ActiveTextFormats : : iterator i = mActiveTextFormats . begin ( ) ; i ! = mActiveTextFormats . end ( ) ; + + i )
i - > second - > createDrawItem ( mNode ) ;
i - > second - > createDrawItem ( mNode ) ;
}
}
@ -1187,7 +1187,7 @@ public:
{
{
_checkMargin ( ) ;
_checkMargin ( ) ;
if ( mNode ! = NULL )
if ( mNode ! = nullptr )
for ( ActiveTextFormats : : iterator i = mActiveTextFormats . begin ( ) ; i ! = mActiveTextFormats . end ( ) ; + + i )
for ( ActiveTextFormats : : iterator i = mActiveTextFormats . begin ( ) ; i ! = mActiveTextFormats . end ( ) ; + + i )
mNode - > outOfDate ( i - > second - > mRenderItem ) ;
mNode - > outOfDate ( i - > second - > mRenderItem ) ;
@ -1198,7 +1198,7 @@ public:
for ( ActiveTextFormats : : iterator i = mActiveTextFormats . begin ( ) ; i ! = mActiveTextFormats . end ( ) ; + + i )
for ( ActiveTextFormats : : iterator i = mActiveTextFormats . begin ( ) ; i ! = mActiveTextFormats . end ( ) ; + + i )
i - > second - > destroyDrawItem ( mNode ) ;
i - > second - > destroyDrawItem ( mNode ) ;
mNode = NULL ;
mNode = nullptr ;
}
}
} ;
} ;