summaryrefslogtreecommitdiff
path: root/sc/source/ui
diff options
context:
space:
mode:
authorMatteo Casalin <matteo.casalin@yahoo.com>2017-10-29 15:15:21 +0100
committerMatteo Casalin <matteo.casalin@yahoo.com>2017-11-01 11:08:23 +0100
commit6ee4f63438a2ea7a56a821373679aa56814b2582 (patch)
treee53a286fcefb043b83692c925ccb28aff7af1ddd /sc/source/ui
parent5a5953b90cd2ba5eaeddc9ba450e3f3ac9dd771a (diff)
Simplify OUString and return early
Change-Id: I783b3fda560cddbbf5c196d20db6323972f62402
Diffstat (limited to 'sc/source/ui')
-rw-r--r--sc/source/ui/docshell/docsh5.cxx20
1 files changed, 6 insertions, 14 deletions
diff --git a/sc/source/ui/docshell/docsh5.cxx b/sc/source/ui/docshell/docsh5.cxx
index d6df70586af0..dd39f53522d8 100644
--- a/sc/source/ui/docshell/docsh5.cxx
+++ b/sc/source/ui/docshell/docsh5.cxx
@@ -270,7 +270,6 @@ ScDBData* ScDocShell::GetDBData( const ScRange& rMarked, ScGetDBMode eMode, ScGe
{
ScDBCollection* pUndoColl = nullptr;
- OUString aNewName;
if (eMode==SC_DB_IMPORT)
{
aDocument.PreprocessDBDataUpdate();
@@ -280,11 +279,11 @@ ScDBData* ScDocShell::GetDBData( const ScRange& rMarked, ScGetDBMode eMode, ScGe
long nCount = 0;
const ScDBData* pDummy = nullptr;
ScDBCollection::NamedDBs& rDBs = pColl->getNamedDBs();
+ OUString aNewName;
do
{
++nCount;
- aNewName = aImport;
- aNewName += OUString::number( nCount );
+ aNewName = aImport + OUString::number( nCount );
pDummy = rDBs.findByUpperName(ScGlobal::pCharClass->uppercase(aNewName));
}
while (pDummy);
@@ -296,8 +295,7 @@ ScDBData* ScDocShell::GetDBData( const ScRange& rMarked, ScGetDBMode eMode, ScGe
}
else
{
- aNewName = STR_DB_LOCAL_NONAME;
- pNoNameData = new ScDBData(aNewName , nTab,
+ pNoNameData = new ScDBData(STR_DB_LOCAL_NONAME, nTab,
nStartCol,nStartRow, nEndCol,nEndRow,
true, bHasHeader );
aDocument.SetAnonymousDBData(nTab, pNoNameData);
@@ -474,19 +472,13 @@ void ScDocShell::RefreshPivotTables( const ScRange& rSource )
static OUString lcl_GetAreaName( ScDocument* pDoc, ScArea* pArea )
{
- OUString aName;
- bool bOk = false;
ScDBData* pData = pDoc->GetDBAtArea( pArea->nTab, pArea->nColStart, pArea->nRowStart,
pArea->nColEnd, pArea->nRowEnd );
if (pData)
- {
- aName = pData->GetName();
- bOk = true;
- }
-
- if (!bOk)
- pDoc->GetName( pArea->nTab, aName );
+ return pData->GetName();
+ OUString aName;
+ pDoc->GetName( pArea->nTab, aName );
return aName;
}