Kaydet (Commit) 7978c786 authored tarafından Markus Mohrhard's avatar Markus Mohrhard

more String->OUString and early bail outs

Change-Id: Ia573f27962b5fbb48e543a2e2a802e85db36fafd
üst 737fbae8
......@@ -1299,7 +1299,7 @@ void ScInputHandler::PasteFunctionData()
// Selektion berechnen und als Tip-Hilfe anzeigen
//
static String lcl_Calculate( const OUString& rFormula, ScDocument* pDoc, const ScAddress &rPos )
static OUString lcl_Calculate( const OUString& rFormula, ScDocument* pDoc, const ScAddress &rPos )
{
//! mit ScFormulaDlg::CalcValue zusammenfassen und ans Dokument verschieben !!!!
//! (Anfuehrungszeichen bei Strings werden nur hier eingefuegt)
......@@ -1331,10 +1331,11 @@ static String lcl_Calculate( const OUString& rFormula, ScDocument* pDoc, const S
}
sal_uInt16 nErrCode = pCell->GetErrCode();
if ( nErrCode == 0 )
{
if ( nErrCode != 0 )
return ScGlobal::GetErrorString(nErrCode);
SvNumberFormatter& aFormatter = *(pDoc->GetFormatTable());
Color* pColor;
OUString aValue;
if ( pCell->IsValue() )
{
double n = pCell->GetValue();
......@@ -1345,29 +1346,22 @@ static String lcl_Calculate( const OUString& rFormula, ScDocument* pDoc, const S
}
else
{
String aStr = pCell->GetString();
OUString aStr = pCell->GetString();
sal_uLong nFormat = aFormatter.GetStandardFormat(
pCell->GetFormatType(), ScGlobal::eLnge);
{
OUString sTempIn(aStr);
OUString sTempOut(aValue);
aFormatter.GetOutputString( sTempIn, nFormat,
sTempOut, &pColor );
aStr = sTempIn;
aValue = sTempOut;
Color* pColor;
aFormatter.GetOutputString( aStr, nFormat,
aValue, &pColor );
}
aValue.Insert('"',0); // in Anfuehrungszeichen
aValue+='"';
aValue = "\"" + aValue + "\"";
//! Anfuehrungszeichen im String escapen ????
}
ScRange aTestRange;
if ( bColRowName || (aTestRange.Parse(rFormula) & SCA_VALID) )
aValue.AppendAscii(RTL_CONSTASCII_STRINGPARAM( " ..." )); // Bereich
}
else
aValue = ScGlobal::GetErrorString(nErrCode);
aValue = aValue + " ...";
return aValue;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment