diff options
author | Norbert Thiebaud <nthiebaud@gmail.com> | 2013-07-05 16:25:03 -0500 |
---|---|---|
committer | Norbert Thiebaud <nthiebaud@gmail.com> | 2013-07-07 20:00:16 +0000 |
commit | 009851223b5ced4ed2662af2e2ae81c0f9200e45 (patch) | |
tree | a8ab339589ea23b98513d394eabc4f135e69ccae /sw | |
parent | 35b42a9d1282a92dbc9a7fbc51d279812070688c (diff) |
module svl: all String and some bool and related clean-up
Change-Id: I36eb559fa58dbe75384b7119c788af0048813aed
Reviewed-on: https://gerrit.libreoffice.org/4733
Reviewed-by: Norbert Thiebaud <nthiebaud@gmail.com>
Tested-by: Norbert Thiebaud <nthiebaud@gmail.com>
Diffstat (limited to 'sw')
-rw-r--r-- | sw/inc/IDocumentUndoRedo.hxx | 4 | ||||
-rw-r--r-- | sw/inc/docsh.hxx | 8 | ||||
-rw-r--r-- | sw/inc/docstyle.hxx | 36 | ||||
-rw-r--r-- | sw/inc/tblafmt.hxx | 2 | ||||
-rw-r--r-- | sw/inc/undobj.hxx | 2 | ||||
-rw-r--r-- | sw/source/core/doc/tblafmt.cxx | 9 | ||||
-rw-r--r-- | sw/source/core/fields/fldbas.cxx | 20 | ||||
-rw-r--r-- | sw/source/core/fields/usrfld.cxx | 2 | ||||
-rw-r--r-- | sw/source/core/inc/SwUndoFmt.hxx | 24 | ||||
-rw-r--r-- | sw/source/core/inc/UndoManager.hxx | 16 | ||||
-rw-r--r-- | sw/source/core/table/swtable.cxx | 30 | ||||
-rw-r--r-- | sw/source/core/text/EnhancedPDFExportHelper.cxx | 2 | ||||
-rw-r--r-- | sw/source/core/undo/SwUndoFmt.cxx | 18 | ||||
-rw-r--r-- | sw/source/core/undo/docundo.cxx | 11 | ||||
-rw-r--r-- | sw/source/core/undo/undobj.cxx | 2 | ||||
-rw-r--r-- | sw/source/ui/app/docsh2.cxx | 10 | ||||
-rw-r--r-- | sw/source/ui/app/docstyle.cxx | 100 | ||||
-rw-r--r-- | sw/source/ui/dbui/dbinsdlg.cxx | 36 | ||||
-rw-r--r-- | sw/source/ui/table/tautofmt.cxx | 109 | ||||
-rw-r--r-- | sw/source/ui/uiview/viewsrch.cxx | 4 | ||||
-rw-r--r-- | sw/source/ui/utlui/numfmtlb.cxx | 6 |
21 files changed, 229 insertions, 222 deletions
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); |