https://bugs.documentfoundation.org/show_bug.cgi?id=91052

            Bug ID: 91052
           Summary: cleanup makeWindow constructors ...
           Product: LibreOffice
           Version: 4.4.3.2 rc
          Hardware: Other
                OS: All
            Status: UNCONFIRMED
          Severity: normal
          Priority: medium
         Component: LibreOffice
          Assignee: [email protected]
          Reporter: [email protected]

VclBuilder constructs a symbol name by concatenating widget names with a 'make'
prefix; cf.

vcl/source/window/builder.cxx:

            OUString sFunction(OStringToOUString(OString("make") +
name.copy(nDelim+1), RTL_TEXTENCODING_UTF8));

This is cast to this type:

    typedef vcl::Window* (*customMakeWidget)(vcl::Window *pParent, stringmap
&rVec);

And invoked. In the new world of VclPtr's we should change this signature to:

    typedef VclPtr<vcl::Window> (*customMakeWidget)(vcl::Window *pParent,
stringmap &rVec);

instead. Which is just a 1x line change. But then it is necessary to do:

git grep -Hn -3 -e 'Window *\*.*make.*('

And change every instance of every 'make' function thus:

eg. chart2/source/controller/dialogs/TextDirectionListBox.cxx:45:

extern "C" SAL_DLLPUBLIC_EXPORT vcl::Window* SAL_CALL
makeTextDirectionListBox(vcl::Window *pParent, VclBuilder::stringmap &)
{
    return new TextDirectionListBox(pParent);
}

into:

VCL_BUILDER_CONSTRUCTOR makeTextDirectionListBox(vcl::Window *pParent,
VclBuilder::stringmap &)
{
    return VclPtr<TextDirectionListBox>::Create(pParent);
}

where we define:

#define VCL_BUILDER_CONSTRUCTOR extern "C" SAL_DLLPUBLIC_EXPORT
VclPtr<vcl::Window> SAL_CALL 

Not an elegant define, but (hopefully) will help us find all these call-sites
in the future =)

Might be nice to have another parameterized macro that takes the type, and just
passes the pParent directly on to a method it-inlines.

No idea; thoughts Caolan ? =)

-- 
You are receiving this mail because:
You are the assignee for the bug.
_______________________________________________
Libreoffice-bugs mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs

Reply via email to