diff options
author | Vladimir Glazounov <vg@openoffice.org> | 2005-03-08 10:30:53 +0000 |
---|---|---|
committer | Vladimir Glazounov <vg@openoffice.org> | 2005-03-08 10:30:53 +0000 |
commit | 3e85af04239f571395aac4e3f7afc999b90b2f3f (patch) | |
tree | 48c5217a8709fee480ff1ae77c8763c2d03cacbd /sc | |
parent | d241eaab25a7064c1460a061ed40e2d21de1aed0 (diff) |
INTEGRATION: CWS calcer (1.9.52); FILE MERGED
2004/11/23 20:18:20 er 1.9.52.2: #i36541# #i37631# generic GetString with EmptyPath and setting error at interpreter
2004/11/16 18:25:34 er 1.9.52.1: #i36541# generic ScMatrix::GetString() also for numerical values
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/core/tool/scmatrix.cxx | 65 |
1 files changed, 55 insertions, 10 deletions
diff --git a/sc/source/core/tool/scmatrix.cxx b/sc/source/core/tool/scmatrix.cxx index 815bfb7600a8..9ed14810c21d 100644 --- a/sc/source/core/tool/scmatrix.cxx +++ b/sc/source/core/tool/scmatrix.cxx @@ -2,9 +2,9 @@ * * $RCSfile: scmatrix.cxx,v $ * - * $Revision: 1.9 $ + * $Revision: 1.10 $ * - * last change: $Author: rt $ $Date: 2004-10-22 07:59:55 $ + * last change: $Author: vg $ $Date: 2005-03-08 11:30:53 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -59,14 +59,6 @@ * ************************************************************************/ -#ifdef PCH -#include "core_pch.hxx" -#endif - -#pragma hdrstop - -//------------------------------------------------------------------------ - #include <tools/debug.hxx> #include <math.h> @@ -76,6 +68,10 @@ #include "errorcodes.hxx" #include "interpre.hxx" +#ifndef _ZFORLIST_HXX +#include <svtools/zforlist.hxx> +#endif + #ifndef _STREAM_HXX //autogen #include <tools/stream.hxx> #endif @@ -399,13 +395,62 @@ const String& ScMatrix::GetString(SCSIZE nC, SCSIZE nR) const if ( IsString( nIndex ) ) return GetString( nIndex ); else + { + SetErrorAtInterpreter( GetError( nIndex)); DBG_ERRORFILE("ScMatrix::GetString: access error, no string"); + } } else DBG_ERRORFILE("ScMatrix::GetString: dimension error"); return ScGlobal::GetEmptyString(); } + +String ScMatrix::GetString( SvNumberFormatter& rFormatter, SCSIZE nIndex) const +{ + if (IsString( nIndex)) + { + if (IsEmptyPath( nIndex)) + { // result of empty FALSE jump path + ULONG nKey = rFormatter.GetStandardFormat( NUMBERFORMAT_LOGICAL, + ScGlobal::eLnge); + String aStr; + Color* pColor = NULL; + rFormatter.GetOutputString( 0.0, nKey, aStr, &pColor); + return aStr; + } + return GetString( nIndex ); + } + + USHORT nError = GetError( nIndex); + if (nError) + { + SetErrorAtInterpreter( nError); + return ScGlobal::GetErrorString( nError); + } + + double fVal= GetDouble( nIndex); + ULONG nKey = rFormatter.GetStandardFormat( NUMBERFORMAT_NUMBER, + ScGlobal::eLnge); + String aStr; + rFormatter.GetInputLineString( fVal, nKey, aStr); + return aStr; +} + + +String ScMatrix::GetString( SvNumberFormatter& rFormatter, SCSIZE nC, SCSIZE nR) const +{ + if (ValidColRow( nC, nR)) + { + SCSIZE nIndex = CalcOffset( nC, nR); + return GetString( rFormatter, nIndex); + } + else + DBG_ERRORFILE("ScMatrix::GetString: dimension error"); + return String(); +} + + const ScMatrixValue* ScMatrix::Get(SCSIZE nC, SCSIZE nR, ScMatValType& nType) const { if (ValidColRow( nC, nR)) |