Commit Graph
602 Commits
Author SHA1 Message Date
Caolán McNamara 48bca65f1c inherit welded dialogs from a common ancestor
Change-Id: Ifa6c871a134cf89bfba71b1049a115cf7c953c42
Reviewed-on: https://gerrit.libreoffice.org/50936
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
2018-03-09 13:47:52 +01:00
Noel Grandin 2d40c43e86 loplugin:redundantfcast look for unnecessary temporaries
when calling methods that take a const&

Change-Id: Idf45dfd9fea0de6fae0b1f89550f2f7fc302aa15
Reviewed-on: https://gerrit.libreoffice.org/50970
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-03-09 07:14:51 +01:00
Caolán McNamara d6f1c3dece weld SfxPasswordDialog Dialog
Change-Id: If8c9757986f4af7b7927717221860e65c8c7285e
Reviewed-on: https://gerrit.libreoffice.org/50755
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
2018-03-05 00:32:13 +01:00
David Tardon 4a731b030e astyle
Change-Id: I3ea599f491a464458865ce42930be4728ede5dc9
2018-02-27 19:10:32 +01:00
David Tardon 9534a8fe3e set number of read bytes correctly
It was wrong if we read less than was expected.

Thanks to Antti Levomäki and Christian Jalio from Forcepoint.

Change-Id: I070c1731d1aace4c101fa01efed0c28734c44899
2018-02-27 19:10:08 +01:00
Miklos Vajna 6259dfce9d EPUB export: pick up XMP metadata from 'metadata.xmp'
This used to be <filename>.xmp, but that's inconsistent with how cover
image is not <filename>.jpg but cover.jpg (or .png, etc).

Also it was redundant, since these files are in the media directory, for
which the default is the <filename> directory.

Change-Id: Iadfebf2f9c336f443537759b1e58409a93e1c51d
Reviewed-on: https://gerrit.libreoffice.org/49604
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Jenkins <ci@libreoffice.org>
2018-02-12 21:04:12 +01:00
Miklos Vajna bf79168dba EPUB export: can use std::move() here
And get rid of an easy to avoid include if we are at it.

Change-Id: I63cb4628a3a7038aab91c66f592920923a31d7a6
Reviewed-on: https://gerrit.libreoffice.org/49060
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Jenkins <ci@libreoffice.org>
2018-02-01 09:03:45 +01:00
Stephan Bergmann 7ca9619dfe -Werror=parentheses (upcoming GCC 8)
Change-Id: I4522dc7929030c5da59f2ab030a806ebe7516bd1
Reviewed-on: https://gerrit.libreoffice.org/48403
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-01-24 13:18:34 +01:00
Miklos Vajna a54787669b EPUB export, fixed layout: add chapter names to the navigation document
Extend vcl::PDFExtOutDevData so that it's possible to use it outside the
PDF export; this way the EPUB export can know which chapters start on
which page.

This means fixed and reflowable layout has the same table of contents,
instead of just Page <N> in the fixed layout case.

Change-Id: I935fb23c66ec747431b91e83b0e677d4e5f704b9
Reviewed-on: https://gerrit.libreoffice.org/48332
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Jenkins <ci@libreoffice.org>
2018-01-23 09:05:02 +01:00
Miklos Vajna cd2c076f64 EPUB export UI: show remaining metadata from the doc model
Title is not special in any way, showing author/language/date has the
same benefits.

Change-Id: Ie05071b88d7fa53ad0e39927904ea5e122a66c9a
Reviewed-on: https://gerrit.libreoffice.org/48183
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2018-01-20 09:00:48 +01:00
Miklos Vajna 9bca3cc186 EPUB export UI: show title from the doc model
It was a bit confusing that the doc model had a title set, it was
written to the EPUB file but the UI did not show it.

Change-Id: Ife408e0dabd3fe48e8acc1f09be0c86f78ed4b80
Reviewed-on: https://gerrit.libreoffice.org/48150
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2018-01-19 09:13:06 +01:00
Miklos Vajna 9035ee7c90 EPUB export: accept relative links for image popup from default media dir
Previously:

- the user had to copy the linked image to the same dir as the doc
- set a relative link on the image (in ODF, it resulted in "../foo.png")
- copy the image to the media dir ("test" by default for "test.odt")
- export to EPUB to have the image popup

Now, additionally:

- relative link may point to the default media dir (in ODF, it results
  in "../test/foo.png")
- no need to copy the image
- export to EPUB creates the popup

So one less step is necessary. The downside is that this way the
relative URL contain the base name of the document, so renaming the
document breaks these relative links.

Change-Id: I93894a28393d36a33dcec7bfe7c4a54fd83768da
2018-01-19 09:11:12 +01:00
Miklos Vajna 5c4d502100 EPUB export: fix validation error on invalid relative links
It's valid to have a relative link that points nowhere in ODF, but the
same is not true for EPUB.

