summaryrefslogtreecommitdiff
path: root/sdext
AgeCommit message (Collapse)AuthorFilesLines
2022-07-14elide some temporary OUStringsNoel Grandin1-8/+17
Change-Id: I8539dd5d9490a14ebac0520486a8322ff86a6cb6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137081 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-07-14speed up loading PDF fileNoel Grandin1-1/+4
Change-Id: I3d892319f4af0c187455bc9c13b6edb0d52ac023 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137079 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-07-12sdext: these tests won't run without popplerAndras Timar1-0/+6
Change-Id: I61deb7d5271bf87ac1bb3aad54c430ace8fd3f9f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136975 Tested-by: Jenkins Reviewed-by: Andras Timar <andras.timar@collabora.com>
2022-07-08[API CHANGE] Drop css::accessibility::XAccessibleStateSetNoel Grandin1-88/+13
which is internal API, unused (as far as I can tell) by external users. This state is purely a bitset (as implemented by utl::AccessibleStateSetHelper) so we can just return it as a 64-bit value. This shaves significant time off the performance profiles of code that loads very complex shapes, because this state is frequently used, and we no longer need to allocate a return value on the heap for every call. Change-Id: Icf1b3bd367c256646ae9015f9127025f59459c2c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136786 Reviewed-by: Michael Weghorn <m.weghorn@posteo.de> Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-07-01tdf#137544 reduce cost of dynamic_castNoel Grandin5-23/+30
casting to TextElement is very hot here Change-Id: I3195da6f09edb270eebdc6f38a1bbb2405b74de6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136659 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-29tdf#137544 reduce work in sdext::PageElement::resolveUnderlinesNoel Grandin1-5/+12
when opening complex pdf Change-Id: I67146a60d016964c96a3994c5a0334287f7bab0a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136654 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-06-29simplify iterator manipulationNoel Grandin1-6/+1
Change-Id: I549947ad9ab93ed02049f7be5afad6be5ed69a52 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136633 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-06-24clang-tidy modernize-pass-by-value in sdextNoel Grandin48-223/+252
Change-Id: Ieded279152946830b2619ac80c4a9639d616557a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136398 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-06-24Follow-up for Poppler 22.06 updateNathan Pratta Teodosio1-3/+4
Change-Id: I8ee9f1a53cc4389e6a4d44e9765b478b5edfffd4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136342 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2022-06-23Update for Poppler 22.06Nathan Pratta Teodosio2-0/+39
Change-Id: I8ee9f1a53cc4389e6a4d44e9765b478b5edfffd3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136261 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2022-06-14tdf#149351 Add a 'Turn off mouse as pen' shortcutGabor Kelemen1-0/+11
for UX compatibility with PP: Ctrl-A turns off 'mouse as pen' mode Change-Id: I0379580f4034f07f044dc1079c14898f3014face Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135579 Tested-by: Jenkins Reviewed-by: Heiko Tietze <heiko.tietze@documentfoundation.org> Reviewed-by: Gabor Kelemen <kelemeng@ubuntu.com>
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-30framework: fix crash on Writer startup when using --enable-ext-wiki-publisherMiklos Vajna1-4/+4
As reported by Julien, once the mediawiki extension is installed, the xHandler in framework::DispatchProvider::implts_searchProtocolHandler() points to an UNO component implemented in Java, and we crash in dynamic_cast<>(), at least on Linux with gcc 7.5 and libstdc++. This dynamic_cast<>() call was added in commit c0fa456436947a5c167c652d19a884064b43c03d (tdf#149261 sdext: fix crash on starting the presenter console for the 2nd time, 2022-05-26), to allow the presenter console to opt out from protocol handler caching. It was expected that the proxy object created for a Java UNO component would simply return nullptr when we try to dynamic_cast<>() it down to a C++ interface. Fix the problem by moving the interface to an UNO one: this side-steps the dynamic_cast<>() crash at the price of introducing an UNO interface, which is not meant to be part of the public UNO API (but at least it's not published). It may still make sense to improve the bridges/ code at some stage to not crash in dynamic_cast<>() on generated Java proxy objects. Change-Id: Iaac44515339e0dc15dddc3be45ef7dee7331e47a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135114 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2022-05-26tdf#149261 sdext: fix crash on starting the presenter console for the 2nd timeMiklos Vajna1-0/+5
This started with commit 3f768cddd28a2f04eb1ffa30bed4474deb6fbfc4 (framework: avoid re-creating protocol handler instances all the time, 2022-05-02). In case there are 2 monitors, then one monitor shows the slideshow, the other shows the presenter console. The presenter console's protocol handler in sdext::presenter::PresenterProtocolHandler::Dispatch::Dispatch() has mpPresenterController->GetWindowManager() as an empty reference on the 2nd time the presentation starts. The above commit started to cache protocol handler instances at a frame level for performance reasons, and this is meant to be safe in general, but the presenter console's window manager is re-created between slideshow runs, so it depends on framework/ code to re-create the protocol handler all the time, which is problematic here. Fix the problem by introducing a framework::CacheInfo interface that allows protocol handler implementations to signal if they want to avoid being cached. This should be good enough for now, but if later it turns out that there are too many broken protocol handlers out there, then we can consider flipping the default and only cache handlers which explicitly opt in for this behavior. This is not done in this commit. Change-Id: Ic159813b1b339540bc8c4e780c4d6d7d2d4d2445 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135020 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2022-05-26disable this sdext test on windows for nowNoel Grandin1-1/+2
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-05-24Use o3tl::make_unsigned in some placesStephan Bergmann3-4/+5
...where a signed and an unsigned value are compared, and the signed value has just been proven to be non-negative here Change-Id: I20600d61a5d59d739bc1bee838c0038e4611aec2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134875 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-05-04Just use Any ctor instead of makeAny in sdextStephan Bergmann2-5/+5
Change-Id: I78f6972f0fe94423e00f2c3766df694d8e118439 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133784 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-05-01use more string_view in variousNoel Grandin1-1/+1
found by examining uses of OUString::copy() for likely places Change-Id: I6ff20e7b273ad6005410b82719183c1122f8c018 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133617 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-04-13loplugin:stringviewparam whitelist some more functionsNoel Grandin2-4/+4
for which we have o3tl:: equivalents Change-Id: I4670fd8b703ac47214be213f41e88d1c6ede7032 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132913 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-04-11loplugin:stringview add check for getToken().toInt32Noel Grandin2-3/+5
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>
2022-04-10loplugin:stringview check for getToken and trimNoel Grandin1-1/+2
since we now have o3tl versions of those that work on string_view. Also improve those o3tl functions to support both string_view and u16string_view Change-Id: Iacab2996becec62aa78a5597c52d983bb784749a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132755 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
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 Kelemen3-11/+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-21tdf#143148 Use pragma once instead of include guardsDeep171-4/+1
Change-Id: I8f2dd2049a70dde809a1b1afb1f67d5feaf60d8b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130222 Tested-by: Jenkins Reviewed-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org>
2022-02-17Parameter should apparently be of type sal_Int32Stephan Bergmann1-1/+1
It was like this ever since 969aac0edf437ec0cad0baadfde46188c4822161 "INTEGRATION: CWS pdf25", but the single caller of encodeBase64 passes a sal_Int32 value, and all use of i_nBufferLength in encodeBase64 are in sal_Int32-based computations. Change-Id: I2963a05bf5a83aaee25cdd71c11d28481b28061a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130067 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-02-04sdext.pdfimport tdf#137128: Recognize more font name and weight...Kevin Suo2-1/+37
...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>
2022-02-04sdext.pdfimport: these SAL_WARN should be SAL_INFOKevin Suo1-4/+4
SAL_WARN should be some message which showns where the program runs abnormally. Normal debugging output code should be SAL_INFO, and if you have set it to SAL_WARN for easy debugging you should set it back to SAL_INFO or delete those lines when submit. Otherwise our dbgutil terminal will be flood with unrelated messages Change-Id: I0767bfbeb7a21f208be12208009ccda8b6c72bab Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118763 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-12-10Generally determine Rdb content from gb_*_set_componentfile callsStephan Bergmann3-3/+3
...instead of by listing the content somewhat redundantly in the Rdb_*.mk files, to avoid duplication of logic for components that are only built conditionally (and thus should only be included conditionally in the corresponding Rdb). To achieve that, add an "rdb" parameter to gb_ComponentTarget_ComponentTarget (and to the gb_*_set_componentfile macros that internally call gb_ComponentTarget_ComponentTarget), which is used to make the appropriate gb_Rdb_add_component call internally from within gb_ComponentTarget_ComponentTarget. (As a special case, gb_CppunitTest_set_componentfile shall not call gb_Rdb_add_component, as that has already been done by the corresponding gb_Library_set_componentfile call, so allow the gb_ComponentTarget_ComponentTarget "rdb" parameter to be empty to support that special case.) Most Rdb_*.mk files are thus mostly empty now. One exception is i18npool/Rdb_saxparser.mk, which duplicates some of the Rdb_services content as needed during the build in CustomTarget_i18npool/localedata. 1c9a40299d328c78c035ca63ccdf22c5c669a03b "gbuild: create services.rdb from built components" had already tried to do something similar (in addition to other things) under a new --enable-services-rdb-from-build option. However, that approach had four drawbacks that this approach here addresses (and which thus partly reverts 1c9a40299d328c78c035ca63ccdf22c5c669a03b): 1 Rdb_services shall not contain the component files of all libraries that are built. While that commit filtered out the component files that go into Rdb_ure/services (ure/Rdb_ure.mk), it failed to filter out the component files that go into others like Rdb_postgresql-sdbc (connectivity/Rdb_postgresql-sdbc.mk). 2 The code added by that commit to Makefile.gbuild codified the knowledge that there is an Rdb_services, which is brittle. 3 The code added by that commit to solenv/gbuild/Rdb.mk codified the knowledge (for gb_Rdb__URECOMPONENTS) that there is an Rdb_ure/services, which is brittle. 4 Introducing an --enable-services-rdb-from-build option needlessly provided two different ways how the content of Rdb_services is assembled. The changes done here would leave --enable-services-rdb-from-build as a misnomer, as it no longer controls how Rdb_services is assembled. I thus renamed it to --enable-customtarget-components, as that is apparently what it still does now. Change-Id: Ia5e8df4b640146c77421fcec6daa11a9cd260265 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126577 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2021-12-09change use of wrong slot id to name of correct commandCaolán McNamara1-1/+1
slot was introduced with commit 27452a082237065ac4cf475c8398241907164b2c Date: Wed Oct 10 14:32:04 2007 +0000 INTEGRATION: CWS pppopt02 (1.24.74); FILE MERGED 2007/09/28 14:52:06 sj 1.24.74.1: added slot to be able to clear the undomanager as 27115, but got renumbered to 27118 with commit 35fe915b7cf508356a88897d520b89fc986407fb Date: Wed Jun 10 15:47:52 2015 +0200 Fix sd ID conflicts and duplicates using its name is verified to call the expected handler for it Change-Id: I656d91937612b0807353455930328aa37d5eecb7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126581 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-11-26Drop support for poppler w/o cpp/poppler-version.hJan-Marek Glogowski1-7/+0
Seems the first poppler including poppler-cpp.pc.in and also cpp/poppler-version.h.in was 0.14.0. So this also increases the minimal system poppler dependency from * poppler 0.12.0 (Wed Sep 9, 2009) to * poppler 0.14.0 (Tue Jun 8, 2010) Compiling the internal poppler, we're up-to-date anyway. Change-Id: Iee07cfeb43f4320fd596c772eeb26662505d0daf Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125778 Tested-by: Jenkins Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
2021-11-23O[U]String::replaceAt overloads that take string_viewNoel Grandin1-1/+1
which results in lots of nice string_view improvements picked up by the plugins Change-Id: Ib0ec3887816b3d4436d003b739d9814f83e244b2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125657 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-11-03loplugin:finalclassesNoel Grandin3-31/+24
Change-Id: I10ff73f89c965beb3cfb5fc3a40dd959d8f77aaa Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124600 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 Kaganski16-141/+118
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-22Revert part of "Simplify vector initialization in sdext"Julien Nabet2-8/+5
since it needs 2 allocations instead of one This partially reverts commit d64a6e2245169e5e4a3f8bc5388b4fff4984e5f4 . Change-Id: Iadd8193a02bd922105c082fe3bbcc6f8e9f96b22 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124069 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2021-10-22Optimize assignment from OUStringLiteral to OUStringStephan Bergmann1-1/+1
...by making the OUString's pData point to the OUStringLiteral, instead of copying the contained characters. This is one of the improvements that had not been done as part of e6dfaf9f44f9939abc338c83b3024108431d0f69 "Turn OUStringLiteral into a consteval'ed, static-refcound rtl_uString": "To keep individual commits reasonably manageable, some consumers of OUStringLiteral in rtl/ustrbuf.hxx and rtl/ustring.hxx are left in a somewhat odd state for now, where they don't take advantage of OUStringLiteral's equivalence to rtl_uString, but just keep extracting its contents and copy it elsewhere. In follow-up commits, those consumers should be changed appropriately, making them treat OUStringLiteral like an rtl_uString or dropping the OUStringLiteral overload in favor of an existing (and cheap to use now) OUString overload, etc." (Simply dropping the OUStringLiteral overload was not possible in this case, though, as that would have lead to ambiguities among the various OUString and std::u16string_view overloads.) The now-deleted OUStringLiteral rvalue reference overload means that some existing assignments from ternary-operator OUStringLiteral<N> to OUString no longer compile and had to be replaced with uses of std::u16string_view. Those had not already been replaced in e6dfaf9f44f9939abc338c83b3024108431d0f69 because they happened to use OUStringLiteral instances of identical length N in both arms of the ternary operator, so did not already start to fail to compile back then. Change-Id: I328e25b8324d045774e811d20a639f40d6a9a960 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124040 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2021-10-16Simplify vector initialization in sdextJulien Nabet5-52/+69
Change-Id: If3cebeadff5496ae214614b49116060d24b6082f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123696 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2021-10-15Remove non-const Sequence::begin()/end() in internal codeMike Kaganski1-1/+1
... to avoid hidden cost of multiple COW checks, because they call getArray() internally. This obsoletes [loplugin:sequenceloop]. Also rename toNonConstRange to asNonConstRange, to reflect that the result is a view of the sequence, not an independent object. TODO: also drop non-const operator[], but introduce operator[] in SequenceRange. Change-Id: Idd5fd7a3400fe65274d2a6343025e2ef8911635d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123518 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-10-14Avoid COW overhead using css::uno::SequenceMike Kaganski3-5/+5
The scenarios are: 1. Calling sequence's begin() and end() in pairs to pass to algorithms (both calls use getArray(), which does the COW checks) 2. In addition to #1, calling end() again when checking result of find algorithms, and/or begin() to calculate result's distance 3. Using non-const sequences in range-based for loops, which internally do #1 4. Assigning sequence to another sequence variable, and then modifying one of them In many cases, the sequences could be made const, or treated as const for the purposes of the algorithms (using std::as_const, std::cbegin, and std::cend). Where algorithm modifies the sequence, it was changed to only call getArray() once. For that, css::uno::toNonConstRange was introduced, which returns a struct (sublclass of std::pair) with two iterators [begin, end], that are calculated using one call to begin() and one call to getLength(). To handle #4, css::uno::Sequence::swap was introduced, that swaps the internal pointer to uno_Sequence. So when a local Sequence variable should be assigned to another variable, and the latter will be modified further, it's now possible to use swap instead, so the two sequences are kept independent. The modified places were found by temporarily removing non-const end(). Change-Id: I8fe2787f200eecb70744e8b77fbdf7a49653f628 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123542 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-10-12loplugin:moveparam in sdextNoel Grandin4-35/+35
Change-Id: I46e0f73f67cffb11ab5f1cf2453450a3066eb1fe Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123425 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
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 Suo12-59/+158
...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-10-03A more lightweight O[U]StringConcatenationStephan Bergmann1-1/+1
...compared to a full-blown O[U]String, for temporary objects holding an O[U]StringConcat result that can then be used as a std::[u16]string_view. It's instructive to see how some invocations of operator ==, operator !=, and O[U]StringBuffer::insert with an O[U]StringConcat argument required implicit materialization of an O[U]String temporary, and how that expensive operation has now been made explicit with the explicit O[U]StringConcatenation ctor. (The additional operator == and operator != overloads are necessary because the overloads taking two std::[u16]string_view parameters wouldn't even be found here with ADL. And the OUString-related ones would cause ambiguities in at least sal/qa/rtl/strings/test_oustring_stringliterals.cxx built with RTL_STRING_UNITTEST, so have simply been disabled for that special test-code case.) Change-Id: Id29799fa8da21a09ff9794cbc7cc9b366e6803b8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122890 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2021-09-15loplugin:constvarsNoel Grandin1-1/+1
Change-Id: I9b35d6333afa6b305bf73fc55a7e60c8365674e9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122134 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-09-12allow build with poppler <= 0.71Rico Tzschichholz1-0/+5
Change-Id: I359c8259ae402f9f22be392c4ab4a23d31a17b4d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121937 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-09-02clang-tidy:readability-redundant-member-initNoel Grandin34-299/+45
Change-Id: I0a9b238c0ba551b330bee7b89eb6cd48fad1b265 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121488 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-08-23loplugin:referencecasting look through more clang TypesNoel Grandin9-27/+16
Note that because of where the fix resides, loplugin:redundantcast also notices a few more things. Change-Id: I0b66047fadfff2c5ceafcbd3eab085de00d861a6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120865 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-08-22tdf#143959 sdext.pdfimport: fix font name with subtagKevin Suo3-0/+43
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>