Bug 101185 - Improve readability of OString concatanations
Summary: Improve readability of OString concatanations
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
Version:
(earliest affected)
5.3.0.0.alpha0+
Hardware: All All
: medium enhancement
Assignee: Not Assigned
URL:
Whiteboard: target:5.3.0
Keywords:
Depends on:
Blocks:
 
Reported: 2016-07-29 07:31 UTC by Nadith Malinda
Modified: 2016-08-13 20:20 UTC (History)
1 user (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 Nadith Malinda 2016-07-29 07:31:50 UTC
Idea is to do OString concatenation/creation is simply done as:

If code looks like this:
 OString tmp("'-O', please check");
 tmp += 


Change it to something like:
 OString tmp = "'-O', please check" + " your input '" + OString(av[i+1]) + "'";


Task is to :
Find occurences of consecutive OString concatanations with += operator following creation (or assignment) of a new OUString object. And find a way to replace those consecutive += assignments with one single assignment like the one in the context below

Goal is :
More readable and efficient code.

is this a good idea ?
Comment 1 Nadith Malinda 2016-07-29 07:34:26 UTC
If code looks like this:
 OString tmp("'-O', please check");
 tmp += " your input '" + OString(av[i+1]) + "'";
Comment 2 Commit Notification 2016-08-01 06:27:09 UTC
nadith committed a patch related to this issue.
It has been pushed to "master":

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

tdf#101185 OString concatanations for efficiently coding

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 3 Commit Notification 2016-08-04 05:39:03 UTC
nadith committed a patch related to this issue.
It has been pushed to "master":

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

tdf#101185 OString concatanations for efficiently coding

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 4 Jean-Baptiste Faure 2016-08-13 20:19:54 UTC
It seems that this enhancement has been confirmed and fixed. If I am wrong please, reopen.

Best regards. JBF