Change-Id: I7884032e277a0c53d0c513cea70dd2ee29ccd85c
2018-01-19 09:07:45 +01:00
Miklos Vajna 9b3904357b EPUB export: various small cleanups
Change-Id: Iaa921257720adc6a65c8598b1105a4d7249778e6
Reviewed-on: https://gerrit.libreoffice.org/48021
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Jenkins <ci@libreoffice.org>
2018-01-17 09:05:02 +01:00
Stephan Bergmann 115d39a27d More loplugin:cstylecast: writerperfect
auto-rewrite with <https://gerrit.libreoffice.org/#/c/47798/> "Enable
loplugin:cstylecast for some more cases" plus
solenv/clang-format/reformat-formatted-files

Change-Id: I4698e9413b00e9bfe472393bf368f6aca0fd98c0
2018-01-12 20:10:13 +01:00
Miklos Vajna 67e1e2ee40 tdf#42949 Fix some more Include What You Use warnings
Change-Id: I2040315707674dc99a37aedb96ac61dca274c13a
Reviewed-on: https://gerrit.libreoffice.org/47348
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Jenkins <ci@libreoffice.org>
2018-01-04 15:51:39 +01:00
Noel Grandin acdba3c2ee loplugin:passstuffbyref more return improvements
slightly less restrictive check when calling functions

Change-Id: I35e268ac611797b1daa83777cda02288a635aa32
Reviewed-on: https://gerrit.libreoffice.org/47259
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-01-03 08:07:41 +01:00
Jan Holesovsky 101a79cc4d lokdialog: Allow switching language of some of the ResMgr's.
This way, it is possible to have all the strings translated in dialogs even
when different users use different languages.  [It was already possible
to have different languages previously, but not everything in the dialog has
switched - like the buttons at the bottom of the dialogs etc.]

Change-Id: I29a5ae6d31a370eec60397884200b684ec1bf5b9
Reviewed-on: https://gerrit.libreoffice.org/46417
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Tested-by: Michael Meeks <michael.meeks@collabora.com>
Reviewed-on: https://gerrit.libreoffice.org/46979
Tested-by: Jenkins <ci@libreoffice.org>
2017-12-22 22:39:39 +01:00
Miklos Vajna fadd9d4497 EPUB export, fixed layout: fix mm size of SVG pages
The preferred map unit was pixel, but SVGExport::writeMtf() expects the
map unit is always a logical one, given that it calls
OutputDevice::LogicToLogic() for it.

Change-Id: Id1f311eb14423a76a82886ca848c90ab48c6eb49
Reviewed-on: https://gerrit.libreoffice.org/46733
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Jenkins <ci@libreoffice.org>
2017-12-19 09:02:11 +01:00
Stephan Bergmann a5c201790b ...and another
Change-Id: I833350b5c193223d24550e58f7ec99ae081afe8b
2017-12-14 10:14:58 +01:00
Stephan Bergmann db75836932 Blind fix for recently removed config_host/config_libepubgen.h.in
Change-Id: If91cfdce97f4f3868c2b09013220d27ceaffdfbe
2017-12-14 10:11:48 +01:00
Miklos Vajna b2b1debf06 external: upload libepubgen-0.1.0
The only change is that version support is now available
unconditionally, otherwise most code changes were bundled already in the
form of patches.

Change-Id: I0e456d85c9d84002cabcd77b31b02c9a7ad16ac5
Reviewed-on: https://gerrit.libreoffice.org/46386
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2017-12-14 09:09:35 +01:00
Miklos Vajna 312cecf11c tdf#113183 DOCX import: fix not independent text box alignments
The alternative would be to clear them in
writerfilter::dmapper::DomainMapper::getPositionOffset(), but that runs
before writerfilter::dmapper::PositionHandler::lcl_sprm(), so it would
be too early.

Change-Id: I287b9a4025c4b1844ae467c48815b5d7ffe3f98e
Reviewed-on: https://gerrit.libreoffice.org/46279
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Jenkins <ci@libreoffice.org>
2017-12-12 13:57:47 +01:00
Noel Grandin 3af500580b loplugin:salcall fix functions
since cdecl is the default calling convention on Windows for
such functions, the annotation is redundant.

Change-Id: I1a85fa27e5ac65ce0e04a19bde74c90800ffaa2d
Reviewed-on: https://gerrit.libreoffice.org/46164
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-12-11 12:13:46 +01:00
Noel Grandin be354a2abd loplugin:constparams
Change-Id: Ia322ecf8f80b28c58ec33d17ca9607401a92534b
Reviewed-on: https://gerrit.libreoffice.org/45959
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-12-07 07:21:32 +01:00
Noel Grandin 9a06b99d2f loplugin:salcall fix non-virtual methods
first, since those are safer to change than virtual methods

