summaryrefslogtreecommitdiff
path: root/svtools
diff options
context:
space:
mode:
authorJan Holesovsky <kendy@suse.cz>2012-10-17 16:04:28 +0200
committerJan Holesovsky <kendy@suse.cz>2012-10-17 16:22:31 +0200
commita4e2e50c4d6422fe49f345409b6f94cbc43d3d09 (patch)
tree1b759077d68b5a409c78e3a784987c8a8cd79733 /svtools
parenta12db69b78f9a3c681b5332ec64585cea5ade8ca (diff)
Remove the unneeded "scalable font" icon from the font combobox.
Change-Id: Ifadad736ae39dff67ad7bc499f85bfbb484826ff
Diffstat (limited to 'svtools')
-rw-r--r--svtools/inc/svtools/ctrlbox.hxx18
-rw-r--r--svtools/inc/svtools/ctrltool.hxx5
-rw-r--r--svtools/inc/svtools/svtools.hrc4
-rw-r--r--svtools/source/control/ctrlbox.cxx112
-rw-r--r--svtools/source/control/ctrlbox.src18
-rw-r--r--svtools/source/control/ctrltool.cxx24
6 files changed, 13 insertions, 168 deletions
diff --git a/svtools/inc/svtools/ctrlbox.hxx b/svtools/inc/svtools/ctrlbox.hxx
index 44117464cb76..77962c30341d 100644
--- a/svtools/inc/svtools/ctrlbox.hxx
+++ b/svtools/inc/svtools/ctrlbox.hxx
@@ -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,21 +430,15 @@ class SVT_DLLPUBLIC FontNameBox : public ComboBox
{
private:
ImplFontList* mpFontList;
- Image maImagePrinterFont;
- Image maImageBitmapFont;
- Image maImageScalableFont;
sal_Bool mbWYSIWYG;
- sal_Bool mbSymbols;
- String maFontMRUEntriesFile;
+ String maFontMRUEntriesFile;
#ifdef _CTRLBOX_CXX
SVT_DLLPRIVATE void ImplCalcUserItemSize();
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();
diff --git a/svtools/inc/svtools/ctrltool.hxx b/svtools/inc/svtools/ctrltool.hxx
index 837c29d94753..0ee133b6efe5 100644
--- a/svtools/inc/svtools/ctrltool.hxx
+++ b/svtools/inc/svtools/ctrltool.hxx
@@ -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;
diff --git a/svtools/inc/svtools/svtools.hrc b/svtools/inc/svtools/svtools.hrc
index 6988e1906c59..6b17f6208cff 100644
--- a/svtools/inc/svtools/svtools.hrc
+++ b/svtools/inc/svtools/svtools.hrc
@@ -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)
diff --git a/svtools/source/control/ctrlbox.cxx b/svtools/source/control/ctrlbox.cxx
index 1e0856f9713b..b3a095d8145b 100644
--- a/svtools/source/control/ctrlbox.cxx
+++ b/svtools/source/control/ctrlbox.cxx
@@ -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;
- }
+ 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;
- 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;
+ assert( mpFontList );
- if ( pImg )
- {
- Point aPos( nX, aTopLeft.Y() + (nH-pImg->GetSizePixel().Height())/2 );
- rUDEvt.GetDevice()->DrawImage( aPos, *pImg );
- }
+ FontInfo& rInfo = (*mpFontList)[ rUDEvt.GetItemId() ];
+ Point aTopLeft = rUDEvt.GetRect().TopLeft();
+ long nX = aTopLeft.X();
+ long nH = rUDEvt.GetRect().GetHeight();
- // X immer um gleiche Breite aendern, auch wenn kein Image ausgegeben.
- nX += maImagePrinterFont.GetSizePixel().Width();
- }
-
- if ( mbWYSIWYG && mpFontList )
+ if ( mbWYSIWYG )
{
nX += IMGOUTERTEXTSPACE;
diff --git a/svtools/source/control/ctrlbox.src b/svtools/source/control/ctrlbox.src
index b31c87505699..e1abf12905b2 100644
--- a/svtools/source/control/ctrlbox.src
+++ b/svtools/source/control/ctrlbox.src
@@ -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";
diff --git a/svtools/source/control/ctrltool.cxx b/svtools/source/control/ctrltool.cxx
index 44da6fccfc1b..f18f865dd1d6 100644
--- a/svtools/source/control/ctrltool.cxx
+++ b/svtools/source/control/ctrltool.cxx
@@ -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 );