loplugin:reftotemp in codemaker..connectivity

Change-Id: I9da2976410f7c4da8ab0d85150fc87f2b3df9e0d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176275
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
This commit is contained in:
Noel Grandin 2024-11-08 13:54:19 +02:00
parent 3f691b4a16
commit 5fe9b3df62
9 changed files with 59 additions and 59 deletions

View file

@ -948,7 +948,7 @@ void NetProducer::produceService(
if (ctor.defaultConstructor)
{
const auto& returnType(getNetName(entity->getBase()));
const auto returnType(getNetName(entity->getBase()));
file.beginLine()
.append("public static ")
@ -1009,7 +1009,7 @@ void NetProducer::produceService(
}
else
{
const auto& returnType(getNetName(entity->getBase()));
const auto returnType(getNetName(entity->getBase()));
const auto* restParam = !ctor.parameters.empty() && ctor.parameters.front().rest
? &ctor.parameters.front()
: nullptr;

View file

@ -201,7 +201,7 @@ void EmbeddedObjectContainer::CloseEmbeddedObjects()
{
for( const auto& rObj : pImpl->maNameToObjectMap )
{
uno::Reference < util::XCloseable > const & xClose = rObj.second;
uno::Reference < embed::XEmbeddedObject > const & xClose = rObj.second;
if( xClose.is() )
{
try

View file

@ -44,12 +44,12 @@ uno::Any jsonToUnoAny(const boost::property_tree::ptree& aTree)
sal_Int32 nFields;
uno::Reference<reflection::XIdlField> aField;
boost::property_tree::ptree aNodeNull, aNodeValue, aNodeField;
const std::string& rType = aTree.get<std::string>("type", "");
const std::string& rValue = aTree.get<std::string>("value", "");
const std::string aType = aTree.get<std::string>("type", "");
const std::string aValueStr = aTree.get<std::string>("value", "");
uno::Sequence<uno::Reference<reflection::XIdlField>> aFields;
uno::Reference<reflection::XIdlClass> xIdlClass
= css::reflection::theCoreReflection::get(comphelper::getProcessComponentContext())
->forName(OUString::fromUtf8(rType));
->forName(OUString::fromUtf8(aType));
if (xIdlClass.is())
{
uno::TypeClass aTypeClass = xIdlClass->getTypeClass();
@ -70,28 +70,28 @@ uno::Any jsonToUnoAny(const boost::property_tree::ptree& aTree)
}
}
}
else if (!rValue.empty())
else if (!aValueStr.empty())
{
if (aTypeClass == uno::TypeClass_VOID)
aAny.clear();
else if (aTypeClass == uno::TypeClass_BYTE)
aAny <<= static_cast<sal_Int8>(o3tl::toInt32(rValue));
aAny <<= static_cast<sal_Int8>(o3tl::toInt32(aValueStr));
else if (aTypeClass == uno::TypeClass_BOOLEAN)
aAny <<= rtl_str_toBoolean(rValue.c_str());
aAny <<= rtl_str_toBoolean(aValueStr.c_str());
else if (aTypeClass == uno::TypeClass_SHORT)
aAny <<= static_cast<sal_Int16>(o3tl::toInt32(rValue));
aAny <<= static_cast<sal_Int16>(o3tl::toInt32(aValueStr));
else if (aTypeClass == uno::TypeClass_UNSIGNED_SHORT)
aAny <<= static_cast<sal_uInt16>(o3tl::toUInt32(rValue));
aAny <<= static_cast<sal_uInt16>(o3tl::toUInt32(aValueStr));
else if (aTypeClass == uno::TypeClass_LONG)
aAny <<= o3tl::toInt32(rValue);
aAny <<= o3tl::toInt32(aValueStr);
else if (aTypeClass == uno::TypeClass_UNSIGNED_LONG)
aAny <<= static_cast<sal_uInt32>(o3tl::toInt32(rValue));
aAny <<= static_cast<sal_uInt32>(o3tl::toInt32(aValueStr));
else if (aTypeClass == uno::TypeClass_FLOAT)
aAny <<= rtl_str_toFloat(rValue.c_str());
aAny <<= rtl_str_toFloat(aValueStr.c_str());
else if (aTypeClass == uno::TypeClass_DOUBLE)
aAny <<= o3tl::toDouble(rValue);
aAny <<= o3tl::toDouble(aValueStr);
else if (aTypeClass == uno::TypeClass_STRING)
aAny <<= OUString::fromUtf8(rValue);
aAny <<= OUString::fromUtf8(aValueStr);
}
}
return aAny;
@ -308,46 +308,46 @@ static std::vector<css::beans::PropertyValue> JsonToPropertyValues(const boost::
boost::property_tree::ptree aNodeNull, aNodeValue;
for (const auto& rPair : aTree)
{
const std::string& rType = rPair.second.get<std::string>("type", "");
const std::string& rValue = rPair.second.get<std::string>("value", "");
const std::string aType = rPair.second.get<std::string>("type", "");
const std::string aValueStr = rPair.second.get<std::string>("value", "");
beans::PropertyValue aValue;
aValue.Name = OUString::fromUtf8(rPair.first);
if (rType == "string")
aValue.Value <<= OUString::fromUtf8(rValue);
else if (rType == "boolean")
aValue.Value <<= rtl_str_toBoolean(rValue.c_str());
else if (rType == "float")
aValue.Value <<= rtl_str_toFloat(rValue.c_str());
else if (rType == "long")
aValue.Value <<= o3tl::toInt32(rValue);
else if (rType == "short")
aValue.Value <<= sal_Int16(o3tl::toInt32(rValue));
else if (rType == "unsigned short")
aValue.Value <<= sal_uInt16(o3tl::toUInt32(rValue));
else if (rType == "int64")
aValue.Value <<= o3tl::toInt64(rValue);
else if (rType == "int32")
aValue.Value <<= o3tl::toInt32(rValue);
else if (rType == "int16")
aValue.Value <<= sal_Int16(o3tl::toInt32(rValue));
else if (rType == "uint64")
aValue.Value <<= rtl_str_toUInt64(rValue.c_str(), 10);
else if (rType == "uint32")
aValue.Value <<= o3tl::toUInt32(rValue);
else if (rType == "uint16")
aValue.Value <<= sal_uInt16(o3tl::toUInt32(rValue));
else if (rType == "[]byte")
if (aType == "string")
aValue.Value <<= OUString::fromUtf8(aValueStr);
else if (aType == "boolean")
aValue.Value <<= rtl_str_toBoolean(aValueStr.c_str());
else if (aType == "float")
aValue.Value <<= rtl_str_toFloat(aValueStr.c_str());
else if (aType == "long")
aValue.Value <<= o3tl::toInt32(aValueStr);
else if (aType == "short")
aValue.Value <<= sal_Int16(o3tl::toInt32(aValueStr));
else if (aType == "unsigned short")
aValue.Value <<= sal_uInt16(o3tl::toUInt32(aValueStr));
else if (aType == "int64")
aValue.Value <<= o3tl::toInt64(aValueStr);
else if (aType == "int32")
aValue.Value <<= o3tl::toInt32(aValueStr);
else if (aType == "int16")
aValue.Value <<= sal_Int16(o3tl::toInt32(aValueStr));
else if (aType == "uint64")
aValue.Value <<= rtl_str_toUInt64(aValueStr.c_str(), 10);
else if (aType == "uint32")
aValue.Value <<= o3tl::toUInt32(aValueStr);
else if (aType == "uint16")
aValue.Value <<= sal_uInt16(o3tl::toUInt32(aValueStr));
else if (aType == "[]byte")
{
aNodeValue = rPair.second.get_child("value", aNodeNull);
if (aNodeValue != aNodeNull && aNodeValue.size() == 0)
{
uno::Sequence<sal_Int8> aSeqByte(reinterpret_cast<const sal_Int8*>(rValue.c_str()),
rValue.size());
uno::Sequence<sal_Int8> aSeqByte(reinterpret_cast<const sal_Int8*>(aValueStr.c_str()),
aValueStr.size());
aValue.Value <<= aSeqByte;
}
}
else if (rType == "any")
else if (aType == "any")
{
aNodeValue = rPair.second.get_child("value", aNodeNull);
if (aNodeValue != aNodeNull && !aNodeValue.empty())
@ -355,7 +355,7 @@ static std::vector<css::beans::PropertyValue> JsonToPropertyValues(const boost::
aValue.Value = jsonToUnoAny(aNodeValue);
}
}
else if (rType == "[]any")
else if (aType == "[]any")
{
aNodeValue = rPair.second.get_child("value", aNodeNull);
if (aNodeValue != aNodeNull && !aNodeValue.empty())
@ -366,12 +366,12 @@ static std::vector<css::beans::PropertyValue> JsonToPropertyValues(const boost::
aValue.Value <<= aSeq;
}
}
else if (rType == "[]com.sun.star.beans.PropertyValue")
else if (aType == "[]com.sun.star.beans.PropertyValue")
{
aNodeValue = rPair.second.get_child("value", aNodeNull);
aValue.Value <<= comphelper::containerToSequence(JsonToPropertyValues(aNodeValue));
}
else if (rType == "[][]com.sun.star.beans.PropertyValue")
else if (aType == "[][]com.sun.star.beans.PropertyValue")
{
aNodeValue = rPair.second.get_child("value", aNodeNull);
std::vector<uno::Sequence<beans::PropertyValue>> aSeqs;
@ -382,7 +382,7 @@ static std::vector<css::beans::PropertyValue> JsonToPropertyValues(const boost::
aValue.Value <<= comphelper::containerToSequence(aSeqs);
}
else
SAL_WARN("comphelper", "JsonToPropertyValues: unhandled type '" << rType << "'");
SAL_WARN("comphelper", "JsonToPropertyValues: unhandled type '" << aType << "'");
aArguments.push_back(aValue);
}
return aArguments;

View file

@ -404,11 +404,11 @@ std::shared_ptr<ExpressionNode> const & FunctionParser::parseFunction( const OUS
// TODO(Q1): Check if a combination of the RTL_UNICODETOTEXT_FLAGS_*
// gives better conversion robustness here (we might want to map space
// etc. to ASCII space here)
const OString& rAsciiFunction(
const OString aAsciiFunction(
OUStringToOString( _sFunction, RTL_TEXTENCODING_ASCII_US ) );
StringIteratorT aStart( rAsciiFunction.getStr() );
StringIteratorT aEnd( rAsciiFunction.getStr()+rAsciiFunction.getLength() );
StringIteratorT aStart( aAsciiFunction.getStr() );
StringIteratorT aEnd( aAsciiFunction.getStr()+aAsciiFunction.getLength() );
// static parser context, because the actual
// Spirit parser is also a static object

View file

@ -497,7 +497,7 @@ void OStatement_Base::GetAssignValues()
OSL_ENSURE(SQL_ISRULE(pOptColumnCommalist,opt_column_commalist),"OResultSet: Error in Parse Tree");
if (pOptColumnCommalist->count() == 0)
{
const Sequence< OUString>& aNames = m_xColNames->getElementNames();
const Sequence< OUString> aNames = m_xColNames->getElementNames();
aColumnNameList.insert(aColumnNameList.end(), aNames.begin(), aNames.end());
}
else

View file

@ -133,7 +133,7 @@ ObjectType Tables::appendObject(const OUString& rName,
m_xMetaData->getConnection())); */
OUStringBuffer aSqlBuffer("CREATE TABLE ");
OUString sCatalog, sSchema, sComposedName, sTable;
const Reference< XConnection>& xConnection = m_xMetaData->getConnection();
const Reference< XConnection> xConnection = m_xMetaData->getConnection();
::dbtools::OPropertyMap& rPropMap = OMetaConnection::getPropMap();

View file

@ -258,7 +258,7 @@ template <typename T> T OPreparedResultSet::retrieveValue(sal_Int32 nColumnIndex
return *static_cast<T*>(m_aData[nColumnIndex - 1].buffer);
else
{
auto const& row = getRowSetValue(nColumnIndex);
auto const row = getRowSetValue(nColumnIndex);
if constexpr (std::is_same_v<sal_Int64, T>)
return row.getLong();
else if constexpr (std::is_same_v<sal_Int32, T>)

View file

@ -240,7 +240,7 @@ Sequence< sal_Int8 > SAL_CALL ODatabaseMetaDataResultSet::getBytes( sal_Int32 co
case DataType::VARCHAR:
case DataType::LONGVARCHAR:
{
OUString const & aRet = OTools::getStringValue(m_pConnection.get(),m_aStatementHandle,columnIndex,SQL_C_BINARY,m_bWasNull,**this,m_nTextEncoding);
OUString const aRet = OTools::getStringValue(m_pConnection.get(),m_aStatementHandle,columnIndex,SQL_C_BINARY,m_bWasNull,**this,m_nTextEncoding);
return Sequence<sal_Int8>(reinterpret_cast<const sal_Int8*>(aRet.getStr()),sizeof(sal_Unicode)*aRet.getLength());
}
}

View file

@ -441,7 +441,7 @@ Sequence< sal_Int8 > SAL_CALL OResultSet::getBytes( sal_Int32 columnIndex )
break;
default:
{
OUString const & sRet = m_aRow[columnIndex].getString();
OUString const sRet = m_aRow[columnIndex].getString();
nRet = Sequence<sal_Int8>(reinterpret_cast<const sal_Int8*>(sRet.getStr()),sizeof(sal_Unicode)*sRet.getLength());
}
}
@ -460,7 +460,7 @@ Sequence< sal_Int8 > OResultSet::impl_getBytes( sal_Int32 columnIndex )
case SQL_CHAR:
case SQL_LONGVARCHAR:
{
OUString const & aRet = OTools::getStringValue(m_pStatement->getOwnConnection(),m_aStatementHandle,columnIndex,nColumnType,m_bWasNull,**this,m_nTextEncoding);
OUString const aRet = OTools::getStringValue(m_pStatement->getOwnConnection(),m_aStatementHandle,columnIndex,nColumnType,m_bWasNull,**this,m_nTextEncoding);
return Sequence<sal_Int8>(reinterpret_cast<const sal_Int8*>(aRet.getStr()),sizeof(sal_Unicode)*aRet.getLength());
}
default: