Kaydet (Commit) fa872241 authored tarafından Noel Grandin's avatar Noel Grandin

loplugin:stringloop basctl,chart2,connectivity

Change-Id: I21353dace60705d55b3d70f1e0bc610d55b84d63
Reviewed-on: https://gerrit.libreoffice.org/58210
Tested-by: Jenkins
Reviewed-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
üst e1d7b097
......@@ -1890,15 +1890,15 @@ void StackWindow::UpdateCalls()
SbMethod* pMethod = StarBASIC::GetActiveMethod( nScope );
while ( pMethod )
{
OUString aEntry( OUString::number(nScope ));
OUStringBuffer aEntry( OUString::number(nScope ));
if ( aEntry.getLength() < 2 )
aEntry = " " + aEntry;
aEntry += ": " + pMethod->GetName();
aEntry.insert(0, " ");
aEntry.append(": ").append(pMethod->GetName());
SbxArray* pParams = pMethod->GetParameters();
SbxInfo* pInfo = pMethod->GetInfo();
if ( pParams )
{
aEntry += "(";
aEntry.append("(");
// 0 is the sub's name...
for ( sal_uInt16 nParam = 1; nParam < pParams->Count(); nParam++ )
{
......@@ -1906,34 +1906,34 @@ void StackWindow::UpdateCalls()
assert(pVar && "Parameter?!");
if ( !pVar->GetName().isEmpty() )
{
aEntry += pVar->GetName();
aEntry.append(pVar->GetName());
}
else if ( pInfo )
{
const SbxParamInfo* pParam = pInfo->GetParam( nParam );
if ( pParam )
{
aEntry += pParam->aName;
aEntry.append(pParam->aName);
}
}
aEntry += "=";
aEntry.append("=");
SbxDataType eType = pVar->GetType();
if( eType & SbxARRAY )
{
aEntry += "..." ;
aEntry.append("...");
}
else if( eType != SbxOBJECT )
{
aEntry += pVar->GetOUString();
aEntry.append(pVar->GetOUString());
}
if ( nParam < ( pParams->Count() - 1 ) )
{
aEntry += ", ";
aEntry.append(", ");
}
}
aEntry += ")";
aEntry.append(")");
}
aTreeListBox->InsertEntry( aEntry );
aTreeListBox->InsertEntry( aEntry.makeStringAndClear() );
nScope++;
pMethod = StarBASIC::GetActiveMethod( nScope );
}
......@@ -2168,7 +2168,7 @@ void WatchTreeListBox::RequestingChildren( SvTreeListEntry * pParent )
// Copy data and create name
OUString aIndexStr = "(";
OUStringBuffer aIndexStr = "(";
pChildItem->mpArrayParentItem = pItem;
pChildItem->nDimLevel = nThisLevel;
pChildItem->nDimCount = pItem->nDimCount;
......@@ -2177,10 +2177,10 @@ void WatchTreeListBox::RequestingChildren( SvTreeListEntry * pParent )
for( j = 0 ; j < nParentLevel ; j++ )
{
short n = pChildItem->vIndices[j] = pItem->vIndices[j];
aIndexStr += OUString::number( n ) + ",";
aIndexStr.append(OUString::number( n )).append(",");
}
pChildItem->vIndices[nParentLevel] = sal::static_int_cast<short>( i );
aIndexStr += OUString::number( i ) + ")";
aIndexStr.append(OUString::number( i )).append(")");
OUString aDisplayName;
WatchItem* pArrayRootItem = pChildItem->GetRootItem();
......@@ -2188,7 +2188,7 @@ void WatchTreeListBox::RequestingChildren( SvTreeListEntry * pParent )
aDisplayName = pItem->maDisplayName;
else
aDisplayName = pItem->maName;
aDisplayName += aIndexStr;
aDisplayName += aIndexStr.makeStringAndClear();
pChildItem->maDisplayName = aDisplayName;
SvTreeListEntry* pChildEntry = SvTreeListBox::InsertEntry( aDisplayName, pEntry );
......
......@@ -61,14 +61,12 @@ void lcl_addObjectsToList( const ObjectHierarchy& rHierarchy, const ObjectIdent
ObjectHierarchy::tChildContainer aChildren( rHierarchy.getChildren(rParent) );
for (auto const& child : aChildren)
{
ObjectIdentifier aOID = child;
OUString aCID = aOID.getObjectCID();
ListBoxEntryData aEntry;
aEntry.OID = aOID;
aEntry.UIName += ObjectNameProvider::getNameForCID( aCID, xChartDoc );
aEntry.OID = child;
aEntry.UIName = ObjectNameProvider::getNameForCID( child.getObjectCID(), xChartDoc );
aEntry.nHierarchyDepth = nHierarchyDepth;
rEntries.push_back(aEntry);
lcl_addObjectsToList( rHierarchy, aOID, rEntries, nHierarchyDepth+1, xChartDoc );
lcl_addObjectsToList( rHierarchy, child, rEntries, nHierarchyDepth+1, xChartDoc );
}
}
......
......@@ -355,7 +355,7 @@ Sequence< OUString > lcl_getExplicitSimpleCategories(
aRet.realloc(nMaxCategoryCount);
for(sal_Int32 nN=0; nN<nMaxCategoryCount; nN++)
{
OUString aText;
OUStringBuffer aText;
for (auto const& complexCatPerIndex : aComplexCatsPerIndex)
{
if ( static_cast<size_t>(nN) < complexCatPerIndex.size() )
......@@ -364,12 +364,12 @@ Sequence< OUString > lcl_getExplicitSimpleCategories(
if( !aAddText.isEmpty() )
{
if(!aText.isEmpty())
aText += " ";
aText += aAddText;
aText.append(" ");
aText.append(aAddText);
}
}
}
aRet[nN]=aText;
aRet[nN]=aText.makeStringAndClear();
}
}
return aRet;
......
......@@ -300,13 +300,13 @@ uno::Reference< XTitle > TitleHelper::createTitle(
OUString TitleHelper::getCompleteString( const uno::Reference< XTitle >& xTitle )
{
OUString aRet;
if(!xTitle.is())
return aRet;
return OUString();
OUStringBuffer aRet;
uno::Sequence< uno::Reference< XFormattedString > > aStringList = xTitle->getText();
for( sal_Int32 nN=0; nN<aStringList.getLength();nN++ )
aRet += aStringList[nN]->getString();
return aRet;
aRet.append( aStringList[nN]->getString() );
return aRet.makeStringAndClear();
}
void TitleHelper::setCompleteString( const OUString& rNewText
......
......@@ -448,12 +448,11 @@ void OTableHelper::refreshIndexes()
if(xResult.is())
{
Reference< XRow > xRow(xResult,UNO_QUERY);
OUString aName;
OUString sCatalogSep = getMetaData()->getCatalogSeparator();
OUString sPreviousRoundName;
while( xResult->next() )
{
aName = xRow->getString(5);
OUString aName = xRow->getString(5);
if(!aName.isEmpty())
aName += sCatalogSep;
aName += xRow->getString(6);
......
......@@ -251,20 +251,20 @@ namespace
::dbtools::OPropertyMap& rPropMap = OMetaConnection::getPropMap();
const OUString sQuote(_xMetaData->getIdentifierQuoteString());
OUString sSql( " (" );
OUStringBuffer sSql( " (" );
Reference< XPropertySet > xColProp;
sal_Int32 nColCount = _xColumns->getCount();
for(sal_Int32 i=0;i<nColCount;++i)
{
if ( (_xColumns->getByIndex(i) >>= xColProp) && xColProp.is() )
sSql += ::dbtools::quoteName(sQuote,::comphelper::getString(xColProp->getPropertyValue(rPropMap.getNameByIndex(PROPERTY_ID_NAME))))
+ ",";
sSql.append( ::dbtools::quoteName(sQuote,::comphelper::getString(xColProp->getPropertyValue(rPropMap.getNameByIndex(PROPERTY_ID_NAME)))) )
.append(",");
}
if ( nColCount )
sSql = sSql.replaceAt(sSql.getLength()-1, 1, ")");
return sSql;
sSql[sSql.getLength()-1] = ')';
return sSql.makeStringAndClear();
}
}
......
......@@ -191,13 +191,13 @@ ORowSetValue OOp_Repeat::operate(const ORowSetValue& lhs,const ORowSetValue& rhs
if ( lhs.isNull() || rhs.isNull() )
return lhs;
OUString sRet;
OUStringBuffer sRet;
sal_Int32 nCount = rhs;
for (sal_Int32 i=0; i < nCount; ++i)
{
sRet += lhs;
sRet.append(lhs.operator OUString());
}
return sRet;
return sRet.makeStringAndClear();
}
ORowSetValue OOp_Insert::operate(const std::vector<ORowSetValue>& lhs) const
......
......@@ -33,6 +33,7 @@
#include <cppuhelper/typeprovider.hxx>
#include <cppuhelper/queryinterface.hxx>
#include <comphelper/types.hxx>
#include <rtl/strbuf.hxx>
#include <algorithm>
#include <strings.hrc>
#include <connectivity/dbexception.hxx>
......@@ -474,18 +475,18 @@ Sequence< sal_Int32 > SAL_CALL OStatement::executeBatch( )
::osl::MutexGuard aGuard( m_aMutex );
checkDisposed(OStatement_BASE::rBHelper.bDisposed);
OString aBatchSql;
OStringBuffer aBatchSql;
sal_Int32 nLen = m_aBatchVector.size();
for (auto const& elem : m_aBatchVector)
{
aBatchSql += OUStringToOString(elem,getOwnConnection()->getTextEncoding());
aBatchSql += ";";
aBatchSql.append(OUStringToOString(elem,getOwnConnection()->getTextEncoding()));
aBatchSql.append(";");
}
OSL_ENSURE(m_aStatementHandle,"StatementHandle is null!");
THROW_SQL(N3SQLExecDirect(m_aStatementHandle, reinterpret_cast<SDB_ODBC_CHAR *>(const_cast<char *>(aBatchSql.getStr())), aBatchSql.getLength()));
auto s = aBatchSql.makeStringAndClear();
THROW_SQL(N3SQLExecDirect(m_aStatementHandle, reinterpret_cast<SDB_ODBC_CHAR *>(const_cast<char *>(s.getStr())), s.getLength()));
Sequence< sal_Int32 > aRet(nLen);
sal_Int32* pArray = aRet.getArray();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment