summaryrefslogtreecommitdiff
path: root/chart2
diff options
context:
space:
mode:
Diffstat (limited to 'chart2')
-rwxr-xr-xchart2/source/tools/InternalDataProvider.cxx6
1 files changed, 4 insertions, 2 deletions
diff --git a/chart2/source/tools/InternalDataProvider.cxx b/chart2/source/tools/InternalDataProvider.cxx
index 4abc51be31af..26b2db4fc253 100755
--- a/chart2/source/tools/InternalDataProvider.cxx
+++ b/chart2/source/tools/InternalDataProvider.cxx
@@ -356,9 +356,11 @@ InternalDataProvider::InternalDataProvider( const Reference< chart2::XChartDocum
if( xSeq.is() )
aStringSeq = xSeq->getTextualData(); // @todo: be able to deal with XDataSequence, too
sal_Int32 nLength = aStringSeq.getLength();
- if( static_cast< sal_Int32 >(aNewCategories.size()) < nLength )
+ sal_Int32 nCatLength = static_cast< sal_Int32 >(aNewCategories.size());
+ if( nCatLength < nLength )
aNewCategories.resize( nLength );
-
+ else if( nLength < nCatLength )
+ aStringSeq.realloc( nCatLength );
transform( aNewCategories.begin(), aNewCategories.end(), aStringSeq.getConstArray(),
aNewCategories.begin(), lcl_setStringAtLevel(nL) );
}