Commit Graph

2455 Commits

Author SHA1 Message Date
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
50a8c89f36 loplugin: cstylecast
Change-Id: I9134aff4f2e6bff43ebb78c605e0ff521eac6ffc
2014-10-23 12:36:14 +02:00
9ecac3874d Replace DISABLE_SCRIPTING with HAVE_FEATURE_SCRIPTING
Feature test macros that govern conditional compilation should be
defined in config_*.h include files, not on the compilation command
line.

Change-Id: I40575a4762fd2564f10927b6f38a112dd9f9a3d7
2014-10-22 09:30:23 +03: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
f5b1b266bc coverity#1247646 Uncaught exception
Change-Id: I332fb602466613e9e79ba4510879411e0bee9da6
2014-10-17 15:19:54 +01:00
d4cdaa2ad6 coverity#1247644 Uncaught exception
Change-Id: Idbaef5c196c29a2e066f667e6bd50189a7b1834c
2014-10-17 15:19:53 +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
8044acf2db convert SFX_CALLMODE constants to SfxCallMode enum class
and fix a couple of bugs in SC and SW where the call mode was
being passed to the hints parameter by accident

Change-Id: Ief805410b3f7035e012e229e77f92d5832430f58
Reviewed-on: https://gerrit.libreoffice.org/11916
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Tested-by: Noel Grandin <noelgrandin@gmail.com>
2014-10-11 15:14:52 +00:00
6033e2d29d Resolves: fdo#60904 allow export of VBAProject
xModLibContainerExport has a "VBAProject" entry but
xDlgLibContainerExport doesn't, so just export the
one we do have

Change-Id: I15f7794904a5aff7679f2cf9fd654d741fd5cbe3
2014-10-09 15:42:20 +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
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
89d408031b border_width from 12 to 6, as the rest of dialogs
Second pass.

Change-Id: Ic4702d2ca7a9d54ee4712dcd073006f16b2d5d1d
Reviewed-on: https://gerrit.libreoffice.org/11669
Reviewed-by: Samuel Mehrbrodt <s.mehrbrodt@gmail.com>
Tested-by: Samuel Mehrbrodt <s.mehrbrodt@gmail.com>
2014-09-28 19:42:47 +00:00
9703cc63ce Remove o3tl/heap_ptr.hxx, use std::unique_ptr instead
Change-Id: Iac70c9be13892a36bfb5975f62e5345b88d4f144
2014-09-24 14:54:51 +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
eea7bf09d5 basctl: sal_False/True -> false/true
Change-Id: I6f9414eba5fce8797f07a3796a12b5213c0ed4e0
2014-09-15 18:22:36 +02:00
c929930177 DBG_ASSERT -> assert where we go on to deref the testee
Change-Id: Id38a9e2e0ca0b1c52cb3306adf77eb43d710c9c6
2014-09-15 09:09:10 +01:00
a88b2d8418 Resolves: fdo#81039 crash on adding new macro library
regression from

commit bf28399df0b73364b12309032e4a8b571389c2cf
Date:   Fri Feb 7 15:54:45 2014 +0100
    auto_ptr -> heap_ptr

Change-Id: Ib54c708cbdcb97a7489df4a1b3a7e9367f81ff6b
2014-09-14 16:21:03 +01: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
ec1de2a4ff coverity#735600 Division by zero
Change-Id: Ia936814ae37ae802fab36f7bde56de09338eb617
2014-09-12 01:45:28 +02:00
39e91c585d Replace uses of old SFX_ITEM_AVAILABLE alias with SFX_ITEM_DEFAULT
Change-Id: I88eeac06413fc3935cbbdb357ff8bf9acaa383a8
2014-09-10 16:37:20 +02:00
7af850c896 vcl: sal_Bool -> bool
Change-Id: Iff4da6d6281eb9194db348ebc10fbe7718538401
2014-09-10 08:36:06 +02:00
5bce329040 SfxHint: convert home-grown RTTI to normal C++ RTTI
Also note that I fixed a bug in SvxFontMenuControl::Notify
where the if statement had the check the wrong way around.