Change-Id: Ie3b624019d75ee2b793cee33b3c5f64e994e8bfe
Reviewed-on: https://gerrit.libreoffice.org/45798
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-12-05 07:32:46 +01:00
Miklos Vajna 32fd735a6a EPUB export, fixed layout always means "split at the end of the page"
So disable split type on the UI, as it has no effect.

Change-Id: Ia16e8050a732fce2f7881eee1b64e4487e843574
Reviewed-on: https://gerrit.libreoffice.org/45691
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2017-12-04 09:08:14 +01:00
Miklos Vajna d4246aeaa2 EPUB export, fixed layout: fix spine names
They are pages, not sections.

Change-Id: Ifd72d5ebec1d372a9bd99653d849479a6ffb6bfa
Reviewed-on: https://gerrit.libreoffice.org/45690
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2017-12-04 09:07:57 +01:00
Miklos Vajna 19339e79e4 EPUB export, fixed layout: remove old non-metafile-based page size approach
This was unused code.

Change-Id: I7f728544127dc283cd74e4425e699d598caeae1a
Reviewed-on: https://gerrit.libreoffice.org/45649
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2017-12-04 09:07:43 +01:00
Miklos Vajna e83d7993d4 EPUB export, fixed layout: disable DTD string in SVG header
epubcheck complains:

ERROR(HTM-003): test.epub/OEBPS/images/image0001.svg(5675,37): External entities are not allowed in EPUB v3 documents. External entity declaration found: %svg-extensibility.mod.

and similar ones. Just not writing the DTD header is enough to address
the error.

Change-Id: I5307e932a0f07585297cce734aceae77e43cc7a6
Reviewed-on: https://gerrit.libreoffice.org/45648
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2017-12-04 09:07:27 +01:00
Miklos Vajna 3ed8466b55 EPUB export, fixed layout: switch to a metafile-based approach
Trying to guess layout from flat ODF output is an approach that doesn't
scale, think of complex documents with split tables, etc.

Do it similar to the PDF export instead: take a metafile of each page
and use the existing SVG writer to embed it into XHTML.

Change-Id: I6e860834beb8025519d3e367f858077ae9e9c006
Reviewed-on: https://gerrit.libreoffice.org/45647
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2017-12-04 09:06:56 +01:00
Miklos Vajna 01283fe86c EPUB export allow requesting fixed layout from cmdline
FilterData is a typed map of options, suitable for UNO API clients, also
that's what the UI uses. OTOH the --convert-to cmdline option can only
set a FilterOptions string, so support that way as well.

--convert-to epub:EPUB:layout=fixed

can be used to trigger this.

Change-Id: I9f429107ae1db3dc4b6ab3b2b75665f096a1a33a
Reviewed-on: https://gerrit.libreoffice.org/45646
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2017-12-01 16:31:20 +01:00
Miklos Vajna 89e7a00080 EPUB export: handle page size in fixed layout
Requires parsing master pages and page layouts.

Change-Id: Ia8b9e59a9355396d3776af06e8e67ec88033754b
Reviewed-on: https://gerrit.libreoffice.org/45645
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2017-12-01 16:30:53 +01:00
Miklos Vajna 913fbc822c EPUB export: add UI to request fixed layout
Sets the EPUBLayoutMethod filter data key at UNO level.

Change-Id: Ia07029bd83fec02e98cb6a3cc2bfea2ab742d769
Reviewed-on: https://gerrit.libreoffice.org/45644
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2017-12-01 16:30:25 +01:00
Miklos Vajna ab7bdd1f91 EPUB export: initial fixed layout support
This is just the bare minimum that is already a fixed layout and is
valid.

Change-Id: I64e1216d92125377d7836988586da9ea1d878536
Reviewed-on: https://gerrit.libreoffice.org/45643
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2017-12-01 16:30:04 +01:00
Stephan Bergmann 09d96767a4 -Werror,-Wunused-private-field
Change-Id: Ia265d565bbc6b9e4c03aa9be66916b926b54bed8
2017-12-01 10:07:05 +01:00
Miklos Vajna 1a0a026a57 EPUB export: handle custom media dir in cover image / XMP metadata
By changing the default to <media dir>/cover.<extension> and <media
dir>/<basename>.xmp.

Change-Id: I736aefafba5aa5208917d9ed40119ca7721cdde3
Reviewed-on: https://gerrit.libreoffice.org/45604
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2017-12-01 09:18:01 +01:00
Miklos Vajna 3ed60d22c3 EPUB export: add UI to test custom media directory
Sets the RVNGMediaDir filter data key at UNO level.

