Commit Graph

5297 Commits

Author SHA1 Message Date
35d78b36b9 coverity#1249459 Unchecked dynamic_cast
Change-Id: I5e212976f1be310c3a802679a0d8b93c2866d591
2014-10-25 16:56:13 +01:00
76617eea54 coverity#1249460 Unchecked dynamic_cast
Change-Id: I21f85d0e18ab8a30320f3db294efa9fbdd4dd55d
2014-10-25 16:56:12 +01:00
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
83210e28ae Take the current axis alignment state.
Change-Id: I02c28f44af0a1510bdb780d1e6c70561b7ba24e5
2014-10-14 11:38:37 -04:00
658f031bb1 Revert "Revert "Make VCartesianAxis::get2DAxisMainLine() truly const method.""
This reverts commit bf302000ea8849ac7ecd9162f3014bac9da4406e,
as clarified on IRC, --enable-chart-tests is known flaky and not intended to be
used by anybody but moggi.
2014-10-14 15:07:31 +02:00
bf302000ea Revert "Make VCartesianAxis::get2DAxisMainLine() truly const method."
This reverts commit 410c5bd58c36d9064a79520d5bc31cb32ead1326,
it causes CppunitTest_chart2_xshape to fail.
2014-10-14 13:01:43 +02:00
2d6dacc1c9 More on documenting the methods.
Change-Id: Ibdbc1b26521e56de5dcba1b9572bb0221fc0fff5
2014-10-13 19:45:39 -04:00
942731076d Scope level reduction & explain what the max axis index really is.
The concept of axis index and dimension index is quite confusing in the
chart2 code....

Change-Id: I035af0a225396bd5394089d6f584f78dcaf0ad31
2014-10-13 19:45:33 -04:00
139f0f44f5 Explain what doAutoScaling() does.
Change-Id: I15ca9ca0c3a22094f0a969adf2b3f1145d116052
2014-10-13 19:45:28 -04:00
410c5bd58c Make VCartesianAxis::get2DAxisMainLine() truly const method.
No internal state gets modified by this method now.

Change-Id: I10475ad3483cb3a92e41208e1a55a6b925c10223
2014-10-13 19:45:21 -04:00
ecf648b3a5 Make the variable name shorter and sweeter...
Change-Id: Ibea26f3c99b50f2011050960794d9736566ee7ce
2014-10-10 15:42:38 -04:00
acfabbf06d prepareScaleAutomatismForDimensionAndIndex -> prepareAutomaticAxisScaling.
Change-Id: Ic66d2fcf78603bdd4fa1e08933900f49c66384b7
2014-10-10 15:42:30 -04:00
2ba6c00d37 Hide the 3rd nested looping for clarity.
Also aScaleAutomatism -> aAutoScaling.  The word 'automatism' is a bit
awkward.

Change-Id: I9856f904d5693e79e19176ba5fff881267d5c7e7
2014-10-10 15:42:23 -04:00
5ce6a22a3b Make this loop a bit easier to follow...
Change-Id: Ib978f47925e1f7d77e02586bff50d24fa5b27f2c
2014-10-10 15:42:16 -04:00
424fb26da3 Make this a hard prerequisite.
Change-Id: Ib1c859b6033b2cf148e1ed74a437dda85872dffe
2014-10-10 15:42:09 -04:00
eb2c2f1a3c Use boost::ptr_vector for this...
which also exposed few cases of mis-used const-ness here and there...

Change-Id: Ie4374459643fc050ded646762d72ad622cf3f843
2014-10-10 15:42:01 -04: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
cbdf857299 coverity#707673 Uninitialized scalar field
Change-Id: Ic631ebc74e94f4ccf7e3915db3952714fd4d28d4
2014-10-10 12:50:20 +01:00
87bf3fb4a5 Fix CppunitTest_chart2_xshape
...regression from d7e477c4518bb3f638af59fa48cae04eba8c76cc "Use boost::optional
for these members."

Change-Id: I8e02033d75fd52489be03b34fbce494ae49ab7e3
2014-10-10 09:41:00 +02:00
0c06f9c5bb Further fallout from git mis-merge?
...in a80f74add22c303327dd3203d9be5eeb901a73a4 "Put SeriesPlotterContainer into
CreateShapeParam2D."

