Fix label parsing and creation issues.
- Parse rotate attribute of Objects node. - Create proper page size when creating template.
This commit is contained in:
@@ -262,6 +262,7 @@ namespace glabels
|
||||
}
|
||||
else if ( tagName == "Objects" )
|
||||
{
|
||||
label->setRotate( parseRotateAttr( child.toElement() ) );
|
||||
QList<LabelModelObject*> list = parseObjectsNode( child.toElement(), data );
|
||||
foreach ( LabelModelObject* object, list )
|
||||
{
|
||||
@@ -541,6 +542,13 @@ namespace glabels
|
||||
}
|
||||
|
||||
|
||||
bool
|
||||
XmlLabelParser::parseRotateAttr( const QDomElement &node )
|
||||
{
|
||||
return XmlUtil::getBoolAttr( node, "rotate", false );
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
XmlLabelParser::parsePositionAttrs( const QDomElement &node, LabelModelObject* object )
|
||||
{
|
||||
|
||||
@@ -64,6 +64,7 @@ namespace glabels
|
||||
static LabelModelBarcodeObject* parseObjectBarcodeNode( const QDomElement &node );
|
||||
static LabelModelTextObject* parseObjectTextNode( const QDomElement &node );
|
||||
static QString parsePNode( const QDomElement &node );
|
||||
static bool parseRotateAttr( const QDomElement &node );
|
||||
static void parsePositionAttrs( const QDomElement &node, LabelModelObject* object );
|
||||
static void parseSizeAttrs( const QDomElement &node, LabelModelObject* object );
|
||||
static void parseLineAttrs( const QDomElement &node, LabelModelObject* object );
|
||||
|
||||
@@ -87,7 +87,7 @@ namespace glabels
|
||||
if ( tmplate->isSizeOther() )
|
||||
{
|
||||
XmlUtil::setLengthAttr( node, "width", tmplate->pageWidth() );
|
||||
XmlUtil::setLengthAttr( node, "height", tmplate->pageWidth() );
|
||||
XmlUtil::setLengthAttr( node, "height", tmplate->pageHeight() );
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user