summaryrefslogtreecommitdiff
path: root/vcl/unx
AgeCommit message (Collapse)Author
2019-12-11Resolves: tdf#128867 support LocalizedDecimalSep for native gtk dialogsCaolán McNamara
Change-Id: Idb883707fb89d1f76b24ea592c51e28fffd2322f Reviewed-on: https://gerrit.libreoffice.org/84952 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2019-12-11lok: Support per-view help dataTamás Zolnai
Used for showing tooltip windows in LO online. Change-Id: I8b6a7272c75025e717923c839fa8fd9f4cab2903 Reviewed-on: https://gerrit.libreoffice.org/84717 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Andras Timar <andras.timar@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/84803 Tested-by: Jenkins
2019-12-09only connect to tooltip query when we have toCaolán McNamara
Change-Id: I0b7f1b798129b41c9831ccdd47cd509680b19de2 Reviewed-on: https://gerrit.libreoffice.org/84742 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2019-12-09Related tdf#108458 if no TooltipHdl set use usual tooltipCaolán McNamara
also if the Tooltip was blank continue to use usual tooltip Change-Id: I7dd02ffcbb558684ff41e50586284607a1ea4881 Reviewed-on: https://gerrit.libreoffice.org/84741 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2019-12-09tdf#108458 related: Add tooltip handling to TreeViewJim Raykowski
Supports GtkInstanceTreeView and SalInstanceTreeView Change-Id: I33984f78c26135319531eace2a3e2e2e28712af1 Reviewed-on: https://gerrit.libreoffice.org/84587 Tested-by: Jenkins Reviewed-by: Heiko Tietze <heiko.tietze@documentfoundation.org> Tested-by: Heiko Tietze <heiko.tietze@documentfoundation.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2019-12-09weld Property BrowserCaolán McNamara
Replaced the odd HyperlinkField Edit whose text can be clicked on to activate listeners, with an ordinary Edit and a Button beside it which can be clicked instead to do that. I couldn't find a real world use of this HyperlinkField in the forms or control properties, nor in casual experimentation in the sidebar in the basicide dialog editor. Also replaced the other strange Edit-alike TextView with a real Edit entry and a dropdown which can be used to support entry of multi-line labels Change-Id: Iad5265e404f6de14c8e760d617dbad49cd6ddead Reviewed-on: https://gerrit.libreoffice.org/82213 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2019-12-07return blank ident if empty notebookCaolán McNamara
Change-Id: Icede4b1458fe858cc6d406b4cbae9f8d579d417b Reviewed-on: https://gerrit.libreoffice.org/84660 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2019-12-06keep just one shared reference to Skia shared GrContextLuboš Luňák
This should make it easier to keep the reference without having to keep references all over the place, especially when the shared GrContext starts to be used also for GPU-backed surfaces elsewhere. Change-Id: Icf3f6eb849ebc5eb63b1836f9caeb6f5e5e58ca6 Reviewed-on: https://gerrit.libreoffice.org/84560 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2019-12-05KF5 drop KF5FilePicker::executeJan-Marek Glogowski
To prevent calls to Qt5FilePicker::updateAutomaticFileExtension, it is simply made virtual with an empty override. This is needed, because the KF5 file picker has its own automatic extension handling. The main motivation is the fix for tdf#129071, which will result in some major changes to XExecutableDialog::execute, so this will prevent larger code duplication later. Change-Id: I5f747f0828cb8a65b4e7043f3ee68ebd31973e6a Reviewed-on: https://gerrit.libreoffice.org/84297 Reviewed-by: Michael Weghorn <m.weghorn@posteo.de> Tested-by: Jenkins
2019-12-05Qt5 hide more Qt5FilePicker detailsJan-Marek Glogowski
* Make most members private * Drop some unused members * Rename some single-char variables for easier reading * Spread some constness * Finalize the KF5FilePicker class * Test the native picker setting of the QFilePicker, instead of an additional bool member This is just some refactoring. While not strictly needed, it helps keeping the following patches fixing tdf#129071 more compact. Change-Id: I15ffe4de848a9498d7f61f99bcf031257da7cb08 Reviewed-on: https://gerrit.libreoffice.org/84456 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2019-12-04factor out 'weld::Widget as XWindow'Caolán McNamara
Change-Id: I24b52c5b8908fdf1a66fd26b2dc438b9557afa6e Reviewed-on: https://gerrit.libreoffice.org/82641 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2019-12-04weld ONavigatorCaolán McNamara
Change-Id: I0b1ae0d50fa8b4c01c36ece0fdd1c2b316ccd27b Reviewed-on: https://gerrit.libreoffice.org/84357 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2019-12-03tdf#129068 try dialog content area help before dialog itselfCaolán McNamara
we already check current notebook page before the dialog, now check the content area before the dialog Change-Id: Ieedb5727ddec6d24adc6e70144977b5c3063c0fd Reviewed-on: https://gerrit.libreoffice.org/84245 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2019-12-03remove some useless comment linesNoel Grandin
which merely announce that the next declaration is a class Change-Id: Ifdb1398bcd99816b13e0b3769b46d0562bfbc1dc Reviewed-on: https://gerrit.libreoffice.org/84229 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-12-03avoid invalid static_cast when mixing X11 and OpenGL bitmapsLuboš Luňák
This can happen because lcl_SelectAppIconPixmap() temporarily disables OpenGL, but in case an icon to be loaded is already cached(?), the bitmap variant may be OpenGL. Happens when launching LO in OpenGL mode with the X11 gen backend, and then selecting Writer in the start screen. Change-Id: I65110dee79769c430eaa8a2cf3dc11119ab02520 Reviewed-on: https://gerrit.libreoffice.org/84246 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2019-12-03tdf#129134 ApplicationColors Scrolled List moves too littleCaolán McNamara
Change-Id: I5cb6ac017f1d2a916297676724d523634afb2020 Reviewed-on: https://gerrit.libreoffice.org/84252 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2019-12-03Fix compilation with `make -- dbglevel=2`Alex Henrie
Change-Id: Icdf93751b00453eb033fd577413bd6bc3527f87c Reviewed-on: https://gerrit.libreoffice.org/84286 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-12-01weld FmFieldWinCaolán McNamara
needs drag source support fixes a leak of ColumnInfo data as well Change-Id: I671834726aed3fd4de096b56baaa592f51a9e73e Reviewed-on: https://gerrit.libreoffice.org/84147 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2019-12-01Introduce o3tl::optional as an alias for std::optionalStephan Bergmann
...with a boost::optional fallback for Xcode < 10 (as std::optional is only available starting with Xcode 10 according to <https://en.cppreference.com/w/cpp/compiler_support>, and our baseline for iOS and macOS is still Xcode 9.3 according to README.md). And mechanically rewrite all code to use o3tl::optional instead of boost::optional. One immediate benefit is that disabling -Wmaybe-uninitialized for GCC as per fed7c3deb3f4ec81f78967c2d7f3c4554398cb9d "Slience bogus -Werror=maybe-uninitialized" should no longer be necessary (and whose check happened to no longer trigger for GCC 10 trunk, even though that compiler would still emit bogus -Wmaybe-uninitialized for uses of boost::optional under --enable-optimized, which made me ponder whether this switch from boost::optional to std::optional would be a useful thing to do; I keep that configure.ac check for now, though, and will only remove it in a follow up commit). Another longer-term benefit is that the code is now already in good shape for an eventual switch to std::optional (a switch we would have done anyway once we no longer need to support Xcode < 10). Only desktop/qa/desktop_lib/test_desktop_lib.cxx heavily uses boost::property_tree::ptree::get_child_optional returning boost::optional, so let it keep using boost::optional for now. After a number of preceding commits have paved the way for this change, this commit is completely mechanical, done with > git ls-files -z | grep -vz -e '^bin/find-unneeded-includes$' -e '^configure.ac$' -e '^desktop/qa/desktop_lib/test_desktop_lib.cxx$' -e '^dictionaries$' -e '^external/' -e '^helpcontent2$' -e '^include/IwyuFilter_include.yaml$' -e '^sc/IwyuFilter_sc.yaml$' -e '^solenv/gdb/boost/optional.py$' -e '^solenv/vs/LibreOffice.natvis$' -e '^translations$' -e '\.svg$' | xargs -0 sed -i -E -e 's|\<boost(/optional)?/optional\.hpp\>|o3tl/optional.hxx|g' -e 's/\<boost(\s*)::(\s*)(make_)?optional\>/o3tl\1::\2\3optional/g' -e 's/\<boost(\s*)::(\s*)none\>/o3tl\1::\2nullopt/g' (before committing include/o3tl/optional.hxx, and relying on some GNU features). It excludes some files where mention of boost::optional et al should apparently not be changed (and the sub-repo directory stubs). It turned out that all uses of boost::none across the code base were in combination with boost::optional, so had all to be rewritten as o3tl::nullopt. Change-Id: Ibfd9f4b3d5a8aee6e6eed310b988c4e5ffd8b11b Reviewed-on: https://gerrit.libreoffice.org/84128 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-12-01boost::optional: replace uses of get_value_or with value_orStephan Bergmann
...in preparation for wholesale replacement of boost::optional with o3tl::optional, which will be an alias for either std::optional or boost::optional, and std::optional only has value_or. boost::optional::value_or was added with <https://github.com/boostorg/optional/ commit/3984c9f9a157ef116cea69bc8bb20f433320eb61> "Added function value_or()", which according to git-describe first appeared in tag boost-1.56.0. We appear to have no strict Boost baseline (the closest we get is with > [AC_MSG_ERROR(boost/spirit/include/classic_core.hpp not found. install boost >= 1.36)] in configure.ac), and at least CentOS 7 TDF machine tb76 only has boost-devel-1.53.0-27.el7.x86_64. However, any environment using Xcode < 10 that needs to make o3tl::optional fall back to boost::optional should use --without-system-boost, and external/boost is currently at 1.69.0, so should be safe. ATTENTION: In isolation, this commit will break in any environment that uses Boost older than 1.56.0. It requires the following commit introducing o3tl::optional. (But doing these changes in individual commits was deemed more valuable than supporting a hypothetical future git-bisect against an old Boost.) Change-Id: Ib31affa3eebf0d0029d8620dc6abb7a60f6c7629 Reviewed-on: https://gerrit.libreoffice.org/84127 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-12-01missing includeStephan Bergmann
Change-Id: I7dc79698e642b3b971a769c57d7c7b9cfded249b Reviewed-on: https://gerrit.libreoffice.org/84132 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-11-30Rewrite uses of boost::optionalStephan Bergmann
...to only use functions that are also available for std::optional (in preparation for changing from boost::optional to std::optional): * uses of get are replaced with operator * or operator -> * uses of is_initialized are replaced with operator bool * uses of reset with an argument are replace with operator = (All of the replacements are also available for boost::optional "since forever", so this change should not break builds against old --with-system-boost. An alternative replacement for is_initialized would have been has_value, but that is only available since Boost 1.68.) Change-Id: I532687b6a5ee37dab28befb8e0eb05c22cbecf0f Reviewed-on: https://gerrit.libreoffice.org/84124 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-11-27Blind fix for 32-bit buildsStephan Bergmann
(where sal_Int32 is long, not int) Change-Id: I45c937f1622b2599b5f63a1dba04757276663302 Reviewed-on: https://gerrit.libreoffice.org/83912 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-11-27tdf#108642 load accessibility children fasterNoel Grandin
Reduces the cost of repeatedly iterating over the page objects, by adding a new XAccessibleContext3 interface to return accesibility children in one call. This takes the load time from 5.6s to 3.2s. Change-Id: Ifcc20fa7e7ab8ad50417073882c8c3a2405d1eaa Reviewed-on: https://gerrit.libreoffice.org/83850 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-11-27revert BackendCapabilities::mbSupportsBitmap32 for SkiaLuboš Luňák
It appears that there are still some paths that do not expect bitmaps to be truly 32bit, so better revert to the old safe (and poor, complicated and inefficient) way of pretty much ignoring the alpha channel in SkiaSalBitmap, and let BitmapEx handle it by using an extra alpha bitmap. Change-Id: I4318c05f4ceafc5de48e19eeae5efe2abed2ec69
2019-11-27handle properly true 32bit bitmaps in some placesLuboš Luňák
I.e. those created with vcl::BackendCapabilities::mbSupportsBitmap32 set. But there are quite possibly many more places that do not expect that the Bitmap itself would contain alpha. Change-Id: I83db37b3d346f42565f96b9bbf81c71b97b6bf8b
2019-11-27extend vcl backendtest to more backendsLuboš Luňák
At least the KF5/Qt5 VCL plugins passes fine. Change-Id: I033ddf6ae9cc663729ca459cdc514dc0fa51ddc2
2019-11-27reimplement supportsOperation() for Skia and OpenGLLuboš Luňák
The shared X11 implementation depends on XRender, which doesn't make any sense. Change-Id: I82f36e0835a993a8b226af211d8635336960d7ec
2019-11-27refactor Windows OpenGLGlyphCache stuff to be reusable for SkiaLuboš Luňák
Basically just remove 'OpenGL' from names of most of the classes, turn them into base classes that have OpenGL subclasses that actually implement the functionality. Change-Id: Idf1f347cebc2a417bda37d6955201c775ecb0890
2019-11-27build properly with or without Skia enabledLuboš Luňák
Change-Id: I5106f13682963b81753f79c3203d4ef7387664fe
2019-11-27Skia supports 32bit bitmapsLuboš Luňák
And I'd say OpenGL does as well, but enabling this for OpenGL makes some tests fail, so let's keep this only for Skia. Change-Id: Ibbbb460cd053f4a6caa4e3a8a9c6ec52e19dcd38
2019-11-27initial empty Skia VCL implementationLuboš Luňák
This mostly duplicates OpenGL cases. Pretty much all implementation methods are empty. Change-Id: I333506f56dcc46c3e9405fe8194c172de17c54fd
2019-11-27move opengl vcl files to opengl/Luboš Luňák
Better to have all of them together rather than scattered. Change-Id: I1f8bbfb7018a6c28c87e4dfa2acbf4efde62894b
2019-11-27tdf#126043 use another bulk_insert_for_eachCaolán McNamara
Change-Id: I05c3fc6e708d000ba955981dbd8d11371ea99da2 Reviewed-on: https://gerrit.libreoffice.org/83686 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2019-11-26tdf#126043 we can use the stock attribute to skip an intermediate BitmapCaolán McNamara
Change-Id: I972774bb2b2b3e494804145a1eebca57e519c3bd Reviewed-on: https://gerrit.libreoffice.org/83680 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2019-11-25Related: tdf#126043 use fastest png compression ratioCaolán McNamara
doesn't make much difference, but doesn't hurt Change-Id: I60a033026b11853d76e77f7871fb33fb2ae7eccb Reviewed-on: https://gerrit.libreoffice.org/83622 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2019-11-22wrong delete signal idCaolán McNamara
Change-Id: I4aecd3c8f5d40c3256d2d2816a79f8809db6cedb Reviewed-on: https://gerrit.libreoffice.org/83518 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
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-20honour MenuFlags::AlwaysShowDisabledEntries for native gtk menusCaolán McNamara
Change-Id: I3d26320061f3da01e9b857cb3dad277f3d7aa4f5 Reviewed-on: https://gerrit.libreoffice.org/83293 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2019-11-20hide help buttons when LibreOfficeKit::isActive and local help unavailableCaolán McNamara
Change-Id: Ia263f9f7c78dbf48143678fc2f577402fb1ce998 Reviewed-on: https://gerrit.libreoffice.org/83304 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2019-11-20consistency wrt notification events for treeview cursor changeCaolán McNamara
Change-Id: I4ecc13cd7163304c0fa1683e75299d03ccc06446 Reviewed-on: https://gerrit.libreoffice.org/83283 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2019-11-19Improved loplugin:external, handling class typesStephan Bergmann
...plus follow-up loplugin:fakebool and renaming the non-external (moved to unnamed namespace) three-parameter load_icon_by_name overload to load_icon_by_name_theme_lang, because it would otherwise hide the one-parameter load_icon_by_name Change-Id: Ie01151c1b4648bd797cc455ec092281448ed4637 Reviewed-on: https://gerrit.libreoffice.org/83134 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-11-19Improved loplugin:external, handling class typesStephan Bergmann
...plus follow-up loplugin:fakebool and loplugin:consttobool findings Change-Id: I4b4045439fc9b19c42f6915b158540d2daf4cafb Reviewed-on: https://gerrit.libreoffice.org/83123 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-11-19Rename GlyphCache to FreetypeManagerJan-Marek Glogowski
And while at it remove the unneeded getPlatformGlyphCache abstraction. Change-Id: Id5cad751eda9e6bf177dfb4816280d7c5af7066a Reviewed-on: https://gerrit.libreoffice.org/83125 Tested-by: Jenkins Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
2019-11-19tdf#128434 correctly release fonts in destructorsJan-Marek Glogowski
This adds ReleaseFonts() calls to all destructors of SalGraphics and TextRenderImpl derivated classes, which implement SetFont. During destruction a base class can't call into derivated classes, as these are already destructed, so we have to spread these calls manually. Change-Id: Ia57db04f7df665e5205212ce512119e2f60e3379 Reviewed-on: https://gerrit.libreoffice.org/82967 Tested-by: Jenkins Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
2019-11-19tdf#128434 try garbage collect ImplFontCache fontsJan-Marek Glogowski
Instead of changing the harfbuzz caching, for this use case it's enough to queue all per-OutputDevice fonts for garbage collection (GC), which are managed by the OutputDevices ImplFontCache. So just try to GC all the fonts in the ImplFontCache destructor. There is no point keeping these LogicalFontInstances alive, after the OutputDevice font cache is destroyed, as these fonts aren't shared and can't be accessed later. But the main problem is still some correct accounting of harfbuzz resources and eventual even the Freetype ones, so this cleanup would not really be needed. AFAI can tell, this plugs the remaining per-document leaks of the PDF generation, except for a 72 byte basic listener leak from: basic::ImplRepository::impl_createManagerForModel(...) basicmanagerrepository.cxx:480 Change-Id: I3155be59a2bdcd85e01f6f048b990db04d88c94f Reviewed-on: https://gerrit.libreoffice.org/82968 Tested-by: Jenkins Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
2019-11-19Move static aFontFileList into GlyphCacheJan-Marek Glogowski
GlyphCache is already a global in the unix SalData class, so we can drop one more global static variable. and the FontFile map values aren't shared, so just use std::unique_ptr, like the two other maps, which form the GlyphCache class. While at it finalize the classes and hide their constructors. Change-Id: Iaac8cd9905e9b4025707a17f62d8961ccfa5d0fb Reviewed-on: https://gerrit.libreoffice.org/82966 Tested-by: Jenkins Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
2019-11-17Extend loplugin:external to warn about enumsStephan Bergmann
To mitigate the dangers of silently breaking ADL when moving enums into unnamed namespaces (see the commit message of 206b5b2661be37efdff3c6aedb6f248c4636be79 "New loplugin:external"), note all functions that are affected. (The plan is to extend loplugin:external further to also warn about classes and class templates, and the code to identify affected functions already takes that into account, so some parts of that code are not actually relevant for enums.) But it appears that none of the functions that are actually affected by the changes in this commit relied on being found through ADL, so no adaptions were necessary for them. (clang::DeclContext::collectAllContexts is non-const, which recursively means that External's Visit... functions must take non-const Decl*. Which required compilerplugins/clang/sharedvisitor/analyzer.cxx to be generalized to support such Visit... functions with non-const Decl* parameters.) Change-Id: Ia215291402bf850d43defdab3cff4db5b270d1bd Reviewed-on: https://gerrit.libreoffice.org/83001 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-11-15tdf#123734 Prepend "Custom." for values of custom PPD optionsMichael Weghorn
CUPS supports using custom options in PPDs, which go beyond what is specified in the PPD specification, s. doc at at [1]. [2] mentions that the "Custom." prefix is needed when specifying custom page sizes: > When Custom is listed for the PageSize option, you can specify custom > media sizes using one of the following forms: > > lp -o media=Custom.WIDTHxLENGTH filename > lp -o media=Custom.WIDTHxLENGTHin filename > lp -o media=Custom.WIDTHxLENGTHcm filename > lp -o media=Custom.WIDTHxLENGTHmm filename While I did not find any explicit documentation that the same is true for CUPS-specific custom options, this is apparently the case. (The "CustomPageSize" keyword is expclicitly specified in the PPD specification [3], section 5.16 "Custom Page Sizes" and thus not a CUPS-specific custom option.) This can be seen e.g. by the fact that after setting the default value for a PPD option to such a custom value, the corresponding entry in the PPD does get the "Custom." prefix, e.g. *DefaultPassword: Custom.12345 for the sample PPD from tdf#123734. For more details, s.a. the discussion on the similar bug report for Gtk+ at [4], where e.g. comment 0 says: > According to the cups people, the value should have been > "Custom.ThisIsAtest" in this case. Without the "Custom." part, > this is not used by the cups filters. Therefore, add the "Custom." prefix for custom options, but don't show them in the UI. [1] https://www.cups.org/doc/spec-ppd.html#OPTIONS [2] https://www.cups.org/doc/options.html [3] https://web.archive.org/web/20161017222612/http://partners.adobe.com/public/developer/en/ps/5003.PPD_Spec_v4.3.pdf [4] https://bugzilla.gnome.org/show_bug.cgi?id=543520 Change-Id: I570d8b55212c6fc33405460f11d152e86cedb0f9 Reviewed-on: https://gerrit.libreoffice.org/82722 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2019-11-14New loplugin:consttoboolStephan Bergmann
...to: "Find implicit conversions from non-'bool' constants (e.g., 'sal_False') to 'bool'". Due to how FALSE is defined as just #define FALSE (0) (i.e., a literal of type 'int') but TRUE is defined as #define TRUE (!FALSE) (i.e., an implicit conversion from 'int' to 'bool') in GLib (see the comment in ConstToBool::VisitImplicitCastExpr), we get more warnings about uses of 'TRUE' than of 'FALSE'. For example, in libreofficekit/source/gtk/lokdocview.cxx there is a warning about the 'TRUE' in g_main_context_iteration(nullptr, TRUE); but not about the 'FALSE' in g_main_context_iteration(nullptr, FALSE); (where the parameter of 'g_main_context_iteration' is of type 'gboolean'). Lets live with that asymmetry for now... (Besides the issues addressed directly in this commit, it also found the two bogus asserts at 7e09d08807b5ba2fd8b9831557752a415bdad562 "Fix useless assert(true) (which would never fire)" and 122a0be8ae480473bd1d7f35e197a2529f4621e3 "Fix useless assert(true) (which would never fire)", plus 5f0d6df7f57ae281fe161e61c7f25d67453fddd2 "Use two-argument form of static_assert".) Change-Id: Id77322de9f94b85a7b65608a03e0e9865d14467b Reviewed-on: https://gerrit.libreoffice.org/82667 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>