Change-Id: I611e8929c65818191e36bd80f2b985820ada4411
Reviewed-on: https://gerrit.libreoffice.org/11147
Reviewed-by: Norbert Thiebaud <nthiebaud@gmail.com>
Tested-by: Norbert Thiebaud <nthiebaud@gmail.com>
2014-09-06 15:47:44 -05:00
d3cd290491 coverity#1233508 Uncaught exception
Change-Id: Ia77a94a486b8e5203617eb00cb5189359798482f
2014-09-02 12:14:46 +01:00
b751142173 Help buttons mushrooming all over the place...
Change-Id: I098cdc4899c27930f3d0a16d7fbd26dbce91d4c5
Reviewed-on: https://gerrit.libreoffice.org/11212
Reviewed-by: Thomas Arnhold <thomas@arnhold.org>
Tested-by: Thomas Arnhold <thomas@arnhold.org>
2014-08-31 06:55:12 -05:00
37b9ea92ba convert SBX flag bits to type-safe enum
Change-Id: I18d5d6a27f06ee60a5cb3dc393bf05b51bba4817
Reviewed-on: https://gerrit.libreoffice.org/11070
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Tested-by: Noel Grandin <noelgrandin@gmail.com>
2014-08-26 04:30:03 -05:00
b6d25be2d7 convert RID_QRYBOX_LANGUAGE with custom title to .ui
Change-Id: I007820c7717a437414bc43936e3138f7e63d090e
2014-08-25 16:45:24 +01: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
7e2b9fa213 Remove some useless tools/debug.hxx includes
Also remove the tools/solar.h included from tools/debug.hxx. The include of solar.h
header was necessary in some cases because of a macro or a typedef that was needed.

Change-Id: Ia6e15d5c2571c58c9e9138b0d0a7f08ae88053c9
Reviewed-on: https://gerrit.libreoffice.org/11075
Reviewed-by: Marcos Paulo de Souza <marcos.souza.org@gmail.com>
Tested-by: Marcos Paulo de Souza <marcos.souza.org@gmail.com>
2014-08-22 16:33:18 -05:00
a107bdfdfc ErrorBox->MessageDialog
Change-Id: I57d4e43460e40d3aff54873280eddbb18c12446b
2014-08-18 10:57:21 +01:00
47e2fd0dc8 Consistently use size_t and SAL_MAX_SIZE
Change-Id: Ibab89984ec94556ec368653b6db50c6c2e380dec
2014-08-16 21:52:32 +02:00
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
ae7ca8b957 fdo#46037: remove unused comphelper/configurationhelper.hxx
Change-Id: I66f9d2912202ba1393d0c65189f8a945bca4fcaa
Reviewed-on: https://gerrit.libreoffice.org/10603
Tested-by: LibreOffice gerrit bot <gerrit@libreoffice.org>
Reviewed-by: Michael Stahl <mstahl@redhat.com>
2014-07-29 15:40:41 +00:00
ea5ef0a72e Drop unused #includes
Change-Id: I77ca957204bacee95e32a7f2a54c9311002aeef9
2014-07-24 01:06:15 +09:00
e1840cf944 Resolves fdo#80906: Delete any control on Dialog editing window crashes LO
Quick fix for this bt:
3  0x00002aaaab2935d2 in __GI___assert_fail (assertion=0x2aaae1f2806a "_pInterface != 0",
    file=0x2aaae1f28018 "/home/julien/compile-libreoffice/libreoffice/include/com/sun/star/uno/Reference.h", line=402,
    function=0x2aaae1f28480 <com::sun::uno::Reference<com::sun::resource::XStringResourceManager>::operator->() const::__PRETTY_FUNCTION__> "interface_type* com::sun::uno::Reference< <template-parameter-1-1> >::operator->() const [with interface_type = com::sun::resource::XStringResourceManager]") at assert.c:101
4  0x00002aaae1e2963b in com::sun::uno::Reference<com::sun::resource::XStringResourceManager>::operator-> (this=0x7fffffff2d00)
    at /home/julien/compile-libreoffice/libreoffice/include/com/sun/star/uno/Reference.h:402