Change-Id: I9919e5ca39c9f4f126d1d67946c8bec99ce0381d
Reviewed-on: https://gerrit.libreoffice.org/45603
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2017-12-01 09:17:43 +01:00
Miklos Vajna 7f0641de76 EPUB export: allow setting custom media dir explicitly
The default is the same <base directory>/<base name>/ as before.

Change-Id: Idb500193a7f6bd901d861e857147832a3ada91d3
Reviewed-on: https://gerrit.libreoffice.org/45602
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2017-12-01 09:17:22 +01:00
Miklos Vajna 7dcb4fef3b EPUB export: support image popup for images and text
Handle relative links on image / text as data for a popup. Pick the images up
from <base directory>/<base name>/<relative url> as a start.

Change-Id: I9b6183d554e3792aa71dfffc19a671a0e4c302cc
Reviewed-on: https://gerrit.libreoffice.org/45601
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2017-12-01 09:17:01 +01:00
Miklos Vajna 553a35bed7 EPUB export: handle footnotes
Stringly speaking just linking from the main text to the footnote
content would be enough from an EPUB point of view, but let's do the
other direction as well, since Writer provides that.

Change-Id: Iba366ef11a8375347d57a650c57baf8e8002e820
Reviewed-on: https://gerrit.libreoffice.org/45600
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2017-12-01 09:16:41 +01:00
Miklos Vajna 8f0f8f80c1 EPUB export: don't loose images with links
And actually handle the link around the image.

Change-Id: Ic9b7b9497becf677dbf550c67074c5c588ef8922
2017-12-01 09:16:23 +01:00
Miklos Vajna ee74bd7385 EPUB export: add UI to set custom metadata
The motivation here is that when it comes to date or author, the typical
metata for the Writer document won't match the metadata of the book the
file represents, so allowing a custom override as part of EPUB export
makes sense.

Change-Id: I19aaed83ae0e69bc0dfa3084e1c9dc9cc534328f
Reviewed-on: https://gerrit.libreoffice.org/45553
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2017-11-30 15:36:26 +01:00
Miklos Vajna 98770243f7 EPUB export: allow setting custom metadata explicitly
If not set, fall back to the existing auto-find. The testcase now
asserts that the priority is:

- api
- if that is not set, then xmp
- if that is not set, then doc

(And at the end libepubgen itself has some defaults as well.)

Change-Id: Ie8fc646b81c4a287690fd2eeed43f4786b7938bf
Reviewed-on: https://gerrit.libreoffice.org/45552
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2017-11-30 15:36:10 +01:00
Miklos Vajna 1a48cdaf91 EPUB export: allow overwriting of document metadata
Pick up overrides from <base directory>/<base name>.xmp as a start.

Change-Id: Ib64a6bbdadc53633fb1f0d4a7efdde2e3c96b5ef
Reviewed-on: https://gerrit.libreoffice.org/45551
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2017-11-30 15:35:44 +01:00
Miklos Vajna 06fa42837d EPUB export: add UI to set a custom cover image
Sets the EPUBCoverImage filter data key at UNO level.

Change-Id: I46eb3c0df1e6c34af0be070c32f9f37666dc718e
Reviewed-on: https://gerrit.libreoffice.org/45485
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2017-11-29 17:54:17 +01:00
Miklos Vajna 612821223c EPUB export: allow setting a custom cover image explicitly
If not set, fall back to the existing auto-find.

Change-Id: I5df7a535e4132a18a803c10fa0e06352d9b6b533
2017-11-29 17:53:15 +01:00
Miklos Vajna 389f7b9581 EPUB export: add support for cover images
Pick them up from <base directory>/<base name>.cover-image.<ext> as a
start.

Change-Id: Ie5ee7c02d6b3271e6e850ca9a2a10ed0bb4a598d
Reviewed-on: https://gerrit.libreoffice.org/45483
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2017-11-29 17:49:20 +01:00
Miklos Vajna 793bbac379 EPUB export: implement font embedding support
Also avoid librevenge::RVNGBinaryData::appendBase64Data() for
performance reasons. Times with and without the XMLBase64ImportContext
rework for sw/qa/extras/odfexport/data/embedded-font-props.odt:

- before: 1m32.254s
- after: 0m7.045s

(Need to insvestigate macOS font embedding situation in general, later.)

Change-Id: I5aa56bfbfa8dc64f19c021202a1b87618b4b2775
Reviewed-on: https://gerrit.libreoffice.org/45385
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2017-11-29 09:17:04 +01:00
Miklos Vajna 944cc09cf7 EPUB export: fix char props of <text:sequence> characters
These are typically inherited from parent, <text:sequence> is similar to
e.g. <text:span> in this regard.

Change-Id: Ic84f6e2e4fc6866ffca23eef2c932ee63e6978ca
Reviewed-on: https://gerrit.libreoffice.org/45314
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2017-11-27 12:39:58 +01:00