clang-tidy performance-unnecessary-copy-init in dbaccess..drawinglayer
Change-Id: I49a152b2aea93d30b16192260f4f659c7e5fcaee Reviewed-on: https://gerrit.libreoffice.org/62215 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
This commit is contained in:
@@ -49,12 +49,11 @@ sal_Int32 lcl_IndexOfUnicode(const OString& rSource, const sal_Int32 nFrom = 0)
|
||||
}
|
||||
|
||||
//Convert ascii escaped unicode to utf-8
|
||||
OUString lcl_ConvertToUTF8(const OString& rText)
|
||||
OUString lcl_ConvertToUTF8(const OString& original)
|
||||
{
|
||||
OString original = rText;
|
||||
OString sResult = rText;
|
||||
OString sResult = original;
|
||||
sal_Int32 nIndex = lcl_IndexOfUnicode(sResult);
|
||||
while (nIndex != -1 && nIndex < rText.getLength())
|
||||
while (nIndex != -1 && nIndex < original.getLength())
|
||||
{
|
||||
const OString sHex = original.copy(nIndex + 2, 4);
|
||||
const sal_Unicode cDec = static_cast<sal_Unicode>(strtol(sHex.getStr(), nullptr, 16));
|
||||
|
||||
@@ -288,7 +288,7 @@ void ODBExport::exportDataSource()
|
||||
|
||||
::connectivity::DriversConfig aDriverConfig(getComponentContext());
|
||||
const OUString sURL = ::comphelper::getString(xProp->getPropertyValue(PROPERTY_URL));
|
||||
::comphelper::NamedValueCollection aDriverSupportedProperties( aDriverConfig.getProperties( sURL ) );
|
||||
const ::comphelper::NamedValueCollection& aDriverSupportedProperties( aDriverConfig.getProperties( sURL ) );
|
||||
|
||||
static OUString s_sTrue(::xmloff::token::GetXMLToken( XML_TRUE ));
|
||||
static OUString s_sFalse(::xmloff::token::GetXMLToken( XML_FALSE ));
|
||||
|
||||
@@ -45,7 +45,7 @@ namespace
|
||||
{
|
||||
bool bGrabFocus = false;
|
||||
SbaGridControl* pVclControl = _pView->getVclControl();
|
||||
Reference< css::awt::XControl > xGrid = _pView->getGridControl();
|
||||
const Reference< css::awt::XControl >& xGrid = _pView->getGridControl();
|
||||
if (pVclControl && xGrid.is())
|
||||
{
|
||||
bGrabFocus = true;
|
||||
|
||||
@@ -138,7 +138,7 @@ namespace dbaui
|
||||
// forward the values to the controls
|
||||
if ( bValid )
|
||||
{
|
||||
OUString sUrl = pUrlItem->GetValue();
|
||||
const OUString& sUrl = pUrlItem->GetValue();
|
||||
setURL( sUrl );
|
||||
|
||||
checkTestConnection();
|
||||
|
||||
@@ -233,7 +233,7 @@ namespace dbaui
|
||||
m_pUserName->SetText(pUidItem->GetValue());
|
||||
m_pPasswordRequired->Check(pAllowEmptyPwd->GetValue());
|
||||
|
||||
OUString sUrl = pUrlItem->GetValue();
|
||||
const OUString& sUrl = pUrlItem->GetValue();
|
||||
setURL( sUrl );
|
||||
|
||||
const bool bEnableJDBC = m_pCollection->determineType(m_eType) == ::dbaccess::DST_JDBC;
|
||||
|
||||
@@ -272,7 +272,7 @@ namespace dbaui
|
||||
RadioButton& rSocketPipeRadio = *m_pNamedPipeRadio;
|
||||
const SfxStringItem* pSocketPipeItem = pNamedPipe;
|
||||
#endif
|
||||
OUString sSocketPipe( pSocketPipeItem->GetValue() );
|
||||
const OUString& sSocketPipe( pSocketPipeItem->GetValue() );
|
||||
if ( !sSocketPipe.isEmpty() )
|
||||
rSocketPipeRadio.Check();
|
||||
else
|
||||
|
||||
@@ -152,7 +152,7 @@ ODbTypeWizDialogSetup::ODbTypeWizDialogSetup(vcl::Window* _pParent
|
||||
::dbaccess::ODsnTypeCollection::TypeIterator aEnd = m_pCollection->end();
|
||||
for(PathId i = 1;aIter != aEnd;++aIter,++i)
|
||||
{
|
||||
const OUString sURLPrefix = aIter.getURLPrefix();
|
||||
const OUString& sURLPrefix = aIter.getURLPrefix();
|
||||
svt::RoadmapWizardTypes::WizardPath aPath;
|
||||
aPath.push_back(PAGE_DBSETUPWIZARD_INTRO);
|
||||
m_pCollection->fillPageIds(sURLPrefix,aPath);
|
||||
|
||||
@@ -123,7 +123,7 @@ namespace dbaui
|
||||
++aTypeLoop
|
||||
)
|
||||
{
|
||||
const OUString sURLPrefix = aTypeLoop.getURLPrefix();
|
||||
const OUString& sURLPrefix = aTypeLoop.getURLPrefix();
|
||||
if ( !sURLPrefix.isEmpty() )
|
||||
{
|
||||
// skip mysql connection variations. It is handled in another window.
|
||||
@@ -166,7 +166,7 @@ namespace dbaui
|
||||
++aTypeLoop
|
||||
)
|
||||
{
|
||||
const OUString sURLPrefix = aTypeLoop.getURLPrefix();
|
||||
const OUString& sURLPrefix = aTypeLoop.getURLPrefix();
|
||||
if ( !sURLPrefix.isEmpty() )
|
||||
{
|
||||
OUString sDisplayName = aTypeLoop.getDisplayName();
|
||||
|
||||
@@ -181,7 +181,7 @@ void OJoinController::impl_onModifyChanged()
|
||||
void OJoinController::SaveTabWinPosSize(OTableWindow const * pTabWin, long nOffsetX, long nOffsetY)
|
||||
{
|
||||
// the data for the window
|
||||
TTableWindowData::value_type pData = pTabWin->GetData();
|
||||
const TTableWindowData::value_type& pData = pTabWin->GetData();
|
||||
OSL_ENSURE(pData != nullptr, "SaveTabWinPosSize : TabWin has no data !");
|
||||
|
||||
// set Position & Size of data anew (with current window parameters)
|
||||
|
||||
@@ -950,7 +950,7 @@ bool OSelectionBrowseBox::SaveModified()
|
||||
OUString sTableAlias = aFieldName.getToken(0,'.');
|
||||
pEntry->SetAlias(sTableAlias);
|
||||
OUString sColumnName = aFieldName.copy(sTableAlias.getLength()+1);
|
||||
Reference<XConnection> xConnection = rController.getConnection();
|
||||
const Reference<XConnection>& xConnection = rController.getConnection();
|
||||
if ( !xConnection.is() )
|
||||
return false;
|
||||
bError = fillColumnRef( sColumnName, sTableAlias, xConnection->getMetaData(), pEntry, bListAction );
|
||||
@@ -1685,7 +1685,7 @@ void OSelectionBrowseBox::DuplicateConditionLevel( const sal_uInt16 nLevel)
|
||||
const sal_uInt16 nNewLevel = nLevel +1;
|
||||
for (auto const& field : getFields())
|
||||
{
|
||||
OTableFieldDescRef pEntry = field;
|
||||
const OTableFieldDescRef& pEntry = field;
|
||||
OUString sValue = pEntry->GetCriteria(nLevel);
|
||||
if ( !sValue.isEmpty() )
|
||||
{
|
||||
@@ -1715,7 +1715,7 @@ void OSelectionBrowseBox::AddCondition( const OTableFieldDescRef& rInfo, const O
|
||||
bool bAllFieldsSearched = true;
|
||||
for (auto const& field : getFields())
|
||||
{
|
||||
OTableFieldDescRef pEntry = field;
|
||||
const OTableFieldDescRef& pEntry = field;
|
||||
const OUString aField = pEntry->GetField();
|
||||
const OUString aAlias = pEntry->GetAlias();
|
||||
|
||||
|
||||
@@ -94,7 +94,7 @@ SvTreeListEntry* OTableWindowListBox::GetEntryFromText( const OUString& rEntryTe
|
||||
try
|
||||
{
|
||||
bool bCase = false;
|
||||
Reference<XConnection> xConnection = rController.getConnection();
|
||||
const Reference<XConnection>& xConnection = rController.getConnection();
|
||||
if(xConnection.is())
|
||||
{
|
||||
Reference<XDatabaseMetaData> xMeta = xConnection->getMetaData();
|
||||
|
||||
@@ -1290,7 +1290,7 @@ bool OTableEditorCtrl::IsPrimaryKeyAllowed( long /*nRow*/ )
|
||||
// Memo and Image fields cannot be primary keys
|
||||
// or if the column cannot be dropped and the Required flag is not set
|
||||
// or if a css::sdbcx::View is available and the Required flag is not set
|
||||
TOTypeInfoSP pTypeInfo = pFieldDescr->getTypeInfo();
|
||||
const TOTypeInfoSP& pTypeInfo = pFieldDescr->getTypeInfo();
|
||||
if( pTypeInfo->nSearchType == ColumnSearch::NONE
|
||||
|| (pFieldDescr->IsNullable() && pRow->IsReadOnly())
|
||||
)
|
||||
|
||||
@@ -1257,7 +1257,7 @@ int Desktop::Main()
|
||||
CommandLineArgs& rCmdLineArgs = GetCommandLineArgs();
|
||||
|
||||
#if HAVE_FEATURE_DESKTOP
|
||||
OUString aUnknown( rCmdLineArgs.GetUnknown() );
|
||||
const OUString& aUnknown( rCmdLineArgs.GetUnknown() );
|
||||
if ( !aUnknown.isEmpty() )
|
||||
{
|
||||
displayCmdlineHelp( aUnknown );
|
||||
|
||||
@@ -674,7 +674,7 @@ bool ExtMgrDialog::acceptLicense( const uno::Reference< deployment::XPackage > &
|
||||
uno::Sequence< OUString > ExtMgrDialog::raiseAddPicker()
|
||||
{
|
||||
sfx2::FileDialogHelper aDlgHelper(ui::dialogs::TemplateDescription::FILEOPEN_SIMPLE, FileDialogFlags::NONE, GetFrameWeld());
|
||||
const uno::Reference<ui::dialogs::XFilePicker3> xFilePicker = aDlgHelper.GetFilePicker();
|
||||
const uno::Reference<ui::dialogs::XFilePicker3>& xFilePicker = aDlgHelper.GetFilePicker();
|
||||
xFilePicker->setTitle( m_sAddPackages );
|
||||
|
||||
if ( !m_sLastFolderURL.isEmpty() )
|
||||
|
||||
@@ -218,7 +218,7 @@ OUString PackageRegistryBackend::createFolder(
|
||||
|
||||
const OUString baseDir(sDataFolder);
|
||||
::utl::TempFile aTemp(&baseDir, true);
|
||||
const OUString url = aTemp.GetURL();
|
||||
const OUString& url = aTemp.GetURL();
|
||||
return sDataFolder + url.copy(url.lastIndexOf('/'));
|
||||
}
|
||||
|
||||
|
||||
@@ -2888,7 +2888,7 @@ static char* getFontSubset (const OString& aFontName)
|
||||
{
|
||||
FontCharMapRef xFontCharMap (new FontCharMap());
|
||||
auto aDevice(VclPtr<VirtualDevice>::Create(nullptr, Size(1, 1), DeviceFormat::DEFAULT));
|
||||
vcl::Font aFont(pList->GetFontName(nItFont));
|
||||
const vcl::Font& aFont(pList->GetFontName(nItFont));
|
||||
|
||||
aDevice->SetFont(aFont);
|
||||
aDevice->GetFontCharMap(xFontCharMap);
|
||||
|
||||
@@ -32,7 +32,7 @@ namespace drawinglayer
|
||||
Primitive2DReference createHiddenGeometryPrimitives2D(
|
||||
const basegfx::B2DHomMatrix& rMatrix)
|
||||
{
|
||||
const basegfx::B2DPolygon aUnitOutline(basegfx::utils::createUnitPolygon());
|
||||
const basegfx::B2DPolygon& aUnitOutline(basegfx::utils::createUnitPolygon());
|
||||
|
||||
return createHiddenGeometryPrimitives2D(
|
||||
false/*bFilled*/,
|
||||
|
||||
@@ -88,7 +88,7 @@ namespace drawinglayer
|
||||
|
||||
for(sal_uInt32 b(0); b < nPolyCount; b++)
|
||||
{
|
||||
const basegfx::B3DPolygon aPartPoly(aFillPolyPolygon.getB3DPolygon(b));
|
||||
const basegfx::B3DPolygon& aPartPoly(aFillPolyPolygon.getB3DPolygon(b));
|
||||
const sal_uInt32 nPointCount(aPartPoly.count());
|
||||
basegfx::B2DPolygon aTexPolygon;
|
||||
|
||||
|
||||
@@ -117,7 +117,7 @@ namespace drawinglayer
|
||||
// create hair line data for all sub polygons
|
||||
for(sal_uInt32 a(0); a < aHairLinePolyPolygon.count(); a++)
|
||||
{
|
||||
const basegfx::B3DPolygon aCandidate = aHairLinePolyPolygon.getB3DPolygon(a);
|
||||
const basegfx::B3DPolygon& aCandidate = aHairLinePolyPolygon.getB3DPolygon(a);
|
||||
const Primitive3DReference xRef(new PolygonHairlinePrimitive3D(aCandidate, getLineAttribute().getColor()));
|
||||
aRetval[a] = xRef;
|
||||
}
|
||||
|
||||
@@ -262,7 +262,7 @@ namespace drawinglayer
|
||||
|
||||
for (sal_uInt32 a = 0; a < nCount; ++a)
|
||||
{
|
||||
const basegfx::B3DPolygon aPartPolygon(aSphere.getB3DPolygon(a));
|
||||
const basegfx::B3DPolygon& aPartPolygon(aSphere.getB3DPolygon(a));
|
||||
const basegfx::B3DPolyPolygon aPartPolyPolygon(aPartPolygon);
|
||||
|
||||
// need to create one primitive per Polygon since the primitive
|
||||
@@ -318,7 +318,7 @@ namespace drawinglayer
|
||||
|
||||
for(sal_uInt32 a(0); a < aSphere.count(); a++)
|
||||
{
|
||||
const basegfx::B3DPolygon aPartPolygon(aSphere.getB3DPolygon(a));
|
||||
const basegfx::B3DPolygon& aPartPolygon(aSphere.getB3DPolygon(a));
|
||||
const basegfx::B3DPolyPolygon aPartPolyPolygon(aPartPolygon);
|
||||
BasePrimitive3D* pNew = new PolyPolygonMaterialPrimitive3D(aPartPolyPolygon, rMaterial, false);
|
||||
aResultVector.push_back(pNew);
|
||||
|
||||
@@ -115,8 +115,8 @@ namespace
|
||||
|
||||
for(sal_uInt32 a(0); a < nPolygonCount; a++)
|
||||
{
|
||||
const basegfx::B3DPolygon aSubA(rPolA.getB3DPolygon(a));
|
||||
const basegfx::B3DPolygon aSubB(rPolB.getB3DPolygon(a));
|
||||
const basegfx::B3DPolygon& aSubA(rPolA.getB3DPolygon(a));
|
||||
const basegfx::B3DPolygon& aSubB(rPolB.getB3DPolygon(a));
|
||||
OSL_ENSURE(aSubA.count() == aSubB.count(), "impAddInBetweenFill: unequally sized polygons (!)");
|
||||
const sal_uInt32 nPointCount(std::min(aSubA.count(), aSubB.count()));
|
||||
|
||||
@@ -290,7 +290,7 @@ namespace
|
||||
for(sal_uInt32 a(0); a < nPolygonCount; a++)
|
||||
{
|
||||
basegfx::B3DPolygon aSubA(rPolA.getB3DPolygon(a));
|
||||
const basegfx::B3DPolygon aSubB(rPolB.getB3DPolygon(a));
|
||||
const basegfx::B3DPolygon& aSubB(rPolB.getB3DPolygon(a));
|
||||
OSL_ENSURE(aSubA.count() == aSubB.count(), "sdrExtrudePrimitive3D: unequally sized polygons (!)");
|
||||
const sal_uInt32 nPointCount(std::min(aSubA.count(), aSubB.count()));
|
||||
|
||||
|
||||
@@ -154,7 +154,7 @@ namespace drawinglayer
|
||||
for(a = 0; a < nCount; a++)
|
||||
{
|
||||
const sal_uInt32 nReducedCount(aReducedLoops.count());
|
||||
const basegfx::B3DPolygon aCandidate(aVerLine.getB3DPolygon(a));
|
||||
const basegfx::B3DPolygon& aCandidate(aVerLine.getB3DPolygon(a));
|
||||
bool bAdd(true);
|
||||
|
||||
if(nReducedCount)
|
||||
@@ -182,8 +182,8 @@ namespace drawinglayer
|
||||
for(sal_uInt32 b(1); b < nReducedCount; b++)
|
||||
{
|
||||
// get loop pair
|
||||
const basegfx::B3DPolygon aCandA(aReducedLoops.getB3DPolygon(b - 1));
|
||||
const basegfx::B3DPolygon aCandB(aReducedLoops.getB3DPolygon(b));
|
||||
const basegfx::B3DPolygon& aCandA(aReducedLoops.getB3DPolygon(b - 1));
|
||||
const basegfx::B3DPolygon& aCandB(aReducedLoops.getB3DPolygon(b));
|
||||
|
||||
// for each loop pair create the connection edges
|
||||
createReducedOutlines(
|
||||
|
||||
@@ -128,7 +128,7 @@ namespace
|
||||
|
||||
for(sal_uInt32 a(0); a < nPolyCount; a++)
|
||||
{
|
||||
const basegfx::B2DPolygon aCandidate(rPolyPolygon.getB2DPolygon(a));
|
||||
const basegfx::B2DPolygon& aCandidate(rPolyPolygon.getB2DPolygon(a));
|
||||
const sal_uInt32 nPointCount(aCandidate.count());
|
||||
bool bNeedToSplit(false);
|
||||
|
||||
@@ -221,7 +221,7 @@ namespace
|
||||
sal_uInt32 nCount(rPoly.count());
|
||||
for( sal_uInt32 i=0; i<nCount; ++i )
|
||||
{
|
||||
basegfx::B2DPolygon aCandidate(rPoly.getB2DPolygon(i));
|
||||
const basegfx::B2DPolygon& aCandidate(rPoly.getB2DPolygon(i));
|
||||
if( !aCandidate.isClosed() || aCandidate.count() > 1 )
|
||||
aPoly.append(aCandidate);
|
||||
}
|
||||
@@ -1390,7 +1390,7 @@ namespace drawinglayer
|
||||
|
||||
for(sal_uInt32 a(0); a < aHairLinePolyPolygon.count(); a++)
|
||||
{
|
||||
const basegfx::B2DPolygon aCandidate(aHairLinePolyPolygon.getB2DPolygon(a));
|
||||
const basegfx::B2DPolygon& aCandidate(aHairLinePolyPolygon.getB2DPolygon(a));
|
||||
|
||||
if(aCandidate.count() > 1)
|
||||
{
|
||||
|
||||
@@ -156,7 +156,7 @@ namespace drawinglayer
|
||||
}
|
||||
|
||||
// get geometry data, prepare hairline data
|
||||
basegfx::B2DPolygon aLocalPolygon(rSource.getB2DPolygon());
|
||||
const basegfx::B2DPolygon& aLocalPolygon(rSource.getB2DPolygon());
|
||||
basegfx::B2DPolyPolygon aHairLinePolyPolygon;
|
||||
|
||||
// simplify curve segments
|
||||
@@ -220,7 +220,7 @@ namespace drawinglayer
|
||||
|
||||
for(sal_uInt32 a(0); a < aHairLinePolyPolygon.count(); a++)
|
||||
{
|
||||
const basegfx::B2DPolygon aSingle(aHairLinePolyPolygon.getB2DPolygon(a));
|
||||
const basegfx::B2DPolygon& aSingle(aHairLinePolyPolygon.getB2DPolygon(a));
|
||||
|
||||
if(aSingle.count())
|
||||
{
|
||||
|
||||
@@ -146,12 +146,12 @@ namespace drawinglayer
|
||||
|
||||
if(!maFront.equal(maBack))
|
||||
{
|
||||
const basegfx::B3DPolyPolygon& rPolyPolygon = rPrimitive.getB3DPolyPolygon();
|
||||
const basegfx::B3DPolyPolygon& rPolyPolygon = rPrimitive.getB3DPolyPolygon();
|
||||
const sal_uInt32 nPolyCount(rPolyPolygon.count());
|
||||
|
||||
if(nPolyCount)
|
||||
{
|
||||
const basegfx::B3DPolygon aPolygon(rPolyPolygon.getB3DPolygon(0));
|
||||
const basegfx::B3DPolygon& aPolygon(rPolyPolygon.getB3DPolygon(0));
|
||||
const sal_uInt32 nPointCount(aPolygon.count());
|
||||
|
||||
if(nPointCount > 2)
|
||||
|
||||
Reference in New Issue
Block a user