184 Commits

Author SHA1 Message Date
Noel Grandin
4978328534 convert method names in tools::SvRef to be more like our other..
reference classes, uno::Reference and rtl::Reference.

Specifically rename Is()->is() and Clear()->clear().

Change-Id: Icb7e05e2d09cb9977121508b837ba0961dabb4ae
Reviewed-on: https://gerrit.libreoffice.org/33576
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-02-02 08:02:54 +00:00
Michael Stahl
0cee740c95 replace #ifdef SOLARIS with #ifdef __sun
Check for a macro that is defined by the compiler, we don't really need
one defined by the build system.

Change-Id: Iccb8e3198396881395c97a6b81690ebe64b7e9d2
2017-01-17 16:38:33 +01:00
Oliver Specht
048e30c1f8 tdf#101828 handle rtf/richtext correctly
Change-Id: Id894f62a918bd6e6fa59f8d546307343bf2bd4b0
Reviewed-on: https://gerrit.libreoffice.org/32682
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
2017-01-09 00:34:30 +00:00
Stephan Bergmann
361c6eb18c Use Size::Width/Height instead of inherited Pair::A/B
Change-Id: Ie0346d5ec054fbe7eff1d4b73814a5e2b9f654c2
2016-11-29 10:22:33 +01:00
Caolán McNamara
aa3f954222 coverity#703927 Unchecked return value
make these less odd and simply return the thing they selected, rather than a
bool that indicates that the rpObj arg was successfully set to non-null, so
there's one flag to check not two which both mean the same thing.

Change-Id: If70e412f98dea8b7114fb77f26a9c59aab93be50
Reviewed-on: https://gerrit.libreoffice.org/30794
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
2016-11-14 08:52:21 +00:00
Noel Grandin
1aa69bd5d4 loplugin:countusersofdefaultparams in sd..slideshow
Change-Id: Iaf10935d8f231676333018a5954d97defe35acf6
2016-10-24 10:44:30 +02:00
Noel Grandin
e588aa4d34 convert PageKind to scoped enum
Change-Id: I7f90cf2e96b72031bcfff558794e6cb42ea408e8
2016-10-11 14:32:40 +02:00
Noel Grandin
d58c604eb3 convert DocumentType to scoped enum
Change-Id: I5a66d71db075df4680c54676dd1420e94c1a90b2
2016-10-11 14:32:40 +02:00
Jacek Fraczek
f004aa9951 tdf#89307: Removed SvRef::operator T*()
Conditional statements are using SvRef::Is() method.
Changed static_cast<T*>(svRef<T>) occurances to svRef.get().
Added operator == and != to SvRef.

SbxObject::Execute is using SbxVariableRef internally.
SbxObject::FindQualified is using SbxVariableRef internally.

Change-Id: I45b553e35d8fca9bf71163e6eefc60802a066395
Reviewed-on: https://gerrit.libreoffice.org/29621
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2016-10-10 08:48:30 +00:00
Noel Grandin
954f752cf1 convert MapUnit to scoped enum
I left a prefix on the names "Map" so that I would not have to re-arrange
each name too much, since I can't start identifiers with digits like "100thMM"

And remove RSC_EXTRAMAPUNIT, which doesn't seem to be doing anything anymore.

Change-Id: I5187824aa87e30caf5357b51b5384b5ab919d224
Reviewed-on: https://gerrit.libreoffice.org/29096
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2016-10-05 06:51:20 +00:00
Caolán McNamara
396138a6bc Resolves: coverity#705366 Mixing enum types
and

coverity#705367 Mixing enum types
coverity#705371 Mixing enum types
coverity#982694 Mixing enum types
coverity#1027717 Mixing enum types
coverity#1371228 Mixing enum types
coverity#1371242 Mixing enum types
coverity#1371280 Mixing enum types
coverity#1371310 Mixing enum types

MapUnit and SfxMapUnit share the same values and
are freely cast from one to the other.

Now that

commit d30a4298bdb5ba53cd1fe659f2b742f218a2e527
Date:   Thu Aug 11 15:02:19 2016 +0200

    loplugin:unusedenumconstants in package..svtools

removed the SfxMapUnit entries that were directly unused, they
don't match anymore and casting from one to the other is dangerous.

Why there was two of these anyway escapes me, get rid of SfxMapUnit
and just use MapUnit universally

