iString to OUString in some calc core code

Change-Id: I25fc70cfd01f5ad25f7362157796d3ddf06139e1
This commit is contained in:
Markus Mohrhard 2013-09-07 11:13:47 +02:00
parent 8d36b558be
commit 801a657ea6
20 changed files with 205 additions and 218 deletions

View File

@ -174,10 +174,10 @@ double & FormulaToken::GetDoubleAsReference()
return fVal; return fVal;
} }
const String& FormulaToken::GetString() const const OUString& FormulaToken::GetString() const
{ {
SAL_WARN( "formula.core", "FormulaToken::GetString: virtual dummy called" ); SAL_WARN( "formula.core", "FormulaToken::GetString: virtual dummy called" );
static String aDummyString; static OUString aDummyString;
return aDummyString; return aDummyString;
} }
@ -210,10 +210,10 @@ short* FormulaToken::GetJump() const
} }
const String& FormulaToken::GetExternal() const const OUString& FormulaToken::GetExternal() const
{ {
SAL_WARN( "formula.core", "FormulaToken::GetExternal: virtual dummy called" ); SAL_WARN( "formula.core", "FormulaToken::GetExternal: virtual dummy called" );
static String aDummyString; static OUString aDummyString;
return aDummyString; return aDummyString;
} }
@ -304,7 +304,7 @@ bool FormulaTokenArray::AddFormulaToken(const sheet::FormulaToken& _aToken,Exter
break; break;
case uno::TypeClass_STRING: case uno::TypeClass_STRING:
{ {
String aStrVal( _aToken.Data.get<OUString>() ); OUString aStrVal( _aToken.Data.get<OUString>() );
if ( eOpCode == ocPush ) if ( eOpCode == ocPush )
AddString( aStrVal ); AddString( aStrVal );
else if ( eOpCode == ocBad ) else if ( eOpCode == ocBad )
@ -756,7 +756,7 @@ FormulaToken* FormulaTokenArray::AddString( const sal_Unicode* pStr )
return AddString( OUString( pStr ) ); return AddString( OUString( pStr ) );
} }
FormulaToken* FormulaTokenArray::AddString( const String& rStr ) FormulaToken* FormulaTokenArray::AddString( const OUString& rStr )
{ {
return Add( new FormulaStringToken( rStr ) ); return Add( new FormulaStringToken( rStr ) );
} }
@ -771,18 +771,18 @@ FormulaToken* FormulaTokenArray::AddExternal( const sal_Unicode* pStr )
return AddExternal( OUString( pStr ) ); return AddExternal( OUString( pStr ) );
} }
FormulaToken* FormulaTokenArray::AddExternal( const String& rStr, FormulaToken* FormulaTokenArray::AddExternal( const OUString& rStr,
OpCode eOp /* = ocExternal */ ) OpCode eOp /* = ocExternal */ )
{ {
return Add( new FormulaExternalToken( eOp, rStr ) ); return Add( new FormulaExternalToken( eOp, rStr ) );
} }
FormulaToken* FormulaTokenArray::AddBad( const String& rStr ) FormulaToken* FormulaTokenArray::AddBad( const OUString& rStr )
{ {
return Add( new FormulaStringOpToken( ocBad, rStr ) ); return Add( new FormulaStringOpToken( ocBad, rStr ) );
} }
FormulaToken* FormulaTokenArray::AddStringXML( const String& rStr ) FormulaToken* FormulaTokenArray::AddStringXML( const OUString& rStr )
{ {
return Add( new FormulaStringOpToken( ocStringXML, rStr ) ); return Add( new FormulaStringOpToken( ocStringXML, rStr ) );
} }
@ -977,19 +977,19 @@ bool FormulaMissingContext::AddMissingExternal( FormulaTokenArray *pNewArr ) con
{ {
// Only called for PODF, not ODFF. No need to distinguish. // Only called for PODF, not ODFF. No need to distinguish.
const String &rName = mpFunc->GetExternal(); const OUString &rName = mpFunc->GetExternal();
// initial (fast) check: // initial (fast) check:
sal_Unicode nLastChar = rName.GetChar( rName.Len() - 1); sal_Unicode nLastChar = rName[ rName.getLength() - 1];
if ( nLastChar != 't' && nLastChar != 'm' ) if ( nLastChar != 't' && nLastChar != 'm' )
return false; return false;
if (rName.EqualsIgnoreCaseAscii( if (rName.equalsIgnoreAsciiCase(
"com.sun.star.sheet.addin.Analysis.getAccrint" )) "com.sun.star.sheet.addin.Analysis.getAccrint" ))
{ {
return AddDefaultArg( pNewArr, 4, 1000.0 ); return AddDefaultArg( pNewArr, 4, 1000.0 );
} }
if (rName.EqualsIgnoreCaseAscii( if (rName.equalsIgnoreAsciiCase(
"com.sun.star.sheet.addin.Analysis.getAccrintm" )) "com.sun.star.sheet.addin.Analysis.getAccrintm" ))
{ {
return AddDefaultArg( pNewArr, 3, 1000.0 ); return AddDefaultArg( pNewArr, 3, 1000.0 );
@ -1324,14 +1324,14 @@ bool FormulaDoubleToken::operator==( const FormulaToken& r ) const
} }
const String& FormulaStringToken::GetString() const { return aString; } const OUString& FormulaStringToken::GetString() const { return aString; }
bool FormulaStringToken::operator==( const FormulaToken& r ) const bool FormulaStringToken::operator==( const FormulaToken& r ) const
{ {
return FormulaToken::operator==( r ) && aString == r.GetString(); return FormulaToken::operator==( r ) && aString == r.GetString();
} }
const String& FormulaStringOpToken::GetString() const { return aString; } const OUString& FormulaStringOpToken::GetString() const { return aString; }
bool FormulaStringOpToken::operator==( const FormulaToken& r ) const bool FormulaStringOpToken::operator==( const FormulaToken& r ) const
{ {
return FormulaByteToken::operator==( r ) && aString == r.GetString(); return FormulaByteToken::operator==( r ) && aString == r.GetString();
@ -1346,7 +1346,7 @@ bool FormulaIndexToken::operator==( const FormulaToken& r ) const
return FormulaToken::operator==( r ) && nIndex == r.GetIndex() && return FormulaToken::operator==( r ) && nIndex == r.GetIndex() &&
mbGlobal == r.IsGlobal(); mbGlobal == r.IsGlobal();
} }
const String& FormulaExternalToken::GetExternal() const { return aExternal; } const OUString& FormulaExternalToken::GetExternal() const { return aExternal; }
sal_uInt8 FormulaExternalToken::GetByte() const { return nByte; } sal_uInt8 FormulaExternalToken::GetByte() const { return nByte; }
void FormulaExternalToken::SetByte( sal_uInt8 n ) { nByte = n; } void FormulaExternalToken::SetByte( sal_uInt8 n ) { nByte = n; }
bool FormulaExternalToken::operator==( const FormulaToken& r ) const bool FormulaExternalToken::operator==( const FormulaToken& r ) const
@ -1364,9 +1364,9 @@ bool FormulaErrorToken::operator==( const FormulaToken& r ) const
nError == static_cast< const FormulaErrorToken & >(r).GetError(); nError == static_cast< const FormulaErrorToken & >(r).GetError();
} }
double FormulaMissingToken::GetDouble() const { return 0.0; } double FormulaMissingToken::GetDouble() const { return 0.0; }
const String& FormulaMissingToken::GetString() const const OUString& FormulaMissingToken::GetString() const
{ {
static String aDummyString; static OUString aDummyString;
return aDummyString; return aDummyString;
} }
bool FormulaMissingToken::operator==( const FormulaToken& r ) const bool FormulaMissingToken::operator==( const FormulaToken& r ) const

View File

