summaryrefslogtreecommitdiff
path: root/writerfilter
AgeCommit message (Collapse)Author
2016-10-25tdf#84678 DOCX import: fix handling of textbox marginsMiklos Vajna
Regression from commit d379d18666aa42031359ca8eb34b0021960347ae (oox: import WPS shape with text as shape with textbox, 2014-06-18), the problem for a long time was that in Writer text frames without borders couldn't have text margins, either. Recently a compat setting was added in the WW8 filter for this situation, so use that in the DOCX import as well, and improve SwTextBoxHelper to handle the margin properties. Change-Id: I472bbc414f21f2ec7334482c460a5c3be3e95e94 Reviewed-on: https://gerrit.libreoffice.org/30255 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2016-10-24loplugin:expandablemethods in writerfilter..xmlhelpNoel Grandin
Change-Id: I23ce30e2f15b6fe857a727f1ef84c40d8d0b127d
2016-10-24tdf#89377 writerfilter: table honors ParaStyle break-before-pageJustin Luth
.doc format handled in prior patch. This import .docx patch checks to see if the very first paragraph style in a table is set with a page-break, and if so, then transfers that setting to the table itself. Change-Id: Ibb87eeb0fbdb7fdd84ef43dd1d7e0a6f8e1f8ad5 Reviewed-on: https://gerrit.libreoffice.org/30161 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Justin Luth <justin_luth@sil.org>
2016-10-18replace <<= with assign for <<= with rhs AnyJochen Nitschke
found by deleting specialization of '<<=' template Change-Id: I253f15177ab20fd3ef9baf4158da8c662cb47e6c Reviewed-on: https://gerrit.libreoffice.org/29956 Reviewed-by: Jochen Nitschke <j.nitschke+logerrit@ok.de> Tested-by: Jochen Nitschke <j.nitschke+logerrit@ok.de>
2016-10-18tdf#95031 DOCX import: auto spacing inside numbering means no spacingMiklos Vajna
The WW8 import has code for this in SwWW8ImplReader::AppendTextNode(), with lots of corner-cases. Not all of that is implemented here yet, but the bullet list in the bugdoc already looks correct now. Change-Id: I9499bfa4d8d7fcc425d7b95e64987258c099f7f2 Reviewed-on: https://gerrit.libreoffice.org/29989 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
2016-10-18loplugin:inlineablemethods in writerfilterNoel Grandin
Change-Id: Iada0f4d631703b3067c90923632ce9a1012bad62
2016-10-18loplugin:unusedmethodsNoel Grandin
Change-Id: Icf773925c37dde8b7404edac9864e7b10fe113b4 Reviewed-on: https://gerrit.libreoffice.org/29968 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2016-10-17replace <<= with assign for <<= with rhs AnyJochen Nitschke
makeAny and Any ctor return an Any Change-Id: Iaa361bc315d785f80153acf1009bf47d109728ec Reviewed-on: https://gerrit.libreoffice.org/29914 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Jochen Nitschke <j.nitschke+logerrit@ok.de>
2016-10-17So MSVC 2013 is too dumb...Stephan Bergmann
...to introduce a temporary in lcl_makePropVal<sal_Int16>(PROP_START_WITH, m_nIStartAt) and instead complains: "cannot convert argument 2 from 'sal_Int32' to 'sal_Int16 &&'". Change-Id: Ic79de8635cc33556ba0803330c0eef314414a7fc
2016-10-17Use perfect forwardingStephan Bergmann
Change-Id: Id34fb78bc80b0796a09286c4fe5f25c5cf98c211
2016-10-14replace macro with function templateJochen Nitschke
Change-Id: Iaa1b503c684b76f57f918285000812360ddbdc56 Reviewed-on: https://gerrit.libreoffice.org/29791 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-10-03n#780843 revert part of docx testcaseJustin Luth
revert testcase for commit 211916f86585cb4f6258eb30e0474e4c21cd37f1 On import, it is impossible to know where automatic end-of-pages will be, so it cannot be known that all the content before the page-break will be on the first page. Removing this testcase because Writer does not have the capability to dynamically assign headers/footers to continuous break sections. This test worked on this particular document, but not on generic documents. Replacing it with a version of the document with more text before the continuous break, which produces the exact opposite footer results. Change-Id: If660edd47b4eb19798f79babe65c37e1a9848739 Reviewed-on: https://gerrit.libreoffice.org/29408 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2016-10-03add more dumpAsXml()Noel Grandin
and make it format the output nicely, so I don't have to use 'xmllint --format' before I can read it. Change-Id: I065ee93193f3c6c7bab87212ab96021fb0d7c5ed Reviewed-on: https://gerrit.libreoffice.org/29407 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2016-09-22Silence some MSVC warnings for autogenerated filesMike Kaganski
Change-Id: I8b4430f9f8282ef7a6b23964ca51d3444a450305 Reviewed-on: https://gerrit.libreoffice.org/29174 Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com> Tested-by: Mike Kaganski <mike.kaganski@collabora.com>
2016-09-20fix buildNoel Grandin
by reverting part of commit b18e1bc61ccba9d0c74274e2fe45b2b422c601cf "loplugin:unusedfields" Change-Id: I69274b54f65e22ec15a053b54af84635d245f51b
2016-09-20loplugin:unusedfieldsNoel Grandin
Change-Id: I852e98b16fdcb88b04e39d11e3101d502c918c24 Reviewed-on: https://gerrit.libreoffice.org/29078 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2016-09-20tdf#84684 RTF import: fix ZOrder of child shapes inside group shapeMiklos Vajna
Both ODF and OOXML's drawingML seem to just not write ZOrder for child shapes (instead they just describe them in a bottom-up order), but RTF does use dhgt, it seems. Given that ZOrder has different meaning inside and outside a group shape use a stack of GraphicZOrderHelpers to get the correct result. Change-Id: I68dbd9f0ae59a1759da14bf414dc1d277d1c927d
2016-09-19Explanation of the SPRM acronym added to definition of the Sprm classMilos Sramek
Change-Id: I536cd6ba2d531292d5148819dfd914b76f4b1111 Reviewed-on: https://gerrit.libreoffice.org/29032 Reviewed-by: Katarina Behrens <Katarina.Behrens@cib.de> Tested-by: Katarina Behrens <Katarina.Behrens@cib.de>
2016-09-19fftester: isAsciiLowerCase has a isUnicodeCodePoint assertCaolán McNamara
which is not helpful when the data is incoming from the outside world Change-Id: I00304ed0d577944a33f5fa6af155f1d130ab7d59
2016-09-18loplugin:unusedenumvaluesNoel Grandin
Change-Id: Icf17f936ce6d07d0e152252833c8645cf9b1163b Reviewed-on: https://gerrit.libreoffice.org/28942 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2016-09-15replace sal_Size with std::size_t (or sal_uInt64 for SvStream pos)Michael Stahl
... except in include/rtl, include/sal, include/uno, where sal_Size is retained for compatibility, and where callers of rtl functions pass in pointers that are incompatible on MSVC. Change-Id: I8344453780689f5120ba0870e44965b6d292450c
2016-09-15tdf#53856 writerfilter set parentless style based on defaultJustin Luth
docx import of base-less style "Text" was conflicting with LibreOffice's builtin "Caption"->"Text" paragraph style. This only worked when the parent .isEmpty(). Style names can use localization, so forcing the imported parent-name will not match between different language versions. Change-Id: I86d9965abb4ee90b04c713371529a679d045660c Reviewed-on: https://gerrit.libreoffice.org/28894 Reviewed-by: Justin Luth <justin_luth@sil.org> Tested-by: Justin Luth <justin_luth@sil.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2016-09-14loplugin:countusersofdefaultparams in xmloffNoel Grandin
Change-Id: Ia92a878ac97b3cc668594946e77a718f27a3e3ed Reviewed-on: https://gerrit.libreoffice.org/28890 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2016-09-14writerfilter style: use emplace_back, avoiding typedefJustin Luth
Change-Id: I106f94ad4b8c8711a563971cb43d71aa90b139f8 Reviewed-on: https://gerrit.libreoffice.org/28868 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Miklos Vajna <vmiklos@collabora.co.uk>
2016-09-13loplugin:override: No more need for the "MSVC dtor override" workaroundStephan Bergmann
The issue of 362d4f0cd4e50111edfae9d30c90602c37ed65a2 "Explicitly mark overriding destructors as 'virtual'" appears to no longer be a problem with MSVC 2013. (The little change in the rewriting code of compilerplugins/clang/override.cxx was necessary to prevent an endless loop when adding "override" to OOO_DLLPUBLIC_CHARTTOOLS virtual ~CloseableLifeTimeManager(); in chart2/source/inc/LifeTime.hxx, getting stuck in the leading OOO_DLLPUBLIC_CHARTTOOLS macro. Can't remember what that isAtEndOfImmediateMacroExpansion thing was originally necessary for, anyway.) Change-Id: I534c634504d7216b9bb632c2775c04eaf27e927e
2016-09-13loplugin:rangedforcopyStephan Bergmann
Change-Id: Ie3faef85382f7e23244e10362bfbe3469357dbfd
2016-09-13tdf#89315 writerfilter add missing parents to out-of-order stylesJustin Luth
Styles that inherit from a parent style, but were defined in style.xml before the parent, were losing their base style. Change-Id: Ic12876dddb1aa961cd8ef7579061cca30c320c71 Reviewed-on: https://gerrit.libreoffice.org/28785 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Justin Luth <justin_luth@sil.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2016-09-12tdf#86926 writerfilter prevent PROP_GRID_LINES exceptionJustin Luth
Ensure that only values accepted by MID_GRID_LINES will be inserted, otherwise an exception can be thrown. Change-Id: I7bac5d502034e073d2d9071af952639abb399c3a Reviewed-on: https://gerrit.libreoffice.org/28766 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Justin Luth <justin_luth@sil.org>
2016-09-12return earlier, no logic changeCaolán McNamara
Change-Id: I7356ead43eb1e0f673a436ecf9fec9129d0e02bd
2016-09-12fftester: no table managerCaolán McNamara
Change-Id: Icb3c640e04416f9120d37558646a570daeddf0a4 Reviewed-on: https://gerrit.libreoffice.org/28825 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2016-09-10fftester: no table managerCaolán McNamara
Change-Id: I033454670d1ee662bc80bc07578690155d97ce28 Reviewed-on: https://gerrit.libreoffice.org/28805 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2016-09-10fftester: use of deleted RTFParserStateCaolán McNamara
but we only use the RTFParserState to use its m_pDocumentImpl and the m_pDocumentImpl is never changed for the RTFParserState lifetime, so take the m_pDocumentImpl at ctor time instead and use that directly later Change-Id: I15152e3f6d9008553b4a384a5e5da21373904cc9 Reviewed-on: https://gerrit.libreoffice.org/28802 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2016-09-09tdf#86926 writerfilter allow fallback if exceptionsJustin Luth
The multiset routine was put in to increase the speed of applying properties. However, if one property causes an exception, the remaining properties are never applied. There is already a fallback routine (if the multiset can't be created), so use that instead of returning in a failed state. Change-Id: Iac53edd5fca8e8543d536609113a7b1109befd82 Reviewed-on: https://gerrit.libreoffice.org/28765 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Justin Luth <justin_luth@sil.org>
2016-09-08tdf#81345 docx import fix default page break regressionJustin Luth
"regression" from 4e653d15eff26aa5283d8ba20611893f4c573f57 If there are new style elements, then don't treat a default break in columns as a continuous break. This fixes both round-tripping, and initial import of columns and headers on this particular document. Since MS and LO treat sections so differently, it is a balancing act of what to change. Change-Id: I9c79bc1246108da6a5ebbf744acbcfcbb9d33d48 Reviewed-on: https://gerrit.libreoffice.org/28728 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Justin Luth <justin_luth@sil.org>
2016-09-07writerfilter: avoid redundant get() call on smart pointer in TableManagerMiklos Vajna
Change-Id: Ie9361fb64a199a9690e2c6bc62a891406fb8b4b9
2016-09-07rtf: throw early on a bad nestrow tokenCaolán McNamara
Change-Id: I9de8d09bce18fd1e8a145617794594a99a5f996e Reviewed-on: https://gerrit.libreoffice.org/28708 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2016-09-07rtf: don't skip backwards on skipping bin specified bytesCaolán McNamara
otherwise we could end up re-parsing the block endlessly Change-Id: Ia90a9e5b513951c91e1917483f9e030dbee98ffb Reviewed-on: https://gerrit.libreoffice.org/28707 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2016-09-06fftester: missing ValueLastCaolán McNamara
Change-Id: I8e881871b1ae4dea757263d04796779e62e168dc Reviewed-on: https://gerrit.libreoffice.org/28693 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2016-09-06if we throw in sw on HoriOrientation::NONE then don't pass it in from rtfCaolán McNamara
Change-Id: Ie01cca9b7cc432fc1fe14bb600af5083d6ca6a0d Reviewed-on: https://gerrit.libreoffice.org/28687 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2016-09-06tdf#44986 RTF import: handle \trwWidthA by faking cellsMiklos Vajna
The DOCX import handles this at a tokenizer level, so let's do the same in the RTF case as well. Change-Id: Id7ff43fa9e9bcd05b13d187623d39fb072758057 Reviewed-on: https://gerrit.libreoffice.org/28679 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
2016-09-05tdf#43157 Clean up OSL_ENSURE in FontTable.cxxdrazil
Clean up OSL_ENSURE in FontTable.cxx. Change-Id: Ibe0b58d00ac5cd63e6227f5d73e70fd1785aa694 Reviewed-on: https://gerrit.libreoffice.org/28640 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2016-09-02fftester: apparent wrong property tested for existenceCaolán McNamara
Change-Id: I5d208bb2a85d7aa4eea9b1c950eeb6f35493f759
2016-09-02tdf#62847 import image hyperlink in docxdrazil
The image hyperlink is a resource id in the document and needs to be translated into real URL. First I define a new type CT_Hyperlink_URL in the model and associate it with an action handleHyperlinkURL. In OOXMLFastContextHandlerProperties::handleHyperlinkURL I dispatch it to OOXMLHyperlinkURLHandler to translate resource id to real URL then set the PropertySet with real URL. Then the correct URL will be captured while resolving GraphicImport, which will be stored in GraphicImport_Impl::sHyperlinkURL as an OUString. Finally the property will be set in the GraphicImport::applyName if the length of the sHyperlinkURL is not 0. Also adds a test file image-hyperlink.docx and a test in ooxmlimport.cxx. Change-Id: I6194b9cc6bcc1bfaa033ab05e94836fe96e33f14 Reviewed-on: https://gerrit.libreoffice.org/28432 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2016-09-01Formatting: consistent spot for TreatSingleColumnBreakAsPageBreakJustin Luth
I failed to keep this instance in a consistent position earlier. Change-Id: I098e5e3f4c3d562d986ae9233cfd62d29fd0f4dd Reviewed-on: https://gerrit.libreoffice.org/28600 Reviewed-by: Justin Luth <justin_luth@sil.org> Tested-by: Justin Luth <justin_luth@sil.org>
2016-08-31tdf#96749: deal with missing custom headers/footers in docxJulien Nabet
Some custom headers and footers are referenced in docx but aren't present. See https://bugs.documentfoundation.org/show_bug.cgi?id=96749#c1 eg: warn:writerfilter:20417:1:writerfilter/source/filter/WriterFilter.cxx:214: WriterFilter::filter(): failed with exception Element does not exist and cannot be created: "header1.xml" See comment in bug: "The attached DOCX was generated by 1C:Enterprise -- extremely popular monopoly business CRM in Russia, with huge userbase (millions of installations)." This is apparently not a fatal condition in MS Word, so all we need to do is to return when we hit such a problem (resolveEmbeddingsStream is a recursive function). Change-Id: I0e085a5f07dc6cc044bbd713e8f81d67dbe5d8b2 Reviewed-on: https://gerrit.libreoffice.org/20993 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2016-08-31writerfilter: use sal_Size for offset values in RTFTokenizer::resolveParse()Miklos Vajna
This way nCurrentPos > (nLastPos + nPercentSize) doesn't do suboptimal add of two values, then truncate to int precision, then compare against long. Change-Id: Id2f380116a05e98fd073a58652c106bf88d13981 Reviewed-on: https://gerrit.libreoffice.org/28537 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
2016-08-30tdf#76349 writer: make 1column-as-page break a compatibility optionJustin Luth
Unable to find/create a proof .doc document, so only implementing this for .docx Change-Id: I3a0cb2ddf7b3aeecc9200e595f70d8c88af4b122 Reviewed-on: https://gerrit.libreoffice.org/28501 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Stahl <mstahl@redhat.com>
2016-08-30loplugin:stringconstant: adapt to improved OUStringLiteral1 (writerfilter)Stephan Bergmann
Change-Id: Ia156b152a5df279d879e91cc0311c2f4da27cd05
2016-08-30tdf#101589 MS import: set 1-row table to don't split if row is setJustin Luth
Since .doc and .docx don't have an option to "don't split table", we emulated that. For this IMPORT case when there is only one row, consider the entire table to be unsplitable is the row is unsplitable. This will give the expected results if the user starts adding more rows to the table. Change-Id: I8a2d817ff714ba0df65b5a5e263b27df4264e848 Reviewed-on: https://gerrit.libreoffice.org/28357 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Justin Luth <justin_luth@sil.org> Reviewed-by: Michael Stahl <mstahl@redhat.com>