Change-Id: I4db5dcd04b59be2f85b62b728f96c90afe00c57e
Reviewed-on: https://gerrit.libreoffice.org/28234
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
2016-08-19 11:25:18 +00:00
Noel Grandin
850a8d27ca Convert GRAPHIC to scoped enum
Change-Id: I1fd09a729cbda00f99841532e0dd3fa66bce7bea
Reviewed-on: https://gerrit.libreoffice.org/25534
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-05-27 12:59:23 +00:00
Stephan Bergmann
0f3ac23d73 Insert explicit "break" when falling through to empty next case
...which itself only contains a "break" (or nothing at all at the end of the
"switch"), as otherwise Clang -Wimplicit-fallthrough would warn about these.

Change-Id: I25c1cf2ca74dfeba7ca0385ca8f1c1bf30bbf91b
2016-05-10 14:57:26 +02:00
Noel Grandin
f469309e26 clang-tidy modernize-loop-convert scaddins to sdext
Change-Id: I63ccc56df1a1de8bc443abb95e520246c457912f
Reviewed-on: https://gerrit.libreoffice.org/24798
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Tested-by: Noel Grandin <noelgrandin@gmail.com>
2016-05-10 06:29:32 +00:00
Stephan Bergmann
0003e99b39 loplugin:salbool: Automatic rewrite of sal_False/True
Change-Id: Iae2e695c26e19275ea02bc6737c311d31a45e1d7
2016-04-20 17:25:49 +02:00
Noel Grandin
9649026cf5 clang-tidy performance-unnecessary-value-param in sd
Change-Id: Id55410931305a9695a001977a5227b430a984e99
2016-04-12 11:54:45 +02:00
Noel Grandin
9391688f61 loplugin:constantfunction in editeng
Change-Id: I8f8414b4867d3248e6d836ed8037de4da41b97f1
Reviewed-on: https://gerrit.libreoffice.org/23331
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-03-18 06:02:18 +00:00
Miklos Vajna
eff3f82033 sd: handle classification during copy&paste
This is the same feature as done for sw internal copy&paste and for the
sw RTF filter: if the copying would leak information, better not to do
that.

Change-Id: I39186d7b798d822f1f3a5a4b1ce2aa000c6f7906
2016-03-10 17:43:23 +01:00
Stephan Bergmann
a3a7a70811 -Werror=nonnull-compare
...where "this" must be (derived from) View, in View::InsertData.

Before 89d39bc100aabf5dccbe77c0b5c0c85736e85b39 "tdf#94559: 4th step to remove
rtti.hxx," that was

  ISA( View )

which had originally been introduced as

  ISA( SdView )

into SdView::InsertData with 82453a8c6c84a22b6f940395d9b4c45516197ed3 "#80266#:
added D&D functionality for slide view" in 2001 (and then, both in concert,
SdView::InsertData changed to View::InsertData and the ISA( SdView ) changed to
ISA( View ) with ee8db8ade5ac9205430eab6f1b701f683ea99eb1 "INTEGRATION: CWS
impress1: #111996# Transition to stacked sub-shells. Introduction of namespace
sd."

So just assume it was always only a harmless glitch that is good to go.

Change-Id: I5a99e401feb2a4c4455469b58c803ccab06694f5
2016-02-24 17:39:34 +01:00
Chris Sherlock
538f276ae0 Formatting changes across all modules
+ Removed comment cruft
+ Tab formatting in number of files
+ Some commented out code removed
+ Tab characters replaced with spaces
+ Newline cleanup in quite a few files
+ Tweak header guard #endifs

Change-Id: I3208ff2f047da890edcc49b73389aca22442f5fc
Reviewed-on: https://gerrit.libreoffice.org/22221
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Chris Sherlock <chris.sherlock79@gmail.com>
2016-02-09 08:11:34 +00:00
Andrea Gelmini
64d624b651 Fix typos
Change-Id: I9a5940027423ff0791fa7da0b79b617412ce6b86
Reviewed-on: https://gerrit.libreoffice.org/21209
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
2016-01-10 14:17:20 +00:00
Caolán McNamara
0f02bc189b crashtesting: CreateShellID returns the mediums base url...
when it works the way we want it to work, so presumably we can cut out the
middle man and use getDocumentBaseURL directly which does the same thing.

This has the advantage of being in the IEmbeddedHelper api so assignFrom can be
tweaked to pull the src and dest ids arguments to CopyAndGetEmbeddedObject from
the src and dest IEmbeddedHelpers always available there. So we ensure we
have some ids to present to CopyAndGetEmbeddedObject, avoiding the assert
on converting documents such as ooo89433-1.ppt to pdf

