From 78933732e987ac992e3ecefa5107c2d1695c46c6 Mon Sep 17 00:00:00 2001 From: ws Date: Mon, 17 Dec 2018 15:49:57 +0100 Subject: [PATCH] fix #276153 Select>more... by subtype does not work to select by text style --- libmscore/dynamic.h | 4 ++-- libmscore/score.cpp | 3 +-- libmscore/stafftextbase.h | 2 -- libmscore/textbase.cpp | 2 +- libmscore/textbase.h | 4 ++-- mscore/selectdialog.cpp | 2 +- 6 files changed, 7 insertions(+), 10 deletions(-) diff --git a/libmscore/dynamic.h b/libmscore/dynamic.h index 8800042a2b220..476e1f8c9c6a5 100644 --- a/libmscore/dynamic.h +++ b/libmscore/dynamic.h @@ -88,8 +88,8 @@ class Dynamic final : public TextBase { void setDynamicType(const QString&); QString dynamicTypeName() const; Type dynamicType() const { return _dynamicType; } - virtual int subtype() const { return (int) _dynamicType; } - virtual QString subtypeName() const { return dynamicTypeName(); } + virtual int subtype() const override { return (int) _dynamicType; } + virtual QString subtypeName() const override { return dynamicTypeName(); } virtual void layout() override; virtual void write(XmlWriter& xml) const override; diff --git a/libmscore/score.cpp b/libmscore/score.cpp index 20484d99e84ec..8d76fe26ca4e4 100644 --- a/libmscore/score.cpp +++ b/libmscore/score.cpp @@ -3047,8 +3047,7 @@ void Score::collectMatch(void* data, Element* e) else if (p->subtypeValid && p->subtype != e->subtype()) return; - if ((p->staffStart != -1) - && ((p->staffStart > e->staffIdx()) || (p->staffEnd <= e->staffIdx()))) + if ((p->staffStart != -1) && ((p->staffStart > e->staffIdx()) || (p->staffEnd <= e->staffIdx()))) return; if (p->voice != -1 && p->voice != e->voice()) diff --git a/libmscore/stafftextbase.h b/libmscore/stafftextbase.h index 3405e4ba495fc..51376c1d5b53e 100644 --- a/libmscore/stafftextbase.h +++ b/libmscore/stafftextbase.h @@ -47,8 +47,6 @@ class StaffTextBase : public TextBase { virtual void write(XmlWriter& xml) const override; virtual void read(XmlReader&) override; virtual bool readProperties(XmlReader&) override; - virtual int subtype() const { return 0; } // TODO::ws - virtual QString subtypeName() const { return "??"; } Segment* segment() const; QString channelName(int voice) const { return _channelNames[voice]; } diff --git a/libmscore/textbase.cpp b/libmscore/textbase.cpp index 15e27b87a2840..8f4ccb79ff2d9 100644 --- a/libmscore/textbase.cpp +++ b/libmscore/textbase.cpp @@ -2149,7 +2149,7 @@ QString TextBase::screenReaderInfo() const int TextBase::subtype() const { - return int(Tid()); + return int(tid()); } //--------------------------------------------------------- diff --git a/libmscore/textbase.h b/libmscore/textbase.h index 286995adcb738..04dba4e1a08dd 100644 --- a/libmscore/textbase.h +++ b/libmscore/textbase.h @@ -318,8 +318,8 @@ class TextBase : public Element { virtual QString accessibleInfo() const override; virtual QString screenReaderInfo() const override; - virtual int subtype() const; - virtual QString subtypeName() const; + virtual int subtype() const override; + virtual QString subtypeName() const override; QList fragmentList() const; // for MusicXML formatted export diff --git a/mscore/selectdialog.cpp b/mscore/selectdialog.cpp index ea68f780cc842..eef3466b992de 100644 --- a/mscore/selectdialog.cpp +++ b/mscore/selectdialog.cpp @@ -79,7 +79,7 @@ SelectDialog::SelectDialog(const Element* _e, QWidget* parent) void SelectDialog::setPattern(ElementPattern* p) { p->type = int(e->type()); - p->subtype = int(e->subtype()); + p->subtype = e->subtype(); if (e->isSlurSegment()) p->subtype = int(toSlurSegment(e)->spanner()->type());