Skip to content

Commit

Permalink
Prevention of any virtual function being called by constructors or de…
Browse files Browse the repository at this point in the history
…structors
  • Loading branch information
gansm committed Jul 20, 2024
1 parent 9d21e82 commit 10082c5
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 12 deletions.
6 changes: 3 additions & 3 deletions final/menu/fmenubar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -231,9 +231,9 @@ void FMenuBar::init()
if ( getRootWidget() )
getRootWidget()->setTopPadding(1, true);

addAccelerator (FKey::F10);
addAccelerator (FKey::Ctrl_space);
addAccelerator (FKey::Menu);
FMenuBar::addAccelerator (FKey::F10);
FMenuBar::addAccelerator (FKey::Ctrl_space);
FMenuBar::addAccelerator (FKey::Menu);
FMenuBar::resetColors();
unsetFocusable();
}
Expand Down
4 changes: 2 additions & 2 deletions final/widget/fbutton.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ FButton::FButton (FString&& txt, FWidget* parent)
//----------------------------------------------------------------------
FButton::~FButton() // destructor
{
FButton::delAccelerator();
FButton::delAccelerator(this);
delOwnTimers();
}

Expand Down Expand Up @@ -380,7 +380,7 @@ inline void FButton::detectHotkey()
{
if ( isEnabled() )
{
FButton::delAccelerator();
FButton::delAccelerator(this);
setHotkeyAccelerator();
}
}
Expand Down
2 changes: 1 addition & 1 deletion final/widget/flabel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ void FLabel::setText (const FString& txt)

if ( isEnabled() )
{
FWidget::delAccelerator();
FWidget::delAccelerator(this);
setHotkeyAccelerator();
}
}
Expand Down
4 changes: 2 additions & 2 deletions final/widget/flineedit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -559,9 +559,9 @@ void FLineEdit::init()
mapKeyFunctions();

if ( isReadOnly() )
FLineEdit::unsetVisibleCursor();
FLineEdit::setVisibleCursor(false);
else
FLineEdit::setVisibleCursor();
FLineEdit::setVisibleCursor(true);
}

//----------------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion final/widget/fscrollview.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ void FScrollView::setScrollSize (const FSize& size)
scroll_geometry.setSize (width, height);
resizeArea (scroll_geometry, viewport.get());
setColor();
clearArea();
FScrollView::clearArea();
addPreprocessingHandler
(
F_PREPROC_HANDLER (this, &FScrollView::copy2area)
Expand Down
2 changes: 1 addition & 1 deletion final/widget/fstatusbar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ FStatusKey::~FStatusKey() // destructor
if ( getConnectedStatusbar() )
getConnectedStatusbar()->remove(this);

FStatusKey::delAccelerator();
FStatusKey::delAccelerator(this);
}


Expand Down
4 changes: 2 additions & 2 deletions final/widget/ftogglebutton.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ FToggleButton::FToggleButton (const FString& txt, FWidget* parent)
//----------------------------------------------------------------------
FToggleButton::~FToggleButton() // destructor
{
FToggleButton::delAccelerator();
FToggleButton::delAccelerator(this);

if ( hasGroup() )
getGroup()->remove(this);
Expand Down Expand Up @@ -176,7 +176,7 @@ void FToggleButton::setText (const FString& txt)

if ( isEnabled() )
{
FToggleButton::delAccelerator();
FToggleButton::delAccelerator(this);
setHotkeyAccelerator();
}
}
Expand Down

0 comments on commit 10082c5

Please sign in to comment.