Kaydet (Commit) 5477b6f5 authored tarafından Kohei Yoshida's avatar Kohei Yoshida

More on eradicating String in favor of rtl::OUString.

üst a5033979
...@@ -533,16 +533,12 @@ class ScChangeActionDel : public ScChangeAction ...@@ -533,16 +533,12 @@ class ScChangeActionDel : public ScChangeAction
virtual const ScChangeTrack* GetChangeTrack() const { return pTrack; } virtual const ScChangeTrack* GetChangeTrack() const { return pTrack; }
public: public:
ScChangeActionDel(const sal_uLong nActionNumber, ScChangeActionDel(
const ScChangeActionState eState, const sal_uLong nActionNumber, const ScChangeActionState eState,
const sal_uLong nRejectingNumber, const sal_uLong nRejectingNumber, const ScBigRange& aBigRange,
const ScBigRange& aBigRange, const rtl::OUString& aUser, const DateTime& aDateTime,
const String& aUser, const rtl::OUString &sComment, const ScChangeActionType eType,
const DateTime& aDateTime, const SCsCOLROW nD, ScChangeTrack* pTrack); // only to use in the XML import
const String &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 // which of nDx and nDy is set is dependend on the type
// is the last in a row (or single) // is the last in a row (or single)
...@@ -632,9 +628,9 @@ public: ...@@ -632,9 +628,9 @@ public:
const ScChangeActionState eState, const ScChangeActionState eState,
const sal_uLong nRejectingNumber, const sal_uLong nRejectingNumber,
const ScBigRange& aToBigRange, const ScBigRange& aToBigRange,
const String& aUser, const rtl::OUString& aUser,
const DateTime& aDateTime, const DateTime& aDateTime,
const String &sComment, const rtl::OUString &sComment,
const ScBigRange& aFromBigRange, const ScBigRange& aFromBigRange,
ScChangeTrack* pTrack); // only to use in the XML import ScChangeTrack* pTrack); // only to use in the XML import
...@@ -743,8 +739,9 @@ class ScChangeActionContent : public ScChangeAction ...@@ -743,8 +739,9 @@ class ScChangeActionContent : public ScChangeAction
bool Select( ScDocument*, ScChangeTrack*, bool Select( ScDocument*, ScChangeTrack*,
bool bOldest, ::std::stack<ScChangeActionContent*>* pRejectActions ); bool bOldest, ::std::stack<ScChangeActionContent*>* pRejectActions );
void PutValueToDoc( ScBaseCell*, const String&, void PutValueToDoc(
ScDocument*, SCsCOL nDx, SCsROW nDy ) const; ScBaseCell* pCell, const rtl::OUString& rValue, ScDocument* pDoc,
SCsCOL nDx, SCsROW nDy ) const;
protected: protected:
using ScChangeAction::GetRefString; using ScChangeAction::GetRefString;
...@@ -762,21 +759,18 @@ public: ...@@ -762,21 +759,18 @@ public:
pNextInSlot( NULL ), pNextInSlot( NULL ),
ppPrevInSlot( NULL ) ppPrevInSlot( NULL )
{} {}
ScChangeActionContent(const sal_uLong nActionNumber, ScChangeActionContent(
const ScChangeActionState eState, const sal_uLong nActionNumber, const ScChangeActionState eState,
const sal_uLong nRejectingNumber, const sal_uLong nRejectingNumber, const ScBigRange& aBigRange,
const ScBigRange& aBigRange, const rtl::OUString& aUser, const DateTime& aDateTime,
const String& aUser, const rtl::OUString &sComment, ScBaseCell* pOldCell,
const DateTime& aDateTime, ScDocument* pDoc, const rtl::OUString& sOldValue); // to use for XML Import
const String &sComment,
ScBaseCell* pOldCell, ScChangeActionContent(
ScDocument* pDoc, const sal_uLong nActionNumber, ScBaseCell* pNewCell,
const String& sOldValue); // to use for XML Import const ScBigRange& aBigRange, ScDocument* pDoc,
ScChangeActionContent(const sal_uLong nActionNumber, const rtl::OUString& sNewValue); // to use for XML Import of Generated Actions
ScBaseCell* pNewCell,
const ScBigRange& aBigRange,
ScDocument* pDoc,
const String& sNewValue); // to use for XML Import of Generated Actions
virtual ~ScChangeActionContent(); virtual ~ScChangeActionContent();
ScChangeActionContent* GetNextContent() const { return pNextContent; } ScChangeActionContent* GetNextContent() const { return pNextContent; }
...@@ -807,9 +801,10 @@ public: ...@@ -807,9 +801,10 @@ public:
sal_uLong nOldFormat, ScBaseCell* pNewCell, sal_uLong nOldFormat, ScBaseCell* pNewCell,
sal_uLong nNewFormat, ScDocument* pDoc ); sal_uLong nNewFormat, ScDocument* pDoc );
// Use this only in the XML import, // Use this only in the XML import,
// takes ownership of cell. // takes ownership of cell.
void SetNewCell( ScBaseCell* pCell, ScDocument* pDoc, const String& rFormatted ); void SetNewCell(
ScBaseCell* pCell, ScDocument* pDoc, const rtl::OUString& rFormatted );
// These functions should be protected but for // These functions should be protected but for
// the XML import they are public. // the XML import they are public.
...@@ -869,9 +864,9 @@ public: ...@@ -869,9 +864,9 @@ public:
const ScChangeActionState eState, const ScChangeActionState eState,
const sal_uLong nRejectingNumber, const sal_uLong nRejectingNumber,
const ScBigRange& aBigRange, const ScBigRange& aBigRange,
const String& aUser, const rtl::OUString& aUser,
const DateTime& aDateTime, 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: ...@@ -1266,8 +1261,8 @@ public:
sal_uInt16 GetLoadedFileFormatVersion() const sal_uInt16 GetLoadedFileFormatVersion() const
{ return nLoadedFileFormatVersion; } { return nLoadedFileFormatVersion; }
sal_uLong AddLoadedGenerated(ScBaseCell* pOldCell, sal_uLong AddLoadedGenerated(
const ScBigRange& aBigRange, const String& sNewValue ); // only to use in the XML import 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 AppendLoaded( ScChangeAction* pAppend ); // this is only for the XML import public, it should be protected
void SetActionMax(sal_uLong nTempActionMax) void SetActionMax(sal_uLong nTempActionMax)
{ nActionMax = nTempActionMax; } // only to use in the XML import { nActionMax = nTempActionMax; } // only to use in the XML import
......
...@@ -858,18 +858,19 @@ ScChangeActionDel::ScChangeActionDel( const ScRange& rRange, ...@@ -858,18 +858,19 @@ ScChangeActionDel::ScChangeActionDel( const ScRange& rRange,
} }
ScChangeActionDel::ScChangeActionDel(const sal_uLong nActionNumber, const ScChangeActionState eStateP, const sal_uLong nRejectingNumber, ScChangeActionDel::ScChangeActionDel(
const ScBigRange& aBigRangeP, const String& aUserP, const DateTime& aDateTimeP, const String &sComment, const sal_uLong nActionNumber, const ScChangeActionState eStateP,
const ScChangeActionType eTypeP, const SCsCOLROW nD, ScChangeTrack* pTrackP) // wich of nDx and nDy is set is depend on the type const sal_uLong nRejectingNumber, const ScBigRange& aBigRangeP,
: const rtl::OUString& aUserP, const DateTime& aDateTimeP, const rtl::OUString &sComment,
ScChangeAction(eTypeP, aBigRangeP, nActionNumber, nRejectingNumber, eStateP, aDateTimeP, aUserP, sComment), const ScChangeActionType eTypeP, const SCsCOLROW nD, ScChangeTrack* pTrackP) : // wich of nDx and nDy is set is depend on the type
pTrack( pTrackP ), ScChangeAction(eTypeP, aBigRangeP, nActionNumber, nRejectingNumber, eStateP, aDateTimeP, aUserP, sComment),
pFirstCell( NULL ), pTrack( pTrackP ),
pCutOff( NULL ), pFirstCell( NULL ),
nCutOff( 0 ), pCutOff( NULL ),
pLinkMove( NULL ), nCutOff( 0 ),
nDx( 0 ), pLinkMove( NULL ),
nDy( 0 ) nDx( 0 ),
nDy( 0 )
{ {
if (eType == SC_CAT_DELETE_COLS) if (eType == SC_CAT_DELETE_COLS)
nDx = static_cast<SCsCOL>(nD); nDx = static_cast<SCsCOL>(nD);
...@@ -1202,16 +1203,18 @@ void ScChangeActionDel::UndoCutOffInsert() ...@@ -1202,16 +1203,18 @@ void ScChangeActionDel::UndoCutOffInsert()
// --- ScChangeActionMove -------------------------------------------------- // --- ScChangeActionMove --------------------------------------------------
ScChangeActionMove::ScChangeActionMove(const sal_uLong nActionNumber, const ScChangeActionState eStateP, const sal_uLong nRejectingNumber, ScChangeActionMove::ScChangeActionMove(
const ScBigRange& aToBigRange, const String& aUserP, const DateTime& aDateTimeP, const String &sComment, const sal_uLong nActionNumber, const ScChangeActionState eStateP,
const ScBigRange& aFromBigRange, ScChangeTrack* pTrackP) // wich of nDx and nDy is set is depend on the type const sal_uLong nRejectingNumber, const ScBigRange& aToBigRange,
: const rtl::OUString& aUserP, const DateTime& aDateTimeP,
ScChangeAction(SC_CAT_MOVE, aToBigRange, nActionNumber, nRejectingNumber, eStateP, aDateTimeP, aUserP, sComment), const rtl::OUString &sComment, const ScBigRange& aFromBigRange,
aFromRange(aFromBigRange), ScChangeTrack* pTrackP) : // wich of nDx and nDy is set is depend on the type
pTrack( pTrackP ), ScChangeAction(SC_CAT_MOVE, aToBigRange, nActionNumber, nRejectingNumber, eStateP, aDateTimeP, aUserP, sComment),
pFirstCell( NULL ), aFromRange(aFromBigRange),
nStartLastCut(0), pTrack( pTrackP ),
nEndLastCut(0) pFirstCell( NULL ),
nStartLastCut(0),
nEndLastCut(0)
{ {
} }
...@@ -1365,9 +1368,9 @@ IMPL_FIXEDMEMPOOL_NEWDEL( ScChangeActionContent ) ...@@ -1365,9 +1368,9 @@ IMPL_FIXEDMEMPOOL_NEWDEL( ScChangeActionContent )
ScChangeActionContent::ScChangeActionContent( const sal_uLong nActionNumber, ScChangeActionContent::ScChangeActionContent( const sal_uLong nActionNumber,
const ScChangeActionState eStateP, const sal_uLong nRejectingNumber, const ScChangeActionState eStateP, const sal_uLong nRejectingNumber,
const ScBigRange& aBigRangeP, const String& aUserP, const ScBigRange& aBigRangeP, const rtl::OUString& aUserP,
const DateTime& aDateTimeP, const String& sComment, const DateTime& aDateTimeP, const rtl::OUString& sComment,
ScBaseCell* pTempOldCell, ScDocument* pDoc, const String& sOldValue ) ScBaseCell* pTempOldCell, ScDocument* pDoc, const rtl::OUString& sOldValue )
: :
ScChangeAction(SC_CAT_CONTENT, aBigRangeP, nActionNumber, nRejectingNumber, eStateP, aDateTimeP, aUserP, sComment), ScChangeAction(SC_CAT_CONTENT, aBigRangeP, nActionNumber, nRejectingNumber, eStateP, aDateTimeP, aUserP, sComment),
aOldValue(sOldValue), aOldValue(sOldValue),
...@@ -1381,13 +1384,13 @@ ScChangeActionContent::ScChangeActionContent( const sal_uLong nActionNumber, ...@@ -1381,13 +1384,13 @@ ScChangeActionContent::ScChangeActionContent( const sal_uLong nActionNumber,
{ {
if (pOldCell) if (pOldCell)
ScChangeActionContent::SetCell( aOldValue, pOldCell, 0, pDoc ); 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 aOldValue = sOldValue; // set again, because SetCell removes it
} }
ScChangeActionContent::ScChangeActionContent( const sal_uLong nActionNumber, ScChangeActionContent::ScChangeActionContent( const sal_uLong nActionNumber,
ScBaseCell* pTempNewCell, const ScBigRange& aBigRangeP, ScBaseCell* pTempNewCell, const ScBigRange& aBigRangeP,
ScDocument* pDoc, const String& sNewValue ) ScDocument* pDoc, const rtl::OUString& sNewValue )
: :
ScChangeAction(SC_CAT_CONTENT, aBigRangeP, nActionNumber), ScChangeAction(SC_CAT_CONTENT, aBigRangeP, nActionNumber),
aNewValue(sNewValue), aNewValue(sNewValue),
...@@ -1400,7 +1403,7 @@ ScChangeActionContent::ScChangeActionContent( const sal_uLong nActionNumber, ...@@ -1400,7 +1403,7 @@ ScChangeActionContent::ScChangeActionContent( const sal_uLong nActionNumber,
{ {
if (pNewCell) if (pNewCell)
ScChangeActionContent::SetCell( aNewValue, pNewCell, 0, pDoc ); 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 aNewValue = sNewValue; // set again, because SetCell removes it
} }
...@@ -1483,14 +1486,15 @@ void ScChangeActionContent::SetOldNewCells( ScBaseCell* pOldCellP, ...@@ -1483,14 +1486,15 @@ void ScChangeActionContent::SetOldNewCells( ScBaseCell* pOldCellP,
ScChangeActionContent::SetCell( aNewValue, pNewCell, nNewFormat, pDoc ); 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" ); OSL_ENSURE( !pNewCell, "ScChangeActionContent::SetNewCell: overwriting existing cell" );
pNewCell = pCell; pNewCell = pCell;
ScChangeActionContent::SetCell( aNewValue, pNewCell, 0, pDoc ); ScChangeActionContent::SetCell( aNewValue, pNewCell, 0, pDoc );
// #i40704# allow to set formatted text here - don't call SetNewValue with String from XML filter // #i40704# allow to set formatted text here - don't call SetNewValue with String from XML filter
if ( rFormatted.Len() ) if (!rFormatted.isEmpty())
aNewValue = rFormatted; aNewValue = rFormatted;
} }
...@@ -1920,15 +1924,16 @@ void ScChangeActionContent::PutNewValueToDoc( ScDocument* pDoc, ...@@ -1920,15 +1924,16 @@ void ScChangeActionContent::PutNewValueToDoc( ScDocument* pDoc,
} }
void ScChangeActionContent::PutValueToDoc( ScBaseCell* pCell, void ScChangeActionContent::PutValueToDoc(
const String& rValue, ScDocument* pDoc, SCsCOL nDx, SCsROW nDy ) const ScBaseCell* pCell, const rtl::OUString& rValue, ScDocument* pDoc,
SCsCOL nDx, SCsROW nDy ) const
{ {
ScAddress aPos( aBigRange.aStart.MakeAddress() ); ScAddress aPos( aBigRange.aStart.MakeAddress() );
if ( nDx ) if ( nDx )
aPos.IncCol( nDx ); aPos.IncCol( nDx );
if ( nDy ) if ( nDy )
aPos.IncRow( nDy ); aPos.IncRow( nDy );
if ( !rValue.Len() ) if (rValue.isEmpty())
{ {
if ( pCell ) if ( pCell )
{ {
...@@ -2162,10 +2167,12 @@ bool ScChangeActionContent::IsOldMatrixReference() const ...@@ -2162,10 +2167,12 @@ bool ScChangeActionContent::IsOldMatrixReference() const
// --- ScChangeActionReject ------------------------------------------------ // --- ScChangeActionReject ------------------------------------------------
ScChangeActionReject::ScChangeActionReject(const sal_uLong nActionNumber, const ScChangeActionState eStateP, const sal_uLong nRejectingNumber, ScChangeActionReject::ScChangeActionReject(
const ScBigRange& aBigRangeP, const String& aUserP, const DateTime& aDateTimeP, const String& sComment) const sal_uLong nActionNumber, const ScChangeActionState eStateP,
: const sal_uLong nRejectingNumber,
ScChangeAction(SC_CAT_CONTENT, aBigRangeP, nActionNumber, nRejectingNumber, eStateP, aDateTimeP, aUserP, sComment) 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( ...@@ -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 ); ScChangeActionContent* pAct = new ScChangeActionContent( --nGeneratedMin, pNewCell, aBigRange, pDoc, sNewValue );
if ( pAct ) if ( pAct )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment