summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2017-07-05 18:52:14 +0200
committerEike Rathke <erack@redhat.com>2017-07-05 18:54:42 +0200
commit14f562b109042ebde90261f93952b4c730e1427d (patch)
tree13f34f9f042a359733de1bbaefd9d65d93f898b4 /sc
parent6865f4618b6ddcc7dd5688e64e9cdd3f3064dea7 (diff)
Display string results in the Function Wizard quoted
To distinguish number strings from numeric results. Change-Id: I68e044e839b2d5d2e87835dd0002f42aa0fc8192
Diffstat (limited to 'sc')
-rw-r--r--sc/source/ui/formdlg/formula.cxx14
1 files changed, 11 insertions, 3 deletions
diff --git a/sc/source/ui/formdlg/formula.cxx b/sc/source/ui/formdlg/formula.cxx
index bdd9d25e2ba0..ac8b3369fe4a 100644
--- a/sc/source/ui/formdlg/formula.cxx
+++ b/sc/source/ui/formdlg/formula.cxx
@@ -338,13 +338,16 @@ bool ScFormulaDlg::calculateValue( const OUString& rStrExp, OUString& rStrResult
{
SvNumberFormatter& aFormatter = *(m_pDoc->GetFormatTable());
Color* pColor;
- if ( pFCell->IsValue() )
+ if (pFCell->IsMatrix())
+ {
+ rStrResult = pFCell->GetString().getString();
+ }
+ else if (pFCell->IsValue())
{
double n = pFCell->GetValue();
sal_uLong nFormat = aFormatter.GetStandardFormat( n, 0,
pFCell->GetFormatType(), ScGlobal::eLnge );
- aFormatter.GetOutputString( n, nFormat,
- rStrResult, &pColor );
+ aFormatter.GetOutputString( n, nFormat, rStrResult, &pColor );
}
else
{
@@ -352,6 +355,11 @@ bool ScFormulaDlg::calculateValue( const OUString& rStrExp, OUString& rStrResult
pFCell->GetFormatType(), ScGlobal::eLnge);
aFormatter.GetOutputString( pFCell->GetString().getString(), nFormat,
rStrResult, &pColor );
+ // Indicate it's a string, so a number string doesn't look numeric.
+ // Escape embedded quotation marks first by doubling them, as
+ // usual. Actually the result can be copy-pasted from the result
+ // box as literal into a formula expression.
+ rStrResult = "\"" + rStrResult.replaceAll( "\"", "\"\"") + "\"";
}
ScRange aTestRange;