summaryrefslogtreecommitdiff
path: root/framework/source/services/backingwindow.cxx
diff options
context:
space:
mode:
authorIvan Timofeev <timofeev.i.s@gmail.com>2012-09-20 21:18:11 +0400
committerIvan Timofeev <timofeev.i.s@gmail.com>2012-09-22 14:32:05 +0400
commitb40f95f9159c3868a059b33fb524ccc7ed182272 (patch)
treeba6c620c2a4eca9dd4f956a43a40b6d868a6176f /framework/source/services/backingwindow.cxx
parentecf56eda2fa41a5bed01294670e82d61c0f98798 (diff)
fdo#34392: request button size after vcl has updated its settings
Change-Id: I1810562a2c0c09404271be5b910f5811fce3e465
Diffstat (limited to 'framework/source/services/backingwindow.cxx')
-rw-r--r--framework/source/services/backingwindow.cxx26
1 files changed, 18 insertions, 8 deletions
diff --git a/framework/source/services/backingwindow.cxx b/framework/source/services/backingwindow.cxx
index cc67aab9a990..008f463b6cc4 100644
--- a/framework/source/services/backingwindow.cxx
+++ b/framework/source/services/backingwindow.cxx
@@ -193,6 +193,10 @@ BackingWindow::BackingWindow( Window* i_pParent ) :
// clean up resource stack
FreeResource();
+ // fdo#34392: we do the layout dynamically, the layout depends on the font,
+ // so we should handle data changed events (font changing) of the last child
+ // control, at this point all the controls have updated settings (i.e. font).
+ maToolbox.AddEventListener( LINK( this, BackingWindow, WindowEventListener ) );
EnableChildTransparentMode();
SetStyle( GetStyle() | WB_DIALOGCONTROL );
@@ -249,6 +253,7 @@ BackingWindow::BackingWindow( Window* i_pParent ) :
BackingWindow::~BackingWindow()
{
+ maToolbox.RemoveEventListener( LINK( this, BackingWindow, WindowEventListener ) );
delete mpRecentMenu;
delete mpAccExec;
}
@@ -267,17 +272,22 @@ class ImageContainerRes : public Resource
~ImageContainerRes() { FreeResource(); }
};
-void BackingWindow::DataChanged( const DataChangedEvent& rDCEvt )
+IMPL_LINK( BackingWindow, WindowEventListener, VclSimpleEvent*, pEvent )
{
- Window::DataChanged( rDCEvt );
-
- if ( rDCEvt.GetFlags() & SETTINGS_STYLE )
+ VclWindowEvent* pWinEvent = dynamic_cast<VclWindowEvent*>( pEvent );
+ if ( pWinEvent && pWinEvent->GetId() == VCLEVENT_WINDOW_DATACHANGED )
{
- initBackground();
- Invalidate();
- // fdo#34392: Resize buttons to match the new text size.
- Resize();
+ DataChangedEvent* pDCEvt =
+ static_cast<DataChangedEvent*>( pWinEvent->GetData() );
+ if ( pDCEvt->GetFlags() & SETTINGS_STYLE )
+ {
+ initBackground();
+ Invalidate();
+ // fdo#34392: Resize buttons to match the new text size.
+ Resize();
+ }
}
+ return 0;
}
void BackingWindow::prepareRecentFileMenu()