Logo Search packages:      
Sourcecode: koffice version File versions

bool KDChartParams::loadXML ( const QDomDocument &  doc  ) 

Reads the parameters from an XML document.

Parameters:
doc the XML document to read from
Returns:
true if the parameters could be read, false if a file format error occurred
See also:
saveXML

Definition at line 1015 of file KDChartParams_io.cpp.

References _additionalChartType, _allowOverlappingDataValueTexts, _areaChartSubType, _areaLocation, _areaMap, KDChartAxisParams::_axisAreaMax, KDChartAxisParams::_axisAreaMin, KDChartAxisParams::_axisAreaMode, KDChartAxisParams::_axisCalcMode, KDChartAxisParams::_axisDigitsBehindComma, KDChartAxisParams::_axisFirstLabelText, KDChartAxisParams::_axisGridColor, KDChartAxisParams::_axisGridLineWidth, KDChartAxisParams::_axisGridStyle, KDChartAxisParams::_axisGridSubColor, KDChartAxisParams::_axisGridSubLineWidth, KDChartAxisParams::_axisGridSubStyle, KDChartAxisParams::_axisIsoRefAxis, KDChartAxisParams::_axisLabelsBlockAlign, KDChartAxisParams::_axisLabelsColor, KDChartAxisParams::_axisLabelsDateTimeFormat, KDChartAxisParams::_axisLabelsDecimalPoint, KDChartAxisParams::_axisLabelsDivPow10, KDChartAxisParams::_axisLabelsDontAutoRotate, KDChartAxisParams::_axisLabelsDontShrinkFont, KDChartAxisParams::_axisLabelsFont, KDChartAxisParams::_axisLabelsFontRelSize, KDChartAxisParams::_axisLabelsFontUseRelSize, KDChartAxisParams::_axisLabelsPadFill, KDChartAxisParams::_axisLabelsPostfix, KDChartAxisParams::_axisLabelsPrefix, KDChartAxisParams::_axisLabelsRotation, KDChartAxisParams::_axisLabelsThousandsPoint, KDChartAxisParams::_axisLabelsTotalLen, KDChartAxisParams::_axisLabelsTouchEdges, KDChartAxisParams::_axisLabelStringList, KDChartAxisParams::_axisLabelsVisible, KDChartAxisParams::_axisLabelTexts, KDChartAxisParams::_axisLabelTextsDirty, KDChartAxisParams::_axisLastLabelText, KDChartAxisParams::_axisLineColor, KDChartAxisParams::_axisLineVisible, KDChartAxisParams::_axisLineWidth, KDChartAxisParams::_axisMaxEmptyInnerSpan, _axisSettings, KDChartAxisParams::_axisShortLabelsStringList, KDChartAxisParams::_axisShowGrid, KDChartAxisParams::_axisShowSubDelimiters, KDChartAxisParams::_axisSteadyValueCalc, KDChartAxisParams::_axisTrueAreaRect, KDChartAxisParams::_axisTrueAreaSize, KDChartAxisParams::_axisTrueLineWidth, KDChartAxisParams::_axisType, KDChartAxisParams::_axisUseAvailableSpaceFrom, KDChartAxisParams::_axisUseAvailableSpaceTo, KDChartAxisParams::_axisValueDelta, KDChartAxisParams::_axisValueDeltaScale, KDChartAxisParams::_axisValueEnd, KDChartAxisParams::_axisValueLeaveOut, KDChartAxisParams::_axisValueStart, KDChartAxisParams::_axisVisible, KDChartAxisParams::_axisZeroLineColor, KDChartAxisParams::_axisZeroLineStartX, KDChartAxisParams::_axisZeroLineStartY, _barChartSubType, _BWChartBrush, _BWChartOutValMarkerSize, _BWChartStatistics, _BWChartSubType, _chartType, _customBoxMap, _dataColors, _dataColorsShadow1, _dataColorsShadow2, _datasetGap, _datasetGapIsRelative, _dataSourceModeAndChart, _explode, _explodeFactor, _explodeFactors, _explodeList, _globalLeadingBottom, _globalLeadingLeft, _globalLeadingRight, _globalLeadingTop, _hiLoChartCloseValuesColor, _hiLoChartCloseValuesFont, _hiLoChartCloseValuesFontRelSize, _hiLoChartCloseValuesUseFontRelSize, _hiLoChartHighValuesColor, _hiLoChartHighValuesFont, _hiLoChartHighValuesFontRelSize, _hiLoChartHighValuesUseFontRelSize, _hiLoChartLowValuesColor, _hiLoChartLowValuesFont, _hiLoChartLowValuesFontRelSize, _hiLoChartLowValuesUseFontRelSize, _hiLoChartOpenValuesColor, _hiLoChartOpenValuesFont, _hiLoChartOpenValuesFontRelSize, _hiLoChartOpenValuesUseFontRelSize, _hiLoChartPrintCloseValues, _hiLoChartPrintHighValues, _hiLoChartPrintLowValues, _hiLoChartPrintOpenValues, _hiLoChartSubType, KDChartAxisParams::_labelTextsDataRow, _legendFont, _legendFontRelSize, _legendFontUseRelSize, _legendPosition, _legendSource, _legendSpacing, _legendText, _legendTextColor, _legendTitleFont, _legendTitleFontRelSize, _legendTitleFontUseRelSize, _legendTitleText, _legendTitleTextColor, _lineChartSubType, _lineColor, _lineMarker, _lineMarkerSize, _lineMarkerStyles, _lineStyle, _lineWidth, _maxDatasetColor, _maxDatasetSourceMode, _numValues, _outlineDataColor, _outlineDataLineStyle, _outlineDataLineWidth, _pieStart, _polarChartSubType, _polarLineWidth, _polarMarker, _polarMarkerSize, _polarMarkerStyles, _printDataValuesSettings, _printDataValuesSettings2, _relativeRingThickness, _ringStart, _setChartSourceModeWasUsed, _shadowBrightnessFactor, _shadowPattern, _threeDBarDepth, _threeDBars, _threeDLineDepth, _threeDLines, _threeDPieHeight, _threeDPies, _threeDShadowColors, KDChartAxisParams::_trueDelta, KDChartAxisParams::_trueHigh, KDChartAxisParams::_trueLow, _valueBlockGap, _valueBlockGapIsRelative, customBox(), KDChartParams::KDChartFrameSettings::dataCol(), KDChartParams::KDChartFrameSettings::dataRow(), datasetGap(), datasetGapIsRelative(), explode(), frameSettings(), lineWidth(), KDChartPropertySet::loadXML(), maxDatasetSourceMode(), numValues(), outlineDataLineWidth(), KDChartParams::AxisSettings::params, pieStart(), polarLineWidth(), readChartFontNode(), readChartValueNode(), readColorMapNode(), KDChartCustomBox::readCustomBoxNode(), readDoubleMapNode(), KDChartParams::KDChartFrameSettings::readFrameSettingsNode(), relativeRingThickness(), ringStart(), setProperties(), shadowBrightnessFactor(), showGrid(), stringToAreaChartSubType(), stringToAreaLocation(), KDChartAxisParams::stringToAxisAreaMode(), KDChartAxisParams::stringToAxisCalcMode(), KDChartAxisParams::stringToAxisType(), stringToBarChartSubType(), stringToBWChartStatVal(), stringToBWChartSubType(), stringToChartSourceMode(), stringToChartType(), stringToHiLoChartSubType(), KDChartAxisParams::stringToLabelsFromDataRow(), KDChartEnums::stringToLayoutPolicy(), stringToLegendPosition(), stringToLegendSource(), stringToLineChartSubType(), stringToLineMarkerStyle(), stringToPolarChartSubType(), stringToPolarMarkerStyle(), KDChartEnums::stringToPositionFlag(), threeDBarDepth(), threeDBars(), threeDPieHeight(), threeDPies(), threeDShadowColors(), valueBlockGap(), and valueBlockGapIsRelative().

