summaryrefslogtreecommitdiffstats
path: root/sc
diff options
context:
space:
mode:
authorKohei Yoshida <kohei.yoshida@suse.com>2012-02-17 23:59:23 -0500
committerKohei Yoshida <kohei.yoshida@suse.com>2012-02-22 14:02:05 -0500
commit13ff8cf43fb003d4d54cecf6b11cc055339bb22b (patch)
treefaecaec83df0bebf2bcc7b6440d3b309f2becc9b /sc
parentMore string and bool conversion. (diff)
downloadcore-13ff8cf43fb003d4d54cecf6b11cc055339bb22b.tar.gz
core-13ff8cf43fb003d4d54cecf6b11cc055339bb22b.zip
No sense making a copy when you don't modify it.
Diffstat (limited to 'sc')
-rw-r--r--sc/source/ui/view/dbfunc3.cxx14
1 files changed, 6 insertions, 8 deletions
diff --git a/sc/source/ui/view/dbfunc3.cxx b/sc/source/ui/view/dbfunc3.cxx
index 5284c7e5651f..abfe1fb3b06f 100644
--- a/sc/source/ui/view/dbfunc3.cxx
+++ b/sc/source/ui/view/dbfunc3.cxx
@@ -1419,8 +1419,6 @@ void ScDBFunc::DataPilotInput( const ScAddress& rPos, const rtl::OUString& rStri
{
using namespace ::com::sun::star::sheet;
- const rtl::OUString& aNewName = rString;
-
ScDocument* pDoc = GetViewData()->GetDocument();
ScDPObject* pDPObj = pDoc->GetDPAtCursor( rPos.Col(), rPos.Row(), rPos.Tab() );
if (!pDPObj)
@@ -1457,11 +1455,11 @@ void ScDBFunc::DataPilotInput( const ScAddress& rPos, const rtl::OUString& rStri
// valid name: not empty, no existing dimension (group or other)
if (!rString.isEmpty() && !pDPObj->IsDimNameInUse(rString))
{
- pGroupDim->Rename( aNewName );
+ pGroupDim->Rename( rString );
// also rename in SaveData to preserve the field settings
ScDPSaveDimension* pSaveDim = aData.GetDimensionByName( aOldText );
- pSaveDim->SetName( aNewName );
+ pSaveDim->SetName( rString );
bChange = sal_True;
}
@@ -1540,15 +1538,15 @@ void ScDBFunc::DataPilotInput( const ScAddress& rPos, const rtl::OUString& rStri
{
// valid name: not empty, no existing group in this dimension
//! ignore case?
- if (!aNewName.isEmpty() && !pGroupDim->GetNamedGroup(aNewName))
+ if (!rString.isEmpty() && !pGroupDim->GetNamedGroup(rString))
{
ScDPSaveGroupItem* pGroup = pGroupDim->GetNamedGroupAcc( aOldText );
if ( pGroup )
- pGroup->Rename( aNewName ); // rename the existing group
+ pGroup->Rename( rString ); // rename the existing group
else
{
// create a new group to replace the automatic group
- ScDPSaveGroupItem aGroup( aNewName );
+ ScDPSaveGroupItem aGroup( rString );
aGroup.AddElement( aOldText );
pGroupDim->AddGroupItem( aGroup );
}
@@ -1557,7 +1555,7 @@ void ScDBFunc::DataPilotInput( const ScAddress& rPos, const rtl::OUString& rStri
ScDPSaveDimension* pSaveDim = aData.GetDimensionByName( aDimName );
ScDPSaveMember* pSaveMember = pSaveDim->GetExistingMemberByName( aOldText );
if ( pSaveMember )
- pSaveMember->SetName( aNewName );
+ pSaveMember->SetName( rString );
bChange = true;
}