summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorMarkus Mohrhard <markus.mohrhard@googlemail.com>2011-11-06 18:11:43 +0100
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2011-11-07 03:46:21 +0100
commitcc59e69c6f2c95a4434623dfea9ab666de6ebe76 (patch)
treeaf2d28a7c336db5583c4d6a54e120c6608939305 /sc
parent128947050b4506bf1fd57d93fe249c476a184f61 (diff)
String->OUString in ScDocument and follow up
Diffstat (limited to 'sc')
-rw-r--r--sc/inc/cell.hxx3
-rw-r--r--sc/inc/cellform.hxx4
-rw-r--r--sc/inc/column.hxx6
-rw-r--r--sc/inc/document.hxx115
-rw-r--r--sc/inc/queryparam.hxx2
-rw-r--r--sc/inc/rangelst.hxx3
-rw-r--r--sc/inc/table.hxx30
-rw-r--r--sc/inc/tablink.hxx4
-rw-r--r--sc/qa/unit/helper/csv_handler.hxx4
-rw-r--r--sc/source/core/data/cell.cxx7
-rw-r--r--sc/source/core/data/column2.cxx19
-rw-r--r--sc/source/core/data/column3.cxx37
-rw-r--r--sc/source/core/data/dociter.cxx8
-rw-r--r--sc/source/core/data/documen2.cxx12
-rw-r--r--sc/source/core/data/documen3.cxx69
-rw-r--r--sc/source/core/data/documen4.cxx72
-rw-r--r--sc/source/core/data/documen5.cxx62
-rw-r--r--sc/source/core/data/documen6.cxx24
-rw-r--r--sc/source/core/data/documen8.cxx46
-rw-r--r--sc/source/core/data/documen9.cxx2
-rw-r--r--sc/source/core/data/document.cxx117
-rw-r--r--sc/source/core/data/table2.cxx17
-rw-r--r--sc/source/core/data/table3.cxx58
-rw-r--r--sc/source/core/data/table4.cxx17
-rw-r--r--sc/source/core/data/table5.cxx4
-rw-r--r--sc/source/core/data/table6.cxx12
-rw-r--r--sc/source/core/tool/cellform.cxx54
-rw-r--r--sc/source/core/tool/chgtrack.cxx2
-rw-r--r--sc/source/core/tool/doubleref.cxx2
-rw-r--r--sc/source/core/tool/interpr1.cxx4
-rw-r--r--sc/source/core/tool/queryparam.cxx3
-rw-r--r--sc/source/core/tool/rangelst.cxx15
-rw-r--r--sc/source/filter/excel/excimp8.cxx2
-rw-r--r--sc/source/filter/excel/impop.cxx2
-rw-r--r--sc/source/filter/excel/xipivot.cxx9
-rw-r--r--sc/source/filter/html/htmlexp.cxx13
-rw-r--r--sc/source/filter/rtf/rtfexp.cxx2
-rw-r--r--sc/source/filter/xcl97/XclExpChangeTrack.cxx2
-rw-r--r--sc/source/filter/xml/XMLCodeNameProvider.cxx6
-rw-r--r--sc/source/ui/app/inputhdl.cxx4
-rw-r--r--sc/source/ui/docshell/docfunc.cxx9
-rw-r--r--sc/source/ui/docshell/docsh.cxx63
-rw-r--r--sc/source/ui/docshell/docsh3.cxx6
-rw-r--r--sc/source/ui/docshell/docsh4.cxx10
-rw-r--r--sc/source/ui/docshell/docsh5.cxx10
-rw-r--r--sc/source/ui/docshell/docsh6.cxx10
-rw-r--r--sc/source/ui/docshell/docsh8.cxx10
-rw-r--r--sc/source/ui/docshell/tablink.cxx12
-rw-r--r--sc/source/ui/drawfunc/fuins2.cxx2
-rw-r--r--sc/source/ui/inc/docsh.hxx2
-rw-r--r--sc/source/ui/inc/linkarea.hxx2
-rw-r--r--sc/source/ui/miscdlgs/instbdlg.cxx4
-rw-r--r--sc/source/ui/miscdlgs/linkarea.cxx8
-rw-r--r--sc/source/ui/miscdlgs/mvtabdlg.cxx6
-rw-r--r--sc/source/ui/miscdlgs/optsolver.cxx4
-rw-r--r--sc/source/ui/navipi/content.cxx10
-rw-r--r--sc/source/ui/undo/undotab.cxx6
-rw-r--r--sc/source/ui/unoobj/cellsuno.cxx16
-rw-r--r--sc/source/ui/unoobj/docuno.cxx4
-rw-r--r--sc/source/ui/unoobj/linkuno.cxx10
-rw-r--r--sc/source/ui/unoobj/styleuno.cxx4
-rw-r--r--sc/source/ui/view/dbfunc3.cxx2
-rw-r--r--sc/source/ui/view/gridwin.cxx7
-rw-r--r--sc/source/ui/view/output2.cxx8
-rw-r--r--sc/source/ui/view/printfun.cxx2
-rw-r--r--sc/source/ui/view/tabcont.cxx2
-rw-r--r--sc/source/ui/view/viewfun2.cxx9
67 files changed, 582 insertions, 530 deletions
diff --git a/sc/inc/cell.hxx b/sc/inc/cell.hxx
index 7551ba693b15..875e7da760f4 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 70f0263c8064..cdfa09cc6599 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 5daecd57ad48..b97a89905865 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 785a24665fcb..b98e42884fc2 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 b97112157a59..389284099a65 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 e497e49b4c42..0c51506ab2ce 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 1001edeacaa9..c7f06170a4af 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 98f04225a963..3e2b542a59a0 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 8b525d496666..dbb68cd30ca8 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 49c94a50ea56..88fcbfd631e8 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 ccd73db32a37..7938c18d8622 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 baa05185ce8e..756c0c3fe658 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 dcc0247bce6f..91df27665a2d 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 565e998739c9..223c50582a0c 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 280660363ee0..273af5f20815 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 22bac02f7db5..93bcbbcbfc21 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 1b755aad8e4d..a60a73f5f2f0 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 a6dd7833a8e0..d04bb9ccf24e 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 d29a59cd5ebd..914cfef6083f 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 746cbfb689a6..e0ef5f30ccb1 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 0f21bbfb888c..b1f258e535fe 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 b52aa1460532..73c26baf5f0b 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 aeedd41e67f8..700a2d0d46dd 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++)
{
GetString( nGroupCol[i], nRow, aString );
@@ -908,8 +908,8 @@ bool ScTable::DoSubTotals( ScSubTotalParam& rParam )
ScGlobal::pCharClass->toUpper( aString );
// wenn sortiert, ist "leer" eine eigene Gruppe
// sonst sind leere Zellen unten erlaubt
- bChanged = ( ( aString.Len() || rParam.bDoSort ) &&
- aString != *pCompString[i] );
+ bChanged = ( ( !aString.isEmpty() || rParam.bDoSort ) &&
+ aString != rtl::OUString(*pCompString[i]) );
}
if ( bChanged && bTestPrevSub )
{
@@ -1266,7 +1266,7 @@ bool ScTable::ValidQuery(SCROW nRow, const ScQueryParam& rParam,
}
else if (isQueryByString(*this, rEntry, nRow, pCell))
{
- String aCellStr;
+ rtl::OUString aCellStr;
if (isPartialTextMatchOp(rEntry))
// may have to do partial textural comparison.
bMatchWholeCell = false;
@@ -1288,14 +1288,14 @@ bool ScTable::ValidQuery(SCROW nRow, const ScQueryParam& rParam,
if ( bRealRegExp || bTestRegExp )
{
xub_StrLen nStart = 0;
- xub_StrLen nEnd = aCellStr.Len();
+ xub_StrLen nEnd = aCellStr.getLength();
// from 614 on, nEnd is behind the found text
bool bMatch = false;
if ( rEntry.eOp == SC_ENDS_WITH || rEntry.eOp == SC_DOES_NOT_END_WITH )
{
nEnd = 0;
- nStart = aCellStr.Len();
+ nStart = aCellStr.getLength();
bMatch = (bool) rEntry.GetSearchTextPtr( rParam.bCaseSens )
->SearchBkwrd( aCellStr, &nStart, &nEnd );
}
@@ -1305,7 +1305,7 @@ bool ScTable::ValidQuery(SCROW nRow, const ScQueryParam& rParam,
->SearchFrwrd( aCellStr, &nStart, &nEnd );
}
if ( bMatch && bMatchWholeCell
- && (nStart != 0 || nEnd != aCellStr.Len()) )
+ && (nStart != 0 || nEnd != aCellStr.getLength()) )
bMatch = false; // RegExp must match entire cell string
if ( bRealRegExp )
switch (rEntry.eOp)
@@ -1325,10 +1325,10 @@ bool ScTable::ValidQuery(SCROW nRow, const ScQueryParam& rParam,
bOk = !( bMatch && (nStart == 0) );
break;
case SC_ENDS_WITH:
- bOk = ( bMatch && (nEnd == aCellStr.Len()) );
+ bOk = ( bMatch && (nEnd == aCellStr.getLength()) );
break;
case SC_DOES_NOT_END_WITH:
- bOk = !( bMatch && (nEnd == aCellStr.Len()) );
+ bOk = !( bMatch && (nEnd == aCellStr.getLength()) );
break;
default:
{
@@ -1362,7 +1362,7 @@ bool ScTable::ValidQuery(SCROW nRow, const ScQueryParam& rParam,
{
rtl::OUString aQueryStr = rEntry.GetQueryString();
String aCell( pTransliteration->transliterate(
- aCellStr, ScGlobal::eLnge, 0, aCellStr.Len(),
+ aCellStr, ScGlobal::eLnge, 0, aCellStr.getLength(),
NULL ) );
String aQuer( pTransliteration->transliterate(
aQueryStr, ScGlobal::eLnge, 0, aQueryStr.getLength(),
@@ -1732,7 +1732,7 @@ SCSIZE ScTable::Query(ScQueryParam& rParamOrg, bool bKeepSub)
String aStr;
for (SCCOL k=aParam.nCol1; k <= aParam.nCol2; k++)
{
- String aCellStr;
+ rtl::OUString aCellStr;
GetString(k, j, aCellStr);
aStr += aCellStr;
aStr += (sal_Unicode)1;
@@ -1793,7 +1793,7 @@ bool ScTable::CreateExcelQuery(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow
{
bool bValid = true;
SCCOL* pFields = new SCCOL[nCol2-nCol1+1];
- String aCellStr;
+ rtl::OUString aCellStr;
SCCOL nCol = nCol1;
OSL_ENSURE( rQueryParam.nTab != SCTAB_MAX, "rQueryParam.nTab no value, not bad but no good" );
SCTAB nDBTab = (rQueryParam.nTab == SCTAB_MAX ? nTab : rQueryParam.nTab);
@@ -1802,7 +1802,7 @@ bool ScTable::CreateExcelQuery(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow
// Erste Zeile muessen Spaltenkoepfe sein
while (bValid && (nCol <= nCol2))
{
- String aQueryStr;
+ rtl::OUString aQueryStr;
GetUpperCellString(nCol, nRow1, aQueryStr);
bool bFound = false;
SCCOL i = rQueryParam.nCol1;
@@ -1845,7 +1845,7 @@ bool ScTable::CreateExcelQuery(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow
{
GetInputString( nCol, nRow, aCellStr );
ScGlobal::pCharClass->toUpper( aCellStr );
- if (aCellStr.Len() > 0)
+ if (!aCellStr.isEmpty())
{
if (nIndex < nNewEntries)
{
@@ -1884,7 +1884,7 @@ bool ScTable::CreateStarQuery(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2
bool bValid;
bool bFound;
- String aCellStr;
+ rtl::OUString aCellStr;
SCSIZE nIndex = 0;
SCROW nRow = nRow1;
OSL_ENSURE( rQueryParam.nTab != SCTAB_MAX, "rQueryParam.nTab no value, not bad but no good" );
@@ -1904,12 +1904,12 @@ bool ScTable::CreateStarQuery(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2
if (nIndex > 0)
{
GetUpperCellString(nCol1, nRow, aCellStr);
- if ( aCellStr == ScGlobal::GetRscString(STR_TABLE_UND) )
+ if ( aCellStr == rtl::OUString(ScGlobal::GetRscString(STR_TABLE_UND)) )
{
rEntry.eConnect = SC_AND;
bValid = true;
}
- else if ( aCellStr == ScGlobal::GetRscString(STR_TABLE_ODER) )
+ else if ( aCellStr == rtl::OUString(ScGlobal::GetRscString(STR_TABLE_ODER)) )
{
rEntry.eConnect = SC_OR;
bValid = true;
@@ -1922,7 +1922,7 @@ bool ScTable::CreateStarQuery(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2
GetUpperCellString(nCol1 + 1, nRow, aCellStr);
for (SCCOL i=rQueryParam.nCol1; (i <= nDBCol2) && (!bFound); i++)
{
- String aFieldStr;
+ rtl::OUString aFieldStr;
if ( nTab == nDBTab )
GetUpperCellString(i, nDBRow1, aFieldStr);
else
@@ -1942,31 +1942,31 @@ bool ScTable::CreateStarQuery(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2
{
bFound = false;
GetUpperCellString(nCol1 + 2, nRow, aCellStr);
- if (aCellStr.GetChar(0) == '<')
+ if (aCellStr[0] == '<')
{
- if (aCellStr.GetChar(1) == '>')
+ if (aCellStr[1] == '>')
rEntry.eOp = SC_NOT_EQUAL;
- else if (aCellStr.GetChar(1) == '=')
+ else if (aCellStr[1] == '=')
rEntry.eOp = SC_LESS_EQUAL;
else
rEntry.eOp = SC_LESS;
}
- else if (aCellStr.GetChar(0) == '>')
+ else if (aCellStr[0] == '>')
{
- if (aCellStr.GetChar(1) == '=')
+ if (aCellStr[1] == '=')
rEntry.eOp = SC_GREATER_EQUAL;
else
rEntry.eOp = SC_GREATER;
}
- else if (aCellStr.GetChar(0) == '=')
+ else if (aCellStr[0] == '=')
rEntry.eOp = SC_EQUAL;
}
// Vierte Spalte Wert
if (bValid)
{
- String aStr;
- GetString(nCol1 + 3, nRow, aStr);
+ rtl::OUString rStr;
+ GetString(nCol1 + 3, nRow, rStr);
rEntry.SetQueryString(aStr);
rEntry.bDoQuery = true;
}
diff --git a/sc/source/core/data/table4.cxx b/sc/source/core/data/table4.cxx
index 4854f493581e..3ae86ea1da12 100644
--- a/sc/source/core/data/table4.cxx
+++ b/sc/source/core/data/table4.cxx
@@ -342,7 +342,7 @@ void ScTable::FillAnalyse( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2,
}
else if (eCellType == CELLTYPE_STRING || eCellType == CELLTYPE_EDIT)
{
- String aStr;
+ rtl::OUString aStr;
GetString(nCol, nRow, aStr);
rListData = (ScUserListData*)(ScGlobal::GetUserList()->GetData(aStr));
if (rListData)
@@ -365,12 +365,16 @@ void ScTable::FillAnalyse( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2,
// -> longest number defines rMinDigits
sal_Int32 nVal1;
- short nFlag1 = lcl_DecompValueString( aStr, nVal1, &rMinDigits );
+ String aString = aStr;
+ short nFlag1 = lcl_DecompValueString( aString, nVal1, &rMinDigits );
+ aStr = aString;
if ( nFlag1 )
{
sal_Int32 nVal2;
GetString( nCol+nAddX, nRow+nAddY, aStr );
- short nFlag2 = lcl_DecompValueString( aStr, nVal2, &rMinDigits );
+ aString = aStr;
+ short nFlag2 = lcl_DecompValueString( aString, nVal2, &rMinDigits );
+ aStr = aString;
if ( nFlag1 == nFlag2 )
{
rInc = (double)nVal2 - (double)nVal1;
@@ -387,7 +391,9 @@ void ScTable::FillAnalyse( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2,
((ScStringCell*)pCell)->GetString( aStr );
else
((ScEditCell*)pCell)->GetString( aStr );
- nFlag2 = lcl_DecompValueString( aStr, nVal2, &rMinDigits );
+ aString = aStr;
+ nFlag2 = lcl_DecompValueString( aString, nVal2, &rMinDigits );
+ aStr = aString;
if ( nFlag1 == nFlag2 )
{
double nDiff = (double)nVal2 - (double)nVal1;
@@ -412,7 +418,8 @@ void ScTable::FillAnalyse( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2,
{
// call DecompValueString to set rMinDigits
sal_Int32 nDummy;
- lcl_DecompValueString( aStr, nDummy, &rMinDigits );
+ String aString = aStr;
+ lcl_DecompValueString( aString, nDummy, &rMinDigits );
}
}
}
diff --git a/sc/source/core/data/table5.cxx b/sc/source/core/data/table5.cxx
index 5e619b7203a4..c6999dce9f70 100644
--- a/sc/source/core/data/table5.cxx
+++ b/sc/source/core/data/table5.cxx
@@ -1107,11 +1107,11 @@ void ScTable::EndListening( const ScAddress& rAddress, SvtListener* pListener )
aCol[rAddress.Col()].EndListening( *pListener, rAddress.Row() );
}
-void ScTable::SetPageStyle( const String& rName )
+void ScTable::SetPageStyle( const rtl::OUString& rName )
{
if ( aPageStyle != rName )
{
- String aStrNew = rName;
+ rtl::OUString aStrNew = rName;
SfxStyleSheetBasePool* pStylePool = pDocument->GetStyleSheetPool();
SfxStyleSheetBase* pNewStyle = pStylePool->Find( aStrNew, SFX_STYLE_FAMILY_PAGE );
diff --git a/sc/source/core/data/table6.cxx b/sc/source/core/data/table6.cxx
index 4edb697ad976..18faf6b4edab 100644
--- a/sc/source/core/data/table6.cxx
+++ b/sc/source/core/data/table6.cxx
@@ -90,7 +90,11 @@ bool ScTable::SearchCell(const SvxSearchItem& rSearchItem, SCCOL nCol, SCROW nRo
bMultiLine = lcl_GetTextWithBreaks(
*(const ScEditCell*)pCell, pDocument, aString );
else
- aCol[nCol].GetInputString( nRow, aString );
+ {
+ rtl::OUString aOUString = aString;
+ aCol[nCol].GetInputString( nRow, aOUString );
+ aString = aOUString;
+ }
}
break;
case SVX_SEARCHIN_VALUE:
@@ -98,7 +102,11 @@ bool ScTable::SearchCell(const SvxSearchItem& rSearchItem, SCCOL nCol, SCROW nRo
bMultiLine = lcl_GetTextWithBreaks(
*(const ScEditCell*)pCell, pDocument, aString );
else
- aCol[nCol].GetInputString( nRow, aString );
+ {
+ rtl::OUString aOUString = aString;
+ aCol[nCol].GetInputString( nRow, aOUString );
+ aString = aOUString;
+ }
break;
case SVX_SEARCHIN_NOTE:
{
diff --git a/sc/source/core/tool/cellform.cxx b/sc/source/core/tool/cellform.cxx
index 48be5206566b..af1975aa2127 100644
--- a/sc/source/core/tool/cellform.cxx
+++ b/sc/source/core/tool/cellform.cxx
@@ -47,7 +47,7 @@ const ScFormulaCell* pLastFormulaTreeTop = 0;
// -----------------------------------------------------------------------
-void ScCellFormat::GetString( ScBaseCell* pCell, sal_uLong nFormat, String& rString,
+void ScCellFormat::GetString( ScBaseCell* pCell, sal_uLong nFormat, rtl::OUString& rString,
Color** ppColor, SvNumberFormatter& rFormatter,
sal_Bool bNullVals,
sal_Bool bFormula,
@@ -56,10 +56,11 @@ void ScCellFormat::GetString( ScBaseCell* pCell, sal_uLong nFormat, String& rStr
*ppColor = NULL;
if (&rFormatter==NULL)
{
- rString.Erase();
+ rString = rtl::OUString();
return;
}
+ String aString = rString;
CellType eType = pCell->GetCellType();
switch(eType)
{
@@ -67,21 +68,21 @@ void ScCellFormat::GetString( ScBaseCell* pCell, sal_uLong nFormat, String& rStr
{
String aCellString;
((ScStringCell*)pCell)->GetString( aCellString );
- rFormatter.GetOutputString( aCellString, nFormat, rString, ppColor );
+ rFormatter.GetOutputString( aCellString, nFormat, aString, ppColor );
}
break;
case CELLTYPE_EDIT:
{
String aCellString;
((ScEditCell*)pCell)->GetString( aCellString );
- rFormatter.GetOutputString( aCellString, nFormat, rString, ppColor );
+ rFormatter.GetOutputString( aCellString, nFormat, aString, ppColor );
}
break;
case CELLTYPE_VALUE:
{
double nValue = ((ScValueCell*)pCell)->GetValue();
if ( !bNullVals && nValue == 0.0 )
- rString.Erase();
+ aString.Erase();
else
{
if( eForceTextFmt == ftCheck )
@@ -93,10 +94,10 @@ void ScCellFormat::GetString( ScBaseCell* pCell, sal_uLong nFormat, String& rStr
{
String aTemp;
rFormatter.GetOutputString( nValue, 0, aTemp, ppColor );
- rFormatter.GetOutputString( aTemp, nFormat, rString, ppColor );
+ rFormatter.GetOutputString( aTemp, nFormat, aString, ppColor );
}
else
- rFormatter.GetOutputString( nValue, nFormat, rString, ppColor );
+ rFormatter.GetOutputString( nValue, nFormat, aString, ppColor );
}
}
break;
@@ -104,7 +105,7 @@ void ScCellFormat::GetString( ScBaseCell* pCell, sal_uLong nFormat, String& rStr
{
ScFormulaCell* pFCell = (ScFormulaCell*)pCell;
if ( bFormula )
- pFCell->GetFormula( rString );
+ pFCell->GetFormula( aString );
else
{
// A macro started from the interpreter, which has
@@ -117,7 +118,7 @@ void ScCellFormat::GetString( ScBaseCell* pCell, sal_uLong nFormat, String& rStr
(!pFCell->GetDocument()->GetMacroInterpretLevel()
|| pFCell->IsRunning()) )
{
- rString.AssignAscii( RTL_CONSTASCII_STRINGPARAM("...") );
+ aString.AssignAscii( RTL_CONSTASCII_STRINGPARAM("...") );
}
else
{
@@ -129,88 +130,91 @@ void ScCellFormat::GetString( ScBaseCell* pCell, sal_uLong nFormat, String& rStr
nFormat );
if (nErrCode != 0)
- rString = ScGlobal::GetErrorString(nErrCode);
+ aString = ScGlobal::GetErrorString(nErrCode);
else if ( pFCell->IsEmptyDisplayedAsString() )
- rString.Erase();
+ aString.Erase();
else if ( pFCell->IsValue() )
{
double fValue = pFCell->GetValue();
if ( !bNullVals && fValue == 0.0 )
- rString.Erase();
+ aString.Erase();
else
- rFormatter.GetOutputString( fValue, nFormat, rString, ppColor );
+ rFormatter.GetOutputString( fValue, nFormat, aString, ppColor );
}
else
{
String aCellString;
pFCell->GetString( aCellString );
- rFormatter.GetOutputString( aCellString, nFormat, rString, ppColor );
+ rFormatter.GetOutputString( aCellString, nFormat, aString, ppColor );
}
}
}
}
break;
default:
- rString.Erase();
+ aString.Erase();
break;
}
+ rString = aString;
}
-void ScCellFormat::GetInputString( ScBaseCell* pCell, sal_uLong nFormat, String& rString,
+void ScCellFormat::GetInputString( ScBaseCell* pCell, sal_uLong nFormat, rtl::OUString& rString,
SvNumberFormatter& rFormatter )
{
if (&rFormatter==NULL)
{
- rString.Erase();
+ rString = rtl::OUString();
return;
}
+ String aString = rString;
CellType eType = pCell->GetCellType();
switch(eType)
{
case CELLTYPE_STRING:
{
- ((ScStringCell*)pCell)->GetString( rString );
+ ((ScStringCell*)pCell)->GetString( aString );
}
break;
case CELLTYPE_EDIT:
{
- ((ScEditCell*)pCell)->GetString( rString );
+ ((ScEditCell*)pCell)->GetString( aString );
}
break;
case CELLTYPE_VALUE:
{
double nValue = ((ScValueCell*)pCell)->GetValue();
- rFormatter.GetInputLineString( nValue, nFormat, rString );
+ rFormatter.GetInputLineString( nValue, nFormat, aString );
}
break;
case CELLTYPE_FORMULA:
{
if (((ScFormulaCell*)pCell)->IsEmptyDisplayedAsString())
{
- rString.Erase();
+ aString.Erase();
}
else if (((ScFormulaCell*)pCell)->IsValue())
{
double nValue = ((ScFormulaCell*)pCell)->GetValue();
- rFormatter.GetInputLineString( nValue, nFormat, rString );
+ rFormatter.GetInputLineString( nValue, nFormat, aString );
}
else
{
- ((ScFormulaCell*)pCell)->GetString( rString );
+ ((ScFormulaCell*)pCell)->GetString( aString );
}
sal_uInt16 nErrCode = ((ScFormulaCell*)pCell)->GetErrCode();
if (nErrCode != 0)
{
- rString.Erase();
+ aString.Erase();
}
}
break;
default:
- rString.Erase();
+ aString.Erase();
break;
}
+ rString = aString;
}
diff --git a/sc/source/core/tool/chgtrack.cxx b/sc/source/core/tool/chgtrack.cxx
index 8a341a6c4a7d..dc5b09728106 100644
--- a/sc/source/core/tool/chgtrack.cxx
+++ b/sc/source/core/tool/chgtrack.cxx
@@ -987,7 +987,7 @@ sal_Bool ScChangeActionDel::Reject( ScDocument* pDoc )
case SC_CAT_DELETE_TABS :
{
//2do: Tabellennamen merken?
- String aName;
+ rtl::OUString aName;
pDoc->CreateValidTabName( aName );
if ( ( bOk = pDoc->ValidNewTabName( aName ) ) != false )
bOk = pDoc->InsertTab( aRange.aStart.Tab(), aName );
diff --git a/sc/source/core/tool/doubleref.cxx b/sc/source/core/tool/doubleref.cxx
index 446c3c694c7e..a4e745e12de9 100644
--- a/sc/source/core/tool/doubleref.cxx
+++ b/sc/source/core/tool/doubleref.cxx
@@ -200,7 +200,7 @@ bool lcl_createExcelQuery(
if (nIndex < nNewEntries)
{
pParam->GetEntry(nIndex).nField = aFields[nCol];
- pParam->FillInExcelSyntax(aCellStr, nIndex);
+ pParam->FillInExcelSyntax(rtl::OUString(aCellStr), nIndex);
nIndex++;
if (nIndex < nNewEntries)
pParam->GetEntry(nIndex).eConnect = SC_AND;
diff --git a/sc/source/core/tool/interpr1.cxx b/sc/source/core/tool/interpr1.cxx
index d8328bbb2629..3a53890ec730 100644
--- a/sc/source/core/tool/interpr1.cxx
+++ b/sc/source/core/tool/interpr1.cxx
@@ -4912,7 +4912,7 @@ void ScInterpreter::ScCountIf()
}
else
{
- rParam.FillInExcelSyntax(rString, 0);
+ rParam.FillInExcelSyntax(rtl::OUString(rString), 0);
sal_uInt32 nIndex = 0;
rEntry.bQueryByString =
!(pFormatter->IsNumberFormat(
@@ -5234,7 +5234,7 @@ void ScInterpreter::ScSumIf()
}
else
{
- rParam.FillInExcelSyntax(aString, 0);
+ rParam.FillInExcelSyntax(rtl::OUString(aString), 0);
sal_uInt32 nIndex = 0;
rEntry.bQueryByString =
!(pFormatter->IsNumberFormat(
diff --git a/sc/source/core/tool/queryparam.cxx b/sc/source/core/tool/queryparam.cxx
index 75360218332a..b6cf41b22360 100644
--- a/sc/source/core/tool/queryparam.cxx
+++ b/sc/source/core/tool/queryparam.cxx
@@ -110,8 +110,9 @@ void ScQueryParamBase::DeleteQuery(size_t nPos)
maEntries.push_back(new ScQueryEntry);
}
-void ScQueryParamBase::FillInExcelSyntax(String& aCellStr, SCSIZE nIndex)
+void ScQueryParamBase::FillInExcelSyntax(const rtl::OUString& rStr, SCSIZE nIndex)
{
+ const String aCellStr = rStr;
if (aCellStr.Len() > 0)
{
if ( nIndex >= maEntries.size() )
diff --git a/sc/source/core/tool/rangelst.cxx b/sc/source/core/tool/rangelst.cxx
index 97ef21c7fb39..d2f367659a24 100644
--- a/sc/source/core/tool/rangelst.cxx
+++ b/sc/source/core/tool/rangelst.cxx
@@ -221,6 +221,21 @@ void ScRangeList::Format( String& rStr, sal_uInt16 nFlags, ScDocument* pDoc,
}
+void ScRangeList::Format( rtl::OUString& rStr, sal_uInt16 nFlags, ScDocument* pDoc,
+ formula::FormulaGrammar::AddressConvention eConv,
+ sal_Unicode cDelimiter ) const
+{
+
+ if (!cDelimiter)
+ cDelimiter = ScCompiler::GetNativeSymbol(ocSep).GetChar(0);
+
+ String aStr;
+ FormatString func(aStr, nFlags, pDoc, eConv, cDelimiter);
+ for_each(maRanges.begin(), maRanges.end(), func);
+ rStr = aStr;
+}
+
+
void ScRangeList::Join( const ScRange& r, bool bIsInList )
{
if ( maRanges.empty() )
diff --git a/sc/source/filter/excel/excimp8.cxx b/sc/source/filter/excel/excimp8.cxx
index 15d68e3b095f..9d26edab734e 100644
--- a/sc/source/filter/excel/excimp8.cxx
+++ b/sc/source/filter/excel/excimp8.cxx
@@ -262,7 +262,7 @@ void ImportExcel8::Boundsheet( void )
aIn.EnableDecryption();
aIn >> nGrbit >> nLen;
- String aName( aIn.ReadUniString( nLen ) );
+ rtl::OUString aName( aIn.ReadUniString( nLen ) );
GetTabInfo().AppendXclTabName( aName, nBdshtTab );
SCTAB nScTab = static_cast< SCTAB >( nBdshtTab );
diff --git a/sc/source/filter/excel/impop.cxx b/sc/source/filter/excel/impop.cxx
index 78927766b13d..dec262a576bf 100644
--- a/sc/source/filter/excel/impop.cxx
+++ b/sc/source/filter/excel/impop.cxx
@@ -702,7 +702,7 @@ void ImportExcel::Boundsheet( void )
aIn >> nGrbit;
}
- String aName( aIn.ReadByteString( false ) );
+ rtl::OUString aName( aIn.ReadByteString( false ) );
SCTAB nScTab = static_cast< SCTAB >( nBdshtTab );
if( nScTab > 0 )
diff --git a/sc/source/filter/excel/xipivot.cxx b/sc/source/filter/excel/xipivot.cxx
index 1629a066fb34..34b1c0c2ea6e 100644
--- a/sc/source/filter/excel/xipivot.cxx
+++ b/sc/source/filter/excel/xipivot.cxx
@@ -714,11 +714,12 @@ void XclImpPivotCache::ReadPivotCacheStream( XclImpStream& rStrm )
nScTab = rDoc.GetTableCount();
rDoc.MakeTable( nScTab );
- String aDummyName = CREATE_STRING( "DPCache" );
+ rtl::OUStringBuffer aDummyName(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DPCache") ));
if( maTabName.Len() > 0 )
- aDummyName.Append( '_' ).Append( maTabName );
- rDoc.CreateValidTabName( aDummyName );
- rDoc.RenameTab( nScTab, aDummyName );
+ aDummyName.append( '_' ).append( maTabName );
+ rtl::OUString aName = aDummyName.makeStringAndClear();
+ rDoc.CreateValidTabName( aName );
+ rDoc.RenameTab( nScTab, aName );
// set sheet index to source range
maSrcRange.aStart.SetTab( nScTab );
maSrcRange.aEnd.SetTab( nScTab );
diff --git a/sc/source/filter/html/htmlexp.cxx b/sc/source/filter/html/htmlexp.cxx
index 84c734e7fd13..8510edf1fd32 100644
--- a/sc/source/filter/html/htmlexp.cxx
+++ b/sc/source/filter/html/htmlexp.cxx
@@ -1174,7 +1174,7 @@ void ScHTMLExport::WriteCell( SCCOL nCol, SCROW nRow, SCTAB nTab )
TAG_ON(aStr.makeStringAndClear().getStr());
}
- String aStrOut;
+ rtl::OUString aStrOut;
sal_Bool bFieldText = false;
if ( pCell )
{ // cell content
@@ -1195,13 +1195,14 @@ void ScHTMLExport::WriteCell( SCCOL nCol, SCROW nRow, SCTAB nTab )
}
if ( !bFieldText )
{
- if ( !aStrOut.Len() )
+ if ( aStrOut.isEmpty() )
{
TAG_ON( OOO_STRING_SVTOOLS_HTML_linebreak ); // keine komplett leere Zelle
}
else
{
- xub_StrLen nPos = aStrOut.Search( _LF );
+ String aStr = aStrOut;
+ xub_StrLen nPos = aStr.Search( _LF );
if ( nPos == STRING_NOTFOUND )
{
OUT_STR( aStrOut );
@@ -1211,13 +1212,13 @@ void ScHTMLExport::WriteCell( SCCOL nCol, SCROW nRow, SCTAB nTab )
xub_StrLen nStartPos = 0;
do
{
- String aSingleLine( aStrOut, nStartPos, nPos - nStartPos );
+ String aSingleLine( aStr, nStartPos, nPos - nStartPos );
OUT_STR( aSingleLine );
TAG_ON( OOO_STRING_SVTOOLS_HTML_linebreak );
nStartPos = nPos + 1;
}
- while( ( nPos = aStrOut.Search( _LF, nStartPos ) ) != STRING_NOTFOUND );
- String aSingleLine( aStrOut, nStartPos, aStrOut.Len() - nStartPos );
+ while( ( nPos = aStr.Search( _LF, nStartPos ) ) != STRING_NOTFOUND );
+ String aSingleLine( aStr, nStartPos, aStr.Len() - nStartPos );
OUT_STR( aSingleLine );
}
}
diff --git a/sc/source/filter/rtf/rtfexp.cxx b/sc/source/filter/rtf/rtfexp.cxx
index ffef3ce6a782..8dc031be5682 100644
--- a/sc/source/filter/rtf/rtfexp.cxx
+++ b/sc/source/filter/rtf/rtfexp.cxx
@@ -190,7 +190,7 @@ void ScRTFExport::WriteCell( SCTAB nTab, SCROW nRow, SCCOL nCol )
ScBaseCell* pCell;
pDoc->GetCell( nCol, nRow, nTab, pCell );
sal_Bool bValueData;
- String aContent;
+ rtl::OUString aContent;
if ( pCell )
{
switch ( pCell->GetCellType() )
diff --git a/sc/source/filter/xcl97/XclExpChangeTrack.cxx b/sc/source/filter/xcl97/XclExpChangeTrack.cxx
index 59c6ba600268..df89d2a82afd 100644
--- a/sc/source/filter/xcl97/XclExpChangeTrack.cxx
+++ b/sc/source/filter/xcl97/XclExpChangeTrack.cxx
@@ -1548,7 +1548,7 @@ ScChangeTrack* XclExpChangeTrack::CreateTempChangeTrack()
// adjust table count
SCTAB nOrigCount = GetDoc().GetTableCount();
- String sTabName;
+ rtl::OUString sTabName;
for( sal_Int32 nIndex = 0; nIndex < nOrigCount; nIndex++ )
{
pTempDoc->CreateValidTabName( sTabName );
diff --git a/sc/source/filter/xml/XMLCodeNameProvider.cxx b/sc/source/filter/xml/XMLCodeNameProvider.cxx
index 9b7bf38ae9a2..dbbd8b9c6c74 100644
--- a/sc/source/filter/xml/XMLCodeNameProvider.cxx
+++ b/sc/source/filter/xml/XMLCodeNameProvider.cxx
@@ -78,7 +78,7 @@ XMLCodeNameProvider::~XMLCodeNameProvider()
throw (uno::RuntimeException )
{
if( aName == msDocName )
- return mpDoc->GetCodeName().Len() > 0;
+ return !mpDoc->GetCodeName().isEmpty();
SCTAB nCount = mpDoc->GetTableCount();
rtl::OUString sSheetName, sCodeName;
@@ -132,7 +132,7 @@ uno::Sequence< OUString > SAL_CALL XMLCodeNameProvider::getElementNames( )
uno::Sequence< OUString > aNames( nCount );
sal_Int32 nRealCount = 0;
- if( mpDoc->GetCodeName().Len() )
+ if( !mpDoc->GetCodeName().isEmpty() )
aNames[nRealCount++] = msDocName;
rtl::OUString sSheetName, sCodeName;
@@ -161,7 +161,7 @@ uno::Type SAL_CALL XMLCodeNameProvider::getElementType( )
::sal_Bool SAL_CALL XMLCodeNameProvider::hasElements()
throw (uno::RuntimeException )
{
- if( mpDoc->GetCodeName().Len() > 0 )
+ if( !mpDoc->GetCodeName().isEmpty() )
return sal_True;
SCTAB nCount = mpDoc->GetTableCount();
diff --git a/sc/source/ui/app/inputhdl.cxx b/sc/source/ui/app/inputhdl.cxx
index c30a8fd5824a..2f3f7e8eec67 100644
--- a/sc/source/ui/app/inputhdl.cxx
+++ b/sc/source/ui/app/inputhdl.cxx
@@ -3417,7 +3417,7 @@ void ScInputHandler::NotifyChange( const ScInputHdlState* pState,
if ( pInputWin ) // Bereichsanzeige
{
- String aPosStr;
+ rtl::OUString aPosStr;
const ScAddress::Details aAddrDetails( pDoc, aCursorPos );
// Ist der Bereich ein Name?
@@ -3427,7 +3427,7 @@ void ScInputHandler::NotifyChange( const ScInputHdlState* pState,
pActiveViewSh->GetViewData()->GetDocument()->
GetRangeAtBlock( ScRange( rSPos, rEPos ), &aPosStr );
- if ( !aPosStr.Len() ) // kein Name -> formatieren
+ if ( !aPosStr.getLength() ) // kein Name -> formatieren
{
sal_uInt16 nFlags = 0;
if( aAddrDetails.eConv == formula::FormulaGrammar::CONV_XL_R1C1 )
diff --git a/sc/source/ui/docshell/docfunc.cxx b/sc/source/ui/docshell/docfunc.cxx
index e8be035e8699..d2b6087057ef 100644
--- a/sc/source/ui/docshell/docfunc.cxx
+++ b/sc/source/ui/docshell/docfunc.cxx
@@ -2631,7 +2631,7 @@ script::ModuleInfo lcl_InitModuleInfo( SfxObjectShell& rDocSh, String& sModule )
return sModuleInfo;
}
-void VBA_InsertModule( ScDocument& rDoc, SCTAB nTab, String& sModuleName, String& sSource )
+void VBA_InsertModule( ScDocument& rDoc, SCTAB nTab, const rtl::OUString& sModuleName, const rtl::OUString& sSource )
{
SfxObjectShell& rDocSh = *rDoc.GetDocumentShell();
uno::Reference< script::XLibraryContainer > xLibContainer = rDocSh.GetBasicContainer();
@@ -2651,7 +2651,7 @@ void VBA_InsertModule( ScDocument& rDoc, SCTAB nTab, String& sModuleName, String
// if the Module with codename exists then find a new name
sal_Int32 nNum = 0;
String genModuleName;
- if ( sModuleName.Len() )
+ if ( !sModuleName.isEmpty() )
genModuleName = sModuleName;
else
{
@@ -2663,7 +2663,7 @@ void VBA_InsertModule( ScDocument& rDoc, SCTAB nTab, String& sModuleName, String
uno::Any aSourceAny;
rtl::OUString sTmpSource = sSource;
- if ( sTmpSource.getLength() == 0 )
+ if ( sTmpSource.isEmpty() )
sTmpSource = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Rem Attribute VBA_ModuleType=VBADocumentModule\nOption VBASupport 1\n" ));
aSourceAny <<= sTmpSource;
uno::Reference< script::vba::XVBAModuleInfo > xVBAModuleInfo( xLib, uno::UNO_QUERY );
@@ -2735,7 +2735,6 @@ sal_Bool ScDocFunc::InsertTable( SCTAB nTab, const String& rName, sal_Bool bReco
if (pDoc->InsertTab( nTab, rName ))
{
- String sCodeName;
if (bRecord)
rDocShell.GetUndoManager()->AddUndoAction(
new ScUndoInsertTab( &rDocShell, nTab, bAppend, rName));
@@ -2743,7 +2742,7 @@ sal_Bool ScDocFunc::InsertTable( SCTAB nTab, const String& rName, sal_Bool bReco
// Only insert vba modules if vba mode ( and not currently importing XML )
if( bInsertDocModule )
{
- String sSource;
+ rtl::OUString sSource, sCodeName;
VBA_InsertModule( *pDoc, nTab, sCodeName, sSource );
}
rDocShell.Broadcast( ScTablesHint( SC_TAB_INSERTED, nTab ) );
diff --git a/sc/source/ui/docshell/docsh.cxx b/sc/source/ui/docshell/docsh.cxx
index d09eb8f33647..93bb4bcef2ad 100644
--- a/sc/source/ui/docshell/docsh.cxx
+++ b/sc/source/ui/docshell/docsh.cxx
@@ -1605,18 +1605,19 @@ xub_StrLen lcl_ScDocShell_GetColWidthInChars( sal_uInt16 nWidth )
}
-void lcl_ScDocShell_GetFixedWidthString( String& rStr, const ScDocument& rDoc,
+void lcl_ScDocShell_GetFixedWidthString( rtl::OUString& rStr, const ScDocument& rDoc,
SCTAB nTab, SCCOL nCol, sal_Bool bValue, SvxCellHorJustify eHorJust )
{
+ String aString = rStr;
xub_StrLen nLen = lcl_ScDocShell_GetColWidthInChars(
rDoc.GetColWidth( nCol, nTab ) );
- if ( nLen < rStr.Len() )
+ if ( nLen < aString.Len() )
{
if ( bValue )
- rStr.AssignAscii( "###" );
- rStr.Erase( nLen );
+ aString.AssignAscii( "###" );
+ aString.Erase( nLen );
}
- if ( nLen > rStr.Len() )
+ if ( nLen > aString.Len() )
{
if ( bValue && eHorJust == SVX_HOR_JUSTIFY_STANDARD )
eHorJust = SVX_HOR_JUSTIFY_RIGHT;
@@ -1625,30 +1626,31 @@ void lcl_ScDocShell_GetFixedWidthString( String& rStr, const ScDocument& rDoc,
case SVX_HOR_JUSTIFY_RIGHT:
{
String aTmp;
- aTmp.Fill( nLen - rStr.Len() );
- rStr.Insert( aTmp, 0 );
+ aTmp.Fill( nLen - aString.Len() );
+ aString.Insert( aTmp, 0 );
}
break;
case SVX_HOR_JUSTIFY_CENTER:
{
- xub_StrLen nLen2 = (nLen - rStr.Len()) / 2;
+ xub_StrLen nLen2 = (nLen - aString.Len()) / 2;
String aTmp;
aTmp.Fill( nLen2 );
- rStr.Insert( aTmp, 0 );
- rStr.Expand( nLen );
+ aString.Insert( aTmp, 0 );
+ aString.Expand( nLen );
}
break;
default:
- rStr.Expand( nLen );
+ aString.Expand( nLen );
}
}
+ rStr = aString;
}
void lcl_ScDocShell_WriteEmptyFixedWidthString( SvStream& rStream,
const ScDocument& rDoc, SCTAB nTab, SCCOL nCol )
{
- String aString;
+ rtl::OUString aString;
lcl_ScDocShell_GetFixedWidthString( aString, rDoc, nTab, nCol, false,
SVX_HOR_JUSTIFY_STANDARD );
rStream.WriteUnicodeOrByteText( aString );
@@ -1706,7 +1708,7 @@ void ScDocShell::AsciiSave( SvStream& rStream, const ScImportOptions& rAsciiOpt
ScProgress aProgress( this, ScGlobal::GetRscString( STR_SAVE_DOC ), nEndRow );
- String aString;
+ rtl::OUString aString;
ScTabViewShell* pViewSh = PTR_CAST(ScTabViewShell, SfxViewShell::Current());
const ScViewOptions& rOpt = (pViewSh)
@@ -1800,7 +1802,7 @@ void ScDocShell::AsciiSave( SvStream& rStream, const ScImportOptions& rAsciiOpt
{
case CELLTYPE_NOTE:
case CELLTYPE_NONE:
- aString.Erase();
+ aString = rtl::OUString();
bString = false;
break;
case CELLTYPE_FORMULA :
@@ -1888,7 +1890,7 @@ void ScDocShell::AsciiSave( SvStream& rStream, const ScImportOptions& rAsciiOpt
break;
default:
OSL_FAIL( "ScDocShell::AsciiSave: unknown CellType" );
- aString.Erase();
+ aString = rtl::OUString();
bString = false;
}
@@ -1903,14 +1905,15 @@ void ScDocShell::AsciiSave( SvStream& rStream, const ScImportOptions& rAsciiOpt
}
else
{
- if (!bString && cStrDelim != 0 && aString.Len() > 0)
+ String aUniString = aString;//remove that later
+ if (!bString && cStrDelim != 0 && aUniString.Len() > 0)
{
- sal_Unicode c = aString.GetChar(0);
+ sal_Unicode c = aUniString.GetChar(0);
bString = (c == cStrDelim || c == ' ' ||
- aString.GetChar( aString.Len()-1) == ' ' ||
- aString.Search( cStrDelim) != STRING_NOTFOUND);
+ aUniString.GetChar( aUniString.Len()-1) == ' ' ||
+ aUniString.Search( cStrDelim) != STRING_NOTFOUND);
if (!bString && cDelim != 0)
- bString = (aString.Search( cDelim) != STRING_NOTFOUND);
+ bString = (aUniString.Search( cDelim) != STRING_NOTFOUND);
}
if ( bString )
{
@@ -1918,20 +1921,20 @@ void ScDocShell::AsciiSave( SvStream& rStream, const ScImportOptions& rAsciiOpt
{
if ( eCharSet == RTL_TEXTENCODING_UNICODE )
{
- xub_StrLen nPos = aString.Search( cStrDelim );
+ xub_StrLen nPos = aUniString.Search( cStrDelim );
// #i116636# quotes are needed if text delimiter (quote), field delimiter, or LF is in the cell text
bool bNeedQuotes = rAsciiOpt.bQuoteAllText ||
( nPos != STRING_NOTFOUND ) ||
- ( aString.Search( cDelim ) != STRING_NOTFOUND ) ||
- ( aString.Search( sal_Unicode(_LF) ) != STRING_NOTFOUND );
+ ( aUniString.Search( cDelim ) != STRING_NOTFOUND ) ||
+ ( aUniString.Search( sal_Unicode(_LF) ) != STRING_NOTFOUND );
while ( nPos != STRING_NOTFOUND )
{
- aString.Insert( cStrDelim, nPos );
- nPos = aString.Search( cStrDelim, nPos+2 );
+ aUniString.Insert( cStrDelim, nPos );
+ nPos = aUniString.Search( cStrDelim, nPos+2 );
}
if ( bNeedQuotes )
rStream.WriteUniOrByteChar( cStrDelim, eCharSet );
- rStream.WriteUnicodeText( aString );
+ rStream.WriteUnicodeText( aUniString );
if ( bNeedQuotes )
rStream.WriteUniOrByteChar( cStrDelim, eCharSet );
}
@@ -1954,7 +1957,7 @@ void ScDocShell::AsciiSave( SvStream& rStream, const ScImportOptions& rAsciiOpt
if ( bContextOrNotAsciiEncoding )
{
// to byte encoding
- ByteString aStrEnc( aString, eCharSet );
+ ByteString aStrEnc( aUniString, eCharSet );
// back to Unicode
UniString aStrDec( aStrEnc, eCharSet );
// search on re-decoded string
@@ -1978,7 +1981,7 @@ void ScDocShell::AsciiSave( SvStream& rStream, const ScImportOptions& rAsciiOpt
}
else
{
- ByteString aStrEnc( aString, eCharSet );
+ ByteString aStrEnc( aUniString, eCharSet );
// search on encoded string
xub_StrLen nPos = aStrEnc.Search( aStrDelimEncoded );
bool bNeedQuotes = rAsciiOpt.bQuoteAllText ||
@@ -2003,10 +2006,10 @@ void ScDocShell::AsciiSave( SvStream& rStream, const ScImportOptions& rAsciiOpt
}
}
else
- rStream.WriteUnicodeOrByteText( aString );
+ rStream.WriteUnicodeOrByteText( aUniString );
}
else
- rStream.WriteUnicodeOrByteText( aString );
+ rStream.WriteUnicodeOrByteText( aUniString );
}
if( nCol < nEndCol )
diff --git a/sc/source/ui/docshell/docsh3.cxx b/sc/source/ui/docshell/docsh3.cxx
index 49b5f459efd2..23355664b27b 100644
--- a/sc/source/ui/docshell/docsh3.cxx
+++ b/sc/source/ui/docshell/docsh3.cxx
@@ -1063,7 +1063,7 @@ void ScDocShell::MergeDocument( ScDocument& rOtherDoc, bool bShared, bool bCheck
break;
case SC_CAT_INSERT_TABS :
{
- String aName;
+ rtl::OUString aName;
aDocument.CreateValidTabName( aName );
GetDocFunc().InsertTable( aSourceRange.aStart.Tab(), aName, sal_True, false );
}
@@ -1230,7 +1230,7 @@ bool ScDocShell::MergeSharedDocument( ScDocShell* pSharedDocShell )
ScDocument* pTmpDoc = new ScDocument;
for ( sal_Int32 nIndex = 0; nIndex < aDocument.GetTableCount(); ++nIndex )
{
- String sTabName;
+ rtl::OUString sTabName;
pTmpDoc->CreateValidTabName( sTabName );
pTmpDoc->InsertTab( SC_TAB_APPEND, sTabName );
}
@@ -1275,7 +1275,7 @@ bool ScDocShell::MergeSharedDocument( ScDocShell* pSharedDocShell )
pTmpDoc = new ScDocument;
for ( sal_Int32 nIndex = 0; nIndex < aDocument.GetTableCount(); ++nIndex )
{
- String sTabName;
+ rtl::OUString sTabName;
pTmpDoc->CreateValidTabName( sTabName );
pTmpDoc->InsertTab( SC_TAB_APPEND, sTabName );
}
diff --git a/sc/source/ui/docshell/docsh4.cxx b/sc/source/ui/docshell/docsh4.cxx
index f8875896f4b5..858809bcda24 100644
--- a/sc/source/ui/docshell/docsh4.cxx
+++ b/sc/source/ui/docshell/docsh4.cxx
@@ -1334,8 +1334,8 @@ void ScDocShell::NotifyStyle( const SfxStyleSheetHint& rHint )
{
ScDocShellModificator aModificator( *this );
- String aNewName = pStyle->GetName();
- String aOldName = aNewName;
+ rtl::OUString aNewName = pStyle->GetName();
+ rtl::OUString aOldName = aNewName;
sal_Bool bExtended = rHint.ISA(SfxStyleSheetHintExtended); // Name geaendert?
if (bExtended)
aOldName = ((SfxStyleSheetHintExtended&)rHint).GetOldName();
@@ -1372,8 +1372,8 @@ void ScDocShell::NotifyStyle( const SfxStyleSheetHint& rHint )
{
if ( nId == SFX_STYLESHEET_MODIFIED)
{
- String aNewName = pStyle->GetName();
- String aOldName = aNewName;
+ rtl::OUString aNewName = pStyle->GetName();
+ rtl::OUString aOldName = aNewName;
sal_Bool bExtended = rHint.ISA(SfxStyleSheetHintExtended);
if (bExtended)
aOldName = ((SfxStyleSheetHintExtended&)rHint).GetOldName();
@@ -1504,7 +1504,7 @@ sal_Bool ScDocShell::AdjustPrintZoom( const ScRange& rRange )
return bChange;
}
-void ScDocShell::PageStyleModified( const String& rStyleName, sal_Bool bApi )
+void ScDocShell::PageStyleModified( const rtl::OUString& rStyleName, sal_Bool bApi )
{
ScDocShellModificator aModificator( *this );
diff --git a/sc/source/ui/docshell/docsh5.cxx b/sc/source/ui/docshell/docsh5.cxx
index a2d5ba50bcd4..081fe0d0161e 100644
--- a/sc/source/ui/docshell/docsh5.cxx
+++ b/sc/source/ui/docshell/docsh5.cxx
@@ -75,7 +75,7 @@
#include <vector>
// defined in docfunc.cxx
-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 );
using com::sun::star::script::XLibraryContainer;
using com::sun::star::script::vba::XVBACompatibility;
@@ -943,8 +943,8 @@ sal_Bool ScDocShell::MoveTable( SCTAB nSrcTab, SCTAB nDestTab, sal_Bool bCopy, s
SCTAB nTabToUse = nDestTab;
if ( nDestTab == SC_TAB_APPEND )
nTabToUse = aDocument.GetMaxTableNumber() - 1;
- String sCodeName;
- String sSource;
+ rtl::OUString sCodeName;
+ rtl::OUString sSource;
Reference< XNameContainer > xLib;
if( xLibContainer.is() )
{
@@ -953,9 +953,7 @@ sal_Bool ScDocShell::MoveTable( SCTAB nSrcTab, SCTAB nDestTab, sal_Bool bCopy, s
}
if( xLib.is() )
{
- rtl::OUString sRTLSource;
- xLib->getByName( sSrcCodeName ) >>= sRTLSource;
- sSource = sRTLSource;
+ xLib->getByName( sSrcCodeName ) >>= sSource;
}
VBA_InsertModule( aDocument, nTabToUse, sCodeName, sSource );
}
diff --git a/sc/source/ui/docshell/docsh6.cxx b/sc/source/ui/docshell/docsh6.cxx
index d2f72271dfce..511abb514363 100644
--- a/sc/source/ui/docshell/docsh6.cxx
+++ b/sc/source/ui/docshell/docsh6.cxx
@@ -425,9 +425,9 @@ void ScDocShell::UpdateLinks()
for (SCTAB i=0; i<nTabCount; i++)
if (aDocument.IsLinked(i))
{
- String aDocName = aDocument.GetLinkDoc(i);
- String aFltName = aDocument.GetLinkFlt(i);
- String aOptions = aDocument.GetLinkOpt(i);
+ rtl::OUString aDocName = aDocument.GetLinkDoc(i);
+ rtl::OUString aFltName = aDocument.GetLinkFlt(i);
+ rtl::OUString aOptions = aDocument.GetLinkOpt(i);
sal_uLong nRefresh = aDocument.GetLinkRefreshDelay(i);
sal_Bool bThere = false;
for (SCTAB j=0; j<i && !bThere; j++) // im Dokument mehrfach?
@@ -453,7 +453,9 @@ void ScDocShell::UpdateLinks()
{
ScTableLink* pLink = new ScTableLink( this, aDocName, aFltName, aOptions, nRefresh );
pLink->SetInCreate( sal_True );
- pLinkManager->InsertFileLink( *pLink, OBJECT_CLIENT_FILE, aDocName, &aFltName );
+ String aStringDocName = aDocName;
+ String aStringFltName = aFltName;
+ pLinkManager->InsertFileLink( *pLink, OBJECT_CLIENT_FILE, aStringDocName, &aStringFltName );
pLink->Update();
pLink->SetInCreate( false );
}
diff --git a/sc/source/ui/docshell/docsh8.cxx b/sc/source/ui/docshell/docsh8.cxx
index c97dddf7861a..9058f7be4cb5 100644
--- a/sc/source/ui/docshell/docsh8.cxx
+++ b/sc/source/ui/docshell/docsh8.cxx
@@ -772,14 +772,14 @@ void lcl_GetColumnTypes( ScDocShell& rDocShell,
}
-inline void lcl_getLongVarCharEditString( String& rString,
+inline void lcl_getLongVarCharEditString( rtl::OUString& rString,
const ScBaseCell* pCell, ScFieldEditEngine& rEditEngine )
{
rEditEngine.SetText( *((const ScEditCell*)pCell)->GetData() );
rString = rEditEngine.GetText( LINEEND_CRLF );
}
-inline void lcl_getLongVarCharString( String& rString, ScBaseCell* pCell,
+inline void lcl_getLongVarCharString( rtl::OUString& rString, ScBaseCell* pCell,
ScDocument& rDocument, SCCOL nCol, SCROW nRow, SCTAB nTab,
SvNumberFormatter& rNumFmt )
{
@@ -833,7 +833,7 @@ sal_uLong ScDocShell::DBaseExport( const String& rFullFileName, CharSet eCharSet
// also needed for exception catch
SCROW nDocRow = 0;
ScFieldEditEngine aEditEngine( aDocument.GetEditPool() );
- String aString;
+ rtl::OUString aString;
String aTabName;
try
@@ -996,7 +996,7 @@ sal_uLong ScDocShell::DBaseExport( const String& rFullFileName, CharSet eCharSet
case sdbc::DataType::VARCHAR:
aDocument.GetString( nDocCol, nDocRow, nTab, aString );
xRowUpdate->updateString( nCol+1, aString );
- if ( nErr == eERR_OK && pColLengths[nCol] < aString.Len() )
+ if ( nErr == eERR_OK && pColLengths[nCol] < aString.getLength() )
nErr = SCWARN_EXPORT_DATALOST;
break;
@@ -1136,7 +1136,7 @@ sal_uLong ScDocShell::DBaseExport( const String& rFullFileName, CharSet eCharSet
#endif
}
else
- nLen = aString.Len() * sizeof(sal_Unicode);
+ nLen = aString.getLength() * sizeof(sal_Unicode);
if (!bEncErr &&
pColTypes[nCol] != sdbc::DataType::LONGVARCHAR &&
pColLengths[nCol] < nLen)
diff --git a/sc/source/ui/docshell/tablink.cxx b/sc/source/ui/docshell/tablink.cxx
index 386dde4ea179..a5d537f7a407 100644
--- a/sc/source/ui/docshell/tablink.cxx
+++ b/sc/source/ui/docshell/tablink.cxx
@@ -547,20 +547,20 @@ void ScDocumentLoader::RemoveAppPrefix( rtl::OUString& rFilterName )
rFilterName = rFilterName.copy(nPreLen);
}
-ScDocumentLoader::ScDocumentLoader( const String& rFileName,
- String& rFilterName, String& rOptions,
+ScDocumentLoader::ScDocumentLoader( const rtl::OUString& rFileName,
+ rtl::OUString& rFilterName, rtl::OUString& rOptions,
sal_uInt32 nRekCnt, bool bWithInteraction ) :
pDocShell(0),
pMedium(0)
{
- if ( !rFilterName.Len() )
+ if ( rFilterName.isEmpty() )
GetFilterName( rFileName, rFilterName, rOptions, true, bWithInteraction );
const SfxFilter* pFilter = ScDocShell::Factory().GetFilterContainer()->GetFilter4FilterName( rFilterName );
// ItemSet immer anlegen, damit die DocShell die Optionen setzen kann
SfxItemSet* pSet = new SfxAllItemSet( SFX_APP()->GetPool() );
- if ( rOptions.Len() )
+ if ( !rOptions.isEmpty() )
pSet->Put( SfxStringItem( SID_FILE_FILTEROPTIONS, rOptions ) );
pMedium = new SfxMedium( rFileName, STREAM_STD_READ, false, pFilter, pSet );
@@ -587,8 +587,8 @@ ScDocumentLoader::ScDocumentLoader( const String& rFileName,
pDocShell->DoLoad( pMedium );
- String aNew = GetOptions(*pMedium); // Optionen werden beim Laden per Dialog gesetzt
- if (aNew.Len() && aNew != rOptions)
+ rtl::OUString aNew = GetOptions(*pMedium); // Optionen werden beim Laden per Dialog gesetzt
+ if (!aNew.isEmpty() && aNew != rOptions)
rOptions = aNew;
}
diff --git a/sc/source/ui/drawfunc/fuins2.cxx b/sc/source/ui/drawfunc/fuins2.cxx
index 3efae6b07752..610f16f1813a 100644
--- a/sc/source/ui/drawfunc/fuins2.cxx
+++ b/sc/source/ui/drawfunc/fuins2.cxx
@@ -632,7 +632,7 @@ FuInsertChart::FuInsertChart(ScTabViewShell* pViewSh, Window* pWin, ScDrawView*
if ( nToTable == pScDoc->GetTableCount() )
{
// dann los...
- String aTabName;
+ rtl::OUString aTabName;
SCTAB nNewTab = pScDoc->GetTableCount();
pScDoc->CreateValidTabName( aTabName );
diff --git a/sc/source/ui/inc/docsh.hxx b/sc/source/ui/inc/docsh.hxx
index c3b5c932b14a..c468ddfa9341 100644
--- a/sc/source/ui/inc/docsh.hxx
+++ b/sc/source/ui/inc/docsh.hxx
@@ -284,7 +284,7 @@ public:
void LoadStylesArgs( ScDocShell& rSource, sal_Bool bReplace, sal_Bool bCellStyles, sal_Bool bPageStyles );
- void PageStyleModified( const String& rStyleName, sal_Bool bApi );
+ void PageStyleModified( const rtl::OUString& rStyleName, sal_Bool bApi );
void NotifyStyle( const SfxStyleSheetHint& rHint );
void DoAutoStyle( const ScRange& rRange, const String& rStyle );
diff --git a/sc/source/ui/inc/linkarea.hxx b/sc/source/ui/inc/linkarea.hxx
index 20724fa7293d..e3cf0e7c2d62 100644
--- a/sc/source/ui/inc/linkarea.hxx
+++ b/sc/source/ui/inc/linkarea.hxx
@@ -76,7 +76,7 @@ private:
void UpdateSourceRanges();
void UpdateEnable();
- void LoadDocument( const String& rFile, const String& rFilter,
+ void LoadDocument( const rtl::OUString& rFile, const String& rFilter,
const String& rOptions );
public:
diff --git a/sc/source/ui/miscdlgs/instbdlg.cxx b/sc/source/ui/miscdlgs/instbdlg.cxx
index d5e47ce425e2..718f02702b1b 100644
--- a/sc/source/ui/miscdlgs/instbdlg.cxx
+++ b/sc/source/ui/miscdlgs/instbdlg.cxx
@@ -130,7 +130,7 @@ void ScInsertTableDlg::Init_Impl( bool bFromFile )
if(nTableCount==1)
{
- String aName;
+ rtl::OUString aName;
rDoc.CreateValidTabName( aName );
aEdName.SetText( aName );
}
@@ -299,7 +299,7 @@ IMPL_LINK( ScInsertTableDlg, CountHdl_Impl, NumericField*, EMPTYARG )
nTableCount = static_cast<SCTAB>(aNfCount.GetValue());
if ( nTableCount==1)
{
- String aName;
+ rtl::OUString aName;
rDoc.CreateValidTabName( aName );
aEdName.SetText( aName );
aFtName.Enable();
diff --git a/sc/source/ui/miscdlgs/linkarea.cxx b/sc/source/ui/miscdlgs/linkarea.cxx
index dd7d129b0c58..67fe1ac1157e 100644
--- a/sc/source/ui/miscdlgs/linkarea.cxx
+++ b/sc/source/ui/miscdlgs/linkarea.cxx
@@ -150,7 +150,7 @@ IMPL_LINK( ScLinkedAreaDlg, FileHdl, ComboBox*, EMPTYARG )
return 0;
}
-void ScLinkedAreaDlg::LoadDocument( const String& rFile, const String& rFilter, const String& rOptions )
+void ScLinkedAreaDlg::LoadDocument( const rtl::OUString& rFile, const String& rFilter, const String& rOptions )
{
if ( pSourceShell )
{
@@ -160,12 +160,12 @@ void ScLinkedAreaDlg::LoadDocument( const String& rFile, const String& rFilter,
aSourceRef.Clear();
}
- if ( rFile.Len() )
+ if ( rFile.getLength() )
{
WaitObject aWait( this );
- String aNewFilter = rFilter;
- String aNewOptions = rOptions;
+ rtl::OUString aNewFilter = rFilter;
+ rtl::OUString aNewOptions = rOptions;
SfxErrorContext aEc( ERRCTX_SFX_OPENDOC, rFile );
diff --git a/sc/source/ui/miscdlgs/mvtabdlg.cxx b/sc/source/ui/miscdlgs/mvtabdlg.cxx
index a89cf6f06bc2..c29cc630db30 100644
--- a/sc/source/ui/miscdlgs/mvtabdlg.cxx
+++ b/sc/source/ui/miscdlgs/mvtabdlg.cxx
@@ -313,12 +313,12 @@ IMPL_LINK( ScMoveTableDlg, OkHdl, void *, EMPTYARG )
{
// Return an empty string when the new name is the same as the
// automatic name assigned by the document.
- String aCopyName = maDefaultName;
+ rtl::OUString aCopyName = maDefaultName;
ScDocument* pDoc = GetSelectedDoc();
if (pDoc)
pDoc->CreateValidTabName(aCopyName);
- if (aCopyName == aEdTabName.GetText())
- aEdTabName.SetText( String() );
+ if (aCopyName == rtl::OUString(aEdTabName.GetText()))
+ aEdTabName.SetText( rtl::OUString() );
}
else
{
diff --git a/sc/source/ui/miscdlgs/optsolver.cxx b/sc/source/ui/miscdlgs/optsolver.cxx
index 5c4fa32b1381..3607f7a1adea 100644
--- a/sc/source/ui/miscdlgs/optsolver.cxx
+++ b/sc/source/ui/miscdlgs/optsolver.cxx
@@ -389,7 +389,7 @@ void ScOptSolverDlg::Init(const ScAddress& rCursorPos)
else
{
maRbMax.Check();
- String aCursorStr;
+ rtl::OUString aCursorStr;
if ( !mpDoc->GetRangeAtBlock( ScRange(rCursorPos), &aCursorStr ) )
rCursorPos.Format( aCursorStr, SCA_ABS, NULL, mpDoc->GetAddressConvention() );
maEdObjectiveCell.SetRefString( aCursorStr );
@@ -503,7 +503,7 @@ void ScOptSolverDlg::SetReference( const ScRange& rRef, ScDocument* pDocP )
if ( bSingle )
aNewRef.aEnd = aAdr;
- String aName;
+ rtl::OUString aName;
if ( pDocP->GetRangeAtBlock( aNewRef, &aName ) ) // named range: show name
aStr = aName;
else // format cell/range reference
diff --git a/sc/source/ui/navipi/content.cxx b/sc/source/ui/navipi/content.cxx
index 25330e7ca78c..bd32d1c50d57 100644
--- a/sc/source/ui/navipi/content.cxx
+++ b/sc/source/ui/navipi/content.cxx
@@ -1204,8 +1204,9 @@ void ScContentTree::DoDrag()
ScDocShell* pSrcShell = NULL;
if ( bHiddenDoc )
{
- String aFilter, aOptions;
- pDocLoader = new ScDocumentLoader( aHiddenName, aFilter, aOptions );
+ rtl::OUString aFilter, aOptions;
+ rtl::OUString aURL = aHiddenName;
+ pDocLoader = new ScDocumentLoader( aURL, aFilter, aOptions );
if (!pDocLoader->IsError())
pSrcShell = pDocLoader->GetDocShell();
}
@@ -1282,8 +1283,9 @@ sal_Bool ScContentTree::LoadFile( const String& rUrl )
aDocName.Erase(nPos); // nur der Name, ohne #...
sal_Bool bReturn = false;
- String aFilter, aOptions;
- ScDocumentLoader aLoader( aDocName, aFilter, aOptions );
+ rtl::OUString aURL = aDocName;
+ rtl::OUString aFilter, aOptions;
+ ScDocumentLoader aLoader( aURL, aFilter, aOptions );
if ( !aLoader.IsError() )
{
bHiddenDoc = sal_True;
diff --git a/sc/source/ui/undo/undotab.cxx b/sc/source/ui/undo/undotab.cxx
index 1a2f9f58707e..0dc6c48d1d18 100644
--- a/sc/source/ui/undo/undotab.cxx
+++ b/sc/source/ui/undo/undotab.cxx
@@ -1120,7 +1120,7 @@ ScUndoRemoveLink::ScUndoRemoveLink( ScDocShell* pShell, const String& rDoc ) :
{
sal_uInt8 nMode = pDoc->GetLinkMode(i);
if (nMode)
- if (pDoc->GetLinkDoc(i) == aDocName)
+ if (pDoc->GetLinkDoc(i) == rtl::OUString(aDocName))
{
if (!nCount)
{
@@ -1130,8 +1130,8 @@ ScUndoRemoveLink::ScUndoRemoveLink( ScDocShell* pShell, const String& rDoc ) :
}
else
{
- OSL_ENSURE(aFltName == pDoc->GetLinkFlt(i) &&
- aOptions == pDoc->GetLinkOpt(i),
+ OSL_ENSURE(rtl::OUString(aFltName) == pDoc->GetLinkFlt(i) &&
+ rtl::OUString(aOptions) == pDoc->GetLinkOpt(i),
"verschiedene Filter fuer ein Dokument?");
}
pTabs[nCount] = i;
diff --git a/sc/source/ui/unoobj/cellsuno.cxx b/sc/source/ui/unoobj/cellsuno.cxx
index 5f7db570726b..618a8f5e40f5 100644
--- a/sc/source/ui/unoobj/cellsuno.cxx
+++ b/sc/source/ui/unoobj/cellsuno.cxx
@@ -1272,7 +1272,7 @@ sal_Bool lcl_PutFormulaArray( ScDocShell& rDocShell, const ScRange& rRange,
// used in ScCellRangeObj::getFormulaArray and ScCellObj::GetInputString_Impl
String lcl_GetInputString( ScDocument* pDoc, const ScAddress& rPosition, sal_Bool bEnglish )
{
- String aVal;
+ rtl::OUString aVal;
if ( pDoc )
{
ScBaseCell* pCell = pDoc->GetCell( rPosition );
@@ -1314,16 +1314,18 @@ String lcl_GetInputString( ScDocument* pDoc, const ScAddress& rPosition, sal_Boo
if ( eType == CELLTYPE_STRING || eType == CELLTYPE_EDIT )
{
double fDummy;
- sal_Bool bIsNumberFormat(pFormatter->IsNumberFormat(aVal, nNumFmt, fDummy));
+ String aTempString = aVal;
+ sal_Bool bIsNumberFormat(pFormatter->IsNumberFormat(aTempString, nNumFmt, fDummy));
if ( bIsNumberFormat )
- aVal.Insert('\'',0);
- else if ( aVal.Len() && aVal.GetChar(0) == '\'' )
+ aTempString.Insert('\'',0);
+ else if ( aTempString.Len() && aTempString.GetChar(0) == '\'' )
{
// if the string starts with a "'", add another one because setFormula
// strips one (like text input, except for "text" number formats)
if ( bEnglish || ( pFormatter->GetType(nNumFmt) != NUMBERFORMAT_TEXT ) )
- aVal.Insert('\'',0);
+ aTempString.Insert('\'',0);
}
+ aVal = aTempString;
}
}
}
@@ -6174,7 +6176,7 @@ String ScCellObj::GetInputString_Impl(sal_Bool bEnglish) const // fuer getF
String ScCellObj::GetOutputString_Impl(ScDocument* pDoc, const ScAddress& aCellPos)
{
- String aVal;
+ rtl::OUString aVal;
if ( pDoc )
{
ScBaseCell* pCell = pDoc->GetCell( aCellPos );
@@ -8223,7 +8225,7 @@ void ScTableSheetObj::SetOnePropertyValue( const SfxItemPropertySimpleEntry* pEn
{
rtl::OUString aStrVal;
aValue >>= aStrVal;
- String aNewStr(ScStyleNameConversion::ProgrammaticToDisplayName(
+ rtl::OUString aNewStr(ScStyleNameConversion::ProgrammaticToDisplayName(
aStrVal, SFX_STYLE_FAMILY_PAGE ));
//! Undo? (auch bei SID_STYLE_APPLY an der View)
diff --git a/sc/source/ui/unoobj/docuno.cxx b/sc/source/ui/unoobj/docuno.cxx
index 8015b2c876af..46f94f8d52e7 100644
--- a/sc/source/ui/unoobj/docuno.cxx
+++ b/sc/source/ui/unoobj/docuno.cxx
@@ -2333,10 +2333,10 @@ uno::Reference<drawing::XDrawPage> SAL_CALL ScDrawPagesObj::insertNewByIndex( sa
uno::Reference<drawing::XDrawPage> xRet;
if (pDocShell)
{
- String aNewName;
+ rtl::OUString aNewName;
pDocShell->GetDocument()->CreateValidTabName(aNewName);
ScDocFunc aFunc(*pDocShell);
- if ( aFunc.InsertTable( (SCTAB)nPos, aNewName, sal_True, sal_True ) )
+ if ( aFunc.InsertTable( static_cast<SCTAB>(nPos), aNewName, true, true ) )
xRet.set(GetObjectByIndex_Impl( nPos ));
}
return xRet;
diff --git a/sc/source/ui/unoobj/linkuno.cxx b/sc/source/ui/unoobj/linkuno.cxx
index 1a64b92ab960..a5af4e632742 100644
--- a/sc/source/ui/unoobj/linkuno.cxx
+++ b/sc/source/ui/unoobj/linkuno.cxx
@@ -312,7 +312,7 @@ void ScSheetLinkObj::setFileName(const rtl::OUString& rNewName)
ScDocument* pDoc = pDocShell->GetDocument();
SCTAB nTabCount = pDoc->GetTableCount();
for (SCTAB nTab=0; nTab<nTabCount; nTab++)
- if ( pDoc->IsLinked(nTab) && pDoc->GetLinkDoc(nTab) == aFileName ) // alte Datei
+ if ( pDoc->IsLinked(nTab) && pDoc->GetLinkDoc(nTab) == rtl::OUString(aFileName) ) // alte Datei
pDoc->SetLink( nTab, pDoc->GetLinkMode(nTab), aNewStr,
pDoc->GetLinkFlt(nTab), pDoc->GetLinkOpt(nTab),
pDoc->GetLinkTab(nTab),
@@ -1305,7 +1305,7 @@ ScDDELinkObj* ScDDELinksObj::GetObjectByIndex_Impl(sal_Int32 nIndex)
{
if (pDocShell)
{
- String aAppl, aTopic, aItem;
+ rtl::OUString aAppl, aTopic, aItem;
if ( nIndex <= USHRT_MAX &&
pDocShell->GetDocument()->GetDdeLinkData( (sal_uInt16)nIndex, aAppl, aTopic, aItem ) )
return new ScDDELinkObj( pDocShell, aAppl, aTopic, aItem );
@@ -1318,7 +1318,7 @@ ScDDELinkObj* ScDDELinksObj::GetObjectByName_Impl(const rtl::OUString& aName)
if (pDocShell)
{
String aNamStr(aName);
- String aAppl, aTopic, aItem;
+ rtl::OUString aAppl, aTopic, aItem;
ScDocument* pDoc = pDocShell->GetDocument();
sal_uInt16 nCount = pDoc->GetDdeLinkCount();
@@ -1393,7 +1393,7 @@ uno::Sequence<rtl::OUString> SAL_CALL ScDDELinksObj::getElementNames() throw(uno
SolarMutexGuard aGuard;
if (pDocShell)
{
- String aAppl, aTopic, aItem;
+ rtl::OUString aAppl, aTopic, aItem;
ScDocument* pDoc = pDocShell->GetDocument();
sal_uInt16 nCount = pDoc->GetDdeLinkCount();
@@ -1417,7 +1417,7 @@ sal_Bool SAL_CALL ScDDELinksObj::hasByName( const rtl::OUString& aName )
if (pDocShell)
{
String aNamStr(aName);
- String aAppl, aTopic, aItem;
+ rtl::OUString aAppl, aTopic, aItem;
ScDocument* pDoc = pDocShell->GetDocument();
sal_uInt16 nCount = pDoc->GetDdeLinkCount();
diff --git a/sc/source/ui/unoobj/styleuno.cxx b/sc/source/ui/unoobj/styleuno.cxx
index 41cef8d44003..0efc5577e08e 100644
--- a/sc/source/ui/unoobj/styleuno.cxx
+++ b/sc/source/ui/unoobj/styleuno.cxx
@@ -689,8 +689,8 @@ void SAL_CALL ScStyleFamiliesObj::loadStylesFromURL( const rtl::OUString& aURL,
//! use aOptions (like Writer)
//! set flag to disable filter option dialogs when importing
- String aFilter; // empty - detect
- String aFiltOpt;
+ rtl::OUString aFilter; // empty - detect
+ rtl::OUString aFiltOpt;
ScDocumentLoader aLoader( aURL, aFilter, aFiltOpt );
ScDocShell* pSource = aLoader.GetDocShell();
diff --git a/sc/source/ui/view/dbfunc3.cxx b/sc/source/ui/view/dbfunc3.cxx
index 3b03dec46a73..e4c4f9e0fa96 100644
--- a/sc/source/ui/view/dbfunc3.cxx
+++ b/sc/source/ui/view/dbfunc3.cxx
@@ -2154,7 +2154,7 @@ void ScDBFunc::ShowDataPilotSourceData( ScDPObject& rDPObj, const Sequence<sheet
String aUndo = ScGlobal::GetRscString( STR_UNDO_DOOUTLINE );
pMgr->EnterListAction( aUndo, aUndo );
- String aNewTabName;
+ rtl::OUString aNewTabName;
pDoc->CreateValidTabName(aNewTabName);
if ( InsertTable(aNewTabName, nNewTab) )
PasteFromClip( IDF_ALL, pInsDoc.get() );
diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx
index aab30fc77519..bc78aaa4c03b 100644
--- a/sc/source/ui/view/gridwin.cxx
+++ b/sc/source/ui/view/gridwin.cxx
@@ -3407,7 +3407,8 @@ sal_Int8 ScGridWindow::AcceptPrivateDrop( const AcceptDropEvent& rEvt )
ScDocument* pThisDoc = pViewData->GetDocument();
if (pSourceDoc == pThisDoc)
{
- if ( pThisDoc->HasChartAtPoint(pViewData->GetTabNo(), PixelToLogic(aPos)) )
+ rtl::OUString aName;
+ if ( pThisDoc->HasChartAtPoint(pViewData->GetTabNo(), PixelToLogic(aPos), aName ))
{
if (bDragRect) // Rechteck loeschen
{
@@ -3957,8 +3958,8 @@ sal_Int8 ScGridWindow::DropTransferObj( ScTransferObj* pTransObj, SCCOL nDestPos
}
else // move/copy block
{
- String aChartName;
- if (pThisDoc->HasChartAtPoint( nThisTab, rLogicPos, &aChartName ))
+ rtl::OUString aChartName;
+ if (pThisDoc->HasChartAtPoint( nThisTab, rLogicPos, aChartName ))
{
String aRangeName;
aSource.Format( aRangeName, SCR_ABS_3D, pThisDoc );
diff --git a/sc/source/ui/view/output2.cxx b/sc/source/ui/view/output2.cxx
index b0dba17f4507..1b732e72fbb7 100644
--- a/sc/source/ui/view/output2.cxx
+++ b/sc/source/ui/view/output2.cxx
@@ -495,12 +495,14 @@ sal_Bool ScDrawStringsVars::SetText( ScBaseCell* pCell )
Color* pColor;
sal_uLong nFormat = GetValueFormat();
+ rtl::OUString aOUString = aString;
ScCellFormat::GetString( pCell,
- nFormat, aString, &pColor,
+ nFormat, aOUString, &pColor,
*pOutput->pDoc->GetFormatTable(),
pOutput->bShowNullValues,
pOutput->bShowFormulas,
ftCheck );
+ aString = aOUString;
if (aString.Len() > DRAWTEXT_MAX)
aString.Erase(DRAWTEXT_MAX);
@@ -2167,7 +2169,7 @@ bool ScOutputData::DrawEditParam::readCellContent(
{
sal_uLong nFormat = mpPattern->GetNumberFormat(
pDoc->GetFormatTable(), mpCondSet );
- String aString;
+ rtl::OUString aString;
Color* pColor;
ScCellFormat::GetString( mpCell,
nFormat,aString, &pColor,
@@ -4904,7 +4906,7 @@ void ScOutputData::DrawRotated(sal_Bool bPixelToLogic)
{
sal_uLong nFormat = pPattern->GetNumberFormat(
pDoc->GetFormatTable(), pCondSet );
- String aString;
+ rtl::OUString aString;
Color* pColor;
ScCellFormat::GetString( pCell,
nFormat,aString, &pColor,
diff --git a/sc/source/ui/view/printfun.cxx b/sc/source/ui/view/printfun.cxx
index 7c07e11c714f..592bc82425f5 100644
--- a/sc/source/ui/view/printfun.cxx
+++ b/sc/source/ui/view/printfun.cxx
@@ -2440,7 +2440,7 @@ sal_Bool ScPrintFunc::UpdatePages()
nZoom = ZOOM_MIN;
}
- String aName = pDoc->GetPageStyle( nPrintTab );
+ rtl::OUString aName = pDoc->GetPageStyle( nPrintTab );
SCTAB nTabCount = pDoc->GetTableCount();
for (SCTAB nTab=0; nTab<nTabCount; nTab++)
if ( nTab==nPrintTab || pDoc->GetPageStyle(nTab)==aName )
diff --git a/sc/source/ui/view/tabcont.cxx b/sc/source/ui/view/tabcont.cxx
index 18ec9bbecae3..db140e745adf 100644
--- a/sc/source/ui/view/tabcont.cxx
+++ b/sc/source/ui/view/tabcont.cxx
@@ -185,7 +185,7 @@ void ScTabControl::MouseButtonUp( const MouseEvent& rMEvt )
ScDocument* pDoc = pViewData->GetDocument();
if (!pDoc->IsDocEditable())
return;
- String aName;
+ rtl::OUString aName;
pDoc->CreateValidTabName(aName);
SCTAB nTabCount = pDoc->GetTableCount();
pViewData->GetViewShell()->InsertTable(aName, nTabCount);
diff --git a/sc/source/ui/view/viewfun2.cxx b/sc/source/ui/view/viewfun2.cxx
index ee80993645f1..6b900e452ab3 100644
--- a/sc/source/ui/view/viewfun2.cxx
+++ b/sc/source/ui/view/viewfun2.cxx
@@ -2299,9 +2299,10 @@ void ScViewFunc::InsertTableLink( const String& rFile,
const String& rFilter, const String& rOptions,
const String& rTabName )
{
- String aFilterName = rFilter;
- String aOpt = rOptions;
- ScDocumentLoader aLoader( rFile, aFilterName, aOpt );
+ rtl::OUString aFilterName = rFilter;
+ rtl::OUString aOpt = rOptions;
+ rtl::OUString aURL = rFile;
+ ScDocumentLoader aLoader( aURL, aFilterName, aOpt );
if (!aLoader.IsError())
{
ScDocShell* pSrcSh = aLoader.GetDocShell();
@@ -2754,7 +2755,7 @@ void ScViewFunc::MoveTable(
for (size_t j = 0; j < n; ++j)
{
SCTAB nRenameTab = (*pDestTabs)[j];
- String aTabName = *pNewTabName;
+ rtl::OUString aTabName = *pNewTabName;
pDoc->CreateValidTabName( aTabName );
pDestNames->push_back(aTabName);
pDoc->RenameTab(nRenameTab, aTabName);