Esempio n. 1
0
bool LineSegment::readProperties(XmlReader& e)
      {
      const QStringRef& tag(e.name());
      if (tag == "subtype")
            setSubtype(SpannerSegmentType(e.readInt()));
      else if (tag == "off1")       // obsolete
            setUserOff(e.readPoint() * spatium());
      else if (tag == "off2")
            setUserOff2(e.readPoint() * spatium());
      else if (tag == "pos") {
            if (score()->mscVersion() > 114) {
                  qreal _spatium = spatium();
                  setUserOff(QPointF());
                  setReadPos(e.readPoint() * _spatium);
                  }
            else
                  e.readNext();
            }
#if 0
      else if (tag == "pos") {
            QPointF rp = e.readPoint() * spatium();
            if ((score()->mscVersion() <= 114) && (type() == VOLTA_SEGMENT)) {
                  rp.ry() -= spatium();
                  }
            setReadPos(rp);
            }
#endif
      else if (!Element::readProperties(e)) {
            e.unknown();
            return false;
            }
      return true;
      }
Esempio n. 2
0
bool LineSegment::readProperties(const QDomElement& e)
      {
      const QString& tag(e.tagName());
      if (tag == "subtype")
            setSubtype(SpannerSegmentType(e.text().toInt()));
      else if (tag == "off1")       // obsolete
            setUserOff(readPoint(e) * spatium());
      else if (tag == "off2")
            setUserOff2(readPoint(e) * spatium());
      else if (tag == "pos") {
            if (score()->mscVersion() > 114) {
                  qreal _spatium = spatium();
                  setUserOff(QPointF());
                  setReadPos(readPoint(e) * _spatium);
                  }
            }
      else if (!Element::readProperties(e)) {
            domError(e);
            return false;
            }
      return true;
      }