summaryrefslogtreecommitdiff
path: root/dbaccess
diff options
context:
space:
mode:
authorMatteo Casalin <matteo.casalin@yahoo.com>2018-12-29 22:54:29 +0100
committerMatteo Casalin <matteo.casalin@yahoo.com>2019-01-13 09:36:37 +0100
commitb409edf2f149d530791be48d7b7595f9202801bf (patch)
tree4b77445cfbef0ba9a54f8afd08f697ff566d82f1 /dbaccess
parent29b322ebab31b83d1df470f7ec794d500e15b948 (diff)
Reduce OUString operations
Change-Id: I92f3af3cf9b0b5d7bc7b903403b1b93e0b432366 Reviewed-on: https://gerrit.libreoffice.org/66218 Tested-by: Jenkins Reviewed-by: Matteo Casalin <matteo.casalin@yahoo.com>
Diffstat (limited to 'dbaccess')
-rw-r--r--dbaccess/source/ui/querydesign/querycontroller.cxx11
1 files changed, 4 insertions, 7 deletions
diff --git a/dbaccess/source/ui/querydesign/querycontroller.cxx b/dbaccess/source/ui/querydesign/querycontroller.cxx
index c06e14d6010a..ea956ad90ccc 100644
--- a/dbaccess/source/ui/querydesign/querycontroller.cxx
+++ b/dbaccess/source/ui/querydesign/querycontroller.cxx
@@ -902,19 +902,17 @@ void OQueryController::onLoadedMenu(const Reference< css::frame::XLayoutManager
OUString OQueryController::getPrivateTitle( ) const
{
- OUString sName = m_sName;
- if ( sName.isEmpty() )
+ if ( m_sName.isEmpty() )
{
if ( !editingCommand() )
{
SolarMutexGuard aSolarGuard;
::osl::MutexGuard aGuard( getMutex() );
OUString aDefaultName = DBA_RES(editingView() ? STR_VIEW_TITLE : STR_QRY_TITLE);
- sName = aDefaultName.getToken(0,' ');
- sName += OUString::number(getCurrentStartNumber());
+ return aDefaultName.getToken(0, ' ') + OUString::number(getCurrentStartNumber());
}
}
- return sName;
+ return m_sName;
}
void OQueryController::setQueryComposer()
@@ -1205,8 +1203,7 @@ bool OQueryController::askForNewName(const Reference<XNameAccess>& _xElements, b
else
{
OUString sName = DBA_RES(editingView() ? STR_VIEW_TITLE : STR_QRY_TITLE);
- aDefaultName = sName.getToken(0,' ');
- aDefaultName = ::dbtools::createUniqueName(_xElements,aDefaultName);
+ aDefaultName = ::dbtools::createUniqueName(_xElements, sName.getToken(0, ' '));
}
DynamicTableOrQueryNameCheck aNameChecker( getConnection(), CommandType::QUERY );