Commit Graph

557 Commits

Author SHA1 Message Date
Caolán McNamara
db4d4bac22 ofz#3801 Divide-by-zero
Change-Id: Ibb2f3e5508899541bc201240a7e9d5f26c750fa5
Reviewed-on: https://gerrit.libreoffice.org/43843
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
2017-10-25 21:33:19 +02:00
Caolán McNamara
d38c7b9654 ofz#3800 Bad-cast
Change-Id: Ib27aa3d10468fbf4030af9b28fdcb29c1ff8cc6b
Reviewed-on: https://gerrit.libreoffice.org/43835
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
2017-10-25 21:27:59 +02:00
Noel Grandin
83fd71e041 loplugin:constmethod in tools,sax,UnoControls
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-25 10:56:03 +02:00
Noel Grandin
ac45764b05 loplugin:finalclasses in svx
Change-Id: I74296e2185902498cd569ecde83905f718a41e84
Reviewed-on: https://gerrit.libreoffice.org/43715
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-10-24 07:59:06 +02:00
Stephan Bergmann
97059fbd09 loplugin:includeform: svx
Change-Id: I4057fe05983fb2b63b592ffd325894c12b9cb5b2
2017-10-23 22:45:50 +02:00
Michael Stahl
33eb9fdb61 tdf#97630 xmloff: ODF extended draw:fit-to-size mess
The plan:

1. As Regina points out, there is already (in ODF 1.2, but not ODF 1.1)
   a style:shrink-to-fit attribute for shapes, so use this to represent
   the AUTOFIT value.

   The fallback from AUTOFIT to draw:fit-to-size="true" was a stupid
   idea anyway, probably "false" is less annoying in practice.

   There are 2 different shapes that implement TextFitToSize property:

   a) text shapes already interpret ALLLINES and PROPORTIONAL exactly
      the same
   b) fontwork custom shapes interpret ALLLINES but do nothing for
      PROPORTIONAL

   As Regina points out, there is no shape that needs to distinguish
   between ALLLINES and PROPORTIONAL, so we do a minor behavioral
   API CHANGE and from now on interpret PROPORTIONAL as ALLLINES
   on fontwork custom shapes.  This obviates the need to distinguish
   the values in ODF and so we don't need a new attribute,
   just use draw:fit-to-size="true" for both.

   On import, use MID_FLAG_MERGE_PROPERTY to combine the 2 attributes
   into one value.

2. Restrict the export of draw:fit-to-size to only the standard
   values "true"/"false".

This implements step 1, the step 2 will be done in the future when
most users have the import of the style:shrink-to-fit.

Change-Id: I4a378aa110fdb82db7a99a839d7ff207248a73e7
Reviewed-on: https://gerrit.libreoffice.org/43521
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Michael Stahl <mstahl@redhat.com>
2017-10-20 10:59:37 +02:00
Michael Stahl
e2c85365df svx: remove pointless duplicate SdrFitToSizeType
Change-Id: I7a59ecfdb8d09ecbc0b760003dbc453ac5646d1c
2017-10-18 12:34:03 +02:00
Tor Lillqvist
8e7897588d Rename the basegfx::tools namespace to basegfx::utils
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-26 14:18:41 +02:00
Noel Grandin
331e2e5ed3 long->sal_Int32 in Fraction
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-15 09:53:57 +02:00
Noel Grandin
158434ee87 no need to call GetNumerator() / GetDenominator() for Fraction
simplify the calculations - why have a Fraction and then just split
it up for the calculation?

Change-Id: I81af95e1ee1633f77e088c0990f308b1c169a6a2
Reviewed-on: https://gerrit.libreoffice.org/42242
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-09-13 15:47:04 +02:00
Jochen Nitschke
5a64d8b20e drop unused SdrCustomShapeAdjustmentItem
unused since commit 935baf97a9
Date:   Tue May 19 09:32:45 2009 +0000
    CWS-TOOLING: integrate CWS impress169

