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 /include | |
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 'include')
-rw-r--r-- | include/basic/sbxvar.hxx | 2 | ||||
-rw-r--r-- | include/codemaker/exceptiontree.hxx | 4 | ||||
-rw-r--r-- | include/comphelper/propertysetinfo.hxx | 2 | ||||
-rw-r--r-- | include/editeng/unoipset.hxx | 2 | ||||
-rw-r--r-- | include/svx/charmap.hxx | 2 | ||||
-rw-r--r-- | include/vcl/openglwin.hxx | 2 |
6 files changed, 7 insertions, 7 deletions
diff --git a/include/basic/sbxvar.hxx b/include/basic/sbxvar.hxx index 1c84f11ba805..2ae113073f3e 100644 --- a/include/basic/sbxvar.hxx +++ b/include/basic/sbxvar.hxx @@ -144,7 +144,7 @@ public: const SbxValues& GetValues_Impl() const { return aData; } virtual bool Put( const SbxValues& ); - inline SbxValues * data() { return &aData; } + inline SbxValues& data() { return aData; } sal_Unicode GetChar() const; sal_Int16 GetInteger() const; diff --git a/include/codemaker/exceptiontree.hxx b/include/codemaker/exceptiontree.hxx index ab395c68be17..2e4795c5f020 100644 --- a/include/codemaker/exceptiontree.hxx +++ b/include/codemaker/exceptiontree.hxx @@ -100,11 +100,11 @@ public: /** Gives access to the resultant exception hierarchy. - @return a non-null pointer to the root of the exception hierarchy, as + @return a reference to the root of the exception hierarchy, as formed by all previous calls to add; it is an error if any calls to add follow the first call to getRoot */ - ExceptionTreeNode const * getRoot() const { return &m_root; } + ExceptionTreeNode const & getRoot() const { return m_root; } private: ExceptionTree(ExceptionTree &); // not implemented diff --git a/include/comphelper/propertysetinfo.hxx b/include/comphelper/propertysetinfo.hxx index 4676875d83a8..8b89fc3c42c8 100644 --- a/include/comphelper/propertysetinfo.hxx +++ b/include/comphelper/propertysetinfo.hxx @@ -65,7 +65,7 @@ public: /** returns a stl map with all PropertyMapEntry pointer.<p> The key is the property name. */ - const PropertyMap* getPropertyMap() const throw(); + const PropertyMap& getPropertyMap() const throw(); /** adds an array of PropertyMapEntry to this instance.<p> The end is marked with a PropertyMapEntry where mpName equals NULL</p> diff --git a/include/editeng/unoipset.hxx b/include/editeng/unoipset.hxx index 01b8c0e2ca80..ffaa38c4a5fb 100644 --- a/include/editeng/unoipset.hxx +++ b/include/editeng/unoipset.hxx @@ -61,7 +61,7 @@ public: com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > getPropertySetInfo() const; const SfxItemPropertyMapEntry* getPropertyMapEntries() const {return _pMap;} - const SfxItemPropertyMap* getPropertyMap()const { return &m_aPropertyMap;} + const SfxItemPropertyMap& getPropertyMap()const { return m_aPropertyMap;} const SfxItemPropertySimpleEntry* getPropertyMapEntry(const OUString &rName) const; static com::sun::star::uno::Reference< com::sun::star::beans::XPropertySetInfo > getPropertySetInfo( const SfxItemPropertyMapEntry* pMap ); diff --git a/include/svx/charmap.hxx b/include/svx/charmap.hxx index 53d78124c30a..d9335fa8c197 100644 --- a/include/svx/charmap.hxx +++ b/include/svx/charmap.hxx @@ -72,7 +72,7 @@ public: sal_uInt16 GetRowPos(sal_uInt16 _nPos) const; sal_uInt16 GetColumnPos(sal_uInt16 _nPos) const; - ScrollBar* getScrollBar() { return &aVscrollSB;} + ScrollBar& getScrollBar() { return aVscrollSB;} void ReleaseAccessible(); sal_Int32 getMaxCharCount() const; diff --git a/include/vcl/openglwin.hxx b/include/vcl/openglwin.hxx index 50d564c177fa..1419dda33e2f 100644 --- a/include/vcl/openglwin.hxx +++ b/include/vcl/openglwin.hxx @@ -37,7 +37,7 @@ class VCLOPENGL_DLLPUBLIC OpenGLWindow : public Window public: OpenGLWindow(Window* pParent); virtual ~OpenGLWindow(); - OpenGLContext* getContext(); + OpenGLContext& getContext(); void setRenderer(IRenderer* pRenderer); |