summaryrefslogtreecommitdiff
path: root/framework/source/xml
AgeCommit message (Collapse)Author
2021-08-02convert #defines to OUStringLiteralNoel Grandin
mostly by doing $ git grep -l '#define.*\"' -- *.cxx | xargs perl -pi -e 's/^#define\s+(\w+)\s+(\".*\")/constexpr OUStringLiteral \1 = u\2;/g' Change-Id: I63a4b050f220f0a61749892cd47fb91813f7d088 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119844 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-04-29loplugin:stringadd simplify some *StringBuffer operationsNoel Grandin
pulled from a larger patch which I created with a more permissive variant of this plugin Change-Id: I7abf1f3f09e84703b6e0e52fe9587dff691b2187 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114875 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-02-21loplugin:refcounting in frameworkNoel
Change-Id: I2d7d14fe0335689e4a338c70587bf33137ed1ddd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111279 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-02-16loplugin:referencecasting in editeng..frameworkNoel
Change-Id: Ia3375011ecd0a65afed0f131f477fc1542603fde Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110948 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-11-30loplugin:stringviewparam include comparisons with string literalsNoel
Change-Id: I8ba1214500dddaf413c506a4b82f43d63cda804b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106559 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-11-13tdf#123936 Formatting files in module framework with clang-formatPhilipp Hofer
Change-Id: I8210a1d4bb51519f59265f370f5e8bab8a3c4179 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105674 Tested-by: Jenkins Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com>
2020-04-08loplugin:flatten in frameworkNoel Grandin
Change-Id: I2a74a7543b5edd853396efa31a3e2568e6607778 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91848 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-11-22Extend loplugin:external to warn about classesStephan Bergmann
...following up on 314f15bff08b76bf96acf99141776ef64d2f1355 "Extend loplugin:external to warn about enums". Cases where free functions were moved into an unnamed namespace along with a class, to not break ADL, are in: filter/source/svg/svgexport.cxx sc/source/filter/excel/xelink.cxx sc/source/filter/excel/xilink.cxx svx/source/sdr/contact/viewobjectcontactofunocontrol.cxx All other free functions mentioning moved classes appear to be harmless and not give rise to (silent, even) ADL breakage. (One remaining TODO in compilerplugins/clang/external.cxx is that derived classes are not covered by computeAffectedTypes, even though they could also be affected by ADL-breakage--- but don't seem to be in any acutal case across the code base.) For friend declarations using elaborate type specifiers, like class C1 {}; class C2 { friend class C1; }; * If C2 (but not C1) is moved into an unnamed namespace, the friend declaration must be changed to not use an elaborate type specifier (i.e., "friend C1;"; see C++17 [namespace.memdef]/3: "If the name in a friend declaration is neither qualified nor a template-id and the declaration is a function or an elaborated-type-specifier, the lookup to determine whether the entity has been previously declared shall not consider any scopes outside the innermost enclosing namespace.") * If C1 (but not C2) is moved into an unnamed namespace, the friend declaration must be changed too, see <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71882> "elaborated-type-specifier friend not looked up in unnamed namespace". Apart from that, to keep changes simple and mostly mechanical (which should help avoid regressions), out-of-line definitions of class members have been left in the enclosing (named) namespace. But explicit specializations of class templates had to be moved into the unnamed namespace to appease <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92598> "explicit specialization of template from unnamed namespace using unqualified-id in enclosing namespace". Also, accompanying declarations (of e.g. typedefs or static variables) that could arguably be moved into the unnamed namespace too have been left alone. And in some cases, mention of affected types in blacklists in other loplugins needed to be adapted. And sc/qa/unit/mark_test.cxx uses a hack of including other .cxx, one of which is sc/source/core/data/segmenttree.cxx where e.g. ScFlatUInt16SegmentsImpl is not moved into an unnamed namespace (because it is declared in sc/inc/segmenttree.hxx), but its base ScFlatSegmentsImpl is. GCC warns about such combinations with enabled-by-default -Wsubobject-linkage, but "The compiler doesn’t give this warning for types defined in the main .C file, as those are unlikely to have multiple definitions." (<https://gcc.gnu.org/onlinedocs/gcc-9.2.0/gcc/Warning-Options.html>) The warned-about classes also don't have multiple definitions in the given test, so disable the warning when including the .cxx. Change-Id: Ib694094c0d8168be68f8fe90dfd0acbb66a3f1e4 Reviewed-on: https://gerrit.libreoffice.org/83239 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-11-20tdf#42949 Fix IWYU warnings in framework/*/*cxxGabor Kelemen
Also drop the now unused framework/inc/general.h Found with bin/find-unneeded-includes Only removal proposals are dealt with here. Change-Id: I8e19036a507dbdcd178835b6ac4182719d27a654 Reviewed-on: https://gerrit.libreoffice.org/82744 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2019-11-11tdf#42949 Fix IWYU warnings in framework/*/*hxxGabor Kelemen
Also drop unused framework/inc/fwkdllapi.h Found with bin/find-unneeded-includes Only removal proposals are dealt with here. Change-Id: I9e79266f273b778f4a8bd3330b1b0353a2e01a61 Reviewed-on: https://gerrit.libreoffice.org/81927 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2019-10-31Fix StringAdd::isCompileTimeConstantStephan Bergmann
...to find StringLiteral on the RHS of +=. Which revealed that the VisitCompoundStmt/checkForCompoundAssign logic needed to be fixed, too, so that s += side_effect(); s += "literal"; s += side_effect(); only gets combined to s += side_effect() + "literal"; s += side_effect(); and not all the way to s += side_effect() + "literal" + side_effect(); Change-Id: I432e3458b933a7d0ad6141c747b675cc8b0f0ba4 Reviewed-on: https://gerrit.libreoffice.org/81804 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-07-31Improved loplugin:stringconstant (now that GCC 7 supports it): frameworkStephan Bergmann
Change-Id: Ia6eef000a712c9f23f81eaf6d27f5a236da9b24d Reviewed-on: https://gerrit.libreoffice.org/76673 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-07-24loplugin:unusedfieldsNoel Grandin
Change-Id: I80ed513cf690f94bf4320b040b36d7f904c63482 Reviewed-on: https://gerrit.libreoffice.org/76233 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-07-23simplify framework image manager load/save codeNoel Grandin
most of this stuff is unused, and we only ever have one image-list Change-Id: I2c7aba4b537b725a627df65609167aea3159553e Reviewed-on: https://gerrit.libreoffice.org/76148 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-07-23Simplify framework image managerNoel Grandin
various bits are no longer used since commit ca00697e3dae9a03573d11281fc8d9a4ee391d3d Date: Tue Sep 8 04:57:32 2009 +0000 CWS-TOOLING: integrate CWS oj18 Change-Id: Iea57cee35026fd90f6a9aaf9927a80a646d722bb Reviewed-on: https://gerrit.libreoffice.org/76147 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-03-06loplugin:unnecessaryparen improve member expressionNoel Grandin
Change-Id: I304621018cb1e2a47e478e86df4229bcf2176741 Reviewed-on: https://gerrit.libreoffice.org/68757 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-10-22pvs-studio: V728 An excessive check can be simplifiedCaolán McNamara
for... "The '(A && !B) || (!A && B)' expression is equivalent to the 'bool(A) != bool(B)' expression" subcases, where the args are already bool Change-Id: Ica8b5c4974c513f7f7ad8acf17ca931e85ebc8af Reviewed-on: https://gerrit.libreoffice.org/62146 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2018-07-30Add missing sal/log.hxx headersGabor Kelemen
rtl/string.hxx and rtl/ustring.hxx both unnecessarily #include <sal/log.hxx> (and don't make use of it themselves), but many other files happen to depend on it. This is a continuation of commit 6ff2d84ade299cb3d14d4110e4cf1a4b8070c030 to be able to remove those unneeded includes. This commit adds missing headers to every file found by: grep -FwL sal/log.hxx $(git grep -Elw 'SAL_INFO|SAL_INFO_IF|SAL_WARN|SAL_WARN_IF|SAL_DETAIL_LOG_STREAM|SAL_WHERE|SAL_STREAM|SAL_DEBUG') to directories from filter to jvmfwk Change-Id: I2a73d63f2aaef5f26d7d08957daaa8a30b412ac5 Reviewed-on: https://gerrit.libreoffice.org/58204 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2018-04-21cppcheck: identicalInnerConditionJochen Nitschke
renamed temporary list in EnhancedCustomShape2d.cxx to avoid shadow of a local variable Change-Id: I17a2261dafd2067480fcc5314af4f48765d6b690 Reviewed-on: https://gerrit.libreoffice.org/53244 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Jochen Nitschke <j.nitschke+logerrit@ok.de>
2018-04-01remove unused processfactory.hxx includesJochen Nitschke
and fix fallout Change-Id: Id06bf31f2075111e426ba40c84c885ae70697bee Reviewed-on: https://gerrit.libreoffice.org/52206 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Jochen Nitschke <j.nitschke+logerrit@ok.de>
2018-03-17Use for-range loops in frameworkJulien Nabet
Change-Id: I72ea832848fd7c76863bcee70a3303de488c0b0f Reviewed-on: https://gerrit.libreoffice.org/51471 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2018-03-01make Color::GetRGBColor return Color instead of ColorDataNoel Grandin
Change-Id: I532959a7103c3857510f26ecce2f942d676a233b Reviewed-on: https://gerrit.libreoffice.org/50487 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-02-28use less COLORDATA_RGBNoel Grandin
part of removing ColorData Change-Id: I5518cddeeefe66f70380367e1e3f78af0f3b5fbc Reviewed-on: https://gerrit.libreoffice.org/50486 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-01-24loplugin:useuniqueptr in ImageListsDescriptorNoel Grandin
Change-Id: I165af348b6d8863a4b1e5dd164d92c29f49d09c0 Reviewed-on: https://gerrit.libreoffice.org/48423 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-01-15More loplugin:cstylecast: frameworkStephan Bergmann
Change-Id: Iffd183cb21b43aaa66dd55cc6c453ebeae36a3e1
2018-01-12More loplugin:cstylecast: frameworkStephan 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: I8981ef6de675bf10c103e1af0afccd620762268d
2017-08-11convert std::map::insert to std::map::emplaceNoel Grandin
which is considerably less verbose Change-Id: Ifa373e8eb09e39bd6c8d3578641610a6055a187b Reviewed-on: https://gerrit.libreoffice.org/40978 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-06-23loplugin:unusedfields in forms..idlcNoel Grandin
Change-Id: If250ff47c1f375fe24c61b5bf271da9a9c330822 Reviewed-on: https://gerrit.libreoffice.org/39133 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-05-12remove unused uno::Reference varsNoel Grandin
found by temporarily marking Reference as SAL_WARN_UNUSED. Change-Id: I18809b62654467f890016adcc92576980ced393b Reviewed-on: https://gerrit.libreoffice.org/37511 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-04-25tools: svstream.hxx needs only errcode.hxx & not errinf.hxxChris Sherlock
Change-Id: Ia28e35ae5af4f601e9a586a3deffbcd61702b0ca Reviewed-on: https://gerrit.libreoffice.org/36896 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Chris Sherlock <chris.sherlock79@gmail.com>
2017-04-21remove some old MSVC workaroundsNoel Grandin
Change-Id: I6abd8aaffb27b3c85df7c0518f7f576be4e32222 Reviewed-on: https://gerrit.libreoffice.org/36660 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-02-06Add missing #includesStephan Bergmann
...and remove some unncessary using directives/declarations, in preparation of removing now-unnecessary #includes from cppumaker-generated files, post e57ca02849c3d87142ff5ff9099a212e72b8139c "Remove dynamic exception specifications". Change-Id: Iaf1f268871e2ee1d1c76cf90f03557527ebc9067
2017-02-02unnecessary use of OUStringBuffer in throwing exceptionsNoel Grandin
Change-Id: Iec1473264426f19c31e72260dfce9494389e474f Reviewed-on: https://gerrit.libreoffice.org/33788 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-01-26Remove dynamic exception specificationsStephan Bergmann
...(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>
2017-01-17new loplugin: useuniqueptr: forms..frameworkNoel Grandin
Change-Id: I4300a13f455148b7156ac3f444c7102d63ae6db3 Reviewed-on: https://gerrit.libreoffice.org/33164 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-01-09New loplugin:externvar: frameworkStephan Bergmann
Change-Id: Idcc4e0bb8065d7a9b30d38463470a67b1921c6cb
2016-10-03Fix typosAndrea Gelmini
Change-Id: I7000efdb7276053c16de992fa8f9a4e614ecb3e2 Reviewed-on: https://gerrit.libreoffice.org/29434 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2016-07-07loplugin:passstuffbyref also for {css::uno,rtl}::ReferenceStephan Bergmann
Change-Id: I22e493f08f11b10d709dd8b4a223a75d52bb5899
2016-06-24loplugin:singlevalfields in frameworkNoel Grandin
Change-Id: I5f5efe2180905343654bdbe4d765e7fd311a2d8a Reviewed-on: https://gerrit.libreoffice.org/26636 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-04-27clang-tidy modernize-loop-convert in f*Noel Grandin
Change-Id: Id866aa244378758e3bdb9e99d02cdd2ae6104e16
2016-04-19Elide macros used onceStephan Bergmann
Change-Id: I5d5c916c966c9e9f2c77c9655f3e8d13a7032117
2016-04-18Remove unused XMLNS_XLINKStephan Bergmann
Change-Id: Ibb2831ed71f61461e7f23edd6eea29ba64df05a9
2016-04-18Elide macro used onceStephan Bergmann
Change-Id: Ie0ad7834f54a5bf9cea65b4bb6d7501a90da0f24
2016-01-26Replace salhelper::SingletonRef with rtl::StaticStephan Bergmann
When destroying the static vcl::CommandInfoProvider aProvider from vcl::CommandInfoProvider::Instance (vcl/source/helper/commandinfoprovider.cxx) during exit, it releases its mxCachedGlobalAcceleratorConfiguration reference on GlobalAcceleratorConfiguration (framework/source/accelerators/globalacceleratorconfiguration.cxx), which may get destroyed, whose base class framework::XCUBasedAcceleratorConfiguration (framework/source/inc/accelerators/acceleratorconfiguration.hxx) has a salhelper::SingletonRef<framework::KeyMapping> member, whose destructor (include/salhelper/singletonref.hxx) uses salhelper::SingletonRef<framework::KeyMapping>::SingletonLockInit::operator ()'s static osl::Mutex aInstance. If, during construction, the instantiation of salhelper::SingletonRef<framework::KeyMapping>::SingletonLockInit::operator ()'s static osl::Mutex aInstance finishes before the instantiation of vcl::CommandInfoProvider::Instance's static vcl::CommandInfoProvider aProvider, the corresponding atexit cleanup actions will be recorded in the right order, causing the above chain of calls to find the static Mutex still alive when used from within the static CommandInfoProvider's destruction. However, vcl::CommandInfoProvider's mxCachedGlobalAcceleratorConfiguration is only set to css::ui::GlobalAcceleratorConfiguration::create in vcl::CommandInfoProvider::GetGlobalAcceleratorConfiguration, so the instantiation of the static Mutex instance can finish after the instantiation of the static CommandInfoProvider instance, recording the atexit cleanup actions in the wrong order, causing the static Mutex to be used after destruction. This occasionally caused PythonTest_sfx2_python to hang during exit for me on Linux, where trying to lock a destroyed pthread mutex can apparently deadlock. rtl::Static does away with the need to do anything in the destructor, at the expense of always keeping the instance alive until exit (and not being able to recreate an already destroyed instance during exit, but code that would require that behavior would probably already be broken to begin with), so the order of creation of the CommandInfoProvider and GlobalAcceleratorConfiguration instances becomes less of a concern. Change-Id: Id6e3860ad9e5b7045980a0b9bf9eaef2e24129bb
2015-11-12Windows header sanitizationAshod Nakashian
Isolation of windows headers using prewin.h and postwin.h headers and making headers dependent on them more self contained. Conversion of TCHAR to WCHAR and LPCTSTR to LPCWSTR etc. and cleanup of unnecessary casts. Change-Id: I7eff5c477d9223a064bfb4d962ff6d61960ee69c Reviewed-on: https://gerrit.libreoffice.org/19901 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2015-11-11framework: boost::ptr_vector->std::vector<std::unique_ptr>Noel Grandin
Change-Id: I10801343e65646b92eb0a6256cd7bfbf5c84c854
2015-11-11framework: boost::ptr_vector->std::vector<std::unique_ptr>Noel Grandin
Change-Id: Ia75bf59de4eb5e0be18f81b6ab897f9f9cb28855
2015-11-11framework: boost::ptr_vector->std::vector<std::unique_ptr>Noel Grandin
Change-Id: If9981b141a591f23e03479c90694e6ffa78f2cb8
2015-11-10loplugin:nullptr (automatic rewrite)Stephan Bergmann
Change-Id: Ie178c474921c1695927a9b01a9972baf09fbb73d
2015-11-06loplugin:stringconstant: elide explicit ctor usage (automatic rewrite)Stephan Bergmann
Change-Id: Iff1f68969f0f044c59a92ab4c019c471511743f7