summaryrefslogtreecommitdiff
path: root/dbaccess
diff options
context:
space:
mode:
authornadith <nadmalinda@gmail.com>2016-08-01 14:51:58 +0530
committerNoel Grandin <noelgrandin@gmail.com>2016-08-04 09:34:11 +0000
commitbd4c80b856a145563ba38242705e87028b1e0ed6 (patch)
tree8a7ed5eefa17155b7c547ed9133dc1881d9fa6b4 /dbaccess
parent7cbb0664b94bb9f4587098c1940de98e4f7aae16 (diff)
tdf#100726: Improve readability of OUString concatenation
module cui and dbaccess fixed Change-Id: Ief6fca46622fe4e0da804c9a874f7ec93a0fd7af Reviewed-on: https://gerrit.libreoffice.org/27770 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'dbaccess')
-rw-r--r--dbaccess/source/core/api/KeySet.cxx5
-rw-r--r--dbaccess/source/core/dataaccess/documentcontainer.cxx3
-rw-r--r--dbaccess/source/filter/xml/xmlFileBasedDatabase.cxx3
-rw-r--r--dbaccess/source/ui/dlg/DBSetupConnectionPages.cxx3
-rw-r--r--dbaccess/source/ui/dlg/directsql.cxx6
-rw-r--r--dbaccess/source/ui/dlg/indexdialog.cxx3
-rw-r--r--dbaccess/source/ui/dlg/sqlmessage.cxx10
-rw-r--r--dbaccess/source/ui/dlg/tablespage.cxx9
-rw-r--r--dbaccess/source/ui/misc/WNameMatch.cxx12
-rw-r--r--dbaccess/source/ui/querydesign/QueryDesignView.cxx44
-rw-r--r--dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx9
-rw-r--r--dbaccess/source/ui/relationdesign/RTableConnectionData.cxx3
-rw-r--r--dbaccess/source/ui/tabledesign/TableController.cxx3
13 files changed, 33 insertions, 80 deletions
diff --git a/dbaccess/source/core/api/KeySet.cxx b/dbaccess/source/core/api/KeySet.cxx
index 28a1f1cc4d2c..3af8899d1475 100644
--- a/dbaccess/source/core/api/KeySet.cxx
+++ b/dbaccess/source/core/api/KeySet.cxx
@@ -756,10 +756,7 @@ void OKeySet::executeInsert( const ORowSetRow& _rInsertRow,const OUString& i_sSQ
SelectColumnsMetaData::const_iterator aFind = m_pKeyColumnNames->find(*aAutoIter);
if ( aFind != aEnd )
{
- sMaxStmt += sMax;
- sMaxStmt += ::dbtools::quoteName( sQuote,aFind->second.sRealName
-);
- sMaxStmt += sMaxEnd;
+ sMaxStmt += sMax + ::dbtools::quoteName( sQuote,aFind->second.sRealName) + sMaxEnd;
}
}
diff --git a/dbaccess/source/core/dataaccess/documentcontainer.cxx b/dbaccess/source/core/dataaccess/documentcontainer.cxx
index aaff380002a4..9770c41831ab 100644
--- a/dbaccess/source/core/dataaccess/documentcontainer.cxx
+++ b/dbaccess/source/core/dataaccess/documentcontainer.cxx
@@ -220,8 +220,7 @@ Reference< XInterface > SAL_CALL ODocumentContainer::createInstanceWithArguments
{
static const char sBaseName[] = "Obj";
- sPersistentName = sBaseName;
- sPersistentName += OUString::number(rDefinitions.size() + 1);
+ sPersistentName = sBaseName + OUString::number(rDefinitions.size() + 1);
Reference<XNameAccess> xElements(getContainerStorage(),UNO_QUERY);
if ( xElements.is() )
sPersistentName = ::dbtools::createUniqueName(xElements,sPersistentName);
diff --git a/dbaccess/source/filter/xml/xmlFileBasedDatabase.cxx b/dbaccess/source/filter/xml/xmlFileBasedDatabase.cxx
index 90f0b1f7c731..458a26b57161 100644
--- a/dbaccess/source/filter/xml/xmlFileBasedDatabase.cxx
+++ b/dbaccess/source/filter/xml/xmlFileBasedDatabase.cxx
@@ -99,8 +99,7 @@ OXMLFileBasedDatabase::OXMLFileBasedDatabase( ODBFilter& rImport,
if ( !(sLocation.isEmpty() || sMediaType.isEmpty()) )
{
::dbaccess::ODsnTypeCollection aTypeCollection(rImport.GetComponentContext());
- OUString sURL(aTypeCollection.getDatasourcePrefixFromMediaType(sMediaType,sFileTypeExtension));
- sURL += sLocation;
+ OUString sURL = aTypeCollection.getDatasourcePrefixFromMediaType(sMediaType,sFileTypeExtension) + sLocation;
try
{
xDataSource->setPropertyValue(PROPERTY_URL,makeAny(sURL));
diff --git a/dbaccess/source/ui/dlg/DBSetupConnectionPages.cxx b/dbaccess/source/ui/dlg/DBSetupConnectionPages.cxx
index 565386d7ea18..8d6a0405d494 100644
--- a/dbaccess/source/ui/dlg/DBSetupConnectionPages.cxx
+++ b/dbaccess/source/ui/dlg/DBSetupConnectionPages.cxx
@@ -189,8 +189,7 @@ using namespace ::com::sun::star;
OSL_ENSURE(pCollection, "OLDAPConnectionPageSetup::FillItemSet : really need a DSN type collection !");
if (pCollection)
{
- OUString sUrl = pCollection->getPrefix( "sdbc:address:ldap:");
- sUrl += m_pETHostServer->GetText();
+ OUString sUrl = pCollection->getPrefix( "sdbc:address:ldap:") + m_pETHostServer->GetText();
_rSet->Put(SfxStringItem(DSID_CONNECTURL, sUrl));
bChangedSomething = true;
}
diff --git a/dbaccess/source/ui/dlg/directsql.cxx b/dbaccess/source/ui/dlg/directsql.cxx
index 7ae9087b407b..97b79d2e408c 100644
--- a/dbaccess/source/ui/dlg/directsql.cxx
+++ b/dbaccess/source/ui/dlg/directsql.cxx
@@ -258,11 +258,9 @@ namespace dbaui
void DirectSQLDialog::addOutputText(const OUString& _rMessage)
{
- OUString sAppendMessage = _rMessage;
- sAppendMessage += "\n";
+ OUString sAppendMessage = _rMessage + "\n";
- OUString sCompleteMessage = m_pOutput->GetText();
- sCompleteMessage += sAppendMessage;
+ OUString sCompleteMessage = m_pOutput->GetText() + sAppendMessage;
m_pOutput->SetText(sCompleteMessage);
}
diff --git a/dbaccess/source/ui/dlg/indexdialog.cxx b/dbaccess/source/ui/dlg/indexdialog.cxx
index c864a2c105c0..0661a95e0e83 100644
--- a/dbaccess/source/ui/dlg/indexdialog.cxx
+++ b/dbaccess/source/ui/dlg/indexdialog.cxx
@@ -376,8 +376,7 @@ namespace dbaui
for ( i = 1; i < 0x7FFFFFFF; ++i )
{
- sNewIndexName = sNewIndexNameBase;
- sNewIndexName += OUString::number(i);
+ sNewIndexName = sNewIndexNameBase + OUString::number(i);
if (m_pIndexes->end() == m_pIndexes->find(sNewIndexName))
break;
}
diff --git a/dbaccess/source/ui/dlg/sqlmessage.cxx b/dbaccess/source/ui/dlg/sqlmessage.cxx
index 2df16e90ea24..8d8c8c4be8aa 100644
--- a/dbaccess/source/ui/dlg/sqlmessage.cxx
+++ b/dbaccess/source/ui/dlg/sqlmessage.cxx
@@ -364,18 +364,12 @@ IMPL_LINK_NOARG_TYPED(OExceptionChainDialog, OnExceptionSelected, SvTreeListBox*
if ( !aExceptionInfo.sSQLState.isEmpty() )
{
- sText += m_sStatusLabel;
- sText += ": ";
- sText += aExceptionInfo.sSQLState;
- sText += "\n";
+ sText += m_sStatusLabel + ": " + aExceptionInfo.sSQLState + "\n";
}
if ( !aExceptionInfo.sErrorCode.isEmpty() )
{
- sText += m_sErrorCodeLabel;
- sText += ": ";
- sText += aExceptionInfo.sErrorCode;
- sText += "\n";
+ sText += m_sErrorCodeLabel + ": " + aExceptionInfo.sErrorCode + "\n";
}
if ( !sText.isEmpty() )
diff --git a/dbaccess/source/ui/dlg/tablespage.cxx b/dbaccess/source/ui/dlg/tablespage.cxx
index 9b682a64e143..53062db32fa9 100644
--- a/dbaccess/source/ui/dlg/tablespage.cxx
+++ b/dbaccess/source/ui/dlg/tablespage.cxx
@@ -479,8 +479,7 @@ namespace dbaui
bCatalogWildcard = OTableTreeListBox::isWildcardChecked(pCatalog);
if (m_bCatalogAtStart)
{
- sComposedName += m_pTablesList->GetEntryText( pCatalog );
- sComposedName += m_sCatalogSeparator;
+ sComposedName += m_pTablesList->GetEntryText( pCatalog ) + m_sCatalogSeparator;
if (bCatalogWildcard)
sComposedName += sWildcard;
}
@@ -490,14 +489,12 @@ namespace dbaui
sCatalog = sWildcard;
else
sCatalog.clear();
- sCatalog += m_sCatalogSeparator;
- sCatalog += m_pTablesList->GetEntryText( pCatalog );
+ sCatalog += m_sCatalogSeparator + m_pTablesList->GetEntryText( pCatalog );
}
}
}
bSchemaWildcard = OTableTreeListBox::isWildcardChecked(pSchema);
- sComposedName += m_pTablesList->GetEntryText( pSchema );
- sComposedName += sDot;
+ sComposedName += m_pTablesList->GetEntryText( pSchema ) + sDot;
}
if (bSchemaWildcard)
diff --git a/dbaccess/source/ui/misc/WNameMatch.cxx b/dbaccess/source/ui/misc/WNameMatch.cxx
index e5a5e962313f..75d9a789c380 100644
--- a/dbaccess/source/ui/misc/WNameMatch.cxx
+++ b/dbaccess/source/ui/misc/WNameMatch.cxx
@@ -67,10 +67,8 @@ OWizNameMatching::OWizNameMatching( vcl::Window* pParent)
m_pCTRL_LEFT->SetStyle( m_pCTRL_LEFT->GetStyle() | WB_FORCE_MAKEVISIBLE );
m_pCTRL_RIGHT->SetStyle( m_pCTRL_RIGHT->GetStyle() | WB_FORCE_MAKEVISIBLE );
- m_sSourceText = m_pTABLE_LEFT->GetText();
- m_sSourceText += "\n";
- m_sDestText = m_pTABLE_RIGHT->GetText();
- m_sDestText += "\n";
+ m_sSourceText = m_pTABLE_LEFT->GetText() + "\n";
+ m_sDestText = m_pTABLE_RIGHT->GetText() + "\n";
}
OWizNameMatching::~OWizNameMatching()
@@ -113,14 +111,12 @@ void OWizNameMatching::ActivatePage( )
{
// set source table name
- OUString aName = m_sSourceText;
- aName += m_pParent->m_sSourceName;
+ OUString aName = m_sSourceText + m_pParent->m_sSourceName;
m_pTABLE_LEFT->SetText(aName);
// set dest table name
- aName = m_sDestText;
- aName += m_pParent->m_sName;
+ aName = m_sDestText + m_pParent->m_sName;
m_pTABLE_RIGHT->SetText(aName);
m_pCTRL_LEFT->FillListBox(m_pParent->getSrcVector());
diff --git a/dbaccess/source/ui/querydesign/QueryDesignView.cxx b/dbaccess/source/ui/querydesign/QueryDesignView.cxx
index 8f8748c5312e..1e08467842ec 100644
--- a/dbaccess/source/ui/querydesign/QueryDesignView.cxx
+++ b/dbaccess/source/ui/querydesign/QueryDesignView.cxx
@@ -108,8 +108,7 @@ namespace
OUString sRet;
if ( _bQuote && !_sAliasName.isEmpty() )
{
- sRet = ::dbtools::quoteName(_sQuote,_sAliasName);
- sRet += ".";
+ sRet = ::dbtools::quoteName(_sQuote,_sAliasName) + ".";
}
return sRet;
}
@@ -408,12 +407,10 @@ namespace
aErg += " FULL OUTER ";
break;
}
- aErg += "JOIN ";
- aErg += rRh;
+ aErg += "JOIN " + rRh;
if ( CROSS_JOIN != pData->GetJoinType() && !pData->isNatural() )
{
- aErg += " ON ";
- aErg += BuildJoinCriteria(_xConnection,&pData->GetConnLineDataList(),pData);
+ aErg += " ON " + BuildJoinCriteria(_xConnection,&pData->GetConnLineDataList(),pData);
}
return aErg;
@@ -776,10 +773,7 @@ namespace
if ( pEntryField->isAggreateFunction() )
{
OSL_ENSURE(!pEntryField->GetFunction().isEmpty(),"No function name for aggregate given!");
- aHavingStr += pEntryField->GetFunction();
- aHavingStr += "("; // bracket
- aHavingStr += aWork;
- aHavingStr += ")"; // bracket
+ aHavingStr += pEntryField->GetFunction() + "(" + aWork + ")"; // bracket
}
else
aHavingStr += aWork;
@@ -941,12 +935,9 @@ namespace
}
else
{
- aWorkStr += quoteTableAlias(bMulti,pEntryField->GetAlias(),aQuote);
- aWorkStr += ::dbtools::quoteName(aQuote, aColumnName);
+ aWorkStr += quoteTableAlias(bMulti,pEntryField->GetAlias(),aQuote) + ::dbtools::quoteName(aQuote, aColumnName);
}
- aWorkStr += " ";
- aWorkStr += OUString( ";ASC;DESC" ).getToken( (sal_uInt16)eOrder, ';' );
- aWorkStr += ",";
+ aWorkStr += " " + OUString( ";ASC;DESC" ).getToken( (sal_uInt16)eOrder, ';' ) + ",";
}
}
@@ -1002,8 +993,7 @@ namespace
if(_rTableNames.insert(sTabName).second)
{
- _rsTableListStr += sTabName;
- _rsTableListStr += ",";
+ _rsTableListStr += sTabName + ",";
}
}
OUString GenerateFromClause( const Reference< XConnection>& _xConnection,
@@ -1113,8 +1103,7 @@ namespace
const OQueryTableWindow* pEntryTab = static_cast<const OQueryTableWindow*>(aTabIter->second.get());
if(!pEntryTab->ExistsAConn())
{
- aTableListStr += BuildTable(_xConnection,pEntryTab);
- aTableListStr += ",";
+ aTableListStr += BuildTable(_xConnection,pEntryTab) + ",";
}
}
@@ -1174,16 +1163,14 @@ namespace
if ( aGroupByNames.find(sGroupByPart) == aGroupByNames.end() )
{
aGroupByNames.insert(::std::map< OUString,bool>::value_type(sGroupByPart,true));
- aGroupByStr += sGroupByPart;
- aGroupByStr += ",";
+ aGroupByStr += sGroupByPart + ",";
}
}
}
if ( !aGroupByStr.isEmpty() )
{
aGroupByStr = aGroupByStr.replaceAt(aGroupByStr.getLength()-1,1, OUString(' ') );
- OUString aGroupByStr2(" GROUP BY ");
- aGroupByStr2 += aGroupByStr;
+ OUString aGroupByStr2 = " GROUP BY " + aGroupByStr;
aGroupByStr = aGroupByStr2;
}
}
@@ -2736,8 +2723,7 @@ void OQueryDesignView::fillValidFields(const OUString& sAliasName, ComboBox* pFi
OQueryTableWindow* pCurrentWin = static_cast<OQueryTableWindow*>(aIter->second.get());
if (bAllTables || (pCurrentWin->GetAliasName() == sAliasName))
{
- strCurrentPrefix = pCurrentWin->GetAliasName();
- strCurrentPrefix += ".";
+ strCurrentPrefix = pCurrentWin->GetAliasName() + ".";
pCurrentWin->EnumValidFields(aFields);
@@ -2853,8 +2839,7 @@ OUString OQueryDesignView::getStatement()
OUString aTmp = "( " + aJoinCrit + " )";
if(!aCriteriaListStr.isEmpty())
{
- aTmp += C_AND;
- aTmp += aCriteriaListStr.makeStringAndClear();
+ aTmp += C_AND + aCriteriaListStr.makeStringAndClear();
}
aCriteriaListStr = aTmp;
}
@@ -3019,10 +3004,7 @@ OSQLParseNode* OQueryDesignView::getPredicateTreeFromEntry(const OTableFieldDesc
{
// first try the international version
OUString sSql;
- sSql += "SELECT * ";
- sSql += " FROM x WHERE ";
- sSql += pEntry->GetField();
- sSql += _sCriteria;
+ sSql += "SELECT * FROM x WHERE " + pEntry->GetField() + _sCriteria;
std::unique_ptr<OSQLParseNode> pParseNode( rParser.parseTree( _rsErrorMessage, sSql, true ) );
nType = DataType::DOUBLE;
if ( pParseNode.get() )
diff --git a/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx b/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx
index 65a7c5b3c4d9..971e821ae097 100644
--- a/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx
+++ b/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx
@@ -703,8 +703,7 @@ bool OSelectionBrowseBox::saveField(OUString& _sFieldName ,OTableFieldDescRef& _
sSql = "SELECT " + sSql;
if ( !sFieldAlias.isEmpty() )
{ // always quote the alias name: there cannot be a function in it
- sSql += " ";
- sSql += ::dbtools::quoteName( xMetaData->getIdentifierQuoteString(), sFieldAlias );
+ sSql += " " + ::dbtools::quoteName( xMetaData->getIdentifierQuoteString(), sFieldAlias );
}
sSql += " FROM x";
@@ -1767,11 +1766,7 @@ void OSelectionBrowseBox::AddCondition( const OTableFieldDescRef& rInfo, const O
OUString sOldCriteria = pLastEntry->GetCriteria( nLevel );
if ( !sOldCriteria.isEmpty() )
{
- sCriteria = "( ";
- sCriteria += sOldCriteria;
- sCriteria += " OR ";
- sCriteria += rValue;
- sCriteria += " )";
+ sCriteria = "( " + sOldCriteria + " OR " + rValue + " )";
}
pLastEntry->SetCriteria( nLevel, sCriteria);
if(nLevel == (m_nVisibleCount-BROW_CRIT1_ROW-1))
diff --git a/dbaccess/source/ui/relationdesign/RTableConnectionData.cxx b/dbaccess/source/ui/relationdesign/RTableConnectionData.cxx
index 3c1456d8d895..88654ee89d0b 100644
--- a/dbaccess/source/ui/relationdesign/RTableConnectionData.cxx
+++ b/dbaccess/source/ui/relationdesign/RTableConnectionData.cxx
@@ -272,8 +272,7 @@ bool ORelationTableConnectionData::Update()
// build a foreign key name
OUString sSourceName;
xTableProp->getPropertyValue(PROPERTY_NAME) >>= sSourceName;
- OUString sKeyName = sSourceName;
- sKeyName += getReferencedTable()->GetTableName();
+ OUString sKeyName = sSourceName + getReferencedTable()->GetTableName();
xKey->setPropertyValue(PROPERTY_NAME,makeAny(sKeyName));
xKey->setPropertyValue(PROPERTY_TYPE,makeAny(KeyType::FOREIGN));
diff --git a/dbaccess/source/ui/tabledesign/TableController.cxx b/dbaccess/source/ui/tabledesign/TableController.cxx
index adb008be31c9..192b7577fb23 100644
--- a/dbaccess/source/ui/tabledesign/TableController.cxx
+++ b/dbaccess/source/ui/tabledesign/TableController.cxx
@@ -1493,8 +1493,7 @@ OUString OTableController::getPrivateTitle() const
if ( sTitle.isEmpty() )
{
OUString aName = ModuleRes(STR_TBL_TITLE);
- sTitle = aName.getToken(0,' ');
- sTitle += OUString::number(getCurrentStartNumber());
+ sTitle = aName.getToken(0,' ') + OUString::number(getCurrentStartNumber());
}
}
catch( const Exception& )