Issue 85921 - impress: right click to edit slide master
Summary: impress: right click to edit slide master
Status: CLOSED FIXED
Alias: None
Product: Draw
Classification: Application
Component: code (show other issues)
Version: 680m245
Hardware: All Linux, all
: P3 Trivial (vote)
Target Milestone: OOo 3.2
Assignee: wolframgarten
QA Contact: issues@graphics
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-02-06 16:36 UTC by caolanm
Modified: 2009-05-12 22:56 UTC (History)
2 users (show)

See Also:
Issue Type: PATCH
Latest Confirmation in: ---
Developer Difficulty: ---


Attachments
proposed patch (8.28 KB, patch)
2008-02-06 16:37 UTC, caolanm
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this issue.
Description caolanm 2008-02-06 16:36:36 UTC
A quick straw poll in my work group shows that the ability to edit the master
slide is just not easily found in the view menu. The first place that the
majority look to find this functionality is by right clicking the relevant
preview in the master section of slide panel hoping to see something there.

So attached is a patch that lets us edit the slide master under the mouse if
we're not in master view already and the slide master is an applied one.
Comment 1 caolanm 2008-02-06 16:37:02 UTC
Created attachment 51408 [details]
proposed patch
Comment 2 christian.guenther 2008-02-06 17:45:05 UTC
Please have a look on this patch.
Comment 3 clippka 2008-02-07 19:24:25 UTC
looks good, af, please apply this patch. It would be cool if we hit ui freeze
for 3.0.
Comment 4 groucho266 2008-05-27 16:37:39 UTC
Ahm, sorry, this somehow seems to have slipped my attention. With the UI freeze
long gone, we have to wait for OOo 3.1.
Comment 5 ooo 2008-11-17 10:54:23 UTC
KA=>AF: any news on verifying the patch?
Comment 6 caolanm 2009-01-07 12:42:04 UTC
How about 3.1, is this still going to make it ?
Comment 7 groucho266 2009-01-20 12:23:28 UTC
I finally found the time to review the patch.  Late again,  I am terribly sorry.

Most of the patch looks good except for the part in MasterPagesSelector.cxx. 
The handling of the SID_TP_EDIT_MASTER slot relies solely on the slide sorter
for switching to master mode and then for switching to the selected master page.

This is not the right way to do it.  I am even surprised and, as the author of
the slide sorter, somewhat pleased that this works at all.

Better use something like the code below to handle the slot.  It first
dispatches slot SID_MASTERPAGE (synchronously) to switch to master mode.  After
that the XDrawController::setCurrentPage(.) method is used to switch to the
selected master page:

        case SID_TP_EDIT_MASTER:
        {
            using namespace ::com::sun::star;
            uno::Reference<drawing::XDrawPage> xSelectedMaster (
                GetSelectedMasterPage()->getUnoPage(), uno::UNO_QUERY);
            SfxViewFrame* pViewFrame = mrBase.GetViewFrame();
            if (pViewFrame != NULL && xSelectedMaster.is())
            {
                SfxDispatcher* pDispatcher = pViewFrame->GetDispatcher();
                if (pDispatcher != NULL)
                {
                    USHORT nIndex = mpPageSet->GetSelectItemId();
                    pDispatcher->Execute(SID_MASTERPAGE, SFX_CALLMODE_SYNCHRON);
                    mpPageSet->SelectItem (nIndex);
                    mrBase.GetDrawController().setCurrentPage(xSelectedMaster);
                }
            }
        break;
        }

I have submitted issue 98272 for an assertion that is triggered when the
previews are created and that makes testing and debugging the code above harder
than necessary.
Comment 8 groucho266 2009-04-09 10:19:36 UTC
Finally applied the patch (with some minor modifications) and the change
described above.

SVN revision is 270683.
Comment 9 groucho266 2009-04-24 12:32:50 UTC
@wg: Please verify.
Comment 10 wolframgarten 2009-04-27 12:32:03 UTC
Verified in CWS.
Comment 11 caolanm 2009-05-12 22:56:16 UTC
integrated DEV300_m48