[Libreoffice-commits] core.git: include/svx include/tools sc/inc sc/qa sc/source sd/source sfx2/source svx/source sw/source tools/source
Caolán McNamara
caolanm at redhat.com
Fri Aug 30 03:39:32 PDT 2013
include/svx/hlnkitem.hxx | 6
include/tools/string.hxx | 1
sc/inc/address.hxx | 17 -
sc/inc/rangeseq.hxx | 2
sc/qa/unit/ucalc.cxx | 9
sc/qa/unit/ucalc_pivottable.cxx | 8
sc/qa/unit/ucalc_sharedformula.cxx | 3
sc/source/core/data/attrib.cxx | 4
sc/source/core/data/dpcache.cxx | 4
sc/source/core/data/formulacell.cxx | 10 -
sc/source/core/data/validat.cxx | 8
sc/source/core/tool/address.cxx | 98 +++-------
sc/source/core/tool/chartarr.cxx | 10 -
sc/source/core/tool/chgtrack.cxx | 6
sc/source/core/tool/ddelink.cxx | 14 -
sc/source/core/tool/interpr1.cxx | 14 -
sc/source/core/tool/interpr2.cxx | 12 -
sc/source/core/tool/rangelst.cxx | 3
sc/source/core/tool/rangeseq.cxx | 6
sc/source/core/tool/rangeutl.cxx | 23 --
sc/source/core/tool/reffind.cxx | 2
sc/source/filter/excel/xename.cxx | 3
sc/source/filter/excel/xestream.cxx | 8
sc/source/ui/Accessibility/AccessibleCellBase.cxx | 3
sc/source/ui/Accessibility/AccessibleDocument.cxx | 3
sc/source/ui/Accessibility/AccessibleDocumentPagePreview.cxx | 4
sc/source/ui/StatisticsDialogs/AnalysisOfVarianceDialog.cxx | 42 +---
sc/source/ui/StatisticsDialogs/CorrelationDialog.cxx | 6
sc/source/ui/StatisticsDialogs/CovarianceDialog.cxx | 6
sc/source/ui/StatisticsDialogs/DescriptiveStatisticsDialog.cxx | 2
sc/source/ui/StatisticsDialogs/RandomNumberGeneratorDialog.cxx | 6
sc/source/ui/StatisticsDialogs/SamplingDialog.cxx | 7
sc/source/ui/StatisticsDialogs/StatisticsInputOutputDialog.cxx | 9
sc/source/ui/app/inputhdl.cxx | 14 -
sc/source/ui/app/inputwin.cxx | 5
sc/source/ui/condformat/condformatdlg.cxx | 3
sc/source/ui/dbgui/consdlg.cxx | 23 +-
sc/source/ui/dbgui/dbnamdlg.cxx | 8
sc/source/ui/dbgui/filtdlg.cxx | 3
sc/source/ui/dbgui/foptmgr.cxx | 16 -
sc/source/ui/dbgui/pfiltdlg.cxx | 3
sc/source/ui/dbgui/pvlaydlg.cxx | 20 --
sc/source/ui/dbgui/sfiltdlg.cxx | 9
sc/source/ui/dbgui/tpsort.cxx | 12 -
sc/source/ui/dbgui/validate.cxx | 3
sc/source/ui/docshell/docfunc.cxx | 3
sc/source/ui/docshell/docsh4.cxx | 24 +-
sc/source/ui/docshell/docsh8.cxx | 13 -
sc/source/ui/docshell/impex.cxx | 8
sc/source/ui/drawfunc/fuins2.cxx | 2
sc/source/ui/formdlg/formula.cxx | 3
sc/source/ui/inc/docsh.hxx | 4
sc/source/ui/inc/navipi.hxx | 6
sc/source/ui/inc/viewfunc.hxx | 2
sc/source/ui/miscdlgs/acredlin.cxx | 3
sc/source/ui/miscdlgs/crnrdlg.cxx | 23 --
sc/source/ui/miscdlgs/highred.cxx | 6
sc/source/ui/miscdlgs/optsolver.cxx | 6
sc/source/ui/miscdlgs/simpref.cxx | 4
sc/source/ui/miscdlgs/solvrdlg.cxx | 7
sc/source/ui/miscdlgs/tabopdlg.cxx | 8
sc/source/ui/namedlg/namedefdlg.cxx | 10 -
sc/source/ui/namedlg/namedlg.cxx | 5
sc/source/ui/navipi/content.cxx | 9
sc/source/ui/navipi/navipi.cxx | 29 +-
sc/source/ui/optdlg/tpusrlst.cxx | 4
sc/source/ui/pagedlg/areasdlg.cxx | 30 +--
sc/source/ui/unoobj/addruno.cxx | 14 -
sc/source/ui/unoobj/cellsuno.cxx | 4
sc/source/ui/unoobj/chart2uno.cxx | 3
sc/source/ui/vba/vbarange.cxx | 4
sc/source/ui/vba/vbawsfunction.cxx | 4
sc/source/ui/view/cellsh.cxx | 3
sc/source/ui/view/cellsh1.cxx | 47 ++--
sc/source/ui/view/cellsh2.cxx | 5
sc/source/ui/view/colrowba.cxx | 2
sc/source/ui/view/gridwin.cxx | 16 -
sc/source/ui/view/gridwin2.cxx | 10 -
sc/source/ui/view/output.cxx | 3
sc/source/ui/view/printfun.cxx | 3
sc/source/ui/view/tabvwsha.cxx | 3
sc/source/ui/view/viewfun5.cxx | 2
sc/source/ui/view/viewfun6.cxx | 8
sc/source/ui/view/viewfunc.cxx | 5
sc/source/ui/xmlsource/xmlsourcedlg.cxx | 6
sd/source/ui/unoidl/sddetect.cxx | 8
sfx2/source/appl/appdde.cxx | 4
sfx2/source/appl/appopen.cxx | 12 -
svx/source/accessibility/AccessibleFrameSelector.cxx | 10 -
svx/source/items/hlnkitem.cxx | 9
sw/source/filter/html/htmlcss1.cxx | 7
sw/source/filter/html/htmlftn.cxx | 6
sw/source/filter/html/svxcss1.hxx | 1
sw/source/filter/html/swhtml.hxx | 2
sw/source/ui/shells/frmsh.cxx | 10 -
tools/source/string/tustring.cxx | 24 --
96 files changed, 377 insertions(+), 545 deletions(-)
New commits:
commit 74929bba736cc6cceed3c088e13f5952abb1bd2b
Author: Caolán McNamara <caolanm at redhat.com>
Date: Thu Aug 29 20:44:22 2013 +0100
Related: fdo#38838 remove UniString::ToUpperAscii
things got a little out of hand and I ended up
converting quite a bit of calc to OUString
Change-Id: I056326d37ffefa8c120cb2e564d166dd9f20f216
diff --git a/include/svx/hlnkitem.hxx b/include/svx/hlnkitem.hxx
index d1bdcfe..6913c41 100644
--- a/include/svx/hlnkitem.hxx
+++ b/include/svx/hlnkitem.hxx
@@ -39,7 +39,7 @@ enum SvxLinkInsertMode
class SVX_DLLPUBLIC SvxHyperlinkItem : public SfxPoolItem
{
- String sName;
+ OUString sName;
String sURL;
String sTarget;
SvxLinkInsertMode eType;
@@ -69,8 +69,8 @@ public:
virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const;
virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 );
- const String& GetName() const { return sName; }
- void SetName(const String& rName) { sName = rName; }
+ const OUString& GetName() const { return sName; }
+ void SetName(const OUString& rName) { sName = rName; }
const String& GetURL() const { return sURL; }
void SetURL(const String& rURL) { sURL = rURL; }
diff --git a/include/tools/string.hxx b/include/tools/string.hxx
index 7b8793c..c26fee3 100644
--- a/include/tools/string.hxx
+++ b/include/tools/string.hxx
@@ -227,7 +227,6 @@ public:
UniString Copy( xub_StrLen nIndex = 0, xub_StrLen nCount = STRING_LEN ) const;
UniString& ToLowerAscii();
- UniString& ToUpperAscii();
StringCompare CompareTo( const UniString& rStr,
xub_StrLen nLen = STRING_LEN ) const;
diff --git a/sc/inc/address.hxx b/sc/inc/address.hxx
index 2a38827..e998de0 100644
--- a/sc/inc/address.hxx
+++ b/sc/inc/address.hxx
@@ -293,9 +293,7 @@ public:
const ::com::sun::star::uno::Sequence<
const ::com::sun::star::sheet::ExternalLinkInfo > * pExternalLinks = NULL );
- SC_DLLPUBLIC void Format( OUString&, sal_uInt16 = 0, const ScDocument* = NULL,
- const Details& rDetails = detailsOOOa1) const;
- SC_DLLPUBLIC void Format( String&, sal_uInt16 = 0, const ScDocument* = NULL,
+ SC_DLLPUBLIC OUString Format( sal_uInt16 = 0, const ScDocument* = NULL,
const Details& rDetails = detailsOOOa1) const;
// The document for the maximum defined sheet number
@@ -494,11 +492,8 @@ public:
const ::com::sun::star::uno::Sequence<
const ::com::sun::star::sheet::ExternalLinkInfo > * pExternalLinks = NULL );
- SC_DLLPUBLIC void Format( String&, sal_uInt16 = 0, const ScDocument* = NULL,
- const ScAddress::Details& rDetails = ScAddress::detailsOOOa1 ) const;
-
- SC_DLLPUBLIC void Format( OUString&, sal_uInt16 = 0, const ScDocument* = NULL,
- const ScAddress::Details& rDetails = ScAddress::detailsOOOa1 ) const;
+ SC_DLLPUBLIC OUString Format(sal_uInt16 = 0, const ScDocument* = NULL,
+ const ScAddress::Details& rDetails = ScAddress::detailsOOOa1) const;
inline void GetVars( SCCOL& nCol1, SCROW& nRow1, SCTAB& nTab1,
SCCOL& nCol2, SCROW& nRow2, SCTAB& nTab2 ) const;
@@ -785,14 +780,14 @@ bool ConvertDoubleRef(ScDocument* pDoc, const String& rRefString,
/// append alpha representation of column to buffer
SC_DLLPUBLIC void ScColToAlpha( OUStringBuffer& rBuffer, SCCOL nCol);
-inline void ScColToAlpha( String& rStr, SCCOL nCol)
+inline void ScColToAlpha( OUString& rStr, SCCOL nCol)
{
OUStringBuffer aBuf(2);
ScColToAlpha( aBuf, nCol);
- rStr.Append( aBuf.getStr(), static_cast<xub_StrLen>(aBuf.getLength()));
+ rStr += aBuf.makeStringAndClear();
}
-inline String ScColToAlpha( SCCOL nCol )
+inline OUString ScColToAlpha( SCCOL nCol )
{
OUStringBuffer aBuf(2);
ScColToAlpha( aBuf, nCol);
diff --git a/sc/inc/rangeseq.hxx b/sc/inc/rangeseq.hxx
index b13233d..64e9f6c 100644
--- a/sc/inc/rangeseq.hxx
+++ b/sc/inc/rangeseq.hxx
@@ -98,7 +98,7 @@ class ScByteSequenceToString
public:
// rAny must contain Sequence<sal_Int8>,
// may or may not contain 0-bytes at the end
- static sal_Bool GetString( String& rString, const com::sun::star::uno::Any& rAny,
+ static sal_Bool GetString( OUString& rString, const com::sun::star::uno::Any& rAny,
sal_uInt16 nEncoding );
};
diff --git a/sc/qa/unit/ucalc.cxx b/sc/qa/unit/ucalc.cxx
index 4ed2092..ab227ea 100644
--- a/sc/qa/unit/ucalc.cxx
+++ b/sc/qa/unit/ucalc.cxx
@@ -3194,8 +3194,7 @@ namespace {
bool checkFormulaPosition(ScDocument& rDoc, const ScAddress& rPos)
{
- OUString aStr;
- rPos.Format(aStr, SCA_VALID);
+ OUString aStr(rPos.Format(SCA_VALID));
const ScFormulaCell* pFC = rDoc.GetFormulaCell(rPos);
if (!pFC)
{
@@ -3205,8 +3204,7 @@ bool checkFormulaPosition(ScDocument& rDoc, const ScAddress& rPos)
if (pFC->aPos != rPos)
{
- OUString aStr2;
- pFC->aPos.Format(aStr2, SCA_VALID);
+ OUString aStr2(pFC->aPos.Format(SCA_VALID));
cerr << "Formula cell at " << aStr << " has incorrect position of " << aStr2 << endl;
return false;
}
@@ -3224,8 +3222,7 @@ void checkFormulaPositions(ScDocument& rDoc, const ScAddress& rPos, const SCROW*
if (!checkFormulaPosition(rDoc, aPos))
{
- OUString aStr;
- aPos.Format(aStr, SCA_VALID);
+ OUString aStr(aPos.Format(SCA_VALID));
std::ostringstream os;
os << "Formula cell position failed at " << aStr;
CPPUNIT_FAIL(os.str().c_str());
diff --git a/sc/qa/unit/ucalc_pivottable.cxx b/sc/qa/unit/ucalc_pivottable.cxx
index 28d0e92..a052adc 100644
--- a/sc/qa/unit/ucalc_pivottable.cxx
+++ b/sc/qa/unit/ucalc_pivottable.cxx
@@ -710,8 +710,7 @@ void Test::testPivotTableNamedSource()
// Insert the raw data.
ScRange aSrcRange = insertDPSourceData(m_pDoc, aFields, nFieldCount, aData, nDataCount);
- OUString aRangeStr;
- aSrcRange.Format(aRangeStr, SCR_ABS_3D, m_pDoc);
+ OUString aRangeStr(aSrcRange.Format(SCR_ABS_3D, m_pDoc));
// Name this range.
OUString aRangeName("MyData");
@@ -2133,8 +2132,7 @@ void Test::testFuncGETPIVOTDATA()
aPos = aOutRange.aEnd;
aPos.IncRow(2); // Move 2 rows down from the table outout.
- OUString aPivotPosStr;
- aOutRange.aStart.Format(aPivotPosStr, SCA_ABS);
+ OUString aPivotPosStr(aOutRange.aStart.Format(SCA_ABS));
sc::AutoCalcSwitch aSwitch(*m_pDoc, true); // turn autocalc on.
@@ -2195,7 +2193,7 @@ void Test::testFuncGETPIVOTDATA()
aPos = aOutRange.aEnd;
aPos.IncRow(2); // move 2 rows down from the output.
- aOutRange.aStart.Format(aPivotPosStr, SCA_ABS);
+ aPivotPosStr = aOutRange.aStart.Format(SCA_ABS);
// First, get the grand totals.
aFormula = ("=GETPIVOTDATA(\"Sum - Value\";") + aPivotPosStr + ")";
diff --git a/sc/qa/unit/ucalc_sharedformula.cxx b/sc/qa/unit/ucalc_sharedformula.cxx
index 39e5176..169c576 100644
--- a/sc/qa/unit/ucalc_sharedformula.cxx
+++ b/sc/qa/unit/ucalc_sharedformula.cxx
@@ -419,8 +419,7 @@ void Test::testSharedFormulasCopyPaste()
// Paste them to C2:C10.
ScRange aDestRange(2,1,0,2,9,0);
- OUString aRS;
- aDestRange.Format(aRS, SCR_ABS);
+ OUString aRS(aDestRange.Format(SCR_ABS));
pasteFromClip(m_pDoc, aDestRange, &aClipDoc);
aPos.SetCol(2);
aPos.SetRow(1);
diff --git a/sc/source/core/data/attrib.cxx b/sc/source/core/data/attrib.cxx
index 80bc01a..ce572b9 100644
--- a/sc/source/core/data/attrib.cxx
+++ b/sc/source/core/data/attrib.cxx
@@ -481,10 +481,8 @@ SfxItemPresentation ScRangeItem::GetPresentation
case SFX_ITEM_PRESENTATION_NAMELESS:
{
- String aText;
/* Always use OOo:A1 format */
- aRange.Format( aText );
- rText += aText;
+ rText += aRange.Format();
}
break;
diff --git a/sc/source/core/data/dpcache.cxx b/sc/source/core/data/dpcache.cxx
index abaf088..5d2e50a 100644
--- a/sc/source/core/data/dpcache.cxx
+++ b/sc/source/core/data/dpcache.cxx
@@ -114,9 +114,7 @@ OUString createLabelString(ScDocument* pDoc, SCCOL nCol, SCROW nRow, SCTAB nTab)
aBuf.append(sal_Unicode(' '));
ScAddress aColAddr(nCol, 0, 0);
- OUString aColStr;
- aColAddr.Format(aColStr, SCA_VALID_COL, NULL);
- aBuf.append(aColStr);
+ aBuf.append(aColAddr.Format(SCA_VALID_COL, NULL));
aDocStr = aBuf.makeStringAndClear();
}
return aDocStr;
diff --git a/sc/source/core/data/formulacell.cxx b/sc/source/core/data/formulacell.cxx
index 32238cd..2ca77d1 100644
--- a/sc/source/core/data/formulacell.cxx
+++ b/sc/source/core/data/formulacell.cxx
@@ -2005,13 +2005,12 @@ sal_uInt16 ScFormulaCell::GetMatrixEdge( ScAddress& rOrgPos ) const
else
{
#if OSL_DEBUG_LEVEL > 0
- OUString aTmp;
OStringBuffer aMsg(RTL_CONSTASCII_STRINGPARAM(
"broken Matrix, no MatFormula at origin, Pos: "));
- aPos.Format( aTmp, SCA_VALID_COL | SCA_VALID_ROW, pDocument );
+ OUString aTmp(aPos.Format(SCA_VALID_COL | SCA_VALID_ROW, pDocument));
aMsg.append(OUStringToOString(aTmp, RTL_TEXTENCODING_ASCII_US));
aMsg.append(RTL_CONSTASCII_STRINGPARAM(", MatOrg: "));
- aOrg.Format( aTmp, SCA_VALID_COL | SCA_VALID_ROW, pDocument );
+ aTmp = aOrg.Format(SCA_VALID_COL | SCA_VALID_ROW, pDocument);
aMsg.append(OUStringToOString(aTmp, RTL_TEXTENCODING_ASCII_US));
OSL_FAIL(aMsg.getStr());
#endif
@@ -2038,12 +2037,11 @@ sal_uInt16 ScFormulaCell::GetMatrixEdge( ScAddress& rOrgPos ) const
#if OSL_DEBUG_LEVEL > 0
else
{
- OUString aTmp;
OStringBuffer aMsg( "broken Matrix, Pos: " );
- aPos.Format( aTmp, SCA_VALID_COL | SCA_VALID_ROW, pDocument );
+ OUString aTmp(aPos.Format(SCA_VALID_COL | SCA_VALID_ROW, pDocument));
aMsg.append(OUStringToOString(aTmp, RTL_TEXTENCODING_UTF8 ));
aMsg.append(RTL_CONSTASCII_STRINGPARAM(", MatOrg: "));
- aOrg.Format( aTmp, SCA_VALID_COL | SCA_VALID_ROW, pDocument );
+ aTmp = aOrg.Format(SCA_VALID_COL | SCA_VALID_ROW, pDocument);
aMsg.append(OUStringToOString(aTmp, RTL_TEXTENCODING_UTF8 ));
aMsg.append(RTL_CONSTASCII_STRINGPARAM(", MatCols: "));
aMsg.append(static_cast<sal_Int32>( nC ));
diff --git a/sc/source/core/data/validat.cxx b/sc/source/core/data/validat.cxx
index e471e85..d6342e0 100644
--- a/sc/source/core/data/validat.cxx
+++ b/sc/source/core/data/validat.cxx
@@ -206,9 +206,8 @@ sal_Bool ScValidationData::DoScript( const ScAddress& rPos, const String& rInput
aParams[0] = ::com::sun::star::uno::makeAny( OUString( aValStr ) );
// 2) Position der Zelle
- String aPosStr;
- rPos.Format( aPosStr, SCA_VALID | SCA_TAB_3D, pDocument, pDocument->GetAddressConvention() );
- aParams[1] = ::com::sun::star::uno::makeAny( OUString( aPosStr ) );
+ OUString aPosStr(rPos.Format(SCA_VALID | SCA_TAB_3D, pDocument, pDocument->GetAddressConvention()));
+ aParams[1] = ::com::sun::star::uno::makeAny(aPosStr);
// use link-update flag to prevent closing the document
// while the macro is running
@@ -329,8 +328,7 @@ sal_Bool ScValidationData::DoMacro( const ScAddress& rPos, const String& rInput,
refPar->Get(1)->PutString( aValStr );
// 2) Position der Zelle
- String aPosStr;
- rPos.Format( aPosStr, SCA_VALID | SCA_TAB_3D, pDocument, pDocument->GetAddressConvention() );
+ OUString aPosStr(rPos.Format(SCA_VALID | SCA_TAB_3D, pDocument, pDocument->GetAddressConvention()));
refPar->Get(2)->PutString( aPosStr );
// use link-update flag to prevent closing the document
diff --git a/sc/source/core/tool/address.cxx b/sc/source/core/tool/address.cxx
index 6906c87..0a3d919 100644
--- a/sc/source/core/tool/address.cxx
+++ b/sc/source/core/tool/address.cxx
@@ -1615,26 +1615,26 @@ sal_uInt16 ScRange::ParseRows( const String& rStr, ScDocument* pDoc,
}
static inline void
-lcl_a1_append_c ( String &r, int nCol, bool bIsAbs )
+lcl_a1_append_c ( OUString &r, int nCol, bool bIsAbs )
{
if( bIsAbs )
- r += '$';
+ r += "$";
ScColToAlpha( r, sal::static_int_cast<SCCOL>(nCol) );
}
static inline void
-lcl_a1_append_r ( String &r, int nRow, bool bIsAbs )
+lcl_a1_append_r ( OUString &r, int nRow, bool bIsAbs )
{
if ( bIsAbs )
- r += '$';
+ r += "$";
r += OUString::number( nRow+1 );
}
static inline void
-lcl_r1c1_append_c ( String &r, int nCol, bool bIsAbs,
+lcl_r1c1_append_c ( OUString &r, int nCol, bool bIsAbs,
const ScAddress::Details& rDetails )
{
- r += 'C';
+ r += "C";
if (bIsAbs)
{
r += OUString::number( nCol + 1 );
@@ -1648,10 +1648,10 @@ lcl_r1c1_append_c ( String &r, int nCol, bool bIsAbs,
}
}
static inline void
-lcl_r1c1_append_r ( String &r, int nRow, bool bIsAbs,
+lcl_r1c1_append_r ( OUString &r, int nRow, bool bIsAbs,
const ScAddress::Details& rDetails )
{
- r += 'R';
+ r += "R";
if (bIsAbs)
{
r += OUString::number( nRow + 1 );
@@ -1691,26 +1691,17 @@ getFileNameFromDoc( const ScDocument* pDoc )
return sFileName;
}
-void ScAddress::Format( OUString& r, sal_uInt16 nFlags, const ScDocument* pDoc,
+OUString ScAddress::Format(sal_uInt16 nFlags, const ScDocument* pDoc,
const Details& rDetails) const
{
- String aStr;
- Format(aStr, nFlags, pDoc, rDetails);
- r = aStr;
-}
-
-void ScAddress::Format( String& r, sal_uInt16 nFlags, const ScDocument* pDoc,
- const Details& rDetails) const
-{
- r.Erase();
+ OUString r;
if( nFlags & SCA_VALID )
nFlags |= ( SCA_VALID_ROW | SCA_VALID_COL | SCA_VALID_TAB );
if( pDoc && (nFlags & SCA_VALID_TAB ) )
{
if ( nTab >= pDoc->GetTableCount() )
{
- r = ScGlobal::GetRscString( STR_NOREF_STR );
- return;
+ return ScGlobal::GetRscString( STR_NOREF_STR );
}
if( nFlags & SCA_TAB_3D )
{
@@ -1745,9 +1736,9 @@ void ScAddress::Format( String& r, sal_uInt16 nFlags, const ScDocument* pDoc,
case formula::FormulaGrammar::CONV_OOO:
r += aDocName;
if( nFlags & SCA_TAB_ABSOLUTE )
- r += '$';
+ r += "$";
r += aTabName;
- r += '.';
+ r += ".";
break;
case formula::FormulaGrammar::CONV_XL_A1:
@@ -1755,12 +1746,12 @@ void ScAddress::Format( String& r, sal_uInt16 nFlags, const ScDocument* pDoc,
case formula::FormulaGrammar::CONV_XL_OOX:
if (aDocName.Len() > 0)
{
- r += '[';
+ r += "[";
r += aDocName;
- r += ']';
+ r += "]";
}
r += aTabName;
- r += '!';
+ r += "!";
break;
}
}
@@ -1784,6 +1775,7 @@ void ScAddress::Format( String& r, sal_uInt16 nFlags, const ScDocument* pDoc,
lcl_r1c1_append_c ( r, nCol, nFlags & SCA_COL_ABSOLUTE, rDetails );
break;
}
+ return r;
}
static void
@@ -1819,7 +1811,7 @@ lcl_Split_DocTab( const ScDocument* pDoc, SCTAB nTab,
}
static void
-lcl_ScRange_Format_XL_Header( String& r, const ScRange& rRange,
+lcl_ScRange_Format_XL_Header( OUString& r, const ScRange& rRange,
sal_uInt16 nFlags, const ScDocument* pDoc,
const ScAddress::Details& rDetails )
{
@@ -1830,9 +1822,9 @@ lcl_ScRange_Format_XL_Header( String& r, const ScRange& rRange,
aTabName, aDocName );
if( aDocName.Len() > 0 )
{
- r += '[';
+ r += "[";
r += aDocName;
- r += ']';
+ r += "]";
}
r += aTabName;
@@ -1840,23 +1832,22 @@ lcl_ScRange_Format_XL_Header( String& r, const ScRange& rRange,
{
lcl_Split_DocTab( pDoc, rRange.aEnd.Tab(), rDetails, nFlags,
aTabName, aDocName );
- r += ':';
+ r += ":";
r += aTabName;
}
- r += '!';
+ r += "!";
}
}
-void ScRange::Format( String& r, sal_uInt16 nFlags, const ScDocument* pDoc,
+OUString ScRange::Format( sal_uInt16 nFlags, const ScDocument* pDoc,
const ScAddress::Details& rDetails ) const
{
- r.Erase();
if( !( nFlags & SCA_VALID ) )
{
- r = ScGlobal::GetRscString( STR_NOREF_STR );
- return;
+ return ScGlobal::GetRscString( STR_NOREF_STR );
}
+ OUString r;
#define absrel_differ(nFlags, mask) (((nFlags) & (mask)) ^ (((nFlags) >> 4) & (mask)))
switch( rDetails.eConv ) {
default :
@@ -1864,19 +1855,18 @@ void ScRange::Format( String& r, sal_uInt16 nFlags, const ScDocument* pDoc,
bool bOneTab = (aStart.Tab() == aEnd.Tab());
if ( !bOneTab )
nFlags |= SCA_TAB_3D;
- aStart.Format( r, nFlags, pDoc, rDetails );
+ r = aStart.Format(nFlags, pDoc, rDetails);
if( aStart != aEnd ||
absrel_differ( nFlags, SCA_COL_ABSOLUTE ) ||
absrel_differ( nFlags, SCA_ROW_ABSOLUTE ))
{
- String aName;
nFlags = ( nFlags & SCA_VALID ) | ( ( nFlags >> 4 ) & 0x070F );
if ( bOneTab )
pDoc = NULL;
else
nFlags |= SCA_TAB_3D;
- aEnd.Format( aName, nFlags, pDoc, rDetails );
- r += ':';
+ OUString aName(aEnd.Format(nFlags, pDoc, rDetails));
+ r += ":";
r += aName;
}
}
@@ -1889,14 +1879,14 @@ void ScRange::Format( String& r, sal_uInt16 nFlags, const ScDocument* pDoc,
{
// Full col refs always require 2 rows (2:2)
lcl_a1_append_r( r, aStart.Row(), nFlags & SCA_ROW_ABSOLUTE );
- r += ':';
+ r += ":";
lcl_a1_append_r( r, aEnd.Row(), nFlags & SCA_ROW2_ABSOLUTE );
}
else if( aStart.Row() == 0 && aEnd.Row() >= MAXROW )
{
// Full row refs always require 2 cols (A:A)
lcl_a1_append_c( r, aStart.Col(), nFlags & SCA_COL_ABSOLUTE );
- r += ':';
+ r += ":";
lcl_a1_append_c( r, aEnd.Col(), nFlags & SCA_COL2_ABSOLUTE );
}
else
@@ -1907,7 +1897,7 @@ void ScRange::Format( String& r, sal_uInt16 nFlags, const ScDocument* pDoc,
absrel_differ( nFlags, SCA_COL_ABSOLUTE ) ||
aStart.Row() != aEnd.Row() ||
absrel_differ( nFlags, SCA_ROW_ABSOLUTE )) {
- r += ':';
+ r += ":";
lcl_a1_append_c ( r, aEnd.Col(), nFlags & SCA_COL2_ABSOLUTE );
lcl_a1_append_r ( r, aEnd.Row(), nFlags & SCA_ROW2_ABSOLUTE );
}
@@ -1921,7 +1911,7 @@ void ScRange::Format( String& r, sal_uInt16 nFlags, const ScDocument* pDoc,
lcl_r1c1_append_r( r, aStart.Row(), nFlags & SCA_ROW_ABSOLUTE, rDetails );
if( aStart.Row() != aEnd.Row() ||
absrel_differ( nFlags, SCA_ROW_ABSOLUTE )) {
- r += ':';
+ r += ":";
lcl_r1c1_append_r( r, aEnd.Row(), nFlags & SCA_ROW2_ABSOLUTE, rDetails );
}
}
@@ -1930,7 +1920,7 @@ void ScRange::Format( String& r, sal_uInt16 nFlags, const ScDocument* pDoc,
lcl_r1c1_append_c( r, aStart.Col(), nFlags & SCA_COL_ABSOLUTE, rDetails );
if( aStart.Col() != aEnd.Col() ||
absrel_differ( nFlags, SCA_COL_ABSOLUTE )) {
- r += ':';
+ r += ":";
lcl_r1c1_append_c( r, aEnd.Col(), nFlags & SCA_COL2_ABSOLUTE, rDetails );
}
}
@@ -1942,21 +1932,14 @@ void ScRange::Format( String& r, sal_uInt16 nFlags, const ScDocument* pDoc,
absrel_differ( nFlags, SCA_COL_ABSOLUTE ) ||
aStart.Row() != aEnd.Row() ||
absrel_differ( nFlags, SCA_ROW_ABSOLUTE )) {
- r += ':';
+ r += ":";
lcl_r1c1_append_r( r, aEnd.Row(), nFlags & SCA_ROW2_ABSOLUTE, rDetails );
lcl_r1c1_append_c( r, aEnd.Col(), nFlags & SCA_COL2_ABSOLUTE, rDetails );
}
}
}
#undef absrel_differ
-}
-
-void ScRange::Format( OUString& r, sal_uInt16 nFlags, const ScDocument* pDoc,
- const ScAddress::Details& rDetails ) const
-{
- String aStr;
- Format(aStr, nFlags, pDoc, rDetails);
- r = aStr;
+ return r;
}
bool ScAddress::Move( SCsCOL dx, SCsROW dy, SCsTAB dz, ScDocument* pDoc )
@@ -1993,7 +1976,7 @@ bool ScRange::Move( SCsCOL dx, SCsROW dy, SCsTAB dz, ScDocument* pDoc )
String ScAddress::GetColRowString( bool bAbsolute,
const Details& rDetails ) const
{
- String aString;
+ OUString aString;
switch( rDetails.eConv )
{
@@ -2002,12 +1985,12 @@ String ScAddress::GetColRowString( bool bAbsolute,
case formula::FormulaGrammar::CONV_XL_A1:
case formula::FormulaGrammar::CONV_XL_OOX:
if (bAbsolute)
- aString.Append( '$' );
+ aString += "$";
ScColToAlpha( aString, nCol);
if ( bAbsolute )
- aString.Append( '$' );
+ aString += "$";
aString += OUString::number(nRow+1);
break;
@@ -2030,7 +2013,6 @@ String ScRefAddress::GetRefString( ScDocument* pDoc, SCTAB nActTab,
if ( Tab()+1 > pDoc->GetTableCount() )
return ScGlobal::GetRscString( STR_NOREF_STR );
- String aString;
sal_uInt16 nFlags = SCA_VALID;
if ( nActTab != Tab() )
{
@@ -2043,9 +2025,7 @@ String ScRefAddress::GetRefString( ScDocument* pDoc, SCTAB nActTab,
if ( !bRelRow )
nFlags |= SCA_ROW_ABSOLUTE;
- aAdr.Format( aString, nFlags, pDoc, rDetails );
-
- return aString;
+ return aAdr.Format(nFlags, pDoc, rDetails);
}
//------------------------------------------------------------------------
diff --git a/sc/source/core/tool/chartarr.cxx b/sc/source/core/tool/chartarr.cxx
index 7abb787..6929e42 100644
--- a/sc/source/core/tool/chartarr.cxx
+++ b/sc/source/core/tool/chartarr.cxx
@@ -279,7 +279,7 @@ ScMemChart* ScChartArray::CreateMemChartSingle()
for (nCol=0; nCol<nColCount; nCol++)
{
- OUString aString, aColStr;
+ OUString aString;
if (HasColHeaders())
aString = pDocument->GetString(aCols[nCol], nStrRow, nTab1);
if (aString.isEmpty())
@@ -289,8 +289,7 @@ ScMemChart* ScChartArray::CreateMemChartSingle()
aBuf.append(sal_Unicode(' '));
ScAddress aPos( aCols[ nCol ], 0, 0 );
- aPos.Format( aColStr, SCA_VALID_COL, NULL );
- aBuf.append(aColStr);
+ aBuf.append(aPos.Format(SCA_VALID_COL, NULL));
aString = aBuf.makeStringAndClear();
}
@@ -399,7 +398,7 @@ ScMemChart* ScChartArray::CreateMemChartMulti()
SCCOL nPosCol = 0;
for ( nCol = 0; nCol < nColCount; nCol++ )
{
- OUString aString, aColStr;
+ OUString aString;
const ScAddress* pPos = GetPositionMap()->GetColHeaderPosition( static_cast<SCCOL>(nCol) );
if ( HasColHeaders() && pPos )
aString = pDocument->GetString(pPos->Col(), pPos->Row(), pPos->Tab());
@@ -413,8 +412,7 @@ ScMemChart* ScChartArray::CreateMemChartMulti()
else
nPosCol++;
ScAddress aPos( nPosCol - 1, 0, 0 );
- aPos.Format( aColStr, SCA_VALID_COL, NULL );
- aBuf.append(aColStr);
+ aBuf.append(aPos.Format(SCA_VALID_COL, NULL));
aString = aBuf.makeStringAndClear();
}
pMemChart->SetColText( static_cast<short>(nCol), aString);
diff --git a/sc/source/core/tool/chgtrack.cxx b/sc/source/core/tool/chgtrack.cxx
index 75163bb..d5f1c6c 100644
--- a/sc/source/core/tool/chgtrack.cxx
+++ b/sc/source/core/tool/chgtrack.cxx
@@ -559,9 +559,7 @@ OUString ScChangeAction::GetRefString(
if ( bFlag3D || GetType() == SC_CAT_INSERT_TABS )
nFlags |= SCA_TAB_3D;
- OUString aTmp;
- aTmpRange.Format(aTmp, nFlags, pDoc, pDoc->GetAddressConvention());
- aBuf.append(aTmp);
+ aBuf.append(aTmpRange.Format(nFlags, pDoc, pDoc->GetAddressConvention()));
}
}
if ( (bFlag3D && IsDeleteType()) || IsDeletedIn() )
@@ -1593,7 +1591,7 @@ void ScChangeActionContent::GetRefString(
ScAddress aTmpAddress( GetBigRange().aStart.MakeAddress() );
if ( bFlag3D )
nFlags |= SCA_TAB_3D;
- aTmpAddress.Format( rStr, nFlags, pDoc, pDoc->GetAddressConvention() );
+ rStr = aTmpAddress.Format(nFlags, pDoc, pDoc->GetAddressConvention());
if ( IsDeletedIn() )
{
// Insert the parentheses.
diff --git a/sc/source/core/tool/ddelink.cxx b/sc/source/core/tool/ddelink.cxx
index c6a55d8..4228d7e 100644
--- a/sc/source/core/tool/ddelink.cxx
+++ b/sc/source/core/tool/ddelink.cxx
@@ -129,23 +129,23 @@ sfx2::SvBaseLink::UpdateResult ScDdeLink::DataChanged(
if ( FORMAT_STRING != SotExchange::GetFormatIdFromMimeType( rMimeType ))
return SUCCESS;
- String aLinkStr;
+ OUString aLinkStr;
ScByteSequenceToString::GetString( aLinkStr, rValue, DDE_TXT_ENCODING );
aLinkStr = convertLineEnd(aLinkStr, LINEEND_LF);
// wenn String mit Zeilenende aufhoert, streichen:
- xub_StrLen nLen = aLinkStr.Len();
- if (nLen && aLinkStr.GetChar(nLen-1) == '\n')
- aLinkStr.Erase(nLen-1);
+ sal_Int32 nLen = aLinkStr.getLength();
+ if (nLen && aLinkStr[nLen-1] == '\n')
+ aLinkStr = aLinkStr.copy(0, nLen-1);
String aLine;
SCSIZE nCols = 1; // Leerstring -> eine leere Zelle
SCSIZE nRows = 1;
- if (aLinkStr.Len())
+ if (!aLinkStr.isEmpty())
{
nRows = static_cast<SCSIZE>(comphelper::string::getTokenCount(aLinkStr, '\n'));
- aLine = aLinkStr.GetToken( 0, '\n' );
+ aLine = aLinkStr.getToken( 0, '\n' );
if (aLine.Len())
nCols = static_cast<SCSIZE>(comphelper::string::getTokenCount(aLine, '\t'));
}
@@ -178,7 +178,7 @@ sfx2::SvBaseLink::UpdateResult ScDdeLink::DataChanged(
String aEntry;
for (SCSIZE nR=0; nR<nRows; nR++)
{
- aLine = aLinkStr.GetToken( (xub_StrLen) nR, '\n' );
+ aLine = aLinkStr.getToken( (sal_Int32) nR, '\n' );
for (SCSIZE nC=0; nC<nCols; nC++)
{
aEntry = aLine.GetToken( (xub_StrLen) nC, '\t' );
diff --git a/sc/source/core/tool/interpr1.cxx b/sc/source/core/tool/interpr1.cxx
index ba26581..a4d0d55 100644
--- a/sc/source/core/tool/interpr1.cxx
+++ b/sc/source/core/tool/interpr1.cxx
@@ -2413,8 +2413,7 @@ void ScInterpreter::ScCell()
else if( aInfoType.EqualsAscii( "ADDRESS" ) )
{ // address formatted as [['FILENAME'#]$TABLE.]$COL$ROW
sal_uInt16 nFlags = (aCellPos.Tab() == aPos.Tab()) ? (SCA_ABS) : (SCA_ABS_3D);
- OUString aStr;
- aCellPos.Format( aStr, nFlags, pDok, pDok->GetAddressConvention() );
+ OUString aStr(aCellPos.Format(nFlags, pDok, pDok->GetAddressConvention()));
PushString(aStr);
}
else if( aInfoType.EqualsAscii( "FILENAME" ) )
@@ -2448,13 +2447,13 @@ void ScInterpreter::ScCell()
{ // address, lotus 1-2-3 formatted: $TABLE:$COL$ROW
// Yes, passing tab as col is intentional!
OUStringBuffer aFuncResult;
- OUString aCellStr;
+ OUString aCellStr =
ScAddress( static_cast<SCCOL>(aCellPos.Tab()), 0, 0 ).Format(
- aCellStr, (SCA_COL_ABSOLUTE|SCA_VALID_COL), NULL, pDok->GetAddressConvention() );
+ (SCA_COL_ABSOLUTE|SCA_VALID_COL), NULL, pDok->GetAddressConvention() );
aFuncResult.append(aCellStr);
aFuncResult.append(sal_Unicode(':'));
- aCellPos.Format( aCellStr, (SCA_COL_ABSOLUTE|SCA_VALID_COL|SCA_ROW_ABSOLUTE|SCA_VALID_ROW),
- NULL, pDok->GetAddressConvention() );
+ aCellStr = aCellPos.Format((SCA_COL_ABSOLUTE|SCA_VALID_COL|SCA_ROW_ABSOLUTE|SCA_VALID_ROW),
+ NULL, pDok->GetAddressConvention());
aFuncResult.append(aCellStr);
PushString( aFuncResult.makeStringAndClear() );
}
@@ -7352,10 +7351,9 @@ void ScInterpreter::ScAddressFunc()
return;
}
- String aRefStr;
const ScAddress::Details aDetails( eConv, aPos );
const ScAddress aAdr( nCol, nRow, 0);
- aAdr.Format( aRefStr, nFlags, pDok, aDetails );
+ OUString aRefStr(aAdr.Format(nFlags, pDok, aDetails));
if( nParamCount >= 5 && sTabStr.Len() )
{
diff --git a/sc/source/core/tool/interpr2.cxx b/sc/source/core/tool/interpr2.cxx
index 85e9ed0..02564b7 100644
--- a/sc/source/core/tool/interpr2.cxx
+++ b/sc/source/core/tool/interpr2.cxx
@@ -2407,17 +2407,17 @@ static bool lcl_GetArabicValue( sal_Unicode cChar, sal_uInt16& rnValue, bool& rb
void ScInterpreter::ScArabic()
{
- String aRoman( GetString() );
+ OUString aRoman( GetString() );
if( nGlobalError )
PushError( nGlobalError);
else
{
- aRoman.ToUpperAscii();
+ aRoman = aRoman.toAsciiUpperCase();
sal_uInt16 nValue = 0;
sal_uInt16 nValidRest = 3999;
- sal_uInt16 nCharIndex = 0;
- sal_uInt16 nCharCount = aRoman.Len();
+ sal_Int32 nCharIndex = 0;
+ sal_Int32 nCharCount = aRoman.getLength();
bool bValid = true;
while( bValid && (nCharIndex < nCharCount) )
@@ -2425,11 +2425,11 @@ void ScInterpreter::ScArabic()
sal_uInt16 nDigit1 = 0;
sal_uInt16 nDigit2 = 0;
bool bIsDec1 = false;
- bValid = lcl_GetArabicValue( aRoman.GetChar( nCharIndex ), nDigit1, bIsDec1 );
+ bValid = lcl_GetArabicValue( aRoman[nCharIndex], nDigit1, bIsDec1 );
if( bValid && (nCharIndex + 1 < nCharCount) )
{
bool bIsDec2 = false;
- bValid = lcl_GetArabicValue( aRoman.GetChar( nCharIndex + 1 ), nDigit2, bIsDec2 );
+ bValid = lcl_GetArabicValue( aRoman[nCharIndex + 1], nDigit2, bIsDec2 );
}
if( bValid )
{
diff --git a/sc/source/core/tool/rangelst.cxx b/sc/source/core/tool/rangelst.cxx
index 4027d6f..8abb347 100644
--- a/sc/source/core/tool/rangelst.cxx
+++ b/sc/source/core/tool/rangelst.cxx
@@ -132,8 +132,7 @@ public:
void operator() (const ScRange* p)
{
- String aStr;
- p->Format(aStr, mnFlags, mpDoc, meConv);
+ OUString aStr(p->Format(mnFlags, mpDoc, meConv));
if (mbFirst)
mbFirst = false;
else
diff --git a/sc/source/core/tool/rangeseq.cxx b/sc/source/core/tool/rangeseq.cxx
index db55a3f..9331a63 100644
--- a/sc/source/core/tool/rangeseq.cxx
+++ b/sc/source/core/tool/rangeseq.cxx
@@ -444,14 +444,14 @@ ScMatrixRef ScSequenceToMatrix::CreateMixedMatrix( const com::sun::star::uno::An
//------------------------------------------------------------------------
-sal_Bool ScByteSequenceToString::GetString( String& rString, const uno::Any& rAny,
+sal_Bool ScByteSequenceToString::GetString( OUString& rString, const uno::Any& rAny,
sal_uInt16 nEncoding )
{
uno::Sequence<sal_Int8> aSeq;
if ( rAny >>= aSeq )
{
- rString = String( (const sal_Char*)aSeq.getConstArray(),
- (xub_StrLen)aSeq.getLength(), nEncoding );
+ rString = OUString( (const sal_Char*)aSeq.getConstArray(),
+ aSeq.getLength(), nEncoding );
rString = comphelper::string::stripEnd(rString, 0);
return sal_True;
}
diff --git a/sc/source/core/tool/rangeutl.cxx b/sc/source/core/tool/rangeutl.cxx
index 38305f6..93490af 100644
--- a/sc/source/core/tool/rangeutl.cxx
+++ b/sc/source/core/tool/rangeutl.cxx
@@ -676,8 +676,7 @@ void ScRangeStringConverter::GetStringFromAddress(
{
if (pDocument && pDocument->HasTable(rAddress.Tab()))
{
- String sAddress;
- rAddress.Format( sAddress, nFormatFlags, (ScDocument*) pDocument, eConv );
+ OUString sAddress(rAddress.Format(nFormatFlags, (ScDocument*) pDocument, eConv));
AssignString( rString, sAddress, bAppendStr, cSeparator );
}
}
@@ -695,10 +694,8 @@ void ScRangeStringConverter::GetStringFromRange(
{
ScAddress aStartAddress( rRange.aStart );
ScAddress aEndAddress( rRange.aEnd );
- String sStartAddress;
- String sEndAddress;
- aStartAddress.Format( sStartAddress, nFormatFlags, (ScDocument*) pDocument, eConv );
- aEndAddress.Format( sEndAddress, nFormatFlags, (ScDocument*) pDocument, eConv );
+ OUString sStartAddress(aStartAddress.Format(nFormatFlags, (ScDocument*) pDocument, eConv));
+ OUString sEndAddress(aEndAddress.Format(nFormatFlags, (ScDocument*) pDocument, eConv));
OUString sOUStartAddress( sStartAddress );
sOUStartAddress += OUString(':');
sOUStartAddress += OUString( sEndAddress );
@@ -811,14 +808,12 @@ static void lcl_appendCellAddress(
ScRangeStringConverter::AppendTableName(rBuf, rExtInfo.maTabName);
rBuf.append(sal_Unicode('.'));
- String aAddr;
- rCell.Format(aAddr, SCA_ABS, NULL, pDoc->GetAddressConvention());
+ OUString aAddr(rCell.Format(SCA_ABS, NULL, pDoc->GetAddressConvention()));
rBuf.append(aAddr);
}
else
{
- String aAddr;
- rCell.Format(aAddr, SCA_ABS_3D, pDoc, pDoc->GetAddressConvention());
+ OUString aAddr(rCell.Format(SCA_ABS_3D, pDoc, pDoc->GetAddressConvention()));
rBuf.append(aAddr);
}
}
@@ -846,8 +841,7 @@ static void lcl_appendCellRangeAddress(
ScRangeStringConverter::AppendTableName(rBuf, rExtInfo1.maTabName);
rBuf.append(sal_Unicode('.'));
- String aAddr;
- rCell1.Format(aAddr, SCA_ABS, NULL, pDoc->GetAddressConvention());
+ OUString aAddr(rCell1.Format(SCA_ABS, NULL, pDoc->GetAddressConvention()));
rBuf.append(aAddr);
rBuf.appendAscii(":");
@@ -859,7 +853,7 @@ static void lcl_appendCellRangeAddress(
rBuf.append(sal_Unicode('.'));
}
- rCell2.Format(aAddr, SCA_ABS, NULL, pDoc->GetAddressConvention());
+ aAddr = rCell2.Format(SCA_ABS, NULL, pDoc->GetAddressConvention());
rBuf.append(aAddr);
}
else
@@ -867,8 +861,7 @@ static void lcl_appendCellRangeAddress(
ScRange aRange;
aRange.aStart = rCell1;
aRange.aEnd = rCell2;
- String aAddr;
- aRange.Format(aAddr, SCR_ABS_3D, pDoc, pDoc->GetAddressConvention());
+ OUString aAddr(aRange.Format(SCR_ABS_3D, pDoc, pDoc->GetAddressConvention()));
rBuf.append(aAddr);
}
}
diff --git a/sc/source/core/tool/reffind.cxx b/sc/source/core/tool/reffind.cxx
index 8b5b863..8c0fe92 100644
--- a/sc/source/core/tool/reffind.cxx
+++ b/sc/source/core/tool/reffind.cxx
@@ -270,7 +270,7 @@ void ScRefFinder::ToggleRel( sal_Int32 nStartPos, sal_Int32 nEndPos )
if ( nResult & SCA_VALID )
{
sal_uInt16 nFlags = lcl_NextFlags( nResult );
- aAddr.Format(aExpr, nFlags, mpDoc, aDetails);
+ aExpr = aAddr.Format(nFlags, mpDoc, aDetails);
sal_Int32 nAbsStart = nStartPos+aResult.getLength()+aSep.getLength();
diff --git a/sc/source/filter/excel/xename.cxx b/sc/source/filter/excel/xename.cxx
index ca472a6..1461161 100644
--- a/sc/source/filter/excel/xename.cxx
+++ b/sc/source/filter/excel/xename.cxx
@@ -386,8 +386,7 @@ sal_uInt16 XclExpNameManagerImpl::InsertBuiltInName( sal_Unicode cBuiltIn, XclTo
XclExpNameRef xName( new XclExpName( GetRoot(), cBuiltIn ) );
xName->SetTokenArray( xTokArr );
xName->SetLocalTab( aRange.aStart.Tab() );
- String sSymbol;
- aRange.Format( sSymbol, SCR_ABS_3D, GetDocPtr(), ScAddress::Details( ::formula::FormulaGrammar::CONV_XL_A1 ) );
+ OUString sSymbol(aRange.Format(SCR_ABS_3D, GetDocPtr(), ScAddress::Details( ::formula::FormulaGrammar::CONV_XL_A1)));
xName->SetSymbol( sSymbol );
return Append( xName );
}
diff --git a/sc/source/filter/excel/xestream.cxx b/sc/source/filter/excel/xestream.cxx
index 16576b6..06b58ab 100644
--- a/sc/source/filter/excel/xestream.cxx
+++ b/sc/source/filter/excel/xestream.cxx
@@ -751,8 +751,7 @@ OString XclXmlUtils::ToOString( const String& s )
OString XclXmlUtils::ToOString( const ScAddress& rAddress )
{
- String sAddress;
- rAddress.Format( sAddress, SCA_VALID, NULL, ScAddress::Details( FormulaGrammar::CONV_XL_A1 ) );
+ OUString sAddress(rAddress.Format(SCA_VALID, NULL, ScAddress::Details( FormulaGrammar::CONV_XL_A1)));
return ToOString( sAddress );
}
@@ -764,15 +763,14 @@ OString XclXmlUtils::ToOString( const ScfUInt16Vec& rBuffer )
OString XclXmlUtils::ToOString( const ScRange& rRange )
{
- String sRange;
- rRange.Format( sRange, SCA_VALID, NULL, ScAddress::Details( FormulaGrammar::CONV_XL_A1 ) );
+ OUString sRange(rRange.Format(SCA_VALID, NULL, ScAddress::Details( FormulaGrammar::CONV_XL_A1)));
return ToOString( sRange );
}
OString XclXmlUtils::ToOString( const ScRangeList& rRangeList )
{
String s;
- rRangeList.Format( s, SCA_VALID, NULL, FormulaGrammar::CONV_XL_A1, ' ' );
+ rRangeList.Format(s, SCA_VALID, NULL, FormulaGrammar::CONV_XL_A1, ' ');
return ToOString( s );
}
diff --git a/sc/source/ui/Accessibility/AccessibleCellBase.cxx b/sc/source/ui/Accessibility/AccessibleCellBase.cxx
index 39e70a0..0d6f431 100644
--- a/sc/source/ui/Accessibility/AccessibleCellBase.cxx
+++ b/sc/source/ui/Accessibility/AccessibleCellBase.cxx
@@ -213,10 +213,9 @@ OUString SAL_CALL
throw (uno::RuntimeException)
{
String sName( ScResId(STR_ACC_CELL_NAME) );
- String sAddress;
// Document not needed, because only the cell address, but not the tablename is needed
// always us OOO notation
- maCellAddress.Format( sAddress, SCA_VALID, NULL );
+ OUString sAddress(maCellAddress.Format(SCA_VALID, NULL));
sName.SearchAndReplaceAscii("%1", sAddress);
/* #i65103# ZoomText merges cell address and contents, e.g. if value 2 is
contained in cell A1, ZT reads "cell A twelve" instead of "cell A1 - 2".
diff --git a/sc/source/ui/Accessibility/AccessibleDocument.cxx b/sc/source/ui/Accessibility/AccessibleDocument.cxx
index b38c639..3e85822 100644
--- a/sc/source/ui/Accessibility/AccessibleDocument.cxx
+++ b/sc/source/ui/Accessibility/AccessibleDocument.cxx
@@ -2087,9 +2087,8 @@ OUString ScAccessibleDocument::GetCurrentCellName() const
String sName( ScResId(STR_ACC_CELL_NAME) );
if (mpViewShell)
{
- String sAddress;
// Document not needed, because only the cell address, but not the tablename is needed
- mpViewShell->GetViewData()->GetCurPos().Format( sAddress, SCA_VALID, NULL );
+ OUString sAddress(mpViewShell->GetViewData()->GetCurPos().Format(SCA_VALID, NULL));
sName.SearchAndReplaceAscii("%1", sAddress);
}
return OUString(sName);
diff --git a/sc/source/ui/Accessibility/AccessibleDocumentPagePreview.cxx b/sc/source/ui/Accessibility/AccessibleDocumentPagePreview.cxx
index 74fefb4..a2fce10 100644
--- a/sc/source/ui/Accessibility/AccessibleDocumentPagePreview.cxx
+++ b/sc/source/ui/Accessibility/AccessibleDocumentPagePreview.cxx
@@ -178,7 +178,7 @@ sal_Int32 ScNotesChildren::AddNotes(const ScPreviewLocationData& rData, const Re
if (bMark)
{
// Document not needed, because only the cell address, but not the tablename is needed
- aNote.maNoteCell.Format( aNote.maNoteText, SCA_VALID, NULL );
+ aNote.maNoteText = aNote.maNoteCell.Format(SCA_VALID, NULL);
}
else
{
@@ -355,7 +355,7 @@ sal_Int32 ScNotesChildren::CheckChanges(const ScPreviewLocationData& rData,
if (bMark)
{
// Document not needed, because only the cell address, but not the tablename is needed
- aNote.maNoteCell.Format( aNote.maNoteText, SCA_VALID, NULL );
+ aNote.maNoteText = aNote.maNoteCell.Format(SCA_VALID, NULL);
}
else
{
diff --git a/sc/source/ui/StatisticsDialogs/AnalysisOfVarianceDialog.cxx b/sc/source/ui/StatisticsDialogs/AnalysisOfVarianceDialog.cxx
index 20d2c86..d0c809d 100644
--- a/sc/source/ui/StatisticsDialogs/AnalysisOfVarianceDialog.cxx
+++ b/sc/source/ui/StatisticsDialogs/AnalysisOfVarianceDialog.cxx
@@ -58,8 +58,7 @@ OUString lclCreateMultiParameterFormula(
OUString aResult;
for (size_t i = 0; i < aRangeList.size(); i++)
{
- OUString aRangeString;
- aRangeList[i]->Format( aRangeString, SCR_ABS, pDocument, aAddressDetails );
+ OUString aRangeString(aRangeList[i]->Format(SCR_ABS, pDocument, aAddressDetails));
OUString aFormulaString = aFormulaTemplate.replaceAll(aWildcard, aRangeString);
aResult += aFormulaString;
if(i != aRangeList.size() - 1) // Not Last
@@ -138,7 +137,7 @@ void ScAnalysisOfVarianceDialog::CalculateInputAndWriteToOutput( )
);
aRangeList.Append(aColumnRange);
- aColumnRange.Format( aReferenceString, SCR_ABS, mDocument, mAddressDetails );
+ aReferenceString = aColumnRange.Format(SCR_ABS, mDocument, mAddressDetails);
OUString aFormulaString;
OUString aFormulaTemplate;
@@ -176,12 +175,10 @@ void ScAnalysisOfVarianceDialog::CalculateInputAndWriteToOutput( )
// Sum of Squares
aAddress = ScAddress(outCol, outRow, outTab);
- OUString aReferenceTotal;
- OUString aReferenceWithin;
ScAddress aAddressTotal(outCol, outRow+2, outTab);
- aAddressTotal.Format( aReferenceTotal, SCR_ABS, mDocument, mAddressDetails );
+ OUString aReferenceTotal(aAddressTotal.Format(SCR_ABS, mDocument, mAddressDetails));
ScAddress aAddressWithin(outCol, outRow+1, outTab);
- aAddressWithin.Format( aReferenceWithin, SCR_ABS, mDocument, mAddressDetails );
+ OUString aReferenceWithin(aAddressWithin.Format(SCR_ABS, mDocument, mAddressDetails));
OUString aFormulaString = "=" + aReferenceTotal + "-" + aReferenceWithin;
pDocShell->GetDocFunc().SetFormulaCell(aAddress, new ScFormulaCell(mDocument, aAddress, aFormulaString), true);
outCol++;
@@ -189,18 +186,16 @@ void ScAnalysisOfVarianceDialog::CalculateInputAndWriteToOutput( )
// Degree of freedom
aAddress = ScAddress(outCol, outRow, outTab);
aAddressTotal = ScAddress(outCol, outRow+2, outTab);
- aAddressTotal.Format( aReferenceTotal, SCR_ABS, mDocument, mAddressDetails );
+ aReferenceTotal = aAddressTotal.Format(SCR_ABS, mDocument, mAddressDetails);
aAddressWithin = ScAddress(outCol, outRow+1, outTab);
- aAddressWithin.Format( aReferenceWithin, SCR_ABS, mDocument, mAddressDetails );
+ aReferenceWithin = aAddressWithin.Format(SCR_ABS, mDocument, mAddressDetails);
aFormulaString = "=" + aReferenceTotal + "-" + aReferenceWithin;
pDocShell->GetDocFunc().SetFormulaCell(aAddress, new ScFormulaCell(mDocument, aAddress, aFormulaString), true);
outCol++;
// MS
- OUString aSSRef;
- ScAddress(outCol-2, outRow, outTab).Format( aSSRef, SCR_ABS, mDocument, mAddressDetails );
- OUString aDFRef;
- ScAddress(outCol-1, outRow, outTab).Format( aDFRef, SCR_ABS, mDocument, mAddressDetails );
+ OUString aSSRef(ScAddress(outCol-2, outRow, outTab).Format(SCR_ABS, mDocument, mAddressDetails));
+ OUString aDFRef(ScAddress(outCol-1, outRow, outTab).Format(SCR_ABS, mDocument, mAddressDetails));
aFormulaString = "=" + aSSRef + "/" + aDFRef;
aAddress = ScAddress(outCol, outRow, outTab);
pDocShell->GetDocFunc().SetFormulaCell(aAddress, new ScFormulaCell(mDocument, aAddress, aFormulaString), true);
@@ -208,22 +203,17 @@ void ScAnalysisOfVarianceDialog::CalculateInputAndWriteToOutput( )
// F
aAddress = ScAddress(outCol, outRow, outTab);
- OUString aMSBetween;
- ScAddress(outCol-1, outRow, outTab).Format( aMSBetween, SCR_ABS, mDocument, mAddressDetails );
- OUString aMSWithin;
- ScAddress(outCol-1, outRow+1, outTab).Format( aMSWithin, SCR_ABS, mDocument, mAddressDetails );
+ OUString aMSBetween(ScAddress(outCol-1, outRow, outTab).Format(SCR_ABS, mDocument, mAddressDetails));
+ OUString aMSWithin(ScAddress(outCol-1, outRow+1, outTab).Format(SCR_ABS, mDocument, mAddressDetails));
aFormulaString = "=" + aMSBetween + "/" + aMSWithin;
pDocShell->GetDocFunc().SetFormulaCell(aAddress, new ScFormulaCell(mDocument, aAddress, aFormulaString), true);
outCol++;
// P-value
aAddress = ScAddress(outCol, outRow, outTab);
- OUString aFValue;
- ScAddress(outCol-1, outRow, outTab).Format( aFValue, SCR_ABS, mDocument, mAddressDetails );
- OUString aDFBetween;
- ScAddress(outCol-3, outRow, outTab).Format( aDFBetween, SCR_ABS, mDocument, mAddressDetails );
- OUString aDFWithin;
- ScAddress(outCol-3, outRow+1, outTab).Format( aDFWithin, SCR_ABS, mDocument, mAddressDetails );
+ OUString aFValue(ScAddress(outCol-1, outRow, outTab).Format(SCR_ABS, mDocument, mAddressDetails));
+ OUString aDFBetween(ScAddress(outCol-3, outRow, outTab).Format(SCR_ABS, mDocument, mAddressDetails));
+ OUString aDFWithin(ScAddress(outCol-3, outRow+1, outTab).Format(SCR_ABS, mDocument, mAddressDetails));
aFormulaString = "=FDIST("+ aFValue + ";" + aDFBetween + ";" + aDFWithin + ")";
pDocShell->GetDocFunc().SetFormulaCell(aAddress, new ScFormulaCell(mDocument, aAddress, aFormulaString), true);
outCol++;
@@ -265,12 +255,10 @@ void ScAnalysisOfVarianceDialog::CalculateInputAndWriteToOutput( )
outCol++;
// MS
- OUString aSSRef;
- OUString aDFRef;
ScAddress aAddressSS(outCol-2, outRow, outTab);
- aAddressSS.Format( aSSRef, SCR_ABS, mDocument, mAddressDetails );
+ OUString aSSRef(aAddressSS.Format(SCR_ABS, mDocument, mAddressDetails));
ScAddress aAddressDF(outCol-1, outRow, outTab);
- aAddressDF.Format( aDFRef, SCR_ABS, mDocument, mAddressDetails );
+ OUString aDFRef(aAddressDF.Format(SCR_ABS, mDocument, mAddressDetails));
OUString aFormulaString = "=" + aSSRef + "/" + aDFRef;
aAddress = ScAddress(outCol, outRow, outTab);
pDocShell->GetDocFunc().SetFormulaCell(aAddress, new ScFormulaCell(mDocument, aAddress, aFormulaString), true);
diff --git a/sc/source/ui/StatisticsDialogs/CorrelationDialog.cxx b/sc/source/ui/StatisticsDialogs/CorrelationDialog.cxx
index 9f26c8c..780804d 100644
--- a/sc/source/ui/StatisticsDialogs/CorrelationDialog.cxx
+++ b/sc/source/ui/StatisticsDialogs/CorrelationDialog.cxx
@@ -126,8 +126,6 @@ void ScCorrelationDialog::CalculateInputAndWriteToOutput( )
void ScCorrelationDialog::WriteCorrelationFormulas(ScAddress aOutputAddress, ScRangeList aRangeList)
{
ScDocShell* pDocShell = mViewData->GetDocShell();
- OUString aColumnString1;
- OUString aColumnString2;
ScAddress aAddress;
SCTAB outTab = aOutputAddress.Tab();
@@ -142,8 +140,8 @@ void ScCorrelationDialog::WriteCorrelationFormulas(ScAddress aOutputAddress, ScR
{
if (j >= i)
{
- aRangeList[i]->Format( aColumnString1, SCR_ABS, mDocument, mAddressDetails );
- aRangeList[j]->Format( aColumnString2, SCR_ABS, mDocument, mAddressDetails );
+ OUString aColumnString1(aRangeList[i]->Format(SCR_ABS, mDocument, mAddressDetails));
+ OUString aColumnString2(aRangeList[j]->Format(SCR_ABS, mDocument, mAddressDetails));
aAddress = ScAddress(outCol, outRow, outTab);
aFormulaString = lclCorrelTemplate.replaceAll(lclWildcardColumn1, aColumnString1);
diff --git a/sc/source/ui/StatisticsDialogs/CovarianceDialog.cxx b/sc/source/ui/StatisticsDialogs/CovarianceDialog.cxx
index 94a62da..b72e569 100644
--- a/sc/source/ui/StatisticsDialogs/CovarianceDialog.cxx
+++ b/sc/source/ui/StatisticsDialogs/CovarianceDialog.cxx
@@ -126,8 +126,6 @@ void ScCovarianceDialog::CalculateInputAndWriteToOutput( )
void ScCovarianceDialog::WriteCovarianceFormulas(ScAddress aOutputAddress, ScRangeList aRangeList)
{
ScDocShell* pDocShell = mViewData->GetDocShell();
- OUString aRowString1;
- OUString aRowString2;
ScAddress aAddress;
SCTAB outTab = aOutputAddress.Tab();
@@ -142,8 +140,8 @@ void ScCovarianceDialog::WriteCovarianceFormulas(ScAddress aOutputAddress, ScRan
{
if (j >= i)
{
- aRangeList[i]->Format( aRowString1, SCR_ABS, mDocument, mAddressDetails );
- aRangeList[j]->Format( aRowString2, SCR_ABS, mDocument, mAddressDetails );
+ OUString aRowString1(aRangeList[i]->Format(SCR_ABS, mDocument, mAddressDetails));
+ OUString aRowString2(aRangeList[j]->Format(SCR_ABS, mDocument, mAddressDetails));
aAddress = ScAddress(outCol, outRow, outTab);
aFormulaString = lclCovarTemplate.replaceAll(lclWildcardRow1, aRowString1);
diff --git a/sc/source/ui/StatisticsDialogs/DescriptiveStatisticsDialog.cxx b/sc/source/ui/StatisticsDialogs/DescriptiveStatisticsDialog.cxx
index b4d8915..f6ae015 100644
--- a/sc/source/ui/StatisticsDialogs/DescriptiveStatisticsDialog.cxx
+++ b/sc/source/ui/StatisticsDialogs/DescriptiveStatisticsDialog.cxx
@@ -113,7 +113,7 @@ void ScDescriptiveStatisticsDialog::CalculateInputAndWriteToOutput( )
ScAddress(inCol, mInputRange.aEnd.Row(), inTab)
);
- aColumnRange.Format( aReferenceString, SCR_ABS, mDocument, mAddressDetails );
+ aReferenceString = aColumnRange.Format(SCR_ABS, mDocument, mAddressDetails);
OUString aFormulaString;
OUString aFormulaTemplate;
diff --git a/sc/source/ui/StatisticsDialogs/RandomNumberGeneratorDialog.cxx b/sc/source/ui/StatisticsDialogs/RandomNumberGeneratorDialog.cxx
index 779252e..917b296 100644
--- a/sc/source/ui/StatisticsDialogs/RandomNumberGeneratorDialog.cxx
+++ b/sc/source/ui/StatisticsDialogs/RandomNumberGeneratorDialog.cxx
@@ -116,9 +116,8 @@ void ScRandomNumberGeneratorDialog::Init()
void ScRandomNumberGeneratorDialog::GetRangeFromSelection()
{
- OUString aCurrentString;
mViewData->GetSimpleArea(mInputRange);
- mInputRange.Format( aCurrentString, SCR_ABS_3D, mDocument, mAddressDetails );
+ OUString aCurrentString(mInputRange.Format(SCR_ABS_3D, mDocument, mAddressDetails));
mpInputRangeEdit->SetText( aCurrentString );
}
@@ -154,8 +153,7 @@ void ScRandomNumberGeneratorDialog::SetReference( const ScRange& rReferenceRange
mInputRange = rReferenceRange;
- String aReferenceString;
- mInputRange.Format( aReferenceString, SCR_ABS_3D, pDocument, mAddressDetails );
+ OUString aReferenceString(mInputRange.Format(SCR_ABS_3D, pDocument, mAddressDetails));
mpInputRangeEdit->SetRefString( aReferenceString );
}
}
diff --git a/sc/source/ui/StatisticsDialogs/SamplingDialog.cxx b/sc/source/ui/StatisticsDialogs/SamplingDialog.cxx
index 841f3fc..20608bb 100644
--- a/sc/source/ui/StatisticsDialogs/SamplingDialog.cxx
+++ b/sc/source/ui/StatisticsDialogs/SamplingDialog.cxx
@@ -101,9 +101,8 @@ void ScSamplingDialog::Init()
void ScSamplingDialog::GetRangeFromSelection()
{
- OUString aCurrentString;
mViewData->GetSimpleArea(mInputRange);
- mInputRange.Format(aCurrentString, SCR_ABS_3D, mDocument, mAddressDetails);
+ OUString aCurrentString(mInputRange.Format(SCR_ABS_3D, mDocument, mAddressDetails));
mpInputRangeEdit->SetText(aCurrentString);
}
@@ -142,7 +141,7 @@ void ScSamplingDialog::SetReference( const ScRange& rReferenceRange, ScDocument*
if ( mpActiveEdit == mpInputRangeEdit )
{
mInputRange = rReferenceRange;
- mInputRange.Format( aReferenceString, SCR_ABS_3D, pDocument, mAddressDetails );
+ aReferenceString = mInputRange.Format(SCR_ABS_3D, pDocument, mAddressDetails);
mpInputRangeEdit->SetRefString( aReferenceString );
}
else if ( mpActiveEdit == mpOutputRangeEdit )
@@ -150,7 +149,7 @@ void ScSamplingDialog::SetReference( const ScRange& rReferenceRange, ScDocument*
mOutputAddress = rReferenceRange.aStart;
sal_uInt16 nFormat = ( mOutputAddress.Tab() == mCurrentAddress.Tab() ) ? SCA_ABS : SCA_ABS_3D;
- mOutputAddress.Format( aReferenceString, nFormat, pDocument, pDocument->GetAddressConvention() );
+ aReferenceString = mOutputAddress.Format(nFormat, pDocument, pDocument->GetAddressConvention());
mpOutputRangeEdit->SetRefString( aReferenceString );
// Change sampling size according to output range selection
diff --git a/sc/source/ui/StatisticsDialogs/StatisticsInputOutputDialog.cxx b/sc/source/ui/StatisticsDialogs/StatisticsInputOutputDialog.cxx
index 7d86870..ff431d7 100644
--- a/sc/source/ui/StatisticsDialogs/StatisticsInputOutputDialog.cxx
+++ b/sc/source/ui/StatisticsDialogs/StatisticsInputOutputDialog.cxx
@@ -111,9 +111,8 @@ void ScStatisticsInputOutputDialog::Init()
void ScStatisticsInputOutputDialog::GetRangeFromSelection()
{
- OUString aCurrentString;
mViewData->GetSimpleArea(mInputRange);
- mInputRange.Format(aCurrentString, SCR_ABS_3D, mDocument, mAddressDetails);
+ OUString aCurrentString(mInputRange.Format(SCR_ABS_3D, mDocument, mAddressDetails));
mpInputRangeEdit->SetText(aCurrentString);
}
@@ -139,12 +138,12 @@ void ScStatisticsInputOutputDialog::SetReference( const ScRange& rReferenceRange
if ( rReferenceRange.aStart != rReferenceRange.aEnd )
RefInputStart( mpActiveEdit );
- String aReferenceString;
+ OUString aReferenceString;
if ( mpActiveEdit == mpInputRangeEdit )
{
mInputRange = rReferenceRange;
- mInputRange.Format( aReferenceString, SCR_ABS_3D, pDocument, mAddressDetails );
+ aReferenceString = mInputRange.Format(SCR_ABS_3D, pDocument, mAddressDetails);
mpInputRangeEdit->SetRefString( aReferenceString );
}
else if ( mpActiveEdit == mpOutputRangeEdit )
@@ -152,7 +151,7 @@ void ScStatisticsInputOutputDialog::SetReference( const ScRange& rReferenceRange
mOutputAddress = rReferenceRange.aStart;
sal_uInt16 nFormat = ( mOutputAddress.Tab() == mCurrentAddress.Tab() ) ? SCA_ABS : SCA_ABS_3D;
- mOutputAddress.Format( aReferenceString, nFormat, pDocument, pDocument->GetAddressConvention() );
+ aReferenceString = mOutputAddress.Format(nFormat, pDocument, pDocument->GetAddressConvention());
mpOutputRangeEdit->SetRefString( aReferenceString );
// Enable OK, Cancel if output range is set
diff --git a/sc/source/ui/app/inputhdl.cxx b/sc/source/ui/app/inputhdl.cxx
index 436991f..42cbbb1 100644
--- a/sc/source/ui/app/inputhdl.cxx
+++ b/sc/source/ui/app/inputhdl.cxx
@@ -331,10 +331,9 @@ void ScInputHandler::UpdateRange( sal_uInt16 nIndex, const ScRange& rNew )
ScRange aJustified = rNew;
aJustified.Justify(); // Ref in der Formel immer richtigherum anzeigen
- String aNewStr;
ScDocument* pDoc = pDocView->GetViewData()->GetDocument();
const ScAddress::Details aAddrDetails( pDoc, aCursorPos );
- aJustified.Format( aNewStr, pData->nFlags, pDoc, aAddrDetails );
+ String aNewStr(aJustified.Format(pData->nFlags, pDoc, aAddrDetails));
ESelection aOldSel( 0, nOldStart, 0, nOldEnd );
DataChanging();
@@ -2967,8 +2966,7 @@ void ScInputHandler::SetReference( const ScRange& rRef, ScDocument* pDoc )
OSL_ENSURE(rRef.aStart.Tab()==rRef.aEnd.Tab(), "nStartTab!=nEndTab");
- String aTmp;
- rRef.Format( aTmp, SCA_VALID|SCA_TAB_3D, pDoc, aAddrDetails ); // immer 3d
+ String aTmp(rRef.Format(SCA_VALID|SCA_TAB_3D, pDoc, aAddrDetails)); // immer 3d
SfxObjectShell* pObjSh = pDoc->GetDocumentShell();
// #i75893# convert escaped URL of the document to something user friendly
@@ -2983,9 +2981,9 @@ void ScInputHandler::SetReference( const ScRange& rRef, ScDocument* pDoc )
{
if ( ( rRef.aStart.Tab() != aCursorPos.Tab() ||
rRef.aStart.Tab() != rRef.aEnd.Tab() ) && pDoc )
- rRef.Format( aRefStr, SCA_VALID|SCA_TAB_3D, pDoc, aAddrDetails );
+ aRefStr = rRef.Format(SCA_VALID|SCA_TAB_3D, pDoc, aAddrDetails);
else
- rRef.Format( aRefStr, SCA_VALID, pDoc, aAddrDetails );
+ aRefStr = rRef.Format(SCA_VALID, pDoc, aAddrDetails);
}
if (pTableView || pTopView)
@@ -3573,10 +3571,10 @@ void ScInputHandler::NotifyChange( const ScInputHdlState* pState,
{
ScRange r(rSPos, rEPos);
nFlags |= (nFlags << 4);
- r.Format( aPosStr, SCA_VALID | nFlags, pDoc, aAddrDetails );
+ aPosStr = r.Format(SCA_VALID | nFlags, pDoc, aAddrDetails);
}
else
- aCursorPos.Format( aPosStr, SCA_VALID | nFlags, pDoc, aAddrDetails );
+ aPosStr = aCursorPos.Format(SCA_VALID | nFlags, pDoc, aAddrDetails);
}
// Disable the accessible VALUE_CHANGE event
diff --git a/sc/source/ui/app/inputwin.cxx b/sc/source/ui/app/inputwin.cxx
index 4fb2ad7..8c1de60 100644
--- a/sc/source/ui/app/inputwin.cxx
+++ b/sc/source/ui/app/inputwin.cxx
@@ -2393,8 +2393,7 @@ void ScPosWnd::DoEnter()
{
ScRangeName aNewRanges( *pNames );
ScAddress aCursor( pViewData->GetCurX(), pViewData->GetCurY(), pViewData->GetTabNo() );
- String aContent;
- aSelection.Format( aContent, SCR_ABS_3D, pDoc, pDoc->GetAddressConvention() );
+ OUString aContent(aSelection.Format(SCR_ABS_3D, pDoc, pDoc->GetAddressConvention()));
ScRangeData* pNew = new ScRangeData( pDoc, aText, aContent, aCursor );
if ( aNewRanges.insert(pNew) )
{
@@ -2420,7 +2419,7 @@ void ScPosWnd::DoEnter()
// be in Calc A1 format. Convert the text.
ScRange aRange(0,0,pViewData->GetTabNo());
aRange.ParseAny(aText, pDoc, pDoc->GetAddressConvention());
- aRange.Format(aText, SCR_ABS_3D, pDoc, ::formula::FormulaGrammar::CONV_OOO);
+ aText = aRange.Format(SCR_ABS_3D, pDoc, ::formula::FormulaGrammar::CONV_OOO);
}
SfxStringItem aPosItem( SID_CURRENTCELL, aText );
diff --git a/sc/source/ui/condformat/condformatdlg.cxx b/sc/source/ui/condformat/condformatdlg.cxx
index bfea6e0..907c1b6 100644
--- a/sc/source/ui/condformat/condformatdlg.cxx
+++ b/sc/source/ui/condformat/condformatdlg.cxx
@@ -436,14 +436,13 @@ void ScCondFormatDlg::SetReference(const ScRange& rRef, ScDocument*)
if(rRef.aStart != rRef.aEnd)
RefInputStart(pEdit);
- OUString aRefStr;
sal_uInt16 n = 0;
if(mpLastEdit && mpLastEdit != &maEdRange)
n = ABS_DREF3D;
else
n = ABS_DREF;
- rRef.Format( aRefStr, n, mpDoc, ScAddress::Details(mpDoc->GetAddressConvention(), 0, 0) );
+ OUString aRefStr(rRef.Format(n, mpDoc, ScAddress::Details(mpDoc->GetAddressConvention(), 0, 0)));
pEdit->SetRefString( aRefStr );
}
}
diff --git a/sc/source/ui/dbgui/consdlg.cxx b/sc/source/ui/dbgui/consdlg.cxx
index 558d68e..d6c2985 100644
--- a/sc/source/ui/dbgui/consdlg.cxx
+++ b/sc/source/ui/dbgui/consdlg.cxx
@@ -172,8 +172,8 @@ void ScConsolidateDlg::Init()
const ScArea& rArea = *(theConsData.ppDataAreas[i] );
if ( rArea.nTab < pDoc->GetTableCount() )
{
- ScRange( rArea.nColStart, rArea.nRowStart, rArea.nTab,
- rArea.nColEnd, rArea.nRowEnd, rArea.nTab ).Format( aStr,
+ aStr = ScRange( rArea.nColStart, rArea.nRowStart, rArea.nTab,
+ rArea.nColEnd, rArea.nRowEnd, rArea.nTab ).Format(
SCR_ABS_3D, pDoc, eConv );
pLbConsAreas->InsertEntry( aStr );
}
@@ -181,12 +181,12 @@ void ScConsolidateDlg::Init()
if ( theConsData.nTab < pDoc->GetTableCount() )
{
- ScAddress( theConsData.nCol, theConsData.nRow, theConsData.nTab
- ).Format( aStr, SCA_ABS_3D, pDoc, eConv );
+ aStr = ScAddress( theConsData.nCol, theConsData.nRow, theConsData.nTab
+ ).Format( SCA_ABS_3D, pDoc, eConv );
pEdDestArea->SetText( aStr );
}
else
- pEdDestArea->SetText( EMPTY_STRING );
+ pEdDestArea->SetText(OUString());
//----------------------------------------------------------
@@ -209,13 +209,12 @@ void ScConsolidateDlg::Init()
pAreaData = new ScAreaData[nAreaDataCount];
String aStrName;
- String aStrArea;
sal_uInt16 nAt = 0;
ScRange aRange;
ScAreaNameIterator aIter( pDoc );
while ( aIter.Next( aStrName, aRange ) )
{
- aRange.Format( aStrArea, SCA_ABS_3D, pDoc, eConv );
+ String aStrArea(aRange.Format(SCA_ABS_3D, pDoc, eConv));
pAreaData[nAt++].Set( aStrName, aStrArea, aIter.WasDBName() );
}
}
@@ -223,7 +222,7 @@ void ScConsolidateDlg::Init()
FillAreaLists();
ModifyHdl( pEdDestArea );
pLbDataArea->SelectEntryPos( 0 );
- pEdDataArea->SetText( EMPTY_STRING );
+ pEdDataArea->SetText(OUString());
pEdDataArea->GrabFocus();
//aFlSep.SetStyle( aFlSep.GetStyle() | WB_VERT );
@@ -276,9 +275,9 @@ void ScConsolidateDlg::SetReference( const ScRange& rRef, ScDocument* pDocP )
nFmt |= SCA_TAB2_3D;
if ( pRefInputEdit == pEdDataArea)
- rRef.Format( aStr, nFmt, pDocP, eConv );
+ aStr = rRef.Format(nFmt, pDocP, eConv);
else if ( pRefInputEdit == pEdDestArea )
- rRef.aStart.Format( aStr, nFmt, pDocP, eConv );
+ aStr = rRef.aStart.Format(nFmt, pDocP, eConv);
pRefInputEdit->SetRefString( aStr );
}
@@ -471,9 +470,9 @@ IMPL_LINK( ScConsolidateDlg, ClickHdl, PushButton*, pBtn )
if ( ppAreas[i] )
{
const ScArea& rArea = *(ppAreas[i]);
- ScRange( rArea.nColStart, rArea.nRowStart, rArea.nTab,
+ aNewArea = ScRange( rArea.nColStart, rArea.nRowStart, rArea.nTab,
rArea.nColEnd, rArea.nRowEnd, rArea.nTab
- ).Format( aNewArea, SCR_ABS_3D, pDoc, eConv );
+ ).Format(SCR_ABS_3D, pDoc, eConv);
if ( pLbConsAreas->GetEntryPos( aNewArea )
== LISTBOX_ENTRY_NOTFOUND )
diff --git a/sc/source/ui/dbgui/dbnamdlg.cxx b/sc/source/ui/dbgui/dbnamdlg.cxx
index e46ffc4..1035ed0 100644
--- a/sc/source/ui/dbgui/dbnamdlg.cxx
+++ b/sc/source/ui/dbgui/dbnamdlg.cxx
@@ -202,7 +202,7 @@ void ScDbNameDlg::Init()
theCurArea = ScRange( ScAddress( nStartCol, nStartRow, nStartTab ),
ScAddress( nEndCol, nEndRow, nEndTab ) );
- theCurArea.Format( theAreaStr, ABS_DREF3D, pDoc, aAddrDetails );
+ theAreaStr = theCurArea.Format(ABS_DREF3D, pDoc, aAddrDetails);
if ( pDBColl )
{
@@ -279,8 +279,7 @@ void ScDbNameDlg::SetReference( const ScRange& rRef, ScDocument* pDocP )
theCurArea = rRef;
- String aRefStr;
- theCurArea.Format( aRefStr, ABS_DREF3D, pDocP, aAddrDetails );
+ OUString aRefStr(theCurArea.Format(ABS_DREF3D, pDocP, aAddrDetails));
m_pEdAssign->SetRefString( aRefStr );
m_pOptions->Enable();
m_pBtnAdd->Enable();
@@ -358,8 +357,7 @@ void ScDbNameDlg::UpdateDBData( const String& rStrName )
pData->GetArea( nTab, nColStart, nRowStart, nColEnd, nRowEnd );
theCurArea = ScRange( ScAddress( nColStart, nRowStart, nTab ),
ScAddress( nColEnd, nRowEnd, nTab ) );
- OUString theArea;
- theCurArea.Format( theArea, ABS_DREF3D, pDoc, aAddrDetails );
+ OUString theArea(theCurArea.Format(ABS_DREF3D, pDoc, aAddrDetails));
m_pEdAssign->SetText( theArea );
m_pBtnAdd->SetText( aStrModify );
m_pBtnHeader->Check( pData->HasHeader() );
diff --git a/sc/source/ui/dbgui/filtdlg.cxx b/sc/source/ui/dbgui/filtdlg.cxx
index 0b7b8f0..bc68214 100644
--- a/sc/source/ui/dbgui/filtdlg.cxx
+++ b/sc/source/ui/dbgui/filtdlg.cxx
@@ -409,8 +409,7 @@ void ScFilterDlg::SetReference( const ScRange& rRef, ScDocument* pDocP )
{
if ( rRef.aStart != rRef.aEnd )
RefInputStart( pEdCopyArea );
- OUString aRefStr;
- rRef.aStart.Format( aRefStr, SCA_ABS_3D, pDocP, pDocP->GetAddressConvention() );
+ OUString aRefStr(rRef.aStart.Format(SCA_ABS_3D, pDocP, pDocP->GetAddressConvention()));
pEdCopyArea->SetRefString( aRefStr );
}
}
diff --git a/sc/source/ui/dbgui/foptmgr.cxx b/sc/source/ui/dbgui/foptmgr.cxx
index abf1faac..362f818 100644
--- a/sc/source/ui/dbgui/foptmgr.cxx
+++ b/sc/source/ui/dbgui/foptmgr.cxx
@@ -111,7 +111,7 @@ void ScFilterOptionsMgr::Init()
OUString theDbName(STR_DB_LOCAL_NONAME);
const formula::FormulaGrammar::AddressConvention eConv = pDoc->GetAddressConvention();
- theCurArea.Format( theAreaStr, SCR_ABS_3D, pDoc, eConv );
+ theAreaStr = theCurArea.Format(SCR_ABS_3D, pDoc, eConv);
// Zielbereichsliste fuellen
@@ -121,12 +121,11 @@ void ScFilterOptionsMgr::Init()
ScAreaNameIterator aIter( pDoc );
String aName;
ScRange aRange;
- String aRefStr;
while ( aIter.Next( aName, aRange ) )
{
sal_uInt16 nInsert = pLbCopyArea->InsertEntry( aName );
- aRange.aStart.Format( aRefStr, SCA_ABS_3D, pDoc, eConv );
+ OUString aRefStr(aRange.aStart.Format(SCA_ABS_3D, pDoc, eConv));
pLbCopyArea->SetEntryData( nInsert, new String( aRefStr ) );
}
@@ -177,12 +176,11 @@ void ScFilterOptionsMgr::Init()
if ( !rQueryData.bInplace )
{
- String aString;
-
- ScAddress( rQueryData.nDestCol,
- rQueryData.nDestRow,
- rQueryData.nDestTab
- ).Format( aString, SCA_ABS_3D, pDoc, eConv );
+ OUString aString =
+ ScAddress( rQueryData.nDestCol,
+ rQueryData.nDestRow,
+ rQueryData.nDestTab
+ ).Format(SCA_ABS_3D, pDoc, eConv);
pBtnCopyResult->Check( sal_True );
pEdCopyArea->SetText( aString );
diff --git a/sc/source/ui/dbgui/pfiltdlg.cxx b/sc/source/ui/dbgui/pfiltdlg.cxx
index 3f5f63e..3adaf16 100644
--- a/sc/source/ui/dbgui/pfiltdlg.cxx
+++ b/sc/source/ui/dbgui/pfiltdlg.cxx
@@ -153,7 +153,6 @@ void ScPivotFilterDlg::Init( const SfxItemSet& rArgSet )
if ( pViewData && pDoc )
{
- OUString theAreaStr;
ScRange theCurArea ( ScAddress( theQueryData.nCol1,
theQueryData.nRow1,
nSrcTab ),
@@ -168,7 +167,7 @@ void ScPivotFilterDlg::Init( const SfxItemSet& rArgSet )
* Bereich um einen Datenbankbereich handelt:
*/
- theCurArea.Format( theAreaStr, SCR_ABS_3D, pDoc, pDoc->GetAddressConvention() );
+ OUString theAreaStr(theCurArea.Format(SCR_ABS_3D, pDoc, pDoc->GetAddressConvention()));
if ( pDBColl )
{
diff --git a/sc/source/ui/dbgui/pvlaydlg.cxx b/sc/source/ui/dbgui/pvlaydlg.cxx
index 79178c9..4c30cb1 100644
--- a/sc/source/ui/dbgui/pvlaydlg.cxx
+++ b/sc/source/ui/dbgui/pvlaydlg.cxx
@@ -179,9 +179,8 @@ ScPivotLayoutDlg::ScPivotLayoutDlg( SfxBindings* pB, SfxChildWindow* pCW, Window
maEdInPos.SetText(aRangeName);
else
{
- OUString aStr;
maOldRange = p->GetSourceRange();
- maOldRange.Format(aStr, SCR_ABS_3D, mpDoc, mpDoc->GetAddressConvention());
+ OUString aStr(maOldRange.Format(SCR_ABS_3D, mpDoc, mpDoc->GetAddressConvention()));
maEdInPos.SetText(aStr);
}
}
@@ -221,14 +220,13 @@ ScPivotLayoutDlg::ScPivotLayoutDlg( SfxBindings* pB, SfxChildWindow* pCW, Window
ScAreaNameIterator aIter( mpDoc );
OUString aName;
ScRange aRange;
- OUString aRefStr;
while ( aIter.Next( aName, aRange ) )
{
if ( !aIter.WasDBName() ) // hier keine DB-Bereiche !
{
sal_uInt16 nInsert = maLbOutPos.InsertEntry( aName );
- aRange.aStart.Format( aRefStr, SCA_ABS_3D, mpDoc, mpDoc->GetAddressConvention() );
+ OUString aRefStr(aRange.aStart.Format(SCA_ABS_3D, mpDoc, mpDoc->GetAddressConvention()));
maRefStrs.push_back(new OUString(aRefStr));
maLbOutPos.SetEntryData(nInsert, &maRefStrs.back());
}
@@ -248,10 +246,10 @@ ScPivotLayoutDlg::ScPivotLayoutDlg( SfxBindings* pB, SfxChildWindow* pCW, Window
if ( maPivotData.nTab != MAXTAB+1 )
{
- OUString aStr;
- ScAddress( maPivotData.nCol,
- maPivotData.nRow,
- maPivotData.nTab ).Format( aStr, STD_FORMAT, mpDoc, mpDoc->GetAddressConvention() );
+ OUString aStr =
+ ScAddress( maPivotData.nCol,
+ maPivotData.nRow,
+ maPivotData.nTab ).Format(STD_FORMAT, mpDoc, mpDoc->GetAddressConvention());
maEdOutPos.SetText( aStr );
maOutputRefStr = aStr;
EdOutModifyHdl(0);
@@ -1470,14 +1468,12 @@ void ScPivotLayoutDlg::SetReference( const ScRange& rRef, ScDocument* pDoc )
if (mpRefInputEdit == &maEdInPos)
{
- OUString aRefStr;
- rRef.Format( aRefStr, SCR_ABS_3D, pDoc, pDoc->GetAddressConvention() );
+ OUString aRefStr(rRef.Format(SCR_ABS_3D, pDoc, pDoc->GetAddressConvention()));
mpRefInputEdit->SetRefString(aRefStr);
}
else if (mpRefInputEdit == &maEdOutPos)
{
- OUString aRefStr;
- rRef.aStart.Format( aRefStr, STD_FORMAT, pDoc, pDoc->GetAddressConvention() );
+ OUString aRefStr(rRef.aStart.Format(STD_FORMAT, pDoc, pDoc->GetAddressConvention()));
mpRefInputEdit->SetRefString(aRefStr);
maOutputRefStr = aRefStr;
OutputPosUpdated();
diff --git a/sc/source/ui/dbgui/sfiltdlg.cxx b/sc/source/ui/dbgui/sfiltdlg.cxx
index a8904cb..793691e 100644
--- a/sc/source/ui/dbgui/sfiltdlg.cxx
+++ b/sc/source/ui/dbgui/sfiltdlg.cxx
@@ -168,8 +168,7 @@ void ScSpecialFilterDlg::Init( const SfxItemSet& rArgSet )
ScRange aAdvSource;
if (rQueryItem.GetAdvancedQuerySource(aAdvSource))
{
- String aRefStr;
- aAdvSource.Format( aRefStr, SCR_ABS_3D, pDoc, pDoc->GetAddressConvention() );
+ OUString aRefStr(aAdvSource.Format(SCR_ABS_3D, pDoc, pDoc->GetAddressConvention()));
pEdFilterArea->SetRefString( aRefStr );
}
}
@@ -227,13 +226,13 @@ void ScSpecialFilterDlg::SetReference( const ScRange& rRef, ScDocument* pDocP )
if ( rRef.aStart != rRef.aEnd )
RefInputStart( pRefInputEdit );
- String aRefStr;
+ OUString aRefStr;
const formula::FormulaGrammar::AddressConvention eConv = pDocP->GetAddressConvention();
if ( pRefInputEdit == pEdCopyArea)
- rRef.aStart.Format( aRefStr, SCA_ABS_3D, pDocP, eConv );
+ aRefStr = rRef.aStart.Format(SCA_ABS_3D, pDocP, eConv);
else if ( pRefInputEdit == pEdFilterArea)
- rRef.Format( aRefStr, SCR_ABS_3D, pDocP, eConv );
+ aRefStr = rRef.Format(SCR_ABS_3D, pDocP, eConv);
pRefInputEdit->SetRefString( aRefStr );
}
diff --git a/sc/source/ui/dbgui/tpsort.cxx b/sc/source/ui/dbgui/tpsort.cxx
index 8ab5a74..e541a1a 100644
--- a/sc/source/ui/dbgui/tpsort.cxx
+++ b/sc/source/ui/dbgui/tpsort.cxx
@@ -593,7 +593,6 @@ void ScTabPageSortOptions::Init()
if ( pViewData && pDoc )
{
- String theArea;
ScDBCollection* pDBColl = pDoc->GetDBCollection();
const SCTAB nCurTab = pViewData->GetTabNo();
OUString theDbName = OUString(STR_DB_LOCAL_NONAME);
@@ -606,12 +605,11 @@ void ScTabPageSortOptions::Init()
ScAreaNameIterator aIter( pDoc );
OUString aName;
ScRange aRange;
- OUString aRefStr;
while ( aIter.Next( aName, aRange ) )
{
sal_uInt16 nInsert = m_pLbOutPos->InsertEntry( aName );
- aRange.aStart.Format( aRefStr, SCA_ABS_3D, pDoc, eConv );
+ OUString aRefStr(aRange.aStart.Format(SCA_ABS_3D, pDoc, eConv));
m_pLbOutPos->SetEntryData( nInsert, new OUString( aRefStr ) );
}
@@ -621,9 +619,10 @@ void ScTabPageSortOptions::Init()
// Check whether the field that is passed on is a database field:
ScAddress aScAddress( aSortData.nCol1, aSortData.nRow1, nCurTab );
- ScRange( aScAddress,
+ String theArea =
+ ScRange( aScAddress,
ScAddress( aSortData.nCol2, aSortData.nRow2, nCurTab )
- ).Format( theArea, SCR_ABS, pDoc, eConv );
+ ).Format(SCR_ABS, pDoc, eConv);
if ( pDBColl )
{
@@ -705,7 +704,6 @@ void ScTabPageSortOptions::Reset( const SfxItemSet& /* rArgSet */ )
if ( pDoc && !aSortData.bInplace )
{
- OUString aStr;
sal_uInt16 nFormat = (aSortData.nDestTab != pViewData->GetTabNo())
? SCR_ABS_3D
: SCR_ABS;
@@ -714,7 +712,7 @@ void ScTabPageSortOptions::Reset( const SfxItemSet& /* rArgSet */ )
aSortData.nDestRow,
aSortData.nDestTab );
- theOutPos.Format( aStr, nFormat, pDoc, pDoc->GetAddressConvention() );
+ OUString aStr(theOutPos.Format(nFormat, pDoc, pDoc->GetAddressConvention()));
m_pBtnCopyResult->Check();
m_pLbOutPos->Enable();
m_pEdOutPos->Enable();
diff --git a/sc/source/ui/dbgui/validate.cxx b/sc/source/ui/dbgui/validate.cxx
index 45e3694..0085edc 100644
--- a/sc/source/ui/dbgui/validate.cxx
+++ b/sc/source/ui/dbgui/validate.cxx
@@ -88,8 +88,7 @@ void ScTPValidationValue::SetReferenceHdl( const ScRange&rRange , ScDocument* pD
if ( m_pRefEdit )
{
- OUString aStr;
- rRange.Format( aStr, SCR_ABS_3D, pDoc );
+ OUString aStr(rRange.Format(SCR_ABS_3D, pDoc));
m_pRefEdit->SetRefString( aStr );
}
}
diff --git a/sc/source/ui/docshell/docfunc.cxx b/sc/source/ui/docshell/docfunc.cxx
index 81b315f..a150f62 100644
--- a/sc/source/ui/docshell/docfunc.cxx
+++ b/sc/source/ui/docshell/docfunc.cxx
@@ -4914,8 +4914,7 @@ void ScDocFunc::CreateOneName( ScRangeName& rList,
ScRangeData::MakeValidName(aName);
if (aName.Len())
{
- String aContent;
- ScRange( nX1, nY1, nTab, nX2, nY2, nTab ).Format( aContent, SCR_ABS_3D, pDoc );
+ String aContent(ScRange( nX1, nY1, nTab, nX2, nY2, nTab ).Format(SCR_ABS_3D, pDoc));
bool bInsert = false;
ScRangeData* pOld = rList.findByUpperName(ScGlobal::pCharClass->uppercase(aName));
diff --git a/sc/source/ui/docshell/docsh4.cxx b/sc/source/ui/docshell/docsh4.cxx
index 8d9e181..65ef96b 100644
--- a/sc/source/ui/docshell/docsh4.cxx
+++ b/sc/source/ui/docshell/docsh4.cxx
@@ -2083,10 +2083,10 @@ long ScDocShell::DdeGetData( const OUString& rItem,
if ( !aObj.IsRef() )
return 0; // ungueltiger Bereich
- if( aDdeTextFmt.GetChar(0) == 'F' )
+ if( aDdeTextFmt[0] == 'F' )
aObj.SetFormulas( sal_True );
- if( aDdeTextFmt.EqualsAscii( "SYLK" ) ||
- aDdeTextFmt.EqualsAscii( "FSYLK" ) )
+ if( aDdeTextFmt == "SYLK" ||
+ aDdeTextFmt == "FSYLK" )
{
OString aData;
if( aObj.ExportByteString( aData, osl_getThreadTextEncoding(),
@@ -2100,8 +2100,8 @@ long ScDocShell::DdeGetData( const OUString& rItem,
else
return 0;
}
- if( aDdeTextFmt.EqualsAscii( "CSV" ) ||
- aDdeTextFmt.EqualsAscii( "FCSV" ) )
+ if( aDdeTextFmt == "CSV" ||
+ aDdeTextFmt == "FCSV" )
aObj.SetSeparator( ',' );
aObj.SetExportTextOptions( ScExportTextOptions( ScExportTextOptions::ToSpace, 0, false ) );
return aObj.ExportData( rMimeType, rValue ) ? 1 : 0;
@@ -2124,26 +2124,26 @@ long ScDocShell::DdeSetData( const OUString& rItem,
{
if ( ScByteSequenceToString::GetString( aDdeTextFmt, rValue, osl_getThreadTextEncoding() ) )
{
- aDdeTextFmt.ToUpperAscii();
+ aDdeTextFmt = aDdeTextFmt.toAsciiUpperCase();
return 1;
}
return 0;
}
ScImportExport aObj( &aDocument, rItem );
- if( aDdeTextFmt.GetChar(0) == 'F' )
+ if( aDdeTextFmt[0] == 'F' )
aObj.SetFormulas( sal_True );
- if( aDdeTextFmt.EqualsAscii( "SYLK" ) ||
- aDdeTextFmt.EqualsAscii( "FSYLK" ) )
+ if( aDdeTextFmt == "SYLK" ||
+ aDdeTextFmt == "FSYLK" )
{
- String aData;
+ OUString aData;
if ( ScByteSequenceToString::GetString( aData, rValue, osl_getThreadTextEncoding() ) )
{
return aObj.ImportString( aData, SOT_FORMATSTR_ID_SYLK ) ? 1 : 0;
}
return 0;
}
- if( aDdeTextFmt.EqualsAscii( "CSV" ) ||
- aDdeTextFmt.EqualsAscii( "FCSV" ) )
+ if( aDdeTextFmt == "CSV" ||
+ aDdeTextFmt == "FCSV" )
aObj.SetSeparator( ',' );
return aObj.ImportData( rMimeType, rValue ) ? 1 : 0;
}
diff --git a/sc/source/ui/docshell/docsh8.cxx b/sc/source/ui/docshell/docsh8.cxx
index ae259c2..da29f00 100644
--- a/sc/source/ui/docshell/docsh8.cxx
+++ b/sc/source/ui/docshell/docsh8.cxx
@@ -514,20 +514,21 @@ void lcl_GetColumnTypes(
sal_Int32 nFieldLen = 0;
sal_Int32 nPrecision = 0;
sal_Int32 nDbType = sdbc::DataType::SQLNULL;
- String aFieldName, aString;
+ String aFieldName;
+ OUString aString;
// Feldname[,Type[,Width[,Prec]]]
// Typ etc.: L; D; C[,W]; N[,W[,P]]
if ( bHasFieldNames )
{
aString = pDoc->GetString(nCol, nFirstRow, nTab);
- aString.ToUpperAscii();
+ aString = aString.toAsciiUpperCase();
xub_StrLen nToken = comphelper::string::getTokenCount(aString, ',');
if ( nToken > 1 )
{
- aFieldName = aString.GetToken( 0, ',' );
+ aFieldName = aString.getToken( 0, ',' );
aString = comphelper::string::remove(aString, ' ');
- switch ( aString.GetToken( 1, ',' ).GetChar(0) )
+ switch ( aString.getToken( 1, ',' )[0] )
{
case 'L' :
nDbType = sdbc::DataType::BIT;
@@ -559,10 +560,10 @@ void lcl_GetColumnTypes(
}
if ( bTypeDefined && !nFieldLen && nToken > 2 )
{
- nFieldLen = aString.GetToken( 2, ',' ).ToInt32();
+ nFieldLen = aString.getToken( 2, ',' ).toInt32();
if ( !bPrecDefined && nToken > 3 )
{
- String aTmp( aString.GetToken( 3, ',' ) );
+ String aTmp( aString.getToken( 3, ',' ) );
if ( CharClass::isAsciiNumeric(aTmp) )
{
nPrecision = aTmp.ToInt32();
diff --git a/sc/source/ui/docshell/impex.cxx b/sc/source/ui/docshell/impex.cxx
index aae1b47..d46a1df 100644
--- a/sc/source/ui/docshell/impex.cxx
+++ b/sc/source/ui/docshell/impex.cxx
@@ -448,17 +448,17 @@ bool ScImportExport::ExportStream( SvStream& rStrm, const String& rBaseURL, sal_
if( aDocName.Len() )
{
// Always use Calc A1 syntax for paste link.
- String aRefName;
+ OUString aRefName;
sal_uInt16 nFlags = SCA_VALID | SCA_TAB_3D;
if( bSingle )
- aRange.aStart.Format( aRefName, nFlags, pDoc, formula::FormulaGrammar::CONV_OOO );
+ aRefName = aRange.aStart.Format(nFlags, pDoc, formula::FormulaGrammar::CONV_OOO);
else
{
if( aRange.aStart.Tab() != aRange.aEnd.Tab() )
nFlags |= SCA_TAB2_3D;
- aRange.Format( aRefName, nFlags, pDoc, formula::FormulaGrammar::CONV_OOO );
+ aRefName = aRange.Format(nFlags, pDoc, formula::FormulaGrammar::CONV_OOO);
}
- String aAppName = Application::GetAppName();
+ OUString aAppName = Application::GetAppName();
// extra bits are used to tell the client to prefer external
// reference link.
diff --git a/sc/source/ui/drawfunc/fuins2.cxx b/sc/source/ui/drawfunc/fuins2.cxx
index 695cbda..7c5b843 100644
--- a/sc/source/ui/drawfunc/fuins2.cxx
+++ b/sc/source/ui/drawfunc/fuins2.cxx
@@ -114,7 +114,7 @@ void lcl_ChartInit( const uno::Reference < embed::XEmbeddedObject >& xObj, ScVie
pDoc->LimitChartArea( nTab1, nCol1,nRow1, nCol2,nRow2 );
ScRange aRange( nCol1, nRow1, nTab1, nCol2, nRow2, nTab2 );
- aRange.Format( aRangeString, SCR_ABS_3D, pScDoc );
+ aRangeString = aRange.Format(SCR_ABS_3D, pScDoc);
}
}
}
diff --git a/sc/source/ui/formdlg/formula.cxx b/sc/source/ui/formdlg/formula.cxx
index 25ae7d0..a907e0c 100644
--- a/sc/source/ui/formdlg/formula.cxx
+++ b/sc/source/ui/formdlg/formula.cxx
@@ -408,8 +408,7 @@ void ScFormulaDlg::SetReference( const ScRange& rRef, ScDocument* pRefDoc )
OSL_ENSURE(rRef.aStart.Tab()==rRef.aEnd.Tab(), "nStartTab!=nEndTab");
- String aTmp;
- rRef.Format( aTmp, SCA_VALID|SCA_TAB_3D, pRefDoc ); // immer 3d
+ OUString aTmp(rRef.Format(SCA_VALID|SCA_TAB_3D, pRefDoc)); // immer 3d
SfxObjectShell* pObjSh = pRefDoc->GetDocumentShell();
diff --git a/sc/source/ui/inc/docsh.hxx b/sc/source/ui/inc/docsh.hxx
index 8e459ab..eeda036 100644
--- a/sc/source/ui/inc/docsh.hxx
+++ b/sc/source/ui/inc/docsh.hxx
@@ -85,7 +85,7 @@ class SC_DLLPUBLIC ScDocShell: public SfxObjectShell, public SfxListener
{
ScDocument aDocument;
- String aDdeTextFmt;
+ OUString aDdeTextFmt;
double nPrtToScreenFactor;
DocShell_Impl* pImpl;
@@ -376,7 +376,7 @@ public:
const ::com::sun::star::uno::Any & rValue );
virtual ::sfx2::SvLinkSource* DdeCreateLinkSource( const OUString& rItem );
- const String& GetDdeTextFmt() const { return aDdeTextFmt; }
+ const OUString& GetDdeTextFmt() const { return aDdeTextFmt; }
SfxBindings* GetViewBindings();
diff --git a/sc/source/ui/inc/navipi.hxx b/sc/source/ui/inc/navipi.hxx
index 8e8f8ac..ed355c9 100644
--- a/sc/source/ui/inc/navipi.hxx
+++ b/sc/source/ui/inc/navipi.hxx
@@ -145,9 +145,9 @@ private:
void EvalText ();
void ExecuteCol ();
- SCCOL AlphaToNum ( String& rStr );
- SCCOL NumStrToAlpha ( String& rStr );
- SCCOL NumToAlpha ( SCCOL nColNo, String& rStr );
+ SCCOL AlphaToNum ( OUString& rStr );
+ SCCOL NumStrToAlpha ( OUString& rStr );
+ SCCOL NumToAlpha ( SCCOL nColNo, OUString& rStr );
};
diff --git a/sc/source/ui/inc/viewfunc.hxx b/sc/source/ui/inc/viewfunc.hxx
index 3c6364c..93e04e7 100644
--- a/sc/source/ui/inc/viewfunc.hxx
+++ b/sc/source/ui/inc/viewfunc.hxx
@@ -158,7 +158,7 @@ public:
sal_uInt16 GetCreateNameFlags();
void InsertNameList();
sal_Bool InsertName( const String& rName, const String& rSymbol,
- const String& rType );
+ const OUString& rType );
void ApplyAttributes( const SfxItemSet* pDialogSet, const SfxItemSet* pOldSet,
sal_Bool bRecord = sal_True );
diff --git a/sc/source/ui/miscdlgs/acredlin.cxx b/sc/source/ui/miscdlgs/acredlin.cxx
index d3b1069..1eb077a 100644
--- a/sc/source/ui/miscdlgs/acredlin.cxx
+++ b/sc/source/ui/miscdlgs/acredlin.cxx
@@ -253,8 +253,7 @@ void ScAcceptChgDlg::Init()
if( !aChangeViewSet.GetTheRangeList().empty() )
{
const ScRange* pRangeEntry = aChangeViewSet.GetTheRangeList().front();
- String aRefStr;
- pRangeEntry->Format( aRefStr, ABS_DREF3D, pDoc );
+ OUString aRefStr(pRangeEntry->Format(ABS_DREF3D, pDoc));
pTPFilter->SetRange(aRefStr);
}
diff --git a/sc/source/ui/miscdlgs/crnrdlg.cxx b/sc/source/ui/miscdlgs/crnrdlg.cxx
index 3cf2f12..e017385 100644
--- a/sc/source/ui/miscdlgs/crnrdlg.cxx
+++ b/sc/source/ui/miscdlgs/crnrdlg.cxx
@@ -258,8 +258,7 @@ void ScColRowNameRangesDlg::SetColRowData( const ScRange& rLabelRange,sal_Bool b
if ( bValid )
{
const formula::FormulaGrammar::AddressConvention eConv = pDoc->GetAddressConvention();
- String aStr;
- theCurArea.Format( aStr, SCR_ABS_3D, pDoc, eConv );
+ OUString aStr(theCurArea.Format(SCR_ABS_3D, pDoc, eConv));
if(bRef)
pEdAssign->SetRefString( aStr );
@@ -267,7 +266,7 @@ void ScColRowNameRangesDlg::SetColRowData( const ScRange& rLabelRange,sal_Bool b
pEdAssign->SetText( aStr );
pEdAssign->SetSelection( Selection( SELECTION_MAX, SELECTION_MAX ) );
- theCurData.Format( aStr, SCR_ABS_3D, pDoc, eConv );
+ aStr = theCurData.Format(SCR_ABS_3D, pDoc, eConv);
if(bRef)
pEdAssign2->SetRefString( aStr );
@@ -361,8 +360,7 @@ void ScColRowNameRangesDlg::AdjustColRowData( const ScRange& rDataRange,sal_Bool
}
}
}
- String aStr;
- theCurData.Format( aStr, SCR_ABS_3D, pDoc, pDoc->GetAddressConvention() );
+ OUString aStr(theCurData.Format(SCR_ABS_3D, pDoc, pDoc->GetAddressConvention()));
if(bRef)
pEdAssign2->SetRefString( aStr );
@@ -512,7 +510,7 @@ void ScColRowNameRangesDlg::UpdateNames()
for ( j=0; j < nCount; j++ )
{
const ScRange aRange(ppSortArray[j]->GetRange(0));
- aRange.Format( aString, SCR_ABS_3D, pDoc, aDetails );
+ aString = aRange.Format(SCR_ABS_3D, pDoc, aDetails);
//@008 Hole Bereichsparameter aus Dok
ppSortArray[j]->GetRange(0).GetVars( nCol1, nRow1, nTab1,
@@ -559,7 +557,7 @@ void ScColRowNameRangesDlg::UpdateNames()
for ( j=0; j < nCount; j++ )
{
const ScRange aRange(ppSortArray[j]->GetRange(0));
- aRange.Format( aString, SCR_ABS_3D, pDoc, aDetails );
+ aString = aRange.Format(SCR_ABS_3D, pDoc, aDetails);
//@008 Ab hier baue String fuer Zeilen
ppSortArray[j]->GetRange(0).GetVars( nCol1, nRow1, nTab1,
@@ -625,16 +623,15 @@ void ScColRowNameRangesDlg::UpdateRangeData( const ScRange& rRange, sal_Bool bCo
if ( bFound )
{
const formula::FormulaGrammar::AddressConvention eConv = pDoc->GetAddressConvention();
- String aStr;
theCurArea = rRange;
- theCurArea.Format( aStr, SCR_ABS_3D, pDoc, eConv );
+ OUString aStr(theCurArea.Format(SCR_ABS_3D, pDoc, eConv));
pEdAssign->SetText( aStr );
pBtnAdd->Disable();
pBtnRemove->Enable();
pBtnColHead->Check( bColName );
pBtnRowHead->Check( !bColName );
theCurData = pPair->GetRange(1);
- theCurData.Format( aStr, SCR_ABS_3D, pDoc, eConv );
+ aStr = theCurData.Format(SCR_ABS_3D, pDoc, eConv);
pEdAssign2->SetText( aStr );
}
else
@@ -1076,8 +1073,7 @@ IMPL_LINK_NOARG(ScColRowNameRangesDlg, ColClickHdl)
if ( theCurArea.aStart.Row() == 0 && theCurArea.aEnd.Row() == MAXROW )
{
theCurArea.aEnd.SetRow( MAXROW - 1 );
- String aStr;
- theCurArea.Format( aStr, SCR_ABS_3D, pDoc, pDoc->GetAddressConvention() );
+ OUString aStr(theCurArea.Format(SCR_ABS_3D, pDoc, pDoc->GetAddressConvention()));
pEdAssign->SetText( aStr );
}
ScRange aRange( theCurData );
@@ -1114,8 +1110,7 @@ IMPL_LINK_NOARG(ScColRowNameRangesDlg, RowClickHdl)
if ( theCurArea.aStart.Col() == 0 && theCurArea.aEnd.Col() == MAXCOL )
{
theCurArea.aEnd.SetCol( MAXCOL - 1 );
- String aStr;
- theCurArea.Format( aStr, SCR_ABS_3D, pDoc, pDoc->GetAddressConvention() );
+ OUString aStr(theCurArea.Format(SCR_ABS_3D, pDoc, pDoc->GetAddressConvention()));
pEdAssign->SetText( aStr );
}
ScRange aRange( theCurData );
diff --git a/sc/source/ui/miscdlgs/highred.cxx b/sc/source/ui/miscdlgs/highred.cxx
index d863bdd..b86780f 100644
--- a/sc/source/ui/miscdlgs/highred.cxx
+++ b/sc/source/ui/miscdlgs/highred.cxx
@@ -135,9 +135,8 @@ void ScHighlightChgDlg::Init()
if ( !aChangeViewSet.GetTheRangeList().empty() )
{
- String aRefStr;
const ScRange* pRangeEntry = aChangeViewSet.GetTheRangeList().front();
- pRangeEntry->Format( aRefStr, ABS_DREF3D, pDoc );
+ OUString aRefStr(pRangeEntry->Format(ABS_DREF3D, pDoc));
aFilterCtr.SetRange(aRefStr);
}
aFilterCtr.Enable(sal_True,sal_True);
@@ -154,8 +153,7 @@ void ScHighlightChgDlg::SetReference( const ScRange& rRef, ScDocument* pDocP )
{
if ( rRef.aStart != rRef.aEnd )
RefInputStart(&aEdAssign);
- String aRefStr;
- rRef.Format( aRefStr, ABS_DREF3D, pDocP, pDocP->GetAddressConvention() );
+ OUString aRefStr(rRef.Format(ABS_DREF3D, pDocP, pDocP->GetAddressConvention()));
aEdAssign.SetRefString( aRefStr );
aFilterCtr.SetRange(aRefStr);
}
diff --git a/sc/source/ui/miscdlgs/optsolver.cxx b/sc/source/ui/miscdlgs/optsolver.cxx
index 12edd67..ecd4cd2 100644
--- a/sc/source/ui/miscdlgs/optsolver.cxx
+++ b/sc/source/ui/miscdlgs/optsolver.cxx
@@ -397,7 +397,7 @@ void ScOptSolverDlg::Init(const ScAddress& rCursorPos)
m_pRbMax->Check();
OUString aCursorStr;
if ( !mpDoc->GetRangeAtBlock( ScRange(rCursorPos), &aCursorStr ) )
- rCursorPos.Format( aCursorStr, SCA_ABS, NULL, mpDoc->GetAddressConvention() );
+ aCursorStr = rCursorPos.Format(SCA_ABS, NULL, mpDoc->GetAddressConvention());
m_pEdObjectiveCell->SetRefString( aCursorStr );
if ( nImplCount > 0 )
maEngine = maImplNames[0]; // use first implementation
@@ -516,9 +516,9 @@ void ScOptSolverDlg::SetReference( const ScRange& rRef, ScDocument* pDocP )
{
sal_uInt16 nFmt = ( aAdr.Tab() == mnCurTab ) ? SCA_ABS : SCA_ABS_3D;
if ( bSingle )
- aAdr.Format( aStr, nFmt, pDocP, pDocP->GetAddressConvention() );
+ aStr = aAdr.Format(nFmt, pDocP, pDocP->GetAddressConvention());
else
- rRef.Format( aStr, nFmt | SCR_ABS, pDocP, pDocP->GetAddressConvention() );
+ aStr = rRef.Format(nFmt | SCR_ABS, pDocP, pDocP->GetAddressConvention());
}
// variable cells can be several ranges, so only the selection is replaced
diff --git a/sc/source/ui/miscdlgs/simpref.cxx b/sc/source/ui/miscdlgs/simpref.cxx
index 7afa37c..93460a5 100644
--- a/sc/source/ui/miscdlgs/simpref.cxx
+++ b/sc/source/ui/miscdlgs/simpref.cxx
@@ -109,10 +109,10 @@ void ScSimpleRefDlg::SetReference( const ScRange& rRef, ScDocument* pDocP )
if ( bSingleCell )
{
ScAddress aAdr = rRef.aStart;
- aAdr.Format( aRefStr, SCA_ABS_3D, pDocP, pDocP->GetAddressConvention() );
+ aRefStr = aAdr.Format(SCA_ABS_3D, pDocP, pDocP->GetAddressConvention());
}
else
- theCurArea.Format( aRefStr, ABS_DREF3D, pDocP, pDocP->GetAddressConvention() );
+ aRefStr = theCurArea.Format(ABS_DREF3D, pDocP, pDocP->GetAddressConvention());
if ( bMultiSelection )
{
diff --git a/sc/source/ui/miscdlgs/solvrdlg.cxx b/sc/source/ui/miscdlgs/solvrdlg.cxx
index b7eae47..0a4d655 100644
--- a/sc/source/ui/miscdlgs/solvrdlg.cxx
+++ b/sc/source/ui/miscdlgs/solvrdlg.cxx
@@ -84,8 +84,6 @@ ScSolverDlg::~ScSolverDlg()
void ScSolverDlg::Init()
{
- String aStr;
-
m_pBtnOk->SetClickHdl( LINK( this, ScSolverDlg, BtnHdl ) );
m_pBtnCancel->SetClickHdl( LINK( this, ScSolverDlg, BtnHdl ) );
@@ -102,7 +100,7 @@ void ScSolverDlg::Init()
m_pEdVariableCell->SetLoseFocusHdl ( aLink );
m_pRBVariableCell->SetLoseFocusHdl ( aLink );
- theFormulaCell.Format( aStr, SCA_ABS, NULL, pDoc->GetAddressConvention() );
+ OUString aStr(theFormulaCell.Format(SCA_ABS, NULL, pDoc->GetAddressConvention()));
m_pEdFormulaCell->SetText( aStr );
m_pEdFormulaCell->GrabFocus();
@@ -142,13 +140,12 @@ void ScSolverDlg::SetReference( const ScRange& rRef, ScDocument* pDocP )
if ( rRef.aStart != rRef.aEnd )
RefInputStart(pEdActive);
- String aStr;
ScAddress aAdr = rRef.aStart;
sal_uInt16 nFmt = ( aAdr.Tab() == nCurTab )
? SCA_ABS
: SCA_ABS_3D;
- aAdr.Format( aStr, nFmt, pDocP, pDocP->GetAddressConvention() );
+ OUString aStr(aAdr.Format(nFmt, pDocP, pDocP->GetAddressConvention()));
pEdActive->SetRefString( aStr );
if ( pEdActive == m_pEdFormulaCell )
diff --git a/sc/source/ui/miscdlgs/tabopdlg.cxx b/sc/source/ui/miscdlgs/tabopdlg.cxx
index 443b87e..12a344f 100644
--- a/sc/source/ui/miscdlgs/tabopdlg.cxx
+++ b/sc/source/ui/miscdlgs/tabopdlg.cxx
@@ -144,7 +144,7 @@ void ScTabOpDlg::SetReference( const ScRange& rRef, ScDocument* pDocP )
if ( rRef.aStart != rRef.aEnd )
RefInputStart(pEdActive);
- String aStr;
+ OUString aStr;
sal_uInt16 nFmt = ( rRef.aStart.Tab() == nCurTab )
? SCR_ABS
: SCR_ABS_3D;
@@ -153,17 +153,17 @@ void ScTabOpDlg::SetReference( const ScRange& rRef, ScDocument* pDocP )
{
theFormulaCell.Set( rRef.aStart, false, false, false);
theFormulaEnd.Set( rRef.aEnd, false, false, false);
- rRef.Format( aStr, nFmt, pDocP, aDetails );
+ aStr = rRef.Format(nFmt, pDocP, aDetails);
}
else if ( pEdActive == &aEdRowCell )
{
theRowCell.Set( rRef.aStart, false, false, false);
- rRef.aStart.Format( aStr, nFmt, pDocP, aDetails );
+ aStr = rRef.aStart.Format(nFmt, pDocP, aDetails);
}
else if ( pEdActive == &aEdColCell )
{
theColCell.Set( rRef.aStart, false, false, false);
- rRef.aStart.Format( aStr, nFmt, pDocP, aDetails );
+ aStr = rRef.aStart.Format(nFmt, pDocP, aDetails);
}
pEdActive->SetRefString( aStr );
diff --git a/sc/source/ui/namedlg/namedefdlg.cxx b/sc/source/ui/namedlg/namedefdlg.cxx
index 3804fca..62e13fd 100644
--- a/sc/source/ui/namedlg/namedefdlg.cxx
+++ b/sc/source/ui/namedlg/namedefdlg.cxx
@@ -78,12 +78,11 @@ ScNameDefDlg::ScNameDefDlg( SfxBindings* pB, SfxChildWindow* pCW, Window* pParen
m_pBtnAdd->Disable(); // empty name is invalid
- String aAreaStr;
ScRange aRange;
pViewData->GetSimpleArea( aRange );
- aRange.Format( aAreaStr, ABS_DREF3D, mpDoc,
- ScAddress::Details(mpDoc->GetAddressConvention(), 0, 0) );
+ OUString aAreaStr(aRange.Format(ABS_DREF3D, mpDoc,
+ ScAddress::Details(mpDoc->GetAddressConvention(), 0, 0)));
m_pEdRange->SetText( aAreaStr );
@@ -288,9 +287,8 @@ void ScNameDefDlg::SetReference( const ScRange& rRef, ScDocument* pDocP )
{
if ( rRef.aStart != rRef.aEnd )
RefInputStart(m_pEdRange);
- String aRefStr;
- rRef.Format( aRefStr, ABS_DREF3D, pDocP,
- ScAddress::Details(pDocP->GetAddressConvention(), 0, 0) );
+ OUString aRefStr(rRef.Format(ABS_DREF3D, pDocP,
+ ScAddress::Details(pDocP->GetAddressConvention(), 0, 0)));
m_pEdRange->SetRefString( aRefStr );
}
}
diff --git a/sc/source/ui/namedlg/namedlg.cxx b/sc/source/ui/namedlg/namedlg.cxx
index 10080fb..b013ba5 100644
--- a/sc/source/ui/namedlg/namedlg.cxx
+++ b/sc/source/ui/namedlg/namedlg.cxx
@@ -173,9 +173,8 @@ void ScNameDlg::SetReference( const ScRange& rRef, ScDocument* pDocP )
{
if ( rRef.aStart != rRef.aEnd )
RefInputStart(m_pEdAssign);
- String aRefStr;
... etc. - the rest is truncated
More information about the Libreoffice-commits
mailing list