summaryrefslogtreecommitdiff
path: root/chart2
diff options
context:
space:
mode:
authorKohei Yoshida <kohei.yoshida@gmail.com>2012-09-24 16:09:10 -0400
committerKohei Yoshida <kohei.yoshida@gmail.com>2012-09-27 23:37:48 -0400
commit81f3a43d70dd23661b30036ca510a6a0da78b616 (patch)
treebe696a2fde17be13baf43a645a0c30f0edc9f1e8 /chart2
parentf0dd1a5ebcb2bd4a04a5b5f4cf6f1d10d08f88a8 (diff)
fdo#55298: We should only treat empty values as continuation of previous ones.
For better Excel compatibility. Change-Id: I3bc44f65127d3f020894dc29e5c6549bb257f218 Signed-off-by: Noel Power <noel.power@suse.com>
Diffstat (limited to 'chart2')
-rw-r--r--chart2/source/tools/ExplicitCategoriesProvider.cxx12
1 files changed, 8 insertions, 4 deletions
diff --git a/chart2/source/tools/ExplicitCategoriesProvider.cxx b/chart2/source/tools/ExplicitCategoriesProvider.cxx
index 73f5801c0b71..bc938e677bac 100644
--- a/chart2/source/tools/ExplicitCategoriesProvider.cxx
+++ b/chart2/source/tools/ExplicitCategoriesProvider.cxx
@@ -293,7 +293,7 @@ std::vector< ComplexCategory > lcl_DataSequenceToComplexCategoryVector(
sal_Int32 nCurrentCount=0;
for( sal_Int32 nN=0; nN<nMaxCount; nN++ )
{
- OUString aCurrent = rStrings[nN];
+ const OUString& aCurrent = rStrings[nN];
if( bCreateSingleCategories || ::std::find( rLimitingBorders.begin(), rLimitingBorders.end(), nN ) != rLimitingBorders.end() )
{
aResult.push_back( ComplexCategory(aPrevious,nCurrentCount) );
@@ -302,14 +302,18 @@ std::vector< ComplexCategory > lcl_DataSequenceToComplexCategoryVector(
}
else
{
- if( !aCurrent.isEmpty() && aPrevious != aCurrent )
+ // Empty value is interpreted as a continuation of the previous
+ // category. Note that having the same value as the previous one
+ // does not equate to a continuation of the category.
+
+ if (aCurrent.isEmpty())
+ ++nCurrentCount;
+ else
{
aResult.push_back( ComplexCategory(aPrevious,nCurrentCount) );
nCurrentCount=1;
aPrevious = aCurrent;
}
- else
- nCurrentCount++;
}
}
if( nCurrentCount )