Skip to content

Commit

Permalink
Revert "fix #102571 Hang/crash by copy-paste all a system of linked s…
Browse files Browse the repository at this point in the history
…taves containing lines"

This reverts commit 264ce26.
  • Loading branch information
wschweer committed Dec 18, 2018
1 parent 739386b commit 9549474
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 51 deletions.
5 changes: 1 addition & 4 deletions libmscore/edit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4309,10 +4309,7 @@ void Score::undoAddElement(Element* element)
}
}
}
if (!alreadyInList(nsp))
undo(new AddElement(nsp));
else
qDebug("%s already there", nsp->name());
undo(new AddElement(nsp));
}
else if (et == ElementType::GLISSANDO)
undo(new AddElement(toSpanner(ne)));
Expand Down
9 changes: 0 additions & 9 deletions libmscore/score.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3585,15 +3585,6 @@ void Score::addSpanner(Spanner* s)
_spanner.addSpanner(s);
}

//---------------------------------------------------------
// alreadyInList
//---------------------------------------------------------

bool Score::alreadyInList(Spanner* s) const
{
return _spanner.alreadyInList(s);
}

//---------------------------------------------------------
// removeSpanner
//---------------------------------------------------------
Expand Down
1 change: 0 additions & 1 deletion libmscore/score.h
Original file line number Diff line number Diff line change
Expand Up @@ -1091,7 +1091,6 @@ class Score : public QObject, public ScoreElement {
bool isSpannerStartEnd(int tick, int track) const;
void removeSpanner(Spanner*);
void addSpanner(Spanner*);
bool alreadyInList(Spanner*) const;
void cmdAddSpanner(Spanner* spanner, const QPointF& pos);
void cmdAddSpanner(Spanner* spanner, int staffIdx, Segment* startSegment, Segment* endSegment);
void checkSpanner(int startTick, int lastTick);
Expand Down
27 changes: 8 additions & 19 deletions libmscore/spannermap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,29 +71,18 @@ const std::vector<Interval<Spanner*>>& SpannerMap::findOverlapping(int start, in

void SpannerMap::addSpanner(Spanner* s)
{
#if 0
#ifndef NDEBUG
if (alreadyInList(s))
abort();
#endif
insert(std::pair<int,Spanner*>(s->tick(), s));
dirty = true;
}

//---------------------------------------------------------
// alreadyInList
//---------------------------------------------------------

bool SpannerMap::alreadyInList(Spanner* s) const
{
// check if spanner already in list
for (auto i = begin(); i != end(); ++i) {
Spanner* os = i->second;
if (os->type() == s->type()) {
if (os->tick() == s->tick() && os->tick2() == s->tick2()
&& os->track() == s->track() && os->track2() == s->track2())
return true;
if (i->second == s) {
qFatal("SpannerMap::addSpanner: %s already in list %p", s->name(), s);
}
}
return false;
#endif
#endif
insert(std::pair<int,Spanner*>(s->tick(), s));
dirty = true;
}

//---------------------------------------------------------
Expand Down
2 changes: 0 additions & 2 deletions libmscore/spannermap.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,6 @@ class SpannerMap : std::multimap<int, Spanner*> {
bool removeSpanner(Spanner* s);
void update() const;
void setDirty() const { dirty = true; } // must be called if a spanner changes start/length
bool alreadyInList(Spanner* s) const;

#ifndef NDEBUG
void dump() const;
#endif
Expand Down
32 changes: 16 additions & 16 deletions mscore/musescore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@
#elif defined(MAC_SPARKLE_ENABLED)
#include "sparkle/sparkleAutoUpdater.h"
#endif

#ifdef USE_LAME
#include "exportmp3.h"
#endif
Expand Down Expand Up @@ -1632,13 +1632,13 @@ MuseScore::MuseScore()
for (auto i : { "voice-x12", "voice-x13", "voice-x14", "voice-x23", "voice-x24", "voice-x34" })
menuVoices->addAction(getAction(i));
menuTools->addMenu(menuVoices);

menuMeasure = new QMenu("");
for (auto i : { "split-measure", "join-measures" })
menuMeasure->addAction(getAction(i));
menuTools->addMenu(menuMeasure);
menuTools->addAction(getAction("time-delete"));

menuTools->addSeparator();

menuTools->addAction(getAction("slash-fill"));
Expand Down Expand Up @@ -1890,7 +1890,7 @@ MuseScore::MuseScore()
#endif
connect(this, SIGNAL(musescoreWindowWasShown()), this, SLOT(checkForUpdates()),
Qt::ConnectionType(Qt::QueuedConnection | Qt::UniqueConnection));

if (!converterMode && !pluginMode)
_loginManager = new LoginManager(getAction(saveOnlineMenuItem), this);
}
Expand Down Expand Up @@ -3815,8 +3815,8 @@ void MuseScore::clipboardChanged()

void MuseScore::inputMethodAnchorRectangleChanged()
{
// QRectF r = QGuiApplication::inputMethod()->anchorRectangle();
// qDebug("inputMethod AnchorRectangle Changed: (%f, %f) + (%f, %f)", r.x(), r.y(), r.width(), r.height());
QRectF r = QGuiApplication::inputMethod()->anchorRectangle();
qDebug("inputMethod AnchorRectangle Changed: (%f, %f) + (%f, %f)", r.x(), r.y(), r.width(), r.height());
}

//---------------------------------------------------------
Expand All @@ -3825,7 +3825,7 @@ void MuseScore::inputMethodAnchorRectangleChanged()

void MuseScore::inputMethodAnimatingChanged()
{
// qDebug("inputMethod Animating Changed: %d", QGuiApplication::inputMethod()->isAnimating());
qDebug("inputMethod Animating Changed: %d", QGuiApplication::inputMethod()->isAnimating());
}

//---------------------------------------------------------
Expand All @@ -3834,8 +3834,8 @@ void MuseScore::inputMethodAnimatingChanged()

void MuseScore::inputMethodCursorRectangleChanged()
{
// QRectF r = QGuiApplication::inputMethod()->cursorRectangle();
// qDebug("inputMethod CursorRectangle Changed: (%f, %f) + (%f, %f)", r.x(), r.y(), r.width(), r.height());
QRectF r = QGuiApplication::inputMethod()->cursorRectangle();
qDebug("inputMethod CursorRectangle Changed: (%f, %f) + (%f, %f)", r.x(), r.y(), r.width(), r.height());
}

//---------------------------------------------------------
Expand All @@ -3844,7 +3844,7 @@ void MuseScore::inputMethodCursorRectangleChanged()

void MuseScore::inputMethodInputDirectionChanged(Qt::LayoutDirection newDirection)
{
// qDebug("inputMethod InputDirection Changed: (QLocale::LayoutDirection enum) #%d", newDirection);
qDebug("inputMethod InputDirection Changed: (QLocale::LayoutDirection enum) #%d", newDirection);
}

//---------------------------------------------------------
Expand All @@ -3853,8 +3853,8 @@ void MuseScore::inputMethodInputDirectionChanged(Qt::LayoutDirection newDirectio

void MuseScore::inputMethodInputItemClipRectangleChanged()
{
// QRectF r = QGuiApplication::inputMethod()->inputItemClipRectangle();
// qDebug("inputMethod InputItemClipRectangle Changed: (%f, %f) + (%f, %f)", r.x(), r.y(), r.width(), r.height());
QRectF r = QGuiApplication::inputMethod()->inputItemClipRectangle();
qDebug("inputMethod InputItemClipRectangle Changed: (%f, %f) + (%f, %f)", r.x(), r.y(), r.width(), r.height());
}

//---------------------------------------------------------
Expand All @@ -3863,8 +3863,8 @@ void MuseScore::inputMethodInputItemClipRectangleChanged()

void MuseScore::inputMethodKeyboardRectangleChanged()
{
// QRectF r = QGuiApplication::inputMethod()->keyboardRectangle();
// qDebug("inputMethod KeyboardRectangle Changed: (%f, %f) + (%f, %f)", r.x(), r.y(), r.width(), r.height());
QRectF r = QGuiApplication::inputMethod()->keyboardRectangle();
qDebug("inputMethod KeyboardRectangle Changed: (%f, %f) + (%f, %f)", r.x(), r.y(), r.width(), r.height());
}

//---------------------------------------------------------
Expand All @@ -3873,7 +3873,7 @@ void MuseScore::inputMethodKeyboardRectangleChanged()

void MuseScore::inputMethodLocaleChanged()
{
// qDebug("inputMethod Locale Changed: (QLocale::Script enum) #%d.", QGuiApplication::inputMethod()->locale().script());
qDebug("inputMethod Locale Changed: (QLocale::Script enum) #%d.", QGuiApplication::inputMethod()->locale().script());
}

//---------------------------------------------------------
Expand All @@ -3882,7 +3882,7 @@ void MuseScore::inputMethodLocaleChanged()

void MuseScore::inputMethodVisibleChanged()
{
// qDebug("inputMethodVisibleChanged: %d", QGuiApplication::inputMethod()->isVisible());
qDebug("inputMethodVisibleChanged: %d", QGuiApplication::inputMethod()->isVisible());
}

//---------------------------------------------------------
Expand Down

0 comments on commit 9549474

Please sign in to comment.