Kaydet (Commit) 94546ae8 authored tarafından Stephan Bergmann's avatar Stephan Bergmann

rtl::Reference fits just fine here

Change-Id: I354b546654e665607d9be0d65f6327fabb5694de
üst 32694db4
...@@ -32,8 +32,6 @@ ...@@ -32,8 +32,6 @@
#include <svx/svdocirc.hxx> #include <svx/svdocirc.hxx>
#include <svx/svdogrp.hxx> #include <svx/svdogrp.hxx>
#include <svx/svdoashp.hxx> #include <svx/svdoashp.hxx>
#include <comphelper/implementationreference.hxx>
namespace rptui namespace rptui
{ {
...@@ -72,7 +70,7 @@ class OPropertyMediator; ...@@ -72,7 +70,7 @@ class OPropertyMediator;
class REPORTDESIGN_DLLPUBLIC OObjectBase class REPORTDESIGN_DLLPUBLIC OObjectBase
{ {
public: public:
typedef ::comphelper::ImplementationReference<OPropertyMediator,::com::sun::star::beans::XPropertyChangeListener> TMediator; typedef rtl::Reference<OPropertyMediator> TMediator;
protected: protected:
mutable TMediator m_xMediator; mutable TMediator m_xMediator;
......
...@@ -32,8 +32,8 @@ ...@@ -32,8 +32,8 @@
#include <com/sun/star/uno/XComponentContext.hpp> #include <com/sun/star/uno/XComponentContext.hpp>
#include <com/sun/star/sdbc/XRowSet.hpp> #include <com/sun/star/sdbc/XRowSet.hpp>
#include <comphelper/stl_types.hxx> #include <comphelper/stl_types.hxx>
#include <comphelper/implementationreference.hxx>
#include <com/sun/star/lang/XServiceInfo.hpp> #include <com/sun/star/lang/XServiceInfo.hpp>
#include <rtl/ref.hxx>
namespace reportdesign namespace reportdesign
{ {
...@@ -78,7 +78,7 @@ namespace reportdesign ...@@ -78,7 +78,7 @@ namespace reportdesign
virtual ~OReportEngineJFree(); virtual ~OReportEngineJFree();
public: public:
typedef ::comphelper::ImplementationReference< OReportEngineJFree ,::com::sun::star::report::XReportEngine,::com::sun::star::uno::XWeak > TReportEngine; typedef rtl::Reference<OReportEngineJFree> TReportEngine;
OReportEngineJFree(const com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >& context); OReportEngineJFree(const com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >& context);
......
...@@ -30,9 +30,9 @@ ...@@ -30,9 +30,9 @@
#include <com/sun/star/drawing/XShapeGrouper.hpp> #include <com/sun/star/drawing/XShapeGrouper.hpp>
#include <com/sun/star/drawing/XShapes.hpp> #include <com/sun/star/drawing/XShapes.hpp>
#include <com/sun/star/form/XFormsSupplier2.hpp> #include <com/sun/star/form/XFormsSupplier2.hpp>
#include <comphelper/implementationreference.hxx>
#include <com/sun/star/lang/XUnoTunnel.hpp> #include <com/sun/star/lang/XUnoTunnel.hpp>
#include <com/sun/star/lang/XServiceInfo.hpp> #include <com/sun/star/lang/XServiceInfo.hpp>
#include <rtl/ref.hxx>
namespace reportdesign namespace reportdesign
{ {
...@@ -127,7 +127,7 @@ namespace reportdesign ...@@ -127,7 +127,7 @@ namespace reportdesign
virtual void SAL_CALL disposing() SAL_OVERRIDE; virtual void SAL_CALL disposing() SAL_OVERRIDE;
public: public:
typedef ::comphelper::ImplementationReference< OSection ,::com::sun::star::report::XSection,::com::sun::star::uno::XWeak > TSection; typedef rtl::Reference<OSection> TSection;
private: private:
OSection(const ::com::sun::star::uno::Reference< ::com::sun::star::report::XReportDefinition >& xParentDef OSection(const ::com::sun::star::uno::Reference< ::com::sun::star::report::XReportDefinition >& xParentDef
......
...@@ -324,7 +324,7 @@ OObjectBase::OObjectBase(const OUString& _sComponentName) ...@@ -324,7 +324,7 @@ OObjectBase::OObjectBase(const OUString& _sComponentName)
OObjectBase::~OObjectBase() OObjectBase::~OObjectBase()
{ {
m_xMediator.reset(); m_xMediator.clear();
if ( isListening() ) if ( isListening() )
EndListening(); EndListening();
m_xReportComponent.clear(); m_xReportComponent.clear();
...@@ -898,7 +898,7 @@ void OUnoObject::CreateMediator(bool _bReverse) ...@@ -898,7 +898,7 @@ void OUnoObject::CreateMediator(bool _bReverse)
Reference<XPropertySet> xControlModel(GetUnoControlModel(),uno::UNO_QUERY); Reference<XPropertySet> xControlModel(GetUnoControlModel(),uno::UNO_QUERY);
if ( !m_xMediator.is() && m_xReportComponent.is() && xControlModel.is() ) 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(); OObjectBase::StartListening();
} }
} }
......
...@@ -44,7 +44,6 @@ ...@@ -44,7 +44,6 @@
#include <com/sun/star/util/XNumberFormatter.hpp> #include <com/sun/star/util/XNumberFormatter.hpp>
#include <com/sun/star/view/XSelectionSupplier.hpp> #include <com/sun/star/view/XSelectionSupplier.hpp>
#include <comphelper/implementationreference.hxx>
#include <comphelper/proparrhlp.hxx> #include <comphelper/proparrhlp.hxx>
#include <comphelper/propertystatecontainer.hxx> #include <comphelper/propertystatecontainer.hxx>
#include <comphelper/uno3.hxx> #include <comphelper/uno3.hxx>
......
...@@ -23,19 +23,19 @@ ...@@ -23,19 +23,19 @@
#include <map> #include <map>
#include <rtl/ref.hxx>
#include <svtools/toolboxcontroller.hxx> #include <svtools/toolboxcontroller.hxx>
#include <com/sun/star/lang/XServiceInfo.hpp> #include <com/sun/star/lang/XServiceInfo.hpp>
#include <com/sun/star/uno/XComponentContext.hpp> #include <com/sun/star/uno/XComponentContext.hpp>
#include <com/sun/star/frame/XSubToolbarController.hpp> #include <com/sun/star/frame/XSubToolbarController.hpp>
#include <cppuhelper/implbase2.hxx> #include <cppuhelper/implbase2.hxx>
#include <comphelper/implementationreference.hxx>
class SfxToolBoxControl; class SfxToolBoxControl;
namespace rptui namespace rptui
{ {
typedef ::cppu::ImplHelper2 < ::com::sun::star::lang::XServiceInfo, typedef ::cppu::ImplHelper2 < ::com::sun::star::lang::XServiceInfo,
::com::sun::star::frame::XSubToolbarController> TToolboxController_BASE; ::com::sun::star::frame::XSubToolbarController> TToolboxController_BASE;
typedef ::comphelper::ImplementationReference<SfxToolBoxControl,::com::sun::star::frame::XToolbarController> TToolbarHelper; typedef rtl::Reference<SfxToolBoxControl> TToolbarHelper;
class OToolboxController : public ::svt::ToolboxController class OToolboxController : public ::svt::ToolboxController
,public TToolboxController_BASE ,public TToolboxController_BASE
......
...@@ -143,48 +143,48 @@ void SAL_CALL OToolboxController::initialize( const Sequence< Any >& _rArguments ...@@ -143,48 +143,48 @@ void SAL_CALL OToolboxController::initialize( const Sequence< Any >& _rArguments
if ( m_aCommandURL == ".uno:BasicShapes" ) if ( m_aCommandURL == ".uno:BasicShapes" )
{ {
m_aStates.insert(TCommandState::value_type(OUString(".uno:BasicShapes"),sal_True)); 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" ) else if ( m_aCommandURL == ".uno:SymbolShapes" )
{ {
m_aStates.insert(TCommandState::value_type(OUString(".uno:SymbolShapes"),sal_True)); 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" ) else if ( m_aCommandURL == ".uno:ArrowShapes" )
{ {
m_aStates.insert(TCommandState::value_type(OUString(".uno:ArrowShapes"),sal_True)); 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" ) else if ( m_aCommandURL == ".uno:FlowChartShapes" )
{ {
m_aStates.insert(TCommandState::value_type(OUString(".uno:FlowChartShapes"),sal_True)); 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" ) else if ( m_aCommandURL == ".uno:CalloutShapes" )
{ {
m_aStates.insert(TCommandState::value_type(OUString(".uno:CalloutShapes"),sal_True)); 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" ) else if ( m_aCommandURL == ".uno:StarShapes" )
{ {
m_aStates.insert(TCommandState::value_type(OUString(".uno:StarShapes"),sal_True)); 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" ) else if ( m_aCommandURL == ".uno:CharFontName" )
{ {
m_aStates.insert(TCommandState::value_type(OUString(".uno:CharFontName"),sal_True)); 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" ) 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:FontColor"),sal_True));
m_aStates.insert(TCommandState::value_type(OUString(".uno:Color"),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 else
{ {
m_aStates.insert(TCommandState::value_type(OUString(".uno:BackgroundColor"),sal_True)); 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(); TCommandState::iterator aIter = m_aStates.begin();
...@@ -271,7 +271,7 @@ Reference< awt::XWindow > SAL_CALL OToolboxController::createPopupWindow() throw ...@@ -271,7 +271,7 @@ Reference< awt::XWindow > SAL_CALL OToolboxController::createPopupWindow() throw
Reference< awt::XWindow > xRet; Reference< awt::XWindow > xRet;
if ( m_pToolbarController.is() ) if ( m_pToolbarController.is() )
xRet = m_pToolbarController.getRef()->createPopupWindow(); xRet = m_pToolbarController->createPopupWindow();
return xRet; return xRet;
} }
...@@ -279,7 +279,7 @@ Reference< awt::XWindow > SAL_CALL OToolboxController::createPopupWindow() throw ...@@ -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) void SAL_CALL OToolboxController::execute( sal_Int16 KeyModifier ) throw (uno::RuntimeException, std::exception)
{ {
if ( m_pToolbarController.is() ) if ( m_pToolbarController.is() )
m_pToolbarController.getRef()->execute( KeyModifier ); m_pToolbarController->execute( KeyModifier );
} }
sal_Bool SAL_CALL OToolboxController::opensSubToolbar() throw (uno::RuntimeException, std::exception) sal_Bool SAL_CALL OToolboxController::opensSubToolbar() throw (uno::RuntimeException, std::exception)
...@@ -296,9 +296,8 @@ OUString SAL_CALL OToolboxController::getSubToolbarName() throw (uno::RuntimeExc ...@@ -296,9 +296,8 @@ OUString SAL_CALL OToolboxController::getSubToolbarName() throw (uno::RuntimeExc
{ {
SolarMutexGuard aSolarMutexGuard; SolarMutexGuard aSolarMutexGuard;
::osl::MutexGuard aGuard(m_aMutex); ::osl::MutexGuard aGuard(m_aMutex);
uno::Reference< frame::XSubToolbarController> xSub(m_pToolbarController.getRef(),uno::UNO_QUERY); if ( m_pToolbarController.is() )
if ( xSub.is() ) return m_pToolbarController->getSubToolbarName();
return xSub->getSubToolbarName();
return OUString(); return OUString();
} }
...@@ -306,11 +305,9 @@ void SAL_CALL OToolboxController::functionSelected( const OUString& rCommand ) t ...@@ -306,11 +305,9 @@ void SAL_CALL OToolboxController::functionSelected( const OUString& rCommand ) t
{ {
SolarMutexGuard aSolarMutexGuard; SolarMutexGuard aSolarMutexGuard;
::osl::MutexGuard aGuard(m_aMutex); ::osl::MutexGuard aGuard(m_aMutex);
if ( m_pToolbarController.is() )
uno::Reference< frame::XSubToolbarController> xSub(m_pToolbarController.getRef(),uno::UNO_QUERY);
if ( xSub.is() )
{ {
xSub->functionSelected(m_aCommandURL = rCommand); m_pToolbarController->functionSelected(m_aCommandURL = rCommand);
} }
} }
...@@ -318,10 +315,8 @@ void SAL_CALL OToolboxController::updateImage( ) throw (uno::RuntimeException, ...@@ -318,10 +315,8 @@ void SAL_CALL OToolboxController::updateImage( ) throw (uno::RuntimeException,
{ {
SolarMutexGuard aSolarMutexGuard; SolarMutexGuard aSolarMutexGuard;
::osl::MutexGuard aGuard(m_aMutex); ::osl::MutexGuard aGuard(m_aMutex);
if ( m_pToolbarController.is() )
uno::Reference< frame::XSubToolbarController> xSub(m_pToolbarController.getRef(),uno::UNO_QUERY); m_pToolbarController->updateImage();
if ( xSub.is() )
xSub->updateImage();
} }
uno::Reference< awt::XWindow > SAL_CALL OToolboxController::createItemWindow( const uno::Reference< awt::XWindow >& _xParent) uno::Reference< awt::XWindow > SAL_CALL OToolboxController::createItemWindow( const uno::Reference< awt::XWindow >& _xParent)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment