convert include/editeng/numitem.hxx from String to OUString

Change-Id: If353e9ee792d58cb7ae3a20072c7208e8f2e6ef6
This commit is contained in:
Noel Grandin 2013-09-06 16:52:32 +02:00
parent c049ec8589
commit e7c7f96b41
2 changed files with 25 additions and 26 deletions

View File

@ -419,7 +419,7 @@ void SvxNumberFormat::SetGraphicBrush( const SvxBrushItem* pBrushItem,
aGraphicSize.Width() = aGraphicSize.Height() = 0; aGraphicSize.Width() = aGraphicSize.Height() = 0;
} }
void SvxNumberFormat::SetGraphic( const String& rName ) void SvxNumberFormat::SetGraphic( const OUString& rName )
{ {
const String* pName; const String* pName;
if( pGraphicBrush && if( pGraphicBrush &&
@ -551,7 +551,7 @@ Size SvxNumberFormat::GetGraphicSizeMM100(const Graphic* pGraphic)
return aRetSize; return aRetSize;
} }
String SvxNumberFormat::CreateRomanString( sal_uLong nNo, sal_Bool bUpper ) OUString SvxNumberFormat::CreateRomanString( sal_uLong nNo, sal_Bool bUpper )
{ {
nNo %= 4000; // more can not be displayed nNo %= 4000; // more can not be displayed
// i, ii, iii, iv, v, vi, vii, vii, viii, ix // i, ii, iii, iv, v, vi, vii, vii, viii, ix
@ -560,7 +560,7 @@ String SvxNumberFormat::CreateRomanString( sal_uLong nNo, sal_Bool bUpper )
? "MDCLXVI--" // +2 Dummy entries! ? "MDCLXVI--" // +2 Dummy entries!
: "mdclxvi--"; // +2 Dummy entries! : "mdclxvi--"; // +2 Dummy entries!
String sRet; OUString sRet;
sal_uInt16 nMask = 1000; sal_uInt16 nMask = 1000;
while( nMask ) while( nMask )
{ {
@ -571,23 +571,23 @@ String SvxNumberFormat::CreateRomanString( sal_uLong nNo, sal_Bool bUpper )
if( 5 < nZahl ) if( 5 < nZahl )
{ {
if( nZahl < 9 ) if( nZahl < 9 )
sRet += sal_Unicode(*(cRomanArr-1)); sRet += OUString(*(cRomanArr-1));
++nDiff; ++nDiff;
nZahl -= 5; nZahl -= 5;
} }
switch( nZahl ) switch( nZahl )
{ {
case 3: { sRet += sal_Unicode(*cRomanArr); } case 3: { sRet += OUString(*cRomanArr); }
case 2: { sRet += sal_Unicode(*cRomanArr); } case 2: { sRet += OUString(*cRomanArr); }
case 1: { sRet += sal_Unicode(*cRomanArr); } case 1: { sRet += OUString(*cRomanArr); }
break; break;
case 4: { case 4: {
sRet += sal_Unicode(*cRomanArr); sRet += OUString(*cRomanArr);
sRet += sal_Unicode(*(cRomanArr-nDiff)); sRet += OUString(*(cRomanArr-nDiff));
} }
break; break;
case 5: { sRet += sal_Unicode(*(cRomanArr-nDiff)); } case 5: { sRet += OUString(*(cRomanArr-nDiff)); }
break; break;
} }
@ -853,9 +853,9 @@ void SvxNumRule::SetLevel(sal_uInt16 nLevel, const SvxNumberFormat* pFmt)
} }
} }
String SvxNumRule::MakeNumString( const SvxNodeNum& rNum, sal_Bool bInclStrings ) const OUString SvxNumRule::MakeNumString( const SvxNodeNum& rNum, sal_Bool bInclStrings ) const
{ {
String aStr; OUString aStr;
if( SVX_NO_NUM > rNum.GetLevel() && !( SVX_NO_NUMLEVEL & rNum.GetLevel() ) ) if( SVX_NO_NUM > rNum.GetLevel() && !( SVX_NO_NUMLEVEL & rNum.GetLevel() ) )
{ {
const SvxNumberFormat& rMyNFmt = GetLevel( rNum.GetLevel() ); const SvxNumberFormat& rMyNFmt = GetLevel( rNum.GetLevel() );
@ -893,16 +893,15 @@ String SvxNumRule::MakeNumString( const SvxNodeNum& rNum, sal_Bool bInclStrings
bDot = sal_False; bDot = sal_False;
} }
else else
aStr += sal_Unicode('0'); // all 0-levels are a 0 aStr += "0"; // all 0-levels are a 0
if( i != rNum.GetLevel() && bDot) if( i != rNum.GetLevel() && bDot)
aStr += sal_Unicode('.'); aStr += ".";
} }
} }
if( bInclStrings ) if( bInclStrings )
{ {
aStr.Insert( rMyNFmt.GetPrefix(), 0 ); aStr = rMyNFmt.GetPrefix() + aStr + rMyNFmt.GetSuffix();
aStr += rMyNFmt.GetSuffix();
} }
} }
return aStr; return aStr;

View File

