Kaydet (Commit) 9eea0332 authored tarafından Matteo Casalin's avatar Matteo Casalin

String to OUString

Change-Id: I5dbb39e429ee35c47b492dc29bf172879bc32b1e
üst a38f4e61
...@@ -16,11 +16,10 @@ ...@@ -16,11 +16,10 @@
* except in compliance with the License. You may obtain a copy of * except in compliance with the License. You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0 . * the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/ */
#ifndef _FMTRUBY_HXX #ifndef FMTRUBY_HXX
#define _FMTRUBY_HXX #define FMTRUBY_HXX
#include <tools/string.hxx>
#include <svl/poolitem.hxx> #include <svl/poolitem.hxx>
class SwTxtRuby; class SwTxtRuby;
...@@ -29,15 +28,15 @@ class SW_DLLPUBLIC SwFmtRuby : public SfxPoolItem ...@@ -29,15 +28,15 @@ class SW_DLLPUBLIC SwFmtRuby : public SfxPoolItem
{ {
friend class SwTxtRuby; friend class SwTxtRuby;
String sRubyTxt; ///< The ruby txt. OUString sRubyTxt; ///< The ruby txt.
String sCharFmtName; ///< Name of the charformat. OUString sCharFmtName; ///< Name of the charformat.
SwTxtRuby* pTxtAttr; ///< The TextAttribute. SwTxtRuby* pTxtAttr; ///< The TextAttribute.
sal_uInt16 nCharFmtId; ///< PoolId of the charformat. sal_uInt16 nCharFmtId; ///< PoolId of the charformat.
sal_uInt16 nPosition; ///< Position of the Ruby-character. sal_uInt16 nPosition; ///< Position of the Ruby-character.
sal_uInt16 nAdjustment; ///< Specific adjustment of the Ruby-ch. sal_uInt16 nAdjustment; ///< Specific adjustment of the Ruby-ch.
public: public:
SwFmtRuby( const String& rRubyTxt ); SwFmtRuby( const OUString& rRubyTxt );
SwFmtRuby( const SwFmtRuby& rAttr ); SwFmtRuby( const SwFmtRuby& rAttr );
virtual ~SwFmtRuby(); virtual ~SwFmtRuby();
...@@ -62,11 +61,11 @@ public: ...@@ -62,11 +61,11 @@ public:
const SwTxtRuby* GetTxtRuby() const { return pTxtAttr; } const SwTxtRuby* GetTxtRuby() const { return pTxtAttr; }
SwTxtRuby* GetTxtRuby() { return pTxtAttr; } SwTxtRuby* GetTxtRuby() { return pTxtAttr; }
const String& GetText() const { return sRubyTxt; } OUString GetText() const { return sRubyTxt; }
void SetText( const String& rTxt ) { sRubyTxt = rTxt; } void SetText( const OUString& rTxt ) { sRubyTxt = rTxt; }
const String& GetCharFmtName() const { return sCharFmtName; } OUString GetCharFmtName() const { return sCharFmtName; }
void SetCharFmtName( const String& rNm ) { sCharFmtName = rNm; } void SetCharFmtName( const OUString& rNm ) { sCharFmtName = rNm; }
sal_uInt16 GetCharFmtId() const { return nCharFmtId; } sal_uInt16 GetCharFmtId() const { return nCharFmtId; }
void SetCharFmtId( sal_uInt16 nNew ) { nCharFmtId = nNew; } void SetCharFmtId( sal_uInt16 nNew ) { nCharFmtId = nNew; }
......
...@@ -124,7 +124,7 @@ sal_uInt16 SwDoc::SetRubyList( const SwPaM& rPam, const SwRubyList& rList, ...@@ -124,7 +124,7 @@ sal_uInt16 SwDoc::SetRubyList( const SwPaM& rPam, const SwRubyList& rList,
if( aCheckEntry.GetRubyAttr() != pEntry->GetRubyAttr() ) if( aCheckEntry.GetRubyAttr() != pEntry->GetRubyAttr() )
{ {
// set/reset the attribut // set/reset the attribut
if( pEntry->GetRubyAttr().GetText().Len() ) if( !pEntry->GetRubyAttr().GetText().isEmpty() )
{ {
InsertPoolItem( aPam, pEntry->GetRubyAttr(), 0 ); InsertPoolItem( aPam, pEntry->GetRubyAttr(), 0 );
} }
...@@ -155,7 +155,7 @@ sal_uInt16 SwDoc::SetRubyList( const SwPaM& rPam, const SwRubyList& rList, ...@@ -155,7 +155,7 @@ sal_uInt16 SwDoc::SetRubyList( const SwPaM& rPam, const SwRubyList& rList,
const SwRubyListEntry* pEntry = &rList[ nListEntry++ ]; const SwRubyListEntry* pEntry = &rList[ nListEntry++ ];
// set/reset the attribut // set/reset the attribut
if( pEntry->GetRubyAttr().GetText().Len() && if( !pEntry->GetRubyAttr().GetText().isEmpty() &&
pEntry->GetText().Len() ) pEntry->GetText().Len() )
{ {
InsertString( aPam, pEntry->GetText() ); InsertString( aPam, pEntry->GetText() );
......
...@@ -421,7 +421,7 @@ bool SwFmtINetFmt::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId ) ...@@ -421,7 +421,7 @@ bool SwFmtINetFmt::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
|* class SwFmtRuby |* class SwFmtRuby
*************************************************************************/ *************************************************************************/
SwFmtRuby::SwFmtRuby( const String& rRubyTxt ) SwFmtRuby::SwFmtRuby( const OUString& rRubyTxt )
: SfxPoolItem( RES_TXTATR_CJK_RUBY ), : SfxPoolItem( RES_TXTATR_CJK_RUBY ),
sRubyTxt( rRubyTxt ), sRubyTxt( rRubyTxt ),
pTxtAttr( 0 ), pTxtAttr( 0 ),
......
...@@ -255,7 +255,7 @@ SwCharFmt* SwTxtRuby::GetCharFmt() ...@@ -255,7 +255,7 @@ SwCharFmt* SwTxtRuby::GetCharFmt()
const SwFmtRuby& rFmt = SwTxtAttrEnd::GetRuby(); const SwFmtRuby& rFmt = SwTxtAttrEnd::GetRuby();
SwCharFmt* pRet = 0; SwCharFmt* pRet = 0;
if( rFmt.GetText().Len() ) if( !rFmt.GetText().isEmpty() )
{ {
const SwDoc* pDoc = GetTxtNode().GetDoc(); const SwDoc* pDoc = GetTxtNode().GetDoc();
const String& rStr = rFmt.GetCharFmtName(); const String& rStr = rFmt.GetCharFmtName();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment