Kaydet (Commit) a4e2e50c authored tarafından Jan Holesovsky's avatar Jan Holesovsky

Remove the unneeded "scalable font" icon from the font combobox.

Change-Id: Ifadad736ae39dff67ad7bc499f85bfbb484826ff
üst a12db69b
......@@ -42,11 +42,10 @@
class FontList;
class ImplColorListData;
class ImpLineListData;
class ImplFontNameListData;
typedef ::std::vector< ImplColorListData* > ImpColorList;
typedef ::std::vector< ImpLineListData* > ImpLineList;
typedef ::std::vector< ImplFontNameListData* > ImplFontList;
typedef ::std::vector< FontInfo > ImplFontList;
// FIXME: STYLE_* duplicate values from editeng::SvxBorderStyle,
// which in turn duplicates values from com::sun::star::table::BorderLineStyle:
......@@ -111,9 +110,7 @@ Erlaubt die Auswahl von Fonts. Die ListBox wird mit Fill gefuellt, wo
ein Pointer auf eine FontList uebergeben werden muss.
Mit EnableWYSIWYG() kann man einstellen, das die Fontnamen in Ihrer Schrift
angezeigt werden und mit EnableSymbols() kann eingestellt werden, das
vor dem Namen ueber ein Symbol angezeigt wird, ob es sich um eine
Drucker oder Bildschirmschrift handelt.
angezeigt werden.
Querverweise
......@@ -433,11 +430,7 @@ class SVT_DLLPUBLIC FontNameBox : public ComboBox
{
private:
ImplFontList* mpFontList;
Image maImagePrinterFont;
Image maImageBitmapFont;
Image maImageScalableFont;
sal_Bool mbWYSIWYG;
sal_Bool mbSymbols;
String maFontMRUEntriesFile;
#ifdef _CTRLBOX_CXX
......@@ -445,9 +438,7 @@ private:
SVT_DLLPRIVATE void ImplDestroyFontList();
#endif
void InitBitmaps( void );
protected:
virtual void DataChanged( const DataChangedEvent& rDCEvt );
void LoadMRUEntries( const String& aFontMRUEntriesFile, xub_Unicode cSep = ';' );
void SaveMRUEntries( const String& aFontMRUEntriesFile, xub_Unicode cSep = ';' ) const;
public:
......@@ -463,9 +454,6 @@ public:
void EnableWYSIWYG( sal_Bool bEnable = sal_True );
sal_Bool IsWYSIWYGEnabled() const { return mbWYSIWYG; }
void EnableSymbols( sal_Bool bEnable = sal_True );
sal_Bool IsSymbolsEnabled() const { return mbSymbols; }
private:
void InitFontMRUEntriesFile();
......
......@@ -140,10 +140,6 @@ von der FontList, sollte deshalb das Array nicht mehr referenziert werden.
#define FONTLIST_FONTINFO_NOTFOUND ((sal_uInt16)0xFFFF)
#define FONTLIST_FONTNAMETYPE_PRINTER ((sal_uInt16)0x0001)
#define FONTLIST_FONTNAMETYPE_SCREEN ((sal_uInt16)0x0002)
#define FONTLIST_FONTNAMETYPE_SCALABLE ((sal_uInt16)0x0004)
class SVT_DLLPUBLIC FontList
{
private:
......@@ -202,7 +198,6 @@ public:
return (sal_uInt16)maEntries.size();
}
const FontInfo& GetFontName( sal_uInt16 nFont ) const;
sal_uInt16 GetFontNameType( sal_uInt16 nFont ) const;
sal_Handle GetFirstFontInfo( const OUString& rName ) const;
sal_Handle GetNextFontInfo( sal_Handle hFontInfo ) const;
const FontInfo& GetFontInfo( sal_Handle hFontInfo ) const;
......
......@@ -262,10 +262,6 @@
#define RID_IMG_TREENODE_COLLAPSED (RID_SVTOOLS_START + 0)
#define RID_IMG_TREENODE_EXPANDED (RID_SVTOOLS_START + 1)
#define RID_IMG_PRINTERFONT (RID_SVTOOLS_START + 12)
#define RID_IMG_BITMAPFONT (RID_SVTOOLS_START + 13)
#define RID_IMG_SCALABLEFONT (RID_SVTOOLS_START + 14)
#define IMG_TRIANGLE_RIGHT (RID_SVTOOLS_START + 18)
#define IMG_TRIANGLE_DOWN (RID_SVTOOLS_START + 20)
......
......@@ -58,7 +58,6 @@
#include <stdio.h>
#define IMGINNERTEXTSPACE 2
#define IMGOUTERTEXTSPACE 5
#define EXTRAFONTSIZE 5
#define GAPTOEXTRAPREVIEW 10
......@@ -1024,28 +1023,11 @@ void LineListBox::DataChanged( const DataChangedEvent& rDCEvt )
// FontNameBox
// ===================================================================
class ImplFontNameListData
{
public:
FontInfo maInfo;
sal_uInt16 mnType;
ImplFontNameListData( const FontInfo& rInfo,
sal_uInt16 nType ) :
maInfo( rInfo ),
mnType( nType )
{}
};
// -------------------------------------------------------------------
FontNameBox::FontNameBox( Window* pParent, WinBits nWinStyle ) :
ComboBox( pParent, nWinStyle )
{
InitBitmaps();
mpFontList = NULL;
mbWYSIWYG = sal_False;
mbSymbols = sal_False;
InitFontMRUEntriesFile();
}
......@@ -1054,10 +1036,8 @@ FontNameBox::FontNameBox( Window* pParent, WinBits nWinStyle ) :
FontNameBox::FontNameBox( Window* pParent, const ResId& rResId ) :
ComboBox( pParent, rResId )
{
InitBitmaps();
mpFontList = NULL;
mbWYSIWYG = sal_False;
mbSymbols = sal_False;
InitFontMRUEntriesFile();
}
......@@ -1083,16 +1063,6 @@ FontNameBox::~FontNameBox()
// -------------------------------------------------------------------
void FontNameBox::DataChanged( const DataChangedEvent& rDCEvt )
{
ComboBox::DataChanged( rDCEvt );
if( rDCEvt.GetType() == DATACHANGED_SETTINGS && ( rDCEvt.GetFlags() & SETTINGS_STYLE ) )
InitBitmaps();
}
// -------------------------------------------------------------------
void FontNameBox::SaveMRUEntries( const String& aFontMRUEntriesFile, xub_Unicode cSep ) const
{
rtl::OString aEntries(rtl::OUStringToOString(GetMRUEntries(cSep),
......@@ -1155,25 +1125,9 @@ void FontNameBox::InitFontMRUEntriesFile()
// -------------------------------------------------------------------
void FontNameBox::InitBitmaps( void )
{
maImagePrinterFont = Image( SvtResId( RID_IMG_PRINTERFONT ) );
maImageBitmapFont = Image( SvtResId( RID_IMG_BITMAPFONT ) );
maImageScalableFont = Image( SvtResId( RID_IMG_SCALABLEFONT ) );
}
// -------------------------------------------------------------------
void FontNameBox::ImplDestroyFontList()
{
if ( mpFontList )
{
for ( size_t i = 0, n = mpFontList->size(); i < n; ++i ) {
delete (*mpFontList)[ i ];
}
mpFontList->clear();
delete mpFontList;
}
}
// -------------------------------------------------------------------
......@@ -1197,14 +1151,12 @@ void FontNameBox::Fill( const FontList* pList )
sal_uLong nIndex = InsertEntry( rFontInfo.GetName() );
if ( nIndex != LISTBOX_ERROR )
{
sal_uInt16 nType = pList->GetFontNameType( i );
ImplFontNameListData* pData = new ImplFontNameListData( rFontInfo, nType );
if ( nIndex < mpFontList->size() ) {
ImplFontList::iterator it = mpFontList->begin();
::std::advance( it, nIndex );
mpFontList->insert( it, pData );
mpFontList->insert( it, rFontInfo );
} else {
mpFontList->push_back( pData );
mpFontList->push_back( rFontInfo );
}
}
}
......@@ -1228,19 +1180,7 @@ void FontNameBox::EnableWYSIWYG( sal_Bool bEnable )
if ( bEnable != mbWYSIWYG )
{
mbWYSIWYG = bEnable;
EnableUserDraw( mbWYSIWYG | mbSymbols );
ImplCalcUserItemSize();
}
}
// -------------------------------------------------------------------
void FontNameBox::EnableSymbols( sal_Bool bEnable )
{
if ( bEnable != mbSymbols )
{
mbSymbols = bEnable;
EnableUserDraw( mbWYSIWYG | mbSymbols );
EnableUserDraw( mbWYSIWYG );
ImplCalcUserItemSize();
}
}
......@@ -1256,17 +1196,6 @@ void FontNameBox::ImplCalcUserItemSize()
aUserItemSz.Height() *= 16;
aUserItemSz.Height() /= 10;
}
if ( mbSymbols )
{
Size aSz = maImageScalableFont.GetSizePixel();
aUserItemSz.Width() += aSz.Width() + IMGINNERTEXTSPACE;
if ( mbWYSIWYG && mpFontList )
aUserItemSz.Width() += IMGOUTERTEXTSPACE;
if ( aSz.Height() > aUserItemSz.Height() )
aUserItemSz.Height() = aSz.Height();
}
SetUserItemSize( aUserItemSz );
}
......@@ -1302,35 +1231,14 @@ namespace
void FontNameBox::UserDraw( const UserDrawEvent& rUDEvt )
{
ImplFontNameListData* pData = (*mpFontList)[ rUDEvt.GetItemId() ];
const FontInfo& rInfo = pData->maInfo;
sal_uInt16 nType = pData->mnType;
assert( mpFontList );
FontInfo& rInfo = (*mpFontList)[ rUDEvt.GetItemId() ];
Point aTopLeft = rUDEvt.GetRect().TopLeft();
long nX = aTopLeft.X();
long nH = rUDEvt.GetRect().GetHeight();
if ( mbSymbols )
{
nX += IMGINNERTEXTSPACE;
Image* pImg = NULL;
if ( (nType & (FONTLIST_FONTNAMETYPE_PRINTER | FONTLIST_FONTNAMETYPE_SCREEN)) == FONTLIST_FONTNAMETYPE_PRINTER )
pImg = &maImagePrinterFont;
else if ( nType & FONTLIST_FONTNAMETYPE_SCALABLE )
pImg = &maImageScalableFont;
else
pImg = &maImageBitmapFont;
if ( pImg )
{
Point aPos( nX, aTopLeft.Y() + (nH-pImg->GetSizePixel().Height())/2 );
rUDEvt.GetDevice()->DrawImage( aPos, *pImg );
}
// X immer um gleiche Breite aendern, auch wenn kein Image ausgegeben.
nX += maImagePrinterFont.GetSizePixel().Width();
}
if ( mbWYSIWYG && mpFontList )
if ( mbWYSIWYG )
{
nX += IMGOUTERTEXTSPACE;
......
......@@ -31,24 +31,6 @@
#endif
IMAGE RID_IMG_SCALABLEFONT
{
ImageBitmap = Bitmap { File = "scalfont.png" ; };
MaskColor = IMAGE_STDBTN_COLOR ;
};
IMAGE RID_IMG_PRINTERFONT
{
ImageBitmap = Bitmap { File = "prnfont.png" ; };
MaskColor = IMAGE_STDBTN_COLOR ;
};
IMAGE RID_IMG_BITMAPFONT
{
ImageBitmap = Bitmap { File = "bmpfont.png" ; };
MaskColor = IMAGE_STDBTN_COLOR ;
};
String STR_SVT_AUTOMATIC_COLOR
{
Text [ en-US ] = "Automatic";
......
......@@ -116,7 +116,6 @@ class ImplFontListNameInfo
private:
XubString maSearchName;
ImplFontListFontInfo* mpFirst;
sal_uInt16 mnType;
ImplFontListNameInfo( const XubString& rSearchName ) :
maSearchName( rSearchName )
......@@ -262,12 +261,6 @@ void FontList::ImplInsertFonts( OutputDevice* pDevice, sal_Bool bAll,
{
rtl_TextEncoding eSystemEncoding = osl_getThreadTextEncoding();
sal_uInt16 nType;
if ( pDevice->GetOutDevType() != OUTDEV_PRINTER )
nType = FONTLIST_FONTNAMETYPE_SCREEN;
else
nType = FONTLIST_FONTNAMETYPE_PRINTER;
// Alle Fonts vom Device abfragen
int n = pDevice->GetDevFontCount();
sal_uInt16 i;
......@@ -294,7 +287,6 @@ void FontList::ImplInsertFonts( OutputDevice* pDevice, sal_Bool bAll,
pData = new ImplFontListNameInfo( aSearchName );
pData->mpFirst = pNewInfo;
pNewInfo->mpNext = NULL;
pData->mnType = 0;
if (nIndex < maEntries.size())
maEntries.insert(maEntries.begin()+nIndex,pData);
......@@ -347,13 +339,6 @@ void FontList::ImplInsertFonts( OutputDevice* pDevice, sal_Bool bAll,
}
}
}
if ( pData )
{
pData->mnType |= nType;
if ( aFontInfo.GetType() != TYPE_RASTER )
pData->mnType |= FONTLIST_FONTNAMETYPE_SCALABLE;
}
}
}
......@@ -681,15 +666,6 @@ const FontInfo& FontList::GetFontName( sal_uInt16 nFont ) const
// -----------------------------------------------------------------------
sal_uInt16 FontList::GetFontNameType( sal_uInt16 nFont ) const
{
DBG_ASSERT( nFont < GetFontNameCount(), "FontList::GetFontNameType(): nFont >= Count" );
return maEntries[nFont].mnType;
}
// -----------------------------------------------------------------------
sal_Handle FontList::GetFirstFontInfo(const OUString& rName) const
{
ImplFontListNameInfo* pData = ImplFindByName( rName );
......
......@@ -747,7 +747,6 @@ void SvxFontNameBox_Impl::EnableControls_Impl()
bEnable = aFontOpt.IsFontWYSIWYGEnabled();
EnableWYSIWYG( bEnable );
EnableSymbols( bEnable );
}
// -----------------------------------------------------------------------
......
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