Commit graph

8567 commits

Author SHA1 Message Date
Stephan Bergmann
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
Caolán McNamara
01c74f4319 coverity#735353 Unchecked return value
Change-Id: Iab54019d07ac27b4d8247d789c29165d24e2288f
2014-10-11 17:33:48 +01:00
Caolán McNamara
c10548eaa9 coverity#704113 Unchecked return value
Change-Id: If6537d84953c67801bc1959e17dd3662cd1face7
2014-10-11 17:33:47 +01:00
Andras Timar
c1a7e72110 typo: follwing -> following
Change-Id: Ia201473c84dc0923e8f4bee6329ad926cd6addd6
2014-10-10 14:55:12 +02:00
Stephan Bergmann
a636217f1f UBSan runtime error: division by zero
...triggered by CppunitTest_sw_ooxmlexport.

Though it iss unclear to me what is the best fix in this case, emit a
style:legend-expansion-aspect-ratio value of 1, emit a style:legend-expansion
value of "custom" without an accompanying style:legend-expansion-aspect-ratio
(if that is even valid), emit another style:legend-expansion value, or emit no
style:legend-expansion attribute (if that is even valid)?

Change-Id: I36afe35082a841974bb2480fe11a7a3dd815ddf0
2014-10-10 13:34:39 +02:00
Eike Rathke
f84dac9b1f back out even more wrong tools::Time changes, geez..
Change-Id: I52eb3400769999d7f554c3bdb8746f65b7990388
2014-10-08 14:35:36 +02:00
Noel Grandin
fbf3aa391b spelling: instanciated -> instantiated
Change-Id: I99f3010e30f81786b938dc11736ea1597cd5530d
2014-10-08 11:02:55 +02:00
Caolán McNamara
8f436d3de7 use comphelper::rng::uniform_*_distribution everywhere
and automatically seed from time on first use

coverity#1242393 Don't call rand
coverity#1242404 Don't call rand
coverity#1242410 Don't call rand and additionally allow 0xFF as a value
coverity#1242409 Don't call rand
coverity#1242399 Don't call rand
coverity#1242372 Don't call rand
coverity#1242377 Don't call rand
coverity#1242378 Don't call rand
coverity#1242379 Don't call rand
coverity#1242382 Don't call rand
coverity#1242383 Don't call rand
coverity#1242402 Don't call rand
coverity#1242397 Don't call rand
coverity#1242390 Don't call rand
coverity#1242389 Don't call rand
coverity#1242388 Don't call rand
coverity#1242386 Don't call rand
coverity#1242384 Don't call rand
coverity#1242394 Don't call rand

Change-Id: I241feab9cb370e091fd6ccaba2af941eb95bc7cf
2014-10-06 14:13:27 +01:00
Miklos Vajna
9835a5823e sw textboxes: reimplement ODF import/export
Turns out that for normal TextFrames and rectangular drawinglayer
shapes, the engine is written in ODF implicitly. Use the same trick to
describe if the shape content should be rendered by SW or editeng.

This reverts 9d310ecfce (sw textboxes:
implement ODF import/export, 2014-06-02).

Change-Id: Id8afa6368bedcd293e578244abb58e18949bec8d
2014-10-04 20:18:01 +02:00
Norbert Thiebaud
64d164875f coverity#1242759 Result is not floating-point
Change-Id: I3a358722279d574f96a2270b5dee84b85ddb402f
2014-10-04 09:36:28 -05:00
Noel Grandin
c625525ddc rename SvRef::AddRef to AddFirstRef
to make it's intended purpose clearly distinguishable from AddNextRef

Change-Id: I5da780b48b19fd873667b648031bc394113f953b
Reviewed-on: https://gerrit.libreoffice.org/11763
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Tested-by: Noel Grandin <noelgrandin@gmail.com>
2014-10-03 05:25:41 +00:00
Noel Grandin
c190577f75 loplugin: cstylecast
Change-Id: I25b82a96aace448a8debe90c181b22976ea95414
2014-10-01 13:08:43 +02:00
Noel Grandin
fc04f76336 fdo#82577: Handle Time
Put the TOOLS Time class in the tools namespace. Avoids clash with the X11
Time typedef.

