/trunk/Scribus/scribus/scxmlstreamreader.h |
---|
52,6 → 52,8 |
public: |
ScXmlStreamReader(const QString& string) : QXmlStreamReader(string) {}; |
ScXmlStreamAttributes scAttributes(void) const; |
void readToElementEnd(void); |
}; |
#endif |
/trunk/Scribus/scribus/scxmlstreamreader.cpp |
---|
159,3 → 159,22 |
ScXmlStreamAttributes attrs(attributes()); |
return attrs; |
} |
void ScXmlStreamReader::readToElementEnd(void) |
{ |
if (!isStartElement()) |
return; |
int count = 1; |
QStringRef tagName = name(); |
while(!atEnd() && !hasError()) |
{ |
readNext(); |
if (isStartElement() && (name() == tagName)) |
++count; |
if (isEndElement() && (name() == tagName)) |
--count; |
if (count == 0) |
break; |
} |
} |
/trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format.cpp |
---|
2919,12 → 2919,8 |
if ((Mpage && tagName != "MASTEROBJECT") || (!Mpage && tagName == "MASTEROBJECT")) |
{ |
// Go to end of node |
while(!reader.atEnd() && !reader.hasError()) |
{ |
reader.readNext(); |
if (reader.isEndElement() && reader.name() == tagName) |
break; |
} |
reader.readToElementEnd(); |
continue; |
} |
if (attrs.valueAsInt("OwnPage") != pageNumber) |
{ |
2932,6 → 2928,7 |
itemRemap[itemCount++] = -1; |
else if (tagName == "MASTEROBJECT") |
itemRemapM[itemCountM++] = -1; |
reader.readToElementEnd(); |
} |
else |
{ |
3307,7 → 3304,7 |
bool Scribus150Format::readPageCount(const QString& fileName, int *num1, int *num2, QStringList & masterPageNames) |
{ |
QString PgNam; |
QString pageName; |
int counter = 0; |
int counter2 = 0; |
QString f(readSLA(fileName)); |
3338,8 → 3335,12 |
counter++; |
if(tagName == "MASTERPAGE") |
{ |
counter2++; |
masterPageNames.append(PgNam); |
pageName = reader.scAttributes().valueAsString("NAM"); |
if (!pageName.isEmpty()) |
{ |
counter2++; |
masterPageNames.append(pageName); |
} |
} |
} |
*num1 = counter; |
/trunk/Scribus/scribus/plugins/fileloader/scribus134format/scribus134format.cpp |
---|
2962,12 → 2962,8 |
if ((Mpage && tagName != "MASTEROBJECT") || (!Mpage && tagName == "MASTEROBJECT")) |
{ |
// Go to end of node |
while(!reader.atEnd() && !reader.hasError()) |
{ |
reader.readNext(); |
if (reader.isEndElement() && reader.name() == tagName) |
break; |
} |
reader.readToElementEnd(); |
continue; |
} |
if (attrs.valueAsInt("OwnPage") != pageNumber) |
{ |
2975,6 → 2971,7 |
itemRemap[itemCount++] = -1; |
else if (tagName == "MASTEROBJECT") |
itemRemapM[itemCountM++] = -1; |
reader.readToElementEnd(); |
} |
else |
{ |
3350,7 → 3347,7 |
bool Scribus134Format::readPageCount(const QString& fileName, int *num1, int *num2, QStringList & masterPageNames) |
{ |
QString PgNam; |
QString pageName; |
int counter = 0; |
int counter2 = 0; |
QString f(readSLA(fileName)); |
3381,8 → 3378,12 |
counter++; |
if(tagName == "MASTERPAGE") |
{ |
counter2++; |
masterPageNames.append(PgNam); |
pageName = reader.scAttributes().valueAsString("NAM"); |
if (!pageName.isEmpty()) |
{ |
counter2++; |
masterPageNames.append(pageName); |
} |
} |
} |
*num1 = counter; |