Commit Graph

24 Commits

Author SHA1 Message Date
Stephan Bergmann
c0755c8ee0 Reduce to static_cast any reinterpret_cast from void pointers
Change-Id: Ie25a2b8a84a146a5b988c6ef77127896d126e488
2015-03-31 13:17:54 +02:00
Stephan Bergmann
0bd502af47 Clean up remaining C-style casts among void pointers
Change-Id: I1b49c020d597b569e330482f4dbf20c15ccdae3f
2015-03-29 09:17:47 +02:00
Stephan Bergmann
44b9b27b1a Clean up C-style casts from pointers to void
Change-Id: I962bd44f2ef6204ed2ea51f79b752bd948f67209
2015-03-28 19:09:29 +01:00
Stephan Bergmann
b388b9fc48 Some more loplugin:cstylecast: xmloff
Change-Id: I45cb9467c618eed929c84656a26293c8d6087378
2015-01-20 09:06:54 +01:00
Noel Grandin
c29657e0d6 fdo#84938: convert EXPORT_ #defines to 'enum class'
Change-Id: I2ed239fa073b5fa8fb56c1af9d4b0bac89acfacf
2015-01-06 10:59:42 +02:00
Noel Grandin
ec5bf66d36 fdo#84938: convert XML_EXPORT_FLAG_ to 'enum class'
Change-Id: I43d778e0eee19a56ea37898ec1c4309d3407775e
2015-01-06 10:59:41 +02:00
Stephan Bergmann
05575c31e1 xmloff: Use appropriate OUString functions on string constants
Change-Id: I349e0c2575d9a5154ac7002d129a1851a3df7687
2014-12-18 14:12:39 +01:00
Stephan Bergmann
0f5e917024 Introduce rtl::OUStringLiteral1
...to use single ASCII character literals "more directly" in the OUString API
(instead of having to go via an intermediary OUString ctor call).  Especially
useful for character literals that are defined as const variables or via macros
("direct" uses of character literals in the OUString API can often simply be
replaced with single-character string literals, for improved readability).

(The functions overloaded for OUStringLiteral1 are those that are actually used
by the existing LO code; more could potentially be added.  The asymmetry in the
operator ==/!= parameter types is by design, though---writing code like

  'x' == s

is an abomination that shall not be abetted.)

Change-Id: Ic5264714be7439eed56b5dfca6ccaee277306f1f
2014-12-17 16:39:33 +01:00
Michael Stahl
7a242b4631 fdo#85496: add some asserts to detect this sort of problem
Change-Id: Iff787c8d2a71bc3082192cc98e3d916badee65dd
2014-12-01 23:12:56 +01: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
Markus Mohrhard
9746dc9ad6 fix ODF validation errors
Introduced by 7d9bb549d4

Change-Id: I09411486b93a031a0c405579d34d9e744b8002a7
2014-07-02 23:03:09 +02:00
Noel Grandin
4ff115b3e7 drop UniReference in favour of rtl::Reference
since they're doing the same thing.

Change-Id: I76134b6b848db8628f315fe5bd9eb972a6bf0cb6
2014-07-02 15:23:52 +02:00
Noel Grandin
8a81f542a6 xmloff: sal_Bool->bool
Change-Id: I873c80baec8e70e3e8f642644563b92137571a30
2014-04-15 09:02:31 +02:00
Noel Grandin
6ac6fb820f xmloff: sal_Bool->bool
Change-Id: I64c33ae4c157e270acac9a1f820d3e6272ba0bea
2014-03-31 12:39:02 +02:00
Alexander Wilms
e23ea87cb3 Remove visual noise from xmloff
Change-Id: I205d4e555f5b88654a90007eb7ac05bc7b00a904
Reviewed-on: https://gerrit.libreoffice.org/8346
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
2014-02-26 04:32:34 -06:00
Matteo Casalin
57d8250a96 std::vector elements are default-initialized in constructor
Change-Id: I593c6c3236172f33b3e58fb44a41e079c3c8b0c4
2013-10-01 08:20:59 +02:00
Markus Mohrhard
ab31465944 fix Mac OSX build 2013-10-01 02:43:55 +02:00
Tor Lillqvist
d74ca89ae8 Include <algorithm> for std::sort()
Hopefully helps a Gentoo tinderbox.

Change-Id: I2e83b867113ba04a708c9fbb46c728368c4328c0
2013-09-30 20:00:30 +03:00
Tor Lillqvist
c1015fdd51 Add hack to optionally get stable ODF output from the same input
To be used in regression testing and similar scenarios, where the output ODF
is *not* intended to be further manipulated in LibreOffice. An environment
variable LIBO_ONEWAY_STABLE_ODF_EXPORT is used to toggle this behaviour. I am
not 100% sure whether the generated ODF with the hack toggled on is even fully
correct, but correctness is not the purpose of the hack anyway.

Two classes of issues handled: 1) Automatic style names and 2) use of
randomness.

For class 1), when the hack toggle is in effect, we generate the names at
first as strings based on all the properties of the style, and sort them based
on those, and then rename them (for brevity in the output) to the "normal"
form of a short prefix plus a number (like "P12").

Sure, it would have been better to just figure out *why* the automatic style
naming currently is not stable in the first place, but outputs the styles in
different order (with some styles being assigned different numbers) in
separate invokations of LibreOffice), but I was unable to understand that.

Possibly this code could be used in all cases, except that it does break some
unit test (can't recall which right now). I don't know whether that is simply
because the unit test assumes too much knowledge of the internal workings of
the automatic style name generation, or whether the generated ODF is actually
invalid.

For 2), I found a handful of places where randomness was used to generated
various kinds of identifiers in ODF output. I changed those to just use large
(64-bit) non-overlapping integers instead. I assume there *is* a point in the
original code in each case that explains why randomness is needed, so the hack
definitely needs to be optional and used only for the above mentioned
scenarios.

Change-Id: I17b657197e38bcf24abdfe61ad4a277f4339eeae
2013-09-30 17:40:53 +03:00
Tor Lillqvist
b94e46ca49 If it is a set, don't call it a list, that just confuses the reader
Change-Id: I1d80c2ee463a0253e7e3a84331106006316c1ea6
2013-09-17 20:59:37 +03:00
Tor Lillqvist
69f08eda0b Insert impastp4.cxx into impastpl.cxx
Change-Id: Iccd059e2d09666775f8391a1ac2a074518a5c111
2013-09-16 18:32:36 +03:00
Tor Lillqvist
2770de8b66 Insert impastp3.cxx into impastpl.cxx
Change-Id: I8038a724d79a81ac5502f926f8b8f19e2a277e74
2013-09-16 18:32:36 +03:00
Tor Lillqvist
4b139b8d93 Insert impastp2.cxx into impastpl.cxx
I guess "impastp" could stand for "IMPort AutoSTyle Pool" but no idea what the
"l" means, I chose the name "impastpl.cxx" just to match "impastpl.hxx"

Change-Id: I6e03df47f4782bfe5bd959d9b52f1fb666a3086f
2013-09-16 18:32:36 +03:00
Tor Lillqvist
e873440b49 Start of collecting the impastp*.cxx files into one
Change-Id: Ibb4e2475efc7f70c08035184cddedfaf40b7ec25
2013-09-16 18:32:36 +03:00