[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: koffice
From: Laurent Montel <montel () kde ! org>
Date: 2004-11-23 17:22:07
Message-ID: 20041123172207.0E87218352 () office ! kde ! org
[Download RAW message or body]
CVS commit by mlaurent:
Add new word for statistic variable
M +8 -0 kpresenter/kprvariable.cc 1.38
M +9 -0 kword/kwvariable.cc 1.172
M +33 -1 lib/kotext/kovariable.cc 1.171
M +1 -1 lib/kotext/kovariable.h 1.70
--- koffice/kword/kwvariable.cc #1.171:1.172
@@ -653,4 +653,13 @@ void KWStatisticVariable::recalc()
nb = charsWithSpace;
}
+ else if ( m_subtype ==VST_STATISTIC_NB_NON_WHITESPACE_CHARACTERE )
+ {
+ nb = charsWithoutSpace;
+ }
+ else if ( m_subtype ==VST_STATISTIC_NB_SYLLABLE )
+ {
+ nb = syllables;
+ }
+
else
nb = 0;
--- koffice/kpresenter/kprvariable.cc #1.37:1.38
@@ -169,4 +169,12 @@ void KPrStatisticVariable::recalc()
nb = charsWithSpace;
}
+ else if ( m_subtype ==VST_STATISTIC_NB_NON_WHITESPACE_CHARACTERE )
+ {
+ nb = charsWithoutSpace;
+ }
+ else if ( m_subtype ==VST_STATISTIC_NB_SYLLABLE )
+ {
+ nb = syllables;
+ }
else
nb = 0;
--- koffice/lib/kotext/kovariable.cc #1.170:1.171
@@ -2360,4 +2360,6 @@ QStringList KoStatisticVariable::actionT
lst << i18n( "Number of Lines" );
lst << i18n( "Number of Characteres" );
+ lst << i18n( "Number of Non Whitespace characteres" );
+ lst << i18n( "Number of Syllable" );
lst << i18n( "Number of Frame" );
lst << i18n( "Number of Embedded Object" );
@@ -2439,4 +2441,14 @@ void KoStatisticVariable::loadOasis( con
m_varValue = QVariant( elem.text().toInt() );
}
+ else if ( localName == "non-whitespace-character-count" )
+ {
+ m_subtype = VST_STATISTIC_NB_NON_WHITESPACE_CHARACTERE;
+ m_varValue = QVariant( elem.text().toInt() );
+ }
+ else if ( localName == "syllable-count" )
+ {
+ m_subtype = VST_STATISTIC_NB_SYLLABLE;
+ m_varValue = QVariant( elem.text().toInt() );
+ }
//TODO other copy
}
@@ -2489,4 +2501,16 @@ void KoStatisticVariable::saveOasis( KoX
writer.endElement();
break;
+ case VST_STATISTIC_NB_NON_WHITESPACE_CHARACTERE:
+ //TODO verify that it's implemented into oasis file format
+ writer.startElement( "text:character-without-space-count" );
+ writer.addTextNode( QString( "%1" ).arg( m_varValue.toInt() ) );
+ writer.endElement();
+ break;
+ case VST_STATISTIC_NB_SYLLABLE:
+ //TODO verify that it's implemented into oasis file format
+ writer.startElement( "text:syllable-count" );
+ writer.addTextNode( QString( "%1" ).arg( m_varValue.toInt() ) );
+ writer.endElement();
+ break;
}
}
@@ -2526,4 +2550,12 @@ QString KoStatisticVariable::fieldCode()
return i18n( "Number of Characteres" );
}
+ else if ( m_subtype == VST_STATISTIC_NB_NON_WHITESPACE_CHARACTERE )
+ {
+ return i18n( "Number of non whitespace character" );
+ }
+ else if ( m_subtype == VST_STATISTIC_NB_SYLLABLE )
+ {
+ return i18n( "Number of syllable" );
+ }
else
return i18n( "Number of Frame" );
--- koffice/lib/kotext/kovariable.h #1.69:1.70
@@ -730,5 +730,5 @@ public:
KoStatisticVariable( KoTextDocument *textdoc, short int subtype, \
KoVariableFormat *varFormat ,KoVariableCollection *_varColl);
- enum { VST_STATISTIC_NB_WORD = 0, VST_STATISTIC_NB_SENTENCE = 1, \
VST_STATISTIC_NB_LINES = 2, VST_STATISTIC_NB_CHARACTERE = 3,VST_STATISTIC_NB_FRAME = \
4, VST_STATISTIC_NB_EMBEDDED = 5, VST_STATISTIC_NB_PICTURE = 6, \
VST_STATISTIC_NB_TABLE = 7 }; + enum { VST_STATISTIC_NB_WORD = 0, \
VST_STATISTIC_NB_SENTENCE = 1, VST_STATISTIC_NB_LINES = 2, \
VST_STATISTIC_NB_CHARACTERE = 3,VST_STATISTIC_NB_NON_WHITESPACE_CHARACTERE = 4, \
VST_STATISTIC_NB_SYLLABLE = 5, VST_STATISTIC_NB_FRAME = 6, VST_STATISTIC_NB_EMBEDDED \
= 7, VST_STATISTIC_NB_PICTURE = 8, VST_STATISTIC_NB_TABLE = 9 };
virtual VariableType type() const
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic