[Libreoffice-commits] .: 2 commits - sc/inc sc/qa sc/source
Markus Mohrhard
mmohrhard at kemper.freedesktop.org
Sun Nov 6 20:28:25 PST 2011
sc/inc/cell.hxx | 3
sc/inc/cellform.hxx | 4
sc/inc/column.hxx | 6
sc/inc/document.hxx | 641 +++++++++++++--------------
sc/inc/global.hxx | 2
sc/inc/queryparam.hxx | 2
sc/inc/rangelst.hxx | 3
sc/inc/table.hxx | 30 -
sc/inc/tablink.hxx | 4
sc/qa/unit/helper/csv_handler.hxx | 4
sc/source/core/data/attarray.cxx | 8
sc/source/core/data/cell.cxx | 7
sc/source/core/data/column2.cxx | 19
sc/source/core/data/column3.cxx | 37 -
sc/source/core/data/dociter.cxx | 8
sc/source/core/data/documen2.cxx | 110 ++--
sc/source/core/data/documen3.cxx | 203 ++++----
sc/source/core/data/documen4.cxx | 146 +++---
sc/source/core/data/documen5.cxx | 90 +--
sc/source/core/data/documen6.cxx | 26 -
sc/source/core/data/documen7.cxx | 46 -
sc/source/core/data/documen8.cxx | 146 +++---
sc/source/core/data/documen9.cxx | 58 +-
sc/source/core/data/document.cxx | 305 ++++++------
sc/source/core/data/fillinfo.cxx | 106 ++--
sc/source/core/data/global.cxx | 2
sc/source/core/data/table2.cxx | 17
sc/source/core/data/table3.cxx | 58 +-
sc/source/core/data/table4.cxx | 17
sc/source/core/data/table5.cxx | 4
sc/source/core/data/table6.cxx | 12
sc/source/core/tool/cellform.cxx | 54 +-
sc/source/core/tool/charthelper.cxx | 10
sc/source/core/tool/chgtrack.cxx | 2
sc/source/core/tool/doubleref.cxx | 2
sc/source/core/tool/interpr1.cxx | 4
sc/source/core/tool/queryparam.cxx | 3
sc/source/core/tool/rangelst.cxx | 15
sc/source/filter/dif/difimp.cxx | 4
sc/source/filter/excel/excform.cxx | 2
sc/source/filter/excel/excimp8.cxx | 2
sc/source/filter/excel/impop.cxx | 2
sc/source/filter/excel/xipivot.cxx | 9
sc/source/filter/html/htmlexp.cxx | 13
sc/source/filter/lotus/lotimpop.cxx | 12
sc/source/filter/lotus/op.cxx | 12
sc/source/filter/lotus/tool.cxx | 2
sc/source/filter/qpro/qpro.cxx | 8
sc/source/filter/rtf/rtfexp.cxx | 2
sc/source/filter/starcalc/scflt.cxx | 2
sc/source/filter/xcl97/XclExpChangeTrack.cxx | 2
sc/source/filter/xml/XMLCodeNameProvider.cxx | 6
sc/source/ui/app/inputhdl.cxx | 4
sc/source/ui/docshell/docfunc.cxx | 9
sc/source/ui/docshell/docsh.cxx | 63 +-
sc/source/ui/docshell/docsh3.cxx | 6
sc/source/ui/docshell/docsh4.cxx | 10
sc/source/ui/docshell/docsh5.cxx | 10
sc/source/ui/docshell/docsh6.cxx | 10
sc/source/ui/docshell/docsh8.cxx | 10
sc/source/ui/docshell/impex.cxx | 2
sc/source/ui/docshell/tablink.cxx | 12
sc/source/ui/drawfunc/fuins2.cxx | 2
sc/source/ui/inc/docsh.hxx | 2
sc/source/ui/inc/linkarea.hxx | 2
sc/source/ui/inc/undodat.hxx | 14
sc/source/ui/miscdlgs/instbdlg.cxx | 4
sc/source/ui/miscdlgs/linkarea.cxx | 8
sc/source/ui/miscdlgs/mvtabdlg.cxx | 6
sc/source/ui/miscdlgs/optsolver.cxx | 4
sc/source/ui/navipi/content.cxx | 10
sc/source/ui/undo/undodat.cxx | 8
sc/source/ui/undo/undotab.cxx | 6
sc/source/ui/unoobj/cellsuno.cxx | 16
sc/source/ui/unoobj/docuno.cxx | 4
sc/source/ui/unoobj/linkuno.cxx | 10
sc/source/ui/unoobj/styleuno.cxx | 4
sc/source/ui/view/dbfunc3.cxx | 2
sc/source/ui/view/dbfunc4.cxx | 6
sc/source/ui/view/formatsh.cxx | 2
sc/source/ui/view/gridwin.cxx | 7
sc/source/ui/view/output2.cxx | 8
sc/source/ui/view/printfun.cxx | 2
sc/source/ui/view/tabcont.cxx | 2
sc/source/ui/view/viewfun2.cxx | 9
85 files changed, 1309 insertions(+), 1257 deletions(-)
New commits:
commit cc59e69c6f2c95a4434623dfea9ab666de6ebe76
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date: Sun Nov 6 18:11:43 2011 +0100
String->OUString in ScDocument and follow up
diff --git a/sc/inc/cell.hxx b/sc/inc/cell.hxx
index 7551ba6..875e7da 100644
--- a/sc/inc/cell.hxx
+++ b/sc/inc/cell.hxx
@@ -236,6 +236,7 @@ public:
inline void SetString( const String& rString ) { maString = rString; }
inline void GetString( String& rString ) const { rString = maString; }
+ inline void GetString( rtl::OUString& rString ) const { rString = maString; }
inline const String& GetString() const { return maString; }
private:
@@ -394,6 +395,8 @@ public:
void GetFormula( String& rFormula,
const formula::FormulaGrammar::Grammar = formula::FormulaGrammar::GRAM_DEFAULT ) const;
+ void GetFormula( rtl::OUString& rFormula,
+ const formula::FormulaGrammar::Grammar = formula::FormulaGrammar::GRAM_DEFAULT ) const;
void GetFormula( rtl::OUStringBuffer& rBuffer,
const formula::FormulaGrammar::Grammar = formula::FormulaGrammar::GRAM_DEFAULT ) const;
diff --git a/sc/inc/cellform.hxx b/sc/inc/cellform.hxx
index 70f0263..cdfa09c 100644
--- a/sc/inc/cellform.hxx
+++ b/sc/inc/cellform.hxx
@@ -49,13 +49,13 @@ enum ScForceTextFmt {
class SC_DLLPUBLIC ScCellFormat
{
public:
- static void GetString( ScBaseCell* pCell, sal_uLong nFormat, String& rString,
+ static void GetString( ScBaseCell* pCell, sal_uLong nFormat, rtl::OUString& rString,
Color** ppColor, SvNumberFormatter& rFormatter,
sal_Bool bNullVals = sal_True,
sal_Bool bFormula = false,
ScForceTextFmt eForceTextFmt = ftDontForce );
- static void GetInputString( ScBaseCell* pCell, sal_uLong nFormat, String& rString,
+ static void GetInputString( ScBaseCell* pCell, sal_uLong nFormat, rtl::OUString& rString,
SvNumberFormatter& rFormatter );
};
diff --git a/sc/inc/column.hxx b/sc/inc/column.hxx
index 5daecd5..b97a899 100644
--- a/sc/inc/column.hxx
+++ b/sc/inc/column.hxx
@@ -251,10 +251,10 @@ public:
void SetValue( SCROW nRow, const double& rVal);
void SetError( SCROW nRow, const sal_uInt16 nError);
- void GetString( SCROW nRow, String& rString ) const;
- void GetInputString( SCROW nRow, String& rString ) const;
+ void GetString( SCROW nRow, rtl::OUString& rString ) const;
+ void GetInputString( SCROW nRow, rtl::OUString& rString ) const;
double GetValue( SCROW nRow ) const;
- void GetFormula( SCROW nRow, String& rFormula ) const;
+ void GetFormula( SCROW nRow, rtl::OUString& rFormula ) const;
CellType GetCellType( SCROW nRow ) const;
SCSIZE GetCellCount() const { return nCount; }
sal_uInt32 GetWeightedCount() const;
diff --git a/sc/inc/document.hxx b/sc/inc/document.hxx
index 785a246..b98e428 100644
--- a/sc/inc/document.hxx
+++ b/sc/inc/document.hxx
@@ -195,7 +195,7 @@ enum ScDocumentMode
struct ScDocStat
{
- String aDocName;
+ rtl::OUString aDocName;
SCTAB nTableCount;
sal_uLong nCellCount;
sal_uInt16 nPageCount;
@@ -278,8 +278,8 @@ private:
mutable ::std::auto_ptr< ScFormulaParserPool >
mxFormulaParserPool; /// Pool for all external formula parsers used by this document.
- String aDocName; // optional: name of document
- String aDocCodeName; // optional: name of document (twice?)
+ rtl::OUString aDocName; // optional: name of document
+ rtl::OUString aDocCodeName; // optional: name of document (twice?)
ScRangePairListRef xColNameRanges;
ScRangePairListRef xRowNameRanges;
@@ -426,10 +426,10 @@ public:
inline ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >
GetServiceManager() const { return xServiceManager; }
- SC_DLLPUBLIC const String& GetName() const { return aDocName; }
- void SetName( const String& r ) { aDocName = r; }
- const String& GetCodeName() const { return aDocCodeName; }
- void SetCodeName( const String& r ) { aDocCodeName = r; }
+ SC_DLLPUBLIC const rtl::OUString& GetName() const { return aDocName; }
+ void SetName( const rtl::OUString& r ) { aDocName = r; }
+ const rtl::OUString& GetCodeName() const { return aDocCodeName; }
+ void SetCodeName( const rtl::OUString& r ) { aDocCodeName = r; }
void GetDocStat( ScDocStat& rDocStat );
@@ -489,7 +489,7 @@ public:
const ScDBData* GetFilterDBAtTable(SCTAB nTab) const;
- SC_DLLPUBLIC const ScRangeData* GetRangeAtBlock( const ScRange& rBlock, String* pName=NULL ) const;
+ SC_DLLPUBLIC const ScRangeData* GetRangeAtBlock( const ScRange& rBlock, rtl::OUString* pName=NULL ) const;
SC_DLLPUBLIC ScDPCollection* GetDPCollection();
ScDPObject* GetDPAtCursor(SCCOL nCol, SCROW nRow, SCTAB nTab) const;
@@ -502,22 +502,22 @@ public:
void EnsureGraphicNames();
SdrObject* GetObjectAtPoint( SCTAB nTab, const Point& rPos );
- bool HasChartAtPoint( SCTAB nTab, const Point& rPos, String* pName = NULL );
+ bool HasChartAtPoint( SCTAB nTab, const Point& rPos, rtl::OUString& rName );
- ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XChartDocument > GetChartByName( const String& rChartName );
- SC_DLLPUBLIC void GetChartRanges( const String& rChartName, ::std::vector< ScRangeList >& rRanges, ScDocument* pSheetNameDoc );
- void SetChartRanges( const String& rChartName, const ::std::vector< ScRangeList >& rRanges );
+ ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XChartDocument > GetChartByName( const rtl::OUString& rChartName );
+ SC_DLLPUBLIC void GetChartRanges( const rtl::OUString& rChartName, ::std::vector< ScRangeList >& rRanges, ScDocument* pSheetNameDoc );
+ void SetChartRanges( const rtl::OUString& rChartName, const ::std::vector< ScRangeList >& rRanges );
- void UpdateChartArea( const String& rChartName, const ScRange& rNewArea,
+ void UpdateChartArea( const rtl::OUString& rChartName, const ScRange& rNewArea,
bool bColHeaders, bool bRowHeaders, bool bAdd );
- void UpdateChartArea( const String& rChartName,
+ void UpdateChartArea( const rtl::OUString& rChartName,
const ScRangeListRef& rNewList,
bool bColHeaders, bool bRowHeaders, bool bAdd );
- void GetOldChartParameters( const String& rName,
+ void GetOldChartParameters( const rtl::OUString& rName,
ScRangeList& rRanges, bool& rColHeaders, bool& rRowHeaders );
::com::sun::star::uno::Reference<
::com::sun::star::embed::XEmbeddedObject >
- FindOleObjectByName( const String& rName );
+ FindOleObjectByName( const rtl::OUString& rName );
SC_DLLPUBLIC void MakeTable( SCTAB nTab,bool _bNeedsNameCheck = true );
@@ -568,23 +568,22 @@ public:
void SetEmbedded( const Rectangle& rRect ); // from VisArea (1/100 mm)
void SnapVisArea( Rectangle& rRect ) const; // 1/100 mm
- static SC_DLLPUBLIC bool ValidTabName( const String& rName );
+ static SC_DLLPUBLIC bool ValidTabName( const rtl::OUString& rName );
- SC_DLLPUBLIC bool ValidNewTabName( const String& rName ) const;
- SC_DLLPUBLIC bool ValidNewTabName( const std::vector<String>& rName ) const;
- SC_DLLPUBLIC void CreateValidTabName(String& rName) const;
+ SC_DLLPUBLIC bool ValidNewTabName( const rtl::OUString& rName ) const;
+ SC_DLLPUBLIC bool ValidNewTabName( const std::vector<rtl::OUString>& rName ) const;
SC_DLLPUBLIC void CreateValidTabName(rtl::OUString& rName) const;
SC_DLLPUBLIC void CreateValidTabNames(std::vector<rtl::OUString>& aNames, SCTAB nCount) const;
void AppendTabOnLoad(const rtl::OUString& rName);
- SC_DLLPUBLIC bool InsertTab( SCTAB nPos, const String& rName,
+ SC_DLLPUBLIC bool InsertTab( SCTAB nPos, const rtl::OUString& rName,
bool bExternalDocument = false );
SC_DLLPUBLIC bool InsertTabs( SCTAB nPos, const std::vector<rtl::OUString>& rNames,
bool bExternalDocument = false, bool bNamesValid = false );
SC_DLLPUBLIC bool DeleteTabs( SCTAB nTab, SCTAB nSheets, ScDocument* pRefUndoDoc = NULL );
SC_DLLPUBLIC bool DeleteTab( SCTAB nTab, ScDocument* pRefUndoDoc = NULL );
- SC_DLLPUBLIC bool RenameTab( SCTAB nTab, const String& rName,
+ SC_DLLPUBLIC bool RenameTab( SCTAB nTab, const rtl::OUString& rName,
bool bUpdateRef = true,
bool bExternalDocument = false );
bool MoveTab( SCTAB nOldPos, SCTAB nNewPos, ScProgress* pProgress = NULL );
@@ -609,7 +608,7 @@ public:
SC_DLLPUBLIC bool IsScenario( SCTAB nTab ) const;
SC_DLLPUBLIC void GetScenarioData( SCTAB nTab, rtl::OUString& rComment,
Color& rColor, sal_uInt16& rFlags ) const;
- SC_DLLPUBLIC void SetScenarioData( SCTAB nTab, const String& rComment,
+ SC_DLLPUBLIC void SetScenarioData( SCTAB nTab, const rtl::OUString& rComment,
const Color& rColor, sal_uInt16 nFlags );
SC_DLLPUBLIC Color GetTabBgColor( SCTAB nTab ) const;
SC_DLLPUBLIC void SetTabBgColor( SCTAB nTab, const Color& rColor );
@@ -622,19 +621,19 @@ public:
void SetGrammar( formula::FormulaGrammar::Grammar eGram );
SC_DLLPUBLIC sal_uInt8 GetLinkMode( SCTAB nTab ) const;
bool IsLinked( SCTAB nTab ) const;
- SC_DLLPUBLIC const String& GetLinkDoc( SCTAB nTab ) const;
- const String& GetLinkFlt( SCTAB nTab ) const;
- const String& GetLinkOpt( SCTAB nTab ) const;
- SC_DLLPUBLIC const String& GetLinkTab( SCTAB nTab ) const;
- sal_uLong GetLinkRefreshDelay( SCTAB nTab ) const;
- void SetLink( SCTAB nTab, sal_uInt8 nMode, const String& rDoc,
- const String& rFilter, const String& rOptions,
- const String& rTabName, sal_uLong nRefreshDelay );
- bool HasLink( const String& rDoc,
- const String& rFilter, const String& rOptions ) const;
- SC_DLLPUBLIC bool LinkExternalTab( SCTAB& nTab, const String& aDocTab,
- const String& aFileName,
- const String& aTabName );
+ SC_DLLPUBLIC const rtl::OUString GetLinkDoc( SCTAB nTab ) const;
+ const rtl::OUString GetLinkFlt( SCTAB nTab ) const;
+ const rtl::OUString GetLinkOpt( SCTAB nTab ) const;
+ SC_DLLPUBLIC const rtl::OUString GetLinkTab( SCTAB nTab ) const;
+ sal_uLong GetLinkRefreshDelay( SCTAB nTab ) const;
+ void SetLink( SCTAB nTab, sal_uInt8 nMode, const rtl::OUString& rDoc,
+ const rtl::OUString& rFilter, const rtl::OUString& rOptions,
+ const rtl::OUString& rTabName, sal_uLong nRefreshDelay );
+ bool HasLink( const rtl::OUString& rDoc,
+ const rtl::OUString& rFilter, const rtl::OUString& rOptions ) const;
+ SC_DLLPUBLIC bool LinkExternalTab( SCTAB& nTab, const rtl::OUString& aDocTab,
+ const rtl::OUString& aFileName,
+ const rtl::OUString& aTabName );
bool HasExternalRefManager() const { return pExternalRefMgr.get(); }
SC_DLLPUBLIC ScExternalRefManager* GetExternalRefManager() const;
@@ -662,12 +661,12 @@ public:
// for StarOne Api:
sal_uInt16 GetDdeLinkCount() const;
- bool UpdateDdeLink( const String& rAppl, const String& rTopic, const String& rItem );
+ bool UpdateDdeLink( const rtl::OUString& rAppl, const rtl::OUString& rTopic, const rtl::OUString& rItem );
/** Tries to find a DDE link with the specified connection data.
@param rnDdePos (out-param) Returns the index of the DDE link (does not include other links from link manager).
@return true = DDE link found, rnDdePos valid. */
- SC_DLLPUBLIC bool FindDdeLink( const String& rAppl, const String& rTopic, const String& rItem, sal_uInt8 nMode, sal_uInt16& rnDdePos );
+ SC_DLLPUBLIC bool FindDdeLink( const rtl::OUString& rAppl, const rtl::OUString& rTopic, const rtl::OUString& rItem, sal_uInt8 nMode, sal_uInt16& rnDdePos );
/** Returns the connection data of the specified DDE link.
@param nDdePos Index of the DDE link (does not include other links from link manager).
@@ -675,7 +674,7 @@ public:
@param rTopic (out-param) The DDE topic.
@param rItem (out-param) The DDE item.
@return true = DDE link found, out-parameters valid. */
- bool GetDdeLinkData( sal_uInt16 nDdePos, String& rAppl, String& rTopic, String& rItem ) const;
+ bool GetDdeLinkData( sal_uInt16 nDdePos, rtl::OUString& rAppl, rtl::OUString& rTopic, rtl::OUString& rItem ) const;
/** Returns the link mode of the specified DDE link.
@param nDdePos Index of the DDE link (does not include other links from link manager).
@param rnMode (out-param) The link mode of the specified DDE link.
@@ -689,7 +688,7 @@ public:
/** Tries to find a DDE link or creates a new, if not extant.
@param pResults If not 0, sets the matrix as as DDE link result matrix (also for existing links).
@return true = DDE link found; false = Unpredictable error occurred, no DDE link created. */
- SC_DLLPUBLIC bool CreateDdeLink( const String& rAppl, const String& rTopic, const String& rItem, sal_uInt8 nMode, ScMatrixRef pResults );
+ SC_DLLPUBLIC bool CreateDdeLink( const rtl::OUString& rAppl, const rtl::OUString& rTopic, const rtl::OUString& rItem, sal_uInt8 nMode, ScMatrixRef pResults );
/** Sets a result matrix for the specified DDE link.
@param nDdePos Index of the DDE link (does not include other links from link manager).
@param pResults The array containing all results of the DDE link (intrusive-ref-counted, do not delete).
@@ -717,7 +716,7 @@ public:
SCCOL nCol2, SCROW nRow2, SCTAB nTab2,
SCsCOL nDx, SCsROW nDy, SCsTAB nDz );
//! only assigns the new RangeList, no ChartListener or the like
- void SetChartRangeList( const String& rChartName,
+ void SetChartRangeList( const rtl::OUString& rChartName,
const ScRangeListRef& rNewRangeListRef );
void StartAnimations( SCTAB nTab, Window* pWin );
@@ -753,7 +752,7 @@ public:
sal_uLong nFormatIndex, bool bForceTab = false);
// return TRUE = number format is set
SC_DLLPUBLIC bool SetString(
- SCCOL nCol, SCROW nRow, SCTAB nTab, const String& rString,
+ SCCOL nCol, SCROW nRow, SCTAB nTab, const rtl::OUString& rString,
ScSetStringParam* pParam = NULL );
SC_DLLPUBLIC void SetValue( SCCOL nCol, SCROW nRow, SCTAB nTab, const double& rVal );
void SetError( SCCOL nCol, SCROW nRow, SCTAB nTab, const sal_uInt16 nError);
@@ -761,7 +760,7 @@ public:
SC_DLLPUBLIC void InsertMatrixFormula(SCCOL nCol1, SCROW nRow1,
SCCOL nCol2, SCROW nRow2,
const ScMarkData& rMark,
- const String& rFormula,
+ const rtl::OUString& rFormula,
const ScTokenArray* p = NULL,
const formula::FormulaGrammar::Grammar = formula::FormulaGrammar::GRAM_DEFAULT );
SC_DLLPUBLIC void InsertTableOp(const ScTabOpParam& rParam, // multi-operation
@@ -1144,7 +1143,7 @@ public:
sal_uLong nFillCount, FillDir eFillDir = FILL_TO_BOTTOM,
FillCmd eFillCmd = FILL_LINEAR, FillDateCmd eFillDateCmd = FILL_DAY,
double nStepValue = 1.0, double nMaxValue = 1E307);
- String GetAutoFillPreview( const ScRange& rSource, SCCOL nEndX, SCROW nEndY );
+ rtl::OUString GetAutoFillPreview( const ScRange& rSource, SCCOL nEndX, SCROW nEndY );
bool GetSelectionFunction( ScSubTotalFunc eFunc,
const ScAddress& rCursor, const ScMarkData& rMark,
@@ -1161,8 +1160,8 @@ public:
const SfxPoolItem* GetEffItem( SCCOL nCol, SCROW nRow, SCTAB nTab, sal_uInt16 nWhich ) const;
SC_DLLPUBLIC const ::com::sun::star::uno::Reference< ::com::sun::star::i18n::XBreakIterator >& GetBreakIterator();
- bool HasStringWeakCharacters( const String& rString );
- SC_DLLPUBLIC sal_uInt8 GetStringScriptType( const String& rString );
+ bool HasStringWeakCharacters( const rtl::OUString& rString );
+ SC_DLLPUBLIC sal_uInt8 GetStringScriptType( const rtl::OUString& rString );
SC_DLLPUBLIC sal_uInt8 GetCellScriptType( ScBaseCell* pCell, sal_uLong nNumberFormat );
SC_DLLPUBLIC sal_uInt8 GetScriptType( SCCOL nCol, SCROW nRow, SCTAB nTab, ScBaseCell* pCell = NULL );
@@ -1274,7 +1273,7 @@ public:
bool Solver(SCCOL nFCol, SCROW nFRow, SCTAB nFTab,
SCCOL nVCol, SCROW nVRow, SCTAB nVTab,
- const String& sValStr, double& nX);
+ const rtl::OUString& sValStr, double& nX);
void ApplySelectionPattern( const ScPatternAttr& rAttr, const ScMarkData& rMark,
ScEditDataArray* pDataArray = NULL );
@@ -1407,8 +1406,8 @@ public:
SC_DLLPUBLIC ScStyleSheetPool* GetStyleSheetPool() const;
// PageStyle:
- SC_DLLPUBLIC const String& GetPageStyle( SCTAB nTab ) const;
- SC_DLLPUBLIC void SetPageStyle( SCTAB nTab, const String& rName );
+ SC_DLLPUBLIC const rtl::OUString GetPageStyle( SCTAB nTab ) const;
+ SC_DLLPUBLIC void SetPageStyle( SCTAB nTab, const rtl::OUString& rName );
Size GetPageSize( SCTAB nTab ) const;
void SetPageSize( SCTAB nTab, const Size& rSize );
void SetRepeatArea( SCTAB nTab, SCCOL nStartCol, SCCOL nEndCol, SCROW nStartRow, SCROW nEndRow );
@@ -1417,13 +1416,13 @@ public:
void RemoveManualBreaks( SCTAB nTab );
bool HasManualBreaks( SCTAB nTab ) const;
- bool IsPageStyleInUse( const String& rStrPageStyle, SCTAB* pInTab = NULL );
- bool RemovePageStyleInUse( const String& rStrPageStyle );
- bool RenamePageStyleInUse( const String& rOld, const String& rNew );
+ bool IsPageStyleInUse( const rtl::OUString& rStrPageStyle, SCTAB* pInTab = NULL );
+ bool RemovePageStyleInUse( const rtl::OUString& rStrPageStyle );
+ bool RenamePageStyleInUse( const rtl::OUString& rOld, const rtl::OUString& rNew );
void ModifyStyleSheet( SfxStyleSheetBase& rPageStyle,
const SfxItemSet& rChanges );
- void PageStyleModified( SCTAB nTab, const String& rNewName );
+ void PageStyleModified( SCTAB nTab, const rtl::OUString& rNewName );
SC_DLLPUBLIC bool NeedPageResetAfterTab( SCTAB nTab ) const;
@@ -1474,7 +1473,7 @@ public:
SCSIZE Query( SCTAB nTab, const ScQueryParam& rQueryParam, bool bKeepSub );
SC_DLLPUBLIC bool CreateQueryParam( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2,
SCTAB nTab, ScQueryParam& rQueryParam );
- void GetUpperCellString(SCCOL nCol, SCROW nRow, SCTAB nTab, String& rStr);
+ void GetUpperCellString(SCCOL nCol, SCROW nRow, SCTAB nTab, rtl::OUString& rStr);
bool GetFilterEntries( SCCOL nCol, SCROW nRow, SCTAB nTab,
bool bFilter, TypedScStrCollection& rStrings, bool& rHasDates);
@@ -1505,7 +1504,7 @@ public:
void DoColResize( SCTAB nTab, SCCOL nCol1, SCCOL nCol2, SCSIZE nAdd );
- void InvalidateTextWidth( const String& rStyleName );
+ void InvalidateTextWidth( const rtl::OUString& rStyleName );
void InvalidateTextWidth( SCTAB nTab );
void InvalidateTextWidth( const ScAddress* pAdrFrom, const ScAddress* pAdrTo, bool bNumFormatChanged );
@@ -1558,14 +1557,14 @@ public:
{ return pChartListenerCollection; }
void SetChartListenerCollection( ScChartListenerCollection*,
bool bSetChartRangeLists = false );
- void UpdateChart( const String& rName );
- void RestoreChartListener( const String& rName );
+ void UpdateChart( const rtl::OUString& rName );
+ void RestoreChartListener( const rtl::OUString& rName );
SC_DLLPUBLIC void UpdateChartListenerCollection();
bool IsChartListenerCollectionNeedsUpdate() const
{ return bChartListenerCollectionNeedsUpdate; }
void SetChartListenerCollectionNeedsUpdate( bool bFlg )
{ bChartListenerCollectionNeedsUpdate = bFlg; }
- void AddOLEObjectToCollection(const String& rName);
+ void AddOLEObjectToCollection(const rtl::OUString& rName);
ScChangeViewSettings* GetChangeViewSettings() const { return pChangeViewSettings; }
SC_DLLPUBLIC void SetChangeViewSettings(const ScChangeViewSettings& rNew);
diff --git a/sc/inc/queryparam.hxx b/sc/inc/queryparam.hxx
index b971121..3892840 100644
--- a/sc/inc/queryparam.hxx
+++ b/sc/inc/queryparam.hxx
@@ -65,7 +65,7 @@ struct ScQueryParamBase
SC_DLLPUBLIC ScQueryEntry& GetEntry(SCSIZE n);
void Resize(size_t nNew);
SC_DLLPUBLIC void DeleteQuery(size_t nPos);
- void FillInExcelSyntax(String& aCellStr, SCSIZE nIndex);
+ void FillInExcelSyntax(rtl::OUString& aCellStr, SCSIZE nIndex);
protected:
ScQueryParamBase();
diff --git a/sc/inc/rangelst.hxx b/sc/inc/rangelst.hxx
index e497e49..0c51506 100644
--- a/sc/inc/rangelst.hxx
+++ b/sc/inc/rangelst.hxx
@@ -55,6 +55,9 @@ public:
void Format( String&, sal_uInt16 nFlags = 0, ScDocument* = NULL,
formula::FormulaGrammar::AddressConvention eConv = formula::FormulaGrammar::CONV_OOO,
sal_Unicode cDelimiter = 0 ) const;
+ void Format( rtl::OUString&, sal_uInt16 nFlags = 0, ScDocument* = NULL,
+ formula::FormulaGrammar::AddressConvention eConv = formula::FormulaGrammar::CONV_OOO,
+ sal_Unicode cDelimiter = 0 ) const;
void Join( const ScRange&, bool bIsInList = false );
diff --git a/sc/inc/table.hxx b/sc/inc/table.hxx
index 1001ede..c7f0617 100644
--- a/sc/inc/table.hxx
+++ b/sc/inc/table.hxx
@@ -107,15 +107,15 @@ private:
rtl::OUString aCodeName;
rtl::OUString aComment;
- String aLinkDoc;
- String aLinkFlt;
- String aLinkOpt;
- String aLinkTab;
+ rtl::OUString aLinkDoc;
+ rtl::OUString aLinkFlt;
+ rtl::OUString aLinkOpt;
+ rtl::OUString aLinkTab;
sal_uLong nLinkRefreshDelay;
sal_uInt8 nLinkMode;
// page style template
- String aPageStyle;
+ rtl::OUString aPageStyle;
Size aPageSizeTwips; // size of the print-page
SCCOL nRepeatStartX; // repeating rows/columns
SCCOL nRepeatEndX; // REPEAT_NONE, if not used
@@ -255,10 +255,10 @@ public:
sal_uInt8 GetLinkMode() const { return nLinkMode; }
bool IsLinked() const { return nLinkMode != SC_LINK_NONE; }
- const String& GetLinkDoc() const { return aLinkDoc; }
- const String& GetLinkFlt() const { return aLinkFlt; }
- const String& GetLinkOpt() const { return aLinkOpt; }
- const String& GetLinkTab() const { return aLinkTab; }
+ const rtl::OUString& GetLinkDoc() const { return aLinkDoc; }
+ const rtl::OUString& GetLinkFlt() const { return aLinkFlt; }
+ const rtl::OUString& GetLinkOpt() const { return aLinkOpt; }
+ const rtl::OUString& GetLinkTab() const { return aLinkTab; }
sal_uLong GetLinkRefreshDelay() const { return nLinkRefreshDelay; }
void SetLink( sal_uInt8 nMode, const String& rDoc, const String& rFlt,
@@ -275,8 +275,8 @@ public:
const rtl::OUString& GetUpperName() const;
- const String& GetPageStyle() const { return aPageStyle; }
- void SetPageStyle( const String& rName );
+ const rtl::OUString& GetPageStyle() const { return aPageStyle; }
+ void SetPageStyle( const rtl::OUString& rName );
void PageStyleModified( const String& rNewName );
bool IsProtected() const;
@@ -311,8 +311,8 @@ public:
void SetValue( SCCOL nCol, SCROW nRow, const double& rVal );
void SetError( SCCOL nCol, SCROW nRow, sal_uInt16 nError);
- void GetString( SCCOL nCol, SCROW nRow, String& rString );
- void GetInputString( SCCOL nCol, SCROW nRow, String& rString );
+ void GetString( SCCOL nCol, SCROW nRow, rtl::OUString& rString );
+ void GetInputString( SCCOL nCol, SCROW nRow, rtl::OUString& rString );
double GetValue( const ScAddress& rPos ) const
{
return ValidColRow(rPos.Col(),rPos.Row()) ?
@@ -320,7 +320,7 @@ public:
0.0;
}
double GetValue( SCCOL nCol, SCROW nRow );
- void GetFormula( SCCOL nCol, SCROW nRow, String& rFormula );
+ void GetFormula( SCCOL nCol, SCROW nRow, rtl::OUString& rFormula );
CellType GetCellType( const ScAddress& rPos ) const
{
@@ -863,7 +863,7 @@ private:
bool CreateExcelQuery(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, ScQueryParam& rQueryParam);
bool CreateStarQuery(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, ScQueryParam& rQueryParam);
- void GetUpperCellString(SCCOL nCol, SCROW nRow, String& rStr);
+ void GetUpperCellString(SCCOL nCol, SCROW nRow, rtl::OUString& rStr);
bool RefVisible(ScFormulaCell* pCell);
diff --git a/sc/inc/tablink.hxx b/sc/inc/tablink.hxx
index 98f0422..3e2b542 100644
--- a/sc/inc/tablink.hxx
+++ b/sc/inc/tablink.hxx
@@ -94,8 +94,8 @@ private:
bool bWithContent, bool bWithInteraction );
public:
- ScDocumentLoader( const String& rFileName,
- String& rFilterName, String& rOptions,
+ ScDocumentLoader( const rtl::OUString& rFileName,
+ rtl::OUString& rFilterName, rtl::OUString& rOptions,
sal_uInt32 nRekCnt = 0, bool bWithInteraction = false );
~ScDocumentLoader();
ScDocument* GetDocument();
diff --git a/sc/qa/unit/helper/csv_handler.hxx b/sc/qa/unit/helper/csv_handler.hxx
index 8b525d4..dbb68cd 100644
--- a/sc/qa/unit/helper/csv_handler.hxx
+++ b/sc/qa/unit/helper/csv_handler.hxx
@@ -41,7 +41,7 @@ namespace {
rtl::OUString getConditionalFormatString(ScDocument* pDoc, SCCOL nCol, SCROW nRow, SCTAB nTab)
{
- String aString;
+ rtl::OUString aString;
Color* pColor;
ScBaseCell* pCell = pDoc->GetCell(ScAddress(nCol, nRow, nTab));
const SfxItemSet* pCondSet = pDoc->GetCondResult( nCol, nRow, nTab );
@@ -49,7 +49,7 @@ rtl::OUString getConditionalFormatString(ScDocument* pDoc, SCCOL nCol, SCROW nRo
SvNumberFormatter* pFormatter = pDoc->GetFormatTable();
sal_uInt32 nFormat = pPattern->GetNumberFormat( pFormatter, pCondSet );
ScCellFormat::GetString( pCell, nFormat, aString, &pColor, *pFormatter);
- return rtl::OUString(aString);
+ return aString;
}
rtl::OString createErrorMessage(SCCOL nCol, SCROW nRow, SCTAB nTab)
diff --git a/sc/source/core/data/cell.cxx b/sc/source/core/data/cell.cxx
index 49c94a5..88fcbfd 100644
--- a/sc/source/core/data/cell.cxx
+++ b/sc/source/core/data/cell.cxx
@@ -1019,6 +1019,13 @@ void ScFormulaCell::GetFormula( String& rFormula, const FormulaGrammar::Grammar
rFormula = rBuffer.makeStringAndClear();
}
+void ScFormulaCell::GetFormula( rtl::OUString& rFormula, const FormulaGrammar::Grammar eGrammar ) const
+{
+ rtl::OUStringBuffer rBuffer( rFormula );
+ GetFormula( rBuffer, eGrammar );
+ rFormula = rBuffer.makeStringAndClear();
+}
+
void ScFormulaCell::GetResultDimensions( SCSIZE& rCols, SCSIZE& rRows )
{
MaybeInterpret();
diff --git a/sc/source/core/data/column2.cxx b/sc/source/core/data/column2.cxx
index ccd73db..7938c18 100644
--- a/sc/source/core/data/column2.cxx
+++ b/sc/source/core/data/column2.cxx
@@ -243,14 +243,14 @@ long ScColumn::GetNeededSize( SCROW nRow, OutputDevice* pDev,
if (!bEditEngine) // direkte Ausgabe
{
- String aValStr;
+ rtl::OUString aValStr;
Color* pColor;
SvNumberFormatter* pFormatter = pDocument->GetFormatTable();
sal_uInt32 nFormat = pPattern->GetNumberFormat( pFormatter, pCondSet );
ScCellFormat::GetString( pCell, nFormat, aValStr, &pColor,
*pFormatter,
true, rOptions.bFormula, ftCheck );
- if (aValStr.Len())
+ if (!aValStr.isEmpty())
{
// SetFont ist nach oben verschoben
@@ -408,11 +408,11 @@ long ScColumn::GetNeededSize( SCROW nRow, OutputDevice* pDev,
Color* pColor;
SvNumberFormatter* pFormatter = pDocument->GetFormatTable();
sal_uInt32 nFormat = pPattern->GetNumberFormat( pFormatter, pCondSet );
- String aString;
+ rtl::OUString aString;
ScCellFormat::GetString( pCell, nFormat, aString, &pColor,
*pFormatter,
true, rOptions.bFormula, ftCheck );
- if (aString.Len())
+ if (!aString.isEmpty())
pEngine->SetTextNewDefaults(aString, pSet);
else
pEngine->SetDefaults(pSet);
@@ -524,6 +524,7 @@ long ScColumn::GetNeededSize( SCROW nRow, OutputDevice* pDev,
return nValue;
}
+
sal_uInt16 ScColumn::GetOptimalColWidth( OutputDevice* pDev, double nPPTX, double nPPTY,
const Fraction& rZoomX, const Fraction& rZoomY,
bool bFormula, sal_uInt16 nOldWidth,
@@ -552,7 +553,7 @@ sal_uInt16 ScColumn::GetOptimalColWidth( OutputDevice* pDev, double nPPTX, doubl
// Try to find the row that has the longest string, and measure the width of that string.
SvNumberFormatter* pFormatter = pDocument->GetFormatTable();
sal_uInt32 nFormat = pPattern->GetNumberFormat( pFormatter );
- String aLongStr;
+ rtl::OUString aLongStr;
Color* pColor;
if (pParam->mnMaxTextRow >= 0)
{
@@ -570,19 +571,19 @@ sal_uInt16 ScColumn::GetOptimalColWidth( OutputDevice* pDev, double nPPTX, doubl
break;
ScBaseCell* pCell = pItems[nIndex].pCell;
- String aValStr;
+ rtl::OUString aValStr;
ScCellFormat::GetString(
pCell, nFormat, aValStr, &pColor, *pFormatter, true, false, ftCheck );
- if (aValStr.Len() > nLongLen)
+ if (aValStr.getLength() > nLongLen)
{
- nLongLen = aValStr.Len();
+ nLongLen = aValStr.getLength();
aLongStr = aValStr;
}
}
}
- if (aLongStr.Len())
+ if (!aLongStr.isEmpty())
{
nWidth = pDev->GetTextWidth(aLongStr) + static_cast<sal_uInt16>(nMargin);
bFound = true;
diff --git a/sc/source/core/data/column3.cxx b/sc/source/core/data/column3.cxx
index baa0518..756c0c3 100644
--- a/sc/source/core/data/column3.cxx
+++ b/sc/source/core/data/column3.cxx
@@ -1569,7 +1569,7 @@ void ScColumn::GetFilterEntries(SCROW nStartRow, SCROW nEndRow, TypedScStrCollec
{
bool bHasDates = false;
SvNumberFormatter* pFormatter = pDocument->GetFormatTable();
- String aString;
+ rtl::OUString aString;
SCROW nRow = 0;
SCSIZE nIndex;
@@ -1779,7 +1779,7 @@ void ScColumn::SetValue( SCROW nRow, const double& rVal)
}
-void ScColumn::GetString( SCROW nRow, String& rString ) const
+void ScColumn::GetString( SCROW nRow, rtl::OUString& rString ) const
{
SCSIZE nIndex;
Color* pColor;
@@ -1792,14 +1792,14 @@ void ScColumn::GetString( SCROW nRow, String& rString ) const
ScCellFormat::GetString( pCell, nFormat, rString, &pColor, *(pDocument->GetFormatTable()) );
}
else
- rString.Erase();
+ rString = rtl::OUString();
}
else
- rString.Erase();
+ rString = rtl::OUString();
}
-void ScColumn::GetInputString( SCROW nRow, String& rString ) const
+void ScColumn::GetInputString( SCROW nRow, rtl::OUString& rString ) const
{
SCSIZE nIndex;
if (Search(nRow, nIndex))
@@ -1811,10 +1811,10 @@ void ScColumn::GetInputString( SCROW nRow, String& rString ) const
ScCellFormat::GetInputString( pCell, nFormat, rString, *(pDocument->GetFormatTable()) );
}
else
- rString.Erase();
+ rString = rtl::OUString();
}
else
- rString.Erase();
+ rString = rtl::OUString();
}
@@ -1846,7 +1846,7 @@ double ScColumn::GetValue( SCROW nRow ) const
}
-void ScColumn::GetFormula( SCROW nRow, String& rFormula ) const
+void ScColumn::GetFormula( SCROW nRow, rtl::OUString& rFormula ) const
{
SCSIZE nIndex;
if (Search(nRow, nIndex))
@@ -1855,10 +1855,10 @@ void ScColumn::GetFormula( SCROW nRow, String& rFormula ) const
if (pCell->GetCellType() == CELLTYPE_FORMULA)
((ScFormulaCell*)pCell)->GetFormula( rFormula );
else
- rFormula.Erase();
+ rFormula = rtl::OUString();
}
else
- rFormula.Erase();
+ rFormula = rtl::OUString();
}
@@ -1964,7 +1964,7 @@ sal_Int32 ScColumn::GetMaxStringLen( SCROW nRowStart, SCROW nRowEnd, CharSet eCh
sal_Int32 nStringLen = 0;
if ( pItems )
{
- String aString;
+ rtl::OUString aString;
rtl::OString aOString;
bool bIsOctetTextEncoding = rtl_isOctetTextEncoding( eCharSet);
SvNumberFormatter* pNumFmt = pDocument->GetFormatTable();
@@ -1984,8 +1984,7 @@ sal_Int32 ScColumn::GetMaxStringLen( SCROW nRowStart, SCROW nRowEnd, CharSet eCh
sal_Int32 nLen;
if (bIsOctetTextEncoding)
{
- rtl::OUString aOUString( aString);
- if (!aOUString.convertToString( &aOString, eCharSet,
+ if (!aString.convertToString( &aOString, eCharSet,
RTL_UNICODETOTEXT_FLAGS_UNDEFINED_ERROR |
RTL_UNICODETOTEXT_FLAGS_INVALID_ERROR))
{
@@ -1997,7 +1996,7 @@ sal_Int32 ScColumn::GetMaxStringLen( SCROW nRowStart, SCROW nRowEnd, CharSet eCh
nLen = aOString.getLength();
}
else
- nLen = aString.Len() * sizeof(sal_Unicode);
+ nLen = aString.getLength() * sizeof(sal_Unicode);
if ( nStringLen < nLen)
nStringLen = nLen;
}
@@ -2019,7 +2018,7 @@ xub_StrLen ScColumn::GetMaxNumberStringLen(
if ( pItems )
{
- String aString;
+ rtl::OUString aString;
SvNumberFormatter* pNumFmt = pDocument->GetFormatTable();
SCSIZE nIndex;
SCROW nRow;
@@ -2034,7 +2033,7 @@ xub_StrLen ScColumn::GetMaxNumberStringLen(
sal_uLong nFormat = (sal_uLong) ((SfxUInt32Item*) GetAttr(
nRow, ATTR_VALUE_FORMAT ))->GetValue();
ScCellFormat::GetInputString( pCell, nFormat, aString, *pNumFmt );
- xub_StrLen nLen = aString.Len();
+ xub_StrLen nLen = aString.getLength();
if ( nLen )
{
if ( nFormat )
@@ -2057,12 +2056,12 @@ xub_StrLen ScColumn::GetMaxNumberStringLen(
{ // less than nPrecision in string => widen it
// more => shorten it
String aSep = pNumFmt->GetFormatDecimalSep( nFormat );
- xub_StrLen nTmp = aString.Search( aSep );
- if ( nTmp == STRING_NOTFOUND )
+ sal_Int32 nTmp = aString.indexOf( aSep );
+ if ( nTmp == -1 )
nLen += nPrecision + aSep.Len();
else
{
- nTmp = aString.Len() - (nTmp + aSep.Len());
+ nTmp = aString.getLength() - (nTmp + aSep.Len());
if ( nTmp != nPrecision )
nLen += nPrecision - nTmp;
// nPrecision > nTmp : nLen + Diff
diff --git a/sc/source/core/data/dociter.cxx b/sc/source/core/data/dociter.cxx
index dcc0247..91df276 100644
--- a/sc/source/core/data/dociter.cxx
+++ b/sc/source/core/data/dociter.cxx
@@ -1409,7 +1409,7 @@ ScBaseCell* ScQueryCellIterator::BinarySearch()
if (pCol->Search( nRow, nLo ) && bFirstStringIgnore &&
pItems[nLo].pCell->HasStringData())
{
- String aCellStr;
+ rtl::OUString aCellStr;
sal_uLong nFormat = pCol->GetNumberFormat( pItems[nLo].nRow);
ScCellFormat::GetInputString( pItems[nLo].pCell, nFormat, aCellStr,
rFormatter);
@@ -1441,8 +1441,10 @@ ScBaseCell* ScQueryCellIterator::BinarySearch()
if (pCell->HasStringData())
{
sal_uLong nFormat = pCol->GetNumberFormat( pItems[nLastInRange].nRow);
- ScCellFormat::GetInputString( pCell, nFormat, aLastInRangeString,
+ rtl::OUString aStr;
+ ScCellFormat::GetInputString( pCell, nFormat, aStr,
rFormatter);
+ aLastInRangeString = aStr;
}
else
{
@@ -1541,7 +1543,7 @@ ScBaseCell* ScQueryCellIterator::BinarySearch()
}
else if (bStr && bByString)
{
- String aCellStr;
+ rtl::OUString aCellStr;
sal_uLong nFormat = pCol->GetNumberFormat( pItems[i].nRow);
ScCellFormat::GetInputString( pItems[i].pCell, nFormat, aCellStr,
rFormatter);
diff --git a/sc/source/core/data/documen2.cxx b/sc/source/core/data/documen2.cxx
index 565e998..223c505 100644
--- a/sc/source/core/data/documen2.cxx
+++ b/sc/source/core/data/documen2.cxx
@@ -595,7 +595,7 @@ void ScDocument::ResetClip( ScDocument* pSourceDoc, SCTAB nTab )
}
}
maTabs[nTab] = new ScTable(this, nTab,
- String::CreateFromAscii(RTL_CONSTASCII_STRINGPARAM("baeh")));
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("baeh")));
if (nTab < static_cast<SCTAB>(pSourceDoc->maTabs.size()) && pSourceDoc->maTabs[nTab])
maTabs[nTab]->SetLayoutRTL( pSourceDoc->maTabs[nTab]->IsLayoutRTL() );
}
@@ -626,7 +626,7 @@ void ScDocument::PutCell( SCCOL nCol, SCROW nRow, SCTAB nTab,
maTabs.resize( nTab + 1, NULL );
}
maTabs.at(nTab) = new ScTable(this, nTab,
- String::CreateFromAscii(RTL_CONSTASCII_STRINGPARAM("temp")),
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("temp")),
bExtras, bExtras);
}
@@ -919,7 +919,7 @@ bool ScDocument::CopyTab( SCTAB nOldPos, SCTAB nNewPos, const ScMarkData* pOnlyM
return bValid;
}
-void VBA_InsertModule( ScDocument& rDoc, SCTAB nTab, String& sModuleName, String& sModuleSource );
+void VBA_InsertModule( ScDocument& rDoc, SCTAB nTab, const rtl::OUString& sModuleName, const rtl::OUString& sModuleSource );
sal_uLong ScDocument::TransferTab( ScDocument* pSrcDoc, SCTAB nSrcPos,
SCTAB nDestPos, bool bInsertNew,
@@ -1094,13 +1094,13 @@ sal_uLong ScDocument::TransferTab( ScDocument* pSrcDoc, SCTAB nSrcPos,
SfxObjectShell* pSrcShell = pSrcDoc ? pSrcDoc->GetDocumentShell() : NULL;
if ( pSrcShell )
{
- String aLibName(RTL_CONSTASCII_USTRINGPARAM("Standard"));
+ rtl::OUString aLibName(RTL_CONSTASCII_USTRINGPARAM("Standard"));
const BasicManager *pBasicManager = pSrcShell->GetBasicManager();
if (pBasicManager && pBasicManager->GetName().Len() > 0)
aLibName = pSrcShell->GetBasicManager()->GetName();
- String sCodeName;
- String sSource;
+ rtl::OUString sCodeName;
+ rtl::OUString sSource;
uno::Reference< script::XLibraryContainer > xLibContainer = pSrcShell->GetBasicContainer();
uno::Reference< container::XNameContainer > xLib;
if( xLibContainer.is() )
diff --git a/sc/source/core/data/documen3.cxx b/sc/source/core/data/documen3.cxx
index 2806603..273af5f 100644
--- a/sc/source/core/data/documen3.cxx
+++ b/sc/source/core/data/documen3.cxx
@@ -173,7 +173,7 @@ void ScDocument::SetRangeName( ScRangeName* pNewRangeName )
}
-const ScRangeData* ScDocument::GetRangeAtBlock( const ScRange& rBlock, String* pName ) const
+const ScRangeData* ScDocument::GetRangeAtBlock( const ScRange& rBlock, rtl::OUString* pName ) const
{
const ScRangeData* pData = NULL;
if ( pRangeName )
@@ -354,7 +354,7 @@ bool ScDocument::IsScenario( SCTAB nTab ) const
return ValidTab(nTab) && nTab < static_cast<SCTAB>(maTabs.size()) && maTabs[nTab] &&maTabs[nTab]->IsScenario();
}
-void ScDocument::SetScenarioData( SCTAB nTab, const String& rComment,
+void ScDocument::SetScenarioData( SCTAB nTab, const rtl::OUString& rComment,
const Color& rColor, sal_uInt16 nFlags )
{
if (ValidTab(nTab) && nTab < static_cast<SCTAB>(maTabs.size()) && maTabs[nTab] && maTabs[nTab]->IsScenario())
@@ -433,32 +433,32 @@ sal_uInt8 ScDocument::GetLinkMode( SCTAB nTab ) const
return SC_LINK_NONE;
}
-const String& ScDocument::GetLinkDoc( SCTAB nTab ) const
+const rtl::OUString ScDocument::GetLinkDoc( SCTAB nTab ) const
{
if (ValidTab(nTab) && nTab < static_cast<SCTAB>(maTabs.size()) && maTabs[nTab])
return maTabs[nTab]->GetLinkDoc();
- return EMPTY_STRING;
+ return rtl::OUString();
}
-const String& ScDocument::GetLinkFlt( SCTAB nTab ) const
+const rtl::OUString ScDocument::GetLinkFlt( SCTAB nTab ) const
{
if (ValidTab(nTab) && nTab < static_cast<SCTAB>(maTabs.size()) && maTabs[nTab])
return maTabs[nTab]->GetLinkFlt();
- return EMPTY_STRING;
+ return rtl::OUString();
}
-const String& ScDocument::GetLinkOpt( SCTAB nTab ) const
+const rtl::OUString ScDocument::GetLinkOpt( SCTAB nTab ) const
{
if (ValidTab(nTab) && nTab < static_cast<SCTAB>(maTabs.size()) && maTabs[nTab])
return maTabs[nTab]->GetLinkOpt();
- return EMPTY_STRING;
+ return rtl::OUString();
}
-const String& ScDocument::GetLinkTab( SCTAB nTab ) const
+const rtl::OUString ScDocument::GetLinkTab( SCTAB nTab ) const
{
if (ValidTab(nTab) && nTab < static_cast<SCTAB>(maTabs.size()) && maTabs[nTab])
return maTabs[nTab]->GetLinkTab();
- return EMPTY_STRING;
+ return rtl::OUString();
}
sal_uLong ScDocument::GetLinkRefreshDelay( SCTAB nTab ) const
@@ -468,16 +468,16 @@ sal_uLong ScDocument::GetLinkRefreshDelay( SCTAB nTab ) const
return 0;
}
-void ScDocument::SetLink( SCTAB nTab, sal_uInt8 nMode, const String& rDoc,
- const String& rFilter, const String& rOptions,
- const String& rTabName, sal_uLong nRefreshDelay )
+void ScDocument::SetLink( SCTAB nTab, sal_uInt8 nMode, const rtl::OUString& rDoc,
+ const rtl::OUString& rFilter, const rtl::OUString& rOptions,
+ const rtl::OUString& rTabName, sal_uLong nRefreshDelay )
{
if (ValidTab(nTab) && nTab < static_cast<SCTAB>(maTabs.size()) && maTabs[nTab])
maTabs[nTab]->SetLink( nMode, rDoc, rFilter, rOptions, rTabName, nRefreshDelay );
}
-bool ScDocument::HasLink( const String& rDoc,
- const String& rFilter, const String& rOptions ) const
+bool ScDocument::HasLink( const rtl::OUString& rDoc,
+ const rtl::OUString& rFilter, const rtl::OUString& rOptions ) const
{
SCTAB nCount = static_cast<SCTAB>(maTabs.size());
for (SCTAB i=0; i<nCount; i++)
@@ -490,8 +490,8 @@ bool ScDocument::HasLink( const String& rDoc,
return false;
}
-bool ScDocument::LinkExternalTab( SCTAB& rTab, const String& aDocTab,
- const String& aFileName, const String& aTabName )
+bool ScDocument::LinkExternalTab( SCTAB& rTab, const rtl::OUString& aDocTab,
+ const rtl::OUString& aFileName, const rtl::OUString& aTabName )
{
if ( IsClipboard() )
{
@@ -499,8 +499,8 @@ bool ScDocument::LinkExternalTab( SCTAB& rTab, const String& aDocTab,
return false;
}
rTab = 0;
- String aFilterName; // wird vom Loader gefuellt
- String aOptions; // Filter-Optionen
+ rtl::OUString aFilterName; // wird vom Loader gefuellt
+ rtl::OUString aOptions; // Filter-Optionen
sal_uInt32 nLinkCnt = pExtDocOptions ? pExtDocOptions->GetDocSettings().mnLinkCnt : 0;
ScDocumentLoader aLoader( aFileName, aFilterName, aOptions, nLinkCnt + 1 );
if ( aLoader.IsError() )
@@ -531,8 +531,9 @@ bool ScDocument::LinkExternalTab( SCTAB& rTab, const String& aDocTab,
{
ScTableLink* pLink = new ScTableLink( pShell, aFileName, aFilterName, aOptions, nRefreshDelay );
pLink->SetInCreate( true );
- GetLinkManager()->InsertFileLink( *pLink, OBJECT_CLIENT_FILE, aFileName,
- &aFilterName );
+ String aFilName = aFilterName;
+ GetLinkManager()->InsertFileLink( *pLink, OBJECT_CLIENT_FILE, String(aFileName),
+ &aFilName );
pLink->Update();
pLink->SetInCreate( false );
SfxBindings* pBindings = GetViewBindings();
@@ -1074,13 +1075,13 @@ void ScDocument::Fill(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, const
nStepValue, nMaxValue);
}
-String ScDocument::GetAutoFillPreview( const ScRange& rSource, SCCOL nEndX, SCROW nEndY )
+rtl::OUString ScDocument::GetAutoFillPreview( const ScRange& rSource, SCCOL nEndX, SCROW nEndY )
{
SCTAB nTab = rSource.aStart.Tab();
if (nTab < static_cast<SCTAB>(maTabs.size()) && maTabs[nTab])
return maTabs[nTab]->GetAutoFillPreview( rSource, nEndX, nEndY );
- return EMPTY_STRING;
+ return rtl::OUString();
}
void ScDocument::AutoFormat( SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow,
@@ -1319,12 +1320,12 @@ SCSIZE ScDocument::Query(SCTAB nTab, const ScQueryParam& rQueryParam, bool bKeep
}
-void ScDocument::GetUpperCellString(SCCOL nCol, SCROW nRow, SCTAB nTab, String& rStr)
+void ScDocument::GetUpperCellString(SCCOL nCol, SCROW nRow, SCTAB nTab, rtl::OUString& rStr)
{
if ( ValidTab(nTab) && nTab < static_cast<SCTAB>(maTabs.size()) && maTabs[nTab] )
maTabs[nTab]->GetUpperCellString( nCol, nRow, rStr );
else
- rStr.Erase();
+ rStr = rtl::OUString();
}
bool ScDocument::CreateQueryParam(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, SCTAB nTab, ScQueryParam& rQueryParam)
@@ -1541,7 +1542,7 @@ bool ScDocument::GetFormulaEntries( TypedScStrCollection& rStrings )
for ( ScBaseCell* pCell = aIter.GetFirst(); pCell; pCell = aIter.GetNext() )
if ( pCell->HasStringData() )
{
- String aStr = pCell->GetStringData();
+ rtl::OUString aStr = pCell->GetStringData();
TypedStrData* pNew = new TypedStrData( aStr, 0.0, SC_STRTYPE_HEADERS );
if ( !rStrings.Insert(pNew) )
delete pNew;
@@ -2006,26 +2007,26 @@ void ScDocument::SetExtDocOptions( ScExtDocOptions* pNewOptions )
void ScDocument::DoMergeContents( SCTAB nTab, SCCOL nStartCol, SCROW nStartRow,
SCCOL nEndCol, SCROW nEndRow )
{
- String aEmpty;
- String aTotal;
- String aCellStr;
+ rtl::OUString aEmpty;
+ rtl::OUStringBuffer aTotal;
+ rtl::OUString aCellStr;
SCCOL nCol;
SCROW nRow;
for (nRow=nStartRow; nRow<=nEndRow; nRow++)
for (nCol=nStartCol; nCol<=nEndCol; nCol++)
{
GetString(nCol,nRow,nTab,aCellStr);
- if (aCellStr.Len())
+ if (!aCellStr.isEmpty())
{
- if (aTotal.Len())
- aTotal += ' ';
- aTotal += aCellStr;
+ if (aTotal.getLength())
+ aTotal.append(' ');
+ aTotal.append(aCellStr);
}
if (nCol != nStartCol || nRow != nStartRow)
SetString(nCol,nRow,nTab,aEmpty);
}
- SetString(nStartCol,nStartRow,nTab,aTotal);
+ SetString(nStartCol,nStartRow,nTab,aTotal.makeStringAndClear());
}
void ScDocument::DoMerge( SCTAB nTab, SCCOL nStartCol, SCROW nStartRow,
diff --git a/sc/source/core/data/documen4.cxx b/sc/source/core/data/documen4.cxx
index 22bac02..93bcbbc 100644
--- a/sc/source/core/data/documen4.cxx
+++ b/sc/source/core/data/documen4.cxx
@@ -64,7 +64,7 @@ using namespace formula;
// Nach der Regula Falsi Methode
bool ScDocument::Solver(SCCOL nFCol, SCROW nFRow, SCTAB nFTab,
SCCOL nVCol, SCROW nVRow, SCTAB nVTab,
- const String& sValStr, double& nX)
+ const rtl::OUString& sValStr, double& nX)
{
bool bRet = false;
nX = 0.0;
@@ -127,7 +127,7 @@ bool ScDocument::Solver(SCCOL nFCol, SCROW nFRow, SCTAB nFTab,
void ScDocument::InsertMatrixFormula(SCCOL nCol1, SCROW nRow1,
SCCOL nCol2, SCROW nRow2,
const ScMarkData& rMark,
- const String& rFormula,
+ const rtl::OUString& rFormula,
const ScTokenArray* pArr,
const formula::FormulaGrammar::Grammar eGram )
{
@@ -251,20 +251,20 @@ void ScDocument::InsertTableOp(const ScTabOpParam& rParam, // Mehrfachopera
}
ScRefAddress aRef;
- String aForString = '=';
- aForString += ScCompiler::GetNativeSymbol(ocTableOp);
- aForString += ScCompiler::GetNativeSymbol( ocOpen);
+ rtl::OUStringBuffer aForString('=');
+ aForString.append(ScCompiler::GetNativeSymbol(ocTableOp));
+ aForString.append(ScCompiler::GetNativeSymbol( ocOpen));
const String& sSep = ScCompiler::GetNativeSymbol( ocSep);
if (rParam.nMode == 0) // nur Spalte
{
aRef.Set( rParam.aRefFormulaCell.GetAddress(), true, false, false );
- aForString += aRef.GetRefString(this, nTab1);
- aForString += sSep;
- aForString += rParam.aRefColCell.GetRefString(this, nTab1);
- aForString += sSep;
+ aForString.append(aRef.GetRefString(this, nTab1));
+ aForString.append(sSep);
+ aForString.append(rParam.aRefColCell.GetRefString(this, nTab1));
+ aForString.append(sSep);
aRef.Set( nCol1, nRow1, nTab1, false, true, true );
- aForString += aRef.GetRefString(this, nTab1);
+ aForString.append(aRef.GetRefString(this, nTab1));
nCol1++;
nCol2 = Min( nCol2, (SCCOL)(rParam.aRefFormulaEnd.Col() -
rParam.aRefFormulaCell.Col() + nCol1 + 1));
@@ -272,34 +272,34 @@ void ScDocument::InsertTableOp(const ScTabOpParam& rParam, // Mehrfachopera
else if (rParam.nMode == 1) // nur zeilenweise
{
aRef.Set( rParam.aRefFormulaCell.GetAddress(), false, true, false );
- aForString += aRef.GetRefString(this, nTab1);
- aForString += sSep;
- aForString += rParam.aRefRowCell.GetRefString(this, nTab1);
- aForString += sSep;
+ aForString.append(aRef.GetRefString(this, nTab1));
+ aForString.append(sSep);
+ aForString.append(rParam.aRefRowCell.GetRefString(this, nTab1));
+ aForString.append(sSep);
aRef.Set( nCol1, nRow1, nTab1, true, false, true );
- aForString += aRef.GetRefString(this, nTab1);
+ aForString.append(aRef.GetRefString(this, nTab1));
nRow1++;
nRow2 = Min( nRow2, (SCROW)(rParam.aRefFormulaEnd.Row() -
rParam.aRefFormulaCell.Row() + nRow1 + 1));
}
else // beides
{
- aForString += rParam.aRefFormulaCell.GetRefString(this, nTab1);
- aForString += sSep;
- aForString += rParam.aRefColCell.GetRefString(this, nTab1);
- aForString += sSep;
+ aForString.append(rParam.aRefFormulaCell.GetRefString(this, nTab1));
+ aForString.append(sSep);
+ aForString.append(rParam.aRefColCell.GetRefString(this, nTab1));
+ aForString.append(sSep);
aRef.Set( nCol1, nRow1 + 1, nTab1, false, true, true );
- aForString += aRef.GetRefString(this, nTab1);
- aForString += sSep;
- aForString += rParam.aRefRowCell.GetRefString(this, nTab1);
- aForString += sSep;
+ aForString.append(aRef.GetRefString(this, nTab1));
+ aForString.append(sSep);
+ aForString.append(rParam.aRefRowCell.GetRefString(this, nTab1));
+ aForString.append(sSep);
aRef.Set( nCol1 + 1, nRow1, nTab1, true, false, true );
- aForString += aRef.GetRefString(this, nTab1);
+ aForString.append(aRef.GetRefString(this, nTab1));
nCol1++; nRow1++;
}
- aForString += ScCompiler::GetNativeSymbol( ocClose);
+ aForString.append(ScCompiler::GetNativeSymbol( ocClose ));
- ScFormulaCell aRefCell( this, ScAddress( nCol1, nRow1, nTab1 ), aForString,
+ ScFormulaCell aRefCell( this, ScAddress( nCol1, nRow1, nTab1 ), aForString.makeStringAndClear(),
formula::FormulaGrammar::GRAM_NATIVE, MM_NONE );
for( j = nCol1; j <= nCol2; j++ )
for( k = nRow1; k <= nRow2; k++ )
@@ -676,8 +676,8 @@ const SfxPoolItem* ScDocument::GetEffItem(
if ( pForm )
{
ScBaseCell* pCell = ((ScDocument*)this)->GetCell(ScAddress(nCol,nRow,nTab));
- String aStyle = pForm->GetCellStyle( pCell, ScAddress(nCol, nRow, nTab) );
- if (aStyle.Len())
+ rtl::OUString aStyle = pForm->GetCellStyle( pCell, ScAddress(nCol, nRow, nTab) );
+ if (!aStyle.isEmpty())
{
SfxStyleSheetBase* pStyleSheet = xPoolHelper->GetStylePool()->Find(
aStyle, SFX_STYLE_FAMILY_PARA );
@@ -700,8 +700,8 @@ const SfxItemSet* ScDocument::GetCondResult( SCCOL nCol, SCROW nRow, SCTAB nTab
if ( pForm )
{
ScBaseCell* pCell = ((ScDocument*)this)->GetCell(ScAddress(nCol,nRow,nTab));
- String aStyle = pForm->GetCellStyle( pCell, ScAddress(nCol, nRow, nTab) );
- if (aStyle.Len())
+ rtl::OUString aStyle = pForm->GetCellStyle( pCell, ScAddress(nCol, nRow, nTab) );
+ if (!aStyle.isEmpty())
{
SfxStyleSheetBase* pStyleSheet = xPoolHelper->GetStylePool()->Find( aStyle, SFX_STYLE_FAMILY_PARA );
if ( pStyleSheet )
@@ -1070,12 +1070,14 @@ void ScDocument::CompareDocument( ScDocument& rOtherDoc )
//! ein Progress ueber alle Tabellen ???
rtl::OUString aTabName;
GetName( nThisTab, aTabName );
- String aTemplate = ScGlobal::GetRscString(STR_PROGRESS_COMPARING);
- String aProText = aTemplate.GetToken( 0, '#' );
- aProText.Append(String(aTabName));
- aProText += aTemplate.GetToken( 1, '#' );
+ rtl::OUString aTemplate = ScGlobal::GetRscString(STR_PROGRESS_COMPARING);
+ sal_Int32 nIndex = 0;
+ rtl::OUStringBuffer aProText = aTemplate.getToken( 0, '#', nIndex );
+ aProText.append(aTabName);
+ nIndex = 0;
+ aProText.append(aTemplate.getToken( 1, '#', nIndex ));
ScProgress aProgress( GetDocumentShell(),
- aProText, 3*nThisEndRow ); // 2x FindOrder, 1x hier
+ aProText.makeStringAndClear(), 3*nThisEndRow ); // 2x FindOrder, 1x hier
long nProgressStart = 2*nThisEndRow; // start fuer hier
SCCOLROW* pTempRows = new SCCOLROW[nThisEndRow+1];
diff --git a/sc/source/core/data/documen5.cxx b/sc/source/core/data/documen5.cxx
index 1b755aa..a60a73f 100644
--- a/sc/source/core/data/documen5.cxx
+++ b/sc/source/core/data/documen5.cxx
@@ -86,15 +86,15 @@ void lcl_GetChartParameters( const uno::Reference< chart2::XChartDocument >& xCh
for (long i = 0; i < nPropCount; i++)
{
const beans::PropertyValue& rProp = pPropArray[i];
- String aPropName(rProp.Name);
+ rtl::OUString aPropName(rProp.Name);
- if (aPropName.EqualsAscii( "CellRangeRepresentation" ))
+ if (aPropName.equalsAscii( "CellRangeRepresentation" ))
rProp.Value >>= rRanges;
- else if (aPropName.EqualsAscii( "DataRowSource" ))
+ else if (aPropName.equalsAscii( "DataRowSource" ))
rDataRowSource = (chart::ChartDataRowSource)ScUnoHelpFunctions::GetEnumFromAny( rProp.Value );
- else if (aPropName.EqualsAscii( "HasCategories" ))
+ else if (aPropName.equalsAscii( "HasCategories" ))
rHasCategories = ScUnoHelpFunctions::GetBoolFromAny( rProp.Value );
- else if (aPropName.EqualsAscii( "FirstCellAsLabel" ))
+ else if (aPropName.equalsAscii( "FirstCellAsLabel" ))
rFirstCellAsLabel = ScUnoHelpFunctions::GetBoolFromAny( rProp.Value );
}
}
@@ -160,7 +160,7 @@ void ScDocument::UpdateAllCharts()
if (pChartObj->GetName() == aIPName)
{
ScRangeListRef aRanges = pChartObj->GetRangeList();
- String sRangeStr;
+ rtl::OUString sRangeStr;
aRanges->Format( sRangeStr, SCR_ABS_3D, this, GetAddressConvention() );
chart::ChartDataRowSource eDataRowSource = chart::ChartDataRowSource_COLUMNS;
@@ -203,7 +203,7 @@ void ScDocument::UpdateAllCharts()
pChartCollection->clear();
}
-bool ScDocument::HasChartAtPoint( SCTAB nTab, const Point& rPos, String* pName )
+bool ScDocument::HasChartAtPoint( SCTAB nTab, const Point& rPos, rtl::OUString& rName )
{
if (pDrawLayer && nTab < static_cast<SCTAB>(maTabs.size()) && maTabs[nTab])
{
@@ -221,8 +221,7 @@ bool ScDocument::HasChartAtPoint( SCTAB nTab, const Point& rPos, String* pName )
if (IsChart(pObject))
{
- if (pName)
- *pName = ((SdrOle2Obj*)pObject)->GetPersistName();
+ rName = (static_cast<SdrOle2Obj*>(pObject))->GetPersistName();
return true;
}
}
@@ -230,12 +229,11 @@ bool ScDocument::HasChartAtPoint( SCTAB nTab, const Point& rPos, String* pName )
}
}
- if (pName)
- pName->Erase();
+ rName = rtl::OUString();
return false; // nothing found
}
-void ScDocument::UpdateChartArea( const String& rChartName,
+void ScDocument::UpdateChartArea( const rtl::OUString& rChartName,
const ScRange& rNewArea, bool bColHeaders, bool bRowHeaders,
bool bAdd )
{
@@ -244,7 +242,7 @@ void ScDocument::UpdateChartArea( const String& rChartName,
UpdateChartArea( rChartName, aRLR, bColHeaders, bRowHeaders, bAdd );
}
-uno::Reference< chart2::XChartDocument > ScDocument::GetChartByName( const String& rChartName )
+uno::Reference< chart2::XChartDocument > ScDocument::GetChartByName( const rtl::OUString& rChartName )
{
uno::Reference< chart2::XChartDocument > xReturn;
@@ -261,7 +259,7 @@ uno::Reference< chart2::XChartDocument > ScDocument::GetChartByName( const Strin
while (pObject)
{
if ( pObject->GetObjIdentifier() == OBJ_OLE2 &&
- ((SdrOle2Obj*)pObject)->GetPersistName() == rChartName )
+ rtl::OUString(((SdrOle2Obj*)pObject)->GetPersistName()) == rChartName )
{
xReturn.set( ScChartHelper::GetChartFromSdrObject( pObject ) );
return xReturn;
@@ -272,7 +270,7 @@ uno::Reference< chart2::XChartDocument > ScDocument::GetChartByName( const Strin
}
return xReturn;
}
-void ScDocument::GetChartRanges( const String& rChartName, ::std::vector< ScRangeList >& rRangesVector, ScDocument* pSheetNameDoc )
+void ScDocument::GetChartRanges( const rtl::OUString& rChartName, ::std::vector< ScRangeList >& rRangesVector, ScDocument* pSheetNameDoc )
{
rRangesVector.clear();
uno::Reference< chart2::XChartDocument > xChartDoc( GetChartByName( rChartName ) );
@@ -289,7 +287,7 @@ void ScDocument::GetChartRanges( const String& rChartName, ::std::vector< ScRang
}
}
-void ScDocument::SetChartRanges( const String& rChartName, const ::std::vector< ScRangeList >& rRangesVector )
+void ScDocument::SetChartRanges( const rtl::OUString& rChartName, const ::std::vector< ScRangeList >& rRangesVector )
{
uno::Reference< chart2::XChartDocument > xChartDoc( GetChartByName( rChartName ) );
if ( xChartDoc.is() )
@@ -299,7 +297,7 @@ void ScDocument::SetChartRanges( const String& rChartName, const ::std::vector<
for( sal_Int32 nN=0; nN<nCount; nN++ )
{
ScRangeList aScRangeList( rRangesVector[nN] );
- String sRangeStr; // This range must be in Calc A1 format.
+ rtl::OUString sRangeStr; // This range must be in Calc A1 format.
aScRangeList.Format( sRangeStr, SCR_ABS_3D, this );
aRangeStrings[nN]=sRangeStr;
}
@@ -307,7 +305,7 @@ void ScDocument::SetChartRanges( const String& rChartName, const ::std::vector<
}
}
-void ScDocument::GetOldChartParameters( const String& rName,
+void ScDocument::GetOldChartParameters( const rtl::OUString& rName,
ScRangeList& rRanges, bool& rColHeaders, bool& rRowHeaders )
{
// used for undo of changing chart source area
@@ -326,7 +324,7 @@ void ScDocument::GetOldChartParameters( const String& rName,
while (pObject)
{
if ( pObject->GetObjIdentifier() == OBJ_OLE2 &&
- ((SdrOle2Obj*)pObject)->GetPersistName() == rName )
+ rtl::OUString(((SdrOle2Obj*)pObject)->GetPersistName()) == rName )
{
uno::Reference< chart2::XChartDocument > xChartDoc( ScChartHelper::GetChartFromSdrObject( pObject ) );
if ( xChartDoc.is() )
@@ -356,7 +354,7 @@ void ScDocument::GetOldChartParameters( const String& rName,
}
}
-void ScDocument::UpdateChartArea( const String& rChartName,
+void ScDocument::UpdateChartArea( const rtl::OUString& rChartName,
const ScRangeListRef& rNewList, bool bColHeaders, bool bRowHeaders,
bool bAdd )
{
@@ -373,7 +371,7 @@ void ScDocument::UpdateChartArea( const String& rChartName,
while (pObject)
{
if ( pObject->GetObjIdentifier() == OBJ_OLE2 &&
- ((SdrOle2Obj*)pObject)->GetPersistName() == rChartName )
+ rtl::OUString(((SdrOle2Obj*)pObject)->GetPersistName()) == rChartName )
{
uno::Reference< chart2::XChartDocument > xChartDoc( ScChartHelper::GetChartFromSdrObject( pObject ) );
uno::Reference< chart2::data::XDataReceiver > xReceiver( xChartDoc, uno::UNO_QUERY );
@@ -425,7 +423,7 @@ void ScDocument::UpdateChartArea( const String& rChartName,
xReceiver->attachNumberFormatsSupplier( xNumberFormatsSupplier );
}
- String sRangeStr;
+ rtl::OUString sRangeStr;
aNewRanges->Format( sRangeStr, SCR_ABS_3D, this, GetAddressConvention() );
lcl_SetChartParameters( xReceiver, sRangeStr, eDataRowSource, bHasCategories, bFirstCellAsLabel );
@@ -440,7 +438,7 @@ void ScDocument::UpdateChartArea( const String& rChartName,
}
}
-void ScDocument::UpdateChart( const String& rChartName )
+void ScDocument::UpdateChart( const rtl::OUString& rChartName )
{
if (!pDrawLayer || bInDtorClear)
return;
@@ -468,7 +466,7 @@ void ScDocument::UpdateChart( const String& rChartName )
}
}
-void ScDocument::RestoreChartListener( const String& rName )
+void ScDocument::RestoreChartListener( const rtl::OUString& rName )
{
// Read the data ranges from the chart object, and start listening to those ranges again
// (called when a chart is saved, because then it might be swapped out and stop listening itself).
@@ -590,7 +588,7 @@ void ScDocument::UpdateChartRef( UpdateRefMode eUpdateRefMode,
}
-void ScDocument::SetChartRangeList( const String& rChartName,
+void ScDocument::SetChartRangeList( const rtl::OUString& rChartName,
const ScRangeListRef& rNewRangeListRef )
{
// called from ChartListener
@@ -608,7 +606,7 @@ void ScDocument::SetChartRangeList( const String& rChartName,
while (pObject)
{
if ( pObject->GetObjIdentifier() == OBJ_OLE2 &&
- ((SdrOle2Obj*)pObject)->GetPersistName() == rChartName )
+ rtl::OUString(((SdrOle2Obj*)pObject)->GetPersistName()) == rChartName )
{
uno::Reference< chart2::XChartDocument > xChartDoc( ScChartHelper::GetChartFromSdrObject( pObject ) );
uno::Reference< chart2::data::XDataReceiver > xReceiver( xChartDoc, uno::UNO_QUERY );
@@ -621,7 +619,7 @@ void ScDocument::SetChartRangeList( const String& rChartName,
rtl::OUString aRangesStr;
lcl_GetChartParameters( xChartDoc, aRangesStr, eDataRowSource, bHasCategories, bFirstCellAsLabel );
- String sRangeStr;
+ rtl::OUString sRangeStr;
rNewRangeListRef->Format( sRangeStr, SCR_ABS_3D, this, GetAddressConvention() );
lcl_SetChartParameters( xReceiver, sRangeStr, eDataRowSource, bHasCategories, bFirstCellAsLabel );
@@ -645,7 +643,7 @@ bool ScDocument::HasData( SCCOL nCol, SCROW nRow, SCTAB nTab )
}
uno::Reference< embed::XEmbeddedObject >
- ScDocument::FindOleObjectByName( const String& rName )
+ ScDocument::FindOleObjectByName( const rtl::OUString& rName )
{
if (!pDrawLayer)
return uno::Reference< embed::XEmbeddedObject >();
@@ -668,7 +666,7 @@ uno::Reference< embed::XEmbeddedObject >
{
SdrOle2Obj * pOleObject ( dynamic_cast< SdrOle2Obj * >( pObject ));
if( pOleObject &&
- pOleObject->GetPersistName() == rName )
+ rtl::OUString(pOleObject->GetPersistName()) == rName )
{
return pOleObject->GetObjRef();
}
@@ -680,7 +678,7 @@ uno::Reference< embed::XEmbeddedObject >
return uno::Reference< embed::XEmbeddedObject >();
}
-bool lcl_StringInCollection( const ScStrCollection* pColl, const String& rStr )
+bool lcl_StringInCollection( const ScStrCollection* pColl, const rtl::OUString& rStr )
{
if ( !pColl )
return false;
@@ -716,7 +714,7 @@ void ScDocument::UpdateChartListenerCollection()
if ( pObject->GetObjIdentifier() != OBJ_OLE2 )
continue;
- String aObjName = ((SdrOle2Obj*)pObject)->GetPersistName();
+ rtl::OUString aObjName = ((SdrOle2Obj*)pObject)->GetPersistName();
aCLSearcher.SetString( aObjName );
sal_uInt16 nIndex;
if ( pChartListenerCollection->Search( &aCLSearcher, nIndex ) )
@@ -774,7 +772,7 @@ void ScDocument::UpdateChartListenerCollection()
pChartListenerCollection->FreeUnused();
}
-void ScDocument::AddOLEObjectToCollection(const String& rName)
+void ScDocument::AddOLEObjectToCollection(const rtl::OUString& rName)
{
if (!pOtherObjects)
pOtherObjects = new ScStrCollection;
diff --git a/sc/source/core/data/documen6.cxx b/sc/source/core/data/documen6.cxx
index a6dd783..d04bb9c 100644
--- a/sc/source/core/data/documen6.cxx
+++ b/sc/source/core/data/documen6.cxx
@@ -70,24 +70,23 @@ const uno::Reference< i18n::XBreakIterator >& ScDocument::GetBreakIterator()
return pScriptTypeData->xBreakIter;
}
-bool ScDocument::HasStringWeakCharacters( const String& rString )
+bool ScDocument::HasStringWeakCharacters( const rtl::OUString& rString )
{
- if (rString.Len())
+ if (!rString.isEmpty())
{
uno::Reference<i18n::XBreakIterator> xBreakIter = GetBreakIterator();
if ( xBreakIter.is() )
{
- rtl::OUString aText = rString;
- sal_Int32 nLen = aText.getLength();
+ sal_Int32 nLen = rString.getLength();
sal_Int32 nPos = 0;
do
{
- sal_Int16 nType = xBreakIter->getScriptType( aText, nPos );
+ sal_Int16 nType = xBreakIter->getScriptType( rString, nPos );
if ( nType == i18n::ScriptType::WEAK )
return true; // found
- nPos = xBreakIter->endOfScript( aText, nPos, nType );
+ nPos = xBreakIter->endOfScript( rString, nPos, nType );
}
while ( nPos >= 0 && nPos < nLen );
}
@@ -96,22 +95,21 @@ bool ScDocument::HasStringWeakCharacters( const String& rString )
return false; // none found
}
-sal_uInt8 ScDocument::GetStringScriptType( const String& rString )
+sal_uInt8 ScDocument::GetStringScriptType( const rtl::OUString& rString )
{
sal_uInt8 nRet = 0;
- if (rString.Len())
+ if (!rString.isEmpty())
{
uno::Reference<i18n::XBreakIterator> xBreakIter = GetBreakIterator();
if ( xBreakIter.is() )
{
- rtl::OUString aText = rString;
- sal_Int32 nLen = aText.getLength();
+ sal_Int32 nLen = rString.getLength();
sal_Int32 nPos = 0;
do
{
- sal_Int16 nType = xBreakIter->getScriptType( aText, nPos );
+ sal_Int16 nType = xBreakIter->getScriptType( rString, nPos );
switch ( nType )
{
case i18n::ScriptType::LATIN:
@@ -125,7 +123,7 @@ sal_uInt8 ScDocument::GetStringScriptType( const String& rString )
break;
// WEAK is ignored
}
- nPos = xBreakIter->endOfScript( aText, nPos, nType );
+ nPos = xBreakIter->endOfScript( rString, nPos, nType );
}
while ( nPos >= 0 && nPos < nLen );
}
@@ -142,7 +140,7 @@ sal_uInt8 ScDocument::GetCellScriptType( ScBaseCell* pCell, sal_uLong nNumberFor
if ( nStored != SC_SCRIPTTYPE_UNKNOWN ) // stored value valid?
return nStored; // use stored value
- String aStr;
+ rtl::OUString aStr;
Color* pColor;
ScCellFormat::GetString( pCell, nNumberFormat, aStr, &pColor, *xPoolHelper->GetFormTable() );
diff --git a/sc/source/core/data/documen8.cxx b/sc/source/core/data/documen8.cxx
index d29a59c..914cfef 100644
--- a/sc/source/core/data/documen8.cxx
+++ b/sc/source/core/data/documen8.cxx
@@ -326,7 +326,7 @@ void ScDocument::CopyStdStylesFrom( ScDocument* pSrcDoc )
//------------------------------------------------------------------------
-void ScDocument::InvalidateTextWidth( const String& rStyleName )
+void ScDocument::InvalidateTextWidth( const rtl::OUString& rStyleName )
{
const SCTAB nCount = GetTableCount();
for ( SCTAB i=0; i<nCount && maTabs[i]; i++ )
@@ -345,7 +345,7 @@ void ScDocument::InvalidateTextWidth( SCTAB nTab )
//------------------------------------------------------------------------
-bool ScDocument::IsPageStyleInUse( const String& rStrPageStyle, SCTAB* pInTab )
+bool ScDocument::IsPageStyleInUse( const rtl::OUString& rStrPageStyle, SCTAB* pInTab )
{
bool bInUse = false;
const SCTAB nCount = GetTableCount();
@@ -362,7 +362,7 @@ bool ScDocument::IsPageStyleInUse( const String& rStrPageStyle, SCTAB* pInTab )
//------------------------------------------------------------------------
-bool ScDocument::RemovePageStyleInUse( const String& rStyle )
+bool ScDocument::RemovePageStyleInUse( const rtl::OUString& rStyle )
{
bool bWasInUse = false;
const SCTAB nCount = GetTableCount();
@@ -377,7 +377,7 @@ bool ScDocument::RemovePageStyleInUse( const String& rStyle )
return bWasInUse;
}
-bool ScDocument::RenamePageStyleInUse( const String& rOld, const String& rNew )
+bool ScDocument::RenamePageStyleInUse( const rtl::OUString& rOld, const rtl::OUString& rNew )
{
bool bWasInUse = false;
const SCTAB nCount = GetTableCount();
@@ -398,7 +398,7 @@ sal_uInt8 ScDocument::GetEditTextDirection(SCTAB nTab) const
{
EEHorizontalTextDirection eRet = EE_HTEXTDIR_DEFAULT;
- String aStyleName = GetPageStyle( nTab );
+ rtl::OUString aStyleName = GetPageStyle( nTab );
SfxStyleSheetBase* pStyle = xPoolHelper->GetStylePool()->Find( aStyleName, SFX_STYLE_FAMILY_PAGE );
if ( pStyle )
{
@@ -732,12 +732,12 @@ bool ScDocument::OnlineSpellInRange( const ScRange& rSpellRange, ScAddress& rSpe
if ( eType == CELLTYPE_STRING )
{
- String aText;
- ((ScStringCell*)pCell)->GetString(aText);
+ rtl::OUString aText;
+ static_cast<ScStringCell*>(pCell)->GetString(aText);
pEngine->SetText( aText );
}
else
- pEngine->SetText( *((ScEditCell*)pCell)->GetData() );
+ pEngine->SetText( *(static_cast<ScEditCell*>(pCell)->GetData() ) );
aStatus.bModified = false;
pEngine->CompleteOnlineSpelling();
@@ -1127,7 +1127,7 @@ void ScDocument::UpdateDdeLinks(Window* pWin)
}
}
-bool ScDocument::UpdateDdeLink( const String& rAppl, const String& rTopic, const String& rItem )
+bool ScDocument::UpdateDdeLink( const rtl::OUString& rAppl, const rtl::OUString& rTopic, const rtl::OUString& rItem )
{
// fuer refresh() per StarOne Api
// ResetValue() fuer einzelnen Link nicht noetig
@@ -1144,9 +1144,9 @@ bool ScDocument::UpdateDdeLink( const String& rAppl, const String& rTopic, const
if (pBase->ISA(ScDdeLink))
{
ScDdeLink* pDdeLink = (ScDdeLink*)pBase;
- if ( pDdeLink->GetAppl() == rAppl &&
- pDdeLink->GetTopic() == rTopic &&
- pDdeLink->GetItem() == rItem )
+ if ( rtl::OUString(pDdeLink->GetAppl()) == rAppl &&
+ rtl::OUString(pDdeLink->GetTopic()) == rTopic &&
+ rtl::OUString(pDdeLink->GetItem()) == rItem )
{
pDdeLink->TryUpdate();
bFound = true; // koennen theoretisch mehrere sein (Mode), darum weitersuchen
@@ -1225,7 +1225,7 @@ namespace {
@return The DDE link, if it exists, otherwise 0. */
ScDdeLink* lclGetDdeLink(
const sfx2::LinkManager* pLinkManager,
- const String& rAppl, const String& rTopic, const String& rItem, sal_uInt8 nMode,
+ const rtl::OUString& rAppl, const rtl::OUString& rTopic, const rtl::OUString& rItem, sal_uInt8 nMode,
sal_uInt16* pnDdePos = NULL )
{
if( pLinkManager )
@@ -1238,9 +1238,9 @@ ScDdeLink* lclGetDdeLink(
::sfx2::SvBaseLink* pLink = *rLinks[ nIndex ];
if( ScDdeLink* pDdeLink = PTR_CAST( ScDdeLink, pLink ) )
{
- if( (pDdeLink->GetAppl() == rAppl) &&
- (pDdeLink->GetTopic() == rTopic) &&
- (pDdeLink->GetItem() == rItem) &&
+ if( (rtl::OUString(pDdeLink->GetAppl()) == rAppl) &&
+ (rtl::OUString(pDdeLink->GetTopic()) == rTopic) &&
+ (rtl::OUString(pDdeLink->GetItem()) == rItem) &&
((nMode == SC_DDE_IGNOREMODE) || (nMode == pDdeLink->GetMode())) )
return pDdeLink;
if( pnDdePos ) ++*pnDdePos;
@@ -1278,12 +1278,12 @@ ScDdeLink* lclGetDdeLink( const sfx2::LinkManager* pLinkManager, sal_uInt16 nDde
// ----------------------------------------------------------------------------
-bool ScDocument::FindDdeLink( const String& rAppl, const String& rTopic, const String& rItem, sal_uInt8 nMode, sal_uInt16& rnDdePos )
+bool ScDocument::FindDdeLink( const rtl::OUString& rAppl, const rtl::OUString& rTopic, const rtl::OUString& rItem, sal_uInt8 nMode, sal_uInt16& rnDdePos )
{
return lclGetDdeLink( GetLinkManager(), rAppl, rTopic, rItem, nMode, &rnDdePos ) != NULL;
}
-bool ScDocument::GetDdeLinkData( sal_uInt16 nDdePos, String& rAppl, String& rTopic, String& rItem ) const
+bool ScDocument::GetDdeLinkData( sal_uInt16 nDdePos, rtl::OUString& rAppl, rtl::OUString& rTopic, rtl::OUString& rItem ) const
{
if( const ScDdeLink* pDdeLink = lclGetDdeLink( GetLinkManager(), nDdePos ) )
{
@@ -1311,7 +1311,7 @@ const ScMatrix* ScDocument::GetDdeLinkResultMatrix( sal_uInt16 nDdePos ) const
return pDdeLink ? pDdeLink->GetResult() : NULL;
}
-bool ScDocument::CreateDdeLink( const String& rAppl, const String& rTopic, const String& rItem, sal_uInt8 nMode, ScMatrixRef pResults )
+bool ScDocument::CreateDdeLink( const rtl::OUString& rAppl, const rtl::OUString& rTopic, const rtl::OUString& rItem, sal_uInt8 nMode, ScMatrixRef pResults )
{
/* Create a DDE link without updating it (i.e. for Excel import), to prevent
unwanted connections. First try to find existing link. Set result array
@@ -1595,7 +1595,7 @@ void ScDocument::TransliterateText( const ScMarkData& rMultiMark, sal_Int32 nTyp
}
else
{
- String aNewStr = pEngine->GetText();
+ rtl::OUString aNewStr = pEngine->GetText();
PutCell( nCol, nRow, nTab, new ScStringCell( aNewStr ) );
}
}
@@ -1603,9 +1603,9 @@ void ScDocument::TransliterateText( const ScMarkData& rMultiMark, sal_Int32 nTyp
else if ( eType == CELLTYPE_STRING )
{
- String aOldStr;
+ rtl::OUString aOldStr;
((const ScStringCell*)pCell)->GetString(aOldStr);
- xub_StrLen nOldLen = aOldStr.Len();
+ sal_Int32 nOldLen = aOldStr.getLength();
if ( bConsiderLanguage )
{
@@ -1617,7 +1617,7 @@ void ScDocument::TransliterateText( const ScMarkData& rMultiMark, sal_Int32 nTyp
}
com::sun::star::uno::Sequence<sal_Int32> aOffsets;
- String aNewStr = aTranslitarationWrapper.transliterate( aOldStr, nLanguage, 0, nOldLen, &aOffsets );
+ rtl::OUString aNewStr = aTranslitarationWrapper.transliterate( aOldStr, nLanguage, 0, nOldLen, &aOffsets );
if ( aNewStr != aOldStr )
PutCell( nCol, nRow, nTab, new ScStringCell( aNewStr ) );
diff --git a/sc/source/core/data/documen9.cxx b/sc/source/core/data/documen9.cxx
index 746cbfb..e0ef5f3 100644
--- a/sc/source/core/data/documen9.cxx
+++ b/sc/source/core/data/documen9.cxx
@@ -137,7 +137,7 @@ void ScDocument::InitDrawLayer( SfxObjectShell* pDocShell )
if (!pDrawLayer)
{
- String aName;
+ rtl::OUString aName;
if ( pShell && !pShell->IsLoading() ) // don't call GetTitle while loading
aName = pShell->GetTitle();
pDrawLayer = new ScDrawLayer( this, aName );
diff --git a/sc/source/core/data/document.cxx b/sc/source/core/data/document.cxx
index 0f21bbf..b1f258e 100644
--- a/sc/source/core/data/document.cxx
+++ b/sc/source/core/data/document.cxx
@@ -141,8 +141,8 @@ void ScDocument::MakeTable( SCTAB nTab,bool _bNeedsNameCheck )
{
if ( ValidTab(nTab) && ( nTab >= static_cast<SCTAB>(maTabs.size()) ||!maTabs[nTab]) )
{
- String aString = ScGlobal::GetRscString(STR_TABLE_DEF); //"Table"
- aString += String::CreateFromInt32(nTab+1);
+ rtl::OUString aString = ScGlobal::GetRscString(STR_TABLE_DEF); //"Table"
+ aString += rtl::OUString::valueOf(nTab+1);
if ( _bNeedsNameCheck )
CreateValidTabName( aString ); // no doubles
if (nTab < static_cast<SCTAB>(maTabs.size()))
@@ -239,9 +239,9 @@ void ScDocument::SetAnonymousDBData(SCTAB nTab, ScDBData* pDBData)
}
-bool ScDocument::ValidTabName( const String& rName )
+bool ScDocument::ValidTabName( const rtl::OUString& rName )
{
- xub_StrLen nLen = rName.Len();
+ sal_Int32 nLen = rName.getLength();
if (!nLen)
return false;
@@ -251,9 +251,9 @@ bool ScDocument::ValidTabName( const String& rName )
* Merely loading and calculating ODF documents using these characters in
* sheet names is not affected by this, but all sheet name editing and
* copying functionality is, maybe falling back to "Sheet4" or similar. */
- for (xub_StrLen i = 0; i < nLen; ++i)
+ for (sal_Int32 i = 0; i < nLen; ++i)
{
- const sal_Unicode c = rName.GetChar(i);
+ const sal_Unicode c = rName[i];
switch (c)
{
case ':':
@@ -279,7 +279,7 @@ bool ScDocument::ValidTabName( const String& rName )
}
-bool ScDocument::ValidNewTabName( const String& rName ) const
+bool ScDocument::ValidNewTabName( const rtl::OUString& rName ) const
{
bool bValid = ValidTabName(rName);
TableContainer::const_iterator it = maTabs.begin();
@@ -294,10 +294,10 @@ bool ScDocument::ValidNewTabName( const String& rName ) const
}
-bool ScDocument::ValidNewTabName( const std::vector<String>& rNames ) const//TODO:FIXME what is if there are duplicates in rNames
+bool ScDocument::ValidNewTabName( const std::vector<rtl::OUString>& rNames ) const//TODO:FIXME what is if there are duplicates in rNames
{
bool bValid = true;
- std::vector<String>::const_iterator nameIter = rNames.begin();
+ std::vector<rtl::OUString>::const_iterator nameIter = rNames.begin();
for (;nameIter != rNames.end() && bValid; ++nameIter)
{
bValid = ValidTabName(*nameIter);
@@ -317,13 +317,13 @@ bool ScDocument::ValidNewTabName( const std::vector<String>& rNames ) const//TOD
}
-void ScDocument::CreateValidTabName(String& rName) const
+void ScDocument::CreateValidTabName(rtl::OUString& rName) const
{
if ( !ValidTabName(rName) )
{
// Find new one
- const String aStrTable( ScResId(SCSTR_TABLE) );
+ const rtl::OUString aStrTable( ResId::toString(ScResId(SCSTR_TABLE)) );
bool bOk = false;
// First test if the prefix is valid, if so only avoid doubles
@@ -334,7 +334,7 @@ void ScDocument::CreateValidTabName(String& rName) const
for ( SCTAB i = static_cast<SCTAB>(maTabs.size())+1; !bOk ; i++ )
{
rName = aStrTable;
- rName += String::CreateFromInt32(i);
+ rName += rtl::OUString::valueOf(i);
if (bPrefix)
bOk = ValidNewTabName( rName );
else
@@ -349,33 +349,26 @@ void ScDocument::CreateValidTabName(String& rName) const
if ( !ValidNewTabName(rName) )
{
SCTAB i = 1;
- String aName;
+ rtl::OUStringBuffer aName;
do
{
i++;
aName = rName;
- aName += '_';
- aName += String::CreateFromInt32(static_cast<sal_Int32>(i));
+ aName.append('_');
+ aName.append(static_cast<sal_Int32>(i));
}
- while (!ValidNewTabName(aName) && (i < MAXTAB+1));
- rName = aName;
+ while (!ValidNewTabName(aName.toString()) && (i < MAXTAB+1));
+ rName = aName.makeStringAndClear();
}
}
}
-void ScDocument::CreateValidTabName(rtl::OUString& rName) const
-{
- String aTmp = rName;
- CreateValidTabName(aTmp);
- rName = aTmp;
-}
-
void ScDocument::CreateValidTabNames(std::vector<rtl::OUString>& aNames, SCTAB nCount) const
{
aNames.clear();//ensure that the vector is empty
- const String aStrTable( ScResId(SCSTR_TABLE) );
- String rName;
+ const rtl::OUString aStrTable( ResId::toString(ScResId(SCSTR_TABLE)) );
+ rtl::OUStringBuffer rName;
bool bOk = false;
// First test if the prefix is valid, if so only avoid doubles
@@ -390,14 +383,14 @@ void ScDocument::CreateValidTabNames(std::vector<rtl::OUString>& aNames, SCTAB n
while(!bOk)
{
rName = aStrTable;
- rName += String::CreateFromInt32(i);
+ rName.append(static_cast<sal_Int32>(i));
if (bPrefix)
- bOk = ValidNewTabName( rName );
+ bOk = ValidNewTabName( rName.toString() );
else
- bOk = !GetTable( rName, nDummy );
+ bOk = !GetTable( rName.toString(), nDummy );
i++;
}
- aNames.push_back(rtl::OUString(rName));
+ aNames.push_back(rName.makeStringAndClear());
}
}
@@ -412,7 +405,7 @@ void ScDocument::AppendTabOnLoad(const rtl::OUString& rName)
}
-bool ScDocument::InsertTab( SCTAB nPos, const String& rName,
+bool ScDocument::InsertTab( SCTAB nPos, const rtl::OUString& rName,
bool bExternalDocument )
{
SCTAB nTabCount = static_cast<SCTAB>(maTabs.size());
@@ -756,7 +749,7 @@ bool ScDocument::DeleteTabs( SCTAB nTab, SCTAB nSheets, ScDocument* pRefUndoDoc
}
-bool ScDocument::RenameTab( SCTAB nTab, const String& rName, bool /* bUpdateRef */,
+bool ScDocument::RenameTab( SCTAB nTab, const rtl::OUString& rName, bool /* bUpdateRef */,
bool bExternalDocument )
{
bool bValid = false;
@@ -1670,7 +1663,7 @@ void ScDocument::InitUndoSelected( ScDocument* pSrcDoc, const ScMarkData& rTabSe
xPoolHelper = pSrcDoc->xPoolHelper;
- String aString;
+ rtl::OUString aString;
for (SCTAB nTab = 0; nTab <= rTabSelection.GetLastSelected(); nTab++)
if ( rTabSelection.GetTableSelect( nTab ) )
{
@@ -1704,7 +1697,7 @@ void ScDocument::InitUndo( ScDocument* pSrcDoc, SCTAB nTab1, SCTAB nTab2,
xPoolHelper = pSrcDoc->xPoolHelper;
- String aString;
+ rtl::OUString aString;
if ( nTab2 >= static_cast<SCTAB>(maTabs.size()))
maTabs.resize(nTab2 + 1, NULL);
for (SCTAB nTab = nTab1; nTab <= nTab2; nTab++)
@@ -1724,7 +1717,7 @@ void ScDocument::AddUndoTab( SCTAB nTab1, SCTAB nTab2, bool bColInfo, bool bRowI
{
if (bIsUndo)
{
- String aString;
+ rtl::OUString aString;
if (nTab2 >= static_cast<SCTAB>(maTabs.size()))
{
maTabs.resize(nTab2+1,NULL);
@@ -1774,7 +1767,7 @@ void ScDocument::CopyToDocument(SCCOL nCol1, SCROW nRow1, SCTAB nTab1,
PutInOrder( nCol1, nCol2 );
PutInOrder( nRow1, nRow2 );
PutInOrder( nTab1, nTab2 );
- if( !pDestDoc->aDocName.Len() )
+ if( pDestDoc->aDocName.isEmpty() )
pDestDoc->aDocName = aDocName;
if (VALIDTAB(nTab1) && VALIDTAB(nTab2))
{
@@ -1829,7 +1822,7 @@ void ScDocument::CopyToDocument(const ScRange& rRange,
ScRange aNewRange = rRange;
aNewRange.Justify();
- if( !pDestDoc->aDocName.Len() )
+ if( pDestDoc->aDocName.isEmpty() )
pDestDoc->aDocName = aDocName;
bool bOldAutoCalc = pDestDoc->GetAutoCalc();
pDestDoc->SetAutoCalc( false ); // avoid multiple calculations
@@ -2993,7 +2986,7 @@ void ScDocument::PutCell( SCCOL nCol, SCROW nRow, SCTAB nTab, ScBaseCell* pCell,
if (nTab >= static_cast<SCTAB>(maTabs.size()))
maTabs.resize(nTab + 1,NULL);
maTabs[nTab] = new ScTable(this, nTab,
- String::CreateFromAscii(RTL_CONSTASCII_STRINGPARAM("temp")),
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("temp")),
bExtras, bExtras);
}
@@ -3013,7 +3006,7 @@ void ScDocument::PutCell( const ScAddress& rPos, ScBaseCell* pCell, bool bForceT
if (nTab >= static_cast<SCTAB>(maTabs.size()))
maTabs.resize(nTab + 1,NULL);
maTabs[nTab] = new ScTable(this, nTab,
- String::CreateFromAscii(RTL_CONSTASCII_STRINGPARAM("temp")),
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("temp")),
bExtras, bExtras);
}
@@ -3022,7 +3015,7 @@ void ScDocument::PutCell( const ScAddress& rPos, ScBaseCell* pCell, bool bForceT
}
-bool ScDocument::SetString( SCCOL nCol, SCROW nRow, SCTAB nTab, const String& rString,
+bool ScDocument::SetString( SCCOL nCol, SCROW nRow, SCTAB nTab, const rtl::OUString& rString,
ScSetStringParam* pParam )
{
if ( ValidTab(nTab) && nTab < static_cast<SCTAB>(maTabs.size()) && maTabs[nTab] )
@@ -3040,34 +3033,34 @@ void ScDocument::SetValue( SCCOL nCol, SCROW nRow, SCTAB nTab, const double& rVa
}
-void ScDocument::GetString( SCCOL nCol, SCROW nRow, SCTAB nTab, String& rString )
+void ScDocument::GetString( SCCOL nCol, SCROW nRow, SCTAB nTab, rtl::OUString& rString )
{
if ( VALIDTAB(nTab) && nTab < static_cast<SCTAB>(maTabs.size()) && maTabs[nTab] )
maTabs[nTab]->GetString( nCol, nRow, rString );
else
- rString.Erase();
+ rString = rtl::OUString();
}
-void ScDocument::GetString( SCCOL nCol, SCROW nRow, SCTAB nTab, rtl::OUString& rString )
+void ScDocument::GetString( SCCOL nCol, SCROW nRow, SCTAB nTab, String& rString )
{
- String aStr;
- GetString(nCol, nRow, nTab, aStr);
- rString = aStr;
+ rtl::OUString aString;
+ GetString( nCol, nRow, nTab, aString);
+ rString = aString;
}
-void ScDocument::GetInputString( SCCOL nCol, SCROW nRow, SCTAB nTab, String& rString )
+void ScDocument::GetInputString( SCCOL nCol, SCROW nRow, SCTAB nTab, rtl::OUString& rString )
{
if ( VALIDTAB(nTab) && nTab < static_cast<SCTAB>(maTabs.size()) && maTabs[nTab] )
maTabs[nTab]->GetInputString( nCol, nRow, rString );
else
- rString.Erase();
+ rString = rtl::OUString();
}
-void ScDocument::GetInputString( SCCOL nCol, SCROW nRow, SCTAB nTab, rtl::OUString& rString )
+void ScDocument::GetInputString( SCCOL nCol, SCROW nRow, SCTAB nTab, String& rString )
{
- String aTmp;
- GetInputString(nCol, nRow, nTab, aTmp);
- rString = aTmp;
+ rtl::OUString aString;
+ GetInputString( nCol, nRow, nTab, aString);
+ rString = aString;
}
void ScDocument::GetValue( SCCOL nCol, SCROW nRow, SCTAB nTab, double& rValue )
@@ -3157,19 +3150,19 @@ void ScDocument::GetNumberFormatInfo( short& nType, sal_uLong& nIndex,
}
-void ScDocument::GetFormula( SCCOL nCol, SCROW nRow, SCTAB nTab, String& rFormula ) const
+void ScDocument::GetFormula( SCCOL nCol, SCROW nRow, SCTAB nTab, rtl::OUString& rFormula ) const
{
if ( VALIDTAB(nTab) && nTab < static_cast<SCTAB>(maTabs.size()) && maTabs[nTab] )
maTabs[nTab]->GetFormula( nCol, nRow, rFormula );
else
- rFormula.Erase();
+ rFormula = rtl::OUString();
}
-void ScDocument::GetFormula( SCCOL nCol, SCROW nRow, SCTAB nTab, rtl::OUString& rFormula) const
+void ScDocument::GetFormula( SCCOL nCol, SCROW nRow, SCTAB nTab, String& rFormula ) const
{
- String aString;
- GetFormula(nCol, nRow, nTab, aString);
+ rtl::OUString aString;
+ GetFormula( nCol, nRow, nTab, aString);
rFormula = aString;
}
@@ -5477,26 +5470,26 @@ sal_uLong ScDocument::GetCodeCount() const
}
-void ScDocument::PageStyleModified( SCTAB nTab, const String& rNewName )
+void ScDocument::PageStyleModified( SCTAB nTab, const rtl::OUString& rNewName )
{
if ( ValidTab(nTab) && nTab < static_cast<SCTAB>(maTabs.size()) && maTabs[nTab] )
maTabs[nTab]->PageStyleModified( rNewName );
}
-void ScDocument::SetPageStyle( SCTAB nTab, const String& rName )
+void ScDocument::SetPageStyle( SCTAB nTab, const rtl::OUString& rName )
{
if ( ValidTab(nTab) && nTab < static_cast<SCTAB>(maTabs.size()) && maTabs[nTab] )
maTabs[nTab]->SetPageStyle( rName );
}
-const String& ScDocument::GetPageStyle( SCTAB nTab ) const
+const rtl::OUString ScDocument::GetPageStyle( SCTAB nTab ) const
{
if ( ValidTab(nTab) && nTab < static_cast<SCTAB>(maTabs.size()) && maTabs[nTab] )
return maTabs[nTab]->GetPageStyle();
- return EMPTY_STRING;
+ return rtl::OUString();
}
@@ -5676,7 +5669,7 @@ bool ScDocument::NeedPageResetAfterTab( SCTAB nTab ) const
if ( nTab + 1 < static_cast<SCTAB>(maTabs.size()) && maTabs[nTab] && maTabs[nTab+1] )
{
- String aNew = maTabs[nTab+1]->GetPageStyle();
+ rtl::OUString aNew = maTabs[nTab+1]->GetPageStyle();
if ( aNew != maTabs[nTab]->GetPageStyle() )
{
SfxStyleSheetBase* pStyle = xPoolHelper->GetStylePool()->Find( aNew, SFX_STYLE_FAMILY_PAGE );
diff --git a/sc/source/core/data/table2.cxx b/sc/source/core/data/table2.cxx
index b52aa14..73c26ba 100644
--- a/sc/source/core/data/table2.cxx
+++ b/sc/source/core/data/table2.cxx
@@ -1058,21 +1058,21 @@ void ScTable::SetValue( SCCOL nCol, SCROW nRow, const double& rVal )
}
-void ScTable::GetString( SCCOL nCol, SCROW nRow, String& rString )
+void ScTable::GetString( SCCOL nCol, SCROW nRow, rtl::OUString& rString )
{
if (ValidColRow(nCol,nRow))
aCol[nCol].GetString( nRow, rString );
else
- rString.Erase();
+ rString = rtl::OUString();
}
-void ScTable::GetInputString( SCCOL nCol, SCROW nRow, String& rString )
+void ScTable::GetInputString( SCCOL nCol, SCROW nRow, rtl::OUString& rString )
{
if (ValidColRow(nCol,nRow))
aCol[nCol].GetInputString( nRow, rString );
else
- rString.Erase();
+ rString = rtl::OUString();
}
@@ -1084,12 +1084,12 @@ double ScTable::GetValue( SCCOL nCol, SCROW nRow )
}
-void ScTable::GetFormula( SCCOL nCol, SCROW nRow, String& rFormula )
+void ScTable::GetFormula( SCCOL nCol, SCROW nRow, rtl::OUString& rFormula )
{
if (ValidColRow(nCol,nRow))
aCol[nCol].GetFormula( nRow, rFormula );
else
- rFormula.Erase();
+ rFormula = rtl::OUString();
}
@@ -3011,11 +3011,10 @@ bool ScTable::RefVisible(ScFormulaCell* pCell)
}
-void ScTable::GetUpperCellString(SCCOL nCol, SCROW nRow, String& rStr)
+void ScTable::GetUpperCellString(SCCOL nCol, SCROW nRow, rtl::OUString& rStr)
{
GetInputString(nCol, nRow, rStr);
- rStr.EraseTrailingChars();
- rStr.EraseLeadingChars();
+ rStr = rStr.trim();
ScGlobal::pCharClass->toUpper(rStr);
}
diff --git a/sc/source/core/data/table3.cxx b/sc/source/core/data/table3.cxx
index aeedd41..700a2d0 100644
--- a/sc/source/core/data/table3.cxx
+++ b/sc/source/core/data/table3.cxx
@@ -411,8 +411,8 @@ short ScTable::CompareCell( sal_uInt16 nSort,
if ( bStr1 && bStr2 ) // nur Strings untereinander als String vergleichen!
{
- String aStr1;
- String aStr2;
+ rtl::OUString aStr1;
+ rtl::OUString aStr2;
if (eType1 == CELLTYPE_STRING)
((ScStringCell*)pCell1)->GetString(aStr1);
else
@@ -845,7 +845,7 @@ bool ScTable::DoSubTotals( ScSubTotalParam& rParam )
// (frueher nur, wenn eine Spalte mehrfach vorkam)
bool bTestPrevSub = ( nLevelCount > 1 );
- String aSubString;
+ rtl::OUString aSubString;
String aOutString;
bool bIgnoreCase = !rParam.bCaseSens;
@@ -900,7 +900,7 @@ bool ScTable::DoSubTotals( ScSubTotalParam& rParam )
bChanged = false;
if (!bTotal)
{
- String aString;
+ rtl::OUString aString;
for (i=0; i<=aRowEntry.nGroupNo && !bChanged; i++)
{
... etc. - the rest is truncated
More information about the Libreoffice-commits
mailing list