Referenced by operator>>().

{
    int curAxisSettings = 0;
    int curHFSettings = 0;

    QDomElement docRoot = doc.documentElement(); // ChartParams element
    QDomNode node = docRoot.firstChild();
    while( !node.isNull() ) {
        QDomElement element = node.toElement();
        if( !element.isNull() ) { // was really an element
            QString tagName = element.tagName();
            if( tagName == "ChartType" ) {
                if( element.hasAttribute( "primary" ) )
                    _chartType = KDChartParams::stringToChartType( element.attribute( "primary" ) );
                if( element.hasAttribute( "secondary" ) )
                    _additionalChartType = KDChartParams::stringToChartType( element.attribute( "secondary" ) );
            } else if( tagName == "NumValues" ) {
                int numValues;
                if( KDXML::readIntNode( element, numValues ) )
                    _numValues = numValues;
            } else if( tagName == "ModeAndChartMap" ) {
                int dataset = -1;
                QDomNode node = element.firstChild();
                while( !node.isNull() ) {
                    QDomElement element = node.toElement();
                    if( !element.isNull() ) { // was really an element
                        QString tagName = element.tagName();
                        if( tagName == "Dataset" ) {
                            KDXML::readIntNode( element, dataset );
                        } else if( tagName == "ModeAndChart" ) {
                            Q_ASSERT( dataset != -1 ); // there must have been a dataset tag before
                            if( element.hasAttribute( "Mode" ) &&
                                    element.hasAttribute( "Chart" ) ) {
                                KDChartParams::SourceMode sourceMode = KDChartParams::stringToChartSourceMode( element.attribute( "Mode" ) );
                                bool ok = false;
                                uint chart = element.attribute( "Chart" ).toUInt( &ok );
                                if( ok )
                                    _dataSourceModeAndChart[dataset] = KDChartParams::ModeAndChart( sourceMode, chart );
                            }
                        } else {
                            qDebug( "Unknown subelement of ModeAndChartMap found: %s", tagName.latin1() );
                        }
                    }
                    node = node.nextSibling();
                }
            } else if( tagName == "PropertySetMap" ) {
                // the PropertySetMap element
                QDomNode node = element.firstChild();
                KDChartPropertySet set;
                while( !node.isNull() ) {
                    QDomElement element = node.toElement();
                    if(    !element.isNull() // was really an element
                            && KDChartPropertySet::loadXML( element, set ) ) // parsed OK
                        setProperties( set.id(), set );
                    node = node.nextSibling();
                }
            } else if( tagName == "ChartSourceModeWasUsed" ) {
                bool chartSourceModeWasUsed;
                if( KDXML::readBoolNode( element, chartSourceModeWasUsed ) )
                    _setChartSourceModeWasUsed = chartSourceModeWasUsed;
            } else if( tagName == "MaxDatasetSourceMode" ) {
                int maxDatasetSourceMode;
                if( KDXML::readIntNode( element, maxDatasetSourceMode ) )
                    _maxDatasetSourceMode = maxDatasetSourceMode;
            } else if( tagName == "ColorSettings" ) {
                QDomNode node = element.firstChild();
                while( !node.isNull() ) {
                    QDomElement element = node.toElement();
                    if( !element.isNull() ) { // was really an element
                        QString tagName = element.tagName();
                        if( tagName == "DataColors" ) {
                            QMap<uint,QColor>* map = &_dataColors;
                            readColorMapNode( element, map );
                        } else if( tagName == "MaxDatasetColor" ) {
                            int maxDatasetColor;
                            if( KDXML::readIntNode( element, maxDatasetColor ) )
                                _maxDatasetColor = maxDatasetColor;
                        } else if( tagName == "ShadowBrightnessFactor" ) {
                            double shadowBrightnessFactor;
                            if( KDXML::readDoubleNode( element, shadowBrightnessFactor ) )
                                _shadowBrightnessFactor = shadowBrightnessFactor;
                        } else if( tagName == "ShadowPattern" ) {
                            QString value;
                            if( KDXML::readStringNode( element, value ) )
                                _shadowPattern = KDXML::stringToBrushStyle( value );
                        } else if( tagName == "ThreeDShadowColors" ) {
                            bool threeDShadowColors;
                            if( KDXML::readBoolNode( element, threeDShadowColors ) )
                                _threeDShadowColors = threeDShadowColors;
                        } else if( tagName == "DataColorsShadow1" ) {
                            QMap<uint,QColor>* map = &_dataColorsShadow1;
                            readColorMapNode( element, map );
                        } else if( tagName == "DataColorsShadow2" ) {
                            QMap<uint,QColor>* map = &_dataColorsShadow2;
                            readColorMapNode( element, map );
                        } else if( tagName == "OutlineDataColor" ) {
                            QColor color;
                            if( KDXML::readColorNode( element, color ) )
                                _outlineDataColor = color;
                        } else if( tagName == "OutlineDataLineWidth" ) {
                            int outlineDataLineWidth;
                            if( KDXML::readIntNode( element, outlineDataLineWidth ) )
                                _outlineDataLineWidth = outlineDataLineWidth;
                        } else if( tagName == "OutlineDataLineStyle" ) {
                            if( element.hasAttribute( "Style" ) )
                                _outlineDataLineStyle = KDXML::stringToPenStyle( element.attribute( "Style" ) );
                        } else {
                            qDebug( "!!!Unknown subelement of ColorSettings found: %s", tagName.latin1() );
                        }
                    }
                    node = node.nextSibling();
                }
            } else if( tagName == "BarSettings" ) {
                QDomNode node = element.firstChild();
                while( !node.isNull() ) {
                    QDomElement element = node.toElement();
                    if( !element.isNull() ) { // was really an element
                        QString tagName = element.tagName();
                        if( tagName == "SubType" ) {
                            QString value;
                            if( KDXML::readStringNode( element, value ) )
                                _barChartSubType = KDChartParams::stringToBarChartSubType( value );
                        } else if( tagName == "ThreeDBars" ) {
                            bool threeDBars;
                            if( KDXML::readBoolNode( element, threeDBars ) )
                                _threeDBars = threeDBars;
                        } else if( tagName == "ThreeDBarDepth" ) {
                            double threeDBarDepth;
                            if( KDXML::readDoubleNode( element, threeDBarDepth ) )
                                _threeDBarDepth = threeDBarDepth;
                        } else if( tagName == "DatasetGap" ) {
                            int datasetGap;
                            if( KDXML::readIntNode( element, datasetGap ) )
                                _datasetGap = datasetGap;
                        } else if( tagName == "DatasetGapIsRelative" ) {
                            bool datasetGapIsRelative;
                            if( KDXML::readBoolNode( element, datasetGapIsRelative ) )
                                _datasetGapIsRelative = datasetGapIsRelative;
                        } else if( tagName == "ValueBlockGap" ) {
                            int valueBlockGap;
                            if( KDXML::readIntNode( element, valueBlockGap ) )
                                _valueBlockGap = valueBlockGap;
                        } else if( tagName == "ValueBlockGapIsRelative" ) {
                            bool valueBlockGapIsRelative;
                            if( KDXML::readBoolNode( element, valueBlockGapIsRelative ) )
                                _valueBlockGapIsRelative = valueBlockGapIsRelative;
                        } else if( tagName == "SolidExcessArrows" ) {
                            bool solidExcessArrows;
                            if( KDXML::readBoolNode( element, solidExcessArrows ) )
                                _solidExcessArrows = solidExcessArrows;
                        } else {
                            qDebug( "Unknown subelement of BarSettings found: %s", tagName.latin1() );
                        }
                    }
                    node = node.nextSibling();
                }
            } else if( tagName == "LineSettings" ) {
                QDomNode node = element.firstChild();
                while( !node.isNull() ) {
                    QDomElement element = node.toElement();
                    if( !element.isNull() ) { // was really an element
                        QString tagName = element.tagName();
                        if( tagName == "SubType" ) {
                            QString value;
                            if( KDXML::readStringNode( element, value ) )
                                _lineChartSubType = KDChartParams::stringToLineChartSubType( value );
                        } else if( tagName == "Marker" ) {
                            bool marker;
                            if( KDXML::readBoolNode( element, marker ) )
                                _lineMarker = marker;
                        } else if( tagName == "MarkerStyle" ) {
                            bool ok = true;
                            uint dataset;
                            KDChartParams::LineMarkerStyle style = LineMarkerCircle;
                            if( element.hasAttribute( "Dataset" ) &&
                                    element.hasAttribute( "Style" ) ) {
                                dataset = element.attribute( "Dataset" ).toUInt( &ok );
                                if( ok )
                                    style = KDChartParams::stringToLineMarkerStyle( element.attribute( "Style" ) );
                            } else
                                ok = false;
                            if( ok )
                                _lineMarkerStyles[dataset] = style;
                        } else if( tagName == "MarkerSize" ) {
                            int width = 1;
                            int height= 1;
                            bool ok = true;
                            if( element.hasAttribute( "Width" ) &&
                                    element.hasAttribute( "Height" ) ) {
                                width = element.attribute( "Width" ).toInt( &ok );
                                if( ok )
                                    height = element.attribute( "Height" ).toInt( &ok );
                            } else
                                ok = false;

                            if( ok ) {
                                _lineMarkerSize.setWidth( width );
                                _lineMarkerSize.setHeight( height );
                            }
                        } else if( tagName == "LineWidth" ) {
                            int lineWidth;
                            if( KDXML::readIntNode( element, lineWidth ) )
                                _lineWidth = lineWidth;
                        } else if( tagName == "LineColor" ) {
                            QColor color;
                            if( KDXML::readColorNode( element, color ) )
                                _lineColor = color;
                        } else if( tagName == "LineStyle" ) {
                            if( element.hasAttribute( "Style" ) )
                                _lineStyle = KDXML::stringToPenStyle( element.attribute( "Style" ) );
                        } else if( tagName == "ThreeD" ) {
                            bool threeD;
                            if( KDXML::readBoolNode( element, threeD ) )
                                _threeDLines = threeD;
                        } else if( tagName == "ThreeDDepth" ) {
                            int depth;
                            if( KDXML::readIntNode( element, depth ) )
                                _threeDLineDepth = depth;
                        } else if( tagName == "ThreeDXRotation" ) {
                            int rotation;
                            if( KDXML::readIntNode( element, rotation ) )
                                _threeDLineXRotation = rotation;
                        } else if( tagName == "ThreeDYRotation" ) {
                            int rotation;
                            if( KDXML::readIntNode( element, rotation ) )
                                _threeDLineYRotation = rotation;
                        } else {
                            qDebug( "Unknown subelement of LineSettings found: %s", tagName.latin1() );
                        }
                    }
                    node = node.nextSibling();
                }
            } else if( tagName == "AreaSettings" ) {
                QDomNode node = element.firstChild();
                while( !node.isNull() ) {
                    QDomElement element = node.toElement();
                    if( !element.isNull() ) { // was really an element
                        QString tagName = element.tagName();
                        if( tagName == "SubType" ) {
                            QString value;
                            if( KDXML::readStringNode( element, value ) )
                                _areaChartSubType = KDChartParams::stringToAreaChartSubType( value );
                        } else if( tagName == "Location" ) {
                            QString string;
                            if( KDXML::readStringNode( element, string ) )
                                _areaLocation = KDChartParams::stringToAreaLocation( string );
                        } else {
                            qDebug( "Unknown subelement of AreaSettings found: %s", tagName.latin1() );
                        }
                    }
                    node = node.nextSibling();
                }
            } else if( tagName == "PieRingSettings" ) {
                QDomNode node = element.firstChild();
                while( !node.isNull() ) {
                    QDomElement element = node.toElement();
                    if( !element.isNull() ) { // was really an element
                        QString tagName = element.tagName();
                        if( tagName == "Explode" ) {
                            bool explode;
                            if( KDXML::readBoolNode( element, explode ) )
                                _explode = explode;
                        } else if( tagName == "DefaultExplodeFactor" ) {
                            double defaultExplodeFactor;
                            if( KDXML::readDoubleNode( element, defaultExplodeFactor ) )
                                _explodeFactor = defaultExplodeFactor;
                        } else if( tagName == "ExplodeFactors" ) {
                            QMap<int,double>* map = &_explodeFactors;
                            readDoubleMapNode( element, map );
                        } else if( tagName == "ExplodeSegment" ) {
                            int explodeSegment;
                            if( KDXML::readIntNode( element, explodeSegment ) )
                                _explodeList << explodeSegment;
                        } else if( tagName == "ThreeDPies" ) {
                            bool threeDPies;
                            if( KDXML::readBoolNode( element, threeDPies ) )
                                _threeDPies = threeDPies;
                        } else if( tagName == "ThreeDPieHeight" ) {
                            int threeDPieHeight;
                            if( KDXML::readIntNode( element, threeDPieHeight ) )
                                _threeDPieHeight = threeDPieHeight;
                        } else if( tagName == "PieStart" ) {
                            int pieStart;
                            if( KDXML::readIntNode( element, pieStart ) )
                                _pieStart = pieStart;
                        } else if( tagName == "RingStart" ) {
                            int ringStart;
                            if( KDXML::readIntNode( element, ringStart ) )
                                _ringStart = ringStart;
                        } else if( tagName == "RelativeRingThickness" ) {
                            bool relativeRingThickness;
                            if( KDXML::readBoolNode( element, relativeRingThickness ) )
                                _relativeRingThickness = relativeRingThickness;
                        } else {
                            qDebug( "Unknown subelement of PieRingSettings found: %s", tagName.latin1() );
                        }
                    }
                    node = node.nextSibling();
                }
            } else if( tagName == "HiLoSettings" ) {
                QDomNode node = element.firstChild();
                while( !node.isNull() ) {
                    QDomElement element = node.toElement();
                    if( !element.isNull() ) { // was really an element
                        QString tagName = element.tagName();
                        if( tagName == "SubType" ) {
                            QString value;
                            if( KDXML::readStringNode( element, value ) )
                                _hiLoChartSubType = KDChartParams::stringToHiLoChartSubType( value );
                        } else if( tagName == "PrintLowValues" ) {
                            bool printLowValues;
                            if( KDXML::readBoolNode( element, printLowValues ) )
                                _hiLoChartPrintLowValues = printLowValues;
                        } else if( tagName == "LowValuesFont" ) {
                            readChartFontNode( element,
                                    _hiLoChartLowValuesFont,
                                    _hiLoChartLowValuesUseFontRelSize,
                                    _hiLoChartLowValuesFontRelSize );
                        } else if( tagName == "LowValuesColor" ) {
                            QColor color;
                            if( KDXML::readColorNode( element, color ) )
                                _hiLoChartLowValuesColor = color;
                        } else if( tagName == "PrintHighValues" ) {
                            bool printHighValues;
                            if( KDXML::readBoolNode( element, printHighValues ) )
                                _hiLoChartPrintHighValues = printHighValues;
                        } else if( tagName == "HighValuesFont" ) {
                            readChartFontNode( element,
                                    _hiLoChartHighValuesFont,
                                    _hiLoChartHighValuesUseFontRelSize,
                                    _hiLoChartHighValuesFontRelSize );
                        } else if( tagName == "HighValuesColor" ) {
                            QColor color;
                            if( KDXML::readColorNode( element, color ) )
                                _hiLoChartHighValuesColor = color;
                        } else if( tagName == "PrintOpenValues" ) {
                            bool printOpenValues;
                            if( KDXML::readBoolNode( element, printOpenValues ) )
                                _hiLoChartPrintOpenValues = printOpenValues;
                        } else if( tagName == "OpenValuesFont" ) {
                            readChartFontNode( element,
                                    _hiLoChartOpenValuesFont,
                                    _hiLoChartOpenValuesUseFontRelSize,
                                    _hiLoChartOpenValuesFontRelSize );
                        } else if( tagName == "OpenValuesColor" ) {
                            QColor color;
                            if( KDXML::readColorNode( element, color ) )
                                _hiLoChartOpenValuesColor = color;
                        } else if( tagName == "PrintCloseValues" ) {
                            bool printCloseValues;
                            if( KDXML::readBoolNode( element, printCloseValues ) )
                                _hiLoChartPrintCloseValues = printCloseValues;
                        } else if( tagName == "CloseValuesFont" ) {
                            readChartFontNode( element,
                                    _hiLoChartCloseValuesFont,
                                    _hiLoChartCloseValuesUseFontRelSize,
                                    _hiLoChartCloseValuesFontRelSize );
                        } else if( tagName == "CloseValuesColor" ) {
                            QColor color;
                            if( KDXML::readColorNode( element, color ) )
                                _hiLoChartCloseValuesColor = color;
                        } else {
                            qDebug( "Unknown subelement of HiLoSettings found: %s", tagName.latin1() );
                        }
                    }
                    node = node.nextSibling();
                }


            } else if( tagName == "BoxAndWhiskerSettings" ) {
                QDomNode node = element.firstChild();
                while( !node.isNull() ) {
                    QDomElement element = node.toElement();
                    if( !element.isNull() ) { // was really an element
                        QString tagName = element.tagName();
                        if( tagName == "SubType" ) {
                            QString value;
                            if( KDXML::readStringNode( element, value ) )
                                _BWChartSubType = KDChartParams::stringToBWChartSubType( value );
                        } else if( tagName == "FenceUpperInner" ) {
                            double fence;
                            if( KDXML::readDoubleNode( element, fence ) )
                                _BWChartFenceUpperInner = fence;
                        } else if( tagName == "FenceLowerInner" ) {
                            double fence;
                            if( KDXML::readDoubleNode( element, fence ) )
                                _BWChartFenceUpperOuter = fence;
                        } else if( tagName == "FenceUpperOuter" ) {
                            double fence;
                            if( KDXML::readDoubleNode( element, fence ) )
                                _BWChartFenceUpperOuter = fence;
                        } else if( tagName == "FenceLowerOuter" ) {
                            double fence;
                            if( KDXML::readDoubleNode( element, fence ) )
                                _BWChartFenceUpperOuter = fence;
                        } else if( tagName == "Brush" ) {
                            QBrush brush;
                            if( KDXML::readBrushNode( element, brush ) )
                                _BWChartBrush = brush;
                        } else if( tagName == "OutlierSize" ) {
                            int size;
                            if( KDXML::readIntNode( element, size ) )
                                _BWChartOutValMarkerSize = size;
                        } else if( tagName.startsWith("PrintStatistics") ) {
                            // 012345678901234
                            QString statName(tagName.mid( 15 ));
                            BWStatVal i( stringToBWChartStatVal( statName ) );
                            if( BWStatValSTART <= i && i <= BWStatValEND ) {
                                QDomNode node = element.firstChild();
                                while( !node.isNull() ) {
                                    QDomElement element = node.toElement();
                                    if( !element.isNull() ) { // was really an element
                                        QString tagName = element.tagName();
                                        if( tagName == "Active" ) {
                                            bool active;
                                            if( KDXML::readBoolNode( element, active ) )
                                                _BWChartStatistics[ i ].active = active;
                                        } else if( tagName == "Font" ) {
                                            readChartFontNode( element,
                                                    _BWChartStatistics[ i ].font,
                                                    _BWChartStatistics[ i ].useRelSize,
                                                    _BWChartStatistics[ i ].relSize );
                                        } else if( tagName == "Color" ) {
                                            QColor color;
                                            if( KDXML::readColorNode( element, color ) )
                                                _BWChartStatistics[ i ].color = color;
                                        } else if( tagName == "Brush" ) {
                                            QBrush brush;
                                            if( KDXML::readBrushNode( element, brush ) )
                                                _BWChartStatistics[ i ].brush = brush;
                                        } else {
                                            qDebug( "Unknown subelement of BoxAndWhiskerSettings found: %s", tagName.latin1() );
                                        }
                                    }
                                }
                            } else {
                                qDebug( "Unknown subelement of BoxAndWhiskerSettings found: %s", tagName.latin1() );
                            }
                        } else {
                            qDebug( "Unknown subelement of BoxAndWhiskerSettings found: %s", tagName.latin1() );
                        }
                    }
                    node = node.nextSibling();
                }
            } else if( tagName == "PolarSettings" ) {
                QDomNode node = element.firstChild();
                while( !node.isNull() ) {
                    QDomElement element = node.toElement();
                    if( !element.isNull() ) { // was really an element
                        QString tagName = element.tagName();
                        if( tagName == "SubType" ) {
                            QString value;
                            if( KDXML::readStringNode( element, value ) )
                                _polarChartSubType = KDChartParams::stringToPolarChartSubType( value );
                        } else if( tagName == "Marker" ) {
                            bool marker;
                            if( KDXML::readBoolNode( element, marker ) )
                                _polarMarker = marker;
                        } else if( tagName == "MarkerStyle" ) {
                            bool ok = true;
                            uint dataset;
                            KDChartParams::PolarMarkerStyle style = PolarMarkerCircle;
                            if( element.hasAttribute( "Dataset" ) &&
                                    element.hasAttribute( "Style" ) ) {
                                dataset = element.attribute( "Dataset" ).toUInt( &ok );
                                if( ok )
                                    style = KDChartParams::stringToPolarMarkerStyle( element.attribute( "Style" ) );
                            } else
                                ok = false;
                            if( ok )
                                _polarMarkerStyles[dataset] = style;
                        } else if( tagName == "MarkerSize" ) {
                            int width = 1;
                            int height= 1;
                            bool ok = true;
                            if( element.hasAttribute( "Width" ) &&
                                    element.hasAttribute( "Height" ) ) {
                                width = element.attribute( "Width" ).toInt( &ok );
                                if( ok )
                                    height = element.attribute( "Height" ).toInt( &ok );
                            } else
                                ok = false;

                            if( ok ) {
                                _polarMarkerSize.setWidth( width );
                                _polarMarkerSize.setHeight( height );
                            }
                        } else if( tagName == "PolarLineWidth" ) {
                            int polarLineWidth;
                            if( KDXML::readIntNode( element, polarLineWidth ) )
                                _polarLineWidth = polarLineWidth;
                        } else {
                            qDebug( "Unknown subelement of PolarSettings found: %s", tagName.latin1() );
                        }
                    }
                    node = node.nextSibling();
                }
            } else if( tagName == "LegendSettings" ) {
                QDomNode node = element.firstChild();
                while( !node.isNull() ) {
                    QDomElement element = node.toElement();
                    if( !element.isNull() ) { // was really an element
                        QString tagName = element.tagName();
                        if( tagName == "Position" ) {
                            QString string;
                            if( KDXML::readStringNode( element, string ) )
                                _legendPosition = KDChartParams::stringToLegendPosition( string );
                        } else if( tagName == "Source" ) {
                            QString string;
                            if( KDXML::readStringNode( element, string ) )
                                _legendSource = KDChartParams::stringToLegendSource( string );
                        } else if( tagName == "LegendText" ) {
                            bool ok = true;
                            uint dataset = 0;
                            QString text;
                            if( element.hasAttribute( "Dataset" ) &&
                                    element.hasAttribute( "Text" ) ) {
                                dataset = element.attribute( "Dataset" ).toUInt( &ok );
                                if( ok )
                                    text = element.attribute( "Text" );
                            } else
                                ok = false;
                            if( ok )
                                _legendText[dataset] = text;
                        } else if( tagName == "TextColor" ) {
                            QColor color;
                            if( KDXML::readColorNode( element, color ) )
                                _legendTextColor = color;
                        } else if( tagName == "TextFont" ) {
                            readChartFontNode( element,
                                    _legendFont,
                                    _legendFontUseRelSize,
                                    _legendFontRelSize );
                        } else if( tagName == "TitleText" ) {
                            QString string;
                            if( KDXML::readStringNode( element, string ) )
                                _legendTitleText = string;
                        } else if( tagName == "TitleColor" ) {
                            QColor color;
                            if( KDXML::readColorNode( element, color ) )
                                _legendTitleTextColor = color;
                        } else if( tagName == "TitleFont" ) {
                            readChartFontNode( element,
                                    _legendTitleFont,
                                    _legendTitleFontUseRelSize,
                                    _legendTitleFontRelSize );
                        } else if( tagName == "Spacing" ) {
                            int spacing;
                            if( KDXML::readIntNode( element, spacing ) )
                                _legendSpacing = spacing;
                        } else {
                            qDebug( "Unknown subelement of LegendSettings found: %s", tagName.latin1() );
                        }
                    }
                    node = node.nextSibling();
                }
            } else if( tagName == "AxisSettings" ) {
                KDChartAxisParams* axisSettings =
                    &( _axisSettings[ curAxisSettings ].params );
                QDomNode node = element.firstChild();
                while( !node.isNull() ) {
                    QDomElement element = node.toElement();
                    if( !element.isNull() ) { // was really an element
                        QString tagName = element.tagName();
                        if( tagName == "Type" ) {
                            QString string;
                            if( KDXML::readStringNode( element, string ) )
                                axisSettings->_axisType = KDChartAxisParams::stringToAxisType( string );
                        } else if( tagName == "Visible" ) {
                            bool visible;
                            if( KDXML::readBoolNode( element, visible ) )
                                axisSettings->_axisVisible = visible;
                        } else if( tagName == "LabelsTouchEdges" ) {
                            bool labelsTouchEdges;
                            if( KDXML::readBoolNode( element, labelsTouchEdges ) )
                                axisSettings->_axisLabelsTouchEdges = labelsTouchEdges;
                        } else if( tagName == "AreaMode" ) {
                            QString string;
                            if( KDXML::readStringNode( element, string ) )
                                axisSettings->_axisAreaMode = KDChartAxisParams::stringToAxisAreaMode( string );
                        } else if( tagName == "UseAvailableSpaceFrom" ) {
                            int spaceFrom;
                            if( KDXML::readIntNode( element, spaceFrom ) )
                                axisSettings->_axisUseAvailableSpaceFrom = spaceFrom;
                        } else if( tagName == "UseAvailableSpaceTo" ) {
                            int spaceTo;
                            if( KDXML::readIntNode( element, spaceTo ) )
                                axisSettings->_axisUseAvailableSpaceTo = spaceTo;
                        } else if( tagName == "IsometricReferenceAxis" ) {
                            int isoRefAxis;
                            if( KDXML::readIntNode( element,    isoRefAxis ) )
                                axisSettings->_axisIsoRefAxis = isoRefAxis;
                        } else if( tagName == "AreaMin" ) {
                            int areaMin;
                            if( KDXML::readIntNode( element, areaMin ) )
                                axisSettings->_axisAreaMin = areaMin;
                        } else if( tagName == "AreaMax" ) {
                            int areaMax;
                            if( KDXML::readIntNode( element, areaMax ) )
                                axisSettings->_axisAreaMax = areaMax;
                        } else if( tagName == "CalcMode" ) {
                            QString string;
                            if( KDXML::readStringNode( element, string ) )
                                axisSettings->_axisCalcMode = KDChartAxisParams::stringToAxisCalcMode( string );
                        } else if( tagName == "TrueAreaSize" ) {
                            int trueAreaSize;
                            if( KDXML::readIntNode( element, trueAreaSize ) )
                                axisSettings->_axisTrueAreaSize = trueAreaSize;
                        } else if( tagName == "TrueAreaRect" ) {
                            QRect trueAreaRect;
                            if( KDXML::readRectNode( element, trueAreaRect ) )
                                axisSettings->_axisTrueAreaRect = trueAreaRect;
                        } else if( tagName == "ShowSubDelimiters" ) {
                            bool showSubDelimiters;
                            if( KDXML::readBoolNode( element, showSubDelimiters ) )
                                axisSettings->_axisShowSubDelimiters = showSubDelimiters;
                        } else if( tagName == "LineVisible" ) {
                            bool lineVisible;
                            if( KDXML::readBoolNode( element, lineVisible ) )
                                axisSettings->_axisLineVisible = lineVisible;
                        } else if( tagName == "LineWidth" ) {
                            int lineWidth;
                            if( KDXML::readIntNode( element, lineWidth ) )
                                axisSettings->_axisLineWidth = lineWidth;
                        } else if( tagName == "TrueLineWidth" ) {
                            int trueLineWidth;
                            if( KDXML::readIntNode( element, trueLineWidth ) )
                                axisSettings->_axisTrueLineWidth = trueLineWidth;
                        } else if( tagName == "LineColor" ) {
                            QColor color;
                            if( KDXML::readColorNode( element, color ) )
                                axisSettings->_axisLineColor = color;
                        } else if( tagName == "ShowGrid" ) {
                            bool showGrid;
                            if( KDXML::readBoolNode( element, showGrid ) )
                                axisSettings->_axisShowGrid = showGrid;
                        } else if( tagName == "GridColor" ) {
                            QColor color;
                            if( KDXML::readColorNode( element, color ) )
                                axisSettings->_axisGridColor = color;
                        } else if( tagName == "GridLineWidth" ) {
                            int gridLineWidth;
                            if( KDXML::readIntNode( element, gridLineWidth ) )
                                axisSettings->_axisGridLineWidth = gridLineWidth;
                        } else if( tagName == "GridStyle" ) {
                            if( element.hasAttribute( "Style" ) )
                                axisSettings->_axisGridStyle = KDXML::stringToPenStyle( element.attribute( "Style" ) );
                        } else if( tagName == "GridSubColor" ) {
                            QColor color;
                            if( KDXML::readColorNode( element, color ) )
                                axisSettings->_axisGridSubColor = color;
                        } else if( tagName == "GridSubLineWidth" ) {
                            int gridSubLineWidth;
                            if( KDXML::readIntNode( element, gridSubLineWidth ) )
                                axisSettings->_axisGridSubLineWidth = gridSubLineWidth;
                        } else if( tagName == "GridSubStyle" ) {
                            if( element.hasAttribute( "Style" ) )
                                axisSettings->_axisGridSubStyle = KDXML::stringToPenStyle( element.attribute( "Style" ) );
                        } else if( tagName == "ZeroLineColor" ) {
                            QColor color;
                            if( KDXML::readColorNode( element, color ) )
                                axisSettings->_axisZeroLineColor = color;
                        } else if( tagName == "LabelsVisible" ) {
                            bool labelsVisible;
                            if( KDXML::readBoolNode( element, labelsVisible ) )
                                axisSettings->_axisLabelsVisible = labelsVisible;
                        } else if( tagName == "LabelsFont" ) {
                            readChartFontNode( element,
                                    axisSettings->_axisLabelsFont,
                                    axisSettings->_axisLabelsFontUseRelSize,
                                    axisSettings->_axisLabelsFontRelSize );
                        } else if( tagName == "LabelsDontShrinkFont" ) {
                            bool dontShrink;
                            if( KDXML::readBoolNode( element, dontShrink ) )
                                axisSettings->_axisLabelsDontShrinkFont = dontShrink;
                        } else if( tagName == "LabelsDontAutoRotate" ) {
                            bool dontRotate;
                            if( KDXML::readBoolNode( element, dontRotate ) )
                                axisSettings->_axisLabelsDontAutoRotate = dontRotate;
                        } else if( tagName == "LabelsRotation" ) {
                            int rotation;
                            if( KDXML::readIntNode( element, rotation ) )
                                axisSettings->_axisLabelsRotation = rotation;
                        } else if( tagName == "LabelsLeaveOut" ) {
                            int leaveOut;
                            if( KDXML::readIntNode( element, leaveOut ) )
                                axisSettings->_axisValueLeaveOut = leaveOut;
                        } else if( tagName == "LabelsColor" ) {
                            QColor color;
                            if( KDXML::readColorNode( element, color ) )
                                axisSettings->_axisLabelsColor = color;
                        } else if( tagName == "SteadyValueCalc" ) {
                            bool steadyValueCalc;
                            if( KDXML::readBoolNode( element, steadyValueCalc ) )
                                axisSettings->_axisSteadyValueCalc = steadyValueCalc;
                        } else if( tagName == "ValueStart" ) {
                            KDChartData value;
                            if( readChartValueNode( element, value ) )
                                axisSettings->_axisValueStart = value;
                        } else if( tagName == "ValueEnd" ) {
                            KDChartData value;
                            if( readChartValueNode( element, value ) )
                                axisSettings->_axisValueEnd = value;
                        } else if( tagName == "ValueDelta" ) {
                            double valueDelta;
                            if( KDXML::readDoubleNode( element, valueDelta ) )
                                axisSettings->_axisValueDelta = valueDelta;
                        } else if( tagName == "ValueDeltaScale" ) {
                            int valueDeltaScale;
                            if( KDXML::readIntNode( element, valueDeltaScale ) )
                                axisSettings->_axisValueDeltaScale = (KDChartAxisParams::ValueScale)valueDeltaScale;
                        } else if( tagName == "TrueLow" ) {
                            double trueLow;
                            if( KDXML::readDoubleNode( element, trueLow ) )
                                axisSettings->_trueLow  = trueLow;
                        } else if( tagName == "TrueHigh" ) {
                            double trueHigh;
                            if( KDXML::readDoubleNode( element, trueHigh ) )
                                axisSettings->_trueHigh  = trueHigh;
                        } else if( tagName == "TrueDelta" ) {
                            double trueDelta;
                            if( KDXML::readDoubleNode( element, trueDelta ) )
                                axisSettings->_trueDelta  = trueDelta;
                        } else if( tagName == "ZeroLineStart" ) {
                            double x = 0.0;
                            double y = 0.0;
                            bool ok = true;
                            if( element.hasAttribute( "X" ) &&
                                    element.hasAttribute( "Y" ) ) {
                                x = element.attribute( "X" ).toDouble( &ok );
                                if( ok )
                                    y = element.attribute( "Y" ).toDouble( &ok );
                            } else
                                ok = false;

                            if( ok ) {
                                axisSettings->_axisZeroLineStartX = x;
                                axisSettings->_axisZeroLineStartY = y;
                            }
                        } else if( tagName == "DigitsBehindComma" ) {
                            int digitsBehindComma;
                            if( KDXML::readIntNode( element, digitsBehindComma ) )
                                axisSettings->_axisDigitsBehindComma = digitsBehindComma;
                        } else if( tagName == "LabelsDateTimeFormat" ) {
                            QString string;
                            if( KDXML::readStringNode( element, string ) )
                                axisSettings->_axisLabelsDateTimeFormat = string;
                        } else if( tagName == "MaxEmptyInnerSpan" ) {
                            int maxEmptyInnerSpan;
                            if( KDXML::readIntNode( element, maxEmptyInnerSpan ) )
                                axisSettings->_axisMaxEmptyInnerSpan = maxEmptyInnerSpan;
                        } else if( tagName == "LabelsFromDataRow" ) {
                            QString string;
                            if( KDXML::readStringNode( element, string ) )
                                axisSettings->_labelTextsDataRow = KDChartAxisParams::stringToLabelsFromDataRow( string );
                        } else if( tagName == "TextsDataRow" ) {
                            int textsDataRow;
                            if( KDXML::readIntNode( element, textsDataRow ) )
                                axisSettings->_labelTextsDataRow = textsDataRow;
                        } else if( tagName == "LabelString" ) {
                            QString string;
                            if( KDXML::readStringNode( element, string ) )
                                axisSettings->_axisLabelStringList << string;
                        } else if( tagName == "ShortLabelString" ) {
                            QString string;
                            if( KDXML::readStringNode( element, string ) )
                                axisSettings->_axisShortLabelsStringList << string;
                        } else if( tagName == "LabelText" ) {
                            QString string;
                            if( KDXML::readStringNode( element, string ) )
                                axisSettings->_axisLabelTexts = string;
                        } else if( tagName == "LabelTextsDirty" ) {
                            bool labelTextsDirty;
                            if( KDXML::readBoolNode( element, labelTextsDirty ) )
                                axisSettings->_axisLabelTextsDirty = labelTextsDirty;
                        } else if( tagName == "FirstLabelReplacementText" ) {
                            QString value;
                            if( KDXML::readStringNode( element, value ) )
                                axisSettings->_axisFirstLabelText = value;
                        } else if( tagName == "LastLabelReplacementText" ) {
                            QString value;
                            if( KDXML::readStringNode( element, value ) )
                                axisSettings->_axisLastLabelText = value;
                        } else if( tagName == "LabelsDivPow10" ) {
                            int divPow10;
                            if( KDXML::readIntNode( element, divPow10 ) )
                                axisSettings->_axisLabelsDivPow10 = divPow10;
                        } else if( tagName == "LabelsDecimalPoint" ) {
                            QString value;
                            if( KDXML::readStringNode( element, value ) )
                                axisSettings->_axisLabelsDecimalPoint = value;
                        } else if( tagName == "LabelsThousandsPoint" ) {
                            QString value;
                            if( KDXML::readStringNode( element, value ) )
                                axisSettings->_axisLabelsThousandsPoint = value;
                        } else if( tagName == "LabelsPrefix" ) {
                            QString value;
                            if( KDXML::readStringNode( element, value ) )
                                axisSettings->_axisLabelsPrefix = value;
                        } else if( tagName == "LabelsPostfix" ) {
                            QString value;
                            if( KDXML::readStringNode( element, value ) )
                                axisSettings->_axisLabelsPostfix = value;
                        } else if( tagName == "LabelsTotalLen" ) {
                            int totalLen;
                            if( KDXML::readIntNode( element, totalLen ) )
                                axisSettings->_axisLabelsTotalLen = totalLen;
                        } else if( tagName == "LabelsPadFill" ) {
                            QString value;
                            if( KDXML::readStringNode( element, value ) ){
                                if( value.isEmpty() )
                                    axisSettings->_axisLabelsPadFill = ' ';
                                else
                                    axisSettings->_axisLabelsPadFill = value.at(0);
                            }
                        } else if( tagName == "LabelsBlockAlign" ) {
                            bool blockAlign;
                            if( KDXML::readBoolNode( element, blockAlign ) )
                                axisSettings->_axisLabelsBlockAlign = blockAlign;
                        } else {
                            qDebug( "Unknown subelement of AxisSettings found: %s", tagName.latin1() );
                        }
                    }
                    node = node.nextSibling();
                }
                curAxisSettings++; // one axis settings entry finished
            } else if( tagName == "HeaderFooterSettings" ) {
                KDChartParams::HdFtParams* hfSettings =
                    &( _hdFtParams[ curHFSettings ] );
                QDomNode node = element.firstChild();
                while( !node.isNull() ) {
                    QDomElement element = node.toElement();
                    if( !element.isNull() ) { // was really an element
                        QString tagName = element.tagName();
                        if( tagName == "Text" ) {
                            QString string;
                            if( KDXML::readStringNode( element, string ) )
                                hfSettings->_text = string;
                        } else if( tagName == "Font" ) {
                            readChartFontNode( element,
                                    hfSettings->_font,
                                    hfSettings->_fontUseRelSize,
                                    hfSettings->_fontRelSize );
                        } else if( tagName == "Color" ) {
                            QColor color;
                            if( KDXML::readColorNode( element, color ) )
                                hfSettings->_color = color;
                        } else {
                            qDebug( "Unknown subelement of HeaderFooterSettings found: %s", tagName.latin1() );
                        }
                    }
                    node = node.nextSibling();
                }
                curHFSettings++; // one header/footer setting finished
            } else if( tagName == "GlobalLeading" ) {
                QDomNode node = element.firstChild();
                while( !node.isNull() ) {
                    QDomElement element = node.toElement();
                    if( !element.isNull() ) { // was really an elemente
                        QString tagName = element.tagName();
                        if( tagName == "Left" ) {
                            int value;
                            if( KDXML::readIntNode( element, value ) )
                                _globalLeadingLeft = value;
                        }
                        else if( tagName == "Top" ) {
                            int value;
                            if( KDXML::readIntNode( element, value ) )
                                _globalLeadingTop = value;
                        }
                        else if( tagName == "Right" ) {
                            int value;
                            if( KDXML::readIntNode( element, value ) )
                                _globalLeadingRight = value;
                        }
                        else if( tagName == "Bottom" ) {
                            int value;
                            if( KDXML::readIntNode( element, value ) )
                                _globalLeadingBottom = value;
                        } else {
                            qDebug( "Unknown subelement of GlobalLeading found: %s", tagName.latin1() );
                        }
                    }
                    node = node.nextSibling();
                }
            } else if( tagName == "DataValuesSettings1" ) {
                QDomNode node = element.firstChild();
                while( !node.isNull() ) {
                    QDomElement element = node.toElement();
                    if( !element.isNull() ) { // was really an element
                        QString tagName = element.tagName();
                        if( tagName == "PrintDataValues" ) {
                            bool value;
                            if( KDXML::readBoolNode( element, value ) )
                                _printDataValuesSettings._printDataValues = value;
                        } else if( tagName == "DivPow10" ) {
                            int value;
                            if( KDXML::readIntNode( element, value ) )
                                _printDataValuesSettings._divPow10 = value;
                        } else if( tagName == "DigitsBehindComma" ) {
                            int value;
                            if( KDXML::readIntNode( element, value ) )
                                _printDataValuesSettings._digitsBehindComma = value;
                        } else if( tagName == "Font" ) {
                            readChartFontNode( element,
                                    _printDataValuesSettings._dataValuesFont,
                                    _printDataValuesSettings._dataValuesUseFontRelSize,
                                    _printDataValuesSettings._dataValuesFontRelSize );
                        } else if( tagName == "Color" ) {
                            KDXML::readColorNode( element, _printDataValuesSettings._dataValuesColor );
                        } else if( tagName == "Background" ) {
                            KDXML::readBrushNode( element, _printDataValuesSettings._dataValuesBrush );
                        } else if( tagName == "AutoColor" ) {
                            KDXML::readBoolNode( element,
                                    _printDataValuesSettings._dataValuesAutoColor );
                        } else if( tagName == "AnchorNegativePosition" ) {
                            QString value;
                            if( KDXML::readStringNode( element, value ) )
                                _printDataValuesSettings._dataValuesAnchorNegativePosition = KDChartEnums::stringToPositionFlag( value );
                        } else if( tagName == "AnchorNegativeAlign" ) {
                            int value;
                            if( KDXML::readIntNode( element, value ) )
                                _printDataValuesSettings._dataValuesAnchorNegativeAlign = value;
                        } else if( tagName == "AnchorNegativeDeltaX" ) {
                            int value;
                            if( KDXML::readIntNode( element, value ) )
                                _printDataValuesSettings._dataValuesAnchorNegativeDeltaX = value;
                        } else if( tagName == "AnchorNegativeDeltaY" ) {
                            int value;
                            if( KDXML::readIntNode( element, value ) )
                                _printDataValuesSettings._dataValuesAnchorNegativeDeltaY = value;
                        } else if( tagName == "NegativeRotation" ) {
                            int value;
                            if( KDXML::readIntNode( element, value ) )
                                _printDataValuesSettings._dataValuesNegativeRotation = value;
                        } else if( tagName == "AnchorPositivePosition" ) {
                            QString value;
                            if( KDXML::readStringNode( element, value ) )
                                _printDataValuesSettings._dataValuesAnchorPositivePosition = KDChartEnums::stringToPositionFlag( value );
                        } else if( tagName == "AnchorPositiveAlign" ) {
                            int value;
                            if( KDXML::readIntNode( element, value ) )
                                _printDataValuesSettings._dataValuesAnchorPositiveAlign = value;
                        } else if( tagName == "AnchorPositiveDeltaX" ) {
                            int value;
                            if( KDXML::readIntNode( element, value ) )
                                _printDataValuesSettings._dataValuesAnchorPositiveDeltaX = value;
                        } else if( tagName == "AnchorPositiveDeltaY" ) {
                            int value;
                            if( KDXML::readIntNode( element, value ) )
                                _printDataValuesSettings._dataValuesAnchorPositiveDeltaY = value;
                        } else if( tagName == "PositiveRotation" ) {
                            int value;
                            if( KDXML::readIntNode( element, value ) )
                                _printDataValuesSettings._dataValuesPositiveRotation = value;
                        } else if( tagName == "LayoutPolicy" ) {
                            QString value;
                            if( KDXML::readStringNode( element, value ) )
                                _printDataValuesSettings._dataValuesLayoutPolicy = KDChartEnums::stringToLayoutPolicy( value );
                        } else if( tagName == "ShowInfinite" ) {
                            KDXML::readBoolNode( element, _printDataValuesSettings._dataValuesShowInfinite );
                        } else {
                            qDebug( "Unknown subelement of DataValuesSettings1 found: %s", tagName.latin1() );
                        }
                    }
                    node = node.nextSibling();
                }
            } else if( tagName == "DataValuesSettings2" ) {
                QDomNode node = element.firstChild();
                while( !node.isNull() ) {
                    QDomElement element = node.toElement();
                    if( !element.isNull() ) { // was really an element
                        QString tagName = element.tagName();
                        if( tagName == "PrintDataValues" ) {
                            bool value;
                            if( KDXML::readBoolNode( element, value ) )
                                _printDataValuesSettings2._printDataValues = value;
                        } else if( tagName == "DivPow10" ) {
                            int value;
                            if( KDXML::readIntNode( element, value ) )
                                _printDataValuesSettings2._divPow10 = value;
                        } else if( tagName == "DigitsBehindComma" ) {
                            int value;
                            if( KDXML::readIntNode( element, value ) )
                                _printDataValuesSettings2._digitsBehindComma = value;
                        } else if( tagName == "Font" ) {
                            readChartFontNode( element,
                                    _printDataValuesSettings2._dataValuesFont,
                                    _printDataValuesSettings2._dataValuesUseFontRelSize,
                                    _printDataValuesSettings2._dataValuesFontRelSize );
                        } else if( tagName == "Color" ) {
                            KDXML::readColorNode( element, _printDataValuesSettings2._dataValuesColor );
                        } else if( tagName == "Background" ) {
                            KDXML::readBrushNode( element, _printDataValuesSettings2._dataValuesBrush );
                        } else if( tagName == "AutoColor" ) {
                            KDXML::readBoolNode( element,
                                    _printDataValuesSettings2._dataValuesAutoColor );
                        } else if( tagName == "AnchorNegativePosition" ) {
                            QString value;
                            if( KDXML::readStringNode( element, value ) )
                                _printDataValuesSettings2._dataValuesAnchorNegativePosition = KDChartEnums::stringToPositionFlag( value );
                        } else if( tagName == "AnchorNegativeAlign" ) {
                            int value;
                            if( KDXML::readIntNode( element, value ) )
                                _printDataValuesSettings2._dataValuesAnchorNegativeAlign = value;
                        } else if( tagName == "AnchorNegativeDeltaX" ) {
                            int value;
                            if( KDXML::readIntNode( element, value ) )
                                _printDataValuesSettings2._dataValuesAnchorNegativeDeltaX = value;
                        } else if( tagName == "AnchorNegativeDeltaY" ) {
                            int value;
                            if( KDXML::readIntNode( element, value ) )
                                _printDataValuesSettings2._dataValuesAnchorNegativeDeltaY = value;
                        } else if( tagName == "NegativeRotation" ) {
                            int value;
                            if( KDXML::readIntNode( element, value ) )
                                _printDataValuesSettings2._dataValuesNegativeRotation = value;
                        } else if( tagName == "AnchorPositivePosition" ) {
                            QString value;
                            if( KDXML::readStringNode( element, value ) )
                                _printDataValuesSettings2._dataValuesAnchorPositivePosition = KDChartEnums::stringToPositionFlag( value );
                        } else if( tagName == "AnchorPositiveAlign" ) {
                            int value;
                            if( KDXML::readIntNode( element, value ) )
                                _printDataValuesSettings2._dataValuesAnchorPositiveAlign = value;
                        } else if( tagName == "AnchorPositiveDeltaX" ) {
                            int value;
                            if( KDXML::readIntNode( element, value ) )
                                _printDataValuesSettings2._dataValuesAnchorPositiveDeltaX = value;
                        } else if( tagName == "AnchorPositiveDeltaY" ) {
                            int value;
                            if( KDXML::readIntNode( element, value ) )
                                _printDataValuesSettings2._dataValuesAnchorPositiveDeltaY = value;
                        } else if( tagName == "PositiveRotation" ) {
                            int value;
                            if( KDXML::readIntNode( element, value ) )
                                _printDataValuesSettings2._dataValuesPositiveRotation = value;
                        } else if( tagName == "LayoutPolicy" ) {
                            QString value;
                            if( KDXML::readStringNode( element, value ) )
                                _printDataValuesSettings2._dataValuesLayoutPolicy = KDChartEnums::stringToLayoutPolicy( value );
                        } else if( tagName == "ShowInfinite" ) {
                            KDXML::readBoolNode( element, _printDataValuesSettings2._dataValuesShowInfinite );
                        } else {
                            qDebug( "Unknown subelement of DataValuesSettings2 found: %s", tagName.latin1() );
                        }
                    }
                    node = node.nextSibling();
                }
            } else if( tagName == "DataValuesGlobalSettings" ) {
                QDomNode node = element.firstChild();
                while( !node.isNull() ) {
                    QDomElement element = node.toElement();
                    if( !element.isNull() ) { // was really an element
                        QString tagName = element.tagName();
                        if( tagName == "allowOverlappingTexts" ) {
                            bool value;
                            if( KDXML::readBoolNode( element, value ) )
                                _allowOverlappingDataValueTexts = value;
                        }
                        else
                            qDebug( "Unknown subelement of DataValuesGlobalSettings found: %s", tagName.latin1() );
                        // do _not_ return false here (to enable future extentions)
                    }
                    node = node.nextSibling();
                }
            } else if( tagName == "AreaMap" ) {
                QDomNode node = element.firstChild();
                while( !node.isNull() ) {
                    QDomElement element = node.toElement();
                    if( !element.isNull() ) { // was really an element
                        QString tagName = element.tagName();
                        if( tagName == "FrameSettings" ) {
                            KDChartFrameSettings frameSettings;
                            uint areaId = KDChartEnums::AreaUNKNOWN;
                            if( KDChartFrameSettings::readFrameSettingsNode(
                                        element, frameSettings, areaId ) ) {
                                QString str;
                                if(areaId == KDChartEnums::AreaChartDataRegion)
                                    str = QString( "%1/%2/%3/%4" )
                                              .arg( areaId, 5 )
                                              .arg( frameSettings.dataRow(), 5 )
                                              .arg( frameSettings.dataCol(), 5 )
                                              .arg( 0, 5 );//frameSettings.data3rd(), 5 );
                                else
                                    str = QString( "%1/-----/-----/-----" ).arg( areaId, 5 );
                                _areaMap.insert( str, frameSettings );
                            }
                        }
                        else
                            qDebug( "Unknown tag in AreaMap found: %s", tagName.latin1() );
                        // do _not_ return false here (to enable future extentions)
                    }
                    node = node.nextSibling();
                }
            } else if( tagName == "CustomBoxMap" ) {
                QDomNode node = element.firstChild();
                int curNumber = -1;
                while( !node.isNull() ) {
                    QDomElement element = node.toElement();
                    if( !element.isNull() ) { // was really an element
                        QString tagName = element.tagName();
                        if( tagName == "Number" ) {
                            KDXML::readIntNode( element, curNumber );
                        } else if( tagName == "FrameSettings" ) {
                            Q_ASSERT( curNumber != -1 ); // there was a Dataset tag before
                            KDChartCustomBox customBox;
                            KDChartCustomBox::readCustomBoxNode( element,
                                    customBox );
                            _customBoxMap.insert( curNumber, customBox );
                        }
                        else
                            qDebug( "Unknown tag in CustomBoxMap found: %s", tagName.latin1() );
                    }
                    node = node.nextSibling();
                }
            } else {
                qDebug( "Unknown second-level element found: %s", tagName.latin1() );
                // NOTE: We do *not* 'return false' here but continue normal operation
                //       since additional elements might have been added in future versions
            }
        }
        node = node.nextSibling();
    }
    return true;
}


Generated by  Doxygen 1.6.0   Back to index