summaryrefslogtreecommitdiff
path: root/cppcanvas
AgeCommit message (Collapse)AuthorFilesLines
2019-12-29tdf#124176: Use pragma once instead of include guardscagatay9-35/+11
Change-Id: If73053c1fa0f65ff7296bf8f5a34d6ead64167ab Reviewed-on: https://gerrit.libreoffice.org/c/core/+/85928 Tested-by: Jenkins Reviewed-by: Muhammet Kara <muhammet.kara@collabora.com>
2019-12-19tdf#124176: Use pragma once instead of include guardsYusuf Keten5-20/+5
Change-Id: Id65f17c9785e9db3eecfb1fba6902a04906077e5 Reviewed-on: https://gerrit.libreoffice.org/85428 Tested-by: Jenkins Reviewed-by: Muhammet Kara <muhammet.kara@collabora.com>
2019-12-18sal_Char->char in cppcanvas..cuiNoel Grandin1-1/+1
Change-Id: I7e9fa7011f1e0bf143f86055718c772caebf8ee6 Reviewed-on: https://gerrit.libreoffice.org/85397 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-12-01Introduce o3tl::optional as an alias for std::optionalStephan Bergmann3-5/+5
...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-11-30Rewrite uses of boost::optionalStephan Bergmann4-24/+24
...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-03tdf#42949 restore vcl/canvastools.hxx for OSL_DEBUG_LEVEL > 2Tomoyuki Kubota1-0/+3
Change-Id: I6c69bcca4d5cd34efc297764d940727ef8631bf4 Reviewed-on: https://gerrit.libreoffice.org/81953 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-10-31tdf#42949 Fix IWYU warnings in cppcanvas/Gabor Kelemen32-92/+18
Found with bin/find-unneeded-includes Only removal proposals are dealt with here. Change-Id: I3e6b35acf6266157d4cf634e2143e6e19a73102a Reviewed-on: https://gerrit.libreoffice.org/81813 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2019-10-18make bin/update_pch.s always include code in trivial #if'sLuboš Luňák1-1/+6
E.g. #ifdef LIBO_INTERNAL_ONLY is always true for code that builds with our PCHs. Change-Id: I3cf311ea3621b909105754cfea2cb0116b8b67f5 Reviewed-on: https://gerrit.libreoffice.org/80961 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2019-09-23do not require $(SRCDIR) in every gb_Library_set_precompiled_headerLuboš Luňák1-1/+1
Change-Id: I7b3a22584bb2e4d501f509ffcd80929feed23a4c Reviewed-on: https://gerrit.libreoffice.org/79360 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2019-08-12Fix typosAndrea Gelmini1-1/+1
Change-Id: I4bd004af206813b9dc01c50ab20f2e8b954b8dca Reviewed-on: https://gerrit.libreoffice.org/77323 Reviewed-by: Julien Nabet <serval2412@yahoo.fr> Tested-by: Julien Nabet <serval2412@yahoo.fr>
2019-07-23rhbz#1728763 black bg seen in renderer emfsCaolán McNamara1-1/+10
back in 5-4 series FWIW, since... commit a3c95ec45397b146c86a3fa44445c763de99d3a3 Author: Caolán McNamara <caolanm@redhat.com> Date: Mon Jun 11 09:00:46 2018 +0100 rhbz#1589029 tdf#93789 impress not showing text highlight in presentation mode Change-Id: I8412854cd32af73cf2512db8c424d56ed84d9c1e Reviewed-on: https://gerrit.libreoffice.org/76153 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2019-07-19loplugin:referencecasting in cppcanvas..cuiNoel Grandin4-9/+4
Change-Id: Ib8a513d88575cef9c1479b91adff98170c9323e8 Reviewed-on: https://gerrit.libreoffice.org/75937 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-06-18loplugin:passstuffbyrefNoel Grandin1-1/+1
Change-Id: Icb7c22cf4ac95eab54d04e79312fb471ca27bceb Reviewed-on: https://gerrit.libreoffice.org/74246 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-06-05Use hasElements to check Sequence emptiness in cppcanvas..desktopArkadiy Illarionov3-13/+13
Similar to clang-tidy readability-container-size-empty Change-Id: I81c0ff78d2ecc7d984e3ed5e5ce60efe327fc162 Reviewed-on: https://gerrit.libreoffice.org/71799 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-05-13Fix emfplus.cxx cppcanvas/qaJulien Nabet1-1/+1
/home/julien/lo/libreoffice/cppcanvas/qa/extras/emfplus/emfplus.cxx: In member function ‘void testFdo77229::TestBody()’: /home/julien/lo/libreoffice/cppcanvas/qa/extras/emfplus/emfplus.cxx:79:46: error: ‘class BitmapColor’ has no member named ‘GetColor’; did you mean ‘getBColor’? Color aColor(pAccess->GetPixel(142, 140).GetColor()); ^~~~~~~~ getBColor Change-Id: I7db2e678ddfadcbd55b3cb87613eeecb79d12ad5 Reviewed-on: https://gerrit.libreoffice.org/72253 Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de> Tested-by: Jenkins
2019-05-13fix wrong SET/QUERY flags passed to uno::ReferenceNoel Grandin1-1/+1
By creating deleted methods for the wrong calls. Avoids the compiler needing to construct a temporary Change-Id: I3b8c648d6bb22d22827bf74f21ea5a2a17fc0f6a Reviewed-on: https://gerrit.libreoffice.org/72103 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-05-12regenerate PCH headersLuboš Luňák1-2/+3
Change-Id: I4894023e42cbfa32916ee3ddfb2cfb5426cfc69f Reviewed-on: https://gerrit.libreoffice.org/72195 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2019-05-10an uno -> a unoCaolán McNamara1-1/+1
Change-Id: I538db88f8477dd2d2ad25c372928fec6c11d979d Reviewed-on: https://gerrit.libreoffice.org/72105 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2019-05-09regenerate PCH headers for the 4 new levelsLuboš Luňák1-98/+21
Plus some build fixes triggered by this. Change-Id: I59b21def706598ceffd45ae5b1f0262ec9c1ad50 Reviewed-on: https://gerrit.libreoffice.org/71581 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2019-05-08improve tools::Rectangle->basegfx::B2?Rectangle conversionNoel Grandin2-30/+24
Improve the conversion method to do something reasonable with empty Rectangle. Use the conversion method in more places. Change-Id: I48c13f3d6dae71f39f03f7939101e545c8125503 Reviewed-on: https://gerrit.libreoffice.org/71853 Tested-by: Jenkins Reviewed-by: Regina Henschel <rb.henschel@t-online.de> Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
2019-04-28rename animate.hxx to animate/Animation.hxx, more changes followTomaž Vajngerl1-1/+1
This is the first step of refactoring Animation where it is needed to separate AnimationBitmap(s) from the Animation class, which is also responsible for displaying of animation. General idea is to make Graphic work only with AnimationBitmaps, which can be freely be swapped out and in, make copies - all transparantly from the actually displaying them and possibly it will also remove the need to copy the animation objects. Change-Id: If5d55ac1a5b26c3880d4f7602be57742b086f9da Reviewed-on: https://gerrit.libreoffice.org/71406 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2019-04-20Fix typoAndrea Gelmini1-6/+6
Change-Id: I9f75142304673c7512f92ae82d8d6cfee6f4a8a3 Reviewed-on: https://gerrit.libreoffice.org/70995 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2019-04-15remove or change salbtype.hxx includes with the specific oneTomaž Vajngerl1-1/+1
We probably don't need salbtype.hxx include, but if we do we can now change it with a more specific one - namely BitmapPalette.hxx in most cases. This doesn't yet touch the includes in VCL. Change-Id: Ie3067ccb2eec425650b41ce7fca48e368215f489 Reviewed-on: https://gerrit.libreoffice.org/70761 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2019-04-12loplugin:sequentialassign in comphelper..cuiNoel Grandin2-5/+2
Change-Id: I1a08f3684b785e31535adcfb4220ded267a77c3b Reviewed-on: https://gerrit.libreoffice.org/70643 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-03-05tdf#42949 Fix IWYU warnings in include/cppcanvas/*Gabor Kelemen4-0/+4
Found with bin/find-unneeded-includes Only removal proposals are dealt with here. Change-Id: I8174b6e684b5b46a8abd3ca825b7de75f9255df3 Reviewed-on: https://gerrit.libreoffice.org/68703 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2019-03-03Simplify containers iterations in cppcanvas, cppu, cppuhelperArkadiy Illarionov1-4/+2
Use range-based loop or replace with STL functions Change-Id: I72bf7cdb632c04e2fc8d4f7ab85cb6571222aa07 Reviewed-on: https://gerrit.libreoffice.org/68636 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-02-25loplugin:unusedfields in variousNoel Grandin2-9/+1
Change-Id: I31d0e6c3559af2e322fb474b97f3bbf4d5064831 Reviewed-on: https://gerrit.libreoffice.org/68280 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-02-07CppunitTest_cppcanvas_emfplus: use CPPUNIT_TEST_FIXTURE()Miklos Vajna1-9/+1
Change-Id: I1d6a2b5d2b34dfd3356650a14cc853d00afbdda9 Reviewed-on: https://gerrit.libreoffice.org/67476 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2019-01-08convert "*xxx.get()" to "*xxx"Noel Grandin1-2/+2
Change-Id: Ic307226591ff9702957ccdec486ccf70357eb6d9 Reviewed-on: https://gerrit.libreoffice.org/65951 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-01-07tdf#42949 Fix IWYU warnings in include/vcl/[v-x]*Gabor Kelemen2-0/+2
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-12-10loplugin:unnecessaryvirtualNoel Grandin2-8/+0
Change-Id: I15633651aaa914918f1e7739c4f3d4793f7d800a Reviewed-on: https://gerrit.libreoffice.org/64831 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-12-10loplugin:unusedfieldsNoel Grandin1-12/+0
Change-Id: I03e8814407fd8e345cb07ac433db4230b4d96e10 Reviewed-on: https://gerrit.libreoffice.org/64822 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-12-09loplugin:unusedmethodsNoel Grandin2-42/+0
Change-Id: I4f2635d468c9ad83b3ac93733529e01a4d03f38e Reviewed-on: https://gerrit.libreoffice.org/64805 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-12-08Clean up obsolete uses of BOOST_FALLTHROUGHStephan Bergmann1-5/+5
Change-Id: If391c86c9b2c94eed9b95c692f290449a241ed4e Reviewed-on: https://gerrit.libreoffice.org/64790 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-12-08Remove misguided FALLTHROUGH commentsStephan Bergmann2-11/+0
...between adjacent switch labels without any intervening statements Change-Id: Ieb8a0d9f71ea4382b5f7d005cdf7111d06aeb5d0 Reviewed-on: https://gerrit.libreoffice.org/64789 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-12-07tdf#111486 Removed not used EMF+ codeBartosz Kosiorek20-3489/+1
Change-Id: I708876fecab1bd6b0c37892efa9c4ab180457d6b Reviewed-on: https://gerrit.libreoffice.org/64366 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-11-27tdf#42949 Fix IWYU warnings in include/vcl/[f-h]*Gabor Kelemen1-0/+2
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-11-25tdf#120703 PVS: V560 A part of conditional expression is always true/falseMike Kaganski1-1/+1
Change-Id: I8d98aa7dd77fbd79611b8a4aba77e8c378fd1cae Reviewed-on: https://gerrit.libreoffice.org/63981 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2018-11-21loplugin:redundantfcast improvementsNoel Grandin1-3/+3
check for calls to constructors, and extend the list of types we check for unnecessary temporary creation Change-Id: Ia2c1f202b41ed6866779fff5343c821128033eec Reviewed-on: https://gerrit.libreoffice.org/63472 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-11-07Fix typosAndrea Gelmini1-1/+1
Change-Id: Id6f5edca053048540b57fd9871aabd1c71f9b64f Reviewed-on: https://gerrit.libreoffice.org/62902 Reviewed-by: Julien Nabet <serval2412@yahoo.fr> Tested-by: Jenkins
2018-11-06tdf#70851 fix strange waveline polygon.Mark Hung1-12/+11
::basegfx::utils::createWaveline was invoked with incorrect parameter, resulted in wavelines rendered along a 4-sided rectangle instead of a line. Change-Id: I30f52c95bdb4f804438b04559ba339ba95dee6e1 Reviewed-on: https://gerrit.libreoffice.org/62838 Tested-by: Jenkins Reviewed-by: Mark Hung <marklh9@gmail.com>
2018-11-05tdf#37636 Render textlines with colors.Mark Hung4-36/+235
Create a new helepr class, TextLinesHelper, to handle textline colors and overall size. Change-Id: I8635199819443429f7be1754a298e9a21ef17f8c Reviewed-on: https://gerrit.libreoffice.org/62832 Tested-by: Jenkins Reviewed-by: Mark Hung <marklh9@gmail.com>
2018-11-05tdf#37636: pass bNormalText to cppcanvas::internal::TextRenderer.Mark Hung1-11/+11
so that we know whether we are rendering a normal text or othewise (like shadow, etc.) because it is not necessary to use the textline color or overline color when rendering the shadow. Change-Id: I51c21bbb4e3cec226320b46e2cdba4cd5e8792d6 Reviewed-on: https://gerrit.libreoffice.org/62831 Tested-by: Jenkins Reviewed-by: Mark Hung <marklh9@gmail.com>
2018-11-05tdf#37636 create underlines, overlines, strikeout separatelyMark Hung2-205/+249
and expose a new cppcanvas::tools::createTextLinesPolyPolygon interace to fetch them in order to fill each of them with their own color later. Change-Id: I26e99a9af87a69d9cb71cda6a4c03c4ba42158dc Reviewed-on: https://gerrit.libreoffice.org/62830 Tested-by: Jenkins Reviewed-by: Mark Hung <marklh9@gmail.com>
2018-11-05tdf#37636 take care of MetaOverlineColorAction in mtfrenderer.Mark Hung2-0/+29
Keep the overline color in DevOutState so that it can be used in text actions later. Change-Id: Ia584de9b78e1adf6862c09fb50cbed1f16e2ad0b Reviewed-on: https://gerrit.libreoffice.org/62829 Tested-by: Jenkins Reviewed-by: Mark Hung <marklh9@gmail.com>
2018-11-05cppcanvas::mtfrenderer refactorMark Hung1-37/+24
to get rid of one of the initEffectLinePolyPolygon we used. Change-Id: I04c6e1dc72e1f3936bfd268a3b1092bdc4a9b199 Reviewed-on: https://gerrit.libreoffice.org/62828 Tested-by: Jenkins Reviewed-by: Mark Hung <marklh9@gmail.com>
2018-10-31tdf#43671 creatCanvasFont with EmphasisMark.Mark Hung2-4/+14
Change-Id: I8c7592e9bdb212fcbb07655e81faadd07ed880f7 Reviewed-on: https://gerrit.libreoffice.org/62244 Tested-by: Jenkins Reviewed-by: Mark Hung <marklh9@gmail.com>
2018-10-23tdf#100236 Implement linestyles with dash and dots.Mark Hung1-104/+93
Allow append dashes to have dash and dot line styles. Segment length parameters were taken from cppcanvas, also restructure the code to use the same appendDashes function. Change-Id: I17c0796dbe722c4c6d5e91d0e318570a52a2514c Reviewed-on: https://gerrit.libreoffice.org/62084 Tested-by: Jenkins Reviewed-by: Mark Hung <marklh9@gmail.com>
2018-10-22tdf#70851 render wave underlines in slideshow.Mark Hung1-6/+13
Change-Id: I31b2717e60b5eae6c992e27700e589938764957c Reviewed-on: https://gerrit.libreoffice.org/62035 Tested-by: Jenkins Reviewed-by: Mark Hung <marklh9@gmail.com>
2018-10-22tdf#100236 implement waveline in mtfrenderer.Mark Hung1-6/+50
Create B2DPolygon with ::basegfx::utils::createWaveline to render the waveline. Parameters are adapted from the drawinglayer. Thickness of the line isn't really implemented yet. Change-Id: I74d05744632d5d54e439a2a3e144fa2daf4ae1bb Reviewed-on: https://gerrit.libreoffice.org/61947 Tested-by: Jenkins Reviewed-by: Mark Hung <marklh9@gmail.com>