om>
2023-11-19Extended loplugin:ostr: sdextStephan Bergmann
Change-Id: If4e8ccf288846fc768b3e035706a8bd0b2207f4f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159678
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2023-03-30loplugin:stringadd in sd/sdextNoel Grandin
when applying my upcoming patch to also consider O[U]StringBuffer
Change-Id: Ic95e72e1c857c6814d6e25b9820494cdfa535465
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149746
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-11-25CppunitTest_sdext_pdfimport: move it to 'qa' folderXisco Fauli
like the rest of folders in the project
Change-Id: Ifb833aa8acedc8549c74383b2d76737d4f425c09
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143277
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2022-11-25sdext: remove unused documentXisco Fauli
it was added in bc48dbe08db537f41e42839a0493317298606413
"sdext.pdfimport: Use string() in xpath for testTdf104597_textrun"
for no reason
Change-Id: I58abed336cb4c8ca5cfe488f81fbf2332ff43c34
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143278
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2022-11-25Resolves tdf#152083: Ligatures are incorrectly reversed in Draw pdf importKevin Suo
For the string "بسم الله الرحمن الرحیم", the xpdfimport generates the following drawChar tokens:
drawChar 438.500000 723.300000 446.744000 723.300000 1.000000 0.000000 0.000000 1.000000 12.000000 م
drawChar 446.696000 723.300000 450.908000 723.300000 1.000000 0.000000 0.000000 1.000000 12.000000 ی
drawChar 450.896000 723.300000 458.804000 723.300000 1.000000 0.000000 0.000000 1.000000 12.000000 ح
drawChar 458.792000 723.300000 463.784000 723.300000 1.000000 0.000000 0.000000 1.000000 12.000000 ر
drawChar 463.688000 723.300000 467.048000 723.300000 1.000000 0.000000 0.000000 1.000000 12.000000 ل
drawChar 467.072000 723.300000 469.964000 723.300000 1.000000 0.000000 0.000000 1.000000 12.000000 ا
drawChar 469.964000 723.300000 473.708000 723.300000 1.000000 0.000000 0.000000 1.000000 12.000000
drawChar 473.756000 723.300000 482.780000 723.300000 1.000000 0.000000 0.000000 1.000000 12.000000 ن
drawChar 482.756000 723.300000 490.028000 723.300000 1.000000 0.000000 0.000000 1.000000 12.000000 م
drawChar 490.040000 723.300000 497.948000 723.300000 1.000000 0.000000 0.000000 1.000000 12.000000 ح
drawChar 497.936000 723.300000 502.928000 723.300000 1.000000 0.000000 0.000000 1.000000 12.000000 ر
drawChar 502.928000 723.300000 506.288000 723.300000 1.000000 0.000000 0.000000 1.000000 12.000000 ل
drawChar 506.312000 723.300000 509.204000 723.300000 1.000000 0.000000 0.000000 1.000000 12.000000 ا
drawChar 509.108000 723.300000 512.852000 723.300000 1.000000 0.000000 0.000000 1.000000 12.000000
drawChar 512.900000 723.300000 527.216000 723.300000 1.000000 0.000000 0.000000 1.000000 12.000000 الله
drawChar 527.204000 723.300000 530.948000 723.300000 1.000000 0.000000 0.000000 1.000000 12.000000
drawChar 530.996000 723.300000 539.240000 723.300000 1.000000 0.000000 0.000000 1.000000 12.000000 م
drawChar 539.288000 723.300000 552.020000 723.300000 1.000000 0.000000 0.000000 1.000000 12.000000 س
drawChar 551.888000 723.300000 555.236000 723.300000 1.000000 0.000000 0.000000 1.000000 12.000000 ب
Previously, all the above are combined to a single text frame in DrawXmlOptimizer::optimizeTextElements,
and then the text in the text frame is reversed (commit 69e9925ded584113e52f84ef0ed7c224079fa061, and
further improved by commit 50d73574b6c3d71f9a539c895a15d6fcda22390b).
The problem is that, the single token "الله" was already in correct order. Thus when it is reversed
together with others, the order for itself would be wrong. Fix this by doing a pre-reverse.
The space char needs special treatment, as observed in tdf104597_textrun.pdf.
Change-Id: If0bd716cc2d68820436d0e3f0f161ffb9cb4397a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142978
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-11-20sdext.pdfimport: Use string() in xpath for testTdf104597_textrunKevin Suo
...and remove the TODO comments.
Also, comment out the test for string ٱلسََّل which is related to tdf#152083 and will be fixed in a separate commit.
Change-Id: I075145be1ff58c16e976c710fbf8f55fc6752af1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142962
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-11-08sdext.pdfimport - Wirter: add handling for continuous space charactersKevin Suo
This was done for Draw in sdext/source/pdfimport/tree/drawtreevisiting.cxx,
but was not done for Writer. Without this, continuous spaces in PDF will
show only one space on pdfimport using the Writer pdfimport filter.
Change-Id: I2279d9b1750e07f5743aeba80a3fd553bc037d13
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141527
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-10-24sdext.pdfimport: refactor this unit test and active it for WindowsKevin Suo
This unit test was disabled for Windows build in commit fc45e54be6ba5d4685ae4ef3c3ea696fc99cccd4,
due to the "crashes on the windows jenkins boxes".
In this patch, I:
1. Rename the test name to show its purpose for easier reading;
2. Test the whole string all at once using xpath, rather than use indexOf().
This way we can not only test the existance of the characters, but also
the order they appear.
3. Activate it for Windows build and hope it passes on Jenkins.
4. Remove the std::cout debug code, and use CPPUNIT_ASSERT_EQUAL_MESSAGE
instead, so that the xml content (i.e. aOutput) is only shown when the
assertion fails.
5. Move the test document to testdocs directory.
Change-Id: I39084eb4ddc451ecac5183213b7e6166facf617b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141601
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-10-19tdf#151546: RTL text is reversed (Writer pdfimport)Kevin Suo
This is a followup to commit 69e9925ded584113e52f84ef0ed7c224079fa061
for the fix of tdf#104597.
The Writer pdf import filter code is similar than the Draw part.
However, many fixes to the Draw part was not done in the Writer part historically.
This patch ports the fix of text run in the Draw part to the Writer
part. There is a todo related to continuous spaces issue which should
be fixed separately.
Also use CPPUNIT_ASSERT_EQUAL_MESSAGE for the output of xml content
instread of using std::cout, in case of unit test failure.
Change-Id: Id013700524750e6e5283d85eeab72d8075f16f1b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141420
Tested-by: Thorsten Behrens <thorsten.behrens@allotropia.de>
Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de>
2022-10-13sdext.pdfimport: resolves tdf#104597: RTL script text runs are reversedKevin Suo
For the simple Arabic string: ٱلسَّلَامُ عَلَيْك, the xpdfimport binary generates the
follwing (drawchar) sequences:
كَ
يْ
لَ
عَ
مُ
ا
لَ
سَّ
ل
ٱ
(i.e., in reversed order, one character by one character).
Before this patch, after pdfimport the text shows up as لَسَّلٱ كَيْلَعَ مُا, which is reversed.
It was surposed to combine these characters into text frames in
DrawXmlOptimizer::optimizeTextElements(Element& rParent) (sdext/source/pdfimport/\
tree/drawtreevisiting.cxx:677), but actually it was not combined successfully there.
The single characters were then passed to sdext/source/pdfimport/tree/drawtreevisiting\
.cxx:105, one by one, in the hope that the strings could be mirrored. The mirroring
failed, because one single character, even after mirroring, always equals itself.
The DrawXmlOptimizer::optimizeTextElements failed to combine the characters into
one text frame, because the condition:
(rCurGC.Transformation == rNextGC.Transformation || notTransformed(rNextGC))
would never be true, as at least its horizontal position is different. A further analysis
indicates that we do not need to check the transformation here at all, as this is an
optimizer for a TextElement and in case a character is transformed then it would already
be in a different draw element (thus will never be combined with this TextElement).
After the fix of DrawXmlOptimizer::optimizeTextElements which now successfully
combines the characters, there is another issue in the old PDFIProcessor::mirrorString
function. It seems to mirror the characters within a word, but if a string contains
two words, then the two words are not successfully switched (e.g. for string "abc def"
it produces "cba fed" rather than "fed cba"), which is not suitable for
the case of RTL which requires all the characters been reversed. Fix this by using
comphelper::string::reverseString.
Change-Id: Ifa210836f1d6666dd56205ff0d243adfb4114794
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141231
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de>
2022-08-18Move tools/diagnose_ex.h to comphelper/diagnose_ex.hxxStephan Bergmann
...so that its TOOLS_WARN_EXCEPTION can be used in
comphelper/source/misc/logging.cxx in a follow-up commit. (And while at it,
rename from diangose_ex.h to the more appropriate diagnose_ex.hxx. The
comphelper module is sufficiently low-level for this immediate use case, so use
that at least for now; o3tl might be even more suitable but doesn't have a
Library until now. Also, for the immediate use case it would have sufficed to
only break DbgGetCaughtException, exceptionToString, TOOLS_WARN_EXCEPTION,
TOOLS_WARN_EXCEPTION_IF, and TOOLS_INFO_EXCEPTION out of
include/tools/diagnose_ex.h into an additional new
include/comphelper/diagnose_ex.hxx, but its probably easier overall to just move
the complete include file as is.)
Change-Id: I9f3222d4ccf1a9ac29d7eb9ba1530d53e2affaee
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138451
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-07-12sdext: these tests won't run without popplerAndras Timar
Change-Id: I61deb7d5271bf87ac1bb3aad54c430ace8fd3f9f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136975
Tested-by: Jenkins
Reviewed-by: Andras Timar <andras.timar@collabora.com>
2022-05-26disable this sdext test on windows for nowNoel Grandin
Change-Id: I06456afa84314b3348bce177c939f510e00aa743
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134993
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-04-11loplugin:stringview add check for getToken().toInt32Noel Grandin
where we can convert that to
o3tl::toInt32(o3tl::getToken(
and avoid the heap allocation of a temporary string
Change-Id: Ib11c19c6e6cdc0de3e551affd3578d181e292de4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132810
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-10-11sdext.pdfimport tdf#78427: Add support for more Font Weight featuresKevin Suo
...e.g. Thin, Extra-Light, Light, Semi-Bold, Bold, Extra-Bold and Black.
Previously the xpdfimport code passes the isBold value which is bool value.
sdext.pdfimport accepted this value from the xpdfimport output and check
whether a font is bold or not. However, there are many other FontWeight
features more than a "bold".
This patch changes the isBold to the GfxFont::Weight type, and changed the
sdext.pdfimport isBold bool type (in FontAttributes) to an OUString fontWeight.
The value for the fontWeight is set according to the GfxFont::Weight passed
by xpdfimport, and then this fontWeight is passed to the ODF xml generation
stage and used there directly.
Now the Semibold and Light (as shown in the unittest file) can be currectly
handled. However, for other weights the parseFontFamilyName still need to
be updated, but before doing that I plan to refector this function as the
current logic is very difficult for maintennance.
Change-Id: If2ce5f0f41c83843d8a6aeb30134b3faf99ba877
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123339
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-08-22tdf#143959 sdext.pdfimport: fix font name with subtagKevin Suo
as returned by the font descriptor when reading the font file.
Change-Id: I376b887e6356e765f669b41c43776f78f94c3623
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120815
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-07-14tdf#78427 tdf#81481 sdext.pdfimport: added unittestKevin Suo
Change-Id: Ia112762f0ece1be589997f6b9be336424603a1c5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118947
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-06-23tdf#141709: Use poppler_dataMichael Warner
Bundle the files from poppler_data and provide the path to them to
poppler when the bundled poppler library is used.
Change-Id: I13a2ef861303a0be17aa0a861ef8ac96ed8a93be
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117523
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2021-05-02throw() -> noexcept, part 2/3: Automatic loplugin:noexcept rewriteStephan Bergmann
Change-Id: I076f16d0536b534abf0ced4d76051eadb4c0e033
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114949
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2021-04-21loplugin:stringadd replace OUStringLiteral temporaries with OUString::ConcatNoel Grandin
Change-Id: I656f06a74d9f0180ae460264563d6a935c7d2c60
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114377
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-02-08Improve loplugin:cppunitassertequal for CPPUNIT_ASSERT(a && b)Stephan Bergmann
...by re-enabling the code temporarily #if'ed-out in
a528392e71bc70136021be4e3d83732fccbb885e "Fixed/improved
loplugin:cppunitassertequals" (and which then triggers lots of other
lopglugin:cppunitassertequal CPPUNIT_ASSERT -> CPPUNIT_ASSERT_EQUAL warnings).
For two css::uno::Reference equality comparisons in cppu/qa/test_any.cxx, it
was more straightforward to rewrite them with an explicit call to operator ==
(which silences loplugin:cppunitassertequal) than to adapt them to
CPPUNIT_ASSERT_EQUAL's requirement for arguments of identical types.
In sc/qa/unit/ucalc_pivottable.cxx, ScDPItemData needs toString, which has been
implemented trivially for now, but might want to combine that with the
DEBUG_PIVOT_TABLE-only ScDPItemData::Dump.
Change-Id: Iae6d09cf69bd4e52fe4411bba9e50c48e696291c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110546
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2021-02-05Revert "Fix typo in code"Stephan Bergmann
This reverts commit 3ed9bba283a6a67864c0928186e277240be0d9ba. osl_Pos_Absolut
(include/osl/file.h) is part of the stable URE interface; it must not be changed.
Change-Id: I1f49923a9351e4be5aee39b10720d38b424feb9b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110435
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2021-02-04Fix typo in codeAndrea Gelmini
Change-Id: Ib8b306a27d25a34e784aeeb72708b0d5d1511f3c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110394
Tested-by: Jenkins
Reviewed-by: Andrea Gelmini <andrea.gelmini@gelma.net>
2021-01-09fix coverity parse errorsCaolán McNamara
Change-Id: I3a1179947704452e3ffec02be59d0f7bf0b75ab0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109017
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-12-29loplugin:stringviewparam: operator +Stephan Bergmann
Change-Id: I044dd21b63d7eb03224675584fa143009c6b6008
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108418
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-12-26New loplugin:stringliteralvarStephan Bergmann
See the comment at the top of compilerplugins/clang/stringliteralvar.cxx for
details.
(Turned some affected variables in included files into inline variables, to
avoid GCC warnings about unused variables.)
Change-Id: Ie77219e6adfdaaceaa8b4e590b08971f2f04c83a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108239
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-12-11Adapt the remaining OUString functions to std string_viewStephan Bergmann
...for LIBO_INTERNAL_ONLY. These had been missed by
1b43cceaea2084a0489db68cd0113508f34b6643 "Make many OUString functions take
std::u16string_view parameters" because they did not match the multi-overload
pattern that was addressed there, but they nevertheless benefit from being
changed just as well (witness e.g. the various resulting changes from copy() to
subView()).
This showed a conversion from OStringChar to std::string_view to be missing
(while the corresponding conversion form OUStringChar to std::u16string_view was
already present).
The improvement to loplugin:stringadd became necessary to fix
> [CPT] compilerplugins/clang/test/stringadd.cxx
> error: 'error' diagnostics expected but not seen:
> File ~/lo/core/compilerplugins/clang/test/stringadd.cxx Line 43 (directive at ~/lo/core/compilerplugins/clang/test/stringadd.cxx:42): simplify by merging with the preceding assignment [loplugin:stringadd]
> File ~/lo/core/compilerplugins/clang/test/stringadd.cxx Line 61 (directive at ~/lo/core/compilerplugins/clang/test/stringadd.cxx:60): simplify by merging with the preceding assignment [loplugin:stringadd]
> 2 errors generated.
Change-Id: Ie40de0616a66e60e289c1af0ca60aed6f9ecc279
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107602
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-01-10use more std::make_sharedNoel Grandin
found using 'git grep', I tried using clang-tidy, but it only
successfully found a tiny fraction of these
Change-Id: I61c7d85105ff7a911722750e759d6641d578da33
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86526
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-12-22sal_Char->char in scaddins..sdextNoel Grandin
Change-Id: If2456800ace3696c2582e19a4c8612fee7d77f90
Reviewed-on: https://gerrit.libreoffice.org/85700
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-11-22Extend loplugin:external to warn about classesStephan Bergmann
...following up on 314f15bff08b76bf96acf99141776ef64d2f1355 "Extend
loplugin:external to warn about enums".
Cases where free functions were moved into an unnamed namespace along with a
class, to not break ADL, are in:
filter/source/svg/svgexport.cxx
sc/source/filter/excel/xelink.cxx
sc/source/filter/excel/xilink.cxx
svx/source/sdr/contact/viewobjectcontactofunocontrol.cxx
All other free functions mentioning moved classes appear to be harmless and not
give rise to (silent, even) ADL breakage. (One remaining TODO in
compilerplugins/clang/external.cxx is that derived classes are not covered by
computeAffectedTypes, even though they could also be affected by ADL-breakage---
but don't seem to be in any acutal case across the code base.)
For friend declarations using elaborate type specifiers, like
class C1 {};
class C2 { friend class C1; };
* If C2 (but not C1) is moved into an unnamed namespace, the friend declaration
must be changed to not use an elaborate type specifier (i.e., "friend C1;"; see
C++17 [namespace.memdef]/3: "If the name in a friend declaration is neither
qualified nor a template-id and the declaration is a function or an
elaborated-type-specifier, the lookup to determine whether the entity has been
previously declared shall not consider any scopes outside the innermost
enclosing namespace.")
* If C1 (but not C2) is moved into an unnamed namespace, the friend declaration
must be changed too, see <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71882>
"elaborated-type-specifier friend not looked up in unnamed namespace".
Apart from that, to keep changes simple and mostly mechanical (which should help
avoid regressions), out-of-line definitions of class members have been left in
the enclosing (named) namespace. But explicit specializations of class
templates had to be moved into the unnamed namespace to appease
<https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92598> "explicit specialization of
template from unnamed namespace using unqualified-id in enclosing namespace".
Also, accompanying declarations (of e.g. typedefs or static variables) that
could arguably be moved into the unnamed namespace too have been left alone.
And in some cases, mention of affected types in blacklists in other loplugins
needed to be adapted.
And sc/qa/unit/mark_test.cxx uses a hack of including other .cxx, one of which
is sc/source/core/data/segmenttree.cxx where e.g. ScFlatUInt16SegmentsImpl is
not moved into an unnamed namespace (because it is declared in
sc/inc/segmenttree.hxx), but its base ScFlatSegmentsImpl is. GCC warns about
such combinations with enabled-by-default -Wsubobject-linkage, but "The compiler
doesn’t give this warning for types defined in the main .C file, as those are
unlikely to have multiple definitions."
(<https://gcc.gnu.org/onlinedocs/gcc-9.2.0/gcc/Warning-Options.html>) The
warned-about classes also don't have multiple definitions in the given test, so
disable the warning when including the .cxx.
Change-Id: Ib694094c0d8168be68f8fe90dfd0acbb66a3f1e4
Reviewed-on: https://gerrit.libreoffice.org/83239
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-11-13tdf#42949 Fix IWYU warnings in sdext/Gabor Kelemen
Found with bin/find-unneeded-includes
Only removal proposals are dealt with here.
Change-Id: I73e11bb945df16d2599b5421b552e155dacdf860
Reviewed-on: https://gerrit.libreoffice.org/82411
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2019-11-06loplugin:unusedvariablecheck tweak to find more stuffNoel Grandin
but leave the tweak commented out, since it generates false positives
Change-Id: Iaf3f92414d2618f8780561f98765e33e282afe0c
Reviewed-on: https://gerrit.libreoffice.org/82121
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-10-15new loplugin:bufferaddNoel Grandin
look for OUStringBuffer append sequences that can be turned
into creating an OUString with + operations
Change-Id: Ica840dc096000307b4a105fb4d9ec7588a15ade6
Reviewed-on: https://gerrit.libreoffice.org/80809
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-06-17loplugin:logexceptionnicely in scripting..sdextNoel Grandin
Change-Id: Ib08f41bb0bed494e7ed00f5bae92eae2b8e80d93
Reviewed-on: https://gerrit.libreoffice.org/74113
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-05-12Use hasElements to check Sequence emptiness in sax..sdextArkadiy Illarionov
Similar to clang-tidy readability-container-size-empty
Change-Id: If6a567708d3c59355d54933fad23c85195846624
Reviewed-on: https://gerrit.libreoffice.org/71763
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-04-19loplugin:sequentialassign in sdNoel Grandin
Change-Id: I7d592b8929ca46c64a622551b039af0d6a7911db
Reviewed-on: https://gerrit.libreoffice.org/70716
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-03-29loplugin:useuniqueptr in PDFReaderNoel Grandin
Change-Id: I22a96bbf9266cc8dfbe223b985d0ba005a6367e9
Reviewed-on: https://gerrit.libreoffice.org/69881
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-03-07build: support disabling popplerAshod Nakashian
This adds --enable-poppler configure option.
Poppler can be enabled/disabled by setting this
parameter to yes or no.
Change-Id: I42ba2d27de7b5014d28523394310616d20073b71
Reviewed-on: https://gerrit.libreoffice.org/68602
Reviewed-by: Andras Timar <andras.timar@collabora.com>
Tested-by: Andras Timar <andras.timar@collabora.com>
Reviewed-on: https://gerrit.libreoffice.org/68842
Tested-by: Jenkins
2018-12-01tdf#120703 PVS: V560 A part of conditional expression is always true/falseMike Kaganski
Change-Id: I38f3e3243f8cb891c9a0fe2f4c68bc76acd1ef44
Reviewed-on: https://gerrit.libreoffice.org/64020
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2018-11-29loplugin:stringconstant look for unnecessary OString constructor useNoel Grandin
and tweak the methods in check.hxx to make them more flexible when
called with
dc.Class(xxx ? "foo" : "bar")
Change-Id: I881fe628f22121ced4d8849715d6b1c92b092da1
Reviewed-on: https://gerrit.libreoffice.org/64207
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-11-27tdf#42949 Fix IWYU warnings in include/vcl/[f-h]*Gabor Kelemen
Found with bin/find-unneeded-includes
Only removal proposals are dealt with here.
Change-Id: Ice2eb8c5994bf2ccb88972332ca4a1d3ed41752a
Reviewed-on: https://gerrit.libreoffice.org/63826
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2018-09-17New loplugin:externalStephan Bergmann
...warning about (for now only) functions and variables with external linkage
that likely don't need it.
The problems with moving entities into unnamed namespacs and breaking ADL
(as alluded to in comments in compilerplugins/clang/external.cxx) are
illustrated by the fact that while
struct S1 { int f() { return 0; } };
int f(S1 s) { return s.f(); }
namespace N {
struct S2: S1 { int f() { return 1; } };
int f(S2 s) { return s.f(); }
}
int main() { return f(N::S2()); }
returns 1, both moving just the struct S2 into an nunnamed namespace,
struct S1 { int f() { return 0; } };
int f(S1 s) { return s.f(); }
namespace N {
namespace { struct S2: S1 { int f() { return 1; } }; }
int f(S2 s) { return s.f(); }
}
int main() { return f(N::S2()); }
as well as moving just the function f overload into an unnamed namespace,
struct S1 { int f() { return 0; } };
int f(S1 s) { return s.f(); }
namespace N {
struct S2: S1 { int f() { return 1; } };
namespace { int f(S2 s) { return s.f(); } }
}
int main() { return f(N::S2()); }
would each change the program to return 0 instead.
Change-Id: I4d09f7ac5e8f9bcd6e6bde4712608444b642265c
Reviewed-on: https://gerrit.libreoffice.org/60539
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-08-29replace rtl_allocateMemory with std::mallocNoel Grandin
where used directly, since rtl_allocateMemory now just calls into std::malloc
Change-Id: I59f85bdb7efdf6baa30e8fcd2370c0f8e9c999ad
Reviewed-on: https://gerrit.libreoffice.org/59685
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-07-30Add missing sal/log.hxx headersGabor Kelemen
rtl/string.hxx and rtl/ustring.hxx both unnecessarily #include <sal/log.hxx> (and don't make use of it themselves), but many other files happen to depend on it.
This is a continuation of commit 6ff2d84ade299cb3d14d4110e4cf1a4b8070c030 to be able to remove those unneeded includes.
This commit adds missing headers to every file found by:
grep -FwL sal/log.hxx $(git grep -Elw 'SAL_INFO|SAL_INFO_IF|SAL_WARN|SAL_WARN_IF|SAL_DETAIL_LOG_STREAM|SAL_WHERE|SAL_STREAM|SAL_DEBUG')
to directories scripting, sd, sdext
Change-Id: I47889cd889cf1d68353184229bfd4712f1528fbf
Reviewed-on: https://gerrit.libreoffice.org/58220
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2018-01-12More loplugin:cstylecast: sdextStephan Bergmann
auto-rewrite with <https://gerrit.libreoffice.org/#/c/47798/> "Enable
loplugin:cstylecast for some more cases" plus
solenv/clang-format/reformat-formatted-files
Change-Id: Ie9eca6a78912a62f5a46ecacb1da052621c79ea4