summaryrefslogtreecommitdiff
path: root/include/vcl/gdimtf.hxx
AgeCommit message (Collapse)Author
9 daysDrop unneeded forward declarations from include/ even harderGabor Kelemen
test drive the new bin/find-unneeded-includes --fwdecl mode with iwyu 0.23 instead of 0.21, this seems to find more unneeded fw declarations Change-Id: I451e571c70eb74f46c799753e3c5a53c0110da36 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/179707 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2024-11-15simplify GDIMetaFile::ReplaceActionNoel Grandin
now that we are using proper reference-counting template classes to control lifetime here, the code can be simplified and obsolete comments removed. Change-Id: I7693c684d4bed0e26016b5d6bbbf1c38fec62519 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176624 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Jenkins
2024-03-14reduce symbol visibility in vclNoel Grandin
Change-Id: Ifaa37246e79678aa0c548b9ca8a9faf8036b9195 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164804 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-07-03tdf#152231 vcl,sw: PDF/UA export: fix comments in the marginMichael Stahl
If enabled, the comments mess up the structure elements, because the PageSyncData::mActions stores indexes into the GDIMetaFile::m_aList vector, and in PageSyncData::PlaySyncPageAct() the indexes don't match. This is because SwViewShell::PrintOrPDFExport() replaces the GDIMetaFile with a temporary one, then records the page content, then applies scaling to the temporary one and replays it, recording with the original one; somehow replaying a temporary GDIMetaFile with 270 actions to one that already has 4 actions results in 392 actions. It's not obvious how this can work with the temporary GDIMetaFile, so try to get rid of it; not sure if there any drawbacks to this but the GDIMetaFile is freshly created by the caller in any case. Change-Id: Ic297367ea307aa8eee8d609751d06abf417e9629 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153808 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2023-06-09MCGR: tdf#155479 repair gradient SVG export for MCGRArmin Le Grand (allotropia)
Unfortunately SVG export is based on metafiles and thus there is (in principle) no way to get the BGradient/ColorStop/MCGR data transfered as needed. For that, using UNO API to read the model or using B2DPrimitives would help - as is better for the export respectively. Since there is not the time to re-design SVG export I added this 'compromize' as a fix. It gets the needed data transported over the metafile (that part is the compromize). It then exports the MCGR data to SVG (at least - as was already there - if it's a linear/axial gradient). This happens now with all Gradient Stops when there is a MCGR gradient. That part is/will hopefully be re-usable if SVG export gets redesigned. I also added a handling for StepCount feature, so when used (in LO, others do not have that) 'hard' color stops get generated to make the gradient look identical for SVG export. Had to make adding of that extra-information in metafiles dependent on exporting really to SVG. There are 51 cases which use 'MetaActionType::COMMENT' which would potentially have to be adapted. Also added code to solve the problem for TransparencePrimitive2D at VclMetafileProcessor2D::processTransparencePrimitive2D. This will now - also only for SVG export - directly create the needed MetaFloatTransparentAction and add additional MCGR information. This will be used on SVG export to write a 'Mask' as was done before. This is now capable of creating fill MCGR-Masks in the sense that any number of TransparencyStops will be supported. Change-Id: Ic6d022714eae96b8fbc09e60652851ac5799b757 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152623 Tested-by: Jenkins Reviewed-by: Armin Le Grand <Armin.Le.Grand@me.com>
2022-02-02tdf#126319 Corrected bitmap creation from metafileArmin Le Grand (Allotropia)
The conversion from Metafile to Bitmap in GraphicExporter is based on metafiles which does just not deliver enough precision when getting the bounds to do the correct size calculation for the target Bitmap. So I changed that to use Primitive functionality what produces better data. That old fix/correction itself was based on hairlines only which is anyways no longer sufficient since LO uses less hairlines nowadays, what is good in general (They are a relic of non-AA times when it was not possible to paint/work with lines taller than one pixel). Thus, cases need to be solved more generic based on better data. It would also be good to change this to primitives completely, but that is too much for now. Change-Id: I71bd136b106ef8ff3ba51458c46df08269773c01 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129235 Tested-by: Jenkins Reviewed-by: Armin Le Grand <Armin.Le.Grand@me.com>
2021-09-07loplugin:unusedmethodsNoel Grandin
Change-Id: I6295d6ff6fb7410852351801c324244308c5c472 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121751 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-08-17Move GDIMetaFile::GetChecksum to SvmWriter::GetChecksumpanoskorovesis
Move the method and update all the method calls from GDIMetaFile::GetChecksum -> SvmWriter::GetChecksum Remove the method from gdimtf Change-Id: I68e2b3cf99178947ac4f1474810dd5568f07e122 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120414 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2021-08-17Remove unused methods from gdimtf.hxxpanoskorovesis
Remove GDIMetaFile::Read, ReadGDIMetaFile, GDIMetaFile::Write, WriteGDIMetaFile. Their functionality is covered from SvmReader::Read and SvmWriter::Write respectively Change-Id: Id3d22e251d19c2898359a6c1dbeffbc53419540b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120409 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2021-05-19ImplPlayWithRenderer never checks its OutputDevice against nullptrCaolán McNamara
just pass a reference instead and spread that around to some similar cases Change-Id: Ifb2dee8c7bf02a9f01982b928c90666cbbdd84fe Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115759 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-05-05sal_uLong->sal_Int32 in BitmapNoel Grandin
Change-Id: I267fbdb8946d307440cb675f6ff985bf58db5e4c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115108 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-10-21new tools::Degree10 strong typedefNoel Grandin
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-19use tools::Long in vclNoel
Change-Id: Ice1055021e8568634e9a66ba89d3bb4ef4e731df Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104522 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-05-14vcl: move transparency checks into MetaAction and GDIMetaFileChris Sherlock
I want to remove the final bits of meOutDevType but need to refactor the function OutputDevice::RemoveTransparenciesFromMetaFile(). This is the start. Change-Id: I7c5330540fb396f033b40831b24028c7bfec4832 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93940 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2019-03-14vcl: avoid OUString defaulted parameter in GDIMetaFile::dumpAsXml()Miklos Vajna
So that it's possible to do ad-hoc dumping from gdb with something like: print xMetaFile->dumpAsXml(0) Similar to how that already worked for SwDoc or SwFrame. Change-Id: I9cb884491f2a49afdb06179d8d54252101f37bb7 Reviewed-on: https://gerrit.libreoffice.org/69253 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2019-01-14Add fileName to GDIMetaFile::dumpAsXml()Muhammet Kara
GDIMetaFile::dumpAsXml() is very useful while investigating/examining the meta files, but it overwrites with the same file name each time. To be able to get different dumps at the same time, let's add a fileName parameter to it. Change-Id: I993720b460f326cd65519556cf1e902591d90d42 Reviewed-on: https://gerrit.libreoffice.org/66283 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-01-03vcl GDIMetaFile: easier dumping from debuggerMiklos Vajna
Calling a const member function is easy, creating a dumper instance is not. Change-Id: I4892f93f6e1d1f17021185bfd24e411c9d705b3b Reviewed-on: https://gerrit.libreoffice.org/65838 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2018-11-27tdf#42949 Fix IWYU warnings in include/vcl/[f-h]*Gabor Kelemen
Found with bin/find-unneeded-includes Only removal proposals are dealt with here. Change-Id: Ice2eb8c5994bf2ccb88972332ca4a1d3ed41752a Reviewed-on: https://gerrit.libreoffice.org/63826 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2018-09-06clang-tidy performance-unnecessary-value-paramNoel Grandin
Change-Id: I69247498e13331f6ef84afeb242479f8fb1178a8 Reviewed-on: https://gerrit.libreoffice.org/60068 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-04-12hold MetaAction by rtl::ReferenceNoel Grandin
instead of yet another private implementation of manual reference counting Change-Id: Iefb1d2e595e45a2dfdc3be54e1c51b64afeaf9d8 Reviewed-on: https://gerrit.libreoffice.org/52753 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-03-29ofz#7165 set a recursion limit for svm in svmCaolán McNamara
Change-Id: Id9089986012588690b6d5e33cd71d094ef2357dd Reviewed-on: https://gerrit.libreoffice.org/51982 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2018-01-24loplugin:unused-returns in vclNoel Grandin
Change-Id: I507320900a47f604d17ed7d402d531a7cbdf744e Reviewed-on: https://gerrit.libreoffice.org/48331 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-01-16Remove unused GDI_METAFILE_LABEL_NOTFOUNDStephan Bergmann
...unused since 22bd00fa7f6b90964e5eca03c314cdfa7ac2be12 "remove unused #defines METAFILE_END and METAFILE_LABEL_NOTFOUND" Change-Id: Ia9bcd4100f03c12c8e97b57cbfabfbf634248014 Reviewed-on: https://gerrit.libreoffice.org/47918 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-01-12More loplugin:cstylecast: vclStephan Bergmann
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: I363c01a1ae9e863fca4fb4589829492d7280d711
2017-11-29loplugin:unusedmethodsNoel Grandin
Change-Id: I2efb5c0e5735c179314c6c5de87821cee3b033e1 Reviewed-on: https://gerrit.libreoffice.org/45386 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-04-05loplugin:constantparamNoel Grandin
Change-Id: I1996319e5b664dff95f7a9b2346aea6092d333ec Reviewed-on: https://gerrit.libreoffice.org/36070 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-03-31tdf#82580 tools: rename Rectangle to tools::RectangleMiklos Vajna
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-02-09convert BmpConversion to scoped enumNoel Grandin
and drop unused 4BIT_TRANS and 1BIT_MATRIX enumerators Also fix a bug in x11::convertBitmapDepth where we were incorrectly passing BmpConversion enumeratirs to ReduceColors Change-Id: I903c6866750e46ee752e10a17c05fcaaf6b11242 Reviewed-on: https://gerrit.libreoffice.org/34062 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-02-09loplugin:unusedenumconstants read-only constants in vcl (2)Noel Grandin
Change-Id: Ia3da23e0ef2fa710403745bd11255ed001516da4 Reviewed-on: https://gerrit.libreoffice.org/34020 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2016-11-16new loplugin finalprotectedNoel Grandin
look for final classes, and make sure they don't have protected members Change-Id: I1fa810659bba02b61a5160dbfd8e24185ec9abf4 Reviewed-on: https://gerrit.libreoffice.org/30895 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2016-11-04loplugin:unnnecessaryvirtual in vclNoel Grandin
Change-Id: Ifa8bfafb2e527ce5976f3bd310d107cb2840a5f6 Reviewed-on: https://gerrit.libreoffice.org/30531 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2016-10-07loplugin:staticmethods: vclStephan Bergmann
Change-Id: I9a563100400375cd185729282b3e4f1ff3a44151
2016-10-05convert MapUnit to scoped enumNoel Grandin
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-09-15loplugin:countusersofdefaultparams in vclNoel Grandin
Change-Id: I046e6f16c5b171a06e2be2da2f72340634f3e979 Reviewed-on: https://gerrit.libreoffice.org/28891 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2016-08-31loplugin:countusersofdefaultparamsNoel Grandin
Change-Id: I697b9081424acdc61107709392baa8af8ce29028 Reviewed-on: https://gerrit.libreoffice.org/28497 Reviewed-by: Noel Grandin <noelgrandin@gmail.com> Tested-by: Noel Grandin <noelgrandin@gmail.com>
2016-07-05Remove unused DELEGATE_PLUGGABLE_RENDERER to simplify mtf codeMark Page
The code was added July 2008 as a way to delegate mtf action rendering to external services. Change-Id: I5b2277fada1a8ad85e82cb2c10c822df09da836a Reviewed-on: https://gerrit.libreoffice.org/26371 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: jan iversen <jani@documentfoundation.org> Tested-by: jan iversen <jani@documentfoundation.org>
2016-05-26Convert MtfConversion to scoped enumNoel Grandin
Change-Id: I694fe139531a10467265b028ad15df0eda6d723a Reviewed-on: https://gerrit.libreoffice.org/25442 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-04-25GDIMetaFile: rename members missing their prefixesMiklos Vajna
Change-Id: Ie21807952d74b89b0e8b6f376f8807737b6685f0 Reviewed-on: https://gerrit.libreoffice.org/24360 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
2016-02-26loplugin:unuseddefaultparms in include/vcl (part2)Noel Grandin
including a fix for a rather glaring bug in BitmapTools.cxx Change-Id: Id9db990b993cfeea9039c5fbaaa91996adeae22a Reviewed-on: https://gerrit.libreoffice.org/22713 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-02-09Remove excess newlinesChris Sherlock
A ridiculously fast way of doing this is: for i in $(pcregrep -l -M -r --include='.*[hc]xx$' \ --exclude-dir=workdir --exclude-dir=instdir '^ {3,}' .) do perl -0777 -i -pe 's/^ {3,}/ /gm' $i done Change-Id: Iebb93eccbee9e4fc5c4380474ba595858a27ac2c Reviewed-on: https://gerrit.libreoffice.org/22224 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Chris Sherlock <chris.sherlock79@gmail.com>
2016-02-09Formatting changes across all modulesChris Sherlock
+ Removed comment cruft + Tab formatting in number of files + Some commented out code removed + Tab characters replaced with spaces + Newline cleanup in quite a few files + Tweak header guard #endifs Change-Id: I3208ff2f047da890edcc49b73389aca22442f5fc Reviewed-on: https://gerrit.libreoffice.org/22221 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Chris Sherlock <chris.sherlock79@gmail.com>
2016-02-08revert part of "loplugin:unusedmethods"Noel Grandin
<sberg> noelgrandin, just happen to look at b14224fe again; looks a bit scary to remove == or != from cases where both where declared <noelgrandin> sberg, ok, I can revert that part <sberg> noelgrandin, I guess that would be safer (there could be cases where now a different overload could kick in) Change-Id: I5dc41c05dc4439d5adee0e5b3e0a9e1dfb9de3af Reviewed-on: https://gerrit.libreoffice.org/22211 Reviewed-by: Noel Grandin <noelgrandin@gmail.com> Tested-by: Noel Grandin <noelgrandin@gmail.com>
2016-02-08loplugin:unusedmethodsNoel Grandin
using an idea from dtardon: <dtardon> noelgrandin, hi. could you try to run the unusedmethods clang plugin with "make build-nocheck"? that would catch functions that are only used in tests. e.g., i just removed the whole o3tl::range class, which has not been used in many years, but htere was a test for it... <noelgrandin> dtardon, interesting idea! Sure, I can do that. Change-Id: I5653953a426a2186a1e43017212d87ffce520387 Reviewed-on: https://gerrit.libreoffice.org/22041 Reviewed-by: Noel Grandin <noelgrandin@gmail.com> Tested-by: Noel Grandin <noelgrandin@gmail.com>
2016-01-08vcl: document parameterChris Sherlock
Change-Id: I6215f0af4b5ce0d310c0a00c1806edbe7a5017eb
2015-11-10loplugin:nullptr (automatic rewrite)Stephan Bergmann
Change-Id: I05e89f9896170d4df3d1377549ea074f06b884a0
2015-09-29loplugin:removeunusedmethods, remove unused stuffNoel Grandin
Change-Id: I35456b2a3ad2a84a1d045f09cdfb29e4c19b8350
2015-09-22remove unused Link<> fieldNoel Grandin
Change-Id: Ia07a1db94bacad8c1d9c108ee6e2ac2f82b6581f
2015-09-01Switching to 64-bit checksum: substituted sal_uLong with BitmapChecksumMarco Cecchetti
A typedef sal_uLong BitmapChecksum; has been added to include/vcl/checksum.hxx Wherever needed sal_uLong and sal_Int32 has been substituted with BitmapChecksum. A BITMAP_CHECKSUM_BITS constant equal to the amount of bits used by the BitmapChecksum type has been defined and used in `GraphicID::GetIDString` (vstools/source/graphic/grfcache.cxx). Change-Id: I74bd285089e58a8b18c06233d75b87023c7bf31b
2015-08-29sal_uLong to sal_uInt32 for CRC32Matteo Casalin
Change-Id: Id13e07f479615b8eb39d05e6534f514277cc3d03
2015-08-17Put Polygon from tools under tools:: namespaceNorbert Thiebaud
Polygon is one of these names that Clash with some system objects A similar work has been done earlier with PolyPolygon. Change-Id: Icf2217cb2906292b7275760f1a16be0e150312f5 Reviewed-on: https://gerrit.libreoffice.org/17789 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Norbert Thiebaud <nthiebaud@gmail.com>