Commit Graph
2138 Commits
Author SHA1 Message Date
Jochen Nitschke 959496794c cleanup osl/diagnose.h includes
with command
> git grep -l osl/diagnose.h *.cxx |
  xargs grep -L -w 'OSL_\w*' |
  xargs sed -i '/#include *\(<\|\"\)osl\/diagnose.h\(>\|\"\).*/d'

headers need more work

Change-Id: I906519ebbd47a04703b4fa5943b2f7abea7a97ab
Reviewed-on: https://gerrit.libreoffice.org/37350
Tested-by: Jochen Nitschke <j.nitschke+logerrit@ok.de>
Reviewed-by: Michael Stahl <mstahl@redhat.com>
2017-05-09 15:41:46 +02:00
Fakabbir Amin f9f0b6ac12 tdf#43157 Cleanup DBG_ASSERT in pstm.cxx
Change-Id: Ibc7b7399ccc827168768ee94b6e75e4116fc95c9
Reviewed-on: https://gerrit.libreoffice.org/33882
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2017-05-08 16:58:21 +02:00
Jochen Nitschke b3eb843766 cleanup tools/debug.hxx includes
with command
> git grep -l tools/debug.hxx |
  xargs grep -L DBG_ |
  xargs sed -i '/#include *\(<\|\"\)tools\/debug.hxx.*/d'

don't change files in includes/ and */pch

Change-Id: Ie429d6a7dca5dfa1073e0f5ba037f7c84bdbec08
Reviewed-on: https://gerrit.libreoffice.org/37349
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-05-08 08:33:01 +02:00
Chris Sherlock 97eb00c75e revert OSL_ASSERT changes
Change-Id: I365d140446bd2a62cf8256acbfdd53fe72987380
2017-05-07 17:03:35 +10:00
Chris Sherlock 85aefc8802 tdf#43157: convert tools from OSL_ASSERT to assert
Change-Id: If932ad6282bac2ca0caa1a824ce58cad9e61045c
2017-05-07 08:40:29 +10:00
Eike Rathke 3208f0cb80 DateTime::GetWin32FileDateTime: FILETIME is uint64
Truncate to 0 at 1601-01-01
See source code comment for pointers and reasoning.

Change-Id: Iea961e0c0302f4f48a0ddbdd23036cbbbf53c00f
2017-05-06 00:13:15 +02:00
Andrea Gelmini a940826162 Fix typos
To complete commit 0ef94e2b55
and f12096272e

Change-Id: Ie86bbfbd58dd728a013bef221e4d5c8fbcaf8e03
Reviewed-on: https://gerrit.libreoffice.org/37199
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2017-05-05 23:35:06 +02:00
Eike Rathke 7a47058e41 DateTime::CreateFromWin32FileDateTime: FILETIME is uint64
Called with a (stray value read from file?) sometimes absurdly high value
treated as an int64 negative value which the algorithm couldn't cope with,
resulting in weird DateTime ctor arguments that now assert.

Changed to uint64 and replaced calculation with Date::operator+=(long)

Change-Id: Ia8dbc10c4c633208730fce583e43afd828e7546f
2017-05-05 22:56:41 +02:00
David Ostrovsky 9f68be9991 Use gcd from boost::math::gcd
According to the documentation "Run-time GCD & LCM Determination": [1],
gcd should be consumed from boost::math::gcd.

[1] <http://www.boost.org/doc/libs/1_64_0/libs/math/doc/html/math_toolkit/run_time.html>

Change-Id: I026a4e8ead75399765eb73fa5434a57958676383
Reviewed-on: https://gerrit.libreoffice.org/37260
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2017-05-05 09:27:40 +02:00
Michael Stahl 489406e5dd tools: don't use std::tie when comparing resources
This is unbelievably slow, Impress is basically unusable in a
non-optimized build; every time you enter or leave text edit mode,
some svx::sidebar::AreaPropertyPanel is created, which loads the color
palette standard.soc, and there are lots of resource lookups for the
strings in there; the std::tie and std::tuple::operator< make those
10x slower.

(regression from d26f7537a5)

Change-Id: I073b0187f6c173487e781a42c49631cb9ff2e625
2017-05-03 17:13:03 +02:00
Jochen Nitschke d954a20f50 remove excessive forward declarations
and move comments.

