diff options
author | Herbert Dürr <hdu@apache.org> | 2013-03-21 15:27:40 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2013-05-10 09:46:56 +0100 |
commit | c2cb5f47f04cfce498943bad08d18b891c680f19 (patch) | |
tree | fd33d2c1944ec1200351e0e5bf228b3dc5da593d /vcl/unx/kde | |
parent | 064457db3ede211d3130f42c9dfaa17ea24a6aa5 (diff) |
Related: #i112873# check native widget's control value type...
before converting to SpinbuttonValue or ScrollbarValue
Else problems like #i112873# or even crashes can and do happen.
(cherry picked from commit d2fde1d34c3c28572b1b6b4780269c15dd4c2bef)
Conflicts:
vcl/unx/kde/salnativewidgets-kde.cxx
Change-Id: I6429205ab41b3194577bc50aa02384c920e11ed2
Diffstat (limited to 'vcl/unx/kde')
-rw-r--r-- | vcl/unx/kde/salnativewidgets-kde.cxx | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/vcl/unx/kde/salnativewidgets-kde.cxx b/vcl/unx/kde/salnativewidgets-kde.cxx index dcce289cd323..b1dd7f859a3c 100644 --- a/vcl/unx/kde/salnativewidgets-kde.cxx +++ b/vcl/unx/kde/salnativewidgets-kde.cxx @@ -559,7 +559,7 @@ sal_Bool WidgetPainter::drawStyledWidget( QWidget *pWidget, } else if ( strcmp( QSpinWidget_String, pClassName ) == 0 ) { - const SpinbuttonValue *pValue = static_cast<const SpinbuttonValue *> ( &aValue ); + const SpinbuttonValue* pValue = (aValue.getType() == CTRL_SPINBUTTONS) ? static_cast<const SpinbuttonValue*>(&aValue) : NULL; // Is any of the buttons pressed? QStyle::SCFlags eActive = QStyle::SC_None; @@ -648,7 +648,7 @@ sal_Bool WidgetPainter::drawStyledWidget( QWidget *pWidget, } else if ( strcmp( QScrollBar_String, pClassName ) == 0 ) { - const ScrollbarValue *pValue = static_cast<const ScrollbarValue *> ( &aValue ); + const ScrollbarValue* pScrollbarVal = (aValue.getType() == CTRL_SCROLLBAR) ? static_cast<const ScrollbarValue*>(&aValue) : NULL; QStyle::SCFlags eActive = QStyle::SC_None; if ( pValue ) @@ -1052,7 +1052,7 @@ QScrollBar *WidgetPainter::scrollBar( const Rectangle& rControlRegion, m_pScrollBar->resize( qRect.size() ); m_pScrollBar->setOrientation( bHorizontal? Qt::Horizontal: Qt::Vertical ); - const ScrollbarValue *pValue = static_cast<const ScrollbarValue *> ( &aValue ); + const ScrollbarValue* pScrollbarVal = (aValue.getType() == CTRL_SCROLLBAR) ? static_cast<const ScrollbarValue*>(&aValue) : NULL; if ( pValue ) { m_pScrollBar->setMinValue( pValue->mnMin ); |