@ -136,13 +136,13 @@ public:
virtual void SetForceArray( bool b ); virtual void SetForceArray( bool b );
virtual double GetDouble() const; virtual double GetDouble() const;
virtual double& GetDoubleAsReference(); virtual double& GetDoubleAsReference();
virtual const String& GetString() const; virtual const OUString& GetString() const;
virtual sal_uInt16 GetIndex() const; virtual sal_uInt16 GetIndex() const;
virtual void SetIndex( sal_uInt16 n ); virtual void SetIndex( sal_uInt16 n );
virtual bool IsGlobal() const; virtual bool IsGlobal() const;
virtual void SetGlobal( bool b ); virtual void SetGlobal( bool b );
virtual short* GetJump() const; virtual short* GetJump() const;
virtual const String& GetExternal() const; virtual const OUString& GetExternal() const;
virtual FormulaToken* GetFAPOrigToken() const; virtual FormulaToken* GetFAPOrigToken() const;
virtual sal_uInt16 GetError() const; virtual sal_uInt16 GetError() const;
virtual void SetError( sal_uInt16 ); virtual void SetError( sal_uInt16 );
@ -169,8 +169,8 @@ public:
static size_t GetStrLenBytes( xub_StrLen nLen ) static size_t GetStrLenBytes( xub_StrLen nLen )
{ return nLen * sizeof(sal_Unicode); } { return nLen * sizeof(sal_Unicode); }
static size_t GetStrLenBytes( const String& rStr ) static size_t GetStrLenBytes( const OUString& rStr )
{ return GetStrLenBytes( rStr.Len() ); } { return GetStrLenBytes( rStr.getLength() ); }
}; };
inline void intrusive_ptr_add_ref(const FormulaToken* p) inline void intrusive_ptr_add_ref(const FormulaToken* p)
@ -257,15 +257,15 @@ public:
class FORMULA_DLLPUBLIC FormulaStringToken : public FormulaToken class FORMULA_DLLPUBLIC FormulaStringToken : public FormulaToken
{ {
private: private:
String aString; OUString aString;
public: public:
FormulaStringToken( const String& r ) : FormulaStringToken( const OUString& r ) :
FormulaToken( svString ), aString( r ) {} FormulaToken( svString ), aString( r ) {}
FormulaStringToken( const FormulaStringToken& r ) : FormulaStringToken( const FormulaStringToken& r ) :
FormulaToken( r ), aString( r.aString ) {} FormulaToken( r ), aString( r.aString ) {}
virtual FormulaToken* Clone() const { return new FormulaStringToken(*this); } virtual FormulaToken* Clone() const { return new FormulaStringToken(*this); }
virtual const String& GetString() const; virtual const OUString& GetString() const;
virtual bool operator==( const FormulaToken& rToken ) const; virtual bool operator==( const FormulaToken& rToken ) const;
DECL_FIXEDMEMPOOL_NEWDEL_DLL( FormulaStringToken ) DECL_FIXEDMEMPOOL_NEWDEL_DLL( FormulaStringToken )
@ -277,15 +277,15 @@ public:
class FORMULA_DLLPUBLIC FormulaStringOpToken : public FormulaByteToken class FORMULA_DLLPUBLIC FormulaStringOpToken : public FormulaByteToken
{ {
private: private:
String aString; OUString aString;
public: public:
FormulaStringOpToken( OpCode e, const String& r ) : FormulaStringOpToken( OpCode e, const OUString& r ) :
FormulaByteToken( e, 0, svString, false ), aString( r ) {} FormulaByteToken( e, 0, svString, false ), aString( r ) {}
FormulaStringOpToken( const FormulaStringOpToken& r ) : FormulaStringOpToken( const FormulaStringOpToken& r ) :
FormulaByteToken( r ), aString( r.aString ) {} FormulaByteToken( r ), aString( r.aString ) {}
virtual FormulaToken* Clone() const { return new FormulaStringOpToken(*this); } virtual FormulaToken* Clone() const { return new FormulaStringOpToken(*this); }
virtual const String& GetString() const; virtual const OUString& GetString() const;
virtual bool operator==( const FormulaToken& rToken ) const; virtual bool operator==( const FormulaToken& rToken ) const;
}; };
@ -312,13 +312,13 @@ public:
class FORMULA_DLLPUBLIC FormulaExternalToken : public FormulaToken class FORMULA_DLLPUBLIC FormulaExternalToken : public FormulaToken
{ {
private: private:
String aExternal; OUString aExternal;
sal_uInt8 nByte; sal_uInt8 nByte;
public: public:
FormulaExternalToken( OpCode e, sal_uInt8 n, const String& r ) : FormulaExternalToken( OpCode e, sal_uInt8 n, const OUString& r ) :
FormulaToken( svExternal, e ), aExternal( r ), FormulaToken( svExternal, e ), aExternal( r ),
nByte( n ) {} nByte( n ) {}
FormulaExternalToken( OpCode e, const String& r ) : FormulaExternalToken( OpCode e, const OUString& r ) :
FormulaToken(svExternal, e ), aExternal( r ), FormulaToken(svExternal, e ), aExternal( r ),
nByte( 0 ) {} nByte( 0 ) {}
FormulaExternalToken( const FormulaExternalToken& r ) : FormulaExternalToken( const FormulaExternalToken& r ) :
@ -326,7 +326,7 @@ public:
nByte( r.nByte ) {} nByte( r.nByte ) {}
virtual FormulaToken* Clone() const { return new FormulaExternalToken(*this); } virtual FormulaToken* Clone() const { return new FormulaExternalToken(*this); }
virtual const String& GetExternal() const; virtual const OUString& GetExternal() const;
virtual sal_uInt8 GetByte() const; virtual sal_uInt8 GetByte() const;
virtual void SetByte( sal_uInt8 n ); virtual void SetByte( sal_uInt8 n );
virtual bool operator==( const FormulaToken& rToken ) const; virtual bool operator==( const FormulaToken& rToken ) const;
@ -343,7 +343,7 @@ public:
virtual FormulaToken* Clone() const { return new FormulaMissingToken(*this); } virtual FormulaToken* Clone() const { return new FormulaMissingToken(*this); }
virtual double GetDouble() const; virtual double GetDouble() const;
virtual const String& GetString() const; virtual const OUString& GetString() const;
virtual bool operator==( const FormulaToken& rToken ) const; virtual bool operator==( const FormulaToken& rToken ) const;
}; };

View File

@ -200,14 +200,14 @@ public:
FormulaToken* AddToken( const FormulaToken& ); FormulaToken* AddToken( const FormulaToken& );
FormulaToken* AddString( const sal_Unicode* pStr ); FormulaToken* AddString( const sal_Unicode* pStr );
FormulaToken* AddString( const String& rStr ); FormulaToken* AddString( const OUString& rStr );
FormulaToken* AddDouble( double fVal ); FormulaToken* AddDouble( double fVal );
FormulaToken* AddExternal( const sal_Unicode* pStr ); FormulaToken* AddExternal( const sal_Unicode* pStr );
/** Xcl import may play dirty tricks with OpCode!=ocExternal. /** Xcl import may play dirty tricks with OpCode!=ocExternal.
Others don't use! */ Others don't use! */
FormulaToken* AddExternal( const String& rStr, OpCode eOp = ocExternal ); FormulaToken* AddExternal( const OUString& rStr, OpCode eOp = ocExternal );
FormulaToken* AddBad( const String& rStr ); /// ocBad with String FormulaToken* AddBad( const OUString& rStr ); /// ocBad with OUString
FormulaToken* AddStringXML( const String& rStr ); /// ocStringXML with String, temporary during import FormulaToken* AddStringXML( const OUString& rStr ); /// ocStringXML with OUString, temporary during import
virtual FormulaToken* MergeArray( ); virtual FormulaToken* MergeArray( );

View File

@ -169,9 +169,9 @@ public:
// These methods are ok to use, reference count not cleared. // These methods are ok to use, reference count not cleared.
void SetName(bool bGlobal, sal_uInt16 nIndex); void SetName(bool bGlobal, sal_uInt16 nIndex);
void SetExternalSingleRef( sal_uInt16 nFileId, const String& rTabName, const ScSingleRefData& rRef ); void SetExternalSingleRef( sal_uInt16 nFileId, const OUString& rTabName, const ScSingleRefData& rRef );
void SetExternalDoubleRef( sal_uInt16 nFileId, const String& rTabName, const ScComplexRefData& rRef ); void SetExternalDoubleRef( sal_uInt16 nFileId, const OUString& rTabName, const ScComplexRefData& rRef );
void SetExternalName( sal_uInt16 nFileId, const String& rName ); void SetExternalName( sal_uInt16 nFileId, const OUString& rName );
void SetMatrix( ScMatrix* p ); void SetMatrix( ScMatrix* p );
void SetExternal(const sal_Unicode* pStr); void SetExternal(const sal_Unicode* pStr);

View File

@ -220,12 +220,12 @@ private:
sal_Bool bIgnoreBlank; sal_Bool bIgnoreBlank;
sal_Int16 nShowList; sal_Int16 nShowList;
sal_Bool bShowInput; sal_Bool bShowInput;
String aInputTitle; OUString aInputTitle;
String aInputMessage; OUString aInputMessage;
sal_Bool bShowError; sal_Bool bShowError;
sal_uInt16 nErrorStyle; // enum ScValidErrorStyle sal_uInt16 nErrorStyle; // enum ScValidErrorStyle
String aErrorTitle; OUString aErrorTitle;
String aErrorMessage; OUString aErrorMessage;
void ClearData_Impl(); void ClearData_Impl();

View File

@ -158,7 +158,7 @@ public:
/** Return string if type formula::svString or formula::svHybridCell or formula::svMatrixCell and /** Return string if type formula::svString or formula::svHybridCell or formula::svMatrixCell and
upper left formula::svString, else empty string. */ upper left formula::svString, else empty string. */
const String& GetString() const; const OUString& GetString() const;
/** Return matrix if type formula::svMatrixCell and ScMatrix present, else NULL. */ /** Return matrix if type formula::svMatrixCell and ScMatrix present, else NULL. */
ScConstMatrixRef GetMatrix() const; ScConstMatrixRef GetMatrix() const;
@ -179,7 +179,7 @@ public:
/** Should only be used by import filters, best in the order /** Should only be used by import filters, best in the order
SetHybridDouble(), SetHybridString()/SetHybridFormula(), or only SetHybridDouble(), SetHybridString()/SetHybridFormula(), or only
SetHybridFormula() for formula string to be compiled later. */ SetHybridFormula() for formula string to be compiled later. */
SC_DLLPUBLIC void SetHybridFormula( const String & rFormula ); SC_DLLPUBLIC void SetHybridFormula( const OUString & rFormula );
SC_DLLPUBLIC void SetMatrix( SCCOL nCols, SCROW nRows, const ScConstMatrixRef& pMat, formula::FormulaToken* pUL ); SC_DLLPUBLIC void SetMatrix( SCCOL nCols, SCROW nRows, const ScConstMatrixRef& pMat, formula::FormulaToken* pUL );

View File

@ -212,17 +212,17 @@ class ScExternalSingleRefToken : public ScToken
{ {
private: private:
sal_uInt16 mnFileId; sal_uInt16 mnFileId;
String maTabName; OUString maTabName;
ScSingleRefData maSingleRef; ScSingleRefData maSingleRef;
ScExternalSingleRefToken(); // disabled ScExternalSingleRefToken(); // disabled
public: public:
ScExternalSingleRefToken( sal_uInt16 nFileId, const String& rTabName, const ScSingleRefData& r ); ScExternalSingleRefToken( sal_uInt16 nFileId, const OUString& rTabName, const ScSingleRefData& r );
ScExternalSingleRefToken( const ScExternalSingleRefToken& r ); ScExternalSingleRefToken( const ScExternalSingleRefToken& r );
virtual ~ScExternalSingleRefToken(); virtual ~ScExternalSingleRefToken();
virtual sal_uInt16 GetIndex() const; virtual sal_uInt16 GetIndex() const;
virtual const String& GetString() const; virtual const OUString& GetString() const;
virtual const ScSingleRefData& GetSingleRef() const; virtual const ScSingleRefData& GetSingleRef() const;
virtual ScSingleRefData& GetSingleRef(); virtual ScSingleRefData& GetSingleRef();
virtual bool operator==( const formula::FormulaToken& rToken ) const; virtual bool operator==( const formula::FormulaToken& rToken ) const;
@ -234,17 +234,17 @@ class ScExternalDoubleRefToken : public ScToken
{ {
private: private:
sal_uInt16 mnFileId; sal_uInt16 mnFileId;
String maTabName; // name of the first sheet OUString maTabName; // name of the first sheet
ScComplexRefData maDoubleRef; ScComplexRefData maDoubleRef;
ScExternalDoubleRefToken(); // disabled ScExternalDoubleRefToken(); // disabled
public: public:
ScExternalDoubleRefToken( sal_uInt16 nFileId, const String& rTabName, const ScComplexRefData& r ); ScExternalDoubleRefToken( sal_uInt16 nFileId, const OUString& rTabName, const ScComplexRefData& r );
ScExternalDoubleRefToken( const ScExternalDoubleRefToken& r ); ScExternalDoubleRefToken( const ScExternalDoubleRefToken& r );
virtual ~ScExternalDoubleRefToken(); virtual ~ScExternalDoubleRefToken();
virtual sal_uInt16 GetIndex() const; virtual sal_uInt16 GetIndex() const;
virtual const String& GetString() const; virtual const OUString& GetString() const;
virtual const ScSingleRefData& GetSingleRef() const; virtual const ScSingleRefData& GetSingleRef() const;
virtual ScSingleRefData& GetSingleRef(); virtual ScSingleRefData& GetSingleRef();
virtual const ScSingleRefData& GetSingleRef2() const; virtual const ScSingleRefData& GetSingleRef2() const;
@ -259,15 +259,15 @@ class ScExternalNameToken : public ScToken
{ {
private: private:
sal_uInt16 mnFileId; sal_uInt16 mnFileId;
String maName; OUString maName;
private: private:
ScExternalNameToken(); // disabled ScExternalNameToken(); // disabled
public: public:
ScExternalNameToken( sal_uInt16 nFileId, const String& rName ); ScExternalNameToken( sal_uInt16 nFileId, const OUString& rName );
ScExternalNameToken( const ScExternalNameToken& r ); ScExternalNameToken( const ScExternalNameToken& r );
virtual ~ScExternalNameToken(); virtual ~ScExternalNameToken();
virtual sal_uInt16 GetIndex() const; virtual sal_uInt16 GetIndex() const;
virtual const String& GetString() const; virtual const OUString& GetString() const;
virtual bool operator==( const formula::FormulaToken& rToken ) const; virtual bool operator==( const formula::FormulaToken& rToken ) const;
virtual FormulaToken* Clone() const { return new ScExternalNameToken(*this); } virtual FormulaToken* Clone() const { return new ScExternalNameToken(*this); }
}; };
@ -325,7 +325,7 @@ public:
bool IsInherited() const { return bInherited; } bool IsInherited() const { return bInherited; }
bool IsDisplayedAsString() const { return bDisplayedAsString; } bool IsDisplayedAsString() const { return bDisplayedAsString; }
virtual double GetDouble() const; virtual double GetDouble() const;
virtual const String & GetString() const; virtual const OUString & GetString() const;
virtual bool operator==( const formula::FormulaToken& rToken ) const; virtual bool operator==( const formula::FormulaToken& rToken ) const;
virtual FormulaToken* Clone() const { return new ScEmptyCellToken(*this); } virtual FormulaToken* Clone() const { return new ScEmptyCellToken(*this); }
}; };
@ -345,7 +345,7 @@ public:
ScMatrixCellResultToken( const ScConstMatrixRef& pMat, formula::FormulaToken* pUL ); ScMatrixCellResultToken( const ScConstMatrixRef& pMat, formula::FormulaToken* pUL );
ScMatrixCellResultToken( const ScMatrixCellResultToken& r ); ScMatrixCellResultToken( const ScMatrixCellResultToken& r );
virtual double GetDouble() const; virtual double GetDouble() const;
virtual const String & GetString() const; virtual const OUString & GetString() const;
virtual const ScMatrix* GetMatrix() const; virtual const ScMatrix* GetMatrix() const;
virtual bool operator==( const formula::FormulaToken& rToken ) const; virtual bool operator==( const formula::FormulaToken& rToken ) const;
virtual FormulaToken* Clone() const; virtual FormulaToken* Clone() const;
@ -414,7 +414,7 @@ class SC_DLLPUBLIC ScHybridCellToken : public ScToken
{ {
private: private:
double mfDouble; double mfDouble;
String maString; OUString maString;
OUString maFormula; OUString maFormula;
public: public:
ScHybridCellToken( double f, ScHybridCellToken( double f,
@ -426,7 +426,7 @@ public:
const OUString& GetFormula() const { return maFormula; } const OUString& GetFormula() const { return maFormula; }
virtual double GetDouble() const; virtual double GetDouble() const;
virtual const String& GetString() const; virtual const OUString& GetString() const;
virtual bool operator==( const formula::FormulaToken& rToken ) const; virtual bool operator==( const formula::FormulaToken& rToken ) const;
virtual FormulaToken* Clone() const { return new ScHybridCellToken(*this); } virtual FormulaToken* Clone() const { return new ScHybridCellToken(*this); }
}; };

View File

@ -91,9 +91,9 @@ public:
formula::FormulaToken* AddDoubleReference( const ScComplexRefData& rRef ); formula::FormulaToken* AddDoubleReference( const ScComplexRefData& rRef );
formula::FormulaToken* AddRangeName( sal_uInt16 n, bool bGlobal ); formula::FormulaToken* AddRangeName( sal_uInt16 n, bool bGlobal );
formula::FormulaToken* AddDBRange( sal_uInt16 n ); formula::FormulaToken* AddDBRange( sal_uInt16 n );
formula::FormulaToken* AddExternalName( sal_uInt16 nFileId, const String& rName ); formula::FormulaToken* AddExternalName( sal_uInt16 nFileId, const OUString& rName );
formula::FormulaToken* AddExternalSingleReference( sal_uInt16 nFileId, const String& rTabName, const ScSingleRefData& rRef ); formula::FormulaToken* AddExternalSingleReference( sal_uInt16 nFileId, const OUString& rTabName, const ScSingleRefData& rRef );
formula::FormulaToken* AddExternalDoubleReference( sal_uInt16 nFileId, const String& rTabName, const ScComplexRefData& rRef ); formula::FormulaToken* AddExternalDoubleReference( sal_uInt16 nFileId, const OUString& rTabName, const ScComplexRefData& rRef );
formula::FormulaToken* AddMatrix( const ScMatrixRef& p ); formula::FormulaToken* AddMatrix( const ScMatrixRef& p );
/** ScSingleRefOpToken with ocColRowName. */ /** ScSingleRefOpToken with ocColRowName. */
formula::FormulaToken* AddColRowName( const ScSingleRefData& rRef ); formula::FormulaToken* AddColRowName( const ScSingleRefData& rRef );

View File

@ -62,33 +62,34 @@ enum ScValidErrorStyle
class SC_DLLPUBLIC ScValidationData : public ScConditionEntry class SC_DLLPUBLIC ScValidationData : public ScConditionEntry
{ {
private:
sal_uInt32 nKey; // index in attributes sal_uInt32 nKey; // index in attributes
ScValidationMode eDataMode; ScValidationMode eDataMode;
sal_Bool bShowInput; bool bShowInput;
sal_Bool bShowError; bool bShowError;
ScValidErrorStyle eErrorStyle; ScValidErrorStyle eErrorStyle;
sal_Int16 mnListType; // selection list type: none, unsorted, sorted. sal_Int16 mnListType; // selection list type: none, unsorted, sorted.
String aInputTitle; OUString aInputTitle;
String aInputMessage; OUString aInputMessage;
String aErrorTitle; OUString aErrorTitle;
String aErrorMessage; OUString aErrorMessage;
sal_Bool bIsUsed; // temporary during saving bool bIsUsed; // temporary during saving
sal_Bool DoMacro( const ScAddress& rPos, const String& rInput, bool DoMacro( const ScAddress& rPos, const OUString& rInput,
ScFormulaCell* pCell, Window* pParent ) const; ScFormulaCell* pCell, Window* pParent ) const;
sal_Bool DoScript( const ScAddress& rPos, const String& rInput, bool DoScript( const ScAddress& rPos, const OUString& rInput,
ScFormulaCell* pCell, Window* pParent ) const; ScFormulaCell* pCell, Window* pParent ) const;
using ScConditionEntry::operator==; using ScConditionEntry::operator==;
public: public:
ScValidationData( ScValidationMode eMode, ScConditionMode eOper, ScValidationData( ScValidationMode eMode, ScConditionMode eOper,
const String& rExpr1, const String& rExpr2, const OUString& rExpr1, const OUString& rExpr2,
ScDocument* pDocument, const ScAddress& rPos, ScDocument* pDocument, const ScAddress& rPos,
const String& rExprNmsp1 = EMPTY_STRING, const String& rExprNmsp2 = EMPTY_STRING, const OUString& rExprNmsp1 = EMPTY_OUSTRING, const OUString& rExprNmsp2 = EMPTY_OUSTRING,
formula::FormulaGrammar::Grammar eGrammar1 = formula::FormulaGrammar::GRAM_DEFAULT, formula::FormulaGrammar::Grammar eGrammar1 = formula::FormulaGrammar::GRAM_DEFAULT,
formula::FormulaGrammar::Grammar eGrammar2 = formula::FormulaGrammar::GRAM_DEFAULT ); formula::FormulaGrammar::Grammar eGrammar2 = formula::FormulaGrammar::GRAM_DEFAULT );
ScValidationData( ScValidationMode eMode, ScConditionMode eOper, ScValidationData( ScValidationMode eMode, ScConditionMode eOper,
@ -105,15 +106,15 @@ public:
void ResetInput(); void ResetInput();
void ResetError(); void ResetError();
void SetInput( const String& rTitle, const String& rMsg ); void SetInput( const OUString& rTitle, const OUString& rMsg );
void SetError( const String& rTitle, const String& rMsg, void SetError( const OUString& rTitle, const OUString& rMsg,
ScValidErrorStyle eStyle ); ScValidErrorStyle eStyle );
sal_Bool GetInput( String& rTitle, String& rMsg ) const bool GetInput( OUString& rTitle, OUString& rMsg ) const
{ rTitle = aInputTitle; rMsg = aInputMessage; return bShowInput; } { rTitle = aInputTitle; rMsg = aInputMessage; return bShowInput; }
sal_Bool GetErrMsg( String& rTitle, String& rMsg, ScValidErrorStyle& rStyle ) const; bool GetErrMsg( OUString& rTitle, OUString& rMsg, ScValidErrorStyle& rStyle ) const;
sal_Bool HasErrMsg() const { return bShowError; } bool HasErrMsg() const { return bShowError; }
ScValidationMode GetDataMode() const { return eDataMode; } ScValidationMode GetDataMode() const { return eDataMode; }
@ -137,17 +138,17 @@ public:
bool IsDataValid( ScRefCellValue& rCell, const ScAddress& rPos ) const; bool IsDataValid( ScRefCellValue& rCell, const ScAddress& rPos ) const;
// TRUE -> break // TRUE -> break
sal_Bool DoError( Window* pParent, const String& rInput, const ScAddress& rPos ) const; bool DoError( Window* pParent, const OUString& rInput, const ScAddress& rPos ) const;
void DoCalcError( ScFormulaCell* pCell ) const; void DoCalcError( ScFormulaCell* pCell ) const;
sal_Bool IsEmpty() const; bool IsEmpty() const;
sal_uInt32 GetKey() const { return nKey; } sal_uInt32 GetKey() const { return nKey; }
void SetKey(sal_uInt32 nNew) { nKey = nNew; } // only if not inserted! void SetKey(sal_uInt32 nNew) { nKey = nNew; } // only if not inserted!
void SetUsed(sal_Bool bSet) { bIsUsed = bSet; } void SetUsed(bool bSet) { bIsUsed = bSet; }
sal_Bool IsUsed() const { return bIsUsed; } bool IsUsed() const { return bIsUsed; }
sal_Bool EqualEntries( const ScValidationData& r ) const; // for undo bool EqualEntries( const ScValidationData& r ) const; // for undo
// sort (using std::set) by index // sort (using std::set) by index
// operator== only for sorting // operator== only for sorting
@ -214,7 +215,7 @@ public:
void UpdateDeleteTab( sc::RefUpdateDeleteTabContext& rCxt ); void UpdateDeleteTab( sc::RefUpdateDeleteTabContext& rCxt );
void UpdateMoveTab( sc::RefUpdateMoveTabContext& rCxt ); void UpdateMoveTab( sc::RefUpdateMoveTabContext& rCxt );
sal_Bool operator==( const ScValidationDataList& r ) const; // for ref-undo bool operator==( const ScValidationDataList& r ) const; // for ref-undo
void clear(); void clear();

View File

@ -56,9 +56,9 @@ using namespace formula;
// //
ScValidationData::ScValidationData( ScValidationMode eMode, ScConditionMode eOper, ScValidationData::ScValidationData( ScValidationMode eMode, ScConditionMode eOper,
const String& rExpr1, const String& rExpr2, const OUString& rExpr1, const OUString& rExpr2,
ScDocument* pDocument, const ScAddress& rPos, ScDocument* pDocument, const ScAddress& rPos,
const String& rExprNmsp1, const String& rExprNmsp2, const OUString& rExprNmsp1, const OUString& rExprNmsp2,
FormulaGrammar::Grammar eGrammar1, FormulaGrammar::Grammar eGrammar2 ) : FormulaGrammar::Grammar eGrammar1, FormulaGrammar::Grammar eGrammar2 ) :
ScConditionEntry( eOper, rExpr1, rExpr2, pDocument, rPos, rExprNmsp1, rExprNmsp2, eGrammar1, eGrammar2 ), ScConditionEntry( eOper, rExpr1, rExpr2, pDocument, rPos, rExprNmsp1, rExprNmsp2, eGrammar1, eGrammar2 ),
nKey( 0 ), nKey( 0 ),
@ -117,14 +117,14 @@ ScValidationData::~ScValidationData()
{ {
} }
sal_Bool ScValidationData::IsEmpty() const bool ScValidationData::IsEmpty() const
{ {
String aEmpty; OUString aEmpty;
ScValidationData aDefault( SC_VALID_ANY, SC_COND_EQUAL, aEmpty, aEmpty, GetDocument(), ScAddress() ); ScValidationData aDefault( SC_VALID_ANY, SC_COND_EQUAL, aEmpty, aEmpty, GetDocument(), ScAddress() );
return EqualEntries( aDefault ); return EqualEntries( aDefault );
} }
sal_Bool ScValidationData::EqualEntries( const ScValidationData& r ) const bool ScValidationData::EqualEntries( const ScValidationData& r ) const
{ {
// gleiche Parameter eingestellt (ohne Key) // gleiche Parameter eingestellt (ohne Key)
@ -150,23 +150,23 @@ void ScValidationData::ResetError()
bShowError = false; bShowError = false;
} }
void ScValidationData::SetInput( const String& rTitle, const String& rMsg ) void ScValidationData::SetInput( const OUString& rTitle, const OUString& rMsg )
{ {
bShowInput = sal_True; bShowInput = true;
aInputTitle = rTitle; aInputTitle = rTitle;
aInputMessage = rMsg; aInputMessage = rMsg;
} }
void ScValidationData::SetError( const String& rTitle, const String& rMsg, void ScValidationData::SetError( const OUString& rTitle, const OUString& rMsg,
ScValidErrorStyle eStyle ) ScValidErrorStyle eStyle )
{ {
bShowError = sal_True; bShowError = true;
eErrorStyle = eStyle; eErrorStyle = eStyle;
aErrorTitle = rTitle; aErrorTitle = rTitle;
aErrorMessage = rMsg; aErrorMessage = rMsg;
} }
sal_Bool ScValidationData::GetErrMsg( String& rTitle, String& rMsg, bool ScValidationData::GetErrMsg( OUString& rTitle, OUString& rMsg,
ScValidErrorStyle& rStyle ) const ScValidErrorStyle& rStyle ) const
{ {
rTitle = aErrorTitle; rTitle = aErrorTitle;
@ -175,7 +175,7 @@ sal_Bool ScValidationData::GetErrMsg( String& rTitle, String& rMsg,
return bShowError; return bShowError;
} }
sal_Bool ScValidationData::DoScript( const ScAddress& rPos, const String& rInput, bool ScValidationData::DoScript( const ScAddress& rPos, const OUString& rInput,
ScFormulaCell* pCell, Window* pParent ) const ScFormulaCell* pCell, Window* pParent ) const
{ {
ScDocument* pDocument = GetDocument(); ScDocument* pDocument = GetDocument();
@ -183,15 +183,15 @@ sal_Bool ScValidationData::DoScript( const ScAddress& rPos, const String& rInput
if ( !pDocSh || !pDocument->CheckMacroWarn() ) if ( !pDocSh || !pDocument->CheckMacroWarn() )
return false; return false;
sal_Bool bScriptReturnedFalse = false; // Standard: kein Abbruch bool bScriptReturnedFalse = false; // Standard: kein Abbruch
// Set up parameters // Set up parameters
::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > aParams(2); ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > aParams(2);
// 1) eingegebener / berechneter Wert // 1) eingegebener / berechneter Wert
String aValStr = rInput; OUString aValStr = rInput;
double nValue; double nValue;
sal_Bool bIsValue = false; bool bIsValue = false;
if ( pCell ) // wenn Zelle gesetzt, aus Interpret gerufen if ( pCell ) // wenn Zelle gesetzt, aus Interpret gerufen
{ {
bIsValue = pCell->IsValue(); bIsValue = pCell->IsValue();
@ -211,9 +211,9 @@ sal_Bool ScValidationData::DoScript( const ScAddress& rPos, const String& rInput
// use link-update flag to prevent closing the document // use link-update flag to prevent closing the document
// while the macro is running // while the macro is running
sal_Bool bWasInLinkUpdate = pDocument->IsInLinkUpdate(); bool bWasInLinkUpdate = pDocument->IsInLinkUpdate();
if ( !bWasInLinkUpdate ) if ( !bWasInLinkUpdate )
pDocument->SetInLinkUpdate( sal_True ); pDocument->SetInLinkUpdate( true );
if ( pCell ) if ( pCell )
pDocument->LockTable( rPos.Tab() ); pDocument->LockTable( rPos.Tab() );
@ -233,13 +233,13 @@ sal_Bool ScValidationData::DoScript( const ScAddress& rPos, const String& rInput
// Check the return value from the script // Check the return value from the script
// The contents of the cell get reset if the script returns false // The contents of the cell get reset if the script returns false
sal_Bool bTmp = false; bool bTmp = false;
if ( eRet == ERRCODE_NONE && if ( eRet == ERRCODE_NONE &&
aRet.getValueType() == getCppuBooleanType() && aRet.getValueType() == getCppuBooleanType() &&
sal_True == ( aRet >>= bTmp ) && ( aRet >>= bTmp ) &&
bTmp == false ) !bTmp )
{ {
bScriptReturnedFalse = sal_True; bScriptReturnedFalse = true;
} }
if ( eRet == ERRCODE_BASIC_METHOD_NOT_FOUND && !pCell ) if ( eRet == ERRCODE_BASIC_METHOD_NOT_FOUND && !pCell )
@ -255,9 +255,9 @@ sal_Bool ScValidationData::DoScript( const ScAddress& rPos, const String& rInput
return bScriptReturnedFalse; return bScriptReturnedFalse;
} }
// sal_True -> Abbruch // true -> Abbruch
sal_Bool ScValidationData::DoMacro( const ScAddress& rPos, const String& rInput, bool ScValidationData::DoMacro( const ScAddress& rPos, const OUString& rInput,
ScFormulaCell* pCell, Window* pParent ) const ScFormulaCell* pCell, Window* pParent ) const
{ {
if ( SfxApplication::IsXScriptURL( aErrorTitle ) ) if ( SfxApplication::IsXScriptURL( aErrorTitle ) )
@ -270,8 +270,8 @@ sal_Bool ScValidationData::DoMacro( const ScAddress& rPos, const String& rInput,
if ( !pDocSh || !pDocument->CheckMacroWarn() ) if ( !pDocSh || !pDocument->CheckMacroWarn() )
return false; return false;
sal_Bool bDone = false; bool bDone = false;
sal_Bool bRet = false; // Standard: kein Abbruch bool bRet = false; // Standard: kein Abbruch
// Wenn das Dok waehrend eines Basic-Calls geladen wurde, // Wenn das Dok waehrend eines Basic-Calls geladen wurde,
// ist das Sbx-Objekt evtl. nicht angelegt (?) // ist das Sbx-Objekt evtl. nicht angelegt (?)
@ -290,12 +290,9 @@ sal_Bool ScValidationData::DoMacro( const ScAddress& rPos, const String& rInput,
SbMethod* pMethod = (SbMethod*)pVar; SbMethod* pMethod = (SbMethod*)pVar;
SbModule* pModule = pMethod->GetModule(); SbModule* pModule = pMethod->GetModule();
SbxObject* pObject = pModule->GetParent(); SbxObject* pObject = pModule->GetParent();
String aMacroStr = pObject->GetName(); OUStringBuffer aMacroStr = pObject->GetName();
aMacroStr += '.'; aMacroStr.append('.').append(pModule->GetName()).append('.').append(pMethod->GetName());
aMacroStr += pModule->GetName(); OUString aBasicStr;
aMacroStr += '.';
aMacroStr += pMethod->GetName();
String aBasicStr;
// the distinction between document- and app-basic has to be done // the distinction between document- and app-basic has to be done
// by checking the parent (as in ScInterpreter::ScMacro), not by looping // by checking the parent (as in ScInterpreter::ScMacro), not by looping
@ -311,9 +308,9 @@ sal_Bool ScValidationData::DoMacro( const ScAddress& rPos, const String& rInput,
SbxArrayRef refPar = new SbxArray; SbxArrayRef refPar = new SbxArray;
// 1) eingegebener / berechneter Wert // 1) eingegebener / berechneter Wert
String aValStr = rInput; OUString aValStr = rInput;
double nValue = 0.0; double nValue = 0.0;
sal_Bool bIsValue = false; bool bIsValue = false;
if ( pCell ) // wenn Zelle gesetzt, aus Interpret gerufen if ( pCell ) // wenn Zelle gesetzt, aus Interpret gerufen
{ {
bIsValue = pCell->IsValue(); bIsValue = pCell->IsValue();
@ -333,14 +330,14 @@ sal_Bool ScValidationData::DoMacro( const ScAddress& rPos, const String& rInput,
// use link-update flag to prevent closing the document // use link-update flag to prevent closing the document
// while the macro is running // while the macro is running
sal_Bool bWasInLinkUpdate = pDocument->IsInLinkUpdate(); bool bWasInLinkUpdate = pDocument->IsInLinkUpdate();
if ( !bWasInLinkUpdate ) if ( !bWasInLinkUpdate )
pDocument->SetInLinkUpdate( sal_True ); pDocument->SetInLinkUpdate( true );
if ( pCell ) if ( pCell )
pDocument->LockTable( rPos.Tab() ); pDocument->LockTable( rPos.Tab() );
SbxVariableRef refRes = new SbxVariable; SbxVariableRef refRes = new SbxVariable;
ErrCode eRet = pDocSh->CallBasic( aMacroStr, aBasicStr, refPar, refRes ); ErrCode eRet = pDocSh->CallBasic( aMacroStr.makeStringAndClear(), aBasicStr, refPar, refRes );
if ( pCell ) if ( pCell )
pDocument->UnlockTable( rPos.Tab() ); pDocument->UnlockTable( rPos.Tab() );
@ -349,8 +346,8 @@ sal_Bool ScValidationData::DoMacro( const ScAddress& rPos, const String& rInput,
// Eingabe abbrechen, wenn Basic-Makro sal_False zurueckgibt // Eingabe abbrechen, wenn Basic-Makro sal_False zurueckgibt
if ( eRet == ERRCODE_NONE && refRes->GetType() == SbxBOOL && refRes->GetBool() == false ) if ( eRet == ERRCODE_NONE && refRes->GetType() == SbxBOOL && refRes->GetBool() == false )
bRet = sal_True; bRet = true;
bDone = sal_True; bDone = true;
} }
#endif #endif
if ( !bDone && !pCell ) // Makro nicht gefunden (nur bei Eingabe) if ( !bDone && !pCell ) // Makro nicht gefunden (nur bei Eingabe)
@ -371,9 +368,9 @@ void ScValidationData::DoCalcError( ScFormulaCell* pCell ) const
DoMacro( pCell->aPos, EMPTY_STRING, pCell, NULL ); DoMacro( pCell->aPos, EMPTY_STRING, pCell, NULL );
} }
// sal_True -> Abbruch // true -> Abbruch
sal_Bool ScValidationData::DoError( Window* pParent, const String& rInput, bool ScValidationData::DoError( Window* pParent, const OUString& rInput,
const ScAddress& rPos ) const const ScAddress& rPos ) const
{ {
if ( eErrorStyle == SC_VALERR_MACRO ) if ( eErrorStyle == SC_VALERR_MACRO )
@ -381,11 +378,11 @@ sal_Bool ScValidationData::DoError( Window* pParent, const String& rInput,
// Fehlermeldung ausgeben // Fehlermeldung ausgeben
String aTitle = aErrorTitle; OUString aTitle = aErrorTitle;
if (!aTitle.Len()) if (aTitle.isEmpty())
aTitle = ScGlobal::GetRscString( STR_MSSG_DOSUBTOTALS_0 ); // application title aTitle = ScGlobal::GetRscString( STR_MSSG_DOSUBTOTALS_0 ); // application title
String aMessage = aErrorMessage; OUString aMessage = aErrorMessage;
if (!aMessage.Len()) if (aMessage.isEmpty())
aMessage = ScGlobal::GetRscString( STR_VALID_DEFERROR ); aMessage = ScGlobal::GetRscString( STR_VALID_DEFERROR );
//! ErrorBox / WarningBox / InfoBox ? //! ErrorBox / WarningBox / InfoBox ?
@ -420,7 +417,7 @@ bool ScValidationData::IsDataValid(
const OUString& rTest, const ScPatternAttr& rPattern, const ScAddress& rPos ) const const OUString& rTest, const ScPatternAttr& rPattern, const ScAddress& rPos ) const
{ {
if ( eDataMode == SC_VALID_ANY ) // check if any cell content is allowed if ( eDataMode == SC_VALID_ANY ) // check if any cell content is allowed
return sal_True; return true;
if (rTest.isEmpty()) // check whether empty cells are allowed if (rTest.isEmpty()) // check whether empty cells are allowed
return IsIgnoreBlank(); return IsIgnoreBlank();
@ -434,9 +431,9 @@ bool ScValidationData::IsDataValid(
// get the value if any // get the value if any
sal_uInt32 nFormat = rPattern.GetNumberFormat( pFormatter ); sal_uInt32 nFormat = rPattern.GetNumberFormat( pFormatter );
double nVal; double nVal;
sal_Bool bIsVal = pFormatter->IsNumberFormat( rTest, nFormat, nVal ); bool bIsVal = pFormatter->IsNumberFormat( rTest, nFormat, nVal );
sal_Bool bRet; bool bRet;
if (SC_VALID_TEXTLEN == eDataMode) if (SC_VALID_TEXTLEN == eDataMode)
{ {
double nLenVal; double nLenVal;
@ -561,9 +558,9 @@ public:
mrTokArr( rTokArr ), mbSkipEmpty( bSkipEmpty ), mbOk( true ) {} mrTokArr( rTokArr ), mbSkipEmpty( bSkipEmpty ), mbOk( true ) {}
/** Returns the string of the first string token or NULL on error or empty token array. */ /** Returns the string of the first string token or NULL on error or empty token array. */
const String* First(); const OUString* First();
/** Returns the string of the next string token or NULL on error or end of token array. */ /** Returns the string of the next string token or NULL on error or end of token array. */
const String* Next(); const OUString* Next();
/** Returns false, if a wrong token has been found. Does NOT return false on end of token array. */ /** Returns false, if a wrong token has been found. Does NOT return false on end of token array. */
inline bool Ok() const { return mbOk; } inline bool Ok() const { return mbOk; }
@ -574,14 +571,14 @@ private:
bool mbOk; /// true = correct token or end of token array. bool mbOk; /// true = correct token or end of token array.
}; };
const String* ScStringTokenIterator::First() const OUString* ScStringTokenIterator::First()
{ {
mrTokArr.Reset(); mrTokArr.Reset();
mbOk = true; mbOk = true;
return Next(); return Next();
} }
const String* ScStringTokenIterator::Next() const OUString* ScStringTokenIterator::Next()
{ {
if( !mbOk ) if( !mbOk )
return NULL; return NULL;
@ -592,9 +589,9 @@ const String* ScStringTokenIterator::Next()
pToken = mrTokArr.NextNoSpaces(); pToken = mrTokArr.NextNoSpaces();
mbOk = !pToken || (pToken->GetType() == formula::svString); mbOk = !pToken || (pToken->GetType() == formula::svString);
const String* pString = (mbOk && pToken) ? &pToken->GetString() : NULL; const OUString* pString = (mbOk && pToken) ? &pToken->GetString() : NULL;
// string found but empty -> get next token; otherwise return it // string found but empty -> get next token; otherwise return it
return (mbSkipEmpty && pString && !pString->Len()) ? Next() : pString; return (mbSkipEmpty && pString && pString->isEmpty()) ? Next() : pString;
} }
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
@ -650,7 +647,7 @@ bool ScValidationData::GetSelectionFromFormula(
if (nErrCode) if (nErrCode)
{ {
/* TODO : to use later in an alert box? /* TODO : to use later in an alert box?
* String rStrResult = "..."; * OUString rStrResult = "...";
* rStrResult += ScGlobal::GetLongErrorString(nErrCode); * rStrResult += ScGlobal::GetLongErrorString(nErrCode);
*/ */
@ -661,7 +658,7 @@ bool ScValidationData::GetSelectionFromFormula(
xMatRef->PutDouble( aValidationSrc.GetValue(), 0); xMatRef->PutDouble( aValidationSrc.GetValue(), 0);
else else
{ {
String aStr = aValidationSrc.GetString(); OUString aStr = aValidationSrc.GetString();
xMatRef->PutString( aStr, 0); xMatRef->PutString( aStr, 0);
} }
@ -721,7 +718,7 @@ bool ScValidationData::GetSelectionFromFormula(
{ {
ScTokenArray aCondTokArr; ScTokenArray aCondTokArr;
ScTypedStrData* pEntry = NULL; ScTypedStrData* pEntry = NULL;
String aValStr; OUString aValStr;
ScMatrixValue nMatVal = pValues->Get( nCol, nRow); ScMatrixValue nMatVal = pValues->Get( nCol, nRow);
// strings and empties // strings and empties
@ -806,7 +803,7 @@ bool ScValidationData::FillSelectionList(std::vector<ScTypedStrData>& rStrColl,
sal_uInt32 nFormat = lclGetCellFormat( *GetDocument(), rPos ); sal_uInt32 nFormat = lclGetCellFormat( *GetDocument(), rPos );
ScStringTokenIterator aIt( *pTokArr ); ScStringTokenIterator aIt( *pTokArr );
for( const String* pString = aIt.First(); pString && aIt.Ok(); pString = aIt.Next() ) for( const OUString* pString = aIt.First(); pString && aIt.Ok(); pString = aIt.Next() )
{ {
double fValue; double fValue;
bool bIsValue = GetDocument()->GetFormatTable()->IsNumberFormat( *pString, nFormat, fValue ); bool bIsValue = GetDocument()->GetFormatTable()->IsNumberFormat( *pString, nFormat, fValue );
@ -862,7 +859,7 @@ bool ScValidationData::IsListValid( ScRefCellValue& rCell, const ScAddress& rPos
sal_uInt32 nFormat = lclGetCellFormat( *GetDocument(), rPos ); sal_uInt32 nFormat = lclGetCellFormat( *GetDocument(), rPos );
ScStringTokenIterator aIt( *pTokArr ); ScStringTokenIterator aIt( *pTokArr );
for( const String* pString = aIt.First(); pString && aIt.Ok(); pString = aIt.Next() ) for( const OUString* pString = aIt.First(); pString && aIt.Ok(); pString = aIt.Next() )
{ {
/* Do not break the loop, if a valid string has been found. /* Do not break the loop, if a valid string has been found.
This is to find invalid tokens following in the formula. */ This is to find invalid tokens following in the formula. */
@ -966,7 +963,7 @@ void ScValidationDataList::UpdateMoveTab( sc::RefUpdateMoveTabContext& rCxt )
(*it)->UpdateMoveTab(rCxt); (*it)->UpdateMoveTab(rCxt);
} }
sal_Bool ScValidationDataList::operator==( const ScValidationDataList& r ) const bool ScValidationDataList::operator==( const ScValidationDataList& r ) const
{ {
// fuer Ref-Undo - interne Variablen werden nicht verglichen // fuer Ref-Undo - interne Variablen werden nicht verglichen

View File

@ -826,7 +826,7 @@ public:
sal_uInt16 GetError() const { return nGlobalError; } sal_uInt16 GetError() const { return nGlobalError; }
formula::StackVar GetResultType() const { return xResult->GetType(); } formula::StackVar GetResultType() const { return xResult->GetType(); }
const String& GetStringResult() const { return xResult->GetString(); } const OUString& GetStringResult() const { return xResult->GetString(); }
double GetNumResult() const { return xResult->GetDouble(); } double GetNumResult() const { return xResult->GetDouble(); }
formula::FormulaTokenRef GetResultToken() const { return xResult; } formula::FormulaTokenRef GetResultToken() const { return xResult; }
short GetRetFormatType() const { return nRetFmtType; } short GetRetFormatType() const { return nRetFmtType; }

View File

@ -279,8 +279,8 @@ bool ScFormulaResult::IsMultiline() const
{ {
if (meMultiline == MULTILINE_UNKNOWN) if (meMultiline == MULTILINE_UNKNOWN)
{ {
const String& rStr = GetString(); const OUString& rStr = GetString();
if (rStr.Len() && rStr.Search( '\n' ) != STRING_NOTFOUND) if (!rStr.isEmpty() && rStr.indexOf( '\n' ) != -1)
const_cast<ScFormulaResult*>(this)->meMultiline = MULTILINE_TRUE; const_cast<ScFormulaResult*>(this)->meMultiline = MULTILINE_TRUE;
else else
const_cast<ScFormulaResult*>(this)->meMultiline = MULTILINE_FALSE; const_cast<ScFormulaResult*>(this)->meMultiline = MULTILINE_FALSE;
@ -389,7 +389,7 @@ double ScFormulaResult::GetDouble() const
return mfValue; return mfValue;
} }
const String & ScFormulaResult::GetString() const const OUString & ScFormulaResult::GetString() const
{ {
if (mbToken && mpToken) if (mbToken && mpToken)
{ {
@ -441,8 +441,8 @@ void ScFormulaResult::SetHybridDouble( double f )
SetDouble(f); SetDouble(f);
else else
{ {
String aString( GetString()); OUString aString( GetString());
String aFormula( GetHybridFormula()); OUString aFormula( GetHybridFormula());
mpToken->DecRef(); mpToken->DecRef();
mpToken = new ScHybridCellToken( f, aString, aFormula); mpToken = new ScHybridCellToken( f, aString, aFormula);
mpToken->IncRef(); mpToken->IncRef();
@ -460,7 +460,7 @@ void ScFormulaResult::SetHybridString( const OUString & rStr )
{ {
// Obtain values before changing anything. // Obtain values before changing anything.
double f = GetDouble(); double f = GetDouble();
String aFormula( GetHybridFormula()); OUString aFormula( GetHybridFormula());
ResetToDefaults(); ResetToDefaults();
if (mbToken && mpToken) if (mbToken && mpToken)
mpToken->DecRef(); mpToken->DecRef();
@ -469,11 +469,11 @@ void ScFormulaResult::SetHybridString( const OUString & rStr )
mbToken = true; mbToken = true;
} }
void ScFormulaResult::SetHybridFormula( const String & rFormula ) void ScFormulaResult::SetHybridFormula( const OUString & rFormula )
{ {
// Obtain values before changing anything. // Obtain values before changing anything.
double f = GetDouble(); double f = GetDouble();
String aStr( GetString()); OUString aStr( GetString());
ResetToDefaults(); ResetToDefaults();
if (mbToken && mpToken) if (mbToken && mpToken)
mpToken->DecRef(); mpToken->DecRef();

View File

@ -105,7 +105,7 @@ void ScRefTokenHelper::compileRangeRepresentation(
bFailure = true; bFailure = true;
break; break;
case svString: case svString:
if (!pT->GetString().Len()) if (pT->GetString().isEmpty())
bFailure = true; bFailure = true;
break; break;
default: default:
@ -320,7 +320,7 @@ private:
// Get the information of the new token. // Get the information of the new token.
bool bExternal = ScRefTokenHelper::isExternalRef(pToken); bool bExternal = ScRefTokenHelper::isExternalRef(pToken);
sal_uInt16 nFileId = bExternal ? pToken->GetIndex() : 0; sal_uInt16 nFileId = bExternal ? pToken->GetIndex() : 0;
String aTabName = bExternal ? pToken->GetString() : String(); OUString aTabName = bExternal ? pToken->GetString() : OUString();
bool bJoined = false; bool bJoined = false;
vector<ScTokenRef>::iterator itr = rTokens.begin(), itrEnd = rTokens.end(); vector<ScTokenRef>::iterator itr = rTokens.begin(), itrEnd = rTokens.end();

View File

@ -233,7 +233,7 @@ void ScRawToken::SetName(bool bGlobal, sal_uInt16 nIndex)
name.nIndex = nIndex; name.nIndex = nIndex;
} }
void ScRawToken::SetExternalSingleRef( sal_uInt16 nFileId, const String& rTabName, const ScSingleRefData& rRef ) void ScRawToken::SetExternalSingleRef( sal_uInt16 nFileId, const OUString& rTabName, const ScSingleRefData& rRef )
{ {
eOp = ocPush; eOp = ocPush;
eType = svExternalSingleRef; eType = svExternalSingleRef;
@ -243,12 +243,12 @@ void ScRawToken::SetExternalSingleRef( sal_uInt16 nFileId, const String& rTabNam
extref.aRef.Ref1 = extref.aRef.Ref1 =
extref.aRef.Ref2 = rRef; extref.aRef.Ref2 = rRef;
xub_StrLen n = rTabName.Len(); sal_Int32 n = rTabName.getLength();
memcpy(extref.cTabName, rTabName.GetBuffer(), n*sizeof(sal_Unicode)); memcpy(extref.cTabName, rTabName.getStr(), n*sizeof(sal_Unicode));
extref.cTabName[n] = 0; extref.cTabName[n] = 0;
} }
void ScRawToken::SetExternalDoubleRef( sal_uInt16 nFileId, const String& rTabName, const ScComplexRefData& rRef ) void ScRawToken::SetExternalDoubleRef( sal_uInt16 nFileId, const OUString& rTabName, const ScComplexRefData& rRef )
{ {
eOp = ocPush; eOp = ocPush;
eType = svExternalDoubleRef; eType = svExternalDoubleRef;
@ -257,12 +257,12 @@ void ScRawToken::SetExternalDoubleRef( sal_uInt16 nFileId, const String& rTabNam
extref.nFileId = nFileId; extref.nFileId = nFileId;
extref.aRef = rRef; extref.aRef = rRef;
xub_StrLen n = rTabName.Len(); sal_Int32 n = rTabName.getLength();
memcpy(extref.cTabName, rTabName.GetBuffer(), n*sizeof(sal_Unicode)); memcpy(extref.cTabName, rTabName.getStr(), n*sizeof(sal_Unicode));
extref.cTabName[n] = 0; extref.cTabName[n] = 0;
} }
void ScRawToken::SetExternalName( sal_uInt16 nFileId, const String& rName ) void ScRawToken::SetExternalName( sal_uInt16 nFileId, const OUString& rName )
{ {
eOp = ocPush; eOp = ocPush;
eType = svExternalName; eType = svExternalName;
@ -270,8 +270,8 @@ void ScRawToken::SetExternalName( sal_uInt16 nFileId, const String& rName )
extname.nFileId = nFileId; extname.nFileId = nFileId;
xub_StrLen n = rName.Len(); sal_Int32 n = rName.getLength();
memcpy(extname.cName, rName.GetBuffer(), n*sizeof(sal_Unicode)); memcpy(extname.cName, rName.getStr(), n*sizeof(sal_Unicode));
extname.cName[n] = 0; extname.cName[n] = 0;
} }
@ -854,7 +854,7 @@ FormulaToken* ScMatrixRangeToken::Clone() const
// ============================================================================ // ============================================================================
ScExternalSingleRefToken::ScExternalSingleRefToken( sal_uInt16 nFileId, const String& rTabName, const ScSingleRefData& r ) : ScExternalSingleRefToken::ScExternalSingleRefToken( sal_uInt16 nFileId, const OUString& rTabName, const ScSingleRefData& r ) :
ScToken( svExternalSingleRef, ocPush), ScToken( svExternalSingleRef, ocPush),
mnFileId(nFileId), mnFileId(nFileId),
maTabName(rTabName), maTabName(rTabName),
@ -879,7 +879,7 @@ sal_uInt16 ScExternalSingleRefToken::GetIndex() const
return mnFileId; return mnFileId;
} }
const String& ScExternalSingleRefToken::GetString() const const OUString& ScExternalSingleRefToken::GetString() const
{ {
return maTabName; return maTabName;
} }
@ -910,7 +910,7 @@ bool ScExternalSingleRefToken::operator ==( const FormulaToken& r ) const
// ============================================================================ // ============================================================================
ScExternalDoubleRefToken::ScExternalDoubleRefToken( sal_uInt16 nFileId, const String& rTabName, const ScComplexRefData& r ) : ScExternalDoubleRefToken::ScExternalDoubleRefToken( sal_uInt16 nFileId, const OUString& rTabName, const ScComplexRefData& r ) :
ScToken( svExternalDoubleRef, ocPush), ScToken( svExternalDoubleRef, ocPush),
mnFileId(nFileId), mnFileId(nFileId),
maTabName(rTabName), maTabName(rTabName),
@ -935,7 +935,7 @@ sal_uInt16 ScExternalDoubleRefToken::GetIndex() const
return mnFileId; return mnFileId;
} }
const String& ScExternalDoubleRefToken::GetString() const const OUString& ScExternalDoubleRefToken::GetString() const
{ {
return maTabName; return maTabName;
} }
@ -986,7 +986,7 @@ bool ScExternalDoubleRefToken::operator ==( const FormulaToken& r ) const
// ============================================================================ // ============================================================================
ScExternalNameToken::ScExternalNameToken( sal_uInt16 nFileId, const String& rName ) : ScExternalNameToken::ScExternalNameToken( sal_uInt16 nFileId, const OUString& rName ) :
ScToken( svExternalName, ocPush), ScToken( svExternalName, ocPush),
mnFileId(nFileId), mnFileId(nFileId),
maName(rName) maName(rName)
@ -1007,7 +1007,7 @@ sal_uInt16 ScExternalNameToken::GetIndex() const
return mnFileId; return mnFileId;
} }
const String& ScExternalNameToken::GetString() const const OUString& ScExternalNameToken::GetString() const
{ {
return maName; return maName;
} }
@ -1020,19 +1020,8 @@ bool ScExternalNameToken::operator==( const FormulaToken& r ) const
if (mnFileId != r.GetIndex()) if (mnFileId != r.GetIndex())
return false; return false;
xub_StrLen nLen = maName.Len(); const OUString& rName = r.GetString();
const String& rName = r.GetString(); return maName == rName;
if (nLen != rName.Len())
return false;
const sal_Unicode* p1 = maName.GetBuffer();
const sal_Unicode* p2 = rName.GetBuffer();
for (xub_StrLen j = 0; j < nLen; ++j)
{
if (p1[j] != p2[j])
return false;
}
return true;
} }
// ============================================================================ // ============================================================================
@ -1048,9 +1037,9 @@ ScJumpMatrixToken::~ScJumpMatrixToken()
} }
double ScEmptyCellToken::GetDouble() const { return 0.0; } double ScEmptyCellToken::GetDouble() const { return 0.0; }
const String & ScEmptyCellToken::GetString() const const OUString & ScEmptyCellToken::GetString() const
{ {
static String aDummyString; static OUString aDummyString;
return aDummyString; return aDummyString;
} }
bool ScEmptyCellToken::operator==( const FormulaToken& r ) const bool ScEmptyCellToken::operator==( const FormulaToken& r ) const
@ -1067,7 +1056,7 @@ ScMatrixCellResultToken::ScMatrixCellResultToken( const ScMatrixCellResultToken&
ScToken(r), xMatrix(r.xMatrix), xUpperLeft(r.xUpperLeft) {} ScToken(r), xMatrix(r.xMatrix), xUpperLeft(r.xUpperLeft) {}
double ScMatrixCellResultToken::GetDouble() const { return xUpperLeft->GetDouble(); } double ScMatrixCellResultToken::GetDouble() const { return xUpperLeft->GetDouble(); }
const String & ScMatrixCellResultToken::GetString() const { return xUpperLeft->GetString(); } const OUString & ScMatrixCellResultToken::GetString() const { return xUpperLeft->GetString(); }
const ScMatrix* ScMatrixCellResultToken::GetMatrix() const { return xMatrix.get(); } const ScMatrix* ScMatrixCellResultToken::GetMatrix() const { return xMatrix.get(); }
// Non-const GetMatrix() is private and unused but must be implemented to // Non-const GetMatrix() is private and unused but must be implemented to
// satisfy vtable linkage. // satisfy vtable linkage.
@ -1174,7 +1163,7 @@ void ScMatrixFormulaCellToken::ResetResult()
double ScHybridCellToken::GetDouble() const { return mfDouble; } double ScHybridCellToken::GetDouble() const { return mfDouble; }
const String& ScHybridCellToken::GetString() const { return maString; } const OUString& ScHybridCellToken::GetString() const { return maString; }
bool ScHybridCellToken::operator==( const FormulaToken& r ) const bool ScHybridCellToken::operator==( const FormulaToken& r ) const
{ {
return FormulaToken::operator==( r ) && return FormulaToken::operator==( r ) &&
@ -1251,8 +1240,8 @@ bool ScTokenArray::AddFormulaToken(const com::sun::star::sheet::FormulaToken& _a
{ {
// try to resolve cache index to sheet name // try to resolve cache index to sheet name
size_t nCacheId = static_cast< size_t >( aApiSRef.Sheet ); size_t nCacheId = static_cast< size_t >( aApiSRef.Sheet );
String aTabName = _pRef->getCacheTableName( nFileId, nCacheId ); OUString aTabName = _pRef->getCacheTableName( nFileId, nCacheId );
if( aTabName.Len() > 0 ) if( !aTabName.isEmpty() )
{ {
ScSingleRefData aSingleRef; ScSingleRefData aSingleRef;
// convert column/row settings, set sheet index to absolute // convert column/row settings, set sheet index to absolute
@ -1266,8 +1255,8 @@ bool ScTokenArray::AddFormulaToken(const com::sun::star::sheet::FormulaToken& _a
{ {
// try to resolve cache index to sheet name. // try to resolve cache index to sheet name.
size_t nCacheId = static_cast< size_t >( aApiCRef.Reference1.Sheet ); size_t nCacheId = static_cast< size_t >( aApiCRef.Reference1.Sheet );
String aTabName = _pRef->getCacheTableName( nFileId, nCacheId ); OUString aTabName = _pRef->getCacheTableName( nFileId, nCacheId );
if( aTabName.Len() > 0 ) if( !aTabName.isEmpty() )
{ {
ScComplexRefData aComplRef; ScComplexRefData aComplRef;
// convert column/row settings, set sheet index to absolute // convert column/row settings, set sheet index to absolute
@ -1478,7 +1467,7 @@ void ScTokenArray::GenHash()
case svString: case svString:
{ {
// Constant string. // Constant string.
const String& rStr = p->GetString(); const OUString& rStr = p->GetString();
nHash += aHasher(rStr); nHash += aHasher(rStr);
} }
break; break;
@ -1902,17 +1891,17 @@ FormulaToken* ScTokenArray::AddDBRange( sal_uInt16 n )
return Add( new FormulaIndexToken( ocDBArea, n)); return Add( new FormulaIndexToken( ocDBArea, n));
} }
FormulaToken* ScTokenArray::AddExternalName( sal_uInt16 nFileId, const String& rName ) FormulaToken* ScTokenArray::AddExternalName( sal_uInt16 nFileId, const OUString& rName )
{ {
return Add( new ScExternalNameToken(nFileId, rName) ); return Add( new ScExternalNameToken(nFileId, rName) );
} }
FormulaToken* ScTokenArray::AddExternalSingleReference( sal_uInt16 nFileId, const String& rTabName, const ScSingleRefData& rRef ) FormulaToken* ScTokenArray::AddExternalSingleReference( sal_uInt16 nFileId, const OUString& rTabName, const ScSingleRefData& rRef )
{ {
return Add( new ScExternalSingleRefToken(nFileId, rTabName, rRef) ); return Add( new ScExternalSingleRefToken(nFileId, rTabName, rRef) );
} }
FormulaToken* ScTokenArray::AddExternalDoubleReference( sal_uInt16 nFileId, const String& rTabName, const ScComplexRefData& rRef ) FormulaToken* ScTokenArray::AddExternalDoubleReference( sal_uInt16 nFileId, const OUString& rTabName, const ScComplexRefData& rRef )
{ {
return Add( new ScExternalDoubleRefToken(nFileId, rTabName, rRef) ); return Add( new ScExternalDoubleRefToken(nFileId, rTabName, rRef) );
} }

View File

@ -1476,13 +1476,13 @@ XclExpDV::XclExpDV( const XclExpRoot& rRoot, sal_uLong nScHandle ) :
if( const ScValidationData* pValData = GetDoc().GetValidationEntry( mnScHandle ) ) if( const ScValidationData* pValData = GetDoc().GetValidationEntry( mnScHandle ) )
{ {
// prompt box - empty string represented by single NUL character // prompt box - empty string represented by single NUL character
String aTitle, aText; OUString aTitle, aText;
bool bShowPrompt = (pValData->GetInput( aTitle, aText ) == sal_True); bool bShowPrompt = (pValData->GetInput( aTitle, aText ) == sal_True);
if( aTitle.Len() ) if( !aTitle.isEmpty() )
maPromptTitle.Assign( aTitle ); maPromptTitle.Assign( aTitle );
else else
maPromptTitle.Assign( '\0' ); maPromptTitle.Assign( '\0' );
if( aText.Len() ) if( !aText.isEmpty() )
maPromptText.Assign( aText ); maPromptText.Assign( aText );
else else
maPromptText.Assign( '\0' ); maPromptText.Assign( '\0' );
@ -1490,11 +1490,11 @@ XclExpDV::XclExpDV( const XclExpRoot& rRoot, sal_uLong nScHandle ) :
// error box - empty string represented by single NUL character // error box - empty string represented by single NUL character
ScValidErrorStyle eScErrorStyle; ScValidErrorStyle eScErrorStyle;
bool bShowError = (pValData->GetErrMsg( aTitle, aText, eScErrorStyle ) == sal_True); bool bShowError = (pValData->GetErrMsg( aTitle, aText, eScErrorStyle ) == sal_True);
if( aTitle.Len() ) if( !aTitle.isEmpty() )
maErrorTitle.Assign( aTitle ); maErrorTitle.Assign( aTitle );
else else
maErrorTitle.Assign( '\0' ); maErrorTitle.Assign( '\0' );
if( aText.Len() ) if( !aText.isEmpty() )
maErrorText.Assign( aText ); maErrorText.Assign( aText );
else else
maErrorText.Assign( '\0' ); maErrorText.Assign( '\0' );

View File

@ -1281,7 +1281,7 @@ void XclExpXct::Save( XclExpStream& rStrm )
break; break;
case svString: case svString:
// do not save empty strings (empty cells) to cache // do not save empty strings (empty cells) to cache
if( xToken->GetString().Len() > 0 ) if( !xToken->GetString().isEmpty() )
bValid = aCrnRecs.InsertValue( nScCol, nScRow, Any( OUString( xToken->GetString() ) ) ); bValid = aCrnRecs.InsertValue( nScCol, nScRow, Any( OUString( xToken->GetString() ) ) );
break; break;
default: default:

View File

@ -732,7 +732,7 @@ void Chart2Positioner::createPositionMap()
bool bExternal = ScRefTokenHelper::isExternalRef(pToken); bool bExternal = ScRefTokenHelper::isExternalRef(pToken);
sal_uInt16 nFileId = bExternal ? pToken->GetIndex() : 0; sal_uInt16 nFileId = bExternal ? pToken->GetIndex() : 0;
String aTabName = bExternal ? pToken->GetString() : String(); OUString aTabName = bExternal ? pToken->GetString() : OUString();
ScComplexRefData aData; ScComplexRefData aData;
if( !ScRefTokenHelper::getDoubleRefDataFromToken(aData, *itr) ) if( !ScRefTokenHelper::getDoubleRefDataFromToken(aData, *itr) )
@ -960,7 +960,7 @@ private:
return false; return false;
bool bExternal = ScRefTokenHelper::isExternalRef(pToken); bool bExternal = ScRefTokenHelper::isExternalRef(pToken);
sal_uInt16 nFileId = bExternal ? pToken->GetIndex() : 0; sal_uInt16 nFileId = bExternal ? pToken->GetIndex() : 0;
String aTabName = bExternal ? pToken->GetString() : String(); OUString aTabName = bExternal ? pToken->GetString() : OUString();
// In saving to XML, we don't prepend address with '$'. // In saving to XML, we don't prepend address with '$'.
setRelative(aData.Ref1); setRelative(aData.Ref1);

View File

@ -624,7 +624,7 @@ ScTableValidationObj::ScTableValidationObj(ScDocument* pDoc, sal_uLong nKey,
{ {
// Eintrag aus dem Dokument lesen... // Eintrag aus dem Dokument lesen...
sal_Bool bFound = false; bool bFound = false;
if ( pDoc && nKey ) if ( pDoc && nKey )
{ {
const ScValidationData* pData = pDoc->GetValidationEntry( nKey ); const ScValidationData* pData = pDoc->GetValidationEntry( nKey );
@ -650,7 +650,7 @@ ScTableValidationObj::ScTableValidationObj(ScDocument* pDoc, sal_uLong nKey,
if (nValMode != SC_VALID_ANY && pDoc->IsInExternalReferenceMarking()) if (nValMode != SC_VALID_ANY && pDoc->IsInExternalReferenceMarking())
pData->MarkUsedExternalReferences(); pData->MarkUsedExternalReferences();
bFound = sal_True; bFound = true;
} }
} }
if (!bFound) if (!bFound)
@ -716,10 +716,10 @@ void ScTableValidationObj::ClearData_Impl()
maExprNmsp1.Erase(); maExprNmsp1.Erase();
maExprNmsp2.Erase(); maExprNmsp2.Erase();
meGrammar1 = meGrammar2 = FormulaGrammar::GRAM_UNSPECIFIED; // will be overriden when needed meGrammar1 = meGrammar2 = FormulaGrammar::GRAM_UNSPECIFIED; // will be overriden when needed
aInputTitle.Erase(); aInputTitle = OUString();
aInputMessage.Erase(); aInputMessage = OUString();
aErrorTitle.Erase(); aErrorTitle = OUString();
aErrorMessage.Erase(); aErrorMessage = OUString();
} }
ScTableValidationObj::~ScTableValidationObj() ScTableValidationObj::~ScTableValidationObj()

View File

@ -755,10 +755,10 @@ void ScCellShell::ExecuteDB( SfxRequest& rReq )
sal_Bool bBlank = sal_True; sal_Bool bBlank = sal_True;
sal_Int16 nListType = ValidListType::UNSORTED; sal_Int16 nListType = ValidListType::UNSORTED;
sal_Bool bShowHelp = false; sal_Bool bShowHelp = false;
String aHelpTitle, aHelpText; OUString aHelpTitle, aHelpText;
sal_Bool bShowError = false; sal_Bool bShowError = false;
ScValidErrorStyle eErrStyle = SC_VALERR_STOP; ScValidErrorStyle eErrStyle = SC_VALERR_STOP;
String aErrTitle, aErrText; OUString aErrTitle, aErrText;
ScDocument* pDoc = GetViewData()->GetDocument(); ScDocument* pDoc = GetViewData()->GetDocument();
SCCOL nCurX = GetViewData()->GetCurX(); SCCOL nCurX = GetViewData()->GetCurX();

View File

@ -615,8 +615,8 @@ void ScTabView::TestHintWindow()
{ {
const ScValidationData* pData = pDoc->GetValidationEntry( pItem->GetValue() ); const ScValidationData* pData = pDoc->GetValidationEntry( pItem->GetValue() );
OSL_ENSURE(pData,"ValidationData nicht gefunden"); OSL_ENSURE(pData,"ValidationData nicht gefunden");
String aTitle, aMessage; OUString aTitle, aMessage;
if ( pData && pData->GetInput( aTitle, aMessage ) && aMessage.Len() > 0 ) if ( pData && pData->GetInput( aTitle, aMessage ) && !aMessage.isEmpty() )
{ {
//! Abfrage, ob an gleicher Stelle !!!! //! Abfrage, ob an gleicher Stelle !!!!