Change-Id: I1e8b0285ae1f6e8d92efd3f5a2463ff3126f1a0d
Reviewed-on: https://gerrit.libreoffice.org/41248
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-08-17 16:33:48 +02:00
Noel Grandin
2e8acde112 remove UL/L suffixes from integer constants on the RHS of expressions
Change-Id: I899a8126c9d971601fea6c77eca165718aea0ac5
Reviewed-on: https://gerrit.libreoffice.org/41237
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-08-17 11:25:21 +02:00
Noel Grandin
ff1f6a5fc2 remove UL/L suffixes from integer constants in initialiser/call expressions
Change-Id: Iae081567c4fa5b88edbd12cf2fbafd2b8f31b300
Reviewed-on: https://gerrit.libreoffice.org/41214
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-08-17 08:14:31 +02:00
Paul Trojahn
3e33a25515 tdf#109317 Fix incorrect rotation of flipped custom OOXML shapes
The shape wasn't imported correctly because IsPostRotateAngle wasn't
set. As a result the shape was flipped after it was rotated instead
of before. This commit removes 1c44b263 and converts the rotation to
the internal format instead. This also fixes that ooxml preset shapes
can't be exported to odf correctly and that ooxml preset shapes rotate
in the wrong direction when rotated in LO.

Change-Id: I9691902fdfb2cfecc8fe50d6eb66ac3880ddd4e8
Reviewed-on: https://gerrit.libreoffice.org/40789
Reviewed-by: Tamás Zolnai <tamas.zolnai@collabora.com>
Tested-by: Tamás Zolnai <tamas.zolnai@collabora.com>
2017-08-10 17:38:20 +02:00
Noel Grandin
612b489d3e loplugin:checkunusedparams
the "check for taking address of function" part was generating false+

Change-Id: Iad6203850901229b7b1b2f8938c68ec703cd343f
Reviewed-on: https://gerrit.libreoffice.org/40613
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-08-01 11:06:26 +02:00
Noel Grandin
148a9f29d4 loplugin:constparams in svx
Change-Id: Icc388182b9b7b6a6617793be09217f06bed7332d
Reviewed-on: https://gerrit.libreoffice.org/40527
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-07-29 08:50:12 +02:00
Noel Grandin
8ce64dbb3d loplugin:constparams in svx
and fix a bug in the plugin itself when calling operator's like the one
on std::function<>

Change-Id: I1617607107eeff06785c1841f69e13ad2926218e
Reviewed-on: https://gerrit.libreoffice.org/40446
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-07-27 08:03:26 +02:00
Noel Grandin
7b59273c6c loplugin:unusedfields in svx
Change-Id: I7fc5bf55b01d464815771220914f21d8e85b5a36
Reviewed-on: https://gerrit.libreoffice.org/40253
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-07-21 08:38:06 +02:00
Noel Grandin
4250b25c6a teach unnecessaryparen loplugin about identifiers
Change-Id: I5710b51e53779c222cec0bf08cd34bda330fec4b
Reviewed-on: https://gerrit.libreoffice.org/39737
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-07-10 09:57:24 +02:00
Noel Grandin
4b2262ab5b new loplugin unnecessaryparen
Change-Id: Ic883a07b30069ca6342d7521c8ad890f4326f0ec
Reviewed-on: https://gerrit.libreoffice.org/39549
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-07-05 11:08:48 +02:00
Noel Grandin
a5c200bddd loplugin:unusedfields in svx
Change-Id: I027b70ee92ab07eb68452457c3ee45de3ad22c8b
Reviewed-on: https://gerrit.libreoffice.org/39412
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-07-03 10:19:36 +02:00
Noel Grandin
6561fc32af loplugin:oncevar in svx
Change-Id: I22a3a13e059ac7d3479f12860564fe3eb1b55e44
Reviewed-on: https://gerrit.libreoffice.org/39282
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-06-27 11:11:27 +02:00
Noel Grandin
5e028ad5dc simplify some string handling in tracing calls
Change-Id: I0fb76562429e691400a02216019c7f96791cf9b3
Reviewed-on: https://gerrit.libreoffice.org/39159
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-06-23 14:38:14 +02:00
Noel Grandin
546c355191 use more SAL_N_ELEMENTS part 2
Change-Id: If00e371c3cd3ae616309a172c875faed016e391b
Reviewed-on: https://gerrit.libreoffice.org/38773
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-06-14 15:14:27 +02:00
Stephan Bergmann
acb923263e Improved loplugin:cstylecast to reference types: svx
Change-Id: Idb58ca86ea6c0593283c455880ca7c0e99983c60
2017-06-05 21:18:02 +02:00
Vasily Melenchuk
5477f7274e tdf#100072 zero height of shape's path was causing geometry errors
DOCX custom geometry shape's path width and height are now used
independently for scaling calculations.

