Commit Graph
22 Commits
Author SHA1 Message Date
Michael Stahl 0d6ffe118f xmloff: ODF import: improve meta:generator checks
Instead of a hard-coded check for (effectively) one project name
"LibreOffice" (which is build-time configurable), check for the string
"LibreOffice_project", which has been produced hard-coded ever since
LO 3.3.0.

This now recognises additional downstreams "LibreOffice_Vanilla"
and "Collabora_Office", and also historic "BrOffice".

An important point here is that the build-time configurable version
numbers of any downstream that retains the hard-coded
"LibreOffice_project" *MUST* be the same as the upstream's at least
in their major and minor versions (micro and further digits are
currently not used), and that such downstreams don't backport
changes with ODF export compatibility impact further than upstream.

Add a unit test too, with a representative sample of 4372 distinct
generators in bugzilla attachments.

This revealed that StarOffice 6 and AOO 4.0.1 were falling through
the cracks and not recognised, so fix that too.

Change-Id: I8105222d3428e7b20cc4a6b8e76732c697812594
Reviewed-on: https://gerrit.libreoffice.org/51171
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2018-03-14 08:59:38 +01:00
Stephan Bergmann 3ff3a05371 loplugin:includeform: xmloff
Change-Id: I9e55142a7904c426fce49f68f1790365ea490fab
2017-10-23 22:45:46 +02:00
Chris Sherlock da64d198ec tools: svstream.hxx needs only errcode.hxx & not errinf.hxx
Change-Id: Ia28e35ae5af4f601e9a586a3deffbcd61702b0ca
Reviewed-on: https://gerrit.libreoffice.org/36896
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Chris Sherlock <chris.sherlock79@gmail.com>
2017-04-25 09:31:31 +02:00
Miklos Vajna ff8f5e6255 writerperfect, xmloff: fix loplugin:cppunitassertequals warnings
Change-Id: Ie8246433a7cea0886f00d8c76cf6f7d023545417
Reviewed-on: https://gerrit.libreoffice.org/32770
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Jenkins <ci@libreoffice.org>
2017-01-06 09:34:59 +00:00
Michael Stahl 82f3b262f8 xmloff: fix --enable-mergelibs build
... by merging all object-using CppunitTests into uxmloff, which is
already disabled for MERGELIBS.

Change-Id: I12ad08660fd714cceba2fe9b855cdb1bbda19c2d
2016-10-07 21:35:04 +02:00
Mohammed Abdul Azeem 090e3fe416 GSoC - Keeping both token lists in xmloff/ consistent:
Added dummy tokens to keep the lists consistent and
a test case to check the same.

Change-Id: Ia58f1f77a5100a9fb3c7226fcad1fef1bd5aec39
Reviewed-on: https://gerrit.libreoffice.org/28183
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Tested-by: Noel Grandin <noelgrandin@gmail.com>
2016-08-22 07:12:28 +00:00
Stephan Bergmann cf31f48acc At which point, TokenmapTest::setUp/tearDown are redundant again
Change-Id: I0b3017427aa0d3cf9450734c677b442e61fdbe63
2016-08-19 11:13:00 +02:00
Noel Grandin 4753582d68 attempt to fix the xmloff/tokenmap tinderbox failure
Change-Id: I1b70ef90de374ade858b8207802b8048b2dfd248
2016-08-19 10:25:24 +02:00
Eike Rathke 5dd8fdae4a xmloff tokenmap: allocate map on heap instead of as class member
Try to make the tinderbox happy..

Change-Id: I564d554739fc38d2a901d38ad676c9ba28f3c233
2016-08-18 13:58:27 +02:00
Eike Rathke 60d4b7fe92 xmloff tokenmap: do not assume anything did not fail
Change-Id: If13feffe41631b45605511fbad07965e0d5cb8d5
2016-08-18 11:55:37 +02:00
Noel Grandin 8cb4a74de4 loplugin:staticcall
Change-Id: I0e35e3e6b7540fb1b8a65b034095d2b1fe80715f
2016-08-17 09:52:52 +02:00
Daniel Sikeler f577a42207 GSoC - implement global tokenhandler for odf-tokens
This generates perfect hash for odf-tokens and use them with the tokenhandler.
With added test case to check to and fro mapping between tokens.
This is taken from Daniel's work in feature/fastparser branch.

Change-Id: I7cf77c1eb6c9dd68fd78108c6e0726507c7672e1
Reviewed-on: https://gerrit.libreoffice.org/28073
Reviewed-by: Eike Rathke <erack@redhat.com>
Tested-by: Eike Rathke <erack@redhat.com>
2016-08-16 20:31:31 +00:00
Stephan Bergmann 51b45df6bb loplugin:nullptr (automatic rewrite)
Change-Id: I8690de2cb68dcfedc9f2239ce66cea06fd94bc16
2015-11-10 10:32:01 +01:00
Stephan Bergmann b36963c0a6 Replace "SAL_OVERRIDE" with "override" in LIBO_INTERNAL_ONLY code
Change-Id: I2ea407acd763ef2d7dae2d3b8f32525523ac8274
2015-10-12 17:52:29 +02: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 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
Stephan Bergmann 70cc2b191b First batch of adding SAL_OVERRRIDE to overriding function declarations
...mostly done with a rewriting Clang plugin, with just some manual tweaking
necessary to fix poor macro usage.

Change-Id: I71fa20213e86be10de332ece0aa273239df7b61a
2014-03-26 16:39:26 +01:00
Stephan Bergmann 31911b3cdc Consolidate XServiceInfo for classes derived from SvXMLExport
Change-Id: Ia3e2b5e682a64844bb6c713912c50c7681393d52
2014-01-08 14:11:58 +01:00
Eike Rathke ebc1b2fe50 added bool bForExport parameter to XMLPropertySetMapper ctor
Set to true for export, false for import. If export true, an
XMLPropertyMapEntry with mbImportOnly==true is not added to the
mappings. This to be able to have more than one mappings for import
(for example a current extension namespace and the future namespace
proposed to the ODF-TC, or corrected typos in element or attribute
names), but map only to one entry on export, of course.

Change-Id: Ia01ea949c88eda2f8a6c10f51c59e35e7abdcaf3
2013-12-20 03:26:57 +01: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
Michael Meeks c44e6855a9 xmloff: at least do something to test styles.
Change-Id: I7982f162ef95a9f10501c860b6f19865bf34744b
2013-03-14 17:41:55 +00:00
Michael Meeks 678e35c4ac xmloff: native code unit testing harness.
Change-Id: I5b9133deea2aa7630752128128f1a222bef99eb1
2013-03-14 13:26:42 +00:00