diff options
author | Caolán McNamara <caolanm@redhat.com> | 2012-03-09 00:51:17 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2012-03-09 10:26:50 +0000 |
commit | 809e3017d1d0ee953880da1c3360bc1ee40d3c05 (patch) | |
tree | b1126ae22590ac3d32901506c3f5ca586046965b /sw | |
parent | Do not remove the whole workdir/* on 'make clean' (diff) | |
download | core-809e3017d1d0ee953880da1c3360bc1ee40d3c05.tar.gz core-809e3017d1d0ee953880da1c3360bc1ee40d3c05.zip |
update code a bit
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/filter/inc/msfilter.hxx | 4 | ||||
-rw-r--r-- | sw/source/filter/ww8/writerhelper.cxx | 20 | ||||
-rw-r--r-- | sw/source/filter/ww8/writerhelper.hxx | 10 | ||||
-rw-r--r-- | sw/source/filter/ww8/wrtww8.cxx | 14 | ||||
-rw-r--r-- | sw/source/filter/ww8/wrtww8.hxx | 2 |
5 files changed, 25 insertions, 25 deletions
diff --git a/sw/source/filter/inc/msfilter.hxx b/sw/source/filter/inc/msfilter.hxx index 73245119d527..e24dab43bd52 100644 --- a/sw/source/filter/inc/msfilter.hxx +++ b/sw/source/filter/inc/msfilter.hxx @@ -432,14 +432,14 @@ namespace sw class WrtRedlineAuthor : public boost::noncopyable { protected: - std::vector<String> maAuthors; // Array of Sw - Bookmarknames + std::vector<rtl::OUString> maAuthors; // Array of Sw - Bookmarknames sal_uInt16 GetPos( const String& rNm ); public: WrtRedlineAuthor() {} virtual ~WrtRedlineAuthor() {} - sal_uInt16 AddName( const String& rNm ); + sal_uInt16 AddName( const rtl::OUString& rNm ); virtual void Write(Writer &rWrt) = 0; // std::vector<String> GetNames(); }; diff --git a/sw/source/filter/ww8/writerhelper.cxx b/sw/source/filter/ww8/writerhelper.cxx index 982284b6d433..2442722b29b4 100644 --- a/sw/source/filter/ww8/writerhelper.cxx +++ b/sw/source/filter/ww8/writerhelper.cxx @@ -277,7 +277,7 @@ namespace sw rObj.AbandonObject(); } - bool DrawingOLEAdaptor::TransferToDoc( ::rtl::OUString &rName ) + bool DrawingOLEAdaptor::TransferToDoc( rtl::OUString &rName ) { OSL_ENSURE(mxIPRef.is(), "Transferring invalid object to doc"); if (!mxIPRef.is()) @@ -294,7 +294,7 @@ namespace sw ::svt::EmbeddedObjectRef::SetGraphicToContainer( *mpGraphic, mrPers.GetEmbeddedObjectContainer(), rName, - ::rtl::OUString() ); + rtl::OUString() ); mxIPRef = 0; } @@ -457,7 +457,7 @@ namespace sw return aStyles; } - SwTxtFmtColl* GetParaStyle(SwDoc &rDoc, const String& rName) + SwTxtFmtColl* GetParaStyle(SwDoc &rDoc, const rtl::OUString& rName) { // Search first in the Doc-Styles SwTxtFmtColl* pColl = rDoc.FindTxtFmtCollByName(rName); @@ -472,7 +472,7 @@ namespace sw return pColl; } - SwCharFmt* GetCharStyle(SwDoc &rDoc, const String& rName) + SwCharFmt* GetCharStyle(SwDoc &rDoc, const rtl::OUString& rName) { SwCharFmt *pFmt = rDoc.FindCharFmtByName(rName); if (!pFmt) @@ -632,11 +632,11 @@ namespace sw } } - bool IsStarSymbol(const String &rFontName) + bool IsStarSymbol(const rtl::OUString &rFontName) { - String sFamilyNm(GetFontToken(rFontName, 0)); - return (sFamilyNm.EqualsIgnoreCaseAscii("starsymbol") || - sFamilyNm.EqualsIgnoreCaseAscii("opensymbol")); + rtl::OUString sFamilyNm(GetFontToken(rFontName, 0)); + return (sFamilyNm.equalsIgnoreAsciiCaseAsciiL(RTL_CONSTASCII_STRINGPARAM("starsymbol")) || + sFamilyNm.equalsIgnoreAsciiCaseAsciiL(RTL_CONSTASCII_STRINGPARAM("opensymbol"))); } Size GetSwappedInSize(const SwNoTxtNode& rNd) @@ -755,10 +755,10 @@ namespace sw std::for_each(maStack.begin(), maStack.end(), SetInDocAndDelete(mrDoc)); } - sal_uInt16 WrtRedlineAuthor::AddName( const String& rNm ) + sal_uInt16 WrtRedlineAuthor::AddName( const rtl::OUString& rNm ) { sal_uInt16 nRet; - typedef std::vector<String>::iterator myiter; + typedef std::vector<rtl::OUString>::iterator myiter; myiter aIter = std::find(maAuthors.begin(), maAuthors.end(), rNm); if (aIter != maAuthors.end()) nRet = static_cast< sal_uInt16 >(aIter - maAuthors.begin()); diff --git a/sw/source/filter/ww8/writerhelper.hxx b/sw/source/filter/ww8/writerhelper.hxx index 5218e5ab530f..01c53c8db1ac 100644 --- a/sw/source/filter/ww8/writerhelper.hxx +++ b/sw/source/filter/ww8/writerhelper.hxx @@ -530,7 +530,7 @@ namespace sw @author <a href="mailto:cmc@openoffice.org">Caolán McNamara</a> */ - SwTxtFmtColl* GetParaStyle(SwDoc &rDoc, const String& rName); + SwTxtFmtColl* GetParaStyle(SwDoc &rDoc, const rtl::OUString& rName); /** Get a Character Style which fits a given name @@ -548,7 +548,7 @@ namespace sw @author <a href="mailto:cmc@openoffice.org">Caolán McNamara</a> */ - SwCharFmt* GetCharStyle(SwDoc &rDoc, const String& rName); + SwCharFmt* GetCharStyle(SwDoc &rDoc, const rtl::OUString& rName); /** Sort sequence of Paragraph Styles by assigned outline style list level @@ -741,7 +741,7 @@ namespace sw @author <a href="mailto:cmc@openoffice.org">Caolán McNamara</a> */ - bool IsStarSymbol(const String &rFontName); + bool IsStarSymbol(const rtl::OUString &rFontName); /** Make setting a drawing object's layer in a Writer document easy @@ -873,7 +873,7 @@ namespace sw class DrawingOLEAdaptor { private: - String msOrigPersistName; + rtl::OUString msOrigPersistName; com::sun::star::uno::Reference < com::sun::star::embed::XEmbeddedObject > mxIPRef; SfxObjectShell& mrPers; Graphic* mpGraphic; @@ -907,7 +907,7 @@ namespace sw @return On success true is returned, otherwise false. On success rName is then suitable for user with SwDoc::InsertOLE */ - bool TransferToDoc(::rtl::OUString &rName); + bool TransferToDoc(rtl::OUString &rName); private: /// No assigning allowed DrawingOLEAdaptor& operator=(const DrawingOLEAdaptor&); diff --git a/sw/source/filter/ww8/wrtww8.cxx b/sw/source/filter/ww8/wrtww8.cxx index b24985e3ebf1..0dbf05cabcf6 100644 --- a/sw/source/filter/ww8/wrtww8.cxx +++ b/sw/source/filter/ww8/wrtww8.cxx @@ -1299,7 +1299,7 @@ void WW8_WrtBookmarks::Write( WW8Export& rWrt ) std::sort(aBookmarks.begin(), aBookmarks.end()); // First write the Bookmark Name Stringtable - std::vector<String> aNames; + std::vector<rtl::OUString> aNames; aNames.reserve(aBookmarks.size()); for (BkmIter bIt = aBookmarks.begin(); bIt < aBookmarks.end(); ++bIt) aNames.push_back(bIt->name); @@ -1456,7 +1456,7 @@ sal_uInt16 WW8Export::AddRedlineAuthor( sal_uInt16 nId ) //-------------------------------------------------------------------------- -void WW8Export::WriteAsStringTable(const std::vector<String>& rStrings, +void WW8Export::WriteAsStringTable(const std::vector<rtl::OUString>& rStrings, sal_Int32& rfcSttbf, sal_Int32& rlcbSttbf, sal_uInt16 nExtraLen) { sal_uInt16 n, nCount = static_cast< sal_uInt16 >(rStrings.size()); @@ -1484,7 +1484,8 @@ void WW8Export::WriteAsStringTable(const std::vector<String>& rStrings, SwWW8Writer::WriteShort( rStrm, 0 ); for( n = 0; n < nCount; ++n ) { - const String aNm(rStrings[n].Copy(0, 255)); + const rtl::OUString &rString = rStrings[n]; + const String aNm(rString.copy(0, std::min<sal_Int32>(rString.getLength(), 255))); rStrm << (sal_uInt8)aNm.Len(); SwWW8Writer::WriteString8(rStrm, aNm, false, RTL_TEXTENCODING_MS_1252); @@ -2639,15 +2640,14 @@ void WW8Export::WriteFkpPlcUsw() if ( pSttbfAssoc ) // #i106057# { - ::std::vector<String> aStrings; + ::std::vector<rtl::OUString> aStrings; ::ww8::StringVector_t & aSttbStrings = pSttbfAssoc->getStrings(); ::ww8::StringVector_t::const_iterator aItEnd = aSttbStrings.end(); for (::ww8::StringVector_t::const_iterator aIt = aSttbStrings.begin(); - aIt != aItEnd; aIt++) + aIt != aItEnd; ++aIt) { - String aStr(aIt->getStr()); - aStrings.push_back(aStr); + aStrings.push_back(aIt->getStr()); } WriteAsStringTable(aStrings, pFib->fcSttbfAssoc, diff --git a/sw/source/filter/ww8/wrtww8.hxx b/sw/source/filter/ww8/wrtww8.hxx index a7dd47a9eedf..5bd0cd7a240f 100644 --- a/sw/source/filter/ww8/wrtww8.hxx +++ b/sw/source/filter/ww8/wrtww8.hxx @@ -1008,7 +1008,7 @@ public: virtual void AppendBookmark( const rtl::OUString& rName, bool bSkip = false ); void MoveFieldMarks(sal_uLong nFrom, sal_uLong nTo); - void WriteAsStringTable(const ::std::vector<String>&, sal_Int32& rfcSttbf, + void WriteAsStringTable(const ::std::vector<rtl::OUString>&, sal_Int32& rfcSttbf, sal_Int32& rlcbSttbf, sal_uInt16 nExtraLen = 0); virtual sal_uLong ReplaceCr( sal_uInt8 nChar ); |