Bug 88205 - Adapt uses of css::uno::Sequence to use initializer_list ctor
Summary: Adapt uses of css::uno::Sequence to use initializer_list ctor
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
Version:
(earliest affected)
unspecified
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard: target:5.3.0 target:5.4.0 target:6.1....
Keywords: difficultyBeginner, easyHack, skillCpp, topicCleanup
Depends on:
Blocks:
 
Reported: 2015-01-08 16:51 UTC by Stephan Bergmann
Modified: 2018-10-27 15:55 UTC (History)
3 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 Stephan Bergmann 2015-01-08 16:51:27 UTC
Since <http://cgit.freedesktop.org/libreoffice/core/commit/?id=d79b96cf6564187c96f5a1451ca98e2c93adee77> "css::uno::Sequence ctor with initializer_list," that class has a ctor taking a C++11 std::initializer_list, which can greatly simplify some code constructing Sequence instances (see the commit for some examples).

Find places in the code that would benefit from adapting them (good candidates are "getSupportedServiceNames" functions that return statically known OUString Sequences).

(Note that this is a LIBO_INTERNAL_ONLY feature that cannot be used in external code though; in general, just keep away from files in include/cppu, include/cppuhelper, include/sal, include/salhelper, include/uno, and odk/examples.)
Comment 1 Michael Meeks 2015-01-26 21:42:55 UTC
As Stephan says that's really great for the getSupportedServiceNames cases: a quick:

$ git grep -5 getSupportedServiceNames

shows you a load of these places (when you get through accessibility) where we can turn two or often three lines into one like this:

 css::uno::Sequence< OUString >
 BridgeFactory::static_getSupportedServiceNames() {
-    OUString name("com.sun.star.bridge.BridgeFactory");
-    return css::uno::Sequence< OUString >(&name, 1);
+    return css::uno::Sequence<OUString>{ "com.sun.star.bridge.BridgeFactory" };
 }

Then again - it's not clear to me that this wouldn't produce rather more efficient code with a var-arg method that took C strings =) but at least far more terse.

Thanks !
Comment 2 Commit Notification 2015-03-05 10:41:44 UTC
Takeshi Abe committed a patch related to this issue.
It has been pushed to "master":

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

tdf#88205 Adapt uses of css::uno::Sequence to use initializer_list ctor

It will be available in 4.5.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 3 Robinson Tryon (qubit) 2015-12-14 06:35:25 UTC Comment hidden (obsolete)
Comment 4 kerem 2016-01-26 21:09:53 UTC
I sent following patch for this bug;

https://gerrit.libreoffice.org/#/c/21826/
Comment 5 kerem 2016-01-27 09:59:36 UTC
I sent following new patch for this bug;

https://gerrit.libreoffice.org/#/c/21836/
Comment 6 Commit Notification 2016-01-31 13:47:33 UTC
kerem committed a patch related to this issue.
It has been pushed to "master":

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

tdf#88205 Delete 'css::uno::Sequence'

It will be available in 5.2.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-02-03 08:28:37 UTC
kerem committed a patch related to this issue.
It has been pushed to "master":

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

tdf#88205 Delete 'css::uno::Sequence' in framework

It will be available in 5.2.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-02-08 20:05:02 UTC
kerem committed a patch related to this issue.
It has been pushed to "master":

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

tdf#88205 Delete 'uno::Sequence' in svl

It will be available in 5.2.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 Luke 2016-02-08 21:01:55 UTC
Stephan,
You said keep away from include/cppuhelper but numfmuno.cxx in
https://cgit.freedesktop.org/libreoffice/core/commit/?id=84b0c3e9f7cc25a5d6860d2ca33852230201915f
has 
#include <cppuhelper/supportsservice.hxx>

Is this safe?
Comment 10 Commit Notification 2016-02-09 06:20:25 UTC
kerem committed a patch related to this issue.
It has been pushed to "master":

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

tdf#88205 Delete 'css::uno::Sequence' in filter

