diff options
author | Release Engineering <releng@openoffice.org> | 2010-06-16 09:47:53 +0200 |
---|---|---|
committer | Release Engineering <releng@openoffice.org> | 2010-06-16 09:47:53 +0200 |
commit | 41436227fd2108d59e52cdd217d73604613ce02e (patch) | |
tree | a5ef8033ca652be93dd19e7e6b3fc4911289e197 /svtools | |
parent | d4741b8cb17b32ed902e60024649d6273e99f617 (diff) |
masterfix: #i10000# resolve merge problems
Diffstat (limited to 'svtools')
-rw-r--r-- | svtools/inc/svtools/toolboxcontroller.hxx | 1 | ||||
-rw-r--r-- | svtools/source/uno/toolboxcontroller.cxx | 39 |
2 files changed, 40 insertions, 0 deletions
diff --git a/svtools/inc/svtools/toolboxcontroller.hxx b/svtools/inc/svtools/toolboxcontroller.hxx index f636178881d0..7a49b294759c 100644 --- a/svtools/inc/svtools/toolboxcontroller.hxx +++ b/svtools/inc/svtools/toolboxcontroller.hxx @@ -133,6 +133,7 @@ class SVT_DLLPUBLIC ToolboxController : public ::com::sun::star::frame::XStatusL void enable( bool bEnable ); protected: + bool getToolboxId( sal_uInt16& rItemId, ToolBox** ppToolBox ); void setSupportVisiableProperty(sal_Bool bValue); //shizhoubo struct Listener { diff --git a/svtools/source/uno/toolboxcontroller.cxx b/svtools/source/uno/toolboxcontroller.cxx index 36c1374ba9fb..0af47339dc58 100644 --- a/svtools/source/uno/toolboxcontroller.cxx +++ b/svtools/source/uno/toolboxcontroller.cxx @@ -808,6 +808,45 @@ throw( com::sun::star::uno::Exception) this->setSupportVisiableProperty( rValue ); } } + +void ToolboxController::enable( bool bEnable ) +{ + ToolBox* pToolBox = 0; + sal_uInt16 nItemId = 0; + if( getToolboxId( nItemId, &pToolBox ) ) + { + pToolBox->EnableItem( nItemId, bEnable ? TRUE : FALSE ); + } +} + +bool ToolboxController::getToolboxId( sal_uInt16& rItemId, ToolBox** ppToolBox ) +{ + if( (m_pImpl->m_nToolBoxId != SAL_MAX_UINT16) && (ppToolBox == 0) ) + return m_pImpl->m_nToolBoxId; + + ToolBox* pToolBox = static_cast< ToolBox* >( VCLUnoHelper::GetWindow( getParent() ) ); + + if( (m_pImpl->m_nToolBoxId == SAL_MAX_UINT16) && pToolBox ) + { + const sal_uInt16 nCount = pToolBox->GetItemCount(); + for ( sal_uInt16 nPos = 0; nPos < nCount; ++nPos ) + { + const sal_uInt16 nItemId = pToolBox->GetItemId( nPos ); + if ( pToolBox->GetItemCommand( nItemId ) == String( m_aCommandURL ) ) + { + m_pImpl->m_nToolBoxId = nItemId; + break; + } + } + } + + if( ppToolBox ) + *ppToolBox = pToolBox; + + rItemId = m_pImpl->m_nToolBoxId; + + return (rItemId != SAL_MAX_UINT16) && (( ppToolBox == 0) || (*ppToolBox != 0) ); +} //end } // svt |