Allow STYLE_OPTION_MONO to be unset from toolkit-created window
This was keeping form controls (e.g. CheckBox and RadioButton) to transition from flat style to 3d style, while the 3d-to-flat transition was allowed, making flat some unescapable pit of doom. Whatever the goal of that pinning, it will have to be achieved in a different way. Change-Id: Icc4dfb9673a7dfe4a7d8726fbfd23f75499f8b41
This commit is contained in:
@@ -136,7 +136,6 @@ public:
|
|||||||
virtual bool Notify( NotifyEvent& rNEvt ) SAL_OVERRIDE;
|
virtual bool Notify( NotifyEvent& rNEvt ) SAL_OVERRIDE;
|
||||||
virtual void StateChanged( StateChangedType nStateChange ) SAL_OVERRIDE;
|
virtual void StateChanged( StateChangedType nStateChange ) SAL_OVERRIDE;
|
||||||
virtual void Resize() SAL_OVERRIDE;
|
virtual void Resize() SAL_OVERRIDE;
|
||||||
virtual void DataChanged( const DataChangedEvent& rDCEvt ) SAL_OVERRIDE;
|
|
||||||
|
|
||||||
// invalidates layout data
|
// invalidates layout data
|
||||||
virtual void SetText( const OUString& rStr ) SAL_OVERRIDE;
|
virtual void SetText( const OUString& rStr ) SAL_OVERRIDE;
|
||||||
|
@@ -368,31 +368,6 @@ void Control::ImplDrawFrame( OutputDevice* pDev, Rectangle& rRect )
|
|||||||
pDev->OutputDevice::SetSettings( aOriginalSettings );
|
pDev->OutputDevice::SetSettings( aOriginalSettings );
|
||||||
}
|
}
|
||||||
|
|
||||||
void Control::DataChanged( const DataChangedEvent& rDCEvt)
|
|
||||||
{
|
|
||||||
// we don't want to lose some style settings for controls created with the
|
|
||||||
// toolkit
|
|
||||||
if ( IsCreatedWithToolkit() &&
|
|
||||||
(rDCEvt.GetType() == DATACHANGED_SETTINGS) &&
|
|
||||||
(rDCEvt.GetFlags() & SETTINGS_STYLE) )
|
|
||||||
{
|
|
||||||
const AllSettings* pOldSettings = rDCEvt.GetOldSettings();
|
|
||||||
|
|
||||||
AllSettings aSettings = GetSettings();
|
|
||||||
StyleSettings aStyleSettings = aSettings.GetStyleSettings();
|
|
||||||
sal_uLong nNewOptions = aStyleSettings.GetOptions();
|
|
||||||
|
|
||||||
if ( pOldSettings && !(nNewOptions & STYLE_OPTION_MONO) && ( pOldSettings->GetStyleSettings().GetOptions() & STYLE_OPTION_MONO ) )
|
|
||||||
{
|
|
||||||
nNewOptions |= STYLE_OPTION_MONO;
|
|
||||||
aStyleSettings.SetOptions( nNewOptions );
|
|
||||||
aStyleSettings.SetMonoColor( pOldSettings->GetStyleSettings().GetMonoColor() );
|
|
||||||
aSettings.SetStyleSettings( aStyleSettings );
|
|
||||||
SetSettings( aSettings );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
ControlLayoutData::~ControlLayoutData()
|
ControlLayoutData::~ControlLayoutData()
|
||||||
{
|
{
|
||||||
if( m_pParent )
|
if( m_pParent )
|
||||||
|
Reference in New Issue
Block a user