It will be available in 5.2.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 Stephan Bergmann 2016-02-09 10:17:24 UTC
(In reply to Luke from comment #9)
> Stephan,
> You said keep away from include/cppuhelper but numfmuno.cxx in
> https://cgit.freedesktop.org/libreoffice/core/commit/
> ?id=84b0c3e9f7cc25a5d6860d2ca33852230201915f
> has 
> #include <cppuhelper/supportsservice.hxx>
> 
> Is this safe?

Yes, that's safe.  You should keep away from doing such modifications in files that reside in include/cppuhelper/ etc., but there's nothing wrong with doing such modifications in files elsewhere that just happen to also include files from include/cppuhelper/.
Comment 12 Robinson Tryon (qubit) 2016-02-18 14:51:35 UTC Comment hidden (obsolete)
Comment 13 Commit Notification 2016-06-29 14:46:01 UTC
Arnold Dumas committed a patch related to this issue.
It has been pushed to "master":

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

tdf#88205: Adapt uses of css::uno::Sequence to use initializer_list ctor

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 14 Commit Notification 2016-07-01 15:27:48 UTC
Arnold Dumas committed a patch related to this issue.
It has been pushed to "master":

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

tdf#88205: Adapt uses of css::uno::Sequence to use initializer_list ctor

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 15 Commit Notification 2016-08-02 05:46:03 UTC
Muhammet Kara committed a patch related to this issue.
It has been pushed to "master":

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

tdf#88205 Adapt uses of css::uno::Sequence to use initializer_list ctor

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 16 Commit Notification 2016-08-04 05:41:41 UTC
Muhammet Kara committed a patch related to this issue.
It has been pushed to "master":

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

tdf#88205 Adapt uses of css::uno::Sequence to use initializer_list ctor

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 17 Commit Notification 2016-08-04 05:49:10 UTC
Muhammet Kara committed a patch related to this issue.
It has been pushed to "master":

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

tdf#88205 Adapt uses of css::uno::Sequence to use initializer_list ctor

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 18 jani 2016-08-05 09:18:26 UTC
Please be aware, that this easyhack is considered an important but large scale cosmetic change as described in https://wiki.documentfoundation.org/Development/LargeScaleChanges

It was in decided by the ESC to close this kind of easyhacks, and send them directly as mail, to new contributors.
https://lists.freedesktop.org/archives/libreoffice/2016-August/074920.html

Please do not submit patches with many files !!

This particular easyhack is kept open as an exception to the rule.
Comment 19 Commit Notification 2016-08-05 12:46:56 UTC
Muhammet Kara committed a patch related to this issue.
It has been pushed to "master":

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

tdf#88205 Adapt uses of css::uno::Sequence to use initializer_list ctor

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 20 jani 2016-08-05 18:56:53 UTC
Please be aware, that this easyhack is considered an important but large scale cosmetic change as described in https://wiki.documentfoundation.org/Development/LargeScaleChanges

It was in decided by the ESC to close this kind of easyhacks, and send them directly as mail, to new contributors.
https://lists.freedesktop.org/archives/libreoffice/2016-August/074920.html

Please do not submit patches with many files !!

This particular easyhack is kept open as an exception to the rule
Comment 21 Commit Notification 2016-09-11 07:17:40 UTC
Jochen Nitschke committed a patch related to this issue.
It has been pushed to "master":

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

tdf#88205 use list ctor for uno::Sequence<OUString> in sc

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 22 Commit Notification 2016-09-14 07:24:53 UTC
Jochen Nitschke committed a patch related to this issue.
It has been pushed to "master":

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

tdf#88205 use list ctor for uno::Sequence a11y to canvas

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 23 Commit Notification 2016-10-02 10:59:10 UTC
Chamal committed a patch related to this issue.
It has been pushed to "master":

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

tdf#88205 Adapt uses of css::uno::Sequence to use initializer_list ctor

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 24 JoNi 2016-10-02 11:59:54 UTC
commands for code pointers:
> git grep -nA 3 -P 'Sequence<.*OUString.*\(\s*[A-Z1-9_][A-Z0-9_]*\s*\)'
for OUString Sequence

or more general:
> git grep -nA 3 -P 'Sequence<.*\(\s*[A-Z1-9_][A-Z0-9_]*\s*\)'
Comment 25 Commit Notification 2016-10-13 14:36:06 UTC
Asela Dasanayaka committed a patch related to this issue.
It has been pushed to "master":

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

tdf#88205 Adapt uses of css::uno::Sequence to use initializer_list ctor

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 26 Sudarshan K 2016-10-13 19:54:59 UTC
jan iversen: https://gerrit.libreoffice.org/#/c/29797/. Please review. 
Apologies, I forgot about your comment about not committing a lot of files together (There are small changes in six files). I missed it somehow. Let me know if you want to change it.
Comment 27 Commit Notification 2016-10-14 06:14:47 UTC
nadith committed a patch related to this issue.
It has been pushed to "master":

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

tdf#88205 Adapt uses of css::uno::Sequence to use initializer_list ctor

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 28 Commit Notification 2016-10-14 06:33:35 UTC
Hieronymous committed a patch related to this issue.
It has been pushed to "master":

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

tdf#88205 Adapt uses of css::uno::Sequence to use initialize_list ctor

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 29 Commit Notification 2016-10-14 06:39:14 UTC
nadith committed a patch related to this issue.
It has been pushed to "master":

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

tdf#88205 Adapt uses of css::uno::Sequence to use initializer_list ctor

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 30 Commit Notification 2016-10-16 10:59:06 UTC
Hieronymous committed a patch related to this issue.
It has been pushed to "master":

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

tdf#88205 css::uno::Sequence to use initializer_list ctor.

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 31 Commit Notification 2016-10-16 11:02:01 UTC
Hieronymous committed a patch related to this issue.
It has been pushed to "master":

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

tdf#88205 Adapt uses of css::uno::Sequence to use initializer_list ctor

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 32 Commit Notification 2016-10-16 11:03:51 UTC
Hieronymous committed a patch related to this issue.
It has been pushed to "master":

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

tdf#88205 Adapt uses of css::uno::Sequence to use initializer_list ctor

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 33 Commit Notification 2017-02-02 20:00:53 UTC
dilekuzulmez committed a patch related to this issue.
It has been pushed to "master":

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

tdf#88205 Adapt uses of css::uno::Sequence to use initializer_list ctor

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 34 Commit Notification 2017-02-03 12:20:29 UTC
dilekuzulmez committed a patch related to this issue.
It has been pushed to "master":

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

tdf#88205 Adapt uses of css::uno::Sequence to use initializer_list ctor

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 35 Commit Notification 2017-03-06 07:12:55 UTC
Fakabbir Amin committed a patch related to this issue.
It has been pushed to "master":

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

tdf#88205 Remove 'css::uno::Sequence' in svx

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 36 Commit Notification 2017-05-18 07:39:42 UTC
Dilek Uzulmez committed a patch related to this issue.
It has been pushed to "master":

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

tdf#88205 Adapt uses of css::uno::Sequence to use initializer_list ctor

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 37 Commit Notification 2018-01-26 07:30:31 UTC
ekuiitr committed a patch related to this issue.
It has been pushed to "master":

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

tdf#88205 Adapt uses of css::uno::Sequence to use initializer_list ctor

It will be available in 6.1.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 38 Commit Notification 2018-07-02 12:07:57 UTC
Jacek Fraczek committed a patch related to this issue.
It has been pushed to "master":

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

tdf#88205 Adapt uses of css::uno::Sequence to use initializer_list ctor

It will be available in 6.2.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 39 Commit Notification 2018-07-14 13:32:16 UTC
Ulkem Kasapoglu committed a patch related to this issue.
It has been pushed to "master":

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

tdf#88205: Adapt uses of css::uno::Sequence to use initializer_list ctor

It will be available in 6.2.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 40 Björn Michaelsen 2018-10-27 10:25:35 UTC
Better command to find files with candidates:

> git grep -A10 getSupportedServiceNames|egrep 'Sequence.*[0-9]+'|grep -o ^.*cxx
Comment 41 Commit Notification 2018-10-27 15:55:41 UTC
Izabela Bakollari committed a patch related to this issue.
It has been pushed to "master":

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

tdf#88205: Adapt uses of css::uno::Sequence to use initializer_list ctor

It will be available in 6.2.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.