Change-Id: Ice44cfb4bbfb8973cd67a168727f2273976f8979
Reviewed-on: https://gerrit.libreoffice.org/37158
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-05-03 09:09:13 +02:00
Eike Rathke eace834d08 Assert that nMonth and nDay <100 to be representable
Change-Id: Ie52269478ecac75519d04310a17873904c8167e6
2017-05-02 23:12:34 +02:00
Eike Rathke 1edd422990 Date::Normalize: handle day 0 and empty date
* Empty date (initialized with Date::EMPTY == all 0) stays empty.
* Day 0 is normalized to the last day of the previous month.
* Day 0 AND month 0 is also normalized to the last day of the previous month
  (and not the last day of the previous-1 month).
* Before,
  * all day 0 cases weren't handled at all and day 0 stayed day 0, which
    doesn't make sense in a Normalize() context
  * empty date wasn't detected and resulted in nonsense date -0001-12-00

Change-Id: Ib12ff7694e1adb17724af038a266f6f284285f36
2017-05-02 21:12:11 +02:00
Eike Rathke 8ea7253327 Date::IsValidDate: year 0 is not
Change-Id: I44e476f354d04a1d070a7348e3b00d75497231c2
2017-05-02 17:23:56 +02:00
Caolán McNamara 34f7e618dd untranslated strings are just strings
removes starmaths InsertCommand in favour of InsertCommandText

Change-Id: I5659adcaa28e5b5861d1a1cc5d2afa84009490f6
Reviewed-on: https://gerrit.libreoffice.org/37113
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
2017-05-02 13:18:57 +02:00
Chris Sherlock ad3e1afe59 Move getProcessWorkingDir from tools to unotools
Change-Id: Ifd86ab3c89c285ad5329fc86cc57967ebd1af91a
Reviewed-on: https://gerrit.libreoffice.org/37100
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Chris Sherlock <chris.sherlock79@gmail.com>
2017-04-29 18:38:09 +02:00
Jochen Nitschke 8250e1a4a3 use std container for ParameterList
'ParameterList::find' was used to detect duplicate sections and
sort the parameters by attribute and section.
Checking for duplicates is done by 'std::any_of' and
the predicate 'Parameter::IsSameSection' now.
The parameters are inserted as they are parsed and sorted later
with 'std::sort' algorithm and 'Parameter::operator<'

Adapt loops to use iterators. Change a weird 'for' loop in
'parseParameters' to a 'do .. while ..' loop to match style of a
preceding loop.

Extend unit test with a case of duplicate sections.

Change-Id: If2789c0cee8f64deae84bc720807d2d26d81dc9f
Reviewed-on: https://gerrit.libreoffice.org/37075
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-04-28 22:29:45 +02:00
Stephan Bergmann f5f564bad3 loplugin:salunicodeliteral: tools
Change-Id: I9b428f4c5ff34a574d13a138cda4444502817e5c
2017-04-28 18:26:54 +02:00
Eike Rathke 9054648bab Month 100 was always wrong
Though only in case localtime() couldn't be obtained, which is about ~never.

Fallout from

    commit a3de32acc0
    Date:   Wed Oct 28 11:23:36 2015 +0100

        Rename (private) Date::init and reuse it

Change-Id: Idbbac69f3d90e7556cd83bbf442ef8ccaecec86e
2017-04-28 17:22:06 +02:00
Noel Grandin d26f7537a5 split nTypeAndId into two fields in ImpContent
preparatory to making the id part into strong_int

Change-Id: Ied96193a6db9d45b24267b51b3014eb923319598
Reviewed-on: https://gerrit.libreoffice.org/37027
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-04-27 19:06:11 +02:00
Caolán McNamara 18120258b3 no bitmaps in .src files anymore
Change-Id: I0228cae8590366be5d5f0d431cf655942bbb891c
2017-04-27 13:29:58 +01:00
Noel Grandin dbd20b5c79 loplugin:unusedmethods
Change-Id: If2e1241bbe8a3d17859e3ca076b0f55f25c48ea5
Reviewed-on: https://gerrit.libreoffice.org/36983
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-04-26 13:25:23 +02:00
Jochen Nitschke bef9fe6e3d extend unit test for INetMIME::scanContentType
This reverts parts of commit 631b679529
and commit abc6071b7a.

some of the removed fields are usefull,
m_bConverted should be checked by callers

