summaryrefslogtreecommitdiff
path: root/svx/source/tbxctrls/tbunosearchcontrollers.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'svx/source/tbxctrls/tbunosearchcontrollers.cxx')
-rw-r--r--svx/source/tbxctrls/tbunosearchcontrollers.cxx17
1 files changed, 14 insertions, 3 deletions
diff --git a/svx/source/tbxctrls/tbunosearchcontrollers.cxx b/svx/source/tbxctrls/tbunosearchcontrollers.cxx
index e41751c6beac..5177177ebca3 100644
--- a/svx/source/tbxctrls/tbunosearchcontrollers.cxx
+++ b/svx/source/tbxctrls/tbunosearchcontrollers.cxx
@@ -1196,6 +1196,9 @@ public:
// XStatusListener
virtual void SAL_CALL statusChanged( const css::frame::FeatureStateEvent& rEvent ) override;
+
+private:
+ VclPtr<vcl::Window> m_pSL;
};
SearchLabelToolboxController::SearchLabelToolboxController( const css::uno::Reference< css::uno::XComponentContext > & rxContext )
@@ -1250,6 +1253,7 @@ void SAL_CALL SearchLabelToolboxController::dispose()
SearchToolbarControllersManager::createControllersManager().freeController(m_xFrame, m_aCommandURL);
svt::ToolboxController::dispose();
+ m_pSL.disposeAndClear();
}
// XInitialization
@@ -1262,13 +1266,20 @@ void SAL_CALL SearchLabelToolboxController::initialize( const css::uno::Sequence
// XStatusListener
void SAL_CALL SearchLabelToolboxController::statusChanged( const css::frame::FeatureStateEvent& )
{
+ if (m_pSL)
+ {
+ OUString aStr = SvxSearchDialogWrapper::GetSearchLabel();
+ m_pSL->SetText(aStr);
+ long aWidth = !aStr.isEmpty() ? m_pSL->get_preferred_size().getWidth() : 300;
+ m_pSL->SetSizePixel(Size(aWidth, m_pSL->get_preferred_size().getHeight()));
+ }
}
css::uno::Reference< css::awt::XWindow > SAL_CALL SearchLabelToolboxController::createItemWindow( const css::uno::Reference< css::awt::XWindow >& Parent )
{
- VclPtr<vcl::Window> pSL = VclPtr<FixedText>::Create(VCLUnoHelper::GetWindow( Parent ));
- pSL->SetSizePixel(Size(250, 25));
- return VCLUnoHelper::GetInterface(pSL);
+ m_pSL = VclPtr<FixedText>::Create(VCLUnoHelper::GetWindow( Parent ));
+ m_pSL->SetSizePixel(Size(300, 25));
+ return VCLUnoHelper::GetInterface(m_pSL);
}
// protocol handler for "vnd.sun.star.findbar:*" URLs