diff options
author | Caolán McNamara <caolanm@redhat.com> | 2014-10-24 09:22:57 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2014-10-24 09:24:59 +0100 |
commit | d9dde5e57262e2fb91636ca5d1ee91cdb647ba05 (patch) | |
tree | a531988c7b34ba6da9d78af14db943d13579cf0a | |
parent | a52028d55427aa1a2bc51aff307a2436f68576ad (diff) |
improve Sttb dumping for truncated case
Change-Id: Ie4c1d01540274e3782487d376168f561766b7a39
-rw-r--r-- | sw/source/filter/ww8/ww8par.cxx | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx index 0f049a4c9e97..90fcc8c54f08 100644 --- a/sw/source/filter/ww8/ww8par.cxx +++ b/sw/source/filter/ww8/ww8par.cxx @@ -458,9 +458,10 @@ public: OUString getStringAtIndex( sal_uInt32 ); }; -Sttb::Sttb() : fExtend( 0 ) -,cData( 0 ) -,cbExtra( 0 ) +Sttb::Sttb() + : fExtend(0) + , cData(0) + , cbExtra(0) { } @@ -499,8 +500,12 @@ void Sttb::Print( FILE* fp ) if ( cData ) { - for ( sal_Int32 index = 0; index < cData; ++index ) + for (sal_Int32 index = 0; index < cData; ++index) + { + if (index >= dataItems.size()) + fprintf(fp, " Sttb truncated at entry %d(0x%x)\n", static_cast< int >( index ), static_cast< unsigned int >( index )); fprintf(fp," string dataItem[ %d(0x%x) ] has name %s\n", static_cast< int >( index ), static_cast< unsigned int >( index ), OUStringToOString( dataItems[ index ].data, RTL_TEXTENCODING_UTF8 ).getStr() ); + } } } #endif |