Commit b84d4a34 authored by Tobias Koenig's avatar Tobias Koenig

The default-style can miss the master-page reference, so

don't depend on it.

BUG 195308

svn path=/trunk/KDE/kdegraphics/okular/; revision=977959
parent ea8c2163
......@@ -187,6 +187,10 @@ bool StyleParser::parseMasterStyles( QDomElement &parent )
while ( !element.isNull() ) {
if ( element.tagName() == QLatin1String( "master-page" ) ) {
mStyleInformation->addMasterLayout( element.attribute( "name" ), element.attribute( "page-layout-name" ) );
if ( !mMasterPageNameSet ) {
mStyleInformation->setMasterPageName( element.attribute( "name" ) );
mMasterPageNameSet = true;
}
} else {
qDebug( "unknown tag %s", qPrintable( element.tagName() ) );
}
......@@ -237,10 +241,12 @@ StyleFormatProperty StyleParser::parseStyleProperty( QDomElement &parent )
property.setParentStyleName( parent.attribute( "parent-style-name" ) );
property.setFamily( parent.attribute( "family" ) );
property.setMasterPageName( parent.attribute( "master-page-name" ) );
if ( !mMasterPageNameSet ) {
mStyleInformation->setMasterPageName( parent.attribute( "master-page-name" ) );
mMasterPageNameSet = true;
if ( parent.hasAttribute( "master-page-name" ) ) {
property.setMasterPageName( parent.attribute( "master-page-name" ) );
if ( !mMasterPageNameSet ) {
mStyleInformation->setMasterPageName( parent.attribute( "master-page-name" ) );
mMasterPageNameSet = true;
}
}
QDomElement element = parent.firstChildElement();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment