diff options
author | Norbert Thiebaud <nthiebaud@gmail.com> | 2013-07-05 16:25:03 -0500 |
---|---|---|
committer | Norbert Thiebaud <nthiebaud@gmail.com> | 2013-07-07 20:00:16 +0000 |
commit | 009851223b5ced4ed2662af2e2ae81c0f9200e45 (patch) | |
tree | a8ab339589ea23b98513d394eabc4f135e69ccae /sd | |
parent | 35b42a9d1282a92dbc9a7fbc51d279812070688c (diff) |
module svl: all String and some bool and related clean-up
Change-Id: I36eb559fa58dbe75384b7119c788af0048813aed
Reviewed-on: https://gerrit.libreoffice.org/4733
Reviewed-by: Norbert Thiebaud <nthiebaud@gmail.com>
Tested-by: Norbert Thiebaud <nthiebaud@gmail.com>
Diffstat (limited to 'sd')
-rw-r--r-- | sd/inc/stlpool.hxx | 2 | ||||
-rw-r--r-- | sd/inc/stlsheet.hxx | 4 | ||||
-rw-r--r-- | sd/inc/undo/undomanager.hxx | 2 | ||||
-rw-r--r-- | sd/source/core/stlfamily.cxx | 10 | ||||
-rw-r--r-- | sd/source/core/stlpool.cxx | 10 | ||||
-rw-r--r-- | sd/source/core/stlsheet.cxx | 43 | ||||
-rw-r--r-- | sd/source/core/undo/undomanager.cxx | 6 | ||||
-rw-r--r-- | sd/source/ui/func/fuhhconv.cxx | 2 | ||||
-rw-r--r-- | sd/source/ui/func/sdundogr.cxx | 6 | ||||
-rw-r--r-- | sd/source/ui/inc/sdundogr.hxx | 4 |
10 files changed, 44 insertions, 45 deletions
diff --git a/sd/inc/stlpool.hxx b/sd/inc/stlpool.hxx index 624d5da15a02..3696a8ca5a56 100644 --- a/sd/inc/stlpool.hxx +++ b/sd/inc/stlpool.hxx @@ -125,7 +125,7 @@ protected: void CopySheets(SdStyleSheetPool& rSourcePool, SfxStyleFamily eFamily ); void CopySheets(SdStyleSheetPool& rSourcePool, SfxStyleFamily eFamily, SdStyleSheetVector& rCreatedSheets ); - virtual SfxStyleSheetBase* Create(const String& rName, SfxStyleFamily eFamily, sal_uInt16 nMask); + virtual SfxStyleSheetBase* Create(const OUString& rName, SfxStyleFamily eFamily, sal_uInt16 nMask); virtual SfxStyleSheetBase* Create(const SdStyleSheet& rStyle); using SfxStyleSheetPool::Create; diff --git a/sd/inc/stlsheet.hxx b/sd/inc/stlsheet.hxx index 5a9662c28747..8a596e167976 100644 --- a/sd/inc/stlsheet.hxx +++ b/sd/inc/stlsheet.hxx @@ -54,13 +54,13 @@ public: SdStyleSheet( const OUString& rDisplayName, SfxStyleSheetBasePool& rPool, SfxStyleFamily eFamily, sal_uInt16 nMask ); SdStyleSheet( const SdStyleSheet& ); - virtual bool SetParent (const String& rParentName); + virtual bool SetParent (const OUString& rParentName); virtual SfxItemSet& GetItemSet(); virtual bool IsUsed() const; virtual bool HasFollowSupport() const; virtual bool HasParentSupport() const; virtual bool HasClearParentSupport() const; - virtual bool SetName( const UniString& ); + virtual bool SetName( const OUString& ); virtual void SetHelpId( const OUString& r, sal_uLong nId ); void AdjustToFontHeight(SfxItemSet& rSet, sal_Bool bOnlyMissingItems = sal_True); diff --git a/sd/inc/undo/undomanager.hxx b/sd/inc/undo/undomanager.hxx index 14fa2d9811a4..0991c9fd55f9 100644 --- a/sd/inc/undo/undomanager.hxx +++ b/sd/inc/undo/undomanager.hxx @@ -33,7 +33,7 @@ public: virtual void EnterListAction(const OUString &rComment, const OUString& rRepeatComment, sal_uInt16 nId=0); - virtual void AddUndoAction( SfxUndoAction *pAction, sal_Bool bTryMerg=sal_False ); + virtual void AddUndoAction( SfxUndoAction *pAction, bool bTryMerg=false ); /** Set or reset the undo manager linked with the called undo manager. */ diff --git a/sd/source/core/stlfamily.cxx b/sd/source/core/stlfamily.cxx index a38791dbd7b5..d52930984e7e 100644 --- a/sd/source/core/stlfamily.cxx +++ b/sd/source/core/stlfamily.cxx @@ -67,11 +67,11 @@ PresStyleMap& SdStyleFamilyImpl::getStyleSheets() { maLayoutName = mxMasterPage->GetLayoutName(); - String aLayoutName( maLayoutName ); - const sal_uInt16 nLen = aLayoutName.Search(String( SD_LT_SEPARATOR ))+4; - aLayoutName.Erase( nLen ); + OUString aLayoutName( maLayoutName ); + const sal_uInt16 nLen = aLayoutName.indexOf(SD_LT_SEPARATOR ) + 4; + aLayoutName = aLayoutName.copy(0, nLen ); - if( (maStyleSheets.empty()) || !((*maStyleSheets.begin()).second->GetName().Equals( aLayoutName, 0, nLen )) ) + if( (maStyleSheets.empty()) || !(*maStyleSheets.begin()).second->GetName().startsWith( aLayoutName) ) { maStyleSheets.clear(); @@ -79,7 +79,7 @@ PresStyleMap& SdStyleFamilyImpl::getStyleSheets() for( SfxStyles::const_iterator iter( rStyles.begin() ); iter != rStyles.end(); ++iter ) { SdStyleSheet* pStyle = static_cast< SdStyleSheet* >( (*iter).get() ); - if( pStyle && (pStyle->GetFamily() == SD_STYLE_FAMILY_MASTERPAGE) && (pStyle->GetName().Equals( aLayoutName, 0, nLen )) ) + if( pStyle && (pStyle->GetFamily() == SD_STYLE_FAMILY_MASTERPAGE) && pStyle->GetName().startsWith(aLayoutName) ) maStyleSheets[ pStyle->GetApiName() ] = rtl::Reference< SdStyleSheet >( pStyle ); } } diff --git a/sd/source/core/stlpool.cxx b/sd/source/core/stlpool.cxx index a64ed0d776df..228eb25350b0 100644 --- a/sd/source/core/stlpool.cxx +++ b/sd/source/core/stlpool.cxx @@ -106,7 +106,7 @@ SdStyleSheetPool::~SdStyleSheetPool() // ---------------------------------------------------------- -SfxStyleSheetBase* SdStyleSheetPool::Create(const String& rName, SfxStyleFamily eFamily, sal_uInt16 _nMask ) +SfxStyleSheetBase* SdStyleSheetPool::Create(const OUString& rName, SfxStyleFamily eFamily, sal_uInt16 _nMask ) { return new SdStyleSheet(rName, *this, eFamily, _nMask); } @@ -695,7 +695,7 @@ void SdStyleSheetPool::CopyLayoutSheets(const String& rLayoutName, SdStyleSheetP if (!pSheet) break; - if (pSheet->GetParent().Len() == 0) + if (pSheet->GetParent().isEmpty()) pSheet->SetParent(pParent->GetName()); pParent = pSheet; @@ -760,16 +760,14 @@ void SdStyleSheetPool::CreateLayoutSheetNames(const String& rLayoutName, std::ve void SdStyleSheetPool::CreateLayoutSheetList(const String& rLayoutName, SdStyleSheetVector& rLayoutSheets ) { - String aLayoutNameWithSep(rLayoutName); - aLayoutNameWithSep.AppendAscii( SD_LT_SEPARATOR ); - sal_uInt16 nLen = aLayoutNameWithSep.Len(); + OUString aLayoutNameWithSep(rLayoutName + OUString(SD_LT_SEPARATOR )); SfxStyleSheetIterator aIter(this, SD_STYLE_FAMILY_MASTERPAGE); SfxStyleSheetBase* pSheet = aIter.First(); while (pSheet) { - if (pSheet->GetName().Match(aLayoutNameWithSep) == nLen) + if (pSheet->GetName().startsWith(aLayoutNameWithSep)) rLayoutSheets.push_back( SdStyleSheetRef( static_cast< SdStyleSheet* >( pSheet ) ) ); pSheet = aIter.Next(); } diff --git a/sd/source/core/stlsheet.cxx b/sd/source/core/stlsheet.cxx index 48d85e312c3c..10541d65450a 100644 --- a/sd/source/core/stlsheet.cxx +++ b/sd/source/core/stlsheet.cxx @@ -185,16 +185,16 @@ void SdStyleSheet::Store(SvStream& rOut) } -bool SdStyleSheet::SetParent(const String& rParentName) +bool SdStyleSheet::SetParent(const OUString& rParentName) { - bool bResult = sal_False; + bool bResult = false; if (SfxStyleSheet::SetParent(rParentName)) { // PseudoStyleSheets do not have their own ItemSets if (nFamily != SD_STYLE_FAMILY_PSEUDO) { - if( rParentName.Len() ) + if( !rParentName.isEmpty() ) { SfxStyleSheetBase* pStyle = pPool->Find(rParentName, nFamily); if (pStyle) @@ -422,36 +422,37 @@ SdStyleSheet* SdStyleSheet::GetRealStyleSheet() const /* now map from the name (specified for country language) to the internal name (independent of the country language) */ - String aInternalName; + OUString aInternalName; + OUString aStyleName(aName); - if (aName == String(SdResId(STR_PSEUDOSHEET_TITLE))) + if (aStyleName == OUString(SdResId(STR_PSEUDOSHEET_TITLE))) { - aInternalName = String(SdResId(STR_LAYOUT_TITLE)); + aInternalName = OUString(SdResId(STR_LAYOUT_TITLE)); } - else if (aName == String(SdResId(STR_PSEUDOSHEET_SUBTITLE))) + else if (aStyleName == OUString(SdResId(STR_PSEUDOSHEET_SUBTITLE))) { - aInternalName = String(SdResId(STR_LAYOUT_SUBTITLE)); + aInternalName = OUString(SdResId(STR_LAYOUT_SUBTITLE)); } - else if (aName == String(SdResId(STR_PSEUDOSHEET_BACKGROUND))) + else if (aStyleName == OUString(SdResId(STR_PSEUDOSHEET_BACKGROUND))) { - aInternalName = String(SdResId(STR_LAYOUT_BACKGROUND)); + aInternalName = OUString(SdResId(STR_LAYOUT_BACKGROUND)); } - else if (aName == String(SdResId(STR_PSEUDOSHEET_BACKGROUNDOBJECTS))) + else if (aStyleName == OUString(SdResId(STR_PSEUDOSHEET_BACKGROUNDOBJECTS))) { - aInternalName = String(SdResId(STR_LAYOUT_BACKGROUNDOBJECTS)); + aInternalName = OUString(SdResId(STR_LAYOUT_BACKGROUNDOBJECTS)); } - else if (aName == String(SdResId(STR_PSEUDOSHEET_NOTES))) + else if (aStyleName == OUString(SdResId(STR_PSEUDOSHEET_NOTES))) { - aInternalName = String(SdResId(STR_LAYOUT_NOTES)); + aInternalName = OUString(SdResId(STR_LAYOUT_NOTES)); } else { - String aOutlineStr(SdResId(STR_PSEUDOSHEET_OUTLINE)); - sal_uInt16 nPos = aName.Search(aOutlineStr); - if (nPos != STRING_NOTFOUND) + OUString aOutlineStr(SdResId(STR_PSEUDOSHEET_OUTLINE)); + sal_Int32 nPos = aStyleName.indexOf(aOutlineStr); + if (nPos >= 0) { - String aNumStr(aName.Copy(aOutlineStr.Len())); - aInternalName = String(SdResId(STR_LAYOUT_OUTLINE)); + String aNumStr(aStyleName.copy(aOutlineStr.getLength())); + aInternalName = OUString(SdResId(STR_LAYOUT_OUTLINE)); aInternalName += aNumStr; } } @@ -628,7 +629,7 @@ bool SdStyleSheet::HasClearParentSupport() const // -------------------------------------------------------------------- -bool SdStyleSheet::SetName( const UniString& rName ) +bool SdStyleSheet::SetName( const OUString& rName ) { return SfxStyleSheet::SetName( rName ); } @@ -962,7 +963,7 @@ OUString SAL_CALL SdStyleSheet::getParentStyle() throw(RuntimeException) SolarMutexGuard aGuard; throwIfDisposed(); - if( GetParent().Len() ) + if( !GetParent().isEmpty() ) { SdStyleSheet* pParentStyle = static_cast< SdStyleSheet* >( mxPool->Find( GetParent(), nFamily ) ); if( pParentStyle ) diff --git a/sd/source/core/undo/undomanager.cxx b/sd/source/core/undo/undomanager.cxx index a2fc65326672..f790de5c9eab 100644 --- a/sd/source/core/undo/undomanager.cxx +++ b/sd/source/core/undo/undomanager.cxx @@ -22,8 +22,8 @@ using namespace sd; UndoManager::UndoManager( sal_uInt16 nMaxUndoActionCount /* = 20 */ ) -: SdrUndoManager( nMaxUndoActionCount ) -, mpLinkedUndoManager(NULL) + : SdrUndoManager( nMaxUndoActionCount ) + , mpLinkedUndoManager(NULL) { } @@ -36,7 +36,7 @@ void UndoManager::EnterListAction(const OUString &rComment, const OUString& rRep } } -void UndoManager::AddUndoAction( SfxUndoAction *pAction, sal_Bool bTryMerg /* = sal_False */ ) +void UndoManager::AddUndoAction( SfxUndoAction *pAction, bool bTryMerg /* = sal_False */ ) { if( !IsDoing() ) { diff --git a/sd/source/ui/func/fuhhconv.cxx b/sd/source/ui/func/fuhhconv.cxx index 31495124840c..bc73ef62ad0a 100644 --- a/sd/source/ui/func/fuhhconv.cxx +++ b/sd/source/ui/func/fuhhconv.cxx @@ -168,7 +168,7 @@ void FuHangulHanjaConversion::ConvertStyles( sal_Int16 nTargetLanguage, const Fo { SfxItemSet& rSet = pStyle->GetItemSet(); - const bool bHasParent = pStyle->GetParent().Len() != 0; + const bool bHasParent = !pStyle->GetParent().isEmpty(); if( !bHasParent || rSet.GetItemState( EE_CHAR_LANGUAGE_CJK, sal_False ) == SFX_ITEM_SET ) rSet.Put( SvxLanguageItem( nTargetLanguage, EE_CHAR_LANGUAGE_CJK ) ); diff --git a/sd/source/ui/func/sdundogr.cxx b/sd/source/ui/func/sdundogr.cxx index 013f538a1329..ed3217f38c67 100644 --- a/sd/source/ui/func/sdundogr.cxx +++ b/sd/source/ui/func/sdundogr.cxx @@ -32,9 +32,9 @@ SdUndoGroup::~SdUndoGroup() aCtn.clear(); } -sal_Bool SdUndoGroup::Merge( SfxUndoAction* pNextAction ) +bool SdUndoGroup::Merge( SfxUndoAction* pNextAction ) { - sal_Bool bRet = sal_False; + bool bRet = false; if( pNextAction && pNextAction->ISA( SdUndoAction ) ) { @@ -43,7 +43,7 @@ sal_Bool SdUndoGroup::Merge( SfxUndoAction* pNextAction ) if( pClone ) { AddAction( pClone ); - bRet = sal_True; + bRet = true; } } diff --git a/sd/source/ui/inc/sdundogr.hxx b/sd/source/ui/inc/sdundogr.hxx index e12d433580d6..253ba39ed0ac 100644 --- a/sd/source/ui/inc/sdundogr.hxx +++ b/sd/source/ui/inc/sdundogr.hxx @@ -34,13 +34,13 @@ public: aCtn() {} virtual ~SdUndoGroup(); - virtual sal_Bool Merge( SfxUndoAction* pNextAction ); + virtual bool Merge( SfxUndoAction* pNextAction ); virtual void Undo(); virtual void Redo(); void AddAction(SdUndoAction* pAction); - sal_uLong Count() const { return aCtn.size(); } + sal_uLong Count() const { return aCtn.size(); } }; |