Commit Graph

2244 Commits

Author SHA1 Message Date
2deb0a2651 coverity#704564 Unchecked dynamic_cast
Change-Id: I2dfdc5e1e852011b532b484e566896133208ee86
2014-10-24 09:24:53 +01:00
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
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
cb414252b8 loplugin: cstylecast
Change-Id: I4aafc170895d8bab47206c7b07b4f1f6105d42d3
2014-10-23 12:36:14 +02:00
908d1b6e63 chart2: fix memory leak due to cyclic reference in VAxisBase
The VAxisBase::m_xNumberFormatsSupplier refers to the ChartModel itself,
and apparently that is a cyclic reference.  Naively using the
ChartModel's m_xNumberFormatsSupplier in
ChartView::impl_createDiagramAndContent() because it will later be passed
to AxisHelper::getExplicitNumberFormatKeyForAxis(), which expects to be
able to convert it to a ChartModel.

Since passing around the ChartModel as an XNumberFormattingSupplier is
sort of un-intuitive anyway, refactor some methods to use XChartDocument
instead, and only create the VPolarAxis / VCartesianAxis with the
ChartModel's m_xNumberFormatsSupplier.

The drawback is that if ChartModel::attachNumberFormatsSupplier()
is called after ChartView::update() has created the axes, it may not
have an effect on them; not sure if that is a real or hypothetical
problem.

Change-Id: Ib5f0d5882b85adaf44f80e086f19178b3e64882f
2014-10-20 17:14:26 +02:00
67c9d05451 fdo#84938: replace TIB_ constants with enum
Change-Id: I435ce2331fb49e7ce9fe97bdfddfaef706759a84
Reviewed-on: https://gerrit.libreoffice.org/12023
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Tested-by: Noel Grandin <noelgrandin@gmail.com>
2014-10-20 07:16:46 +00:00
b520fca88d coverity#1247647 Uncaught exception
Change-Id: I1e47f3970f944aa3556e4ddb9b7918d9ee23c0eb
2014-10-17 15:19:54 +01:00
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
ad9498f8b8 More -Werror,-Wunused-private-field
...detected with a modified trunk Clang with

> Index: lib/Sema/SemaDeclCXX.cpp
> ===================================================================
> --- lib/Sema/SemaDeclCXX.cpp	(revision 219190)
> +++ lib/Sema/SemaDeclCXX.cpp	(working copy)
> @@ -1917,9 +1917,10 @@
>    const Type *T = FD.getType()->getBaseElementTypeUnsafe();
>    // FIXME: Destruction of ObjC lifetime types has side-effects.
>    if (const CXXRecordDecl *RD = T->getAsCXXRecordDecl())
> -    return !RD->isCompleteDefinition() ||
> -           !RD->hasTrivialDefaultConstructor() ||
> -           !RD->hasTrivialDestructor();
> +    return !RD->hasAttr<WarnUnusedAttr>() &&
> +           (!RD->isCompleteDefinition() ||
> +            !RD->hasTrivialDefaultConstructor() ||
> +            !RD->hasTrivialDestructor());
>    return false;
>  }
>
> @@ -3517,9 +3518,11 @@
>    bool addFieldInitializer(CXXCtorInitializer *Init) {
>      AllToInit.push_back(Init);
>
> +#if 0
>      // Check whether this initializer makes the field "used".
>      if (Init->getInit()->HasSideEffects(S.Context))
>        S.UnusedPrivateFields.remove(Init->getAnyMember());
> +#endif
>
>      return false;
>    }

to warn about members of SAL_WARN_UNUSED-annotated class types, and warn about
initializations with side effects (cf.
<http://lists.cs.uiuc.edu/pipermail/cfe-dev/2014-October/039602.html>
"-Wunused-private-field distracted by side effects").

Change-Id: I3f3181c4eb8180ca28e1fa3dffc9dbe1002c6628
2014-10-15 15:58:56 +02:00
d1217a95ef coverity#1223085 Unchecked return value
there were three of these, not just one

i.e. see also

commit 276a051ef5dc144a202633779259a4ecd43c81a8
Date:   Sun Oct 5 13:05:04 2014 -0500
    coverity#1223085 Unchecked return value

