Bug 91222 - VclBuilder constructor cleanup ...
Summary: VclBuilder constructor cleanup ...
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: graphics stack (show other bugs)
Version:
(earliest affected)
unspecified
Hardware: Other All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard: target:5.3.0 target:5.4.0
Keywords: difficultyBeginner, easyHack, skillCpp, topicCleanup
Depends on:
Blocks:
 
Reported: 2015-05-11 13:56 UTC by Michael Meeks
Modified: 2020-02-22 14:52 UTC (History)
5 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Meeks 2015-05-11 13:56:43 UTC
The VclBuilder code has a set of nice public symbols, one for each custom method that can be looked up by the relevant code to create those widgets (cf. vcl/source/window/builder.cxx).

These are all declared by macros eg.

VCL_BUILDER_FACTORY(FooType)

checkout include/vcl/builderfactory.hxx

But some of these constructor functions are over-complex and we can only partially macro-ise those eg.

VCL_BUILDER_DECL_FACTORY(SwCaptionPreview)
{
    WinBits nBits = 0;
    OString sBorder = VclBuilder::extractCustomProperty(rMap);
    if (!sBorder.isEmpty())
       nBits |= WB_BORDER;
    return VclPtr<SwCaptionPreview>::Create(pParent, nBits);
}

It would be great to go over these instances and move these pieces into a SwCaptionPreview constructor that takes a (VclBuilder::stringmap &rMap) parameter - meaning we can shrink the above to a new macro:

VCL_BUILDER_FACTORY_CONSTRUCTOR(SwCaptionPreview)

or something =) that is unless Caolan disagrees (?)

Thanks !
Comment 1 Julien Nabet 2015-05-12 20:12:06 UTC
Sorry for this naive question but what about taking benefit ot the cleanup to use templates instead of macros?
I mean, I thought the first category had to be preferred to the last one (for different reasons one can find by Googling a bit).
Unless it could be a necessary intermediate step and in this case, sorry for the noise! :-)
Comment 2 Michael Meeks 2015-05-13 08:47:18 UTC
Heh - so, I've no idea how well all the C / linking declarations go with templates; we need:

extern "C" SAL_DLLPUBLIC_EXPORT void SAL_CALL

as a prefix; at least for me that's easy to do via macros. Either way - whatever we do - having constructors that take the property map, and simple one-line factory definitions would be nice; then we can do what we want there =)
Comment 3 Julien Nabet 2015-05-14 08:07:11 UTC
(In reply to Michael Meeks from comment #2)
> Heh - so, I've no idea how well all the C / linking declarations go with
> templates; we need:
> 
> extern "C" SAL_DLLPUBLIC_EXPORT void SAL_CALL
> 
> as a prefix; at least for me that's easy to do via macros. Either way -
> whatever we do - having constructors that take the property map, and simple
> one-line factory definitions would be nice; then we can do what we want
> there =)

Thank you for your explanation, I didn't know about the C / linking.
I don't know too if using template could be still an option (I know too little about templates) but I understand better now the choice of macros.
Comment 4 Robinson Tryon (qubit) 2015-12-10 11:40:58 UTC Comment hidden (obsolete)
Comment 5 Robinson Tryon (qubit) 2016-02-18 14:51:27 UTC Comment hidden (obsolete)
Comment 6 Commit Notification 2016-11-02 09:24:47 UTC
melikeyurtoglu committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=9937b8daa7c6b8012d9ce4f936e239d87f34a0d1

tdf#91222 VclBuilder constructor cleanup

It will be available in 5.3.0.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 7 Commit Notification 2016-11-03 06:37:38 UTC
melikeyurtoglu committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=10197c094b3267adc8071bcef482b64dc291deed

tdf#91222 VclBuilder constructor cleanup

It will be available in 5.3.0.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 8 Commit Notification 2016-11-03 06:39:37 UTC
melikeyurtoglu committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=164d8e3b1aa660d65c1af9570e67b66520bd953a

tdf#91222 VclBuilder constructor cleanup

It will be available in 5.3.0.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 9 Commit Notification 2016-11-04 07:19:38 UTC
melikeyurtoglu committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=02eaf40ba04e970d88e37ef15963a409e375a7ad

tdf#91222 VclBuilder constructor cleanup

It will be available in 5.3.0.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 10 Commit Notification 2016-11-08 06:16:23 UTC
melikeyurtoglu committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=62e5010e5df379a26aa85ca9fd58bf872f020c36

tdf#91222 VclBuilder constructor cleanup

It will be available in 5.3.0.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 11 Commit Notification 2016-11-14 06:23:53 UTC
melikeyurtoglu committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=c5f5b3e5334c52502c1de28828a44ad469c68850

tdf#91222 VclBuilder constructor cleanup

It will be available in 5.3.0.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 12 Commit Notification 2016-11-17 11:53:19 UTC
melikeyurtoglu committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=69d08efffeca1e38fce7b04226894871279a1696

tdf#91222 VclBuilder constructor cleanup

It will be available in 5.3.0.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 13 Commit Notification 2017-03-08 06:11:34 UTC
Julien Nabet committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=bb4cf1da125344d5ef4fe51b0f1549718a11affa

tdf#91222 VclBuilder constructor cleanup

It will be available in 5.4.0.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 14 Ekansh Jha 2018-01-11 13:44:04 UTC
Hello,

I tried to find "VCL_BUILDER_DECL_FACTORY" but couldn't find it. 
Is the bug resolved or is there anything else to do in this bug, 
IF yes, I want to work on this issue.
Comment 15 Pelin Kuran 2020-02-22 14:47:35 UTC
Hello,
Just a little information, I git grepped VCL_BUILDER_DECL_FACTORY, but there is only "compilerplugins/clang/unusedmethods.py" file exist, also nothing can found in Opengrok. Seems like the bug resolved.
Comment 16 Buovjaga 2020-02-22 14:52:23 UTC
Ok, let's close