5  0x00002aaae1eb5c87 in basctl::LocalizationMgr::implHandleControlResourceProperties (aControlAny=
    uno::Any {<com::sun::uno::XInterface> = {_vptr.XInterface = 0x8935ea8}, <No data fields>}, aDialogName="Dialog1", aCtrlName="TextField1",
    xStringResourceManager=empty uno::Reference, xSourceStringResolver=empty uno::Reference, eMode=basctl::LocalizationMgr::REMOVE_IDS_FROM_RESOURCE)
    at /home/julien/compile-libreoffice/libreoffice/basctl/source/basicide/localizationmgr.cxx:202
6  0x00002aaae1eb92a0 in basctl::LocalizationMgr::deleteControlResourceIDsForDeletedEditorObject (pEditor=0x919d820, aControlAny=
    uno::Any {<com::sun::uno::XInterface> = {_vptr.XInterface = 0x8935ea8}, <No data fields>}, aCtrlName="TextField1")
    at /home/julien/compile-libreoffice/libreoffice/basctl/source/basicide/localizationmgr.cxx:896
Indeed, LocalizationMgr::setControlResourceIDsForNewEditorObject just returns if !xStringResourceManager.is()
So let's do the same when trying to delete ControlResources
See http://opengrok.libreoffice.org/xref/core/basctl/source/basicide/localizationmgr.cxx#835

Change-Id: I4be49503cd2464f97a25840dfdc29877e5fb2b93
2014-07-21 23:32:12 +02:00
6a873638fa Renamed brdcst.[hc]xx to SfxBroadcaster.[hc]xx
- Remove includes from files where they are not needed.
- Update pch files

Change-Id: I0188e3934ef429008c1ef495ab1d5b27f38664d5
Reviewed-on: https://gerrit.libreoffice.org/10342
Reviewed-by: Thomas Arnhold <thomas@arnhold.org>
Tested-by: Thomas Arnhold <thomas@arnhold.org>
2014-07-17 08:47:58 +00:00
dac4ca5f68 new loplugin: externalandnotdefined
Find "missing headers," where a function is declared directly in the
.cxx (as extern) and not defined, and should arguably instead be declared
in an include file.

Change-Id: I6d83ee432b2ab0cd050aec2b27c3658d32ac02a2
2014-07-11 14:12:25 +02:00
4228f08d60 use assert when followed by deref
Change-Id: I8405e4d8f9fa1de3ef6ee474321b4ac2b4ce1624
2014-07-03 12:49:38 +01:00
5ace3f3b4f clang scan-build: various warnings
Change-Id: I4bdfb074b3cf6fcb49765322308dfa4b9ed67713
2014-07-01 10:56:14 +01:00
d92aa2f445 remove SFX_APP() macro that was a mer wrapper for SfxGetApp()
Change-Id: I480a789c767dd671775c9d70d96bf71908f21f5b
2014-06-27 17:08:04 +02:00
e48a233960 loplugin:unreffun: also warn about redundant redeclarations
Change-Id: I9a812220b58cf6da00d854e65794f7c673ab239d
2014-06-27 15:27:39 +02:00
171efcb7ac fdo#76203 - use consistent titlecase for UI title labels
Change-Id: Icae67c083ca867c89cff7f9d5d44dbbe4aadcba9
Reviewed-on: https://gerrit.libreoffice.org/9858
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
2014-06-23 09:01:25 +00:00
3e82897353 improve the inlinesimplememberfunctions clang plugin
Change-Id: I6d5a952901648e01904ef5c37f953c517304d31e
2014-06-17 10:55:17 +02:00
0e44fb66e5 loplugin:staticcall
Change-Id: Ida2e09b88c9df0d70c8298020d768e6386714edd
2014-06-13 17:54:22 +02:00
9a1298cf86 coverity#1213488 Uncaught exception
Change-Id: Iee4e5dd2936979a9bcb8bd5db781e51551270a7f
2014-06-13 09:50:53 +01:00
184a00b962 loplugin: inlinesimplememberfunctions
Change-Id: I42119f656ca528286fb25d2d36c0af54b7d04a6b
2014-06-09 10:10:13 +02:00
0e507ae031 various: remove SAL_THROW macro
Change-Id: I9464179a736b91f5bc32eb5e5e89b3b4e3da3494
2014-06-05 08:17:52 +02:00
b32ee04731 Avoid possible memory leaks in case of exceptions
Change-Id: I1988d2766d8bdeb5f8a22a5673dcff9b898dd637
2014-05-31 22:30:40 +09:00