Related: #i121442# Adapt existing code in other modules
(cherry picked from commit 6c640ee420df6f7c9f3ab981e49ee304f1d2319e) Conflicts: reportdesign/source/ui/misc/statusbarcontroller.cxx sfx2/inc/sfx2/stbitem.hxx svtools/inc/svtools/statusbarcontroller.hxx svtools/source/uno/statusbarcontroller.cxx Change-Id: If03a201214a4afe09efa4e3e996aded9b6a57bdf
This commit is contained in:
committed by
Caolán McNamara
parent
cfaac477e2
commit
25ec90bfa8
@@ -90,10 +90,10 @@ protected:
|
|||||||
::sal_Bool bMouseEvent,
|
::sal_Bool bMouseEvent,
|
||||||
const ::com::sun::star::uno::Any& aData ) throw (::com::sun::star::uno::RuntimeException);
|
const ::com::sun::star::uno::Any& aData ) throw (::com::sun::star::uno::RuntimeException);
|
||||||
virtual void SAL_CALL paint( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XGraphics >& xGraphics,
|
virtual void SAL_CALL paint( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XGraphics >& xGraphics,
|
||||||
const ::com::sun::star::awt::Rectangle& rOutputRectangle,
|
const ::com::sun::star::awt::Rectangle& rOutputRectangle,
|
||||||
::sal_Int32 nItemId, ::sal_Int32 nStyle ) throw (::com::sun::star::uno::RuntimeException);
|
::sal_Int32 nStyle ) throw (::com::sun::star::uno::RuntimeException);
|
||||||
virtual void SAL_CALL click() throw (::com::sun::star::uno::RuntimeException);
|
virtual void SAL_CALL click( const ::com::sun::star::awt::Point& aPos ) throw (::com::sun::star::uno::RuntimeException);
|
||||||
virtual void SAL_CALL doubleClick() throw (::com::sun::star::uno::RuntimeException);
|
virtual void SAL_CALL doubleClick( const ::com::sun::star::awt::Point& aPos ) throw (::com::sun::star::uno::RuntimeException);
|
||||||
|
|
||||||
// Old sfx2 interface
|
// Old sfx2 interface
|
||||||
virtual void StateChanged( sal_uInt16 nSID, SfxItemState eState,
|
virtual void StateChanged( sal_uInt16 nSID, SfxItemState eState,
|
||||||
|
@@ -21,12 +21,10 @@
|
|||||||
#define _SVTOOLS_STATUSBARCONTROLLER_HXX
|
#define _SVTOOLS_STATUSBARCONTROLLER_HXX
|
||||||
|
|
||||||
#include "svtools/svtdllapi.h"
|
#include "svtools/svtdllapi.h"
|
||||||
|
#include <com/sun/star/ui/XStatusbarItem.hpp>
|
||||||
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
|
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
|
||||||
#include <com/sun/star/lang/XInitialization.hpp>
|
|
||||||
#include <com/sun/star/util/XUpdatable.hpp>
|
|
||||||
#include <com/sun/star/frame/XFrame.hpp>
|
#include <com/sun/star/frame/XFrame.hpp>
|
||||||
#include <com/sun/star/frame/XDispatch.hpp>
|
#include <com/sun/star/frame/XDispatch.hpp>
|
||||||
#include <com/sun/star/frame/XStatusListener.hpp>
|
|
||||||
#include <com/sun/star/frame/XStatusbarController.hpp>
|
#include <com/sun/star/frame/XStatusbarController.hpp>
|
||||||
#include <com/sun/star/util/XURLTransformer.hpp>
|
#include <com/sun/star/util/XURLTransformer.hpp>
|
||||||
#include <com/sun/star/frame/XLayoutManager.hpp>
|
#include <com/sun/star/frame/XLayoutManager.hpp>
|
||||||
@@ -41,10 +39,8 @@
|
|||||||
namespace svt
|
namespace svt
|
||||||
{
|
{
|
||||||
|
|
||||||
class SVT_DLLPUBLIC StatusbarController : public ::com::sun::star::frame::XStatusListener,
|
class SVT_DLLPUBLIC StatusbarController :
|
||||||
public ::com::sun::star::frame::XStatusbarController,
|
public ::com::sun::star::frame::XStatusbarController,
|
||||||
public ::com::sun::star::lang::XInitialization,
|
|
||||||
public ::com::sun::star::util::XUpdatable,
|
|
||||||
public ::com::sun::star::lang::XComponent,
|
public ::com::sun::star::lang::XComponent,
|
||||||
public ::comphelper::OBaseMutex,
|
public ::comphelper::OBaseMutex,
|
||||||
public ::cppu::OWeakObject
|
public ::cppu::OWeakObject
|
||||||
@@ -94,9 +90,9 @@ class SVT_DLLPUBLIC StatusbarController : public ::com::sun::star::frame::XStatu
|
|||||||
const ::com::sun::star::uno::Any& aData ) throw (::com::sun::star::uno::RuntimeException);
|
const ::com::sun::star::uno::Any& aData ) throw (::com::sun::star::uno::RuntimeException);
|
||||||
virtual void SAL_CALL paint( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XGraphics >& xGraphics,
|
virtual void SAL_CALL paint( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XGraphics >& xGraphics,
|
||||||
const ::com::sun::star::awt::Rectangle& rOutputRectangle,
|
const ::com::sun::star::awt::Rectangle& rOutputRectangle,
|
||||||
::sal_Int32 nItemId, ::sal_Int32 nStyle ) throw (::com::sun::star::uno::RuntimeException);
|
::sal_Int32 nStyle ) throw (::com::sun::star::uno::RuntimeException);
|
||||||
virtual void SAL_CALL click() throw (::com::sun::star::uno::RuntimeException);
|
virtual void SAL_CALL click( const ::com::sun::star::awt::Point& aPos ) throw (::com::sun::star::uno::RuntimeException);
|
||||||
virtual void SAL_CALL doubleClick() throw (::com::sun::star::uno::RuntimeException);
|
virtual void SAL_CALL doubleClick( const ::com::sun::star::awt::Point& aPos ) throw (::com::sun::star::uno::RuntimeException);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
struct Listener
|
struct Listener
|
||||||
@@ -132,6 +128,7 @@ class SVT_DLLPUBLIC StatusbarController : public ::com::sun::star::frame::XStatu
|
|||||||
URLToDispatchMap m_aListenerMap;
|
URLToDispatchMap m_aListenerMap;
|
||||||
::cppu::OMultiTypeInterfaceContainerHelper m_aListenerContainer; /// container for ALL Listener
|
::cppu::OMultiTypeInterfaceContainerHelper m_aListenerContainer; /// container for ALL Listener
|
||||||
mutable ::com::sun::star::uno::Reference< ::com::sun::star::util::XURLTransformer > m_xURLTransformer;
|
mutable ::com::sun::star::uno::Reference< ::com::sun::star::util::XURLTransformer > m_xURLTransformer;
|
||||||
|
::com::sun::star::uno::Reference< ::com::sun::star::ui::XStatusbarItem > m_xStatusbarItem;
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -23,20 +23,19 @@
|
|||||||
#include <comphelper/uno3.hxx>
|
#include <comphelper/uno3.hxx>
|
||||||
#include <com/sun/star/lang/XServiceInfo.hpp>
|
#include <com/sun/star/lang/XServiceInfo.hpp>
|
||||||
#include <cppuhelper/implbase1.hxx>
|
#include <cppuhelper/implbase1.hxx>
|
||||||
#include <comphelper/implementationreference.hxx>
|
|
||||||
|
|
||||||
class SfxStatusBarControl;
|
class SfxStatusBarControl;
|
||||||
namespace rptui
|
namespace rptui
|
||||||
{
|
{
|
||||||
typedef ::comphelper::ImplementationReference<SfxStatusBarControl,::com::sun::star::frame::XStatusbarController> TStatusbarHelper;
|
typedef com::sun::star::uno::Reference< com::sun::star::frame::XStatusbarController > TStatusbarRef;
|
||||||
|
|
||||||
typedef ::cppu::ImplHelper1 < ::com::sun::star::lang::XServiceInfo> OStatusbarController_BASE;
|
typedef ::cppu::ImplHelper1 < ::com::sun::star::lang::XServiceInfo> OStatusbarController_BASE;
|
||||||
class OStatusbarController : public ::svt::StatusbarController,
|
class OStatusbarController : public ::svt::StatusbarController,
|
||||||
public OStatusbarController_BASE
|
public OStatusbarController_BASE
|
||||||
{
|
{
|
||||||
TStatusbarHelper m_pController;
|
TStatusbarRef m_rController;
|
||||||
sal_uInt16 m_nSlotId;
|
sal_uInt16 m_nSlotId;
|
||||||
sal_uInt16 m_nId;
|
sal_uInt16 m_nId;
|
||||||
public:
|
public:
|
||||||
OStatusbarController(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxORB);
|
OStatusbarController(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxORB);
|
||||||
|
|
||||||
@@ -75,9 +74,9 @@ namespace rptui
|
|||||||
const ::com::sun::star::uno::Any& aData ) throw (::com::sun::star::uno::RuntimeException);
|
const ::com::sun::star::uno::Any& aData ) throw (::com::sun::star::uno::RuntimeException);
|
||||||
virtual void SAL_CALL paint( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XGraphics >& xGraphics,
|
virtual void SAL_CALL paint( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XGraphics >& xGraphics,
|
||||||
const ::com::sun::star::awt::Rectangle& rOutputRectangle,
|
const ::com::sun::star::awt::Rectangle& rOutputRectangle,
|
||||||
::sal_Int32 nItemId, ::sal_Int32 nStyle ) throw (::com::sun::star::uno::RuntimeException);
|
::sal_Int32 nStyle ) throw (::com::sun::star::uno::RuntimeException);
|
||||||
virtual void SAL_CALL click() throw (::com::sun::star::uno::RuntimeException);
|
virtual void SAL_CALL click( const ::com::sun::star::awt::Point& aPos ) throw (::com::sun::star::uno::RuntimeException);
|
||||||
virtual void SAL_CALL doubleClick() throw (::com::sun::star::uno::RuntimeException);
|
virtual void SAL_CALL doubleClick( const ::com::sun::star::awt::Point& aPos ) throw (::com::sun::star::uno::RuntimeException);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
#endif // DBAUI_STATUSBARCONTROLLER_HXX
|
#endif // DBAUI_STATUSBARCONTROLLER_HXX
|
||||||
|
@@ -99,19 +99,25 @@ void SAL_CALL OStatusbarController::initialize( const Sequence< Any >& _rArgumen
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
SfxStatusBarControl *pController = 0;
|
||||||
if ( m_aCommandURL == ".uno:ZoomSlider" )
|
if ( m_aCommandURL == ".uno:ZoomSlider" )
|
||||||
{
|
{
|
||||||
m_pController = TStatusbarHelper::createFromQuery(new SvxZoomSliderControl(m_nSlotId = SID_ATTR_ZOOMSLIDER,m_nId,*pStatusBar));
|
pController = new SvxZoomSliderControl(m_nSlotId = SID_ATTR_ZOOMSLIDER,m_nId,*pStatusBar);
|
||||||
}
|
}
|
||||||
else if ( m_aCommandURL == ".uno:Zoom" )
|
else if ( m_aCommandURL == ".uno:Zoom" )
|
||||||
{
|
{
|
||||||
m_pController = TStatusbarHelper::createFromQuery(new SvxZoomStatusBarControl(m_nSlotId = SID_ATTR_ZOOM,m_nId,*pStatusBar));
|
pController = new SvxZoomStatusBarControl(m_nSlotId = SID_ATTR_ZOOM,m_nId,*pStatusBar);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( m_pController.is() )
|
if ( pController )
|
||||||
{
|
{
|
||||||
m_pController->initialize(_rArguments);
|
m_rController.set( pController );
|
||||||
m_pController->update();
|
if ( m_rController.is() )
|
||||||
|
{
|
||||||
|
m_rController->initialize(_rArguments);
|
||||||
|
m_rController->update();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
addStatusListener(m_aCommandURL);
|
addStatusListener(m_aCommandURL);
|
||||||
@@ -124,7 +130,7 @@ void SAL_CALL OStatusbarController::statusChanged( const FeatureStateEvent& _aEv
|
|||||||
SolarMutexGuard aSolarGuard;
|
SolarMutexGuard aSolarGuard;
|
||||||
::osl::MutexGuard aGuard(m_aMutex);
|
::osl::MutexGuard aGuard(m_aMutex);
|
||||||
|
|
||||||
if ( m_pController.is() )
|
if ( m_rController.is() )
|
||||||
{
|
{
|
||||||
if ( m_aCommandURL == ".uno:ZoomSlider" )
|
if ( m_aCommandURL == ".uno:ZoomSlider" )
|
||||||
{
|
{
|
||||||
@@ -133,7 +139,7 @@ void SAL_CALL OStatusbarController::statusChanged( const FeatureStateEvent& _aEv
|
|||||||
{
|
{
|
||||||
SvxZoomSliderItem aZoomSlider(100,20,400);
|
SvxZoomSliderItem aZoomSlider(100,20,400);
|
||||||
aZoomSlider.PutValue(_aEvent.State);
|
aZoomSlider.PutValue(_aEvent.State);
|
||||||
static_cast<SvxZoomSliderControl*>(m_pController.get())->StateChanged(m_nSlotId,SFX_ITEM_AVAILABLE,&aZoomSlider);
|
static_cast<SvxZoomSliderControl*>(m_rController.get())->StateChanged(m_nSlotId,SFX_ITEM_AVAILABLE,&aZoomSlider);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if ( m_aCommandURL == ".uno:Zoom" )
|
else if ( m_aCommandURL == ".uno:Zoom" )
|
||||||
@@ -143,7 +149,7 @@ void SAL_CALL OStatusbarController::statusChanged( const FeatureStateEvent& _aEv
|
|||||||
{
|
{
|
||||||
SvxZoomItem aZoom;
|
SvxZoomItem aZoom;
|
||||||
aZoom.PutValue(_aEvent.State);
|
aZoom.PutValue(_aEvent.State);
|
||||||
static_cast<SvxZoomStatusBarControl*>(m_pController.get())->StateChanged(m_nSlotId,SFX_ITEM_AVAILABLE,&aZoom);
|
static_cast<SvxZoomStatusBarControl*>(m_rController.get())->StateChanged(m_nSlotId,SFX_ITEM_AVAILABLE,&aZoom);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -152,17 +158,17 @@ void SAL_CALL OStatusbarController::statusChanged( const FeatureStateEvent& _aEv
|
|||||||
// XStatusbarController
|
// XStatusbarController
|
||||||
::sal_Bool SAL_CALL OStatusbarController::mouseButtonDown(const ::com::sun::star::awt::MouseEvent& _aEvent)throw (::com::sun::star::uno::RuntimeException)
|
::sal_Bool SAL_CALL OStatusbarController::mouseButtonDown(const ::com::sun::star::awt::MouseEvent& _aEvent)throw (::com::sun::star::uno::RuntimeException)
|
||||||
{
|
{
|
||||||
return m_pController.is() && m_pController.getRef()->mouseButtonDown(_aEvent);
|
return m_rController.is() && m_rController->mouseButtonDown(_aEvent);
|
||||||
}
|
}
|
||||||
|
|
||||||
::sal_Bool SAL_CALL OStatusbarController::mouseMove( const ::com::sun::star::awt::MouseEvent& _aEvent)throw (::com::sun::star::uno::RuntimeException)
|
::sal_Bool SAL_CALL OStatusbarController::mouseMove( const ::com::sun::star::awt::MouseEvent& _aEvent)throw (::com::sun::star::uno::RuntimeException)
|
||||||
{
|
{
|
||||||
return m_pController.is() && m_pController.getRef()->mouseMove(_aEvent);
|
return m_rController.is() && m_rController->mouseMove(_aEvent);
|
||||||
}
|
}
|
||||||
|
|
||||||
::sal_Bool SAL_CALL OStatusbarController::mouseButtonUp( const ::com::sun::star::awt::MouseEvent& _aEvent)throw (::com::sun::star::uno::RuntimeException)
|
::sal_Bool SAL_CALL OStatusbarController::mouseButtonUp( const ::com::sun::star::awt::MouseEvent& _aEvent)throw (::com::sun::star::uno::RuntimeException)
|
||||||
{
|
{
|
||||||
return m_pController.is() && m_pController.getRef()->mouseButtonUp(_aEvent);
|
return m_rController.is() && m_rController->mouseButtonUp(_aEvent);
|
||||||
}
|
}
|
||||||
|
|
||||||
void SAL_CALL OStatusbarController::command(
|
void SAL_CALL OStatusbarController::command(
|
||||||
@@ -172,47 +178,49 @@ void SAL_CALL OStatusbarController::command(
|
|||||||
const ::com::sun::star::uno::Any& aData )
|
const ::com::sun::star::uno::Any& aData )
|
||||||
throw (::com::sun::star::uno::RuntimeException)
|
throw (::com::sun::star::uno::RuntimeException)
|
||||||
{
|
{
|
||||||
if ( m_pController.is() )
|
if ( m_rController.is() )
|
||||||
m_pController.getRef()->command( aPos, nCommand, bMouseEvent, aData );
|
m_rController->command( aPos, nCommand, bMouseEvent, aData );
|
||||||
}
|
}
|
||||||
|
|
||||||
void SAL_CALL OStatusbarController::paint(
|
void SAL_CALL OStatusbarController::paint(
|
||||||
const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XGraphics >& xGraphics,
|
const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XGraphics >& xGraphics,
|
||||||
const ::com::sun::star::awt::Rectangle& rOutputRectangle,
|
const ::com::sun::star::awt::Rectangle& rOutputRectangle,
|
||||||
::sal_Int32 nItemId,
|
|
||||||
::sal_Int32 nStyle )
|
::sal_Int32 nStyle )
|
||||||
throw (::com::sun::star::uno::RuntimeException)
|
throw (::com::sun::star::uno::RuntimeException)
|
||||||
{
|
{
|
||||||
if ( m_pController.is() )
|
if ( m_rController.is() )
|
||||||
m_pController.getRef()->paint( xGraphics, rOutputRectangle, nItemId, nStyle );
|
m_rController->paint( xGraphics, rOutputRectangle, nStyle );
|
||||||
}
|
}
|
||||||
|
|
||||||
void SAL_CALL OStatusbarController::click() throw (::com::sun::star::uno::RuntimeException)
|
void SAL_CALL OStatusbarController::click(
|
||||||
|
const ::com::sun::star::awt::Point& aPos )
|
||||||
|
throw (::com::sun::star::uno::RuntimeException)
|
||||||
{
|
{
|
||||||
if ( m_pController.is() )
|
if ( m_rController.is() )
|
||||||
m_pController.getRef()->click();
|
m_rController->click( aPos );
|
||||||
}
|
}
|
||||||
|
|
||||||
void SAL_CALL OStatusbarController::doubleClick() throw (::com::sun::star::uno::RuntimeException)
|
void SAL_CALL OStatusbarController::doubleClick(
|
||||||
|
const ::com::sun::star::awt::Point& aPos )
|
||||||
|
throw (::com::sun::star::uno::RuntimeException)
|
||||||
{
|
{
|
||||||
if ( m_pController.is() )
|
if ( m_rController.is() )
|
||||||
m_pController.getRef()->doubleClick();
|
m_rController->doubleClick( aPos );
|
||||||
}
|
}
|
||||||
// -----------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------
|
||||||
void SAL_CALL OStatusbarController::update() throw ( RuntimeException )
|
void SAL_CALL OStatusbarController::update() throw ( RuntimeException )
|
||||||
{
|
{
|
||||||
::svt::StatusbarController::update();
|
::svt::StatusbarController::update();
|
||||||
Reference< XUpdatable > xUp(m_pController.getRef(),UNO_QUERY);
|
if ( m_rController.is() )
|
||||||
if ( xUp.is() )
|
m_rController->update();
|
||||||
xUp->update();
|
|
||||||
}
|
}
|
||||||
// -----------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------
|
||||||
// XComponent
|
// XComponent
|
||||||
void SAL_CALL OStatusbarController::dispose() throw (::com::sun::star::uno::RuntimeException)
|
void SAL_CALL OStatusbarController::dispose() throw (::com::sun::star::uno::RuntimeException)
|
||||||
{
|
{
|
||||||
Reference< XComponent > xComp( m_pController.getRef(), UNO_QUERY );
|
if ( m_rController.is() )
|
||||||
::comphelper::disposeComponent(xComp);
|
::comphelper::disposeComponent( m_rController );
|
||||||
m_pController.dispose();
|
|
||||||
svt::StatusbarController::dispose();
|
svt::StatusbarController::dispose();
|
||||||
}
|
}
|
||||||
// =============================================================================
|
// =============================================================================
|
||||||
|
@@ -387,7 +387,6 @@ throw (::com::sun::star::uno::RuntimeException)
|
|||||||
void SAL_CALL SfxStatusBarControl::paint(
|
void SAL_CALL SfxStatusBarControl::paint(
|
||||||
const uno::Reference< awt::XGraphics >& xGraphics,
|
const uno::Reference< awt::XGraphics >& xGraphics,
|
||||||
const awt::Rectangle& rOutputRectangle,
|
const awt::Rectangle& rOutputRectangle,
|
||||||
::sal_Int32 nItemId,
|
|
||||||
::sal_Int32 nStyle )
|
::sal_Int32 nStyle )
|
||||||
throw ( ::uno::RuntimeException )
|
throw ( ::uno::RuntimeException )
|
||||||
{
|
{
|
||||||
@@ -397,14 +396,14 @@ throw ( ::uno::RuntimeException )
|
|||||||
if ( pOutDev )
|
if ( pOutDev )
|
||||||
{
|
{
|
||||||
::Rectangle aRect = VCLRectangle( rOutputRectangle );
|
::Rectangle aRect = VCLRectangle( rOutputRectangle );
|
||||||
UserDrawEvent aUserDrawEvent( pOutDev, aRect, (sal_uInt16)nItemId, (sal_uInt16)nStyle );
|
UserDrawEvent aUserDrawEvent( pOutDev, aRect, pBar->GetCurItemId(), (sal_uInt16)nStyle );
|
||||||
Paint( aUserDrawEvent );
|
Paint( aUserDrawEvent );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
|
|
||||||
void SAL_CALL SfxStatusBarControl::click()
|
void SAL_CALL SfxStatusBarControl::click( const awt::Point& )
|
||||||
throw ( uno::RuntimeException )
|
throw ( uno::RuntimeException )
|
||||||
{
|
{
|
||||||
SolarMutexGuard aGuard;
|
SolarMutexGuard aGuard;
|
||||||
@@ -413,7 +412,7 @@ throw ( uno::RuntimeException )
|
|||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
|
|
||||||
void SAL_CALL SfxStatusBarControl::doubleClick()
|
void SAL_CALL SfxStatusBarControl::doubleClick( const awt::Point& )
|
||||||
throw ( uno::RuntimeException )
|
throw ( uno::RuntimeException )
|
||||||
{
|
{
|
||||||
SolarMutexGuard aGuard;
|
SolarMutexGuard aGuard;
|
||||||
|
@@ -30,7 +30,7 @@
|
|||||||
#include <vcl/status.hxx>
|
#include <vcl/status.hxx>
|
||||||
#include <svtools/imgdef.hxx>
|
#include <svtools/imgdef.hxx>
|
||||||
#include <svtools/miscopt.hxx>
|
#include <svtools/miscopt.hxx>
|
||||||
#include <toolkit/unohlp.hxx>
|
#include <toolkit/helper/vclunohelper.hxx>
|
||||||
#include <comphelper/processfactory.hxx>
|
#include <comphelper/processfactory.hxx>
|
||||||
|
|
||||||
using namespace ::cppu;
|
using namespace ::cppu;
|
||||||
@@ -153,6 +153,8 @@ throw ( Exception, RuntimeException )
|
|||||||
aPropValue.Value >>= m_xParentWindow;
|
aPropValue.Value >>= m_xParentWindow;
|
||||||
else if ( aPropValue.Name == "Identifier" )
|
else if ( aPropValue.Name == "Identifier" )
|
||||||
aPropValue.Value >>= m_nID;
|
aPropValue.Value >>= m_nID;
|
||||||
|
else if ( aPropValue.Name == "StatusbarItem" )
|
||||||
|
aPropValue.Value >>= m_xStatusbarItem;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -220,6 +222,7 @@ throw (::com::sun::star::uno::RuntimeException)
|
|||||||
m_xServiceManager.clear();
|
m_xServiceManager.clear();
|
||||||
m_xFrame.clear();
|
m_xFrame.clear();
|
||||||
m_xParentWindow.clear();
|
m_xParentWindow.clear();
|
||||||
|
m_xStatusbarItem.clear();
|
||||||
|
|
||||||
m_bDisposed = sal_True;
|
m_bDisposed = sal_True;
|
||||||
}
|
}
|
||||||
@@ -240,26 +243,31 @@ throw ( RuntimeException )
|
|||||||
void SAL_CALL StatusbarController::disposing( const EventObject& Source )
|
void SAL_CALL StatusbarController::disposing( const EventObject& Source )
|
||||||
throw ( RuntimeException )
|
throw ( RuntimeException )
|
||||||
{
|
{
|
||||||
Reference< XInterface > xSource( Source.Source );
|
|
||||||
|
|
||||||
SolarMutexGuard aSolarMutexGuard;
|
SolarMutexGuard aSolarMutexGuard;
|
||||||
|
|
||||||
if ( m_bDisposed )
|
if ( m_bDisposed )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
Reference< XFrame > xFrame( Source.Source, UNO_QUERY );
|
||||||
|
if ( xFrame.is() )
|
||||||
|
{
|
||||||
|
if ( xFrame == m_xFrame )
|
||||||
|
m_xFrame.clear();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
Reference< XDispatch > xDispatch( Source.Source, UNO_QUERY );
|
||||||
|
if ( !xDispatch.is() )
|
||||||
|
return;
|
||||||
|
|
||||||
URLToDispatchMap::iterator pIter = m_aListenerMap.begin();
|
URLToDispatchMap::iterator pIter = m_aListenerMap.begin();
|
||||||
while ( pIter != m_aListenerMap.end() )
|
while ( pIter != m_aListenerMap.end() )
|
||||||
{
|
{
|
||||||
// Compare references and release dispatch references if they are equal.
|
// Compare references and release dispatch references if they are equal.
|
||||||
Reference< XInterface > xIfac( pIter->second, UNO_QUERY );
|
if ( xDispatch == pIter->second )
|
||||||
if ( xSource == xIfac )
|
|
||||||
pIter->second.clear();
|
pIter->second.clear();
|
||||||
++pIter;
|
++pIter;
|
||||||
}
|
}
|
||||||
|
|
||||||
Reference< XInterface > xIfac( m_xFrame, UNO_QUERY );
|
|
||||||
if ( xIfac == xSource )
|
|
||||||
m_xFrame.clear();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// XStatusListener
|
// XStatusListener
|
||||||
@@ -318,18 +326,17 @@ throw (::com::sun::star::uno::RuntimeException)
|
|||||||
void SAL_CALL StatusbarController::paint(
|
void SAL_CALL StatusbarController::paint(
|
||||||
const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XGraphics >&,
|
const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XGraphics >&,
|
||||||
const ::com::sun::star::awt::Rectangle&,
|
const ::com::sun::star::awt::Rectangle&,
|
||||||
::sal_Int32,
|
|
||||||
::sal_Int32 )
|
::sal_Int32 )
|
||||||
throw (::com::sun::star::uno::RuntimeException)
|
throw (::com::sun::star::uno::RuntimeException)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
void SAL_CALL StatusbarController::click()
|
void SAL_CALL StatusbarController::click( const ::com::sun::star::awt::Point& )
|
||||||
throw (::com::sun::star::uno::RuntimeException)
|
throw (::com::sun::star::uno::RuntimeException)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
void SAL_CALL StatusbarController::doubleClick() throw (::com::sun::star::uno::RuntimeException)
|
void SAL_CALL StatusbarController::doubleClick( const ::com::sun::star::awt::Point& ) throw (::com::sun::star::uno::RuntimeException)
|
||||||
{
|
{
|
||||||
SolarMutexGuard aSolarMutexGuard;
|
SolarMutexGuard aSolarMutexGuard;
|
||||||
|
|
||||||
@@ -465,37 +472,29 @@ void StatusbarController::bindListener()
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Call without locked mutex as we are called back from dispatch implementation
|
// Call without locked mutex as we are called back from dispatch implementation
|
||||||
if ( xStatusListener.is() )
|
if ( !xStatusListener.is() )
|
||||||
|
return;
|
||||||
|
|
||||||
|
for ( sal_uInt32 i = 0; i < aDispatchVector.size(); i++ )
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
for ( sal_uInt32 i = 0; i < aDispatchVector.size(); i++ )
|
Listener& rListener = aDispatchVector[i];
|
||||||
|
if ( rListener.xDispatch.is() )
|
||||||
|
rListener.xDispatch->addStatusListener( xStatusListener, rListener.aURL );
|
||||||
|
else if ( rListener.aURL.Complete == m_aCommandURL )
|
||||||
{
|
{
|
||||||
Listener& rListener = aDispatchVector[i];
|
// Send status changed for the main URL, if we cannot get a valid dispatch object.
|
||||||
if ( rListener.xDispatch.is() )
|
// UI disables the button. Catch exception as we release our mutex, it is possible
|
||||||
rListener.xDispatch->addStatusListener( xStatusListener, rListener.aURL );
|
// that someone else already disposed this instance!
|
||||||
else if ( rListener.aURL.Complete == m_aCommandURL )
|
FeatureStateEvent aFeatureStateEvent;
|
||||||
{
|
aFeatureStateEvent.IsEnabled = sal_False;
|
||||||
try
|
aFeatureStateEvent.FeatureURL = rListener.aURL;
|
||||||
{
|
aFeatureStateEvent.State = Any();
|
||||||
// Send status changed for the main URL, if we cannot get a valid dispatch object.
|
xStatusListener->statusChanged( aFeatureStateEvent );
|
||||||
// UI disables the button. Catch exception as we release our mutex, it is possible
|
|
||||||
// that someone else already disposed this instance!
|
|
||||||
FeatureStateEvent aFeatureStateEvent;
|
|
||||||
aFeatureStateEvent.IsEnabled = sal_False;
|
|
||||||
aFeatureStateEvent.FeatureURL = rListener.aURL;
|
|
||||||
aFeatureStateEvent.State = Any();
|
|
||||||
xStatusListener->statusChanged( aFeatureStateEvent );
|
|
||||||
}
|
|
||||||
catch ( Exception& )
|
|
||||||
{
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch ( Exception& )
|
catch ( ... ){}
|
||||||
{
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user