diff --git a/effects/internal/voideffect.cpp b/effects/internal/voideffect.cpp index 86a229b9e..95acc9442 100644 --- a/effects/internal/voideffect.cpp +++ b/effects/internal/voideffect.cpp @@ -52,26 +52,26 @@ Effect *VoidEffect::copy(Clip *c) { void VoidEffect::load(QXmlStreamReader &stream) { QString tag = stream.name().toString(); - qint64 start_index = stream.characterOffset(); - qint64 end_index = start_index; - while (!stream.atEnd() && !(stream.name() == tag && stream.isEndElement())) { - end_index = stream.characterOffset(); - stream.readNext(); - } - qint64 passage_length = end_index - start_index; - if (passage_length > 0) { - // store xml data verbatim - QFile* device = static_cast(stream.device()); - QFile passage_get(device->fileName()); - if (passage_get.open(QFile::ReadOnly)) { - passage_get.seek(start_index); - bytes = passage_get.read(passage_length); - int passage_end = bytes.lastIndexOf('>')+1; - bytes.remove(passage_end, bytes.size()-passage_end); - passage_get.close(); - } - } + QXmlStreamWriter writer(&bytes); + + // copy XML from reader to writer + while (!stream.atEnd() && !(stream.name() == tag && stream.isEndElement())) { + stream.readNext(); + + if (stream.isStartElement()) { + writer.writeStartElement(stream.name().toString()); + } + if (stream.isEndElement()) { + writer.writeEndElement(); + } + if (stream.isCharacters()) { + writer.writeCharacters(stream.text().toString()); + } + for (int i=0;isetAlignment(Qt::AlignCenter); layout->addWidget(current_row_desc); - connect(view, SIGNAL(zoom_changed(double)), header, SLOT(update_zoom(double))); + connect(view, SIGNAL(zoom_changed(double, double)), header, SLOT(update_zoom(double))); connect(view, SIGNAL(x_scroll_changed(int)), header, SLOT(set_scroll(int))); connect(view, SIGNAL(selection_changed(bool, int)), this, SLOT(set_key_button_enabled(bool, int)));