summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorKohei Yoshida <kohei.yoshida@suse.com>2012-02-23 20:14:08 -0500
committerKohei Yoshida <kohei.yoshida@suse.com>2012-02-24 00:51:41 -0500
commit34ff598994a52e8058e34074cb18a993e8c82157 (patch)
tree96ebf2114c58f2707f74f87a6cc0e097ea22748c /sc
parentd473a3699befc388d49bdba491a543d88bcf0778 (diff)
Use a dedicated method instead of manually removing trailing '*'s.
Also, caption shouldn't have a leading ' any more. We have a dedicated flag for that.
Diffstat (limited to 'sc')
-rw-r--r--sc/source/core/data/dpobject.cxx3
-rw-r--r--sc/source/core/data/dpoutput.cxx12
-rw-r--r--sc/source/core/data/dptabsrc.cxx4
3 files changed, 9 insertions, 10 deletions
diff --git a/sc/source/core/data/dpobject.cxx b/sc/source/core/data/dpobject.cxx
index 25f2c6078d7a..bb988f5fa4e2 100644
--- a/sc/source/core/data/dpobject.cxx
+++ b/sc/source/core/data/dpobject.cxx
@@ -52,6 +52,7 @@
#include "dpglobal.hxx"
#include "globstr.hrc"
#include "queryentry.hxx"
+#include "dputil.hxx"
#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/sdb/XCompletedExecution.hpp>
@@ -2016,7 +2017,7 @@ bool ScDPObject::FillLabelData(ScPivotParam& rParam)
xDimProp, OUString(RTL_CONSTASCII_USTRINGPARAM(SC_UNO_DP_FIELD_SUBTOTALNAME)), OUString());
bool bIsValue = true; //! check
- aFieldName = comphelper::string::stripEnd(aFieldName, sal_Unicode('*'));
+ aFieldName = ScDPUtil::getSourceDimensionName(aFieldName);
std::auto_ptr<ScDPLabelData> pNewLabel(
new ScDPLabelData(aFieldName, static_cast<SCCOL>(nDim), bIsValue));
diff --git a/sc/source/core/data/dpoutput.cxx b/sc/source/core/data/dpoutput.cxx
index 690d5b6ab256..37f09708e5ab 100644
--- a/sc/source/core/data/dpoutput.cxx
+++ b/sc/source/core/data/dpoutput.cxx
@@ -54,6 +54,7 @@
#include "unonames.hxx"
#include "sc.hrc"
#include "stringutil.hxx"
+#include "dputil.hxx"
#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/sheet/DataPilotTableHeaderData.hpp>
@@ -1481,7 +1482,7 @@ bool ScDPOutput::GetDataResultPositionData(vector<sheet::DataPilotFieldFilter>&
// helper functions for ScDPOutput::GetPivotData
//
-bool lcl_IsNamedDataField( const ScDPGetPivotDataField& rTarget, const String& rSourceName, const String& rGivenName )
+bool lcl_IsNamedDataField( const ScDPGetPivotDataField& rTarget, const rtl::OUString& rSourceName, const rtl::OUString& rGivenName )
{
// match one of the names, ignoring case
return ScGlobal::GetpTransliteration()->isEqual( rTarget.maFieldName, rSourceName ) ||
@@ -1740,13 +1741,10 @@ void lcl_FilterInclude( std::vector< sal_Bool >& rResult, std::vector< sal_Int32
{
// Asterisks are added in ScDPSaveData::WriteToSource to create unique names.
//! preserve original name there?
- String aSourceName( aResultEntry.Name );
- aSourceName.EraseTrailingChars( '*' );
+ rtl::OUString aSourceName = ScDPUtil::getSourceDimensionName(aResultEntry.Name);
- String aGivenName( aResultEntry.Caption ); //! Should use a stored name when available
- aGivenName.EraseLeadingChars( '\'' );
-
- rResult[j] = lcl_IsNamedDataField( rTarget, aSourceName, aGivenName );
+ rResult[j] = lcl_IsNamedDataField(
+ rTarget, aSourceName, aResultEntry.Caption);
}
}
else if ( bHasFilter )
diff --git a/sc/source/core/data/dptabsrc.cxx b/sc/source/core/data/dptabsrc.cxx
index 7dbb122b0e80..22f17effa857 100644
--- a/sc/source/core/data/dptabsrc.cxx
+++ b/sc/source/core/data/dptabsrc.cxx
@@ -58,6 +58,7 @@
#include "miscuno.hxx"
#include "unonames.hxx"
#include "dpitemdata.hxx"
+#include "dputil.hxx"
#include <com/sun/star/beans/PropertyAttribute.hpp>
#include <com/sun/star/sheet/DataPilotFieldFilter.hpp>
@@ -824,10 +825,9 @@ void ScDPSource::CreateRes_Impl()
aDataNames[i] = pDim->getName();
- // asterisk is added to duplicated dimension names by ScDPSaveData::WriteToSource
//! modify user visible strings as in ScDPResultData::GetMeasureString instead!
- aDataNames[i] = comphelper::string::removeTrailingChars(aDataNames[i], '*');
+ aDataNames[i] = ScDPUtil::getSourceDimensionName(aDataNames[i]);
//! if the name is overridden by user, a flag must be set
//! so the user defined name replaces the function string and field name.