Change-Id: I9e2f700a1999070069ff87fc3030c00a045372c6
2014-10-10 08:35:58 +02:00
9dfc5fe09a Fix git's wrong 3-way merge.
Change-Id: I30520ff78f47bcfa487cea6f40904bf718610967
2014-10-09 23:11:50 -04:00
a80f74add2 Put SeriesPlotterContainer into CreateShapeParam2D.
Change-Id: I537c131c0c927d2cbbd7cd44f07e9e4748b8ed6c
2014-10-09 22:46:39 -04:00
78a33913b1 Explain what updateScreenValues() does.
Change-Id: I323827f259c9f09c5b4bfe882c63096dea640dbf
2014-10-09 22:46:39 -04:00
110d0915c6 Use typedef rather than raw nested std::vector everywhere...
Change-Id: Id4b58d13b229776f2ef1f270e937547ece9e1248
2014-10-09 22:46:39 -04:00
d7dd306302 Make its own header the first header.
Change-Id: I81ff1cb9200bdccd3f50dc08fa68fc69929e7c90
2014-10-09 22:46:38 -04:00
e776418ce4 Clean this up a bit.
Change-Id: Ief207c72a22eee6a745f885912ea929ade717321
2014-10-09 17:48:32 -04:00
5aa51c08cd Description for m_aAllTickInfos.
Especially wrt why it is nested vectors.

Change-Id: I143785778ef62abbdc047a2d18c713f43a6522d9
2014-10-09 17:48:26 -04:00
700ed579f9 Make AxisProperties non-virtual; nobody derives from it.
Change-Id: I1cb5203374b6d13a914c335d73a7db6d8a47c4bb
2014-10-09 17:48:23 -04:00
c5cb66b537 B2DVector supports operator!=. Let's use it.
Change-Id: Iecf58e0f24909ec2fd2780a5f4b219105c7c4b47
2014-10-09 16:34:36 -04:00
bd485290c7 Make it clear which bounding rectangle it returns & const.
Change-Id: I9c8080225cfbe0f38133ce2503bd2d0c1d0f5e13
2014-10-09 16:34:28 -04:00
877b66a00b xInverseScaling is set but not used. Remove it.
Change-Id: I1d185df4b14e152f4da9dfdbc2e71504c2cb1f3b
2014-10-09 16:34:14 -04:00
f602c74fac Re-organize method / class descriptions.
Change-Id: Ib7fe33581c3aec2f58f8a16a07215b69080e0a51
2014-10-09 16:34:09 -04:00
70ac6e7997 Make this data member const, as it never gets modified once constructed.
Change-Id: Ic01fd0591bbb524b4a6a0ec1dfe448e33f4d6b18
2014-10-09 16:34:04 -04:00
fd9151e1fe TickFactory_2D -> TickFactory2D.
For consistent naming.

Change-Id: Ic94681d4d18c0330ea5a8393c1b3d863c81e1ea8
2014-10-09 16:33:57 -04:00
a66ab02f04 Make thie method consistent with the others.
Change-Id: I028f0dd833cb2307e842805636458f51c71dbd66
2014-10-09 16:33:42 -04:00
4dfd8ba4ab Simplify AxisProperties and its surrounding code.
Change-Id: Ie47421d778c2beb8eb8e132532220054f183a5f1
2014-10-09 16:33:37 -04:00
d7e477c451 Use boost::optional for these members.
Change-Id: I60c52bf99d0e63e27f7c576e2582c26e19809c8c
2014-10-09 16:33:36 -04: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
05f1a88e19 typo: Lable -> Label
Change-Id: I8b9e9f75dd22ee5bff678c5bc0e1fa9381a103de
2014-10-09 13:02:50 +02:00
0ac722ccdf coverity#1237352 Dereference after null check
Change-Id: Ia9cb84bb0924915d4611c5f18d2a0d19b4198d94
2014-10-08 20:45:11 +01:00
fbf3aa391b spelling: instanciated -> instantiated
Change-Id: I99f3010e30f81786b938dc11736ea1597cd5530d
2014-10-08 11:02:55 +02:00
276a046d52 Annotate code.
Change-Id: If26d21593f36a39de3bc5b81717e5000795c97ae
2014-10-07 20:22:17 -04:00