So the explicit args can apparently be dropped, bubbling up then means we don't
need a CloneWithShellIDs (introduced with tdf#71076 and tdf#71767) as normal
Clone should now do the right thing.

And various other arguments in various callers of these, which are typically
filled in with an unhelpful empty OUString placeholder, can go

Change-Id: I9c0be0340e72f98b10ee87ada7d2a021fcc39e23
2015-12-22 20:14:40 +00:00
Stephan Bergmann
92c697c0e3 loplugin:nullptr (automatic rewrite)
Change-Id: If1b80da64ba575f07b31dce9bc0e34b7eb9f11a4
2015-11-10 10:31:38 +01:00
Noel Grandin
a279535660 com::sun::star->css in sd
Change-Id: Ic0cbc857a3a9c66241b94c30bf8c859435f5a4b4
2015-10-29 09:50:19 +02:00
Stephan Bergmann
d50e38686c loplugin:defaultparams
Change-Id: Ibf07815fa1a113876730382b8d14960eb7a78a0b
2015-10-20 11:46:24 +02:00
Oliver Specht
89d39bc100 tdf#94559: 4th step to remove rtti.hxx
replaced use of PTR_CAST, IS_TYPE, ISA in
    idl, editeng, sc, sd, sw, sfx2, sot, starmath

Change-Id: I4a5bba4fdc4829099618c09b690c83f876a3d653
Reviewed-on: https://gerrit.libreoffice.org/19132
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Oliver Specht <oliver.specht@cib.de>
2015-10-06 07:29:37 +00:00
Caolán McNamara
e678a8d8e5 boost->std
Change-Id: If0ca026bd63a921d4f258586231455aacee23b1f
Reviewed-on: https://gerrit.libreoffice.org/18870
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
2015-09-25 21:09:26 +00:00
Caolán McNamara
b71ba617e5 sd/source/ui/inc boost::scoped_ptr->std::unique_ptr
Change-Id: Icf32ccd437c97dfa0ac3a569a3f2ec2b746ac300
Reviewed-on: https://gerrit.libreoffice.org/18822
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
2015-09-24 16:54:36 +00:00
Caolán McNamara
177ea7a281 boost::shared_ptr->std::shared_ptr
Change-Id: I2c6ac98f0984534894759cfbf4449eb554801cf8
Reviewed-on: https://gerrit.libreoffice.org/18678
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
2015-09-23 11:19:17 +00:00
Caolán McNamara
d030c4a2a5 revert for mac and win unit case crashes after boost->std
Change-Id: I82c7084f203a834c2d42f9527705288e6036019b
2015-09-17 18:59:32 +01:00
Caolán McNamara
6f495a195b boost->std
Change-Id: I1e6a7fd66f90e6acd803c6cd464f1d73252f7bcb
2015-09-17 17:01:14 +01:00
Noel Grandin
1df4114245 loplugin:loopvartoosmall
Change-Id: I809e408c994222cfa95ba8f56e4db7bd96be7080
2015-06-02 09:45:16 +02:00
Noel Grandin
ad0c5e6c66 convert META_*_ACTION constants to scoped enum
Change-Id: I8ecfbfecd765a35fafcbcc5452b0d04a89be2459
2015-05-15 10:05:03 +02:00
Stephan Bergmann
f9e73fe26b loplugin:cstylecast: nop between pointer types of exactly same spelling
Change-Id: Ia78ebb57f69c678ddc4ca2b42c82105fa528ff2b
2015-05-11 12:50:39 +02:00
Stephan Bergmann
0241519f32 Unwind SotStorageStreamRef typedef
Change-Id: If7652a7c0251b741660365848a717c06954ca419
2015-05-07 11:05:04 +02:00
Noel Grandin
1f1b9b9ff5 convert SDRINSERT constants to scoped enum
Change-Id: I6335e00cae161cea7ece922ecfa845c205626cd9
2015-04-29 10:41:39 +02:00
Noel Grandin
89dd3f8068 convert SfxObjectCreateMode to scoped enum
and fix some dodgy usage in /sc in the process

Change-Id: Ia2bee267df31aba431fc8cb81195bb83e5b64deb
2015-04-10 09:48:06 +02:00
Stephan Bergmann
1a9e23609b const_cast: convert some C-style casts and remove some redundant ones
Change-Id: Iad769ac61d17f6e348681a38ae11c832f75f6353
2015-03-26 15:33:35 +01:00
Caolán McNamara
dcde8abaaf SotClipboardFormatId::FILE->SotClipboardFormatId::SIMPLE_FILE
Change-Id: Ice4963da8a856b1d2ada13e5b699157a0217e06c
2015-03-18 13:07:59 +00:00
Noel Grandin
fb14be5f8f create new 'enum class' SotClipboardFormatId to unify types
of which there are several.

There are some issues here I am unsure of
- the SW and SC and CHART2 modules essentially ignore the enum values and assign their own ids
  Perhaps I should change them to use the common values and create new enum values where necessary?
- the sc/qa/ and sq/qa/ and starmath/qa/ code was doing some dodgy stuff. I translated the code to pass down the stuff
   numeric values to the underlying code, but perhaps further fixing is necessary?

Change-Id: Ic06d723e404481e3f1bca67c43b70321b764d923
2015-03-18 14:23:50 +02:00
Caolán McNamara
b6d6dab920 V668 no sense in testing the result of new against null
Change-Id: I1cff71d15f4d1b5ee47cc734b3fc2168d7f99201
2015-03-10 15:44:58 +00:00
Michael Weghorn
fb7c188842 fdo#39440 sd: reduce scope of local variables
This addresses some cppcheck warnings.

Change-Id: I14107ca24aa98f4111f542c3999866eb1a93a72b
2014-12-21 20:19:32 +01:00
Tobias Madl
ec5851361b changed timers to idles
Change-Id: I1595a9711e3d5c564f1c9028cbb756f2b0ca45f1
2014-12-09 12:35:00 +00:00
Noel Grandin
526917bbd0 loplugin: cstylecast
Change-Id: I9d3f642239bc5c7a52611b9c27fd0291940c7483
2014-11-10 15:22:17 +02:00
Jan Holesovsky
31af61ea09 Fraction: Revert "fdo#81356: convert Fraction to boost::rational<long> - wip"
This reverts commit 47a2d7642d249d70b5da0c330a73f3a0032e4bba.

Conflicts:

	cui/source/tabpages/transfrm.cxx
	svx/source/svdraw/svdedtv1.cxx
	svx/source/svdraw/svdibrow.cxx
	sw/source/filter/ww1/w1filter.cxx
	tools/source/generic/rational.cxx

Change-Id: I4849916f5f277a4afef0e279b0135c76b36b9d15
2014-10-23 18:34:39 +02:00
Jan Holesovsky
858c2a2977 Fraction: Revert "fdo#84854 it seems long is not enough on 32 bit"
This reverts commit 582ef22d3e8e30ffd58f092d37ffda30bd07bd9e.

Conflicts:

	svx/source/svdraw/svdedtv1.cxx
	svx/source/svdraw/svdibrow.cxx
	sw/source/filter/ww1/w1filter.cxx

Change-Id: I80abc7abdeddc267eaabc9f8ab49611bb3f8ae83
2014-10-23 18:34:34 +02:00
David Tardon
582ef22d3e fdo#84854 it seems long is not enough on 32 bit
Fraction used BigInt internally for computations, rational does nothing
like that.

Change-Id: I3e9b25074f979bc291208f7c6362c3c40eb77ff5
2014-10-16 17:44:44 +02:00
Juan Picca
47a2d7642d fdo#81356: convert Fraction to boost::rational<long> - wip
* Added rational util functions used by Fraction class not
  available in the boost::rational class.
* Replaced usage of Fraction by boost::rational<long>
* Removed code that relies on:
  1. fraction.IsValid() -- rational only allow valid values, ie
     denominator() != 0
  2. rational.denominator() == 0 -- always false
  3. rational.denominator() < 0 -- always false but implementation
     detail: http://www.boost.org/doc/libs/release/libs/rational/rational.html#Internal%20representation
* Simplified code that relies on:
  1. rational.denominator() != 0 -- always true
* BUGS EXIST because Fraction allows the creation of invalid values but
  boost::rational throws the exception boost::bad_rational

Change-Id: I84970a4956afb3f91ac0c8f726547466319420f9
Reviewed-on: https://gerrit.libreoffice.org/11551
Reviewed-by: David Tardon <dtardon@redhat.com>
Tested-by: David Tardon <dtardon@redhat.com>
2014-10-09 11:33:33 +00:00
Matteo Casalin
384cb5ff7b Consistently use size_t and SAL_MAX_SIZE
Instead of a mix of sal_uIntPtr, sal_uLong, int, and so on.
Also change CONTAINER_ENTRY_NOTFOUND=ULONG_MAX to SAL_MAX_SIZE as
return value in case of failure and in the related tests.

Change-Id: Ie778a849253b4be84fbcdab9557b7c4240233927
2014-08-16 21:52:28 +02:00
Miklos Vajna
1e6ff8f7f8 XFillStyle -> css::drawing::FillStyle
Change-Id: I6b2fabd72fd34f4ac1b3a18f386c90794bc39ce4
2014-07-19 00:30:37 +02:00