From 753b209ebcb42d313359fc4062201461b21213a1 Mon Sep 17 00:00:00 2001 From: Carsten Driesner Date: Thu, 8 Apr 2010 17:26:09 +0200 Subject: fwk139: #i100512# Eliminate flicker when toolbar buttons make themselves invisible --- svtools/inc/svtools/toolboxcontroller.hxx | 24 ++++++- svtools/source/uno/toolboxcontroller.cxx | 101 ++++++++++++++++++++++++++++-- 2 files changed, 117 insertions(+), 8 deletions(-) (limited to 'svtools') diff --git a/svtools/inc/svtools/toolboxcontroller.hxx b/svtools/inc/svtools/toolboxcontroller.hxx index 27ed315a3c04..e1ba26607922 100644 --- a/svtools/inc/svtools/toolboxcontroller.hxx +++ b/svtools/inc/svtools/toolboxcontroller.hxx @@ -42,7 +42,13 @@ #include #include #include - +//shizhoubo for ToolbarController Visiable +#include +#include +#include +#include +#include +//end #ifndef INCLUDED_HASH_MAP #include #define INCLUDED_HASH_MAP @@ -57,9 +63,13 @@ class SVT_DLLPUBLIC ToolboxController : public ::com::sun::star::frame::XStatusL public ::com::sun::star::lang::XInitialization, public ::com::sun::star::util::XUpdatable, public ::com::sun::star::lang::XComponent, - public ::comphelper::OBaseMutex, + public ::comphelper::OMutexAndBroadcastHelper,//shizhoubo + public ::comphelper::OPropertyContainer,//shizhoubo + public ::comphelper::OPropertyArrayUsageHelper< ToolboxController >,//shizhoubo public ::cppu::OWeakObject { + private: + sal_Bool m_bSupportVisiable; //shizhoubo public: ToolboxController( const com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory >& rServiceManager, const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& xFrame, @@ -102,8 +112,18 @@ class SVT_DLLPUBLIC ToolboxController : public ::com::sun::star::frame::XStatusL virtual void SAL_CALL doubleClick() throw (::com::sun::star::uno::RuntimeException); virtual ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow > SAL_CALL createPopupWindow() throw (::com::sun::star::uno::RuntimeException); virtual ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow > SAL_CALL createItemWindow( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow >& Parent ) throw (::com::sun::star::uno::RuntimeException); + // OPropertySetHelper //shizhoubo + virtual void SAL_CALL setFastPropertyValue_NoBroadcast( sal_Int32 nHandle, const com::sun::star::uno::Any& rValue ) throw(com::sun::star::uno::Exception); + virtual sal_Bool SAL_CALL convertFastPropertyValue( com::sun::star::uno::Any& rConvertedValue, com::sun::star::uno::Any& rOldValue, sal_Int32 nHandle, const com::sun::star::uno::Any& rValue) throw(com::sun::star::lang::IllegalArgumentException); + // XPropertySet //shizhoubo + virtual ::com::sun::star::uno::Reference< com::sun::star::beans::XPropertySetInfo> SAL_CALL getPropertySetInfo() throw(::com::sun::star::uno::RuntimeException); + virtual ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper(); + // OPropertyArrayUsageHelper //shizhoubo + virtual ::cppu::IPropertyArrayHelper* createArrayHelper( ) const; + protected: + void setSupportVisiableProperty(sal_Bool bValue); //shizhoubo struct Listener { Listener( const ::com::sun::star::util::URL& rURL, const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatch >& rDispatch ) : diff --git a/svtools/source/uno/toolboxcontroller.cxx b/svtools/source/uno/toolboxcontroller.cxx index 3f0b4e7c0ee6..4658da9bee3a 100644 --- a/svtools/source/uno/toolboxcontroller.cxx +++ b/svtools/source/uno/toolboxcontroller.cxx @@ -42,6 +42,12 @@ #include #endif #include +//shizhobo +#include +const int TOOLBARCONTROLLER_PROPHANDLE_SUPPORTSVISIABLE = 1; +const int TOOLBARCONTROLLER_PROPCOUNT = 1; +const rtl::OUString TOOLBARCONTROLLER_PROPNAME_SUPPORTSVISIABLE( RTL_CONSTASCII_USTRINGPARAM( "SupportsVisiable" )); +//end using namespace ::cppu; using namespace ::com::sun::star::awt; @@ -61,10 +67,12 @@ struct ToolboxController_Impl }; ToolboxController::ToolboxController( + const Reference< XMultiServiceFactory >& rServiceManager, const Reference< XFrame >& xFrame, const ::rtl::OUString& aCommandURL ) : OWeakObject() + ,OPropertyContainer(GetBroadcastHelper())//shizhoubo , m_bInitialized( sal_False ) , m_bDisposed( sal_False ) , m_xFrame(xFrame) @@ -72,6 +80,10 @@ ToolboxController::ToolboxController( , m_aCommandURL( aCommandURL ) , m_aListenerContainer( m_aMutex ) { + //registger Propertyh by shizhoubo + registerProperty(TOOLBARCONTROLLER_PROPNAME_SUPPORTSVISIABLE, TOOLBARCONTROLLER_PROPHANDLE_SUPPORTSVISIABLE, com::sun::star::beans::PropertyAttribute::TRANSIENT | com::sun::star::beans::PropertyAttribute::READONLY, + &m_bSupportVisiable, getCppuType(&m_bSupportVisiable)); + m_pImpl = new ToolboxController_Impl; try @@ -87,10 +99,15 @@ ToolboxController::ToolboxController( ToolboxController::ToolboxController() : OWeakObject() + ,OPropertyContainer(GetBroadcastHelper())//shizhoubo , m_bInitialized( sal_False ) , m_bDisposed( sal_False ) , m_aListenerContainer( m_aMutex ) { + //registger Propertyh by shizhoubo + registerProperty(TOOLBARCONTROLLER_PROPNAME_SUPPORTSVISIABLE, TOOLBARCONTROLLER_PROPHANDLE_SUPPORTSVISIABLE, com::sun::star::beans::PropertyAttribute::TRANSIENT | com::sun::star::beans::PropertyAttribute::READONLY, + &m_bSupportVisiable, getCppuType(&m_bSupportVisiable)); + m_pImpl = new ToolboxController_Impl; } @@ -146,11 +163,16 @@ throw ( RuntimeException ) static_cast< XInitialization* >( this ), static_cast< XComponent* >( this ), static_cast< XUpdatable* >( this )); - - if ( a.hasValue() ) - return a; - - return OWeakObject::queryInterface( rType ); + if ( !a.hasValue()) + { + a = ::cppu::queryInterface(rType + ,static_cast(this) + ,static_cast(this) + ,static_cast(this)); + if (!a.hasValue()) + return OWeakObject::queryInterface( rType ); + } + return a; } void SAL_CALL ToolboxController::acquire() throw () @@ -186,7 +208,8 @@ throw ( Exception, RuntimeException ) { vos::OGuard aSolarMutexGuard( Application::GetSolarMutex() ); m_bInitialized = sal_True; - + //shizhoubo add + m_bSupportVisiable = sal_False; PropertyValue aPropValue; for ( int i = 0; i < aArguments.getLength(); i++ ) { @@ -704,4 +727,70 @@ Reference< ::com::sun::star::awt::XWindow > ToolboxController::getParent() const { return m_pImpl->m_xParentWindow; } +// +//------------------------------------------------------------------------- +// XPropertySet by shizhoubo +com::sun::star::uno::Reference< com::sun::star::beans::XPropertySetInfo > SAL_CALL ToolboxController::getPropertySetInfo() throw(::com::sun::star::uno::RuntimeException) +{ + Reference xInfo( createPropertySetInfo( getInfoHelper() ) ); + return xInfo; +} +//------------------------------------------------------------------------- +::cppu::IPropertyArrayHelper& ToolboxController::getInfoHelper() +{ + return *const_cast(this)->getArrayHelper(); +} +//OPropertyArrayUsageHelper by shizhoubo +//------------------------------------------------------------------------------ +::cppu::IPropertyArrayHelper* ToolboxController::createArrayHelper( ) const +{ + com::sun::star::uno::Sequence< Property > aProps; + describeProperties(aProps); + return new ::cppu::OPropertyArrayHelper(aProps); +} +//shizhoubo for supportsvisiable +void ToolboxController::setSupportVisiableProperty(sal_Bool bValue) +{ + m_bSupportVisiable = bValue; +} +//OPropertySetHelper by shizhoubo +sal_Bool SAL_CALL ToolboxController::convertFastPropertyValue( com::sun::star::uno::Any& aConvertedValue , + com::sun::star::uno::Any& aOldValue , + sal_Int32 nHandle , + const com::sun::star::uno::Any& aValue ) throw( com::sun::star::lang::IllegalArgumentException ) +{ + + switch (nHandle) + { + case TOOLBARCONTROLLER_PROPHANDLE_SUPPORTSVISIABLE: + { + sal_Bool aNewValue; + aValue >>= aNewValue; + if (aNewValue != m_bSupportVisiable) + { + aConvertedValue <<= aNewValue; + aOldValue <<= m_bSupportVisiable; + return sal_True; + } + return sal_False; + } + } + return OPropertyContainer::convertFastPropertyValue(aConvertedValue, aOldValue, nHandle, aValue); + + +} +void SAL_CALL ToolboxController::setFastPropertyValue_NoBroadcast(sal_Int32 nHandle, + const com::sun::star::uno::Any& aValue ) throw( com::sun::star::uno::Exception) +{ + OPropertyContainer::setFastPropertyValue_NoBroadcast(nHandle, aValue); + if (TOOLBARCONTROLLER_PROPHANDLE_SUPPORTSVISIABLE == nHandle) + { sal_Bool rValue; + aValue >>= rValue; + if (m_bInitialized) + this->setSupportVisiableProperty(rValue); + } + +} +//end + } // svt -- cgit v1.2.3 From e11315fea42a010fb2248b54be599bdbf98be127 Mon Sep 17 00:00:00 2001 From: Carsten Driesner Date: Thu, 20 May 2010 12:45:50 +0200 Subject: fwk139: #i110066# Fixed typo for Malay string --- svtools/source/misc/langtab.src | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'svtools') diff --git a/svtools/source/misc/langtab.src b/svtools/source/misc/langtab.src index 39f9362e3940..0e4117b52e35 100644 --- a/svtools/source/misc/langtab.src +++ b/svtools/source/misc/langtab.src @@ -138,7 +138,7 @@ StringArray STR_ARR_SVT_LANGUAGE_TABLE < "Lithuanian" ; LANGUAGE_LITHUANIAN ; > ; < "Macedonian" ; LANGUAGE_MACEDONIAN ; > ; < "Malay (Malaysia)" ; LANGUAGE_MALAY_MALAYSIA ; > ; - < "Malay (Brunei Darusalam)" ; LANGUAGE_MALAY_BRUNEI_DARUSSALAM ; > ; + < "Malay (Brunei Darussalam)" ; LANGUAGE_MALAY_BRUNEI_DARUSSALAM ; > ; < "Malayalam" ; LANGUAGE_MALAYALAM ; > ; < "Manipuri" ; LANGUAGE_MANIPURI ; > ; < "Marathi" ; LANGUAGE_MARATHI ; > ; -- cgit v1.2.3 From 4624195e6db83d5cd4504ecb15133ba02fb23f52 Mon Sep 17 00:00:00 2001 From: Mikhail Voytenko Date: Wed, 2 Jun 2010 12:16:56 +0200 Subject: fwk139: #i10000# adopt for solaris --- svtools/inc/svtools/toolboxcontroller.hxx | 1 + 1 file changed, 1 insertion(+) (limited to 'svtools') diff --git a/svtools/inc/svtools/toolboxcontroller.hxx b/svtools/inc/svtools/toolboxcontroller.hxx index e1ba26607922..d4286b2d31b0 100644 --- a/svtools/inc/svtools/toolboxcontroller.hxx +++ b/svtools/inc/svtools/toolboxcontroller.hxx @@ -101,6 +101,7 @@ class SVT_DLLPUBLIC ToolboxController : public ::com::sun::star::frame::XStatusL virtual void SAL_CALL removeEventListener( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener >& aListener ) throw (::com::sun::star::uno::RuntimeException); // XEventListener + using cppu::OPropertySetHelper::disposing; virtual void SAL_CALL disposing( const com::sun::star::lang::EventObject& Source ) throw ( ::com::sun::star::uno::RuntimeException ); // XStatusListener -- cgit v1.2.3 From d50be7a83ace7a3181c91dbe63cf2588e1424a1c Mon Sep 17 00:00:00 2001 From: Carsten Driesner Date: Fri, 4 Jun 2010 17:28:06 +0200 Subject: fwk139: Fix build problem with gcc --- svtools/source/uno/toolboxcontroller.cxx | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) (limited to 'svtools') diff --git a/svtools/source/uno/toolboxcontroller.cxx b/svtools/source/uno/toolboxcontroller.cxx index 4658da9bee3a..c0203c93c020 100644 --- a/svtools/source/uno/toolboxcontroller.cxx +++ b/svtools/source/uno/toolboxcontroller.cxx @@ -71,8 +71,8 @@ ToolboxController::ToolboxController( const Reference< XMultiServiceFactory >& rServiceManager, const Reference< XFrame >& xFrame, const ::rtl::OUString& aCommandURL ) : - OWeakObject() - ,OPropertyContainer(GetBroadcastHelper())//shizhoubo + OPropertyContainer(GetBroadcastHelper()) + , OWeakObject() , m_bInitialized( sal_False ) , m_bDisposed( sal_False ) , m_xFrame(xFrame) @@ -98,8 +98,8 @@ ToolboxController::ToolboxController( } ToolboxController::ToolboxController() : - OWeakObject() - ,OPropertyContainer(GetBroadcastHelper())//shizhoubo + OPropertyContainer(GetBroadcastHelper()) + , OWeakObject() , m_bInitialized( sal_False ) , m_bDisposed( sal_False ) , m_aListenerContainer( m_aMutex ) @@ -779,17 +779,19 @@ sal_Bool SAL_CALL ToolboxController::convertFastPropertyValue( com::sun::star::u } -void SAL_CALL ToolboxController::setFastPropertyValue_NoBroadcast(sal_Int32 nHandle, - const com::sun::star::uno::Any& aValue ) throw( com::sun::star::uno::Exception) + +void SAL_CALL ToolboxController::setFastPropertyValue_NoBroadcast( + sal_Int32 nHandle, + const com::sun::star::uno::Any& aValue ) +throw( com::sun::star::uno::Exception) { OPropertyContainer::setFastPropertyValue_NoBroadcast(nHandle, aValue); if (TOOLBARCONTROLLER_PROPHANDLE_SUPPORTSVISIABLE == nHandle) - { sal_Bool rValue; - aValue >>= rValue; - if (m_bInitialized) - this->setSupportVisiableProperty(rValue); + { + sal_Bool rValue(sal_False); + if (( aValue >>= rValue ) && m_bInitialized) + this->setSupportVisiableProperty( rValue ); } - } //end -- cgit v1.2.3