Kaydet (Commit) 966daa8e authored tarafından Maxim Monastirsky's avatar Maxim Monastirsky

Set ToolBoxItemBits inside the controller

Don't rely on the toolbar:style attribute of the toolbar xml,
because it's not available after toolbar customization, or
when placing the button on a different toolbar.

See 99ace739 for a similar fix.

Change-Id: Ia9485cafe111ba609fe802c984be1aa9db3a2ca9
üst fdc51831
...@@ -243,6 +243,17 @@ vcl::Window* ExtrusionDirectionControl::createPopupWindow( vcl::Window* pParent ...@@ -243,6 +243,17 @@ vcl::Window* ExtrusionDirectionControl::createPopupWindow( vcl::Window* pParent
return new ExtrusionDirectionWindow( *this, m_xFrame, pParent ); return new ExtrusionDirectionWindow( *this, m_xFrame, pParent );
} }
// XInitialization
void SAL_CALL ExtrusionDirectionControl::initialize( const css::uno::Sequence< css::uno::Any >& aArguments )
throw ( css::uno::Exception, css::uno::RuntimeException, std::exception )
{
svt::PopupWindowController::initialize( aArguments );
ToolBox* pToolBox = 0;
sal_uInt16 nId = 0;
if ( getToolboxId( nId, &pToolBox ) )
pToolBox->SetItemBits( nId, pToolBox->GetItemBits( nId ) | ToolBoxItemBits::DROPDOWNONLY );
}
// XServiceInfo // XServiceInfo
...@@ -493,7 +504,17 @@ vcl::Window* ExtrusionDepthController::createPopupWindow( vcl::Window* pParent ) ...@@ -493,7 +504,17 @@ vcl::Window* ExtrusionDepthController::createPopupWindow( vcl::Window* pParent )
return new ExtrusionDepthWindow( *this, m_xFrame, pParent ); return new ExtrusionDepthWindow( *this, m_xFrame, pParent );
} }
// XInitialization
void SAL_CALL ExtrusionDepthController::initialize( const css::uno::Sequence< css::uno::Any >& aArguments )
throw ( css::uno::Exception, css::uno::RuntimeException, std::exception )
{
svt::PopupWindowController::initialize( aArguments );
ToolBox* pToolBox = 0;
sal_uInt16 nId = 0;
if ( getToolboxId( nId, &pToolBox ) )
pToolBox->SetItemBits( nId, pToolBox->GetItemBits( nId ) | ToolBoxItemBits::DROPDOWNONLY );
}
// XServiceInfo // XServiceInfo
...@@ -750,6 +771,17 @@ vcl::Window* ExtrusionLightingControl::createPopupWindow( vcl::Window* pParent ) ...@@ -750,6 +771,17 @@ vcl::Window* ExtrusionLightingControl::createPopupWindow( vcl::Window* pParent )
return new ExtrusionLightingWindow( *this, m_xFrame, pParent ); return new ExtrusionLightingWindow( *this, m_xFrame, pParent );
} }
// XInitialization
void SAL_CALL ExtrusionLightingControl::initialize( const css::uno::Sequence< css::uno::Any >& aArguments )
throw ( css::uno::Exception, css::uno::RuntimeException, std::exception )
{
svt::PopupWindowController::initialize( aArguments );
ToolBox* pToolBox = 0;
sal_uInt16 nId = 0;
if ( getToolboxId( nId, &pToolBox ) )
pToolBox->SetItemBits( nId, pToolBox->GetItemBits( nId ) | ToolBoxItemBits::DROPDOWNONLY );
}
// XServiceInfo // XServiceInfo
...@@ -893,6 +925,17 @@ vcl::Window* ExtrusionSurfaceControl::createPopupWindow( vcl::Window* pParent ) ...@@ -893,6 +925,17 @@ vcl::Window* ExtrusionSurfaceControl::createPopupWindow( vcl::Window* pParent )
return new ExtrusionSurfaceWindow( *this, m_xFrame, pParent ); return new ExtrusionSurfaceWindow( *this, m_xFrame, pParent );
} }
// XInitialization
void SAL_CALL ExtrusionSurfaceControl::initialize( const css::uno::Sequence< css::uno::Any >& aArguments )
throw ( css::uno::Exception, css::uno::RuntimeException, std::exception )
{
svt::PopupWindowController::initialize( aArguments );
ToolBox* pToolBox = 0;
sal_uInt16 nId = 0;
if ( getToolboxId( nId, &pToolBox ) )
pToolBox->SetItemBits( nId, pToolBox->GetItemBits( nId ) | ToolBoxItemBits::DROPDOWNONLY );
}
// XServiceInfo // XServiceInfo
......
...@@ -73,6 +73,10 @@ public: ...@@ -73,6 +73,10 @@ public:
virtual vcl::Window* createPopupWindow( vcl::Window* pParent ) SAL_OVERRIDE; virtual vcl::Window* createPopupWindow( vcl::Window* pParent ) SAL_OVERRIDE;
// XInitialization
virtual void SAL_CALL initialize( const css::uno::Sequence< css::uno::Any >& aArguments )
throw ( css::uno::Exception, css::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
// XServiceInfo // XServiceInfo
virtual OUString SAL_CALL getImplementationName() throw( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE; virtual OUString SAL_CALL getImplementationName() throw( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() throw( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE; virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() throw( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
...@@ -121,6 +125,10 @@ public: ...@@ -121,6 +125,10 @@ public:
virtual vcl::Window* createPopupWindow( vcl::Window* pParent ) SAL_OVERRIDE; virtual vcl::Window* createPopupWindow( vcl::Window* pParent ) SAL_OVERRIDE;
// XInitialization
virtual void SAL_CALL initialize( const css::uno::Sequence< css::uno::Any >& aArguments )
throw ( css::uno::Exception, css::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
// XServiceInfo // XServiceInfo
virtual OUString SAL_CALL getImplementationName() throw( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE; virtual OUString SAL_CALL getImplementationName() throw( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() throw( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE; virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() throw( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
...@@ -172,6 +180,10 @@ public: ...@@ -172,6 +180,10 @@ public:
virtual vcl::Window* createPopupWindow( vcl::Window* pParent ) SAL_OVERRIDE; virtual vcl::Window* createPopupWindow( vcl::Window* pParent ) SAL_OVERRIDE;
// XInitialization
virtual void SAL_CALL initialize( const css::uno::Sequence< css::uno::Any >& aArguments )
throw ( css::uno::Exception, css::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
// XServiceInfo // XServiceInfo
virtual OUString SAL_CALL getImplementationName() throw( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE; virtual OUString SAL_CALL getImplementationName() throw( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() throw( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE; virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() throw( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
...@@ -212,6 +224,10 @@ public: ...@@ -212,6 +224,10 @@ public:
virtual vcl::Window* createPopupWindow( vcl::Window* pParent ) SAL_OVERRIDE; virtual vcl::Window* createPopupWindow( vcl::Window* pParent ) SAL_OVERRIDE;
// XInitialization
virtual void SAL_CALL initialize( const css::uno::Sequence< css::uno::Any >& aArguments )
throw ( css::uno::Exception, css::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
// XServiceInfo // XServiceInfo
virtual OUString SAL_CALL getImplementationName() throw( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE; virtual OUString SAL_CALL getImplementationName() throw( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() throw( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE; virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() throw( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
......
...@@ -419,6 +419,10 @@ public: ...@@ -419,6 +419,10 @@ public:
virtual vcl::Window* createPopupWindow( vcl::Window* pParent ) SAL_OVERRIDE; virtual vcl::Window* createPopupWindow( vcl::Window* pParent ) SAL_OVERRIDE;
// XInitialization
virtual void SAL_CALL initialize( const css::uno::Sequence< css::uno::Any >& aArguments )
throw ( css::uno::Exception, css::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
// XServiceInfo // XServiceInfo
virtual OUString SAL_CALL getImplementationName() throw( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE; virtual OUString SAL_CALL getImplementationName() throw( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() throw( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE; virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() throw( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
...@@ -441,6 +445,17 @@ vcl::Window* FontworkAlignmentControl::createPopupWindow( vcl::Window* pParent ) ...@@ -441,6 +445,17 @@ vcl::Window* FontworkAlignmentControl::createPopupWindow( vcl::Window* pParent )
return new FontworkAlignmentWindow( *this, m_xFrame, pParent ); return new FontworkAlignmentWindow( *this, m_xFrame, pParent );
} }
// XInitialization
void SAL_CALL FontworkAlignmentControl::initialize( const css::uno::Sequence< css::uno::Any >& aArguments )
throw ( css::uno::Exception, css::uno::RuntimeException, std::exception )
{
svt::PopupWindowController::initialize( aArguments );
ToolBox* pToolBox = 0;
sal_uInt16 nId = 0;
if ( getToolboxId( nId, &pToolBox ) )
pToolBox->SetItemBits( nId, pToolBox->GetItemBits( nId ) | ToolBoxItemBits::DROPDOWNONLY );
}
// XServiceInfo // XServiceInfo
...@@ -650,6 +665,10 @@ public: ...@@ -650,6 +665,10 @@ public:
virtual vcl::Window* createPopupWindow( vcl::Window* pParent ) SAL_OVERRIDE; virtual vcl::Window* createPopupWindow( vcl::Window* pParent ) SAL_OVERRIDE;
// XInitialization
virtual void SAL_CALL initialize( const css::uno::Sequence< css::uno::Any >& aArguments )
throw ( css::uno::Exception, css::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
// XServiceInfo // XServiceInfo
virtual OUString SAL_CALL getImplementationName() throw( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE; virtual OUString SAL_CALL getImplementationName() throw( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() throw( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE; virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() throw( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
...@@ -670,6 +689,17 @@ vcl::Window* FontworkCharacterSpacingControl::createPopupWindow( vcl::Window* pP ...@@ -670,6 +689,17 @@ vcl::Window* FontworkCharacterSpacingControl::createPopupWindow( vcl::Window* pP
return new FontworkCharacterSpacingWindow( *this, m_xFrame, pParent ); return new FontworkCharacterSpacingWindow( *this, m_xFrame, pParent );
} }
// XInitialization
void SAL_CALL FontworkCharacterSpacingControl::initialize( const css::uno::Sequence< css::uno::Any >& aArguments )
throw ( css::uno::Exception, css::uno::RuntimeException, std::exception )
{
svt::PopupWindowController::initialize( aArguments );
ToolBox* pToolBox = 0;
sal_uInt16 nId = 0;
if ( getToolboxId( nId, &pToolBox ) )
pToolBox->SetItemBits( nId, pToolBox->GetItemBits( nId ) | ToolBoxItemBits::DROPDOWNONLY );
}
// XServiceInfo // XServiceInfo
......
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