From 271b11a3d56ba0c5f542a142ab859a0819530dba Mon Sep 17 00:00:00 2001 From: Norbert Thiebaud Date: Sun, 18 Nov 2012 18:55:49 -0600 Subject: migrate one GetOutputString variatn to OUString that create some clutter on some of the caller, this will be resolved as things progress to ward OUString only This is done that way to be incremental and avoid creating too big patches Change-Id: I4a881d85cc2ee1eb53bc0c0d0902838b1d3720a2 --- svtools/source/control/fmtfield.cxx | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) (limited to 'svtools') diff --git a/svtools/source/control/fmtfield.cxx b/svtools/source/control/fmtfield.cxx index 3bfa00a81b3f..2d1445f9b38e 100644 --- a/svtools/source/control/fmtfield.cxx +++ b/svtools/source/control/fmtfield.cxx @@ -413,9 +413,17 @@ void FormattedField::SetTextFormatted(const OUString& rStr) sal_uInt32 nTempFormatKey = static_cast< sal_uInt32 >( m_nFormatKey ); if( IsUsingInputStringForFormatting() && ImplGetFormatter()->IsNumberFormat(m_sCurrentTextValue, nTempFormatKey, dNumber) ) + { ImplGetFormatter()->GetInputLineString(dNumber, m_nFormatKey, sFormatted); + } else - ImplGetFormatter()->GetOutputString(m_sCurrentTextValue, m_nFormatKey, sFormatted, &m_pLastOutputColor); + { + OUString sTempIn(m_sCurrentTextValue); + OUString sTempOut(sFormatted); + ImplGetFormatter()->GetOutputString(sTempIn, m_nFormatKey, sTempOut, &m_pLastOutputColor); + m_sCurrentTextValue = sTempIn; + sFormatted = sTempOut; + } // calculate the new selection Selection aSel(GetSelection()); @@ -956,14 +964,23 @@ void FormattedField::ImplSetValue(double dVal, sal_Bool bForce) String sTemp; ImplGetFormatter()->GetOutputString(dVal, 0, sTemp, &m_pLastOutputColor); // dann den String entsprechend dem Text-Format - ImplGetFormatter()->GetOutputString(sTemp, m_nFormatKey, sNewText, &m_pLastOutputColor); + { + OUString sTempIn(m_sCurrentTextValue); + OUString sTempOut; + ImplGetFormatter()->GetOutputString(sTempIn, m_nFormatKey, sTempOut, &m_pLastOutputColor); + sNewText = sTempOut; + } } else { if( IsUsingInputStringForFormatting()) + { ImplGetFormatter()->GetInputLineString(dVal, m_nFormatKey, sNewText); + } else + { ImplGetFormatter()->GetOutputString(dVal, m_nFormatKey, sNewText, &m_pLastOutputColor); + } } ImplSetTextImpl(sNewText, NULL); -- cgit