summaryrefslogtreecommitdiff
path: root/comphelper
AgeCommit message (Collapse)AuthorFilesLines
2019-12-16desktop: unit-test to check SpellDialog works in multiple viewsAshod Nakashian1-0/+5
Unfortunately, this isn't fully functional, but didn't want to lose the effort. The problem is that there is no proper config for languages in the unit-tests. So even when we set the language explicitly, it still doesn't apply to the SpellCheckerDispatcher, which is where it matters. This seems to be because the config is not properly propagated and broadcast. Below is the stacktrace as works on desktop. During the unittest the Broadcaster has no change listener for LngSvcMgr, so SpellCheckerDispatcher::SetServiceList doesn't get called. #0 0x00007f47f3fed7e6 in SpellCheckerDispatcher::SetServiceList(com::sun::star::lang::Locale const&, com::sun::star::uno::Sequence<rtl::OUString> const&) (this=0x5589de40e7a0, rLocale=..., rSvcImplNames=uno::Sequence of length 1 = {...}) at /home/ash/prj/master/linguistic/source/spelldsp.cxx:795 #1 0x00007f47f3fcc0ad in LngSvcMgr::Notify(com::sun::star::uno::Sequence<rtl::OUString> const&) (this=0x5589de43b4e0, rPropertyNames=uno::Sequence of length 4 = {...}) at /home/ash/prj/master/linguistic/source/lngsvcmgr.cxx:826 #2 0x00007f47fa2d3c8d in utl::ConfigItem::CallNotify(com::sun::star::uno::Sequence<rtl::OUString> const&) (this=0x5589de43b530, rPropertyNames=uno::Sequence of length 4 = {...}) at /home/ash/prj/master/unotools/source/config/configitem.cxx:181 #3 0x00007f47fa2d3946 in utl::ConfigChangeListener_Impl::changesOccurred(com::sun::star::util::ChangesEvent const&) (this=0x5589de464b90, rEvent=...) at /home/ash/prj/master/unotools/source/config/configitem.cxx:143 #4 0x00007f47e273bb61 in configmgr::Broadcaster::send() (this=0x7ffcc604c5b0) at /home/ash/prj/master/configmgr/source/broadcaster.cxx:182 #5 0x00007f47e277f002 in configmgr::RootAccess::commitChanges() (this=0x5589dd557400) at /home/ash/prj/master/configmgr/source/rootaccess.cxx:171 #6 0x00007f47fa2d80e3 in utl::ConfigItem::ReplaceSetProperties(rtl::OUString const&, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) (this=0x5589dd5571b0, rNode="ServiceManager/SpellCheckerList", rValues=uno::Sequence of length 4 = {...}) at /home/ash/prj/master/unotools/source/config/configitem.cxx:1025 #7 0x00007f47fa339983 in SvtLinguConfig::ReplaceSetProperties(rtl::OUString const&, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) (this=0x7ffcc604cb40, rNode="ServiceManager/SpellCheckerList", rValues=uno::Sequence of length 4 = {...}) at /home/ash/prj/master/unotools/source/config/lingucfg.cxx:847 #8 0x00007f47f3fcb88f in LngSvcMgr::UpdateAll() (this=0x5589de43b4e0) at /home/ash/prj/master/linguistic/source/lngsvcmgr.cxx:765 #9 0x00007f47f3fc9caa in LngSvcMgr::LngSvcMgr() (this=0x5589de43b4e0) at /home/ash/prj/master/linguistic/source/lngsvcmgr.cxx:438 #10 0x00007f47f3fd3baf in LngSvcMgr_CreateInstance(com::sun::star::uno::Reference<com::sun::star::lang::XMultiServiceFactory> const&) () at /home/ash/prj/master/linguistic/source/lngsvcmgr.cxx:1967 #11 0x00007f4800e9656b in cppu::OSingleFactoryHelper::createInstanceEveryTime(com::sun::star::uno::Reference<com::sun::star::uno::XComponentContext> const&) (this=0x5589de3ccfc8, xContext= uno::Reference to (cppu::ComponentContext *) 0x5589dbcca630) at /home/ash/prj/master/cppuhelper/source/factory.cxx:149 #12 0x00007f4800e96790 in cppu::OSingleFactoryHelper::createInstanceWithContext(com::sun::star::uno::Reference<com::sun::star::uno::XComponentContext> const&) (this=0x5589de3ccfc8, xContext=uno::Reference to (cppu::ComponentContext *) 0x5589dbcca630) at /home/ash/prj/master/cppuhelper/source/factory.cxx:175 #13 0x00007f4800e97107 in cppu::OFactoryComponentHelper::createInstanceWithContext(com::sun::star::uno::Reference<com::sun::star::uno::XComponentContext> const&) (this=0x5589de3ccf60, xContext=uno::Reference to (cppu::ComponentContext *) 0x5589dbcca630) at /home/ash/prj/master/cppuhelper/source/factory.cxx:374 #14 0x00007f4800eebc8f in cppuhelper::ServiceManager::Data::Implementation::createInstance(com::sun::star::uno::Reference<com::sun::star::uno::XComponentContext> const&, bool) (this=0x5589dbd2f030, context=uno::Reference to (cppu::ComponentContext *) 0x5589dbcca630, singletonRequest=false) at /home/ash/prj/master/cppuhelper/source/servicemanager.cxx:667 #15 0x00007f4800eee587 in cppuhelper::ServiceManager::createInstanceWithContext(rtl::OUString const&, com::sun::star::uno::Reference<com::sun::star::uno::XComponentContext> const&) (this=0x5589dbcbaaf0, aServiceSpecifier="com.sun.star.linguistic2.LinguServiceManager", Context=uno::Reference to (cppu::ComponentContext *) 0x5589dbcca630) at /home/ash/prj/master/cppuhelper/source/servicemanager.cxx:991 #16 0x00007f4800776778 in com::sun::star::linguistic2::LinguServiceManager::create(com::sun::star::uno::Reference<com::sun::star::uno::XComponentContext> const&) (the_context=uno::Reference to (cppu::ComponentContext *) 0x5589dbcca630) at /home/ash/prj/master/workdir/UnoApiHeadersTarget/offapi/normal/com/sun/star/linguistic2/LinguServiceManager.hpp:38 #17 0x00007f4800772d51 in GetLngSvcMgr_Impl() () at /home/ash/prj/master/editeng/source/misc/unolingu.cxx:66 #18 0x00007f4800773449 in SpellDummy_Impl::GetSpell_Impl() (this=0x5589dd82f420) at /home/ash/prj/master/editeng/source/misc/unolingu.cxx:217 #19 0x00007f4800773614 in SpellDummy_Impl::isValid(rtl::OUString const&, short, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) (this=0x5589dd82f420, rWord="a", nLanguage=1033, rProperties=empty uno::Sequence) at /home/ash/prj/master/editeng/source/misc/unolingu.cxx:249 #20 0x00007f48006ae4c2 in ImpEditEngine::DoOnlineSpelling(ContentNode*, bool, bool) (this=0x5589de195060, pThisNodeOnly=0x0, bSpellAtCursorPos=false, bInterruptible=true) at /home/ash/prj/master/editeng/source/editeng/impedit4.cxx:2306 #21 0x00007f480067d0d2 in ImpEditEngine::OnlineSpellHdl(Timer*) (this=0x5589de195060) at /home/ash/prj/master/editeng/source/editeng/impedit3.cxx:322 Change-Id: Iffef03502c78311427aa8883739678120cc84931 (cherry picked from commit 4f77bd94028a140133814d735c0425bbd0de4839) Reviewed-on: https://gerrit.libreoffice.org/85007 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
2019-11-05Revert "sc lok: Implement hi-dpi and zoom for spreadsheets."Michael Meeks1-1/+1
This reverts commit 498dceb43f870bf9e380f1f87e99c6ccadf1963c. Change-Id: Iadb9da47cf8c9a57385530ab888d55169db7639a Reviewed-on: https://gerrit.libreoffice.org/82095 Reviewed-by: Michael Meeks <michael.meeks@collabora.com> Tested-by: Michael Meeks <michael.meeks@collabora.com>
2019-09-20The AsyncQuitHandler class needs to be implemented in the comphelper DLLTor Lillqvist2-0/+52
Otherwise each file that uses it will get a separate copy of the object that the instance() function returns. I think. Silly me for trying to cut corners. Change-Id: Id9df7d60926e57491fe749dfc50cea8e1de643c3 (cherry picked from commit 6d55c969e58714382e6ccd2cedcabceb1bd43c0a) Reviewed-on: https://gerrit.libreoffice.org/79251 Reviewed-by: Tor Lillqvist <tml@collabora.com> Tested-by: Tor Lillqvist <tml@collabora.com>
2019-09-05warn on load when a document binds an event to a macroCaolán McNamara1-0/+14
a) treat shared/Scripts equivalently to document scripts This doesn't automatically warn/block running those scripts when used in a freshly loaded document on its own however because DocumentMacroMode::checkMacrosOnLoading will see at... if ( m_xData->m_rDocumentAccess.documentStorageHasMacros() || hasMacroLibrary() ) that the document contains no macros and flip the allow macros flag to true so that potentially new uses of macros added by the user during the edit are allowed to run b) so, add an additional flag to indicate existence of use of macros in a document c) for odf import, set it when a script:event-listener tag is encountered d) for html import when registerScriptEvents or SwFormatINetFormat::SetMacroTable is called e) for doc import when Read_F_Macro or StoreMacroCmds is called as well for good measure f) for xls import when registerScriptEvent or ScMacroInfo::SetMacro is called g) for oox import when VbaProject::attachMacros is called Change-Id: Ic1203d8ec7dfc217aa217135033ae9db2888e19b Reviewed-on: https://gerrit.libreoffice.org/77387 Tested-by: Jenkins Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com>
2019-09-03Remove work-around for isMobile()Muhammet Kara1-4/+0
Let's remove this dangerous work-around since it is no longer needed after 6ceab5b233da675b25f42fadff9e85d404903322 (cherry picked from commit 610050fcd745694a6dee58152bfc1c4d85535165) Change-Id: Idb18d83f9eac571334fe8bfcd7f212f2f0a930a9 Reviewed-on: https://gerrit.libreoffice.org/78311 Reviewed-by: Andras Timar <andras.timar@collabora.com> Tested-by: Andras Timar <andras.timar@collabora.com>
2019-09-03LOK: per-view support for isMobile()Muhammet Kara1-6/+18
embeddedobj/source/commonembedding/embedobj.cxx will have a follow-up patch, which also removes the -1 case. It is left out because it has many call-sites, and inheritance/override relations. (cherry picked from commit f8b2a27365b858ab5653edad75fd089b39d016d8) Conflicts: comphelper/source/misc/lok.cxx sc/source/ui/condformat/condformatdlg.cxx sc/source/ui/condformat/condformatdlgentry.cxx Change-Id: Iaf00530916f3772f7aec151cbd358f255b7aab24 Reviewed-on: https://gerrit.libreoffice.org/78309 Reviewed-by: Andras Timar <andras.timar@collabora.com> Tested-by: Andras Timar <andras.timar@collabora.com>
2019-09-03lok: Add isMobile() methodMuhammet Kara1-0/+12
[ Miklos: this allows core to e.g. serve tunelled dialogs with more or less compact layouts, depending on if the client is mobile or not. ] (cherry picked from commit 4e144c1ab2ae7ef0a7928f7d4685aabe8e6b9c18) Change-Id: I3559bee84e6ef6f757809617e303aa090698ce5d Reviewed-on: https://gerrit.libreoffice.org/78306 Reviewed-by: Andras Timar <andras.timar@collabora.com> Tested-by: Andras Timar <andras.timar@collabora.com>
2019-08-05pretty up logging of exceptionsNoel Grandin1-1/+1
Add exceptionToString() and getCaughtExceptionAsString() methods in tools. Use the new methods in DbgUnhandledException() Add special-case case code for most of the exceptions that contain extra fields, so all of the relevant data ends up in the log Change-Id: I376f6549b4d7bd480202f8bff17a454657c75ece Reviewed-on: https://gerrit.libreoffice.org/67857 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-08-05Don't draw gridlines and document background in Online server processMike Kaganski1-0/+6
... see https://gerrit.libreoffice.org/72417 They will be drawn client-side. Borders and explicit cell background are still drawn in core. This mode is activated using "sc_no_grid_bg" option in SAL_LOK_OPTIONS environment variable. Change-Id: Ie10e7770b8168ec648d44ae5af0a0a0602d89ee6 Reviewed-on: https://gerrit.libreoffice.org/75484 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2019-05-15Resolves: tdf#120423 dispatch against the correct FrameCaolán McNamara1-11/+17
Change-Id: I5ea2e5d7b79efbd2b14d0b528e5a5c3e44e643bc Reviewed-on: https://gerrit.libreoffice.org/72292 Reviewed-by: Michael Stahl <Michael.Stahl@cib.de> Tested-by: Jenkins
2018-11-24Use the correct DPI scaling factor in LibreOfficeKit for iOS, tooTor Lillqvist1-1/+1
Fixes the rendering of spreadsheets in the iOS app. (The cell area was rendered at half the scale of the row and column headers.) Actual code change only in desktop/source/lib/init.cxx, but update related comments elsewhere to mention CoreGraphics, too, and not just cairo. Change-Id: Ife99c6a2d58e592cfea3b4ed1ab09c19fba77e72 (cherry picked from commit 3ace447b0fe1926945f739479a7be39276e81fb5) Reviewed-on: https://gerrit.libreoffice.org/63919 Tested-by: Jenkins Reviewed-by: Tor Lillqvist <tml@collabora.com>
2018-11-22tdf#42949 Fix IWYU warnings in include/vcl/[B-E]*Gabor Kelemen1-0/+1
Found with bin/find-unneeded-includes Only removal proposals are dealt with here. Change-Id: Iabe571aa8f00492902c499094bea8365a3e17fca Reviewed-on: https://gerrit.libreoffice.org/63623 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com> (cherry picked from commit 40710c488de3e4eef585c5a5276c9a0943d36f2e) Reviewed-on: https://gerrit.libreoffice.org/63769 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2018-11-22tdf#42949 Fix IWYU warnings in include/vcl/[ab]*Gabor Kelemen1-0/+1
Found with bin/find-unneeded-includes Only removal proposals are dealt with here. Change-Id: If18c80fc64e55d797953e24e40e5d5e62bd9c625 Reviewed-on: https://gerrit.libreoffice.org/63453 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com> (cherry picked from commit 492ea7e08571e466e37f870b7642a79df55c2e92) Reviewed-on: https://gerrit.libreoffice.org/63768 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2018-11-12Add a SAL_INFO() when changing the global "lok" language tagTor Lillqvist1-0/+4
Change-Id: I229bb2cce38c3f67724802e31edff73e313b7457
2018-11-12tdf#118581 Correctly display issuer name in signature lineSamuel Mehrbrodt2-0/+336
Move the xmlsec helper methods to comphelper so that we can use them in cui Change-Id: If9b10cfff5f5abd6b16e48f043af7959edbb1142 Reviewed-on: https://gerrit.libreoffice.org/63198 Tested-by: Jenkins Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
2018-11-09Fix many Java subsequentcheck test by using JUHJan-Marek Glogowski1-8/+2
Splits gb_JunitTest_set_unoapi_test_class_and_jars into two separate defines as: - gb_JunitTest_use_unoapi_jars - gb_JunitTest_use_unoapi_test_class Then replaces many of the gb_JunitTest_use_jars lists with the new gb_JunitTest_use_unoapi_jars to fix the JUH dependencies. This probably adds some unneeded JUH dependencies to some Java tests, but that shouldn't be a problem. Change-Id: I0c4fce6b50f7c6eb8d62bfb2c50f056b97584794 Reviewed-on: https://gerrit.libreoffice.org/63119 Tested-by: Jenkins Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
2018-11-08sc lok: Implement hi-dpi and zoom for spreadsheets.Jan Holesovsky1-0/+13
A bit different approach than trying to paint different zoom levels at the samet time, because it is terribly hard to achieve with Calc - things misalign, because Calc tries to fit the lines into the pixels etc. Instead, always paint the spreadsheet at 100%, but use cairo to scale the actual painting. Change-Id: I228a9dd41bf29862bdd188825d12e61e1c86cccc Reviewed-on: https://gerrit.libreoffice.org/63031 Tested-by: Jenkins Reviewed-by: Jan Holesovsky <kendy@collabora.com>
2018-11-08coverity#1441101: Use std::atomic instead of volatileStephan Bergmann1-1/+5
ee9ccdf6ecd944c2f448a30d10700754d1f0cfa2 "reduce cost of ProfileZone when it is not active" had changed g_bRecording from a bool guarded by g_aMutex to a volatile bool. But having been guarded by a mutex indicates that g_bRecording is potentially accessed from multiple threads, and volatile does not avoid races. Change-Id: I933ff5d912cbc7acce52155c605d9c19049c66aa Reviewed-on: https://gerrit.libreoffice.org/63073 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-11-06reduce cost of ProfileZone when it is not activeNoel Grandin1-40/+33
by avoiding taking the mutex Also reduce the code that the mutex covers to the minimum necessary. Change-Id: I115c8a447ec17f4800c39557e8de0bc8c669b47b Reviewed-on: https://gerrit.libreoffice.org/62936 Reviewed-by: Michael Meeks <michael.meeks@collabora.com> Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-11-05tdf#120703 PVS: V1028 fix unexpected integer overflowMike Kaganski1-1/+1
V1028 Possible overflow. Consider casting arguments of the operator to the type instead of casting its result. V547 Expression 'nNewSize > ((sal_Int32) 0x7FFFFFFF)' is always false. Change-Id: I7107b162d88c9d3f97019effcac1f9cfab52a66c Reviewed-on: https://gerrit.libreoffice.org/62846 Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com> Tested-by: Mike Kaganski <mike.kaganski@collabora.com>
2018-11-03tdf#120703 PVS: V547 Expression is always true/falseMike Kaganski1-14/+11
Change-Id: I856345576ff5c10a41509a97ad4539272bd55568 Reviewed-on: https://gerrit.libreoffice.org/62803 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2018-10-26Log unopkg errors to log file if requestedSamuel Mehrbrodt1-0/+5
Before only the output generated by extension add/remove/... functions were logged to file, but not the error messages of unopkg itself. Change-Id: I4451aa51e2877ae48c453ee4791e36d970832567 Reviewed-on: https://gerrit.libreoffice.org/62369 Tested-by: Jenkins Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
2018-10-24remove more rtl::OUString and OString prefixesNoel Grandin4-17/+17
which seem to have snuck back in since the great rounds of removals. Change-Id: I85f7f5f4801c0b48dae8b50f51f83595b286d6a1 Reviewed-on: https://gerrit.libreoffice.org/62229 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-10-24Fix typosAndrea Gelmini2-2/+2
Change-Id: I8d2ff75a7b185daf331724616b4c61c5569c0664 Reviewed-on: https://gerrit.libreoffice.org/62226 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2018-10-20when calling std::lower_boundNoel Grandin1-1/+1
it's not enough to compare != end(), you also need to compare the key against the iterator result Change-Id: Ide5f151ba2297a35e5546f47fbc3c53cbe5ab533 Reviewed-on: https://gerrit.libreoffice.org/62014 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-10-19clang-tidy readability-container-size-emptyNoel Grandin4-4/+4
Change-Id: I1df70b7dff5ebb6048f7fc618789faa15ca5d422 Reviewed-on: https://gerrit.libreoffice.org/61967 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-10-17clang-tidy readability-redundant-smartptr-getNoel Grandin2-3/+3
redundant get() call on smart pointer Change-Id: Icb5a03bbc15e79a30d3d135a507d22914d15c2bd Reviewed-on: https://gerrit.libreoffice.org/61837 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-10-09Extend loplugin:redundantinline to catch inline functions w/o external linkageStephan Bergmann2-4/+4
...where "inline" (in its meaning of "this function can be defined in multiple translation units") thus doesn't make much sense. (As discussed in compilerplugins/clang/redundantinline.cxx, exempt such "static inline" functions in include files for now.) All the rewriting has been done automatically by the plugin, except for one instance in sw/source/ui/frmdlg/column.cxx that used to involve an #if), plus some subsequent solenv/clang-format/reformat-formatted-files. Change-Id: Ib8b996b651aeafc03bbdc8890faa05ed50517224 Reviewed-on: https://gerrit.libreoffice.org/61573 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-10-08tdf#42949 Fix IWYU warnings in include/comphelper/[m-z]*Gabor Kelemen18-3/+24
Found with bin/find-unneeded-includes Only removal proposals are dealt with here. Change-Id: I04c5ba277d5b3398c07de6ae66713d977636088d Reviewed-on: https://gerrit.libreoffice.org/61347 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2018-10-02Move GetkeyBindingStrByXkeyBinding to comphelperSamuel Mehrbrodt2-0/+45
So that it is available to other a11y implementations as well Change-Id: Ib82c4861cf9e0e90c64703b13c46548a080ffd10 Reviewed-on: https://gerrit.libreoffice.org/61198 Tested-by: Jenkins Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
2018-09-27-Werror=unused-variable (--enable-debug --disable-assert-always-abort)Stephan Bergmann1-1/+1
...found by <https://ci.libreoffice.org//job/lo_tb_random_config_linux/1504/> Change-Id: I8ebbe48cdbbdf378731bbc4548031d8799d91532 Reviewed-on: https://gerrit.libreoffice.org/61023 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-09-24tdf#42949 Fix IWYU warnings in include/comphelper/[a-l]*Gabor Kelemen9-1/+12
Found with bin/find-unneeded-includes Only removal proposals are dealt with here. Change-Id: I22ba2c8aec235e34cd7835b8a0a716bf3057db7a Reviewed-on: https://gerrit.libreoffice.org/60837 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2018-09-19generateGUIDString: Fix incorrect string lengthSamuel Mehrbrodt1-1/+1
This bug caused signature line IDs in OOXML to be written with an appended "_x0000_". Change-Id: If219279a5d5177ec5fac2d9dd747dc015c16b6bc Reviewed-on: https://gerrit.libreoffice.org/60736 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Jenkins Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
2018-09-17New loplugin:externalStephan Bergmann5-5/+8
...warning about (for now only) functions and variables with external linkage that likely don't need it. The problems with moving entities into unnamed namespacs and breaking ADL (as alluded to in comments in compilerplugins/clang/external.cxx) are illustrated by the fact that while struct S1 { int f() { return 0; } }; int f(S1 s) { return s.f(); } namespace N { struct S2: S1 { int f() { return 1; } }; int f(S2 s) { return s.f(); } } int main() { return f(N::S2()); } returns 1, both moving just the struct S2 into an nunnamed namespace, struct S1 { int f() { return 0; } }; int f(S1 s) { return s.f(); } namespace N { namespace { struct S2: S1 { int f() { return 1; } }; } int f(S2 s) { return s.f(); } } int main() { return f(N::S2()); } as well as moving just the function f overload into an unnamed namespace, struct S1 { int f() { return 0; } }; int f(S1 s) { return s.f(); } namespace N { struct S2: S1 { int f() { return 1; } }; namespace { int f(S2 s) { return s.f(); } } } int main() { return f(N::S2()); } would each change the program to return 0 instead. Change-Id: I4d09f7ac5e8f9bcd6e6bde4712608444b642265c Reviewed-on: https://gerrit.libreoffice.org/60539 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-09-11clang-tidy bugprone-copy-constructor-initNoel Grandin1-1/+1
Change-Id: Idd435b3a4d081f6d3af26ff8add69ad4af50db57 warning: calling a base constructor other than the copy constructor Reviewed-on: https://gerrit.libreoffice.org/60239 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-09-06loplugin:simplifyconstruct in canvas..cuiNoel Grandin3-6/+2
Change-Id: I02eba1df117a9d0df42bcac13c3251cb4fa6da14 Reviewed-on: https://gerrit.libreoffice.org/60074 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-09-06clang-tidy performance-unnecessary-value-paramNoel Grandin2-3/+4
Change-Id: I69247498e13331f6ef84afeb242479f8fb1178a8 Reviewed-on: https://gerrit.libreoffice.org/60068 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-09-05loplugin:useuniqueptr in AccessibleEventNotifierNoel Grandin1-3/+3
Change-Id: I4a77e1ea7338a2d38120597a146a5a2d893e970b Reviewed-on: https://gerrit.libreoffice.org/59996 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-08-29Replace find_if with proper quantifier algorithmsArkadiy Illarionov1-2/+1
Change-Id: Icc820a47ac891c358883f9c01224f676c58fdd11 Reviewed-on: https://gerrit.libreoffice.org/59744 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-08-29loplugin:constantparam (1)Noel Grandin1-42/+7
Change-Id: I25077e391ecca1b678062d261a83d88daadf0a58 Reviewed-on: https://gerrit.libreoffice.org/59701 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-08-22new loplugin:conststringfieldNoel Grandin4-62/+49
Look for const string fields which can be static, and mostly convert them to OUStringLiteral And add a getLength() method to OUStringLiteral to make the transition easier. Remove dead code in XclExpRoot::GenerateDefaultEncryptionData, default password is never empty. Change-Id: Iae75514d9dbb87289fd5b016222f640abe755091 Reviewed-on: https://gerrit.libreoffice.org/59204 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-08-14create appendCopy method in OUStringBufferNoel Grandin1-1/+1
so we can avoid temporary copies when appending a substring of an OUString to the buffer. I would have preferred to call the method just "append" but that results in ambiguous method errors when the callsite is something like sal_Int32 n; OUStringBuffer s; s.append(n, 10); I'm not sure why Change-Id: I6b5b6641fcb5b26ce2269f89ef06e03c0b6aa76f Reviewed-on: https://gerrit.libreoffice.org/58666 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-08-09remove Calc's software interpreterLuboš Luňák1-2/+0
- it's in practice never used nowadays, group threading has higher priority in the code and since SwInterpreter's allowed opcodes are a subset of group threading's, there should be no formula where control flow gets as far as using SwInterpreter - the only opcodes SwInterpreter allows are ocAdd, ocSub, ocMul, ocDiv, ocSum and ocProduct, which is a rather limited set and group threading should handle all that as well - if SwInterpreter performs anything better than group threading, there shouldn't be a problem doing the same for group threading - it's yet another code path that should be handled, tested, etc. and the added complexity is not worth it - it shares some code with OpenCL handling, which is both added hassle in case OpenCL code needs changes, and it also causes confusion such as people thinking SwInterpreter has something to do with OpenCL Change-Id: I99052862b60b6266c70dd436d1d7938177dc6bd9 Reviewed-on: https://gerrit.libreoffice.org/58643 Tested-by: Jenkins Reviewed-by: Tor Lillqvist <tml@collabora.com>
2018-07-27new loplugin:stringloop, and applied in variousNoel Grandin1-4/+5
look for OUString being appended to in a loop, better to use OUStringBuffer to accumulate the results. Change-Id: Ia36e06e2781a7c546ce9cbad62727aa4c5f10c4b Reviewed-on: https://gerrit.libreoffice.org/58092 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-07-27Related: rhbz#1602589 add comments to coverity annotationsCaolán McNamara1-1/+1
Change-Id: I88c941832a0d682ea4b6028c28edd48cf5df38f7 Reviewed-on: https://gerrit.libreoffice.org/58093 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2018-07-26comphelper: avoid -Werror=deprecated-copy (GCC trunk towards GCC 9)Stephan Bergmann1-6/+0
...by removing explicitly user-provided functions that do the same as their implicitly-defined counterparts, but may prevent implicitly declared copy functions from being defined as non-deleted in the future. (Even if a dtor was declared non-inline in an include file, the apparently-used implicitly-defined copy functions are already inline, so why bother with a non-inline dtor.) Change-Id: Id5494686dd169b17de7830588e603d1fd5f6b768 Reviewed-on: https://gerrit.libreoffice.org/58061 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-07-26loplugin:returnconstant in tools,comphelper,unotoolsNoel Grandin1-3/+1
Change-Id: Iabc3c67b4cdcd0344a37c533bf92dd00cd4700d8 Reviewed-on: https://gerrit.libreoffice.org/57974 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-07-23Fix typosAndrea Gelmini1-2/+2
Change-Id: If0d8f4033d9bc20f521d33d732fb349f0df5eeef Reviewed-on: https://gerrit.libreoffice.org/57822 Reviewed-by: Julien Nabet <serval2412@yahoo.fr> Tested-by: Jenkins
2018-07-20loplugin:unusedfields - look for fields that can be const, in comphelperNoel Grandin9-26/+26
idea from tml. Extend the unusedfields plugin to find fields that are only assigned in the constructor. Change-Id: I258d3581afbe651d53ce730c9ba27a4598cd9248 Reviewed-on: https://gerrit.libreoffice.org/57733 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-07-19Fix typosAndrea Gelmini1-1/+1
Change-Id: If7365b05c8f4fd1bf130678cb28f05c9a1add4c7 Reviewed-on: https://gerrit.libreoffice.org/57598 Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com> Tested-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com>