diff options
-rw-r--r-- | sc/inc/docpool.hxx | 2 | ||||
-rw-r--r-- | sc/inc/document.hxx | 1 | ||||
-rw-r--r-- | sc/inc/docuno.hxx | 2 | ||||
-rw-r--r-- | sc/source/core/data/docpool.cxx | 2 | ||||
-rw-r--r-- | sc/source/core/data/document.cxx | 14 | ||||
-rw-r--r-- | sc/source/ui/docshell/docfunc.cxx | 7 | ||||
-rw-r--r-- | sc/source/ui/docshell/impex.cxx | 52 | ||||
-rw-r--r-- | sc/source/ui/unoobj/docuno.cxx | 12 | ||||
-rw-r--r-- | sc/source/ui/view/cellsh.cxx | 4 | ||||
-rw-r--r-- | sc/source/ui/view/cellsh1.cxx | 8 | ||||
-rw-r--r-- | sc/source/ui/view/tabvwsha.cxx | 4 |
11 files changed, 45 insertions, 63 deletions
diff --git a/sc/inc/docpool.hxx b/sc/inc/docpool.hxx index a3114aab5ae7..c794148e79ce 100644 --- a/sc/inc/docpool.hxx +++ b/sc/inc/docpool.hxx @@ -57,7 +57,7 @@ public: static void CheckRef( const SfxPoolItem& ); void StyleDeleted( ScStyleSheet* pStyle ); // delete templates(?) in organizer - void CellStyleCreated( const String& rName ); + void CellStyleCreated( const OUString& rName ); virtual SfxItemPresentation GetPresentation( const SfxPoolItem& rItem, SfxItemPresentation ePresentation, diff --git a/sc/inc/document.hxx b/sc/inc/document.hxx index 550f7b7dab2b..ad6471688ac8 100644 --- a/sc/inc/document.hxx +++ b/sc/inc/document.hxx @@ -880,7 +880,6 @@ public: void SetNumberFormat( const ScAddress& rPos, sal_uInt32 nNumberFormat ); void GetNumberFormatInfo( short& nType, sal_uLong& nIndex, const ScAddress& rPos ) const; - void GetFormula( SCCOL nCol, SCROW nRow, SCTAB nTab, String& rFormula ) const; const ScTokenArray* GetFormulaTokens( const ScAddress& rPos ) const; SC_DLLPUBLIC const ScFormulaCell* GetFormulaCell( const ScAddress& rPos ) const; SC_DLLPUBLIC ScFormulaCell* GetFormulaCell( const ScAddress& rPos ); diff --git a/sc/inc/docuno.hxx b/sc/inc/docuno.hxx index 897c90d27d84..ce289d17ba0a 100644 --- a/sc/inc/docuno.hxx +++ b/sc/inc/docuno.hxx @@ -102,7 +102,7 @@ private: bool FillRenderMarkData( const com::sun::star::uno::Any& aSelection, const com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue >& rOptions, - ScMarkData& rMark, ScPrintSelectionStatus& rStatus, String& rPagesStr ) const; + ScMarkData& rMark, ScPrintSelectionStatus& rStatus, OUString& rPagesStr ) const; com::sun::star::uno::Reference<com::sun::star::uno::XAggregation> GetFormatter(); void HandleCalculateEvents(); diff --git a/sc/source/core/data/docpool.cxx b/sc/source/core/data/docpool.cxx index 684c32a691b9..018dc1c158bb 100644 --- a/sc/source/core/data/docpool.cxx +++ b/sc/source/core/data/docpool.cxx @@ -664,7 +664,7 @@ void ScDocumentPool::StyleDeleted( ScStyleSheet* pStyle ) } } -void ScDocumentPool::CellStyleCreated( const String& rName ) +void ScDocumentPool::CellStyleCreated( const OUString& rName ) { // If a style was created, don't keep any pattern with its name string in the pool, // because it would compare equal to a pattern with a pointer to the new style. diff --git a/sc/source/core/data/document.cxx b/sc/source/core/data/document.cxx index 9b91290ba911..093640506686 100644 --- a/sc/source/core/data/document.cxx +++ b/sc/source/core/data/document.cxx @@ -3245,13 +3245,6 @@ void ScDocument::GetInputString( SCCOL nCol, SCROW nRow, SCTAB nTab, OUString& r rString = OUString(); } -void ScDocument::GetInputString( SCCOL nCol, SCROW nRow, SCTAB nTab, String& rString ) -{ - OUString aString; - GetInputString( nCol, nRow, nTab, aString); - rString = aString; -} - sal_uInt16 ScDocument::GetStringForFormula( const ScAddress& rPos, OUString& rString ) { // Used in formulas (add-in parameters etc), so it must use the same semantics as @@ -3428,13 +3421,6 @@ void ScDocument::GetFormula( SCCOL nCol, SCROW nRow, SCTAB nTab, OUString& rForm } -void ScDocument::GetFormula( SCCOL nCol, SCROW nRow, SCTAB nTab, String& rFormula ) const -{ - OUString aString; - GetFormula( nCol, nRow, nTab, aString); - rFormula = aString; -} - const ScTokenArray* ScDocument::GetFormulaTokens( const ScAddress& rPos ) const { if (!TableExists(rPos.Tab())) diff --git a/sc/source/ui/docshell/docfunc.cxx b/sc/source/ui/docshell/docfunc.cxx index fe16f96474c5..2a3e1aec31d6 100644 --- a/sc/source/ui/docshell/docfunc.cxx +++ b/sc/source/ui/docshell/docfunc.cxx @@ -5190,16 +5190,15 @@ sal_Bool ScDocFunc::ResizeMatrix( const ScRange& rOldRange, const ScAddress& rNe sal_Bool bRet = false; - String aFormula; + OUString aFormula; pDoc->GetFormula( nStartCol, nStartRow, nTab, aFormula ); - if ( aFormula.GetChar(0) == '{' && aFormula.GetChar(aFormula.Len()-1) == '}' ) + if ( aFormula[0] == '{' && aFormula[aFormula.getLength()-1] == '}' ) { String aUndo = ScGlobal::GetRscString( STR_UNDO_RESIZEMATRIX ); if (bUndo) rDocShell.GetUndoManager()->EnterListAction( aUndo, aUndo ); - aFormula.Erase(0,1); - aFormula.Erase(aFormula.Len()-1,1); + aFormula = aFormula.copy(1, aFormula.getLength()-2); ScMarkData aMark; aMark.SetMarkArea( rOldRange ); diff --git a/sc/source/ui/docshell/impex.cxx b/sc/source/ui/docshell/impex.cxx index 40d3cba85545..93f3960e025c 100644 --- a/sc/source/ui/docshell/impex.cxx +++ b/sc/source/ui/docshell/impex.cxx @@ -831,25 +831,24 @@ static const sal_Unicode* lcl_ScanSylkFormula( const sal_Unicode* p, return p; } -static void lcl_DoubleEscapeChar( String& rString, sal_Unicode cStr ) +static void lcl_DoubleEscapeChar( OUString& rString, sal_Unicode cStr ) { - xub_StrLen n = 0; - while( ( n = rString.Search( cStr, n ) ) != STRING_NOTFOUND ) + sal_Int32 n = 0; + while( ( n = rString.indexOf( cStr, n ) ) != -1 ) { - rString.Insert( cStr, n ); + rString = rString.replaceAt( n, 0, OUString(cStr) ); n += 2; } } -static void lcl_WriteString( SvStream& rStrm, String& rString, sal_Unicode cQuote, sal_Unicode cEsc ) +static void lcl_WriteString( SvStream& rStrm, OUString& rString, sal_Unicode cQuote, sal_Unicode cEsc ) { if (cEsc) lcl_DoubleEscapeChar( rString, cEsc ); if (cQuote) { - rString.Insert( cQuote, 0 ); - rString.Append( cQuote ); + rString = OUString(cQuote) + rString + OUString(cQuote); } ScImportExport::WriteUnicodeOrByteString( rStrm, rString ); @@ -1591,7 +1590,7 @@ bool ScImportExport::Doc2Text( SvStream& rStrm ) if (!pDoc->GetClipParam().isMultiRange() && nStartTab == nEndTab) pDoc->ShrinkToDataArea( nStartTab, nStartCol, nStartRow, nEndCol, nEndRow ); - String aCell; + OUString aCell; bool bConvertLF = (GetSystemLineEnd() != LINEEND_LF); @@ -1610,7 +1609,7 @@ bool ScImportExport::Doc2Text( SvStream& rStrm ) if (bFormulas) { pDoc->GetFormula( nCol, nRow, nStartTab, aCell ); - if( aCell.Search( cSep ) != STRING_NOTFOUND ) + if( aCell.indexOf( cSep ) != -1 ) lcl_WriteString( rStrm, aCell, cStr, cStr ); else lcl_WriteSimpleString( rStrm, aCell ); @@ -1619,19 +1618,19 @@ bool ScImportExport::Doc2Text( SvStream& rStrm ) { aCell = pDoc->GetString(nCol, nRow, nStartTab); - bool bMultiLineText = ( aCell.Search( '\n' ) != STRING_NOTFOUND ); + bool bMultiLineText = ( aCell.indexOf( '\n' ) != -1 ); if( bMultiLineText ) { if( mExportTextOptions.meNewlineConversion == ScExportTextOptions::ToSpace ) - aCell.SearchAndReplaceAll( '\n', ' ' ); + aCell = aCell.replaceAll( "\n", " " ); else if ( mExportTextOptions.meNewlineConversion == ScExportTextOptions::ToSystem && bConvertLF ) aCell = convertLineEnd(aCell, GetSystemLineEnd()); } if( mExportTextOptions.mcSeparatorConvertTo && cSep ) - aCell.SearchAndReplaceAll( cSep, mExportTextOptions.mcSeparatorConvertTo ); + aCell = aCell.replaceAll( OUString(cSep), OUString(mExportTextOptions.mcSeparatorConvertTo) ); - if( mExportTextOptions.mbAddQuotes && ( aCell.Search( cSep ) != STRING_NOTFOUND ) ) + if( mExportTextOptions.mbAddQuotes && ( aCell.indexOf( cSep ) != -1 ) ) lcl_WriteString( rStrm, aCell, cStr, cStr ); else lcl_WriteSimpleString( rStrm, aCell ); @@ -1650,17 +1649,17 @@ bool ScImportExport::Doc2Text( SvStream& rStrm ) { aCell = pDoc->GetString(nCol, nRow, nStartTab); - bool bMultiLineText = ( aCell.Search( '\n' ) != STRING_NOTFOUND ); + bool bMultiLineText = ( aCell.indexOf( '\n' ) != -1 ); if( bMultiLineText ) { if( mExportTextOptions.meNewlineConversion == ScExportTextOptions::ToSpace ) - aCell.SearchAndReplaceAll( '\n', ' ' ); + aCell = aCell.replaceAll( "\n", " " ); else if ( mExportTextOptions.meNewlineConversion == ScExportTextOptions::ToSystem && bConvertLF ) aCell = convertLineEnd(aCell, GetSystemLineEnd()); } if( mExportTextOptions.mcSeparatorConvertTo && cSep ) - aCell.SearchAndReplaceAll( cSep, mExportTextOptions.mcSeparatorConvertTo ); + aCell = aCell.replaceAll( OUString(cSep), OUString(mExportTextOptions.mcSeparatorConvertTo) ); if( mExportTextOptions.mbAddQuotes && hasLineBreaksOrSeps(aCell, cSep) ) lcl_WriteString( rStrm, aCell, cStr, cStr ); @@ -1947,7 +1946,7 @@ bool ScImportExport::Doc2Sylk( SvStream& rStrm ) SCROW nStartRow = aRange.aStart.Row(); SCCOL nEndCol = aRange.aEnd.Col(); SCROW nEndRow = aRange.aEnd.Row(); - String aCellStr; + OUString aCellStr; String aValStr; lcl_WriteSimpleString( rStrm, String( RTL_CONSTASCII_USTRINGPARAM( "ID;PCALCOOO32"))); @@ -1995,7 +1994,7 @@ bool ScImportExport::Doc2Sylk( SvStream& rStrm ) case CELLTYPE_EDIT: hasstring: aCellStr = pDoc->GetString(nCol, nRow, aRange.aStart.Tab()); - aCellStr.SearchAndReplaceAll( OUString('\n'), OUString(SYLK_LF) ); + aCellStr = aCellStr.replaceAll( OUString('\n'), OUString(SYLK_LF) ); aBufStr = "C;X"; aBufStr += OUString::number( c ); @@ -2012,7 +2011,7 @@ bool ScImportExport::Doc2Sylk( SvStream& rStrm ) switch ( pFCell->GetMatrixFlag() ) { case MM_REFERENCE : - aCellStr.Erase(); + aCellStr = ""; break; default: OUString aOUCellStr; @@ -2024,15 +2023,14 @@ bool ScImportExport::Doc2Sylk( SvStream& rStrm ) * writes in SYLK. */ } if ( pFCell->GetMatrixFlag() != MM_NONE && - aCellStr.Len() > 2 && - aCellStr.GetChar(0) == '{' && - aCellStr.GetChar(aCellStr.Len()-1) == '}' ) + aCellStr.getLength() > 2 && + aCellStr[0] == '{' && + aCellStr[aCellStr.getLength()-1] == '}' ) { // cut off matrix {} characters - aCellStr.Erase(aCellStr.Len()-1,1); - aCellStr.Erase(0,1); + aCellStr = aCellStr.copy(1, aCellStr.getLength()-2); } - if ( aCellStr.GetChar(0) == '=' ) - aCellStr.Erase(0,1); + if ( aCellStr[0] == '=' ) + aCellStr = aCellStr.copy(1); String aPrefix; switch ( pFCell->GetMatrixFlag() ) { @@ -2065,7 +2063,7 @@ bool ScImportExport::Doc2Sylk( SvStream& rStrm ) aPrefix = ";E"; } lcl_WriteSimpleString( rStrm, aPrefix ); - if ( aCellStr.Len() ) + if ( !aCellStr.isEmpty() ) lcl_WriteString( rStrm, aCellStr, 0, ';' ); } WriteUnicodeOrByteEndl( rStrm ); diff --git a/sc/source/ui/unoobj/docuno.cxx b/sc/source/ui/unoobj/docuno.cxx index d151edccc78e..1be316cf7da5 100644 --- a/sc/source/ui/unoobj/docuno.cxx +++ b/sc/source/ui/unoobj/docuno.cxx @@ -769,7 +769,7 @@ static bool lcl_ParseTarget( const String& rTarget, ScRange& rTargetRange, Recta bool ScModelObj::FillRenderMarkData( const uno::Any& aSelection, const uno::Sequence< beans::PropertyValue >& rOptions, ScMarkData& rMark, - ScPrintSelectionStatus& rStatus, String& rPagesStr ) const + ScPrintSelectionStatus& rStatus, OUString& rPagesStr ) const { OSL_ENSURE( !rMark.IsMarked() && !rMark.IsMultiMarked(), "FillRenderMarkData: MarkData must be empty" ); OSL_ENSURE( pDocShell, "FillRenderMarkData: DocShell must be set" ); @@ -932,7 +932,7 @@ bool ScModelObj::FillRenderMarkData( const uno::Any& aSelection, if ( nPrintRange == 1 ) rPagesStr = aPageRange; else - rPagesStr.Erase(); + rPagesStr = ""; return bDone; } @@ -951,7 +951,7 @@ sal_Int32 SAL_CALL ScModelObj::getRendererCount( const uno::Any& aSelection, ScMarkData aMark; ScPrintSelectionStatus aStatus; - String aPagesStr; + OUString aPagesStr; if ( !FillRenderMarkData( aSelection, rOptions, aMark, aStatus, aPagesStr ) ) return 0; @@ -967,7 +967,7 @@ sal_Int32 SAL_CALL ScModelObj::getRendererCount( const uno::Any& aSelection, sal_Int32 nPages = pPrintFuncCache->GetPageCount(); sal_Int32 nSelectCount = nPages; - if ( aPagesStr.Len() ) + if ( !aPagesStr.isEmpty() ) { StringRangeEnumerator aRangeEnum( aPagesStr, 0, nPages-1 ); nSelectCount = aRangeEnum.size(); @@ -1002,7 +1002,7 @@ uno::Sequence<beans::PropertyValue> SAL_CALL ScModelObj::getRenderer( sal_Int32 ScMarkData aMark; ScPrintSelectionStatus aStatus; - String aPagesStr; + OUString aPagesStr; // #i115266# if FillRenderMarkData fails, keep nTotalPages at 0, but still handle getRenderer(0) below long nTotalPages = 0; if ( FillRenderMarkData( aSelection, rOptions, aMark, aStatus, aPagesStr ) ) @@ -1110,7 +1110,7 @@ void SAL_CALL ScModelObj::render( sal_Int32 nSelRenderer, const uno::Any& aSelec ScMarkData aMark; ScPrintSelectionStatus aStatus; - String aPagesStr; + OUString aPagesStr; if ( !FillRenderMarkData( aSelection, rOptions, aMark, aStatus, aPagesStr ) ) throw lang::IllegalArgumentException(); diff --git a/sc/source/ui/view/cellsh.cxx b/sc/source/ui/view/cellsh.cxx index 29b47a478e81..6d38103cd63b 100644 --- a/sc/source/ui/view/cellsh.cxx +++ b/sc/source/ui/view/cellsh.cxx @@ -630,9 +630,9 @@ void ScCellShell::GetState(SfxItemSet &rSet) case SID_RANGE_FORMULA: { - String aString; + OUString aString; pDoc->GetFormula( nPosX, nPosY, nTab, aString ); - if( aString.Len() == 0 ) + if( aString.isEmpty() ) { pDoc->GetInputString( nPosX, nPosY, nTab, aString ); } diff --git a/sc/source/ui/view/cellsh1.cxx b/sc/source/ui/view/cellsh1.cxx index 03f969de7bc4..408b37df1843 100644 --- a/sc/source/ui/view/cellsh1.cxx +++ b/sc/source/ui/view/cellsh1.cxx @@ -641,13 +641,13 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq ) } // - String aStartStr; + OUString aStartStr; // suggest default Startvalue only, when just 1 row or column if ( nStartCol == nEndCol || nStartRow == nEndRow ) { double fInputEndVal = 0.0; - String aEndStr; + OUString aEndStr; pDoc->GetInputString( nStartCol, nStartRow, nStartTab, aStartStr); pDoc->GetValue( nStartCol, nStartRow, nStartTab, fStartVal ); @@ -656,7 +656,7 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq ) if(eFillDir==FILL_TO_BOTTOM && nStartRow < nEndRow ) { pDoc->GetInputString( nStartCol, nStartRow+1, nStartTab, aEndStr); - if(aEndStr.Len()>0) + if(!aEndStr.isEmpty()) { pDoc->GetValue( nStartCol, nStartRow+1, nStartTab, fInputEndVal); fIncVal=fInputEndVal-fStartVal; @@ -667,7 +667,7 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq ) if(nStartCol < nEndCol) { pDoc->GetInputString( nStartCol+1, nStartRow, nStartTab, aEndStr); - if(aEndStr.Len()>0) + if(!aEndStr.isEmpty()) { pDoc->GetValue( nStartCol+1, nStartRow, nStartTab, fInputEndVal); fIncVal=fInputEndVal-fStartVal; diff --git a/sc/source/ui/view/tabvwsha.cxx b/sc/source/ui/view/tabvwsha.cxx index 2f980b26889f..807b25d6fcff 100644 --- a/sc/source/ui/view/tabvwsha.cxx +++ b/sc/source/ui/view/tabvwsha.cxx @@ -606,7 +606,7 @@ void ScTabViewShell::UpdateInputHandler( sal_Bool bForce /* = sal_False */, sal_ if ( pHdl ) { - String aString; + OUString aString; const EditTextObject* pObject = NULL; ScViewData* pViewData = GetViewData(); ScDocument* pDoc = pViewData->GetDocument(); @@ -668,7 +668,7 @@ void ScTabViewShell::UpdateInputHandler( sal_Bool bForce /* = sal_False */, sal_ pDoc->GetNumberFormat( nPosX, nPosY, nTab, nNumFmt ); double fDummy; if ( pFormatter->IsNumberFormat(aString, nNumFmt, fDummy) ) - aString.Insert('\'',0); + aString = "'" + aString; } } } |