summaryrefslogtreecommitdiff
path: root/vcl
AgeCommit message (Collapse)Author
2022-05-05use more o3tl::getTokenNoel Grandin
found by inspecting call sites of OUString::getToken Change-Id: I4269c7476c7aa46fac39528227e350568f0eb34a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132644 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-05-05Just use Any ctor instead of makeAny (Linux, sequel)Stephan Bergmann
Change-Id: Idcf537a838bb0e47cfa31db8bc09e477b277ee37 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133875 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-05-05use more string_viewNoel Grandin
found by examining the call sites of OString::getToken which means I needed to add a new o3tl::equalsAscii function Change-Id: I7dc0ea1cf5ce8090a708d44f2cf7c938fa200c5f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133826 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-05-04remove unused layout callLuboš Luňák
I should have removed this in bfb6a42e26de28d88ced43eb3a2c63ce323. Change-Id: Ieb4b5fabcc1eecf82dbacef66bef8288b6c51761 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133815 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2022-05-04reduce string conversions in jsdialog::ExecuteActionNoel Grandin
Change-Id: Id1b908e06ebaa7f6ba5981abff51584623770215 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133814 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-05-04ofz#47199 AbortCaolán McNamara
Change-Id: I5e18242b3a18f0c9ca1891ab4e29bd43aaab1f26 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133811 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2022-05-04Related: tdf#131725 match the basegfx translation to the mirror logicCaolán McNamara
that is used in the traditional code path, this will fix vcl RTL scrollbars in otherwise LTR UI Change-Id: I1451f7e17b93b0339ded6d33147df6415274ebfc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133780 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2022-05-04use more string_view in unotoolsNoel Grandin
Change-Id: Id10d68f2eb016671be6842dfaa82909207b0708d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133754 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-05-04Related: tdf#131725 if SvTreeListBox RTL set, set scrollbars to matchCaolán McNamara
so if we have a RTL SvTreeListBox in a LTR environ then we get RTL scrollbars Change-Id: Ia9aaab81f273e31c61cfe4fd4e138709414ad599 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133778 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2022-05-04remove completed TODOCaolán McNamara
Change-Id: I51c446c2e1e4b02df34200357b2d4ccafd69c7f6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133777 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2022-05-04reset cached SalLayoutGlyphs when statusbar text changesLuboš Luňák
A mistake from bfb6a42e26de28d88ced43eb3a2c63ce323d33aa. Change-Id: Iddf885d41177e6dbbfdc1c916b45843f4d7ba499 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133796 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2022-05-04lay out entire strings in SalLayoutGlyphsCache more often (tdf#148911)Luboš Luňák
The document has parts of paragraphs e.g. underlined, which changes the vcl::Font part of the hash key. So if a paragraph starts that way but the rest is not underlined, the optimization of laying out the entire string would be missed. So do the optimization if there are subsequent calls for adjacent parts of the string (or starting at the same index and different length). Change-Id: I3d4a78b0eae42bd3085e96024340e6ed8daa9ad1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133790 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2022-05-04don't lay out entire strings for Writer layout testsLuboš Luňák
The SalLayoutGlyphsCache optimization of laying out an entire string if it looks like a caller will call it repeatedly for parts of the string conflicts with the SAL_ABORT_ON_NON_APPLICATION_FONT_USE checks causing PrintFontManager::Substitute() abort if font fallback happens. Simply disable the optimization, the output should be the same. Change-Id: I0cce6a0c2a1a2ce93b95df54d18fedbdc779f34f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133789 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2022-05-04vcl : avoid recursive call if skia context creation failed.Arnaud VERSINI
To avoid this bactrace : https://crashreport.libreoffice.org/stats/crash_details/4d1984f3-3352-49fa-8569-ebf6994ed216 Change-Id: I45ae8b56191c546c551ccaf48d5ab27a20b8e0e6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133662 Tested-by: Jenkins Reviewed-by: Arnaud Versini <arnaud.versini@libreoffice.org>
2022-05-04tidy up SalLayoutGlyphs usage in StatusBarLuboš Luňák
It's enough to store just SalLayoutGlyphs, not whole SalLayout. Change-Id: I31d0faccf08142326255c527b875ba8128f9bb38 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133764 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2022-05-04do not allow reusing already used SalLayoutGlyphs (tdf#148477)Luboš Luňák
If the glyphs have already been used, the AdjustLayout() call in OutputDevice::ImplLayout might have altered them, since MultiSalLayout::ImplAdjustMultiLayout() drops glyphs that need falllback from the base layout. And then then GenericSalLayout::LayoutText() would not know to call SetNeedFallback(). Change-Id: I2f79d26c8b861f20d7d52abaa0d917aaeefb37a0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133758 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2022-05-03ofz: Use-of-uninitialized-valueCaolán McNamara
Change-Id: I9ca24a135494a49449aec63615b2d945a93e8b27 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133735 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2022-05-03Don't add empty labels to fontwork's icon viewMike Kaganski
This allows to center the icon in the respective entry, not having whitespace in the bottom Change-Id: Ib148df6911f020f8d4efca4f6a80a65b7f95945f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133720 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2022-05-03loplugin:stringviewparamStephan Bergmann
Change-Id: I32ded64d7e9a86a6226dfbc4a3b9262bc7572ad2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133761 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-05-03ofz#47200 AbrtCaolán McNamara
Change-Id: I8975120de36575e1af5297db4f40ba3a39398bb6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133748 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2022-05-03Use o3tl::make_unsigned in some placesStephan Bergmann
...where a signed and an unsigned value are compared, and the signed value has just been proven to be non-negative here Change-Id: I297d0f80b2b3e68ea7362de64c871d647ac07371 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133739 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-05-03Why cast from FontWeight to intStephan Bergmann
Change-Id: I2e283197024c89681dc123e77c05d593ccec4552 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133738 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-05-03add o3tl::equalsAsciiNoel Grandin
Change-Id: I042b8dcadbf7581de325c161763fe35aecde5ca2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133694 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-05-03optimize repeated calls for the same string in SalLayoutGlyphsCacheLuboš Luňák
It often happens that the entire text will be laid out in parts, so if the first call is a prefix and another one follows that, lay out the entire string and then use the glyph subset optimization. Doing this only for the second segment instead immediately for the prefix is more efficient, as sometimes there is only the prefix call and there's no call for the rest of the string. This also avoids failures in CppunitTest_sw_layoutwriter, as a number of tests such as testAbi11870 lay out only a prefix and doing a layout for the entire string leads to font fallback, on which CppunitTest_sw_layoutwriter aborts in PrintFontManager::Substitute(). Change-Id: I76554868ec7e8a79dd09709a247ad1d839291c06 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133495 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2022-05-03Just use Any ctor instead of makeAny in vclStephan Bergmann
Change-Id: Ib9b588cd10154049a5493c1be16de72955ea6077 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133736 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-05-03remove the o3tl::lru_map "unlimited" hackLuboš Luňák
It didn't quite make sense before that maxsize == 0 meant no cleanup, and now with items optionally being count as having size more than 1 it makes even less sense to limit the size to max_size() of the containers. This comes from 16a338e173083954a9932a3a4005f17230, so instead make that special caller pass a large size, which in practice is the same. Change-Id: Id875862126200ba889211f6e4079ae5921f27650 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133690 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2022-05-02Silence -Werror=maybe-uninitializedStephan Bergmann
> vcl/source/helper/strhelper.cxx: In function ‘rtl::OString psp::WhitespaceToSpace(std::string_view)’: > vcl/source/helper/strhelper.cxx:365:9: error: ‘pBuffer[-1]’ may be used uninitialized [-Werror=maybe-uninitialized] > 365 | if( *pLeap == ' ' ) > | ^~~~~~ that hits at least with GCC 13 trunk now (and which actually is a false positive as far as I can tell) Change-Id: I69b96e4cf68f0ed20ac7d73014c164db792983a6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133704 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-05-02Delete mnemonics for CJK translations on macOSxuenhua
'Cop~y' translated into Chinese is '复制(~Y)' But the mnemonics '(Y)' is useless on macOS. In English, 'Cop~y' with the '~' removed is the correct result. But in CJK should remove along with '(' and ')', not just only for mbMenuBar. Use the method MnemonicGenerator::EraseAllMnemonicChars already defined in vcl/mnemonic.hxx Change-Id: Ic37ce566923e3dea47535d187b1b3dba2088e960 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133572 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2022-05-02Reimplement IconView::PaintEntryMike Kaganski
Use spacing between top, bottom, icon and text (the case of sum of items heights greater than element height is not yet handled). Draw the background even when there's no text: that allows to center the icon in the item, and still have proper highlight of selected item. Change-Id: I5d5dd14060efd15beb0e69df859ecf1efe8a0287 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133612 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2022-05-02Related: tdf#148433 experiment with CAIRO_OPERATOR_EXCLUSIONCaolán McNamara
export SAL_DISABLE_CAIRO_DIFFERENCE=1 to experiment with this Change-Id: If0e5fee8c71ae3d2181b1e0b90bf9ecd6536ffc0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133671 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2022-05-02better for fix glyph font fallback with null characterLuboš Luňák
Text layout code already filters out unsuitable characters, the null character just wasn't included there because it's normally not expected to be present in text, only something broken like ofz34898-1.doc causes it. This basically reverts commit 3d7ca1bd1c4cc9d468ae214ecb497f71bad340f8. Change-Id: Ic29674d9507340c2a43098a88c0320d4253a0bf8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133689 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2022-05-02better cache size limit for vcl::text::TextLayoutCacheLuboš Luňák
This is not as important as SalLayoutGlyphsCache, as these should be smaller and less needed, but still, make sure to limit the memory the cache may use. Change-Id: I4051331f8c5254cb5723772bac4dd1bceb9a2a41 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133674 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2022-05-02better cache size limit for SalLayoutGlyphsCacheLuboš Luňák
With just limit on the number of cached SalLayoutGlyphs instances the actual memory used could vary wildly depending on how long the text is. Change-Id: Ibcf6918e562e81276d21876c532838996e275bd6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133673 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2022-05-02loplugin:stringviewparamStephan Bergmann
Change-Id: Ife277f789270f80a40cd711a9235e41bbb3384ad Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133686 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-05-01jsdialog: export symbol for buttonsSzymon Kłos
Change-Id: I412961bd59855dcb4204dfb917b30539dac0eac2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132756 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Tested-by: Szymon Kłos <szymon.klos@collabora.com> Reviewed-by: Szymon Kłos <szymon.klos@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133653 Tested-by: Jenkins
2022-05-01jsdialog: handle formulabar as textinputSzymon Kłos
mostly boilerplate code jsdialog changes: - added force parameter to sendAction - added support for key press/release and command events - moved ActionDataMap to jsdialog namespace for sharing formulabar changes: - added calls to send jsdialog messages with formula - added cursor moving support - on command event Change-Id: I714715133901941ba0758655e2d5907a3bae79f2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133010 Reviewed-by: Mert Tumer <mert.tumer@collabora.com> Tested-by: Szymon Kłos <szymon.klos@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133652 Tested-by: Jenkins Reviewed-by: Szymon Kłos <szymon.klos@collabora.com>
2022-05-01abort more writer layout tests if a font isn't foundCaolán McNamara
Change-Id: I4d94b60531505f2d5a493b4c51f4c9110d3a4517 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133633 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2022-05-01abort writer layout tests if a font isn't foundCaolán McNamara
if (the default) of --with-fonts is enabled then additionally restrict fontconfig to those "application" fonts so the linux ci can be used to safeguard that font and glyph fallback isn't in operation during the layout tests Change-Id: Ic7fc705827c8177b8367cf41f55cdd8ae002c1f5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133523 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2022-05-01tdf#74331: 16bit "min-is-black" tiff not loaded correctlyCaolán McNamara
try an alternative fix git show -w is your friend here Change-Id: Ie9644f73431243ea0e9c6ef7f5c7ca4dadc7ed9e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133638 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2022-05-01don't use an empty fontname, reuse the default from the virtual devCaolán McNamara
zero size font is odd, but that's as it was already Change-Id: Ib430f2ff2a53c21dc7d15d11377762ab336a61e0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133660 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2022-05-01use more string_view in variousNoel Grandin
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-05-01use string_view in WhitespaceToSpaceNoel Grandin
Change-Id: I64c63418ca51a09312083dab2432bcca0ea262a3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133647 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-05-01SalLayoutGlyphsCache no longer needs to hash OutputDevice pointerLuboš Luňák
It seems now the cache key contains all the necessary info and results can be shared even between different OutputDevice instances, as long as they are "the same". Change-Id: I367322f469ab6713299f178a711a63065b245f9a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132902 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2022-04-30split comphelper::string::strip functions into String and view versionNoel Grandin
which is more obvious, from the perspective of the caller, and lets us avoid creating a new String if nothing needs to be stripped Change-Id: I66a980eaf4aa818251bec49bdb16c2dddb0745e7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133657 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-04-30new loplugin:stringviewdangleNoel Grandin
to find places where string_view is pointing into a temporary String Change-Id: Ib530b36f441e95d83d8f687d40a97516a0806721 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133656 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-04-30ofz#47104 Revert "tdf#74331: 16bit "min-is-black" tiff not loaded correctly"Caolán McNamara
This reverts commit bd1d0967920655ef85a2352259332f99fef6876e. Change-Id: I4f4c0aa7d779487b9f3b1da46e7b2e1070f2dba3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133637 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2022-04-30jsdialog: used for formulabarSzymon Kłos
- do not block painting - use welded wrappers to send JSON - don't send tunneled dialog Change-Id: I54c3cd02ab63bad4a50a3623a32f13b0c94a3595 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132757 Reviewed-by: Mert Tumer <mert.tumer@collabora.com> Tested-by: Szymon Kłos <szymon.klos@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133651 Tested-by: Jenkins Reviewed-by: Szymon Kłos <szymon.klos@collabora.com>
2022-04-29add a cppunit test for EraseAllMnemonicCharsCaolán McNamara
Change-Id: Ib7a9d0250e855d4c80c7ce2d66df02eac0ab2e69 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133618 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2022-04-29Fix Method EraseAllMnemonicChars bugxuenhua
MNEMONIC_RANGE_2_START and MNEMONIC_RANGE_2_END defined in 'core/include/vcl/mnemonic.hxx' are 'a' and 'z' This variable c is UpperCase, should be converted to lowercase, and thencompare with MNEMONIC_RANGE_2_START and MNEMONIC_RANGE_2_END. Change-Id: I721e293e88bf1b8260b7ea2dc39ae6a7fd4f3d79 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133587 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2022-04-29use more string_view in INetURLObjectNoel Grandin
Change-Id: I4462f7cf4740fa4d1b129d76a0775f4250f41bbd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133555 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>