summaryrefslogtreecommitdiff
path: root/sw/source/filter/html/wrthtml.cxx
AgeCommit message (Collapse)Author
2018-04-16sw: prefix members of WriterMiklos Vajna
Change-Id: Iee39219eb9de089ded9658eb75fcf258c3bd951d Reviewed-on: https://gerrit.libreoffice.org/52931 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
2018-03-28tdf#108122 HTML export: fix lost images on copyMiklos Vajna
As in the copy part of copy&paste. The problem was that the document has an empty base URL during copy, and this was images were not exported at all. An alternative fix would be to use embedded images, but sadly Word's HTML import doesn't understand that markup, so use tempfiles instead. Change-Id: Iab8c555ac244d943c4958f24f8ac61cba4ec3aba Reviewed-on: https://gerrit.libreoffice.org/52003 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
2018-03-27ditch HelpEx hackCaolán McNamara
in since initial commit, no sign of it in use Change-Id: I7f4a072f5d8620c088ec4750c8dbcefc89667cf5 Reviewed-on: https://gerrit.libreoffice.org/51958 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2018-03-27sw HTML paste: add debug env var to capture outgoing contentMiklos Vajna
Similar to existing SW_DEBUG_RTF_PASTE_TO. Change-Id: I5d6fe72929ab6ddd3e6e175ed344781fc4e3cb31 Reviewed-on: https://gerrit.libreoffice.org/51961 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
2018-03-20sw XHTML import: write <div> wrapper in ReqIF modeMiklos Vajna
ReqIF says the XHTML fragment must be of type xhtml.BlkStruct.class, which is either a <p> or a <div> element (a single one). Just write this wrapper unconditionally, as we ignore it on import anyway, and it could be skipped only in the single-paragraph-doc case. Change-Id: I3051008866c4a28ce54413c73071bd4a5ced8b87 Reviewed-on: https://gerrit.libreoffice.org/51646 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
2018-03-09sw XHTML export: handle image as <object>Miklos Vajna
At least in ReqIF mode, where <img> is not part of the allowed subset. (Freeware validator for that subset is at <https://reqif.academy/library/software/consequent-command-line/>.) Change-Id: Iecc2645c5fbd35cc52096a25a797df0594b47d4f Reviewed-on: https://gerrit.libreoffice.org/51009 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
2018-03-09sw: fix some IWYU warningsMiklos Vajna
Change-Id: Idb8ad6cda75b7112280ae71b4340d0187a602794 Reviewed-on: https://gerrit.libreoffice.org/50974 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2018-03-07sw XHTML export: let reqif-xhtml= imply XHTMLMiklos Vajna
An XML namespace for non-XHTML makes little sense. Change-Id: I0ae1b2886a8d81be3c932c9e74aa91cd2e2fa447 Reviewed-on: https://gerrit.libreoffice.org/50905 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
2018-03-07use more Color in swNoel Grandin
Change-Id: I51d575c40228bbd2ff384f12da33c1cd8bda2dda Reviewed-on: https://gerrit.libreoffice.org/50800 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-03-01sw HTML export: ReqIf implies we write a fragmentMiklos Vajna
Test that for a very simple input we roundtrip perfectly (not counting whitespace changes). Change-Id: I89cfbe1da594f8a5343444ca20a107021d6a1a37 Reviewed-on: https://gerrit.libreoffice.org/50522 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
2018-03-01sw HTML export: handle XHTML ns alias even with HTMLOutFuncs::Out_AsciiTag()Miklos Vajna
This is meant to be mechanical, full conversion to HtmlWriter has to be done step by step in follow-up commits. Change-Id: Ieab096f8c9936f0ecad029fbdfb51da7412ad83e Reviewed-on: https://gerrit.libreoffice.org/50449 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2018-02-28sw HTML export: allow custom XHTML namespace aliasMiklos Vajna
This helps in case the HTML filter expected to produce an XHTML fragment that has an explicit namespace alias for <http://www.w3.org/1999/xhtml>. This only has an effect when HtmlWriter is used to write elements, though. Change-Id: I161caf4bb6bc6d0c21a7a67433b08bb060b447f1 Reviewed-on: https://gerrit.libreoffice.org/50448 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2018-02-28convert COL_ constants to be of type ColorNoel Grandin
Change-Id: I0e25c8950ac26b851ff42f71e1471fcbe4770d48 Reviewed-on: https://gerrit.libreoffice.org/50373 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-02-20drop Color::SetColor(ColorData) in favour of operator=Noel Grandin
first stage of getting rid of ColorData Change-Id: I5e4e95eb958722814c43c8d1ebfef17ad18c29ec Reviewed-on: https://gerrit.libreoffice.org/49997 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-02-08sw HTML import: avoid loading the Writer/Web template for the Writer filterMiklos Vajna
The share/template/common/internal/html.stw template we have is for Writer/Web, loading that into Writer is questionable at best. Also it means that the outline numbering of the heading styles is not set, which is a problem, as the sw HTML import only sets the style, not the outline numbering. Change-Id: I86d11d8a5744c3c2ca71b03fd41a24d3f88ea333 Reviewed-on: https://gerrit.libreoffice.org/49381 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
2018-01-24Fix some IWYU warningsMiklos Vajna
Change-Id: I4b6e799c1afc2a762a3729ee89f3226c59a6eef8 Reviewed-on: https://gerrit.libreoffice.org/48462 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
2018-01-12More loplugin:cstylecast: swStephan Bergmann
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: I0f49d21dfdf82742f11b27709f74294feb1e419e
2017-12-24convert RES_FRM constants to TypedWhichIdNoel Grandin
Change-Id: I0c71a6fd2e094cebdb720e6c0661cd8a7bb8482c Reviewed-on: https://gerrit.libreoffice.org/46812 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-12-15sw HTML export: add a filter option to produce XHTMLMiklos Vajna
Add initial support for writing XHTML markup as part of the HTML filter. This already emits valid XHTML for hello world documents. Times for 100 hello world inputs: 16032 -> 9957 ms is spent in ODT-load + export + close (62% of original). Change-Id: I51a0a20985958fbc817c196d3a966e55dcb3f13f Reviewed-on: https://gerrit.libreoffice.org/46567 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
2017-11-24TypedWhichId for RES_CHRATR constantsNoel Grandin
Change-Id: Id6c45c237e9c8c55597d97b647b443eab9d1880a Reviewed-on: https://gerrit.libreoffice.org/45147 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-10-06filters: always use "" for includes in current source's directoryMike Kaganski
For rationale, see commit 633f405701fc5cadfa73e950f7a8c122ad01c149 Change-Id: I9a43caca12cc5755ffc5c4fdf16ac7e0660edf2e Reviewed-on: https://gerrit.libreoffice.org/43180 Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com> Tested-by: Mike Kaganski <mike.kaganski@collabora.com>
2017-08-21remove dead sw error codesNoel Grandin
and inline some macros Change-Id: Ida8db46bec4fcec46a779da0180fe3bf1a1af59d Reviewed-on: https://gerrit.libreoffice.org/41375 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-07-21migrate to boost::gettextCaolán McNamara
* all .ui files go from <interface> to <interface domain="MODULE"> e.g. vcl * all .src files go away and the english source strings folded into the .hrc as NC_("context", "source string") * ResMgr is dropped in favour of std::locale imbued by boost::locale::generator pointed at matching MODULE .mo files * UIConfig translations are folded into the module .mo, so e.g. UIConfig_cui goes from l10n target to normal one, so the res/lang.zips of UI files go away * translation via Translation::get(hrc-define-key, imbued-std::locale) * python can now be translated with its inbuilt gettext support (we keep the name strings.hrc there to keep finding the .hrc file uniform) so magic numbers can go away there * java and starbasic components can be translated via the pre-existing css.resource.StringResourceWithLocation mechanism * en-US res files go away, their strings are now the .hrc keys in the source code * remaining .res files are replaced by .mo files * in .res/.ui-lang-zip files, the old scheme missing translations of strings results in inserting the english original so something can be found, now the standard fallback of using the english original from the source key is used, so partial translations shrink dramatically in size * extract .hrc strings with hrcex which backs onto xgettext -C --add-comments --keyword=NC_:1c,2 --from-code=UTF-8 --no-wrap * extract .ui strings with uiex which backs onto xgettext --add-comments --no-wrap * qtz for gettext translations is generated at runtime as ascii-ified crc32 of content + "|" + msgid * [API CHANGE] remove deprecated binary .res resouce loader related uno apis com::sun::star::resource::OfficeResourceLoader com::sun::star::resource::XResourceBundleLoader com::sun::star::resource::XResourceBundle when translating strings via uno apis com.sun.star.resource.StringResourceWithLocation can continue to be used Change-Id: Ia2594a2672b7301d9c3421fdf31b6cfe7f3f8d0a
2017-07-13loplugin:oncevar: empty strings: swStephan Bergmann
Change-Id: I38d5669078308b425d8e87090ef72279de96c6c9
2017-06-21loplugin:unusedfields in sw part3Noel Grandin
Change-Id: I0ee93f4df757d477912de70937ec1dded82c48fb Reviewed-on: https://gerrit.libreoffice.org/39041 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-06-21convert ErrCode to strong typedefNoel Grandin
would have preferred to re-use o3tl::strong_int, of which this is a modified copy, but there are lots of convenience accessors which are nice to define on the class. Change-Id: I301b807aaf02fbced3bf75de1e1692cde6c0340a Reviewed-on: https://gerrit.libreoffice.org/38497 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-06-14use ERRCODE_NONE instead of 0Noel Grandin
peeling off a small chunk of my ErrCode strong_int conversion Change-Id: Idc89e8496083beed7608cba705cd981139eb7111 Reviewed-on: https://gerrit.libreoffice.org/38777 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-05-05loplugin:checkunusedparams in svtoolsNoel Grandin
Change-Id: Iea68d7c0683740acaf4f85c14efe2a33e0cf13e7 Reviewed-on: https://gerrit.libreoffice.org/37201 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-05-05convert HTML_TOKEN_IDS to scoped enumNoel Grandin
Change-Id: I525506e0103e4f17e5b8b95f15c1285d65b93de9 Reviewed-on: https://gerrit.libreoffice.org/37220 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-04-14tdf#39468 Translate German comments in swJens Carl
Translate German comments and terms in sw/ Change-Id: Ie82178842f6d9e4b2b1f4cac1bcee1e8a5b8b957 Reviewed-on: https://gerrit.libreoffice.org/36547 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Bartosz Kosiorek <gang65@poczta.onet.pl>
2017-03-22loplugin:redundantcast find redundant c-style enum castsNoel Grandin
Change-Id: I2dab376d87804521aed6b6bd41ad7762830fa349 Reviewed-on: https://gerrit.libreoffice.org/35467 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-03-15convert SvxFrameDirection to scoped enumNoel Grandin
Based on the casts in chart2/source/view/main/ChartView.cxx and the similarity of naming of values, I conclude that this enum was intended to abstract over css::text::WritingMode2. Added a comment to that effect. Change-Id: I3af8bbe8b6ac8c4a9375f6ccde145b98b9c69a57 Reviewed-on: https://gerrit.libreoffice.org/35164 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-03-08loplugin:loopvartoosmallStephan Bergmann
Change-Id: I01b42f92b553695724305c1604db967da114a818
2017-03-07convert RES_FIELDS to scoped enumNoel Grandin
and rename to SwFieldIds Change-Id: I50d2b7550f68b4b020ffc1603f931c671c8e1de6 Reviewed-on: https://gerrit.libreoffice.org/34924 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2017-01-19use rtl::Reference in SwHTMLWriterNoel Grandin
instead of manual acquire/release Change-Id: I76176841738688dff9df2e7dc3077be7d32387e9
2017-01-18new loplugin: useuniqueptr: sw part 2Noel Grandin
Change-Id: Ifa901f75072d8474d8a97ca57c2b5b48d8c6b79d Reviewed-on: https://gerrit.libreoffice.org/33250 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-01-10New loplugin:conststringvar: swStephan Bergmann
Change-Id: I8c2dcd34668f9f2e4bea70ea86ff57fd7b923c34
2016-12-05convert DecodeMechanism to scoped enumNoel Grandin
Change-Id: I5c56634b1bca8e37fa73d02d2428645301b6c547
2016-11-23tdf#42949 Remove unnecessary headers from sw/source/filtersBartosz Kosiorek
Change-Id: I5f4d3fed6e8fd484ba5da835e2954f3c2042f33b Reviewed-on: https://gerrit.libreoffice.org/31087 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2016-10-05convert MapUnit to scoped enumNoel Grandin
I left a prefix on the names "Map" so that I would not have to re-arrange each name too much, since I can't start identifiers with digits like "100thMM" And remove RSC_EXTRAMAPUNIT, which doesn't seem to be doing anything anymore. Change-Id: I5187824aa87e30caf5357b51b5384b5ab919d224 Reviewed-on: https://gerrit.libreoffice.org/29096 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2016-08-30Let OUStringLiteral1 take its arg as ctor arg, not template argStephan Bergmann
...which makes it more flexible, can now also be used on non-const arguments. The drawback of the argument no longer being a compile-time constant is remedied by making the ctor constexpr. Change-Id: Ia4903a2cc86791fece92eac0cb8406b6659dd19d
2016-07-04remove comphelper::string::removeNoel Grandin
and replace it with OUString/OString::replaceAll Change-Id: I37b1c3b51251dfd9d749d6f1060c75b3a93d7f1a Reviewed-on: https://gerrit.libreoffice.org/26850 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-05-12clang-tidy modernize-loop-convert in swNoel Grandin
Change-Id: I1f4a0ad6658bd3154c48940296aa8edc1ea1612c Reviewed-on: https://gerrit.libreoffice.org/24876 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-03-23tdf#63211: saving embedded images to HTML optionalOliver Specht
This change re-introduces linked images in HTML export but keeps embedded image export in mailmerge e-Mail function Change-Id: I9e956b590f4c675b5954e19e4d3948c36b55f1e6 Reviewed-on: https://gerrit.libreoffice.org/23359 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Oliver Specht <oliver.specht@cib.de>
2016-02-08tdf#83890 sw html export: fix missing start numbering attributeMarc Bessières
In the sequence 1 Title 1 1.1 Subtitle 1.1 Not numbered item 1.2 Subitle 1.2 2 Title 2 The numbering element for the Subitle 1.2 was missing the html start attribute when it was followed by a numbering element of lower level. So let's force it, when it comes after a not numbered item. Adding a test case that validate that the Subtitle now contains the right attribute Removed a reference to an openoffice bug that brings no value too Change-Id: I928592a667f59128a4aa079d6b042ffb14244181 Reviewed-on: https://gerrit.libreoffice.org/22191 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2015-12-02loplugin:stringconcat: Also look through O[U]String ctorsStephan Bergmann
Change-Id: I4f07c7c61d324a85f9f5dee0f25a7358facebd41
2015-11-25bin/rename-sw-abbreviations.shlibreoffice-5-1-branch-pointRobinson Tryon
This commit renames the most annoying abbreviations in Writer (and partially in the shared code too). Change-Id: I77e5134f42f25e3786afa36b7a505c7e3237a9e8
2015-11-24loplugin:unusedfields in sw/Noel Grandin
Change-Id: I323a038e5581b00cd3a4ea2f362c66540377759e
2015-11-10loplugin:nullptr (automatic rewrite)Stephan Bergmann
Change-Id: I01e11fa956a249974e77dce9deebe79311f098d0
2015-11-05sw: prefix members of SwHTMLWriterMiklos Vajna
Change-Id: I571b3cc8c6120ccddc79659e8e58b536c79f2430