@ -80,7 +80,7 @@ OpenCalcImport::OpenCalcPoint::OpenCalcPoint( TQString const & str )
int colonPos = - 1 ;
TQString range ;
// tq replace '.' with '!'
// replace '.' with '!'
for ( int i = 0 ; i < l ; + + i )
{
if ( str [ i ] = = ' $ ' )
@ -261,9 +261,9 @@ void OpenCalcImport::checkForNamedAreas( TQString & formula ) const
}
if ( word . length ( ) > 0 )
{
if ( m_namedAreas . tq find( word ) ! = m_namedAreas . end ( ) )
if ( m_namedAreas . find( word ) ! = m_namedAreas . end ( ) )
{
formula = formula . tq replace( start , word . length ( ) , " ' " + word + " ' " ) ;
formula = formula . replace( start , word . length ( ) , " ' " + word + " ' " ) ;
l = formula . length ( ) ;
+ + i ;
kdDebug ( 30518 ) < < " Formula: " < < formula < < " , L: " < < l < < " , i: " < < i + 1 < < endl ;
@ -276,9 +276,9 @@ void OpenCalcImport::checkForNamedAreas( TQString & formula ) const
}
if ( word . length ( ) > 0 )
{
if ( m_namedAreas . tq find( word ) ! = m_namedAreas . end ( ) )
if ( m_namedAreas . find( word ) ! = m_namedAreas . end ( ) )
{
formula = formula . tq replace( start , word . length ( ) , " ' " + word + " ' " ) ;
formula = formula . replace( start , word . length ( ) , " ' " + word + " ' " ) ;
l = formula . length ( ) ;
+ + i ;
kdDebug ( 30518 ) < < " Formula: " < < formula < < " , L: " < < l < < " , i: " < < i + 1 < < endl ;
@ -635,13 +635,13 @@ bool OpenCalcImport::readCells( TQDomElement & rowNode, Sheet * table, int row,
int year = 0 , month = 0 , day = 0 ;
ok = false ;
int p1 = value . tq find( ' - ' ) ;
int p1 = value . find( ' - ' ) ;
if ( p1 > 0 )
year = value . left ( p1 ) . toInt ( & ok ) ;
kdDebug ( 30518 ) < < " year: " < < value . left ( p1 ) < < endl ;
int p2 = value . tq find( ' - ' , + + p1 ) ;
int p2 = value . find( ' - ' , + + p1 ) ;
if ( ok )
month = value . mid ( p1 , p2 - p1 ) . toInt ( & ok ) ;
@ -807,14 +807,14 @@ void OpenCalcImport::loadOasisCondition(Cell*cell,const TQDomElement &property )
void OpenCalcImport : : loadOasisConditionValue ( const TQString & styleCondition , Conditional & newCondition )
{
TQString val ( styleCondition ) ;
if ( val . tq contains( " cell-content() " ) )
if ( val . contains( " cell-content() " ) )
{
val = val . remove ( " cell-content() " ) ;
loadOasisCondition ( val , newCondition ) ;
}
//GetFunction ::= cell-content-is-between(Value, Value) | cell-content-is-not-between(Value, Value)
//for the moment we support just int/double value, not text/date/time :(
if ( val . tq contains( " cell-content-is-between( " ) )
if ( val . contains( " cell-content-is-between( " ) )
{
val = val . remove ( " cell-content-is-between( " ) ;
val = val . remove ( " ) " ) ;
@ -822,7 +822,7 @@ void OpenCalcImport::loadOasisConditionValue( const TQString &styleCondition, Co
loadOasisValidationValue ( listVal , newCondition ) ;
newCondition . cond = Conditional : : Between ;
}
if ( val . tq contains( " cell-content-is-not-between( " ) )
if ( val . contains( " cell-content-is-not-between( " ) )
{
val = val . remove ( " cell-content-is-not-between( " ) ;
val = val . remove ( " ) " ) ;
@ -837,33 +837,33 @@ void OpenCalcImport::loadOasisConditionValue( const TQString &styleCondition, Co
void OpenCalcImport : : loadOasisCondition ( TQString & valExpression , Conditional & newCondition )
{
TQString value ;
if ( valExpression . tq find( " <= " ) = = 0 )
if ( valExpression . find( " <= " ) = = 0 )
{
value = valExpression . remove ( 0 , 2 ) ;
newCondition . cond = Conditional : : InferiorEqual ;
}
else if ( valExpression . tq find( " >= " ) = = 0 )
else if ( valExpression . find( " >= " ) = = 0 )
{
value = valExpression . remove ( 0 , 2 ) ;
newCondition . cond = Conditional : : SuperiorEqual ;
}
else if ( valExpression . tq find( " != " ) = = 0 )
else if ( valExpression . find( " != " ) = = 0 )
{
//add Differentto attribute
value = valExpression . remove ( 0 , 2 ) ;
newCondition . cond = Conditional : : DifferentTo ;
}
else if ( valExpression . tq find( " < " ) = = 0 )
else if ( valExpression . find( " < " ) = = 0 )
{
value = valExpression . remove ( 0 , 1 ) ;
newCondition . cond = Conditional : : Inferior ;
}
else if ( valExpression . tq find( " > " ) = = 0 )
else if ( valExpression . find( " > " ) = = 0 )
{
value = valExpression . remove ( 0 , 1 ) ;
newCondition . cond = Conditional : : Superior ;
}
else if ( valExpression . tq find( " = " ) = = 0 )
else if ( valExpression . find( " = " ) = = 0 )
{
value = valExpression . remove ( 0 , 1 ) ;
newCondition . cond = Conditional : : Equal ;
@ -1135,9 +1135,9 @@ bool OpenCalcImport::readColLayouts( TQDomElement & content, Sheet * table )
void replaceMacro ( TQString & text , TQString const & old , TQString const & newS )
{
int n = text . tq find( old ) ;
int n = text . find( old ) ;
if ( n ! = - 1 )
text = text . tq replace( n , old . length ( ) , newS ) ;
text = text . replace( n , old . length ( ) , newS ) ;
}
TQString getPart ( TQDomNode const & part )
@ -1332,35 +1332,35 @@ void OpenCalcImport::loadOasisMasterLayoutPage( Sheet * table,KoStyleStack &styl
TQString str = styleStack . attributeNS ( ooNS : : style , " print " ) ;
kdDebug ( 30518 ) < < " style:print : " < < str < < endl ;
if ( str . tq contains( " headers " ) )
if ( str . contains( " headers " ) )
{
//todo implement it into kspread
}
if ( str . tq contains( " grid " ) )
if ( str . contains( " grid " ) )
{
table - > print ( ) - > setPrintGrid ( true ) ;
}
if ( str . tq contains( " annotations " ) )
if ( str . contains( " annotations " ) )
{
//todo it's not implemented
}
if ( str . tq contains( " objects " ) )
if ( str . contains( " objects " ) )
{
//todo it's not implemented
}
if ( str . tq contains( " charts " ) )
if ( str . contains( " charts " ) )
{
//todo it's not implemented
}
if ( str . tq contains( " drawings " ) )
if ( str . contains( " drawings " ) )
{
//todo it's not implemented
}
if ( str . tq contains( " formulas " ) )
if ( str . contains( " formulas " ) )
{
table - > setShowFormula ( true ) ;
}
if ( str . tq contains( " zero-values " ) )
if ( str . contains( " zero-values " ) )
{
//todo it's not implemented
}
@ -1624,11 +1624,11 @@ void OpenCalcImport::loadOasisAreaName( const TQDomElement&body )
TQString range ( point . translation ) ;
if ( point . translation . tq find( ' : ' ) = = - 1 )
if ( point . translation . find( ' : ' ) = = - 1 )
{
Point p ( point . translation ) ;
int n = range . tq find( ' ! ' ) ;
int n = range . find( ' ! ' ) ;
if ( n > 0 )
range = range + " : " + range . right ( range . length ( ) - n - 1 ) ;
@ -2001,7 +2001,7 @@ void OpenCalcImport::loadBorder( Format * tqlayout, TQString const & borderDef,
if ( borderDef = = " none " )
return ;
int p = borderDef . tq find( ' ' ) ;
int p = borderDef . find( ' ' ) ;
if ( p < 0 )
return ;
@ -2011,7 +2011,7 @@ void OpenCalcImport::loadBorder( Format * tqlayout, TQString const & borderDef,
+ + p ;
int p2 = borderDef . tq find( ' ' , p ) ;
int p2 = borderDef . find( ' ' , p ) ;
TQString s = borderDef . mid ( p , p2 - p ) ;
kdDebug ( 30518 ) < < " Borderstyle: " < < s < < endl ;
@ -2031,7 +2031,7 @@ void OpenCalcImport::loadBorder( Format * tqlayout, TQString const & borderDef,
}
+ + p2 ;
p = borderDef . tq find( ' ' , p2 ) ;
p = borderDef . find( ' ' , p2 ) ;
if ( p = = - 1 )
p = borderDef . length ( ) ;
@ -2224,7 +2224,7 @@ void OpenCalcImport::readInStyle( Format * tqlayout, TQDomElement const & style
if ( style . hasAttributeNS ( ooNS : : style , " tqparent-style-name " ) )
{
Format * cp
= m_defaultStyles . tq find( style . attributeNS ( ooNS : : style , " tqparent-style-name " , TQString ( ) ) ) ;
= m_defaultStyles . find( style . attributeNS ( ooNS : : style , " tqparent-style-name " , TQString ( ) ) ) ;
kdDebug ( 30518 ) < < " Copying tqlayout from " < < style . attributeNS ( ooNS : : style , " tqparent-style-name " , TQString ( ) ) < < endl ;
if ( cp ! = 0 )
@ -2233,7 +2233,7 @@ void OpenCalcImport::readInStyle( Format * tqlayout, TQDomElement const & style
else if ( style . hasAttributeNS ( ooNS : : style , " family " ) )
{
TQString name = style . attribute ( " style-family " ) + " default " ;
Format * cp = m_defaultStyles . tq find( name ) ;
Format * cp = m_defaultStyles . find( name ) ;
kdDebug ( 30518 ) < < " Copying tqlayout from " < < name < < " , " < < ! cp < < endl ;
@ -2440,7 +2440,7 @@ void OpenCalcImport::loadOasisValidation( Validity* val, const TQString& validat
//A NumberValue is a whole or decimal number. It must not contain comma separators for numbers of 1000 or greater.
//ExtendedTrueCondition
if ( valExpression . tq contains( " cell-content-text-length() " ) )
if ( valExpression . contains( " cell-content-text-length() " ) )
{
//"cell-content-text-length()>45"
valExpression = valExpression . remove ( " cell-content-text-length() " ) ;
@ -2450,7 +2450,7 @@ void OpenCalcImport::loadOasisValidation( Validity* val, const TQString& validat
loadOasisValidationCondition ( val , valExpression ) ;
}
//cell-content-text-length-is-between(Value, Value) | cell-content-text-length-is-not-between(Value, Value)
else if ( valExpression . tq contains( " cell-content-text-length-is-between " ) )
else if ( valExpression . contains( " cell-content-text-length-is-between " ) )
{
val - > m_restriction = Restriction : : TextLength ;
val - > m_cond = Conditional : : Between ;
@ -2460,7 +2460,7 @@ void OpenCalcImport::loadOasisValidation( Validity* val, const TQString& validat
TQStringList listVal = TQStringList : : split ( " , " , valExpression ) ;
loadOasisValidationValue ( val , listVal ) ;
}
else if ( valExpression . tq contains( " cell-content-text-length-is-not-between " ) )
else if ( valExpression . contains( " cell-content-text-length-is-not-between " ) )
{
val - > m_restriction = Restriction : : TextLength ;
val - > m_cond = Conditional : : Different ;
@ -2475,36 +2475,36 @@ void OpenCalcImport::loadOasisValidation( Validity* val, const TQString& validat
//TrueFunction ::= cell-content-is-whole-number() | cell-content-is-decimal-number() | cell-content-is-date() | cell-content-is-time()
else
{
if ( valExpression . tq contains( " cell-content-is-whole-number() " ) )
if ( valExpression . contains( " cell-content-is-whole-number() " ) )
{
val - > m_restriction = Restriction : : Number ;
valExpression = valExpression . remove ( " cell-content-is-whole-number() and " ) ;
}
else if ( valExpression . tq contains( " cell-content-is-decimal-number() " ) )
else if ( valExpression . contains( " cell-content-is-decimal-number() " ) )
{
val - > m_restriction = Restriction : : Integer ;
valExpression = valExpression . remove ( " cell-content-is-decimal-number() and " ) ;
}
else if ( valExpression . tq contains( " cell-content-is-date() " ) )
else if ( valExpression . contains( " cell-content-is-date() " ) )
{
val - > m_restriction = Restriction : : Date ;
valExpression = valExpression . remove ( " cell-content-is-date() and " ) ;
}
else if ( valExpression . tq contains( " cell-content-is-time() " ) )
else if ( valExpression . contains( " cell-content-is-time() " ) )
{
val - > m_restriction = Restriction : : Time ;
valExpression = valExpression . remove ( " cell-content-is-time() and " ) ;
}
kdDebug ( 30518 ) < < " valExpression : " < < valExpression < < endl ;
if ( valExpression . tq contains( " cell-content() " ) )
if ( valExpression . contains( " cell-content() " ) )
{
valExpression = valExpression . remove ( " cell-content() " ) ;
loadOasisValidationCondition ( val , valExpression ) ;
}
//GetFunction ::= cell-content-is-between(Value, Value) | cell-content-is-not-between(Value, Value)
//for the moment we support just int/double value, not text/date/time :(
if ( valExpression . tq contains( " cell-content-is-between( " ) )
if ( valExpression . contains( " cell-content-is-between( " ) )
{
valExpression = valExpression . remove ( " cell-content-is-between( " ) ;
valExpression = valExpression . remove ( " ) " ) ;
@ -2513,7 +2513,7 @@ void OpenCalcImport::loadOasisValidation( Validity* val, const TQString& validat
val - > m_cond = Conditional : : Between ;
}
if ( valExpression . tq contains( " cell-content-is-not-between( " ) )
if ( valExpression . contains( " cell-content-is-not-between( " ) )
{
valExpression = valExpression . remove ( " cell-content-is-not-between( " ) ;
valExpression = valExpression . remove ( " ) " ) ;
@ -2623,33 +2623,33 @@ void OpenCalcImport::loadOasisValidationValue( Validity* val, const TQStringList
void OpenCalcImport : : loadOasisValidationCondition ( Validity * val , TQString & valExpression )
{
TQString value ;
if ( valExpression . tq contains( " <= " ) )
if ( valExpression . contains( " <= " ) )
{
value = valExpression . remove ( " <= " ) ;
val - > m_cond = Conditional : : InferiorEqual ;
}
else if ( valExpression . tq contains( " >= " ) )
else if ( valExpression . contains( " >= " ) )
{
value = valExpression . remove ( " >= " ) ;
val - > m_cond = Conditional : : SuperiorEqual ;
}
else if ( valExpression . tq contains( " != " ) )
else if ( valExpression . contains( " != " ) )
{
//add Differentto attribute
value = valExpression . remove ( " != " ) ;
val - > m_cond = Conditional : : DifferentTo ;
}
else if ( valExpression . tq contains( " < " ) )
else if ( valExpression . contains( " < " ) )
{
value = valExpression . remove ( " < " ) ;
val - > m_cond = Conditional : : Inferior ;
}
else if ( valExpression . tq contains( " > " ) )
else if ( valExpression . contains( " > " ) )
{
value = valExpression . remove ( " > " ) ;
val - > m_cond = Conditional : : Superior ;
}
else if ( valExpression . tq contains( " = " ) )
else if ( valExpression . contains( " = " ) )
{
value = valExpression . remove ( " = " ) ;
val - > m_cond = Conditional : : Equal ;