As per [1] and Stephan Knorr, I have removed "Show preview of fonts"
and "Show font history" from Options->View which should now always be
on. Posting the patch here for developer review and notifying
ux-advise to make sure it isn't too controversial.
[1] http://wiki.documentfoundation.org/Whiteboards/KillOptions#View
August Sodora
augsod@gmail.com
(201) 280-8138
From 9ec7a8669cb2cab74dbd942ff1bbb502d84796fc Mon Sep 17 00:00:00 2001
From: August Sodora <augsod@gmail.com>
Date: Thu, 22 Dec 2011 15:27:06 -0500
Subject: [PATCH] Remove options "Show preview of fonts" and "Show font
history"
---
cui/source/options/optgdlg.cxx | 24 +--
cui/source/options/optgdlg.hrc | 14 -
cui/source/options/optgdlg.hxx | 4 -
cui/source/options/optgdlg.src | 20 --
svtools/inc/svtools/ctrlbox.hxx | 8 -
svtools/source/control/ctrlbox.cxx | 82 ++-----
svtools/workben/svdem.cxx | 2 -
svx/source/tbxctrls/tbcontrl.cxx | 8 +-
unotools/Library_utl.mk | 1 -
unotools/Package_inc.mk | 1 -
unotools/inc/unotools/fontoptions.hxx | 138 -----------
unotools/source/config/fontoptions.cxx | 417 --------------------------------
unotools/source/config/itemholder1.cxx | 5 -
13 files changed, 27 insertions(+), 697 deletions(-)
delete mode 100644 unotools/inc/unotools/fontoptions.hxx
delete mode 100644 unotools/source/config/fontoptions.cxx
diff --git a/cui/source/options/optgdlg.cxx b/cui/source/options/optgdlg.cxx
index bc86de6..ab200e1 100644
--- a/cui/source/options/optgdlg.cxx
+++ b/cui/source/options/optgdlg.cxx
@@ -742,9 +742,6 @@ OfaViewTabPage::OfaViewTabPage(Window* pParent, const SfxItemSet& rSet ) :
aMenuFL ( this, CUI_RES( FL_MENU ) ),
aMenuIconsFT ( this, CUI_RES( FT_MENU_ICONS )),
aMenuIconsLB ( this, CUI_RES( LB_MENU_ICONS )),
- aFontListsFL ( this, CUI_RES( FL_FONTLISTS) ),
- aFontShowCB ( this, CUI_RES( CB_FONT_SHOW ) ),
- aFontHistoryCB ( this, CUI_RES( CB_FONT_HISTORY ) ),
aRenderingFL ( this, CUI_RES( FL_RENDERING ) ),
aUseHardwareAccell ( this, CUI_RES( CB_USE_HARDACCELL ) ),
aUseAntiAliase ( this, CUI_RES( CB_USE_ANTIALIASE ) ),
@@ -802,8 +799,7 @@ OfaViewTabPage::OfaViewTabPage(Window* pParent, const SfxItemSet& rSet ) :
// (in the resource, the coordinates are calculated for the AA options beeing present)
Control* pMiscOptions[] =
{
- &aMenuFL, &aMenuIconsFT, &aMenuIconsLB,
- &aFontListsFL, &aFontShowCB, &aFontHistoryCB
+ &aMenuFL, &aMenuIconsFT, &aMenuIconsLB
};
// temporaryly create the checkbox for the anti aliasing (we need to to determine it's pos)
@@ -916,7 +912,6 @@ SfxTabPage* OfaViewTabPage::Create( Window* pParent, const SfxItemSet& rAttrSet
sal_Bool OfaViewTabPage::FillItemSet( SfxItemSet& )
{
- SvtFontOptions aFontOpt;
SvtMenuOptions aMenuOpt;
SvtStartOptions aStartOpt;
@@ -1007,12 +1002,6 @@ sal_Bool OfaViewTabPage::FillItemSet( SfxItemSet& )
}
#endif
- if ( aFontShowCB.IsChecked() != aFontShowCB.GetSavedValue() )
- {
- aFontOpt.EnableFontWYSIWYG( aFontShowCB.IsChecked() );
- bModified = sal_True;
- }
-
if(aMenuIconsLB.GetSelectEntryPos() != aMenuIconsLB.GetSavedValue())
{
aMenuOpt.SetMenuIconsState( aMenuIconsLB.GetSelectEntryPos() == 0 ? 2 :
aMenuIconsLB.GetSelectEntryPos() - 1);
@@ -1021,12 +1010,6 @@ sal_Bool OfaViewTabPage::FillItemSet( SfxItemSet& )
bAppearanceChanged = sal_True;
}
- if ( aFontHistoryCB.IsChecked() != aFontHistoryCB.GetSavedValue() )
- {
- aFontOpt.EnableFontHistory( aFontHistoryCB.IsChecked() );
- bModified = sal_True;
- }
-
// #i95644# if disabled, do not use value, see in ::Reset()
if(aUseHardwareAccell.IsEnabled())
{
@@ -1149,12 +1132,9 @@ void OfaViewTabPage::Reset( const SfxItemSet& )
#endif
// WorkingSet
- SvtFontOptions aFontOpt;
- aFontShowCB.Check( aFontOpt.IsFontWYSIWYGEnabled() );
SvtMenuOptions aMenuOpt;
aMenuIconsLB.SelectEntryPos(aMenuOpt.GetMenuIconsState() == 2 ? 0 :
aMenuOpt.GetMenuIconsState() + 1);
aMenuIconsLB.SaveValue();
- aFontHistoryCB.Check( aFontOpt.IsFontHistoryEnabled() );
{ // #i95644# HW accel (unified to disable mechanism)
if(pCanvasSettings->IsHardwareAccelerationAvailable())
@@ -1209,8 +1189,6 @@ void OfaViewTabPage::Reset( const SfxItemSet& )
aFontAntiAliasing.SaveValue();
aAAPointLimit.SaveValue();
#endif
- aFontShowCB.SaveValue();
- aFontHistoryCB.SaveValue();
#if defined( UNX )
LINK( this, OfaViewTabPage, OnAntialiasingToggled ).Call( NULL );
diff --git a/cui/source/options/optgdlg.hrc b/cui/source/options/optgdlg.hrc
index 5e54e0b..a94d3fd 100644
--- a/cui/source/options/optgdlg.hrc
+++ b/cui/source/options/optgdlg.hrc
@@ -82,10 +82,6 @@
#define ROW_FT_MENU_ICONS (ROW_FL_MENU + RSC_CD_FIXEDLINE_HEIGHT + ROWSPACE)
#define ROW_LB_MENU_ICONS (ROW_FT_MENU_ICONS + RSC_CD_FIXEDLINE_HEIGHT + ROWSPACE)
-#define ROW_FL_FONTLISTS (ROW_LB_MENU_ICONS + RSC_CD_CHECKBOX_HEIGHT + RSC_SP_FLGR_SPACE_X)
-#define ROW_CB_FONT_SHOW (ROW_FL_FONTLISTS + RSC_CD_FIXEDLINE_HEIGHT + ROWSPACE)
-#define ROW_CB_FONT_HISTORY (ROW_CB_FONT_SHOW + RSC_CD_CHECKBOX_HEIGHT + ROWSPACE)
-
// #i95644# start on top with rendering section
#define ROW_FL_RENDERING (3)
#define ROW_CB_USE_HARDACCELL (ROW_FL_RENDERING + RSC_CD_FIXEDLINE_HEIGHT + ROWSPACE)
@@ -114,12 +110,6 @@
#define FT_EXPERIMENTAL 17
#define CB_EXPERIMENTAL 18
-//#define FL_FILEDLG 20
-//#define CB_FILEDLG 21
-
-//#define FL_DOCSTATUS 30
-//#define CB_DOCSTATUS 31
-
#define FL_TWOFIGURE 40
#define FT_INTERPRET 41
#define NF_YEARVALUE 42
@@ -143,7 +133,6 @@
#define FT_MENU_ICONS 40
#define LB_MENU_ICONS 41
#define FL_MENU 42
-#define FL_FONTLISTS 43
#define LB_ICONSIZE 54
#define FT_ICONSIZESTYLE 55
@@ -151,9 +140,6 @@
#define CB_SYSTEM_FONT 57
#define STR_ICONSIZE 58
-#define CB_FONT_SHOW 60
-#define CB_FONT_HISTORY 62
-
#define CB_FONTANTIALIASING 63
#define NF_AA_POINTLIMIT 64
#define FT_POINTLIMIT_LABEL 65
diff --git a/cui/source/options/optgdlg.hxx b/cui/source/options/optgdlg.hxx
index d875100..a21f9cd 100644
--- a/cui/source/options/optgdlg.hxx
+++ b/cui/source/options/optgdlg.hxx
@@ -120,10 +120,6 @@ private:
FixedText aMenuIconsFT;
ListBox aMenuIconsLB;
- FixedLine aFontListsFL;
- CheckBox aFontShowCB;
- CheckBox aFontHistoryCB;
-
FixedLine aRenderingFL;
CheckBox aUseHardwareAccell;
CheckBox aUseAntiAliase;
diff --git a/cui/source/options/optgdlg.src b/cui/source/options/optgdlg.src
index 1f26e3e..a4a308b 100644
--- a/cui/source/options/optgdlg.src
+++ b/cui/source/options/optgdlg.src
@@ -353,26 +353,6 @@ TabPage OFA_TP_VIEW
< "Show" ; > ;
};
};
- FixedLine FL_FONTLISTS
- {
- Pos = MAP_APPFONT ( 6, ROW_FL_FONTLISTS ) ;
- Size = MAP_APPFONT ( 120 , 8 ) ;
- Text [ en-US ] = "Font Lists" ;
- };
- CheckBox CB_FONT_SHOW
- {
- HelpID = "cui:CheckBox:OFA_TP_VIEW:CB_FONT_SHOW";
- Pos = MAP_APPFONT ( 12, ROW_CB_FONT_SHOW ) ;
- Size = MAP_APPFONT ( 118 , RSC_CD_CHECKBOX_HEIGHT ) ;
- Text [ en-US ] = "Show p~review of fonts" ;
- };
- CheckBox CB_FONT_HISTORY
- {
- HelpID = "cui:CheckBox:OFA_TP_VIEW:CB_FONT_HISTORY";
- Pos = MAP_APPFONT ( 12, ROW_CB_FONT_HISTORY ) ;
- Size = MAP_APPFONT ( 118 , RSC_CD_CHECKBOX_HEIGHT ) ;
- Text [ en-US ] = "Show font h~istory" ;
- };
FixedLine FL_RENDERING
{
Pos = MAP_APPFONT ( 133 , ROW_FL_RENDERING ) ;
diff --git a/svtools/inc/svtools/ctrlbox.hxx b/svtools/inc/svtools/ctrlbox.hxx
index 5815719..ec6e216 100644
--- a/svtools/inc/svtools/ctrlbox.hxx
+++ b/svtools/inc/svtools/ctrlbox.hxx
@@ -465,8 +465,6 @@ private:
Image maImagePrinterFont;
Image maImageBitmapFont;
Image maImageScalableFont;
- sal_Bool mbWYSIWYG;
- sal_Bool mbSymbols;
String maFontMRUEntriesFile;
#ifdef _CTRLBOX_CXX
@@ -489,12 +487,6 @@ public:
void Fill( const FontList* pList );
- 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/source/control/ctrlbox.cxx b/svtools/source/control/ctrlbox.cxx
index cf7df79..e124748 100644
--- a/svtools/source/control/ctrlbox.cxx
+++ b/svtools/source/control/ctrlbox.cxx
@@ -1016,8 +1016,6 @@ FontNameBox::FontNameBox( Window* pParent, WinBits nWinStyle ) :
{
InitBitmaps();
mpFontList = NULL;
- mbWYSIWYG = sal_False;
- mbSymbols = sal_False;
InitFontMRUEntriesFile();
}
@@ -1028,8 +1026,6 @@ FontNameBox::FontNameBox( Window* pParent, const ResId& rResId ) :
{
InitBitmaps();
mpFontList = NULL;
- mbWYSIWYG = sal_False;
- mbSymbols = sal_False;
InitFontMRUEntriesFile();
}
@@ -1183,50 +1179,25 @@ void FontNameBox::Fill( const FontList* pList )
// -------------------------------------------------------------------
-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 );
- ImplCalcUserItemSize();
- }
-}
-
-// -------------------------------------------------------------------
-
void FontNameBox::ImplCalcUserItemSize()
{
Size aUserItemSz;
- if ( mbWYSIWYG && mpFontList )
+ if ( mpFontList )
{
aUserItemSz = Size(MAXPREVIEWWIDTH, GetTextHeight() );
aUserItemSz.Height() *= 16;
aUserItemSz.Height() /= 10;
}
- if ( mbSymbols )
- {
- Size aSz = maImageScalableFont.GetSizePixel();
- aUserItemSz.Width() += aSz.Width() + IMGINNERTEXTSPACE;
- if ( mbWYSIWYG && mpFontList )
- aUserItemSz.Width() += IMGOUTERTEXTSPACE;
+ Size aSz = maImageScalableFont.GetSizePixel();
+ aUserItemSz.Width() += aSz.Width() + IMGINNERTEXTSPACE;
+
+ if ( mpFontList )
+ aUserItemSz.Width() += IMGOUTERTEXTSPACE;
+
+ if ( aSz.Height() > aUserItemSz.Height() )
+ aUserItemSz.Height() = aSz.Height();
- if ( aSz.Height() > aUserItemSz.Height() )
- aUserItemSz.Height() = aSz.Height();
- }
SetUserItemSize( aUserItemSz );
}
@@ -1269,28 +1240,25 @@ void FontNameBox::UserDraw( const UserDrawEvent& rUDEvt )
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 );
- }
+ 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;
- // X immer um gleiche Breite aendern, auch wenn kein Image ausgegeben.
- nX += maImagePrinterFont.GetSizePixel().Width();
+ if ( pImg )
+ {
+ Point aPos( nX, aTopLeft.Y() + (nH-pImg->GetSizePixel().Height())/2 );
+ rUDEvt.GetDevice()->DrawImage( aPos, *pImg );
}
- if ( mbWYSIWYG && mpFontList )
+ // X immer um gleiche Breite aendern, auch wenn kein Image ausgegeben.
+ nX += maImagePrinterFont.GetSizePixel().Width();
+
+ if ( mpFontList )
{
nX += IMGOUTERTEXTSPACE;
diff --git a/svtools/workben/svdem.cxx b/svtools/workben/svdem.cxx
index 776f67e..e4d1a02 100644
--- a/svtools/workben/svdem.cxx
+++ b/svtools/workben/svdem.cxx
@@ -351,8 +351,6 @@ MyFontDialog::MyFontDialog( Window* pParent ) :
{
pList = NULL;
- aFontBox.EnableWYSIWYG( sal_True );
- aFontBox.EnableSymbols( sal_True );
aFontBox.SetPosSizePixel( Point( 10, 10 ), Size( 140, 140 ) );
aFontBox.SetSelectHdl( LINK( this, MyFontDialog, SelectFont ) );
aFontBox.SetLoseFocusHdl( LINK( this, MyFontDialog, SelectFont ) );
diff --git a/svx/source/tbxctrls/tbcontrl.cxx b/svx/source/tbxctrls/tbcontrl.cxx
index b5c50a5..80048b6 100644
--- a/svx/source/tbxctrls/tbcontrl.cxx
+++ b/svx/source/tbxctrls/tbcontrl.cxx
@@ -748,9 +748,7 @@ void SvxFontNameBox_Impl::ReleaseFocus_Impl()
void SvxFontNameBox_Impl::EnableControls_Impl()
{
- SvtFontOptions aFontOpt;
- sal_Bool bEnable = aFontOpt.IsFontHistoryEnabled();
- sal_uInt16 nEntries = bEnable ? MAX_MRU_FONTNAME_ENTRIES : 0;
+ sal_uInt16 nEntries = MAX_MRU_FONTNAME_ENTRIES;
if ( GetMaxMRUCount() != nEntries )
{
// refill in the next GetFocus-Handler
@@ -758,10 +756,6 @@ void SvxFontNameBox_Impl::EnableControls_Impl()
Clear();
SetMaxMRUCount( nEntries );
}
-
- bEnable = aFontOpt.IsFontWYSIWYGEnabled();
- EnableWYSIWYG( bEnable );
- EnableSymbols( bEnable );
}
// -----------------------------------------------------------------------
diff --git a/unotools/Library_utl.mk b/unotools/Library_utl.mk
index 0157145..3e19a27 100644
--- a/unotools/Library_utl.mk
+++ b/unotools/Library_utl.mk
@@ -90,7 +90,6 @@ $(eval $(call gb_Library_add_exception_objects,utl,\
unotools/source/config/extendedsecurityoptions \
unotools/source/config/fltrcfg \
unotools/source/config/fontcfg \
- unotools/source/config/fontoptions \
unotools/source/config/historyoptions \
unotools/source/config/inetoptions \
unotools/source/config/internaloptions \
diff --git a/unotools/Package_inc.mk b/unotools/Package_inc.mk
index 7d031fb..d9e3277 100644
--- a/unotools/Package_inc.mk
+++ b/unotools/Package_inc.mk
@@ -60,7 +60,6 @@ $(eval $(call gb_Package_add_file,unotools_inc,inc/unotools/fltrcfg.hxx,unotools
$(eval $(call gb_Package_add_file,unotools_inc,inc/unotools/fontcfg.hxx,unotools/fontcfg.hxx))
$(eval $(call gb_Package_add_file,unotools_inc,inc/unotools/fontcvt.hxx,unotools/fontcvt.hxx))
$(eval $(call gb_Package_add_file,unotools_inc,inc/unotools/fontdefs.hxx,unotools/fontdefs.hxx))
-$(eval $(call
gb_Package_add_file,unotools_inc,inc/unotools/fontoptions.hxx,unotools/fontoptions.hxx))
$(eval $(call
gb_Package_add_file,unotools_inc,inc/unotools/historyoptions_const.hxx,unotools/historyoptions_const.hxx))
$(eval $(call
gb_Package_add_file,unotools_inc,inc/unotools/historyoptions.hxx,unotools/historyoptions.hxx))
$(eval $(call gb_Package_add_file,unotools_inc,inc/unotools/idhelper.hxx,unotools/idhelper.hxx))
diff --git a/unotools/inc/unotools/fontoptions.hxx b/unotools/inc/unotools/fontoptions.hxx
deleted file mode 100644
index 171ae04..0000000
--- a/unotools/inc/unotools/fontoptions.hxx
+++ /dev/null
@@ -1,138 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef INCLUDED_unotools_FONTOPTIONS_HXX
-#define INCLUDED_unotools_FONTOPTIONS_HXX
-
-#include "unotools/unotoolsdllapi.h"
-#include <sal/types.h>
-#include <osl/mutex.hxx>
-#include <rtl/ustring.hxx>
-#include <unotools/options.hxx>
-
-/*-************************************************************************************************************//**
- @short forward declaration to our private date container implementation
- @descr We use these class as internal member to support small memory requirements.
- You can create the container if it is neccessary. The class which use these
mechanism
- is faster and smaller then a complete implementation!
-*//*-*************************************************************************************************************/
-
-class SvtFontOptions_Impl;
-
-/*-************************************************************************************************************//**
- @short collect informations about font features
- @descr -
-
- @implements -
- @base -
-
- @devstatus ready to use
-*//*-*************************************************************************************************************/
-
-class UNOTOOLS_DLLPUBLIC SvtFontOptions: public utl::detail::Options
-{
- public:
-
/*-****************************************************************************************************//**
- @short standard constructor and destructor
- @descr This will initialize an instance with default values.
- We implement these class with a refcount mechanism! Every instance of this
class increase it
- at create and decrease it at delete time - but all instances use the same
data container!
- He is implemented as a static member ...
-
- @seealso member m_nRefCount
- @seealso member m_pDataContainer
-
- @param -
- @return -
-
- @onerror -
-
*//*-*****************************************************************************************************/
-
- SvtFontOptions();
- virtual ~SvtFontOptions();
-
-
/*-****************************************************************************************************//**
- @short interface methods to get and set value of config key
"org.openoffice.Office.Common/Font"
- @descr These values defines different states of font handling.
-
- ..ReplacementTable..() => Determines if the list of font replacements is
applied or not.
-
- ..FontHistory..() => The last 5 fonts will be shown and the last
one will be the
- first name on the list. These will be
displayed in the Font name
- combo box on the Object bar.
-
- ..FontWYSIWYG..() => With this option the names of the selectable
fonts
- (for example, the fonts in the Font field in
the object bar)
- will be formatted as the current font.
-
- @seealso -
-
- @param -
- @return -
-
- @onerror No error should occurre!
-
*//*-*****************************************************************************************************/
-
- sal_Bool IsFontHistoryEnabled ( ) const ;
- void EnableFontHistory ( sal_Bool bState ) ;
-
- sal_Bool IsFontWYSIWYGEnabled ( ) const ;
- void EnableFontWYSIWYG ( sal_Bool bState ) ;
- private:
-
-
/*-****************************************************************************************************//**
- @short return a reference to a static mutex
- @descr These class use his own static mutex to be threadsafe.
- We create a static mutex only for one ime and use at different times.
-
- @seealso -
-
- @param -
- @return A reference to a static mutex member.
-
- @onerror -
-
*//*-*****************************************************************************************************/
-
- UNOTOOLS_DLLPRIVATE static ::osl::Mutex& impl_GetOwnStaticMutex();
- private:
-
- /*Attention
-
- Don't initialize these static member in these header!
- a) Double dfined symbols will be detected ...
- b) and unresolved externals exist at linking time.
- Do it in your source only.
- */
-
- static SvtFontOptions_Impl* m_pDataContainer ; /// impl. data container as
dynamic pointer for smaller memory requirements!
- static sal_Int32 m_nRefCount ; /// internal ref count
mechanism
-
-}; // class SvtFontOptions
-
-#endif // #ifndef INCLUDED_unotools_FONTOPTIONS_HXX
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/unotools/source/config/fontoptions.cxx b/unotools/source/config/fontoptions.cxx
deleted file mode 100644
index d4b5260..0000000
--- a/unotools/source/config/fontoptions.cxx
+++ /dev/null
@@ -1,417 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-
-#include <unotools/fontoptions.hxx>
-#include <unotools/configmgr.hxx>
-#include <unotools/configitem.hxx>
-#include <tools/debug.hxx>
-#include <com/sun/star/uno/Any.hxx>
-#include <com/sun/star/uno/Sequence.hxx>
-
-#include <rtl/logfile.hxx>
-#include <rtl/instance.hxx>
-#include "itemholder1.hxx"
-
-using namespace ::utl ;
-using namespace ::rtl ;
-using namespace ::osl ;
-using namespace ::com::sun::star::uno ;
-
-#define ROOTNODE_FONT
OUString(RTL_CONSTASCII_USTRINGPARAM("Office.Common/Font" ))
-
-#define PROPERTYNAME_REPLACEMENTTABLE
OUString(RTL_CONSTASCII_USTRINGPARAM("Substitution/Replacement" ))
-#define PROPERTYNAME_FONTHISTORY OUString(RTL_CONSTASCII_USTRINGPARAM("View/History"
))
-#define PROPERTYNAME_FONTWYSIWYG
OUString(RTL_CONSTASCII_USTRINGPARAM("View/ShowFontBoxWYSIWYG" ))
-
-#define PROPERTYHANDLE_REPLACEMENTTABLE 0
-#define PROPERTYHANDLE_FONTHISTORY 1
-#define PROPERTYHANDLE_FONTWYSIWYG 2
-
-#define PROPERTYCOUNT 3
-
-class SvtFontOptions_Impl : public ConfigItem
-{
- public:
-
- SvtFontOptions_Impl();
- ~SvtFontOptions_Impl();
-
-
/*-****************************************************************************************************//**
- @short called for notify of configmanager
- @descr These method is called from the ConfigManager before application ends or
from the
- PropertyChangeListener if the sub tree broadcasts changes. You must
update your
- internal values.
-
- @seealso baseclass ConfigItem
-
- @param "seqPropertyNames" is the list of properties which should be updated.
- @return -
-
- @onerror -
-
*//*-*****************************************************************************************************/
-
- virtual void Notify( const Sequence< OUString >& seqPropertyNames );
-
-
/*-****************************************************************************************************//**
- @short write changes to configuration
- @descr These method writes the changed values into the sub tree
- and should always called in our destructor to guarantee consistency of
config data.
-
- @seealso baseclass ConfigItem
-
- @param -
- @return -
-
- @onerror -
-
*//*-*****************************************************************************************************/
-
- virtual void Commit();
-
-
/*-****************************************************************************************************//**
- @short access method to get internal values
- @descr These method give us a chance to regulate acces to ouer internal values.
- It's not used in the moment - but it's possible for the feature!
-
- @seealso -
-
- @param -
- @return -
-
- @onerror -
-
*//*-*****************************************************************************************************/
-
- sal_Bool IsFontHistoryEnabled ( ) const ;
- void EnableFontHistory ( sal_Bool bState ) ;
-
- sal_Bool IsFontWYSIWYGEnabled ( ) const ;
- void EnableFontWYSIWYG ( sal_Bool bState ) ;
-
- private:
-
-
/*-****************************************************************************************************//**
- @short return list of key names of ouer configuration management which represent
oue module tree
- @descr These methods return a static const list of key names. We need it to get
needed values from our
- configuration management.
-
- @seealso -
-
- @param -
- @return A list of needed configuration keys is returned.
-
- @onerror -
-
*//*-*****************************************************************************************************/
-
- static Sequence< OUString > impl_GetPropertyNames();
-
- private:
-
- sal_Bool m_bReplacementTable ;
- sal_Bool m_bFontHistory ;
- sal_Bool m_bFontWYSIWYG ;
-};
-
-//*****************************************************************************************************************
-// constructor
-//*****************************************************************************************************************
-SvtFontOptions_Impl::SvtFontOptions_Impl()
- // Init baseclasses first
- : ConfigItem ( ROOTNODE_FONT )
- // Init member then.
- , m_bReplacementTable ( sal_False )
- , m_bFontHistory ( sal_False )
- , m_bFontWYSIWYG ( sal_False )
-{
- // Use our static list of configuration keys to get his values.
- Sequence< OUString > seqNames = impl_GetPropertyNames ( );
- Sequence< Any > seqValues = GetProperties ( seqNames );
-
- // Safe impossible cases.
- // We need values from ALL configuration keys.
- // Follow assignment use order of values in relation to our list of key names!
- DBG_ASSERT( !(seqNames.getLength()!=seqValues.getLength()),
"SvtFontOptions_Impl::SvtFontOptions_Impl()\nI miss some values of configuration keys!\n" );
-
- // Copy values from list in right order to ouer internal member.
- sal_Int32 nPropertyCount = seqValues.getLength();
- for( sal_Int32 nProperty=0; nProperty<nPropertyCount; ++nProperty )
- {
- // Safe impossible cases.
- // Check any for valid value.
- DBG_ASSERT( !(seqValues[nProperty].hasValue()==sal_False),
"SvtFontOptions_Impl::SvtFontOptions_Impl()\nInvalid property value detected!\n" );
- switch( nProperty )
- {
- case PROPERTYHANDLE_REPLACEMENTTABLE : {
-
DBG_ASSERT(!(seqValues[nProperty].getValueTypeClass()!=TypeClass_BOOLEAN),
"SvtFontOptions_Impl::SvtFontOptions_Impl()\nWho has changed the value type of
\"Office.Common\\Font\\Substitution\\Replacement\"?" );
- seqValues[nProperty] >>=
m_bReplacementTable;
- }
- break;
- case PROPERTYHANDLE_FONTHISTORY : {
-
DBG_ASSERT(!(seqValues[nProperty].getValueTypeClass()!=TypeClass_BOOLEAN),
"SvtFontOptions_Impl::SvtFontOptions_Impl()\nWho has changed the value type of
\"Office.Common\\Font\\View\\History\"?" );
- seqValues[nProperty] >>=
m_bFontHistory;
- }
- break;
- case PROPERTYHANDLE_FONTWYSIWYG : {
-
DBG_ASSERT(!(seqValues[nProperty].getValueTypeClass()!=TypeClass_BOOLEAN),
"SvtFontOptions_Impl::SvtFontOptions_Impl()\nWho has changed the value type of
\"Office.Common\\Font\\View\\ShowFontBoxWYSIWYG\"?" );
- seqValues[nProperty] >>=
m_bFontWYSIWYG;
- }
- break;
- }
- }
-
- // Enable notification mechanism of ouer baseclass.
- // We need it to get information about changes outside these class on ouer used configuration
keys!
- EnableNotification( seqNames );
-}
-
-//*****************************************************************************************************************
-// destructor
-//*****************************************************************************************************************
-SvtFontOptions_Impl::~SvtFontOptions_Impl()
-{
- // We must save our current values .. if user forget it!
- if( IsModified() == sal_True )
- {
- Commit();
- }
-}
-
-//*****************************************************************************************************************
-// public method
-//*****************************************************************************************************************
-void SvtFontOptions_Impl::Notify( const Sequence< OUString >& seqPropertyNames )
-{
- // Use given list of updated properties to get his values from configuration directly!
- Sequence< Any > seqValues = GetProperties( seqPropertyNames );
- // Safe impossible cases.
- // We need values from ALL notified configuration keys.
- DBG_ASSERT( !(seqPropertyNames.getLength()!=seqValues.getLength()),
"SvtFontOptions_Impl::Notify()\nI miss some values of configuration keys!\n" );
- // Step over list of property names and get right value from coreesponding value list to set
it on internal members!
- sal_Int32 nCount = seqPropertyNames.getLength();
- for( sal_Int32 nProperty=0; nProperty<nCount; ++nProperty )
- {
- if( seqPropertyNames[nProperty] == PROPERTYNAME_REPLACEMENTTABLE )
- {
- DBG_ASSERT(!(seqValues[nProperty].getValueTypeClass()!=TypeClass_BOOLEAN),
"SvtFontOptions_Impl::Notify()\nWho has changed the value type of
\"Office.Common\\Font\\Substitution\\Replacement\"?" );
- seqValues[nProperty] >>= m_bReplacementTable;
- }
- else
- if( seqPropertyNames[nProperty] == PROPERTYNAME_FONTHISTORY )
- {
- DBG_ASSERT(!(seqValues[nProperty].getValueTypeClass()!=TypeClass_BOOLEAN),
"SvtFontOptions_Impl::Notify()\nWho has changed the value type of
\"Office.Common\\Font\\View\\History\"?" );
- seqValues[nProperty] >>= m_bFontHistory;
- }
- else
- if( seqPropertyNames[nProperty] == PROPERTYNAME_FONTWYSIWYG )
- {
- DBG_ASSERT(!(seqValues[nProperty].getValueTypeClass()!=TypeClass_BOOLEAN),
"SvtFontOptions_Impl::Notify()\nWho has changed the value type of
\"Office.Common\\Font\\View\\ShowFontBoxWYSIWYG\"?" );
- seqValues[nProperty] >>= m_bFontWYSIWYG;
- }
- #if OSL_DEBUG_LEVEL > 1
- else DBG_ASSERT( sal_False, "SvtFontOptions_Impl::Notify()\nUnkown property detected ... I
can't handle these!\n" );
- #endif
- }
-}
-
-//*****************************************************************************************************************
-// public method
-//*****************************************************************************************************************
-void SvtFontOptions_Impl::Commit()
-{
- // Get names of supported properties, create a list for values and copy current values to it.
- Sequence< OUString > seqNames = impl_GetPropertyNames();
- sal_Int32 nCount = seqNames.getLength();
- Sequence< Any > seqValues ( nCount );
- for( sal_Int32 nProperty=0; nProperty<nCount; ++nProperty )
- {
- switch( nProperty )
- {
- case PROPERTYHANDLE_REPLACEMENTTABLE : {
- seqValues[nProperty] <<=
m_bReplacementTable;
- }
- break;
- case PROPERTYHANDLE_FONTHISTORY : {
- seqValues[nProperty] <<=
m_bFontHistory;
- }
- break;
- case PROPERTYHANDLE_FONTWYSIWYG : {
- seqValues[nProperty] <<=
m_bFontWYSIWYG;
- }
- break;
- }
- }
- // Set properties in configuration.
- PutProperties( seqNames, seqValues );
-}
-
-//*****************************************************************************************************************
-// public method
-//*****************************************************************************************************************
-sal_Bool SvtFontOptions_Impl::IsFontHistoryEnabled() const
-{
- return m_bFontHistory;
-}
-
-//*****************************************************************************************************************
-// public method
-//*****************************************************************************************************************
-void SvtFontOptions_Impl::EnableFontHistory( sal_Bool bState )
-{
- m_bFontHistory = bState;
- SetModified();
-}
-
-//*****************************************************************************************************************
-// public method
-//*****************************************************************************************************************
-sal_Bool SvtFontOptions_Impl::IsFontWYSIWYGEnabled() const
-{
- return m_bFontWYSIWYG;
-}
-
-//*****************************************************************************************************************
-// public method
-//*****************************************************************************************************************
-void SvtFontOptions_Impl::EnableFontWYSIWYG( sal_Bool bState )
-{
- m_bFontWYSIWYG = bState;
- SetModified();
-}
-
-//*****************************************************************************************************************
-// private method
-//*****************************************************************************************************************
-Sequence< OUString > SvtFontOptions_Impl::impl_GetPropertyNames()
-{
- // Build list of configuration key names.
- const OUString pProperties[] =
- {
- PROPERTYNAME_REPLACEMENTTABLE ,
- PROPERTYNAME_FONTHISTORY ,
- PROPERTYNAME_FONTWYSIWYG ,
- };
- // Initialize return sequence with these list ...
- const Sequence< OUString > seqPropertyNames( pProperties, PROPERTYCOUNT );
- // ... and return it.
- return seqPropertyNames;
-}
-
-//*****************************************************************************************************************
-// initialize static member
-// DON'T DO IT IN YOUR HEADER!
-// see definition for further informations
-//*****************************************************************************************************************
-SvtFontOptions_Impl* SvtFontOptions::m_pDataContainer = NULL ;
-sal_Int32 SvtFontOptions::m_nRefCount = 0 ;
-
-//*****************************************************************************************************************
-// constructor
-//*****************************************************************************************************************
-SvtFontOptions::SvtFontOptions()
-{
- // Global access, must be guarded (multithreading!).
- MutexGuard aGuard( impl_GetOwnStaticMutex() );
- // Increase ouer refcount ...
- ++m_nRefCount;
- // ... and initialize ouer data container only if it not already exist!
- if( m_pDataContainer == NULL )
- {
- RTL_LOGFILE_CONTEXT(aLog, "unotools ( ??? ) ::SvtFontOptions_Impl::ctor()");
- m_pDataContainer = new SvtFontOptions_Impl;
-
- ItemHolder1::holdConfigItem(E_FONTOPTIONS);
- }
-}
-
-//*****************************************************************************************************************
-// destructor
-//*****************************************************************************************************************
-SvtFontOptions::~SvtFontOptions()
-{
- // Global access, must be guarded (multithreading!)
- MutexGuard aGuard( impl_GetOwnStaticMutex() );
- // Decrease ouer refcount.
- --m_nRefCount;
- // If last instance was deleted ...
- // we must destroy ouer static data container!
- if( m_nRefCount <= 0 )
- {
- delete m_pDataContainer;
- m_pDataContainer = NULL;
- }
-}
-
-//*****************************************************************************************************************
-// public method
-//*****************************************************************************************************************
-sal_Bool SvtFontOptions::IsFontHistoryEnabled() const
-{
- MutexGuard aGuard( impl_GetOwnStaticMutex() );
- return m_pDataContainer->IsFontHistoryEnabled();
-}
-
-//*****************************************************************************************************************
-// public method
-//*****************************************************************************************************************
-void SvtFontOptions::EnableFontHistory( sal_Bool bState )
-{
- MutexGuard aGuard( impl_GetOwnStaticMutex() );
- m_pDataContainer->EnableFontHistory( bState );
-}
-
-//*****************************************************************************************************************
-// public method
-//*****************************************************************************************************************
-sal_Bool SvtFontOptions::IsFontWYSIWYGEnabled() const
-{
- MutexGuard aGuard( impl_GetOwnStaticMutex() );
- return m_pDataContainer->IsFontWYSIWYGEnabled();
-}
-
-//*****************************************************************************************************************
-// public method
-//*****************************************************************************************************************
-void SvtFontOptions::EnableFontWYSIWYG( sal_Bool bState )
-{
- MutexGuard aGuard( impl_GetOwnStaticMutex() );
- m_pDataContainer->EnableFontWYSIWYG( bState );
-}
-
-namespace
-{
- class theFontOptionsMutex : public rtl::Static<osl::Mutex, theFontOptionsMutex> {};
-}
-
-//*****************************************************************************************************************
-// private method
-//*****************************************************************************************************************
-Mutex& SvtFontOptions::impl_GetOwnStaticMutex()
-{
- return theFontOptionsMutex::get();
-}
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/unotools/source/config/itemholder1.cxx b/unotools/source/config/itemholder1.cxx
index d21684f..4a17a18 100644
--- a/unotools/source/config/itemholder1.cxx
+++ b/unotools/source/config/itemholder1.cxx
@@ -46,7 +46,6 @@
#include <unotools/eventcfg.hxx>
#include <unotools/extendedsecurityoptions.hxx>
#include <unotools/fltrcfg.hxx>
-#include <unotools/fontoptions.hxx>
#include <unotools/historyoptions.hxx>
#include <unotools/inetoptions.hxx>
#include <unotools/internaloptions.hxx>
@@ -203,10 +202,6 @@ void ItemHolder1::impl_newItem(TItemInfo& rItem)
// no ref count rItem.pItem = new SvtFilterOptions();
break;
- case E_FONTOPTIONS :
- rItem.pItem = new SvtFontOptions();
- break;
-
case E_HISTORYOPTIONS :
rItem.pItem = new SvtHistoryOptions();
break;
--
1.7.5.4
Context
- [Libreoffice] [PATCH] Remove options "Show preview of fonts" and "Show font history" · August Sodora
Privacy Policy |
Impressum (Legal Info) |
Copyright information: Unless otherwise specified, all text and images
on this website are licensed under the
Creative Commons Attribution-Share Alike 3.0 License.
This does not include the source code of LibreOffice, which is
licensed under the Mozilla Public License (
MPLv2).
"LibreOffice" and "The Document Foundation" are
registered trademarks of their corresponding registered owners or are
in actual use as trademarks in one or more countries. Their respective
logos and icons are also subject to international copyright laws. Use
thereof is explained in our
trademark policy.