diff options
author | Marco Cecchetti <mrcekets@gmail.com> | 2011-04-14 12:36:44 +0200 |
---|---|---|
committer | Cédric Bosdonnat <cedricbosdo@openoffice.org> | 2011-04-15 11:04:05 +0200 |
commit | f82a46dabeb431fc199aa4b43766115184844efe (patch) | |
tree | f9b1ded1bcc35fc11d4c93cf9e171f223e4c1d1f /svtools/inc | |
parent | 4fc170d3e8d0bb05197deb57f60d85f9fd9f0f72 (diff) |
Hack: store/restore font name box mru entries
When a LibreOffice window with a FontNameBox control is closed the
list of mru entries for the control is stored in a file,
discarding the previous saved entry list; when a document is opened or
created the last saved mru entry list for the FontNameBox control is
restored.
Diffstat (limited to 'svtools/inc')
-rw-r--r-- | svtools/inc/svtools/ctrlbox.hxx | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/svtools/inc/svtools/ctrlbox.hxx b/svtools/inc/svtools/ctrlbox.hxx index 8678b770dc6e..56c69e0d078b 100644 --- a/svtools/inc/svtools/ctrlbox.hxx +++ b/svtools/inc/svtools/ctrlbox.hxx @@ -31,6 +31,7 @@ #include "svtools/svtdllapi.h" +#include <tools/string.hxx> #include <vcl/lstbox.hxx> #include <vcl/combobox.hxx> #include <vcl/image.hxx> @@ -56,6 +57,8 @@ typedef ::std::vector< ImplFontNameListData* > ImplFontList; #define CHANGE_DIST ( ( sal_uInt16 ) 4 ) #define ADAPT_DIST ( ( sal_uInt16 ) 8 ) + + /************************************************************************* Beschreibung @@ -461,8 +464,9 @@ private: Image maImagePrinterFont; Image maImageBitmapFont; Image maImageScalableFont; - sal_Bool mbWYSIWYG; - sal_Bool mbSymbols; + sal_Bool mbWYSIWYG; + sal_Bool mbSymbols; + String maFontMRUEntriesFile; #ifdef _CTRLBOX_CXX SVT_DLLPRIVATE void ImplCalcUserItemSize(); @@ -472,6 +476,8 @@ private: 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: FontNameBox( Window* pParent, WinBits nWinStyle = WB_SORT ); @@ -489,6 +495,8 @@ public: sal_Bool IsSymbolsEnabled() const { return mbSymbols; } private: + void InitFontMRUEntriesFile(); + // declared as private because some compilers would generate the default functions FontNameBox( const FontNameBox& ); FontNameBox& operator =( const FontNameBox& ); |