fixed 2 bugs and added test cases:
* extended attributes with more than 2 sections were not parsed
* extended attributes with more than 1 section were not parsed
  if there was an other attribute

Change-Id: I61ab2af7c5151ef1bcd80cc159fa2b99559374a8
Reviewed-on: https://gerrit.libreoffice.org/36913
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2017-04-26 09:16:19 +02:00
Chris Sherlock 3b85b72d64 errinf.hxx moved out of tools and into vcl module
ErrorInfo has a hard depency on VCL, yet is in the tools package. It is more
appropriate to have it reside in the VCL module.

Change-Id: Ica54a46c3a7f86cf0331ed7245234bea69c05650
Reviewed-on: https://gerrit.libreoffice.org/36839
Reviewed-by: Chris Sherlock <chris.sherlock79@gmail.com>
Tested-by: Chris Sherlock <chris.sherlock79@gmail.com>
2017-04-25 10:55:17 +02:00
Chris Sherlock da64d198ec tools: svstream.hxx needs only errcode.hxx & not errinf.hxx
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-25 09:31:31 +02:00
Chris Sherlock a1909515e8 tools: cleanup tools/source/ref/errinf.cxx
Make the code more readable, some whitespace formatting changes and
changed ppDcr, etc. to clearer variable names.
Change-Id: I9d0f3eec6607376b6648241cea80922f11d9773e
Reviewed-on: https://gerrit.libreoffice.org/36837
Reviewed-by: Chris Sherlock <chris.sherlock79@gmail.com>
Tested-by: Chris Sherlock <chris.sherlock79@gmail.com>
2017-04-24 00:13:04 +02:00
Chris Sherlock f3281c0954 tools: change internal DynamicErrorInfo struct name
Change of an internal struct's name in errinf.cxx - renaming EDcrData to
DynamicErrorRegistry as EDcr makes very little sense to me. EDcrData is
an internally used struct consisting of collections of error data, error
handlers and error contexts, and uses only DynamicErrorInfo instances.

Change-Id: I79d7f7db5d9550dffca6adcb2a286a2d6e1fa2e7
Reviewed-on: https://gerrit.libreoffice.org/36836
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-04-23 21:24:31 +02:00
Noel Grandin 8c8f2a5285 remove unnecessary explicit linefeeds from end of SAL and OSL log calls
Change-Id: I3fa363c8e76e6cfb297f4ec346e3f031c09d6fbf
Reviewed-on: https://gerrit.libreoffice.org/36727
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-04-21 09:15:11 +02:00
Noel Grandin 841e1a6f36 remove some old MSVC workarounds
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-04-21 09:14:45 +02:00
Noel Grandin 1c5cae479b loplugin:unusedmethods
Change-Id: Ib7a9b1b0802ca751da258065e89b412b090bb672
Reviewed-on: https://gerrit.libreoffice.org/36718
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-04-20 10:07:10 +02:00
Caolán McNamara 2b83e73fd7 remove freshly unused menu support from src files
Change-Id: I038711a0c4d440d452d5b2ae1bfcba5c9305815b
Reviewed-on: https://gerrit.libreoffice.org/36646
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
2017-04-19 13:42:07 +02:00
Stephan Bergmann c4d02f488d Add minimal INetMIME::scanContentType test and fix bugs thus found
Change-Id: I8fcbeb2b0804bc4f9ee8f97f7d02737ba79a7f20
2017-04-12 13:39:52 +02:00
Noel Grandin 4a2a03ff08 Revert "remove duplicate charset entries"
This reverts commit 98973e40e8.

Not actually duplicates, the entries have underscore instead
of dash.
2017-04-12 10:44:17 +02:00
Jochen Nitschke 98973e40e8 remove duplicate charset entries
Change-Id: I0e216af87b3dfaa57533418286fbf290d564cb25
Reviewed-on: https://gerrit.libreoffice.org/36418
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-04-12 10:13:50 +02:00
Noel Grandin 52117bb8c3 loplugin:inlinefields in INetMIMEMessageStream
Change-Id: I675b53a55e02899f0cf325245cedb298f6903281
Reviewed-on: https://gerrit.libreoffice.org/36266
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-04-10 08:52:26 +02:00
Jochen Nitschke b377caa14c use correct string length
Change-Id: I2a5a0e496e80e1f5868e5ac09bfdba57a598ec90
Reviewed-on: https://gerrit.libreoffice.org/36271
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-04-09 20:49:04 +02:00
Noel Grandin be8b9b4d29 loplugin:redundantcast find cstyle arithmetic casts
Change-Id: If7c259f0d12a41182f476ddb558f7cb5f76f9577
Reviewed-on: https://gerrit.libreoffice.org/36253
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-04-07 12:16:13 +00:00
Noel Grandin aa09b0c27a loplugin:useuniqueptr extend to catch more localvar cases
i.e. where the code looks like
{
    foo * p = new foo;
    ...
    delete p;
    return ...;
}

