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

rtl::Reference fits just fine here

Change-Id: I65499ac299fb474e581245c5237a0b184f1f2b60
üst 0b978f24
...@@ -126,37 +126,37 @@ void ShapeToolbarController::initialize( const Sequence< uno::Any >& rArguments ...@@ -126,37 +126,37 @@ void ShapeToolbarController::initialize( const Sequence< uno::Any >& rArguments
{ {
m_aStates.insert( TCommandState::value_type( ".uno:BasicShapes", sal_True ) ); m_aStates.insert( TCommandState::value_type( ".uno:BasicShapes", sal_True ) );
m_nSlotId = SID_DRAWTBX_CS_BASIC; m_nSlotId = SID_DRAWTBX_CS_BASIC;
m_pToolbarController = TToolbarHelper::createFromQuery( new SvxTbxCtlCustomShapes( m_nSlotId, m_nToolBoxId, *pToolBox ) ); m_pToolbarController = new SvxTbxCtlCustomShapes( m_nSlotId, m_nToolBoxId, *pToolBox );
} }
else if ( m_aCommandURL == ".uno:SymbolShapes" ) else if ( m_aCommandURL == ".uno:SymbolShapes" )
{ {
m_aStates.insert( TCommandState::value_type( ".uno:SymbolShapes", sal_True ) ); m_aStates.insert( TCommandState::value_type( ".uno:SymbolShapes", sal_True ) );
m_nSlotId = SID_DRAWTBX_CS_SYMBOL; m_nSlotId = SID_DRAWTBX_CS_SYMBOL;
m_pToolbarController = TToolbarHelper::createFromQuery( new SvxTbxCtlCustomShapes( m_nSlotId, m_nToolBoxId, *pToolBox ) ); m_pToolbarController = new SvxTbxCtlCustomShapes( m_nSlotId, m_nToolBoxId, *pToolBox );
} }
else if ( m_aCommandURL == ".uno:ArrowShapes" ) else if ( m_aCommandURL == ".uno:ArrowShapes" )
{ {
m_aStates.insert( TCommandState::value_type( ".uno:ArrowShapes", sal_True ) ); m_aStates.insert( TCommandState::value_type( ".uno:ArrowShapes", sal_True ) );
m_nSlotId = SID_DRAWTBX_CS_ARROW; m_nSlotId = SID_DRAWTBX_CS_ARROW;
m_pToolbarController = TToolbarHelper::createFromQuery( new SvxTbxCtlCustomShapes( m_nSlotId, m_nToolBoxId, *pToolBox) ); m_pToolbarController = new SvxTbxCtlCustomShapes( m_nSlotId, m_nToolBoxId, *pToolBox);
} }
else if ( m_aCommandURL == ".uno:FlowChartShapes" ) else if ( m_aCommandURL == ".uno:FlowChartShapes" )
{ {
m_aStates.insert( TCommandState::value_type( ".uno:FlowChartShapes", sal_True ) ); m_aStates.insert( TCommandState::value_type( ".uno:FlowChartShapes", sal_True ) );
m_nSlotId = SID_DRAWTBX_CS_FLOWCHART; m_nSlotId = SID_DRAWTBX_CS_FLOWCHART;
m_pToolbarController = TToolbarHelper::createFromQuery( new SvxTbxCtlCustomShapes( m_nSlotId, m_nToolBoxId, *pToolBox ) ); m_pToolbarController = new SvxTbxCtlCustomShapes( m_nSlotId, m_nToolBoxId, *pToolBox );
} }
else if ( m_aCommandURL == ".uno:CalloutShapes" ) else if ( m_aCommandURL == ".uno:CalloutShapes" )
{ {
m_aStates.insert( TCommandState::value_type( ".uno:CalloutShapes", sal_True ) ); m_aStates.insert( TCommandState::value_type( ".uno:CalloutShapes", sal_True ) );
m_nSlotId = SID_DRAWTBX_CS_CALLOUT; m_nSlotId = SID_DRAWTBX_CS_CALLOUT;
m_pToolbarController = TToolbarHelper::createFromQuery( new SvxTbxCtlCustomShapes( m_nSlotId, m_nToolBoxId, *pToolBox ) ); m_pToolbarController = new SvxTbxCtlCustomShapes( m_nSlotId, m_nToolBoxId, *pToolBox );
} }
else if ( m_aCommandURL == ".uno:StarShapes" ) else if ( m_aCommandURL == ".uno:StarShapes" )
{ {
m_aStates.insert( TCommandState::value_type( ".uno:StarShapes" , sal_True ) ); m_aStates.insert( TCommandState::value_type( ".uno:StarShapes" , sal_True ) );
m_nSlotId = SID_DRAWTBX_CS_STAR; m_nSlotId = SID_DRAWTBX_CS_STAR;
m_pToolbarController = TToolbarHelper::createFromQuery( new SvxTbxCtlCustomShapes( m_nSlotId, m_nToolBoxId, *pToolBox ) ); m_pToolbarController = new SvxTbxCtlCustomShapes( m_nSlotId, m_nToolBoxId, *pToolBox );
} }
for ( TCommandState::iterator aIter( m_aStates.begin() ); aIter != m_aStates.end(); ++aIter ) for ( TCommandState::iterator aIter( m_aStates.begin() ); aIter != m_aStates.end(); ++aIter )
...@@ -225,7 +225,7 @@ Reference< awt::XWindow > ShapeToolbarController::createPopupWindow() throw (uno ...@@ -225,7 +225,7 @@ Reference< awt::XWindow > ShapeToolbarController::createPopupWindow() throw (uno
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;
...@@ -254,10 +254,9 @@ OUString ShapeToolbarController::getSubToolbarName() throw (uno::RuntimeExceptio ...@@ -254,10 +254,9 @@ OUString ShapeToolbarController::getSubToolbarName() throw (uno::RuntimeExceptio
{ {
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 xSub->getSubToolbarName(); return m_pToolbarController->getSubToolbarName();
} }
return OUString(); return OUString();
} }
...@@ -266,12 +265,10 @@ void ShapeToolbarController::functionSelected( const OUString& rCommand ) throw ...@@ -266,12 +265,10 @@ void ShapeToolbarController::functionSelected( const OUString& rCommand ) throw
{ {
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() )
{ {
m_aCommandURL = rCommand; m_aCommandURL = rCommand;
xSub->functionSelected( rCommand ); m_pToolbarController->functionSelected( rCommand );
} }
} }
...@@ -279,11 +276,9 @@ void ShapeToolbarController::updateImage() throw (uno::RuntimeException, std::ex ...@@ -279,11 +276,9 @@ void ShapeToolbarController::updateImage() throw (uno::RuntimeException, std::ex
{ {
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->updateImage(); m_pToolbarController->updateImage();
} }
} }
......
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
#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> #include <rtl/ref.hxx>
#include <svtools/toolboxcontroller.hxx> #include <svtools/toolboxcontroller.hxx>
class SfxToolBoxControl; class SfxToolBoxControl;
...@@ -39,7 +39,7 @@ namespace chart ...@@ -39,7 +39,7 @@ namespace chart
typedef ::cppu::ImplHelper2 < ::com::sun::star::lang::XServiceInfo, typedef ::cppu::ImplHelper2 < ::com::sun::star::lang::XServiceInfo,
::com::sun::star::frame::XSubToolbarController> ShapeToolbarController_Base; ::com::sun::star::frame::XSubToolbarController> ShapeToolbarController_Base;
typedef ::comphelper::ImplementationReference< SfxToolBoxControl, ::com::sun::star::frame::XToolbarController > TToolbarHelper; typedef rtl::Reference<SfxToolBoxControl> TToolbarHelper;
class ShapeToolbarController : public ::svt::ToolboxController class ShapeToolbarController : public ::svt::ToolboxController
,public ShapeToolbarController_Base ,public ShapeToolbarController_Base
......
...@@ -26,7 +26,6 @@ ...@@ -26,7 +26,6 @@
#include "chartview/ExplicitScaleValues.hxx" #include "chartview/ExplicitScaleValues.hxx"
#include <com/sun/star/chart2/XCoordinateSystem.hpp> #include <com/sun/star/chart2/XCoordinateSystem.hpp>
#include "comphelper/implementationreference.hxx"
#include <com/sun/star/awt/Rectangle.hpp> #include <com/sun/star/awt/Rectangle.hpp>
#include <com/sun/star/drawing/HomogenMatrix.hpp> #include <com/sun/star/drawing/HomogenMatrix.hpp>
#include <com/sun/star/drawing/XShapes.hpp> #include <com/sun/star/drawing/XShapes.hpp>
......
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