Kaydet (Commit) 282395aa authored tarafından Eike Rathke's avatar Eike Rathke

SvxDoubleItem::GetPresentation: if really needed do it with IntlWrapper and SolarMath

üst df555ecf
......@@ -2,9 +2,9 @@
*
* $RCSfile: chrtitem.cxx,v $
*
* $Revision: 1.3 $
* $Revision: 1.4 $
*
* last change: $Author: er $ $Date: 2001-05-13 03:29:15 $
* last change: $Author: er $ $Date: 2001-05-15 10:26:58 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
......@@ -70,6 +70,12 @@
#if defined UNX && !defined LINUX
#include <wchar.h>
#endif
#ifndef _TOOLS_SOLMATH_HXX
#include <tools/solmath.hxx>
#endif
#ifndef _UNOTOOLS_INTLWRAPPER_HXX
#include <unotools/intlwrapper.hxx>
#endif
#ifdef MAC
#include <stdlib.h>
......@@ -312,13 +318,22 @@ XubString SvxDoubleItem::GetValueText() const
SfxItemPresentation SvxDoubleItem::GetPresentation
( SfxItemPresentation ePresentation, SfxMapUnit eCoreMetric,
SfxMapUnit ePresentationMetric, XubString& rText, const IntlWrapper *) const
SfxMapUnit ePresentationMetric, XubString& rText,
const IntlWrapper * pIntlWrapper) const
{
char cBuff[80];
sprintf(cBuff, "%e", fVal);
rText.Erase();
rText.AppendAscii(cBuff);
DBG_ASSERT( pIntlWrapper, "SvxDoubleItem::GetPresentation: no IntlWrapper" );
if ( pIntlWrapper )
{
SolarMath::DoubleToString( rText, fVal, 'E', 4,
pIntlWrapper->getLocaleData()->getNumDecimalSep().GetChar(0), TRUE );
}
else
{
char cBuff[80];
sprintf(cBuff, "%.4E", fVal);
rText.AppendAscii(cBuff);
}
return SFX_ITEM_PRESENTATION_NAMELESS;
}
......
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