diff options
author | Kohei Yoshida <kohei.yoshida@suse.com> | 2012-02-03 00:02:01 -0500 |
---|---|---|
committer | Kohei Yoshida <kohei.yoshida@suse.com> | 2012-02-03 00:02:47 -0500 |
commit | 5477b6f5fb1f91378c049308d7031bb5c25c3931 (patch) | |
tree | c8f183cc57787afa9004fc82c298157a50217247 /sc | |
parent | a5033979fdb12afd28193dcc0bc31005bf706a4a (diff) |
More on eradicating String in favor of rtl::OUString.
Diffstat (limited to 'sc')
-rw-r--r-- | sc/inc/chgtrack.hxx | 67 | ||||
-rw-r--r-- | sc/source/core/tool/chgtrack.cxx | 84 |
2 files changed, 77 insertions, 74 deletions
diff --git a/sc/inc/chgtrack.hxx b/sc/inc/chgtrack.hxx index c44da6ae85b0..c4cb308e191f 100644 --- a/sc/inc/chgtrack.hxx +++ b/sc/inc/chgtrack.hxx @@ -533,16 +533,12 @@ class ScChangeActionDel : public ScChangeAction virtual const ScChangeTrack* GetChangeTrack() const { return pTrack; } public: - ScChangeActionDel(const sal_uLong nActionNumber, - const ScChangeActionState eState, - const sal_uLong nRejectingNumber, - const ScBigRange& aBigRange, - const String& aUser, - const DateTime& aDateTime, - const String &sComment, - const ScChangeActionType eType, - const SCsCOLROW nD, - ScChangeTrack* pTrack); // only to use in the XML import + ScChangeActionDel( + const sal_uLong nActionNumber, const ScChangeActionState eState, + const sal_uLong nRejectingNumber, const ScBigRange& aBigRange, + const rtl::OUString& aUser, const DateTime& aDateTime, + const rtl::OUString &sComment, const ScChangeActionType eType, + const SCsCOLROW nD, ScChangeTrack* pTrack); // only to use in the XML import // which of nDx and nDy is set is dependend on the type // is the last in a row (or single) @@ -632,9 +628,9 @@ public: const ScChangeActionState eState, const sal_uLong nRejectingNumber, const ScBigRange& aToBigRange, - const String& aUser, + const rtl::OUString& aUser, const DateTime& aDateTime, - const String &sComment, + const rtl::OUString &sComment, const ScBigRange& aFromBigRange, ScChangeTrack* pTrack); // only to use in the XML import @@ -743,8 +739,9 @@ class ScChangeActionContent : public ScChangeAction bool Select( ScDocument*, ScChangeTrack*, bool bOldest, ::std::stack<ScChangeActionContent*>* pRejectActions ); - void PutValueToDoc( ScBaseCell*, const String&, - ScDocument*, SCsCOL nDx, SCsROW nDy ) const; + void PutValueToDoc( + ScBaseCell* pCell, const rtl::OUString& rValue, ScDocument* pDoc, + SCsCOL nDx, SCsROW nDy ) const; protected: using ScChangeAction::GetRefString; @@ -762,21 +759,18 @@ public: pNextInSlot( NULL ), ppPrevInSlot( NULL ) {} - ScChangeActionContent(const sal_uLong nActionNumber, - const ScChangeActionState eState, - const sal_uLong nRejectingNumber, - const ScBigRange& aBigRange, - const String& aUser, - const DateTime& aDateTime, - const String &sComment, - ScBaseCell* pOldCell, - ScDocument* pDoc, - const String& sOldValue); // to use for XML Import - ScChangeActionContent(const sal_uLong nActionNumber, - ScBaseCell* pNewCell, - const ScBigRange& aBigRange, - ScDocument* pDoc, - const String& sNewValue); // to use for XML Import of Generated Actions + ScChangeActionContent( + const sal_uLong nActionNumber, const ScChangeActionState eState, + const sal_uLong nRejectingNumber, const ScBigRange& aBigRange, + const rtl::OUString& aUser, const DateTime& aDateTime, + const rtl::OUString &sComment, ScBaseCell* pOldCell, + ScDocument* pDoc, const rtl::OUString& sOldValue); // to use for XML Import + + ScChangeActionContent( + const sal_uLong nActionNumber, ScBaseCell* pNewCell, + const ScBigRange& aBigRange, ScDocument* pDoc, + const rtl::OUString& sNewValue); // to use for XML Import of Generated Actions + virtual ~ScChangeActionContent(); ScChangeActionContent* GetNextContent() const { return pNextContent; } @@ -807,9 +801,10 @@ public: sal_uLong nOldFormat, ScBaseCell* pNewCell, sal_uLong nNewFormat, ScDocument* pDoc ); - // Use this only in the XML import, - // takes ownership of cell. - void SetNewCell( ScBaseCell* pCell, ScDocument* pDoc, const String& rFormatted ); + // Use this only in the XML import, + // takes ownership of cell. + void SetNewCell( + ScBaseCell* pCell, ScDocument* pDoc, const rtl::OUString& rFormatted ); // These functions should be protected but for // the XML import they are public. @@ -869,9 +864,9 @@ public: const ScChangeActionState eState, const sal_uLong nRejectingNumber, const ScBigRange& aBigRange, - const String& aUser, + const rtl::OUString& aUser, const DateTime& aDateTime, - const String &sComment); // only to use in the XML import + const rtl::OUString &sComment); // only to use in the XML import }; @@ -1266,8 +1261,8 @@ public: sal_uInt16 GetLoadedFileFormatVersion() const { return nLoadedFileFormatVersion; } - sal_uLong AddLoadedGenerated(ScBaseCell* pOldCell, - const ScBigRange& aBigRange, const String& sNewValue ); // only to use in the XML import + sal_uLong AddLoadedGenerated( + ScBaseCell* pOldCell, const ScBigRange& aBigRange, const rtl::OUString& sNewValue ); // only to use in the XML import void AppendLoaded( ScChangeAction* pAppend ); // this is only for the XML import public, it should be protected void SetActionMax(sal_uLong nTempActionMax) { nActionMax = nTempActionMax; } // only to use in the XML import diff --git a/sc/source/core/tool/chgtrack.cxx b/sc/source/core/tool/chgtrack.cxx index d6f7f2088275..b86e3b0154fa 100644 --- a/sc/source/core/tool/chgtrack.cxx +++ b/sc/source/core/tool/chgtrack.cxx @@ -858,18 +858,19 @@ ScChangeActionDel::ScChangeActionDel( const ScRange& rRange, } -ScChangeActionDel::ScChangeActionDel(const sal_uLong nActionNumber, const ScChangeActionState eStateP, const sal_uLong nRejectingNumber, - const ScBigRange& aBigRangeP, const String& aUserP, const DateTime& aDateTimeP, const String &sComment, - const ScChangeActionType eTypeP, const SCsCOLROW nD, ScChangeTrack* pTrackP) // wich of nDx and nDy is set is depend on the type - : - ScChangeAction(eTypeP, aBigRangeP, nActionNumber, nRejectingNumber, eStateP, aDateTimeP, aUserP, sComment), - pTrack( pTrackP ), - pFirstCell( NULL ), - pCutOff( NULL ), - nCutOff( 0 ), - pLinkMove( NULL ), - nDx( 0 ), - nDy( 0 ) +ScChangeActionDel::ScChangeActionDel( + const sal_uLong nActionNumber, const ScChangeActionState eStateP, + const sal_uLong nRejectingNumber, const ScBigRange& aBigRangeP, + const rtl::OUString& aUserP, const DateTime& aDateTimeP, const rtl::OUString &sComment, + const ScChangeActionType eTypeP, const SCsCOLROW nD, ScChangeTrack* pTrackP) : // wich of nDx and nDy is set is depend on the type + ScChangeAction(eTypeP, aBigRangeP, nActionNumber, nRejectingNumber, eStateP, aDateTimeP, aUserP, sComment), + pTrack( pTrackP ), + pFirstCell( NULL ), + pCutOff( NULL ), + nCutOff( 0 ), + pLinkMove( NULL ), + nDx( 0 ), + nDy( 0 ) { if (eType == SC_CAT_DELETE_COLS) nDx = static_cast<SCsCOL>(nD); @@ -1202,16 +1203,18 @@ void ScChangeActionDel::UndoCutOffInsert() // --- ScChangeActionMove -------------------------------------------------- -ScChangeActionMove::ScChangeActionMove(const sal_uLong nActionNumber, const ScChangeActionState eStateP, const sal_uLong nRejectingNumber, - const ScBigRange& aToBigRange, const String& aUserP, const DateTime& aDateTimeP, const String &sComment, - const ScBigRange& aFromBigRange, ScChangeTrack* pTrackP) // wich of nDx and nDy is set is depend on the type - : - ScChangeAction(SC_CAT_MOVE, aToBigRange, nActionNumber, nRejectingNumber, eStateP, aDateTimeP, aUserP, sComment), - aFromRange(aFromBigRange), - pTrack( pTrackP ), - pFirstCell( NULL ), - nStartLastCut(0), - nEndLastCut(0) +ScChangeActionMove::ScChangeActionMove( + const sal_uLong nActionNumber, const ScChangeActionState eStateP, + const sal_uLong nRejectingNumber, const ScBigRange& aToBigRange, + const rtl::OUString& aUserP, const DateTime& aDateTimeP, + const rtl::OUString &sComment, const ScBigRange& aFromBigRange, + ScChangeTrack* pTrackP) : // wich of nDx and nDy is set is depend on the type + ScChangeAction(SC_CAT_MOVE, aToBigRange, nActionNumber, nRejectingNumber, eStateP, aDateTimeP, aUserP, sComment), + aFromRange(aFromBigRange), + pTrack( pTrackP ), + pFirstCell( NULL ), + nStartLastCut(0), + nEndLastCut(0) { } @@ -1365,9 +1368,9 @@ IMPL_FIXEDMEMPOOL_NEWDEL( ScChangeActionContent ) ScChangeActionContent::ScChangeActionContent( const sal_uLong nActionNumber, const ScChangeActionState eStateP, const sal_uLong nRejectingNumber, - const ScBigRange& aBigRangeP, const String& aUserP, - const DateTime& aDateTimeP, const String& sComment, - ScBaseCell* pTempOldCell, ScDocument* pDoc, const String& sOldValue ) + const ScBigRange& aBigRangeP, const rtl::OUString& aUserP, + const DateTime& aDateTimeP, const rtl::OUString& sComment, + ScBaseCell* pTempOldCell, ScDocument* pDoc, const rtl::OUString& sOldValue ) : ScChangeAction(SC_CAT_CONTENT, aBigRangeP, nActionNumber, nRejectingNumber, eStateP, aDateTimeP, aUserP, sComment), aOldValue(sOldValue), @@ -1381,13 +1384,13 @@ ScChangeActionContent::ScChangeActionContent( const sal_uLong nActionNumber, { if (pOldCell) ScChangeActionContent::SetCell( aOldValue, pOldCell, 0, pDoc ); - if ( sOldValue.Len() ) // #i40704# don't overwrite SetCell result with empty string + if (!sOldValue.isEmpty()) // #i40704# don't overwrite SetCell result with empty string aOldValue = sOldValue; // set again, because SetCell removes it } ScChangeActionContent::ScChangeActionContent( const sal_uLong nActionNumber, ScBaseCell* pTempNewCell, const ScBigRange& aBigRangeP, - ScDocument* pDoc, const String& sNewValue ) + ScDocument* pDoc, const rtl::OUString& sNewValue ) : ScChangeAction(SC_CAT_CONTENT, aBigRangeP, nActionNumber), aNewValue(sNewValue), @@ -1400,7 +1403,7 @@ ScChangeActionContent::ScChangeActionContent( const sal_uLong nActionNumber, { if (pNewCell) ScChangeActionContent::SetCell( aNewValue, pNewCell, 0, pDoc ); - if ( sNewValue.Len() ) // #i40704# don't overwrite SetCell result with empty string + if (!sNewValue.isEmpty()) // #i40704# don't overwrite SetCell result with empty string aNewValue = sNewValue; // set again, because SetCell removes it } @@ -1483,14 +1486,15 @@ void ScChangeActionContent::SetOldNewCells( ScBaseCell* pOldCellP, ScChangeActionContent::SetCell( aNewValue, pNewCell, nNewFormat, pDoc ); } -void ScChangeActionContent::SetNewCell( ScBaseCell* pCell, ScDocument* pDoc, const String& rFormatted ) +void ScChangeActionContent::SetNewCell( + ScBaseCell* pCell, ScDocument* pDoc, const rtl::OUString& rFormatted ) { OSL_ENSURE( !pNewCell, "ScChangeActionContent::SetNewCell: overwriting existing cell" ); pNewCell = pCell; ScChangeActionContent::SetCell( aNewValue, pNewCell, 0, pDoc ); // #i40704# allow to set formatted text here - don't call SetNewValue with String from XML filter - if ( rFormatted.Len() ) + if (!rFormatted.isEmpty()) aNewValue = rFormatted; } @@ -1920,15 +1924,16 @@ void ScChangeActionContent::PutNewValueToDoc( ScDocument* pDoc, } -void ScChangeActionContent::PutValueToDoc( ScBaseCell* pCell, - const String& rValue, ScDocument* pDoc, SCsCOL nDx, SCsROW nDy ) const +void ScChangeActionContent::PutValueToDoc( + ScBaseCell* pCell, const rtl::OUString& rValue, ScDocument* pDoc, + SCsCOL nDx, SCsROW nDy ) const { ScAddress aPos( aBigRange.aStart.MakeAddress() ); if ( nDx ) aPos.IncCol( nDx ); if ( nDy ) aPos.IncRow( nDy ); - if ( !rValue.Len() ) + if (rValue.isEmpty()) { if ( pCell ) { @@ -2162,10 +2167,12 @@ bool ScChangeActionContent::IsOldMatrixReference() const // --- ScChangeActionReject ------------------------------------------------ -ScChangeActionReject::ScChangeActionReject(const sal_uLong nActionNumber, const ScChangeActionState eStateP, const sal_uLong nRejectingNumber, - const ScBigRange& aBigRangeP, const String& aUserP, const DateTime& aDateTimeP, const String& sComment) - : - ScChangeAction(SC_CAT_CONTENT, aBigRangeP, nActionNumber, nRejectingNumber, eStateP, aDateTimeP, aUserP, sComment) +ScChangeActionReject::ScChangeActionReject( + const sal_uLong nActionNumber, const ScChangeActionState eStateP, + const sal_uLong nRejectingNumber, + const ScBigRange& aBigRangeP, const rtl::OUString& aUserP, + const DateTime& aDateTimeP, const rtl::OUString& sComment) : + ScChangeAction(SC_CAT_CONTENT, aBigRangeP, nActionNumber, nRejectingNumber, eStateP, aDateTimeP, aUserP, sComment) { } @@ -4522,7 +4529,8 @@ bool ScChangeTrack::Reject( } -sal_uLong ScChangeTrack::AddLoadedGenerated(ScBaseCell* pNewCell, const ScBigRange& aBigRange, const String& sNewValue ) +sal_uLong ScChangeTrack::AddLoadedGenerated( + ScBaseCell* pNewCell, const ScBigRange& aBigRange, const rtl::OUString& sNewValue ) { ScChangeActionContent* pAct = new ScChangeActionContent( --nGeneratedMin, pNewCell, aBigRange, pDoc, sNewValue ); if ( pAct ) |