1
/* This file is part of the KDE project
2
Copyright (C) 1998, 1999 Torben Weis <weis@kde.org>
3
Copyright (C) 2000 - 2003 The KSpread Team
4
www.koffice.org/kspread
6
This library is free software; you can redistribute it and/or
7
modify it under the terms of the GNU Library General Public
8
License as published by the Free Software Foundation; either
9
version 2 of the License, or (at your option) any later version.
11
This library is distributed in the hope that it will be useful,
12
but WITHOUT ANY WARRANTY; without even the implied warranty of
13
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14
Library General Public License for more details.
16
You should have received a copy of the GNU Library General Public License
17
along with this library; see the file COPYING.LIB. If not, write to
18
the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
19
Boston, MA 02111-1307, USA.
22
#include "kspread_canvas.h"
23
#include "kspread_doc.h"
24
#include "kspread_global.h"
25
#include "kspread_sheet.h"
26
#include "kspread_sheetprint.h"
27
#include "kspread_style.h"
28
#include "kspread_style_manager.h"
29
#include "KSpreadColumnIface.h"
30
#include "KSpreadLayoutIface.h"
31
#include "KSpreadRowIface.h"
33
#include <dcopobject.h>
48
double g_colWidth = colWidth;
49
double g_rowHeight = heightOfRow;
52
using namespace format_LNS;
55
/*****************************************************************************
59
*****************************************************************************/
61
KSpreadFormat::KSpreadFormat( KSpreadSheet * _table, KSpreadStyle * _style )
71
KSpreadFormat::~KSpreadFormat()
75
void KSpreadFormat::defaultStyleFormat()
77
if ( m_pStyle->release() )
81
m_pStyle = m_pTable->doc()->styleManager()->defaultStyle();
87
void KSpreadFormat::setGlobalColWidth( double width )
92
void KSpreadFormat::setGlobalRowHeight( double height )
97
double KSpreadFormat::globalRowHeight()
102
double KSpreadFormat::globalColWidth()
107
void KSpreadFormat::copy( const KSpreadFormat & _l )
109
if ( m_pStyle && m_pStyle->release() )
112
m_pStyle = new KSpreadStyle( _l.m_pStyle );
115
m_flagsMask = _l.m_flagsMask;
116
m_bNoFallBack = _l.m_bNoFallBack;
118
if ( _l.m_strComment )
121
m_strComment = new QString( *_l.m_strComment );
125
void KSpreadFormat::setKSpreadStyle( KSpreadStyle * style )
127
if ( style == m_pStyle )
130
if ( m_pStyle && m_pStyle->release() )
137
kdDebug() << "Newly assigned style: " << m_pStyle << ", type: " << m_pStyle->type() << endl;
138
if ( style->type() == KSpreadStyle::BUILTIN || style->type() == KSpreadStyle::CUSTOM )
139
kdDebug() << "Style name: " << ((KSpreadCustomStyle *) m_pStyle)->name() << endl;
142
void KSpreadFormat::clearFlag( FormatFlags flag )
144
m_flagsMask &= ~(Q_UINT32)flag;
147
void KSpreadFormat::setFlag( FormatFlags flag )
149
m_flagsMask |= (Q_UINT32)flag;
152
bool KSpreadFormat::testFlag( FormatFlags flag ) const
154
return ( m_flagsMask & (Q_UINT32)flag );
157
void KSpreadFormat::clearProperties()
164
void KSpreadFormat::clearProperty( Properties p )
171
bool KSpreadFormat::hasProperty( Properties p, bool withoutParent ) const
173
if ( m_pStyle->hasFeature( (KSpreadStyle::FlagsSet) p, withoutParent ) )
176
return ( m_mask & (uint)p );
179
void KSpreadFormat::setProperty( Properties p )
184
void KSpreadFormat::clearNoFallBackProperties()
191
void KSpreadFormat::clearNoFallBackProperties( Properties p )
193
m_bNoFallBack &= ~(uint)p;
198
bool KSpreadFormat::hasNoFallBackProperties( Properties p ) const
200
return ( m_bNoFallBack & (uint)p );
203
void KSpreadFormat::setNoFallBackProperties( Properties p )
205
m_bNoFallBack |= (uint)p;
211
// Loading and saving
215
QDomElement KSpreadFormat::saveFormat( QDomDocument & doc, int _col, int _row, bool force, bool copy ) const
217
QDomElement format( doc.createElement( "format" ) );
219
if ( m_pStyle->type() == KSpreadStyle::BUILTIN || m_pStyle->type() == KSpreadStyle::CUSTOM )
221
format.setAttribute( "style-name", ((KSpreadCustomStyle *) m_pStyle)->name() );
223
if ( !copy && m_pTable->doc()->specialOutputFlag() != KoDocument::SaveAsKOffice1dot1 /* so it's KSpread < 1.2 */)
228
if ( m_pStyle->parent() && m_pStyle->parent()->name().length() > 0 )
229
format.setAttribute( "parent", m_pStyle->parent()->name() );
232
if ( hasProperty( PAlign, true ) || hasNoFallBackProperties( PAlign ) || force )
233
format.setAttribute( "align", (int) align( _col, _row ) );
234
if ( hasProperty( PAlignY, true ) || hasNoFallBackProperties( PAlignY ) || force )
235
format.setAttribute( "alignY", (int)alignY( _col, _row ) );
236
if ( ( hasProperty( PBackgroundColor, false ) || hasNoFallBackProperties( PBackgroundColor)
237
|| force ) && bgColor( _col, _row ).isValid() )
238
format.setAttribute( "bgcolor", bgColor( _col, _row ).name() );
239
if ( ( hasProperty( PMultiRow, true ) || hasNoFallBackProperties( PMultiRow )
240
|| force ) && multiRow( _col, _row ) )
241
format.setAttribute( "multirow", "yes" );
242
if ( ( hasProperty( PVerticalText, true ) || hasNoFallBackProperties( PVerticalText )
243
|| force ) && verticalText( _col, _row ) )
244
format.setAttribute( "verticaltext", "yes" );
245
if ( hasProperty( PPrecision, true ) || hasNoFallBackProperties( PPrecision ) || force )
246
format.setAttribute( "precision", precision( _col, _row ) );
247
if ( ( hasProperty( PPrefix, true ) || hasNoFallBackProperties( PPrefix ) || force )
248
&& !prefix( _col, _row ).isEmpty() )
249
format.setAttribute( "prefix", prefix( _col, _row ) );
250
if ( ( hasProperty( PPostfix, true ) || hasNoFallBackProperties( PPostfix ) || force )
251
&& !postfix( _col, _row ).isEmpty() )
252
format.setAttribute( "postfix", postfix( _col, _row ) );
253
if ( hasProperty( PFloatFormat, true ) || hasNoFallBackProperties( PFloatFormat ) || force )
254
format.setAttribute( "float", (int) floatFormat( _col, _row ) );
255
if ( hasProperty( PFloatColor, true ) || hasNoFallBackProperties( PFloatColor ) || force )
256
format.setAttribute( "floatcolor", (int) floatColor( _col, _row ) );
257
if ( hasProperty( PFactor, true ) || hasNoFallBackProperties( PFactor ) || force )
258
format.setAttribute( "faktor", factor( _col, _row ) );
259
if ( hasProperty( PFormatType, true ) || hasNoFallBackProperties( PFormatType ) || force )
260
format.setAttribute( "format", (int)getFormatType( _col, _row ));
261
if ( hasProperty( PCustomFormat, true ) || hasNoFallBackProperties( PCustomFormat ) || force )
263
QString s( getFormatString( _col, _row ) );
264
if ( s.length() > 0 )
265
format.setAttribute( "custom", s );
267
if ( getFormatType( _col, _row ) == Money )
269
format.setAttribute( "type", (int) m_pStyle->currency().type ); // TODO: fallback?
270
format.setAttribute( "symbol", m_pStyle->currency().symbol );
272
if ( hasProperty( PAngle, true ) || hasNoFallBackProperties( PAngle ) || force )
273
format.setAttribute( "angle", getAngle( _col, _row ) );
274
if ( hasProperty( PIndent, true ) || hasNoFallBackProperties( PIndent ) || force )
275
format.setAttribute( "indent", getIndent( _col, _row ) );
276
if( ( hasProperty( PDontPrintText, true ) || hasNoFallBackProperties( PDontPrintText )
277
|| force ) && getDontprintText( _col, _row ) )
278
format.setAttribute( "dontprinttext", "yes" );
279
if( ( hasProperty( PNotProtected, true ) || hasNoFallBackProperties( PNotProtected )
280
|| force ) && notProtected( _col, _row ) )
281
format.setAttribute( "noprotection", "yes" );
282
if( ( hasProperty( PHideAll, true ) || hasNoFallBackProperties( PHideAll )
283
|| force ) && isHideAll( _col, _row ) )
284
format.setAttribute( "hideall", "yes" );
285
if( ( hasProperty( PHideFormula, true ) || hasNoFallBackProperties( PHideFormula )
286
|| force ) && isHideFormula( _col, _row ) )
287
format.setAttribute( "hideformula", "yes" );
288
if ( hasProperty( PFont, true ) || hasNoFallBackProperties( PFont ) || force )
289
format.appendChild( util_createElement( "font", textFont( _col, _row ), doc ) );
290
if ( ( hasProperty( PTextPen, true ) || hasNoFallBackProperties( PTextPen ) || force )
291
&& textPen( _col, _row ).color().isValid() )
292
format.appendChild( util_createElement( "pen", textPen( _col, _row ), doc ) );
293
if ( hasProperty( PBackgroundBrush, true ) || hasNoFallBackProperties( PBackgroundBrush ) || force )
295
format.setAttribute( "brushcolor", backGroundBrushColor( _col, _row ).name() );
296
format.setAttribute( "brushstyle", (int)backGroundBrushStyle( _col, _row ) );
298
if ( hasProperty( PLeftBorder, true ) || hasNoFallBackProperties( PLeftBorder ) || force )
300
QDomElement left = doc.createElement( "left-border" );
301
left.appendChild( util_createElement( "pen", leftBorderPen( _col, _row ), doc ) );
302
format.appendChild( left );
304
if ( hasProperty( PTopBorder, true ) || hasNoFallBackProperties( PTopBorder ) || force )
306
QDomElement top = doc.createElement( "top-border" );
307
top.appendChild( util_createElement( "pen", topBorderPen( _col, _row ), doc ) );
308
format.appendChild( top );
310
if ( hasProperty( PRightBorder, true ) || hasNoFallBackProperties( PRightBorder ) || force )
312
QDomElement right = doc.createElement( "right-border" );
313
right.appendChild( util_createElement( "pen", rightBorderPen( _col, _row ), doc ) );
314
format.appendChild( right );
316
if ( hasProperty( PBottomBorder, true ) || hasNoFallBackProperties( PBottomBorder ) || force )
318
QDomElement bottom = doc.createElement( "bottom-border" );
319
bottom.appendChild( util_createElement( "pen", bottomBorderPen( _col, _row ), doc ) );
320
format.appendChild( bottom );
322
if ( hasProperty( PFallDiagonal, true ) || hasNoFallBackProperties( PFallDiagonal ) || force )
324
QDomElement fallDiagonal = doc.createElement( "fall-diagonal" );
325
fallDiagonal.appendChild( util_createElement( "pen", fallDiagonalPen( _col, _row ), doc ) );
326
format.appendChild( fallDiagonal );
328
if ( hasProperty( PGoUpDiagonal, true ) || hasNoFallBackProperties( PGoUpDiagonal ) || force )
330
QDomElement goUpDiagonal = doc.createElement( "up-diagonal" );
331
goUpDiagonal.appendChild( util_createElement( "pen", goUpDiagonalPen( _col, _row ), doc ) );
332
format.appendChild( goUpDiagonal );
338
QDomElement KSpreadFormat::saveFormat( QDomDocument& doc, bool force, bool copy ) const
340
QDomElement format( doc.createElement( "format" ) );
342
if ( m_pStyle->type() == KSpreadStyle::BUILTIN || m_pStyle->type() == KSpreadStyle::CUSTOM )
344
format.setAttribute( "style-name", ((KSpreadCustomStyle *) m_pStyle)->name() );
346
if ( !copy && m_pTable->doc()->specialOutputFlag() != KoDocument::SaveAsKOffice1dot1 /* so it's KSpread < 1.2 */)
351
if ( m_pStyle->parent() && m_pStyle->parentName().length() > 0 )
352
format.setAttribute( "parent", m_pStyle->parentName() );
355
if ( hasProperty( PAlign, true ) || hasNoFallBackProperties( PAlign ) || force )
356
format.setAttribute( "align", (int)m_pStyle->alignX() );
357
if ( hasProperty( PAlignY, true ) || hasNoFallBackProperties( PAlignY ) || force )
358
format.setAttribute( "alignY", (int)m_pStyle->alignY() );
359
if ( ( hasProperty( PBackgroundColor, true ) || hasNoFallBackProperties( PBackgroundColor )
360
|| force ) && m_pStyle->bgColor().isValid() )
361
format.setAttribute( "bgcolor", m_pStyle->bgColor().name() );
363
if ( ( hasProperty( PMultiRow, true ) || hasNoFallBackProperties( PMultiRow ) || force )
364
&& m_pStyle->hasProperty( KSpreadStyle::PMultiRow ) )
365
format.setAttribute( "multirow", "yes" );
366
if ( ( hasProperty( PVerticalText, true ) || hasNoFallBackProperties( PVerticalText ) || force )
367
&& m_pStyle->hasProperty( KSpreadStyle::PVerticalText ) )
368
format.setAttribute( "verticaltext", "yes" );
370
if ( hasProperty( PPrecision, true ) || hasNoFallBackProperties( PPrecision ) || force )
371
format.setAttribute( "precision", m_pStyle->precision() );
372
if ( ( hasProperty( PPrefix, true ) || hasNoFallBackProperties( PPrefix ) || force )
373
&& !m_pStyle->prefix().isEmpty() )
374
format.setAttribute( "prefix", m_pStyle->prefix() );
375
if ( ( hasProperty( PPostfix, true ) || hasNoFallBackProperties( PPostfix ) || force )
376
&& !m_pStyle->postfix().isEmpty() )
377
format.setAttribute( "postfix", m_pStyle->postfix() );
379
if ( hasProperty( PFloatFormat, true ) || hasNoFallBackProperties( PFloatFormat ) || force )
380
format.setAttribute( "float", (int) m_pStyle->floatFormat() );
381
if ( hasProperty( PFloatColor, true ) || hasNoFallBackProperties( PFloatColor ) || force )
382
format.setAttribute( "floatcolor", (int) m_pStyle->floatColor() );
383
if ( hasProperty( PFactor, true ) || hasNoFallBackProperties( PFactor ) || force )
384
format.setAttribute( "faktor", m_pStyle->factor() );
385
if ( hasProperty( PFormatType, true ) || hasNoFallBackProperties( PFormatType ) || force )
386
format.setAttribute( "format", (int) m_pStyle->formatType() );
387
if ( hasProperty( PCustomFormat, true ) || hasNoFallBackProperties( PCustomFormat ) || force )
388
if ( m_pStyle->strFormat().length() > 0 )
389
format.setAttribute( "custom", m_pStyle->strFormat() );
390
if ( m_pStyle->formatType() == Money )
392
format.setAttribute( "type", (int) m_pStyle->currency().type );
393
format.setAttribute( "symbol", m_pStyle->currency().symbol );
395
if ( hasProperty( PAngle, true ) || hasNoFallBackProperties( PAngle ) || force )
396
format.setAttribute( "angle", m_pStyle->rotateAngle() );
397
if ( hasProperty( PIndent, true ) || hasNoFallBackProperties( PIndent ) || force )
398
format.setAttribute( "indent", m_pStyle->indent() );
399
if ( ( hasProperty( PDontPrintText, true ) || hasNoFallBackProperties( PDontPrintText ) || force )
400
&& m_pStyle->hasProperty( KSpreadStyle::PDontPrintText ) )
401
format.setAttribute( "dontprinttext", "yes" );
402
if ( ( hasProperty( PNotProtected, true ) || hasNoFallBackProperties( PNotProtected )
403
|| force ) && m_pStyle->hasProperty( KSpreadStyle::PNotProtected ) )
404
format.setAttribute( "noprotection", "yes" );
405
if( ( hasProperty( PHideAll, true ) || hasNoFallBackProperties( PHideAll )
406
|| force ) && m_pStyle->hasProperty( KSpreadStyle::PHideAll ) )
407
format.setAttribute( "hideall", "yes" );
408
if( ( hasProperty( PHideFormula, true ) || hasNoFallBackProperties( PHideFormula )
409
|| force ) && m_pStyle->hasProperty( KSpreadStyle::PHideFormula ) )
410
format.setAttribute( "hideformula", "yes" );
411
if ( hasProperty( PFont, true ) || hasNoFallBackProperties( PFont ) || force )
412
format.appendChild( util_createElement( "font", m_pStyle->font(), doc ) );
413
if ( ( hasProperty( PTextPen, true ) || hasNoFallBackProperties( PTextPen ) || force )
414
&& m_pStyle->pen().color().isValid() )
415
format.appendChild( util_createElement( "pen", m_pStyle->pen(), doc ) );
416
if ( hasProperty( PBackgroundBrush, true ) || hasNoFallBackProperties( PBackgroundBrush ) || force )
418
format.setAttribute( "brushcolor", m_pStyle->backGroundBrush().color().name() );
419
format.setAttribute( "brushstyle", (int) m_pStyle->backGroundBrush().style() );
421
if ( hasProperty( PLeftBorder, true ) || hasNoFallBackProperties( PLeftBorder ) || force )
423
QDomElement left = doc.createElement( "left-border" );
424
left.appendChild( util_createElement( "pen", m_pStyle->leftBorderPen(), doc ) );
425
format.appendChild( left );
427
if ( hasProperty( PTopBorder, true ) || hasNoFallBackProperties( PTopBorder ) || force )
429
QDomElement top = doc.createElement( "top-border" );
430
top.appendChild( util_createElement( "pen", m_pStyle->topBorderPen(), doc ) );
431
format.appendChild( top );
433
if ( hasProperty( PRightBorder, true ) || hasNoFallBackProperties( PRightBorder ) || force )
435
QDomElement right = doc.createElement( "right-border" );
436
right.appendChild( util_createElement( "pen", m_pStyle->rightBorderPen(), doc ) );
437
format.appendChild( right );
439
if ( hasProperty( PBottomBorder, true ) || hasNoFallBackProperties( PBottomBorder ) || force )
441
QDomElement bottom = doc.createElement( "bottom-border" );
442
bottom.appendChild( util_createElement( "pen", m_pStyle->bottomBorderPen(), doc ) );
443
format.appendChild( bottom );
445
if ( hasProperty( PFallDiagonal, true ) || hasNoFallBackProperties( PFallDiagonal ) || force )
447
QDomElement fallDiagonal = doc.createElement( "fall-diagonal" );
448
fallDiagonal.appendChild( util_createElement( "pen", m_pStyle->fallDiagonalPen(), doc ) );
449
format.appendChild( fallDiagonal );
451
if ( hasProperty( PGoUpDiagonal, true ) || hasNoFallBackProperties( PGoUpDiagonal ) || force )
453
QDomElement goUpDiagonal = doc.createElement( "up-diagonal" );
454
goUpDiagonal.appendChild( util_createElement( "pen", m_pStyle->goUpDiagonalPen(), doc ) );
455
format.appendChild( goUpDiagonal );
460
QDomElement KSpreadFormat::save( QDomDocument & doc, int _col, int _row, bool force, bool copy ) const
462
QDomElement format = saveFormat( doc, _col, _row, force, copy );
466
bool KSpreadFormat::loadFormat( const QDomElement & f, PasteMode pm, bool paste )
468
if ( f.hasAttribute( "style-name" ) )
470
KSpreadStyle * s = m_pTable->doc()->styleManager()->style( f.attribute( "style-name" ) );
472
kdDebug() << "Using style: " << f.attribute( "style-name" ) << ", s: " << s << endl;
475
setKSpreadStyle( s );
483
if ( f.hasAttribute( "parent" ) )
485
KSpreadCustomStyle * s = (KSpreadCustomStyle *) m_pTable->doc()->styleManager()->style( f.attribute( "parent" ) );
486
kdDebug() << "Loading Style, parent: " << s->name() << ": " << s << endl;
490
if ( m_pStyle && m_pStyle->release() )
493
m_pStyle = new KSpreadStyle();
494
m_pStyle->setParent( s );
499
if ( f.hasAttribute( "align" ) )
501
Align a = (Align) f.attribute( "align" ).toInt( &ok );
505
if ( (unsigned int) a >= 1 || (unsigned int) a <= 4 )
510
if ( f.hasAttribute( "alignY" ) )
512
AlignY a = (AlignY) f.attribute( "alignY" ).toInt( &ok );
516
if ( (unsigned int) a >= 1 || (unsigned int) a <= 4 )
522
if ( f.hasAttribute( "bgcolor" ) )
523
setBgColor( QColor( f.attribute( "bgcolor" ) ) );
525
if ( f.hasAttribute( "multirow" ) )
528
if ( f.hasAttribute( "verticaltext" ) )
529
setVerticalText( true );
531
if ( f.hasAttribute( "precision" ) )
533
int i = f.attribute( "precision" ).toInt( &ok );
536
kdDebug(36001) << "Value out of range Cell::precision=" << i << endl;
543
if ( f.hasAttribute( "float" ) )
545
FloatFormat a = (FloatFormat) f.attribute( "float" ).toInt( &ok );
546
if ( !ok ) return false;
547
if ( (unsigned int) a >= 1 || (unsigned int) a <= 3 )
553
if ( f.hasAttribute( "floatcolor" ) )
555
FloatColor a = (FloatColor) f.attribute( "floatcolor" ).toInt( &ok );
556
if ( !ok ) return false;
557
if ( (unsigned int) a >= 1 || (unsigned int) a <= 2 )
563
if ( f.hasAttribute( "faktor" ) )
565
setFactor( f.attribute( "faktor" ).toDouble( &ok ) );
566
if ( !ok ) return false;
568
if ( f.hasAttribute( "format" ) )
570
int fo = f.attribute( "format" ).toInt( &ok );
573
setFormatType( ( FormatType ) fo );
575
if ( f.hasAttribute( "custom" ) )
577
setFormatString( f.attribute( "custom" ) );
579
if ( m_pStyle->formatType() == Money )
583
if ( f.hasAttribute( "type" ) )
585
c.type = f.attribute( "type" ).toInt( &ok );
589
if ( f.hasAttribute( "symbol" ) )
591
c.symbol = f.attribute( "symbol" );
596
if ( f.hasAttribute( "angle" ) )
598
setAngle( f.attribute( "angle" ).toInt( &ok ) );
602
if ( f.hasAttribute( "indent" ) )
604
setIndent( f.attribute( "indent" ).toDouble( &ok ) );
608
if ( f.hasAttribute( "dontprinttext" ) )
609
setDontPrintText( true );
611
if ( f.hasAttribute( "noprotection" ) )
612
setNotProtected( true );
614
if ( f.hasAttribute( "hideall" ) )
617
if ( f.hasAttribute( "hideformula" ) )
618
setHideFormula( true );
620
if ( f.hasAttribute( "brushcolor" ) )
621
setBackGroundBrushColor( QColor( f.attribute( "brushcolor" ) ) );
623
if ( f.hasAttribute( "brushstyle" ) )
625
setBackGroundBrushStyle( (Qt::BrushStyle) f.attribute( "brushstyle" ).toInt( &ok ) );
630
QDomElement pen( f.namedItem( "pen" ).toElement() );
632
setTextPen( util_toPen( pen ) );
634
QDomElement font( f.namedItem( "font" ).toElement() );
635
if ( !font.isNull() )
636
setTextFont( util_toFont( font ) );
638
if ( ( pm != NoBorder ) && ( pm != Text ) && ( pm != Comment ) )
640
QDomElement left( f.namedItem( "left-border" ).toElement() );
641
if ( !left.isNull() )
643
QDomElement pen( left.namedItem( "pen" ).toElement() );
645
setLeftBorderPen( util_toPen( pen ) );
648
QDomElement top( f.namedItem( "top-border" ).toElement() );
651
QDomElement pen( top.namedItem( "pen" ).toElement() );
653
setTopBorderPen( util_toPen( pen ) );
656
QDomElement right( f.namedItem( "right-border" ).toElement() );
657
if ( !right.isNull() )
659
QDomElement pen( right.namedItem( "pen" ).toElement() );
661
setRightBorderPen( util_toPen( pen ) );
664
QDomElement bottom( f.namedItem( "bottom-border" ).toElement() );
665
if ( !bottom.isNull() )
667
QDomElement pen( bottom.namedItem( "pen" ).toElement() );
669
setBottomBorderPen( util_toPen( pen ) );
672
QDomElement fallDiagonal( f.namedItem( "fall-diagonal" ).toElement() );
673
if ( !fallDiagonal.isNull() )
675
QDomElement pen( fallDiagonal.namedItem( "pen" ).toElement() );
677
setFallDiagonalPen( util_toPen( pen ) );
680
QDomElement goUpDiagonal( f.namedItem( "up-diagonal" ).toElement() );
681
if ( !goUpDiagonal.isNull() )
683
QDomElement pen( goUpDiagonal.namedItem( "pen" ).toElement() );
685
setGoUpDiagonalPen( util_toPen( pen ) );
689
if ( f.hasAttribute( "prefix" ) )
690
setPrefix( f.attribute( "prefix" ) );
691
if ( f.hasAttribute( "postfix" ) )
692
setPostfix( f.attribute( "postfix" ) );
697
bool KSpreadFormat::load( const QDomElement & f, PasteMode pm, bool paste )
699
if ( !loadFormat( f, pm, paste ) )
711
void KSpreadFormat::setFormatString( QString const & format )
713
if ( format.isEmpty() )
715
clearProperty( PCustomFormat );
716
setNoFallBackProperties( PCustomFormat );
720
setProperty( PCustomFormat );
721
clearNoFallBackProperties( PCustomFormat );
723
// now have a custom format...
724
clearProperty( PPrefix );
725
clearProperty( PPostfix );
726
clearProperty( PPrecision );
727
clearProperty( PFloatColor );
728
clearProperty( PFloatFormat );
730
setNoFallBackProperties( PPrecision );
731
setNoFallBackProperties( PPrefix );
732
setNoFallBackProperties( PPostfix );
735
m_pStyle = m_pStyle->setStrFormat( format );
739
void KSpreadFormat::setAlign( Align _align )
741
if ( _align == KSpreadFormat::Undefined )
743
clearProperty( PAlign );
744
setNoFallBackProperties(PAlign );
748
setProperty( PAlign );
749
clearNoFallBackProperties(PAlign );
752
m_pStyle = m_pStyle->setAlignX( _align );
756
void KSpreadFormat::setAlignY( AlignY _alignY)
758
kdDebug() << "Format: AlignY: " << _alignY << endl;
759
if ( _alignY == KSpreadFormat::Middle )
761
kdDebug() << "Middle" << endl;
762
clearProperty( PAlignY );
763
setNoFallBackProperties(PAlignY );
767
kdDebug() << "Not middle: " << _alignY << endl;
768
setProperty( PAlignY );
769
clearNoFallBackProperties( PAlignY );
772
m_pStyle = m_pStyle->setAlignY( _alignY );
776
void KSpreadFormat::setFactor( double _d )
780
clearProperty( PFactor );
781
setNoFallBackProperties(PFactor );
785
setProperty( PFactor );
786
clearNoFallBackProperties( PFactor );
789
m_pStyle = m_pStyle->setFactor( _d );
793
void KSpreadFormat::setPrefix( const QString& _prefix )
795
if ( _prefix.isEmpty() )
797
clearProperty( PPrefix );
798
setNoFallBackProperties( PPrefix );
802
setProperty( PPrefix );
803
clearNoFallBackProperties( PPrefix );
806
m_pStyle = m_pStyle->setPrefix( _prefix );
810
void KSpreadFormat::setPostfix( const QString& _postfix )
812
if ( _postfix.isEmpty() )
814
clearProperty( PPostfix );
815
setNoFallBackProperties( PPostfix );
819
setProperty( PPostfix );
820
clearNoFallBackProperties( PPostfix );
823
m_pStyle = m_pStyle->setPostfix( _postfix );
827
void KSpreadFormat::setPrecision( int _p )
831
clearProperty( PPrecision );
832
setNoFallBackProperties( PPrecision );
836
setProperty( PPrecision );
837
clearNoFallBackProperties( PPrecision );
840
m_pStyle = m_pStyle->setPrecision( _p );
844
void KSpreadFormat::setLeftBorderPen( const QPen & _p )
846
if ( _p.style() == Qt::NoPen )
848
clearProperty( PLeftBorder );
849
setNoFallBackProperties( PLeftBorder );
853
setProperty( PLeftBorder );
854
clearNoFallBackProperties( PLeftBorder );
857
m_pStyle = m_pStyle->setLeftBorderPen( _p );
861
void KSpreadFormat::setLeftBorderStyle( Qt::PenStyle s )
863
QPen p( m_pStyle->leftBorderPen() );
865
setLeftBorderPen( p );
868
void KSpreadFormat::setLeftBorderColor( const QColor & c )
870
QPen p( m_pStyle->leftBorderPen() );
872
setLeftBorderPen( p );
875
void KSpreadFormat::setLeftBorderWidth( int _w )
877
QPen p( m_pStyle->leftBorderPen() );
879
setLeftBorderPen( p );
882
void KSpreadFormat::setTopBorderPen( const QPen & _p )
884
if ( _p.style() == Qt::NoPen )
886
clearProperty( PTopBorder );
887
setNoFallBackProperties( PTopBorder );
891
setProperty( PTopBorder );
892
clearNoFallBackProperties( PTopBorder );
895
m_pStyle = m_pStyle->setTopBorderPen( _p );
899
void KSpreadFormat::setTopBorderStyle( Qt::PenStyle s )
901
QPen p( m_pStyle->topBorderPen() );
903
setTopBorderPen( p );
906
void KSpreadFormat::setTopBorderColor( const QColor& c )
908
QPen p( m_pStyle->topBorderPen() );
910
setTopBorderPen( p );
913
void KSpreadFormat::setTopBorderWidth( int _w )
915
QPen p( m_pStyle->topBorderPen() );
917
setTopBorderPen( p );
920
void KSpreadFormat::setRightBorderPen( const QPen& p )
922
if ( p.style() == Qt::NoPen )
924
clearProperty( PRightBorder );
925
setNoFallBackProperties( PRightBorder );
929
setProperty( PRightBorder );
930
clearNoFallBackProperties( PRightBorder );
933
m_pStyle = m_pStyle->setRightBorderPen( p );
937
void KSpreadFormat::setRightBorderStyle( Qt::PenStyle _s )
939
QPen p( m_pStyle->rightBorderPen() );
941
setRightBorderPen( p );
944
void KSpreadFormat::setRightBorderColor( const QColor & _c )
946
QPen p( m_pStyle->rightBorderPen() );
948
setRightBorderPen( p );
951
void KSpreadFormat::setRightBorderWidth( int _w )
953
QPen p( m_pStyle->rightBorderPen() );
955
setRightBorderPen( p );
958
void KSpreadFormat::setBottomBorderPen( const QPen& p )
960
if ( p.style() == Qt::NoPen )
962
clearProperty( PBottomBorder );
963
setNoFallBackProperties( PBottomBorder );
967
setProperty( PBottomBorder );
968
clearNoFallBackProperties( PBottomBorder );
971
m_pStyle = m_pStyle->setBottomBorderPen( p );
975
void KSpreadFormat::setBottomBorderStyle( Qt::PenStyle _s )
977
QPen p( m_pStyle->bottomBorderPen() );
979
setBottomBorderPen( p );
982
void KSpreadFormat::setBottomBorderColor( const QColor & _c )
984
QPen p( m_pStyle->bottomBorderPen() );
986
setBottomBorderPen( p );
989
void KSpreadFormat::setBottomBorderWidth( int _w )
991
QPen p( m_pStyle->bottomBorderPen() );
993
setBottomBorderPen( p );
996
void KSpreadFormat::setFallDiagonalPen( const QPen & _p )
998
if ( _p.style() == Qt::NoPen )
1000
clearProperty( PFallDiagonal );
1001
setNoFallBackProperties( PFallDiagonal );
1005
setProperty( PFallDiagonal );
1006
clearNoFallBackProperties( PFallDiagonal );
1009
m_pStyle = m_pStyle->setFallDiagonalPen( _p );
1013
void KSpreadFormat::setFallDiagonalStyle( Qt::PenStyle s )
1015
QPen p( m_pStyle->fallDiagonalPen() );
1017
setFallDiagonalPen( p );
1020
void KSpreadFormat::setFallDiagonalColor( const QColor& c )
1022
QPen p( m_pStyle->fallDiagonalPen() );
1024
setFallDiagonalPen( p );
1027
void KSpreadFormat::setFallDiagonalWidth( int _w )
1029
QPen p( m_pStyle->fallDiagonalPen() );
1031
setFallDiagonalPen( p );
1034
void KSpreadFormat::setGoUpDiagonalPen( const QPen & _p )
1036
if ( _p.style() == Qt::NoPen )
1038
clearProperty( PGoUpDiagonal );
1039
setNoFallBackProperties( PGoUpDiagonal );
1043
setProperty( PGoUpDiagonal );
1044
clearNoFallBackProperties( PGoUpDiagonal );
1047
m_pStyle = m_pStyle->setGoUpDiagonalPen( _p );
1051
void KSpreadFormat::setGoUpDiagonalStyle( Qt::PenStyle s )
1053
QPen p( m_pStyle->goUpDiagonalPen() );
1055
setGoUpDiagonalPen( p );
1058
void KSpreadFormat::setGoUpDiagonalColor( const QColor& c )
1060
QPen p( m_pStyle->goUpDiagonalPen() );
1062
setGoUpDiagonalPen( p );
1065
void KSpreadFormat::setGoUpDiagonalWidth( int _w )
1067
QPen p( m_pStyle->goUpDiagonalPen() );
1069
setGoUpDiagonalPen( p );
1072
void KSpreadFormat::setBackGroundBrush( const QBrush & _p)
1074
if ( _p.style() == Qt::NoBrush )
1076
clearProperty( PBackgroundBrush );
1077
setNoFallBackProperties( PBackgroundBrush );
1081
setProperty( PBackgroundBrush );
1082
clearNoFallBackProperties( PBackgroundBrush );
1085
m_pStyle = m_pStyle->setBackGroundBrush( _p );
1089
void KSpreadFormat::setBackGroundBrushStyle( Qt::BrushStyle s )
1091
QBrush b( m_pStyle->backGroundBrush() );
1093
setBackGroundBrush( b );
1096
void KSpreadFormat::setBackGroundBrushColor( const QColor & c )
1098
QBrush b( m_pStyle->backGroundBrush() );
1100
setBackGroundBrush( b );
1103
void KSpreadFormat::setTextFont( const QFont & _f )
1105
if( _f == KoGlobal::defaultFont() )
1107
clearProperty( PFont );
1108
setNoFallBackProperties( PFont );
1112
setProperty( PFont );
1113
clearNoFallBackProperties( PFont );
1117
m_pStyle = m_pStyle->setFont( _f );
1121
void KSpreadFormat::setTextFontSize( int _s )
1123
QFont f( m_pStyle->font() );
1124
f.setPointSize( _s );
1128
void KSpreadFormat::setTextFontFamily( const QString & _f )
1130
QFont f( m_pStyle->font() );
1135
void KSpreadFormat::setTextFontBold( bool _b )
1137
QFont f( m_pStyle->font() );
1142
void KSpreadFormat::setTextFontItalic( bool _i )
1144
QFont f( m_pStyle->font() );
1149
void KSpreadFormat::setTextFontUnderline( bool _i )
1151
QFont f( m_pStyle->font() );
1152
f.setUnderline( _i );
1156
void KSpreadFormat::setTextFontStrike( bool _i )
1158
QFont f( m_pStyle->font() );
1159
f.setStrikeOut( _i );
1163
void KSpreadFormat::setTextPen( const QPen & _p )
1165
// An invalid color means "the default text color, from the color scheme"
1166
// It doesn't mean "no setting here, look at fallback"
1167
// Maybe we should look at the fallback color, in fact.
1168
/*if(!_p.color().isValid())
1170
clearProperty( PTextPen );
1171
setNoFallBackProperties( PTextPen );
1175
setProperty( PTextPen );
1176
clearNoFallBackProperties( PTextPen );
1179
//setProperty( PTextPen );
1180
m_pStyle = m_pStyle->setPen( _p );
1181
//kdDebug(36001) << "setTextPen: this=" << this << " pen=" << m_textPen.color().name() << " valid:" << m_textPen.color().isValid() << endl;
1185
void KSpreadFormat::setTextColor( const QColor & _c )
1187
QPen p( m_pStyle->pen() );
1192
void KSpreadFormat::setBgColor( const QColor & _c )
1194
if ( !_c.isValid() )
1196
clearProperty( PBackgroundColor );
1197
setNoFallBackProperties( PBackgroundColor );
1201
setProperty( PBackgroundColor );
1202
clearNoFallBackProperties( PBackgroundColor );
1205
m_pStyle = m_pStyle->setBgColor( _c );
1209
void KSpreadFormat::setFloatFormat( FloatFormat _f )
1211
setProperty( PFloatFormat );
1213
m_pStyle = m_pStyle->setFloatFormat( _f );
1217
void KSpreadFormat::setFloatColor( FloatColor _c )
1219
setProperty( PFloatColor );
1221
m_pStyle = m_pStyle->setFloatColor( _c );
1225
void KSpreadFormat::setMultiRow( bool _b )
1229
m_pStyle = m_pStyle->clearProperty( KSpreadStyle::PMultiRow );
1230
clearProperty( PMultiRow );
1231
setNoFallBackProperties( PMultiRow );
1235
m_pStyle = m_pStyle->setProperty( KSpreadStyle::PMultiRow );
1236
setProperty( PMultiRow );
1237
clearNoFallBackProperties( PMultiRow );
1242
void KSpreadFormat::setVerticalText( bool _b )
1246
m_pStyle = m_pStyle->clearProperty( KSpreadStyle::PVerticalText );
1247
setNoFallBackProperties( PVerticalText);
1248
clearFlag( Flag_VerticalText );
1252
m_pStyle = m_pStyle->setProperty( KSpreadStyle::PVerticalText );
1253
clearNoFallBackProperties( PVerticalText);
1254
setFlag( Flag_VerticalText );
1259
void KSpreadFormat::setFormatType( FormatType _format )
1261
if ( _format == KSpreadFormat::Number )
1263
clearProperty( PFormatType );
1264
setNoFallBackProperties( PFormatType);
1268
setProperty( PFormatType );
1269
clearNoFallBackProperties( PFormatType);
1272
m_pStyle = m_pStyle->setFormatType( _format );
1276
void KSpreadFormat::setAngle( int _angle )
1280
clearProperty( PAngle );
1281
setNoFallBackProperties( PAngle);
1285
setProperty( PAngle );
1286
clearNoFallBackProperties( PAngle);
1289
m_pStyle = m_pStyle->setRotateAngle( _angle );
1293
void KSpreadFormat::setIndent( double _indent )
1295
if ( _indent == 0.0 )
1297
clearProperty( PIndent );
1298
setNoFallBackProperties( PIndent );
1302
setProperty( PIndent );
1303
clearNoFallBackProperties( PIndent );
1306
m_pStyle = m_pStyle->setIndent( _indent );
1310
void KSpreadFormat::setComment( const QString & _comment )
1312
if ( _comment.isEmpty() )
1314
clearProperty( PComment );
1315
setNoFallBackProperties( PComment );
1319
setProperty( PComment );
1320
clearNoFallBackProperties( PComment );
1323
// not part of the style
1324
delete m_strComment;
1325
if ( !_comment.isEmpty() )
1326
m_strComment = new QString( _comment );
1332
void KSpreadFormat::setNotProtected( bool _b)
1336
m_pStyle = m_pStyle->clearProperty( KSpreadStyle::PNotProtected );
1337
setNoFallBackProperties( PNotProtected );
1338
clearFlag( Flag_NotProtected );
1342
m_pStyle = m_pStyle->setProperty( KSpreadStyle::PNotProtected );
1343
clearNoFallBackProperties( PNotProtected );
1344
setFlag( Flag_NotProtected );
1349
void KSpreadFormat::setDontPrintText( bool _b )
1353
m_pStyle = m_pStyle->clearProperty( KSpreadStyle::PDontPrintText );
1354
setNoFallBackProperties(PDontPrintText);
1355
clearFlag( Flag_DontPrintText );
1359
m_pStyle = m_pStyle->setProperty( KSpreadStyle::PDontPrintText );
1360
clearNoFallBackProperties( PDontPrintText);
1361
setFlag( Flag_DontPrintText );
1366
void KSpreadFormat::setHideAll( bool _b )
1370
m_pStyle = m_pStyle->clearProperty( KSpreadStyle::PHideAll );
1371
setNoFallBackProperties(PHideAll);
1372
clearFlag( Flag_HideAll );
1376
m_pStyle = m_pStyle->setProperty( KSpreadStyle::PHideAll );
1377
clearNoFallBackProperties( PHideAll);
1378
setFlag( Flag_HideAll );
1383
void KSpreadFormat::setHideFormula( bool _b )
1387
m_pStyle = m_pStyle->clearProperty( KSpreadStyle::PHideFormula );
1388
setNoFallBackProperties( PHideFormula );
1389
clearFlag( Flag_HideFormula );
1393
m_pStyle = m_pStyle->setProperty( KSpreadStyle::PHideFormula );
1394
clearNoFallBackProperties( PHideFormula );
1395
setFlag( Flag_HideFormula );
1400
void KSpreadFormat::setCurrency( Currency const & c )
1402
m_pStyle = m_pStyle->setCurrency( c );
1405
void KSpreadFormat::setCurrency( int type, QString const & symbol )
1409
c.symbol = symbol.simplifyWhiteSpace();
1412
if ( c.symbol.length() < 1 )
1415
c.symbol = locale()->currencySymbol();
1418
m_pStyle = m_pStyle->setCurrency( c );
1427
QString const & KSpreadFormat::getFormatString( int col, int row ) const
1429
if ( !hasProperty( PCustomFormat, false ) && !hasNoFallBackProperties( PCustomFormat ))
1431
const KSpreadFormat * l = fallbackFormat( col, row );
1433
return l->getFormatString( col, row );
1435
return m_pStyle->strFormat();
1438
QString KSpreadFormat::prefix( int col, int row ) const
1440
if ( !hasProperty( PPrefix, false ) && !hasNoFallBackProperties(PPrefix ))
1442
const KSpreadFormat * l = fallbackFormat( col, row );
1444
return l->prefix( col, row );
1446
return m_pStyle->prefix();
1449
QString KSpreadFormat::postfix( int col, int row ) const
1451
if ( !hasProperty( PPostfix, false ) && !hasNoFallBackProperties(PPostfix ))
1453
const KSpreadFormat * l = fallbackFormat( col, row );
1455
return l->postfix( col, row );
1457
return m_pStyle->postfix();
1460
const QPen& KSpreadFormat::fallDiagonalPen( int col, int row ) const
1462
if ( !hasProperty( PFallDiagonal, false ) && !hasNoFallBackProperties(PFallDiagonal ))
1464
const KSpreadFormat* l = fallbackFormat( col, row );
1466
return l->fallDiagonalPen( col, row );
1468
return m_pStyle->fallDiagonalPen();
1471
int KSpreadFormat::fallDiagonalWidth( int col, int row ) const
1473
return fallDiagonalPen( col, row ).width();
1476
Qt::PenStyle KSpreadFormat::fallDiagonalStyle( int col, int row ) const
1478
return fallDiagonalPen( col, row ).style();
1481
const QColor & KSpreadFormat::fallDiagonalColor( int col, int row ) const
1483
return fallDiagonalPen( col, row ).color();
1486
const QPen & KSpreadFormat::goUpDiagonalPen( int col, int row ) const
1488
if ( !hasProperty( PGoUpDiagonal, false ) && !hasNoFallBackProperties( PGoUpDiagonal ) )
1490
const KSpreadFormat* l = fallbackFormat( col, row );
1492
return l->goUpDiagonalPen( col, row );
1494
return m_pStyle->goUpDiagonalPen();
1497
int KSpreadFormat::goUpDiagonalWidth( int col, int row ) const
1499
return goUpDiagonalPen( col, row ).width();
1502
Qt::PenStyle KSpreadFormat::goUpDiagonalStyle( int col, int row ) const
1504
return goUpDiagonalPen( col, row ).style();
1507
const QColor& KSpreadFormat::goUpDiagonalColor( int col, int row ) const
1509
return goUpDiagonalPen( col, row ).color();
1512
uint KSpreadFormat::bottomBorderValue( int col, int row ) const
1514
if ( !hasProperty( PBottomBorder, false ) && !hasNoFallBackProperties( PBottomBorder ) )
1516
const KSpreadFormat * l = fallbackFormat( col, row );
1518
return l->bottomBorderValue( col, row );
1523
return m_pStyle->bottomPenValue();
1526
uint KSpreadFormat::rightBorderValue( int col, int row ) const
1528
if ( !hasProperty( PRightBorder, false ) && !hasNoFallBackProperties( PRightBorder ) )
1530
const KSpreadFormat * l = fallbackFormat( col, row );
1532
return l->rightBorderValue( col, row );
1537
return m_pStyle->rightPenValue();
1540
uint KSpreadFormat::leftBorderValue( int col, int row ) const
1542
if ( !hasProperty( PLeftBorder, false ) && !hasNoFallBackProperties( PLeftBorder ) )
1544
const KSpreadFormat * l = fallbackFormat( col, row );
1546
return l->leftBorderValue( col, row );
1551
return m_pStyle->leftPenValue();
1554
uint KSpreadFormat::topBorderValue( int col, int row ) const
1556
if ( !hasProperty( PTopBorder, false ) && !hasNoFallBackProperties( PTopBorder ) )
1558
const KSpreadFormat * l = fallbackFormat( col, row );
1560
return l->topBorderValue( col, row );
1565
return m_pStyle->topPenValue();
1568
const QPen& KSpreadFormat::leftBorderPen( int col, int row ) const
1570
if ( !hasProperty( PLeftBorder, false ) && !hasNoFallBackProperties( PLeftBorder ) )
1572
const KSpreadFormat * l = fallbackFormat( col, row );
1574
return l->leftBorderPen( col, row );
1575
return table()->emptyPen();
1578
return m_pStyle->leftBorderPen();
1581
Qt::PenStyle KSpreadFormat::leftBorderStyle( int col, int row ) const
1583
return leftBorderPen( col, row ).style();
1586
const QColor& KSpreadFormat::leftBorderColor( int col, int row ) const
1588
return leftBorderPen( col, row ).color();
1591
int KSpreadFormat::leftBorderWidth( int col, int row ) const
1593
return leftBorderPen( col, row ).width();
1596
const QPen& KSpreadFormat::topBorderPen( int col, int row ) const
1598
if ( !hasProperty( PTopBorder, false ) && !hasNoFallBackProperties( PTopBorder ) )
1600
const KSpreadFormat* l = fallbackFormat( col, row );
1602
return l->topBorderPen( col, row );
1603
return table()->emptyPen();
1606
return m_pStyle->topBorderPen();
1609
const QColor& KSpreadFormat::topBorderColor( int col, int row ) const
1611
return topBorderPen( col, row ).color();
1614
Qt::PenStyle KSpreadFormat::topBorderStyle( int col, int row ) const
1616
return topBorderPen( col, row ).style();
1619
int KSpreadFormat::topBorderWidth( int col, int row ) const
1621
return topBorderPen( col, row ).width();
1624
const QPen& KSpreadFormat::rightBorderPen( int col, int row ) const
1626
if ( !hasProperty( PRightBorder, false ) && !hasNoFallBackProperties( PRightBorder ) )
1628
const KSpreadFormat * l = fallbackFormat( col, row );
1630
return l->rightBorderPen( col, row );
1631
return table()->emptyPen();
1634
return m_pStyle->rightBorderPen();
1637
int KSpreadFormat::rightBorderWidth( int col, int row ) const
1639
return rightBorderPen( col, row ).width();
1642
Qt::PenStyle KSpreadFormat::rightBorderStyle( int col, int row ) const
1644
return rightBorderPen( col, row ).style();
1647
const QColor& KSpreadFormat::rightBorderColor( int col, int row ) const
1649
return rightBorderPen( col, row ).color();
1652
const QPen& KSpreadFormat::bottomBorderPen( int col, int row ) const
1654
if ( !hasProperty( PBottomBorder, false )&& !hasNoFallBackProperties( PBottomBorder ) )
1656
const KSpreadFormat * l = fallbackFormat( col, row );
1658
return l->bottomBorderPen( col, row );
1659
return table()->emptyPen();
1662
return m_pStyle->bottomBorderPen();
1665
int KSpreadFormat::bottomBorderWidth( int col, int row ) const
1667
return bottomBorderPen( col, row ).width();
1670
Qt::PenStyle KSpreadFormat::bottomBorderStyle( int col, int row ) const
1672
return bottomBorderPen( col, row ).style();
1675
const QColor& KSpreadFormat::bottomBorderColor( int col, int row ) const
1677
return bottomBorderPen( col, row ).color();
1680
const QBrush& KSpreadFormat::backGroundBrush( int col, int row ) const
1682
if ( !hasProperty( PBackgroundBrush, false ) && !hasNoFallBackProperties(PBackgroundBrush ))
1684
const KSpreadFormat* l = fallbackFormat( col, row );
1686
return l->backGroundBrush( col, row );
1688
return m_pStyle->backGroundBrush();
1691
Qt::BrushStyle KSpreadFormat::backGroundBrushStyle( int col, int row ) const
1693
return backGroundBrush( col, row ).style();
1696
const QColor& KSpreadFormat::backGroundBrushColor( int col, int row ) const
1698
return backGroundBrush( col, row ).color();
1701
int KSpreadFormat::precision( int col, int row ) const
1703
if ( !hasProperty( PPrecision, false )&& !hasNoFallBackProperties( PPrecision ) )
1705
const KSpreadFormat * l = fallbackFormat( col, row );
1707
return l->precision( col, row );
1709
return m_pStyle->precision();
1712
KSpreadFormat::FloatFormat KSpreadFormat::floatFormat( int col, int row ) const
1714
if ( !hasProperty( PFloatFormat, false ) && !hasNoFallBackProperties( PFloatFormat ) )
1716
const KSpreadFormat * l = fallbackFormat( col, row );
1718
return l->floatFormat( col, row );
1720
return m_pStyle->floatFormat();
1723
KSpreadFormat::FloatColor KSpreadFormat::floatColor( int col, int row ) const
1725
if ( !hasProperty( PFloatColor, false ) && !hasNoFallBackProperties( PFloatColor ) )
1727
const KSpreadFormat * l = fallbackFormat( col, row );
1729
return l->floatColor( col, row );
1731
return m_pStyle->floatColor();
1734
const QColor& KSpreadFormat::bgColor( int col, int row ) const
1736
if ( !hasProperty( PBackgroundColor, false ) && !hasNoFallBackProperties( PBackgroundColor ) )
1738
const KSpreadFormat * l = fallbackFormat( col, row );
1740
return l->bgColor( col, row );
1743
return m_pStyle->bgColor();
1746
const QPen& KSpreadFormat::textPen( int col, int row ) const
1748
if ( !hasProperty( PTextPen, false ) && !hasNoFallBackProperties( PTextPen ) )
1750
const KSpreadFormat * l = fallbackFormat( col, row );
1752
return l->textPen( col, row );
1754
return m_pStyle->pen();
1757
const QColor& KSpreadFormat::textColor( int col, int row ) const
1759
return textPen( col, row ).color();
1762
const QFont KSpreadFormat::textFont( int col, int row ) const
1764
if ( !hasProperty( PFont, false ) && !hasNoFallBackProperties( PFont ) )
1766
const KSpreadFormat * l = fallbackFormat( col, row );
1768
return l->textFont( col, row );
1771
return m_pStyle->font();
1774
int KSpreadFormat::textFontSize( int col, int row ) const
1776
if ( !hasProperty( PFont, false ) && !hasNoFallBackProperties( PFont ) )
1778
const KSpreadFormat * l = fallbackFormat( col, row );
1780
return l->textFontSize( col, row );
1783
return m_pStyle->fontSize();
1786
QString const & KSpreadFormat::textFontFamily( int col, int row ) const
1788
if ( !hasProperty( PFont, false ) && !hasNoFallBackProperties( PFont ) )
1790
const KSpreadFormat * l = fallbackFormat( col, row );
1792
return l->textFontFamily( col, row );
1795
return m_pStyle->fontFamily();
1798
bool KSpreadFormat::textFontBold( int col, int row ) const
1800
if ( !hasProperty( PFont, false ) && !hasNoFallBackProperties( PFont ) )
1802
const KSpreadFormat * l = fallbackFormat( col, row );
1804
return l->textFontBold( col, row );
1807
return ( m_pStyle->fontFlags() & KSpreadStyle::FBold );
1810
bool KSpreadFormat::textFontItalic( int col, int row ) const
1812
if ( !hasProperty( PFont, false ) && !hasNoFallBackProperties( PFont ) )
1814
const KSpreadFormat * l = fallbackFormat( col, row );
1816
return l->textFontItalic( col, row );
1819
return ( m_pStyle->fontFlags() & KSpreadStyle::FItalic );
1822
bool KSpreadFormat::textFontUnderline( int col, int row ) const
1824
if ( !hasProperty( PFont, false ) && !hasNoFallBackProperties( PFont ) )
1826
const KSpreadFormat * l = fallbackFormat( col, row );
1828
return l->textFontUnderline( col, row );
1831
return ( m_pStyle->fontFlags() & KSpreadStyle::FUnderline );
1834
bool KSpreadFormat::textFontStrike( int col, int row ) const
1836
if ( !hasProperty( PFont, false ) && !hasNoFallBackProperties( PFont ) )
1838
const KSpreadFormat * l = fallbackFormat( col, row );
1840
return l->textFontStrike( col, row );
1843
return ( m_pStyle->fontFlags() & KSpreadStyle::FStrike );
1846
KSpreadFormat::Align KSpreadFormat::align( int col, int row ) const
1848
if ( !hasProperty( PAlign, false ) && !hasNoFallBackProperties( PAlign ) )
1850
const KSpreadFormat * l = fallbackFormat( col, row );
1852
return l->align( col, row );
1855
return m_pStyle->alignX();
1858
KSpreadFormat::AlignY KSpreadFormat::alignY( int col, int row ) const
1860
if ( !hasProperty( PAlignY, false )&& !hasNoFallBackProperties( PAlignY ) )
1862
const KSpreadFormat * l = fallbackFormat( col, row );
1864
return l->alignY( col, row );
1867
return m_pStyle->alignY();
1870
double KSpreadFormat::factor( int col, int row ) const
1872
if ( !hasProperty( PFactor, false ) && !hasNoFallBackProperties( PFactor ) )
1874
const KSpreadFormat * l = fallbackFormat( col, row );
1876
return l->factor( col, row );
1879
return m_pStyle->factor();
1882
bool KSpreadFormat::multiRow( int col, int row ) const
1884
if ( !hasProperty( PMultiRow, false ) && !hasNoFallBackProperties( PMultiRow ) )
1886
const KSpreadFormat * l = fallbackFormat( col, row );
1888
return l->multiRow( col, row );
1891
return m_pStyle->hasProperty( KSpreadStyle::PMultiRow );
1894
bool KSpreadFormat::verticalText( int col, int row ) const
1896
if ( !hasProperty( PVerticalText, false )&& !hasNoFallBackProperties( PVerticalText ) )
1898
const KSpreadFormat * l = fallbackFormat( col, row );
1900
return l->verticalText( col, row );
1903
return m_pStyle->hasProperty( KSpreadStyle::PVerticalText );
1906
KSpreadFormat::FormatType KSpreadFormat::getFormatType( int col, int row ) const
1908
if ( !hasProperty( PFormatType, false ) && !hasNoFallBackProperties( PFormatType ) )
1910
const KSpreadFormat* l = fallbackFormat( col, row );
1912
return l->getFormatType( col, row );
1915
return m_pStyle->formatType();
1918
int KSpreadFormat::getAngle( int col, int row ) const
1920
if ( !hasProperty( PAngle, false ) && !hasNoFallBackProperties( PAngle ) )
1922
const KSpreadFormat* l = fallbackFormat( col, row );
1924
return l->getAngle( col, row );
1927
return m_pStyle->rotateAngle();
1930
QString KSpreadFormat::comment( int col, int row ) const
1932
if ( !hasProperty( PComment, false ) && !hasNoFallBackProperties( PComment ))
1934
const KSpreadFormat* l = fallbackFormat( col, row );
1936
return l->comment( col, row );
1939
if ( !m_strComment )
1940
return QString::null;
1942
// not part of the style
1943
return *m_strComment;
1946
QString * KSpreadFormat::commentP( int col, int row ) const
1948
if ( !hasProperty( PComment, false ) && !hasNoFallBackProperties( PComment ))
1950
const KSpreadFormat* l = fallbackFormat( col, row );
1952
return l->commentP( col, row );
1955
return m_strComment;
1958
double KSpreadFormat::getIndent( int col, int row ) const
1960
if ( !hasProperty( PIndent, false ) && !hasNoFallBackProperties( PIndent ) )
1962
const KSpreadFormat* l = fallbackFormat( col, row );
1964
return l->getIndent( col, row );
1967
return m_pStyle->indent();
1970
bool KSpreadFormat::getDontprintText( int col, int row ) const
1972
if ( !hasProperty( PDontPrintText, false )&& !hasNoFallBackProperties( PDontPrintText ) )
1974
const KSpreadFormat* l = fallbackFormat( col, row );
1976
return l->getDontprintText( col, row );
1979
return m_pStyle->hasProperty( KSpreadStyle::PDontPrintText );
1982
bool KSpreadFormat::isProtected( int col, int row ) const
1984
return ( m_pTable->isProtected() && !notProtected( col, row ) );
1988
bool KSpreadFormat::notProtected( int col, int row) const
1990
if ( !hasProperty( PNotProtected, false )&& !hasNoFallBackProperties( PNotProtected ) )
1992
const KSpreadFormat * l = fallbackFormat( col, row );
1994
return l->notProtected( col, row );
1997
return m_pStyle->hasProperty( KSpreadStyle::PNotProtected );
2000
bool KSpreadFormat::isHideAll( int col, int row) const
2002
if ( !hasProperty( PHideAll, false )&& !hasNoFallBackProperties( PHideAll ) )
2004
const KSpreadFormat * l = fallbackFormat( col, row );
2006
return l->isHideAll( col, row );
2009
return m_pStyle->hasProperty( KSpreadStyle::PHideAll );
2012
bool KSpreadFormat::isHideFormula( int col, int row) const
2014
if ( !hasProperty( PHideFormula, false )&& !hasNoFallBackProperties( PHideFormula ) )
2016
const KSpreadFormat * l = fallbackFormat( col, row );
2018
return l->isHideFormula( col, row );
2021
return m_pStyle->hasProperty( KSpreadStyle::PHideFormula );
2024
bool KSpreadFormat::currencyInfo( Currency & currency) const
2027
if ( m_pStyle->formatType() != Money )
2030
currency.symbol = m_pStyle->currency().symbol;
2031
currency.type = m_pStyle->currency().type;
2036
QString KSpreadFormat::getCurrencySymbol() const
2039
return m_pStyle->currency().symbol;
2042
QFont KSpreadFormat::font() const
2044
return m_pStyle->font();
2054
const QPen & KSpreadFormat::leftBorderPen() const
2056
return m_pStyle->leftBorderPen();
2059
const QPen & KSpreadFormat::topBorderPen() const
2061
return m_pStyle->topBorderPen();
2064
const QPen & KSpreadFormat::rightBorderPen() const
2066
return m_pStyle->rightBorderPen();
2069
const QPen & KSpreadFormat::bottomBorderPen() const
2071
return m_pStyle->bottomBorderPen();
2074
const QPen & KSpreadFormat::fallDiagonalPen() const
2076
return m_pStyle->fallDiagonalPen();
2079
const QPen & KSpreadFormat::goUpDiagonalPen() const
2081
return m_pStyle->goUpDiagonalPen();
2084
const QBrush & KSpreadFormat::backGroundBrush() const
2086
return m_pStyle->backGroundBrush();
2089
const QFont KSpreadFormat::textFont() const
2091
return m_pStyle->font();
2094
const QPen & KSpreadFormat::textPen() const
2096
return m_pStyle->pen();
2105
void KSpreadFormat::formatChanged()
2109
KSpreadFormat* KSpreadFormat::fallbackFormat( int, int )
2114
const KSpreadFormat* KSpreadFormat::fallbackFormat( int, int ) const
2119
bool KSpreadFormat::isDefault() const
2124
KLocale * KSpreadFormat::locale()const
2126
return m_pTable->doc()->locale();
2129
/*****************************************************************************
2133
*****************************************************************************/
2135
#define UPDATE_BEGIN bool b_update_begin = m_bDisplayDirtyFlag; m_bDisplayDirtyFlag = true;
2136
#define UPDATE_END if ( !b_update_begin && m_bDisplayDirtyFlag ) m_pTable->emit_updateRow( this, m_iRow );
2138
RowFormat::RowFormat( KSpreadSheet * _table, int _row )
2139
: KSpreadFormat( _table, _table->doc()->styleManager()->defaultStyle() )
2144
m_bDisplayDirtyFlag = false;
2145
m_fHeight = g_rowHeight;
2152
RowFormat::~RowFormat()
2155
m_next->setPrevious( m_prev );
2157
m_prev->setNext( m_next );
2161
DCOPObject * RowFormat::dcopObject()
2164
m_dcop = new KSpreadRowIface( this );
2169
void RowFormat::setMMHeight( double _h )
2171
setDblHeight( MM_TO_POINT ( _h ) );
2174
void RowFormat::setHeight( int _h, const KSpreadCanvas * _canvas )
2176
setDblHeight( (double) _h, _canvas );
2179
void RowFormat::setDblHeight( double _h, const KSpreadCanvas * _canvas )
2181
KSpreadSheet *_table = _canvas ? _canvas->activeTable() : m_pTable;
2183
// avoid unnecessary updates
2184
if ( kAbs( _h - dblHeight( _canvas ) ) < DBL_EPSILON )
2189
// Lower maximum size by old height
2190
_table->adjustSizeMaxY ( - dblHeight() );
2193
m_fHeight = ( _h / _canvas->zoom() );
2197
// Rise maximum size by new height
2198
_table->adjustSizeMaxY ( dblHeight() );
2199
_table->print()->updatePrintRepeatRowsHeight();
2200
_table->print()->updateNewPageListY ( row() );
2205
int RowFormat::height( const KSpreadCanvas *_canvas ) const
2207
return (int) dblHeight( _canvas );
2210
double RowFormat::dblHeight( const KSpreadCanvas *_canvas ) const
2216
return _canvas->zoom() * m_fHeight;
2221
double RowFormat::mmHeight() const
2223
return POINT_TO_MM ( dblHeight() );
2226
QDomElement RowFormat::save( QDomDocument& doc, int yshift, bool copy ) const
2228
QDomElement row = doc.createElement( "row" );
2229
row.setAttribute( "height", m_fHeight );
2230
row.setAttribute( "row", m_iRow - yshift );
2232
row.setAttribute( "hide", (int) m_bHide );
2234
QDomElement format( saveFormat( doc, false, copy ) );
2235
row.appendChild( format );
2239
bool RowFormat::load( const QDomElement & row, int yshift, PasteMode sp, bool paste )
2243
m_iRow = row.attribute( "row" ).toInt( &ok ) + yshift;
2247
if ( row.hasAttribute( "height" ) )
2249
if ( m_pTable->doc()->syntaxVersion() < 1 ) //compatibility with old format - was in millimeter
2250
m_fHeight = qRound( MM_TO_POINT( row.attribute( "height" ).toDouble( &ok ) ) );
2252
m_fHeight = row.attribute( "height" ).toDouble( &ok );
2254
if ( !ok ) return false;
2258
if ( m_fHeight < 0 )
2260
kdDebug(36001) << "Value height=" << m_fHeight << " out of range" << endl;
2263
if ( m_iRow < 1 || m_iRow > KS_rowMax )
2265
kdDebug(36001) << "Value row=" << m_iRow << " out of range" << endl;
2269
if ( row.hasAttribute( "hide" ) )
2271
setHide( (int) row.attribute( "hide" ).toInt( &ok ) );
2276
QDomElement f( row.namedItem( "format" ).toElement() );
2278
if ( !f.isNull() && ( sp == Normal || sp == Format || sp == NoBorder ) )
2280
if ( !loadFormat( f, sp, paste ) )
2288
const QPen & RowFormat::topBorderPen( int _col, int _row ) const
2290
// First look at the row above us
2291
if ( !hasProperty( PTopBorder, false ) )
2293
const RowFormat * rl = table()->rowFormat( _row - 1 );
2294
if ( rl->hasProperty( PBottomBorder ) )
2295
return rl->bottomBorderPen( _col, _row - 1 );
2298
return KSpreadFormat::topBorderPen( _col, _row );
2301
void RowFormat::setTopBorderPen( const QPen & p )
2303
RowFormat * cl = table()->nonDefaultRowFormat( row() - 1, false );
2305
cl->clearProperty( PBottomBorder );
2307
KSpreadFormat::setTopBorderPen( p );
2310
const QPen & RowFormat::bottomBorderPen( int _col, int _row ) const
2312
// First look at the row below of us
2313
if ( !hasProperty( PBottomBorder, false ) && ( _row < KS_rowMax ) )
2315
const RowFormat * rl = table()->rowFormat( _row + 1 );
2316
if ( rl->hasProperty( PTopBorder ) )
2317
return rl->topBorderPen( _col, _row + 1 );
2320
return KSpreadFormat::bottomBorderPen( _col, _row );
2323
void RowFormat::setBottomBorderPen( const QPen & p )
2325
if ( row() < KS_rowMax )
2327
RowFormat * cl = table()->nonDefaultRowFormat( row() + 1, FALSE );
2329
cl->clearProperty( PTopBorder );
2332
KSpreadFormat::setBottomBorderPen( p );
2335
void RowFormat::setHide( bool _hide )
2337
if ( _hide != m_bHide ) // only if we change the status
2341
// Lower maximum size by height of row
2342
m_pTable->adjustSizeMaxY ( - dblHeight() );
2343
m_bHide = _hide; //hide must be set after we requested the height
2347
// Rise maximum size by height of row
2348
m_bHide = _hide; //unhide must be set before we request the height
2349
m_pTable->adjustSizeMaxY ( dblHeight() );
2350
m_pTable->emit_updateRow( this, m_iRow );
2355
KSpreadFormat * RowFormat::fallbackFormat( int col, int )
2357
return table()->columnFormat( col );
2360
const KSpreadFormat* RowFormat::fallbackFormat( int col, int ) const
2362
return table()->columnFormat( col );
2365
bool RowFormat::isDefault() const
2370
/*****************************************************************************
2374
*****************************************************************************/
2379
#define UPDATE_BEGIN bool b_update_begin = m_bDisplayDirtyFlag; m_bDisplayDirtyFlag = true;
2380
#define UPDATE_END if ( !b_update_begin && m_bDisplayDirtyFlag ) m_pTable->emit_updateColumn( this, m_iColumn );
2382
ColumnFormat::ColumnFormat( KSpreadSheet * _table, int _column )
2383
: KSpreadFormat( _table, _table->doc()->styleManager()->defaultStyle() )
2385
m_bDisplayDirtyFlag = false;
2386
m_fWidth = g_colWidth;
2387
m_iColumn = _column;
2395
ColumnFormat::~ColumnFormat()
2398
m_next->setPrevious( m_prev );
2400
m_prev->setNext( m_next );
2404
DCOPObject * ColumnFormat::dcopObject()
2407
m_dcop = new KSpreadColumnIface( this );
2411
void ColumnFormat::setMMWidth( double _w )
2413
setDblWidth( MM_TO_POINT ( _w ) );
2416
void ColumnFormat::setWidth( int _w, const KSpreadCanvas * _canvas )
2418
setDblWidth( (double)_w, _canvas );
2421
void ColumnFormat::setDblWidth( double _w, const KSpreadCanvas * _canvas )
2423
KSpreadSheet *_table = _canvas ? _canvas->activeTable() : m_pTable;
2425
// avoid unnecessary updates
2426
if ( kAbs( _w - dblWidth( _canvas ) ) < DBL_EPSILON )
2431
// Lower maximum size by old width
2432
_table->adjustSizeMaxX ( - dblWidth() );
2435
m_fWidth = ( _w / _canvas->zoom() );
2439
// Rise maximum size by new width
2440
_table->adjustSizeMaxX ( dblWidth() );
2441
_table->print()->updatePrintRepeatColumnsWidth();
2442
_table->print()->updateNewPageListX ( column() );
2447
int ColumnFormat::width( const KSpreadCanvas * _canvas ) const
2449
return (int) dblWidth( _canvas );
2452
double ColumnFormat::dblWidth( const KSpreadCanvas * _canvas ) const
2458
return _canvas->zoom() * m_fWidth;
2463
double ColumnFormat::mmWidth() const
2465
return POINT_TO_MM( dblWidth() );
2469
QDomElement ColumnFormat::save( QDomDocument& doc, int xshift, bool copy ) const
2471
QDomElement col( doc.createElement( "column" ) );
2472
col.setAttribute( "width", m_fWidth );
2473
col.setAttribute( "column", m_iColumn - xshift );
2476
col.setAttribute( "hide", (int) m_bHide );
2478
QDomElement format( saveFormat( doc, false, copy ) );
2479
col.appendChild( format );
2484
bool ColumnFormat::load( const QDomElement & col, int xshift, PasteMode sp, bool paste )
2487
if ( col.hasAttribute( "width" ) )
2489
if ( m_pTable->doc()->syntaxVersion() < 1 ) //combatibility to old format - was in millimeter
2490
m_fWidth = qRound( MM_TO_POINT ( col.attribute( "width" ).toDouble( &ok ) ) );
2492
m_fWidth = col.attribute( "width" ).toDouble( &ok );
2498
m_iColumn = col.attribute( "column" ).toInt( &ok ) + xshift;
2506
kdDebug(36001) << "Value width=" << m_fWidth << " out of range" << endl;
2509
if ( m_iColumn < 1 || m_iColumn > KS_colMax )
2511
kdDebug(36001) << "Value col=" << m_iColumn << " out of range" << endl;
2514
if ( col.hasAttribute( "hide" ) )
2516
setHide( (int) col.attribute( "hide" ).toInt( &ok ) );
2521
QDomElement f( col.namedItem( "format" ).toElement() );
2523
if ( !f.isNull() && ( sp == Normal || sp == Format || sp == NoBorder ))
2525
if ( !loadFormat( f, sp, paste ) )
2533
const QPen & ColumnFormat::leftBorderPen( int _col, int _row ) const
2535
// First look ar the right column at the right
2536
if ( !hasProperty( PLeftBorder, false ) )
2538
const ColumnFormat * cl = table()->columnFormat( _col - 1 );
2539
if ( cl->hasProperty( PRightBorder ) )
2540
return cl->rightBorderPen( _col - 1, _row );
2543
return KSpreadFormat::leftBorderPen( _col, _row );
2546
void ColumnFormat::setLeftBorderPen( const QPen & p )
2548
ColumnFormat * cl = table()->nonDefaultColumnFormat( column() - 1, FALSE );
2550
cl->clearProperty( PRightBorder );
2552
KSpreadFormat::setLeftBorderPen( p );
2555
const QPen & ColumnFormat::rightBorderPen( int _col, int _row ) const
2557
// First look ar the right column at the right
2558
if ( !hasProperty( PRightBorder, false ) && ( _col < KS_colMax ) )
2560
const ColumnFormat * cl = table()->columnFormat( _col + 1 );
2561
if ( cl->hasProperty( PLeftBorder ) )
2562
return cl->leftBorderPen( _col + 1, _row );
2565
return KSpreadFormat::rightBorderPen( _col, _row );
2568
void ColumnFormat::setRightBorderPen( const QPen & p )
2570
if ( column() < KS_colMax )
2572
ColumnFormat * cl = table()->nonDefaultColumnFormat( column() + 1, false );
2574
cl->clearProperty( PLeftBorder );
2577
KSpreadFormat::setRightBorderPen( p );
2580
KSpreadFormat * ColumnFormat::fallbackFormat( int, int )
2582
return table()->defaultFormat();
2585
void ColumnFormat::setHide( bool _hide )
2587
if ( _hide != m_bHide ) // only if we change the status
2591
// Lower maximum size by width of column
2592
m_pTable->adjustSizeMaxX ( - dblWidth() );
2593
m_bHide = _hide; //hide must be set after we requested the width
2597
// Rise maximum size by width of column
2598
m_bHide = _hide; //unhide must be set before we request the width
2599
m_pTable->adjustSizeMaxX ( dblWidth() );
2600
m_pTable->emit_updateColumn( this, m_iColumn );
2605
const KSpreadFormat * ColumnFormat::fallbackFormat( int, int ) const
2607
return table()->defaultFormat();
2610
bool ColumnFormat::isDefault() const
2615
namespace KSpreadCurrency_LNS
2620
char const * country;
2622
char const * display;
2625
// codes and names as defined in ISO 3166-1
2626
// first column: saved code
2627
// second column: contry name (localized)
2628
// third column: currency name (localized)
2629
// fourth column: displayed currency code (localized but maybe only in
2630
// the country language it belongs to)
2632
{ "", "", "", ""}, // auto
2633
{ "", "", "", ""}, // extension (codes imported)
2634
{ "$", "", "Dollar", "$" }, // unspecified
2635
{ "$", I18N_NOOP("Australia"), I18N_NOOP("Dollar"), "$" },
2636
{ "$", I18N_NOOP("Canada"), I18N_NOOP("Dollar"), "$" },
2637
{ "$", I18N_NOOP("Caribbea"), I18N_NOOP("Dollar"), "$" },
2638
{ "$", I18N_NOOP("New Zealand"), I18N_NOOP("Dollar"), "$" },
2639
{ "$", I18N_NOOP("United States"), I18N_NOOP("Dollar"), "$" },
2641
{ "�", "", "�", "�" }, // unspecified
2642
{ "�", I18N_NOOP("Austria"), I18N_NOOP("Euro"), "�" },
2643
{ "�", I18N_NOOP("Belgium"), I18N_NOOP("Euro"), "�" },
2644
{ "�", I18N_NOOP("Finland"), I18N_NOOP("Euro"), "�" },
2645
{ "�", I18N_NOOP("France"), I18N_NOOP("Euro"), "�" },
2646
{ "�", I18N_NOOP("Germany"), I18N_NOOP("Euro"), "�" },
2647
{ "�", I18N_NOOP("Greece"), I18N_NOOP("Euro"), "�" },
2648
{ "�", I18N_NOOP("Ireland"), I18N_NOOP("Euro"), "�" },
2649
{ "�", I18N_NOOP("Italy"), I18N_NOOP("Euro"), "�" },
2650
{ "�", I18N_NOOP("Luxembourg"), I18N_NOOP("Euro"), "�" },
2651
{ "�", I18N_NOOP("Monaco"), I18N_NOOP("Euro"), "�" },
2652
{ "�", I18N_NOOP("Netherlands"), I18N_NOOP("Euro"), "�" },
2653
{ "�", I18N_NOOP("Portugal"), I18N_NOOP("Euro"), "�" },
2654
{ "�", I18N_NOOP("Spain"), I18N_NOOP("Euro"), "�" },
2656
{ "�", I18N_NOOP("United Kingdom"), I18N_NOOP("Pound"), "�" },
2658
{ "�", I18N_NOOP("Japan"), I18N_NOOP("Yen"), "�" },
2660
{ "AFA", I18N_NOOP("Afganistan"), I18N_NOOP("Afghani"), I18N_NOOP("AFA") },
2661
{ "ALL", I18N_NOOP("Albania"), I18N_NOOP("Lek"), I18N_NOOP("Lek") },
2662
{ "DZD", I18N_NOOP("Algeria"), I18N_NOOP("Algerian Dinar"), I18N_NOOP("DZD") },
2663
{ "USD", I18N_NOOP("American Samoa"), I18N_NOOP("US Dollar"), I18N_NOOP("USD") },
2664
{ "EUR", I18N_NOOP("Andorra"), I18N_NOOP("Euro"), I18N_NOOP("EUR") },
2665
{ "ADP", I18N_NOOP("Andorra"), I18N_NOOP("Andorran Peseta"), I18N_NOOP("ADP") },
2666
{ "AOA", I18N_NOOP("Angola"), I18N_NOOP("Kwanza"), I18N_NOOP("AOA") },
2667
{ "XCD", I18N_NOOP("Anguilla"), I18N_NOOP("East Caribbean Dollar"), I18N_NOOP("XCD") },
2668
{ "XCD", I18N_NOOP("Antigua And Barbuda"), I18N_NOOP("East Carribean Dollar"), I18N_NOOP("XCD") },
2669
{ "ARS", I18N_NOOP("Argentina"), I18N_NOOP("Argentine Peso"), I18N_NOOP("ARS") },
2670
{ "AMD", I18N_NOOP("Armenia"), I18N_NOOP("Armenian Dram"), I18N_NOOP("AMD") },
2671
{ "AWG", I18N_NOOP("Aruba"), I18N_NOOP("Aruban Guilder"), I18N_NOOP("AWG") },
2672
{ "AUD", I18N_NOOP("Australia"), I18N_NOOP("Australian Dollar"), I18N_NOOP("AUD") },
2673
{ "EUR", I18N_NOOP("Austria"), I18N_NOOP("Euro"), I18N_NOOP("EUR") },
2674
{ "ATS", I18N_NOOP("Austria"), I18N_NOOP("Schilling"), I18N_NOOP("S") },
2675
{ "AZM", I18N_NOOP("Azerbaijan"), I18N_NOOP("Azerbaijanian Manat"), I18N_NOOP("AZM") },
2676
{ "BSD", I18N_NOOP("Bahamas"), I18N_NOOP("Bahamian Dollar"), I18N_NOOP("BSD") },
2677
{ "BHD", I18N_NOOP("Bahrain"), I18N_NOOP("Bahraini Dinar"), I18N_NOOP("BHD") },
2678
{ "BDT", I18N_NOOP("Bangladesh"), I18N_NOOP("Taka"), I18N_NOOP("BDT") },
2679
{ "BBD", I18N_NOOP("Barbados"), I18N_NOOP("Barbados Dollar"), I18N_NOOP("BBD") },
2680
{ "BYR", I18N_NOOP("Belarus"), I18N_NOOP("Belarussian Ruble"), I18N_NOOP("p.") },
2681
{ "EUR", I18N_NOOP("Belgium"), I18N_NOOP("Euro"), I18N_NOOP("EUR") },
2682
{ "BEF", I18N_NOOP("Belgium"), I18N_NOOP("Franc"), I18N_NOOP("BF") },
2683
{ "BZD", I18N_NOOP("Belize"), I18N_NOOP("Belize Dollar"), I18N_NOOP("BZ$") },
2684
{ "XOF", I18N_NOOP("Benin"), I18N_NOOP("CFA Franc BCEAO"), I18N_NOOP("XOF") },
2685
{ "BMD", I18N_NOOP("Bermuda"), I18N_NOOP("Bermudian Dollar"), I18N_NOOP("BMD") },
2686
{ "INR", I18N_NOOP("Bhutan"), I18N_NOOP("Indian Rupee"), I18N_NOOP("INR") },
2687
{ "BTN", I18N_NOOP("Bhutan"), I18N_NOOP("Ngultrum"), I18N_NOOP("BTN") },
2688
{ "BOB", I18N_NOOP("Bolivia"), I18N_NOOP("Boliviano"), I18N_NOOP("Bs") },
2689
{ "BOV", I18N_NOOP("Bolivia"), I18N_NOOP("Mvdol"), I18N_NOOP("BOV") },
2690
{ "BAM", I18N_NOOP("Bosnia And Herzegovina"), I18N_NOOP("Convertible Marks"), I18N_NOOP("BAM") },
2691
{ "BWP", I18N_NOOP("Botswana"), I18N_NOOP("Pula"), I18N_NOOP("BWP") },
2692
{ "NOK", I18N_NOOP("Bouvet Island"), I18N_NOOP("Norvegian Krone"), I18N_NOOP("NOK") },
2693
{ "BRL", I18N_NOOP("Brazil"), I18N_NOOP("Brazilian Real"), I18N_NOOP("R$") },
2694
{ "USD", I18N_NOOP("British Indian Ocean Territory"), I18N_NOOP("US Dollar"), I18N_NOOP("USD") },
2695
{ "BND", I18N_NOOP("Brunei Darussalam"), I18N_NOOP("Brunei Dollar"), I18N_NOOP("BND") },
2696
{ "BGL", I18N_NOOP("Bulgaria"), I18N_NOOP("Lev"), I18N_NOOP("BGL") },
2697
{ "BGN", I18N_NOOP("Bulgaria"), I18N_NOOP("Bulgarian Lev"), I18N_NOOP("BGN") },
2698
{ "XOF", I18N_NOOP("Burkina Faso"), I18N_NOOP("CFA Franc BCEAO"), I18N_NOOP("XOF") },
2699
{ "BIF", I18N_NOOP("Burundi"), I18N_NOOP("Burundi Franc"), I18N_NOOP("BIF") },
2700
{ "KHR", I18N_NOOP("Cambodia"), I18N_NOOP("Riel"), I18N_NOOP("KHR") },
2701
{ "XAF", I18N_NOOP("Cameroon"), I18N_NOOP("CFA Franc BEAC"), I18N_NOOP("XAF") },
2702
{ "CAD", I18N_NOOP("Canada"), I18N_NOOP("Canadian Dollar"), I18N_NOOP("CAD") },
2703
{ "CVE", I18N_NOOP("Cape Verde"), I18N_NOOP("Cape Verde Escudo"), I18N_NOOP("CVE") },
2704
{ "KYD", I18N_NOOP("Cayman Islands"), I18N_NOOP("Cayman Islands Dollar"), I18N_NOOP("KYD") },
2705
{ "XAF", I18N_NOOP("Central African Republic"), I18N_NOOP("CFA Franc BEAC"), I18N_NOOP("XAF") },
2706
{ "XAF", I18N_NOOP("Chad"), I18N_NOOP("CFA Franc BEAC"), I18N_NOOP("XAF") },
2707
{ "CLP", I18N_NOOP("Chile"), I18N_NOOP("Chilean Peso"), I18N_NOOP("Ch$") },
2708
{ "CLF", I18N_NOOP("Chile"), I18N_NOOP("Unidades de fomento"), I18N_NOOP("CLF") },
2709
{ "CNY", I18N_NOOP("China"), I18N_NOOP("Yuan Renminbi"), I18N_NOOP("CNY") },
2710
{ "AUD", I18N_NOOP("Christmas Island"), I18N_NOOP("Australian Dollar"), I18N_NOOP("AUD") },
2711
{ "AUD", I18N_NOOP("Cocos (Keeling) Islands"), I18N_NOOP("Australian Dollar"), I18N_NOOP("AUD") },
2712
{ "COP", I18N_NOOP("Colombia"), I18N_NOOP("Colombian Peso"), I18N_NOOP("C$") },
2713
{ "KMF", I18N_NOOP("Comoros"), I18N_NOOP("Comoro Franc"), I18N_NOOP("KMF") },
2714
{ "XAF", I18N_NOOP("Congo"), I18N_NOOP("CFA Franc BEAC"), I18N_NOOP("XAF") },
2715
{ "CDF", I18N_NOOP("Congo, The Democratic Republic Of"), I18N_NOOP("Franc Congolais"), I18N_NOOP("CDF") },
2716
{ "NZD", I18N_NOOP("Cook Islands"), I18N_NOOP("New Zealand Dollar"), I18N_NOOP("NZD") },
2717
{ "CRC", I18N_NOOP("Costa Rica"), I18N_NOOP("Costa Rican Colon"), I18N_NOOP("C") },
2718
{ "XOF", I18N_NOOP("Cote D'Ivoire"), I18N_NOOP("CFA Franc BCEAO"), I18N_NOOP("XOF") },
2719
{ "HRK", I18N_NOOP("Croatia"), I18N_NOOP("Croatian kuna"), I18N_NOOP("kn") },
2720
{ "CUP", I18N_NOOP("Cuba"), I18N_NOOP("Cuban Peso"), I18N_NOOP("CUP") },
2721
{ "CYP", I18N_NOOP("Cyprus"), I18N_NOOP("Cyprus Pound"), I18N_NOOP("CYP") },
2722
{ "CZK", I18N_NOOP("Czech Republic"), I18N_NOOP("Czech Koruna"), I18N_NOOP("Kc") },
2723
{ "DKK", I18N_NOOP("Denmark"), I18N_NOOP("Danish Krone"), I18N_NOOP("kr") },
2724
{ "DJF", I18N_NOOP("Djibouti"), I18N_NOOP("Djibouti Franc"), I18N_NOOP("DJF") },
2725
{ "XCD", I18N_NOOP("Dominica"), I18N_NOOP("East Caribbean Dollar"), I18N_NOOP("RD$") },
2726
{ "DOP", I18N_NOOP("Dominican Republic"), I18N_NOOP("Dominican Peso"), I18N_NOOP("DOP") },
2727
{ "TPE", I18N_NOOP("East Timor"), I18N_NOOP("Timor Escudo"), I18N_NOOP("TPE") },
2728
{ "USD", I18N_NOOP("East Timor"), I18N_NOOP("US Dollar"), I18N_NOOP("USD") },
2729
{ "USD", I18N_NOOP("Ecuador"), I18N_NOOP("US Dollar"), I18N_NOOP("USD") },
2730
{ "EGP", I18N_NOOP("Egypt"), I18N_NOOP("Egyptian Pound"), I18N_NOOP("EGP") },
2731
{ "SVC", I18N_NOOP("El Salvador"), I18N_NOOP("El Salvador Colon"), I18N_NOOP("C") },
2732
{ "USD", I18N_NOOP("El Salvador"), I18N_NOOP("US Dollar"), I18N_NOOP("USD") },
2733
{ "XAF", I18N_NOOP("Equatorial Guinea"), I18N_NOOP("CFA Franc BEAC"), I18N_NOOP("XAF") },
2734
{ "ERN", I18N_NOOP("Eritrea"), I18N_NOOP("Nakfa"), I18N_NOOP("ERN") },
2735
{ "EEK", I18N_NOOP("Estonia"), I18N_NOOP("Kroon"), I18N_NOOP("kr") },
2736
{ "ETB", I18N_NOOP("Ethiopia"), I18N_NOOP("Ethiopian Birr"), I18N_NOOP("ETB") },
2737
{ "FKP", I18N_NOOP("Falkland Island (Malvinas)"), I18N_NOOP("Falkland Islands Pound"), I18N_NOOP("FKP") },
2738
{ "DKK", I18N_NOOP("Faeroe Islands"), I18N_NOOP("Danish Krone"), I18N_NOOP("kr") },
2739
{ "FJD", I18N_NOOP("Fiji"), I18N_NOOP("Fiji Dollar"), I18N_NOOP("FJD") },
2740
{ "EUR", I18N_NOOP("Finland"), I18N_NOOP("Euro"), I18N_NOOP("EUR") },
2741
{ "FIM", I18N_NOOP("Finland"), I18N_NOOP("Markka"), I18N_NOOP("mk") },
2742
{ "EUR", I18N_NOOP("France"), I18N_NOOP("Euro"), I18N_NOOP("EUR") },
2743
{ "FRF", I18N_NOOP("France"), I18N_NOOP("Franc"), I18N_NOOP("F") },
2744
{ "EUR", I18N_NOOP("French Guiana"), I18N_NOOP("Euro"), I18N_NOOP("EUR") },
2745
{ "XPF", I18N_NOOP("French Polynesia"), I18N_NOOP("CFP Franc"), I18N_NOOP("XPF") },
2746
{ "EUR", I18N_NOOP("Franc Southern Territories"), I18N_NOOP("Euro"), I18N_NOOP("EUR") },
2747
{ "XAF", I18N_NOOP("Gabon"), I18N_NOOP("CFA Franc BEAC"), I18N_NOOP("XAF") },
2748
{ "GMD", I18N_NOOP("Gambia"), I18N_NOOP("Dalasi"), I18N_NOOP("GMD") },
2749
{ "GEL", I18N_NOOP("Georgia"), I18N_NOOP("Lari"), I18N_NOOP("GEL") },
2750
{ "EUR", I18N_NOOP("Germany"), I18N_NOOP("Euro"), I18N_NOOP("EUR") },
2751
{ "DEM", I18N_NOOP("Germany"), I18N_NOOP("German Mark"), I18N_NOOP("DM") },
2752
{ "GHC", I18N_NOOP("Ghana"), I18N_NOOP("Cedi"), I18N_NOOP("GHC") },
2753
{ "GIP", I18N_NOOP("Gibraltar"), I18N_NOOP("Gibraltar Pound"), I18N_NOOP("GIP") },
2754
{ "EUR", I18N_NOOP("Greece"), I18N_NOOP("Euro"), I18N_NOOP("EUR") },
2755
{ "GRD", I18N_NOOP("Greece"), I18N_NOOP("Drachma"), I18N_NOOP("GRD") },
2756
{ "DKK", I18N_NOOP("Greenland"), I18N_NOOP("Danish Krone"), I18N_NOOP("DKK") },
2757
{ "XCD", I18N_NOOP("Grenada"), I18N_NOOP("East Caribbean Dollar"), I18N_NOOP("XCD") },
2758
{ "EUR", I18N_NOOP("Guadeloupe"), I18N_NOOP("Euro"), I18N_NOOP("EUR") },
2759
{ "USD", I18N_NOOP("Guam"), I18N_NOOP("US Dollar"), I18N_NOOP("USD") },
2760
{ "GTQ", I18N_NOOP("Guatemala"), I18N_NOOP("Quetzal"), I18N_NOOP("Q") },
2761
{ "GNF", I18N_NOOP("Guinea"), I18N_NOOP("Guinea Franc"), I18N_NOOP("GNF") },
2762
{ "GWP", I18N_NOOP("Guinea-Bissau"), I18N_NOOP("Guinea-Bissau Peso"), I18N_NOOP("GWP") },
2763
{ "XOF", I18N_NOOP("Guinea-Bissau"), I18N_NOOP("CFA Franc BCEAO"), I18N_NOOP("XOF") },
2764
{ "GYD", I18N_NOOP("Guyana"), I18N_NOOP("Guyana Dollar"), I18N_NOOP("GYD") },
2765
{ "HTG", I18N_NOOP("Haiti"), I18N_NOOP("Gourde"), I18N_NOOP("HTG") },
2766
{ "USD", I18N_NOOP("Haiti"), I18N_NOOP("US Dollar"), I18N_NOOP("USD") },
2767
{ "AUD", I18N_NOOP("Heard Island And McDonald Islands"), I18N_NOOP("Australian Dollar"), I18N_NOOP("AUD") },
2768
{ "EUR", I18N_NOOP("Holy See (Vatican City State)"), I18N_NOOP("Euro"), I18N_NOOP("EUR") },
2769
{ "HNL", I18N_NOOP("Honduras"), I18N_NOOP("Lempira"), I18N_NOOP("L") },
2770
{ "HKD", I18N_NOOP("Hong Kong"), I18N_NOOP("Hong Kong Dollar"), I18N_NOOP("HKD") },
2771
{ "HUF", I18N_NOOP("Hungary"), I18N_NOOP("Forint"), I18N_NOOP("Ft") },
2772
{ "ISK", I18N_NOOP("Iceland"), I18N_NOOP("Iceland Krona"), I18N_NOOP("kr.") },
2773
{ "INR", I18N_NOOP("India"), I18N_NOOP("Indian Rupee"), I18N_NOOP("INR") },
2774
{ "IDR", I18N_NOOP("Indonesia"), I18N_NOOP("Rupiah"), I18N_NOOP("Rp") },
2775
{ "IRR", I18N_NOOP("Iran, Islamic Republic Of"), I18N_NOOP("Iranian Rial"), I18N_NOOP("IRR") },
2776
{ "IQD", I18N_NOOP("Iraq"), I18N_NOOP("Iraqi Dinar"), I18N_NOOP("IQD") },
2777
{ "EUR", I18N_NOOP("Ireland"), I18N_NOOP("Euro"), I18N_NOOP("EUR") },
2778
{ "IEP", I18N_NOOP("Ireland"), I18N_NOOP("Punt"), I18N_NOOP("IR----") },
2779
{ "IEX", I18N_NOOP("Ireland"), I18N_NOOP("Pence"), I18N_NOOP("IEX") },
2780
{ "ILS", I18N_NOOP("Israel"), I18N_NOOP("New Israeli Sheqel"), I18N_NOOP("ILS") },
2781
{ "EUR", I18N_NOOP("Italy"), I18N_NOOP("Euro"), I18N_NOOP("EUR") },
2782
{ "ITL", I18N_NOOP("Italy"), I18N_NOOP("Lira"), I18N_NOOP("L.") },
2783
{ "JMD", I18N_NOOP("Jamaica"), I18N_NOOP("Jamaican Dollar"), I18N_NOOP("J$") },
2784
{ "JPY", I18N_NOOP("Japan"), I18N_NOOP("Yen"), I18N_NOOP("JPY") },
2785
{ "JOD", I18N_NOOP("Jordan"), I18N_NOOP("Jordanian Dinar"), I18N_NOOP("JOD") },
2786
{ "KZT", I18N_NOOP("Kazakhstan"), I18N_NOOP("Tenge"), I18N_NOOP("KZT") },
2787
{ "KES", I18N_NOOP("Kenya"), I18N_NOOP("Kenyan Shilling"), I18N_NOOP("KES") },
2788
{ "AUD", I18N_NOOP("Kiribati"), I18N_NOOP("Australian Dollar"), I18N_NOOP("AUD") },
2789
{ "KPW", I18N_NOOP("Korea, Democratic People's Republic Of"), I18N_NOOP("North Korean Won"), I18N_NOOP("KPW") },
2790
{ "KRW", I18N_NOOP("Korea, Republic Of"), I18N_NOOP("Won"), I18N_NOOP("KRW") },
2791
{ "KWD", I18N_NOOP("Kuwait"), I18N_NOOP("Kuwaiti Dinar"), I18N_NOOP("KWD") },
2792
{ "KGS", I18N_NOOP("Kyrgyzstan"), I18N_NOOP("Som"), I18N_NOOP("KGS") },
2793
{ "LAK", I18N_NOOP("Lao People's Democratic Republic"), I18N_NOOP("Kip"), I18N_NOOP("LAK") },
2794
{ "LVL", I18N_NOOP("Latvia"), I18N_NOOP("Latvian Lats"), I18N_NOOP("Ls") },
2795
{ "LBP", I18N_NOOP("Lebanon"), I18N_NOOP("Lebanese Pound"), I18N_NOOP("LBP") },
2796
{ "ZAR", I18N_NOOP("Lesotho"), I18N_NOOP("Rand"), I18N_NOOP("ZAR") },
2797
{ "LSL", I18N_NOOP("Lesotho"), I18N_NOOP("Loti"), I18N_NOOP("LSL") },
2798
{ "LRD", I18N_NOOP("Liberia"), I18N_NOOP("Liberian Dollar"), I18N_NOOP("LRD") },
2799
{ "LYD", I18N_NOOP("Libyan Arab Jamahiriya"), I18N_NOOP("Lybian Dinar"), I18N_NOOP("LYD") },
2800
{ "CHF", I18N_NOOP("Liechtenstein"), I18N_NOOP("Swiss Franc"), I18N_NOOP("CHF") },
2801
{ "LTL", I18N_NOOP("Lithuania"), I18N_NOOP("Lithuanian Litus"), I18N_NOOP("Lt") },
2802
{ "EUR", I18N_NOOP("Luxembourg"), I18N_NOOP("Euro"), I18N_NOOP("EUR") },
2803
{ "LUF", I18N_NOOP("Luxembourg"), I18N_NOOP("Franc"), I18N_NOOP("F") },
2804
{ "MOP", I18N_NOOP("Macao"), I18N_NOOP("Pataca"), I18N_NOOP("MOP") },
2805
{ "MKD", I18N_NOOP("Macedonia, The Former Yugoslav Republic Of"), I18N_NOOP("Denar"), I18N_NOOP("MKD") },
2806
{ "MGF", I18N_NOOP("Madagascar"), I18N_NOOP("Malagasy Franc"), I18N_NOOP("MGF") },
2807
{ "MWK", I18N_NOOP("Malawi"), I18N_NOOP("Kwacha"), I18N_NOOP("MWK") },
2808
{ "MYR", I18N_NOOP("Malaysia"), I18N_NOOP("Malaysian Ringgit"), I18N_NOOP("MYR") },
2809
{ "MVR", I18N_NOOP("Maldives"), I18N_NOOP("Rufiyaa"), I18N_NOOP("MVR") },
2810
{ "XOF", I18N_NOOP("Mali"), I18N_NOOP("CFA Franc BCEAO"), I18N_NOOP("XOF") },
2811
{ "MTL", I18N_NOOP("Malta"), I18N_NOOP("Maltese Lira"), I18N_NOOP("MTL") },
2812
{ "USD", I18N_NOOP("Marshall Islands"), I18N_NOOP("US Dollar"), I18N_NOOP("USD") },
2813
{ "EUR", I18N_NOOP("Martinique"), I18N_NOOP("Euro"), I18N_NOOP("EUR") },
2814
{ "MRO", I18N_NOOP("Mauritania"), I18N_NOOP("Ouguiya"), I18N_NOOP("MRO") },
2815
{ "MUR", I18N_NOOP("Mauritius"), I18N_NOOP("Mauritius Rupee"), I18N_NOOP("MUR") },
2816
{ "EUR", I18N_NOOP("Mayotte"), I18N_NOOP("Euro"), I18N_NOOP("EUR") },
2817
{ "MXN", I18N_NOOP("Mexico"), I18N_NOOP("Mexican Peso"), I18N_NOOP("MXN") },
2818
{ "MXV", I18N_NOOP("Mexico"), I18N_NOOP("Mexican Unidad de Inversion (UDI)"), I18N_NOOP("MXV") },
2819
{ "USD", I18N_NOOP("Micronesia, Federated States Of"), I18N_NOOP("US Dollar"), I18N_NOOP("USD") },
2820
{ "MDL", I18N_NOOP("Moldova, Republic Of"), I18N_NOOP("Moldovan Leu"), I18N_NOOP("MDL") },
2821
{ "EUR", I18N_NOOP("Monaco"), I18N_NOOP("Euro"), I18N_NOOP("EUR") },
2822
{ "MNT", I18N_NOOP("Mongolia"), I18N_NOOP("Tugrik"), I18N_NOOP("MNT") },
2823
{ "XCD", I18N_NOOP("Montserrat"), I18N_NOOP("East Caribbean Dollar"), I18N_NOOP("XCD") },
2824
{ "MAD", I18N_NOOP("Morocco"), I18N_NOOP("Moroccan Dirham"), I18N_NOOP("MAD") },
2825
{ "MZM", I18N_NOOP("Mozambique"), I18N_NOOP("Metical"), I18N_NOOP("MZM") },
2826
{ "MMK", I18N_NOOP("Myanmar"), I18N_NOOP("Kyat"), I18N_NOOP("MMK") },
2827
{ "ZAR", I18N_NOOP("Namibia"), I18N_NOOP("Rand"), I18N_NOOP("ZAR") },
2828
{ "NAD", I18N_NOOP("Namibia"), I18N_NOOP("Namibia Dollar"), I18N_NOOP("NAD") },
2829
{ "AUD", I18N_NOOP("Nauru"), I18N_NOOP("Australian Dollar"), I18N_NOOP("AUD") },
2830
{ "NPR", I18N_NOOP("Nepal"), I18N_NOOP("Nepalese Rupee"), I18N_NOOP("NPR") },
2831
{ "EUR", I18N_NOOP("Netherlands"), I18N_NOOP("Euro"), I18N_NOOP("EUR") },
2832
{ "NLG", I18N_NOOP("Netherlands"), I18N_NOOP("Guilder"), I18N_NOOP("fl") },
2833
{ "ANG", I18N_NOOP("Netherlands Antilles"), I18N_NOOP("Netherlands Antillan Guilder"), I18N_NOOP("ANG") },
2834
{ "XPF", I18N_NOOP("New Caledonia"), I18N_NOOP("CFP Franc"), I18N_NOOP("XPF") },
2835
{ "NZD", I18N_NOOP("New Zealand"), I18N_NOOP("New Zealand Dollar"), I18N_NOOP("NZD") },
2836
{ "NIO", I18N_NOOP("Nicaragua"), I18N_NOOP("Cordoba Oro"), I18N_NOOP("NIO") },
2837
{ "XOF", I18N_NOOP("Niger"), I18N_NOOP("CFA Franc BCEAO"), I18N_NOOP("XOF") },
2838
{ "NGN", I18N_NOOP("Nigeria"), I18N_NOOP("Naira"), I18N_NOOP("NGN") },
2839
{ "NZD", I18N_NOOP("Niue"), I18N_NOOP("New Zealand Dollar"), I18N_NOOP("NZD") },
2840
{ "AUD", I18N_NOOP("Norfolk Islands"), I18N_NOOP("Australian Dollar"), I18N_NOOP("AUD") },
2841
{ "USD", I18N_NOOP("Northern Mariana Islands"), I18N_NOOP("US Dollar"), I18N_NOOP("USD") },
2842
{ "NOK", I18N_NOOP("Norway"), I18N_NOOP("Norwegian Krone"), I18N_NOOP("kr") },
2843
{ "OMR", I18N_NOOP("Oman"), I18N_NOOP("Rial Omani"), I18N_NOOP("OMR") },
2844
{ "PKR", I18N_NOOP("Pakistan"), I18N_NOOP("Pakistan Rupee"), I18N_NOOP("PKR") },
2845
{ "USD", I18N_NOOP("Palau"), I18N_NOOP("US Dollar"), I18N_NOOP("USD") },
2846
{ "PAB", I18N_NOOP("Panama"), I18N_NOOP("Balboa"), I18N_NOOP("PAB") },
2847
{ "USD", I18N_NOOP("Panama"), I18N_NOOP("US Dollar"), I18N_NOOP("USD") },
2848
{ "PGK", I18N_NOOP("Papua New Guinea"), I18N_NOOP("Kina"), I18N_NOOP("PGK") },
2849
{ "PYG", I18N_NOOP("Paraguay"), I18N_NOOP("Guarani"), I18N_NOOP("G") },
2850
{ "PEN", I18N_NOOP("Peru"), I18N_NOOP("Nuevo Sol"), I18N_NOOP("PEN") },
2851
{ "PHP", I18N_NOOP("Philippines"), I18N_NOOP("Philippine Peso"), I18N_NOOP("PHP") },
2852
{ "NZD", I18N_NOOP("Pitcairn"), I18N_NOOP("New Zealand Dollar"), I18N_NOOP("NZD") },
2853
{ "PLN", I18N_NOOP("Poland"), I18N_NOOP("Zloty"), I18N_NOOP("zt") },
2854
{ "EUR", I18N_NOOP("Portugal"), I18N_NOOP("Euro"), I18N_NOOP("EUR") },
2855
{ "PTE", I18N_NOOP("Portugal"), I18N_NOOP("Escudo"), I18N_NOOP("Esc.") },
2856
{ "USD", I18N_NOOP("Puerto Rico"), I18N_NOOP("US Dollar"), I18N_NOOP("USD") },
2857
{ "QAR", I18N_NOOP("Qatar"), I18N_NOOP("Qatari Rial"), I18N_NOOP("QAR") },
2858
{ "ROL", I18N_NOOP("Romania"), I18N_NOOP("Leu"), I18N_NOOP("LEI") },
2859
{ "RUR", I18N_NOOP("Russian Federation"), I18N_NOOP("Russian Ruble"), I18N_NOOP("RUR") },
2860
{ "RUB", I18N_NOOP("Russian Federation"), I18N_NOOP("Russian Ruble"), I18N_NOOP("RUB") },
2861
{ "RWF", I18N_NOOP("Rwanda"), I18N_NOOP("Rwanda Franc"), I18N_NOOP("RWF") },
2862
{ "SHP", I18N_NOOP("Saint Helena"), I18N_NOOP("Saint Helena Pound"), I18N_NOOP("SHP") },
2863
{ "XCD", I18N_NOOP("Saint Kitts And Nevis"), I18N_NOOP("East Caribbean Dollar"), I18N_NOOP("XCD") },
2864
{ "XCD", I18N_NOOP("Saint Lucia"), I18N_NOOP("East Caribbean Dollar"), I18N_NOOP("XCD") },
2865
{ "EUR", I18N_NOOP("Saint Pierre And Miquelon"), I18N_NOOP("Euro"), I18N_NOOP("EUR") },
2866
{ "XCD", I18N_NOOP("Saint Vincent And The Grenadines"), I18N_NOOP("East Caribbean Dollar"), I18N_NOOP("XCD") },
2867
{ "WST", I18N_NOOP("Samoa"), I18N_NOOP("Tala"), I18N_NOOP("WST") },
2868
{ "EUR", I18N_NOOP("San Marino"), I18N_NOOP("Euro"), I18N_NOOP("EUR") },
2869
{ "STD", I18N_NOOP("Sao Tome And Principe"), I18N_NOOP("Dobra"), I18N_NOOP("STD") },
2870
{ "SAR", I18N_NOOP("Saudi Arabia"), I18N_NOOP("Saudi Riyal"), I18N_NOOP("SAR") },
2871
{ "XOF", I18N_NOOP("Senegal"), I18N_NOOP("CFA Franc BCEAO"), I18N_NOOP("XOF") },
2872
{ "SCR", I18N_NOOP("Seychelles"), I18N_NOOP("Seychelles Rupee"), I18N_NOOP("SCR") },
2873
{ "SLL", I18N_NOOP("Sierra Leone"), I18N_NOOP("Leone"), I18N_NOOP("SLL") },
2874
{ "SGD", I18N_NOOP("Singapore"), I18N_NOOP("Singapore Dollar"), I18N_NOOP("SGD") },
2875
{ "SKK", I18N_NOOP("Slovakia"), I18N_NOOP("Slovak Koruna"), I18N_NOOP("Sk") },
2876
{ "SIT", I18N_NOOP("Slovenia"), I18N_NOOP("Tolar"), I18N_NOOP("SIT") },
2877
{ "SBD", I18N_NOOP("Solomon Islands"), I18N_NOOP("Solomon Islands Dollar"), I18N_NOOP("SBD") },
2878
{ "SOS", I18N_NOOP("Somalia"), I18N_NOOP("Somali Shilling"), I18N_NOOP("SOS") },
2879
{ "ZAR", I18N_NOOP("South Africa"), I18N_NOOP("Rand"), I18N_NOOP("R") },
2880
{ "EUR", I18N_NOOP("Spain"), I18N_NOOP("Euro"), I18N_NOOP("EUR") },
2881
{ "ESP", I18N_NOOP("Spain"), I18N_NOOP("Peseta"), I18N_NOOP("Pts") },
2882
{ "LKR", I18N_NOOP("Sri Lanka"), I18N_NOOP("Sri Lanka Rupee"), I18N_NOOP("LKR") },
2883
{ "SDD", I18N_NOOP("Sudan"), I18N_NOOP("Sudanese Dinar"), I18N_NOOP("SDD") },
2884
{ "SRG", I18N_NOOP("Suriname"), I18N_NOOP("Suriname Guilder"), I18N_NOOP("SRG") },
2885
{ "NOK", I18N_NOOP("Svalbard And Jan Mayen"), I18N_NOOP("Norwegian Krone"), I18N_NOOP("NOK") },
2886
{ "SZL", I18N_NOOP("Swaziland"), I18N_NOOP("Lilangeni"), I18N_NOOP("SZL") },
2887
{ "SEK", I18N_NOOP("Sweden"), I18N_NOOP("Swedish Krona"), I18N_NOOP("kr") },
2888
{ "CHF", I18N_NOOP("Switzerland"), I18N_NOOP("Swiss Franc"), I18N_NOOP("SFr.") },
2889
{ "SYP", I18N_NOOP("Syrian Arab Republic"), I18N_NOOP("Syrian Pound"), I18N_NOOP("SYP") },
2890
{ "TWD", I18N_NOOP("Taiwan, Province Of China"), I18N_NOOP("New Taiwan Dollar"), I18N_NOOP("TWD") },
2891
{ "TJS", I18N_NOOP("Tajikistan"), I18N_NOOP("Somoni"), I18N_NOOP("TJS") },
2892
{ "TZS", I18N_NOOP("Tanzania, United Republic Of"), I18N_NOOP("Tanzanian Shilling"), I18N_NOOP("TZS") },
2893
{ "THB", I18N_NOOP("Thailand"), I18N_NOOP("Baht"), I18N_NOOP("THB") },
2894
{ "XOF", I18N_NOOP("Togo"), I18N_NOOP("CFA Franc BCEAO"), I18N_NOOP("XOF") },
2895
{ "NZD", I18N_NOOP("Tokelau"), I18N_NOOP("New Zealand Dollar"), I18N_NOOP("NZD") },
2896
{ "TOP", I18N_NOOP("Tonga"), I18N_NOOP("Pa'anga"), I18N_NOOP("TOP") },
2897
{ "TTD", I18N_NOOP("Trinidad And Tobago"), I18N_NOOP("Trinidad and Tobago Dollar"), I18N_NOOP("TT$") },
2898
{ "TND", I18N_NOOP("Tunisia"), I18N_NOOP("Tunisian Dinar"), I18N_NOOP("TND") },
2899
{ "TRL", I18N_NOOP("Turkey"), I18N_NOOP("Turkish Lira"), I18N_NOOP("TL") },
2900
{ "TMM", I18N_NOOP("Turkmenistan"), I18N_NOOP("Manat"), I18N_NOOP("TMM") },
2901
{ "USD", I18N_NOOP("Turks And Caicos Islands"), I18N_NOOP("US Dollar"), I18N_NOOP("USD") },
2902
{ "AUD", I18N_NOOP("Tuvalu"), I18N_NOOP("Australian Dollar"), I18N_NOOP("AUD") },
2903
{ "UGX", I18N_NOOP("Uganda"), I18N_NOOP("Uganda Shilling"), I18N_NOOP("UGX") },
2904
{ "UAH", I18N_NOOP("Ukraine"), I18N_NOOP("Hryvnia"), I18N_NOOP("UAH") },
2905
{ "AED", I18N_NOOP("United Arab Emirates"), I18N_NOOP("UAE Dirham"), I18N_NOOP("AED") },
2906
{ "GBP", I18N_NOOP("United Kingdom"), I18N_NOOP("Pound Sterling"), I18N_NOOP("GBP") },
2907
{ "USD", I18N_NOOP("United States"), I18N_NOOP("US Dollar"), I18N_NOOP("USD") },
2908
{ "USN", I18N_NOOP("United States"), I18N_NOOP("US Dollar (Next day)"), I18N_NOOP("USN") },
2909
{ "USS", I18N_NOOP("United States"), I18N_NOOP("US Dollar (Same day)"), I18N_NOOP("USS") },
2910
{ "UYU", I18N_NOOP("Uruguay"), I18N_NOOP("Peso Uruguayo"), I18N_NOOP("NU$") },
2911
{ "UZS", I18N_NOOP("Uzbekistan"), I18N_NOOP("Uzbekistan Sum"), I18N_NOOP("UZS") },
2912
{ "VUV", I18N_NOOP("Vanuatu"), I18N_NOOP("Vatu"), I18N_NOOP("VUV") },
2913
{ "VEB", I18N_NOOP("Venezuela"), I18N_NOOP("Bolivar"), I18N_NOOP("Bs") },
2914
{ "VND", I18N_NOOP("Viet Nam"), I18N_NOOP("Dong"), I18N_NOOP("VND") },
2915
{ "USD", I18N_NOOP("Virgin Islands"), I18N_NOOP("US Dollar"), I18N_NOOP("USD") },
2916
{ "XPF", I18N_NOOP("Wallis And Futuna"), I18N_NOOP("CFP Franc"), I18N_NOOP("XPF") },
2917
{ "MAD", I18N_NOOP("Western Sahara"), I18N_NOOP("Moroccan Dirham"), I18N_NOOP("MAD") },
2918
{ "YER", I18N_NOOP("Yemen"), I18N_NOOP("Yemeni Rial"), I18N_NOOP("YER") },
2919
{ "YUM", I18N_NOOP("Yugoslavia"), I18N_NOOP("Yugoslavian Dinar"), I18N_NOOP("YUM") },
2920
{ "ZMK", I18N_NOOP("Zambia"), I18N_NOOP("Kwacha"), I18N_NOOP("ZMK") },
2921
{ "ZWD", I18N_NOOP("Zimbabwe"), I18N_NOOP("Zimbabwe Dollar"), I18N_NOOP("ZWD") },
2922
{ 0, 0, 0, 0}, // Last must be empty!
2934
QString getCode(int t) const
2936
return m_List[t].code;
2939
QString getCountry(int t) const
2941
return m_List[t].country;
2944
QString getName(int t) const
2946
return m_List[t].name;
2949
QString getDisplayCode(int t) const
2951
return m_List[t].display;
2958
CurrencyMap gCurrencyMap;
2959
Money * gMoneyList(lMoney);
2963
using namespace KSpreadCurrency_LNS;
2965
KSpreadCurrency::KSpreadCurrency()
2970
KSpreadCurrency::~KSpreadCurrency()
2974
KSpreadCurrency::KSpreadCurrency(int index)
2976
m_code( gCurrencyMap.getCode( index ) )
2980
KSpreadCurrency::KSpreadCurrency(int index, QString const & code)
2981
: m_type ( 1 ), // unspec
2984
if ( gCurrencyMap.getCode( index ) == code )
2988
KSpreadCurrency::KSpreadCurrency(QString const & code, currencyFormat format)
2989
: m_type( 1 ), // unspec
2992
if ( format == Gnumeric )
2994
if ( code.find( '�' ) != -1 )
2996
else if ( code.find( '�' ) != -1 )
2998
else if ( code.find( '�' ) != -1 )
3000
else if ( code[0] == '[' && code[1] == '$' )
3002
int n = code.find(']');
3005
m_code = code.mid( 2, n - 2 );
3010
// m_code = locale()->currentCurrencySymbol();
3013
else if ( code.find( '$' ) != -1 )
3018
KSpreadCurrency & KSpreadCurrency::operator=(int type)
3021
m_code = gCurrencyMap.getCode( m_type );
3026
KSpreadCurrency & KSpreadCurrency::operator=(char const * code)
3034
bool KSpreadCurrency::operator==(KSpreadCurrency const & cur) const
3036
if ( m_type == cur.m_type )
3039
if ( m_code == cur.m_code )
3045
bool KSpreadCurrency::operator==(int type) const
3047
if ( m_type == type )
3053
KSpreadCurrency::operator int() const
3058
QString KSpreadCurrency::getCode() const
3063
QString KSpreadCurrency::getCountry() const
3065
return gCurrencyMap.getCountry( m_type );
3068
QString KSpreadCurrency::getName() const
3070
return gCurrencyMap.getName( m_type );
3073
QString KSpreadCurrency::getDisplayCode() const
3075
return gMoneyList[m_type].display;
3078
int KSpreadCurrency::getIndex() const
3083
QString KSpreadCurrency::getExportCode( currencyFormat format ) const
3085
if ( format == Gnumeric )
3087
if ( m_code.length() == 1 ) // symbol
3100
QString KSpreadCurrency::getChooseString( int type, bool & ok )
3102
if ( !gMoneyList[type].country )
3109
QString ret( i18n( gMoneyList[type].name ) );
3111
ret += i18n( gMoneyList[type].country );
3118
QString ret( i18n( gMoneyList[type].country ) );
3120
ret += i18n( gMoneyList[type].name );
3126
QString KSpreadCurrency::getDisplaySymbol( int type )
3128
return gMoneyList[type].display;
3131
QString KSpreadCurrency::getCurrencyCode( int type )
3133
return gMoneyList[type].code;