diff options
-rw-r--r-- | sw/source/filter/ww8/ww8glsy.cxx | 4 | ||||
-rw-r--r-- | sw/source/filter/ww8/ww8graf.cxx | 14 | ||||
-rw-r--r-- | sw/source/filter/ww8/ww8par.cxx | 5 | ||||
-rw-r--r-- | sw/source/filter/ww8/ww8par.hxx | 18 | ||||
-rw-r--r-- | sw/source/filter/ww8/ww8scan.cxx | 32 | ||||
-rw-r--r-- | sw/source/filter/ww8/ww8scan.hxx | 4 | ||||
-rw-r--r-- | tools/source/fsys/tempfile.cxx | 18 |
7 files changed, 48 insertions, 47 deletions
diff --git a/sw/source/filter/ww8/ww8glsy.cxx b/sw/source/filter/ww8/ww8glsy.cxx index fa328e4d8c05..15eed4fe8ec6 100644 --- a/sw/source/filter/ww8/ww8glsy.cxx +++ b/sw/source/filter/ww8/ww8glsy.cxx @@ -161,13 +161,13 @@ bool WW8Glossary::MakeEntries(SwDoc *pD, SwTextBlocks &rBlocks, String sShortcut = rLNm; // Need to check make sure the shortcut is not already being used - xub_StrLen nStart = 0; + sal_Int32 nStart = 0; sal_uInt16 nCurPos = rBlocks.GetIndex( sShortcut ); xub_StrLen nLen = sShortcut.Len(); while( (sal_uInt16)-1 != nCurPos ) { sShortcut.Erase( nLen ) += - String::CreateFromInt32( ++nStart ); // add an Number to it + rtl::OUString::valueOf(++nStart); // add an Number to it nCurPos = rBlocks.GetIndex( sShortcut ); } diff --git a/sw/source/filter/ww8/ww8graf.cxx b/sw/source/filter/ww8/ww8graf.cxx index 06714382984f..b044636fd89b 100644 --- a/sw/source/filter/ww8/ww8graf.cxx +++ b/sw/source/filter/ww8/ww8graf.cxx @@ -159,15 +159,15 @@ Color WW8TransCol(SVBT32 nWC) return Color(nWC[0], nWC[1], nWC[2]); } -void wwFrameNamer::SetUniqueGraphName(SwFrmFmt *pFrmFmt, const String &rFixed) +void wwFrameNamer::SetUniqueGraphName(SwFrmFmt *pFrmFmt, const rtl::OUString &rFixed) { - if (mbIsDisabled || !rFixed.Len()) + if (mbIsDisabled || rFixed.isEmpty()) return; - String aName(msSeed); - aName += String::CreateFromInt32(++mnImportedGraphicsCount); - aName.APPEND_CONST_ASC( ": " ); - aName += rFixed; - pFrmFmt->SetName( aName ); + rtl::OUStringBuffer aName(msSeed); + aName.append(++mnImportedGraphicsCount); + aName.append(": "); + aName.append(rFixed); + pFrmFmt->SetName(aName.makeStringAndClear()); } // ReadGrafStart liest die ObjektDaten ein und erzeugt falls noetig einen Anker diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx index 6fe97846b70f..d038f19f7e24 100644 --- a/sw/source/filter/ww8/ww8par.cxx +++ b/sw/source/filter/ww8/ww8par.cxx @@ -3537,8 +3537,7 @@ bool SwWW8ImplReader::ReadText(long nStartCp, long nTextLen, ManTypes nType) if(pAktItemSet && !pFmt) { - String sPrefix(CREATE_CONST_ASC( "WW8Dropcap")); - sPrefix += String::CreateFromInt32( nDropCap++ ); + rtl::OUString sPrefix(rtl::OUStringBuffer("WW8Dropcap").append(nDropCap++).makeStringAndClear()); pNewSwCharFmt = rDoc.MakeCharFmt(sPrefix, (SwCharFmt*)rDoc.GetDfltCharFmt()); pAktItemSet->ClearItem(RES_CHRATR_ESCAPEMENT); pNewSwCharFmt->SetFmtAttr( *pAktItemSet ); @@ -5659,7 +5658,7 @@ sal_Bool SwMSDffManager::GetOLEStorageName(long nOLEId, String& rStorageName, if( bRet ) { rStorageName = '_'; - rStorageName += String::CreateFromInt32(nPictureId); + rStorageName += rtl::OUString::valueOf(nPictureId); rSrcStorage = rReader.pStg->OpenSotStorage(CREATE_CONST_ASC( SL::aObjectPool)); if (!rReader.mpDocShell) diff --git a/sw/source/filter/ww8/ww8par.hxx b/sw/source/filter/ww8/ww8par.hxx index 7b4ec8efd762..de9219d78efc 100644 --- a/sw/source/filter/ww8/ww8par.hxx +++ b/sw/source/filter/ww8/ww8par.hxx @@ -840,20 +840,18 @@ public: void delete_all_from_doc(); }; -class wwFrameNamer +class wwFrameNamer : private ::boost::noncopyable { private: - String msSeed; - int mnImportedGraphicsCount; + rtl::OUString msSeed; + sal_Int32 mnImportedGraphicsCount; bool mbIsDisabled; - //No copying - wwFrameNamer(const wwFrameNamer&); - wwFrameNamer& operator=(const wwFrameNamer&); public: - void SetUniqueGraphName(SwFrmFmt *pFrmFmt,const String &rFixedPart); - wwFrameNamer(bool bIsDisabled, const String &rSeed) + void SetUniqueGraphName(SwFrmFmt *pFrmFmt, const rtl::OUString &rFixedPart); + wwFrameNamer(bool bIsDisabled, const rtl::OUString &rSeed) : msSeed(rSeed), mnImportedGraphicsCount(0), mbIsDisabled(bIsDisabled) - { } + { + } }; class wwSectionNamer @@ -1212,7 +1210,7 @@ private: bool bParaAutoAfter; bool bDropCap; - int nDropCap; + sal_Int32 nDropCap; int nIdctHint; bool bBidi; diff --git a/sw/source/filter/ww8/ww8scan.cxx b/sw/source/filter/ww8/ww8scan.cxx index ac801fbd4f37..94a751bb9f2b 100644 --- a/sw/source/filter/ww8/ww8scan.cxx +++ b/sw/source/filter/ww8/ww8scan.cxx @@ -4155,23 +4155,23 @@ String WW8PLCFx_Book::GetBookmark(long nStart,long nEnd, sal_uInt16 &nIndex) return bFound ? aBookNames[i] : aEmptyStr; } -String WW8PLCFx_Book::GetUniqueBookmarkName(const rtl::OUString &rSuggestedName) -{ - String aRet=(rSuggestedName.isEmpty() ? rtl::OUString("Unnamed") : rSuggestedName); - unsigned int i=0; - while(i<aBookNames.size()) { - String &s=aBookNames[i]; - if (aRet.CompareTo(s)==0) { - int len=aRet.Len(); - int p=len-1; - while(p>0 && aRet.GetChar(static_cast<sal_uInt16>(p))>='0' && aRet.GetChar(static_cast<sal_uInt16>(p))<='9') - p--; - aRet=String(aRet, 0, static_cast<sal_uInt16>(p+1)); - aRet += String::CreateFromInt32( nBookmarkId++ ); - i=0; // start search from beginning - } else { - i++; +rtl::OUString WW8PLCFx_Book::GetUniqueBookmarkName(const rtl::OUString &rSuggestedName) +{ + rtl::OUString aRet(rSuggestedName.isEmpty() ? rtl::OUString("Unnamed") : rSuggestedName); + size_t i = 0; + while (i < aBookNames.size()) + { + if (aRet.equals(aBookNames[i])) + { + sal_Int32 len = aRet.getLength(); + sal_Int32 p = len - 1; + while (p > 0 && aRet[p] >= '0' && aRet[p] <= '9') + --p; + aRet = aRet.copy(0, p+1) + rtl::OUString::valueOf(nBookmarkId++); + i = 0; // start search from beginning } + else + ++i; } return aRet; } diff --git a/sw/source/filter/ww8/ww8scan.hxx b/sw/source/filter/ww8/ww8scan.hxx index c9e88896ff27..2adec6661023 100644 --- a/sw/source/filter/ww8/ww8scan.hxx +++ b/sw/source/filter/ww8/ww8scan.hxx @@ -713,7 +713,7 @@ private: eBookStatus* pStatus; long nIMax; // Number of Booknotes sal_uInt16 nIsEnd; - int nBookmarkId; // counter incremented by GetUniqueBookmarkName. + sal_Int32 nBookmarkId; // counter incremented by GetUniqueBookmarkName. //No copying WW8PLCFx_Book(const WW8PLCFx_Book&); @@ -740,7 +740,7 @@ public: bool MapName(String& rName); String GetBookmark(long nStart,long nEnd, sal_uInt16 &nIndex); eBookStatus GetStatus() const; - String GetUniqueBookmarkName(const rtl::OUString &rSuggestedName); + rtl::OUString GetUniqueBookmarkName(const rtl::OUString &rSuggestedName); }; /* diff --git a/tools/source/fsys/tempfile.cxx b/tools/source/fsys/tempfile.cxx index 4a5c957c17f7..7a69e2e7696c 100644 --- a/tools/source/fsys/tempfile.cxx +++ b/tools/source/fsys/tempfile.cxx @@ -31,6 +31,7 @@ #include "comdep.hxx" #include <rtl/ustring.hxx> +#include <rtl/ustrbuf.hxx> #include <osl/file.hxx> #include <rtl/instance.hxx> #include <tools/time.hxx> @@ -119,9 +120,10 @@ void CreateTempName_Impl( String& rName, sal_Bool bKeep, sal_Bool bDir = sal_Tru for ( unsigned long nOld = u; ++u != nOld; ) { u %= (nRadix*nRadix*nRadix); - String aTmp( aName ); - aTmp += String::CreateFromInt32( (sal_Int32) (unsigned) u, nRadix ); - aTmp += String::CreateFromAscii( ".tmp" ); + rtl::OUString aTmp = rtl::OUStringBuffer(aName). + append((sal_Int32)(unsigned)u, nRadix). + append(".tmp"). + makeStringAndClear(); if ( bDir ) { @@ -200,12 +202,14 @@ TempFile::TempFile( const String& rLeadingChars, const String* pExtension, const aName += rLeadingChars; for ( sal_Int32 i=0;; i++ ) { - String aTmp( aName ); - aTmp += String::CreateFromInt32( i ); + rtl::OUStringBuffer aTmpBuffer(aName); + aTmpBuffer.append(i); if ( pExtension ) - aTmp += *pExtension; + aTmpBuffer.append(*pExtension); else - aTmp += String::CreateFromAscii( ".tmp" ); + aTmpBuffer.append(".tmp"); + rtl::OUString aTmp = aTmpBuffer.makeStringAndClear(); + if ( bDirectory ) { FileBase::RC err = Directory::create( aTmp ); |