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 /xmlscript/source | |
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 'xmlscript/source')
-rw-r--r-- | xmlscript/source/xmldlg_imexp/imp_share.hxx | 4 | ||||
-rw-r--r-- | xmlscript/source/xmldlg_imexp/xmldlg_impmodels.cxx | 12 |
2 files changed, 8 insertions, 8 deletions
diff --git a/xmlscript/source/xmldlg_imexp/imp_share.hxx b/xmlscript/source/xmldlg_imexp/imp_share.hxx index ec9d7b46f8f4..0d097ac36be1 100644 --- a/xmlscript/source/xmldlg_imexp/imp_share.hxx +++ b/xmlscript/source/xmldlg_imexp/imp_share.hxx @@ -366,8 +366,8 @@ protected: css::uno::Reference< css::xml::input::XElement > getStyle( css::uno::Reference<css::xml::input::XAttributes> const & xAttributes ); public: - ::std::vector<css::uno::Reference< css::xml::input::XElement> > *getEvents() - { return &_events; } + ::std::vector<css::uno::Reference< css::xml::input::XElement> >& getEvents() + { return _events; } ControlElement( OUString const & rLocalName, diff --git a/xmlscript/source/xmldlg_imexp/xmldlg_impmodels.cxx b/xmlscript/source/xmldlg_imexp/xmldlg_impmodels.cxx index d7e563448c4f..cabfb297d687 100644 --- a/xmlscript/source/xmldlg_imexp/xmldlg_impmodels.cxx +++ b/xmlscript/source/xmldlg_imexp/xmldlg_impmodels.cxx @@ -1184,12 +1184,12 @@ void TitledBoxElement::endElement() } xControlModel->setPropertyValue( "State", makeAny( nVal ) ); ctx.importDataAwareProperty( "linked-cell" , xAttributes ); - ::std::vector< Reference< xml::input::XElement > > * radioEvents = + ::std::vector< Reference< xml::input::XElement > > & radioEvents = static_cast< RadioElement * >( xRadio.get() )->getEvents(); - ctx.importEvents( *radioEvents ); + ctx.importEvents( radioEvents ); // avoid ring-reference: // vector< event elements > holding event elements holding this (via _pParent) - radioEvents->clear(); + radioEvents.clear(); } // avoid ring-reference: // vector< radio elements > holding radio elements holding this (via _pParent) @@ -1280,12 +1280,12 @@ void RadioGroupElement::endElement() ctx.importDataAwareProperty( "linked-cell", xAttributes ); - ::std::vector< Reference< xml::input::XElement > > * radioEvents = + ::std::vector< Reference< xml::input::XElement > > & radioEvents = static_cast< RadioElement * >( xRadio.get() )->getEvents(); - ctx.importEvents( *radioEvents ); + ctx.importEvents( radioEvents ); // avoid ring-reference: // vector< event elements > holding event elements holding this (via _pParent) - radioEvents->clear(); + radioEvents.clear(); } // avoid ring-reference: // vector< radio elements > holding radio elements holding this (via _pParent) |