diff options
author | Noel Grandin <noel@peralex.com> | 2014-06-18 12:14:29 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2014-06-24 11:34:21 +0200 |
commit | e2080e70fe8b085f18e868e46340454720fa94ca (patch) | |
tree | 4038d1d57b41b68a47d5ebbbe6ad390648ec6303 /ucb | |
parent | f910280b8704ed9c289150a4ca3c8d60e15d0d97 (diff) |
new compilerplugin returnbyref
Find places where we are returning a pointer to something, where we can
be returning a reference.
e.g.
class A {
struct X x;
public X* getX() { return &x; }
}
which can be:
public X& getX() { return x; }
Change-Id: I796fd23fd36a18aedf6e36bc28f8fab4f518c6c7
Diffstat (limited to 'ucb')
-rw-r--r-- | ucb/source/sorter/sortresult.cxx | 10 | ||||
-rw-r--r-- | ucb/source/sorter/sortresult.hxx | 6 |
2 files changed, 8 insertions, 8 deletions
diff --git a/ucb/source/sorter/sortresult.cxx b/ucb/source/sorter/sortresult.cxx index eb35bb6ffbca..703b0aa62097 100644 --- a/ucb/source/sorter/sortresult.cxx +++ b/ucb/source/sorter/sortresult.cxx @@ -1347,8 +1347,8 @@ void SortedResultSet::PropertyChanged( const PropertyChangeEvent& rEvt ) void SortedResultSet::CopyData( SortedResultSet *pSource ) { - const SortedEntryList *pSrcS2O = pSource->GetS2OList(); - const SimpleList *pSrcO2S = pSource->GetO2SList(); + const SortedEntryList& rSrcS2O = pSource->GetS2OList(); + const SimpleList& rSrcO2S = pSource->GetO2SList(); sal_IntPtr i, nCount; @@ -1359,12 +1359,12 @@ void SortedResultSet::CopyData( SortedResultSet *pSource ) maS2O.Insert( NULL, 0 ); maO2S.Insert( 0, (sal_uInt32) 0 ); // value, pos - nCount = pSrcS2O->Count(); + nCount = rSrcS2O.Count(); for ( i=1; i<nCount; i++ ) { - maS2O.Insert( new SortListData( (*pSrcS2O)[ i ] ), i ); - maO2S.Insert( pSrcO2S->GetObject( i ), (sal_uInt32) i ); + maS2O.Insert( new SortListData( rSrcS2O[ i ] ), i ); + maO2S.Insert( rSrcO2S.GetObject( i ), (sal_uInt32) i ); } mnLastSort = maS2O.Count(); diff --git a/ucb/source/sorter/sortresult.hxx b/ucb/source/sorter/sortresult.hxx index 43c9f45772b7..7e51e7f9caec 100644 --- a/ucb/source/sorter/sortresult.hxx +++ b/ucb/source/sorter/sortresult.hxx @@ -167,11 +167,11 @@ public: SortedResultSet( css::uno::Reference< css::sdbc::XResultSet > aResult ); virtual ~SortedResultSet(); - const SortedEntryList* GetS2OList() const { return &maS2O; } - const SimpleList* GetO2SList() const { return &maO2S; } + const SortedEntryList& GetS2OList() const { return maS2O; } + const SimpleList& GetO2SList() const { return maO2S; } css::uno::Reference < css::sdbc::XResultSet > GetResultSet() const { return mxOriginal; } SortInfo* GetSortInfo() const { return mpSortInfo; } - sal_IntPtr GetCount() const { return mnCount; } + sal_IntPtr GetCount() const { return mnCount; } void CopyData( SortedResultSet* pSource ); void Initialize( const css::uno::Sequence < css::ucb::NumberedSortingInfo > &xSortInfo, |