[Libreoffice-commits] .: 2 commits - sc/inc sc/source svl/source
Markus Mohrhard
mmohrhard at kemper.freedesktop.org
Wed Nov 9 20:20:59 PST 2011
sc/inc/rangenam.hxx | 12 ++++++------
sc/source/core/tool/rangenam.cxx | 6 +++---
sc/source/ui/docshell/docfunc.cxx | 2 +-
svl/source/numbers/zformat.cxx | 6 +++++-
4 files changed, 15 insertions(+), 11 deletions(-)
New commits:
commit 832c18da69aa944dffae8f7d7a351f352a94cfcf
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date: Thu Nov 10 05:18:58 2011 +0100
change the code a bit to make it a bit more clear
this should do nearly the same as the old code
diff --git a/svl/source/numbers/zformat.cxx b/svl/source/numbers/zformat.cxx
index d9d71d5..214d89f 100644
--- a/svl/source/numbers/zformat.cxx
+++ b/svl/source/numbers/zformat.cxx
@@ -2252,9 +2252,13 @@ bool SvNumberformat::GetOutputString(double fNumber,
{
if (rScan.GetStandardPrec() == SvNumberFormatter::UNLIMITED_PRECISION)
{
- bool bSign = ::rtl::math::isSignBitSet(fNumber) && fNumber != 0.0;
+ bool bSign = ::rtl::math::isSignBitSet(fNumber);
if (bSign)
+ {
+ if (!(fNumber < 0.0))
+ bSign = false;
fNumber = -fNumber;
+ }
ImpGetOutputStdToPrecision(fNumber, OutString, 10); // Use 10 decimals for general 'unlimited' format.
if (fNumber < EXP_LOWER_BOUND)
{
commit 1833e05aebcdbb277a7945efc34230dc3138c610
Author: Laurent Godard <lgodard.libre at laposte.net>
Date: Wed Nov 9 15:33:32 2011 +0100
ScRangeData aName to OUString
diff --git a/sc/inc/rangenam.hxx b/sc/inc/rangenam.hxx
index ab2ed6a..32d31ff 100644
--- a/sc/inc/rangenam.hxx
+++ b/sc/inc/rangenam.hxx
@@ -72,7 +72,7 @@ class ScTokenArray;
class ScRangeData
{
private:
- String aName;
+ rtl::OUString aName;
rtl::OUString aUpperName; // #i62977# for faster searching (aName is never modified after ctor)
ScTokenArray* pCode;
ScAddress aPos;
@@ -95,18 +95,18 @@ public:
typedef ::std::map<sal_uInt16, sal_uInt16> IndexMap;
SC_DLLPUBLIC ScRangeData( ScDocument* pDoc,
- const String& rName,
+ const rtl::OUString& rName,
const String& rSymbol,
const ScAddress& rAdr = ScAddress(),
RangeType nType = RT_NAME,
const formula::FormulaGrammar::Grammar eGrammar = formula::FormulaGrammar::GRAM_DEFAULT );
SC_DLLPUBLIC ScRangeData( ScDocument* pDoc,
- const String& rName,
+ const rtl::OUString& rName,
const ScTokenArray& rArr,
const ScAddress& rAdr = ScAddress(),
RangeType nType = RT_NAME );
SC_DLLPUBLIC ScRangeData( ScDocument* pDoc,
- const String& rName,
+ const rtl::OUString& rName,
const ScAddress& rTarget );
// rTarget is ABSPOS jump label
ScRangeData(const ScRangeData& rScRangeData, ScDocument* pDocument = NULL);
@@ -115,8 +115,8 @@ public:
bool operator== (const ScRangeData& rData) const;
- void GetName( String& rName ) const { rName = aName; }
- const String& GetName( void ) const { return aName; }
+ void GetName( rtl::OUString& rName ) const { rName = aName; }
+ const rtl::OUString& GetName( void ) const { return aName; }
const rtl::OUString& GetUpperName( void ) const { return aUpperName; }
ScAddress GetPos() const { return aPos; }
// The index has to be unique. If index=0 a new index value is assigned.
diff --git a/sc/source/core/tool/rangenam.cxx b/sc/source/core/tool/rangenam.cxx
index d3ded0c..6984984 100644
--- a/sc/source/core/tool/rangenam.cxx
+++ b/sc/source/core/tool/rangenam.cxx
@@ -64,7 +64,7 @@ ScRangeData::ScRangeData( sal_uInt16 n )
{}
ScRangeData::ScRangeData( ScDocument* pDok,
- const String& rName,
+ const rtl::OUString& rName,
const String& rSymbol,
const ScAddress& rAddress,
RangeType nType,
@@ -96,7 +96,7 @@ ScRangeData::ScRangeData( ScDocument* pDok,
}
ScRangeData::ScRangeData( ScDocument* pDok,
- const String& rName,
+ const rtl::OUString& rName,
const ScTokenArray& rArr,
const ScAddress& rAddress,
RangeType nType ) :
@@ -127,7 +127,7 @@ ScRangeData::ScRangeData( ScDocument* pDok,
}
ScRangeData::ScRangeData( ScDocument* pDok,
- const String& rName,
+ const rtl::OUString& rName,
const ScAddress& rTarget ) :
aName ( rName ),
aUpperName ( ScGlobal::pCharClass->upper( rName ) ),
diff --git a/sc/source/ui/docshell/docfunc.cxx b/sc/source/ui/docshell/docfunc.cxx
index d2b6087..39600bd 100644
--- a/sc/source/ui/docshell/docfunc.cxx
+++ b/sc/source/ui/docshell/docfunc.cxx
@@ -4758,7 +4758,7 @@ sal_Bool ScDocFunc::InsertNameList( const ScAddress& rStartPos, sal_Bool bApi )
qsort( (void*)ppSortArray, nValidCount, sizeof(ScRangeData*),
ICCQsortNameCompare );
#endif
- String aName;
+ rtl::OUString aName;
rtl::OUStringBuffer aContent;
String aFormula;
SCROW nOutRow = nStartRow;
More information about the Libreoffice-commits
mailing list