Change-Id: Iac57d5aef35e81ace1ee0d5e6d76cb278f8ad866
Reviewed-on: https://gerrit.libreoffice.org/11684
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Tested-by: Noel Grandin <noelgrandin@gmail.com>
2014-10-01 07:34:23 +00:00
Noel Grandin
c9d4a2887c fdo#82577: Handle PolyPolygon
Put the TOOLS PolyPolygon class in the tools namespace. Avoids clash with the Windows
PolyPolygon typedef.

Change-Id: I811ecbb3d55ba4ce66e4555a8586f60fcd57fb66
2014-09-30 11:47:41 +02:00
Stephan Bergmann
68daa8a226 xmloff: std::auto_ptr -> std::unique_ptr
Change-Id: I8baa6c0573af3629bacbf1891c3196c165883d9e
2014-09-30 08:13:48 +02:00
Tor Lillqvist
38975e16ec WaE: implicit conversion of literal of type 'sal_Bool' to 'bool'
Change-Id: Ibcb6abe7162197dec35f4626f158448ff538542f
2014-09-30 08:02:58 +03:00
Michael Stahl
0f21f93208 fdo#79269: fix ODF import of style:footer-first
The implementation of SwXStyle's FirstIsShared property is busted, and
that causes xmloff to write the footer-first content into the master
footer.

Change-Id: I520a4929d9d7313da65bcdcf4094f8244382377d
2014-09-29 23:59:29 +02:00
Caolán McNamara
5aa360cae0 Resolves: fdo#80468 and fdo#81223 image/frame backgrounds wrong
writer has code to fill in missing new properties from the old properties
if they exist. But xmloff is stripping them out before they get there.

Don't strip them out, and add in a missing check for one of the
archaic bg colors and add a regression test for fdo#81223

Change-Id: I9a541a9bee0a01c90f2c33383f1144ecd8b0bfff
2014-09-29 16:31:32 +01:00
Michael Stahl
24a0129274 assert that XMLTransformerBase::m_xHandler is initialized
Just seen a test with a null m_xHandler, no idea how that happened.

Change-Id: I2e5ff9d3c799284beea5fdca37fa8a825f8a4756
2014-09-25 20:58:52 +02:00
Noel Grandin
23e1fc277d loplugin: cstylecast, update PTR_CAST macro to use static_cast
I introduce a template method into the PTR_CAST machinery
to maintain constness.
There is now a FIXME in sd/../docshell.cxx because I needed
to use a dynamic_cast there to work around the games it appears
to be playing with OLE in-place activation.

Signed-off-by: Stephan Bergmann <sbergman@redhat.com>,
dropping the GCC-extension, unnecessary use of typeof from tools/rtti.hxx

Change-Id: Iba5ace1aa27e02b34fcc91af1e658c43371afd03
2014-09-23 17:27:47 +02:00
Daniel Sikeler
32d6415617 fdo#83512 Make use of OUStringHash and OStringHash
Change-Id: I33cafe68c798e3d54943ea1790fa4e73f85e525d
Signed-off-by: Stephan Bergmann <sbergman@redhat.com>
2014-09-18 13:12:48 +02:00
Stephan Bergmann
7480948d87 xmloff: sal_Bool -> bool
Change-Id: Ic1e599568ece7e6bba354845a6cf85fa090e67bd
2014-09-15 14:32:39 +02:00
Michael Stahl
787d98f3ff xmloff: remove yet another SunStudio workaround
Change-Id: Ic9ec167d921c4c5f08914476bdbdd6a31a9391c1
2014-09-12 18:38:37 +02:00
Stephan Bergmann
4d3c88805d Avoid ODR-violating name clash
Change-Id: I69c3b11b01d520a485b07c8e5397a7f971210af2
2014-09-11 13:13:24 +02:00
Stephan Bergmann
d4494c33e4 Avoid ODR-violating name clash
Change-Id: I4911dcb5d902a5b92d4c175054acd220e449459d
2014-09-11 13:06:05 +02:00
Marcos Paulo de Souza
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
Michael Stahl
29e1b2f1ca xmloff: dead code gives MSVC fits
Change-Id: I1aaaaae4a38fb828e6801e444b6345fd8b60f5c1
2014-08-20 17:38:06 +02:00
Michael Stahl
2d4b87f0c1 ODF export: don't write invalid "group-name" attribute
Radio buttons are grouped via their "form:name" attribute already.

