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


https://bugs.freedesktop.org/show_bug.cgi?id=71770

Michael Meeks <michael.meeks@collabora.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Whiteboard|                            |EasyHack DifficultyBeginner
                   |                            |SkillCpp TopicCleanup

--- Comment #10 from Michael Meeks <michael.meeks@collabora.com> ---
Sounds like a slam-dunk to me. Unfortunately popup menus are not nearly as
trivial to edit as you might hope - there is no nice XML stuff; it is all
resource file blather with things like this:

class SwReadOnlyPopup : public PopupMenu

Menu MN_READONLY_POPUP
{
    ItemList =
    {
        MenuItem
        {
            Identifier = MN_READONLY_OPENURL ;
            HelpId = CMD_SID_OPENDOC ;
            Text [ en-US ] = "~Open" ;
        };
...
        SEPARATOR
        MenuItem
        {
            Identifier = MN_READONLY_COPY ;
            HelpId = CMD_SID_COPY;
            Text [ en-US ] = "~Copy" ;
        };
    };

Though that guy should be easy to move 'Copy' to the top of the menu (for
readonly documents) - finding the other more generic bits is perhaps harder:

sfx2/source/menu/menu.hrc:#define MN_CLIPBOARDFUNCS                  
RID_SFX_MENU_START+1
sfx2/source/menu/menu.src:Menu MN_CLIPBOARDFUNCS
sfx2/source/menu/mnumgr.cxx:        PopupMenu aPop( SfxResId( MN_CLIPBOARDFUNCS
) );
sfx2/source/menu/mnumgr.cxx:        PopupMenu aPop( SfxResId( MN_CLIPBOARDFUNCS
) );

is one place that might be useful. Indeed - reading that it looks quite
promising:

SfxPopupMenuManager* SfxPopupMenuManager::Popup( const ResId& rResId,
SfxViewFrame* pFrame,const Point& rPoint, Window* pWindow )
{

-seems-

to insert these items into menus that don't have them =) and it always does it
at the end; that should be ~trivial to change this to the beginning - even a
beginner can do that =)

cf. include/vcl/menu.hxx:

    void                InsertSeparator( const OString &rIdent = OString(),
                            sal_uInt16 nPos = MENU_APPEND );

We need to provide an nPos of zero (ONO) for the insertion of those items and
... bingo =) => an easy hack.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

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.