summaryrefslogtreecommitdiff
path: root/dbaccess
diff options
context:
space:
mode:
authorMatteo Casalin <matteo.casalin@yahoo.com>2016-04-26 21:25:46 +0200
committerMatteo Casalin <matteo.casalin@yahoo.com>2016-05-10 21:38:36 +0200
commitc64a7dd4270296bef1b577ced45b51122a379e3f (patch)
treed593e62dd8e53f580958fe162f77e7cf2f5e32f6 /dbaccess
parent4bf7614503292fe69d3e5835621c1cdcaa4536cb (diff)
Avoid some temporaries and constify
Change-Id: Ie9ae7edb78e3c5768e4d253ab43a1dcdcf44078c
Diffstat (limited to 'dbaccess')
-rw-r--r--dbaccess/source/ui/misc/WCPage.cxx20
1 files changed, 6 insertions, 14 deletions
diff --git a/dbaccess/source/ui/misc/WCPage.cxx b/dbaccess/source/ui/misc/WCPage.cxx
index 1613036643aa..a939c95df744 100644
--- a/dbaccess/source/ui/misc/WCPage.cxx
+++ b/dbaccess/source/ui/misc/WCPage.cxx
@@ -92,11 +92,9 @@ OCopyTable::OCopyTable(vcl::Window * pParent)
m_pFT_KeyName->Enable(false);
m_pEdKeyName->Enable(false);
- OUString sKeyName("ID");
- sKeyName = m_pParent->createUniqueName(sKeyName);
- m_pEdKeyName->SetText(sKeyName);
+ m_pEdKeyName->SetText(m_pParent->createUniqueName("ID"));
- sal_Int32 nMaxLen = m_pParent->getMaxColumnNameLength();
+ const sal_Int32 nMaxLen = m_pParent->getMaxColumnNameLength();
m_pEdKeyName->SetMaxTextLen(nMaxLen ? nMaxLen : EDIT_NOLIMIT);
}
@@ -196,8 +194,7 @@ bool OCopyTable::LeavePage()
sal_Int32 nMaxLength = xMeta->getMaxTableNameLength();
if ( nMaxLength && sTable.getLength() > nMaxLength )
{
- OUString sError(ModuleRes(STR_INVALID_TABLE_NAME_LENGTH));
- m_pParent->showError(sError);
+ m_pParent->showError(ModuleRes(STR_INVALID_TABLE_NAME_LENGTH));
return false;
}
@@ -205,10 +202,7 @@ bool OCopyTable::LeavePage()
if ( m_pParent->m_bCreatePrimaryKeyColumn
&& m_pParent->m_aKeyName != m_pParent->createUniqueName(m_pParent->m_aKeyName) )
{
- OUString aInfoString( ModuleRes(STR_WIZ_NAME_ALREADY_DEFINED) );
- aInfoString += " ";
- aInfoString += m_pParent->m_aKeyName;
- m_pParent->showError(aInfoString);
+ m_pParent->showError(ModuleRes(STR_WIZ_NAME_ALREADY_DEFINED).toString()+" "+m_pParent->m_aKeyName);
return false;
}
}
@@ -239,8 +233,7 @@ bool OCopyTable::LeavePage()
if(m_pParent->m_sName.isEmpty())
{
- OUString sError(ModuleRes(STR_INVALID_TABLE_NAME));
- m_pParent->showError(sError);
+ m_pParent->showError(ModuleRes(STR_INVALID_TABLE_NAME));
return false;
}
@@ -313,8 +306,7 @@ bool OCopyTable::checkAppendData()
if ( !xTable.is() )
{
- OUString sError(ModuleRes(STR_INVALID_TABLE_NAME));
- m_pParent->showError(sError);
+ m_pParent->showError(ModuleRes(STR_INVALID_TABLE_NAME));
return false;
}
return true;