Logo Search packages:      
Sourcecode: facturalux version File versions  Download package

void MReportEngine::setSectionAttributes ( MReportSection section,
QDomNode *  report 
) [protected]

Sets the layout attributes for the given report section

Definition at line 678 of file mreportengine.cpp.

References MReportSection::addCalculatedField(), MReportSection::addLabel(), MReportSection::addLine(), MReportSection::addSpecialField(), setCalculatedFieldAttributes(), MReportSection::setHeight(), setLabelAttributes(), setLineAttributes(), MReportSection::setPrintFrequency(), and setSpecialAttributes().

Referenced by initTemplate(), and setDetMiscAttributes().

{
  // Get the attributes for the section
  QDomNamedNodeMap attributes = report->attributes ();

  // Get the section attributes
  section->setHeight (attributes.namedItem ("Height").nodeValue ().toInt ());
  section->setPrintFrequency (attributes.namedItem ("PrintFrequency").nodeValue ().toInt ());

  // Process the sections labels
  QDomNodeList children = report->childNodes ();
  int childCount = children.length ();

  // For each label, extract the attr list and add the new label
  // to the sections's label collection
  for (int j = 0; j < childCount; j++)
      {
        QDomNode child = children.item (j);

        if (child.nodeType () == QDomNode::ElementNode)
            {
              if (child.nodeName () == "Line")
                  {
                    QDomNamedNodeMap attributes = child.attributes ();
                    MLineObject *line = new MLineObject ();

                    setLineAttributes (line, &attributes);
                    section->addLine (line);
                  }
              else if (child.nodeName () == "Label")
                  {
                    QDomNamedNodeMap attributes = child.attributes ();
                    MLabelObject *label = new MLabelObject ();

                    setLabelAttributes (label, &attributes);
                    section->addLabel (label);
                  }
              else if (child.nodeName () == "Special")
                  {
                    QDomNamedNodeMap attributes = child.attributes ();
                    MSpecialObject *field = new MSpecialObject ();

                    setSpecialAttributes (field, &attributes);
                    section->addSpecialField (field);
                  }
              else if (child.nodeName () == "CalculatedField")
                  {
                    QDomNamedNodeMap attributes = child.attributes ();
                    MCalcObject *field = new MCalcObject ();

                    setCalculatedFieldAttributes (field, &attributes);
                    section->addCalculatedField (field);
                  }
            }
      }
}


Generated by  Doxygen 1.6.0   Back to index