summaryrefslogtreecommitdiff
path: root/toolkit/source/helper/vclunohelper.cxx
AgeCommit message (Collapse)AuthorFilesLines
7 daysloplugin:ostr in toolkitNoel Grandin1-1/+1
Change-Id: Ia70d03713bfb7621196d2bd12473d3cf1c2ef1b5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167654 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-07-25Convert internal vcl bitmap formats transparency->alpha (II)Noel Grandin1-0/+1
(Second attempt at landing this) Image formats and graphics APIs use alpha, not transparency, so change our internal formats and data structures to work directly with alpha, so we don't need to modify data before we push it to graphics APIs. Add a couple of new Color constants to make the intention of the vcl code clearer. Notes (*) On macOS, tweaking the logic in CreateWithSalBitmapAndMask to more accurately reflect the requirements of the CGImageCreateWithMask function seems to fix some tests. (*) The vcl code does not properly support gradients with transparency. So the previous code was wrong, and this change is going to result in slightly different wrongness. Change-Id: I9e21c2e98d88ecfdc5f75db13bd1ffff7c38db98 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114168 Tested-by: Jenkins Reviewed-by: Patrick Luby <plubius@neooffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-01-16XUnoTunnel->dynamic_cast in VCLXBitmapNoel Grandin1-1/+1
Change-Id: I2cf42ac720184bc2b8b89ced5564dbb95e7dc1ba Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145535 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-01-16XUnoTunnel->dynamic_cast in VCLXRegionNoel Grandin1-1/+1
Change-Id: I75956a2c713d52c01dcfd47fc0b8506ba526523e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145532 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-01-13XUnoTunnel->dynamic_cast in VCLXFontNoel Grandin1-1/+1
Change-Id: I4afa34805e64f3ff37b76fe8ca4676c1f4eb3e14 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145468 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-01-13XUnoTunnel->dynamic_cast in VCLXDeviceNoel Grandin1-5/+5
Change-Id: I9fa06600d3b9a2172a1818f89a3b9c06d65c8c54 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145467 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-11-19loplugin:unusedmethodsNoel Grandin1-5/+0
Change-Id: I5dcba14a9b0dfcc5267760410f6d135fcd3b1bd2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142944 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-09-15Use <comphelper/servicehelper.hxx> implementing XUnoTunnel part 1Mike Kaganski1-8/+8
The header got some changes: 1. Move UnoTunnelIdInit and isUnoTunnelId into 'comphelper' namespace 2. Rename UnoTunnelIdInit to UnoIdInit, as a precondition to replace of uses of OImplementationId with it, including in XTypeProvider 3. Introduce convenience functions 'getSomething_cast' to cast between sal_Int64 and object pointers uniformly. 4. Rename getUnoTunnelImplementation to getFromUnoTunnel, both to make it a bit shorter, and to reflect its function better. Templatize it to take also css::uno::Any for convenience. 5. Introduce getSomethingImpl, inspired by sw::UnoTunnelImpl; allow it handle cases both with and without fallback to parent. 6. Adjust UNO3_GETIMPLEMENTATION_* macros TODO (in separate commits): - Drop sw::UnoTunnelImpl and sw::UnoTunnelGetImplementation - Replace all uses of OImplementationId in core with UnoIdInit - Deprecate OImplementationId in <cppuhelper/typeprovider.hxx> - Change implementations of getSomething to use getSomethingImpl - Revise uses of getSomething to use getFromUnoTunnel Change-Id: If4a3cb024130f1f552f988f0479589da1cd066e7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122022 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-04-08move set/get Pointer to VCLUnoHelperCaolán McNamara1-4/+22
Change-Id: I7dadc7bc881e0b892720b3eb89fdc60c8d87c541 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113776 Tested-by: Caolán McNamara <caolanm@redhat.com> Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-02-23loplugin:refcounting in toolkitNoel1-5/+4
Change-Id: I4a65ee848eed7c48340c73d3144b4a1e29ab867c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111370 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-01-25avoid some ref-countingNoel Grandin1-6/+6
can just return a pointer here, instead of VclPtr. Change-Id: I9ab8962cbbe84ed4dfcfd658a6d758112914cb89 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109923 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-10-21new tools::Degree10 strong typedefNoel Grandin1-2/+2
partly to flush some use of "long" out the codebase, but also to make it obvious which units are being used for angle values. Change-Id: I1dc22494ca42c4677a63f685d5903f2b89886dc2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104548 Tested-by: Noel Grandin <noel.grandin@collabora.co.uk> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-10-20fix font orientation conversion in VCLUnoHelperNoel Grandin1-2/+2
css::awt::FontDescriptor uses degrees, while vcl::Font uses deci-degrees Change-Id: I72265ea6385bc61db99ee9a6bb392dab2cb1ab3f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104543 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-04-10Make BitmapPrimitive2D vcl-independentArmin Le Grand1-0/+5
as preparation to have drawinglayer module independent from vcl in the future Change-Id: Iaa01370f27b51cba5114a54f37d1ec73d0719918 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92048 Tested-by: Jenkins Reviewed-by: Armin Le Grand <Armin.Le.Grand@me.com>
2020-02-05move some toolkit/ headers inside the moduleNoel Grandin1-5/+5
Change-Id: I88badb1eb586db00a350afbcd6f4903a5623c724 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87988 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-09-18tdf#42949 Fix IWYU warnings in toolkit/Gabor Kelemen1-6/+0
Found with bin/find-unneeded-includes Only removal proposals are dealt with here. Change-Id: Ib49e2f29daa6d9b2a8195915c4ba10a8cef965ce Reviewed-on: https://gerrit.libreoffice.org/78722 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2019-08-15loplugin:sequenceloop in test..toolkitNoel Grandin1-1/+1
Change-Id: Ic8dad06c535b0af713bfe7cd46e601c8ea7ba6c7 Reviewed-on: https://gerrit.libreoffice.org/77531 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-07-04remove some unneede vcl/bitmap.hxx includesNoel Grandin1-1/+0
Change-Id: Ibdc79538276992193e61f6dc16ddd3fd1ab80b82 Reviewed-on: https://gerrit.libreoffice.org/75069 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-06-30Simplify Sequence iterations in toolkitArkadiy Illarionov1-3/+2
Use range-based loops or replace with STL functions Change-Id: I8129ca201dd7017fc4064b04834f41d69cc01274 Reviewed-on: https://gerrit.libreoffice.org/74926 Tested-by: Jenkins Reviewed-by: Arkadiy Illarionov <qarkai@gmail.com>
2019-06-17Add comphelper::getUnoTunnelImplementation templateArkadiy Illarionov1-8/+8
Use it instead of classname::getImplementation from UNO3_GETIMPLEMENTATION_* Change-Id: Ifcc8cfcd6369c576250008c76ce31ba79ea3a596 Reviewed-on: https://gerrit.libreoffice.org/74107 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-06-04tdf#39593 remove IMPL_XUNOTUNNEL* macrosArkadiy Illarionov1-8/+8
Replace with UNO3_GETIMPLEMENTATION* macros. Replace single usage of IMPL_XUNOTUNNEL_MINIMAL with it's body. Change-Id: I7d4ad76399b999ebb2178ecf57edcf6bd2aa6c3e Reviewed-on: https://gerrit.libreoffice.org/73424 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-01-15tdf#42949 Fix IWYU warnings in include/toolkit/*Gabor Kelemen1-0/+1
Found with bin/find-unneeded-includes Only removal proposals are dealt with here. Change-Id: Icebcf1a6ab073dce935a74ce79ee0f302b62e8a8 Reviewed-on: https://gerrit.libreoffice.org/65947 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2019-01-07tdf#42949 Fix IWYU warnings in include/vcl/[v-x]*Gabor Kelemen1-0/+1
Found with bin/find-unneeded-includes Only removal proposals are dealt with here. Change-Id: I98f49765c6b74808dcbd692e0f375dd2848fcfd4 Reviewed-on: https://gerrit.libreoffice.org/65614 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2018-11-08Convert FieldUnit to scoped enumMike Kaganski1-17/+17
Change-Id: Id2df31daa596a18c79af5fc6ea162deb6e24d5af Reviewed-on: https://gerrit.libreoffice.org/62958 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2018-10-22loplugin:staticvar in variousNoel Grandin1-4/+4
looks for variables that can be declared const and static i.e. they can be stored in the read-only linker segment and shared between different processes Change-Id: I8ddc6e5fa0f6b10d80c75d5952df8ddd311cf892 Reviewed-on: https://gerrit.libreoffice.org/61591 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-09-27loplugin:constfields in toolkitNoel Grandin1-3/+3
Change-Id: I26254acc84b1bfe71e4addbde51cb6a9ed52c981 Reviewed-on: https://gerrit.libreoffice.org/60990 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-02-22loplugin:changetoolsgen in tools..toolkitNoel Grandin1-2/+2
Change-Id: I3d87ee59258567b5a82cb459248539faea1b3ca9 Reviewed-on: https://gerrit.libreoffice.org/50101 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-01-15More loplugin:cstylecast: toolkitStephan Bergmann1-10/+10
Change-Id: I65b3c17c516d364326ce6dc3f7ba90c885a3e5e3
2018-01-12More loplugin:cstylecast: toolkitStephan Bergmann1-13/+13
auto-rewrite with <https://gerrit.libreoffice.org/#/c/47798/> "Enable loplugin:cstylecast for some more cases" plus solenv/clang-format/reformat-formatted-files Change-Id: Iaee0fee0cbc6e5311342b83d847cb89bd1056973
2017-04-21remove unnecessary explicit linefeeds from end of SAL and OSL log callsNoel Grandin1-2/+2
Change-Id: I3fa363c8e76e6cfb297f4ec346e3f031c09d6fbf Reviewed-on: https://gerrit.libreoffice.org/36727 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-04-02coverity#1403662 Mixing enum typesCaolán McNamara1-170/+7
Change-Id: Ic5e797c65dfc736a9ef0ab14f3ae563216143947 Reviewed-on: https://gerrit.libreoffice.org/36020 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2017-03-31tdf#82580 tools: rename Rectangle to tools::RectangleMiklos Vajna1-3/+3
Mostly generated using make check COMPILER_EXTERNAL_TOOL=1 CCACHE_PREFIX=clang-rename-wrapper RENAME_ARGS="-qualified-name=Rectangle -new-name=tools::Rectangle" Except some modules have their own foo::tools namespace, so there have to use ::tools::Rectangle. This commit just moves the class from the global namespace, it does not update pre/postwin.h yet. Change-Id: I42b2de3c6f769fcf28cfe086f98eb31e42a305f2 Reviewed-on: https://gerrit.libreoffice.org/35923 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
2017-01-26Remove dynamic exception specificationsStephan Bergmann1-1/+1
...(for now, from LIBO_INTERNAL_CODE only). See the mail thread starting at <https://lists.freedesktop.org/archives/libreoffice/2017-January/076665.html> "Dynamic Exception Specifications" for details. Most changes have been done automatically by the rewriting loplugin:dynexcspec (after enabling the rewriting mode, to be committed shortly). The way it only removes exception specs from declarations if it also sees a definition, it identified some dead declarations-w/o-definitions (that have been removed manually) and some cases where a definition appeared in multiple include files (which have also been cleaned up manually). There's also been cases of macro paramters (that were used to abstract over exception specs) that have become unused now (and been removed). Furthermore, some code needed to be cleaned up manually (avmedia/source/quicktime/ and connectivity/source/drivers/kab/), as I had no configurations available that would actually build that code. Missing @throws documentation has not been applied in such manual clean-up. Change-Id: I3408691256c9b0c12bc5332de976743626e13960 Reviewed-on: https://gerrit.libreoffice.org/33574 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2016-11-29loplugin:vclwidgets check for assigning from VclPt<T> to T*Noel Grandin1-1/+1
Inspired by a recent bug report where we were assigning the result of VclPtr<T>::Create to a raw pointer. As a consequence, we also need to change various methods that were returning newly created Window subclasses via raw pointer, to instead return those via VclPtr Change-Id: I8118e0195a5b2b4780e646cfb0e151692e54ae2b Reviewed-on: https://gerrit.libreoffice.org/31318 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2016-10-05convert MapUnit to scoped enumNoel Grandin1-36/+36
I left a prefix on the names "Map" so that I would not have to re-arrange each name too much, since I can't start identifiers with digits like "100thMM" And remove RSC_EXTRAMAPUNIT, which doesn't seem to be doing anything anymore. Change-Id: I5187824aa87e30caf5357b51b5384b5ab919d224 Reviewed-on: https://gerrit.libreoffice.org/29096 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2016-05-13clang-tidy modernize-loop-convert in toolkit to uuiNoel Grandin1-6/+6
Change-Id: I805aa1389ef8dde158f0b776d6b59579fa3082e4 Reviewed-on: https://gerrit.libreoffice.org/24921 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-04-20loplugin:salbool: Automatic rewrite of sal_False/TrueStephan Bergmann1-1/+1
Change-Id: I04d2884dcb81482c5c3450c98cccb36096a126d4
2016-02-04vcl: take into account the font width is the average font widthChris Sherlock1-3/+3
I'm changing the Font class function names: - SetSize -> SetFontSize - GetSize -> GetFontSize - SetHeight -> SetFontHeight - GetHeight -> GetFontHeight - SetWidth -> SetAverageFontWidth - GetWidth -> GetAverageFontWidth That's because it really makes no sense to say that there is a single constant font width because obviously proportional fonts don't have one - the best we can do is an average font width, which is what folks like Microsoft sort of do already. On a fixed font, the average is still accurate, for obvious reasons :-) I'm also not a fan of GetSize/SetSize as I find it a might too generic. Change-Id: Ib80a604ba62d6883fd6cbc7994da763976be5c70 Reviewed-on: https://gerrit.libreoffice.org/22069 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Chris Sherlock <chris.sherlock79@gmail.com>
2016-02-03toolkit: remove some comment cruft from vclunohelper.cxxChris Sherlock1-5/+0
Change-Id: I1670e8d1adccd2123d41e51b7d7ee5228c555280
2016-02-03tdf#39468 toolkit: translate some German comments in the VCL UNO helper fileChris Sherlock1-2/+2
Change-Id: Ib432f2cbfc71ebfec0ef1ecae99ae3fde1a4d946
2016-01-31tools: rename FontUnderline to FontLineStyleChris Sherlock1-2/+2
Change-Id: I4750ad8569a1003b2f8c29052f3e25003ee433ca Reviewed-on: https://gerrit.libreoffice.org/21892 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Chris Sherlock <chris.sherlock79@gmail.com>
2016-01-21vcl: rename Font::GetFamily to Font::GetFamilyTypeChris Sherlock1-1/+1
Change-Id: Ie427a43bd126dcdd89c6f66582736e67130f2254 Reviewed-on: https://gerrit.libreoffice.org/21633 Reviewed-by: Chris Sherlock <chris.sherlock79@gmail.com> Tested-by: Chris Sherlock <chris.sherlock79@gmail.com>
2016-01-18vcl: change Font::SetName() to Font::SetFamilyName()Chris Sherlock1-1/+1
Change-Id: I9b7bd1ec25955981ebcb9085579cbb9fbaa802d5 Reviewed-on: https://gerrit.libreoffice.org/21560 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Chris Sherlock <chris.sherlock79@gmail.com>
2016-01-17vcl: rename Font::GetName to Font::GetFamilyNameChris Sherlock1-1/+1
Change-Id: Ie20871a3078bf875c1782b7761d60591a9c9704f Reviewed-on: https://gerrit.libreoffice.org/21529 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Chris Sherlock <chris.sherlock79@gmail.com>
2016-01-16revert vcl patch series that brok Mac and WindowsNorbert Thiebaud1-2/+2
revert: 9bc2f3de8672e812f3a67541c6d7069b434a7e42 vcl: add comment about ImplFontMetric::{Get|Set}LineHeight() 26371f105bc44e04469ec03fc5bb12505e651c6b vcl: FontAttributes::GetSlantType() -> FontAttributes::GetItalic() 2dd0b4317372b8022efe3911b38b4fa02956d8b9 vcl: font.hxx and metric.hxx cleanup, make ctors explicit and the dtor virtual 5ab13bf3ead3539e4ad847656da81e7eb6029652 vcl: tabify font.hxx f99550dae55e40e49bf9c9875053fe2abb4c71ca vcl: change Font::SetName() to Font::SetFamilyName() 2b297116cb6bb1061c43e5714e2609c8ee9f57d2 vcl: rename Font::GetName to Font::GetFamilyName Change-Id: I23f38921187d66b970ca815eb30dda4222a2da62
2016-01-16vcl: change Font::SetName() to Font::SetFamilyName()Chris Sherlock1-1/+1
Change-Id: I54a4036544c680c4a49607677af776aa7a433fbc Reviewed-on: https://gerrit.libreoffice.org/21510 Reviewed-by: Chris Sherlock <chris.sherlock79@gmail.com> Tested-by: Chris Sherlock <chris.sherlock79@gmail.com>
2016-01-16vcl: rename Font::GetName to Font::GetFamilyNameChris Sherlock1-1/+1
Change-Id: I83927e0992dfe0a2a79d139818a9f45d3761aae5 Reviewed-on: https://gerrit.libreoffice.org/21509 Reviewed-by: Chris Sherlock <chris.sherlock79@gmail.com> Tested-by: Chris Sherlock <chris.sherlock79@gmail.com>
2016-01-13vcl: Create accessor and mutator for int and ext leading in FontMetricChris Sherlock1-1/+1
Accessor and mutator created for external and internal leading space in FontMetric. See commit description in 8bfccd3a71d911b6d ("vcl: Create accessor and mutator for font scaling in FontMetric") for reasoning behind patch. Unit tests - check to ensure that can set external and leading space - check equality operator on FontMetric after setting both external and internal leading space - enhanced tests to also check the inequality operator Change-Id: I973970dd0b0631c5eca3e89039dce57ac3a3eb63 Reviewed-on: https://gerrit.libreoffice.org/21454 Reviewed-by: Chris Sherlock <chris.sherlock79@gmail.com> Tested-by: Chris Sherlock <chris.sherlock79@gmail.com>
2015-11-10loplugin:nullptr (automatic rewrite)Stephan Bergmann1-3/+3
Change-Id: Ied9204441c07f1f6a6026c8c1a2fa21b93b98e1a
2015-11-09com::sun::star->css in toolkit/Noel Grandin1-143/+122
Change-Id: Ia8feca46fa64a300235730e1248fa5fda0783ba2 Reviewed-on: https://gerrit.libreoffice.org/19853 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>