Change-Id: I9f8b27a2904d947c3d4665495d36961e3e41d2c6
2014-08-20 16:40:14 +02:00
Markus Mohrhard
66c6d1ef20 prevent invalid ods files with loext:fill-character
ODF specifies that extension elements in a document are removed before
the validation. With our old implementation of the number format export
this could result in two number:text elements following each other.

According to the spec a number:text element may not follow another
number:text element.

The number:text element before loext:fill is actually not that
interesting so it makes more sense to make this one an extension
element.

Possible documents showing issues:

fdo45268-1.xlsx
fdo49150-1.xlsx
and many more

Change-Id: I3ad92b8a61a246b3dbc0132d9a2c367488a766d0
2014-08-16 07:14:28 +02:00
Markus Mohrhard
a772be514e just use a typedef, don't inherit from boost::ptr_container
Change-Id: I1a63802dfeb702f6f6e9506339fd299b98fd8604
2014-08-16 06:52:16 +02:00
Thomas Arnhold
7cc627ff79 update_pch
Change-Id: Ic1dae7aac2f4367b4196ba3128c0aea9be1fbbda
2014-08-13 10:10:33 +02:00
Michael Stahl
555c988f3b fdo#82165: ODF import: clear all shapes when removing header content
Shapes anchored to the first or last paragraph survive setString("")
so need to be deleted with some ruse.

(regression from b8499fc3dc)

Change-Id: I00a8132583c45d1953c207932cc7f02f3065ae77
2014-08-12 17:56:44 +02:00
Stephan Bergmann
525d784796 -Werror,-Wundefined-bool-conversion
Change-Id: Icf4a55f7e76a723014a7b8b5f6b9350db7370dd9
2014-08-11 16:08:32 +02:00
Takeshi Abe
248437e4fd fdo#75757: remove inheritance to std::map
Change-Id: I2fd0b43c62c331d866d697c94dd57d17f903111b
Reviewed-on: https://gerrit.libreoffice.org/10810
Reviewed-by: David Tardon <dtardon@redhat.com>
Tested-by: David Tardon <dtardon@redhat.com>
2014-08-07 14:28:18 +00:00
Takeshi Abe
223f761330 fdo#75757: remove inheritance to std::vector
typedefs just work.

Change-Id: Ib91c0d4c383b5efac1ad9b93e574dec62e8234a4
Reviewed-on: https://gerrit.libreoffice.org/10754
Reviewed-by: Michael Stahl <mstahl@redhat.com>
Tested-by: Michael Stahl <mstahl@redhat.com>
2014-08-05 21:26:50 +00:00
Takeshi Abe
a9bae49661 fdo#75757: remove inheritance to std::vector
Typedef'ing SvxXMLListStyle_Impl is enough.

Change-Id: I281766822aea60794510c959581f0b821aea6642
Reviewed-on: https://gerrit.libreoffice.org/10729
Reviewed-by: David Tardon <dtardon@redhat.com>
Tested-by: David Tardon <dtardon@redhat.com>
2014-08-05 08:30:26 +00:00
Noel Grandin
7e0e581c16 cleanup usage of MapUnit enum
some places were using the wrong enum constant, and some places were
unnnecessarily converting to sal_Int16

