~ubuntu-branches/ubuntu/breezy/koffice/breezy-security

« back to all changes in this revision

Viewing changes to kchart/kdchart/KDChartParams_io.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Jonathan Riddell
  • Date: 2005-10-11 14:49:50 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20051011144950-lwpngbifzp8nk0ds
Tags: 1:1.4.1-0ubuntu7
* SECURITY UPDATE: fix heap based buffer overflow in the RTF importer of KWord
* Opening specially crafted RTF files in KWord can cause
  execution of abitrary code.
* Add kubuntu_01_rtfimport_heap_overflow.diff
* References:
  CAN-2005-2971
  CESA-2005-005
  http://www.koffice.org/security/advisory-20051011-1.txt

Show diffs side-by-side

added added

removed removed

Lines of Context:
27
27
 **
28
28
 **********************************************************************/
29
29
#include "KDChartParams.h"
 
30
#include "KDXMLTools.h"
 
31
 
 
32
#include <klocale.h>
30
33
 
31
34
/**
32
35
  \fn QTextStream& operator<<( QTextStream& s, const KDChartParams& p );
237
240
                "LineWidth", _lineWidth );
238
241
 
239
242
        // the LineColor element
240
 
        KDXML::createColorNode( doc, lineSettingsElement,
241
 
                "LineColor",
242
 
                _lineColor );
 
243
        if ( _lineColor.isValid() )
 
244
            KDXML::createColorNode( doc, lineSettingsElement,
 
245
                                    "LineColor", _lineColor );
243
246
 
244
247
        // the LineStyle element
245
248
        QDomElement lineStyleElement =
2116
2119
                        QString tagName = element.tagName();
2117
2120
                        if( tagName == "Number" ) {
2118
2121
                            KDXML::readIntNode( element, curNumber );
2119
 
                        } else if( tagName == "FrameSettings" ) {
 
2122
                         } else if( tagName == "CustomBox" /*"FrameSettings"*/ ) {
2120
2123
                            Q_ASSERT( curNumber != -1 ); // there was a Dataset tag before
2121
2124
                            KDChartCustomBox customBox;
2122
2125
                            KDChartCustomBox::readCustomBoxNode( element,
2588
2591
QString KDChartParams::lineMarkerStyleToStringTr( LineMarkerStyle style ) {
2589
2592
    switch( style ) {
2590
2593
        case LineMarkerSquare:
2591
 
            return tr( "Square" );
 
2594
            return i18n( "Square" );
2592
2595
        case LineMarkerDiamond:
2593
 
            return tr( "Diamond" );
 
2596
            return i18n( "Diamond" );
2594
2597
        case LineMarkerCircle:
2595
 
            return tr( "Circle" );
 
2598
            return i18n( "Circle" );
2596
2599
        case LineMarker1Pixel:
2597
 
            return tr( "One pixel" );
 
2600
            return i18n( "One pixel" );
2598
2601
        case LineMarker4Pixels:
2599
 
            return tr( "Four pixels" );
 
2602
            return i18n( "Four pixels" );
2600
2603
        case LineMarkerRing:
2601
 
            return tr( "Ring" );
 
2604
            return i18n( "Ring" );
2602
2605
        case LineMarkerCross:
2603
 
            return tr( "Cross" );
 
2606
            return i18n( "Cross" );
2604
2607
        default: // should not happen
2605
2608
            qDebug( "Unknown line marker style!" );
2606
 
            return tr( "Circle" );
 
2609
            return i18n( "Circle" );
2607
2610
    }
2608
2611
}
2609
2612
 
2644
2647
  \return the line marker style enum value
2645
2648
  */
2646
2649
KDChartParams::LineMarkerStyle KDChartParams::stringToLineMarkerStyleTr( const QString& string ) {
2647
 
    if( string == tr( "Square" ) )
 
2650
    if( string == i18n( "Square" ) )
2648
2651
        return LineMarkerSquare;
2649
 
    else if( string == tr( "Diamond" ) )
 
2652
    else if( string == i18n( "Diamond" ) )
2650
2653
        return LineMarkerDiamond;
2651
 
    else if( string == tr( "Circle" ) )
 
2654
    else if( string == i18n( "Circle" ) )
2652
2655
        return LineMarkerCircle;
2653
 
    else if( string == tr( "One pixel" ) )
 
2656
    else if( string == i18n( "One pixel" ) )
2654
2657
        return LineMarker1Pixel;
2655
 
    else if( string == tr( "Four pixels" ) )
 
2658
    else if( string == i18n( "Four pixels" ) )
2656
2659
        return LineMarker4Pixels;
2657
 
    else if( string == tr( "Ring" ) )
 
2660
    else if( string == i18n( "Ring" ) )
2658
2661
        return LineMarkerRing;
2659
 
    else if( string == tr( "Cross" ) )
 
2662
    else if( string == i18n( "Cross" ) )
2660
2663
        return LineMarkerCross;
2661
2664
    else // default, should not happen
2662
2665
        return LineMarkerCircle;
2808
2811
QString KDChartParams::polarMarkerStyleToStringTr( PolarMarkerStyle style ) {
2809
2812
    switch( style ) {
2810
2813
        case PolarMarkerSquare:
2811
 
            return tr( "Square" );
 
2814
            return i18n( "Square" );
2812
2815
        case PolarMarkerDiamond:
2813
 
            return tr( "Diamond" );
 
2816
            return i18n( "Diamond" );
2814
2817
        case PolarMarkerCircle:
2815
 
            return tr( "Circle" );
 
2818
            return i18n( "Circle" );
2816
2819
        default: // should not happen
2817
2820
            qDebug( "Unknown polar marker style" );
2818
 
            return tr( "Circle" );
 
2821
            return i18n( "Circle" );
2819
2822
    }
2820
2823
}
2821
2824
 
2846
2849
  \return the polar marker style enum value
2847
2850
  */
2848
2851
KDChartParams::PolarMarkerStyle KDChartParams::stringToPolarMarkerStyleTr( const QString& string ) {
2849
 
    if( string == tr( "Square" ) )
 
2852
    if( string == i18n( "Square" ) )
2850
2853
        return PolarMarkerSquare;
2851
 
    else if( string == tr( "Diamond" ) )
 
2854
    else if( string == i18n( "Diamond" ) )
2852
2855
        return PolarMarkerDiamond;
2853
 
    else if( string == tr( "Circle" ) )
 
2856
    else if( string == i18n( "Circle" ) )
2854
2857
        return PolarMarkerCircle;
2855
2858
    else // default, should not happen
2856
2859
        return PolarMarkerCircle;