Kaydet (Commit) d2d58644 authored tarafından Stephan Bergmann's avatar Stephan Bergmann

TabControl::DeactivatePage should return bool

Change-Id: I9fb774a235db2b9bc759976d2d3f84363ed944ec
üst 697e84f5
...@@ -86,7 +86,7 @@ class DataSourceTabControl : public TabControl ...@@ -86,7 +86,7 @@ class DataSourceTabControl : public TabControl
public: public:
DataSourceTabControl(Window* pParent); DataSourceTabControl(Window* pParent);
virtual long DeactivatePage(); virtual bool DeactivatePage() SAL_OVERRIDE;
void DisableTabToggling(); void DisableTabToggling();
void EnableTabToggling(); void EnableTabToggling();
...@@ -101,14 +101,9 @@ DataSourceTabControl::DataSourceTabControl(Window* pParent) ...@@ -101,14 +101,9 @@ DataSourceTabControl::DataSourceTabControl(Window* pParent)
{ {
} }
// Note that the result is long, but is intended to be a bool bool DataSourceTabControl::DeactivatePage()
long DataSourceTabControl::DeactivatePage()
{ {
bool bCanDeactivate( TabControl::DeactivatePage() != 0 ); return TabControl::DeactivatePage() && m_bTogglingEnabled;
bCanDeactivate = (bCanDeactivate && m_bTogglingEnabled);
return (bCanDeactivate ? 1 : 0 );
} }
void DataSourceTabControl::DisableTabToggling() void DataSourceTabControl::DisableTabToggling()
......
...@@ -100,7 +100,7 @@ public: ...@@ -100,7 +100,7 @@ public:
virtual bool PreNotify( NotifyEvent& rNEvt ); virtual bool PreNotify( NotifyEvent& rNEvt );
virtual void ActivatePage(); virtual void ActivatePage();
virtual long DeactivatePage(); virtual bool DeactivatePage();
virtual Size GetOptimalSize() const; virtual Size GetOptimalSize() const;
......
...@@ -1698,12 +1698,9 @@ void TabControl::ActivatePage() ...@@ -1698,12 +1698,9 @@ void TabControl::ActivatePage()
// ----------------------------------------------------------------------- // -----------------------------------------------------------------------
long TabControl::DeactivatePage() bool TabControl::DeactivatePage()
{ {
if ( maDeactivateHdl.IsSet() ) return !maDeactivateHdl.IsSet() || maDeactivateHdl.Call( this );
return maDeactivateHdl.Call( this );
else
return sal_True;
} }
// ----------------------------------------------------------------------- // -----------------------------------------------------------------------
......
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