diff options
135 files changed, 1731 insertions, 1791 deletions
diff --git a/chart2/source/tools/NumberFormatterWrapper.cxx b/chart2/source/tools/NumberFormatterWrapper.cxx index a1080b34c792..9a7db0691e5d 100644 --- a/chart2/source/tools/NumberFormatterWrapper.cxx +++ b/chart2/source/tools/NumberFormatterWrapper.cxx @@ -99,10 +99,10 @@ Date NumberFormatterWrapper::getNullDate() const return aRet; } -OUString NumberFormatterWrapper::getFormattedString( - sal_Int32 nNumberFormatKey, double fValue, sal_Int32& rLabelColor, bool& rbColorChanged ) const +OUString NumberFormatterWrapper::getFormattedString( sal_Int32 nNumberFormatKey, double fValue, + sal_Int32& rLabelColor, bool& rbColorChanged ) const { - String aText; + OUString aText; Color* pTextColor = NULL; if( !m_pNumberFormatter ) { @@ -124,13 +124,11 @@ OUString NumberFormatterWrapper::getFormattedString( m_aNullDate >>= aNewNullDate; m_pNumberFormatter->ChangeNullDate(aNewNullDate.Day,aNewNullDate.Month,aNewNullDate.Year); } - m_pNumberFormatter->GetOutputString( - fValue, nNumberFormatKey, aText, &pTextColor); + m_pNumberFormatter->GetOutputString(fValue, nNumberFormatKey, aText, &pTextColor); if ( m_aNullDate.hasValue() ) { m_pNumberFormatter->ChangeNullDate(nDay,nMonth,nYear); } - OUString aRet( aText ); if(pTextColor) { @@ -140,7 +138,7 @@ OUString NumberFormatterWrapper::getFormattedString( else rbColorChanged = false; - return aRet; + return aText; } //............................................................................. diff --git a/cui/source/options/optupdt.cxx b/cui/source/options/optupdt.cxx index 70df01235a72..f23f94b372a2 100644 --- a/cui/source/options/optupdt.cxx +++ b/cui/source/options/optupdt.cxx @@ -120,17 +120,14 @@ void SvxOnlineUpdateTabPage::UpdateLastCheckedText() LanguageType eUILang = Application::GetSettings().GetUILanguageTag().getLanguageType(); SvNumberFormatter *pNumberFormatter = new SvNumberFormatter( ::comphelper::getProcessComponentContext(), eUILang ); - String aTmpStr; Color* pColor = NULL; Date* pNullDate = pNumberFormatter->GetNullDate(); sal_uInt32 nFormat = pNumberFormatter->GetStandardFormat( NUMBERFORMAT_DATE, eUILang ); - pNumberFormatter->GetOutputString( aDate - *pNullDate, nFormat, aTmpStr, &pColor ); - aDateStr = aTmpStr; + pNumberFormatter->GetOutputString( aDate - *pNullDate, nFormat, aDateStr, &pColor ); nFormat = pNumberFormatter->GetStandardFormat( NUMBERFORMAT_TIME, eUILang ); - pNumberFormatter->GetOutputString( aTime.GetTimeInDays(), nFormat, aTmpStr, &pColor ); - aTimeStr = aTmpStr; + pNumberFormatter->GetOutputString( aTime.GetTimeInDays(), nFormat, aTimeStr, &pColor ); delete pColor; delete pNumberFormatter; diff --git a/editeng/source/editeng/editundo.cxx b/editeng/source/editeng/editundo.cxx index dfc8df189530..1ce72741152b 100644 --- a/editeng/source/editeng/editundo.cxx +++ b/editeng/source/editeng/editundo.cxx @@ -48,10 +48,10 @@ void EditUndoManager::SetEditEngine(EditEngine* pNew) mpEditEngine = pNew; } -sal_Bool EditUndoManager::Undo() +bool EditUndoManager::Undo() { if ( !mpEditEngine || GetUndoActionCount() == 0 ) - return sal_False; + return false; DBG_ASSERT( mpEditEngine->GetActiveView(), "Active View?" ); @@ -62,14 +62,14 @@ sal_Bool EditUndoManager::Undo() else { OSL_FAIL("Undo in engine is not possible without a View! "); - return sal_False; + return false; } } mpEditEngine->GetActiveView()->GetImpEditView()->DrawSelection(); // Remove the old selection mpEditEngine->SetUndoMode( sal_True ); - sal_Bool bDone = SfxUndoManager::Undo(); + bool bDone = SfxUndoManager::Undo(); mpEditEngine->SetUndoMode( sal_False ); EditSelection aNewSel( mpEditEngine->GetActiveView()->GetImpEditView()->GetEditSelection() ); @@ -83,10 +83,10 @@ sal_Bool EditUndoManager::Undo() return bDone; } -sal_Bool EditUndoManager::Redo() +bool EditUndoManager::Redo() { if ( !mpEditEngine || GetRedoActionCount() == 0 ) - return sal_False; + return false; DBG_ASSERT( mpEditEngine->GetActiveView(), "Active View?" ); @@ -97,14 +97,14 @@ sal_Bool EditUndoManager::Redo() else { OSL_FAIL( "Redo in Engine ohne View nicht moeglich!" ); - return sal_False; + return false; } } mpEditEngine->GetActiveView()->GetImpEditView()->DrawSelection(); // Remove the old selection mpEditEngine->SetUndoMode( sal_True ); - sal_Bool bDone = SfxUndoManager::Redo(); + bool bDone = SfxUndoManager::Redo(); mpEditEngine->SetUndoMode( sal_False ); EditSelection aNewSel( mpEditEngine->GetActiveView()->GetImpEditView()->GetEditSelection() ); @@ -138,9 +138,9 @@ sal_uInt16 EditUndo::GetId() const return nId; } -sal_Bool EditUndo::CanRepeat(SfxRepeatTarget&) const +bool EditUndo::CanRepeat(SfxRepeatTarget&) const { - return sal_False; + return false; } OUString EditUndo::GetComment() const @@ -320,21 +320,21 @@ void EditUndoInsertChars::Redo() GetEditEngine()->GetActiveView()->GetImpEditView()->SetEditSelection( EditSelection( aPaM, aNewPaM ) ); } -sal_Bool EditUndoInsertChars::Merge( SfxUndoAction* pNextAction ) +bool EditUndoInsertChars::Merge( SfxUndoAction* pNextAction ) { EditUndoInsertChars* pNext = dynamic_cast<EditUndoInsertChars*>(pNextAction); if (!pNext) return false; if ( aEPaM.nPara != pNext->aEPaM.nPara ) - return sal_False; + return false; if ( ( aEPaM.nIndex + aText.Len() ) == pNext->aEPaM.nIndex ) { aText += pNext->aText; - return sal_True; + return true; } - return sal_False; + return false; } EditUndoRemoveChars::EditUndoRemoveChars( diff --git a/editeng/source/editeng/editundo.hxx b/editeng/source/editeng/editundo.hxx index 834a9c4b4554..7f7d4e3114f7 100644 --- a/editeng/source/editeng/editundo.hxx +++ b/editeng/source/editeng/editundo.hxx @@ -110,7 +110,7 @@ public: virtual void Undo(); virtual void Redo(); - virtual sal_Bool Merge( SfxUndoAction *pNextAction ); + virtual bool Merge( SfxUndoAction *pNextAction ); }; // ----------------------------------------------------------------------- diff --git a/editeng/source/editeng/impedit4.cxx b/editeng/source/editeng/impedit4.cxx index dedd6b2c1497..0252b8d78e3e 100644 --- a/editeng/source/editeng/impedit4.cxx +++ b/editeng/source/editeng/impedit4.cxx @@ -492,7 +492,7 @@ sal_uInt32 ImpEditEngine::WriteRTF( SvStream& rOutput, EditSelection aSel ) } // Parent ... (only if necessary) - if ( pStyle->GetParent().Len() && ( pStyle->GetParent() != pStyle->GetName() ) ) + if ( !pStyle->GetParent().isEmpty() && ( pStyle->GetParent() != pStyle->GetName() ) ) { SfxStyleSheet* pParent = (SfxStyleSheet*)GetStyleSheetPool()->Find( pStyle->GetParent(), pStyle->GetFamily() ); DBG_ASSERT( pParent, "Parent not found!" ); @@ -503,7 +503,7 @@ sal_uInt32 ImpEditEngine::WriteRTF( SvStream& rOutput, EditSelection aSel ) // Next Style ... (more) SfxStyleSheet* pNext = pStyle; - if ( pStyle->GetFollow().Len() && ( pStyle->GetFollow() != pStyle->GetName() ) ) + if ( !pStyle->GetFollow().isEmpty() && ( pStyle->GetFollow() != pStyle->GetName() ) ) pNext = (SfxStyleSheet*)GetStyleSheetPool()->Find( pStyle->GetFollow(), pStyle->GetFamily() ); DBG_ASSERT( pNext, "Next ot found!" ); diff --git a/framework/source/fwe/helper/undomanagerhelper.cxx b/framework/source/fwe/helper/undomanagerhelper.cxx index 40d09c187181..72e0f9b66a31 100644 --- a/framework/source/fwe/helper/undomanagerhelper.cxx +++ b/framework/source/fwe/helper/undomanagerhelper.cxx @@ -76,10 +76,10 @@ namespace framework ); virtual ~UndoActionWrapper(); - virtual OUString GetComment() const; + virtual OUString GetComment() const; virtual void Undo(); virtual void Redo(); - virtual sal_Bool CanRepeat(SfxRepeatTarget&) const; + virtual bool CanRepeat(SfxRepeatTarget&) const; private: const Reference< XUndoAction > m_xUndoAction; @@ -136,7 +136,7 @@ namespace framework } //------------------------------------------------------------------------------------------------------------------ - sal_Bool UndoActionWrapper::CanRepeat(SfxRepeatTarget&) const + bool UndoActionWrapper::CanRepeat(SfxRepeatTarget&) const { return sal_False; } @@ -254,14 +254,14 @@ namespace framework } // SfxUndoListener - virtual void actionUndone( const String& i_actionComment ); - virtual void actionRedone( const String& i_actionComment ); - virtual void undoActionAdded( const String& i_actionComment ); + virtual void actionUndone( const OUString& i_actionComment ); + virtual void actionRedone( const OUString& i_actionComment ); + virtual void undoActionAdded( const OUString& i_actionComment ); virtual void cleared(); virtual void clearedRedo(); virtual void resetAll(); - virtual void listActionEntered( const String& i_comment ); - virtual void listActionLeft( const String& i_comment ); + virtual void listActionEntered( const OUString& i_comment ); + virtual void listActionLeft( const OUString& i_comment ); virtual void listActionLeftAndMerged(); virtual void listActionCancelled(); virtual void undoManagerDying(); @@ -800,7 +800,7 @@ namespace framework } //------------------------------------------------------------------------------------------------------------------ - void UndoManagerHelper_Impl::actionUndone( const String& i_actionComment ) + void UndoManagerHelper_Impl::actionUndone( const OUString& i_actionComment ) { UndoManagerEvent aEvent; aEvent.Source = getXUndoManager(); @@ -811,7 +811,7 @@ namespace framework } //------------------------------------------------------------------------------------------------------------------ - void UndoManagerHelper_Impl::actionRedone( const String& i_actionComment ) + void UndoManagerHelper_Impl::actionRedone( const OUString& i_actionComment ) { UndoManagerEvent aEvent; aEvent.Source = getXUndoManager(); @@ -822,7 +822,7 @@ namespace framework } //------------------------------------------------------------------------------------------------------------------ - void UndoManagerHelper_Impl::undoActionAdded( const String& i_actionComment ) + void UndoManagerHelper_Impl::undoActionAdded( const OUString& i_actionComment ) { if ( m_bAPIActionRunning ) return; @@ -858,7 +858,7 @@ namespace framework } //------------------------------------------------------------------------------------------------------------------ - void UndoManagerHelper_Impl::listActionEntered( const String& i_comment ) + void UndoManagerHelper_Impl::listActionEntered( const OUString& i_comment ) { #if OSL_DEBUG_LEVEL > 0 m_aContextAPIFlags.push( m_bAPIActionRunning ); @@ -871,7 +871,7 @@ namespace framework } //------------------------------------------------------------------------------------------------------------------ - void UndoManagerHelper_Impl::listActionLeft( const String& i_comment ) + void UndoManagerHelper_Impl::listActionLeft( const OUString& i_comment ) { #if OSL_DEBUG_LEVEL > 0 const bool bCurrentContextIsAPIContext = m_aContextAPIFlags.top(); diff --git a/include/editeng/editund2.hxx b/include/editeng/editund2.hxx index b8106288f97e..3a3578b06cf3 100644 --- a/include/editeng/editund2.hxx +++ b/include/editeng/editund2.hxx @@ -36,8 +36,8 @@ class EDITENG_DLLPUBLIC EditUndoManager : public SfxUndoManager public: EditUndoManager(sal_uInt16 nMaxUndoActionCount = 20); - virtual sal_Bool Undo(); - virtual sal_Bool Redo(); + virtual bool Undo(); + virtual bool Redo(); }; // ----------------------------------------------------------------------- @@ -58,7 +58,7 @@ public: virtual void Undo() = 0; virtual void Redo() = 0; - virtual sal_Bool CanRepeat(SfxRepeatTarget&) const; + virtual bool CanRepeat(SfxRepeatTarget&) const; virtual OUString GetComment() const; virtual sal_uInt16 GetId() const; }; diff --git a/include/sfx2/app.hxx b/include/sfx2/app.hxx index 858140d2b8be..d202219d917b 100644 --- a/include/sfx2/app.hxx +++ b/include/sfx2/app.hxx @@ -152,7 +152,7 @@ public: // DDE #if defined( WNT ) - long DdeExecute( const String& rCmd ); + long DdeExecute( const OUString& rCmd ); #endif sal_Bool InitializeDde(); const DdeService* GetDdeService() const; diff --git a/include/sfx2/objsh.hxx b/include/sfx2/objsh.hxx index 64e738fb1b11..4fbda631db9d 100644 --- a/include/sfx2/objsh.hxx +++ b/include/sfx2/objsh.hxx @@ -471,14 +471,14 @@ public: void InvalidateName(); // Re-set to unnamed // DDE-Interface - virtual long DdeExecute( const String& rCmd ); - virtual long DdeGetData( const String& rItem, - const String& rMimeType, - ::com::sun::star::uno::Any & rValue ); - virtual long DdeSetData( const String& rItem, - const String& rMimeType, - const ::com::sun::star::uno::Any & rValue ); - virtual ::sfx2::SvLinkSource* DdeCreateLinkSource( const String& rItem ); + virtual long DdeExecute( const OUString& rCmd ); + virtual long DdeGetData( const OUString& rItem, + const OUString& rMimeType, + ::com::sun::star::uno::Any & rValue ); + virtual long DdeSetData( const OUString& rItem, + const OUString& rMimeType, + const ::com::sun::star::uno::Any & rValue ); + virtual ::sfx2::SvLinkSource* DdeCreateLinkSource( const OUString& rItem ); virtual void ReconnectDdeLink(SfxObjectShell& rServer); static void ReconnectDdeLinks(SfxObjectShell& rServer); diff --git a/include/sfx2/viewfrm.hxx b/include/sfx2/viewfrm.hxx index a81c20c83041..7c92eb49c9ce 100644 --- a/include/sfx2/viewfrm.hxx +++ b/include/sfx2/viewfrm.hxx @@ -139,14 +139,14 @@ public: virtual void Deactivate( sal_Bool bUI ); // DDE-Interface - virtual long DdeExecute( const String& rCmd ); - virtual long DdeGetData( const String& rItem, - const String& rMimeType, + virtual long DdeExecute( const OUString& rCmd ); + virtual long DdeGetData( const OUString& rItem, + const OUString& rMimeType, ::com::sun::star::uno::Any & rValue ); - virtual long DdeSetData( const String& rItem, - const String& rMimeType, - const ::com::sun::star::uno::Any & rValue ); - virtual ::sfx2::SvLinkSource* DdeCreateLinkSource( const String& rItem ); + virtual long DdeSetData( const OUString& rItem, + const OUString& rMimeType, + const ::com::sun::star::uno::Any & rValue ); + virtual ::sfx2::SvLinkSource* DdeCreateLinkSource( const OUString& rItem ); void UpdateTitle(); diff --git a/include/svl/inethist.hxx b/include/svl/inethist.hxx index 4ee592faad16..bdf69260ff21 100644 --- a/include/svl/inethist.hxx +++ b/include/svl/inethist.hxx @@ -21,7 +21,6 @@ #include "svl/svldllapi.h" #include <tools/solar.h> -#include <tools/string.hxx> #include <tools/urlobj.hxx> #include <svl/brdcst.hxx> #include <svl/hint.hxx> @@ -86,7 +85,7 @@ public: return sal_False; } - sal_Bool QueryUrl (const String &rUrl) + sal_Bool QueryUrl (const OUString &rUrl) { INetProtocol eProto = INetURLObject::CompareProtocolScheme (rUrl); @@ -104,7 +103,7 @@ public: PutUrl_Impl (rUrl); } - void PutUrl (const String &rUrl) + void PutUrl (const OUString &rUrl) { INetProtocol eProto = INetURLObject::CompareProtocolScheme (rUrl); diff --git a/include/svl/itemprop.hxx b/include/svl/itemprop.hxx index c1b7ed68b400..46280d7fa34e 100644 --- a/include/svl/itemprop.hxx +++ b/include/svl/itemprop.hxx @@ -21,7 +21,6 @@ #include "svl/svldllapi.h" #include <tools/solar.h> -#include <tools/string.hxx> #include <svl/itemset.hxx> #include <cppuhelper/implbase1.hxx> #include <com/sun/star/beans/XPropertySetInfo.hpp> @@ -35,47 +34,55 @@ struct SfxItemPropertyMapEntry { const char* pName; - sal_uInt16 nNameLen; - sal_uInt16 nWID; + sal_uInt16 nNameLen; + sal_uInt16 nWID; const com::sun::star::uno::Type* pType; long nFlags; - sal_uInt8 nMemberId; + sal_uInt8 nMemberId; }; struct SfxItemPropertySimpleEntry { - sal_uInt16 nWID; + sal_uInt16 nWID; const com::sun::star::uno::Type* pType; long nFlags; - sal_uInt8 nMemberId; + sal_uInt8 nMemberId; - SfxItemPropertySimpleEntry() : - nWID( 0 ), - pType( 0 ), - nFlags( 0 ), - nMemberId( 0 ){} + SfxItemPropertySimpleEntry() + : nWID( 0 ) + , pType( 0 ) + , nFlags( 0 ) + , nMemberId( 0 ) + { + } SfxItemPropertySimpleEntry(sal_uInt16 _nWID, const com::sun::star::uno::Type* _pType, - long _nFlags, sal_uInt8 _nMemberId) : - nWID( _nWID ), - pType( _pType ), - nFlags( _nFlags ), - nMemberId( _nMemberId ){} - - SfxItemPropertySimpleEntry( const SfxItemPropertyMapEntry* pMapEntry ) : - nWID( pMapEntry->nWID ), - pType( pMapEntry->pType ), - nFlags( pMapEntry->nFlags ), - nMemberId( pMapEntry->nMemberId ){} + long _nFlags, sal_uInt8 _nMemberId) + : nWID( _nWID ) + , pType( _pType ) + , nFlags( _nFlags ) + , nMemberId( _nMemberId ) + { + } + + SfxItemPropertySimpleEntry( const SfxItemPropertyMapEntry* pMapEntry ) + : nWID( pMapEntry->nWID ) + , pType( pMapEntry->pType ) + , nFlags( pMapEntry->nFlags ) + , nMemberId( pMapEntry->nMemberId ) + { + } }; struct SfxItemPropertyNamedEntry : public SfxItemPropertySimpleEntry { OUString sName; - SfxItemPropertyNamedEntry( const String& rName, const SfxItemPropertySimpleEntry& rSimpleEntry) : - SfxItemPropertySimpleEntry( rSimpleEntry ), - sName( rName ){} + SfxItemPropertyNamedEntry( const OUString& rName, const SfxItemPropertySimpleEntry& rSimpleEntry) + : SfxItemPropertySimpleEntry( rSimpleEntry ) + , sName( rName ) +{ +} }; typedef std::vector< SfxItemPropertyNamedEntry > PropertyEntryVector_t; @@ -92,7 +99,7 @@ public: com::sun::star::uno::Sequence< com::sun::star::beans::Property > getProperties() const; com::sun::star::beans::Property getPropertyByName( const OUString rName ) const throw( ::com::sun::star::beans::UnknownPropertyException ); - sal_Bool hasPropertyByName( const OUString& rName ) const; + bool hasPropertyByName( const OUString& rName ) const; void mergeProperties( const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::Property >& rPropSeq ); PropertyEntryVector_t getPropertyEntries() const; diff --git a/include/svl/ondemand.hxx b/include/svl/ondemand.hxx index b3a2c42e11e6..d61b31f570d2 100644 --- a/include/svl/ondemand.hxx +++ b/include/svl/ondemand.hxx @@ -307,7 +307,7 @@ public: return pPtr; } - const ::utl::TransliterationWrapper* getForModule( const String& rModule, LanguageType eLang ) const + const ::utl::TransliterationWrapper* getForModule( const OUString& rModule, LanguageType eLang ) const { if ( !pPtr ) pPtr = new ::utl::TransliterationWrapper( m_xContext, nType ); diff --git a/include/svl/srchitem.hxx b/include/svl/srchitem.hxx index 5d4413ea8cab..3fb8949e2f23 100644 --- a/include/svl/srchitem.hxx +++ b/include/svl/srchitem.hxx @@ -27,7 +27,6 @@ #include <com/sun/star/i18n/TransliterationModules.hpp> #include <unotools/configitem.hxx> #include <rsc/rscsfx.hxx> -#include <tools/string.hxx> #include <svl/poolitem.hxx> #include <svl/srchdefs.hxx> @@ -98,11 +97,11 @@ public: sal_uInt16 GetCommand() const { return nCommand; } void SetCommand(sal_uInt16 nNewCommand) { nCommand = nNewCommand; } - inline const String GetSearchString() const; - inline void SetSearchString(const String& rNewString); + inline const OUString GetSearchString() const; + inline void SetSearchString(const OUString& rNewString); - inline const String GetReplaceString() const; - inline void SetReplaceString(const String& rNewString); + inline const OUString GetReplaceString() const; + inline void SetReplaceString(const OUString& rNewString); inline bool GetWordOnly() const; void SetWordOnly(bool bNewWordOnly); @@ -176,22 +175,22 @@ public: inline void SetUseAsianOptions( bool bVal ) { bAsianOptions = bVal; } }; -const String SvxSearchItem::GetSearchString() const +const OUString SvxSearchItem::GetSearchString() const { return aSearchOpt.searchString; } -void SvxSearchItem::SetSearchString(const String& rNewString) +void SvxSearchItem::SetSearchString(const OUString& rNewString) { aSearchOpt.searchString = rNewString; } -const String SvxSearchItem::GetReplaceString() const +const OUString SvxSearchItem::GetReplaceString() const { return aSearchOpt.replaceString; } -void SvxSearchItem::SetReplaceString(const String& rNewString) +void SvxSearchItem::SetReplaceString(const OUString& rNewString) { aSearchOpt.replaceString = rNewString; } diff --git a/include/svl/style.hxx b/include/svl/style.hxx index af58cbc44327..c54313ec96a2 100644 --- a/include/svl/style.hxx +++ b/include/svl/style.hxx @@ -29,7 +29,6 @@ #include <cppuhelper/implbase2.hxx> #include "svl/svldllapi.h" #include <rsc/rscsfx.hxx> -#include <tools/string.hxx> #include <svl/hint.hxx> #include <svl/lstner.hxx> #include <svl/brdcst.hxx> @@ -82,7 +81,7 @@ protected: SfxStyleSheetBasePool* pPool; // zugehoeriger Pool SfxStyleFamily nFamily; // Familie - UniString aName, aParent, aFollow; + OUString aName, aParent, aFollow; OUString maDisplayName; OUString aHelpFile; // Name der Hilfedatei SfxItemSet* pSet; // ItemSet @@ -93,7 +92,7 @@ protected: bool bMySet; // sal_True: Set loeschen im dtor bool bHidden; - SfxStyleSheetBase( const UniString&, SfxStyleSheetBasePool*, SfxStyleFamily eFam, sal_uInt16 mask ); + SfxStyleSheetBase( const OUString&, SfxStyleSheetBasePool*, SfxStyleFamily eFam, sal_uInt16 mask ); SfxStyleSheetBase( const SfxStyleSheetBase& ); virtual ~SfxStyleSheetBase(); virtual void Load( SvStream&, sal_uInt16 ); @@ -103,10 +102,10 @@ public: TYPEINFO(); // returns the internal name of this style - virtual const UniString& GetName() const; + virtual const OUString& GetName() const; // sets the internal name of this style - virtual bool SetName( const UniString& ); + virtual bool SetName( const OUString& ); /** returns the display name of this style, it is used at the user interface. If the display name is empty, this method returns the internal name. */ @@ -115,18 +114,18 @@ public: // sets the display name of this style virtual void SetDisplayName( const OUString& ); - virtual const UniString& GetParent() const; - virtual bool SetParent( const UniString& ); - virtual const UniString& GetFollow() const; - virtual bool SetFollow( const UniString& ); + virtual const OUString& GetParent() const; + virtual bool SetParent( const OUString& ); + virtual const OUString& GetFollow() const; + virtual bool SetFollow( const OUString& ); virtual bool HasFollowSupport() const; // Default true virtual bool HasParentSupport() const; // Default true virtual bool HasClearParentSupport() const; // Default false virtual bool IsUsed() const; // Default true // Default aus dem Itemset; entweder dem uebergebenen // oder aus dem per GetItemSet() zurueckgelieferten Set - virtual UniString GetDescription(); - virtual UniString GetDescription( SfxMapUnit eMetric ); + virtual OUString GetDescription(); + virtual OUString GetDescription( SfxMapUnit eMetric ); SfxStyleSheetBasePool& GetPool() { return *pPool; } SfxStyleFamily GetFamily() const { return nFamily; } @@ -207,15 +206,15 @@ friend class SfxStyleSheetBase; private: SVL_DLLPRIVATE SfxStyleSheetIterator& GetIterator_Impl(); protected: - String aAppName; + OUString aAppName; SfxItemPool& rPool; SfxStyles aStyles; SfxStyleFamily nSearchFamily; - sal_uInt16 nMask; + sal_uInt16 nMask; SfxStyleSheetBase& Add( SfxStyleSheetBase& ); - void ChangeParent( const UniString&, const UniString&, bool bVirtual = true ); - virtual SfxStyleSheetBase* Create( const UniString&, SfxStyleFamily, sal_uInt16 ); + void ChangeParent( const OUString&, const OUString&, bool bVirtual = true ); + virtual SfxStyleSheetBase* Create( const OUString&, SfxStyleFamily, sal_uInt16 ); virtual SfxStyleSheetBase* Create( const SfxStyleSheetBase& ); virtual ~SfxStyleSheetBasePool(); @@ -224,7 +223,7 @@ public: SfxStyleSheetBasePool( SfxItemPool& ); SfxStyleSheetBasePool( const SfxStyleSheetBasePool& ); - const String& GetAppName() const { return aAppName; } + const OUString& GetAppName() const { return aAppName; } SfxItemPool& GetPool(); const SfxItemPool& GetPool() const; @@ -233,7 +232,7 @@ public: virtual sal_uInt16 Count(); virtual SfxStyleSheetBase* operator[](sal_uInt16 nIdx); - virtual SfxStyleSheetBase& Make(const UniString&, + virtual SfxStyleSheetBase& Make(const OUString&, SfxStyleFamily eFam, sal_uInt16 nMask = SFXSTYLEBIT_ALL , sal_uInt16 nPos = 0xffff); @@ -252,13 +251,13 @@ public: const SfxStyles& GetStyles(); virtual SfxStyleSheetBase* First(); virtual SfxStyleSheetBase* Next(); - virtual SfxStyleSheetBase* Find( const UniString&, SfxStyleFamily eFam, sal_uInt16 n=SFXSTYLEBIT_ALL ); + virtual SfxStyleSheetBase* Find( const OUString&, SfxStyleFamily eFam, sal_uInt16 n=SFXSTYLEBIT_ALL ); virtual bool SetParent(SfxStyleFamily eFam, - const UniString &rStyle, - const UniString &rParent); + const OUString &rStyle, + const OUString &rParent); - SfxStyleSheetBase* Find(const UniString& rStr) + SfxStyleSheetBase* Find(const OUString& rStr) { return Find(rStr, nSearchFamily, nMask); } void SetSearchMask(SfxStyleFamily eFam, sal_uInt16 n=SFXSTYLEBIT_ALL ); @@ -274,19 +273,18 @@ class SVL_DLLPUBLIC SfxStyleSheet: public SfxStyleSheetBase, public: TYPEINFO(); - SfxStyleSheet( const UniString&, const SfxStyleSheetBasePool&, SfxStyleFamily, sal_uInt16 ); + SfxStyleSheet( const OUString&, const SfxStyleSheetBasePool&, SfxStyleFamily, sal_uInt16 ); SfxStyleSheet( const SfxStyleSheet& ); virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ); virtual bool isUsedByModel() const; - virtual bool SetParent( const UniString& ); + virtual bool SetParent( const OUString& ); protected: SfxStyleSheet() // do not use! needed by MSVC at compile time to satisfy ImplInheritanceHelper2 - : SfxStyleSheetBase(OUString("dummy"), - NULL, SFX_STYLE_FAMILY_ALL, 0) + : SfxStyleSheetBase(OUString("dummy"), NULL, SFX_STYLE_FAMILY_ALL, 0) { assert(false); } @@ -299,7 +297,7 @@ class SVL_DLLPUBLIC SfxStyleSheetPool: public SfxStyleSheetBasePool { protected: using SfxStyleSheetBasePool::Create; - virtual SfxStyleSheetBase* Create(const UniString&, SfxStyleFamily, sal_uInt16 mask); + virtual SfxStyleSheetBase* Create(const OUString&, SfxStyleFamily, sal_uInt16 mask); virtual SfxStyleSheetBase* Create(const SfxStyleSheet &); public: @@ -354,21 +352,20 @@ public: class SVL_DLLPUBLIC SfxStyleSheetHintExtended: public SfxStyleSheetHint { - String aName; + OUString aName; public: TYPEINFO(); - SfxStyleSheetHintExtended( - sal_uInt16, const String& rOld, - SfxStyleSheetBase& ); - const String& GetOldName() { return aName; } + SfxStyleSheetHintExtended( sal_uInt16, const OUString& rOld, + SfxStyleSheetBase& ); + const OUString& GetOldName() { return aName; } }; class SVL_DLLPUBLIC SfxUnoStyleSheet : public ::cppu::ImplInheritanceHelper2< SfxStyleSheet, ::com::sun::star::style::XStyle, ::com::sun::star::lang::XUnoTunnel > { public: - SfxUnoStyleSheet( const UniString& _rName, const SfxStyleSheetBasePool& _rPool, SfxStyleFamily _eFamily, sal_uInt16 _nMaske ); + SfxUnoStyleSheet( const OUString& _rName, const SfxStyleSheetBasePool& _rPool, SfxStyleFamily _eFamily, sal_uInt16 _nMaske ); static SfxUnoStyleSheet* getUnoStyleSheet( const ::com::sun::star::uno::Reference< ::com::sun::star::style::XStyle >& xStyle ); diff --git a/include/svl/svdde.hxx b/include/svl/svdde.hxx index 0a1d22bd7de1..7f5e7135f11d 100644 --- a/include/svl/svdde.hxx +++ b/include/svl/svdde.hxx @@ -22,7 +22,7 @@ #include "svl/svldllapi.h" #include <sot/exchange.hxx> -#include <tools/string.hxx> +#include <tools/solar.h> #include <tools/link.hxx> #include <vector> @@ -67,7 +67,7 @@ class SVL_DLLPUBLIC DdeData public: DdeData(); DdeData( SAL_UNUSED_PARAMETER const void*, SAL_UNUSED_PARAMETER long, SAL_UNUSED_PARAMETER sal_uLong = FORMAT_STRING ); - DdeData( SAL_UNUSED_PARAMETER const String& ); + DdeData( SAL_UNUSED_PARAMETER const OUString& ); DdeData( const DdeData& ); ~DdeData(); @@ -90,7 +90,7 @@ class SVL_DLLPUBLIC DdeTransaction { public: virtual void Data( const DdeData* ); - virtual void Done( sal_Bool bDataValid ); + virtual void Done( bool bDataValid ); protected: DdeConnection& rDde; DdeData aDdeData; @@ -102,7 +102,7 @@ protected: Link aDone; bool bBusy; - DdeTransaction( DdeConnection&, SAL_UNUSED_PARAMETER const String&, SAL_UNUSED_PARAMETER long = 0 ); + DdeTransaction( DdeConnection&, SAL_UNUSED_PARAMETER const OUString&, SAL_UNUSED_PARAMETER long = 0 ); public: virtual ~DdeTransaction(); @@ -141,7 +141,7 @@ class SVL_DLLPUBLIC DdeLink : public DdeTransaction Link aNotify; public: - DdeLink( DdeConnection&, const String&, long = 0 ); + DdeLink( DdeConnection&, const OUString&, long = 0 ); virtual ~DdeLink(); void SetNotifyHdl( const Link& rLink ) { aNotify = rLink; } @@ -156,7 +156,7 @@ public: class SVL_DLLPUBLIC DdeWarmLink : public DdeLink { public: - DdeWarmLink( DdeConnection&, const String&, long = 0 ); + DdeWarmLink( DdeConnection&, const OUString&, long = 0 ); }; // -------------- @@ -166,7 +166,7 @@ public: class SVL_DLLPUBLIC DdeHotLink : public DdeLink { public: - DdeHotLink( DdeConnection&, const String&, long = 0 ); + DdeHotLink( DdeConnection&, const OUString&, long = 0 ); }; // -------------- @@ -176,7 +176,7 @@ public: class SVL_DLLPUBLIC DdeRequest : public DdeTransaction { public: - DdeRequest( DdeConnection&, const String&, long = 0 ); + DdeRequest( DdeConnection&, const OUString&, long = 0 ); }; // ----------- @@ -186,10 +186,10 @@ public: class SVL_DLLPUBLIC DdePoke : public DdeTransaction { public: - DdePoke( DdeConnection&, const String&, const char*, long, + DdePoke( DdeConnection&, const OUString&, const char*, long, sal_uLong = FORMAT_STRING, long = 0 ); - DdePoke( DdeConnection&, const String&, SAL_UNUSED_PARAMETER const DdeData&, long = 0 ); - DdePoke( DdeConnection&, const String&, const String&, long = 0 ); + DdePoke( DdeConnection&, const OUString&, SAL_UNUSED_PARAMETER const DdeData&, long = 0 ); + DdePoke( DdeConnection&, const OUString&, const OUString&, long = 0 ); }; // -------------- @@ -199,7 +199,7 @@ public: class SVL_DLLPUBLIC DdeExecute : public DdeTransaction { public: - DdeExecute( DdeConnection&, const String&, long = 0 ); + DdeExecute( DdeConnection&, const OUString&, long = 0 ); }; // ----------------- @@ -216,7 +216,7 @@ class SVL_DLLPUBLIC DdeConnection DdeImp* pImp; public: - DdeConnection( SAL_UNUSED_PARAMETER const String&, SAL_UNUSED_PARAMETER const String& ); + DdeConnection( SAL_UNUSED_PARAMETER const OUString&, SAL_UNUSED_PARAMETER const OUString& ); ~DdeConnection(); long GetError(); @@ -224,10 +224,10 @@ public: static const std::vector<DdeConnection*>& GetConnections(); - sal_Bool IsConnected(); + bool IsConnected(); - const String& GetServiceName(); - const String& GetTopicName(); + const OUString GetServiceName(); + const OUString GetTopicName(); private: DdeConnection( const DdeConnection& ); @@ -254,7 +254,7 @@ protected: public: DdeItem( const sal_Unicode* ); - DdeItem( SAL_UNUSED_PARAMETER const String& ); + DdeItem( SAL_UNUSED_PARAMETER const OUString& ); DdeItem( const DdeItem& ); virtual ~DdeItem(); @@ -271,12 +271,12 @@ class SVL_DLLPUBLIC DdeGetPutItem : public DdeItem { public: DdeGetPutItem( const sal_Unicode* p ); - DdeGetPutItem( const String& rStr ); + DdeGetPutItem( const OUString& rStr ); DdeGetPutItem( const DdeItem& rItem ); virtual DdeData* Get( sal_uLong ); - virtual sal_Bool Put( const DdeData* ); - virtual void AdviseLoop( sal_Bool ); // AdviseLoop starten/stoppen + virtual bool Put( const DdeData* ); + virtual void AdviseLoop( bool ); // AdviseLoop starten/stoppen }; // ------------ @@ -291,15 +291,15 @@ public: virtual void Connect( sal_IntPtr ); virtual void Disconnect( sal_IntPtr ); virtual DdeData* Get( sal_uLong ); - virtual sal_Bool Put( const DdeData* ); - virtual sal_Bool Execute( const String* ); + virtual bool Put( const DdeData* ); + virtual bool Execute( const OUString* ); // evt. ein neues anlegen; return 0 -> es konnte nicht angelegt werden - virtual sal_Bool MakeItem( const OUString& rItem ); + virtual bool MakeItem( const OUString& rItem ); // es wird ein Warm-/Hot-Link eingerichtet. Return-Wert // besagt ob es geklappt hat - virtual sal_Bool StartAdviseLoop(); - virtual sal_Bool StopAdviseLoop(); + virtual bool StartAdviseLoop(); + virtual bool StopAdviseLoop(); private: friend class DdeInternal; @@ -334,8 +334,8 @@ public: void SetExecuteHdl( const Link& rLink ) { aExecLink = rLink; } const Link& GetExecuteHdl() const { return aExecLink; } - void NotifyClient( const String& ); - sal_Bool IsSystemTopic(); + void NotifyClient( const OUString& ); + bool IsSystemTopic(); void InsertItem( DdeItem* ); // fuer eigene Ableitungen! DdeItem* AddItem( const DdeItem& ); // werden kopiert ! @@ -357,18 +357,18 @@ class SVL_DLLPUBLIC DdeService friend class DdeInternal; public: - virtual sal_Bool IsBusy(); - virtual String GetHelp(); + virtual bool IsBusy(); + virtual OUString GetHelp(); // evt. ein neues anlegen; return 0 -> es konnte nicht angelegt werden - virtual sal_Bool MakeTopic( const OUString& rItem ); + virtual bool MakeTopic( const OUString& rItem ); protected: - virtual String Topics(); - virtual String Formats(); - virtual String SysItems(); - virtual String Status(); - virtual String SysTopicGet( const String& ); - virtual sal_Bool SysTopicExecute( const String* ); + virtual OUString Topics(); + virtual OUString Formats(); + virtual OUString SysItems(); + virtual OUString Status(); + virtual OUString SysTopicGet( const OUString& ); + virtual bool SysTopicExecute( const OUString* ); const DdeTopic* GetSysTopic() const { return pSysTopic; } private: @@ -379,13 +379,13 @@ private: ConvList* pConv; short nStatus; - SVL_DLLPRIVATE sal_Bool HasCbFormat( sal_uInt16 ); + SVL_DLLPRIVATE bool HasCbFormat( sal_uInt16 ); public: - DdeService( SAL_UNUSED_PARAMETER const String& ); + DdeService( SAL_UNUSED_PARAMETER const OUString& ); virtual ~DdeService(); - const OUString GetName() const; + const OUString GetName() const; short GetError() { return nStatus; } static DdeServices& GetServices(); @@ -396,7 +396,7 @@ public: void AddFormat( sal_uLong ); void RemoveFormat( sal_uLong ); - sal_Bool HasFormat( sal_uLong ); + bool HasFormat( sal_uLong ); private: // DdeService( const DdeService& ); diff --git a/include/svl/undo.hxx b/include/svl/undo.hxx index 3e59baa693db..b16775fa9848 100644 --- a/include/svl/undo.hxx +++ b/include/svl/undo.hxx @@ -65,9 +65,9 @@ public: virtual void Redo(); virtual void RedoWithContext( SfxUndoContext& i_context ); virtual void Repeat(SfxRepeatTarget&); - virtual sal_Bool CanRepeat(SfxRepeatTarget&) const; + virtual bool CanRepeat(SfxRepeatTarget&) const; - virtual sal_Bool Merge( SfxUndoAction *pNextAction ); + virtual bool Merge( SfxUndoAction *pNextAction ); virtual OUString GetComment() const; virtual OUString GetRepeatComment(SfxRepeatTarget&) const; @@ -172,13 +172,13 @@ class SVL_DLLPUBLIC SfxListUndoAction : public SfxUndoAction, public SfxUndoArra virtual void Redo(); virtual void RedoWithContext( SfxUndoContext& i_context ); virtual void Repeat(SfxRepeatTarget&); - virtual sal_Bool CanRepeat(SfxRepeatTarget&) const; + virtual bool CanRepeat(SfxRepeatTarget&) const; - virtual sal_Bool Merge( SfxUndoAction *pNextAction ); + virtual bool Merge( SfxUndoAction *pNextAction ); - virtual OUString GetComment() const; - virtual OUString GetRepeatComment(SfxRepeatTarget&) const; - virtual sal_uInt16 GetId() const; + virtual OUString GetComment() const; + virtual OUString GetRepeatComment(SfxRepeatTarget&) const; + virtual sal_uInt16 GetId() const; void SetComment(const OUString& rComment); @@ -197,14 +197,14 @@ class SVL_DLLPUBLIC SfxListUndoAction : public SfxUndoAction, public SfxUndoArra class SAL_NO_VTABLE SfxUndoListener { public: - virtual void actionUndone( const String& i_actionComment ) = 0; - virtual void actionRedone( const String& i_actionComment ) = 0; - virtual void undoActionAdded( const String& i_actionComment ) = 0; + virtual void actionUndone( const OUString& i_actionComment ) = 0; + virtual void actionRedone( const OUString& i_actionComment ) = 0; + virtual void undoActionAdded( const OUString& i_actionComment ) = 0; virtual void cleared() = 0; virtual void clearedRedo() = 0; virtual void resetAll() = 0; - virtual void listActionEntered( const String& i_comment ) = 0; - virtual void listActionLeft( const String& i_comment ) = 0; + virtual void listActionEntered( const OUString& i_comment ) = 0; + virtual void listActionLeft( const OUString& i_comment ) = 0; virtual void listActionLeftAndMerged() = 0; virtual void listActionCancelled() = 0; virtual void undoManagerDying() = 0; @@ -231,7 +231,7 @@ namespace svl virtual void SetMaxUndoActionCount( size_t nMaxUndoActionCount ) = 0; virtual size_t GetMaxUndoActionCount() const = 0; - virtual void AddUndoAction( SfxUndoAction *pAction, sal_Bool bTryMerg=sal_False ) = 0; + virtual void AddUndoAction( SfxUndoAction *pAction, bool bTryMerg=false ) = 0; virtual size_t GetUndoActionCount( bool const i_currentLevel = CurrentLevel ) const = 0; virtual sal_uInt16 GetUndoActionId() const = 0; @@ -242,8 +242,8 @@ namespace svl virtual OUString GetRedoActionComment( size_t nNo=0, bool const i_currentLevel = CurrentLevel ) const = 0; virtual SfxUndoAction* GetRedoAction( size_t nNo=0, bool const i_currentLevel = CurrentLevel ) const = 0; - virtual sal_Bool Undo() = 0; - virtual sal_Bool Redo() = 0; + virtual bool Undo() = 0; + virtual bool Redo() = 0; /** clears both the Redo and the Undo stack. @@ -272,8 +272,8 @@ namespace svl virtual size_t GetRepeatActionCount() const = 0; virtual OUString GetRepeatActionComment( SfxRepeatTarget &rTarget) const = 0; - virtual sal_Bool Repeat( SfxRepeatTarget &rTarget ) = 0; - virtual sal_Bool CanRepeat( SfxRepeatTarget &rTarget ) const = 0; + virtual bool Repeat( SfxRepeatTarget &rTarget ) = 0; + virtual bool CanRepeat( SfxRepeatTarget &rTarget ) const = 0; virtual void EnterListAction(const OUString &rComment, const OUString& rRepeatComment, sal_uInt16 nId=0) = 0; @@ -352,7 +352,7 @@ public: // IUndoManager overridables virtual void SetMaxUndoActionCount( size_t nMaxUndoActionCount ); virtual size_t GetMaxUndoActionCount() const; - virtual void AddUndoAction( SfxUndoAction *pAction, sal_Bool bTryMerg=sal_False ); + virtual void AddUndoAction( SfxUndoAction *pAction, bool bTryMerg=false ); virtual size_t GetUndoActionCount( bool const i_currentLevel = CurrentLevel ) const; virtual sal_uInt16 GetUndoActionId() const; virtual OUString GetUndoActionComment( size_t nNo=0, bool const i_currentLevel = CurrentLevel ) const; @@ -360,16 +360,16 @@ public: virtual size_t GetRedoActionCount( bool const i_currentLevel = CurrentLevel ) const; virtual OUString GetRedoActionComment( size_t nNo=0, bool const i_currentLevel = CurrentLevel ) const; virtual SfxUndoAction* GetRedoAction( size_t nNo=0, bool const i_currentLevel = CurrentLevel ) const; - virtual sal_Bool Undo(); - virtual sal_Bool Redo(); + virtual bool Undo(); + virtual bool Redo(); virtual void Clear(); virtual void ClearRedo(); virtual void Reset(); virtual bool IsDoing() const; virtual size_t GetRepeatActionCount() const; virtual OUString GetRepeatActionComment( SfxRepeatTarget &rTarget) const; - virtual sal_Bool Repeat( SfxRepeatTarget &rTarget ); - virtual sal_Bool CanRepeat( SfxRepeatTarget &rTarget ) const; + virtual bool Repeat( SfxRepeatTarget &rTarget ); + virtual bool CanRepeat( SfxRepeatTarget &rTarget ) const; virtual void EnterListAction(const OUString &rComment, const OUString& rRepeatComment, sal_uInt16 nId=0); virtual size_t LeaveListAction(); virtual size_t LeaveAndMergeListAction(); @@ -399,8 +399,8 @@ public: void RemoveOldestUndoActions( size_t const i_count ); protected: - sal_Bool UndoWithContext( SfxUndoContext& i_context ); - sal_Bool RedoWithContext( SfxUndoContext& i_context ); + bool UndoWithContext( SfxUndoContext& i_context ); + bool RedoWithContext( SfxUndoContext& i_context ); void ImplClearRedo_NoLock( bool const i_currentLevel ); @@ -426,8 +426,8 @@ private: bool ImplIsInListAction_Lock() const; void ImplEnableUndo_Lock( bool const i_enable ); - sal_Bool ImplUndo( SfxUndoContext* i_contextOrNull ); - sal_Bool ImplRedo( SfxUndoContext* i_contextOrNull ); + bool ImplUndo( SfxUndoContext* i_contextOrNull ); + bool ImplRedo( SfxUndoContext* i_contextOrNull ); friend class ::svl::undo::impl::LockGuard; }; @@ -462,19 +462,19 @@ public: virtual void Undo(); virtual void Redo(); - virtual sal_Bool CanRepeat(SfxRepeatTarget& r) const; + virtual bool CanRepeat(SfxRepeatTarget& r) const; virtual void Repeat(SfxRepeatTarget&r); - virtual OUString GetComment() const; - virtual OUString GetRepeatComment(SfxRepeatTarget&r) const; - virtual sal_uInt16 GetId() const; + virtual OUString GetComment() const; + virtual OUString GetRepeatComment(SfxRepeatTarget&r) const; + virtual sal_uInt16 GetId() const; SfxUndoAction* GetAction() const { return pAction; } protected: - ::svl::IUndoManager *pUndoManager; - SfxUndoAction *pAction; + ::svl::IUndoManager* pUndoManager; + SfxUndoAction* pAction; }; diff --git a/include/svl/zforlist.hxx b/include/svl/zforlist.hxx index 311e01369ad5..34521c8df80d 100644 --- a/include/svl/zforlist.hxx +++ b/include/svl/zforlist.hxx @@ -22,7 +22,7 @@ #include "svl/svldllapi.h" #include <rtl/ustrbuf.hxx> #include <rtl/ustring.hxx> -#include <tools/string.hxx> +#include <tools/solar.h> #include <i18nlangtag/lang.h> #include <com/sun/star/uno/Reference.hxx> #include <com/sun/star/lang/Locale.hpp> @@ -447,11 +447,6 @@ public: rNewInserted==false and rCheckPos>0 the format code has errors and/or could not be converted. */ - sal_uInt32 GetIndexPuttingAndConverting( String & rString, LanguageType eLnge, - LanguageType eSysLnge, short & rType, - bool & rNewInserted, - xub_StrLen & rCheckPos ); - sal_uInt32 GetIndexPuttingAndConverting( OUString & rString, LanguageType eLnge, LanguageType eSysLnge, short & rType, bool & rNewInserted, sal_Int32 & rCheckPos ); @@ -474,10 +469,6 @@ public: /// Format a number according to a format index, return string and color void GetOutputString( const double& fOutNumber, sal_uInt32 nFIndex, - String& sOutString, Color** ppColor, bool bUseStarFormat = false ); - - /// Format a number according to a format index, return string and color - void GetOutputString( const double& fOutNumber, sal_uInt32 nFIndex, OUString& sOutString, Color** ppColor, bool bUseStarFormat = false ); /** Format a string according to a format index, return string and color. @@ -489,9 +480,6 @@ public: /** Format a number according to the standard default format matching the given format index */ void GetInputLineString( const double& fOutNumber, - sal_uInt32 nFIndex, String& sOutString ); - - void GetInputLineString( const double& fOutNumber, sal_uInt32 nFIndex, OUString& rOutString ); /** Format a number according to a format code string to be scanned. @@ -724,7 +712,7 @@ public: If ppEntry is not NULL and exactly one entry is found, a [$xxx-nnn] is returned, even if the format code only contains [$xxx] ! */ - bool GetNewCurrencySymbolString( sal_uInt32 nFormat, String& rSymbol, + bool GetNewCurrencySymbolString( sal_uInt32 nFormat, OUString& rSymbol, const NfCurrencyEntry** ppEntry = NULL, bool* pBank = NULL ) const; diff --git a/include/svx/e3dundo.hxx b/include/svx/e3dundo.hxx index 468a7ad77ca0..af919ca077ea 100644 --- a/include/svx/e3dundo.hxx +++ b/include/svx/e3dundo.hxx @@ -46,7 +46,7 @@ class E3dUndoAction : public SdrUndoAction virtual ~E3dUndoAction (); - virtual sal_Bool CanRepeat(SfxRepeatTarget&) const; + virtual bool CanRepeat(SfxRepeatTarget&) const; }; /************************************************************************\ @@ -101,7 +101,7 @@ class SVX_DLLPUBLIC E3dAttributesUndoAction : public SdrUndoAction virtual ~E3dAttributesUndoAction(); - virtual sal_Bool CanRepeat(SfxRepeatTarget& rView) const; + virtual bool CanRepeat(SfxRepeatTarget& rView) const; virtual void Undo(); virtual void Redo(); virtual void Repeat(); diff --git a/include/svx/sdrundomanager.hxx b/include/svx/sdrundomanager.hxx index 860742f8bae7..0b833ebc4716 100644 --- a/include/svx/sdrundomanager.hxx +++ b/include/svx/sdrundomanager.hxx @@ -44,8 +44,8 @@ public: virtual ~SdrUndoManager(); /// react depending on edit mode and if no more undo is possible - virtual sal_Bool Undo(); - virtual sal_Bool Redo(); + virtual bool Undo(); + virtual bool Redo(); // Call for the view which starts the interactive text edit. Use link to // activate (start text edit) and empty link to reset (end text edit). On diff --git a/include/svx/svdundo.hxx b/include/svx/svdundo.hxx index 6684d10be85f..f065394e9daf 100644 --- a/include/svx/svdundo.hxx +++ b/include/svx/svdundo.hxx @@ -62,7 +62,7 @@ public: TYPEINFO(); virtual ~SdrUndoAction(); - virtual sal_Bool CanRepeat(SfxRepeatTarget& rView) const; + virtual bool CanRepeat(SfxRepeatTarget& rView) const; virtual void Repeat(SfxRepeatTarget& rView); virtual OUString GetRepeatComment(SfxRepeatTarget& rView) const; diff --git a/reportdesign/source/ui/report/ReportController.cxx b/reportdesign/source/ui/report/ReportController.cxx index 220f31e61276..05c9520819a5 100644 --- a/reportdesign/source/ui/report/ReportController.cxx +++ b/reportdesign/source/ui/report/ReportController.cxx @@ -1031,7 +1031,7 @@ void OReportController::Execute(sal_uInt16 _nId, const Sequence< PropertyValue > case SID_UNDO: { const OXUndoEnvironment::OUndoMode aLock( m_aReportModel->GetUndoEnv() ); - sal_Bool ( SfxUndoManager::*doXDo )() = + bool ( SfxUndoManager::*doXDo )() = ( _nId == SID_UNDO ) ? &SfxUndoManager::Undo : &SfxUndoManager::Redo; SfxUndoManager& rUndoManager( getUndoManager() ); diff --git a/sc/inc/patattr.hxx b/sc/inc/patattr.hxx index 6b5fbf6f5fdf..d0e6741ce308 100644 --- a/sc/inc/patattr.hxx +++ b/sc/inc/patattr.hxx @@ -51,11 +51,11 @@ enum ScAutoFontColorMode class SC_DLLPUBLIC ScPatternAttr: public SfxSetItem { - String* pName; + OUString* pName; ScStyleSheet* pStyle; public: static ScDocument* pDoc; - ScPatternAttr(SfxItemSet* pItemSet, const String& rStyleName); + ScPatternAttr(SfxItemSet* pItemSet, const OUString& rStyleName); ScPatternAttr(SfxItemSet* pItemSet, ScStyleSheet* pStyleSheet = NULL); ScPatternAttr(SfxItemPool* pItemPool); ScPatternAttr(const ScPatternAttr& rPatternAttr); @@ -115,7 +115,7 @@ public: void SetStyleSheet(ScStyleSheet* pNewStyle, bool bClearDirectFormat = true); const ScStyleSheet* GetStyleSheet() const { return pStyle; } - const String* GetStyleName() const; + const OUString* GetStyleName() const; void UpdateStyleSheet(); void StyleToName(); diff --git a/sc/inc/stlpool.hxx b/sc/inc/stlpool.hxx index f2a025536835..f3abe11b0924 100644 --- a/sc/inc/stlpool.hxx +++ b/sc/inc/stlpool.hxx @@ -47,13 +47,13 @@ public: void CopyStdStylesFrom( ScStyleSheetPool* pSrcPool ); void CopyStyleFrom( ScStyleSheetPool* pSrcPool, - const String& rName, SfxStyleFamily eFamily ); + const OUString& rName, SfxStyleFamily eFamily ); - ScStyleSheet* FindCaseIns( const String& rName, SfxStyleFamily eFam ); + ScStyleSheet* FindCaseIns( const OUString& rName, SfxStyleFamily eFam ); - const String* GetForceStdName() const { return pForceStdName; } + const OUString* GetForceStdName() const { return pForceStdName; } - virtual SfxStyleSheetBase& Make( const String&, SfxStyleFamily eFam, + virtual SfxStyleSheetBase& Make( const OUString&, SfxStyleFamily eFam, sal_uInt16 nMask = SFXSTYLEBIT_ALL, sal_uInt16 nPos = 0xffff ); protected: @@ -61,15 +61,15 @@ protected: using SfxStyleSheetPool::Create; // calcwarnings: Create(const SfxStyleSheet&) - ever used? - virtual SfxStyleSheetBase* Create( const String& rName, + virtual SfxStyleSheetBase* Create( const OUString& rName, SfxStyleFamily eFamily, - sal_uInt16 nMask); + sal_uInt16 nMask); virtual SfxStyleSheetBase* Create( const SfxStyleSheetBase& rStyle ); private: SfxStyleSheetBase* pActualStyleSheet; ScDocument* pDoc; - const String* pForceStdName; + const OUString* pForceStdName; }; #endif // SC_STLPOOL_HXX diff --git a/sc/inc/stlsheet.hxx b/sc/inc/stlsheet.hxx index c66d53642b4e..28e4a9d04d01 100644 --- a/sc/inc/stlsheet.hxx +++ b/sc/inc/stlsheet.hxx @@ -51,17 +51,17 @@ public: ScStyleSheet( const ScStyleSheet& rStyle ); - 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 const String& GetName() const; - virtual const String& GetParent() const; - virtual const String& GetFollow() const; + virtual const OUString& GetName() const; + virtual const OUString& GetParent() const; + virtual const OUString& GetFollow() const; - virtual bool SetName( const String& ); + virtual bool SetName( const OUString& ); void SetUsage( ScStyleSheet::Usage eUse ) const { eUsage = eUse; } @@ -71,10 +71,10 @@ public: protected: virtual ~ScStyleSheet(); - ScStyleSheet( const String& rName, + ScStyleSheet( const OUString& rName, ScStyleSheetPool& rPool, SfxStyleFamily eFamily, - sal_uInt16 nMask ); + sal_uInt16 nMask ); virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ); }; diff --git a/sc/inc/undorangename.hxx b/sc/inc/undorangename.hxx index 33fd541c348e..50357f109e2d 100644 --- a/sc/inc/undorangename.hxx +++ b/sc/inc/undorangename.hxx @@ -31,7 +31,7 @@ public: virtual void Undo(); virtual void Redo(); virtual void Repeat(SfxRepeatTarget& rTarget); - virtual sal_Bool CanRepeat(SfxRepeatTarget& rTarget) const; + virtual bool CanRepeat(SfxRepeatTarget& rTarget) const; virtual OUString GetComment() const; private: @@ -53,7 +53,7 @@ public: virtual void Undo(); virtual void Redo(); virtual void Repeat(SfxRepeatTarget& rTarget); - virtual sal_Bool CanRepeat(SfxRepeatTarget& rTarget) const; + virtual bool CanRepeat(SfxRepeatTarget& rTarget) const; virtual OUString GetComment() const; private: diff --git a/sc/inc/zforauto.hxx b/sc/inc/zforauto.hxx index 1dbb74e3bb4c..c132a8af4410 100644 --- a/sc/inc/zforauto.hxx +++ b/sc/inc/zforauto.hxx @@ -30,7 +30,7 @@ class SvNumberFormatter; class ScNumFormatAbbrev { - String sFormatstring; + OUString sFormatstring; LanguageType eLnge; LanguageType eSysLnge; public: diff --git a/sc/source/core/data/docpool.cxx b/sc/source/core/data/docpool.cxx index 4954ac0e4412..684c32a691b9 100644 --- a/sc/source/core/data/docpool.cxx +++ b/sc/source/core/data/docpool.cxx @@ -679,7 +679,7 @@ void ScDocumentPool::CellStyleCreated( const String& rName ) static_cast<ScPatternAttr const*>(GetItem2(ATTR_PATTERN, i))); if ( pPattern && pPattern->GetStyleSheet() == NULL ) { - const String* pStyleName = pPattern->GetStyleName(); + const OUString* pStyleName = pPattern->GetStyleName(); if ( pStyleName && *pStyleName == rName ) pPattern->UpdateStyleSheet(); // find and store style pointer } diff --git a/sc/source/core/data/dpcache.cxx b/sc/source/core/data/dpcache.cxx index bff62bd964ac..abaf08882abf 100644 --- a/sc/source/core/data/dpcache.cxx +++ b/sc/source/core/data/dpcache.cxx @@ -963,7 +963,7 @@ OUString ScDPCache::GetFormattedString(long nDim, const ScDPItemData& rItem) con if (pFormatter) { Color* pColor = NULL; - String aStr; + OUString aStr; pFormatter->GetOutputString(rItem.GetValue(), nNumFormat, aStr, &pColor); return aStr; } diff --git a/sc/source/core/data/dputil.cxx b/sc/source/core/data/dputil.cxx index d7bf56fee780..e4240ba60769 100644 --- a/sc/source/core/data/dputil.cxx +++ b/sc/source/core/data/dputil.cxx @@ -110,7 +110,7 @@ OUString ScDPUtil::getDateGroupName( sal_uLong nFormat = pFormatter->GetFormatIndex(NF_DATE_SYS_DDMMM, ScGlobal::eLnge); Color* pColor; - String aStr; + OUString aStr; pFormatter->GetOutputString(nDays, nFormat, aStr, &pColor); return aStr; } diff --git a/sc/source/core/data/patattr.cxx b/sc/source/core/data/patattr.cxx index af1d5c9e6f8d..3e18fa4630c2 100644 --- a/sc/source/core/data/patattr.cxx +++ b/sc/source/core/data/patattr.cxx @@ -72,9 +72,9 @@ using sc::TwipsToHMM; // ----------------------------------------------------------------------- -ScPatternAttr::ScPatternAttr( SfxItemSet* pItemSet, const String& rStyleName ) +ScPatternAttr::ScPatternAttr( SfxItemSet* pItemSet, const OUString& rStyleName ) : SfxSetItem ( ATTR_PATTERN, pItemSet ), - pName ( new String( rStyleName ) ), + pName ( new OUString( rStyleName ) ), pStyle ( NULL ) { } @@ -100,7 +100,7 @@ ScPatternAttr::ScPatternAttr( const ScPatternAttr& rPatternAttr ) pStyle ( rPatternAttr.pStyle ) { if (rPatternAttr.pName) - pName = new String(*rPatternAttr.pName); + pName = new OUString(*rPatternAttr.pName); else pName = NULL; } @@ -115,12 +115,12 @@ SfxPoolItem* ScPatternAttr::Clone( SfxItemPool *pPool ) const ScPatternAttr* pPattern = new ScPatternAttr( GetItemSet().Clone(true, pPool) ); pPattern->pStyle = pStyle; - pPattern->pName = pName ? new String(*pName) : NULL; + pPattern->pName = pName ? new OUString(*pName) : NULL; return pPattern; } -inline int StrCmp( const String* pStr1, const String* pStr2 ) +inline int StrCmp( const OUString* pStr1, const OUString* pStr2 ) { return ( pStr1 ? ( pStr2 ? ( *pStr1 == *pStr2 ) : false ) : ( pStr2 ? false : true ) ); } @@ -150,7 +150,7 @@ int ScPatternAttr::operator==( const SfxPoolItem& rCmp ) const SfxPoolItem* ScPatternAttr::Create( SvStream& rStream, sal_uInt16 /* nVersion */ ) const { - String* pStr; + OUString* pStr; sal_Bool bHasStyle; rStream >> bHasStyle; @@ -158,12 +158,12 @@ SfxPoolItem* ScPatternAttr::Create( SvStream& rStream, sal_uInt16 /* nVersion */ if ( bHasStyle ) { short eFamDummy; - pStr = new String; + pStr = new OUString; *pStr = rStream.ReadUniOrByteString( rStream.GetStreamCharSet() ); rStream >> eFamDummy; // wg. altem Dateiformat } else - pStr = new String( ScGlobal::GetRscString(STR_STYLENAME_STANDARD) ); + pStr = new OUString( ScGlobal::GetRscString(STR_STYLENAME_STANDARD) ); SfxItemSet *pNewSet = new SfxItemSet( *GetItemSet().GetPool(), ATTR_PATTERN_START, ATTR_PATTERN_END ); @@ -1117,7 +1117,7 @@ bool ScPatternAttr::IsVisibleEqual( const ScPatternAttr& rOther ) const //! auch hier nur wirklich sichtbare Werte testen !!! } -const String* ScPatternAttr::GetStyleName() const +const OUString* ScPatternAttr::GetStyleName() const { return pName ? pName : ( pStyle ? &pStyle->GetName() : NULL ); } @@ -1184,7 +1184,7 @@ void ScPatternAttr::StyleToName() if ( pName ) *pName = pStyle->GetName(); else - pName = new String( pStyle->GetName() ); + pName = new OUString( pStyle->GetName() ); pStyle = NULL; GetItemSet().SetParent( NULL ); diff --git a/sc/source/core/data/stlpool.cxx b/sc/source/core/data/stlpool.cxx index c008123990e7..da1ddb364d19 100644 --- a/sc/source/core/data/stlpool.cxx +++ b/sc/source/core/data/stlpool.cxx @@ -80,8 +80,8 @@ void ScStyleSheetPool::SetDocument( ScDocument* pDocument ) //------------------------------------------------------------------------ -SfxStyleSheetBase& ScStyleSheetPool::Make( const String& rName, - SfxStyleFamily eFam, sal_uInt16 mask, sal_uInt16 nPos ) +SfxStyleSheetBase& ScStyleSheetPool::Make( const OUString& rName, + SfxStyleFamily eFam, sal_uInt16 mask, sal_uInt16 nPos ) { // When updating styles from a template, Office 5.1 sometimes created // files with multiple default styles. @@ -89,13 +89,13 @@ SfxStyleSheetBase& ScStyleSheetPool::Make( const String& rName, //! only when loading? - if ( rName.EqualsAscii(STRING_STANDARD) && Find( rName, eFam ) != NULL ) + if ( rName == STRING_STANDARD && Find( rName, eFam ) != NULL ) { OSL_FAIL("renaming additional default style"); sal_uInt32 nCount = aStyles.size(); for ( sal_uInt32 nAdd = 1; nAdd <= nCount; nAdd++ ) { - String aNewName = ScGlobal::GetRscString(STR_STYLENAME_STANDARD); + OUString aNewName = ScGlobal::GetRscString(STR_STYLENAME_STANDARD); aNewName += OUString::number( nAdd ); if ( Find( aNewName, eFam ) == NULL ) return SfxStyleSheetPool::Make( aNewName, eFam, mask, nPos ); @@ -107,10 +107,9 @@ SfxStyleSheetBase& ScStyleSheetPool::Make( const String& rName, //------------------------------------------------------------------------ -SfxStyleSheetBase* ScStyleSheetPool::Create( - const String& rName, - SfxStyleFamily eFamily, - sal_uInt16 nMaskP ) +SfxStyleSheetBase* ScStyleSheetPool::Create( const OUString& rName, + SfxStyleFamily eFamily, + sal_uInt16 nMaskP ) { ScStyleSheet* pSheet = new ScStyleSheet( rName, *this, eFamily, nMaskP ); if ( eFamily == SFX_STYLE_FAMILY_PARA && ScGlobal::GetRscString(STR_STYLENAME_STANDARD) != rName ) @@ -144,7 +143,7 @@ void ScStyleSheetPool::Remove( SfxStyleSheetBase* pStyle ) //------------------------------------------------------------------------ void ScStyleSheetPool::CopyStyleFrom( ScStyleSheetPool* pSrcPool, - const String& rName, SfxStyleFamily eFamily ) + const OUString& rName, SfxStyleFamily eFamily ) { // this ist Dest-Pool @@ -483,9 +482,9 @@ void ScStyleSheetPool::CreateStandardStyles() //------------------------------------------------------------------------ -ScStyleSheet* ScStyleSheetPool::FindCaseIns( const String& rName, SfxStyleFamily eFam ) +ScStyleSheet* ScStyleSheetPool::FindCaseIns( const OUString& rName, SfxStyleFamily eFam ) { - String aUpSearch = ScGlobal::pCharClass->uppercase(rName); + OUString aUpSearch = ScGlobal::pCharClass->uppercase(rName); sal_uInt32 nCount = aStyles.size(); for (sal_uInt32 n=0; n<nCount; n++) diff --git a/sc/source/core/data/stlsheet.cxx b/sc/source/core/data/stlsheet.cxx index eaa692a798cc..c7c4fd168c8c 100644 --- a/sc/source/core/data/stlsheet.cxx +++ b/sc/source/core/data/stlsheet.cxx @@ -50,12 +50,12 @@ TYPEINIT1(ScStyleSheet, SfxStyleSheet); //======================================================================== -ScStyleSheet::ScStyleSheet( const String& rName, +ScStyleSheet::ScStyleSheet( const OUString& rName, ScStyleSheetPool& rPoolP, SfxStyleFamily eFamily, - sal_uInt16 nMaskP ) + sal_uInt16 nMaskP ) - : SfxStyleSheet ( rName, rPoolP, eFamily, nMaskP ) + : SfxStyleSheet ( rName, rPoolP, eFamily, nMaskP ) , eUsage( UNKNOWN ) { } @@ -89,9 +89,9 @@ bool ScStyleSheet::HasParentSupport () const switch ( GetFamily() ) { - case SFX_STYLE_FAMILY_PARA: bHasParentSupport = true; break; - case SFX_STYLE_FAMILY_PAGE: bHasParentSupport = false; break; - default: + case SFX_STYLE_FAMILY_PARA: bHasParentSupport = true; break; + case SFX_STYLE_FAMILY_PAGE: bHasParentSupport = false; break; + default: { // added to avoid warnings } @@ -102,10 +102,10 @@ bool ScStyleSheet::HasParentSupport () const //------------------------------------------------------------------------ -bool ScStyleSheet::SetParent( const String& rParentName ) +bool ScStyleSheet::SetParent( const OUString& rParentName ) { bool bResult = false; - String aEffName = rParentName; + OUString aEffName = rParentName; SfxStyleSheetBase* pStyle = pPool->Find( aEffName, nFamily ); if (!pStyle) { @@ -285,30 +285,30 @@ void ScStyleSheet::Notify( SfxBroadcaster&, const SfxHint& rHint ) // schmutzige Tricks, um die Standard-Vorlage immer als "Standard" zu speichern, // obwohl der fuer den Benutzer sichtbare Name uebersetzt ist: -const String& ScStyleSheet::GetName() const +const OUString& ScStyleSheet::GetName() const { - const String& rBase = SfxStyleSheet::GetName(); - const String* pForceStdName = ((ScStyleSheetPool*)pPool)->GetForceStdName(); + const OUString& rBase = SfxStyleSheet::GetName(); + const OUString* pForceStdName = ((ScStyleSheetPool*)pPool)->GetForceStdName(); if ( pForceStdName && rBase == ScGlobal::GetRscString(STR_STYLENAME_STANDARD) ) return *pForceStdName; else return rBase; } -const String& ScStyleSheet::GetParent() const +const OUString& ScStyleSheet::GetParent() const { - const String& rBase = SfxStyleSheet::GetParent(); - const String* pForceStdName = ((ScStyleSheetPool*)pPool)->GetForceStdName(); + const OUString& rBase = SfxStyleSheet::GetParent(); + const OUString* pForceStdName = ((ScStyleSheetPool*)pPool)->GetForceStdName(); if ( pForceStdName && rBase == ScGlobal::GetRscString(STR_STYLENAME_STANDARD) ) return *pForceStdName; else return rBase; } -const String& ScStyleSheet::GetFollow() const +const OUString& ScStyleSheet::GetFollow() const { - const String& rBase = SfxStyleSheet::GetFollow(); - const String* pForceStdName = ((ScStyleSheetPool*)pPool)->GetForceStdName(); + const OUString& rBase = SfxStyleSheet::GetFollow(); + const OUString* pForceStdName = ((ScStyleSheetPool*)pPool)->GetForceStdName(); if ( pForceStdName && rBase == ScGlobal::GetRscString(STR_STYLENAME_STANDARD) ) return *pForceStdName; else @@ -323,9 +323,9 @@ const String& ScStyleSheet::GetFollow() const //! Flag gesetzt und abgefragt werden. //! Die ganze Abfrage muss raus, wenn fuer eine neue Datei-Version die Namens-Umsetzung wegfaellt. -bool ScStyleSheet::SetName( const String& rNew ) +bool ScStyleSheet::SetName( const OUString& rNew ) { - String aFileStdName = OUString(STRING_STANDARD); + OUString aFileStdName = OUString(STRING_STANDARD); if ( rNew == aFileStdName && aFileStdName != ScGlobal::GetRscString(STR_STYLENAME_STANDARD) ) return false; else diff --git a/sc/source/core/data/table4.cxx b/sc/source/core/data/table4.cxx index c605a972736a..5df625709dbd 100644 --- a/sc/source/core/data/table4.cxx +++ b/sc/source/core/data/table4.cxx @@ -1068,8 +1068,9 @@ String ScTable::GetAutoFillPreview( const ScRange& rSource, SCCOL nEndX, SCROW n Color* pColor; sal_uLong nNumFmt = GetNumberFormat( nSrcX, nSrcY ); - pDocument->GetFormatTable()-> - GetOutputString( nVal, nNumFmt, aValue, &pColor ); + OUString sTmp(aValue); + pDocument->GetFormatTable()->GetOutputString( nVal, nNumFmt, sTmp, &pColor ); + aValue = sTmp; } break; // not for formulas @@ -1153,8 +1154,9 @@ String ScTable::GetAutoFillPreview( const ScRange& rSource, SCCOL nEndX, SCROW n //! Zahlformat je nach Index holen? Color* pColor; sal_uLong nNumFmt = GetNumberFormat( nCol1, nRow1 ); - pDocument->GetFormatTable()-> - GetOutputString( nStart, nNumFmt, aValue, &pColor ); + OUString sTmp(aValue); + pDocument->GetFormatTable()->GetOutputString( nStart, nNumFmt, sTmp, &pColor ); + aValue = sTmp; } } } diff --git a/sc/source/core/data/table6.cxx b/sc/source/core/data/table6.cxx index 9f6ae6202447..540eb55dc17b 100644 --- a/sc/source/core/data/table6.cxx +++ b/sc/source/core/data/table6.cxx @@ -824,7 +824,7 @@ bool lcl_maybeReplaceCellString( rCol = nCol; rRow = nRow; if (rSearchItem.GetCommand() == SVX_SEARCHCMD_REPLACE && - rSearchItem.GetReplaceString().Len()) + !rSearchItem.GetReplaceString().isEmpty()) { rColObj.SetRawString(nRow, rSearchItem.GetReplaceString()); rUndoStr = OUString(); @@ -952,7 +952,7 @@ bool ScTable::SearchRangeForAllEmptyCells( { bool bFound = false; bool bReplace = (rSearchItem.GetCommand() == SVX_SEARCHCMD_REPLACE_ALL) && - (rSearchItem.GetReplaceString().Len() > 0); + !rSearchItem.GetReplaceString().isEmpty(); bool bSkipFiltered = rSearchItem.IsSearchFiltered(); for (SCCOL nCol = rRange.aStart.Col(); nCol <= rRange.aEnd.Col(); ++nCol) diff --git a/sc/source/core/data/validat.cxx b/sc/source/core/data/validat.cxx index 175c3dbd822b..4d72c9837ad5 100644 --- a/sc/source/core/data/validat.cxx +++ b/sc/source/core/data/validat.cxx @@ -450,9 +450,9 @@ bool ScValidationData::IsDataValid( // determine length, otherwise a once accepted value maybe could // not be edited again, for example abbreviated dates or leading // zeros or trailing zeros after decimal separator change length. - String aStr; + OUString aStr; pFormatter->GetInputLineString( nVal, nFormat, aStr); - nLenVal = static_cast<double>( aStr.Len() ); + nLenVal = static_cast<double>( aStr.getLength() ); } ScRefCellValue aTmpCell(nLenVal); bRet = IsCellValid(aTmpCell, rPos); @@ -758,7 +758,11 @@ bool ScValidationData::GetSelectionFromFormula( (SCROW)(nRow+aRange.aStart.Row()), aRange.aStart.Tab() , aValStr); } else - pFormatter->GetInputLineString( nMatVal.fVal, 0, aValStr ); + { + OUString sTmp(aValStr); + pFormatter->GetInputLineString( nMatVal.fVal, 0, sTmp ); + aValStr = sTmp; + } } if (!rCell.isEmpty() && rMatch < 0) diff --git a/sc/source/core/tool/rangeseq.cxx b/sc/source/core/tool/rangeseq.cxx index a892eb408373..11743c723ba0 100644 --- a/sc/source/core/tool/rangeseq.cxx +++ b/sc/source/core/tool/rangeseq.cxx @@ -221,7 +221,7 @@ sal_Bool ScRangeToSequence::FillStringArray( uno::Any& rAny, const ScMatrix* pMa OUString* pColAry = aColSeq.getArray(); for (SCSIZE nCol = 0; nCol < nColCount; nCol++) { - String aStr; + OUString aStr; if ( pMatrix->IsString( nCol, nRow ) ) { if ( !pMatrix->IsEmpty( nCol, nRow ) ) @@ -233,7 +233,7 @@ sal_Bool ScRangeToSequence::FillStringArray( uno::Any& rAny, const ScMatrix* pMa Color* pColor; pFormatter->GetOutputString( fVal, 0, aStr, &pColor ); } - pColAry[nCol] = OUString( aStr ); + pColAry[nCol] = aStr; } pRowAry[nRow] = aColSeq; diff --git a/sc/source/core/tool/zforauto.cxx b/sc/source/core/tool/zforauto.cxx index 6c75a59b4ebd..3611c71fd466 100644 --- a/sc/source/core/tool/zforauto.cxx +++ b/sc/source/core/tool/zforauto.cxx @@ -25,12 +25,10 @@ #include "zforauto.hxx" #include "global.hxx" -static const sal_Char pStandardName[] = "Standard"; - //------------------------------------------------------------------------ ScNumFormatAbbrev::ScNumFormatAbbrev() : - sFormatstring ( pStandardName ), + sFormatstring ( "Standard" ), eLnge (LANGUAGE_SYSTEM), eSysLnge (LANGUAGE_GERMAN) // sonst passt "Standard" nicht { @@ -81,7 +79,7 @@ void ScNumFormatAbbrev::PutFormatIndex(sal_uLong nFormat, OSL_FAIL("SCNumFormatAbbrev:: unknown number format"); eLnge = LANGUAGE_SYSTEM; eSysLnge = LANGUAGE_GERMAN; // sonst passt "Standard" nicht - sFormatstring.AssignAscii( RTL_CONSTASCII_STRINGPARAM( pStandardName ) ); + sFormatstring = "Standard"; } } @@ -89,9 +87,9 @@ sal_uLong ScNumFormatAbbrev::GetFormatIndex( SvNumberFormatter& rFormatter) { short nType; bool bNewInserted; - xub_StrLen nCheckPos; + sal_Int32 nCheckPos; return rFormatter.GetIndexPuttingAndConverting( sFormatstring, eLnge, - eSysLnge, nType, bNewInserted, nCheckPos); + eSysLnge, nType, bNewInserted, nCheckPos); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/filter/excel/xestyle.cxx b/sc/source/filter/excel/xestyle.cxx index c3ab137eddc3..39769276e45a 100644 --- a/sc/source/filter/excel/xestyle.cxx +++ b/sc/source/filter/excel/xestyle.cxx @@ -2722,7 +2722,7 @@ sal_uInt32 XclExpXFBuffer::InsertStyleXF( const SfxStyleSheetBase& rStyleSheet ) { maXFList.AppendNewRecord( new XclExpXF( GetRoot(), rStyleSheet ) ); // create the STYLE record - if( rStyleSheet.GetName().Len() ) + if( !rStyleSheet.GetName().isEmpty() ) maStyleList.AppendNewRecord( new XclExpStyle( nXFId, rStyleSheet.GetName() ) ); } else diff --git a/sc/source/filter/rtf/eeimpars.cxx b/sc/source/filter/rtf/eeimpars.cxx index cad6188aa7ad..fd97da61f100 100644 --- a/sc/source/filter/rtf/eeimpars.cxx +++ b/sc/source/filter/rtf/eeimpars.cxx @@ -372,7 +372,9 @@ void ScEEImport::WriteToDocument( bool bSizeColsRows, double nOutputFactor, SvNu pFormatter->GetFormatForLanguageIfBuiltIn( nIndex, LANGUAGE_SYSTEM); OSL_ENSURE( nNewIndex != nIndex, "ScEEImport::WriteToDocument: NumbersEnglishUS not a built-in format?"); - pFormatter->GetInputLineString( fEnVal, nNewIndex, aStr); + OUString sTemp(aStr); + pFormatter->GetInputLineString( fEnVal, nNewIndex, sTemp); + aStr = sTemp; } else bTextFormat = true; diff --git a/sc/source/filter/xml/XMLChangeTrackingImportHelper.cxx b/sc/source/filter/xml/XMLChangeTrackingImportHelper.cxx index d585686c08a8..d37f2d41f8b6 100644 --- a/sc/source/filter/xml/XMLChangeTrackingImportHelper.cxx +++ b/sc/source/filter/xml/XMLChangeTrackingImportHelper.cxx @@ -64,7 +64,7 @@ const ScCellValue& ScMyCellInfo::CreateCell( ScDocument* pDoc ) maCell.mpFormula->SetMatColsRows(static_cast<SCCOL>(nMatrixCols), static_cast<SCROW>(nMatrixRows)); } - if ((nType == NUMBERFORMAT_DATE || nType == NUMBERFORMAT_TIME) && sInputString.Len() == 0) + if ((nType == NUMBERFORMAT_DATE || nType == NUMBERFORMAT_TIME) && sInputString.isEmpty()) { sal_uInt32 nFormat(0); if (nType == NUMBERFORMAT_DATE) diff --git a/sc/source/filter/xml/XMLChangeTrackingImportHelper.hxx b/sc/source/filter/xml/XMLChangeTrackingImportHelper.hxx index ea565c5a96f0..b08be6178991 100644 --- a/sc/source/filter/xml/XMLChangeTrackingImportHelper.hxx +++ b/sc/source/filter/xml/XMLChangeTrackingImportHelper.hxx @@ -39,7 +39,7 @@ struct ScMyCellInfo ScCellValue maCell; OUString sFormulaAddress; OUString sFormula; - String sInputString; + OUString sInputString; double fValue; sal_Int32 nMatrixCols; sal_Int32 nMatrixRows; diff --git a/sc/source/filter/xml/xmlcelli.cxx b/sc/source/filter/xml/xmlcelli.cxx index 445766e04343..5b1c58fa69a8 100644 --- a/sc/source/filter/xml/xmlcelli.cxx +++ b/sc/source/filter/xml/xmlcelli.cxx @@ -900,7 +900,7 @@ void ScXMLTableRowCellContext::SetAnnotation(const ScAddress& rPos) rXMLImport.GetMM100UnitConverter().convertDateTime( fDate, mxAnnotationData->maCreateDate ); SvNumberFormatter* pNumForm = pDoc->GetFormatTable(); sal_uInt32 nfIndex = pNumForm->GetFormatIndex( NF_DATE_SYS_DDMMYYYY, LANGUAGE_SYSTEM ); - String aDate; + OUString aDate; Color* pColor = 0; Color** ppColor = &pColor; pNumForm->GetOutputString( fDate, nfIndex, aDate, ppColor ); diff --git a/sc/source/ui/docshell/docsh4.cxx b/sc/source/ui/docshell/docsh4.cxx index 48ed4c6e3385..8d9e1814f7ff 100644 --- a/sc/source/ui/docshell/docsh4.cxx +++ b/sc/source/ui/docshell/docsh4.cxx @@ -2064,13 +2064,13 @@ void ScDocShell::GetPageOnFromPageStyleSet( const SfxItemSet* pStyleSet, rbFooter = ((const SfxBoolItem&)pSet->Get(ATTR_PAGE_ON)).GetValue(); } -long ScDocShell::DdeGetData( const String& rItem, - const String& rMimeType, - ::com::sun::star::uno::Any & rValue ) +long ScDocShell::DdeGetData( const OUString& rItem, + const OUString& rMimeType, + ::com::sun::star::uno::Any & rValue ) { if( FORMAT_STRING == SotExchange::GetFormatIdFromMimeType( rMimeType ) ) { - if( rItem.EqualsIgnoreCaseAscii( "Format" ) ) + if( rItem.equalsIgnoreAsciiCase( "Format" ) ) { OString aFmtByte(OUStringToOString(aDdeTextFmt, osl_getThreadTextEncoding())); @@ -2114,13 +2114,13 @@ long ScDocShell::DdeGetData( const String& rItem, return 0; } -long ScDocShell::DdeSetData( const String& rItem, - const String& rMimeType, - const ::com::sun::star::uno::Any & rValue ) +long ScDocShell::DdeSetData( const OUString& rItem, + const OUString& rMimeType, + const ::com::sun::star::uno::Any & rValue ) { if( FORMAT_STRING == SotExchange::GetFormatIdFromMimeType( rMimeType )) { - if( rItem.EqualsIgnoreCaseAscii( "Format" ) ) + if( rItem.equalsIgnoreAsciiCase( "Format" ) ) { if ( ScByteSequenceToString::GetString( aDdeTextFmt, rValue, osl_getThreadTextEncoding() ) ) { @@ -2153,7 +2153,7 @@ long ScDocShell::DdeSetData( const String& rItem, return 0; } -::sfx2::SvLinkSource* ScDocShell::DdeCreateLinkSource( const String& rItem ) +::sfx2::SvLinkSource* ScDocShell::DdeCreateLinkSource( const OUString& rItem ) { // only check for valid item string - range is parsed again in ScServerObject ctor diff --git a/sc/source/ui/formdlg/formula.cxx b/sc/source/ui/formdlg/formula.cxx index 522a277bf875..37ee0e2a0bd9 100644 --- a/sc/source/ui/formdlg/formula.cxx +++ b/sc/source/ui/formdlg/formula.cxx @@ -341,10 +341,13 @@ bool ScFormulaDlg::calculateValue( const String& rStrExp, String& rStrResult ) if ( pFCell->IsValue() ) { double n = pFCell->GetValue(); + OUString sTempOut(rStrResult); sal_uLong nFormat = aFormatter.GetStandardFormat( n, 0, pFCell->GetFormatType(), ScGlobal::eLnge ); + aFormatter.GetOutputString( n, nFormat, - rStrResult, &pColor ); + sTempOut, &pColor ); + rStrResult = sTempOut; } else { diff --git a/sc/source/ui/inc/docsh.hxx b/sc/source/ui/inc/docsh.hxx index d761f7f46fba..ec2201f65c98 100644 --- a/sc/source/ui/inc/docsh.hxx +++ b/sc/source/ui/inc/docsh.hxx @@ -373,11 +373,11 @@ public: bool& rbHeader, bool& rbFooter ); - virtual long DdeGetData( const String& rItem, const String& rMimeType, + virtual long DdeGetData( const OUString& rItem, const OUString& rMimeType, ::com::sun::star::uno::Any & rValue ); - virtual long DdeSetData( const String& rItem, const String& rMimeType, + virtual long DdeSetData( const OUString& rItem, const OUString& rMimeType, const ::com::sun::star::uno::Any & rValue ); - virtual ::sfx2::SvLinkSource* DdeCreateLinkSource( const String& rItem ); + virtual ::sfx2::SvLinkSource* DdeCreateLinkSource( const OUString& rItem ); const String& GetDdeTextFmt() const { return aDdeTextFmt; } diff --git a/sc/source/ui/inc/undobase.hxx b/sc/source/ui/inc/undobase.hxx index 694340850dc7..e57e3081da34 100644 --- a/sc/source/ui/inc/undobase.hxx +++ b/sc/source/ui/inc/undobase.hxx @@ -42,7 +42,7 @@ public: ScSimpleUndo( ScDocShell* pDocSh ); virtual ~ScSimpleUndo(); - virtual sal_Bool Merge( SfxUndoAction *pNextAction ); + virtual bool Merge( SfxUndoAction *pNextAction ); protected: ScDocShell* pDocShell; @@ -180,8 +180,8 @@ public: virtual void Undo(); virtual void Redo(); virtual void Repeat(SfxRepeatTarget& rTarget); - virtual sal_Bool CanRepeat(SfxRepeatTarget& rTarget) const; - virtual sal_Bool Merge( SfxUndoAction *pNextAction ); + virtual bool CanRepeat(SfxRepeatTarget& rTarget) const; + virtual bool Merge( SfxUndoAction *pNextAction ); virtual OUString GetComment() const; virtual OUString GetRepeatComment(SfxRepeatTarget&) const; virtual sal_uInt16 GetId() const; diff --git a/sc/source/ui/inc/undoblk.hxx b/sc/source/ui/inc/undoblk.hxx index 470e7d3bdf4a..def653f2cd54 100644 --- a/sc/source/ui/inc/undoblk.hxx +++ b/sc/source/ui/inc/undoblk.hxx @@ -54,11 +54,11 @@ public: virtual void Undo(); virtual void Redo(); virtual void Repeat( SfxRepeatTarget& rTarget ); - virtual sal_Bool CanRepeat( SfxRepeatTarget& rTarget ) const; + virtual bool CanRepeat( SfxRepeatTarget& rTarget ) const; virtual OUString GetComment() const; - virtual sal_Bool Merge( SfxUndoAction *pNextAction ); + virtual bool Merge( SfxUndoAction *pNextAction ); private: ScRange aEffRange; @@ -87,7 +87,7 @@ public: virtual void Undo(); virtual void Redo(); virtual void Repeat(SfxRepeatTarget& rTarget); - virtual sal_Bool CanRepeat(SfxRepeatTarget& rTarget) const; + virtual bool CanRepeat(SfxRepeatTarget& rTarget) const; virtual OUString GetComment() const; @@ -118,7 +118,7 @@ public: virtual void Undo(); virtual void Redo(); virtual void Repeat(SfxRepeatTarget& rTarget); - virtual sal_Bool CanRepeat(SfxRepeatTarget& rTarget) const; + virtual bool CanRepeat(SfxRepeatTarget& rTarget) const; virtual OUString GetComment() const; @@ -150,7 +150,7 @@ public: virtual void Undo(); virtual void Redo(); virtual void Repeat(SfxRepeatTarget& rTarget); - virtual sal_Bool CanRepeat(SfxRepeatTarget& rTarget) const; + virtual bool CanRepeat(SfxRepeatTarget& rTarget) const; virtual OUString GetComment() const; @@ -199,7 +199,7 @@ public: virtual void Undo(); virtual void Redo(); virtual void Repeat(SfxRepeatTarget& rTarget); - virtual sal_Bool CanRepeat(SfxRepeatTarget& rTarget) const; + virtual bool CanRepeat(SfxRepeatTarget& rTarget) const; virtual OUString GetComment() const; @@ -233,7 +233,7 @@ public: virtual void Undo(); virtual void Redo(); virtual void Repeat(SfxRepeatTarget& rTarget); - virtual sal_Bool CanRepeat(SfxRepeatTarget& rTarget) const; + virtual bool CanRepeat(SfxRepeatTarget& rTarget) const; virtual OUString GetComment() const; @@ -266,7 +266,7 @@ public: virtual void Undo(); virtual void Redo(); virtual void Repeat(SfxRepeatTarget& rTarget); - virtual sal_Bool CanRepeat(SfxRepeatTarget& rTarget) const; + virtual bool CanRepeat(SfxRepeatTarget& rTarget) const; virtual OUString GetComment() const; @@ -300,7 +300,7 @@ public: virtual void Undo(); virtual void Redo(); virtual void Repeat(SfxRepeatTarget& rTarget); - virtual sal_Bool CanRepeat(SfxRepeatTarget& rTarget) const; + virtual bool CanRepeat(SfxRepeatTarget& rTarget) const; virtual OUString GetComment() const; @@ -339,7 +339,7 @@ public: virtual void Undo(); virtual void Redo(); virtual void Repeat(SfxRepeatTarget& rTarget); - virtual sal_Bool CanRepeat(SfxRepeatTarget& rTarget) const; + virtual bool CanRepeat(SfxRepeatTarget& rTarget) const; virtual OUString GetComment() const; @@ -362,24 +362,24 @@ private: class ScUndoWidthOrHeight: public ScSimpleUndo { public: - TYPEINFO(); - ScUndoWidthOrHeight( ScDocShell* pNewDocShell, - const ScMarkData& rMark, - SCCOLROW nNewStart, SCTAB nNewStartTab, - SCCOLROW nNewEnd, SCTAB nNewEndTab, - ScDocument* pNewUndoDoc, - SCCOLROW nNewCnt, SCCOLROW* pNewRanges, - ScOutlineTable* pNewUndoTab, - ScSizeMode eNewMode, sal_uInt16 nNewSizeTwips, - sal_Bool bNewWidth ); - virtual ~ScUndoWidthOrHeight(); + TYPEINFO(); + ScUndoWidthOrHeight( ScDocShell* pNewDocShell, + const ScMarkData& rMark, + SCCOLROW nNewStart, SCTAB nNewStartTab, + SCCOLROW nNewEnd, SCTAB nNewEndTab, + ScDocument* pNewUndoDoc, + SCCOLROW nNewCnt, SCCOLROW* pNewRanges, + ScOutlineTable* pNewUndoTab, + ScSizeMode eNewMode, sal_uInt16 nNewSizeTwips, + sal_Bool bNewWidth ); + virtual ~ScUndoWidthOrHeight(); - virtual void Undo(); - virtual void Redo(); - virtual void Repeat(SfxRepeatTarget& rTarget); - virtual sal_Bool CanRepeat(SfxRepeatTarget& rTarget) const; + virtual void Undo(); + virtual void Redo(); + virtual void Repeat(SfxRepeatTarget& rTarget); + virtual bool CanRepeat(SfxRepeatTarget& rTarget) const; - virtual OUString GetComment() const; + virtual OUString GetComment() const; private: ScMarkData aMarkData; @@ -413,7 +413,7 @@ public: virtual void Undo(); virtual void Redo(); virtual void Repeat(SfxRepeatTarget& rTarget); - virtual sal_Bool CanRepeat(SfxRepeatTarget& rTarget) const; + virtual bool CanRepeat(SfxRepeatTarget& rTarget) const; virtual OUString GetComment() const; @@ -445,7 +445,7 @@ public: virtual void Undo(); virtual void Redo(); virtual void Repeat(SfxRepeatTarget& rTarget); - virtual sal_Bool CanRepeat(SfxRepeatTarget& rTarget) const; + virtual bool CanRepeat(SfxRepeatTarget& rTarget) const; virtual OUString GetComment() const; @@ -472,7 +472,7 @@ public: virtual void Undo(); virtual void Redo(); virtual void Repeat(SfxRepeatTarget& rTarget); - virtual sal_Bool CanRepeat(SfxRepeatTarget& rTarget) const; + virtual bool CanRepeat(SfxRepeatTarget& rTarget) const; virtual OUString GetComment() const; @@ -498,7 +498,7 @@ public: virtual void Undo(); virtual void Redo(); virtual void Repeat(SfxRepeatTarget& rTarget); - virtual sal_Bool CanRepeat(SfxRepeatTarget& rTarget) const; + virtual bool CanRepeat(SfxRepeatTarget& rTarget) const; virtual OUString GetComment() const; @@ -533,7 +533,7 @@ public: virtual void Undo(); virtual void Redo(); virtual void Repeat(SfxRepeatTarget& rTarget); - virtual sal_Bool CanRepeat(SfxRepeatTarget& rTarget) const; + virtual bool CanRepeat(SfxRepeatTarget& rTarget) const; virtual OUString GetComment() const; @@ -551,49 +551,48 @@ private: class ScUndoConversion : public ScSimpleUndo { public: - TYPEINFO(); + TYPEINFO(); - ScUndoConversion( - ScDocShell* pNewDocShell, const ScMarkData& rMark, - SCCOL nCurX, SCROW nCurY, SCTAB nCurZ, ScDocument* pNewUndoDoc, - SCCOL nNewX, SCROW nNewY, SCTAB nNewZ, ScDocument* pNewRedoDoc, - const ScConversionParam& rConvParam ); - virtual ~ScUndoConversion(); + ScUndoConversion( ScDocShell* pNewDocShell, const ScMarkData& rMark, + SCCOL nCurX, SCROW nCurY, SCTAB nCurZ, ScDocument* pNewUndoDoc, + SCCOL nNewX, SCROW nNewY, SCTAB nNewZ, ScDocument* pNewRedoDoc, + const ScConversionParam& rConvParam ); + virtual ~ScUndoConversion(); - virtual void Undo(); - virtual void Redo(); - virtual void Repeat(SfxRepeatTarget& rTarget); - virtual sal_Bool CanRepeat(SfxRepeatTarget& rTarget) const; + virtual void Undo(); + virtual void Redo(); + virtual void Repeat(SfxRepeatTarget& rTarget); + virtual bool CanRepeat(SfxRepeatTarget& rTarget) const; - virtual OUString GetComment() const; + virtual OUString GetComment() const; private: - ScMarkData aMarkData; - ScAddress aCursorPos; - ScDocument* pUndoDoc; // Block mark and deleted data - ScAddress aNewCursorPos; - ScDocument* pRedoDoc; // Block mark and new data - sal_uLong nStartChangeAction; - sal_uLong nEndChangeAction; - ScConversionParam maConvParam; /// Conversion type and parameters. + ScMarkData aMarkData; + ScAddress aCursorPos; + ScDocument* pUndoDoc; // Block mark and deleted data + ScAddress aNewCursorPos; + ScDocument* pRedoDoc; // Block mark and new data + sal_uLong nStartChangeAction; + sal_uLong nEndChangeAction; + ScConversionParam maConvParam; /// Conversion type and parameters. - void DoChange( ScDocument* pRefDoc, const ScAddress& rCursorPos ); - void SetChangeTrack(); + void DoChange( ScDocument* pRefDoc, const ScAddress& rCursorPos ); + void SetChangeTrack(); }; class ScUndoRefConversion: public ScSimpleUndo { public: - TYPEINFO(); - ScUndoRefConversion( ScDocShell* pNewDocShell, - const ScRange& aMarkRange, const ScMarkData& rMark, - ScDocument* pNewUndoDoc, ScDocument* pNewRedoDoc, sal_Bool bNewMulti, sal_uInt16 nNewFlag); - virtual ~ScUndoRefConversion(); + TYPEINFO(); + ScUndoRefConversion( ScDocShell* pNewDocShell, + const ScRange& aMarkRange, const ScMarkData& rMark, + ScDocument* pNewUndoDoc, ScDocument* pNewRedoDoc, sal_Bool bNewMulti, sal_uInt16 nNewFlag); + virtual ~ScUndoRefConversion(); - virtual void Undo(); - virtual void Redo(); - virtual void Repeat(SfxRepeatTarget& rTarget); - virtual sal_Bool CanRepeat(SfxRepeatTarget& rTarget) const; + virtual void Undo(); + virtual void Redo(); + virtual void Repeat(SfxRepeatTarget& rTarget); + virtual bool CanRepeat(SfxRepeatTarget& rTarget) const; virtual OUString GetComment() const; @@ -623,7 +622,7 @@ public: virtual void Undo(); virtual void Redo(); virtual void Repeat(SfxRepeatTarget& rTarget); - virtual sal_Bool CanRepeat(SfxRepeatTarget& rTarget) const; + virtual bool CanRepeat(SfxRepeatTarget& rTarget) const; virtual OUString GetComment() const; @@ -638,19 +637,19 @@ private: class ScUndoUseScenario: public ScSimpleUndo { public: - TYPEINFO(); - ScUndoUseScenario( ScDocShell* pNewDocShell, - const ScMarkData& rMark, - const ScArea& rDestArea, ScDocument* pNewUndoDoc, - const String& rNewName ); - virtual ~ScUndoUseScenario(); + TYPEINFO(); + ScUndoUseScenario( ScDocShell* pNewDocShell, + const ScMarkData& rMark, + const ScArea& rDestArea, ScDocument* pNewUndoDoc, + const String& rNewName ); + virtual ~ScUndoUseScenario(); - virtual void Undo(); - virtual void Redo(); - virtual void Repeat(SfxRepeatTarget& rTarget); - virtual sal_Bool CanRepeat(SfxRepeatTarget& rTarget) const; + virtual void Undo(); + virtual void Redo(); + virtual void Repeat(SfxRepeatTarget& rTarget); + virtual bool CanRepeat(SfxRepeatTarget& rTarget) const; - virtual OUString GetComment() const; + virtual OUString GetComment() const; private: ScDocument* pUndoDoc; @@ -674,7 +673,7 @@ public: virtual void Undo(); virtual void Redo(); virtual void Repeat(SfxRepeatTarget& rTarget); - virtual sal_Bool CanRepeat(SfxRepeatTarget& rTarget) const; + virtual bool CanRepeat(SfxRepeatTarget& rTarget) const; virtual OUString GetComment() const; virtual sal_uInt16 GetId() const; @@ -700,7 +699,7 @@ public: virtual void Undo(); virtual void Redo(); virtual void Repeat(SfxRepeatTarget& rTarget); - virtual sal_Bool CanRepeat(SfxRepeatTarget& rTarget) const; + virtual bool CanRepeat(SfxRepeatTarget& rTarget) const; virtual OUString GetComment() const; @@ -723,7 +722,7 @@ public: virtual void Undo(); virtual void Redo(); virtual void Repeat(SfxRepeatTarget& rTarget); - virtual sal_Bool CanRepeat(SfxRepeatTarget& rTarget) const; + virtual bool CanRepeat(SfxRepeatTarget& rTarget) const; virtual OUString GetComment() const; @@ -751,7 +750,7 @@ public: virtual void Undo(); virtual void Redo(); virtual void Repeat(SfxRepeatTarget& rTarget); - virtual sal_Bool CanRepeat(SfxRepeatTarget& rTarget) const; + virtual bool CanRepeat(SfxRepeatTarget& rTarget) const; virtual OUString GetComment() const; @@ -779,7 +778,7 @@ public: virtual void Undo(); virtual void Redo(); virtual void Repeat(SfxRepeatTarget& rTarget); - virtual sal_Bool CanRepeat(SfxRepeatTarget& rTarget) const; + virtual bool CanRepeat(SfxRepeatTarget& rTarget) const; virtual OUString GetComment() const; @@ -813,7 +812,7 @@ public: virtual void Undo(); virtual void Redo(); virtual void Repeat(SfxRepeatTarget& rTarget); - virtual sal_Bool CanRepeat(SfxRepeatTarget& rTarget) const; + virtual bool CanRepeat(SfxRepeatTarget& rTarget) const; virtual OUString GetComment() const; @@ -849,7 +848,7 @@ public: virtual void Undo(); virtual void Redo(); virtual void Repeat(SfxRepeatTarget& rTarget); - virtual sal_Bool CanRepeat(SfxRepeatTarget& rTarget) const; + virtual bool CanRepeat(SfxRepeatTarget& rTarget) const; virtual OUString GetComment() const; @@ -871,7 +870,7 @@ public: virtual void Undo(); virtual void Redo(); virtual void Repeat(SfxRepeatTarget& rTarget); - virtual sal_Bool CanRepeat(SfxRepeatTarget& rTarget) const; + virtual bool CanRepeat(SfxRepeatTarget& rTarget) const; virtual OUString GetComment() const; @@ -893,7 +892,7 @@ public: virtual void Undo(); virtual void Redo(); virtual void Repeat(SfxRepeatTarget& rTarget); - virtual sal_Bool CanRepeat(SfxRepeatTarget& rTarget) const; + virtual bool CanRepeat(SfxRepeatTarget& rTarget) const; virtual OUString GetComment() const; @@ -915,7 +914,7 @@ public: virtual void Undo(); virtual void Redo(); virtual void Repeat(SfxRepeatTarget& rTarget); - virtual sal_Bool CanRepeat(SfxRepeatTarget& rTarget) const; + virtual bool CanRepeat(SfxRepeatTarget& rTarget) const; virtual OUString GetComment() const; @@ -937,7 +936,7 @@ public: virtual void Undo(); virtual void Redo(); virtual void Repeat(SfxRepeatTarget& rTarget); - virtual sal_Bool CanRepeat(SfxRepeatTarget& rTarget) const; + virtual bool CanRepeat(SfxRepeatTarget& rTarget) const; virtual OUString GetComment() const; @@ -963,7 +962,7 @@ public: virtual void Undo(); virtual void Redo(); virtual void Repeat(SfxRepeatTarget& rTarget); - virtual sal_Bool CanRepeat(SfxRepeatTarget& rTarget) const; + virtual bool CanRepeat(SfxRepeatTarget& rTarget) const; virtual OUString GetComment() const; diff --git a/sc/source/ui/inc/undocell.hxx b/sc/source/ui/inc/undocell.hxx index 38651c863f1d..aacc8d91a4f4 100644 --- a/sc/source/ui/inc/undocell.hxx +++ b/sc/source/ui/inc/undocell.hxx @@ -49,7 +49,7 @@ public: virtual void Undo(); virtual void Redo(); virtual void Repeat(SfxRepeatTarget& rTarget); - virtual sal_Bool CanRepeat(SfxRepeatTarget& rTarget) const; + virtual bool CanRepeat(SfxRepeatTarget& rTarget) const; virtual OUString GetComment() const; @@ -99,7 +99,7 @@ public: virtual void Undo(); virtual void Redo(); virtual void Repeat(SfxRepeatTarget& rTarget); - virtual sal_Bool CanRepeat(SfxRepeatTarget& rTarget) const; + virtual bool CanRepeat(SfxRepeatTarget& rTarget) const; virtual OUString GetComment() const; @@ -129,7 +129,7 @@ public: virtual void Undo(); virtual void Redo(); virtual void Repeat(SfxRepeatTarget& rTarget); - virtual sal_Bool CanRepeat(SfxRepeatTarget& rTarget) const; + virtual bool CanRepeat(SfxRepeatTarget& rTarget) const; virtual OUString GetComment() const; @@ -154,7 +154,7 @@ public: virtual void Undo(); virtual void Redo(); virtual void Repeat( SfxRepeatTarget& rTarget ); - virtual sal_Bool CanRepeat( SfxRepeatTarget& rTarget ) const; + virtual bool CanRepeat( SfxRepeatTarget& rTarget ) const; virtual OUString GetComment() const; private: @@ -180,7 +180,7 @@ public: virtual void Undo(); virtual void Redo(); virtual void Repeat(SfxRepeatTarget& rTarget); - virtual sal_Bool CanRepeat(SfxRepeatTarget& rTarget) const; + virtual bool CanRepeat(SfxRepeatTarget& rTarget) const; virtual OUString GetComment() const; @@ -205,7 +205,7 @@ public: virtual void Undo(); virtual void Redo(); virtual void Repeat(SfxRepeatTarget& rTarget); - virtual sal_Bool CanRepeat(SfxRepeatTarget& rTarget) const; + virtual bool CanRepeat(SfxRepeatTarget& rTarget) const; virtual OUString GetComment() const; @@ -232,7 +232,7 @@ public: virtual void Undo(); virtual void Redo(); virtual void Repeat(SfxRepeatTarget& rTarget); - virtual sal_Bool CanRepeat(SfxRepeatTarget& rTarget) const; + virtual bool CanRepeat(SfxRepeatTarget& rTarget) const; virtual OUString GetComment() const; @@ -280,7 +280,7 @@ public: virtual void Undo(); virtual void Redo(); virtual void Repeat( SfxRepeatTarget& rTarget ); - virtual sal_Bool CanRepeat( SfxRepeatTarget& rTarget ) const; + virtual bool CanRepeat( SfxRepeatTarget& rTarget ) const; virtual OUString GetComment() const; @@ -308,7 +308,7 @@ public: virtual void Undo(); virtual void Redo(); virtual void Repeat( SfxRepeatTarget& rTarget ); - virtual sal_Bool CanRepeat( SfxRepeatTarget& rTarget ) const; + virtual bool CanRepeat( SfxRepeatTarget& rTarget ) const; virtual OUString GetComment() const; @@ -331,7 +331,7 @@ public: virtual void Undo(); virtual void Redo(); virtual void Repeat(SfxRepeatTarget& rTarget); - virtual sal_Bool CanRepeat(SfxRepeatTarget& rTarget) const; + virtual bool CanRepeat(SfxRepeatTarget& rTarget) const; virtual OUString GetComment() const; @@ -356,7 +356,7 @@ public: virtual void Undo(); virtual void Redo(); virtual void Repeat(SfxRepeatTarget& rTarget); - virtual sal_Bool CanRepeat(SfxRepeatTarget& rTarget) const; + virtual bool CanRepeat(SfxRepeatTarget& rTarget) const; virtual OUString GetComment() const; diff --git a/sc/source/ui/inc/undodat.hxx b/sc/source/ui/inc/undodat.hxx index e4d28396717b..2ab4158b21cb 100644 --- a/sc/source/ui/inc/undodat.hxx +++ b/sc/source/ui/inc/undodat.hxx @@ -55,7 +55,7 @@ public: virtual void Undo(); virtual void Redo(); virtual void Repeat(SfxRepeatTarget& rTarget); - virtual sal_Bool CanRepeat(SfxRepeatTarget& rTarget) const; + virtual bool CanRepeat(SfxRepeatTarget& rTarget) const; virtual OUString GetComment() const; @@ -85,7 +85,7 @@ public: virtual void Undo(); virtual void Redo(); virtual void Repeat(SfxRepeatTarget& rTarget); - virtual sal_Bool CanRepeat(SfxRepeatTarget& rTarget) const; + virtual bool CanRepeat(SfxRepeatTarget& rTarget) const; virtual OUString GetComment() const; @@ -111,7 +111,7 @@ public: virtual void Undo(); virtual void Redo(); virtual void Repeat(SfxRepeatTarget& rTarget); - virtual sal_Bool CanRepeat(SfxRepeatTarget& rTarget) const; + virtual bool CanRepeat(SfxRepeatTarget& rTarget) const; virtual OUString GetComment() const; @@ -140,7 +140,7 @@ public: virtual void Undo(); virtual void Redo(); virtual void Repeat(SfxRepeatTarget& rTarget); - virtual sal_Bool CanRepeat(SfxRepeatTarget& rTarget) const; + virtual bool CanRepeat(SfxRepeatTarget& rTarget) const; virtual OUString GetComment() const; @@ -166,7 +166,7 @@ public: virtual void Undo(); virtual void Redo(); virtual void Repeat(SfxRepeatTarget& rTarget); - virtual sal_Bool CanRepeat(SfxRepeatTarget& rTarget) const; + virtual bool CanRepeat(SfxRepeatTarget& rTarget) const; virtual OUString GetComment() const; @@ -191,7 +191,7 @@ public: virtual void Undo(); virtual void Redo(); virtual void Repeat(SfxRepeatTarget& rTarget); - virtual sal_Bool CanRepeat(SfxRepeatTarget& rTarget) const; + virtual bool CanRepeat(SfxRepeatTarget& rTarget) const; virtual OUString GetComment() const; @@ -217,7 +217,7 @@ public: virtual void Undo(); virtual void Redo(); virtual void Repeat(SfxRepeatTarget& rTarget); - virtual sal_Bool CanRepeat(SfxRepeatTarget& rTarget) const; + virtual bool CanRepeat(SfxRepeatTarget& rTarget) const; virtual OUString GetComment() const; @@ -246,7 +246,7 @@ public: virtual void Undo(); virtual void Redo(); virtual void Repeat(SfxRepeatTarget& rTarget); - virtual sal_Bool CanRepeat(SfxRepeatTarget& rTarget) const; + virtual bool CanRepeat(SfxRepeatTarget& rTarget) const; virtual OUString GetComment() const; @@ -273,7 +273,7 @@ public: virtual void Undo(); virtual void Redo(); virtual void Repeat(SfxRepeatTarget& rTarget); - virtual sal_Bool CanRepeat(SfxRepeatTarget& rTarget) const; + virtual bool CanRepeat(SfxRepeatTarget& rTarget) const; virtual OUString GetComment() const; @@ -308,7 +308,7 @@ public: virtual void Undo(); virtual void Redo(); virtual void Repeat(SfxRepeatTarget& rTarget); - virtual sal_Bool CanRepeat(SfxRepeatTarget& rTarget) const; + virtual bool CanRepeat(SfxRepeatTarget& rTarget) const; virtual OUString GetComment() const; }; @@ -325,7 +325,7 @@ public: virtual void Undo(); virtual void Redo(); virtual void Repeat(SfxRepeatTarget& rTarget); - virtual sal_Bool CanRepeat(SfxRepeatTarget& rTarget) const; + virtual bool CanRepeat(SfxRepeatTarget& rTarget) const; virtual OUString GetComment() const; @@ -349,7 +349,7 @@ public: virtual void Undo(); virtual void Redo(); virtual void Repeat(SfxRepeatTarget& rTarget); - virtual sal_Bool CanRepeat(SfxRepeatTarget& rTarget) const; + virtual bool CanRepeat(SfxRepeatTarget& rTarget) const; virtual OUString GetComment() const; @@ -382,7 +382,7 @@ public: virtual void Undo(); virtual void Redo(); virtual void Repeat(SfxRepeatTarget& rTarget); - virtual sal_Bool CanRepeat(SfxRepeatTarget& rTarget) const; + virtual bool CanRepeat(SfxRepeatTarget& rTarget) const; virtual OUString GetComment() const; @@ -414,7 +414,7 @@ public: virtual void Undo(); virtual void Redo(); virtual void Repeat(SfxRepeatTarget& rTarget); - virtual sal_Bool CanRepeat(SfxRepeatTarget& rTarget) const; + virtual bool CanRepeat(SfxRepeatTarget& rTarget) const; virtual OUString GetComment() const; @@ -441,7 +441,7 @@ public: virtual void Undo(); virtual void Redo(); virtual void Repeat(SfxRepeatTarget& rTarget); - virtual sal_Bool CanRepeat(SfxRepeatTarget& rTarget) const; + virtual bool CanRepeat(SfxRepeatTarget& rTarget) const; virtual OUString GetComment() const; @@ -471,7 +471,7 @@ public: virtual void Undo(); virtual void Redo(); virtual void Repeat(SfxRepeatTarget& rTarget); - virtual sal_Bool CanRepeat(SfxRepeatTarget& rTarget) const; + virtual bool CanRepeat(SfxRepeatTarget& rTarget) const; virtual OUString GetComment() const; @@ -507,7 +507,7 @@ public: virtual void Undo(); virtual void Redo(); virtual void Repeat(SfxRepeatTarget& rTarget); - virtual sal_Bool CanRepeat(SfxRepeatTarget& rTarget) const; + virtual bool CanRepeat(SfxRepeatTarget& rTarget) const; virtual OUString GetComment() const; diff --git a/sc/source/ui/inc/undodraw.hxx b/sc/source/ui/inc/undodraw.hxx index 97c1c00a723f..4a1fab00c867 100644 --- a/sc/source/ui/inc/undodraw.hxx +++ b/sc/source/ui/inc/undodraw.hxx @@ -44,8 +44,8 @@ public: virtual void Undo(); virtual void Redo(); virtual void Repeat(SfxRepeatTarget& rTarget); - virtual sal_Bool CanRepeat(SfxRepeatTarget& rTarget) const; - virtual sal_Bool Merge( SfxUndoAction *pNextAction ); + virtual bool CanRepeat(SfxRepeatTarget& rTarget) const; + virtual bool Merge( SfxUndoAction *pNextAction ); virtual OUString GetComment() const; virtual OUString GetRepeatComment(SfxRepeatTarget&) const; virtual sal_uInt16 GetId() const; diff --git a/sc/source/ui/inc/undostyl.hxx b/sc/source/ui/inc/undostyl.hxx index 59bc7c8197d7..e50ae2dc9014 100644 --- a/sc/source/ui/inc/undostyl.hxx +++ b/sc/source/ui/inc/undostyl.hxx @@ -70,7 +70,7 @@ public: virtual void Undo(); virtual void Redo(); virtual void Repeat(SfxRepeatTarget& rTarget); - virtual sal_Bool CanRepeat(SfxRepeatTarget& rTarget) const; + virtual bool CanRepeat(SfxRepeatTarget& rTarget) const; virtual OUString GetComment() const; }; @@ -87,7 +87,7 @@ public: virtual void Undo(); virtual void Redo(); virtual void Repeat(SfxRepeatTarget& rTarget); - virtual sal_Bool CanRepeat(SfxRepeatTarget& rTarget) const; + virtual bool CanRepeat(SfxRepeatTarget& rTarget) const; virtual OUString GetComment() const; diff --git a/sc/source/ui/inc/undotab.hxx b/sc/source/ui/inc/undotab.hxx index a1fa0f59d263..96d6a3f25b30 100644 --- a/sc/source/ui/inc/undotab.hxx +++ b/sc/source/ui/inc/undotab.hxx @@ -58,7 +58,7 @@ public: virtual void Undo(); virtual void Redo(); virtual void Repeat(SfxRepeatTarget& rTarget); - virtual sal_Bool CanRepeat(SfxRepeatTarget& rTarget) const; + virtual bool CanRepeat(SfxRepeatTarget& rTarget) const; virtual OUString GetComment() const; @@ -85,7 +85,7 @@ public: virtual void Undo(); virtual void Redo(); virtual void Repeat(SfxRepeatTarget& rTarget); - virtual sal_Bool CanRepeat(SfxRepeatTarget& rTarget) const; + virtual bool CanRepeat(SfxRepeatTarget& rTarget) const; virtual OUString GetComment() const; @@ -115,7 +115,7 @@ public: virtual void Undo(); virtual void Redo(); virtual void Repeat(SfxRepeatTarget& rTarget); - virtual sal_Bool CanRepeat(SfxRepeatTarget& rTarget) const; + virtual bool CanRepeat(SfxRepeatTarget& rTarget) const; virtual OUString GetComment() const; @@ -142,7 +142,7 @@ public: virtual void Undo(); virtual void Redo(); virtual void Repeat(SfxRepeatTarget& rTarget); - virtual sal_Bool CanRepeat(SfxRepeatTarget& rTarget) const; + virtual bool CanRepeat(SfxRepeatTarget& rTarget) const; virtual OUString GetComment() const; @@ -171,7 +171,7 @@ public: virtual void Undo(); virtual void Redo(); virtual void Repeat(SfxRepeatTarget& rTarget); - virtual sal_Bool CanRepeat(SfxRepeatTarget& rTarget) const; + virtual bool CanRepeat(SfxRepeatTarget& rTarget) const; virtual OUString GetComment() const; @@ -200,7 +200,7 @@ public: virtual void Undo(); virtual void Redo(); virtual void Repeat(SfxRepeatTarget& rTarget); - virtual sal_Bool CanRepeat(SfxRepeatTarget& rTarget) const; + virtual bool CanRepeat(SfxRepeatTarget& rTarget) const; virtual OUString GetComment() const; @@ -230,7 +230,7 @@ public: virtual void Undo(); virtual void Redo(); virtual void Repeat(SfxRepeatTarget& rTarget); - virtual sal_Bool CanRepeat(SfxRepeatTarget& rTarget) const; + virtual bool CanRepeat(SfxRepeatTarget& rTarget) const; virtual OUString GetComment() const; @@ -255,7 +255,7 @@ public: virtual void Undo(); virtual void Redo(); virtual void Repeat(SfxRepeatTarget& rTarget); - virtual sal_Bool CanRepeat(SfxRepeatTarget& rTarget) const; + virtual bool CanRepeat(SfxRepeatTarget& rTarget) const; virtual OUString GetComment() const; @@ -283,7 +283,7 @@ public: virtual void Undo(); virtual void Redo(); virtual void Repeat(SfxRepeatTarget& rTarget); - virtual sal_Bool CanRepeat(SfxRepeatTarget& rTarget) const; + virtual bool CanRepeat(SfxRepeatTarget& rTarget) const; virtual OUString GetComment() const; @@ -309,7 +309,7 @@ public: virtual void Undo(); virtual void Redo(); virtual void Repeat(SfxRepeatTarget& rTarget); - virtual sal_Bool CanRepeat(SfxRepeatTarget& rTarget) const; + virtual bool CanRepeat(SfxRepeatTarget& rTarget) const; virtual OUString GetComment() const; @@ -340,7 +340,7 @@ public: virtual void Undo(); virtual void Redo(); virtual void Repeat(SfxRepeatTarget& rTarget); - virtual sal_Bool CanRepeat(SfxRepeatTarget& rTarget) const; + virtual bool CanRepeat(SfxRepeatTarget& rTarget) const; virtual OUString GetComment() const; @@ -366,7 +366,7 @@ public: virtual void Undo(); virtual void Redo(); virtual void Repeat(SfxRepeatTarget& rTarget); - virtual sal_Bool CanRepeat(SfxRepeatTarget& rTarget) const; + virtual bool CanRepeat(SfxRepeatTarget& rTarget) const; virtual OUString GetComment() const; @@ -394,7 +394,7 @@ public: virtual void Undo(); virtual void Redo(); virtual void Repeat(SfxRepeatTarget& rTarget); - virtual sal_Bool CanRepeat(SfxRepeatTarget& rTarget) const; + virtual bool CanRepeat(SfxRepeatTarget& rTarget) const; virtual OUString GetComment() const; @@ -419,7 +419,7 @@ public: virtual void Undo(); virtual void Redo(); virtual void Repeat(SfxRepeatTarget& rTarget); - virtual sal_Bool CanRepeat(SfxRepeatTarget& rTarget) const; + virtual bool CanRepeat(SfxRepeatTarget& rTarget) const; virtual OUString GetComment() const; @@ -448,7 +448,7 @@ public: virtual void Undo(); virtual void Redo(); virtual void Repeat(SfxRepeatTarget& rTarget); - virtual sal_Bool CanRepeat(SfxRepeatTarget& rTarget) const; + virtual bool CanRepeat(SfxRepeatTarget& rTarget) const; virtual OUString GetComment() const; @@ -478,7 +478,7 @@ public: virtual void Undo(); virtual void Redo(); virtual void Repeat(SfxRepeatTarget& rTarget); - virtual sal_Bool CanRepeat(SfxRepeatTarget& rTarget) const; + virtual bool CanRepeat(SfxRepeatTarget& rTarget) const; virtual OUString GetComment() const; @@ -501,7 +501,7 @@ public: virtual void Undo(); virtual void Redo(); virtual void Repeat(SfxRepeatTarget& rTarget); - virtual sal_Bool CanRepeat(SfxRepeatTarget& rTarget) const; + virtual bool CanRepeat(SfxRepeatTarget& rTarget) const; virtual OUString GetComment() const; diff --git a/sc/source/ui/miscdlgs/autofmt.cxx b/sc/source/ui/miscdlgs/autofmt.cxx index d0548dbcc151..425014f378a5 100644 --- a/sc/source/ui/miscdlgs/autofmt.cxx +++ b/sc/source/ui/miscdlgs/autofmt.cxx @@ -188,7 +188,7 @@ void ScAutoFmtPreview::DrawString( size_t nCol, size_t nRow ) // Ausgabe des Zelltextes: //------------------------ - String cellString; + OUString cellString; sal_Bool bNumFormat = pCurData->GetIncludeValueFormat(); sal_uLong nNum; double nVal; @@ -241,7 +241,7 @@ void ScAutoFmtPreview::DrawString( size_t nCol, size_t nRow ) break; } - if ( cellString.Len() > 0 ) + if ( !cellString.isEmpty()) { Size aStrSize; sal_uInt16 nFmtIndex = GetFormatIndex( nCol, nRow ); @@ -283,12 +283,12 @@ void ScAutoFmtPreview::DrawString( size_t nCol, size_t nRow ) aStrSize = aScriptedText.GetTextSize(); } while ( ( theMaxStrSize.Width() <= aStrSize.Width() ) - && ( cellString.Len() > 1 ) ) + && ( cellString.getLength() > 1 ) ) { if( eJustification == SVX_HOR_JUSTIFY_RIGHT ) - cellString.Erase( 0, 1 ); + cellString = cellString.copy(1); else - cellString.Erase( cellString.Len() - 1 ); + cellString = cellString.copy(0, cellString.getLength() - 1 ); aScriptedText.SetText( cellString, xBreakIter ); aStrSize = aScriptedText.GetTextSize(); diff --git a/sc/source/ui/miscdlgs/filldlg.cxx b/sc/source/ui/miscdlgs/filldlg.cxx index 339cb03cf024..f174afdea142 100644 --- a/sc/source/ui/miscdlgs/filldlg.cxx +++ b/sc/source/ui/miscdlgs/filldlg.cxx @@ -198,11 +198,11 @@ void ScFillSeriesDlg::Init( sal_uInt16 nPossDir ) aEdStartVal.SetText( aStartStrVal); - String aIncrTxt; + OUString aIncrTxt; rDoc.GetFormatTable()->GetInputLineString( fIncrement, 0, aIncrTxt ); aEdIncrement.SetText( aIncrTxt ); - String aEndTxt; + OUString aEndTxt; if ( fEndVal != MAXDOUBLE ) rDoc.GetFormatTable()->GetInputLineString( fEndVal, 0, aEndTxt ); aEdEndVal.SetText( aEndTxt ); diff --git a/sc/source/ui/undo/undobase.cxx b/sc/source/ui/undo/undobase.cxx index 4acff4960114..955d2ba4be51 100644 --- a/sc/source/ui/undo/undobase.cxx +++ b/sc/source/ui/undo/undobase.cxx @@ -64,7 +64,7 @@ bool ScSimpleUndo::SetViewMarkData( const ScMarkData& rMarkData ) return true; } -sal_Bool ScSimpleUndo::Merge( SfxUndoAction *pNextAction ) +bool ScSimpleUndo::Merge( SfxUndoAction *pNextAction ) { // A SdrUndoGroup for updating detective arrows can belong // to each Undo-Action. @@ -569,7 +569,7 @@ void ScUndoWrapper::SetLinkToSfxLinkUndoAction(SfxLinkUndoAction* pSfxLinkUndoAc SetLinkToSfxLinkUndoAction(pSfxLinkUndoAction); } -sal_Bool ScUndoWrapper::Merge( SfxUndoAction* pNextAction ) +bool ScUndoWrapper::Merge( SfxUndoAction* pNextAction ) { if (pWrappedUndo) return pWrappedUndo->Merge(pNextAction); @@ -595,7 +595,7 @@ void ScUndoWrapper::Repeat(SfxRepeatTarget& rTarget) pWrappedUndo->Repeat(rTarget); } -sal_Bool ScUndoWrapper::CanRepeat(SfxRepeatTarget& rTarget) const +bool ScUndoWrapper::CanRepeat(SfxRepeatTarget& rTarget) const { if (pWrappedUndo) return pWrappedUndo->CanRepeat(rTarget); diff --git a/sc/source/ui/undo/undoblk.cxx b/sc/source/ui/undo/undoblk.cxx index a6049f1dba78..ce78a8f7ae57 100644 --- a/sc/source/ui/undo/undoblk.cxx +++ b/sc/source/ui/undo/undoblk.cxx @@ -115,7 +115,7 @@ OUString ScUndoInsertCells::GetComment() const return ScGlobal::GetRscString( pPasteUndo ? STR_UNDO_PASTE : STR_UNDO_INSERTCELLS ); } -sal_Bool ScUndoInsertCells::Merge( SfxUndoAction* pNextAction ) +bool ScUndoInsertCells::Merge( SfxUndoAction* pNextAction ) { // If a paste undo action has already been added, append (detective) action there. if ( pPasteUndo ) @@ -132,7 +132,7 @@ sal_Bool ScUndoInsertCells::Merge( SfxUndoAction* pNextAction ) pPasteUndo = pWrappedAction; pWrapper->ForgetWrappedUndo(); // pWrapper is deleted by UndoManager - return sal_True; + return true; } } @@ -312,9 +312,9 @@ void ScUndoInsertCells::Repeat(SfxRepeatTarget& rTarget) } } -sal_Bool ScUndoInsertCells::CanRepeat(SfxRepeatTarget& rTarget) const +bool ScUndoInsertCells::CanRepeat(SfxRepeatTarget& rTarget) const { - return (rTarget.ISA(ScTabViewTarget)); + return rTarget.ISA(ScTabViewTarget); } @@ -547,9 +547,9 @@ void ScUndoDeleteCells::Repeat(SfxRepeatTarget& rTarget) ((ScTabViewTarget&)rTarget).GetViewShell()->DeleteCells( eCmd, sal_True ); } -sal_Bool ScUndoDeleteCells::CanRepeat(SfxRepeatTarget& rTarget) const +bool ScUndoDeleteCells::CanRepeat(SfxRepeatTarget& rTarget) const { - return (rTarget.ISA(ScTabViewTarget)); + return rTarget.ISA(ScTabViewTarget); } // delete cells in multiselection @@ -730,9 +730,9 @@ void ScUndoDeleteMulti::Repeat(SfxRepeatTarget& rTarget) ((ScTabViewTarget&)rTarget).GetViewShell()->DeleteCells( DEL_DELROWS, sal_True ); } -sal_Bool ScUndoDeleteMulti::CanRepeat(SfxRepeatTarget& rTarget) const +bool ScUndoDeleteMulti::CanRepeat(SfxRepeatTarget& rTarget) const { - return (rTarget.ISA(ScTabViewTarget)); + return rTarget.ISA(ScTabViewTarget); } @@ -830,9 +830,9 @@ void ScUndoCut::Repeat(SfxRepeatTarget& rTarget) ((ScTabViewTarget&)rTarget).GetViewShell()->CutToClip( NULL, sal_True ); } -sal_Bool ScUndoCut::CanRepeat(SfxRepeatTarget& rTarget) const +bool ScUndoCut::CanRepeat(SfxRepeatTarget& rTarget) const { - return (rTarget.ISA(ScTabViewTarget)); + return rTarget.ISA(ScTabViewTarget); } ScUndoPaste::ScUndoPaste( ScDocShell* pNewDocShell, const ScRangeList& rRanges, @@ -1098,9 +1098,9 @@ void ScUndoPaste::Repeat(SfxRepeatTarget& rTarget) } } -sal_Bool ScUndoPaste::CanRepeat(SfxRepeatTarget& rTarget) const +bool ScUndoPaste::CanRepeat(SfxRepeatTarget& rTarget) const { - return (rTarget.ISA(ScTabViewTarget)); + return rTarget.ISA(ScTabViewTarget); } ScUndoDragDrop::ScUndoDragDrop( ScDocShell* pNewDocShell, @@ -1340,7 +1340,7 @@ void ScUndoDragDrop::Repeat(SfxRepeatTarget& /* rTarget */) { } -sal_Bool ScUndoDragDrop::CanRepeat(SfxRepeatTarget& /* rTarget */) const +bool ScUndoDragDrop::CanRepeat(SfxRepeatTarget& /* rTarget */) const { return false; // not possible } @@ -1399,9 +1399,9 @@ void ScUndoListNames::Repeat(SfxRepeatTarget& rTarget) ((ScTabViewTarget&)rTarget).GetViewShell()->InsertNameList(); } -sal_Bool ScUndoListNames::CanRepeat(SfxRepeatTarget& rTarget) const +bool ScUndoListNames::CanRepeat(SfxRepeatTarget& rTarget) const { - return (rTarget.ISA(ScTabViewTarget)); + return rTarget.ISA(ScTabViewTarget); } ScUndoUseScenario::ScUndoUseScenario( ScDocShell* pNewDocShell, @@ -1514,7 +1514,7 @@ void ScUndoUseScenario::Repeat(SfxRepeatTarget& rTarget) } } -sal_Bool ScUndoUseScenario::CanRepeat(SfxRepeatTarget& rTarget) const +bool ScUndoUseScenario::CanRepeat(SfxRepeatTarget& rTarget) const { if (rTarget.ISA(ScTabViewTarget)) { @@ -1624,9 +1624,9 @@ void ScUndoSelectionStyle::Repeat(SfxRepeatTarget& rTarget) } } -sal_Bool ScUndoSelectionStyle::CanRepeat(SfxRepeatTarget& rTarget) const +bool ScUndoSelectionStyle::CanRepeat(SfxRepeatTarget& rTarget) const { - return (rTarget.ISA(ScTabViewTarget)); + return rTarget.ISA(ScTabViewTarget); } sal_uInt16 ScUndoSelectionStyle::GetId() const @@ -1714,9 +1714,9 @@ void ScUndoEnterMatrix::Repeat(SfxRepeatTarget& rTarget) } } -sal_Bool ScUndoEnterMatrix::CanRepeat(SfxRepeatTarget& rTarget) const +bool ScUndoEnterMatrix::CanRepeat(SfxRepeatTarget& rTarget) const { - return (rTarget.ISA(ScTabViewTarget)); + return rTarget.ISA(ScTabViewTarget); } static ScRange lcl_GetMultiMarkRange( const ScMarkData& rMark ) @@ -1780,9 +1780,9 @@ void ScUndoIndent::Repeat(SfxRepeatTarget& rTarget) ((ScTabViewTarget&)rTarget).GetViewShell()->ChangeIndent( bIsIncrement ); } -sal_Bool ScUndoIndent::CanRepeat(SfxRepeatTarget& rTarget) const +bool ScUndoIndent::CanRepeat(SfxRepeatTarget& rTarget) const { - return (rTarget.ISA(ScTabViewTarget)); + return rTarget.ISA(ScTabViewTarget); } ScUndoTransliterate::ScUndoTransliterate( ScDocShell* pNewDocShell, const ScMarkData& rMark, @@ -1836,9 +1836,9 @@ void ScUndoTransliterate::Repeat(SfxRepeatTarget& rTarget) ((ScTabViewTarget&)rTarget).GetViewShell()->TransliterateText( nTransliterationType ); } -sal_Bool ScUndoTransliterate::CanRepeat(SfxRepeatTarget& rTarget) const +bool ScUndoTransliterate::CanRepeat(SfxRepeatTarget& rTarget) const { - return (rTarget.ISA(ScTabViewTarget)); + return rTarget.ISA(ScTabViewTarget); } ScUndoClearItems::ScUndoClearItems( ScDocShell* pNewDocShell, const ScMarkData& rMark, @@ -1900,9 +1900,9 @@ void ScUndoClearItems::Repeat(SfxRepeatTarget& rTarget) } } -sal_Bool ScUndoClearItems::CanRepeat(SfxRepeatTarget& rTarget) const +bool ScUndoClearItems::CanRepeat(SfxRepeatTarget& rTarget) const { - return (rTarget.ISA(ScTabViewTarget)); + return rTarget.ISA(ScTabViewTarget); } // remove all line breaks of a table @@ -1964,9 +1964,9 @@ void ScUndoRemoveBreaks::Repeat(SfxRepeatTarget& rTarget) } } -sal_Bool ScUndoRemoveBreaks::CanRepeat(SfxRepeatTarget& rTarget) const +bool ScUndoRemoveBreaks::CanRepeat(SfxRepeatTarget& rTarget) const { - return (rTarget.ISA(ScTabViewTarget)); + return rTarget.ISA(ScTabViewTarget); } ScUndoRemoveMerge::ScUndoRemoveMerge( ScDocShell* pNewDocShell, @@ -2072,9 +2072,9 @@ void ScUndoRemoveMerge::Repeat(SfxRepeatTarget& rTarget) ((ScTabViewTarget&)rTarget).GetViewShell()->RemoveMerge(); } -sal_Bool ScUndoRemoveMerge::CanRepeat(SfxRepeatTarget& rTarget) const +bool ScUndoRemoveMerge::CanRepeat(SfxRepeatTarget& rTarget) const { - return (rTarget.ISA(ScTabViewTarget)); + return rTarget.ISA(ScTabViewTarget); } void ScUndoRemoveMerge::SetCurTab() @@ -2170,7 +2170,7 @@ void ScUndoBorder::Repeat(SfxRepeatTarget& /* rTarget */) //TODO later (when the function has moved from cellsuno to docfunc) } -sal_Bool ScUndoBorder::CanRepeat(SfxRepeatTarget& /* rTarget */) const +bool ScUndoBorder::CanRepeat(SfxRepeatTarget& /* rTarget */) const { return false; // See above } diff --git a/sc/source/ui/undo/undoblk2.cxx b/sc/source/ui/undo/undoblk2.cxx index 384c8bce7a53..4a2547a92b3a 100644 --- a/sc/source/ui/undo/undoblk2.cxx +++ b/sc/source/ui/undo/undoblk2.cxx @@ -168,9 +168,9 @@ void ScUndoWidthOrHeight::Repeat(SfxRepeatTarget& rTarget) ((ScTabViewTarget&)rTarget).GetViewShell()->SetMarkedWidthOrHeight( bWidth, eMode, nNewSize, sal_True ); } -sal_Bool ScUndoWidthOrHeight::CanRepeat(SfxRepeatTarget& rTarget) const +bool ScUndoWidthOrHeight::CanRepeat(SfxRepeatTarget& rTarget) const { - return (rTarget.ISA(ScTabViewTarget)); + return rTarget.ISA(ScTabViewTarget); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/undo/undoblk3.cxx b/sc/source/ui/undo/undoblk3.cxx index 124251f07097..6a527f3e79aa 100644 --- a/sc/source/ui/undo/undoblk3.cxx +++ b/sc/source/ui/undo/undoblk3.cxx @@ -214,9 +214,9 @@ void ScUndoDeleteContents::Repeat(SfxRepeatTarget& rTarget) ((ScTabViewTarget&)rTarget).GetViewShell()->DeleteContents( nFlags, sal_True ); } -sal_Bool ScUndoDeleteContents::CanRepeat(SfxRepeatTarget& rTarget) const +bool ScUndoDeleteContents::CanRepeat(SfxRepeatTarget& rTarget) const { - return (rTarget.ISA(ScTabViewTarget)); + return rTarget.ISA(ScTabViewTarget); } ScUndoFillTable::ScUndoFillTable( ScDocShell* pNewDocShell, @@ -347,9 +347,9 @@ void ScUndoFillTable::Repeat(SfxRepeatTarget& rTarget) ((ScTabViewTarget&)rTarget).GetViewShell()->FillTab( nFlags, nFunction, bSkipEmpty, bAsLink ); } -sal_Bool ScUndoFillTable::CanRepeat(SfxRepeatTarget& rTarget) const +bool ScUndoFillTable::CanRepeat(SfxRepeatTarget& rTarget) const { - return (rTarget.ISA(ScTabViewTarget)); + return rTarget.ISA(ScTabViewTarget); } ScUndoSelectionAttr::ScUndoSelectionAttr( ScDocShell* pNewDocShell, @@ -487,9 +487,9 @@ void ScUndoSelectionAttr::Repeat(SfxRepeatTarget& rTarget) } } -sal_Bool ScUndoSelectionAttr::CanRepeat(SfxRepeatTarget& rTarget) const +bool ScUndoSelectionAttr::CanRepeat(SfxRepeatTarget& rTarget) const { - return (rTarget.ISA(ScTabViewTarget)); + return rTarget.ISA(ScTabViewTarget); } ScUndoAutoFill::ScUndoAutoFill( ScDocShell* pNewDocShell, @@ -635,9 +635,9 @@ void ScUndoAutoFill::Repeat(SfxRepeatTarget& rTarget) } } -sal_Bool ScUndoAutoFill::CanRepeat(SfxRepeatTarget& rTarget) const +bool ScUndoAutoFill::CanRepeat(SfxRepeatTarget& rTarget) const { - return (rTarget.ISA(ScTabViewTarget)); + return rTarget.ISA(ScTabViewTarget); } ScUndoMerge::ScUndoMerge( ScDocShell* pNewDocShell, const ScCellMergeOption& rOption, @@ -760,9 +760,9 @@ void ScUndoMerge::Repeat(SfxRepeatTarget& rTarget) } } -sal_Bool ScUndoMerge::CanRepeat(SfxRepeatTarget& rTarget) const +bool ScUndoMerge::CanRepeat(SfxRepeatTarget& rTarget) const { - return (rTarget.ISA(ScTabViewTarget)); + return rTarget.ISA(ScTabViewTarget); } ScUndoAutoFormat::ScUndoAutoFormat( ScDocShell* pNewDocShell, @@ -908,9 +908,9 @@ void ScUndoAutoFormat::Repeat(SfxRepeatTarget& rTarget) ((ScTabViewTarget&)rTarget).GetViewShell()->AutoFormat( nFormatNo, sal_True ); } -sal_Bool ScUndoAutoFormat::CanRepeat(SfxRepeatTarget& rTarget) const +bool ScUndoAutoFormat::CanRepeat(SfxRepeatTarget& rTarget) const { - return (rTarget.ISA(ScTabViewTarget)); + return rTarget.ISA(ScTabViewTarget); } ScUndoReplace::ScUndoReplace( ScDocShell* pNewDocShell, const ScMarkData& rMark, @@ -1087,9 +1087,9 @@ void ScUndoReplace::Repeat(SfxRepeatTarget& rTarget) ((ScTabViewTarget&)rTarget).GetViewShell()->SearchAndReplace( pSearchItem, sal_True, false ); } -sal_Bool ScUndoReplace::CanRepeat(SfxRepeatTarget& rTarget) const +bool ScUndoReplace::CanRepeat(SfxRepeatTarget& rTarget) const { - return (rTarget.ISA(ScTabViewTarget)); + return rTarget.ISA(ScTabViewTarget); } // multi-operation (only simple blocks) @@ -1164,7 +1164,7 @@ void ScUndoTabOp::Repeat(SfxRepeatTarget& /* rTarget */) { } -sal_Bool ScUndoTabOp::CanRepeat(SfxRepeatTarget& /* rTarget */) const +bool ScUndoTabOp::CanRepeat(SfxRepeatTarget& /* rTarget */) const { return false; } @@ -1271,7 +1271,7 @@ void ScUndoConversion::Repeat( SfxRepeatTarget& rTarget ) ((ScTabViewTarget&)rTarget).GetViewShell()->DoSheetConversion( maConvParam, sal_True ); } -sal_Bool ScUndoConversion::CanRepeat(SfxRepeatTarget& rTarget) const +bool ScUndoConversion::CanRepeat(SfxRepeatTarget& rTarget) const { return rTarget.ISA( ScTabViewTarget ); } @@ -1357,9 +1357,9 @@ void ScUndoRefConversion::Repeat(SfxRepeatTarget& rTarget) ((ScTabViewTarget&)rTarget).GetViewShell()->DoRefConversion(); } -sal_Bool ScUndoRefConversion::CanRepeat(SfxRepeatTarget& rTarget) const +bool ScUndoRefConversion::CanRepeat(SfxRepeatTarget& rTarget) const { - return (rTarget.ISA(ScTabViewTarget)); + return rTarget.ISA(ScTabViewTarget); } ScUndoRefreshLink::ScUndoRefreshLink( ScDocShell* pNewDocShell, @@ -1465,7 +1465,7 @@ void ScUndoRefreshLink::Repeat(SfxRepeatTarget& /* rTarget */) // makes no sense } -sal_Bool ScUndoRefreshLink::CanRepeat(SfxRepeatTarget& /* rTarget */) const +bool ScUndoRefreshLink::CanRepeat(SfxRepeatTarget& /* rTarget */) const { return false; } @@ -1546,7 +1546,7 @@ void ScUndoInsertAreaLink::Repeat(SfxRepeatTarget& /* rTarget */) // makes no sense } -sal_Bool ScUndoInsertAreaLink::CanRepeat(SfxRepeatTarget& /* rTarget */) const +bool ScUndoInsertAreaLink::CanRepeat(SfxRepeatTarget& /* rTarget */) const { return false; } @@ -1608,7 +1608,7 @@ void ScUndoRemoveAreaLink::Repeat(SfxRepeatTarget& /* rTarget */) // makes no sense } -sal_Bool ScUndoRemoveAreaLink::CanRepeat(SfxRepeatTarget& /* rTarget */) const +bool ScUndoRemoveAreaLink::CanRepeat(SfxRepeatTarget& /* rTarget */) const { return false; } @@ -1745,7 +1745,7 @@ void ScUndoUpdateAreaLink::Repeat(SfxRepeatTarget& /* rTarget */) // makes no sense } -sal_Bool ScUndoUpdateAreaLink::CanRepeat(SfxRepeatTarget& /* rTarget */) const +bool ScUndoUpdateAreaLink::CanRepeat(SfxRepeatTarget& /* rTarget */) const { return false; } diff --git a/sc/source/ui/undo/undocell.cxx b/sc/source/ui/undo/undocell.cxx index 01873318e58a..f577e72f7168 100644 --- a/sc/source/ui/undo/undocell.cxx +++ b/sc/source/ui/undo/undocell.cxx @@ -158,9 +158,9 @@ void ScUndoCursorAttr::Repeat(SfxRepeatTarget& rTarget) ((ScTabViewTarget&)rTarget).GetViewShell()->ApplySelectionPattern( *pApplyPattern ); } -sal_Bool ScUndoCursorAttr::CanRepeat(SfxRepeatTarget& rTarget) const +bool ScUndoCursorAttr::CanRepeat(SfxRepeatTarget& rTarget) const { - return (rTarget.ISA(ScTabViewTarget)); + return rTarget.ISA(ScTabViewTarget); } ScUndoEnterData::Value::Value() : mnTab(-1), mbHasFormat(false), mnFormat(0) {} @@ -319,9 +319,9 @@ void ScUndoEnterData::Repeat(SfxRepeatTarget& rTarget) } } -sal_Bool ScUndoEnterData::CanRepeat(SfxRepeatTarget& rTarget) const +bool ScUndoEnterData::CanRepeat(SfxRepeatTarget& rTarget) const { - return (rTarget.ISA(ScTabViewTarget)); + return rTarget.ISA(ScTabViewTarget); } @@ -396,7 +396,7 @@ void ScUndoEnterValue::Repeat(SfxRepeatTarget& /* rTarget */) // makes no sense } -sal_Bool ScUndoEnterValue::CanRepeat(SfxRepeatTarget& /* rTarget */) const +bool ScUndoEnterValue::CanRepeat(SfxRepeatTarget& /* rTarget */) const { return false; } @@ -443,7 +443,7 @@ void ScUndoSetCell::Repeat( SfxRepeatTarget& /*rTarget*/ ) // Makes no sense. } -sal_Bool ScUndoSetCell::CanRepeat( SfxRepeatTarget& /*rTarget*/ ) const +bool ScUndoSetCell::CanRepeat( SfxRepeatTarget& /*rTarget*/ ) const { return false; } @@ -576,9 +576,9 @@ void ScUndoPageBreak::Repeat(SfxRepeatTarget& rTarget) } } -sal_Bool ScUndoPageBreak::CanRepeat(SfxRepeatTarget& rTarget) const +bool ScUndoPageBreak::CanRepeat(SfxRepeatTarget& rTarget) const { - return (rTarget.ISA(ScTabViewTarget)); + return rTarget.ISA(ScTabViewTarget); } ScUndoPrintZoom::ScUndoPrintZoom( ScDocShell* pNewDocShell, @@ -646,9 +646,9 @@ void ScUndoPrintZoom::Repeat(SfxRepeatTarget& rTarget) } } -sal_Bool ScUndoPrintZoom::CanRepeat(SfxRepeatTarget& rTarget) const +bool ScUndoPrintZoom::CanRepeat(SfxRepeatTarget& rTarget) const { - return (rTarget.ISA(ScTabViewTarget)); + return rTarget.ISA(ScTabViewTarget); } ScUndoThesaurus::ScUndoThesaurus( ScDocShell* pNewDocShell, @@ -777,9 +777,9 @@ void ScUndoThesaurus::Repeat(SfxRepeatTarget& rTarget) ((ScTabViewTarget&)rTarget).GetViewShell()->DoThesaurus( sal_True ); } -sal_Bool ScUndoThesaurus::CanRepeat(SfxRepeatTarget& rTarget) const +bool ScUndoThesaurus::CanRepeat(SfxRepeatTarget& rTarget) const { - return (rTarget.ISA(ScTabViewTarget)); + return rTarget.ISA(ScTabViewTarget); } ScUndoReplaceNote::ScUndoReplaceNote( ScDocShell& rDocShell, const ScAddress& rPos, @@ -839,7 +839,7 @@ void ScUndoReplaceNote::Repeat( SfxRepeatTarget& /*rTarget*/ ) { } -sal_Bool ScUndoReplaceNote::CanRepeat( SfxRepeatTarget& /*rTarget*/ ) const +bool ScUndoReplaceNote::CanRepeat( SfxRepeatTarget& /*rTarget*/ ) const { return false; } @@ -909,7 +909,7 @@ void ScUndoShowHideNote::Repeat( SfxRepeatTarget& /*rTarget*/ ) { } -sal_Bool ScUndoShowHideNote::CanRepeat( SfxRepeatTarget& /*rTarget*/ ) const +bool ScUndoShowHideNote::CanRepeat( SfxRepeatTarget& /*rTarget*/ ) const { return false; } @@ -1019,7 +1019,7 @@ void ScUndoDetective::Repeat(SfxRepeatTarget& /* rTarget */) // makes no sense } -sal_Bool ScUndoDetective::CanRepeat(SfxRepeatTarget& /* rTarget */) const +bool ScUndoDetective::CanRepeat(SfxRepeatTarget& /* rTarget */) const { return false; } @@ -1088,7 +1088,7 @@ void ScUndoRangeNames::Repeat(SfxRepeatTarget& /* rTarget */) // makes no sense } -sal_Bool ScUndoRangeNames::CanRepeat(SfxRepeatTarget& /* rTarget */) const +bool ScUndoRangeNames::CanRepeat(SfxRepeatTarget& /* rTarget */) const { return false; } diff --git a/sc/source/ui/undo/undodat.cxx b/sc/source/ui/undo/undodat.cxx index 83b06d55f437..7d2bb68ec486 100644 --- a/sc/source/ui/undo/undodat.cxx +++ b/sc/source/ui/undo/undodat.cxx @@ -152,7 +152,7 @@ void ScUndoDoOutline::Repeat(SfxRepeatTarget& /* rTarget */) { } -sal_Bool ScUndoDoOutline::CanRepeat(SfxRepeatTarget& /* rTarget */) const +bool ScUndoDoOutline::CanRepeat(SfxRepeatTarget& /* rTarget */) const { return false; // is not possible } @@ -235,9 +235,9 @@ void ScUndoMakeOutline::Repeat(SfxRepeatTarget& rTarget) } } -sal_Bool ScUndoMakeOutline::CanRepeat(SfxRepeatTarget& rTarget) const +bool ScUndoMakeOutline::CanRepeat(SfxRepeatTarget& rTarget) const { - return (rTarget.ISA(ScTabViewTarget)); + return rTarget.ISA(ScTabViewTarget); } ScUndoOutlineLevel::ScUndoOutlineLevel( ScDocShell* pNewDocShell, @@ -321,9 +321,9 @@ void ScUndoOutlineLevel::Repeat(SfxRepeatTarget& rTarget) ((ScTabViewTarget&)rTarget).GetViewShell()->SelectLevel( bColumns, nLevel, sal_True ); } -sal_Bool ScUndoOutlineLevel::CanRepeat(SfxRepeatTarget& rTarget) const +bool ScUndoOutlineLevel::CanRepeat(SfxRepeatTarget& rTarget) const { - return (rTarget.ISA(ScTabViewTarget)); + return rTarget.ISA(ScTabViewTarget); } /** show/hide outline over block marks */ @@ -424,9 +424,9 @@ void ScUndoOutlineBlock::Repeat(SfxRepeatTarget& rTarget) } } -sal_Bool ScUndoOutlineBlock::CanRepeat(SfxRepeatTarget& rTarget) const +bool ScUndoOutlineBlock::CanRepeat(SfxRepeatTarget& rTarget) const { - return (rTarget.ISA(ScTabViewTarget)); + return rTarget.ISA(ScTabViewTarget); } ScUndoRemoveAllOutlines::ScUndoRemoveAllOutlines( ScDocShell* pNewDocShell, @@ -509,9 +509,9 @@ void ScUndoRemoveAllOutlines::Repeat(SfxRepeatTarget& rTarget) ((ScTabViewTarget&)rTarget).GetViewShell()->RemoveAllOutlines( sal_True ); } -sal_Bool ScUndoRemoveAllOutlines::CanRepeat(SfxRepeatTarget& rTarget) const +bool ScUndoRemoveAllOutlines::CanRepeat(SfxRepeatTarget& rTarget) const { - return (rTarget.ISA(ScTabViewTarget)); + return rTarget.ISA(ScTabViewTarget); } ScUndoAutoOutline::ScUndoAutoOutline( ScDocShell* pNewDocShell, @@ -612,9 +612,9 @@ void ScUndoAutoOutline::Repeat(SfxRepeatTarget& rTarget) ((ScTabViewTarget&)rTarget).GetViewShell()->AutoOutline( sal_True ); } -sal_Bool ScUndoAutoOutline::CanRepeat(SfxRepeatTarget& rTarget) const +bool ScUndoAutoOutline::CanRepeat(SfxRepeatTarget& rTarget) const { - return (rTarget.ISA(ScTabViewTarget)); + return rTarget.ISA(ScTabViewTarget); } ScUndoSubTotals::ScUndoSubTotals( ScDocShell* pNewDocShell, SCTAB nNewTab, @@ -735,7 +735,7 @@ void ScUndoSubTotals::Repeat(SfxRepeatTarget& /* rTarget */) { } -sal_Bool ScUndoSubTotals::CanRepeat(SfxRepeatTarget& /* rTarget */) const +bool ScUndoSubTotals::CanRepeat(SfxRepeatTarget& /* rTarget */) const { return false; // is not possible due to column numbers } @@ -851,7 +851,7 @@ void ScUndoSort::Repeat(SfxRepeatTarget& /* rTarget */) { } -sal_Bool ScUndoSort::CanRepeat(SfxRepeatTarget& /* rTarget */) const +bool ScUndoSort::CanRepeat(SfxRepeatTarget& /* rTarget */) const { return false; // does not work due to column numbers } @@ -1021,7 +1021,7 @@ void ScUndoQuery::Repeat(SfxRepeatTarget& /* rTarget */) { } -sal_Bool ScUndoQuery::CanRepeat(SfxRepeatTarget& /* rTarget */) const +bool ScUndoQuery::CanRepeat(SfxRepeatTarget& /* rTarget */) const { return false; // does not work due to column numbers } @@ -1100,7 +1100,7 @@ void ScUndoAutoFilter::Repeat(SfxRepeatTarget& /* rTarget */) { } -sal_Bool ScUndoAutoFilter::CanRepeat(SfxRepeatTarget& /* rTarget */) const +bool ScUndoAutoFilter::CanRepeat(SfxRepeatTarget& /* rTarget */) const { return false; } @@ -1165,7 +1165,7 @@ void ScUndoDBData::Repeat(SfxRepeatTarget& /* rTarget */) { } -sal_Bool ScUndoDBData::CanRepeat(SfxRepeatTarget& /* rTarget */) const +bool ScUndoDBData::CanRepeat(SfxRepeatTarget& /* rTarget */) const { return false; // is not possible } @@ -1372,12 +1372,12 @@ void ScUndoImportData::Repeat(SfxRepeatTarget& rTarget) } } -sal_Bool ScUndoImportData::CanRepeat(SfxRepeatTarget& rTarget) const +bool ScUndoImportData::CanRepeat(SfxRepeatTarget& rTarget) const { // Repeat only for import using a database range, then pUndoDBData is set if (pUndoDBData) - return (rTarget.ISA(ScTabViewTarget)); + return rTarget.ISA(ScTabViewTarget); else return false; // Address book } @@ -1541,9 +1541,9 @@ void ScUndoRepeatDB::Repeat(SfxRepeatTarget& rTarget) ((ScTabViewTarget&)rTarget).GetViewShell()->RepeatDB( sal_True ); } -sal_Bool ScUndoRepeatDB::CanRepeat(SfxRepeatTarget& rTarget) const +bool ScUndoRepeatDB::CanRepeat(SfxRepeatTarget& rTarget) const { - return (rTarget.ISA(ScTabViewTarget)); + return rTarget.ISA(ScTabViewTarget); } ScUndoDataPilot::ScUndoDataPilot( ScDocShell* pNewDocShell, @@ -1699,7 +1699,7 @@ void ScUndoDataPilot::Repeat(SfxRepeatTarget& /* rTarget */) //! allow deletion } -sal_Bool ScUndoDataPilot::CanRepeat(SfxRepeatTarget& /* rTarget */) const +bool ScUndoDataPilot::CanRepeat(SfxRepeatTarget& /* rTarget */) const { //! allow deletion return false; @@ -1839,7 +1839,7 @@ void ScUndoConsolidate::Repeat(SfxRepeatTarget& /* rTarget */) { } -sal_Bool ScUndoConsolidate::CanRepeat(SfxRepeatTarget& /* rTarget */) const +bool ScUndoConsolidate::CanRepeat(SfxRepeatTarget& /* rTarget */) const { return false; } @@ -1913,7 +1913,7 @@ void ScUndoChartData::Repeat(SfxRepeatTarget& /* rTarget */) { } -sal_Bool ScUndoChartData::CanRepeat(SfxRepeatTarget& /* rTarget */) const +bool ScUndoChartData::CanRepeat(SfxRepeatTarget& /* rTarget */) const { return false; } @@ -1996,7 +1996,7 @@ void ScUndoDataForm::Repeat(SfxRepeatTarget& /*rTarget*/) { } -sal_Bool ScUndoDataForm::CanRepeat(SfxRepeatTarget& rTarget) const +bool ScUndoDataForm::CanRepeat(SfxRepeatTarget& rTarget) const { return (rTarget.ISA(ScTabViewTarget)); } diff --git a/sc/source/ui/undo/undodraw.cxx b/sc/source/ui/undo/undodraw.cxx index 2f42a798dc41..b46825de8bdc 100644 --- a/sc/source/ui/undo/undodraw.cxx +++ b/sc/source/ui/undo/undodraw.cxx @@ -71,7 +71,7 @@ void ScUndoDraw::SetLinkToSfxLinkUndoAction(SfxLinkUndoAction* pSfxLinkUndoActio SetLinkToSfxLinkUndoAction(pSfxLinkUndoAction); } -sal_Bool ScUndoDraw::Merge( SfxUndoAction* pNextAction ) +bool ScUndoDraw::Merge( SfxUndoAction* pNextAction ) { if (pDrawUndo) return pDrawUndo->Merge(pNextAction); @@ -113,7 +113,7 @@ void ScUndoDraw::Repeat(SfxRepeatTarget& rTarget) pDrawUndo->Repeat(rTarget); } -sal_Bool ScUndoDraw::CanRepeat(SfxRepeatTarget& rTarget) const +bool ScUndoDraw::CanRepeat(SfxRepeatTarget& rTarget) const { if (pDrawUndo) return pDrawUndo->CanRepeat(rTarget); diff --git a/sc/source/ui/undo/undorangename.cxx b/sc/source/ui/undo/undorangename.cxx index f7edac94045d..40f288915d02 100644 --- a/sc/source/ui/undo/undorangename.cxx +++ b/sc/source/ui/undo/undorangename.cxx @@ -66,9 +66,9 @@ void ScUndoAllRangeNames::Repeat(SfxRepeatTarget& /*rTarget*/) { } -sal_Bool ScUndoAllRangeNames::CanRepeat(SfxRepeatTarget& /*rTarget*/) const +bool ScUndoAllRangeNames::CanRepeat(SfxRepeatTarget& /*rTarget*/) const { - return sal_False; + return false; } OUString ScUndoAllRangeNames::GetComment() const @@ -139,9 +139,9 @@ void ScUndoAddRangeData::Repeat(SfxRepeatTarget& /*rTarget*/) { } -sal_Bool ScUndoAddRangeData::CanRepeat(SfxRepeatTarget& /*rTarget*/) const +bool ScUndoAddRangeData::CanRepeat(SfxRepeatTarget& /*rTarget*/) const { - return sal_False; + return false; } OUString ScUndoAddRangeData::GetComment() const diff --git a/sc/source/ui/undo/undostyl.cxx b/sc/source/ui/undo/undostyl.cxx index 5125bbaf4a83..2d847c23d986 100644 --- a/sc/source/ui/undo/undostyl.cxx +++ b/sc/source/ui/undo/undostyl.cxx @@ -225,7 +225,7 @@ void ScUndoModifyStyle::Repeat(SfxRepeatTarget& /* rTarget */) { } -sal_Bool ScUndoModifyStyle::CanRepeat(SfxRepeatTarget& /* rTarget */) const +bool ScUndoModifyStyle::CanRepeat(SfxRepeatTarget& /* rTarget */) const { return false; // no repeat possible } @@ -287,7 +287,7 @@ void ScUndoApplyPageStyle::Repeat(SfxRepeatTarget& /* rTarget */) //! set same page style to current tab } -sal_Bool ScUndoApplyPageStyle::CanRepeat(SfxRepeatTarget& /* rTarget */) const +bool ScUndoApplyPageStyle::CanRepeat(SfxRepeatTarget& /* rTarget */) const { return false; } diff --git a/sc/source/ui/undo/undotab.cxx b/sc/source/ui/undo/undotab.cxx index db101dd62273..804e2e02a129 100644 --- a/sc/source/ui/undo/undotab.cxx +++ b/sc/source/ui/undo/undotab.cxx @@ -162,9 +162,9 @@ void ScUndoInsertTab::Repeat(SfxRepeatTarget& rTarget) Execute(FID_INS_TABLE, SFX_CALLMODE_SLOT | SFX_CALLMODE_RECORD); } -sal_Bool ScUndoInsertTab::CanRepeat(SfxRepeatTarget& rTarget) const +bool ScUndoInsertTab::CanRepeat(SfxRepeatTarget& rTarget) const { - return (rTarget.ISA(ScTabViewTarget)); + return rTarget.ISA(ScTabViewTarget); } ScUndoInsertTables::ScUndoInsertTables( ScDocShell* pNewDocShell, @@ -257,9 +257,9 @@ void ScUndoInsertTables::Repeat(SfxRepeatTarget& rTarget) Execute(FID_INS_TABLE, SFX_CALLMODE_SLOT | SFX_CALLMODE_RECORD); } -sal_Bool ScUndoInsertTables::CanRepeat(SfxRepeatTarget& rTarget) const +bool ScUndoInsertTables::CanRepeat(SfxRepeatTarget& rTarget) const { - return (rTarget.ISA(ScTabViewTarget)); + return rTarget.ISA(ScTabViewTarget); } ScUndoDeleteTab::ScUndoDeleteTab( ScDocShell* pNewDocShell, const vector<SCTAB> &aTab, @@ -417,9 +417,9 @@ void ScUndoDeleteTab::Repeat(SfxRepeatTarget& rTarget) } } -sal_Bool ScUndoDeleteTab::CanRepeat(SfxRepeatTarget& rTarget) const +bool ScUndoDeleteTab::CanRepeat(SfxRepeatTarget& rTarget) const { - return (rTarget.ISA(ScTabViewTarget)); + return rTarget.ISA(ScTabViewTarget); } ScUndoRenameTab::ScUndoRenameTab( ScDocShell* pNewDocShell, @@ -474,7 +474,7 @@ void ScUndoRenameTab::Repeat(SfxRepeatTarget& /* rTarget */) // makes no sense } -sal_Bool ScUndoRenameTab::CanRepeat(SfxRepeatTarget& /* rTarget */) const +bool ScUndoRenameTab::CanRepeat(SfxRepeatTarget& /* rTarget */) const { return false; } @@ -579,7 +579,7 @@ void ScUndoMoveTab::Repeat(SfxRepeatTarget& /* rTarget */) // No Repeat ! ? ! } -sal_Bool ScUndoMoveTab::CanRepeat(SfxRepeatTarget& /* rTarget */) const +bool ScUndoMoveTab::CanRepeat(SfxRepeatTarget& /* rTarget */) const { return false; } @@ -719,7 +719,7 @@ void ScUndoCopyTab::Repeat(SfxRepeatTarget& /* rTarget */) // no Repeat ! ? ! } -sal_Bool ScUndoCopyTab::CanRepeat(SfxRepeatTarget& /* rTarget */) const +bool ScUndoCopyTab::CanRepeat(SfxRepeatTarget& /* rTarget */) const { return false; } @@ -788,7 +788,7 @@ void ScUndoTabColor::Repeat(SfxRepeatTarget& /* rTarget */) // makes no sense } -sal_Bool ScUndoTabColor::CanRepeat(SfxRepeatTarget& /* rTarget */) const +bool ScUndoTabColor::CanRepeat(SfxRepeatTarget& /* rTarget */) const { return false; } @@ -875,9 +875,9 @@ void ScUndoMakeScenario::Repeat(SfxRepeatTarget& rTarget) } } -sal_Bool ScUndoMakeScenario::CanRepeat(SfxRepeatTarget& rTarget) const +bool ScUndoMakeScenario::CanRepeat(SfxRepeatTarget& rTarget) const { - return (rTarget.ISA(ScTabViewTarget)); + return rTarget.ISA(ScTabViewTarget); } ScUndoImportTab::ScUndoImportTab( ScDocShell* pShell, @@ -1031,9 +1031,9 @@ void ScUndoImportTab::Repeat(SfxRepeatTarget& rTarget) Execute(FID_INS_TABLE, SFX_CALLMODE_SLOT | SFX_CALLMODE_RECORD); } -sal_Bool ScUndoImportTab::CanRepeat(SfxRepeatTarget& rTarget) const +bool ScUndoImportTab::CanRepeat(SfxRepeatTarget& rTarget) const { - return (rTarget.ISA(ScTabViewTarget)); + return rTarget.ISA(ScTabViewTarget); } ScUndoRemoveLink::ScUndoRemoveLink( ScDocShell* pShell, const String& rDoc ) : @@ -1112,7 +1112,7 @@ void ScUndoRemoveLink::Repeat(SfxRepeatTarget& /* rTarget */) // makes no sense } -sal_Bool ScUndoRemoveLink::CanRepeat(SfxRepeatTarget& /* rTarget */) const +bool ScUndoRemoveLink::CanRepeat(SfxRepeatTarget& /* rTarget */) const { return false; } @@ -1165,9 +1165,9 @@ void ScUndoShowHideTab::Repeat(SfxRepeatTarget& rTarget) SFX_CALLMODE_SLOT | SFX_CALLMODE_RECORD); } -sal_Bool ScUndoShowHideTab::CanRepeat(SfxRepeatTarget& rTarget) const +bool ScUndoShowHideTab::CanRepeat(SfxRepeatTarget& rTarget) const { - return (rTarget.ISA(ScTabViewTarget)); + return rTarget.ISA(ScTabViewTarget); } OUString ScUndoShowHideTab::GetComment() const @@ -1245,7 +1245,7 @@ void ScUndoDocProtect::Repeat(SfxRepeatTarget& /* rTarget */) // makes no sense } -sal_Bool ScUndoDocProtect::CanRepeat(SfxRepeatTarget& /* rTarget */) const +bool ScUndoDocProtect::CanRepeat(SfxRepeatTarget& /* rTarget */) const { return false; // makes no sense } @@ -1317,7 +1317,7 @@ void ScUndoTabProtect::Repeat(SfxRepeatTarget& /* rTarget */) // makes no sense } -sal_Bool ScUndoTabProtect::CanRepeat(SfxRepeatTarget& /* rTarget */) const +bool ScUndoTabProtect::CanRepeat(SfxRepeatTarget& /* rTarget */) const { return false; // makes no sense } @@ -1379,7 +1379,7 @@ void ScUndoPrintRange::Repeat(SfxRepeatTarget& /* rTarget */) // makes no sense } -sal_Bool ScUndoPrintRange::CanRepeat(SfxRepeatTarget& /* rTarget */) const +bool ScUndoPrintRange::CanRepeat(SfxRepeatTarget& /* rTarget */) const { return false; // makes no sense } @@ -1453,7 +1453,7 @@ void ScUndoScenarioFlags::Repeat(SfxRepeatTarget& /* rTarget */) // Repeat makes no sense } -sal_Bool ScUndoScenarioFlags::CanRepeat(SfxRepeatTarget& /* rTarget */) const +bool ScUndoScenarioFlags::CanRepeat(SfxRepeatTarget& /* rTarget */) const { return false; } @@ -1530,7 +1530,7 @@ void ScUndoRenameObject::Repeat(SfxRepeatTarget& /* rTarget */) { } -sal_Bool ScUndoRenameObject::CanRepeat(SfxRepeatTarget& /* rTarget */) const +bool ScUndoRenameObject::CanRepeat(SfxRepeatTarget& /* rTarget */) const { return false; } @@ -1579,9 +1579,9 @@ void ScUndoLayoutRTL::Repeat(SfxRepeatTarget& rTarget) Execute( FID_TAB_RTL, SFX_CALLMODE_SLOT | SFX_CALLMODE_RECORD); } -sal_Bool ScUndoLayoutRTL::CanRepeat(SfxRepeatTarget& rTarget) const +bool ScUndoLayoutRTL::CanRepeat(SfxRepeatTarget& rTarget) const { - return (rTarget.ISA(ScTabViewTarget)); + return rTarget.ISA(ScTabViewTarget); } OUString ScUndoLayoutRTL::GetComment() const diff --git a/sc/source/ui/unoobj/chart2uno.cxx b/sc/source/ui/unoobj/chart2uno.cxx index 6ec562d2a548..975953318373 100644 --- a/sc/source/ui/unoobj/chart2uno.cxx +++ b/sc/source/ui/unoobj/chart2uno.cxx @@ -2707,7 +2707,7 @@ sal_Int32 ScChart2DataSequence::FillCacheFromExternalRef(const ScTokenRef& pToke SvNumberFormatter* pFormatter = m_pDocument->GetFormatTable(); if (pFormatter) { - String aStr; + OUString aStr; const double fVal = rItem.mfValue; Color* pColor = NULL; sal_uInt32 nFmt = 0; diff --git a/sc/source/ui/unoobj/pageuno.cxx b/sc/source/ui/unoobj/pageuno.cxx index 390d4fb749dd..6107e503fac7 100644 --- a/sc/source/ui/unoobj/pageuno.cxx +++ b/sc/source/ui/unoobj/pageuno.cxx @@ -17,6 +17,7 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ +#include <tools/string.hxx> #include "pageuno.hxx" #include "shapeuno.hxx" diff --git a/sc/source/ui/view/cellsh1.cxx b/sc/source/ui/view/cellsh1.cxx index 6073baf1abce..23bbec0b5501 100644 --- a/sc/source/ui/view/cellsh1.cxx +++ b/sc/source/ui/view/cellsh1.cxx @@ -742,37 +742,37 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq ) if( ! rReq.IsAPI() ) { - String aPara; + OUString aPara; Color* pColor=0; switch( eFillDir ) { - case FILL_TO_BOTTOM: aPara = 'B'; break; - case FILL_TO_RIGHT: aPara = 'R'; break; - case FILL_TO_TOP: aPara = 'T'; break; - case FILL_TO_LEFT: aPara = 'L'; break; - default: aPara.Erase(); break; + case FILL_TO_BOTTOM: aPara = "B"; break; + case FILL_TO_RIGHT: aPara = "R"; break; + case FILL_TO_TOP: aPara = "T"; break; + case FILL_TO_LEFT: aPara = "L"; break; + default: break; } rReq.AppendItem( SfxStringItem( FID_FILL_SERIES, aPara ) ); switch( eFillCmd ) { - case FILL_SIMPLE: aPara = 'S'; break; - case FILL_LINEAR: aPara = 'L'; break; - case FILL_GROWTH: aPara = 'G'; break; - case FILL_DATE: aPara = 'D'; break; - case FILL_AUTO: aPara = 'A'; break; - default: aPara.Erase(); break; + case FILL_SIMPLE: aPara = "S"; break; + case FILL_LINEAR: aPara = "L"; break; + case FILL_GROWTH: aPara = "G"; break; + case FILL_DATE: aPara = "D"; break; + case FILL_AUTO: aPara = "A"; break; + default: break; } rReq.AppendItem( SfxStringItem( FN_PARAM_1, aPara ) ); switch( eFillDateCmd ) { - case FILL_DAY: aPara = 'D'; break; - case FILL_WEEKDAY: aPara = 'W'; break; - case FILL_MONTH: aPara = 'M'; break; - case FILL_YEAR: aPara = 'Y'; break; - default: aPara.Erase(); break; + case FILL_DAY: aPara = "D"; break; + case FILL_WEEKDAY: aPara = "W"; break; + case FILL_MONTH: aPara = "M"; break; + case FILL_YEAR: aPara = "Y"; break; + default: break; } rReq.AppendItem( SfxStringItem( FN_PARAM_2, aPara ) ); diff --git a/sc/source/ui/view/tabvwsha.cxx b/sc/source/ui/view/tabvwsha.cxx index 4e2d64517473..022f9ddc6469 100644 --- a/sc/source/ui/view/tabvwsha.cxx +++ b/sc/source/ui/view/tabvwsha.cxx @@ -114,7 +114,7 @@ sal_Bool ScTabViewShell::GetFunction( String& rFuncStr, sal_uInt16 nErrCode ) pDoc->GetNumberFormat( nPosX, nPosY, nTab, nNumFmt ); } - String aValStr; + OUString aValStr; Color* pDummy; pFormatter->GetOutputString( nVal, nNumFmt, aValStr, &pDummy ); aStr += aValStr; diff --git a/sc/source/ui/view/viewfun2.cxx b/sc/source/ui/view/viewfun2.cxx index a042d0df07dd..9ce1c27e5d72 100644 --- a/sc/source/ui/view/viewfun2.cxx +++ b/sc/source/ui/view/viewfun2.cxx @@ -1830,8 +1830,8 @@ void ScViewFunc::Solve( const ScSolveParam& rParam ) if ( rParam.pStrTargetVal != NULL ) aTargetValStr = *(rParam.pStrTargetVal); - String aMsgStr; - String aResStr; + OUString aMsgStr; + OUString aResStr; double nSolveResult; GetFrameWin()->EnterWait(); @@ -1858,14 +1858,14 @@ void ScViewFunc::Solve( const ScSolveParam& rParam ) if ( bExact ) { aMsgStr += ScGlobal::GetRscString( STR_MSSG_SOLVE_0 ); - aMsgStr += String( aResStr ); + aMsgStr += aResStr; aMsgStr += ScGlobal::GetRscString( STR_MSSG_SOLVE_1 ); } else { aMsgStr = ScGlobal::GetRscString( STR_MSSG_SOLVE_2 ); aMsgStr += ScGlobal::GetRscString( STR_MSSG_SOLVE_3 ); - aMsgStr += String( aResStr ); + aMsgStr += aResStr ; aMsgStr += ScGlobal::GetRscString( STR_MSSG_SOLVE_4 ); } 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(); } }; diff --git a/sfx2/source/appl/appdde.cxx b/sfx2/source/appl/appdde.cxx index 371f5239ac7e..e5f67021f38d 100644 --- a/sfx2/source/appl/appdde.cxx +++ b/sfx2/source/appl/appdde.cxx @@ -46,32 +46,32 @@ //======================================================================== -String SfxDdeServiceName_Impl( const String& sIn ) +OUString SfxDdeServiceName_Impl( const OUString& sIn ) { - String sReturn; + OUStringBuffer sReturn(sIn.getLength()); - for ( sal_uInt16 n = sIn.Len(); n; --n ) + for ( sal_uInt16 n = sIn.getLength(); n; --n ) { - sal_Unicode cChar = sIn.GetChar(n-1); + sal_Unicode cChar = sIn[n-1]; if (comphelper::string::isalnumAscii(cChar)) - sReturn += cChar; + sReturn.append(cChar); } - return sReturn; + return sReturn.makeStringAndClear(); } #if defined( WNT ) class ImplDdeService : public DdeService { public: - ImplDdeService( const String& rNm ) + ImplDdeService( const OUString& rNm ) : DdeService( rNm ) {} - virtual sal_Bool MakeTopic( const OUString& ); + virtual bool MakeTopic( const OUString& ); - virtual String Topics(); + virtual OUString Topics(); - virtual sal_Bool SysTopicExecute( const String* pStr ); + virtual bool SysTopicExecute( const OUString* pStr ); }; //-------------------------------------------------------------------- @@ -111,12 +111,12 @@ namespace } } -sal_Bool ImplDdeService::MakeTopic( const OUString& rNm ) +bool ImplDdeService::MakeTopic( const OUString& rNm ) { // Workaround for Event after Main() under OS/2 // happens when exiting starts the App again if ( !Application::IsInExecute() ) - return sal_False; + return false; // The Topic rNm is sought, do we have it? // First only loop over the ObjectShells to find those @@ -133,7 +133,7 @@ sal_Bool ImplDdeService::MakeTopic( const OUString& rNm ) if( sTmp == sNm ) { SFX_APP()->AddDdeTopic( pShell ); - bRet = sal_True; + bRet = true; break; } pShell = SfxObjectShell::GetNext( *pShell, &aType ); @@ -163,16 +163,16 @@ sal_Bool ImplDdeService::MakeTopic( const OUString& rNm ) ->GetFrame()->GetObjectShell() ) ) { SFX_APP()->AddDdeTopic( pShell ); - bRet = sal_True; + bRet = true; } } } return bRet; } -String ImplDdeService::Topics() +OUString ImplDdeService::Topics() { - String sRet; + OUString sRet; if( GetSysTopic() ) sRet += GetSysTopic()->GetName(); @@ -182,20 +182,20 @@ String ImplDdeService::Topics() { if( SfxViewFrame::GetFirst( pShell ) ) { - if( sRet.Len() ) - sRet += '\t'; + if( !sRet.isEmpty() ) + sRet += "\t"; sRet += pShell->GetTitle(SFX_TITLE_FULLNAME); } pShell = SfxObjectShell::GetNext( *pShell, &aType ); } - if( sRet.Len() ) + if( !sRet.isEmpty() ) sRet += "\r\n"; return sRet; } -sal_Bool ImplDdeService::SysTopicExecute( const String* pStr ) +bool ImplDdeService::SysTopicExecute( const OUString* pStr ) { - return (sal_Bool)SFX_APP()->DdeExecute( *pStr ); + return SFX_APP()->DdeExecute( *pStr ); } #endif @@ -203,10 +203,10 @@ class SfxDdeTriggerTopic_Impl : public DdeTopic { public: SfxDdeTriggerTopic_Impl() - : DdeTopic( "TRIGGER" ) - {} + : DdeTopic( "TRIGGER" ) + {} - virtual sal_Bool Execute( const String* ); + virtual bool Execute( const OUString* ); }; class SfxDdeDocTopic_Impl : public DdeTopic @@ -221,21 +221,15 @@ public: {} virtual DdeData* Get( sal_uIntPtr ); - virtual sal_Bool Put( const DdeData* ); - virtual sal_Bool Execute( const String* ); - virtual sal_Bool StartAdviseLoop(); - virtual sal_Bool MakeItem( const OUString& rItem ); + virtual bool Put( const DdeData* ); + virtual bool Execute( const OUString* ); + virtual bool StartAdviseLoop(); + virtual bool MakeItem( const OUString& rItem ); }; class SfxDdeDocTopics_Impl : public std::vector<SfxDdeDocTopic_Impl*> {}; -//======================================================================== - -sal_Bool SfxAppEvent_Impl( ApplicationEvent &rAppEvent, - const OUString& rCmd, const OUString& rEvent, - ApplicationEvent::Type eType ) - /* [Description] Checks if 'rCmd' of the event 'rEvent' is (without '(') and then assemble @@ -248,7 +242,9 @@ sal_Bool SfxAppEvent_Impl( ApplicationEvent &rAppEvent, rCmd = "Open(\"d:\doc\doc.sdw\")" rEvent = "Open" */ - +sal_Bool SfxAppEvent_Impl( ApplicationEvent &rAppEvent, + const OUString& rCmd, const OUString& rEvent, + ApplicationEvent::Type eType ) { OUString sEvent(rEvent); sEvent += "("; @@ -289,11 +285,6 @@ sal_Bool SfxAppEvent_Impl( ApplicationEvent &rAppEvent, } #if defined( WNT ) -long SfxApplication::DdeExecute -( - const String& rCmd // Expressed in our BASIC-Syntax -) - /* Description] This method can be overloaded by application developers, to receive @@ -303,7 +294,7 @@ long SfxApplication::DdeExecute relevant SfxApplication subclass in BASIC syntax. Return values can not be transferred, unfortunately. */ - +long SfxApplication::DdeExecute( const OUString& rCmd ) // Expressed in our BASIC-Syntax { // Print or Open-Event? ApplicationEvent aAppEvent; @@ -326,11 +317,6 @@ long SfxApplication::DdeExecute } #endif -long SfxObjectShell::DdeExecute -( - const String& rCmd // Expressed in our BASIC-Syntax -) - /* [Description] This method can be overloaded by application developers, to receive @@ -338,7 +324,7 @@ long SfxObjectShell::DdeExecute The base implementation does nothing and returns 0. */ - +long SfxObjectShell::DdeExecute( const OUString& rCmd ) // Expressed in our BASIC-Syntax { #ifdef DISABLE_SCRIPTING (void) rCmd; @@ -357,13 +343,6 @@ long SfxObjectShell::DdeExecute //-------------------------------------------------------------------- -long SfxObjectShell::DdeGetData -( - const String&, // the Item to be addressed - const String&, // in: Format - ::com::sun::star::uno::Any& // out: requested data -) - /* [Description] This method can be overloaded by application developers, to receive @@ -371,20 +350,15 @@ long SfxObjectShell::DdeGetData The base implementation provides no data and returns 0. */ - +long SfxObjectShell::DdeGetData( const OUString&, // the Item to be addressed + const OUString&, // in: Format + ::com::sun::star::uno::Any& )// out: requested data { return 0; } //-------------------------------------------------------------------- -long SfxObjectShell::DdeSetData -( - const String&, // the Item to be addressed - const String&, // in: Format - const ::com::sun::star::uno::Any& // out: requested data -) - /* [Description] This method can be overloaded by application developers, to receive @@ -392,17 +366,13 @@ long SfxObjectShell::DdeSetData The base implementation is not receiving any data and returns 0. */ - +long SfxObjectShell::DdeSetData( const OUString&, // the Item to be addressed + const OUString&, // in: Format + const ::com::sun::star::uno::Any& )// out: requested data { return 0; } -//-------------------------------------------------------------------- -::sfx2::SvLinkSource* SfxObjectShell::DdeCreateLinkSource -( - const String& // the Item to be addressed -) - /* [Description] This method can be overloaded by application developers, to establish @@ -410,7 +380,7 @@ long SfxObjectShell::DdeSetData The base implementation is not generate a link and returns 0. */ - +::sfx2::SvLinkSource* SfxObjectShell::DdeCreateLinkSource( const OUString& ) // the Item to be addressed { return 0; } @@ -432,13 +402,6 @@ void SfxObjectShell::ReconnectDdeLinks(SfxObjectShell& rServer) } } -//======================================================================== - -long SfxViewFrame::DdeExecute -( - const String& rCmd // Expressed in our BASIC-Syntax -) - /* [Description] This method can be overloaded by application developers, to receive @@ -449,7 +412,7 @@ long SfxViewFrame::DdeExecute and the relevant SfxApplication subclass in BASIC syntax. Return values can not be transferred, unfortunately. */ - +long SfxViewFrame::DdeExecute( const OUString& rCmd ) // Expressed in our BASIC-Syntax { if ( GetObjectShell() ) return GetObjectShell()->DdeExecute( rCmd ); @@ -457,15 +420,6 @@ long SfxViewFrame::DdeExecute return 0; } -//-------------------------------------------------------------------- - -long SfxViewFrame::DdeGetData -( - const String&, // the Item to be addressed - const String&, // in: Format - ::com::sun::star::uno::Any& // out: requested data -) - /* [Description] This method can be overloaded by application developers, to receive @@ -473,20 +427,13 @@ long SfxViewFrame::DdeGetData The base implementation provides no data and returns 0. */ - +long SfxViewFrame::DdeGetData( const OUString&, // the Item to be addressed + const OUString&, // in: Format + ::com::sun::star::uno::Any& )// out: requested data { return 0; } -//-------------------------------------------------------------------- - -long SfxViewFrame::DdeSetData -( - const String&, // the Item to be addressed - const String&, // in: Format - const ::com::sun::star::uno::Any& // out: requested data -) - /* [Description] This method can be overloaded by application developers, to receive @@ -494,18 +441,13 @@ long SfxViewFrame::DdeSetData The base implementation is not receiving any data and returns 0. */ - +long SfxViewFrame::DdeSetData( const OUString&, // the Item to be addressed + const OUString&, // in: Format + const ::com::sun::star::uno::Any& )// out: requested data { return 0; } -//-------------------------------------------------------------------- - -::sfx2::SvLinkSource* SfxViewFrame::DdeCreateLinkSource -( - const String& // the Item to be addressed -) - /* [Description] This method can be overloaded by application developers, to establish @@ -513,13 +455,11 @@ long SfxViewFrame::DdeSetData The base implementation is not generate a link and returns 0. */ - +::sfx2::SvLinkSource* SfxViewFrame::DdeCreateLinkSource( const OUString& )// the Item to be addressed { return 0; } -//======================================================================== - sal_Bool SfxApplication::InitializeDde() { int nError = 0; @@ -622,9 +562,9 @@ DdeService* SfxApplication::GetDdeService() //-------------------------------------------------------------------- -sal_Bool SfxDdeTriggerTopic_Impl::Execute( const String* ) +bool SfxDdeTriggerTopic_Impl::Execute( const OUString* ) { - return sal_True; + return true; } //-------------------------------------------------------------------- @@ -642,11 +582,11 @@ DdeData* SfxDdeDocTopic_Impl::Get( sal_uIntPtr nFormat ) return 0; } -sal_Bool SfxDdeDocTopic_Impl::Put( const DdeData* pData ) +bool SfxDdeDocTopic_Impl::Put( const DdeData* pData ) { aSeq = ::com::sun::star::uno::Sequence< sal_Int8 >( (sal_Int8*)(const void*)*pData, (long)*pData ); - sal_Bool bRet; + bool bRet; if( aSeq.getLength() ) { ::com::sun::star::uno::Any aValue; @@ -655,25 +595,25 @@ sal_Bool SfxDdeDocTopic_Impl::Put( const DdeData* pData ) bRet = 0 != pSh->DdeSetData( GetCurItem(), sMimeType, aValue ); } else - bRet = sal_False; + bRet = false; return bRet; } -sal_Bool SfxDdeDocTopic_Impl::Execute( const String* pStr ) +bool SfxDdeDocTopic_Impl::Execute( const OUString* pStr ) { long nRet = pStr ? pSh->DdeExecute( *pStr ) : 0; return 0 != nRet; } -sal_Bool SfxDdeDocTopic_Impl::MakeItem( const OUString& rItem ) +bool SfxDdeDocTopic_Impl::MakeItem( const OUString& rItem ) { AddItem( DdeItem( rItem ) ); - return sal_True; + return true; } -sal_Bool SfxDdeDocTopic_Impl::StartAdviseLoop() +bool SfxDdeDocTopic_Impl::StartAdviseLoop() { - sal_Bool bRet = sal_False; + bool bRet = false; ::sfx2::SvLinkSource* pNewObj = pSh->DdeCreateLinkSource( GetCurItem() ); if( pNewObj ) { @@ -681,7 +621,7 @@ sal_Bool SfxDdeDocTopic_Impl::StartAdviseLoop() String sNm, sTmp( Application::GetAppName() ); ::sfx2::MakeLnkName( sNm, &sTmp, pSh->GetTitle(SFX_TITLE_FULLNAME), GetCurItem() ); new ::sfx2::SvBaseLink( sNm, OBJECT_DDE_EXTERN, pNewObj ); - bRet = sal_True; + bRet = true; } return bRet; } diff --git a/sfx2/source/appl/lnkbase2.cxx b/sfx2/source/appl/lnkbase2.cxx index 7fd8c789418d..e9d025c14f1f 100644 --- a/sfx2/source/appl/lnkbase2.cxx +++ b/sfx2/source/appl/lnkbase2.cxx @@ -109,8 +109,8 @@ public: virtual ~ImplDdeItem(); virtual DdeData* Get( sal_uIntPtr ); - virtual sal_Bool Put( const DdeData* ); - virtual void AdviseLoop( sal_Bool ); + virtual bool Put( const DdeData* ); + virtual void AdviseLoop( bool ); void Notify() { @@ -564,14 +564,14 @@ DdeData* ImplDdeItem::Get( sal_uIntPtr nFormat ) } -sal_Bool ImplDdeItem::Put( const DdeData* ) +bool ImplDdeItem::Put( const DdeData* ) { OSL_FAIL( "ImplDdeItem::Put not implemented" ); - return sal_False; + return false; } -void ImplDdeItem::AdviseLoop( sal_Bool bOpen ) +void ImplDdeItem::AdviseLoop( bool bOpen ) { // Connection is closed, so also unsubscribe link if( pLink->GetObj() ) diff --git a/sfx2/source/dialog/dinfdlg.cxx b/sfx2/source/dialog/dinfdlg.cxx index cc2768c18320..5a03ba1ce1bb 100644 --- a/sfx2/source/dialog/dinfdlg.cxx +++ b/sfx2/source/dialog/dinfdlg.cxx @@ -1719,7 +1719,7 @@ void CustomPropertiesWindow::AddLine( const OUString& sName, Any& rAny ) const LocaleDataWrapper& rLocaleWrapper = aSysLocale.GetLocaleData(); pNewLine->m_aNameBox.SetText( sName ); sal_IntPtr nType = CUSTOM_TYPE_UNKNOWN; - String sValue; + OUString sValue; if ( rAny >>= nTmpValue ) { diff --git a/sfx2/source/dialog/mgetempl.cxx b/sfx2/source/dialog/mgetempl.cxx index 12cb90eff457..698baafabb32 100644 --- a/sfx2/source/dialog/mgetempl.cxx +++ b/sfx2/source/dialog/mgetempl.cxx @@ -86,7 +86,7 @@ SfxManageStyleSheetPage::SfxManageStyleSheetPage(Window* pParent, const SfxItemS pPool->First(); // for SW - update internal list } - if ( !pStyle->GetName().Len() && pPool ) + if ( pStyle->GetName().isEmpty() && pPool ) { // NullString as Name -> generate Name String aNoName( SfxResId(STR_NONAME).toString() ); diff --git a/sfx2/source/dialog/styledlg.cxx b/sfx2/source/dialog/styledlg.cxx index bf60f44eadf2..35236caf9d52 100644 --- a/sfx2/source/dialog/styledlg.cxx +++ b/sfx2/source/dialog/styledlg.cxx @@ -60,7 +60,7 @@ SfxStyleDialog::SfxStyleDialog // With new template always set the management page as the current page - if( !rStyle.GetName().Len() ) + if( rStyle.GetName().isEmpty() ) SetCurPageId( ID_TABPAGE_MANAGESTYLES ); else { diff --git a/starmath/source/document.cxx b/starmath/source/document.cxx index e0504c264974..8a8c9c640c55 100644 --- a/starmath/source/document.cxx +++ b/starmath/source/document.cxx @@ -1178,7 +1178,7 @@ void SmDocShell::Execute(SfxRequest& rReq) if( pArgs && SFX_ITEM_SET == pArgs->GetItemState( nId, false, &pItem )) nCnt = ((SfxUInt16Item*)pItem)->GetValue(); - sal_Bool (::svl::IUndoManager:: *fnDo)(); + bool (::svl::IUndoManager:: *fnDo)(); sal_uInt16 nCount; if( SID_UNDO == rReq.GetSlot() ) diff --git a/svl/source/fsstor/fsstorage.cxx b/svl/source/fsstor/fsstorage.cxx index f42f952b0cac..5d5bfefe1616 100644 --- a/svl/source/fsstor/fsstorage.cxx +++ b/svl/source/fsstor/fsstorage.cxx @@ -49,7 +49,6 @@ #include <cppuhelper/typeprovider.hxx> #include <cppuhelper/exc_hlp.hxx> -#include <tools/string.hxx> #include <tools/urlobj.hxx> #include <unotools/ucbhelper.hxx> #include <unotools/ucbstreamhelper.hxx> @@ -480,7 +479,7 @@ uno::Reference< io::XStream > SAL_CALL FSStorage::openStreamElement( else { // TODO: test whether it really works for http and fwp - SvStream* pStream = ::utl::UcbStreamHelper::CreateStream( String(aFileURL.GetMainURL( INetURLObject::NO_DECODE )), + SvStream* pStream = ::utl::UcbStreamHelper::CreateStream( aFileURL.GetMainURL( INetURLObject::NO_DECODE ), STREAM_STD_WRITE ); if ( pStream ) { diff --git a/svl/source/items/itemprop.cxx b/svl/source/items/itemprop.cxx index 001ed129960c..00ca36e2218c 100644 --- a/svl/source/items/itemprop.cxx +++ b/svl/source/items/itemprop.cxx @@ -130,7 +130,7 @@ beans::Property SfxItemPropertyMap::getPropertyByName( const OUString rName ) co return aProp; } -sal_Bool SfxItemPropertyMap::hasPropertyByName( const OUString& rName ) const +bool SfxItemPropertyMap::hasPropertyByName( const OUString& rName ) const { SfxItemPropertyHashMap_t::const_iterator aIter = m_pImpl->find(rName); return aIter != m_pImpl->end(); @@ -218,8 +218,8 @@ void SfxItemPropertySet::getPropertyValue( const SfxItemPropertySimpleEntry& rEn } void SfxItemPropertySet::getPropertyValue( const OUString &rName, - const SfxItemSet& rSet, Any& rAny ) const - throw(RuntimeException, UnknownPropertyException) + const SfxItemSet& rSet, Any& rAny ) const + throw(RuntimeException, UnknownPropertyException) { // detect which-id const SfxItemPropertySimpleEntry* pEntry = m_aMap.getByName( rName ); @@ -229,8 +229,8 @@ void SfxItemPropertySet::getPropertyValue( const OUString &rName, } Any SfxItemPropertySet::getPropertyValue( const OUString &rName, - const SfxItemSet& rSet ) const - throw(RuntimeException, UnknownPropertyException) + const SfxItemSet& rSet ) const + throw(RuntimeException, UnknownPropertyException) { Any aVal; getPropertyValue( rName,rSet, aVal ); @@ -238,10 +238,10 @@ Any SfxItemPropertySet::getPropertyValue( const OUString &rName, } void SfxItemPropertySet::setPropertyValue( const SfxItemPropertySimpleEntry& rEntry, - const Any& aVal, - SfxItemSet& rSet ) const - throw(RuntimeException, - IllegalArgumentException) + const Any& aVal, + SfxItemSet& rSet ) const + throw(RuntimeException, + IllegalArgumentException) { // get the SfxPoolItem const SfxPoolItem* pItem = 0; @@ -277,11 +277,11 @@ void SfxItemPropertySet::setPropertyValue( const SfxItemPropertySimpleEntry& rEn } void SfxItemPropertySet::setPropertyValue( const OUString &rName, - const Any& aVal, - SfxItemSet& rSet ) const - throw(RuntimeException, - IllegalArgumentException, - UnknownPropertyException) + const Any& aVal, + SfxItemSet& rSet ) const + throw(RuntimeException, + IllegalArgumentException, + UnknownPropertyException) { const SfxItemPropertySimpleEntry* pEntry = m_aMap.getByName( rName ); if ( !pEntry ) @@ -292,7 +292,7 @@ void SfxItemPropertySet::setPropertyValue( const OUString &rName, } PropertyState SfxItemPropertySet::getPropertyState(const SfxItemPropertySimpleEntry& rEntry, const SfxItemSet& rSet) const - throw() + throw() { PropertyState eRet = PropertyState_DIRECT_VALUE; sal_uInt16 nWhich = rEntry.nWID; @@ -306,9 +306,9 @@ PropertyState SfxItemPropertySet::getPropertyState(const SfxItemPropertySimpleEn eRet = PropertyState_AMBIGUOUS_VALUE; return eRet; } -PropertyState SfxItemPropertySet::getPropertyState( - const OUString& rName, const SfxItemSet& rSet) const - throw(UnknownPropertyException) + +PropertyState SfxItemPropertySet::getPropertyState(const OUString& rName, const SfxItemSet& rSet) const + throw(UnknownPropertyException) { PropertyState eRet = PropertyState_DIRECT_VALUE; @@ -333,8 +333,7 @@ PropertyState SfxItemPropertySet::getPropertyState( return eRet; } -Reference<XPropertySetInfo> - SfxItemPropertySet::getPropertySetInfo() const +Reference<XPropertySetInfo> SfxItemPropertySet::getPropertySetInfo() const { if( !m_xInfo.is() ) m_xInfo = new SfxItemPropertySetInfo( m_aMap ); @@ -346,21 +345,20 @@ struct SfxItemPropertySetInfo_Impl SfxItemPropertyMap* m_pOwnMap; }; -SfxItemPropertySetInfo::SfxItemPropertySetInfo(const SfxItemPropertyMap &rMap ) : - m_pImpl( new SfxItemPropertySetInfo_Impl ) +SfxItemPropertySetInfo::SfxItemPropertySetInfo(const SfxItemPropertyMap &rMap ) + : m_pImpl( new SfxItemPropertySetInfo_Impl ) { m_pImpl->m_pOwnMap = new SfxItemPropertyMap( rMap ); } -SfxItemPropertySetInfo::SfxItemPropertySetInfo(const SfxItemPropertyMapEntry *pEntries ) : - m_pImpl( new SfxItemPropertySetInfo_Impl ) +SfxItemPropertySetInfo::SfxItemPropertySetInfo(const SfxItemPropertyMapEntry *pEntries ) + : m_pImpl( new SfxItemPropertySetInfo_Impl ) { m_pImpl->m_pOwnMap = new SfxItemPropertyMap( pEntries ); } -Sequence< Property > SAL_CALL - SfxItemPropertySetInfo::getProperties( ) - throw(RuntimeException) +Sequence< Property > SAL_CALL SfxItemPropertySetInfo::getProperties( ) + throw(RuntimeException) { return m_pImpl->m_pOwnMap->getProperties(); } @@ -371,24 +369,21 @@ SfxItemPropertySetInfo::~SfxItemPropertySetInfo() delete m_pImpl; } -Property SAL_CALL - SfxItemPropertySetInfo::getPropertyByName( const OUString& rName ) - throw(UnknownPropertyException, RuntimeException) +Property SAL_CALL SfxItemPropertySetInfo::getPropertyByName( const OUString& rName ) + throw(UnknownPropertyException, RuntimeException) { return m_pImpl->m_pOwnMap->getPropertyByName( rName ); } -sal_Bool SAL_CALL - SfxItemPropertySetInfo::hasPropertyByName( const OUString& rName ) - throw(RuntimeException) +sal_Bool SAL_CALL SfxItemPropertySetInfo::hasPropertyByName( const OUString& rName ) + throw(RuntimeException) { return m_pImpl->m_pOwnMap->hasPropertyByName( rName ); } -SfxExtItemPropertySetInfo::SfxExtItemPropertySetInfo( - const SfxItemPropertyMapEntry *pMap, - const Sequence<Property>& rPropSeq ) : - aExtMap( pMap ) +SfxExtItemPropertySetInfo::SfxExtItemPropertySetInfo( const SfxItemPropertyMapEntry *pMap, + const Sequence<Property>& rPropSeq ) + : aExtMap( pMap ) { aExtMap.mergeProperties( rPropSeq ); } @@ -397,22 +392,19 @@ SfxExtItemPropertySetInfo::~SfxExtItemPropertySetInfo() { } -Sequence< Property > SAL_CALL - SfxExtItemPropertySetInfo::getProperties( ) throw(RuntimeException) +Sequence< Property > SAL_CALL SfxExtItemPropertySetInfo::getProperties( ) throw(RuntimeException) { return aExtMap.getProperties(); } -Property SAL_CALL -SfxExtItemPropertySetInfo::getPropertyByName( const OUString& rPropertyName ) - throw(UnknownPropertyException, RuntimeException) +Property SAL_CALL SfxExtItemPropertySetInfo::getPropertyByName( const OUString& rPropertyName ) + throw(UnknownPropertyException, RuntimeException) { return aExtMap.getPropertyByName( rPropertyName ); } -sal_Bool SAL_CALL -SfxExtItemPropertySetInfo::hasPropertyByName( const OUString& rPropertyName ) - throw(RuntimeException) +sal_Bool SAL_CALL SfxExtItemPropertySetInfo::hasPropertyByName( const OUString& rPropertyName ) + throw(RuntimeException) { return aExtMap.hasPropertyByName( rPropertyName ); } diff --git a/svl/source/items/macitem.cxx b/svl/source/items/macitem.cxx index cd812c6c16d0..5484f5f21c7a 100644 --- a/svl/source/items/macitem.cxx +++ b/svl/source/items/macitem.cxx @@ -131,7 +131,7 @@ SvStream& SvxMacroTableDtor::Read( SvStream& rStrm, sal_uInt16 nVersion ) for( short i = 0; i < nMacro; ++i ) { sal_uInt16 nCurKey, eType = STARBASIC; - String aLibName, aMacName; + OUString aLibName, aMacName; rStrm >> nCurKey; aLibName = SfxPoolItem::readByteString(rStrm); aMacName = SfxPoolItem::readByteString(rStrm); diff --git a/svl/source/items/style.cxx b/svl/source/items/style.cxx index 8c8c19314736..635480d42f93 100644 --- a/svl/source/items/style.cxx +++ b/svl/source/items/style.cxx @@ -62,8 +62,8 @@ TYPEINIT1(SfxStyleSheetPoolHint, SfxHint); SfxStyleSheetHintExtended::SfxStyleSheetHintExtended ( - sal_uInt16 nAction, // SFX_STYLESHEET_... (s.o.) - const String& rOldName, + sal_uInt16 nAction, // SFX_STYLESHEET_... (s.o.) + const OUString& rOldName, SfxStyleSheetBase& rStyleSheet // geh"ort weiterhin dem Aufrufer ) : SfxStyleSheetHint( nAction, rStyleSheet ), @@ -88,7 +88,7 @@ public: }; -SfxStyleSheetBase::SfxStyleSheetBase( const XubString& rName, SfxStyleSheetBasePool* p, SfxStyleFamily eFam, sal_uInt16 mask ) +SfxStyleSheetBase::SfxStyleSheetBase( const OUString& rName, SfxStyleSheetBasePool* p, SfxStyleFamily eFam, sal_uInt16 mask ) : pPool( p ) , nFamily( eFam ) , aName( rName ) @@ -147,18 +147,19 @@ sal_uInt16 SfxStyleSheetBase::GetVersion() const // Change name -const XubString& SfxStyleSheetBase::GetName() const +const OUString& SfxStyleSheetBase::GetName() const { return aName; } -bool SfxStyleSheetBase::SetName( const XubString& rName ) +bool SfxStyleSheetBase::SetName( const OUString& rName ) { - if(rName.Len() == 0) - return sal_False; + if(rName.isEmpty()) + return false; + if( aName != rName ) { - String aOldName = aName; + OUString aOldName = aName; SfxStyleSheetBase *pOther = pPool->Find( rName, nFamily ) ; if ( pOther && pOther != this ) return sal_False; @@ -168,16 +169,17 @@ bool SfxStyleSheetBase::SetName( const XubString& rName ) pPool->SetSearchMask(nFamily); - if ( aName.Len() ) + if ( !aName.isEmpty() ) pPool->ChangeParent( aName, rName, sal_False ); - if ( aFollow.Equals( aName ) ) + + if ( aFollow == aName ) aFollow = rName; aName = rName; pPool->SetSearchMask(eTmpFam, nTmpMask); pPool->Broadcast( SfxStyleSheetHintExtended( SFX_STYLESHEET_MODIFIED, aOldName, *this ) ); } - return sal_True; + return true; } OUString SfxStyleSheetBase::GetDisplayName() const @@ -199,12 +201,12 @@ void SfxStyleSheetBase::SetDisplayName( const OUString& rDisplayName ) // Change Parent -const XubString& SfxStyleSheetBase::GetParent() const +const OUString& SfxStyleSheetBase::GetParent() const { return aParent; } -bool SfxStyleSheetBase::SetParent( const XubString& rName ) +bool SfxStyleSheetBase::SetParent( const OUString& rName ) { if ( rName == aName ) return false; @@ -212,19 +214,21 @@ bool SfxStyleSheetBase::SetParent( const XubString& rName ) if( aParent != rName ) { SfxStyleSheetBase* pIter = pPool->Find(rName, nFamily); - if( rName.Len() && !pIter ) + if( !rName.isEmpty() && !pIter ) { OSL_FAIL( "StyleSheet-Parent not found" ); return false; } // prevent recursive linkages - if( aName.Len() ) + if( !aName.isEmpty() ) + { while(pIter) { if(pIter->GetName() == aName) return false; pIter = pPool->Find(pIter->GetParent(), nFamily); } + } aParent = rName; } pPool->Broadcast( SfxStyleSheetHint( SFX_STYLESHEET_MODIFIED, *this ) ); @@ -239,12 +243,12 @@ void SfxStyleSheetBase::SetHidden( sal_Bool hidden ) // Change follow -const XubString& SfxStyleSheetBase::GetFollow() const +const OUString& SfxStyleSheetBase::GetFollow() const { return aFollow; } -bool SfxStyleSheetBase::SetFollow( const XubString& rName ) +bool SfxStyleSheetBase::SetFollow( const OUString& rName ) { if( aFollow != rName ) { @@ -315,17 +319,17 @@ bool SfxStyleSheetBase::IsUsed() const // eingestellte Attribute ausgeben -XubString SfxStyleSheetBase::GetDescription() +OUString SfxStyleSheetBase::GetDescription() { return GetDescription( SFX_MAPUNIT_CM ); } // eingestellte Attribute ausgeben -XubString SfxStyleSheetBase::GetDescription( SfxMapUnit eMetric ) +OUString SfxStyleSheetBase::GetDescription( SfxMapUnit eMetric ) { SfxItemIter aIter( GetItemSet() ); - XubString aDesc; + OUString aDesc; const SfxPoolItem* pItem = aIter.FirstItem(); IntlWrapper aIntlWrapper( SvtSysLocale().GetLanguageTag() ); @@ -338,8 +342,8 @@ XubString SfxStyleSheetBase::GetDescription( SfxMapUnit eMetric ) *pItem, SFX_ITEM_PRESENTATION_COMPLETE, eMetric, aItemPresentation, &aIntlWrapper ) ) { - if ( aDesc.Len() && !aItemPresentation.isEmpty() ) - aDesc.AppendAscii(" + "); + if ( !aDesc.isEmpty() && !aItemPresentation.isEmpty() ) + aDesc += " + "; if ( !aItemPresentation.isEmpty() ) aDesc += aItemPresentation; } @@ -355,8 +359,8 @@ SfxStyleFamily SfxStyleSheetIterator::GetSearchFamily() const inline bool SfxStyleSheetIterator::IsTrivialSearch() { - return ( nMask & SFXSTYLEBIT_ALL_VISIBLE ) == SFXSTYLEBIT_ALL_VISIBLE - && GetSearchFamily() == SFX_STYLE_FAMILY_ALL; + return (( nMask & SFXSTYLEBIT_ALL_VISIBLE ) == SFXSTYLEBIT_ALL_VISIBLE) && + (GetSearchFamily() == SFX_STYLE_FAMILY_ALL); } bool SfxStyleSheetIterator::DoesStyleMatch(SfxStyleSheetBase *pStyle) @@ -498,7 +502,7 @@ SfxStyleSheetBase* SfxStyleSheetIterator::Find(const OUString& rStr) // #98454# performance: in case of bSearchUsed==sal_True it may be // significant to first compare the name and only if it matches to call // the style sheet IsUsed() method in DoesStyleMatch(). - if ( pStyle->GetName().Equals( rStr ) && DoesStyleMatch( pStyle ) ) + if ( pStyle->GetName() == rStr && DoesStyleMatch( pStyle ) ) { nAktPosition = n; return pAktStyle = pStyle; @@ -517,8 +521,7 @@ sal_uInt16 SfxStyleSheetIterator::GetSearchMask() const } -void SfxStyleSheetBasePool::Replace( - SfxStyleSheetBase& rSource, SfxStyleSheetBase& rTarget ) +void SfxStyleSheetBasePool::Replace( SfxStyleSheetBase& rSource, SfxStyleSheetBase& rTarget ) { rTarget.SetFollow( rSource.GetFollow() ); rTarget.SetParent( rSource.GetParent() ); @@ -578,7 +581,7 @@ SfxStyleSheetBasePool::~SfxStyleSheetBasePool() delete pImp; } -bool SfxStyleSheetBasePool::SetParent(SfxStyleFamily eFam, const XubString& rStyle, const XubString& rParent) +bool SfxStyleSheetBasePool::SetParent(SfxStyleFamily eFam, const OUString& rStyle, const OUString& rParent) { SfxStyleSheetIterator aIter(this,eFam,SFXSTYLEBIT_ALL); SfxStyleSheetBase *pStyle = aIter.Find(rStyle); @@ -611,7 +614,7 @@ SfxStyleSheetIteratorPtr SfxStyleSheetBasePool::CreateIterator SfxStyleSheetBase* SfxStyleSheetBasePool::Create ( - const XubString& rName, + const OUString& rName, SfxStyleFamily eFam, sal_uInt16 mask ) @@ -624,7 +627,7 @@ SfxStyleSheetBase* SfxStyleSheetBasePool::Create( const SfxStyleSheetBase& r ) return new SfxStyleSheetBase( r ); } -SfxStyleSheetBase& SfxStyleSheetBasePool::Make( const XubString& rName, SfxStyleFamily eFam, sal_uInt16 mask, sal_uInt16 nPos) +SfxStyleSheetBase& SfxStyleSheetBasePool::Make( const OUString& rName, SfxStyleFamily eFam, sal_uInt16 mask, sal_uInt16 nPos) { OSL_ENSURE( eFam != SFX_STYLE_FAMILY_ALL, "svl::SfxStyleSheetBasePool::Make(), FamilyAll is not a allowed Familie" ); @@ -698,7 +701,7 @@ SfxStyleSheetBase *SfxStyleSheetBasePool::operator[](sal_uInt16 nIdx) return GetIterator_Impl()[nIdx]; } -SfxStyleSheetBase* SfxStyleSheetBasePool::Find(const XubString& rName, +SfxStyleSheetBase* SfxStyleSheetBasePool::Find(const OUString& rName, SfxStyleFamily eFam, sal_uInt16 mask) { @@ -793,15 +796,15 @@ void SfxStyleSheetBasePool::Clear() } } -void SfxStyleSheetBasePool::ChangeParent(const XubString& rOld, - const XubString& rNew, +void SfxStyleSheetBasePool::ChangeParent(const OUString& rOld, + const OUString& rNew, bool bVirtual) { const sal_uInt16 nTmpMask = GetSearchMask(); SetSearchMask(GetSearchFamily(), SFXSTYLEBIT_ALL); for( SfxStyleSheetBase* p = First(); p; p = Next() ) { - if( p->GetParent().Equals( rOld ) ) + if( p->GetParent() == rOld ) { if(bVirtual) p->SetParent( rNew ); @@ -831,19 +834,21 @@ const SfxItemPool& SfxStyleSheetBasePool::GetPool() const } -SfxStyleSheet::SfxStyleSheet(const XubString &rName, +SfxStyleSheet::SfxStyleSheet(const OUString &rName, const SfxStyleSheetBasePool& r_Pool, SfxStyleFamily eFam, - sal_uInt16 mask ): - SfxStyleSheetBase(rName, const_cast< SfxStyleSheetBasePool* >( &r_Pool ), eFam, mask) -{} + sal_uInt16 mask ) + : SfxStyleSheetBase(rName, const_cast< SfxStyleSheetBasePool* >( &r_Pool ), eFam, mask) +{ +} -SfxStyleSheet::SfxStyleSheet(const SfxStyleSheet& rStyle) : - SfxStyleSheetBase(rStyle), - SfxListener( rStyle ), - SfxBroadcaster( rStyle ), - svl::StyleSheetUser() -{} +SfxStyleSheet::SfxStyleSheet(const SfxStyleSheet& rStyle) + : SfxStyleSheetBase(rStyle) + , SfxListener( rStyle ) + , SfxBroadcaster( rStyle ) + , svl::StyleSheetUser() +{ +} SfxStyleSheet::~SfxStyleSheet() { @@ -851,22 +856,25 @@ SfxStyleSheet::~SfxStyleSheet() } -bool SfxStyleSheet::SetParent( const XubString& rName ) +bool SfxStyleSheet::SetParent( const OUString& rName ) { if(aParent == rName) return true; - const XubString aOldParent(aParent); - if(SfxStyleSheetBase::SetParent(rName)) { + const OUString aOldParent(aParent); + if(SfxStyleSheetBase::SetParent(rName)) + { // aus der Benachrichtigungskette des alten // Parents gfs. austragen - if(aOldParent.Len()) { + if(!aOldParent.isEmpty()) + { SfxStyleSheet *pParent = (SfxStyleSheet *)pPool->Find(aOldParent, nFamily, SFXSTYLEBIT_ALL); if(pParent) EndListening(*pParent); } // in die Benachrichtigungskette des neuen // Parents eintragen - if(aParent.Len()) { + if(!aParent.isEmpty()) + { SfxStyleSheet *pParent = (SfxStyleSheet *)pPool->Find(aParent, nFamily, SFXSTYLEBIT_ALL); if(pParent) StartListening(*pParent); @@ -893,8 +901,8 @@ SfxStyleSheetPool::SfxStyleSheetPool( SfxItemPool const& rSet) { } -SfxStyleSheetBase* SfxStyleSheetPool::Create( const XubString& rName, - SfxStyleFamily eFam, sal_uInt16 mask ) +SfxStyleSheetBase* SfxStyleSheetPool::Create( const OUString& rName, + SfxStyleFamily eFam, sal_uInt16 mask ) { return new SfxStyleSheet( rName, *this, eFam, mask ); } @@ -905,7 +913,7 @@ SfxStyleSheetBase* SfxStyleSheetPool::Create( const SfxStyleSheet& r ) } // class SfxUnoStyleSheet -SfxUnoStyleSheet::SfxUnoStyleSheet( const UniString& _rName, const SfxStyleSheetBasePool& _rPool, SfxStyleFamily _eFamily, sal_uInt16 _nMaske ) +SfxUnoStyleSheet::SfxUnoStyleSheet( const OUString& _rName, const SfxStyleSheetBasePool& _rPool, SfxStyleFamily _eFamily, sal_uInt16 _nMaske ) : ::cppu::ImplInheritanceHelper2< SfxStyleSheet, ::com::sun::star::style::XStyle, ::com::sun::star::lang::XUnoTunnel >( _rName, _rPool, _eFamily, _nMaske ) { } diff --git a/svl/source/misc/inethist.cxx b/svl/source/misc/inethist.cxx index 7dda81a7c621..167ccdc4909b 100644 --- a/svl/source/misc/inethist.cxx +++ b/svl/source/misc/inethist.cxx @@ -26,7 +26,6 @@ #include "rtl/crc.h" #include <tools/solar.h> #include <tools/debug.hxx> -#include <tools/string.hxx> #include <tools/urlobj.hxx> /*======================================================================== @@ -201,8 +200,8 @@ public: /** putUrl/queryUrl. */ - void putUrl (const String &rUrl); - sal_Bool queryUrl (const String &rUrl); + void putUrl (const OUString &rUrl); + sal_Bool queryUrl (const OUString &rUrl); }; /*======================================================================== @@ -292,7 +291,7 @@ void INetURLHistory_Impl::move (sal_uInt16 nSI, sal_uInt16 nDI) /* * putUrl. */ -void INetURLHistory_Impl::putUrl (const String &rUrl) +void INetURLHistory_Impl::putUrl (const OUString &rUrl) { sal_uInt32 h = crc32 (rUrl); sal_uInt16 k = find (h); @@ -349,7 +348,7 @@ void INetURLHistory_Impl::putUrl (const String &rUrl) /* * queryUrl. */ -sal_Bool INetURLHistory_Impl::queryUrl (const String &rUrl) +sal_Bool INetURLHistory_Impl::queryUrl (const OUString &rUrl) { sal_uInt32 h = crc32 (rUrl); sal_uInt16 k = find (h); @@ -417,8 +416,7 @@ void INetURLHistory::NormalizeUrl_Impl (INetURLObject &rUrl) case INET_PROT_FILE: if (!rUrl.IsCaseSensitive()) { - String aPath (rUrl.GetURLPath(INetURLObject::NO_DECODE)); - aPath.ToLowerAscii(); + OUString aPath (rUrl.GetURLPath(INetURLObject::NO_DECODE).toAsciiLowerCase()); rUrl.SetURLPath (aPath, INetURLObject::NOT_CANONIC); } break; diff --git a/svl/source/numbers/zforlist.cxx b/svl/source/numbers/zforlist.cxx index 2dba599fb4b8..f75748ba6202 100644 --- a/svl/source/numbers/zforlist.cxx +++ b/svl/source/numbers/zforlist.cxx @@ -596,19 +596,6 @@ bool SvNumberFormatter::PutandConvertEntrySystem(OUString& rString, return bRes; } -sal_uInt32 SvNumberFormatter::GetIndexPuttingAndConverting( String & rString, LanguageType eLnge, - LanguageType eSysLnge, short & rType, - bool & rNewInserted, xub_StrLen & rCheckPos ) -{ - sal_uInt32 result; - OUString sTemp(rString); - sal_Int32 nCheckPos = (rCheckPos == (xub_StrLen)0xFFFF) ? -1 : (sal_Int32)rCheckPos; - result = GetIndexPuttingAndConverting(sTemp, eLnge, eSysLnge, rType, rNewInserted, nCheckPos); - rCheckPos = nCheckPos < 0 ? (xub_StrLen)0xFFFF : (xub_StrLen)nCheckPos; - rString = sTemp; - return result; -} - sal_uInt32 SvNumberFormatter::GetIndexPuttingAndConverting( OUString & rString, LanguageType eLnge, LanguageType eSysLnge, short & rType, bool & rNewInserted, sal_Int32 & rCheckPos ) @@ -1498,15 +1485,6 @@ void SvNumberFormatter::GetInputLineString(const double& fOutNumber, } } -void SvNumberFormatter::GetInputLineString(const double& fOutNumber, - sal_uInt32 nFIndex, - String& rOutString) -{ - OUString aTmp; - GetInputLineString(fOutNumber, nFIndex, aTmp); - rOutString = aTmp; -} - void SvNumberFormatter::GetOutputString(const OUString& sString, sal_uInt32 nFIndex, OUString& sOutString, @@ -1560,17 +1538,6 @@ void SvNumberFormatter::GetOutputString(const double& fOutNumber, pFormat->SetStarFormatSupport( false ); } -void SvNumberFormatter::GetOutputString(const double& fOutNumber, - sal_uInt32 nFIndex, - String& sOutString, - Color** ppColor, - bool bUseStarFormat ) -{ - OUString sTemp(sOutString); - GetOutputString(fOutNumber, nFIndex, sTemp, ppColor, bUseStarFormat); - sOutString = sTemp; -} - bool SvNumberFormatter::GetPreviewString(const OUString& sFormatString, double fPreviewNumber, OUString& sOutString, @@ -1824,22 +1791,22 @@ SvNumberformat* SvNumberFormatter::ImpInsertFormat( const ::com::sun::star::i18n sal_uInt32 nPos, bool bAfterChangingSystemCL, sal_Int16 nOrgIndex ) { - String aCodeStr( rCode.Code ); + OUString aCodeStr( rCode.Code ); if ( rCode.Index < NF_INDEX_TABLE_LOCALE_DATA_DEFAULTS && rCode.Usage == ::com::sun::star::i18n::KNumberFormatUsage::CURRENCY && rCode.Index != NF_CURRENCY_1000DEC2_CCC ) { // strip surrounding [$...] on automatic currency - if ( aCodeStr.SearchAscii( "[$" ) != STRING_NOTFOUND ) + if ( aCodeStr.indexOf( "[$" ) >= 0) aCodeStr = SvNumberformat::StripNewCurrencyDelimiters( aCodeStr, false ); else { if (LocaleDataWrapper::areChecksEnabled() && rCode.Index != NF_CURRENCY_1000DEC2_CCC ) { - OUString aMsg("SvNumberFormatter::ImpInsertFormat: no [$...] on currency format code, index "); - aMsg += OUString::valueOf( sal_Int32(rCode.Index) ); - aMsg += ":\n"; - aMsg += rCode.Code; + OUString aMsg(OUString("SvNumberFormatter::ImpInsertFormat: no [$...] on currency format code, index ") + + OUString::valueOf( sal_Int32(rCode.Index)) + + OUString(":\n") + + rCode.Code); LocaleDataWrapper::outputCheckMessage( xLocaleData->appendLocaleInfo( aMsg)); } } @@ -1856,10 +1823,10 @@ SvNumberformat* SvNumberFormatter::ImpInsertFormat( const ::com::sun::star::i18n { if (LocaleDataWrapper::areChecksEnabled()) { - OUString aMsg( "SvNumberFormatter::ImpInsertFormat: bad format code, index " ); - aMsg += OUString::valueOf( sal_Int32(rCode.Index) ); - aMsg += "\n"; - aMsg += rCode.Code; + OUString aMsg( OUString("SvNumberFormatter::ImpInsertFormat: bad format code, index " ) + + OUString::valueOf( sal_Int32(rCode.Index) ) + + OUString("\n") + + rCode.Code); LocaleDataWrapper::outputCheckMessage( xLocaleData->appendLocaleInfo( aMsg)); } delete pFormat; @@ -2842,7 +2809,7 @@ OUString SvNumberFormatter::GenerateFormat(sal_uInt32 nIndex, else if (eType == NUMBERFORMAT_CURRENCY) { OUStringBuffer sNegStr(sString); - String aCurr; + OUString aCurr; const NfCurrencyEntry* pEntry; bool bBank; if ( GetNewCurrencySymbolString( nIndex, aCurr, &pEntry, &bBank ) ) @@ -3462,18 +3429,19 @@ inline } -bool SvNumberFormatter::GetNewCurrencySymbolString( sal_uInt32 nFormat, String& rStr, +bool SvNumberFormatter::GetNewCurrencySymbolString( sal_uInt32 nFormat, OUString& rStr, const NfCurrencyEntry** ppEntry /* = NULL */, bool* pBank /* = NULL */ ) const { - rStr.Erase(); if ( ppEntry ) *ppEntry = NULL; if ( pBank ) *pBank = false; + const SvNumberformat* pFormat = GetFormatEntry(nFormat); if ( pFormat ) { + OUStringBuffer sBuff(128); // guess-estimate of a value that will pretty much garantee no re-alloc OUString aSymbol, aExtension; if ( pFormat->GetNewCurrencySymbol( aSymbol, aExtension ) ) { @@ -3492,26 +3460,31 @@ bool SvNumberFormatter::GetNewCurrencySymbolString( sal_uInt32 nFormat, String& rStr = pFoundEntry->BuildSymbolString(bFoundBank); } } - if ( !rStr.Len() ) + if ( rStr.isEmpty() ) { // analog to BuildSymbolString - rStr = '['; - rStr += '$'; + sBuff.append("[$"); if ( aSymbol.indexOf( '-' ) != -1 || aSymbol.indexOf( ']' ) != -1 ) { - rStr += '"'; - rStr += aSymbol; - rStr += '"'; + sBuff.append('"'); + sBuff.append( aSymbol); + sBuff.append('"'); } else - rStr += aSymbol; - if ( aExtension.getLength() ) - rStr += aExtension; - rStr += ']'; + { + sBuff.append(aSymbol); + } + if ( !aExtension.isEmpty() ) + { + sBuff.append(aExtension); + } + sBuff.append(']'); } + rStr = sBuff.toString(); return true; } } + rStr = ""; return false; } @@ -4172,10 +4145,8 @@ void NfCurrencyEntry::CompleteNegativeFormatString(OUStringBuffer& rStr, break; case 11: // $ -1 { - String aTmp( rSymStr ); - aTmp += ' '; - aTmp += '-'; - rStr.insert(0, aTmp); + rStr.insert(0, " -"); + rStr.insert(0, rSymStr); } break; case 12 : // $ 1- diff --git a/svl/source/numbers/zformat.cxx b/svl/source/numbers/zformat.cxx index 720ea8727953..abaf36b068b5 100644 --- a/svl/source/numbers/zformat.cxx +++ b/svl/source/numbers/zformat.cxx @@ -1919,7 +1919,7 @@ void SvNumberformat::ConvertLanguage( SvNumberFormatter& rConverter, // static OUString SvNumberformat::LoadString( SvStream& rStream ) { - CharSet eStream = rStream.GetStreamCharSet(); + rtl_TextEncoding eStream = rStream.GetStreamCharSet(); OString aStr = read_lenPrefixed_uInt8s_ToOString<sal_uInt16>(rStream); sal_Char cStream = NfCurrencyEntry::GetEuroSymbol( eStream ); if (aStr.indexOf(cStream) < 0) @@ -5024,7 +5024,7 @@ Color* SvNumberformat::GetColor( sal_uInt16 nNumFor ) const static void lcl_SvNumberformat_AddLimitStringImpl( OUString& rStr, SvNumberformatLimitOps eOp, - double fLimit, const String& rDecSep ) + double fLimit, const OUString& rDecSep ) { if ( eOp != NUMBERFORMAT_OP_NO ) { @@ -5054,7 +5054,7 @@ static void lcl_SvNumberformat_AddLimitStringImpl( OUString& rStr, } rStr += ::rtl::math::doubleToUString( fLimit, rtl_math_StringFormat_Automatic, rtl_math_DecimalPlaces_Max, - rDecSep.GetChar(0), true); + rDecSep[0], true); rStr += "]"; } } diff --git a/svl/source/numbers/zforscan.cxx b/svl/source/numbers/zforscan.cxx index 387da214ea8e..ce019296ed68 100644 --- a/svl/source/numbers/zforscan.cxx +++ b/svl/source/numbers/zforscan.cxx @@ -742,7 +742,7 @@ short ImpSvNumberformatScan::Next_Symbol( const OUString& rStr, bool bCurrency = false; // "Automatic" currency may start with keyword, // like "R" (Rand) and 'R' (era) - if ( nCurrPos != STRING_NOTFOUND && + if ( nCurrPos >= 0 && nPos-1 + sCurString.getLength() <= rStr.getLength() && sCurString.indexOf( sKeyword[nTmpType] ) == 0 ) { @@ -1314,7 +1314,7 @@ sal_Int32 ImpSvNumberformatScan::ScanType() case NUMBERFORMAT_FRACTION: // MM/SS break; default: - if (nCurrPos != STRING_NOTFOUND) + if (nCurrPos >= 0) { eScannedType = NUMBERFORMAT_UNDEFINED; } @@ -1373,7 +1373,7 @@ sal_Int32 ImpSvNumberformatScan::ScanType() eScannedType = eNewType; break; default: - if (nCurrPos != STRING_NOTFOUND) + if (nCurrPos >= 0) { eScannedType = NUMBERFORMAT_UNDEFINED; } diff --git a/svl/source/svdde/ddecli.cxx b/svl/source/svdde/ddecli.cxx index 168881144d35..f2d53cb51355 100644 --- a/svl/source/svdde/ddecli.cxx +++ b/svl/source/svdde/ddecli.cxx @@ -54,9 +54,9 @@ struct DdeImp // --- DdeInternat::CliCallback() ---------------------------------- -HDDEDATA CALLBACK DdeInternal::CliCallback( - WORD nCode, WORD nCbType, HCONV hConv, HSZ, HSZ hText2, - HDDEDATA hData, DWORD nInfo1, DWORD ) +HDDEDATA CALLBACK DdeInternal::CliCallback( WORD nCode, WORD nCbType, + HCONV hConv, HSZ, HSZ hText2, + HDDEDATA hData, DWORD nInfo1, DWORD ) { HDDEDATA nRet = DDE_FNOTPROCESSED; const std::vector<DdeConnection*> &rAll = DdeConnection::GetConnections(); @@ -75,35 +75,35 @@ HDDEDATA CALLBACK DdeInternal::CliCallback( if( self ) { - sal_Bool bFound = sal_False; + bool bFound = false; std::vector<DdeTransaction*>::iterator iter; for( iter = self->aTransactions.begin(); iter != self->aTransactions.end(); ++iter ) { switch( nCode ) { - case XTYP_XACT_COMPLETE: - if( (DWORD)(*iter)->nId == nInfo1 ) - { - nCode = (*iter)->nType & (XCLASS_MASK | XTYP_MASK); - (*iter)->bBusy = false; - (*iter)->Done( 0 != hData ); - bFound = sal_True; - } - break; + case XTYP_XACT_COMPLETE: + if( (DWORD)(*iter)->nId == nInfo1 ) + { + nCode = (*iter)->nType & (XCLASS_MASK | XTYP_MASK); + (*iter)->bBusy = false; + (*iter)->Done( 0 != hData ); + bFound = true; + } + break; - case XTYP_DISCONNECT: - self->pImp->hConv = DdeReconnect( hConv ); - self->pImp->nStatus = self->pImp->hConv - ? DMLERR_NO_ERROR - : DdeGetLastError( pInst->hDdeInstCli ); - iter = self->aTransactions.end(); - nRet = 0; - bFound = sal_True; - break; + case XTYP_DISCONNECT: + self->pImp->hConv = DdeReconnect( hConv ); + self->pImp->nStatus = self->pImp->hConv + ? DMLERR_NO_ERROR + : DdeGetLastError( pInst->hDdeInstCli ); + iter = self->aTransactions.end(); + nRet = 0; + bFound = true; + break; - case XTYP_ADVDATA: - bFound = sal_Bool( *(*iter)->pName == hText2 ); - break; + case XTYP_ADVDATA: + bFound = *(*iter)->pName == hText2; + break; } if( bFound ) break; @@ -143,7 +143,7 @@ HDDEDATA CALLBACK DdeInternal::CliCallback( // --- DdeConnection::DdeConnection() ------------------------------ -DdeConnection::DdeConnection( const String& rService, const String& rTopic ) +DdeConnection::DdeConnection( const OUString& rService, const OUString& rTopic ) { pImp = new DdeImp; pImp->nStatus = DMLERR_NO_ERROR; @@ -212,33 +212,33 @@ DdeConnection::~DdeConnection() // --- DdeConnection::IsConnected() -------------------------------- -sal_Bool DdeConnection::IsConnected() +bool DdeConnection::IsConnected() { CONVINFO c; c.cb = sizeof( c ); if ( DdeQueryConvInfo( pImp->hConv, QID_SYNC, &c ) ) - return sal_True; + return true; else { DdeInstData* pInst = ImpGetInstData(); pImp->hConv = DdeReconnect( pImp->hConv ); pImp->nStatus = pImp->hConv ? DMLERR_NO_ERROR : DdeGetLastError( pInst->hDdeInstCli ); - return sal_Bool( pImp->nStatus == DMLERR_NO_ERROR ); + return pImp->nStatus == DMLERR_NO_ERROR; } } // --- DdeConnection::GetServiceName() ----------------------------- -const String& DdeConnection::GetServiceName() +const OUString DdeConnection::GetServiceName() { - return (const String&)*pService; + return pService->toOUString(); } // --- DdeConnection::GetTopicName() ------------------------------- -const String& DdeConnection::GetTopicName() +const OUString DdeConnection::GetTopicName() { - return (const String&)*pTopic; + return pTopic->toOUString(); } // --- DdeConnection::GetConvId() ---------------------------------- @@ -257,9 +257,9 @@ const std::vector<DdeConnection*>& DdeConnection::GetConnections() // --- DdeTransaction::DdeTransaction() ---------------------------- -DdeTransaction::DdeTransaction( DdeConnection& d, const String& rItemName, - long n ) : - rDde( d ) +DdeTransaction::DdeTransaction( DdeConnection& d, const OUString& rItemName, + long n ) + : rDde( d ) { DdeInstData* pInst = ImpGetInstData(); pName = new DdeString( pInst->hDdeInstCli, rItemName ); @@ -360,7 +360,7 @@ void DdeTransaction::Data( const DdeData* p ) // --- DdeTransaction::Done() -------------------------------------- -void DdeTransaction::Done( sal_Bool bDataValid ) +void DdeTransaction::Done( bool bDataValid ) { const sal_uIntPtr nDataValid(bDataValid); aDone.Call( reinterpret_cast<void*>(nDataValid) ); @@ -368,8 +368,8 @@ void DdeTransaction::Done( sal_Bool bDataValid ) // --- DdeLink::DdeLink() ------------------------------------------ -DdeLink::DdeLink( DdeConnection& d, const String& aItemName, long n ) : - DdeTransaction (d, aItemName, n) +DdeLink::DdeLink( DdeConnection& d, const OUString& aItemName, long n ) + : DdeTransaction (d, aItemName, n) { } @@ -390,33 +390,33 @@ void DdeLink::Notify() // --- DdeRequest::DdeRequest() ------------------------------------ -DdeRequest::DdeRequest( DdeConnection& d, const String& i, long n ) : - DdeTransaction( d, i, n ) +DdeRequest::DdeRequest( DdeConnection& d, const OUString& i, long n ) + : DdeTransaction( d, i, n ) { nType = XTYP_REQUEST; } // --- DdeWarmLink::DdeWarmLink() ---------------------------------- -DdeWarmLink::DdeWarmLink( DdeConnection& d, const String& i, long n ) : - DdeLink( d, i, n ) +DdeWarmLink::DdeWarmLink( DdeConnection& d, const OUString& i, long n ) + : DdeLink( d, i, n ) { nType = XTYP_ADVSTART | XTYPF_NODATA; } // --- DdeHotLink::DdeHotLink() ------------------------------------ -DdeHotLink::DdeHotLink( DdeConnection& d, const String& i, long n ) : - DdeLink( d, i, n ) +DdeHotLink::DdeHotLink( DdeConnection& d, const OUString& i, long n ) + : DdeLink( d, i, n ) { nType = XTYP_ADVSTART; } // --- DdePoke::DdePoke() ------------------------------------------ -DdePoke::DdePoke( DdeConnection& d, const String& i, const char* p, - long l, sal_uLong f, long n ) : - DdeTransaction( d, i, n ) +DdePoke::DdePoke( DdeConnection& d, const OUString& i, const char* p, + long l, sal_uLong f, long n ) + : DdeTransaction( d, i, n ) { aDdeData = DdeData( p, l, f ); nType = XTYP_POKE; @@ -424,19 +424,19 @@ DdePoke::DdePoke( DdeConnection& d, const String& i, const char* p, // --- DdePoke::DdePoke() ------------------------------------------ -DdePoke::DdePoke( DdeConnection& d, const String& i, const String& rData, - long n ) : - DdeTransaction( d, i, n ) +DdePoke::DdePoke( DdeConnection& d, const OUString& i, const OUString& rData, + long n ) + : DdeTransaction( d, i, n ) { - aDdeData = DdeData( (void*) rData.GetBuffer(), sizeof(sal_Unicode) * (rData.Len()), CF_TEXT ); + aDdeData = DdeData( (void*) rData.getStr(), sizeof(sal_Unicode) * (rData.getLength()), CF_TEXT ); nType = XTYP_POKE; } // --- DdePoke::DdePoke() ------------------------------------------ -DdePoke::DdePoke( DdeConnection& d, const String& i, const DdeData& rData, - long n ) : - DdeTransaction( d, i, n ) +DdePoke::DdePoke( DdeConnection& d, const OUString& i, const DdeData& rData, + long n ) + : DdeTransaction( d, i, n ) { aDdeData = rData; nType = XTYP_POKE; @@ -444,10 +444,10 @@ DdePoke::DdePoke( DdeConnection& d, const String& i, const DdeData& rData, // --- DdeExecute::DdeExecute() ------------------------------------ -DdeExecute::DdeExecute( DdeConnection& d, const String& rData, long n ) : - DdeTransaction( d, String(), n ) +DdeExecute::DdeExecute( DdeConnection& d, const OUString& rData, long n ) + : DdeTransaction( d, OUString(), n ) { - aDdeData = DdeData( (void*)rData.GetBuffer(), sizeof(sal_Unicode) * (rData.Len() + 1), CF_TEXT ); + aDdeData = DdeData( (void*)rData.getStr(), sizeof(sal_Unicode) * (rData.getLength() + 1), CF_TEXT ); nType = XTYP_EXECUTE; } diff --git a/svl/source/svdde/ddedata.cxx b/svl/source/svdde/ddedata.cxx index 4b4c051a8ca3..4c9e465f572f 100644 --- a/svl/source/svdde/ddedata.cxx +++ b/svl/source/svdde/ddedata.cxx @@ -55,12 +55,12 @@ DdeData::DdeData( const void* p, long n, sal_uLong f ) // --- DdeData::DdeData() ------------------------------------------ -DdeData::DdeData( const String& s ) +DdeData::DdeData( const OUString& s ) { pImp = new DdeDataImp; pImp->hData = NULL; - pImp->pData = (LPBYTE)s.GetBuffer(); - pImp->nData = s.Len()+1; + pImp->pData = (LPBYTE)s.getStr(); + pImp->nData = s.getLength()+1; pImp->nFmt = CF_TEXT; } @@ -151,9 +151,9 @@ sal_uLong DdeData::GetExternalFormat( sal_uLong nFmt ) default: { #if defined(WNT) - String aName( SotExchange::GetFormatName( nFmt ) ); - if( aName.Len() ) - nFmt = RegisterClipboardFormat( reinterpret_cast<LPCWSTR>(aName.GetBuffer()) ); + OUString aName( SotExchange::GetFormatName( nFmt ) ); + if( !aName.isEmpty() ) + nFmt = RegisterClipboardFormat( reinterpret_cast<LPCWSTR>(aName.getStr()) ); #endif } } diff --git a/svl/source/svdde/ddesvr.cxx b/svl/source/svdde/ddesvr.cxx index eaafebb0afb0..25a3f3fd56c1 100644 --- a/svl/source/svdde/ddesvr.cxx +++ b/svl/source/svdde/ddesvr.cxx @@ -204,7 +204,7 @@ found: return (HDDEDATA)NULL; } - sal_Bool bExec = sal_Bool(nCode == XTYP_EXECUTE); + bool bExec = nCode == XTYP_EXECUTE; pTopic = pC->pTopic; if ( pTopic && !bExec ) pItem = FindItem( *pTopic, hText2 ); @@ -220,14 +220,14 @@ found: else pTopic->aItem = OUString(); - sal_Bool bRes = sal_False; + bool bRes = false; pInst->hCurConvSvr = (sal_IntPtr)hConv; switch( nCode ) { - case XTYP_REQUEST: - case XTYP_ADVREQ: - { - String aRes; // darf erst am Ende freigegeben werden!! + case XTYP_REQUEST: + case XTYP_ADVREQ: + { + OUString aRes; // darf erst am Ende freigegeben werden!! if ( pTopic->IsSystemTopic() ) { if ( pTopic->aItem == reinterpret_cast<const sal_Unicode*>(SZDDESYS_ITEM_TOPICS) ) @@ -243,18 +243,22 @@ found: else aRes = pService->SysTopicGet( pTopic->aItem ); - if ( aRes.Len() ) + if ( !aRes.isEmpty() ) pData = new DdeData( aRes ); else pData = NULL; } else if( DDEGETPUTITEM == pItem->nType ) - pData = ((DdeGetPutItem*)pItem)->Get( - DdeData::GetInternalFormat( nCbType ) ); + { + pData = ((DdeGetPutItem*)pItem)->Get( DdeData::GetInternalFormat( nCbType ) ); + } else + { pData = pTopic->Get( DdeData::GetInternalFormat( nCbType )); + } if ( pData ) + { return DdeCreateDataHandle( pInst->hDdeInstSvr, (LPBYTE)pData->pImp->pData, pData->pImp->nData, @@ -263,94 +267,95 @@ found: pData->pImp->nFmt ), 0 ); } - break; + } + break; - case XTYP_POKE: - if ( !pTopic->IsSystemTopic() ) - { - DdeData d; - d.pImp->hData = hData; - d.pImp->nFmt = DdeData::GetInternalFormat( nCbType ); - d.Lock(); - if( DDEGETPUTITEM == pItem->nType ) - bRes = ((DdeGetPutItem*)pItem)->Put( &d ); - else - bRes = pTopic->Put( &d ); - } - pInst->hCurConvSvr = 0; - if ( bRes ) - return (HDDEDATA)DDE_FACK; + case XTYP_POKE: + if ( !pTopic->IsSystemTopic() ) + { + DdeData d; + d.pImp->hData = hData; + d.pImp->nFmt = DdeData::GetInternalFormat( nCbType ); + d.Lock(); + if( DDEGETPUTITEM == pItem->nType ) + bRes = ((DdeGetPutItem*)pItem)->Put( &d ); else - return (HDDEDATA) DDE_FNOTPROCESSED; + bRes = pTopic->Put( &d ); + } + pInst->hCurConvSvr = 0; + if ( bRes ) + return (HDDEDATA)DDE_FACK; + else + return (HDDEDATA) DDE_FNOTPROCESSED; - case XTYP_ADVSTART: + case XTYP_ADVSTART: + { + // wird das Item zum erstenmal ein HotLink ? + if( !pItem->pImpData && pTopic->StartAdviseLoop() ) { - // wird das Item zum erstenmal ein HotLink ? - if( !pItem->pImpData && pTopic->StartAdviseLoop() ) + // dann wurde das Item ausgewechselt + std::vector<DdeItem*>::iterator it(std::find(pTopic->aItems.begin(), + pTopic->aItems.end(), + pItem)); + if (it != pTopic->aItems.end()) + pTopic->aItems.erase(it); + + std::vector<DdeItem*>::iterator iter; + for( iter = pTopic->aItems.begin(); + iter != pTopic->aItems.end(); + ++iter ) { - // dann wurde das Item ausgewechselt - std::vector<DdeItem*>::iterator it(std::find(pTopic->aItems.begin(), - pTopic->aItems.end(), - pItem)); - if (it != pTopic->aItems.end()) - pTopic->aItems.erase(it); - - std::vector<DdeItem*>::iterator iter; - for( iter = pTopic->aItems.begin(); - iter != pTopic->aItems.end(); - ++iter ) + if( *(*iter)->pName == hText2 ) { - if( *(*iter)->pName == hText2 ) - { - // es wurde tatsaechlich ausgewechselt - delete pItem; - pItem = 0; - break; - } + // es wurde tatsaechlich ausgewechselt + delete pItem; + pItem = 0; + break; } - - if( pItem ) - // es wurde doch nicht ausgewechselt, also wieder rein - pTopic->aItems.push_back(pItem); - else - pItem = iter != pTopic->aItems.end() ? *iter : NULL; } - if (pItem) - { - pItem->IncMonitor( (sal_IntPtr)hConv ); - pInst->hCurConvSvr = 0; - } + if( pItem ) + // es wurde doch nicht ausgewechselt, also wieder rein + pTopic->aItems.push_back(pItem); + else + pItem = iter != pTopic->aItems.end() ? *iter : NULL; } - return (HDDEDATA)sal_True; - case XTYP_ADVSTOP: - pItem->DecMonitor( (sal_IntPtr)hConv ); - if( !pItem->pImpData ) - pTopic->StopAdviseLoop(); - pInst->hCurConvSvr = 0; - return (HDDEDATA)sal_True; - - case XTYP_EXECUTE: + if (pItem) { - DdeData aExec; - aExec.pImp->hData = hData; - aExec.pImp->nFmt = DdeData::GetInternalFormat( nCbType ); - aExec.Lock(); - String aName; + pItem->IncMonitor( (sal_IntPtr)hConv ); + pInst->hCurConvSvr = 0; + } + } + return (HDDEDATA)sal_True; - aName = (const sal_Unicode *)aExec.pImp->pData; + case XTYP_ADVSTOP: + pItem->DecMonitor( (sal_IntPtr)hConv ); + if( !pItem->pImpData ) + pTopic->StopAdviseLoop(); + pInst->hCurConvSvr = 0; + return (HDDEDATA)sal_True; - if( pTopic->IsSystemTopic() ) - bRes = pService->SysTopicExecute( &aName ); - else - bRes = pTopic->Execute( &aName ); - } - pInst->hCurConvSvr = 0; - if ( bRes ) - return (HDDEDATA)DDE_FACK; + case XTYP_EXECUTE: + { + DdeData aExec; + aExec.pImp->hData = hData; + aExec.pImp->nFmt = DdeData::GetInternalFormat( nCbType ); + aExec.Lock(); + OUString aName; + + aName = (const sal_Unicode *)aExec.pImp->pData; + + if( pTopic->IsSystemTopic() ) + bRes = pService->SysTopicExecute( &aName ); else - return (HDDEDATA)DDE_FNOTPROCESSED; + bRes = pTopic->Execute( &aName ); + } + pInst->hCurConvSvr = 0; + if ( bRes ) + return (HDDEDATA)DDE_FACK; + else + return (HDDEDATA)DDE_FNOTPROCESSED; } return (HDDEDATA)NULL; @@ -378,11 +383,12 @@ DdeTopic* DdeInternal::FindTopic( DdeService& rService, HSZ hTopic ) { std::vector<DdeTopic*>::iterator iter; std::vector<DdeTopic*> &rTopics = rService.aTopics; - int bWeiter = sal_False; + bool bWeiter = false; DdeInstData* pInst = ImpGetInstData(); DBG_ASSERT(pInst,"SVDDE:No instance data"); - do { // middle check loop + do + { // middle check loop for ( iter = rTopics.begin(); iter != rTopics.end(); ++iter ) { if ( *(*iter)->pName == hTopic ) @@ -398,7 +404,8 @@ DdeTopic* DdeInternal::FindTopic( DdeService& rService, HSZ hTopic ) DdeQueryString(pInst->hDdeInstSvr,hTopic,chBuf,sizeof(chBuf)/sizeof(TCHAR),CP_WINUNICODE ); bWeiter = rService.MakeTopic( reinterpret_cast<const sal_Unicode*>(chBuf) ); // dann muessen wir noch mal suchen - } while( bWeiter ); + } + while( bWeiter ); return 0; } @@ -411,14 +418,16 @@ DdeItem* DdeInternal::FindItem( DdeTopic& rTopic, HSZ hItem ) std::vector<DdeItem*> &rItems = rTopic.aItems; DdeInstData* pInst = ImpGetInstData(); DBG_ASSERT(pInst,"SVDDE:No instance data"); - int bWeiter = sal_False; + bool bWeiter = false; - do { // middle check loop + do + { // middle check loop for ( iter = rItems.begin(); iter != rItems.end(); ++iter ) + { if ( *(*iter)->pName == hItem ) return *iter; - + } bWeiter = !bWeiter; if( !bWeiter ) break; @@ -428,14 +437,15 @@ DdeItem* DdeInternal::FindItem( DdeTopic& rTopic, HSZ hItem ) DdeQueryString(pInst->hDdeInstSvr,hItem,chBuf,sizeof(chBuf)/sizeof(TCHAR),CP_WINUNICODE ); bWeiter = rTopic.MakeItem( reinterpret_cast<const sal_Unicode*>(chBuf) ); // dann muessen wir noch mal suchen - } while( bWeiter ); + } + while( bWeiter ); return 0; } // --- DdeService::DdeService() ------------------------------------ -DdeService::DdeService( const String& rService ) +DdeService::DdeService( const OUString& rService ) { DdeInstData* pInst = ImpGetInstData(); if( !pInst ) @@ -463,10 +473,13 @@ DdeService::DdeService( const String& rService ) pName = new DdeString( pInst->hDdeInstSvr, rService ); if ( nStatus == DMLERR_NO_ERROR ) + { if ( !DdeNameService( pInst->hDdeInstSvr, *pName, NULL, - DNS_REGISTER | DNS_FILTEROFF ) ) + DNS_REGISTER | DNS_FILTEROFF ) ) + { nStatus = DMLERR_SYS_ERROR; - + } + } AddFormat( FORMAT_STRING ); pSysTopic = new DdeTopic( reinterpret_cast<const sal_Unicode*>(SZDDESYS_TOPIC) ); pSysTopic->AddItem( DdeItem( reinterpret_cast<const sal_Unicode*>(SZDDESYS_ITEM_TOPICS) ) ); @@ -565,7 +578,7 @@ void DdeService::RemoveTopic( const DdeTopic& rTopic ) // --- DdeService::HasCbFormat() ----------------------------------- -sal_Bool DdeService::HasCbFormat( sal_uInt16 nFmt ) +bool DdeService::HasCbFormat( sal_uInt16 nFmt ) { for ( size_t i = 0, n = aFormats.size(); i < n; ++i ) if ( aFormats[ i ] == nFmt ) @@ -575,7 +588,7 @@ sal_Bool DdeService::HasCbFormat( sal_uInt16 nFmt ) // --- DdeService::HasFormat() ------------------------------------- -sal_Bool DdeService::HasFormat( sal_uLong nFmt ) +bool DdeService::HasFormat( sal_uLong nFmt ) { return HasCbFormat( (sal_uInt16)DdeData::GetExternalFormat( nFmt )); } @@ -596,8 +609,10 @@ void DdeService::AddFormat( sal_uLong nFmt ) void DdeService::RemoveFormat( sal_uLong nFmt ) { nFmt = DdeData::GetExternalFormat( nFmt ); - for ( DdeFormats::iterator it = aFormats.begin(); it != aFormats.end(); ++it ) { - if ( (sal_uLong) *it == nFmt ) { + for ( DdeFormats::iterator it = aFormats.begin(); it != aFormats.end(); ++it ) + { + if ( (sal_uLong) *it == nFmt ) + { aFormats.erase( it ); break; } @@ -636,9 +651,9 @@ const OUString DdeTopic::GetName() const // --- DdeTopic::IsSystemTopic() ----------------------------------- -sal_Bool DdeTopic::IsSystemTopic() +bool DdeTopic::IsSystemTopic() { - return sal_Bool (GetName() == reinterpret_cast<const sal_Unicode*>(SZDDESYS_TOPIC)); + return GetName() == reinterpret_cast<const sal_Unicode*>(SZDDESYS_TOPIC); } // --- DdeTopic::AddItem() ----------------------------------------- @@ -650,6 +665,7 @@ DdeItem* DdeTopic::AddItem( const DdeItem& r ) s = new DdeGetPutItem( r ); else s = new DdeItem( r ); + if ( s ) { aItems.push_back( s ); @@ -690,7 +706,7 @@ void DdeTopic::RemoveItem( const DdeItem& r ) // --- DdeTopic::NotifyClient() ------------------------------------ -void DdeTopic::NotifyClient( const String& rItem ) +void DdeTopic::NotifyClient( const OUString& rItem ) { std::vector<DdeItem*>::iterator iter; DdeInstData* pInst = ImpGetInstData(); @@ -742,22 +758,22 @@ DdeData* DdeTopic::Get( sal_uIntPtr nFmt ) // --- DdeTopic::Put() --------------------------------------------- -sal_Bool DdeTopic::Put( const DdeData* r ) +bool DdeTopic::Put( const DdeData* r ) { if ( aPutLink.IsSet() ) - return (sal_Bool)aPutLink.Call( (void*) r ); + return aPutLink.Call( (void*) r ); else - return sal_False; + return false; } // --- DdeTopic::Execute() ----------------------------------------- -sal_Bool DdeTopic::Execute( const String* r ) +bool DdeTopic::Execute( const OUString* r ) { if ( aExecLink.IsSet() ) - return (sal_Bool)aExecLink.Call( (void*)r ); + return aExecLink.Call( (void*)r ); else - return sal_False; + return false; } // --- DdeTopic::GetConvId() --------------------------------------- @@ -771,16 +787,16 @@ long DdeTopic::GetConvId() // --- DdeTopic::StartAdviseLoop() --------------------------------- -sal_Bool DdeTopic::StartAdviseLoop() +bool DdeTopic::StartAdviseLoop() { - return sal_False; + return false; } // --- DdeTopic::StopAdviseLoop() ---------------------------------- -sal_Bool DdeTopic::StopAdviseLoop() +bool DdeTopic::StopAdviseLoop() { - return sal_False; + return false; } // --- DdeItem::DdeItem() ------------------------------------------ @@ -797,7 +813,7 @@ DdeItem::DdeItem( const sal_Unicode* p ) // --- DdeItem::DdeItem() ------------------------------------------ -DdeItem::DdeItem( const String& r) +DdeItem::DdeItem( const OUString& r) { DdeInstData* pInst = ImpGetInstData(); DBG_ASSERT(pInst,"SVDDE:No instance data"); @@ -857,7 +873,7 @@ void DdeItem::IncMonitor( sal_uLong nHCnv ) { pImpData = new DdeItemImp; if( DDEGETPUTITEM == nType ) - ((DdeGetPutItem*)this)->AdviseLoop( sal_True ); + ((DdeGetPutItem*)this)->AdviseLoop( true ); } else { @@ -893,7 +909,7 @@ void DdeItem::DecMonitor( sal_uLong nHCnv ) { delete pImpData, pImpData = 0; if( DDEGETPUTITEM == nType ) - ((DdeGetPutItem*)this)->AdviseLoop( sal_False ); + ((DdeGetPutItem*)this)->AdviseLoop( false ); } } return ; @@ -908,10 +924,12 @@ short DdeItem::GetLinks() { short nCnt = 0; if( pImpData ) + { for( sal_uInt16 n = pImpData->size(); n; ) { nCnt = nCnt + (*pImpData)[ --n ].nCnt; } + } return nCnt; } @@ -925,7 +943,7 @@ DdeGetPutItem::DdeGetPutItem( const sal_Unicode* p ) // --- DdeGetPutItem::DdeGetPutItem() ------------------------------ -DdeGetPutItem::DdeGetPutItem( const String& rStr ) +DdeGetPutItem::DdeGetPutItem( const OUString& rStr ) : DdeItem( rStr ) { nType = DDEGETPUTITEM; @@ -949,23 +967,23 @@ DdeData* DdeGetPutItem::Get( sal_uLong ) // --- DdeGetPutData::Put() ---------------------------------------- -sal_Bool DdeGetPutItem::Put( const DdeData* ) +bool DdeGetPutItem::Put( const DdeData* ) { - return sal_False; + return false; } // --- DdeGetPutData::AdviseLoop() --------------------------------- -void DdeGetPutItem::AdviseLoop( sal_Bool ) +void DdeGetPutItem::AdviseLoop( bool ) { } // --- DdeService::SysItems() -------------------------------------- -String DdeService::SysItems() +OUString DdeService::SysItems() { - String s; + OUString s; std::vector<DdeTopic*>::iterator iter; std::vector<DdeItem*>::iterator iterItem; for ( iter = aTopics.begin(); iter != aTopics.end(); ++iter ) @@ -976,10 +994,10 @@ String DdeService::SysItems() for ( iterItem = (*iter)->aItems.begin(); iterItem != (*iter)->aItems.end(); ++iterItem, n++ ) { if ( n ) - s += '\t'; + s += "\t"; s += (*iterItem)->GetName(); } - s += OUString("\r\n"); + s += "\r\n"; } } @@ -988,28 +1006,28 @@ String DdeService::SysItems() // --- DdeService::Topics() ---------------------------------------- -String DdeService::Topics() +OUString DdeService::Topics() { - String s; + OUString s; std::vector<DdeTopic*>::iterator iter; short n = 0; for ( iter = aTopics.begin(); iter != aTopics.end(); ++iter, n++ ) { if ( n ) - s += '\t'; + s += "\t"; s += (*iter)->GetName(); } - s += OUString("\r\n"); + s += "\r\n"; return s; } // --- DdeService::Formats() --------------------------------------- -String DdeService::Formats() +OUString DdeService::Formats() { - String s; + OUString s; long f; short n = 0; @@ -1017,70 +1035,70 @@ String DdeService::Formats() { f = aFormats[ i ]; if ( n ) - s += '\t'; + s += "\t"; switch( (sal_uInt16)f ) { - case CF_TEXT: - s += OUString("TEXT"); - break; - case CF_BITMAP: - s += OUString("BITMAP"); - break; - default: - { - TCHAR buf[128]; - GetClipboardFormatName( (UINT)f, buf, sizeof(buf) / sizeof(TCHAR) ); - s += OUString(reinterpret_cast<sal_Unicode*>(buf)); - } - break; + case CF_TEXT: + s += "TEXT"; + break; + case CF_BITMAP: + s += "BITMAP"; + break; + default: + { + TCHAR buf[128]; + GetClipboardFormatName( (UINT)f, buf, sizeof(buf) / sizeof(TCHAR) ); + s += OUString(reinterpret_cast<sal_Unicode*>(buf)); + } + break; } } - s += OUString("\r\n"); + s += "\r\n"; return s; } // --- DdeService::Status() ---------------------------------------- -String DdeService::Status() +OUString DdeService::Status() { return IsBusy() ? OUString("Busy\r\n") : OUString("Ready\r\n"); } // --- DdeService::IsBusy() ---------------------------------------- -sal_Bool DdeService::IsBusy() +bool DdeService::IsBusy() { - return sal_False; + return false; } // --- DdeService::GetHelp() ---------------------------------------- -String DdeService::GetHelp() +OUString DdeService::GetHelp() { - return String(); + return OUString(); } -sal_Bool DdeTopic::MakeItem( const OUString& ) +bool DdeTopic::MakeItem( const OUString& ) { - return sal_False; + return false; } -sal_Bool DdeService::MakeTopic( const OUString& ) +bool DdeService::MakeTopic( const OUString& ) { - return sal_False; + return false; } -String DdeService::SysTopicGet( const String& ) +OUString DdeService::SysTopicGet( const OUString& ) { - return String(); + return OUString(); } -sal_Bool DdeService::SysTopicExecute( const String* ) +bool DdeService::SysTopicExecute( const OUString* ) { - return sal_False; + return false; } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/source/undo/undo.cxx b/svl/source/undo/undo.cxx index d27de22e266e..04aaceb2ade6 100644 --- a/svl/source/undo/undo.cxx +++ b/svl/source/undo/undo.cxx @@ -84,10 +84,10 @@ SfxUndoAction::SfxUndoAction() //------------------------------------------------------------------------ -sal_Bool SfxUndoAction::Merge( SfxUndoAction * ) +bool SfxUndoAction::Merge( SfxUndoAction * ) { DBG_CHKTHIS(SfxUndoAction, 0); - return sal_False; + return false; } //------------------------------------------------------------------------ @@ -158,9 +158,9 @@ void SfxUndoAction::Repeat(SfxRepeatTarget&) //------------------------------------------------------------------------ -sal_Bool SfxUndoAction::CanRepeat(SfxRepeatTarget&) const +bool SfxUndoAction::CanRepeat(SfxRepeatTarget&) const { - return sal_True; + return true; } //======================================================================== @@ -226,7 +226,7 @@ namespace svl { namespace undo { namespace impl //-------------------------------------------------------------------- typedef void ( SfxUndoListener::*UndoListenerVoidMethod )(); - typedef void ( SfxUndoListener::*UndoListenerStringMethod )( const String& ); + typedef void ( SfxUndoListener::*UndoListenerStringMethod )( const OUString& ); //-------------------------------------------------------------------- struct SVL_DLLPRIVATE NotifyUndoListener : public ::std::unary_function< SfxUndoListener*, void > @@ -245,7 +245,7 @@ namespace svl { namespace undo { namespace impl { } - NotifyUndoListener( UndoListenerStringMethod i_notificationMethod, const String& i_actionComment ) + NotifyUndoListener( UndoListenerStringMethod i_notificationMethod, const OUString& i_actionComment ) :m_notificationMethod( NULL ) ,m_altNotificationMethod( i_notificationMethod ) ,m_sActionComment( i_actionComment ) @@ -273,7 +273,7 @@ namespace svl { namespace undo { namespace impl private: UndoListenerVoidMethod m_notificationMethod; UndoListenerStringMethod m_altNotificationMethod; - String m_sActionComment; + OUString m_sActionComment; }; //-------------------------------------------------------------------- @@ -326,7 +326,7 @@ namespace svl { namespace undo { namespace impl m_notifiers.push_back( NotifyUndoListener( i_notificationMethod ) ); } - void scheduleNotification( UndoListenerStringMethod i_notificationMethod, const String& i_actionComment ) + void scheduleNotification( UndoListenerStringMethod i_notificationMethod, const OUString& i_actionComment ) { m_notifiers.push_back( NotifyUndoListener( i_notificationMethod, i_actionComment ) ); } @@ -648,7 +648,7 @@ bool SfxUndoManager::ImplAddUndoAction_NoNotify( SfxUndoAction *pAction, bool bT //------------------------------------------------------------------------ -void SfxUndoManager::AddUndoAction( SfxUndoAction *pAction, sal_Bool bTryMerge ) +void SfxUndoManager::AddUndoAction( SfxUndoAction *pAction, bool bTryMerge ) { UndoManagerGuard aGuard( *m_pData ); @@ -739,21 +739,21 @@ bool SfxUndoManager::IsDoing() const //------------------------------------------------------------------------ -sal_Bool SfxUndoManager::Undo() +bool SfxUndoManager::Undo() { return ImplUndo( NULL ); } //------------------------------------------------------------------------ -sal_Bool SfxUndoManager::UndoWithContext( SfxUndoContext& i_context ) +bool SfxUndoManager::UndoWithContext( SfxUndoContext& i_context ) { return ImplUndo( &i_context ); } //------------------------------------------------------------------------ -sal_Bool SfxUndoManager::ImplUndo( SfxUndoContext* i_contextOrNull ) +bool SfxUndoManager::ImplUndo( SfxUndoContext* i_contextOrNull ) { UndoManagerGuard aGuard( *m_pData ); OSL_ENSURE( !IsDoing(), "SfxUndoManager::Undo: *nested* Undo/Redo actions? How this?" ); @@ -774,7 +774,7 @@ sal_Bool SfxUndoManager::ImplUndo( SfxUndoContext* i_contextOrNull ) } SfxUndoAction* pAction = m_pData->pActUndoArray->aUndoActions[ --m_pData->pActUndoArray->nCurUndoAction ].pAction; - const String sActionComment = pAction->GetComment(); + const OUString sActionComment = pAction->GetComment(); try { // clear the guard/mutex before calling into the SfxUndoAction - this can be an extension-implemented UNO component @@ -846,7 +846,7 @@ SfxUndoAction* SfxUndoManager::GetRedoAction( size_t nNo, bool const i_currentLe OUString SfxUndoManager::GetRedoActionComment( size_t nNo, bool const i_currentLevel ) const { - String sComment; + OUString sComment; UndoManagerGuard aGuard( *m_pData ); const SfxUndoArray* pUndoArray = i_currentLevel ? m_pData->pActUndoArray : m_pData->pUndoArray; if ( (pUndoArray->nCurUndoAction + nNo) < pUndoArray->aUndoActions.size() ) @@ -858,21 +858,21 @@ OUString SfxUndoManager::GetRedoActionComment( size_t nNo, bool const i_currentL //------------------------------------------------------------------------ -sal_Bool SfxUndoManager::Redo() +bool SfxUndoManager::Redo() { return ImplRedo( NULL ); } //------------------------------------------------------------------------ -sal_Bool SfxUndoManager::RedoWithContext( SfxUndoContext& i_context ) +bool SfxUndoManager::RedoWithContext( SfxUndoContext& i_context ) { return ImplRedo( &i_context ); } //------------------------------------------------------------------------ -sal_Bool SfxUndoManager::ImplRedo( SfxUndoContext* i_contextOrNull ) +bool SfxUndoManager::ImplRedo( SfxUndoContext* i_contextOrNull ) { UndoManagerGuard aGuard( *m_pData ); OSL_ENSURE( !IsDoing(), "SfxUndoManager::Redo: *nested* Undo/Redo actions? How this?" ); @@ -893,7 +893,7 @@ sal_Bool SfxUndoManager::ImplRedo( SfxUndoContext* i_contextOrNull ) } SfxUndoAction* pAction = m_pData->pActUndoArray->aUndoActions[ m_pData->pActUndoArray->nCurUndoAction++ ].pAction; - const String sActionComment = pAction->GetComment(); + const OUString sActionComment = pAction->GetComment(); try { // clear the guard/mutex before calling into the SfxUndoAction - this can be a extension-implemented UNO component @@ -951,7 +951,7 @@ OUString SfxUndoManager::GetRepeatActionComment(SfxRepeatTarget &rTarget) const //------------------------------------------------------------------------ -sal_Bool SfxUndoManager::Repeat( SfxRepeatTarget &rTarget ) +bool SfxUndoManager::Repeat( SfxRepeatTarget &rTarget ) { UndoManagerGuard aGuard( *m_pData ); if ( !m_pData->pActUndoArray->aUndoActions.empty() ) @@ -963,12 +963,12 @@ sal_Bool SfxUndoManager::Repeat( SfxRepeatTarget &rTarget ) return sal_True; } - return sal_False; + return false; } //------------------------------------------------------------------------ -sal_Bool SfxUndoManager::CanRepeat( SfxRepeatTarget &rTarget ) const +bool SfxUndoManager::CanRepeat( SfxRepeatTarget &rTarget ) const { UndoManagerGuard aGuard( *m_pData ); if ( !m_pData->pActUndoArray->aUndoActions.empty() ) @@ -976,7 +976,7 @@ sal_Bool SfxUndoManager::CanRepeat( SfxRepeatTarget &rTarget ) const size_t nActionNo = m_pData->pActUndoArray->aUndoActions.size() - 1; return m_pData->pActUndoArray->aUndoActions[nActionNo].pAction->CanRepeat(rTarget); } - return sal_False; + return false; } //------------------------------------------------------------------------ @@ -1007,8 +1007,8 @@ void SfxUndoManager::RemoveUndoListener( SfxUndoListener& i_listener ) //------------------------------------------------------------------------ -void SfxUndoManager::EnterListAction( - const OUString& rComment, const OUString &rRepeatComment, sal_uInt16 nId ) +void SfxUndoManager::EnterListAction( const OUString& rComment, + const OUString &rRepeatComment, sal_uInt16 nId ) /* [Beschreibung] @@ -1372,17 +1372,19 @@ void SfxListUndoAction::Repeat(SfxRepeatTarget&rTarget) //------------------------------------------------------------------------ -sal_Bool SfxListUndoAction::CanRepeat(SfxRepeatTarget&r) const +bool SfxListUndoAction::CanRepeat(SfxRepeatTarget&r) const { for(size_t i=0;i<nCurUndoAction;i++) + { if(!aUndoActions[i].pAction->CanRepeat(r)) - return sal_False; - return sal_True; + return false; + } + return true; } //------------------------------------------------------------------------ -sal_Bool SfxListUndoAction::Merge( SfxUndoAction *pNextAction ) +bool SfxListUndoAction::Merge( SfxUndoAction *pNextAction ) { return !aUndoActions.empty() && aUndoActions[aUndoActions.size()-1].pAction->Merge( pNextAction ); } @@ -1433,7 +1435,7 @@ void SfxLinkUndoAction::Redo() //------------------------------------------------------------------------ -sal_Bool SfxLinkUndoAction::CanRepeat(SfxRepeatTarget& r) const +bool SfxLinkUndoAction::CanRepeat(SfxRepeatTarget& r) const { return pAction && pAction->CanRepeat(r); } diff --git a/svl/unx/source/svdde/ddedummy.cxx b/svl/unx/source/svdde/ddedummy.cxx index 70104ef189bc..2e03c0862105 100644 --- a/svl/unx/source/svdde/ddedummy.cxx +++ b/svl/unx/source/svdde/ddedummy.cxx @@ -24,7 +24,7 @@ DdeData::DdeData() { } -DdeData::DdeData( const String& ) +DdeData::DdeData( const OUString& ) { } @@ -46,17 +46,17 @@ void DdeData::SetFormat( SAL_UNUSED_PARAMETER sal_uLong ) sal_uLong DdeData::GetFormat() const { - return 0L; + return 0L; } DdeData& DdeData::operator = ( const DdeData& ) { - return *this; + return *this; } DdeData::operator long() const { - return 0L; + return 0L; } DdeData::operator const void*() const @@ -66,10 +66,10 @@ DdeData::operator const void*() const long DdeConnection::GetError() { - return 0L; + return 0L; } -DdeConnection::DdeConnection( const String&, const String& ) +DdeConnection::DdeConnection( const OUString&, const OUString& ) { } @@ -77,23 +77,23 @@ DdeConnection::~DdeConnection() { } -const String& DdeConnection::GetServiceName() +const OUString DdeConnection::GetServiceName() { - return String::EmptyString(); + return OUString(); } -const String& DdeConnection::GetTopicName() +const OUString DdeConnection::GetTopicName() { - return String::EmptyString(); + return OUString();; } -DdeTransaction::DdeTransaction( DdeConnection& rConnection, const String&, long ) : - rDde( rConnection ) +DdeTransaction::DdeTransaction( DdeConnection& rConnection, const OUString&, long ) + : rDde( rConnection ) { } -DdeTransaction::DdeTransaction( const DdeTransaction& rTransaction ) : - rDde( rTransaction.rDde ) +DdeTransaction::DdeTransaction( const DdeTransaction& rTransaction ) + : rDde( rTransaction.rDde ) { } @@ -101,7 +101,7 @@ void DdeTransaction::Execute() { } -void DdeTransaction::Done( SAL_UNUSED_PARAMETER sal_Bool ) +void DdeTransaction::Done( SAL_UNUSED_PARAMETER bool ) { } @@ -113,18 +113,18 @@ DdeTransaction::~DdeTransaction() { } -DdeRequest::DdeRequest( DdeConnection& rConnection, const String& rString, long lLong ) : - DdeTransaction( rConnection, rString, lLong ) +DdeRequest::DdeRequest( DdeConnection& rConnection, const OUString& rString, long lLong ) + : DdeTransaction( rConnection, rString, lLong ) { } -DdeExecute::DdeExecute( DdeConnection& rConnection, const String& rString, long lLong ) : - DdeTransaction( rConnection, rString, lLong ) +DdeExecute::DdeExecute( DdeConnection& rConnection, const OUString& rString, long lLong ) + : DdeTransaction( rConnection, rString, lLong ) { } -DdePoke::DdePoke( DdeConnection& rConnection, const String& rString, const DdeData&, long lLong ) : - DdeTransaction( rConnection, rString, lLong ) +DdePoke::DdePoke( DdeConnection& rConnection, const OUString& rString, const DdeData&, long lLong ) + : DdeTransaction( rConnection, rString, lLong ) { } @@ -151,7 +151,7 @@ void DdeTopic::InsertItem( SAL_UNUSED_PARAMETER DdeItem* ) DdeItem* DdeTopic::AddItem( const DdeItem& rDdeItem ) { - return (DdeItem*) &rDdeItem; + return (DdeItem*) &rDdeItem; } void DdeTopic::RemoveItem( SAL_UNUSED_PARAMETER const DdeItem& ) @@ -160,80 +160,85 @@ void DdeTopic::RemoveItem( SAL_UNUSED_PARAMETER const DdeItem& ) DdeData* DdeTopic::Get( SAL_UNUSED_PARAMETER sal_uLong ) { - return NULL; + return NULL; } -sal_Bool DdeTopic::MakeItem( SAL_UNUSED_PARAMETER const OUString& ) +bool DdeTopic::MakeItem( SAL_UNUSED_PARAMETER const OUString& ) { - return sal_False; + return false; } -sal_Bool DdeTopic::StartAdviseLoop() +bool DdeTopic::StartAdviseLoop() { - return sal_False; + return false; } -sal_Bool DdeTopic::StopAdviseLoop() +bool DdeTopic::StopAdviseLoop() { - return sal_False; + return false; } -sal_Bool DdeTopic::Execute( SAL_UNUSED_PARAMETER const String* ) +bool DdeTopic::Execute( SAL_UNUSED_PARAMETER const OUString* ) { - return sal_False; + return false; } -sal_Bool DdeTopic::Put( SAL_UNUSED_PARAMETER const DdeData* ) +bool DdeTopic::Put( SAL_UNUSED_PARAMETER const DdeData* ) { - return sal_False; + return false; } const OUString DdeTopic::GetName() const { - return OUString(); + return OUString(); } -DdeService::DdeService( const String& ) +DdeService::DdeService( const OUString& ) { - nStatus = 0; + nStatus = 0; } -String DdeService::Topics() { - return String(); +OUString DdeService::Topics() +{ + return OUString(); } -String DdeService::Formats() { - return String(); +OUString DdeService::Formats() { + return OUString(); } -String DdeService::SysItems() { - return String(); +OUString DdeService::SysItems() +{ + return OUString(); } -String DdeService::Status() { - return String(); +OUString DdeService::Status() +{ + return OUString(); } -String DdeService::SysTopicGet(const String& rString) { +OUString DdeService::SysTopicGet(const OUString& rString) +{ return rString; } -sal_Bool DdeService::SysTopicExecute(SAL_UNUSED_PARAMETER const String*) { - return sal_False; +bool DdeService::SysTopicExecute(SAL_UNUSED_PARAMETER const OUString*) +{ + return false; } DdeService::~DdeService() { } -sal_Bool DdeService::IsBusy() +bool DdeService::IsBusy() { - return sal_False; + return false; } -String DdeService::GetHelp() +OUString DdeService::GetHelp() { - return String::EmptyString(); + return OUString(); } void DdeService::AddFormat( SAL_UNUSED_PARAMETER sal_uLong ) @@ -248,14 +253,14 @@ void DdeService::RemoveTopic( SAL_UNUSED_PARAMETER const DdeTopic& ) { } -sal_Bool DdeService::MakeTopic( SAL_UNUSED_PARAMETER const OUString& ) +bool DdeService::MakeTopic( SAL_UNUSED_PARAMETER const OUString& ) { - return sal_False; + return false; } const OUString DdeService::GetName() const { - return OUString(); + return OUString(); } namespace @@ -269,7 +274,7 @@ DdeServices& DdeService::GetServices() return theDdeServices::get(); } -DdeItem::DdeItem( const String& ) +DdeItem::DdeItem( const OUString& ) { } @@ -285,32 +290,32 @@ void DdeItem::NotifyClient() { } -DdeGetPutItem::DdeGetPutItem( const String& rStr ) : -DdeItem( rStr ) +DdeGetPutItem::DdeGetPutItem( const OUString& rStr ) + : DdeItem( rStr ) { } -DdeGetPutItem::DdeGetPutItem( const DdeItem& rItem ) : -DdeItem( rItem ) +DdeGetPutItem::DdeGetPutItem( const DdeItem& rItem ) + : DdeItem( rItem ) { } DdeData* DdeGetPutItem::Get( SAL_UNUSED_PARAMETER sal_uLong ) { - return NULL; + return NULL; } -sal_Bool DdeGetPutItem::Put( SAL_UNUSED_PARAMETER const DdeData* ) +bool DdeGetPutItem::Put( SAL_UNUSED_PARAMETER const DdeData* ) { - return sal_False; + return false; } -void DdeGetPutItem::AdviseLoop( SAL_UNUSED_PARAMETER sal_Bool ) +void DdeGetPutItem::AdviseLoop( SAL_UNUSED_PARAMETER bool ) { } -DdeLink::DdeLink( DdeConnection& rConnection, const String& rString, long l ) : -DdeTransaction( rConnection, rString, l ) +DdeLink::DdeLink( DdeConnection& rConnection, const OUString& rString, long l ) + : DdeTransaction( rConnection, rString, l ) { } @@ -322,8 +327,8 @@ void DdeLink::Notify() { } -DdeHotLink::DdeHotLink( DdeConnection& rConnection, const String& rString, long l ) : -DdeLink( rConnection, rString, l ) +DdeHotLink::DdeHotLink( DdeConnection& rConnection, const OUString& rString, long l ) + : DdeLink( rConnection, rString, l ) { } diff --git a/svtools/source/control/fmtfield.cxx b/svtools/source/control/fmtfield.cxx index 7e04e8ca54ec..bc6bd449ae1e 100644 --- a/svtools/source/control/fmtfield.cxx +++ b/svtools/source/control/fmtfield.cxx @@ -958,18 +958,15 @@ void FormattedField::ImplSetValue(double dVal, sal_Bool bForce) m_bValueDirty = sal_False; m_dCurrentValue = dVal; - String sNewText; + OUString sNewText; if (ImplGetFormatter()->IsTextFormat(m_nFormatKey)) { // zuerst die Zahl als String im Standard-Format - String sTemp; + OUString sTemp; ImplGetFormatter()->GetOutputString(dVal, 0, sTemp, &m_pLastOutputColor); // dann den String entsprechend dem Text-Format { - OUString sTempIn(sTemp); - OUString sTempOut; - ImplGetFormatter()->GetOutputString(sTempIn, m_nFormatKey, sTempOut, &m_pLastOutputColor); - sNewText = sTempOut; + ImplGetFormatter()->GetOutputString(sTemp, m_nFormatKey, sNewText, &m_pLastOutputColor); } } else diff --git a/svtools/source/svhtml/htmlout.cxx b/svtools/source/svhtml/htmlout.cxx index a126e4ea79f5..a23638f122da 100644 --- a/svtools/source/svhtml/htmlout.cxx +++ b/svtools/source/svhtml/htmlout.cxx @@ -940,7 +940,7 @@ OString HTMLOutFuncs::CreateTableDataOptionsValNum( if ( bValue ) { // printf / scanf ist zu ungenau - String aValStr; + OUString aValStr; rFormatter.GetInputLineString( fVal, 0, aValStr ); OString sTmp(OUStringToOString(aValStr, eDestEnc)); aStrTD.append(' '). diff --git a/svtools/source/uno/unoiface.cxx b/svtools/source/uno/unoiface.cxx index fd7d5b3200a0..bc434ae10003 100644 --- a/svtools/source/uno/unoiface.cxx +++ b/svtools/source/uno/unoiface.cxx @@ -1051,9 +1051,9 @@ void SVTXFormattedField::setProperty( const OUString& PropertyName, const ::com: Color* pDum; double d = 0.0; rValue >>= d; - String sConverted; + OUString sConverted; pFormatter->GetOutputString(d, 0, sConverted, &pDum); - aReturn <<= OUString( sConverted ); + aReturn <<= sConverted; } break; case ::com::sun::star::uno::TypeClass_STRING: diff --git a/svx/source/dialog/srchdlg.cxx b/svx/source/dialog/srchdlg.cxx index 22d913abd922..11d235e57870 100644 --- a/svx/source/dialog/srchdlg.cxx +++ b/svx/source/dialog/srchdlg.cxx @@ -929,7 +929,7 @@ void SvxSearchDialog::Init_Impl( int bSearchPattern ) bool bSetSearch = ( ( nModifyFlag & MODIFY_SEARCH ) == 0 ); bool bSetReplace = ( ( nModifyFlag & MODIFY_REPLACE ) == 0 ); - if ( pSearchItem->GetSearchString().Len() && bSetSearch ) + if ( !(pSearchItem->GetSearchString().isEmpty()) && bSetSearch ) m_pSearchLB->SetText( pSearchItem->GetSearchString() ); else if (!aSearchStrings.empty()) { diff --git a/svx/source/engine3d/e3dundo.cxx b/svx/source/engine3d/e3dundo.cxx index 14934f734e3f..38c287fde338 100644 --- a/svx/source/engine3d/e3dundo.cxx +++ b/svx/source/engine3d/e3dundo.cxx @@ -34,9 +34,9 @@ E3dUndoAction::~E3dUndoAction () // Repeat does not exist -sal_Bool E3dUndoAction::CanRepeat(SfxRepeatTarget&) const +bool E3dUndoAction::CanRepeat(SfxRepeatTarget&) const { - return sal_False; + return false; } /************************************************************************/ @@ -74,13 +74,13 @@ void E3dRotateUndoAction::Redo () TYPEINIT1(E3dAttributesUndoAction, SdrUndoAction); E3dAttributesUndoAction::E3dAttributesUndoAction( SdrModel &rModel, - E3dObject* pInObject, - const SfxItemSet& rNewSet, - const SfxItemSet& rOldSet) -: SdrUndoAction( rModel ), - pObject ( pInObject ), - aNewSet ( rNewSet ), - aOldSet ( rOldSet ) + E3dObject* pInObject, + const SfxItemSet& rNewSet, + const SfxItemSet& rOldSet) + : SdrUndoAction( rModel ) + , pObject ( pInObject ) + , aNewSet ( rNewSet ) + , aOldSet ( rOldSet ) { } @@ -105,9 +105,9 @@ void E3dAttributesUndoAction::Redo() // Multiple Undo is not possible -sal_Bool E3dAttributesUndoAction::CanRepeat(SfxRepeatTarget& /*rView*/) const +bool E3dAttributesUndoAction::CanRepeat(SfxRepeatTarget& /*rView*/) const { - return sal_False; + return false; } // Multiple Undo is not possible diff --git a/svx/source/fmcomp/gridcell.cxx b/svx/source/fmcomp/gridcell.cxx index 86a9b256ebf0..91aebe7d1031 100644 --- a/svx/source/fmcomp/gridcell.cxx +++ b/svx/source/fmcomp/gridcell.cxx @@ -1442,7 +1442,7 @@ void DbFormattedField::Init( Window& rParent, const Reference< XRowSet >& xCurso } else { - String sConverted; + OUString sConverted; Color* pDummy; pFormatterUsed->GetOutputString(::comphelper::getDouble(aDefault), 0, sConverted, &pDummy); ((FormattedField*)m_pWindow)->SetDefaultText(sConverted); diff --git a/svx/source/items/numfmtsh.cxx b/svx/source/items/numfmtsh.cxx index ae6fbe7358d6..7a824d2f8f4b 100644 --- a/svx/source/items/numfmtsh.cxx +++ b/svx/source/items/numfmtsh.cxx @@ -456,8 +456,10 @@ void SvxNumberFormatShell::MakePreviewString( const String& rFormatStr, } else { + OUString sTemp(rPreviewStr); pFormatter->GetOutputString( nValNum, nExistingFormat, - rPreviewStr, &rpFontColor, bUseStarFormat ); + sTemp, &rpFontColor, bUseStarFormat ); + rPreviewStr = sTemp; } } } @@ -768,14 +770,14 @@ short SvxNumberFormatShell::FillEListWithCurrency_Impl( std::vector<String*>& rL const NfCurrencyEntry* pTmpCurrencyEntry; bool bTmpBanking; - XubString rSymbol; + OUString rSymbol; bool bFlag=pFormatter->GetNewCurrencySymbolString(nCurFormatKey,rSymbol, - &pTmpCurrencyEntry,&bTmpBanking); + &pTmpCurrencyEntry,&bTmpBanking); - if((!bFlag && pCurCurrencyEntry==NULL) || - (bFlag && pTmpCurrencyEntry==NULL && !rSymbol.Len()) || - nCurCategory==NUMBERFORMAT_ALL) + if( (!bFlag && pCurCurrencyEntry==NULL) || + (bFlag && pTmpCurrencyEntry==NULL && rSymbol.isEmpty()) || + (nCurCategory==NUMBERFORMAT_ALL)) { if ( nCurCategory == NUMBERFORMAT_ALL ) FillEListWithUserCurrencys(rList,nSelPos); @@ -855,10 +857,11 @@ short SvxNumberFormatShell::FillEListWithSysCurrencys( std::vector<String*>& rLi { const NfCurrencyEntry* pTmpCurrencyEntry; bool bTmpBanking; - XubString rSymbol; + OUString rSymbol; pFormatter->GetNewCurrencySymbolString(nKey,rSymbol, - &pTmpCurrencyEntry,&bTmpBanking); + &pTmpCurrencyEntry, + &bTmpBanking); bUserNewCurrency=(pTmpCurrencyEntry!=NULL); } @@ -896,19 +899,20 @@ short SvxNumberFormatShell::FillEListWithUserCurrencys( std::vector<String*>& rL DBG_ASSERT( pCurFmtTable != NULL, "Unbekanntes Zahlenformat!" ); String aStrComment; - String aNewFormNInfo; + OUString aNewFormNInfo; short nMyCat = SELPOS_NONE; const NfCurrencyEntry* pTmpCurrencyEntry; bool bTmpBanking, bAdaptSelPos; - XubString rSymbol; - XubString rBankSymbol; + OUString rSymbol; + OUString rBankSymbol; std::vector<String*> aList; std::vector<sal_uInt32> aKeyList; pFormatter->GetNewCurrencySymbolString(nCurFormatKey,rSymbol, - &pTmpCurrencyEntry,&bTmpBanking); + &pTmpCurrencyEntry, + &bTmpBanking); XubString rShortSymbol; @@ -919,9 +923,9 @@ short SvxNumberFormatShell::FillEListWithUserCurrencys( std::vector<String*>& rL // format (nCurFormatKey) that was set in FormatChanged() after // matching the format string entered in the dialog. bAdaptSelPos = true; - pCurCurrencyEntry=(NfCurrencyEntry*)pTmpCurrencyEntry; - bBankingSymbol=bTmpBanking; - nCurCurrencyEntryPos=FindCurrencyFormat(pTmpCurrencyEntry,bTmpBanking); + pCurCurrencyEntry = (NfCurrencyEntry*)pTmpCurrencyEntry; + bBankingSymbol = bTmpBanking; + nCurCurrencyEntryPos = FindCurrencyFormat(pTmpCurrencyEntry,bTmpBanking); } else { @@ -951,33 +955,35 @@ short SvxNumberFormatShell::FillEListWithUserCurrencys( std::vector<String*>& rL if ( !IsRemoved_Impl( nKey ) ) { if( pNumEntry->GetType() & NUMBERFORMAT_DEFINED || - pNumEntry->IsAdditionalStandardDefined() ) + pNumEntry->IsAdditionalStandardDefined() ) { nMyCat=pNumEntry->GetType() & ~NUMBERFORMAT_DEFINED; - aStrComment=pNumEntry->GetComment(); + aStrComment = pNumEntry->GetComment(); CategoryToPos_Impl(nMyCat,nMyType); - aNewFormNInfo= pNumEntry->GetFormatstring(); + aNewFormNInfo = pNumEntry->GetFormatstring(); bool bInsFlag = false; if ( pNumEntry->HasNewCurrency() ) { bInsFlag = true; // merge locale formats into currency selection } - else if( (!bTmpBanking && aNewFormNInfo.Search(rSymbol)!=STRING_NOTFOUND) || - (bTmpBanking && aNewFormNInfo.Search(rBankSymbol)!=STRING_NOTFOUND) ) + else if( (!bTmpBanking && aNewFormNInfo.indexOf(rSymbol) >= 0) || + (bTmpBanking && aNewFormNInfo.indexOf(rBankSymbol) >= 0) ) { bInsFlag = true; } - else if(aNewFormNInfo.Search(rShortSymbol)!=STRING_NOTFOUND) + else if(aNewFormNInfo.indexOf(rShortSymbol) >= 0) { - XubString rTstSymbol; + OUString rTstSymbol; const NfCurrencyEntry* pTstCurrencyEntry; bool bTstBanking; pFormatter->GetNewCurrencySymbolString(nKey,rTstSymbol, - &pTstCurrencyEntry,&bTstBanking); + &pTstCurrencyEntry, + &bTstBanking); - if(pTmpCurrencyEntry==pTstCurrencyEntry && bTstBanking==bTmpBanking) + if(pTmpCurrencyEntry == pTstCurrencyEntry && + bTstBanking == bTmpBanking) { bInsFlag = true; } @@ -1154,7 +1160,9 @@ void SvxNumberFormatShell::GetPreviewString_Impl( String& rString, Color*& rpCol } else { - pFormatter->GetOutputString( nValNum, nCurFormatKey, rString, &rpColor, bUseStarFormat ); + OUString sTemp(rString); + pFormatter->GetOutputString( nValNum, nCurFormatKey, sTemp, &rpColor, bUseStarFormat ); + rString = sTemp; } } diff --git a/svx/source/svdraw/sdrundomanager.cxx b/svx/source/svdraw/sdrundomanager.cxx index c28654cb924d..4f97225383bd 100644 --- a/svx/source/svdraw/sdrundomanager.cxx +++ b/svx/source/svdraw/sdrundomanager.cxx @@ -21,10 +21,10 @@ ////////////////////////////////////////////////////////////////////////////// SdrUndoManager::SdrUndoManager(sal_uInt16 nMaxUndoActionCount) -: EditUndoManager(nMaxUndoActionCount), - maEndTextEditHdl(), - mpLastUndoActionBeforeTextEdit(0), - mbEndTextEditTriggeredFromUndo(false) + : EditUndoManager(nMaxUndoActionCount) + , maEndTextEditHdl() + , mpLastUndoActionBeforeTextEdit(0) + , mbEndTextEditTriggeredFromUndo(false) { } @@ -32,11 +32,11 @@ SdrUndoManager::~SdrUndoManager() { } -sal_Bool SdrUndoManager::Undo() +bool SdrUndoManager::Undo() { if(isTextEditActive()) { - sal_Bool bRetval(sal_False); + bool bRetval(false); // we are in text edit mode if(GetUndoActionCount() && mpLastUndoActionBeforeTextEdit != GetUndoAction(0)) @@ -61,9 +61,9 @@ sal_Bool SdrUndoManager::Undo() } } -sal_Bool SdrUndoManager::Redo() +bool SdrUndoManager::Redo() { - sal_Bool bRetval(sal_False); + bool bRetval(false); if(isTextEditActive()) { diff --git a/svx/source/svdraw/svdundo.cxx b/svx/source/svdraw/svdundo.cxx index 4ff6730d8561..8cae9f4cbeb7 100644 --- a/svx/source/svdraw/svdundo.cxx +++ b/svx/source/svdraw/svdundo.cxx @@ -59,11 +59,11 @@ TYPEINIT1(SdrUndoAction,SfxUndoAction); SdrUndoAction::~SdrUndoAction() {} -sal_Bool SdrUndoAction::CanRepeat(SfxRepeatTarget& rView) const +bool SdrUndoAction::CanRepeat(SfxRepeatTarget& rView) const { SdrView* pV=PTR_CAST(SdrView,&rView); if (pV!=NULL) return CanSdrRepeat(*pV); - return sal_False; + return false; } void SdrUndoAction::Repeat(SfxRepeatTarget& rView) @@ -145,48 +145,50 @@ OUString SdrUndoGroup::GetComment() const bool SdrUndoGroup::CanSdrRepeat(SdrView& rView) const { - switch (eFunction) { - case SDRREPFUNC_OBJ_NONE : return sal_False; - case SDRREPFUNC_OBJ_DELETE : return rView.AreObjectsMarked(); - case SDRREPFUNC_OBJ_COMBINE_POLYPOLY: return rView.IsCombinePossible(sal_False); - case SDRREPFUNC_OBJ_COMBINE_ONEPOLY : return rView.IsCombinePossible(sal_True); - case SDRREPFUNC_OBJ_DISMANTLE_POLYS : return rView.IsDismantlePossible(sal_False); - case SDRREPFUNC_OBJ_DISMANTLE_LINES : return rView.IsDismantlePossible(sal_True); - case SDRREPFUNC_OBJ_CONVERTTOPOLY : return rView.IsConvertToPolyObjPossible(sal_False); - case SDRREPFUNC_OBJ_CONVERTTOPATH : return rView.IsConvertToPathObjPossible(sal_False); - case SDRREPFUNC_OBJ_GROUP : return rView.IsGroupPossible(); - case SDRREPFUNC_OBJ_UNGROUP : return rView.IsUnGroupPossible(); - case SDRREPFUNC_OBJ_PUTTOTOP : return rView.IsToTopPossible(); - case SDRREPFUNC_OBJ_PUTTOBTM : return rView.IsToBtmPossible(); - case SDRREPFUNC_OBJ_MOVTOTOP : return rView.IsToTopPossible(); - case SDRREPFUNC_OBJ_MOVTOBTM : return rView.IsToBtmPossible(); - case SDRREPFUNC_OBJ_REVORDER : return rView.IsReverseOrderPossible(); - case SDRREPFUNC_OBJ_IMPORTMTF : return rView.IsImportMtfPossible(); - default: break; + switch (eFunction) + { + case SDRREPFUNC_OBJ_NONE : return false; + case SDRREPFUNC_OBJ_DELETE : return rView.AreObjectsMarked(); + case SDRREPFUNC_OBJ_COMBINE_POLYPOLY: return rView.IsCombinePossible(sal_False); + case SDRREPFUNC_OBJ_COMBINE_ONEPOLY : return rView.IsCombinePossible(sal_True); + case SDRREPFUNC_OBJ_DISMANTLE_POLYS : return rView.IsDismantlePossible(sal_False); + case SDRREPFUNC_OBJ_DISMANTLE_LINES : return rView.IsDismantlePossible(sal_True); + case SDRREPFUNC_OBJ_CONVERTTOPOLY : return rView.IsConvertToPolyObjPossible(sal_False); + case SDRREPFUNC_OBJ_CONVERTTOPATH : return rView.IsConvertToPathObjPossible(sal_False); + case SDRREPFUNC_OBJ_GROUP : return rView.IsGroupPossible(); + case SDRREPFUNC_OBJ_UNGROUP : return rView.IsUnGroupPossible(); + case SDRREPFUNC_OBJ_PUTTOTOP : return rView.IsToTopPossible(); + case SDRREPFUNC_OBJ_PUTTOBTM : return rView.IsToBtmPossible(); + case SDRREPFUNC_OBJ_MOVTOTOP : return rView.IsToTopPossible(); + case SDRREPFUNC_OBJ_MOVTOBTM : return rView.IsToBtmPossible(); + case SDRREPFUNC_OBJ_REVORDER : return rView.IsReverseOrderPossible(); + case SDRREPFUNC_OBJ_IMPORTMTF : return rView.IsImportMtfPossible(); + default: break; } // switch - return sal_False; + return false; } void SdrUndoGroup::SdrRepeat(SdrView& rView) { - switch (eFunction) { - case SDRREPFUNC_OBJ_NONE : break; - case SDRREPFUNC_OBJ_DELETE : rView.DeleteMarked(); break; - case SDRREPFUNC_OBJ_COMBINE_POLYPOLY: rView.CombineMarkedObjects(sal_False); break; - case SDRREPFUNC_OBJ_COMBINE_ONEPOLY : rView.CombineMarkedObjects(sal_True); break; - case SDRREPFUNC_OBJ_DISMANTLE_POLYS : rView.DismantleMarkedObjects(sal_False); break; - case SDRREPFUNC_OBJ_DISMANTLE_LINES : rView.DismantleMarkedObjects(sal_True); break; - case SDRREPFUNC_OBJ_CONVERTTOPOLY : rView.ConvertMarkedToPolyObj(sal_False); break; - case SDRREPFUNC_OBJ_CONVERTTOPATH : rView.ConvertMarkedToPathObj(sal_False); break; - case SDRREPFUNC_OBJ_GROUP : rView.GroupMarked(); break; - case SDRREPFUNC_OBJ_UNGROUP : rView.UnGroupMarked(); break; - case SDRREPFUNC_OBJ_PUTTOTOP : rView.PutMarkedToTop(); break; - case SDRREPFUNC_OBJ_PUTTOBTM : rView.PutMarkedToBtm(); break; - case SDRREPFUNC_OBJ_MOVTOTOP : rView.MovMarkedToTop(); break; - case SDRREPFUNC_OBJ_MOVTOBTM : rView.MovMarkedToBtm(); break; - case SDRREPFUNC_OBJ_REVORDER : rView.ReverseOrderOfMarked(); break; - case SDRREPFUNC_OBJ_IMPORTMTF : rView.DoImportMarkedMtf(); break; - default: break; + switch (eFunction) + { + case SDRREPFUNC_OBJ_NONE : break; + case SDRREPFUNC_OBJ_DELETE : rView.DeleteMarked(); break; + case SDRREPFUNC_OBJ_COMBINE_POLYPOLY: rView.CombineMarkedObjects(sal_False); break; + case SDRREPFUNC_OBJ_COMBINE_ONEPOLY : rView.CombineMarkedObjects(sal_True); break; + case SDRREPFUNC_OBJ_DISMANTLE_POLYS : rView.DismantleMarkedObjects(sal_False); break; + case SDRREPFUNC_OBJ_DISMANTLE_LINES : rView.DismantleMarkedObjects(sal_True); break; + case SDRREPFUNC_OBJ_CONVERTTOPOLY : rView.ConvertMarkedToPolyObj(sal_False); break; + case SDRREPFUNC_OBJ_CONVERTTOPATH : rView.ConvertMarkedToPathObj(sal_False); break; + case SDRREPFUNC_OBJ_GROUP : rView.GroupMarked(); break; + case SDRREPFUNC_OBJ_UNGROUP : rView.UnGroupMarked(); break; + case SDRREPFUNC_OBJ_PUTTOTOP : rView.PutMarkedToTop(); break; + case SDRREPFUNC_OBJ_PUTTOBTM : rView.PutMarkedToBtm(); break; + case SDRREPFUNC_OBJ_MOVTOTOP : rView.MovMarkedToTop(); break; + case SDRREPFUNC_OBJ_MOVTOBTM : rView.MovMarkedToBtm(); break; + case SDRREPFUNC_OBJ_REVORDER : rView.ReverseOrderOfMarked(); break; + case SDRREPFUNC_OBJ_IMPORTMTF : rView.DoImportMarkedMtf(); break; + default: break; } // switch } @@ -195,9 +197,9 @@ OUString SdrUndoGroup::GetSdrRepeatComment(SdrView& /*rView*/) const return aComment.replaceAll("%1", ImpGetResStr(STR_ObjNameSingulPlural)); } -SdrUndoObj::SdrUndoObj(SdrObject& rNewObj): - SdrUndoAction(*rNewObj.GetModel()), - pObj(&rNewObj) +SdrUndoObj::SdrUndoObj(SdrObject& rNewObj) + : SdrUndoAction(*rNewObj.GetModel()) + , pObj(&rNewObj) { } @@ -263,19 +265,16 @@ void SdrUndoAttrObj::ensureStyleSheetInStyleSheetPool(SfxStyleSheetBasePool& rSt } SdrUndoAttrObj::SdrUndoAttrObj(SdrObject& rNewObj, bool bStyleSheet1, bool bSaveText) -: SdrUndoObj(rNewObj), - pUndoSet(NULL), - pRedoSet(NULL), - pRepeatSet(NULL), - mxUndoStyleSheet(), - mxRedoStyleSheet(), - bHaveToTakeRedoSet(sal_True), - pTextUndo(NULL), - - // #i8508# - pTextRedo(NULL), - - pUndoGroup(NULL) + : SdrUndoObj(rNewObj) + , pUndoSet(NULL) + , pRedoSet(NULL) + , pRepeatSet(NULL) + , mxUndoStyleSheet() + , mxRedoStyleSheet() + , bHaveToTakeRedoSet(sal_True) + , pTextUndo(NULL) + , pTextRedo(NULL) + , pUndoGroup(NULL) { bStyleSheet = bStyleSheet1; @@ -319,8 +318,6 @@ SdrUndoAttrObj::~SdrUndoAttrObj() delete pRepeatSet; delete pUndoGroup; delete pTextUndo; - - // #i8508# delete pTextRedo; } @@ -603,11 +600,11 @@ OUString SdrUndoMoveObj::GetSdrRepeatComment(SdrView& /*rView*/) const //////////////////////////////////////////////////////////////////////////////////////////////////// -SdrUndoGeoObj::SdrUndoGeoObj(SdrObject& rNewObj): - SdrUndoObj(rNewObj), - pUndoGeo(NULL), - pRedoGeo(NULL), - pUndoGroup(NULL) +SdrUndoGeoObj::SdrUndoGeoObj(SdrObject& rNewObj) + : SdrUndoObj(rNewObj) + , pUndoGeo(NULL) + , pRedoGeo(NULL) + , pUndoGroup(NULL) { SdrObjList* pOL=rNewObj.GetSubList(); if (pOL!=NULL && pOL->GetObjCount() && !rNewObj.ISA(E3dScene)) @@ -620,7 +617,9 @@ SdrUndoGeoObj::SdrUndoGeoObj(SdrObject& rNewObj): for (sal_uIntPtr nObjNum=0; nObjNum<nObjAnz; nObjNum++) { pUndoGroup->AddAction(new SdrUndoGeoObj(*pOL->GetObj(nObjNum))); } - } else { + } + else + { pUndoGeo=pObj->GetGeoData(); } } @@ -719,40 +718,43 @@ void SdrUndoObjList::ObjListListener::Notify(SfxBroadcaster&, const SfxHint& rHi { switch (pSdrHint->GetKind()) { - case HINT_OBJCHG : - if (IsListening(*m_pBroadcaster)) - { - const sal_uInt32 nNewOrdNum(m_rObject.GetOrdNum()); - if (nNewOrdNum != m_rThat.GetOrdNum()) - m_rThat.SetOrdNum(nNewOrdNum); - } - break; - case HINT_OBJREMOVED : - SAL_WARN_IF(!IsListening(*m_pBroadcaster), "svx.sdr", "Object is not in any list"); - EndListening(*m_pBroadcaster); - break; - case HINT_OBJINSERTED : - SAL_WARN_IF(IsListening(*m_pBroadcaster), "svx.sdr", "Object is already in a list"); - StartListening(*m_pBroadcaster); - break; - default : - break; + case HINT_OBJCHG : + if (IsListening(*m_pBroadcaster)) + { + const sal_uInt32 nNewOrdNum(m_rObject.GetOrdNum()); + if (nNewOrdNum != m_rThat.GetOrdNum()) + m_rThat.SetOrdNum(nNewOrdNum); + } + break; + case HINT_OBJREMOVED : + SAL_WARN_IF(!IsListening(*m_pBroadcaster), "svx.sdr", "Object is not in any list"); + EndListening(*m_pBroadcaster); + break; + case HINT_OBJINSERTED : + SAL_WARN_IF(IsListening(*m_pBroadcaster), "svx.sdr", "Object is already in a list"); + StartListening(*m_pBroadcaster); + break; + default : + break; } } } } SdrUndoObjList::SdrUndoObjList(SdrObject& rNewObj, bool bOrdNumDirect) -: SdrUndoObj(rNewObj), - bOwner(sal_False), - pView(NULL), - pPageView(NULL), - m_pListener(NULL) + : SdrUndoObj(rNewObj) + , bOwner(sal_False) + , pView(NULL) + , pPageView(NULL) + , m_pListener(NULL) { pObjList=pObj->GetObjList(); - if (bOrdNumDirect) { + if (bOrdNumDirect) + { nOrdNum=pObj->GetOrdNumDirect(); - } else { + } + else + { nOrdNum=pObj->GetOrdNum(); } @@ -803,9 +805,9 @@ void SdrUndoRemoveObj::Undo() // position of the target object. Point aOwnerAnchorPos(0, 0); - if(pObjList - && pObjList->GetOwnerObj() - && pObjList->GetOwnerObj()->ISA(SdrObjGroup)) + if(pObjList && + pObjList->GetOwnerObj() && + pObjList->GetOwnerObj()->ISA(SdrObjGroup)) { aOwnerAnchorPos = pObjList->GetOwnerObj()->GetAnchorPos(); } @@ -957,17 +959,20 @@ OUString SdrUndoNewObj::GetComment() const } SdrUndoReplaceObj::SdrUndoReplaceObj(SdrObject& rOldObj1, SdrObject& rNewObj1, bool bOrdNumDirect) -: SdrUndoObj(rOldObj1), - bOldOwner(sal_False), - bNewOwner(sal_False), - pNewObj(&rNewObj1) + : SdrUndoObj(rOldObj1) + , bOldOwner(sal_False) + , bNewOwner(sal_False) + , pNewObj(&rNewObj1) { SetOldOwner(sal_True); pObjList=pObj->GetObjList(); - if (bOrdNumDirect) { + if (bOrdNumDirect) + { nOrdNum=pObj->GetOrdNumDirect(); - } else { + } + else + { nOrdNum=pObj->GetOrdNum(); } } @@ -1058,9 +1063,9 @@ OUString SdrUndoCopyObj::GetComment() const // #i11702# SdrUndoObjectLayerChange::SdrUndoObjectLayerChange(SdrObject& rObj, SdrLayerID aOldLayer, SdrLayerID aNewLayer) -: SdrUndoObj(rObj), - maOldLayer(aOldLayer), - maNewLayer(aNewLayer) + : SdrUndoObj(rObj) + , maOldLayer(aOldLayer) + , maNewLayer(aNewLayer) { } @@ -1078,10 +1083,10 @@ void SdrUndoObjectLayerChange::Redo() //////////////////////////////////////////////////////////////////////////////////////////////////// -SdrUndoObjOrdNum::SdrUndoObjOrdNum(SdrObject& rNewObj, sal_uInt32 nOldOrdNum1, sal_uInt32 nNewOrdNum1): - SdrUndoObj(rNewObj), - nOldOrdNum(nOldOrdNum1), - nNewOrdNum(nNewOrdNum1) +SdrUndoObjOrdNum::SdrUndoObjOrdNum(SdrObject& rNewObj, sal_uInt32 nOldOrdNum1, sal_uInt32 nNewOrdNum1) + : SdrUndoObj(rNewObj) + , nOldOrdNum(nOldOrdNum1) + , nNewOrdNum(nNewOrdNum1) { } @@ -1091,7 +1096,8 @@ void SdrUndoObjOrdNum::Undo() ImpShowPageOfThisObject(); SdrObjList* pOL=pObj->GetObjList(); - if (pOL==NULL) { + if (pOL==NULL) + { OSL_FAIL("UndoObjOrdNum: pObj does not have an ObjList."); return; } @@ -1101,7 +1107,8 @@ void SdrUndoObjOrdNum::Undo() void SdrUndoObjOrdNum::Redo() { SdrObjList* pOL=pObj->GetObjList(); - if (pOL==NULL) { + if (pOL==NULL) + { OSL_FAIL("RedoObjOrdNum: pObj does not have an ObjList."); return; } @@ -1121,12 +1128,12 @@ OUString SdrUndoObjOrdNum::GetComment() const //////////////////////////////////////////////////////////////////////////////////////////////////// SdrUndoObjSetText::SdrUndoObjSetText(SdrObject& rNewObj, sal_Int32 nText) -: SdrUndoObj(rNewObj) -, pOldText(NULL) -, pNewText(NULL) -, bNewTextAvailable(sal_False) -, bEmptyPresObj(sal_False) -, mnText(nText) + : SdrUndoObj(rNewObj) + , pOldText(NULL) + , pNewText(NULL) + , bNewTextAvailable(sal_False) + , bEmptyPresObj(sal_False) + , mnText(nText) { SdrText* pText = static_cast< SdrTextObj*>( &rNewObj )->getText(mnText); if( pText && pText->GetOutlinerParaObject() ) @@ -1263,10 +1270,10 @@ SdrUndoObjStrAttr::SdrUndoObjStrAttr( SdrObject& rNewObj, const ObjStrAttrType eObjStrAttr, const String& sOldStr, const String& sNewStr) - : SdrUndoObj( rNewObj ), - meObjStrAttr( eObjStrAttr ), - msOldStr( sOldStr ), - msNewStr( sNewStr ) + : SdrUndoObj( rNewObj ) + , meObjStrAttr( eObjStrAttr ) + , msOldStr( sOldStr ) + , msNewStr( sNewStr ) { } @@ -1276,20 +1283,14 @@ void SdrUndoObjStrAttr::Undo() switch ( meObjStrAttr ) { - case OBJ_NAME: - { - pObj->SetName( msOldStr ); - } + case OBJ_NAME: + pObj->SetName( msOldStr ); break; - case OBJ_TITLE: - { - pObj->SetTitle( msOldStr ); - } + case OBJ_TITLE: + pObj->SetTitle( msOldStr ); break; - case OBJ_DESCRIPTION: - { - pObj->SetDescription( msOldStr ); - } + case OBJ_DESCRIPTION: + pObj->SetDescription( msOldStr ); break; } } @@ -1298,20 +1299,14 @@ void SdrUndoObjStrAttr::Redo() { switch ( meObjStrAttr ) { - case OBJ_NAME: - { - pObj->SetName( msNewStr ); - } + case OBJ_NAME: + pObj->SetName( msNewStr ); break; - case OBJ_TITLE: - { - pObj->SetTitle( msNewStr ); - } + case OBJ_TITLE: + pObj->SetTitle( msNewStr ); break; - case OBJ_DESCRIPTION: - { - pObj->SetDescription( msNewStr ); - } + case OBJ_DESCRIPTION: + pObj->SetDescription( msNewStr ); break; } @@ -1323,24 +1318,18 @@ OUString SdrUndoObjStrAttr::GetComment() const String aStr; switch ( meObjStrAttr ) { - case OBJ_NAME: - { - ImpTakeDescriptionStr( STR_UndoObjName, aStr ); - aStr += sal_Unicode(' '); - aStr += sal_Unicode('\''); - aStr += msNewStr; - aStr += sal_Unicode('\''); - } + case OBJ_NAME: + ImpTakeDescriptionStr( STR_UndoObjName, aStr ); + aStr += sal_Unicode(' '); + aStr += sal_Unicode('\''); + aStr += msNewStr; + aStr += sal_Unicode('\''); break; - case OBJ_TITLE: - { - ImpTakeDescriptionStr( STR_UndoObjTitle, aStr ); - } + case OBJ_TITLE: + ImpTakeDescriptionStr( STR_UndoObjTitle, aStr ); break; - case OBJ_DESCRIPTION: - { - ImpTakeDescriptionStr( STR_UndoObjDescription, aStr ); - } + case OBJ_DESCRIPTION: + ImpTakeDescriptionStr( STR_UndoObjDescription, aStr ); break; } @@ -1348,18 +1337,19 @@ OUString SdrUndoObjStrAttr::GetComment() const } -SdrUndoLayer::SdrUndoLayer(sal_uInt16 nLayerNum, SdrLayerAdmin& rNewLayerAdmin, SdrModel& rNewModel): - SdrUndoAction(rNewModel), - pLayer(rNewLayerAdmin.GetLayer(nLayerNum)), - pLayerAdmin(&rNewLayerAdmin), - nNum(nLayerNum), - bItsMine(sal_False) +SdrUndoLayer::SdrUndoLayer(sal_uInt16 nLayerNum, SdrLayerAdmin& rNewLayerAdmin, SdrModel& rNewModel) + : SdrUndoAction(rNewModel) + , pLayer(rNewLayerAdmin.GetLayer(nLayerNum)) + , pLayerAdmin(&rNewLayerAdmin) + , nNum(nLayerNum) + , bItsMine(sal_False) { } SdrUndoLayer::~SdrUndoLayer() { - if (bItsMine) { + if (bItsMine) + { delete pLayer; } } @@ -1443,18 +1433,22 @@ OUString SdrUndoMoveLayer::GetComment() const SdrUndoPage::SdrUndoPage(SdrPage& rNewPg) -: SdrUndoAction(*rNewPg.GetModel()), - mrPage(rNewPg) + : SdrUndoAction(*rNewPg.GetModel()) + , mrPage(rNewPg) { } void SdrUndoPage::ImpInsertPage(sal_uInt16 nNum) { DBG_ASSERT(!mrPage.IsInserted(),"SdrUndoPage::ImpInsertPage(): mrPage is already inserted."); - if (!mrPage.IsInserted()) { - if (mrPage.IsMasterPage()) { + if (!mrPage.IsInserted()) + { + if (mrPage.IsMasterPage()) + { rMod.InsertMasterPage(&mrPage,nNum); - } else { + } + else + { rMod.InsertPage(&mrPage,nNum); } } @@ -1463,11 +1457,15 @@ void SdrUndoPage::ImpInsertPage(sal_uInt16 nNum) void SdrUndoPage::ImpRemovePage(sal_uInt16 nNum) { DBG_ASSERT(mrPage.IsInserted(),"SdrUndoPage::ImpRemovePage(): mrPage is not inserted."); - if (mrPage.IsInserted()) { + if (mrPage.IsInserted()) + { SdrPage* pChkPg=NULL; - if (mrPage.IsMasterPage()) { + if (mrPage.IsMasterPage()) + { pChkPg=rMod.RemoveMasterPage(nNum); - } else { + } + else + { pChkPg=rMod.RemovePage(nNum); } DBG_ASSERT(pChkPg==&mrPage,"SdrUndoPage::ImpRemovePage(): RemovePage!=&mrPage"); @@ -1478,10 +1476,14 @@ void SdrUndoPage::ImpRemovePage(sal_uInt16 nNum) void SdrUndoPage::ImpMovePage(sal_uInt16 nOldNum, sal_uInt16 nNewNum) { DBG_ASSERT(mrPage.IsInserted(),"SdrUndoPage::ImpMovePage(): mrPage is not inserted."); - if (mrPage.IsInserted()) { - if (mrPage.IsMasterPage()) { + if (mrPage.IsInserted()) + { + if (mrPage.IsMasterPage()) + { rMod.MoveMasterPage(nOldNum,nNewNum); - } else { + } + else + { rMod.MovePage(nOldNum,nNewNum); } } @@ -1494,9 +1496,9 @@ void SdrUndoPage::ImpTakeDescriptionStr(sal_uInt16 nStrCacheID, XubString& rStr, //////////////////////////////////////////////////////////////////////////////////////////////////// -SdrUndoPageList::SdrUndoPageList(SdrPage& rNewPg): - SdrUndoPage(rNewPg), - bItsMine(sal_False) +SdrUndoPageList::SdrUndoPageList(SdrPage& rNewPg) + : SdrUndoPage(rNewPg) + , bItsMine(sal_False) { nPageNum=rNewPg.GetPageNum(); } @@ -1511,9 +1513,9 @@ SdrUndoPageList::~SdrUndoPageList() //////////////////////////////////////////////////////////////////////////////////////////////////// -SdrUndoDelPage::SdrUndoDelPage(SdrPage& rNewPg): - SdrUndoPageList(rNewPg), - pUndoGroup(NULL) +SdrUndoDelPage::SdrUndoDelPage(SdrPage& rNewPg) + : SdrUndoPageList(rNewPg) + , pUndoGroup(NULL) { bItsMine = sal_True; @@ -1552,7 +1554,9 @@ SdrUndoDelPage::~SdrUndoDelPage() void SdrUndoDelPage::Undo() { ImpInsertPage(nPageNum); - if (pUndoGroup!=NULL) { // recover master page relationships + if (pUndoGroup!=NULL) + { + // recover master page relationships pUndoGroup->Undo(); } DBG_ASSERT(bItsMine,"UndoDeletePage: mrPage does not belong to UndoAction."); diff --git a/svx/source/table/tableundo.cxx b/svx/source/table/tableundo.cxx index e889427ef354..aee0012abef3 100644 --- a/svx/source/table/tableundo.cxx +++ b/svx/source/table/tableundo.cxx @@ -38,10 +38,10 @@ using namespace ::com::sun::star::table; namespace sdr { namespace table { CellUndo::CellUndo( const SdrObjectWeakRef& xObjRef, const CellRef& xCell ) -: SdrUndoAction( *xCell->GetModel() ) -, mxObjRef( xObjRef ) -, mxCell( xCell ) -, mbUndo( true ) + : SdrUndoAction( *xCell->GetModel() ) + , mxObjRef( xObjRef ) + , mxCell( xCell ) + , mbUndo( true ) { if( mxCell.is() && mxObjRef.is() ) { @@ -96,16 +96,16 @@ void CellUndo::Redo() } } -sal_Bool CellUndo::Merge( SfxUndoAction *pNextAction ) +bool CellUndo::Merge( SfxUndoAction *pNextAction ) { CellUndo* pNext = dynamic_cast< CellUndo* >( pNextAction ); if( pNext && pNext->mxCell.get() == mxCell.get() ) { - return sal_True; + return true; } else { - return sal_False; + return false; } } @@ -170,10 +170,10 @@ static void Dispose( RowVector& rRows ) // ----------------------------------------------------------------------------- InsertRowUndo::InsertRowUndo( const TableModelRef& xTable, sal_Int32 nIndex, RowVector& aNewRows ) -: SdrUndoAction( *xTable->getSdrTableObj()->GetModel() ) -, mxTable( xTable ) -, mnIndex( nIndex ) -, mbUndo( true ) + : SdrUndoAction( *xTable->getSdrTableObj()->GetModel() ) + , mxTable( xTable ) + , mnIndex( nIndex ) + , mbUndo( true ) { maRows.swap( aNewRows ); } @@ -213,10 +213,10 @@ void InsertRowUndo::Redo() // ----------------------------------------------------------------------------- RemoveRowUndo::RemoveRowUndo( const TableModelRef& xTable, sal_Int32 nIndex, RowVector& aRemovedRows ) -: SdrUndoAction( *xTable->getSdrTableObj()->GetModel() ) -, mxTable( xTable ) -, mnIndex( nIndex ) -, mbUndo( true ) + : SdrUndoAction( *xTable->getSdrTableObj()->GetModel() ) + , mxTable( xTable ) + , mnIndex( nIndex ) + , mbUndo( true ) { maRows.swap( aRemovedRows ); } @@ -274,10 +274,10 @@ static void Dispose( CellVector& rCells ) // ----------------------------------------------------------------------------- InsertColUndo::InsertColUndo( const TableModelRef& xTable, sal_Int32 nIndex, ColumnVector& aNewCols, CellVector& aCells ) -: SdrUndoAction( *xTable->getSdrTableObj()->GetModel() ) -, mxTable( xTable ) -, mnIndex( nIndex ) -, mbUndo( true ) + : SdrUndoAction( *xTable->getSdrTableObj()->GetModel() ) + , mxTable( xTable ) + , mnIndex( nIndex ) + , mbUndo( true ) { maColumns.swap( aNewCols ); maCells.swap( aCells ); @@ -321,10 +321,10 @@ void InsertColUndo::Redo() // ----------------------------------------------------------------------------- RemoveColUndo::RemoveColUndo( const TableModelRef& xTable, sal_Int32 nIndex, ColumnVector& aNewCols, CellVector& aCells ) -: SdrUndoAction( *xTable->getSdrTableObj()->GetModel() ) -, mxTable( xTable ) -, mnIndex( nIndex ) -, mbUndo( true ) + : SdrUndoAction( *xTable->getSdrTableObj()->GetModel() ) + , mxTable( xTable ) + , mnIndex( nIndex ) + , mbUndo( true ) { maColumns.swap( aNewCols ); maCells.swap( aCells ); @@ -368,9 +368,9 @@ void RemoveColUndo::Redo() // ----------------------------------------------------------------------------- TableColumnUndo::TableColumnUndo( const TableColumnRef& xCol ) -: SdrUndoAction( *xCol->mxTableModel->getSdrTableObj()->GetModel() ) -, mxCol( xCol ) -, mbHasRedoData( false ) + : SdrUndoAction( *xCol->mxTableModel->getSdrTableObj()->GetModel() ) + , mxCol( xCol ) + , mbHasRedoData( false ) { getData( maUndoData ); } @@ -402,7 +402,7 @@ void TableColumnUndo::Redo() // ----------------------------------------------------------------------------- -sal_Bool TableColumnUndo::Merge( SfxUndoAction *pNextAction ) +bool TableColumnUndo::Merge( SfxUndoAction *pNextAction ) { TableColumnUndo* pNext = dynamic_cast< TableColumnUndo* >( pNextAction ); return pNext && pNext->mxCol == mxCol; @@ -437,9 +437,9 @@ void TableColumnUndo::getData( Data& rData ) // ----------------------------------------------------------------------------- TableRowUndo::TableRowUndo( const TableRowRef& xRow ) -: SdrUndoAction( *xRow->mxTableModel->getSdrTableObj()->GetModel() ) -, mxRow( xRow ) -, mbHasRedoData( false ) + : SdrUndoAction( *xRow->mxTableModel->getSdrTableObj()->GetModel() ) + , mxRow( xRow ) + , mbHasRedoData( false ) { getData( maUndoData ); } @@ -471,7 +471,7 @@ void TableRowUndo::Redo() // ----------------------------------------------------------------------------- -sal_Bool TableRowUndo::Merge( SfxUndoAction *pNextAction ) +bool TableRowUndo::Merge( SfxUndoAction *pNextAction ) { TableRowUndo* pNext = dynamic_cast< TableRowUndo* >( pNextAction ); return pNext && pNext->mxRow == mxRow; @@ -504,8 +504,8 @@ void TableRowUndo::getData( Data& rData ) // ----------------------------------------------------------------------------- TableStyleUndo::TableStyleUndo( const SdrTableObj& rTableObj ) -: SdrUndoAction( *rTableObj.GetModel() ) -, mxObjRef( const_cast< sdr::table::SdrTableObj*>( &rTableObj ) ) + : SdrUndoAction( *rTableObj.GetModel() ) + , mxObjRef( const_cast< sdr::table::SdrTableObj*>( &rTableObj ) ) { getData( maUndoData ); } diff --git a/svx/source/table/tableundo.hxx b/svx/source/table/tableundo.hxx index 4f816a477650..2e32abab1f98 100644 --- a/svx/source/table/tableundo.hxx +++ b/svx/source/table/tableundo.hxx @@ -47,7 +47,7 @@ public: virtual void Undo(); virtual void Redo(); - virtual sal_Bool Merge( SfxUndoAction *pNextAction ); + virtual bool Merge( SfxUndoAction *pNextAction ); void dispose(); virtual void ObjectInDestruction(const SdrObject& rObject); @@ -164,7 +164,7 @@ public: virtual void Undo(); virtual void Redo(); - virtual sal_Bool Merge( SfxUndoAction *pNextAction ); + virtual bool Merge( SfxUndoAction *pNextAction ); private: struct Data @@ -196,7 +196,7 @@ public: virtual void Undo(); virtual void Redo(); - virtual sal_Bool Merge( SfxUndoAction *pNextAction ); + virtual bool Merge( SfxUndoAction *pNextAction ); private: struct Data diff --git a/sw/inc/IDocumentUndoRedo.hxx b/sw/inc/IDocumentUndoRedo.hxx index a50a4f0dcbb4..4cad09c5c6bf 100644 --- a/sw/inc/IDocumentUndoRedo.hxx +++ b/sw/inc/IDocumentUndoRedo.hxx @@ -95,7 +95,7 @@ public: @return true if executing the last Undo action was successful. */ - virtual sal_Bool Undo() = 0; + virtual bool Undo() = 0; /** Opens undo block. @@ -154,7 +154,7 @@ public: @return true if executing the first Redo action was successful. */ - virtual sal_Bool Redo() = 0; + virtual bool Redo() = 0; /** Get Id and comment of first Redo action. @param o_pStr if not 0, receives comment of first Redo action. diff --git a/sw/inc/docsh.hxx b/sw/inc/docsh.hxx index 4f1a43d53243..08ae99e05275 100644 --- a/sw/inc/docsh.hxx +++ b/sw/inc/docsh.hxx @@ -234,11 +234,11 @@ public: Reader* StartConvertFrom(SfxMedium& rMedium, SwReader** ppRdr, SwCrsrShell* pCrsrSh = 0, SwPaM* pPaM = 0); - virtual long DdeGetData( const String& rItem, const String& rMimeType, + virtual long DdeGetData( const OUString& rItem, const OUString& rMimeType, ::com::sun::star::uno::Any & rValue ); - virtual long DdeSetData( const String& rItem, const String& rMimeType, - const ::com::sun::star::uno::Any & rValue ); - virtual ::sfx2::SvLinkSource* DdeCreateLinkSource( const String& rItem ); + virtual long DdeSetData( const OUString& rItem, const OUString& rMimeType, + const ::com::sun::star::uno::Any & rValue ); + virtual ::sfx2::SvLinkSource* DdeCreateLinkSource( const OUString& rItem ); virtual void ReconnectDdeLink(SfxObjectShell& rServer); virtual void FillClass( SvGlobalName * pClassName, diff --git a/sw/inc/docstyle.hxx b/sw/inc/docstyle.hxx index 90a049e1ac88..fc2a59f7c137 100644 --- a/sw/inc/docstyle.hxx +++ b/sw/inc/docstyle.hxx @@ -82,10 +82,10 @@ protected: public: SwDocStyleSheet( SwDoc& rDoc, - const String& rName, + const OUString& rName, SwDocStyleSheetPool* pPool, SfxStyleFamily eFam, - sal_uInt16 nMask); + sal_uInt16 nMask); SwDocStyleSheet( const SwDocStyleSheet& ); @@ -111,28 +111,28 @@ public: /** new method for paragraph styles to merge indent attributes of applied list style into the given item set, if the list style indent attributes are applicable. */ void MergeIndentAttrsOfListStyle( SfxItemSet& rSet ); - virtual const String& GetParent() const; - virtual const String& GetFollow() const; + virtual const OUString& GetParent() const; + virtual const OUString& GetFollow() const; virtual sal_uLong GetHelpId( OUString& rFile ); virtual void SetHelpId( const OUString& r, sal_uLong nId ); /** Preset the members without physical access. Used by StyleSheetPool. */ - void PresetName(const String& rName) { aName = rName; } - void PresetNameAndFamily(const String& rName); - void PresetParent(const String& rName){ aParent = rName; } - void PresetFollow(const String& rName){ aFollow = rName; } + void PresetName(const OUString& rName) { aName = rName; } + void PresetNameAndFamily(const OUString& rName); + void PresetParent(const OUString& rName){ aParent = rName; } + void PresetFollow(const OUString& rName){ aFollow = rName; } - virtual bool SetName( const String& rStr); - virtual bool SetParent( const String& rStr); - virtual bool SetFollow( const String& rStr); + virtual bool SetName( const OUString& rStr); + virtual bool SetParent( const OUString& rStr); + virtual bool SetFollow( const OUString& rStr); virtual bool HasFollowSupport() const; virtual bool HasParentSupport() const; virtual bool HasClearParentSupport() const; - virtual String GetDescription(); - virtual String GetDescription(SfxMapUnit eUnit); + virtual OUString GetDescription(); + virtual OUString GetDescription(SfxMapUnit eUnit); SwCharFmt* GetCharFmt(); SwTxtFmtColl* GetCollection(); @@ -185,7 +185,7 @@ class SwDocStyleSheetPool : public SfxStyleSheetBasePool sal_Bool bOrganizer : 1; ///< Organizer - virtual SfxStyleSheetBase* Create( const String&, SfxStyleFamily, sal_uInt16 nMask); + virtual SfxStyleSheetBase* Create( const OUString&, SfxStyleFamily, sal_uInt16 nMask); virtual SfxStyleSheetBase* Create( const SfxStyleSheetBase& ); using SfxStyleSheetBasePool::Find; @@ -195,13 +195,13 @@ public: virtual void Replace( SfxStyleSheetBase& rSource, SfxStyleSheetBase& rTarget ); - virtual SfxStyleSheetBase& Make(const String&, SfxStyleFamily, sal_uInt16 nMask, sal_uInt16 nPos = 0xffff); + virtual SfxStyleSheetBase& Make(const OUString&, SfxStyleFamily, sal_uInt16 nMask, sal_uInt16 nPos = 0xffff); - virtual SfxStyleSheetBase* Find( const String&, SfxStyleFamily eFam, + virtual SfxStyleSheetBase* Find( const OUString&, SfxStyleFamily eFam, sal_uInt16 n=SFXSTYLEBIT_ALL ); - virtual bool SetParent( SfxStyleFamily eFam, const String &rStyle, - const String &rParent ); + virtual bool SetParent( SfxStyleFamily eFam, const OUString &rStyle, + const OUString &rParent ); virtual void Remove( SfxStyleSheetBase* pStyle); diff --git a/sw/inc/tblafmt.hxx b/sw/inc/tblafmt.hxx index 734042741a49..58b1f10df2ee 100644 --- a/sw/inc/tblafmt.hxx +++ b/sw/inc/tblafmt.hxx @@ -144,7 +144,7 @@ public: const SvxLineItem &GetTLBR() const { return aTLBR; } const SvxLineItem &GetBLTR() const { return aBLTR; } const SvxBrushItem &GetBackground() const { return aBackground; } - void GetValueFormat( String& rFmt, LanguageType& rLng, LanguageType& rSys ) const + void GetValueFormat( OUString& rFmt, LanguageType& rLng, LanguageType& rSys ) const { rFmt = sNumFmtString; rLng = eNumFmtLanguage; rSys = eSysLanguage; } // The set-methods. diff --git a/sw/inc/undobj.hxx b/sw/inc/undobj.hxx index 3357401c1524..de016109fa15 100644 --- a/sw/inc/undobj.hxx +++ b/sw/inc/undobj.hxx @@ -89,7 +89,7 @@ private: virtual void UndoWithContext(SfxUndoContext &); virtual void RedoWithContext(SfxUndoContext &); virtual void Repeat(SfxRepeatTarget &); - virtual sal_Bool CanRepeat(SfxRepeatTarget &) const; + virtual bool CanRepeat(SfxRepeatTarget &) const; public: SwUndo(SwUndoId const nId); diff --git a/sw/source/core/doc/tblafmt.cxx b/sw/source/core/doc/tblafmt.cxx index 53ccd9a930d1..80483b2fe1a4 100644 --- a/sw/source/core/doc/tblafmt.cxx +++ b/sw/source/core/doc/tblafmt.cxx @@ -837,15 +837,16 @@ void SwTableAutoFmt::UpdateToSet(sal_uInt8 nPos, SfxItemSet& rSet, if( IsValueFormat() && pNFmtr ) { - String sFmt; LanguageType eLng, eSys; + OUString sFmt; + LanguageType eLng, eSys; rChg.GetValueFormat( sFmt, eLng, eSys ); - if( sFmt.Len() ) + if( !sFmt.isEmpty() ) { short nType; bool bNew; - xub_StrLen nCheckPos; + sal_Int32 nCheckPos; sal_uInt32 nKey = pNFmtr->GetIndexPuttingAndConverting( sFmt, eLng, - eSys, nType, bNew, nCheckPos); + eSys, nType, bNew, nCheckPos); rSet.Put( SwTblBoxNumFormat( nKey )); } else diff --git a/sw/source/core/fields/fldbas.cxx b/sw/source/core/fields/fldbas.cxx index 2bd1b7338858..d6bdb926b147 100644 --- a/sw/source/core/fields/fldbas.cxx +++ b/sw/source/core/fields/fldbas.cxx @@ -682,7 +682,7 @@ String SwFormulaField::GetExpandedFormula() const if (nFmt && nFmt != SAL_MAX_UINT32 && ((SwValueFieldType *)GetTyp())->UseFormat()) { - String sFormattedValue; + OUString sFormattedValue; Color* pCol = 0; SvNumberFormatter* pFormatter = GetDoc()->GetNumberFormatter(); @@ -691,10 +691,8 @@ String SwFormulaField::GetExpandedFormula() const { String sValue; ((SwValueFieldType *)GetTyp())->DoubleToString(sValue, GetValue(), nFmt); - OUString sTempOut(sFormattedValue); OUString sTempIn(sValue); - pFormatter->GetOutputString(sTempIn, nFmt, sTempOut, &pCol); - sFormattedValue = sTempOut; + pFormatter->GetOutputString(sTempIn, nFmt, sFormattedValue, &pCol); } else { @@ -715,13 +713,13 @@ bool SwField::IsClickable() const { switch (Which()) { - case RES_JUMPEDITFLD: - case RES_MACROFLD: - case RES_GETREFFLD: - case RES_INPUTFLD: - case RES_SETEXPFLD: - case RES_DROPDOWN: - return true; + case RES_JUMPEDITFLD: + case RES_MACROFLD: + case RES_GETREFFLD: + case RES_INPUTFLD: + case RES_SETEXPFLD: + case RES_DROPDOWN: + return true; } return false; } diff --git a/sw/source/core/fields/usrfld.cxx b/sw/source/core/fields/usrfld.cxx index 4cd42e7973c2..312948a6f474 100644 --- a/sw/source/core/fields/usrfld.cxx +++ b/sw/source/core/fields/usrfld.cxx @@ -237,7 +237,7 @@ String SwUserFieldType::GetContent( sal_uInt32 nFmt ) { if (nFmt && nFmt != SAL_MAX_UINT32) { - String sFormattedValue; + OUString sFormattedValue; Color* pCol = 0; SvNumberFormatter* pFormatter = GetDoc()->GetNumberFormatter(); diff --git a/sw/source/core/inc/SwUndoFmt.hxx b/sw/source/core/inc/SwUndoFmt.hxx index ae587e3a2e2a..dd06903b3b93 100644 --- a/sw/source/core/inc/SwUndoFmt.hxx +++ b/sw/source/core/inc/SwUndoFmt.hxx @@ -53,7 +53,7 @@ public: virtual SwFmt * Create(SwFmt * pDerivedFrom) = 0; virtual void Delete() = 0; - virtual SwFmt * Find(const String & rName) const = 0; + virtual SwFmt * Find(const OUString & rName) const = 0; }; class SwUndoFmtDelete : public SwUndo @@ -77,7 +77,7 @@ public: virtual SwFmt * Create(SwFmt * pDerivedFrom) = 0; virtual void Delete(SwFmt * pFmt) = 0; - virtual SwFmt * Find(const String & rName) const = 0; + virtual SwFmt * Find(const OUString & rName) const = 0; }; class SwUndoRenameFmt : public SwUndo @@ -97,7 +97,7 @@ public: SwRewriter GetRewriter() const; - virtual SwFmt * Find(const String & rName) const = 0; + virtual SwFmt * Find(const OUString & rName) const = 0; }; class SwUndoTxtFmtCollCreate : public SwUndoFmtCreate @@ -108,7 +108,7 @@ public: virtual SwFmt * Create(SwFmt * pDerivedFrom); virtual void Delete(); - virtual SwFmt * Find(const String & rName) const; + virtual SwFmt * Find(const OUString & rName) const; }; class SwUndoTxtFmtCollDelete : public SwUndoFmtDelete @@ -118,7 +118,7 @@ public: virtual SwFmt * Create(SwFmt * pDerivedFrom); virtual void Delete(SwFmt * pFmt); - virtual SwFmt * Find(const String & rName) const; + virtual SwFmt * Find(const OUString & rName) const; }; class SwUndoRenameFmtColl : public SwUndoRenameFmt @@ -128,7 +128,7 @@ public: const String & sNewName, SwDoc * pDoc); - virtual SwFmt * Find(const String & rName) const; + virtual SwFmt * Find(const OUString & rName) const; }; class SwUndoCharFmtCreate : public SwUndoFmtCreate @@ -139,7 +139,7 @@ public: virtual SwFmt * Create(SwFmt * pDerivedFrom); virtual void Delete(); - virtual SwFmt * Find(const String & rName) const; + virtual SwFmt * Find(const OUString & rName) const; }; class SwUndoCharFmtDelete : public SwUndoFmtDelete @@ -149,7 +149,7 @@ public: virtual SwFmt * Create(SwFmt * pDerivedFrom); virtual void Delete(SwFmt * pFmt); - virtual SwFmt * Find(const String & rName) const; + virtual SwFmt * Find(const OUString & rName) const; }; class SwUndoRenameCharFmt : public SwUndoRenameFmt @@ -159,7 +159,7 @@ public: const String & sNewName, SwDoc * pDoc); - virtual SwFmt * Find(const String & rName) const; + virtual SwFmt * Find(const OUString & rName) const; }; class SwUndoFrmFmtCreate : public SwUndoFmtCreate @@ -172,7 +172,7 @@ public: virtual SwFmt * Create(SwFmt * pDerivedFrom); virtual void Delete(); - virtual SwFmt * Find(const String & rName) const; + virtual SwFmt * Find(const OUString & rName) const; }; class SwUndoFrmFmtDelete : public SwUndoFmtDelete @@ -182,7 +182,7 @@ public: virtual SwFmt * Create(SwFmt * pDerivedFrom); virtual void Delete(SwFmt * pFmt); - virtual SwFmt * Find(const String & rName) const; + virtual SwFmt * Find(const OUString & rName) const; }; class SwUndoRenameFrmFmt : public SwUndoRenameFmt @@ -192,7 +192,7 @@ public: const String & sNewName, SwDoc * pDoc); - virtual SwFmt * Find(const String & rName) const; + virtual SwFmt * Find(const OUString & rName) const; }; class SwUndoNumruleCreate : public SwUndo diff --git a/sw/source/core/inc/UndoManager.hxx b/sw/source/core/inc/UndoManager.hxx index 3b7d1136418d..c470a6896669 100644 --- a/sw/source/core/inc/UndoManager.hxx +++ b/sw/source/core/inc/UndoManager.hxx @@ -54,9 +54,9 @@ public: virtual bool IsUndoNoResetModified() const; virtual SwUndoId StartUndo(SwUndoId const eUndoId, - SwRewriter const*const pRewriter); + SwRewriter const*const pRewriter); virtual SwUndoId EndUndo(SwUndoId const eUndoId, - SwRewriter const*const pRewriter); + SwRewriter const*const pRewriter); virtual void DelAllUndoObj(); virtual bool GetLastUndoInfo(OUString *const o_pStr, SwUndoId *const o_pId) const; @@ -65,18 +65,18 @@ public: SwUndoId *const o_pId = 0) const; virtual SwUndoComments_t GetRedoComments() const; virtual bool Repeat(::sw::RepeatContext & rContext, - sal_uInt16 const nRepeatCnt); + sal_uInt16 const nRepeatCnt); virtual SwUndoId GetRepeatInfo(OUString *const o_pStr) const; virtual void AppendUndo(SwUndo *const pUndo); virtual void ClearRedo(); virtual bool IsUndoNodes(SwNodes const& rNodes) const; // ::svl::IUndoManager - virtual void AddUndoAction(SfxUndoAction *pAction, - sal_Bool bTryMerg = sal_False); - virtual sal_Bool Undo(); - virtual sal_Bool Redo(); - virtual void EnableUndo(bool bEnable); + virtual void AddUndoAction(SfxUndoAction *pAction, + bool bTryMerg = false); + virtual bool Undo(); + virtual bool Redo(); + virtual void EnableUndo(bool bEnable); SwUndo * RemoveLastUndo(); SwUndo * GetLastUndo(); diff --git a/sw/source/core/table/swtable.cxx b/sw/source/core/table/swtable.cxx index c0ef98a7e8cf..14b2d6f65f35 100644 --- a/sw/source/core/table/swtable.cxx +++ b/sw/source/core/table/swtable.cxx @@ -178,17 +178,23 @@ static String& lcl_TabToBlankAtSttEnd( String& rTxt ) return rTxt; } -static String& lcl_DelTabsAtSttEnd( String& rTxt ) +static OUString& lcl_DelTabsAtSttEnd( OUString& rTxt ) { sal_Unicode c; - xub_StrLen n; + sal_Int32 n; + OUStringBuffer sBuff(rTxt); - for( n = 0; n < rTxt.Len() && ' ' >= ( c = rTxt.GetChar( n )); ++n ) + for( n = 0; n < sBuff.getLength() && ' ' >= ( c = sBuff[ n ]); ++n ) + { if( '\x9' == c ) - rTxt.Erase( n--, 1 ); - for( n = rTxt.Len(); n && ' ' >= ( c = rTxt.GetChar( --n )); ) + sBuff.remove( n--, 1 ); + } + for( n = sBuff.getLength(); n && ' ' >= ( c = sBuff[ --n ]); ) + { if( '\x9' == c ) - rTxt.Erase( n, 1 ); + sBuff.remove( n, 1 ); + } + rTxt = sBuff.makeStringAndClear(); return rTxt; } @@ -2378,15 +2384,19 @@ void SwTableBoxFmt::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew ) // format contents with the new value assigned and write to paragraph Color* pCol = 0; - String sNewTxt; + OUString sNewTxt; if( DBL_MAX == fVal ) + { sNewTxt = ViewShell::GetShellRes()->aCalc_Error; + } else { pNumFmtr->GetOutputString( fVal, nNewFmt, sNewTxt, &pCol ); if( !bChgTxt ) - sNewTxt.Erase(); + { + sNewTxt = ""; + } } // across all boxes @@ -2465,7 +2475,7 @@ sal_Bool SwTableBox::IsNumberChanged() const if( pNumFmt && pValue && ULONG_MAX != ( nNdPos = IsValidNumTxtNd( sal_True ) ) ) { - String sNewTxt, sOldTxt( pSttNd->GetNodes()[ nNdPos ]-> + OUString sNewTxt, sOldTxt( pSttNd->GetNodes()[ nNdPos ]-> GetTxtNode()->GetRedlineTxt() ); lcl_DelTabsAtSttEnd( sOldTxt ); @@ -2595,7 +2605,7 @@ void SwTableBox::ActualiseValueBox() { double fVal = ((SwTblBoxValue*)pValItem)->GetValue(); Color* pCol = 0; - String sNewTxt; + OUString sNewTxt; pNumFmtr->GetOutputString( fVal, nFmtId, sNewTxt, &pCol ); const String& rTxt = pSttNd->GetNodes()[ nNdPos ]->GetTxtNode()->GetTxt(); diff --git a/sw/source/core/text/EnhancedPDFExportHelper.cxx b/sw/source/core/text/EnhancedPDFExportHelper.cxx index 393383787d1d..cdc25e9aa81b 100644 --- a/sw/source/core/text/EnhancedPDFExportHelper.cxx +++ b/sw/source/core/text/EnhancedPDFExportHelper.cxx @@ -1631,7 +1631,7 @@ void SwEnhancedPDFExportHelper::EnhancedPDFExport() *pNumFormatter->GetNullDate() ); const sal_uLong nFormat = pNumFormatter->GetStandardFormat( NUMBERFORMAT_DATE, pField->GetLanguage() ); - String sDate; + OUString sDate; Color* pColor; pNumFormatter->GetOutputString( aDateDiff.GetDate(), nFormat, sDate, &pColor ); diff --git a/sw/source/core/undo/SwUndoFmt.cxx b/sw/source/core/undo/SwUndoFmt.cxx index 5717b82585ae..149b3c707122 100644 --- a/sw/source/core/undo/SwUndoFmt.cxx +++ b/sw/source/core/undo/SwUndoFmt.cxx @@ -209,7 +209,7 @@ void SwUndoTxtFmtCollCreate::Delete() pDoc->DelTxtFmtColl((SwTxtFmtColl *) pNew, true); } -SwFmt * SwUndoTxtFmtCollCreate::Find(const String & rName) const +SwFmt * SwUndoTxtFmtCollCreate::Find(const OUString & rName) const { return pDoc->FindTxtFmtCollByName(rName); } @@ -230,7 +230,7 @@ void SwUndoTxtFmtCollDelete::Delete(SwFmt * pOld) pDoc->DelTxtFmtColl((SwTxtFmtColl *) pOld, true); } -SwFmt * SwUndoTxtFmtCollDelete::Find(const String & rName) const +SwFmt * SwUndoTxtFmtCollDelete::Find(const OUString & rName) const { return pDoc->FindTxtFmtCollByName(rName); } @@ -242,7 +242,7 @@ SwUndoRenameFmtColl::SwUndoRenameFmtColl(const String & sInitOldName, { } -SwFmt * SwUndoRenameFmtColl::Find(const String & rName) const +SwFmt * SwUndoRenameFmtColl::Find(const OUString & rName) const { return pDoc->FindTxtFmtCollByName(rName); } @@ -264,7 +264,7 @@ void SwUndoCharFmtCreate::Delete() pDoc->DelCharFmt((SwCharFmt *) pNew, true); } -SwFmt * SwUndoCharFmtCreate::Find(const String & rName) const +SwFmt * SwUndoCharFmtCreate::Find(const OUString & rName) const { return pDoc->FindCharFmtByName(rName); } @@ -284,7 +284,7 @@ void SwUndoCharFmtDelete::Delete(SwFmt * pFmt) pDoc->DelCharFmt((SwCharFmt *) pFmt, true); } -SwFmt * SwUndoCharFmtDelete::Find(const String & rName) const +SwFmt * SwUndoCharFmtDelete::Find(const OUString & rName) const { return pDoc->FindCharFmtByName(rName); } @@ -296,7 +296,7 @@ SwUndoRenameCharFmt::SwUndoRenameCharFmt(const String & sInitOldName, { } -SwFmt * SwUndoRenameCharFmt::Find(const String & rName) const +SwFmt * SwUndoRenameCharFmt::Find(const OUString & rName) const { return pDoc->FindCharFmtByName(rName); } @@ -319,7 +319,7 @@ void SwUndoFrmFmtCreate::Delete() pDoc->DelFrmFmt((SwFrmFmt *) pNew, true); } -SwFmt * SwUndoFrmFmtCreate::Find(const String & rName) const +SwFmt * SwUndoFrmFmtCreate::Find(const OUString & rName) const { return pDoc->FindFrmFmtByName(rName); } @@ -339,7 +339,7 @@ void SwUndoFrmFmtDelete::Delete(SwFmt * pFmt) pDoc->DelFrmFmt((SwFrmFmt *) pFmt, true); } -SwFmt * SwUndoFrmFmtDelete::Find(const String & rName) const +SwFmt * SwUndoFrmFmtDelete::Find(const OUString & rName) const { return pDoc->FindFrmFmtByName(rName); } @@ -351,7 +351,7 @@ SwUndoRenameFrmFmt::SwUndoRenameFrmFmt(const String & sInitOldName, { } -SwFmt * SwUndoRenameFrmFmt::Find(const String & rName) const +SwFmt * SwUndoRenameFrmFmt::Find(const OUString & rName) const { return pDoc->FindFrmFmtByName(rName); } diff --git a/sw/source/core/undo/docundo.cxx b/sw/source/core/undo/docundo.cxx index fff78e4da186..cbe642c511c4 100644 --- a/sw/source/core/undo/docundo.cxx +++ b/sw/source/core/undo/docundo.cxx @@ -422,7 +422,7 @@ void UndoManager::EnableUndo(bool bEnable) SdrUndoManager::EnableUndo(bEnable); } -void UndoManager::AddUndoAction(SfxUndoAction *pAction, sal_Bool bTryMerge) +void UndoManager::AddUndoAction(SfxUndoAction *pAction, bool bTryMerge) { SwUndo *const pUndo( dynamic_cast<SwUndo *>(pAction) ); if (pUndo) @@ -522,7 +522,7 @@ bool UndoManager::impl_DoUndoRedo(UndoOrRedo_t const undoOrRedo) return bRet; } -sal_Bool UndoManager::Undo() +bool UndoManager::Undo() { if(isTextEditActive()) { @@ -534,7 +534,7 @@ sal_Bool UndoManager::Undo() } } -sal_Bool UndoManager::Redo() +bool UndoManager::Redo() { if(isTextEditActive()) { @@ -551,9 +551,8 @@ sal_Bool UndoManager::Redo() calling EnterListAction here will cause SdrUndoManager::Repeat to repeat the list action! */ -bool -UndoManager::Repeat(::sw::RepeatContext & rContext, - sal_uInt16 const nRepeatCount) +bool UndoManager::Repeat(::sw::RepeatContext & rContext, + sal_uInt16 const nRepeatCount) { if (SdrUndoManager::IsInListAction()) { diff --git a/sw/source/core/undo/undobj.cxx b/sw/source/core/undo/undobj.cxx index 30a86778525f..42fcd7b1da3b 100644 --- a/sw/source/core/undo/undobj.cxx +++ b/sw/source/core/undo/undobj.cxx @@ -249,7 +249,7 @@ void SwUndo::Repeat(SfxRepeatTarget & rContext) RepeatImpl(*pRepeatContext); } -sal_Bool SwUndo::CanRepeat(SfxRepeatTarget & rContext) const +bool SwUndo::CanRepeat(SfxRepeatTarget & rContext) const { ::sw::RepeatContext *const pRepeatContext( dynamic_cast< ::sw::RepeatContext * >(& rContext)); diff --git a/sw/source/ui/app/docsh2.cxx b/sw/source/ui/app/docsh2.cxx index 372cb3e09496..2123202456ae 100644 --- a/sw/source/ui/app/docsh2.cxx +++ b/sw/source/ui/app/docsh2.cxx @@ -1441,19 +1441,19 @@ void lcl_processCompatibleSfxHint( const uno::Reference< document::XVbaEventsHel } #endif -long SwDocShell::DdeGetData( const String& rItem, const String& rMimeType, - uno::Any & rValue ) +long SwDocShell::DdeGetData( const OUString& rItem, const OUString& rMimeType, + uno::Any & rValue ) { return pDoc->GetData( rItem, rMimeType, rValue ); } -long SwDocShell::DdeSetData( const String& rItem, const String& rMimeType, - const uno::Any & rValue ) +long SwDocShell::DdeSetData( const OUString& rItem, const OUString& rMimeType, + const uno::Any & rValue ) { return pDoc->SetData( rItem, rMimeType, rValue ); } -::sfx2::SvLinkSource* SwDocShell::DdeCreateLinkSource( const String& rItem ) +::sfx2::SvLinkSource* SwDocShell::DdeCreateLinkSource( const OUString& rItem ) { return pDoc->CreateLinkSource( rItem ); } diff --git a/sw/source/ui/app/docstyle.cxx b/sw/source/ui/app/docstyle.cxx index 934f7174b47b..016e4197a4ba 100644 --- a/sw/source/ui/app/docstyle.cxx +++ b/sw/source/ui/app/docstyle.cxx @@ -187,12 +187,12 @@ static SwTxtFmtColl* lcl_FindParaFmt( SwDoc& rDoc, // Border formats static SwFrmFmt* lcl_FindFrmFmt( SwDoc& rDoc, - const String& rName, + const OUString& rName, SwDocStyleSheet* pStyle = 0, bool bCreate = true ) { SwFrmFmt* pFmt = 0; - if( rName.Len() ) + if( !rName.isEmpty() ) { pFmt = rDoc.FindFrmFmtByName( rName ); if( !pFmt && bCreate ) @@ -211,7 +211,7 @@ static SwFrmFmt* lcl_FindFrmFmt( SwDoc& rDoc, if( pFmt->DerivedFrom() && !pFmt->DerivedFrom()->IsDefault() ) pStyle->PresetParent( pFmt->DerivedFrom()->GetName() ); else - pStyle->PresetParent( aEmptyStr ); + pStyle->PresetParent( aEmptyOUStr ); } else pStyle->SetPhysical(sal_False); @@ -348,7 +348,7 @@ void SwPoolFmtList::Erase() // UI-sided implementation of StyleSheets // uses the Core-Engine SwDocStyleSheet::SwDocStyleSheet( SwDoc& rDocument, - const String& rName, + const OUString& rName, SwDocStyleSheetPool* _rPool, SfxStyleFamily eFam, sal_uInt16 _nMask) : @@ -408,9 +408,9 @@ SwDocStyleSheet::SwDocStyleSheet( const SwDocStyleSheet& rOrg) : // Reset void SwDocStyleSheet::Reset() { - aName.Erase(); - aFollow.Erase(); - aParent.Erase(); + aName = ""; + aFollow = ""; + aParent = ""; SetPhysical(sal_False); } @@ -523,7 +523,7 @@ sal_Bool SwDocStyleSheet::IsHidden( ) const return bRet; } -const String& SwDocStyleSheet::GetParent() const +const OUString& SwDocStyleSheet::GetParent() const { if( !bPhysical ) { @@ -550,7 +550,7 @@ const String& SwDocStyleSheet::GetParent() const case SFX_STYLE_FAMILY_PAGE: case SFX_STYLE_FAMILY_PSEUDO: default: - return aEmptyStr; // there's no parent + return aEmptyOUStr; // there's no parent } String sTmp; @@ -574,7 +574,7 @@ const String& SwDocStyleSheet::GetParent() const } // Follower -const String& SwDocStyleSheet::GetFollow() const +const OUString& SwDocStyleSheet::GetFollow() const { if( !bPhysical ) { @@ -629,7 +629,7 @@ bool SwDocStyleSheet::HasClearParentSupport() const } // determine textual description -String SwDocStyleSheet::GetDescription(SfxMapUnit eUnit) +OUString SwDocStyleSheet::GetDescription(SfxMapUnit eUnit) { IntlWrapper aIntlWrapper( SvtSysLocale().GetLanguageTag() ); @@ -674,7 +674,7 @@ String SwDocStyleSheet::GetDescription(SfxMapUnit eUnit) return aDesc; } else if ( SFX_STYLE_FAMILY_FRAME == nFamily || - SFX_STYLE_FAMILY_PARA == nFamily) + SFX_STYLE_FAMILY_PARA == nFamily) { if( !pSet ) GetItemSet(); @@ -795,15 +795,15 @@ String SwDocStyleSheet::GetDescription(SfxMapUnit eUnit) } -String SwDocStyleSheet::GetDescription() +OUString SwDocStyleSheet::GetDescription() { return GetDescription(SFX_MAPUNIT_CM); } // Set names -bool SwDocStyleSheet::SetName( const String& rStr) +bool SwDocStyleSheet::SetName( const OUString& rStr) { - if( !rStr.Len() ) + if( rStr.isEmpty() ) return false; if( aName != rStr ) @@ -881,9 +881,9 @@ bool SwDocStyleSheet::SetName( const String& rStr) if (pNumRule) { - String aOldName = pNumRule->GetName(); + OUString aOldName = pNumRule->GetName(); - if (aOldName.Len() > 0) + if (!aOldName.isEmpty()) { if ( aOldName != rStr && rDoc.RenameNumRule(aOldName, rStr)) @@ -922,26 +922,26 @@ bool SwDocStyleSheet::SetName( const String& rStr) } // hierarchy of deduction -bool SwDocStyleSheet::SetParent( const String& rStr) +bool SwDocStyleSheet::SetParent( const OUString& rStr) { SwFmt* pFmt = 0, *pParent = 0; switch(nFamily) { case SFX_STYLE_FAMILY_CHAR : OSL_ENSURE( pCharFmt, "SwCharFormat missing!" ); - if( 0 != ( pFmt = pCharFmt ) && rStr.Len() ) + if( 0 != ( pFmt = pCharFmt ) && !rStr.isEmpty() ) pParent = lcl_FindCharFmt(rDoc, rStr); break; case SFX_STYLE_FAMILY_PARA : OSL_ENSURE( pColl, "Collektion missing!"); - if( 0 != ( pFmt = pColl ) && rStr.Len() ) + if( 0 != ( pFmt = pColl ) && !rStr.isEmpty() ) pParent = lcl_FindParaFmt( rDoc, rStr ); break; case SFX_STYLE_FAMILY_FRAME: OSL_ENSURE(pFrmFmt, "FrameFormat missing!"); - if( 0 != ( pFmt = pFrmFmt ) && rStr.Len() ) + if( 0 != ( pFmt = pFrmFmt ) && !rStr.isEmpty() ) pParent = lcl_FindFrmFmt( rDoc, rStr ); break; @@ -973,9 +973,9 @@ bool SwDocStyleSheet::SetParent( const String& rStr) } // Set Follower -bool SwDocStyleSheet::SetFollow( const String& rStr) +bool SwDocStyleSheet::SetFollow( const OUString& rStr) { - if( rStr.Len() && !SfxStyleSheetBase::SetFollow( rStr )) + if( !rStr.isEmpty() && !SfxStyleSheetBase::SetFollow( rStr )) return false; SwImplShellAction aTmpSh( rDoc ); @@ -987,7 +987,7 @@ bool SwDocStyleSheet::SetFollow( const String& rStr) if( pColl ) { SwTxtFmtColl* pFollow = pColl; - if( rStr.Len() && 0 == (pFollow = lcl_FindParaFmt(rDoc, rStr) )) + if( !rStr.isEmpty() && 0 == (pFollow = lcl_FindParaFmt(rDoc, rStr) )) pFollow = pColl; pColl->SetNextTxtFmtColl(*pFollow); @@ -999,7 +999,7 @@ bool SwDocStyleSheet::SetFollow( const String& rStr) OSL_ENSURE(pDesc, "PageDesc missing!"); if( pDesc ) { - const SwPageDesc* pFollowDesc = rStr.Len() + const SwPageDesc* pFollowDesc = !rStr.isEmpty() ? lcl_FindPageDesc(rDoc, rStr) : 0; sal_uInt16 nId; @@ -1770,7 +1770,7 @@ void SwDocStyleSheet::Create() if( !pNumRule ) { String sTmpNm( aName ); - if( !aName.Len() ) + if( aName.isEmpty() ) sTmpNm = rDoc.GetUniqueNumRuleName(); SwNumRule* pRule = rDoc.GetNumRuleTbl()[ @@ -1778,7 +1778,7 @@ void SwDocStyleSheet::Create() // #i89178# numfunc::GetDefaultPositionAndSpaceMode() ) ]; pRule->SetAutoRule( sal_False ); - if( !aName.Len() ) + if( aName.isEmpty() ) { // #i91400# pRule->SetName( aName, rDoc ); @@ -1829,18 +1829,17 @@ void SwDocStyleSheet::SetNumRule(const SwNumRule& rRule) // re-generate Name AND Family from String // First() and Next() (see below) insert an identification letter at Pos.1 -void SwDocStyleSheet::PresetNameAndFamily(const String& rName) +void SwDocStyleSheet::PresetNameAndFamily(const OUString& rName) { - switch( rName.GetChar(0) ) + switch( rName[0] ) { - case cPARA: nFamily = SFX_STYLE_FAMILY_PARA; break; - case cFRAME: nFamily = SFX_STYLE_FAMILY_FRAME; break; - case cPAGE: nFamily = SFX_STYLE_FAMILY_PAGE; break; - case cNUMRULE: nFamily = SFX_STYLE_FAMILY_PSEUDO; break; - default: nFamily = SFX_STYLE_FAMILY_CHAR; break; + case cPARA: nFamily = SFX_STYLE_FAMILY_PARA; break; + case cFRAME: nFamily = SFX_STYLE_FAMILY_FRAME; break; + case cPAGE: nFamily = SFX_STYLE_FAMILY_PAGE; break; + case cNUMRULE: nFamily = SFX_STYLE_FAMILY_PSEUDO; break; + default: nFamily = SFX_STYLE_FAMILY_CHAR; break; } - aName = rName; - aName.Erase( 0, 1 ); + aName = rName.copy(1); } // Is the format physically present yet @@ -2049,11 +2048,10 @@ void SAL_CALL SwDocStyleSheetPool::release( ) throw () comphelper::OWeakTypeObject::release(); } -SfxStyleSheetBase& SwDocStyleSheetPool::Make( - const String& rName, - SfxStyleFamily eFam, - sal_uInt16 _nMask, - sal_uInt16 /*nPos*/ ) +SfxStyleSheetBase& SwDocStyleSheetPool::Make( const OUString& rName, + SfxStyleFamily eFam, + sal_uInt16 _nMask, + sal_uInt16 /*nPos*/ ) { mxStyleSheet->PresetName(rName); mxStyleSheet->PresetParent(aEmptyStr); @@ -2074,15 +2072,15 @@ SfxStyleSheetBase* SwDocStyleSheetPool::Create( const SfxStyleSheetBase& /*rOr } -SfxStyleSheetBase* SwDocStyleSheetPool::Create( const String &, - SfxStyleFamily, sal_uInt16 ) +SfxStyleSheetBase* SwDocStyleSheetPool::Create( const OUString &, + SfxStyleFamily, sal_uInt16 ) { OSL_ENSURE( !this, "Create im SW-Stylesheet-Pool geht nicht" ); return NULL; } void SwDocStyleSheetPool::Replace( SfxStyleSheetBase& rSource, - SfxStyleSheetBase& rTarget ) + SfxStyleSheetBase& rTarget ) { SfxStyleFamily eFamily( rSource.GetFamily() ); if( rSource.HasParentSupport()) @@ -2247,23 +2245,23 @@ void SwDocStyleSheetPool::Remove( SfxStyleSheetBase* pStyle) bool SwDocStyleSheetPool::SetParent( SfxStyleFamily eFam, - const String &rStyle, const String &rParent ) + const OUString &rStyle, const OUString &rParent ) { SwFmt* pFmt = 0, *pParent = 0; switch( eFam ) { case SFX_STYLE_FAMILY_CHAR : - if( 0 != ( pFmt = lcl_FindCharFmt( rDoc, rStyle ) ) && rParent.Len() ) + if( 0 != ( pFmt = lcl_FindCharFmt( rDoc, rStyle ) ) && !rParent.isEmpty() ) pParent = lcl_FindCharFmt(rDoc, rParent ); break; case SFX_STYLE_FAMILY_PARA : - if( 0 != ( pFmt = lcl_FindParaFmt( rDoc, rStyle ) ) && rParent.Len() ) + if( 0 != ( pFmt = lcl_FindParaFmt( rDoc, rStyle ) ) && !rParent.isEmpty() ) pParent = lcl_FindParaFmt( rDoc, rParent ); break; case SFX_STYLE_FAMILY_FRAME: - if( 0 != ( pFmt = lcl_FindFrmFmt( rDoc, rStyle ) ) && rParent.Len() ) + if( 0 != ( pFmt = lcl_FindFrmFmt( rDoc, rStyle ) ) && !rParent.isEmpty() ) pParent = lcl_FindFrmFmt( rDoc, rParent ); break; @@ -2293,7 +2291,7 @@ bool SwDocStyleSheetPool::SetParent( SfxStyleFamily eFam, mxStyleSheet->PresetFollow( ((SwTxtFmtColl*)pFmt)-> GetNextTxtFmtColl().GetName() ); else - mxStyleSheet->PresetFollow( aEmptyStr ); + mxStyleSheet->PresetFollow( aEmptyOUStr ); Broadcast( SfxStyleSheetHint( SFX_STYLESHEET_MODIFIED, *(mxStyleSheet.get()) ) ); @@ -2303,8 +2301,8 @@ bool SwDocStyleSheetPool::SetParent( SfxStyleFamily eFam, return bRet; } -SfxStyleSheetBase* SwDocStyleSheetPool::Find( const String& rName, - SfxStyleFamily eFam, sal_uInt16 n ) +SfxStyleSheetBase* SwDocStyleSheetPool::Find( const OUString& rName, + SfxStyleFamily eFam, sal_uInt16 n ) { sal_uInt16 nSMask = n; if( SFX_STYLE_FAMILY_PARA == eFam && rDoc.get(IDocumentSettingAccess::HTML_MODE) ) diff --git a/sw/source/ui/dbui/dbinsdlg.cxx b/sw/source/ui/dbui/dbinsdlg.cxx index c5f8ca32f0d9..bcaad876cd50 100644 --- a/sw/source/ui/dbui/dbinsdlg.cxx +++ b/sw/source/ui/dbui/dbinsdlg.cxx @@ -1271,7 +1271,7 @@ void SwInsertDBColAutoPilot::DataToDoc( const Sequence<Any>& rSelection, for( n = 0; n < nCols; ++n ) { _DB_Column* pDBCol = &aColArr[ n ]; - String sIns; + OUString sIns; switch( pDBCol->eColType ) { case _DB_Column::DB_FILLTEXT: @@ -1351,24 +1351,26 @@ void SwInsertDBColAutoPilot::DataToDoc( const Sequence<Any>& rSelection, break; } - if( sIns.Len() ) + if( !sIns.isEmpty() ) + { rSh.Insert( sIns ); - if( bSetCrsr && sIns.Len() ) - { - // to the beginning and set a mark, so that - // the cursor can be set to the initial position - // at the end. - - rSh.SwCrsrShell::MovePara( - GetfnParaCurr(), GetfnParaStart() ); - pMark = rSh.SetBookmark( - KeyCode(), - OUString(), - OUString(), IDocumentMarkAccess::UNO_BOOKMARK ); - rSh.SwCrsrShell::MovePara( - GetfnParaCurr(), GetfnParaEnd() ); - bSetCrsr = false; + if( bSetCrsr) + { + // to the beginning and set a mark, so that + // the cursor can be set to the initial position + // at the end. + + rSh.SwCrsrShell::MovePara( + GetfnParaCurr(), GetfnParaStart() ); + pMark = rSh.SetBookmark( + KeyCode(), + OUString(), + OUString(), IDocumentMarkAccess::UNO_BOOKMARK ); + rSh.SwCrsrShell::MovePara( + GetfnParaCurr(), GetfnParaEnd() ); + bSetCrsr = false; + } } } diff --git a/sw/source/ui/table/tautofmt.cxx b/sw/source/ui/table/tautofmt.cxx index aa93c35611f2..4300b0dafea4 100644 --- a/sw/source/ui/table/tautofmt.cxx +++ b/sw/source/ui/table/tautofmt.cxx @@ -611,70 +611,71 @@ void AutoFmtPreview::DrawString( size_t nCol, size_t nRow ) // Output of the cell text: sal_uLong nNum; double nVal; - String cellString; + OUString cellString; sal_uInt8 nIndex = static_cast< sal_uInt8 >( maArray.GetCellIndex( nCol, nRow, mbRTL ) ); switch( nIndex ) { - case 1: cellString = aStrJan; break; - case 2: cellString = aStrFeb; break; - case 3: cellString = aStrMar; break; - case 5: cellString = aStrNorth; break; - case 10: cellString = aStrMid; break; - case 15: cellString = aStrSouth; break; - case 4: - case 20: cellString = aStrSum; break; - - case 6: - case 8: - case 16: - case 18: nVal = nIndex; - nNum = 5; - goto MAKENUMSTR; - case 17: - case 7: nVal = nIndex; - nNum = 6; - goto MAKENUMSTR; - case 11: - case 12: - case 13: nVal = nIndex; - nNum = 12 == nIndex ? 10 : 9; - goto MAKENUMSTR; - - case 9: nVal = 21; nNum = 7; goto MAKENUMSTR; - case 14: nVal = 36; nNum = 11; goto MAKENUMSTR; - case 19: nVal = 51; nNum = 7; goto MAKENUMSTR; - case 21: nVal = 33; nNum = 13; goto MAKENUMSTR; - case 22: nVal = 36; nNum = 14; goto MAKENUMSTR; - case 23: nVal = 39; nNum = 13; goto MAKENUMSTR; - case 24: nVal = 108; nNum = 15; goto MAKENUMSTR; + case 1: cellString = aStrJan; break; + case 2: cellString = aStrFeb; break; + case 3: cellString = aStrMar; break; + case 5: cellString = aStrNorth; break; + case 10: cellString = aStrMid; break; + case 15: cellString = aStrSouth; break; + case 4: + case 20: cellString = aStrSum; break; + + case 6: + case 8: + case 16: + case 18: nVal = nIndex; + nNum = 5; + goto MAKENUMSTR; + case 17: + case 7: nVal = nIndex; + nNum = 6; + goto MAKENUMSTR; + case 11: + case 12: + case 13: nVal = nIndex; + nNum = 12 == nIndex ? 10 : 9; + goto MAKENUMSTR; + + case 9: nVal = 21; nNum = 7; goto MAKENUMSTR; + case 14: nVal = 36; nNum = 11; goto MAKENUMSTR; + case 19: nVal = 51; nNum = 7; goto MAKENUMSTR; + case 21: nVal = 33; nNum = 13; goto MAKENUMSTR; + case 22: nVal = 36; nNum = 14; goto MAKENUMSTR; + case 23: nVal = 39; nNum = 13; goto MAKENUMSTR; + case 24: nVal = 108; nNum = 15; goto MAKENUMSTR; MAKENUMSTR: - if( aCurData.IsValueFormat() ) - { - String sFmt; LanguageType eLng, eSys; - aCurData.GetBoxFmt( (sal_uInt8)nNum ).GetValueFormat( sFmt, eLng, eSys ); - - short nType; - bool bNew; - xub_StrLen nCheckPos; - sal_uInt32 nKey = pNumFmt->GetIndexPuttingAndConverting( sFmt, eLng, - eSys, nType, bNew, nCheckPos); - Color* pDummy; - pNumFmt->GetOutputString( nVal, nKey, cellString, &pDummy ); - } - else - cellString = OUString::number((sal_Int32)nVal); - break; + if( aCurData.IsValueFormat() ) + { + OUString sFmt; + LanguageType eLng, eSys; + aCurData.GetBoxFmt( (sal_uInt8)nNum ).GetValueFormat( sFmt, eLng, eSys ); + + short nType; + bool bNew; + sal_Int32 nCheckPos; + sal_uInt32 nKey = pNumFmt->GetIndexPuttingAndConverting( sFmt, eLng, + eSys, nType, bNew, nCheckPos); + Color* pDummy; + pNumFmt->GetOutputString( nVal, nKey, cellString, &pDummy ); + } + else + cellString = OUString::number((sal_Int32)nVal); + break; } - if( cellString.Len() ) + if( !cellString.isEmpty() ) { Size aStrSize; - sal_uInt8 nFmtIndex = GetFormatIndex( nCol, nRow ); + sal_uInt8 nFmtIndex = GetFormatIndex( nCol, nRow ); Rectangle cellRect = maArray.GetCellRect( nCol, nRow ); Point aPos = cellRect.TopLeft(); - sal_uInt16 nRightX = 0; + sal_uInt16 nRightX = 0; Size theMaxStrSize( cellRect.GetWidth() - FRAME_OFFSET, cellRect.GetHeight() - FRAME_OFFSET ); @@ -701,9 +702,9 @@ MAKENUMSTR: } while( theMaxStrSize.Width() <= aStrSize.Width() && - cellString.Len() > 1 ) + cellString.getLength() > 1 ) { - cellString.Erase( cellString.Len() - 1 ); + cellString = cellString.copy(0, cellString.getLength() - 1 ); aScriptedText.SetText( cellString, m_xBreak ); aStrSize = aScriptedText.GetTextSize(); } diff --git a/sw/source/ui/uiview/viewsrch.cxx b/sw/source/ui/uiview/viewsrch.cxx index 7e07a36abff9..3df85c96b032 100644 --- a/sw/source/ui/uiview/viewsrch.cxx +++ b/sw/source/ui/uiview/viewsrch.cxx @@ -243,7 +243,7 @@ void SwView::ExecSearch(SfxRequest& rReq, sal_Bool bNoMessage) // was ist, wenn man das gefundene nur attributieren will?? sal_uInt16 nCmd = SVX_SEARCHCMD_FIND; - if( m_pSrchItem->GetReplaceString().Len() || + if( !m_pSrchItem->GetReplaceString().isEmpty() || !m_pReplList ) { // Verhindern, dass - falls der Suchstring im @@ -751,7 +751,7 @@ sal_uLong SwView::FUNC_Search( const SwSearchOptions& rOptions ) rOptions.eStart, rOptions.eEnd, FindRanges(eRanges), - m_pSrchItem->GetSearchString().Len() ? &aSearchOpt : 0, + !m_pSrchItem->GetSearchString().isEmpty() ? &aSearchOpt : 0, pReplSet ); } else if( m_pSrchItem->GetPattern() ) diff --git a/sw/source/ui/utlui/numfmtlb.cxx b/sw/source/ui/utlui/numfmtlb.cxx index 32bf99a1ce39..58926e6e83fb 100644 --- a/sw/source/ui/utlui/numfmtlb.cxx +++ b/sw/source/ui/utlui/numfmtlb.cxx @@ -303,15 +303,13 @@ void NumFormatListBox::SetDefFormat(const sal_uLong nDefFmt) // No entry found: double fValue = GetDefValue(nType); - String sValue; + OUString sValue; Color* pCol = 0; if (nType == NUMBERFORMAT_TEXT) { OUString sTxt("\"ABC\""); - OUString sTempOut(sValue); - pFormatter->GetOutputString(sTxt, nDefFmt, sTempOut, &pCol); - sValue = sTempOut; + pFormatter->GetOutputString(sTxt, nDefFmt, sValue, &pCol); } else pFormatter->GetOutputString(fValue, nDefFmt, sValue, &pCol); diff --git a/uui/source/iahndl-ssl.cxx b/uui/source/iahndl-ssl.cxx index 922d587d62f8..c75b82202779 100644 --- a/uui/source/iahndl-ssl.cxx +++ b/uui/source/iahndl-ssl.cxx @@ -115,14 +115,13 @@ getLocalizedDatTimeStr( LanguageType eUILang = Application::GetSettings().GetUILanguageTag().getLanguageType(); SvNumberFormatter *pNumberFormatter = new SvNumberFormatter( xContext, eUILang ); - String aTmpStr; + OUString aTmpStr; Color* pColor = NULL; Date* pNullDate = pNumberFormatter->GetNullDate(); sal_uInt32 nFormat = pNumberFormatter->GetStandardFormat( NUMBERFORMAT_DATE, eUILang ); - pNumberFormatter->GetOutputString( - aDate - *pNullDate, nFormat, aTmpStr, &pColor ); + pNumberFormatter->GetOutputString( aDate - *pNullDate, nFormat, aTmpStr, &pColor ); aDateTimeStr = aTmpStr + OUString(" "); nFormat = pNumberFormatter->GetStandardFormat( NUMBERFORMAT_TIME, eUILang ); diff --git a/vcl/source/edit/textund2.hxx b/vcl/source/edit/textund2.hxx index 0ff91792ed09..e8138056ab5c 100644 --- a/vcl/source/edit/textund2.hxx +++ b/vcl/source/edit/textund2.hxx @@ -91,7 +91,7 @@ public: virtual void Undo(); virtual void Redo(); - virtual sal_Bool Merge( SfxUndoAction *pNextAction ); + virtual bool Merge( SfxUndoAction *pNextAction ); virtual OUString GetComment () const; }; diff --git a/vcl/source/edit/textundo.cxx b/vcl/source/edit/textundo.cxx index fb6c00f1be17..324306c5b480 100644 --- a/vcl/source/edit/textundo.cxx +++ b/vcl/source/edit/textundo.cxx @@ -75,15 +75,15 @@ TextUndoManager::~TextUndoManager() { } -sal_Bool TextUndoManager::Undo() +bool TextUndoManager::Undo() { if ( GetUndoActionCount() == 0 ) - return sal_False; + return false; UndoRedoStart(); mpTextEngine->SetIsInUndo( sal_True ); - sal_Bool bDone = SfxUndoManager::Undo(); + bool bDone = SfxUndoManager::Undo(); mpTextEngine->SetIsInUndo( sal_False ); UndoRedoEnd(); @@ -91,16 +91,16 @@ sal_Bool TextUndoManager::Undo() return bDone; } -sal_Bool TextUndoManager::Redo() +bool TextUndoManager::Redo() { if ( GetRedoActionCount() == 0 ) - return sal_False; + return false; UndoRedoStart(); mpTextEngine->SetIsInUndo( sal_True ); - sal_Bool bDone = SfxUndoManager::Redo(); + bool bDone = SfxUndoManager::Redo(); mpTextEngine->SetIsInUndo( sal_False ); UndoRedoEnd(); @@ -278,22 +278,22 @@ void TextUndoInsertChars::Redo() SetSelection( TextSelection( aSel.GetStart(), aNewPaM ) ); } -sal_Bool TextUndoInsertChars::Merge( SfxUndoAction* pNextAction ) +bool TextUndoInsertChars::Merge( SfxUndoAction* pNextAction ) { if ( !pNextAction->ISA( TextUndoInsertChars ) ) - return sal_False; + return false; TextUndoInsertChars* pNext = (TextUndoInsertChars*)pNextAction; if ( maTextPaM.GetPara() != pNext->maTextPaM.GetPara() ) - return sal_False; + return false; if ( ( maTextPaM.GetIndex() + maText.Len() ) == pNext->maTextPaM.GetIndex() ) { maText += pNext->maText; - return sal_True; + return true; } - return sal_False; + return false; } OUString TextUndoInsertChars::GetComment () const diff --git a/vcl/source/edit/textundo.hxx b/vcl/source/edit/textundo.hxx index a461bd78e7b0..4d062d2f4893 100644 --- a/vcl/source/edit/textundo.hxx +++ b/vcl/source/edit/textundo.hxx @@ -44,9 +44,9 @@ public: ~TextUndoManager(); using SfxUndoManager::Undo; - virtual sal_Bool Undo(); + virtual bool Undo(); using SfxUndoManager::Redo; - virtual sal_Bool Redo(); + virtual bool Redo(); }; |