summaryrefslogtreecommitdiff
path: root/vcl/unx/generic
AgeCommit message (Collapse)Author
2023-08-03tdf#114192: Speed up populating font list when FontConfig is usedKhaled Hosny
Instead of calling psp::PrintFontManager::analyzeFontFile() get the font names and metadata, use the values taken from FontConfig which nowadays provides everything we need. This speeds up startup time significantly, especially when there is a large number of fonts installed. This also uses the correct style name, we were mixing name id 1 (family) with name id 17 (typographic subfamily) while we should have been using name id 2 (subfamily). The name ids 1, 2 and 16, 17 should be used together not mixed and matched, and we need the former because it is compatible with the R/I/B/BI model we (and the other office suite) use. So instead of "Foo Black, Black", we now get "Foo Black, Regular". On a system with 6616 fonts installed. Before: $ export OOO_EXIT_POST_STARTUP=1 $ time ./instdir/program/soffice.bin --headless real 0m4.744s user 0m1.672s sys 0m2.547s after: $ export OOO_EXIT_POST_STARTUP=1 $ time ./instdir/program/soffice.bin --headless real 0m1.377s user 0m0.563s sys 0m0.297s Change-Id: Ib7e358f16530c2daabc7ef677ef6a148fdf08e6e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155313 Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com> Tested-by: Jenkins Reviewed-by: خالد حسني <khaled@libreoffice.org>
2023-08-03Raise minimum FontConfig version to 2.12.0Khaled Hosny
I want to use FC_SYMBOL and this the first stable version to have it, and our baseline has 2.13.x already. Change-Id: I606b99190020085cdf20a52788a021543c365fca Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155312 Tested-by: Jenkins Reviewed-by: خالد حسني <khaled@libreoffice.org>
2023-08-02vcl: Simplify analyzeSfntFamilyNameKhaled Hosny
We only need a family name not a set of name, and drop a work around for a broken font that is probably long obsolete. Change-Id: I219ec58e65826250d08b3e88462fdcc1e2e2b7f4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155195 Tested-by: Jenkins Reviewed-by: خالد حسني <khaled@libreoffice.org>
2023-08-02vcl: Drop the PrintFont -> FastPrintFontInfo -> FontAttributes indirectionKhaled Hosny
We want FontAttributes at the end, so lets have them up front instead of the intermediary structures. Change-Id: Iafdf17f4a7615f0c3d972e6080cebea0183840b7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155191 Tested-by: Jenkins Reviewed-by: خالد حسني <khaled@libreoffice.org>
2023-08-02vcl: Drop unused FontAttributes::GetMapNames()/AddMapName()Khaled Hosny
Change-Id: I50e06ad24e95cab39009a8affb876ebc920c1c11 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155168 Tested-by: Jenkins Reviewed-by: خالد حسني <khaled@libreoffice.org>
2023-08-02vcl: Fold two static method into their only call siteKhaled Hosny
Change-Id: Ifa943bd658892d4fcf8e47a6abfa245fbcaa78a5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155161 Tested-by: Jenkins Reviewed-by: خالد حسني <khaled@libreoffice.org>
2023-08-02split Point/Size/Rectangle into AbsoluteScreenPixel* typesNoel Grandin
to attempt to make it obvious in code what kind of coordinate system we are dealing with. The idea is that by doing this, the compile-time type checking will flush out inconsistencies between different code. I started with vcl::Window::OutputToAbsoluteScreenPixel and worked outwards from there. Change-Id: Ia967d7a0bb38886695f3a761b85c8b9340ddb1c0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154676 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-08-02std::set->o3tl::sorted_vector for m_aFontFileToFontIDNoel Grandin
sorted_vector is perfect for small sets of small objects, and fontId is an int. Change-Id: I6955ae1a8793c47cf79b3080e566d7b50896b3e9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155192 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-07-31tdf#156230 one more unused pieceNoel Grandin
Change-Id: I903c55b1f4718c99269460a940be86cad95d11ec Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155082 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-07-31all drawPolyPolygon variants return true nowCaolán McNamara
since: commit 4998de76ed1da4039e30718941d50d6f1dfe4f82 Date: Sun Jul 30 07:40:48 2023 +0000 tdf#156230: Drop freshly unused GenPspGfxBackend Change-Id: I7fc2a068f807777ed392c5d58772d130bf7f51c8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155076 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2023-07-31tdf#156230 remove now unused various bit and piecesNoel Grandin
Change-Id: I0ad88d402329bbc6882f53f6c20c22b97189a27f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155077 Tested-by: Jenkins Reviewed-by: خالد حسني <khaled@libreoffice.org>
2023-07-30Drop freshly unused PrintFontManagerKhaled Hosny
Change-Id: If4cec80eaf1301907d144ecb8518a4de5acdeefb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155070 Tested-by: Jenkins Reviewed-by: خالد حسني <khaled@libreoffice.org>
2023-07-30tdf#156230: Drop freshly unused PSLevel settingKhaled Hosny
Change-Id: I9331b5532f8066f7d13815487c7af0e7fd37e54f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155068 Tested-by: Jenkins Reviewed-by: خالد حسني <khaled@libreoffice.org>
2023-07-30tdf#156230: Drop freshly unused PrinterJob and PrinterGfxKhaled Hosny
Change-Id: I5149fb447e76044e7f4bfdd9a79ee3b454859375 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155065 Tested-by: Jenkins Reviewed-by: خالد حسني <khaled@libreoffice.org>
2023-07-30tdf#156230: Drop freshly unused GenPspGfxBackendKhaled Hosny
Change-Id: Idfc4364b99ed605462aae58391e98960be6021b5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155064 Tested-by: Jenkins Reviewed-by: خالد حسني <khaled@libreoffice.org>
2023-07-30tdf#156230: Use SvpGraphicsBackend in GenPspGraphicsKhaled Hosny
We no longer draw to PostScript, so old backend is unneeded. Change-Id: I069ce735b303721be7de6abf69aa26c1b25a9107 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155063 Tested-by: Jenkins Reviewed-by: خالد حسني <khaled@libreoffice.org>
2023-07-30tdf#156230: Use CairoTextRender in GenPspGraphicsKhaled Hosny
We no longer draw to PostScript, so old layout implementation is unneeded. Change-Id: Ifd007f8dd7794e348abb863c1c36d5c79ac7e0e2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155062 Tested-by: Jenkins Reviewed-by: خالد حسني <khaled@libreoffice.org>
2023-07-30tdf#156230: Drop freshly dead PspSalPrinter codeKhaled Hosny
Change-Id: I272c8f3a4d70ef9d5d03eecc8c91ee8423c52ccc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154976 Tested-by: Jenkins Reviewed-by: خالد حسني <khaled@libreoffice.org>
2023-07-30tdf#156230: Drop PDFDevice handlingKhaled Hosny
Change-Id: I53759eb6025a4fc7e1319d0d1e7b3072edde93c2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154975 Tested-by: Jenkins Reviewed-by: خالد حسني <khaled@libreoffice.org>
2023-07-30tdf#156230: Deprecate and stop using PDFAsStandardPrintJobFormatKhaled Hosny
PDF is the only supported printing format (on Unix) going forward. Change-Id: I1bd442bac370b89a77e2035d4c17bfc43a869ab1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154974 Tested-by: Jenkins Reviewed-by: خالد حسني <khaled@libreoffice.org>
2023-07-25loplugin:unusedfieldsNoel Grandin
Change-Id: If9c76b9c500a5bee0fbf20a44597a250b7fa2af0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154808 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-07-23vcl: Drop now unneeded DevicePoint typedefKhaled Hosny
It has been always typedef'd to basegfx::B2DPoint since: commit 5e218b5c51f7d9cd10bd9db832879efca41b9c75 Date: Wed Jan 12 21:19:32 2022 +0000 always use B2DPoint for DevicePoint Change-Id: I9f5202d5a71c77dd79f1759923917c26bf68a9af Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154632 Tested-by: Jenkins Reviewed-by: خالد حسني <khaled@libreoffice.org>
2023-07-23vcl: TextRenderModeForResolutionIndependentLayout → SubpixelPositioningKhaled Hosny
Change-Id: I8698d0f74889ac8a7de64a97e8cf0e8878ef7fc4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154517 Tested-by: Jenkins Reviewed-by: خالد حسني <khaled@libreoffice.org>
2023-07-23vcl: Use HarfBuzz to get glyph bounding rectangleKhaled Hosny
For consistent cross-platform results that also matches our glyph advances since platform functions might be using hints which we don’t use. Change-Id: I4aebd3e7c5f460dff584f5eba74f7a11bab0f9b1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154388 Tested-by: Jenkins Reviewed-by: خالد حسني <khaled@libreoffice.org>
2023-07-21Assume that, if we have X11, it supports XineramaNoel Grandin
By now, Xinerama is old enough that we can use the X11 server supports it Change-Id: Ida95902916697808c611a53274b1f0299fd298b7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154666 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-07-03Rename and move header next to other font headersKhaled Hosny
Change-Id: I5485817b5a6c2e9538ed6fb00893663d09e7fa26 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153869 Tested-by: Jenkins Reviewed-by: خالد حسني <khaled@libreoffice.org>
2023-07-03Rename ImplFontMetricData -> FontMetricDataKhaled Hosny
Change-Id: I0f8753a5ef1865f4ea0431125e74d0f52aa1c396 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153868 Tested-by: Jenkins Reviewed-by: خالد حسني <khaled@libreoffice.org>
2023-07-01Remove option to set printer language typeKhaled Hosny
Drop support for changing printer language type from printer properties dialog, in preparation for dropping support for PostScript printing. This is a follow up to: commit 2a40505d00fcd79bfa433c301ddc05a35287bfb1 Date: Thu Jan 26 11:49:43 2023 +0000 remove option to toggle IsPDFAsStandardPrintJobFormat from UI Change-Id: I970d627588396d6ff648d6e6304e449da7ec1425 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153817 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2023-06-30loplugin:unusedmethodsNoel Grandin
Change-Id: I8d3402a69237b665462e04440ad73fe29e2133db Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153807 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-06-29loplugin:unusedmethodsNoel Grandin
Change-Id: I95ab7581dec35b113cb657ce8e5ee27c89c73593 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153746 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-06-22Detect Plasma 6 desktopMichael Weghorn
Add detection for Plasma 6, which is currently in development stage. With the following plasma-workspace commit [1] in place, KDE_SESSION_VERSION is set to 6, so use that to detect it: commit 4c2242d7dfafac161baec3ec316af24d7b48ef8b Author: Michael Weghorn <m.weghorn@posteo.de> Date: Thu Jun 22 07:47:31 2023 +0200 Set KDE_SESSION_VERSION to 6 Since the master branch is based on Qt6/KF6 and will become Plasma 6, set KDE_SESSION_VERSION to "6". This will allow other applications to detect they're running in a (preview of a) Plasma 6 session and react accordingly. (E.g. LibreOffice can use this to choose to use its upcoming kf6 integration by default instead of the kf5 one.) [1] https://invent.kde.org/plasma/plasma-workspace/-/commit/4c2242d7dfafac161baec3ec316af24d7b48ef8b Change-Id: I5a15ad1fb177721fbfa016139c56a08b228f2e1f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153437 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2023-06-21Require icu-i18n >= 66Khaled Hosny
We were requiring ICU 4.6 which was released in 2011, and ifdef'ing our way through newer ICU versions. ICU is a core dependency and it makes no sense to build LibreOffice with such ancient versions of it. This change requires ICU 66 (released in 2020), and removes all the ifdefs for older versions. There are more cleanups to do, but these will be done separately. Change-Id: I2e4f7608a08f4d531b0a4c74bbfdf91a451f833f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153387 Tested-by: Jenkins Reviewed-by: خالد حسني <khaled@libreoffice.org>
2023-06-13When adding application fonts, add them also to FontConfigKhaled Hosny
This way FontConfig can use them for missing chars font fallback. Change-Id: I63be8a62db9bdacc83be2327555c558d4cd476bf Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152954 Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com> Tested-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2023-06-13tdf#147021: vcl/* KeyboardReplacements SAL_N_ELEMENTS removalDr. David Alan Gilbert
A couple more tables using SAL_N_ELEMENTS. (I do wonder why these are separate). Note, I've not attacked the 'for' use of SAL_N_ELEMENTS in these files since they require some separate thinking about their indexing. Change-Id: I7fe66510fce7d59bda34b1f22417a2fb6070b065 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152775 Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com> Tested-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2023-06-09Related: CollaboraOnline#6511 cairo backend can do transparent textCaolán McNamara
and avoid the extra work required here for the generic case. keep the transparency helper for the other backends, or any case where we may be recording to metafile, or pdf export etc Change-Id: Ic01b8b69f2d59e585605ce1e981298fda9185824 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152719 Reviewed-by: Michael Meeks <michael.meeks@collabora.com> Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2023-05-28Use getXWeak in vclMike Kaganski
Change-Id: I665c9dc8c4f9cc4a996d9bf990cbfa33822bd07f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150885 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2023-05-23perf: surprising to see PDF being vsprintf'd during JSDialog rendering.Michael Meeks
Avoid some hundreds of these: _cairo_pdf_surface_show_page ... cairo_surface_destroy CairoTextRender::CairoTextRender via. SvpCairoTextRender: :SvpCairoTextRender(SvpSalGraphics&) SvpSalGraphics: :SvpSalGraphics() Change-Id: Ieefb65138f7e685f09dbf4c36a2fccd39b4b05cd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152173 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2023-05-20loplugin:unusedmethodsNoel Grandin
Change-Id: Ief95f111350808f010539bb733a553007d30a9df Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152006 Reviewed-by: Tomaž Vajngerl <quikee@gmail.com> Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-05-17menus all black with SAL_RTL_ENABLED=1 and SAL_USE_VCLPLUGIN=genCaolán McNamara
export SAL_USE_VCLPLUGIN=gen export SAL_RTL_ENABLED=1 run writer and the menus are all black a problem since: commit 622e8cd9e5c96d0fe0bb02e07d95efa93c156c44 Date: Wed Jan 11 11:00:43 2023 +0000 reuse CairoCommon GetGraphicsWidth from X11CairoSalGraphicsImpl so restore the use of mrParent.m_pFrame as done in original implementation Change-Id: I21f76b2e57b7ea6d910552d3b07830811152bfe3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151874 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2023-05-09Resolves: tdf#142176 under GNOME inhibit logout if there are modified docsCaolán McNamara
and if we are forced to quit anyway, unset modifications on documents and terminate. Change-Id: If4a3aed48a4621950e2d630fdfef34b28ba1b089 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151575 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2023-05-09Related: tdf#142176 rearrange screensaver inhibiter to be more genericCaolán McNamara
and for not-x11 I see gtk just uses 0 for xid (which is called window_system_id there now) Change-Id: I9248bcceaa2d21d34133dea80697776df0aa8c6c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151560 Tested-by: Caolán McNamara <caolanm@redhat.com> Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2023-05-09Related: tdf#142176 document what the other inhibit options areCaolán McNamara
via an enum like the gtk one so it can be seen how to inhibit logging out due to unsaved changes Change-Id: I07609cfb7a97b5b6c1b94a09b7b79bcca308d5d1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151559 Tested-by: Caolán McNamara <caolanm@redhat.com> Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2023-04-24tdf#147906 Use std::hypot for Pythagorean additionbuldi
Change-Id: I47611e1bffed814294bd2c7b23b26e1878151464 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149939 Tested-by: Jenkins Reviewed-by: Hossein <hossein@libreoffice.org>
2023-04-21loplugin:unnecessarygetstr extend to checking std::string::c_strNoel Grandin
Change-Id: I17398e2a6a31a2c98ba8e54b5c8045f22aee8759 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150749 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-04-19loplugin::unusedmethodsNoel Grandin
Change-Id: I6a07860edb13588b83345babeb53675aedc43f7a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150607 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-04-13use more string_view in PrinterInfoManagerNoel Grandin
Change-Id: Ib0173b1a33be7156c27c81b0804ac7c4d3373857 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150336 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-04-09cid#1524699 silence Uninitialized scalar variableCaolán McNamara
Change-Id: I32fc2570e8553be356e5c5c059b92791f5e9106a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150164 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2023-04-05Fix typoAndrea Gelmini
Change-Id: I1cf23442667a8ac6e9f8da2ea72bf60f5126236e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150047 Tested-by: Julien Nabet <serval2412@yahoo.fr> Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2023-04-05tdf#132112 excessive stretch of braces can trigger freetype into an errorCaolán McNamara
which propogates to cairo and once a cairo surface is in an error state, that cannot be cleared and all subsequent drawing fails, so bodge that with a high degree of stretch we draw the brace without stretch to a temp surface and stretch that to give a far poorer visual result, but one that can at least be rendered. Change-Id: I6b8bb079e82c3cf03a908de750c5c445ad230750 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150031 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2023-04-05split out a makeCacheIdCaolán McNamara
Change-Id: I89fbaca1fa7303904681f75ee4a7fc90aeb9ef8e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150030 Tested-by: Caolán McNamara <caolanm@redhat.com> Reviewed-by: Caolán McNamara <caolanm@redhat.com>