Merge branch 'rochade' into master
[alioth/musescore.git] / debian / patches / upstream / crash-fontname.diff
1 Origin: upstream, commit:443ead70ac77c655095a67bfc0978145fda0c5de
2 Author: Matt McClinch <mattmcclinch@gmail.com>
3 Description: Fix #303619: MuseScore crashing when entering font name
4  Resolves: https://musescore.org/en/node/303619.
5  .
6  Passing an empty string to QWidget::setStyleSheet() causes the widget's
7  current style sheet to be removed, thus causing the widget's style to be
8  inherited from its parent. This creates a problem in QComboBox::showPopup(),
9  where it becomes possible that a pointer to a QStyle object could used after
10  the object itself has been destroyed. A style sheet of " " can be used to
11  override any previous style sheet without invalidating the current QStyle
12  object.
13
14 --- a/mscore/inspector/inspectorBase.cpp
15 +++ b/mscore/inspector/inspectorBase.cpp
16 @@ -344,7 +344,7 @@ void InspectorBase::checkDifferentValues
17                    if (valuesAreDifferent)
18                          break;
19                    }
20 -            ii.w->setStyleSheet(valuesAreDifferent ? QString("* { color: %1 }").arg(c.name()) : "");
21 +            ii.w->setStyleSheet(valuesAreDifferent ? QString("* { color: %1 }").arg(c.name()) : " ");
22              }
23  
24        //deal with reset if only one element, or if values are the same
25 @@ -359,12 +359,12 @@ void InspectorBase::checkDifferentValues
26                          enableReset = false;
27                          break;
28                    case PropertyFlags::UNSTYLED:
29 -                        ii.w->setStyleSheet("");
30 +                        ii.w->setStyleSheet(" ");
31                          enableReset = true;
32                          break;
33                    case PropertyFlags::NOSTYLE:
34                          enableReset = !isDefault(ii);
35 -                        ii.w->setStyleSheet("");
36 +                        ii.w->setStyleSheet(" ");
37                          break;
38                    }
39              }