String -> OUString

Change-Id: I1cfd68c37629b4847bad88f54d2866496bc91283
This commit is contained in:
Ivan Timofeev 2012-10-01 21:39:33 +04:00
parent 6fa4242439
commit 3c8e321204
2 changed files with 11 additions and 17 deletions

View file

@ -127,7 +127,7 @@ protected:
virtual bool CompareItem(const void *pFirstItem, const void *pSecondItem) const = 0;
virtual String GetStringItem(void *pItem) = 0;
virtual OUString GetStringItem(void *pItem) = 0;
void *GetPtr(sal_uInt16 nPos) const { return SfxPtrArr::GetObject(nPos); }
void *&GetPtr(sal_uInt16 nPos) { return SfxPtrArr::GetObject(nPos); }
@ -172,7 +172,7 @@ protected:
virtual bool CompareItem(const void *pFirstItem, const void *pSecondItem) const;
virtual String GetStringItem(void *pItem);
virtual OUString GetStringItem(void *pItem);
public:
SmFontPickList()

View file

@ -19,7 +19,6 @@
#include <sfx2/app.hxx>
#include <vcl/virdev.hxx>
#include <tools/string.hxx>
#include <tools/tenccvt.hxx>
#include <osl/thread.h>
@ -156,28 +155,23 @@ bool SmFontPickList::CompareItem(const void *pFirstItem, const void *pSecondItem
return false;
}
String SmFontPickList::GetStringItem(void *pItem)
OUString SmFontPickList::GetStringItem(void *pItem)
{
Font *pFont;
String aString;
const sal_Char *pDelim = ", ";
pFont = (Font *)pItem;
aString = pFont->GetName();
Font *pFont = (Font *)pItem;
OUStringBuffer aString(pFont->GetName());
if (IsItalic( *pFont ))
{
aString.AppendAscii( pDelim );
aString += String(SmResId(RID_FONTITALIC));
aString.append(", ");
aString.append(SM_RESSTR(RID_FONTITALIC));
}
if (IsBold( *pFont ))
{
aString.AppendAscii( pDelim );
aString += String(SmResId(RID_FONTBOLD));
aString.append(", ");
aString.append(SM_RESSTR(RID_FONTBOLD));
}
return (aString);
return aString.makeStringAndClear();
}
void SmFontPickList::Insert(const Font &rFont)
@ -213,7 +207,7 @@ void SmFontPickList::WriteTo(SmFontDialog& rDialog) const
IMPL_LINK( SmFontPickListBox, SelectHdl, ListBox *, /*pListBox*/ )
{
sal_uInt16 nPos;
String aString;
OUString aString;
nPos = GetSelectEntryPos();