Change-Id: Id5f2e55d0363fc62c72535a23faeaaf1f0ac6aee
Reviewed-on: https://gerrit.libreoffice.org/36190
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-04-06 09:22:46 +00:00
Stephan Bergmann f8cff53299 loplugin:redundantcast (clang-cl)
Change-Id: Ie096d75c1bc774e77c589845f61276d1478234ef
Reviewed-on: https://gerrit.libreoffice.org/36065
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2017-04-04 12:08:43 +00:00
Jens Carl 6b4a149a65 tdf#39468 Translate German comments
Translate German comments and terms in UnoControls/, editeng/, filter/,
odk/, reportdesign/, sd/, sfx2/, starmath/, svl/, svtools/, toolkit/,
tools/, writerfilter/, and xmloff/.

Change-Id: Ibc401a425ddfdf41e4e4a78600f3fbce8cfaa2b1
Reviewed-on: https://gerrit.libreoffice.org/35992
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Michael Stahl <mstahl@redhat.com>
2017-04-03 19:25:49 +00:00
Miklos Vajna a5a571307f tdf#82580 tools: rename Rectangle to tools::Rectangle
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-03-31 06:27:11 +00:00
Noel Grandin 9bfd742d8c loplugin:unusedmethods
Change-Id: Ib008613fb06c82791c63d5b074a3e2ff1c3607a0
Reviewed-on: https://gerrit.libreoffice.org/35834
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-03-29 11:43:40 +00:00
Markus Mohrhard 8681bd32d7 Close already calls unlockFile
Change-Id: I2c9cc94de1b43555b3bdfbed9a476802e1c97733
Reviewed-on: https://gerrit.libreoffice.org/35818
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
2017-03-29 02:52:32 +00:00
Andrea Gelmini f7eb8ae9d9 Fix typos
Change-Id: Ieea40e1b7282267157810f9f58ca083e68ae6715
Reviewed-on: https://gerrit.libreoffice.org/35659
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
Tested-by: Julien Nabet <serval2412@yahoo.fr>
2017-03-25 12:57:18 +00:00
Stephan Bergmann 6291574d94 Remove unused #include <ctype.h>
Change-Id: I8bf3e30687e20151a9e1936e69362abfe9b3a99d
2017-03-23 17:55:31 +01:00
Stephan Bergmann 692424b805 No need for a temporary OString here
Change-Id: I94115baf51dcb52999d97ad1dc3302b109990b04
2017-03-23 17:04:54 +01:00
Stephan Bergmann bd556163d9 Use rtl::isAscii* instead of ctype.h is* (and fix passing plain char)
Change-Id: I83576b55ca421abfe056eb7b66f8f74782100a09
2017-03-22 21:32:40 +01:00
Caolán McNamara 4f0b226600 check for overflow in multiply
gcc >= 5 and clang have builtins for this
msvc has safeint.h and functions in the msl::utilties namespace
otherwise fall back to certs demo implementations

Change-Id: I6001a278c24b0be4b381d933d256f01f91ead55d
Reviewed-on: https://gerrit.libreoffice.org/35505
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
2017-03-22 11:23:46 +00:00
Stephan Bergmann 7778d9f51b Prevent calls to rtl/character.hxx functions with (signed) char arguments
...that would implicitly be sign extended (for plain char only if it is signed),
so non-ASCII char values would trigger the isUnicodeCodePoint assert.

Change-Id: Iaf8024ad509e64525558e882fe3fd078cfb4ea91
Reviewed-on: https://gerrit.libreoffice.org/35523
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2017-03-22 09:00:57 +00:00
Noel Grandin 7299481834 loplugin:redundantcast find redundant c-style enum casts
Change-Id: I2dab376d87804521aed6b6bd41ad7762830fa349
Reviewed-on: https://gerrit.libreoffice.org/35467
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-03-22 06:47:35 +00:00