summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2013-10-15 17:26:53 +0200
committerNoel Grandin <noel@peralex.com>2013-10-18 09:59:18 +0200
commite39d9876166317b95a0b1f4b5abf032932085a12 (patch)
tree0bc65836d80bc22650e1d1445b996fdfa32f3062
parentbbd37f87b337f4b5c91fae02357a932de3eaa094 (diff)
convert sw/source/core/undo/*.cxx from String to OUString
Change-Id: Ifbd63cd8184deec7f11d504d78d29c8f3ddd247c
-rw-r--r--sw/source/core/undo/docundo.cxx12
-rw-r--r--sw/source/core/undo/undel.cxx18
-rw-r--r--sw/source/core/undo/undobj.cxx6
-rw-r--r--sw/source/core/undo/undobj1.cxx2
-rw-r--r--sw/source/core/undo/undraw.cxx2
-rw-r--r--sw/source/core/undo/unins.cxx36
-rw-r--r--sw/source/core/undo/unovwr.cxx12
-rw-r--r--sw/source/core/undo/unsort.cxx4
8 files changed, 46 insertions, 46 deletions
diff --git a/sw/source/core/undo/docundo.cxx b/sw/source/core/undo/docundo.cxx
index 3e690e4aa0d7..7103fc43f1e9 100644
--- a/sw/source/core/undo/docundo.cxx
+++ b/sw/source/core/undo/docundo.cxx
@@ -206,9 +206,9 @@ UndoManager::StartUndo(SwUndoId const i_eUndoId,
SwUndoId const eUndoId( (0 == i_eUndoId) ? UNDO_START : i_eUndoId );
OSL_ASSERT(UNDO_END != eUndoId);
- String comment( (UNDO_START == eUndoId)
- ? String("??", RTL_TEXTENCODING_ASCII_US)
- : String(SW_RES(UNDO_BASE + eUndoId)) );
+ OUString comment( (UNDO_START == eUndoId)
+ ? OUString("??")
+ : OUString(SW_RES(UNDO_BASE + eUndoId)) );
if (pRewriter)
{
OSL_ASSERT(UNDO_START != eUndoId);
@@ -255,7 +255,7 @@ UndoManager::EndUndo(SwUndoId const i_eUndoId, SwRewriter const*const pRewriter)
OSL_ENSURE(pListAction->GetId() == eUndoId,
"EndUndo(): given ID different from StartUndo()");
// comment set by caller of EndUndo
- String comment = String(SW_RES(UNDO_BASE + eUndoId));
+ OUString comment = SW_RES(UNDO_BASE + eUndoId);
if (pRewriter)
{
comment = pRewriter->Apply(comment);
@@ -272,7 +272,7 @@ UndoManager::EndUndo(SwUndoId const i_eUndoId, SwRewriter const*const pRewriter)
// take comment of last contained action
// (note that this works recursively, i.e. the last contained
// action may be a list action created by StartUndo/EndUndo)
- String const comment(pLastUndo->GetComment());
+ OUString const comment(pLastUndo->GetComment());
pListAction->SetComment(comment);
}
else
@@ -388,7 +388,7 @@ SwUndoId UndoManager::GetRepeatInfo(OUString *const o_pStr) const
}
if (o_pStr) // not repeatable -> clear comment
{
- *o_pStr = String();
+ *o_pStr = OUString();
}
return UNDO_EMPTY;
}
diff --git a/sw/source/core/undo/undel.cxx b/sw/source/core/undo/undel.cxx
index ce0988c28842..c9032f3165d3 100644
--- a/sw/source/core/undo/undel.cxx
+++ b/sw/source/core/undo/undel.cxx
@@ -516,9 +516,9 @@ static SwRewriter lcl_RewriterFromHistory(SwHistory & rHistory)
for ( sal_uInt16 n = 0; n < rHistory.Count(); n++)
{
- String aDescr = rHistory[n]->GetDescription();
+ OUString aDescr = rHistory[n]->GetDescription();
- if (aDescr.Len() > 0)
+ if (!aDescr.isEmpty())
{
aRewriter.AddRule(UndoArg2, aDescr);
@@ -552,14 +552,14 @@ static bool lcl_IsSpecialCharacter(sal_Unicode nChar)
return false;
}
-static String lcl_DenotedPortion(String rStr, xub_StrLen nStart,
+static OUString lcl_DenotedPortion(OUString rStr, xub_StrLen nStart,
xub_StrLen nEnd)
{
- String aResult;
+ OUString aResult;
if (nEnd - nStart > 0)
{
- sal_Unicode cLast = rStr.GetChar(nEnd - 1);
+ sal_Unicode cLast = rStr[nEnd - 1];
if (lcl_IsSpecialCharacter(cLast))
{
switch(cLast)
@@ -587,7 +587,7 @@ static String lcl_DenotedPortion(String rStr, xub_StrLen nStart,
else
{
aResult = SW_RESSTR(STR_START_QUOTE);
- aResult += rStr.Copy(nStart, nEnd - nStart);
+ aResult += rStr.copy(nStart, nEnd - nStart);
aResult += SW_RESSTR(STR_END_QUOTE);
}
}
@@ -652,7 +652,7 @@ SwRewriter SwUndoDelete::GetRewriter() const
aRewriter.AddRule(UndoArg2, sTableName);
aRewriter.AddRule(UndoArg3, SW_RESSTR(STR_END_QUOTE));
- String sTmp = aRewriter.Apply(SW_RES(STR_TABLE_NAME));
+ OUString sTmp = aRewriter.Apply(SW_RES(STR_TABLE_NAME));
aResult.AddRule(UndoArg1, sTmp);
}
else
@@ -660,7 +660,7 @@ SwRewriter SwUndoDelete::GetRewriter() const
}
else
{
- String aStr;
+ OUString aStr;
if (pSttStr != NULL && pEndStr != NULL && pSttStr->isEmpty() &&
pEndStr->isEmpty())
@@ -685,7 +685,7 @@ SwRewriter SwUndoDelete::GetRewriter() const
}
}
- aStr = ShortenString(aStr, nUndoStringLength, String(SW_RES(STR_LDOTS)));
+ aStr = ShortenString(aStr, nUndoStringLength, OUString(SW_RES(STR_LDOTS)));
if (pHistory)
{
SwRewriter aRewriter = lcl_RewriterFromHistory(*pHistory);
diff --git a/sw/source/core/undo/undobj.cxx b/sw/source/core/undo/undobj.cxx
index 510fff184b6a..1807d44ce9c7 100644
--- a/sw/source/core/undo/undobj.cxx
+++ b/sw/source/core/undo/undobj.cxx
@@ -269,7 +269,7 @@ bool SwUndo::CanRepeatImpl( ::sw::RepeatContext & ) const
OUString SwUndo::GetComment() const
{
- String aResult;
+ OUString aResult;
if (bCacheComment)
{
@@ -286,7 +286,7 @@ OUString SwUndo::GetComment() const
}
else
{
- aResult = String(SW_RES(UNDO_BASE + GetId()));
+ aResult = SW_RES(UNDO_BASE + GetId());
SwRewriter aRewriter = GetRewriter();
@@ -958,7 +958,7 @@ void SwRedlineSaveData::RedlineToDoc( SwPaM& rPam )
RedlineMode_t eOld = rDoc.GetRedlineMode();
rDoc.SetRedlineMode_intern((RedlineMode_t)(eOld | nsRedlineMode_t::REDLINE_DONTCOMBINE_REDLINES));
//#i92154# let UI know about a new redline with comment
- if (rDoc.GetDocShell() && (pRedl->GetComment() != String()) )
+ if (rDoc.GetDocShell() && (!pRedl->GetComment().isEmpty()) )
rDoc.GetDocShell()->Broadcast(SwRedlineHint(pRedl,SWREDLINE_INSERTED));
bool const bSuccess = rDoc.AppendRedline( pRedl, true );
diff --git a/sw/source/core/undo/undobj1.cxx b/sw/source/core/undo/undobj1.cxx
index c99c19e97aab..afa735ee37fa 100644
--- a/sw/source/core/undo/undobj1.cxx
+++ b/sw/source/core/undo/undobj1.cxx
@@ -334,7 +334,7 @@ void SwUndoInsLayFmt::RepeatImpl(::sw::RepeatContext & rContext)
// #111827#
OUString SwUndoInsLayFmt::GetComment() const
{
- String aResult;
+ OUString aResult;
// HACK: disable caching:
// the SfxUndoManager calls GetComment() too early: the pFrmFmt does not
diff --git a/sw/source/core/undo/undraw.cxx b/sw/source/core/undo/undraw.cxx
index e9ba3a388cbc..6890e816edd9 100644
--- a/sw/source/core/undo/undraw.cxx
+++ b/sw/source/core/undo/undraw.cxx
@@ -62,7 +62,7 @@ IMPL_LINK( SwDoc, AddDrawUndo, SdrUndoAction *, pUndo )
#if OSL_DEBUG_LEVEL > 1
sal_uInt16 nId = pUndo->GetId();
(void)nId;
- String sComment( pUndo->GetComment() );
+ OUString sComment( pUndo->GetComment() );
#endif
if (GetIDocumentUndoRedo().DoesUndo() &&
diff --git a/sw/source/core/undo/unins.cxx b/sw/source/core/undo/unins.cxx
index bc533af108fd..0b57739a4475 100644
--- a/sw/source/core/undo/unins.cxx
+++ b/sw/source/core/undo/unins.cxx
@@ -488,9 +488,9 @@ SwRewriter SwUndoInsert::GetRewriter() const
if (pStr)
{
- String aString = ShortenString(DenoteSpecialCharacters(*pStr),
+ OUString aString = ShortenString(DenoteSpecialCharacters(*pStr),
nUndoStringLength,
- String(SW_RES(STR_LDOTS)));
+ OUString(SW_RES(STR_LDOTS)));
aResult.AddRule(UndoArg1, aString);
@@ -499,7 +499,7 @@ SwRewriter SwUndoInsert::GetRewriter() const
if ( ! bDone )
{
- aResult.AddRule(UndoArg1, String("??", RTL_TEXTENCODING_ASCII_US));
+ aResult.AddRule(UndoArg1, OUString("??"));
}
return aResult;
@@ -568,38 +568,38 @@ MakeUndoReplaceRewriter(sal_uLong const occurrences,
if (1 < occurrences)
{
aResult.AddRule(UndoArg1, OUString::number(occurrences));
- aResult.AddRule(UndoArg2, String(SW_RES(STR_OCCURRENCES_OF)));
+ aResult.AddRule(UndoArg2, OUString(SW_RES(STR_OCCURRENCES_OF)));
- String aTmpStr;
- aTmpStr += String(SW_RES(STR_START_QUOTE));
+ OUString aTmpStr;
+ aTmpStr += SW_RES(STR_START_QUOTE);
aTmpStr += ShortenString(sOld, nUndoStringLength,
SW_RES(STR_LDOTS));
- aTmpStr += String(SW_RES(STR_END_QUOTE));
+ aTmpStr += SW_RES(STR_END_QUOTE);
aResult.AddRule(UndoArg3, aTmpStr);
}
else if (1 == occurrences)
{
{
- String aTmpStr;
+ OUString aTmpStr;
- aTmpStr += String(SW_RES(STR_START_QUOTE));
+ aTmpStr += SW_RES(STR_START_QUOTE);
// #i33488 #
aTmpStr += ShortenString(sOld, nUndoStringLength,
SW_RES(STR_LDOTS));
- aTmpStr += String(SW_RES(STR_END_QUOTE));
+ aTmpStr += SW_RES(STR_END_QUOTE);
aResult.AddRule(UndoArg1, aTmpStr);
}
- aResult.AddRule(UndoArg2, String(SW_RES(STR_YIELDS)));
+ aResult.AddRule(UndoArg2, OUString(SW_RES(STR_YIELDS)));
{
- String aTmpStr;
+ OUString aTmpStr;
- aTmpStr += String(SW_RES(STR_START_QUOTE));
+ aTmpStr += SW_RES(STR_START_QUOTE);
// #i33488 #
aTmpStr += ShortenString(sNew, nUndoStringLength,
SW_RES(STR_LDOTS));
- aTmpStr += String(SW_RES(STR_END_QUOTE));
+ aTmpStr += SW_RES(STR_END_QUOTE);
aResult.AddRule(UndoArg3, aTmpStr);
}
}
@@ -1056,12 +1056,12 @@ SwRewriter SwUndoInsertLabel::GetRewriter() const
{
SwRewriter aRewriter;
- String aTmpStr;
+ OUString aTmpStr;
- aTmpStr += String(SW_RES(STR_START_QUOTE));
+ aTmpStr += SW_RES(STR_START_QUOTE);
aTmpStr += ShortenString(sText, nUndoStringLength,
- String(SW_RES(STR_LDOTS)));
- aTmpStr += String(SW_RES(STR_END_QUOTE));
+ OUString(SW_RES(STR_LDOTS)));
+ aTmpStr += SW_RES(STR_END_QUOTE);
aRewriter.AddRule(UndoArg1, aTmpStr);
diff --git a/sw/source/core/undo/unovwr.cxx b/sw/source/core/undo/unovwr.cxx
index 2c06cd4777d6..20d8c922b772 100644
--- a/sw/source/core/undo/unovwr.cxx
+++ b/sw/source/core/undo/unovwr.cxx
@@ -308,12 +308,12 @@ SwRewriter SwUndoOverwrite::GetRewriter() const
{
SwRewriter aResult;
- String aString;
+ OUString aString;
- aString += String(SW_RES(STR_START_QUOTE));
+ aString += SW_RES(STR_START_QUOTE);
aString += ShortenString(aInsStr, nUndoStringLength,
- String(SW_RES(STR_LDOTS)));
- aString += String(SW_RES(STR_END_QUOTE));
+ OUString(SW_RES(STR_LDOTS)));
+ aString += SW_RES(STR_END_QUOTE);
aResult.AddRule(UndoArg1, aString);
@@ -322,13 +322,13 @@ SwRewriter SwUndoOverwrite::GetRewriter() const
struct _UndoTransliterate_Data
{
- String sText;
+ OUString sText;
SwHistory* pHistory;
Sequence< sal_Int32 >* pOffsets;
sal_uLong nNdIdx;
xub_StrLen nStart, nLen;
- _UndoTransliterate_Data( sal_uLong nNd, xub_StrLen nStt, xub_StrLen nStrLen, const String& rTxt )
+ _UndoTransliterate_Data( sal_uLong nNd, xub_StrLen nStt, xub_StrLen nStrLen, const OUString& rTxt )
: sText( rTxt ), pHistory( 0 ), pOffsets( 0 ),
nNdIdx( nNd ), nStart( nStt ), nLen( nStrLen )
{}
diff --git a/sw/source/core/undo/unsort.cxx b/sw/source/core/undo/unsort.cxx
index d99e2feac04f..bbb0a25d5807 100644
--- a/sw/source/core/undo/unsort.cxx
+++ b/sw/source/core/undo/unsort.cxx
@@ -173,9 +173,9 @@ void SwUndoSort::RedoImpl(::sw::UndoRedoContext & rContext)
for(sal_uInt16 i=0; i < aSortList.size(); ++i)
{
const SwTableBox* pSource = rTbl.GetTblBox(
- (const String&) *aSortList[i].SORT_TXT_TBL.TBL.pSource );
+ *aSortList[i].SORT_TXT_TBL.TBL.pSource );
const SwTableBox* pTarget = rTbl.GetTblBox(
- (const String&) *aSortList[i].SORT_TXT_TBL.TBL.pTarget );
+ *aSortList[i].SORT_TXT_TBL.TBL.pTarget );
// move back
MoveCell(&rDoc, pSource, pTarget,