summaryrefslogtreecommitdiff
path: root/sdext/source/pdfimport/wrapper/wrapper.cxx
AgeCommit message (Collapse)AuthorFilesLines
2024-02-29tdf#113050 sdext.pdfimport: Plumb tiling pattern fill to pdfiprocessorDr. David Alan Gilbert1-4/+7
Change-Id: I68459834fd903d31c9b2e57d637265dd67da4f56 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163565 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-02-29tdf#113050 sdext.pdfimport Tiling pattern fill parserDr. David Alan Gilbert1-0/+33
Add a parser for the TilingPatternFill entry from the poppler wrapper. This doesn't get triggered yet until the wrapper enables the tilingPatternFill. Change-Id: I34ab84ba1ab9d6773f33d667b324bef5d6c6e409 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163564 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-12-01tdf#158442: fix opening hybrid PDFs on WindowsMike Kaganski1-2/+1
Commit 046e9545956d8ad1d69345d6b4a4c0a33714d179 (Try to revert to use of file_iterator from boost on Windows, 2023-10-31) had introduced a problem that pdfparse::PDFReader::read couldn't create file_iterator for files already opened with write access: mmap_file_iterator ctor on Windows used single FILE_SHARE_READ as dwSharedMode parameter for CreateFileA WinAPI; and that failed, when the file was already opened using GENERIC_WRITE in dwDesiredAccess - which happens when opening stream in TypeDetection::impl_detectTypeFlatAndDeep. Fix this by patching boosts' mmap_file_iterator constructor to use FILE_SHARE_READ | FILE_SHARE_WRITE, like we do in osl_openFile. But there was a pre-existing problem of using char-based CreateFileA API, which disallows opening any files with names not representable in current Windows codepage. Such hybrid PDF files would still fail creation of the file_iterator, and open as PDF. Fix that by further patching boost to have wstring-based constructors for file_iterator and mmap_file_iterator on Windows, which would call CreateFileW. Change-Id: Ib190bc090636159ade390b3dd120957d06d7b89b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160218 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2023-10-07loplugin:ostr: automatic rewriteStephan Bergmann1-26/+26
Change-Id: I2d09b2b83e1b50493ec88d0b2c323a83c0c86395 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157647 Reviewed-by: Stephan Bergmann <sbergman@redhat.com> Tested-by: Jenkins
2023-04-09new loplugin:unnecessarygetstrNoel Grandin1-2/+2
which prevents constructing unnecessary temporaries via getStr() Change-Id: I9ca70893a10e954b5ee0e6ad6098660ee24c2bef Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150170 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-12-04tdf#147246 sdext: font name returned by font descriptor may be...Kevin Suo1-0/+4
... e.g. "NotoSerifCJKjp-Regular-VKana". Change-Id: I9818579c7678b0dad5ec2d2217ae59d573de88b4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143609 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-06-30tdf#137544 slightly improve perf of pdf parsingNoel Grandin1-9/+10
Change-Id: I05af862137666606e557dc3fabe1c3ea249ee10a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136656 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-06-10new loplugin:moveitNoel Grandin1-1/+1
look for local variables that can be std::move'd to parameters off by default, since it doesn't do proper data flow analysis Change-Id: I3403a0fcffd165bdea6a772528bc53995c5fdb40 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135527 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-05-04Just use Any ctor instead of makeAny in sdextStephan Bergmann1-3/+3
Change-Id: I78f6972f0fe94423e00f2c3766df694d8e118439 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133784 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-04-08move comphelper::string::toInt32 to o3tlNoel Grandin1-3/+3
so we can use it in places where we cannot include comphelper Change-Id: Iba0ba3e4c0dcf0f9d1f09092a77c3b2010ec4f6d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132732 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-04-05add some comphelper::string::toInt* functions for string_viewsNoel Grandin1-9/+4
Change-Id: Icf42e00575edf8fc847bccf9c9505cd9710fc9b2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132509 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-02-21Recheck modules sd* with IWYUGabor Kelemen1-8/+0
See tdf#42949 for motivation Change-Id: I97c1a0e8c7f26807b12e6062581066d09ea13086 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130114 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2022-02-04sdext.pdfimport tdf#137128: Recognize more font name and weight...Kevin Suo1-1/+25
...values from the embeded 'PS' font names. Change-Id: I8465a6b1d845ce626848112f0a735a9ee3696e5c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129136 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-10-31Prepare for removal of non-const operator[] from Sequence in sdextMike Kaganski1-9/+6
Change-Id: I1992d1ffbbc80efe9749ebd254971a0a92a10019 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124386 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-10-11Fix font weight comparisonsStephan Bergmann1-8/+8
...after 2d486bac81e06c64d13c647f35d3f4affbeb183e "tdf#143959 sdext.pdfimport: call vcl::Font::identifyFont directly" changed the left-hand sides from aFontDescriptor.Weight of type float to aFontReadResult.GetWeight() of type FontWeight from include/tools/fontenum.hxx. (Diagnosed as > sdext/source/pdfimport/wrapper/wrapper.cxx:624:45: error: comparison of enumeration type 'FontWeight' with floating-point type 'float' is deprecated [-Werror,-Wdeprecated-enum-float-conversion] > if (aFontReadResult.GetWeight() == com::sun::star::awt::FontWeight::THIN) > ~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ in a --with-latest-c++ build.) Change-Id: I0c661fc27eefa478808f796ffb9a7586e1e671c3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123375 Reviewed-by: Kevin Suo <suokunlong@126.com> Reviewed-by: Stephan Bergmann <sbergman@redhat.com> Tested-by: Jenkins
2021-10-11tdf#143959 sdext.pdfimport: call vcl::Font::identifyFont directlyKevin Suo1-67/+46
Previously the unittest testTdf143959_nameFromFontFile did not fail even if the fixing code in wrapper.cxx is removed. That was because the "if (xHolder.is())" condition is always false in the unittest run, which suggests that the calling of com.sun.star.awt.FontIdentificator through the uno did not work in some circumstances. See comments in: https://gerrit.libreoffice.org/c/core/+/120815 In this patch, we call the vcl::Font::identifyFont directly rather than through the uno calling. This is proven to work in both the manual and unittest running. Change-Id: I6334bca2defaa27cf6ac72af3d621fbb59e57980 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123358 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 Suo1-15/+73
...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 Suo1-0/+9
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-26Fix typosAndrea Gelmini1-2/+2
Change-Id: If0c2b0df62d2f307ceaef0ea961a0ff221ba5e65 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119520 Tested-by: Julien Nabet <serval2412@yahoo.fr> Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2021-07-26sdext.pdfimport: Restore to read font file for the determination...Kevin Suo1-13/+84
of font attributes, as suggested by Mike Kaganski in https://gerrit.libreoffice.org/c/core/+/118977. This partially reverts da59686672fd2bc98f8cb28d5f04dc978b50ac13 but did some modification of the previous code with some explanationary comments. Change-Id: I224d9e717bf374a90f4834cbd9e11bf1138b41ff Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119090 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-07-12tdf#78427 sdext.pdfimport: refactor the conversion of font family namesKevin Suo1-119/+28
Simplify the code and hopefully improves performance. The previous code used a long for loop within which it used many duplicated parseFontRemoveSuffix. That for loop was simply intended to remove the font family name suffixes. However, the rResult.familyName is a OUString and this type already has the function of removing suffixes which is more efficient. Also, defined a list of suffixes to be removed in the header file. New suffixes can be easily added to this list. Change-Id: Idfa11cfe60e2e34a1f7456d29562a89eb3de7662 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118734 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-07-12tdf#78427 sdext.pdfimport: No need to read a font file for the purpose of...Kevin Suo1-52/+0
...determining the bold/italic/underline etc. The purpose for reading a font file is that in case the font attributes determined by the xpdfimport process is not enough, then we use the lo core font classes which read in the font file and then determine whether it is bold, italic etc. However, while this works in some cases, it does not work in many cases when the font file was actually a subset and a toUnicode map is followed in the PDF, see tdf#78427. In addition, in case the information collected from the xpdfimport process is enough, there is no need to read the font file. This commit removes the read of font file part. Also, this commit uses gfxFont->getNameWithoutSubsetTag() to get the font name with the subset tags removed, thus simplified the code in wrapper.cxx while also improves performace as the remove of subset tags is only run when the font is a subset (the previous code did this for all the font names). Change-Id: I94c1ad8e743abfab81cf0a46da178d4d8b212427 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118733 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Jenkins
2021-05-21LineParser::readNextToken gets called with m_nCharIndex==npos after allStephan Bergmann1-1/+4
eca89ece45ede76605a6102c94b3b67e1f8ff5aa "Replace rtl_string_getTokenView with o3tl::getToken" had erroneously assumed (from a succeeding `make check`) that the only problematic call to o3tl::getToken with position==npos would be the one in LineParser::readPath (and which had been addressed in that commit). But e.g. loading ooo29794-4.pdf from the crash test corpus would also run into that situation via LineParser::readNextToken, > warn:legacy.osl:3090875:3090875:sdext/source/pdfimport/wrapper/wrapper.cxx:259: insufficient input > soffice.bin: include/o3tl/string_view.hxx:34: std::string_view o3tl::getToken(std::string_view, char, std::size_t &): Assertion `position <= sv.size()' failed. > #3 0x00007ffff7a67a16 in __GI___assert_fail (assertion=0x7fffb39ea58c "position <= sv.size()", file=0x7fffb39f2a7f "include/o3tl/string_view.hxx", line=34, function=0x7fffb39ef3a9 "std::string_view o3tl::getToken(std::string_view, char, std::size_t &)") > #4 0x00007fffb3b60131 in o3tl::getToken(std::basic_string_view<char, std::char_traits<char> >, char, unsigned long&) (sv="eoClipPath", delimiter=32 ' ', position=@0x7fffffff29e0: 18446744073709551615) at include/o3tl/string_view.hxx:34 > #5 0x00007fffb3b5aa9f in pdfi::(anonymous namespace)::LineParser::readNextToken() (this=0x7fffffff29d0) at sdext/source/pdfimport/wrapper/wrapper.cxx:260 > #6 0x00007fffb3b5b2fa in pdfi::(anonymous namespace)::LineParser::readPath() (this=0x7fffffff29d0) at sdext/source/pdfimport/wrapper/wrapper.cxx:323 > #7 0x00007fffb3b59eb3 in pdfi::(anonymous namespace)::Parser::parseLine(rtl::OString const&) (this=0x7fffffff2d28, rLine="eoClipPath") at sdext/source/pdfimport/wrapper/wrapper.cxx:859 [...] so better guard there. Change-Id: Ibfd53fd9d3be0a3548d60cb26d59bb5966c5bc2c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115916 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2021-05-18Replace rtl_string_getTokenView with o3tl::getTokenStephan Bergmann1-18/+20
...to not needlessly extend the sal ABI. At least for now, o3tl::getToken has a simpler interface than its OString::getToken counterpart (driven mainly by how it is used for now): it does not support a `token` argument, and its `position` argument must not be npos. To meet the latter requirement, the check for "subpath" in LineParser::readPath has been reworked slightly. Change-Id: I4428fe2d9aa03ca83a436fc6493fbc34665a8033 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115742 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2021-05-18Use some more std::string_viewStephan Bergmann1-9/+9
Change-Id: I7d4039e87fda447b1d2087b2430a3544e9a1eb14 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115732 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2021-05-18update "add OString::getTokenView"Noel Grandin1-2/+8
update commit 3669d4ec43a6aa2d410d8351d631548db45a5302 Date: Fri May 14 15:51:38 2021 +0200 add OString::getTokenView (tdf#42374 related) with suggested changes from gerrit review Change-Id: I861d960deaa010740a4aa964e402c4c76a85cbc7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115706 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-05-18Move per-Parser::parseLine state into its own LineParser classStephan Bergmann1-109/+117
(together with the member functions that operate on that state). That reveals that Parser::m_nNextToken was always 0 when used, so can be removed. Change-Id: Iaf27d0503efcc8c7628f2f5f99f6e380c91a3893 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115725 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2021-05-15add OString::getTokenView (tdf#42374 related)Noel Grandin1-12/+19
small improvement to PDF import no need to construct temporary string objects when we are just to going to convert them into int/double. So use a view and convert the data through the view. Change-Id: I824fe88bf17142b48fe6032e10c0f3a111927e96 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115616 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-12-11Adapt the remaining OUString functions to std string_viewStephan Bergmann1-1/+2
...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-05-30loplugin:simplifybool extend to expression like !(a < b || c > d)Noel Grandin1-1/+1
mostly to catch stuff from the flatten work, but I think this looks good in general Change-Id: I7be5b7bcf1f3d9f980c748ba20793965cef957e7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92493 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-04-15loplugin:buriedassign in scaddins..sdextNoel Grandin1-7/+14
Change-Id: I72acfdac5879aa251a1074ea850758f66072b46e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92311 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-12-22sal_Char->char in scaddins..sdextNoel Grandin1-6/+6
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 Bergmann1-0/+4
...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 Kelemen1-13/+1
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 Grandin1-1/+0
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-07-04remove some unneede vcl/bitmap.hxx includesNoel Grandin1-1/+0
Change-Id: Ibdc79538276992193e61f6dc16ddd3fd1ab80b82 Reviewed-on: https://gerrit.libreoffice.org/75069 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-04-19loplugin:sequentialassign in sdNoel Grandin1-2/+1
Change-Id: I7d592b8929ca46c64a622551b039af0d6a7911db Reviewed-on: https://gerrit.libreoffice.org/70716 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-12-08Remove misguided FALLTHROUGH commentsStephan Bergmann1-2/+0
...between adjacent switch labels without any intervening statements Change-Id: Ieb8a0d9f71ea4382b5f7d005cdf7111d06aeb5d0 Reviewed-on: https://gerrit.libreoffice.org/64789 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-10-12drop some unused headersCaolán McNamara1-1/+0
Change-Id: If7cedab43231103f7435ce57a0eb3a4d047becb4 Reviewed-on: https://gerrit.libreoffice.org/61714 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2018-07-30Add missing sal/log.hxx headersGabor Kelemen1-0/+1
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-06-07vcl: svx: misc improvements to pdfium importingAshod Nakashian1-1/+1
Change-Id: I58f2fd973a731b148f40b37139cd74bac097a7d2
2018-06-07sd: import PDFs as images using Pdfium new SdPdfFilterAshod Nakashian1-27/+13
LOK now opens PDFs as images using Pdfium, which has a superior accuracy and support to poppler, the default pdf reader. Change-Id: Ifbbecf7f048f001836fb98886705cba47e6bed4e
2018-03-21pdf: refactor poppler importerAshod Nakashian1-0/+21
This paves the way to add pdf parsing via pdfium. Change-Id: I384687bcdce3011682ebeec18ee3de44759feb1a Reviewed-on: https://gerrit.libreoffice.org/51254 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
2018-02-21New loplugin:nestedunnamedStephan Bergmann1-43/+36
Change-Id: Ifb434589ef08428ce609bc7a40b015d4df13224c Reviewed-on: https://gerrit.libreoffice.org/50048 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-01-23new loplugin: pointerboolNoel Grandin1-1/+1
look for possibly bogus implicit conversions to bool when passing (normally pointer) args to bool params. this plugin comes in the wake of a couple of bugs caused by refactoring, where some of the call sites were not currently updated. Of the changes, the following are real bugs: desktop/../dp_persmap.cxx StartInputFieldDlg in sw/../fldmgr.cxx which occurred as a result of commit 39d719a80d8c87856c84e3ecd569d45fa6f8a30e Date: Tue May 3 11:39:37 2016 +0200 tdf#99529 sw: don't pop up input field dialog before inserting field CSerializationURLEncoded::encode_and_append in forms/../serialization_urlencoded.cxx XclExpCFImpl::XclExpCFImpl in sc/../xecontent.cxx I have no idea how to properly fix this, just made a guess. SwDocTest::test64kPageDescs in sw/qa/core/uwriter.cxx which looks like a simple copy/paste error. Change-Id: I795ebd5ef485a1d36863dc27fe13832989f5a441 Reviewed-on: https://gerrit.libreoffice.org/48291 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-10-23loplugin:includeform: sdextStephan Bergmann1-37/+37
Change-Id: Ieb9641b9846ecfed8d1a022a48defe7644405690
2017-09-26Rename the basegfx::tools namespace to basegfx::utilsTor Lillqvist1-2/+2
Reduce potential confusion with the global tools namespace. Will hopefully make it possible to remove the annoying initial :: when referring to the global tools namespace. Unless we have even more tools subnamespaces somewhere. Thorsten said it was OK. Change-Id: Id088dfe8f4244cb79df9aa988995b31a1758c996 Reviewed-on: https://gerrit.libreoffice.org/42644 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Tor Lillqvist <tml@collabora.com>
2017-06-09use comphelper::InitPropertySequence in more placesNoel Grandin1-13/+6
Change-Id: I72d7b13a23ce306b752b39187a0e9fbb7028643a Reviewed-on: https://gerrit.libreoffice.org/38606 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-05-15Resolves: tdf#107812 add check for -ObliqueCaolán McNamara1-12/+18
and move checks for -BoldOblique and -LightOblique before -Bold and -Light Change-Id: I59b59a10c6e92c6a6dc269aad616b9eb9e185ccd Reviewed-on: https://gerrit.libreoffice.org/37652 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2017-05-12remove unused uno::Reference varsNoel Grandin1-1/+0
found by temporarily marking Reference as SAL_WARN_UNUSED. Change-Id: I18809b62654467f890016adcc92576980ced393b Reviewed-on: https://gerrit.libreoffice.org/37511 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>