From 94546ae88d26facac1809a47a89a1bff866694e6 Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Wed, 18 Jun 2014 10:21:13 +0200 Subject: rtl::Reference fits just fine here Change-Id: I354b546654e665607d9be0d65f6327fabb5694de --- reportdesign/inc/RptObject.hxx | 4 +-- reportdesign/source/core/inc/ReportEngineJFree.hxx | 4 +-- reportdesign/source/core/inc/Section.hxx | 4 +-- reportdesign/source/core/sdr/RptObject.cxx | 4 +-- reportdesign/source/ui/inc/ReportController.hxx | 1 - reportdesign/source/ui/inc/toolboxcontroller.hxx | 4 +-- reportdesign/source/ui/misc/toolboxcontroller.cxx | 39 ++++++++++------------ 7 files changed, 26 insertions(+), 34 deletions(-) (limited to 'reportdesign') diff --git a/reportdesign/inc/RptObject.hxx b/reportdesign/inc/RptObject.hxx index 443f53328870..d9c8ea449c98 100644 --- a/reportdesign/inc/RptObject.hxx +++ b/reportdesign/inc/RptObject.hxx @@ -32,8 +32,6 @@ #include #include #include -#include - namespace rptui { @@ -72,7 +70,7 @@ class OPropertyMediator; class REPORTDESIGN_DLLPUBLIC OObjectBase { public: - typedef ::comphelper::ImplementationReference TMediator; + typedef rtl::Reference TMediator; protected: mutable TMediator m_xMediator; diff --git a/reportdesign/source/core/inc/ReportEngineJFree.hxx b/reportdesign/source/core/inc/ReportEngineJFree.hxx index 3beeb25e19dd..62a03ddab358 100644 --- a/reportdesign/source/core/inc/ReportEngineJFree.hxx +++ b/reportdesign/source/core/inc/ReportEngineJFree.hxx @@ -32,8 +32,8 @@ #include #include #include -#include #include +#include namespace reportdesign { @@ -78,7 +78,7 @@ namespace reportdesign virtual ~OReportEngineJFree(); public: - typedef ::comphelper::ImplementationReference< OReportEngineJFree ,::com::sun::star::report::XReportEngine,::com::sun::star::uno::XWeak > TReportEngine; + typedef rtl::Reference TReportEngine; OReportEngineJFree(const com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >& context); diff --git a/reportdesign/source/core/inc/Section.hxx b/reportdesign/source/core/inc/Section.hxx index b0de3eccfdf0..0e115171a067 100644 --- a/reportdesign/source/core/inc/Section.hxx +++ b/reportdesign/source/core/inc/Section.hxx @@ -30,9 +30,9 @@ #include #include #include -#include #include #include +#include namespace reportdesign { @@ -127,7 +127,7 @@ namespace reportdesign virtual void SAL_CALL disposing() SAL_OVERRIDE; public: - typedef ::comphelper::ImplementationReference< OSection ,::com::sun::star::report::XSection,::com::sun::star::uno::XWeak > TSection; + typedef rtl::Reference TSection; private: OSection(const ::com::sun::star::uno::Reference< ::com::sun::star::report::XReportDefinition >& xParentDef diff --git a/reportdesign/source/core/sdr/RptObject.cxx b/reportdesign/source/core/sdr/RptObject.cxx index 6c2287c4e0dd..45ade69b10e7 100644 --- a/reportdesign/source/core/sdr/RptObject.cxx +++ b/reportdesign/source/core/sdr/RptObject.cxx @@ -324,7 +324,7 @@ OObjectBase::OObjectBase(const OUString& _sComponentName) OObjectBase::~OObjectBase() { - m_xMediator.reset(); + m_xMediator.clear(); if ( isListening() ) EndListening(); m_xReportComponent.clear(); @@ -898,7 +898,7 @@ void OUnoObject::CreateMediator(bool _bReverse) Reference xControlModel(GetUnoControlModel(),uno::UNO_QUERY); if ( !m_xMediator.is() && m_xReportComponent.is() && xControlModel.is() ) - m_xMediator = TMediator::createFromQuery(new OPropertyMediator(m_xReportComponent.get(),xControlModel,getPropertyNameMap(GetObjIdentifier()),_bReverse)); + m_xMediator = new OPropertyMediator(m_xReportComponent.get(),xControlModel,getPropertyNameMap(GetObjIdentifier()),_bReverse); OObjectBase::StartListening(); } } diff --git a/reportdesign/source/ui/inc/ReportController.hxx b/reportdesign/source/ui/inc/ReportController.hxx index fd69b2497713..8e9b426ad248 100644 --- a/reportdesign/source/ui/inc/ReportController.hxx +++ b/reportdesign/source/ui/inc/ReportController.hxx @@ -44,7 +44,6 @@ #include #include -#include #include #include #include diff --git a/reportdesign/source/ui/inc/toolboxcontroller.hxx b/reportdesign/source/ui/inc/toolboxcontroller.hxx index b005b42d193e..8127988d1eb4 100644 --- a/reportdesign/source/ui/inc/toolboxcontroller.hxx +++ b/reportdesign/source/ui/inc/toolboxcontroller.hxx @@ -23,19 +23,19 @@ #include +#include #include #include #include #include #include -#include class SfxToolBoxControl; namespace rptui { typedef ::cppu::ImplHelper2 < ::com::sun::star::lang::XServiceInfo, ::com::sun::star::frame::XSubToolbarController> TToolboxController_BASE; - typedef ::comphelper::ImplementationReference TToolbarHelper; + typedef rtl::Reference TToolbarHelper; class OToolboxController : public ::svt::ToolboxController ,public TToolboxController_BASE diff --git a/reportdesign/source/ui/misc/toolboxcontroller.cxx b/reportdesign/source/ui/misc/toolboxcontroller.cxx index 66335da45a22..18588de9ed36 100644 --- a/reportdesign/source/ui/misc/toolboxcontroller.cxx +++ b/reportdesign/source/ui/misc/toolboxcontroller.cxx @@ -143,48 +143,48 @@ void SAL_CALL OToolboxController::initialize( const Sequence< Any >& _rArguments if ( m_aCommandURL == ".uno:BasicShapes" ) { m_aStates.insert(TCommandState::value_type(OUString(".uno:BasicShapes"),sal_True)); - m_pToolbarController = TToolbarHelper::createFromQuery(new SvxTbxCtlCustomShapes(m_nSlotId = SID_DRAWTBX_CS_BASIC,m_nToolBoxId,*pToolBox)); + m_pToolbarController = new SvxTbxCtlCustomShapes(m_nSlotId = SID_DRAWTBX_CS_BASIC,m_nToolBoxId,*pToolBox); } else if ( m_aCommandURL == ".uno:SymbolShapes" ) { m_aStates.insert(TCommandState::value_type(OUString(".uno:SymbolShapes"),sal_True)); - m_pToolbarController = TToolbarHelper::createFromQuery(new SvxTbxCtlCustomShapes(m_nSlotId = SID_DRAWTBX_CS_SYMBOL,m_nToolBoxId,*pToolBox)); + m_pToolbarController = new SvxTbxCtlCustomShapes(m_nSlotId = SID_DRAWTBX_CS_SYMBOL,m_nToolBoxId,*pToolBox); } else if ( m_aCommandURL == ".uno:ArrowShapes" ) { m_aStates.insert(TCommandState::value_type(OUString(".uno:ArrowShapes"),sal_True)); - m_pToolbarController = TToolbarHelper::createFromQuery(new SvxTbxCtlCustomShapes(m_nSlotId = SID_DRAWTBX_CS_ARROW,m_nToolBoxId,*pToolBox)); + m_pToolbarController = new SvxTbxCtlCustomShapes(m_nSlotId = SID_DRAWTBX_CS_ARROW,m_nToolBoxId,*pToolBox); } else if ( m_aCommandURL == ".uno:FlowChartShapes" ) { m_aStates.insert(TCommandState::value_type(OUString(".uno:FlowChartShapes"),sal_True)); - m_pToolbarController = TToolbarHelper::createFromQuery(new SvxTbxCtlCustomShapes(m_nSlotId = SID_DRAWTBX_CS_FLOWCHART,m_nToolBoxId,*pToolBox)); + m_pToolbarController = new SvxTbxCtlCustomShapes(m_nSlotId = SID_DRAWTBX_CS_FLOWCHART,m_nToolBoxId,*pToolBox); } else if ( m_aCommandURL == ".uno:CalloutShapes" ) { m_aStates.insert(TCommandState::value_type(OUString(".uno:CalloutShapes"),sal_True)); - m_pToolbarController = TToolbarHelper::createFromQuery(new SvxTbxCtlCustomShapes(m_nSlotId = SID_DRAWTBX_CS_CALLOUT,m_nToolBoxId,*pToolBox)); + m_pToolbarController = new SvxTbxCtlCustomShapes(m_nSlotId = SID_DRAWTBX_CS_CALLOUT,m_nToolBoxId,*pToolBox); } else if ( m_aCommandURL == ".uno:StarShapes" ) { m_aStates.insert(TCommandState::value_type(OUString(".uno:StarShapes"),sal_True)); - m_pToolbarController = TToolbarHelper::createFromQuery(new SvxTbxCtlCustomShapes(m_nSlotId = SID_DRAWTBX_CS_STAR,m_nToolBoxId,*pToolBox)); + m_pToolbarController = new SvxTbxCtlCustomShapes(m_nSlotId = SID_DRAWTBX_CS_STAR,m_nToolBoxId,*pToolBox); } else if ( m_aCommandURL == ".uno:CharFontName" ) { m_aStates.insert(TCommandState::value_type(OUString(".uno:CharFontName"),sal_True)); - m_pToolbarController = TToolbarHelper::createFromQuery(new SvxFontNameToolBoxControl/*SvxStyleToolBoxControl*/(m_nSlotId = SID_ATTR_CHAR_FONT,m_nToolBoxId,*pToolBox)); + m_pToolbarController = new SvxFontNameToolBoxControl/*SvxStyleToolBoxControl*/(m_nSlotId = SID_ATTR_CHAR_FONT,m_nToolBoxId,*pToolBox); } else if ( m_aCommandURL == ".uno:FontColor" || m_aCommandURL == ".uno:Color" ) { m_aStates.insert(TCommandState::value_type(OUString(".uno:FontColor"),sal_True)); m_aStates.insert(TCommandState::value_type(OUString(".uno:Color"),sal_True)); - m_pToolbarController = TToolbarHelper::createFromQuery(new SvxColorToolBoxControl(m_nSlotId = SID_ATTR_CHAR_COLOR2,m_nToolBoxId,*pToolBox)); + m_pToolbarController = new SvxColorToolBoxControl(m_nSlotId = SID_ATTR_CHAR_COLOR2,m_nToolBoxId,*pToolBox); } else { m_aStates.insert(TCommandState::value_type(OUString(".uno:BackgroundColor"),sal_True)); - m_pToolbarController = TToolbarHelper::createFromQuery(new SvxColorToolBoxControl(m_nSlotId = SID_BACKGROUND_COLOR,m_nToolBoxId,*pToolBox)); + m_pToolbarController = new SvxColorToolBoxControl(m_nSlotId = SID_BACKGROUND_COLOR,m_nToolBoxId,*pToolBox); } TCommandState::iterator aIter = m_aStates.begin(); @@ -271,7 +271,7 @@ Reference< awt::XWindow > SAL_CALL OToolboxController::createPopupWindow() throw Reference< awt::XWindow > xRet; if ( m_pToolbarController.is() ) - xRet = m_pToolbarController.getRef()->createPopupWindow(); + xRet = m_pToolbarController->createPopupWindow(); return xRet; } @@ -279,7 +279,7 @@ Reference< awt::XWindow > SAL_CALL OToolboxController::createPopupWindow() throw void SAL_CALL OToolboxController::execute( sal_Int16 KeyModifier ) throw (uno::RuntimeException, std::exception) { if ( m_pToolbarController.is() ) - m_pToolbarController.getRef()->execute( KeyModifier ); + m_pToolbarController->execute( KeyModifier ); } sal_Bool SAL_CALL OToolboxController::opensSubToolbar() throw (uno::RuntimeException, std::exception) @@ -296,9 +296,8 @@ OUString SAL_CALL OToolboxController::getSubToolbarName() throw (uno::RuntimeExc { SolarMutexGuard aSolarMutexGuard; ::osl::MutexGuard aGuard(m_aMutex); - uno::Reference< frame::XSubToolbarController> xSub(m_pToolbarController.getRef(),uno::UNO_QUERY); - if ( xSub.is() ) - return xSub->getSubToolbarName(); + if ( m_pToolbarController.is() ) + return m_pToolbarController->getSubToolbarName(); return OUString(); } @@ -306,11 +305,9 @@ void SAL_CALL OToolboxController::functionSelected( const OUString& rCommand ) t { SolarMutexGuard aSolarMutexGuard; ::osl::MutexGuard aGuard(m_aMutex); - - uno::Reference< frame::XSubToolbarController> xSub(m_pToolbarController.getRef(),uno::UNO_QUERY); - if ( xSub.is() ) + if ( m_pToolbarController.is() ) { - xSub->functionSelected(m_aCommandURL = rCommand); + m_pToolbarController->functionSelected(m_aCommandURL = rCommand); } } @@ -318,10 +315,8 @@ void SAL_CALL OToolboxController::updateImage( ) throw (uno::RuntimeException, { SolarMutexGuard aSolarMutexGuard; ::osl::MutexGuard aGuard(m_aMutex); - - uno::Reference< frame::XSubToolbarController> xSub(m_pToolbarController.getRef(),uno::UNO_QUERY); - if ( xSub.is() ) - xSub->updateImage(); + if ( m_pToolbarController.is() ) + m_pToolbarController->updateImage(); } uno::Reference< awt::XWindow > SAL_CALL OToolboxController::createItemWindow( const uno::Reference< awt::XWindow >& _xParent) -- cgit