Change-Id: I754993533c840cd33106820d99af2dc951f26a80
2014-07-31 11:38:48 +02:00
Noel Grandin
65803ad94c fix some dodgy FieldUnit conversions
the FieldUnit enum was being converted in some dodgy ways and
in some places the MapUnit enum values were being used.

Change-Id: Ic9aacb84058d1c14c3a4a79ef6676082df9a7270
2014-07-31 11:38:47 +02:00
Stephan Bergmann
3ee8bc8215 Fix previous commit
Change-Id: Ia6437852a5ecd208510af20915bc982d1014458d
2014-07-29 15:11:59 +02:00
Stephan Bergmann
edffb444c0 loplugin:stringconcat
Change-Id: Iaa5df366118b8766b47e7bd4e9875c44c0e5d8d9
2014-07-29 14:59:33 +02:00
Joren De Cuyper
ccdd9a2c54 Further OUString cleanup in xmloff/
Change-Id: Ic749119931db569bf26c8d8a58da7d468811f927
Reviewed-on: https://gerrit.libreoffice.org/10598
Reviewed-by: Michael Stahl <mstahl@redhat.com>
Tested-by: Michael Stahl <mstahl@redhat.com>
2014-07-29 12:44:23 +00:00
Kohei Yoshida
6c2c974dd3 bnc#885825: Handle ODF import and export of data label border properties.
Change-Id: Ic8c7bc873768008537cd52a3fd4b11031b403139
2014-07-26 16:26:09 -04:00
Kohei Yoshida
fed7294029 Simplify.
Change-Id: Id7826839a6177532bb4c3885e798ac5feb95eaca
2014-07-25 23:04:57 -04:00
Kohei Yoshida
f350a71df9 Reduce scope levels.
Change-Id: I64684a80c79c3c7f5a8f23b07703fbcee3fe5887
2014-07-25 23:04:50 -04:00
Kohei Yoshida
52a36fb30a pImplize XMLPropertyHandlerFactory.
Change-Id: Iff524c9065e9374b39db998e3860704555130995
2014-07-25 15:54:19 -04:00
Kohei Yoshida
690f7ff883 Store the handler as a const pointer.
Handlers are conceptually stateless; we can keep them as const objects.

Change-Id: I3d35ab0695037632e82f67f901c9795adf9bdd8d
2014-07-25 15:54:12 -04:00
Kohei Yoshida
dbf84a3574 The 'mutable' keyword exists for this kind of use.
Change-Id: Ic52192f53039b7f1b4529a93c13de74c5f54e7f8
2014-07-25 15:54:02 -04:00
Kohei Yoshida
0915d82bec Document what's in the type of the map entry.
And organize xmltypes.hxx a bit to make it easier to follow.  Also
rename MID_FLAG_PROPERTY_MAY_EXCEPT to MID_FLAG_PROPERTY_MAY_THROW.

Change-Id: If18f07159a613555cf031bea5e07c04c7c45abec
2014-07-25 14:04:56 -04:00
Kohei Yoshida
8a690c88a9 Apply pimpl to XMLPropertySetMapper.
Let's hide its implementation for real this time.

Change-Id: I18c82f4969f2e3560536a68e9bbd86b9282e2ace
2014-07-25 11:50:02 -04:00
Oliver-Rainer Wittmann
fd641c7b23 Resolves: #i125289# do apply possible changed <GraphicStreamURL>...
only for embedded images which already have its stream inside the package

fixes also issue 125290

(cherry picked from commit 9602a121b458e7456fc533dad86f434f846a72ba)

Conflicts:
	xmloff/source/draw/shapeexport2.cxx

Change-Id: I5af0093b20f2f291d3a94c690bfbdb59a59320c3
2014-07-23 11:26:34 +01:00