@ -149,7 +149,7 @@ private:
Size aGraphicSize; // Always! in 1/100 mm Size aGraphicSize; // Always! in 1/100 mm
Font* pBulletFont; // Pointer to the bullet font Font* pBulletFont; // Pointer to the bullet font
String sCharStyleName; // Character Style OUString sCharStyleName; // Character Style
DECL_STATIC_LINK( SvxNumberFormat, GraphicArrived, void * ); DECL_STATIC_LINK( SvxNumberFormat, GraphicArrived, void * );
virtual void NotifyGraphicArrived(); virtual void NotifyGraphicArrived();
@ -175,7 +175,7 @@ public:
void SetSuffix(const OUString& rSet) { sSuffix = rSet;} void SetSuffix(const OUString& rSet) { sSuffix = rSet;}
const OUString& GetSuffix() const { return sSuffix;} const OUString& GetSuffix() const { return sSuffix;}
void SetCharFmtName(const String& rSet){ sCharStyleName = rSet; } void SetCharFmtName(const OUString& rSet){ sCharStyleName = rSet; }
virtual OUString GetCharFmtName()const; virtual OUString GetCharFmtName()const;
void SetBulletFont(const Font* pFont); void SetBulletFont(const Font* pFont);
@ -194,7 +194,7 @@ public:
virtual void SetGraphicBrush( const SvxBrushItem* pBrushItem, const Size* pSize = 0, const sal_Int16* pOrient = 0); virtual void SetGraphicBrush( const SvxBrushItem* pBrushItem, const Size* pSize = 0, const sal_Int16* pOrient = 0);
const SvxBrushItem* GetBrush() const {return pGraphicBrush;} const SvxBrushItem* GetBrush() const {return pGraphicBrush;}
void SetGraphic( const String& rName ); void SetGraphic( const OUString& rName );
virtual void SetVertOrient(sal_Int16 eSet); virtual void SetVertOrient(sal_Int16 eSet);
virtual sal_Int16 GetVertOrient() const; virtual sal_Int16 GetVertOrient() const;
void SetGraphicSize(const Size& rSet) {aGraphicSize = rSet;} void SetGraphicSize(const Size& rSet) {aGraphicSize = rSet;}
@ -222,7 +222,7 @@ public:
long GetIndentAt() const; long GetIndentAt() const;
static Size GetGraphicSizeMM100(const Graphic* pGraphic); static Size GetGraphicSizeMM100(const Graphic* pGraphic);
static String CreateRomanString( sal_uLong nNo, sal_Bool bUpper ); static OUString CreateRomanString( sal_uLong nNo, sal_Bool bUpper );
}; };
enum SvxNumRuleType enum SvxNumRuleType
@ -269,23 +269,23 @@ public:
void SetLevel(sal_uInt16 nLevel, const SvxNumberFormat& rFmt, sal_Bool bIsValid = sal_True); void SetLevel(sal_uInt16 nLevel, const SvxNumberFormat& rFmt, sal_Bool bIsValid = sal_True);
void SetLevel(sal_uInt16 nLevel, const SvxNumberFormat* pFmt); void SetLevel(sal_uInt16 nLevel, const SvxNumberFormat* pFmt);
sal_Bool IsContinuousNumbering()const sal_Bool IsContinuousNumbering()const
{return bContinuousNumbering;} {return bContinuousNumbering;}
void SetContinuousNumbering(sal_Bool bSet) void SetContinuousNumbering(sal_Bool bSet)
{bContinuousNumbering = bSet;} {bContinuousNumbering = bSet;}
sal_uInt16 GetLevelCount() const {return nLevelCount;} sal_uInt16 GetLevelCount() const {return nLevelCount;}
sal_Bool IsFeatureSupported(sal_uInt32 nFeature) const sal_Bool IsFeatureSupported(sal_uInt32 nFeature) const
{return 0 != (nFeatureFlags & nFeature);} {return 0 != (nFeatureFlags & nFeature);}
sal_uInt32 GetFeatureFlags() const {return nFeatureFlags;} sal_uInt32 GetFeatureFlags() const {return nFeatureFlags;}
void SetFeatureFlag( sal_uInt32 nFlag, sal_Bool bSet = sal_True ) { if(bSet) nFeatureFlags |= nFlag; else nFeatureFlags &= ~nFlag; } void SetFeatureFlag( sal_uInt32 nFlag, sal_Bool bSet = sal_True ) { if(bSet) nFeatureFlags |= nFlag; else nFeatureFlags &= ~nFlag; }
String MakeNumString( const SvxNodeNum&, sal_Bool bInclStrings = sal_True ) const; OUString MakeNumString( const SvxNodeNum&, sal_Bool bInclStrings = sal_True ) const;
SvxNumRuleType GetNumRuleType() const { return eNumberingType; } SvxNumRuleType GetNumRuleType() const { return eNumberingType; }
void SetNumRuleType( const SvxNumRuleType& rType ) { eNumberingType = rType; } void SetNumRuleType( const SvxNumRuleType& rType ) { eNumberingType = rType; }
sal_Bool UnLinkGraphics(); sal_Bool UnLinkGraphics();
}; };
class EDITENG_DLLPUBLIC SvxNumBulletItem : public SfxPoolItem class EDITENG_DLLPUBLIC SvxNumBulletItem : public SfxPoolItem