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() ...@@ -1299,7 +1299,7 @@ void ScInputHandler::PasteFunctionData()
// Selektion berechnen und als Tip-Hilfe anzeigen // 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 !!!! //! mit ScFormulaDlg::CalcValue zusammenfassen und ans Dokument verschieben !!!!
//! (Anfuehrungszeichen bei Strings werden nur hier eingefuegt) //! (Anfuehrungszeichen bei Strings werden nur hier eingefuegt)
...@@ -1331,43 +1331,37 @@ static String lcl_Calculate( const OUString& rFormula, ScDocument* pDoc, const S ...@@ -1331,43 +1331,37 @@ static String lcl_Calculate( const OUString& rFormula, ScDocument* pDoc, const S
} }
sal_uInt16 nErrCode = pCell->GetErrCode(); sal_uInt16 nErrCode = pCell->GetErrCode();
if ( nErrCode == 0 ) if ( nErrCode != 0 )
return ScGlobal::GetErrorString(nErrCode);
SvNumberFormatter& aFormatter = *(pDoc->GetFormatTable());
OUString aValue;
if ( pCell->IsValue() )
{ {
SvNumberFormatter& aFormatter = *(pDoc->GetFormatTable()); double n = pCell->GetValue();
Color* pColor; sal_uLong nFormat = aFormatter.GetStandardFormat( n, 0,
if ( pCell->IsValue() ) pCell->GetFormatType(), ScGlobal::eLnge );
{ aFormatter.GetInputLineString( n, nFormat, aValue );
double n = pCell->GetValue(); //! display OutputString but insert InputLineString
sal_uLong nFormat = aFormatter.GetStandardFormat( n, 0, }
pCell->GetFormatType(), ScGlobal::eLnge ); else
aFormatter.GetInputLineString( n, nFormat, aValue ); {
//! display OutputString but insert InputLineString OUString aStr = pCell->GetString();
} sal_uLong nFormat = aFormatter.GetStandardFormat(
else pCell->GetFormatType(), ScGlobal::eLnge);
{ {
String aStr = pCell->GetString(); Color* pColor;
sal_uLong nFormat = aFormatter.GetStandardFormat( aFormatter.GetOutputString( aStr, nFormat,
pCell->GetFormatType(), ScGlobal::eLnge); aValue, &pColor );
{
OUString sTempIn(aStr);
OUString sTempOut(aValue);
aFormatter.GetOutputString( sTempIn, nFormat,
sTempOut, &pColor );
aStr = sTempIn;
aValue = sTempOut;
}
aValue.Insert('"',0); // in Anfuehrungszeichen
aValue+='"';
//! Anfuehrungszeichen im String escapen ????
} }
ScRange aTestRange; aValue = "\"" + aValue + "\"";
if ( bColRowName || (aTestRange.Parse(rFormula) & SCA_VALID) ) //! Anfuehrungszeichen im String escapen ????
aValue.AppendAscii(RTL_CONSTASCII_STRINGPARAM( " ..." )); // Bereich
} }
else
aValue = ScGlobal::GetErrorString(nErrCode); ScRange aTestRange;
if ( bColRowName || (aTestRange.Parse(rFormula) & SCA_VALID) )
aValue = aValue + " ...";
return 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