Change-Id: I368dd4dc065b8f122c4eb2911261e45047f03c70
Reviewed-on: https://gerrit.libreoffice.org/37639
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
2017-05-18 14:15:27 +02:00
Noel Grandin
ac11e45bad loplugin:checkunusedparams in svx(part4)
Change-Id: I032b49f4e1228ef275d7ff8d87ba969dcef687ab
Reviewed-on: https://gerrit.libreoffice.org/37248
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-05-05 08:50:46 +02:00
Noel Grandin
97f391d4e5 loplugin:checkunusedparams in svx(part1)
Change-Id: Ie98ec3be5ece2579feca050563c5ab7776ad6a7e
Reviewed-on: https://gerrit.libreoffice.org/37227
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-05-04 12:14:56 +02:00
Noel Grandin
9fa75f677a loplugin:mergeclasses merge E3dScene with E3dPolyScene
Change-Id: I70f28fb4c87ad8c0e0ad46f4ce04914b6536d6b9
Reviewed-on: https://gerrit.libreoffice.org/36376
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-04-11 10:16:16 +02:00
Noel Grandin
7662e92c64 loplugin:redundantcast find cstyle double casts
Change-Id: I5507be190dac781e5cdb545a60acf3d50056c9f8
Reviewed-on: https://gerrit.libreoffice.org/36187
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-04-06 07:47:30 +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
Caolán McNamara
5b487ff81b document mnIndex doesn't change
Change-Id: Ia000682774cee4c58811325f6ab40859502da79f
2017-03-27 09:00:13 +01:00
Andrea Gelmini
98f18df023 Fix typos
Change-Id: I77cf7fe3a57c031877facf5252b5a900526db48b
Reviewed-on: https://gerrit.libreoffice.org/35646
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
Tested-by: Julien Nabet <serval2412@yahoo.fr>
2017-03-25 17:07:56 +00:00
Noel Grandin
ed76d1d350 loplugins:redundantcast teach it about c-style typedef casts
Change-Id: I1ac11a2481c0f4d8be1e1fd7c7637ac0ece3d65c
Reviewed-on: https://gerrit.libreoffice.org/35558
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-03-23 09:48:10 +00:00
Caolán McNamara
1670cc25bc ofz: stack-overflow with infinite parse recursion
Change-Id: I4973875797446e146cbda6db84958c9e4962aa8b
Reviewed-on: https://gerrit.libreoffice.org/35545
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 23:27:45 +00:00
Jochen Nitschke
b4156ece74 use forward declaration for SfxItemSet
Change-Id: I81f5d1ca22868d278662a55443e2038581dd3246
Reviewed-on: https://gerrit.libreoffice.org/35280
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-03-16 18:36:08 +00:00
Noel Grandin
8ccbc16b5e convert SvxFrameDirection to scoped enum
Based on the casts in chart2/source/view/main/ChartView.cxx
and the similarity of naming of values, I conclude that this
enum was intended to abstract over css::text::WritingMode2.

Added a comment to that effect.

