summaryrefslogtreecommitdiff
path: root/basctl/source
diff options
context:
space:
mode:
authorOliver Bolte <obo@openoffice.org>2004-11-15 12:41:30 +0000
committerOliver Bolte <obo@openoffice.org>2004-11-15 12:41:30 +0000
commit4a0e677df755793c95eed76aedbcc492b8e9c76e (patch)
treef2e6741ab7bebb454fe4a155173bf6227f0337db /basctl/source
parenteae0dda32494b2219575bf9824ada87c18822a76 (diff)
INTEGRATION: CWS tbe13 (1.8.52); FILE MERGED
2004/11/03 17:04:20 tbe 1.8.52.1: #i36073# Insert Controls Toolbar disappears if Properties Window has been opened
Diffstat (limited to 'basctl/source')
-rw-r--r--basctl/source/basicide/tbxctl.cxx52
1 files changed, 47 insertions, 5 deletions
diff --git a/basctl/source/basicide/tbxctl.cxx b/basctl/source/basicide/tbxctl.cxx
index 6ad0ae24fc96..6a1b76ce8e5c 100644
--- a/basctl/source/basicide/tbxctl.cxx
+++ b/basctl/source/basicide/tbxctl.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: tbxctl.cxx,v $
*
- * $Revision: 1.8 $
+ * $Revision: 1.9 $
*
- * last change: $Author: obo $ $Date: 2004-07-06 12:19:24 $
+ * last change: $Author: obo $ $Date: 2004-11-15 13:41:30 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -73,6 +73,11 @@
#include <sfx2/imagemgr.hxx>
#include <svtools/aeitem.hxx>
+using namespace ::com::sun::star::uno;
+
+
+static ::rtl::OUString aSubToolBarResName( RTL_CONSTASCII_USTRINGPARAM( "private:resource/toolbar/insertcontrolsbar" ) );
+
SFX_IMPL_TOOLBOX_CONTROL( TbxControls, SfxAllEnumItem )
/*************************************************************************
@@ -164,9 +169,48 @@ SfxPopupWindowType TbxControls::GetPopupWindowType() const
return(SFX_POPUPWINDOW_ONTIMEOUT);
}
+IMPL_STATIC_LINK( TbxControls, StateChangedHdl_Impl, StateChangedInfo*, pStateChangedInfo )
+{
+ try
+ {
+ if ( pStateChangedInfo )
+ {
+ Reference< ::drafts::com::sun::star::frame::XLayoutManager > xLayoutManager( pStateChangedInfo->xLayoutManager );
+ if ( xLayoutManager.is() )
+ {
+ if ( pStateChangedInfo->bDisabled )
+ {
+ xLayoutManager->destroyElement( aSubToolBarResName );
+ }
+ else
+ {
+ xLayoutManager->createElement( aSubToolBarResName );
+ xLayoutManager->requestElement( aSubToolBarResName );
+ }
+ }
+ }
+ }
+ catch ( Exception& )
+ {
+ // no update
+ }
+
+ delete pStateChangedInfo;
+
+ return 0;
+}
+
void TbxControls::StateChanged( USHORT nSID, SfxItemState eState,
const SfxPoolItem* pState )
{
+ if ( nSID == SID_CHOOSE_CONTROLS )
+ {
+ StateChangedInfo* pStateChangedInfo = new StateChangedInfo;
+ pStateChangedInfo->xLayoutManager = getLayoutManager();
+ pStateChangedInfo->bDisabled = eState & SFX_ITEM_DISABLED;
+ Application::PostUserEvent( STATIC_LINK( 0, TbxControls, StateChangedHdl_Impl ), pStateChangedInfo );
+ }
+
if( pState )
{
SfxAllEnumItem* pItem = PTR_CAST(SfxAllEnumItem, pState);
@@ -240,10 +284,8 @@ void TbxControls::Select( USHORT nModifier )
SfxPopupWindow* TbxControls::CreatePopupWindow()
{
if ( GetSlotId() == SID_CHOOSE_CONTROLS )
- {
- rtl::OUString aSubToolBarResName( RTL_CONSTASCII_USTRINGPARAM( "private:resource/toolbar/insertcontrolsbar" ));
createAndPositionSubToolBar( aSubToolBarResName );
- }
+
/*
if (GetId() == SID_CHOOSE_CONTROLS)
{