loplugin:passstuffbyref improved returns in vcl

Change-Id: I0b103df2e7ce59093869f547225c95865d33da27
Reviewed-on: https://gerrit.libreoffice.org/46916
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
This commit is contained in:
Noel Grandin
2017-12-23 09:17:30 +02:00
parent 38bf5f6966
commit a8c1c0ae16
20 changed files with 23 additions and 23 deletions

View File

@@ -68,7 +68,7 @@ public:
size_t size() const { return aCommandList.size(); } size_t size() const { return aCommandList.size(); }
SvCommand operator[]( size_t i) { SvCommand const & operator[]( size_t i) {
return aCommandList[ i ]; return aCommandList[ i ];
} }

View File

@@ -61,7 +61,7 @@ SVL_DLLPUBLIC OUString SmartRel2Abs(INetURLObject const & rTheBaseURIRef,
SVL_DLLPUBLIC void SetMaybeFileHdl(Link<OUString *, bool> const & rTheMaybeFileHdl); SVL_DLLPUBLIC void SetMaybeFileHdl(Link<OUString *, bool> const & rTheMaybeFileHdl);
SVL_DLLPUBLIC Link<OUString *, bool> GetMaybeFileHdl(); SVL_DLLPUBLIC Link<OUString *, bool> const & GetMaybeFileHdl();
/** /**
Converts a URI reference to a relative one, ignoring certain differences (for Converts a URI reference to a relative one, ignoring certain differences (for

View File

@@ -55,7 +55,7 @@ public:
BitmapChecksum GetChecksum() const { return Bitmap::GetChecksum(); } BitmapChecksum GetChecksum() const { return Bitmap::GetChecksum(); }
Bitmap GetBitmap() const; Bitmap const & GetBitmap() const;
bool Erase( sal_uInt8 cTransparency ); bool Erase( sal_uInt8 cTransparency );
bool Replace( const Bitmap& rMask, sal_uInt8 rReplaceTransparency ); bool Replace( const Bitmap& rMask, sal_uInt8 rReplaceTransparency );

View File

@@ -427,8 +427,8 @@ public:
const Size &rSize ); const Size &rSize );
public: public:
SAL_DLLPRIVATE std::shared_ptr<ImpBitmap> ImplGetBitmapImpBitmap() const { return aBitmap.ImplGetImpBitmap(); } SAL_DLLPRIVATE std::shared_ptr<ImpBitmap> const & ImplGetBitmapImpBitmap() const { return aBitmap.ImplGetImpBitmap(); }
SAL_DLLPRIVATE std::shared_ptr<ImpBitmap> ImplGetMaskImpBitmap() const { return aMask.ImplGetImpBitmap(); } SAL_DLLPRIVATE std::shared_ptr<ImpBitmap> const & ImplGetMaskImpBitmap() const { return aMask.ImplGetImpBitmap(); }
private: private:

View File

@@ -77,7 +77,7 @@ public:
/// Setup handler for UNO commands so that commands like .uno:Something are handled automagically by this button. /// Setup handler for UNO commands so that commands like .uno:Something are handled automagically by this button.
void SetCommandHandler(const OUString& aCommand); void SetCommandHandler(const OUString& aCommand);
const OUString GetCommand() const { return maCommand; } OUString const & GetCommand() const { return maCommand; }
static OUString GetStandardText( StandardButtonType eButton ); static OUString GetStandardText( StandardButtonType eButton );

View File

@@ -145,7 +145,7 @@ public:
nUserId(nArgUserId) {} nUserId(nArgUserId) {}
virtual ~ErrorInfo(); virtual ~ErrorInfo();
ErrCode GetErrorCode() const { return nUserId; } ErrCode const & GetErrorCode() const { return nUserId; }
static ErrorInfo* GetErrorInfo(ErrCode); static ErrorInfo* GetErrorInfo(ErrCode);

View File

@@ -44,7 +44,7 @@ public:
virtual void dispose() override; virtual void dispose() override;
void addEntry(VclPtr<vcl::Window> xEntry, sal_uInt32 nPos = std::numeric_limits<sal_uInt16>::max()); void addEntry(VclPtr<vcl::Window> xEntry, sal_uInt32 nPos = std::numeric_limits<sal_uInt16>::max());
std::vector<VclPtr<vcl::Window>> getEntries() const; std::vector<VclPtr<vcl::Window>> const & getEntries() const;
void deleteEntry(sal_uInt32 nPos); void deleteEntry(sal_uInt32 nPos);
virtual Size GetOptimalSize() const override; virtual Size GetOptimalSize() const override;

View File

@@ -188,7 +188,7 @@ public:
@returns The event's data string. @returns The event's data string.
*/ */
OUString GetStringData() const OUString const & GetStringData() const
{ {
assert( assert(
aEvent == Type::Accept || aEvent == Type::Help aEvent == Type::Accept || aEvent == Type::Help

View File

@@ -355,7 +355,7 @@ public:
sal_uInt16 GetItemId( const OUString& rCommand ) const; sal_uInt16 GetItemId( const OUString& rCommand ) const;
tools::Rectangle GetItemRect( sal_uInt16 nItemId ); tools::Rectangle GetItemRect( sal_uInt16 nItemId );
tools::Rectangle GetItemPosRect( ImplToolItems::size_type nPos ); tools::Rectangle GetItemPosRect( ImplToolItems::size_type nPos );
tools::Rectangle GetOverflowRect() const; tools::Rectangle const & GetOverflowRect() const;
/// Returns size of the bitmap / text that is inside this toolbox item. /// Returns size of the bitmap / text that is inside this toolbox item.
Size GetItemContentSize( sal_uInt16 nItemId ); Size GetItemContentSize( sal_uInt16 nItemId );

View File

@@ -73,7 +73,7 @@ public:
void SetStrm( SvStream*, bool ); void SetStrm( SvStream*, bool );
void SetStrm( UCBStorageStream* ); void SetStrm( UCBStorageStream* );
bool Good() const { return m_nError == ERRCODE_NONE; } bool Good() const { return m_nError == ERRCODE_NONE; }
ErrCode GetError() const { return m_nError; } ErrCode const & GetError() const { return m_nError; }
void MoveError( StorageBase const & ); void MoveError( StorageBase const & );
void SetError( ErrCode ); void SetError( ErrCode );
void ResetError(); void ResetError();

View File

@@ -61,11 +61,11 @@ namespace {
// #i86923# // #i86923#
bool hasItemSet( const bool bCheckUsage ) const; bool hasItemSet( const bool bCheckUsage ) const;
// #i87808# // #i87808#
const std::shared_ptr<SfxItemSet> getItemSet() const std::shared_ptr<SfxItemSet> const & getItemSet() const
{ {
return maItemSet.back(); return maItemSet.back();
} }
const std::shared_ptr<SfxItemSet> getUsedOrLastAddedItemSet() const; std::shared_ptr<SfxItemSet> const & getUsedOrLastAddedItemSet() const;
void setItemSet( const SfxItemSet& rSet ){ maItemSet.push_back( std::shared_ptr<SfxItemSet>( rSet.Clone() ) ); } void setItemSet( const SfxItemSet& rSet ){ maItemSet.push_back( std::shared_ptr<SfxItemSet>( rSet.Clone() ) ); }
// #i86923# // #i86923#
Node* findChildNode( const SfxPoolItem& rItem, Node* findChildNode( const SfxPoolItem& rItem,
@@ -80,7 +80,7 @@ namespace {
}; };
// #i87808# // #i87808#
const std::shared_ptr<SfxItemSet> Node::getUsedOrLastAddedItemSet() const std::shared_ptr<SfxItemSet> const & Node::getUsedOrLastAddedItemSet() const
{ {
std::vector< std::shared_ptr<SfxItemSet> >::const_reverse_iterator aIter; std::vector< std::shared_ptr<SfxItemSet> >::const_reverse_iterator aIter;

View File

@@ -112,7 +112,7 @@ void URIHelper::SetMaybeFileHdl(Link<OUString *, bool> const & rTheMaybeFileHdl)
MaybeFileHdl::get() = rTheMaybeFileHdl; MaybeFileHdl::get() = rTheMaybeFileHdl;
} }
Link<OUString *, bool> URIHelper::GetMaybeFileHdl() Link<OUString *, bool> const & URIHelper::GetMaybeFileHdl()
{ {
return MaybeFileHdl::get(); return MaybeFileHdl::get();
} }

View File

@@ -77,7 +77,7 @@ public:
* be too late for the destructors of the bitmaps in maIconCache)*/ * be too late for the destructors of the bitmaps in maIconCache)*/
void shutdown(); void shutdown();
css::uno::Reference< css::container::XNameAccess > getNameAccess(); css::uno::Reference< css::container::XNameAccess > const & getNameAccess();
private: private:
ImplImageTree(const ImplImageTree&) = delete; ImplImageTree(const ImplImageTree&) = delete;

View File

@@ -43,7 +43,7 @@ public:
mbRelaxed = bRelaxed; mbRelaxed = bRelaxed;
} }
WatchdogTimingsValues getWatchdogTimingsValues(WatchdogTimingMode eMode) WatchdogTimingsValues const & getWatchdogTimingsValues(WatchdogTimingMode eMode)
{ {
size_t index = 0; size_t index = 0;
index = (eMode == WatchdogTimingMode::SHADER_COMPILE) ? 1 : 0; index = (eMode == WatchdogTimingMode::SHADER_COMPILE) ? 1 : 0;

View File

@@ -107,7 +107,7 @@ public:
GDBusProxy * getProxy( std::string target ); GDBusProxy * getProxy( std::string target );
void addBackend( std::pair< std::string, GDBusProxy * > pair ); void addBackend( std::pair< std::string, GDBusProxy * > pair );
void addTempBackend( std::pair< std::string, gchar* > pair ); void addTempBackend( std::pair< std::string, gchar* > pair );
std::vector<std::pair<std::string, gchar*>> getTempBackends(); std::vector<std::pair<std::string, gchar*>> const & getTempBackends();
void addNewPrinter( const OUString&, const OUString&, CPDPrinter * ); void addNewPrinter( const OUString&, const OUString&, CPDPrinter * );
#endif #endif

View File

@@ -148,7 +148,7 @@ void ListControl::deleteEntry(sal_uInt32 nPos)
RecalcAll(); RecalcAll();
} }
std::vector<VclPtr<vcl::Window>> ListControl::getEntries() const std::vector<VclPtr<vcl::Window>> const & ListControl::getEntries() const
{ {
return maEntries; return maEntries;
} }

View File

@@ -75,7 +75,7 @@ void AlphaMask::ImplSetBitmap( const Bitmap& rBitmap )
*static_cast<Bitmap*>(this) = rBitmap; *static_cast<Bitmap*>(this) = rBitmap;
} }
Bitmap AlphaMask::GetBitmap() const Bitmap const & AlphaMask::GetBitmap() const
{ {
return ImplGetBitmap(); return ImplGetBitmap();
} }

View File

@@ -557,7 +557,7 @@ bool ImplImageTree::checkPathAccess()
return rNameAccess.is(); return rNameAccess.is();
} }
css::uno::Reference<css::container::XNameAccess> ImplImageTree::getNameAccess() css::uno::Reference<css::container::XNameAccess> const & ImplImageTree::getNameAccess()
{ {
checkPathAccess(); checkPathAccess();
return getCurrentIconSet().maNameAccess; return getCurrentIconSet().maNameAccess;

View File

@@ -863,7 +863,7 @@ tools::Rectangle ToolBox::GetItemPosRect( ImplToolItems::size_type nPos )
return tools::Rectangle(); return tools::Rectangle();
} }
tools::Rectangle ToolBox::GetOverflowRect() const tools::Rectangle const & ToolBox::GetOverflowRect() const
{ {
return mpData->maMenubuttonItem.maRect; return mpData->maMenubuttonItem.maRect;
} }

View File

@@ -184,7 +184,7 @@ void CPDManager::addTempBackend(std::pair<std::string, gchar*> pair) {
m_tBackends.push_back(pair); m_tBackends.push_back(pair);
} }
std::vector<std::pair<std::string, gchar*>> CPDManager::getTempBackends() { std::vector<std::pair<std::string, gchar*>> const & CPDManager::getTempBackends() {
return m_tBackends; return m_tBackends;
} }