Date: prev next · Thread: first prev next last
2011 Archives by date, by thread · List index



Hi all,
"Store/Restore font dropdown MRU" is the required hack I worked on.
I attached the related patch.

From the Easy Hack web page:

Background: When you open a new document, use the font dropdown and select a number of different fonts then the 5 or so most recently used fonts are shown at the top of the list. But when you open a new document then the dropdown resets again. It would be nice to retain the MRU list when opening a new document, and also save and restore the MRU on exit and restart. Code for the dropdown is in svtools/source/control/ctrlbox.cxx, see vcl/unx/source/fontmanager.cxx and "m_aCacheFile" for a sample of the APIs to save/load from/to a file in the users config directories.

My work:
Now when you close a window where a FontNameBox control is provided
the most recent used (mru) entries for the font control are stored
in a file, the previous saved entry list is discarded; when a
document is opened or created the mru entry list of the FontNameBox
control is populated with the one saved in the file.

The file is saved under UserPath/config and is named
fontnameboxmruentries (is there a better place/name ?)

A possible enhancement could be to save the font name box mru entries
for the last 5/10 openened documents.
(How can I get the name of the current document/window ?)


While I was working on this hack I noticed that when two or more
documents are opened spurious resetting of the FontNameBox mru entry
list may happen, I did not get the cause of that, anyway as a
workaround I added a call to FontNameBox::GetMRUEntries at the begin
of the FontNameBox::Fill method and a call to FontNameBox::SetMRUEntries
to the end of the same method in this way even with spurious calls to
the FontNameBox::Fill method the font mru entries are preserved.


Cheers,
Marco


--
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/

Attachment: binWUOX2PWmuc.bin
Description: Binary data


Context


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.