[PATCH] proposed fix for fdo#49859

Stephan van den Akker stephanv778 at gmail.com
Fri May 25 13:59:40 PDT 2012


Hi, all!

I believe I found the cause of fdo#49859 "FORMATTING, UI: numbering
alignment or
indentation is not applied in Impress"

When the "Position" tab is deactivated,
SvxNumPositionTabPage::DeactivatePage()
is called. This call serves two purposes:

1: To check whether the Tab Page may be deactivated (answer: sal_True)
2: To retrieve the user input from this Tab Page

The Position tab contains two MetricFields: aDistBorderMF and aIndentMF. The
processing of input in these fields is triggered when they lose focus, by:

    SvxNumPositionTabPage::DistanceHdl_Impl()

When either aDistBorderMF or aIndentMF has focus when the Position tab is
deactivated, it faithfully triggers a call to DistanceHdl_Impl(). But this
happens AFTER the call to DeactivatePage(). Therefore, the user input
retrieved from DeactivatePage() doesn't reflect the last changes made
in aDistBorderMF or aIndentMF.

I propose an addition to DeactivatePage():

int  SvxNumPositionTabPage::DeactivatePage(SfxItemSet *_pSet)
{
    if(_pSet)
    {
        if(aDistBorderMF.IsEnabled())
            DistanceHdl_Impl(&aDistBorderMF);
        DistanceHdl_Impl(&aIndentMF);
        FillItemSet(*_pSet);
    }
    return sal_True;
}

Question:

Ideally, I would wrap the DistanceHdl_Impl() calls in ..MF.HasFocus() checks
to prevent unnecessary calls:

        if(aDistBorderMF.HasFocus() && aDistBorderMF.IsEnabled())
            DistanceHdl_Impl(&aDistBorderMF);
        if(aIndentMF.HasFocus())
            DistanceHdl_Impl(&aIndentMF);
        FillItemSet(*_pSet);

But both aDistBorderMF.HasFocus() and aIndentMF.HasFocus() always seem to
return
false! Is this intentional, or a bug?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/libreoffice/attachments/20120525/87d612fd/attachment.htm>


More information about the LibreOffice mailing list