summaryrefslogtreecommitdiff
path: root/svtools/source/control
diff options
context:
space:
mode:
Diffstat (limited to 'svtools/source/control')
-rw-r--r--svtools/source/control/ctrlbox.cxx10
-rw-r--r--svtools/source/control/ctrltool.cxx70
2 files changed, 39 insertions, 41 deletions
diff --git a/svtools/source/control/ctrlbox.cxx b/svtools/source/control/ctrlbox.cxx
index fc99145c8163..26b284d55ce0 100644
--- a/svtools/source/control/ctrlbox.cxx
+++ b/svtools/source/control/ctrlbox.cxx
@@ -1598,7 +1598,7 @@ void FontStyleBox::Fill( const XubString& rName, const FontList* pList )
sal_Handle hFontInfo = pList->GetFirstFontInfo( rName );
if ( hFontInfo )
{
- XubString aStyleText;
+ OUString aStyleText;
FontWeight eLastWeight = WEIGHT_DONTKNOW;
FontItalic eLastItalic = ITALIC_NONE;
FontWidth eLastWidth = WIDTH_DONTKNOW;
@@ -1657,11 +1657,11 @@ void FontStyleBox::Fill( const XubString& rName, const FontList* pList )
{
// If we have two names for the same attributes
// we prefer the translated standard names
- const XubString& rAttrStyleText = pList->GetStyleName( eWeight, eItalic );
- if ( rAttrStyleText != aStyleText )
+ const OUString& rAttrStyleText = pList->GetStyleName( eWeight, eItalic );
+ if (rAttrStyleText != aStyleText)
{
- XubString aTempStyleText = pList->GetStyleName( aInfo );
- if ( rAttrStyleText == aTempStyleText )
+ OUString aTempStyleText = pList->GetStyleName( aInfo );
+ if (rAttrStyleText == aTempStyleText)
aStyleText = rAttrStyleText;
bInsert = GetEntryPos( aStyleText ) == LISTBOX_ENTRY_NOTFOUND;
}
diff --git a/svtools/source/control/ctrltool.cxx b/svtools/source/control/ctrltool.cxx
index 25b68786465d..44da6fccfc1b 100644
--- a/svtools/source/control/ctrltool.cxx
+++ b/svtools/source/control/ctrltool.cxx
@@ -175,14 +175,13 @@ static void ImplMakeSearchStringFromName( XubString& rStr )
// -----------------------------------------------------------------------
-ImplFontListNameInfo* FontList::ImplFind( const XubString& rSearchName, sal_uLong* pIndex ) const
+ImplFontListNameInfo* FontList::ImplFind(const OUString& rSearchName, sal_uLong* pIndex) const
{
// Wenn kein Eintrag in der Liste oder der Eintrag groesser ist als
// der Letzte, dann hinten dranhaengen. Wir vergleichen erst mit dem
// letzten Eintrag, da die Liste von VCL auch sortiert zurueckkommt
// und somit die Wahrscheinlichkeit das hinten angehaengt werden muss
// sehr gross ist.
- StringCompare eComp;
sal_uLong nCnt = maEntries.size();
if ( !nCnt )
{
@@ -193,14 +192,14 @@ ImplFontListNameInfo* FontList::ImplFind( const XubString& rSearchName, sal_uLon
else
{
const ImplFontListNameInfo* pCmpData = &maEntries[nCnt-1];
- eComp = rSearchName.CompareTo( pCmpData->maSearchName );
- if ( eComp == COMPARE_GREATER )
+ sal_Int32 nComp = rSearchName.compareTo( pCmpData->maSearchName );
+ if (nComp > 0)
{
if ( pIndex )
*pIndex = ULONG_MAX;
return NULL;
}
- else if ( eComp == COMPARE_EQUAL )
+ else if (nComp == 0)
return const_cast<ImplFontListNameInfo*>(pCmpData);
}
@@ -215,8 +214,8 @@ ImplFontListNameInfo* FontList::ImplFind( const XubString& rSearchName, sal_uLon
{
nMid = (nLow + nHigh) / 2;
pCompareData = &maEntries[nMid];
- eComp = rSearchName.CompareTo( pCompareData->maSearchName );
- if ( eComp == COMPARE_LESS )
+ sal_Int32 nComp = rSearchName.compareTo(pCompareData->maSearchName);
+ if (nComp < 0)
{
if ( !nMid )
break;
@@ -224,7 +223,7 @@ ImplFontListNameInfo* FontList::ImplFind( const XubString& rSearchName, sal_uLon
}
else
{
- if ( eComp == COMPARE_GREATER )
+ if (nComp > 0)
nLow = nMid + 1;
else
{
@@ -237,8 +236,8 @@ ImplFontListNameInfo* FontList::ImplFind( const XubString& rSearchName, sal_uLon
if ( pIndex )
{
- eComp = rSearchName.CompareTo( pCompareData->maSearchName );
- if ( eComp == COMPARE_GREATER )
+ sal_Int32 nComp = rSearchName.compareTo(pCompareData->maSearchName);
+ if (nComp > 0)
*pIndex = (nMid+1);
else
*pIndex = nMid;
@@ -249,7 +248,7 @@ ImplFontListNameInfo* FontList::ImplFind( const XubString& rSearchName, sal_uLon
// -----------------------------------------------------------------------
-ImplFontListNameInfo* FontList::ImplFindByName( const XubString& rStr ) const
+ImplFontListNameInfo* FontList::ImplFindByName(const OUString& rStr) const
{
XubString aSearchName = rStr;
ImplMakeSearchStringFromName( aSearchName );
@@ -425,7 +424,7 @@ FontList* FontList::Clone() const
// -----------------------------------------------------------------------
-const XubString& FontList::GetStyleName( FontWeight eWeight, FontItalic eItalic ) const
+const OUString& FontList::GetStyleName(FontWeight eWeight, FontItalic eItalic) const
{
if ( eWeight > WEIGHT_BOLD )
{
@@ -466,41 +465,40 @@ const XubString& FontList::GetStyleName( FontWeight eWeight, FontItalic eItalic
// -----------------------------------------------------------------------
-XubString FontList::GetStyleName( const FontInfo& rInfo ) const
+OUString FontList::GetStyleName(const FontInfo& rInfo) const
{
- XubString aStyleName = rInfo.GetStyleName();
- FontWeight eWeight = rInfo.GetWeight();
- FontItalic eItalic = rInfo.GetItalic();
+ OUString aStyleName = rInfo.GetStyleName();
+ FontWeight eWeight = rInfo.GetWeight();
+ FontItalic eItalic = rInfo.GetItalic();
// Nur wenn kein StyleName gesetzt ist, geben wir einen syntetischen
// Namen zurueck
- if ( !aStyleName.Len() )
- aStyleName = GetStyleName( eWeight, eItalic );
+ if (aStyleName.isEmpty())
+ aStyleName = GetStyleName(eWeight, eItalic);
else
{
// Translate StyleName to localized name
- XubString aCompareStyleName = aStyleName;
- aCompareStyleName.ToLowerAscii();
+ OUString aCompareStyleName = aStyleName.toAsciiLowerCase();
aCompareStyleName = comphelper::string::remove(aCompareStyleName, ' ');
- if ( aCompareStyleName.EqualsAscii( "bold" ) )
+ if (aCompareStyleName == "bold")
aStyleName = maBold;
- else if ( aCompareStyleName.EqualsAscii( "bolditalic" ) )
+ else if (aCompareStyleName == "bolditalic")
aStyleName = maBoldItalic;
- else if ( aCompareStyleName.EqualsAscii( "italic" ) )
+ else if (aCompareStyleName == "italic")
aStyleName = maNormalItalic;
- else if ( aCompareStyleName.EqualsAscii( "standard" ) )
+ else if (aCompareStyleName == "standard")
aStyleName = maNormal;
- else if ( aCompareStyleName.EqualsAscii( "regular" ) )
+ else if (aCompareStyleName == "regular")
aStyleName = maNormal;
- else if ( aCompareStyleName.EqualsAscii( "medium" ) )
+ else if (aCompareStyleName == "medium")
aStyleName = maNormal;
- else if ( aCompareStyleName.EqualsAscii( "light" ) )
+ else if (aCompareStyleName == "light")
aStyleName = maLight;
- else if ( aCompareStyleName.EqualsAscii( "lightitalic" ) )
+ else if (aCompareStyleName == "lightitalic")
aStyleName = maLightItalic;
- else if ( aCompareStyleName.EqualsAscii( "black" ) )
+ else if (aCompareStyleName == "black")
aStyleName = maBlack;
- else if ( aCompareStyleName.EqualsAscii( "blackitalic" ) )
+ else if (aCompareStyleName == "blackitalic")
aStyleName = maBlackItalic;
// fix up StyleName, because the PS Printer driver from
@@ -544,7 +542,7 @@ namespace
}
}
-FontInfo FontList::Get( const XubString& rName, const XubString& rStyleName ) const
+FontInfo FontList::Get(const OUString& rName, const OUString& rStyleName) const
{
ImplFontListNameInfo* pData = ImplFindByName( rName );
ImplFontListFontInfo* pFontInfo = NULL;
@@ -556,7 +554,7 @@ FontInfo FontList::Get( const XubString& rName, const XubString& rStyleName ) co
pSearchInfo = pData->mpFirst;
while ( pSearchInfo )
{
- if ( rStyleName.EqualsIgnoreCaseAscii( GetStyleName( *pSearchInfo ) ) )
+ if (rStyleName.equalsIgnoreAsciiCase(GetStyleName(*pSearchInfo)))
{
pFontInfo = pSearchInfo;
break;
@@ -628,8 +626,8 @@ FontInfo FontList::Get( const XubString& rName, const XubString& rStyleName ) co
// -----------------------------------------------------------------------
-FontInfo FontList::Get( const XubString& rName,
- FontWeight eWeight, FontItalic eItalic ) const
+FontInfo FontList::Get(const OUString& rName,
+ FontWeight eWeight, FontItalic eItalic) const
{
ImplFontListNameInfo* pData = ImplFindByName( rName );
ImplFontListFontInfo* pFontInfo = NULL;
@@ -667,7 +665,7 @@ FontInfo FontList::Get( const XubString& rName,
// -----------------------------------------------------------------------
-sal_Bool FontList::IsAvailable( const XubString& rName ) const
+sal_Bool FontList::IsAvailable(const OUString& rName) const
{
return (ImplFindByName( rName ) != 0);
}
@@ -692,7 +690,7 @@ sal_uInt16 FontList::GetFontNameType( sal_uInt16 nFont ) const
// -----------------------------------------------------------------------
-sal_Handle FontList::GetFirstFontInfo( const XubString& rName ) const
+sal_Handle FontList::GetFirstFontInfo(const OUString& rName) const
{
ImplFontListNameInfo* pData = ImplFindByName( rName );
if ( !pData )