Change-Id: I07ee033ae31a346a08f68a6edfa480505fe6c11a
2014-10-10 18:14:36 +01:00
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
276a051ef5 coverity#1223085 Unchecked return value
Change-Id: I4149684a6f704893e130bd1776850634fdb67ceb
2014-10-05 13:26:10 -05:00
2fc308b941 coverity#703928 Unchecked return value
Change-Id: I26ba62448796f1d80d2b4bbaf2499d08058c3add
2014-10-04 21:45:14 -05:00
be31d107f5 chart2: std::auto_ptr -> std::unique_ptr
Change-Id: Ia92c18858c8ed7cfc2765cc2310f3bf7bfd7e8df
2014-09-30 10:33:24 +02:00
8dbde0845a fdo#82577: Handle Region
Put the VCL Region class in the vcl namespace. Avoids clash with the X11
Region typedef.

Change-Id: I6e008111df7cf37121fbc3eaabd44a8306338291
2014-09-30 09:58:23 +02:00
892a7be963 Resolves: fdo#83010 remove svx::WrapField
in favour of a wrap property on NumericField

Change-Id: I62c6bdb69a16f37ae6018a2fe41070fb18dbe4a0
2014-09-25 17:20:31 +01:00
4e82025189 Replace some std::auto_ptr function parameters with std::unique_ptr
Change-Id: Ic66d325fd9559c6dde9556c26e5b2a7e60376c49
2014-09-24 16:06:52 +02:00
827c46e7d7 fdo#82577: Handle Window
Put the VCL Window class in the vcl namespace. Avoids clash with the X11
Window typedef.

Change-Id: Ib1beb7ab4ad75562a42aeb252732a073d25eff1a
2014-09-23 14:11:39 +03:00
60e78fbb80 fdo#82577: Handle Font
Put the VCL Font class in the vcl namespace. Avoids clash with the X11
Font typedef.

Change-Id: I1a84f7cad8b31697b9860a3418f7dff794ff6537
2014-09-18 08:54:37 +02:00
2ff2e254f6 chart2: sal_Bool -> bool
Change-Id: I8d9802c58950ebe46202c4305b58682f6321531a
2014-09-12 15:41:27 +02:00
aa32583329 3D charts: Update the 3D charts when a value changes.
Change-Id: I9c4052108446959ff6f5215d704b496e7a8e6aee
2014-09-12 13:03:52 +02:00
ea733ab5b6 Turn SfxItemState into a C++11 scoped enumeration
...to gain further confidence in the claim "that none of the existing
code tries to uses combinations of these enum values"
(d92602c5b13d0a60439d86c5a033d124178726ca "more fixes for SfxItemState")

Change-Id: I987922d945e8738e38adfde83b869adf3ff35b13
Reviewed-on: https://gerrit.libreoffice.org/11384
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Tested-by: Stephan Bergmann <sbergman@redhat.com>
2014-09-12 06:08:32 +00:00
d92602c5b1 more fixes for SfxItemState
In commit 88a874fc "convert SfxItemState constants to a proper enum"
I made some mistakes in converting bitwise logic to boolean logic.

I fixed one of those places in commit 7ad83656 "fix bitwise->logic
conversion in SfxItemState commit"

This commit fixes the other places where I converted bitwise to normal
boolean logic. I also validated that none of the existing code tries to
uses combinations of these enum values.

This commit also introduces an exception-throwing check in the one place
where the enum is explicitly cast to make sure that no combinations
sneak in.

Change-Id: I545f7d17b76c4fd999078867caec314e83ffe165
Signed-off-by: Stephan Bergmann <sbergman@redhat.com>
2014-09-10 17:54:35 +02:00
7ad8365648 fix bitwise->logic conversion in SfxItemState commit
88a874fc "convert SfxItemState constants to a proper enum"

Change-Id: I979d5a859f0bbfd8797bfc5ba4ce5497eb777fe7
2014-09-09 13:31:17 +02:00
148aea32a3 Consistency around SvxB3DVectorItem in svx/svx3ditems.hxx
...similar to what has been done for svx/sdtmfitm.hxx in
68969cc61adecac481ae9656978ef952f435b310 "Consistency around SdrMetricItem."

