summaryrefslogtreecommitdiff
path: root/tools
AgeCommit message (Collapse)Author
2017-12-11Revert "just delete, don't check for null and then delete"Caolán McNamara
no time for this This reverts commit 4b941b7b7fd79415935c8f2d3ce900eb64a40f66.
2017-12-11just delete, don't check for null and then deleteCaolán McNamara
Change-Id: I4b3ebaadfe72c2c369ae6ad49abfb0d6626e9d71 Reviewed-on: https://gerrit.libreoffice.org/46228 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2017-12-10tdf#62525 tools: use cow_wrapper class for PolygonAndreas Brandner
Change-Id: I78f141762f593b36d32eb3eb2cda8fdae54b7277 Reviewed-on: https://gerrit.libreoffice.org/42309 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
2017-11-29lokdialog: Changed dialog painting to allow for modal dialogsPranav Kant
Split IDialogNotifier from IDialogRenderable and make SfxViewShell implement it. We now just send the dialog UNO command to the backend and wait for core to emit a 'created' dialog callback which signals dialog creation in the backend. The client is then supposed to send the paint commands for rendering the dialog. Change-Id: I1bfbce83c17955fa0212408376d6bcd1b2d2d1dd
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-11-27loplugin:unnecessaryparen (clang-cl)Stephan Bergmann
Change-Id: I5452235287fd5986de25ee542edd57bf1abded52 Reviewed-on: https://gerrit.libreoffice.org/45338 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2017-11-23loplugin:simplifybool can't invert conditions involving float typesNoel Grandin
so revert some of the changes from commit 7a1c21e53fc4733a4bb52282ce0098fcc085ab0e loplugin:simplifybool for negation of comparison operator Change-Id: I937d575b86c1e418805d399b0dc16ae91876b4fe Reviewed-on: https://gerrit.libreoffice.org/45130 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-11-23loplugin:simplifybool for negation of comparison operatorNoel Grandin
Change-Id: Ie56daf560185274754afbc7a09c432b5c2793791 Reviewed-on: https://gerrit.libreoffice.org/45068 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-11-22cpuid is only for x86 processors.jan Iversen
clang for macOS did not like cpuid when compiling for arm cpu. Change-Id: Iede658a524e5c3e1aa2d33137ed399679b021987
2017-11-22drop duplicate methodCaolán McNamara
Change-Id: Idadd0a64e41cd02f5167b275081c3576a6224b12 Reviewed-on: https://gerrit.libreoffice.org/45075 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2017-11-21halve the number of threads if HT is activeDennis Francis
added hasHyperThreading() function to tools::cpuid to detect hyperthreading. Change-Id: I13fab4b6c649e681c329b7e3f4c9f36bda879d84
2017-11-13inline INetMIMEOutputSinkNoel Grandin
Change-Id: Id76cf021658936301dd6b9685cafe7ece7ffa228 Reviewed-on: https://gerrit.libreoffice.org/44589 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-11-08Retrofit "KeepEmptyLinesAtTheStartOfBlocks: false" into .clang-formatStephan Bergmann
...even if that can cause reformatting of already formatted code. The problem I came across is that without this something like > namespace { > > void f1(); > > void f2(); > > } (which is quite a common style in the current code base) would be changed to > namespace > { > > void f1(); > > void f2(); > } instead of > namespace > { > void f1(); > > void f2(); > } and I found no other clang-format style option that would result in the presence or absence of an empty line be identical at the start and end of the namespace block. vmiklos asked to reformat the existing new (i.e., non-blacklisted) files at the same time, so this commit includes that. Some of those new files had not been formatted at all, so this commit includes their full reformatting changes. Change-Id: I54daf0c11098d07d02c802104cf7f56372e61f7c Reviewed-on: https://gerrit.libreoffice.org/44450 Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de> Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2017-11-06tdf#108748 generate PDF preview on SwapInJan-Marek Glogowski
When including a PDF as an image, it's represented internally as a Bitmap with additional PDF data. On SwapIn, LibreOffice just imported the PDF data missing the PDF preview. The Graphic also gad the wrong image type, which results in a busy loop on master, with a strange / unhelpful STR_COMCORE_READERROR generated by SwNoTextFrame::PaintPicture. This is a workaround to generate the Bitmap on SwapIn, which will really slow down LibreOffice when importing many PDFs. I guess the job of generating the PDF previews should probably be deferred to a thread or a low priority Scheduler task, just like the general image loading is handled. Change-Id: I8084e4533995ecddc5b03ef19cb0c6a2dbf60ebd Reviewed-on: https://gerrit.libreoffice.org/43906 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
2017-11-06loplugin:constparams in cppcanvas,drawinglayerNoel Grandin
Change-Id: I15cac1411c985afe8d7cb9439214a8092702bdb8 Reviewed-on: https://gerrit.libreoffice.org/44343 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-11-01Extract XmlWriter and XmlWalker from opencl into toolsTomaž Vajngerl
In opencl we read and writer the profile xml with custom classes XmlWriter and XmlWalker for reading. This classes are useful in other places (very similar XmlWriter is used in test), so extract the code from opencl and move it to a more common place - tools. Refactoring of other usages will follow. Change-Id: I8363e87b7c30083d299080adec3f99cb33ebe4cc Reviewed-on: https://gerrit.libreoffice.org/44149 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2017-10-30tdf#96505 Get rid of cargo cult long integer literalsudareechk
Removing unnecessary 1L occurrences Change-Id: I85d4949eacde0dfc0ff7a513f4bf42324e6d34c1 Reviewed-on: https://gerrit.libreoffice.org/42840 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Stahl <mstahl@redhat.com>
2017-10-30loplugin:constantparam in toolsNoel Grandin
Change-Id: I639fd4f8990b495f8d572a280837afb7054f4837 Reviewed-on: https://gerrit.libreoffice.org/44047 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-10-27loplugin:includeform: tools (Windows)Stephan Bergmann
Change-Id: I5bbe31b375b60e877630c520eef307f39b9c8dcc
2017-10-27ofz#3791 Integer-overflowCaolán McNamara
Change-Id: I0b8258eaf676ee7291365aec10a7876833aba626 Reviewed-on: https://gerrit.libreoffice.org/43947 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2017-10-27ofz#3802 Integer-overflowCaolán McNamara
Change-Id: Id631951119ed0a6b62ffe7d8342cd92191714114 Reviewed-on: https://gerrit.libreoffice.org/43943 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2017-10-27ofz#3812 Divide-by-zeroCaolán McNamara
Change-Id: I1a278302b995137d3e73620c003534498a59ba14 Reviewed-on: https://gerrit.libreoffice.org/43870 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2017-10-25loplugin:constmethod in tools,sax,UnoControlsNoel Grandin
Change-Id: Ie05e44e2a4019e2549843961ebfa04fef7b7aeb4 Reviewed-on: https://gerrit.libreoffice.org/43767 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-10-23loplugin:includeform: toolsStephan Bergmann
Change-Id: I0af695964e467022050500293570c1e01ac4a517
2017-10-17loplugin:useuniqueptr in tools/inetmsg.hxxNoel Grandin
Change-Id: Ifdf0da7f59af1777f214cbafeb75b46136775f67 Reviewed-on: https://gerrit.libreoffice.org/43450 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-10-16-Werror,-Wtautological-constant-compare (Clang 6)Stephan Bergmann
...making Fraction::HasOverflowValue() always return false on all platforms, regardless of size of long, since 331e2e5ed3bf4e0b2c1fab3b7bca836170317827 "long->sal_Int32 in Fraction" changed Fraction::Impl::value from boost::rational<sal_Int64> to boost::rational<sal_Int32>, and changed the limits to compare with in Fraction::HasOverflowValue from long to sal_Int32. Change-Id: I226ca240d6092ac803a1f65a363b1384903da17a
2017-10-05Rename and move SAL_U/W to o3tl::toU/WMike Kaganski
Previosly (since commit 9ac98e6e3488e434bf4864ecfb13a121784f640b) it was expected to gradually remove SAL_U/W usage in Windows code by replacing with reinterpret_cast or changing to some bettertypes. But as it's useful to make use of fact that LibreOffice and Windows use compatible representation of strings, this commit puts these functions to a better-suited o3tl, and recommends that the functions be consistently used throughout Windows-specific code to reflect the compatibility and keep the casts safe. Change-Id: I2f7c65606d0e2d0c01a00f08812bb4ab7659c5f6 Reviewed-on: https://gerrit.libreoffice.org/43150 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2017-10-03new loplugin:blockblockNoel Grandin
Change-Id: I7b68b70fa4c7234e8882f7627026959a596968fd Reviewed-on: https://gerrit.libreoffice.org/43025 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-09-30Use explicit function names for fooA/fooW WinAPI; prefer fooWMike Kaganski
We should only use generic foo function name when it takes params that are also dependent on UNICODE define, like LoadCursor( nullptr, IDC_ARROW ) where IDC_ARROW is defined in MSVC headers synchronised with LoadCursor definition. We should always use Unicode API for any file paths operations, because otherwise we will get "?" for any character in path that is not in current non-unicode codepage, which will result in failed file operations. Change-Id: I3a7f453ca0f893002d8a9764318919709fd8b633 Reviewed-on: https://gerrit.libreoffice.org/42935 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2017-09-28Remove dead code behind Calc "Live Data Streams" dialog's "scriptdata" buttonStephan Bergmann
...that has been disabled and hidden ever since 4c90ed782a09e2e4b8738b82028032c42d1a203d "Actually hide these two radio buttons (since there is no choice now)." This removes the sole user of SvScriptStream. (Unfortunately, removing the no longer needed #include <osl/process.h> from include/tools/stream.hxx triggered an avalanche of missing includes elsewhere.) Change-Id: I7b0e683b14c0eaf7f4737f62adc9d691826380c0 Reviewed-on: https://gerrit.libreoffice.org/42916 Reviewed-by: Michael Meeks <michael.meeks@collabora.com> Tested-by: Michael Meeks <michael.meeks@collabora.com>
2017-09-27check for NaN in FractionNoel Grandin
which can result from division by zero in earlier code, rather assert explicitly than suffer from weird very large sal_Int64 values (which is what NaN converts to, if we let it do the implicit conversion) Change-Id: Id059b84906bbc90a4fa51489ca96dc0267bb9342 Reviewed-on: https://gerrit.libreoffice.org/42798 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-09-26Rename the basegfx::tools namespace to basegfx::utilsTor Lillqvist
Reduce potential confusion with the global tools namespace. Will hopefully make it possible to remove the annoying initial :: when referring to the global tools namespace. Unless we have even more tools subnamespaces somewhere. Thorsten said it was OK. Change-Id: Id088dfe8f4244cb79df9aa988995b31a1758c996 Reviewed-on: https://gerrit.libreoffice.org/42644 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Tor Lillqvist <tml@collabora.com>
2017-09-22Fresh run of bin/update_pch.shMike Kaganski
Change-Id: I69d4157aaf6570cecd51ea59df20556914942e06 Reviewed-on: https://gerrit.libreoffice.org/42565 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2017-09-21ofz#3454 Floating-point-exceptionCaolán McNamara
Change-Id: I2432bff8e1c102b83f0b7aff1303a03539ce0350 Reviewed-on: https://gerrit.libreoffice.org/42580 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2017-09-21nothing to see here, move alongCaolán McNamara
Change-Id: I1dc03bb80562c4234e8a44bca0253dd3041a5151
2017-09-20use aStripOffsets.size instead of nNumStripOffsetsCaolán McNamara
Change-Id: I5d4f65beb7162aabe51fb932c3aec6a4f9b55684 Reviewed-on: https://gerrit.libreoffice.org/42542 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2017-09-19-Werror,-Wmissing-field-initializers (clang-cl)Stephan Bergmann
Change-Id: I049c5569344ccf74726ec429efefdd9119406488
2017-09-18Acknowledge that WinSalGraphicsImpl::drawPolyLine modifies pPtAryStephan Bergmann
Change-Id: Idde44857f8ace883cc759321c71e2ca7a4359334 Reviewed-on: https://gerrit.libreoffice.org/42406 Reviewed-by: Stephan Bergmann <sbergman@redhat.com> Tested-by: Stephan Bergmann <sbergman@redhat.com>
2017-09-18Use even more WIN32_LEAN_AND_MEANMike Kaganski
Change-Id: I538fe5b41156366e0e87b3a93e58a3947afd18f5 Reviewed-on: https://gerrit.libreoffice.org/42398 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2017-09-15Fix typosAndrea Gelmini
Change-Id: I78653129638b25f16e0816b6fff11e02100c85e7 Reviewed-on: https://gerrit.libreoffice.org/42321 Reviewed-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com> Tested-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com>
2017-09-15Fix INetURLObject::operator==() when comparing pathsEike Rathke
Regression from commit 43a6b59539ad573436f43303e9fbe17c12dc9c84 Date: Mon Jul 10 12:42:24 2017 +0200 simplify some OUString compareTo calls to either startsWith or == or != aPath2.startsWith(aPath1) is not the same as aPath1.compareTo(aPath2, nLength) == 0 if aPath1 is longer than aPath2 ... The consequence was a broken Macro Security Trusted Location that never matched. Change-Id: I6b7adab42982c020f3677bf24f18edd14210ffdf
2017-09-15Assert flags passed to rtl_convertTextToUnicode/UnicodeToText are validStephan Bergmann
...so that at least some typos of using OUSTRING_TO_OSTRING_CVTFLAGS (0x566) instead of OSTRING_TO_OUSTRING_CVTFLAGS (0x333) can be found. (Unfortunately, in the other direction, 0x333 is a valid combination of RTL_UNICODETOTEXT_FLAGS_*.) Change-Id: I7cfb3677b103ae90de88833cc93b0a5384607e15 Reviewed-on: https://gerrit.libreoffice.org/42288 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2017-09-15Add tools::Time::GetMonotonicTicks (us)Jan-Marek Glogowski
This moves a combination of tools::Time::GetSystemTicks(), canvas ElapsedTime::getSystemTime() and the opencl timing implementation into tools::Time::GetMonotonicTicks() as a monotonic microsecond time source. Change-Id: I5c9263540b8af55b2eeca6126e288129427f6e8e Reviewed-on: https://gerrit.libreoffice.org/41991 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2017-09-15long->sal_Int32 in FractionNoel Grandin
because long is 32bits on Windows and 64bits on Linux. Reasoning: (a) all the users of Fraction used to be 32bit in the past (b) this makes the Linux code behave the same as the Windows code (c) changing it to 64bits would be dangerous because then call sites could see silent truncation. Change-Id: I2a36200623a3cf2e7d62ccad030a20614e1798fb Reviewed-on: https://gerrit.libreoffice.org/42200 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-09-13New rtl::isUnicodeScalarValue, rtl::isSurrogateStephan Bergmann
There are apparently various places that want to check for a Unicode scalar value rather than for a Unicode code point. Changed those uses of rtl::isUnicodeCodePoint where that was obvious. (For changing svtools/source/svrtf/svparser.cxx see 8e0fb74dc01927b60d8b868548ef8fe1d7a80ce3 "Revert 'svtools: HTML import: don't put lone surrogates in OUString'".) Other uses of rtl::isUnicodeCodePoint might also want to use rtl::isUnicodeScalarValue instead. As a side effect, this change also introduces rtl::isSurrogate, which is useful in a few places as well. Change-Id: I9245f4f98b83877145a4d392f0ddb7c5d824a535
2017-09-04Translate German comments/debug strings (leftovers in dirs test to uui)Johnny_M
Translates leftovers found using a custom regex. Additionally: - A few spelling fixes Change-Id: I3772e1b914acc487d80ab14efb815cb178ca3dcb Reviewed-on: https://gerrit.libreoffice.org/41831 Reviewed-by: Michael Stahl <mstahl@redhat.com> Tested-by: Michael Stahl <mstahl@redhat.com>
2017-09-04loplugin:unnecessaryparen include c++ castsNoel Grandin
Change-Id: I132d3c66f0562e2c37a02eaf4c168d06c2b473eb Reviewed-on: https://gerrit.libreoffice.org/41874 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-08-25loplugin:unusedmethodsNoel Grandin
Change-Id: Iaaf9092ec4d6189492906648b84494d087fed81f Reviewed-on: https://gerrit.libreoffice.org/41539 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-08-22Remove 500ns offset from GetSystemTicks()Jan-Marek Glogowski
This doesn't make any sense. The orignal idea might have been to somehow be in the middle of 1ms, for whatever reason. And it completely breaks, if we want to sleep 0ms. Change-Id: I525b70c016876a96aa17edefe8c076b122ee2527
2017-08-17remove unnecessary use of OUString::getStrNoel Grandin
Change-Id: I3d13e1c0bb6aa4a7aacc463198747c1368ebc9b4 Reviewed-on: https://gerrit.libreoffice.org/38114 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>