Change-Id: I3af8bbe8b6ac8c4a9375f6ccde145b98b9c69a57
Reviewed-on: https://gerrit.libreoffice.org/35164
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-03-15 08:35:10 +00:00
Stephan Bergmann
df016bf7f4 loplugin:loopvartoosmall
Change-Id: Iedec0d8b1f031f8c311acba80609b59df5f9f4cf
2017-03-08 11:03:22 +01:00
Stephan Bergmann
febc1161d1 Clean up use of integer types
Change-Id: Ief9b377b4352796e19797c397e677e9f8397cc53
2017-02-26 13:50:41 +01:00
Stephan Bergmann
e99047fe3b loplugin:subtlezeroinit: svx
Change-Id: I41b2379e42710f908ab0b4531a52cfbff980725e
2017-02-21 07:34:58 +01:00
Tor Lillqvist
34d8dc19a0 tdf#106011: The "swing angle" is negative when counter-clockwise
Change-Id: I1ef77e4c8cf0a6d31b36411a79b576115c32c644
2017-02-14 23:00:26 +02:00
Tor Lillqvist
9d29d3dad4 BOOST_SPIRIT_SINGLE_GRAMMAR_INSTANCE has been defined forever in these files
Change-Id: I0afa1b404192f44540aa318e748452e0328fac6b
2017-02-14 21:21:29 +02:00
Tor Lillqvist
f6afad4c7b No need to have SAL_INFOs inside OSL_DEBUG_LEVEL checks
Also, use the operator<< functionality added in
3f5392c196.

Change-Id: I4ae24d2c45e818d9a1b04f2d8e5660c39c71bcdd
2017-02-14 21:21:29 +02:00
Stephan Bergmann
e57ca02849 Remove dynamic exception specifications
...(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-26 12:54:43 +00:00
Regina Henschel
852b29b091 tdf#105266 Make LIGHTEN and DARKEN follow MS specification
Enhanced geometry of custom shapes has got commands for LIGHTEN and
DARKEN of subpaths. MS specifies, that LIGHTEN is a blending with
white and DARKEN is a blending with black. This patch adapts the
calcuation accordingly.

Change-Id: Ie46f1a1a2210c209c3fac34a7a58758b72eb276c
Reviewed-on: https://gerrit.libreoffice.org/33337
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: jan iversen <jani@documentfoundation.org>
2017-01-23 08:16:14 +00:00
Noel Grandin
4ef9ccea6c OSL_TRACE -> SAL in sfx2..svx
Change-Id: I78cf8058a5682baa3d7b00a25feeb2d28fb3e66e
Reviewed-on: https://gerrit.libreoffice.org/31799
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2016-12-11 18:56:16 +00:00
Noel Grandin
70f05aa69a convert PolyStyle to scoped enum
Change-Id: Ia35fdbb5e40888db9558988ac069741b31721f0e
Reviewed-on: https://gerrit.libreoffice.org/31633
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2016-12-06 05:31:18 +00:00
Stephan Bergmann
6eb60ca801 loplugin:unnecessaryoverride (dtors) in svx
Change-Id: Icc4d9919cedadc00f1420939564dd095fab74cca
2016-12-02 11:14:51 +01:00
Mark Hung
4ffb2ae4bb svx: prevent customshape handles go far away when adjusting.
Change-Id: I4d1efd52320093a8edf4a5b7b1032a0754275f39
Reviewed-on: https://gerrit.libreoffice.org/30604
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Mark Hung <marklh9@gmail.com>
2016-11-12 03:20:58 +00:00
Mark Hung
a39a2d28ac tdf#100733 svx: use RefR and RefAngle for polar handles.
Shapes imports from ooxml use RefR and RefAngle that refers
to adjustment to be updated. Though the properties exist
but the functions weren't implemented before.

Change-Id: Ib45c2e8b16c9a7b41387a3e8c356b803eaf74b77
Reviewed-on: https://gerrit.libreoffice.org/30603
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Mark Hung <marklh9@gmail.com>
2016-11-12 03:19:18 +00:00