Change-Id: I7f2348d82c76f6f231e34f0dfc4b6ee6fddffe55
2014-09-01 16:46:59 +02:00
e5d6ae0c2e Consistency around SvxColorItem in svx/svx3ditems.hxx
...similar to what has been done for svx/sdtmfitm.hxx in
68969cc61adecac481ae9656978ef952f435b310 "Consistency around SdrMetricItem."

Change-Id: If26ab3229871d2d6a7e4e7e8f79f4cb927b96930
2014-09-01 16:16:49 +02:00
9f6018bb64 Consistency around SfxBoolItem in svx/svx3ditems.hxx
...similar to what has been done for svx/sdtmfitm.hxx in
68969cc61adecac481ae9656978ef952f435b310 "Consistency around SdrMetricItem."

Change-Id: I3253b4cc5657a7d6b960ee892584109d373eed3d
2014-09-01 14:46:50 +02:00
bebe30e917 Consistency around SfxUInt32Item in svx/svx3ditems.hxx
...similar to what has been done for svx/sdtmfitm.hxx in
68969cc61adecac481ae9656978ef952f435b310 "Consistency around SdrMetricItem."

Change-Id: I3193eab34a34c051002adeedd8b368e26f55f7a3
2014-09-01 13:37:27 +02:00
1f0a1a308b CHART_DUMMY_FACTORY should not control the OpenGL window
Change-Id: Ic6c640f7d37606b357672f2b73f95d51d1daba67
2014-08-29 17:40:32 +02:00
8e37097d52 Update chart when chart type is changed in edit mode
Regression to master.
In long term it would be better to define ChartWindow as an
OpenGL window and not creating a new window inside the chart
window, becasue otherwise all events which was handled well
by the chart window will be broken (catched by the OpenGL
window so no effect on ChartWindow (defining the behavior of
charts in general) or catched by the ChartWindow and so no
effect on the OpenGLWindow (like invalidating in this case).

Change-Id: I234f469f70914e01f030c8edae9cb5aacea112bf
2014-08-29 17:40:32 +02:00
2414270c39 Don't create an OpenGL window in case of normal charts.
Change-Id: Idb4506712d3902c12aa881a85ddf69a281edff82
2014-08-29 17:40:31 +02:00
7daba09d02 Fix OpenGL chart reinitialiation
Problem after ChartWindow was disabled and enabled
again, OpenGL content was lost.

Two things:
-After setting a new OpenGLWindow the corresponding
IRenderer must be set (x3DWindowProvider->update)
-InitOpenGL() call should not depend on DummyChart, but on
OpenGLWindow (OpenGLContext).

Change-Id: If74e1945de9973d3921ceea1ca6fef39311add7a
2014-08-29 17:40:26 +02:00
43d23a24fd opengl charts: Move the init from sc to chart2, to have the right parent.
Conflicts:
	chart2/source/view/charttypes/GL3DBarChart.cxx

Change-Id: I1e23329345e00e7d8e1f269c832e84d015824c0a
2014-08-29 17:40:25 +02:00
f9857727c6 EE_PARA_WRITINGDIR should presumably use an SvxFrameDirectionItem
...rather than an SfxInt32Item, just as it does everywhere else outside chart2.
At least, running CppunitTest_chart2_export under -fsanitize=undefined
complained about an invalid cast to SvxFrameDirectionItem.

Change-Id: Ia7ea43a00d659de9642f801f390f45b9239d9c32
2014-08-28 15:53:13 +02:00
30ae83c268 fdo#82577: Handle KeyCode
Put the VCL KeyCode class in the vcl namespace. Avoids clash with the X11
KeyCode typedef.

Change-Id: I624c9d937f7c5f5986d313b6c5f060bd8bb7e028
2014-08-23 22:33:30 +03:00
82cb89fa05 Avoid possible memory leaks in case of exceptions
Change-Id: I41392572692bc219ae18ad89d95fc8be47d6812c
2014-08-19 23:35:41 +09:00
47e2fd0dc8 Consistently use size_t and SAL_MAX_SIZE
Change-Id: Ibab89984ec94556ec368653b6db50c6c2e380dec
2014-08-16 21:52:32 +02:00
9585ba198b Delete commented-out declaration of function members
Change-Id: I118b7a788ee62f75af8b7669cad285952f0e968a
2014-08-16 21:52:28 +02:00
85cf4881fc drop FixedLines from wizards to be consistent with the rest of the ui
and two virtual methods don't need to exist after that

Change-Id: I50ea8eaa99fddfed7e0c61e99e76631aa595f2dc
2014-08-15 08:26:02 +01:00
8f2990517f directly include ResourceIds.hrc header
Change-Id: Iaef6876ac2838f8727fea21c03a4cdc50683e675
2014-08-09 18:12:06 +02:00
987d933c58 remove now unused tabpage.hrc
as TP_WIDTH and TP_HEIGHT are unused now

Change-Id: I06ec7af8c2b3386d76e36284eb56ea1ab6b9ec5d
2014-08-09 18:12:06 +02:00
afbbc4cf4c deleted TP_LAYOUT resource
Change-Id: Id0c60b43160f2447cfddfd7cf1c06c1becc419e9
Reviewed-on: https://gerrit.libreoffice.org/10784
Reviewed-by: Thomas Arnhold <thomas@arnhold.org>
Tested-by: Thomas Arnhold <thomas@arnhold.org>
2014-08-06 19:44:56 +00:00
151fbebf8c Consistency around SdrOnOffItem in svx/sdtagitm.hxx
...similar to what has been done for svx/sdtmfitm.hxx in
6a2ea81ca1622d2c2ad55bea8ddc28167fcc2794 "Remove unused ctors" and
68969cc61adecac481ae9656978ef952f435b310 "Consistency around SdrMetricItem."

Change-Id: I6d8b3709d6d55bd6958d38f262141c43779dfdcc
2014-08-04 19:22:55 +02:00
02f0102b8b prevent memory leak
Found by Lsan.

Returning this or a heap allocated object asks for trouble. Let the
caller handle it and return null instead of this.

Change-Id: I7586e103bef5a8c2727adfe214b052d6962d4467
Reviewed-on: https://gerrit.libreoffice.org/10716
Reviewed-by: Michael Stahl <mstahl@redhat.com>
Tested-by: Michael Stahl <mstahl@redhat.com>
2014-08-04 12:49:59 +00:00
88ba62b0e0 cosmetic clean-up
Change-Id: I7b34e021c9f193643c89f20dc1ba42aad8e065d6
Reviewed-on: https://gerrit.libreoffice.org/10715
Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
Tested-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
2014-08-03 20:58:46 +00:00
6c2c974dd3 bnc#885825: Handle ODF import and export of data label border properties.
Change-Id: Ic8c7bc873768008537cd52a3fd4b11031b403139
2014-07-26 16:26:09 -04:00
f1531cdaae bnc#885825: Support borders around data labels.
Change-Id: Ib141413e523cbf73746876f727e9f80dda9f5f7c
2014-07-26 16:26:08 -04:00
cc827ab81d Revert "opengl charts: Move the init from sc to chart2 ...
This reverts commit 46cea34638b371570073c0e86f79969753c543ed.

Conflicts:
	chart2/source/view/charttypes/GL3DBarChart.cxx

Change-Id: Ia29ea6a95b8b9eb870d14538d0cadaa40472582f
2014-07-23 22:19:58 +02:00
c02e393c7d Revert "Fix OpenGL chart reinitializing"
This reverts commit cbc50c90ad63f0e59b8cf3bbfb6b5b1f61db09b9.
2014-07-23 22:19:27 +02:00
88a874fcb3 convert SfxItemState constants to a proper enum
and while we're at it
- use the enum type all over the place instead of passing around
sal_uInt16
- don't use bitwise logic on enum values
- use enum values instead of numeric constants

Change-Id: I7f24cb4d242e1c00703e7bbcf1a00c18ef1e9fd4
2014-07-23 13:26:19 +02:00