summaryrefslogtreecommitdiff
path: root/writerfilter
AgeCommit message (Collapse)Author
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>
2016-08-30Related: tdf#44986 DOCX import: handle w:gridAfter by faking cellsMiklos Vajna
This is similar to the w:gridBefore handling code introduced in commit cf33af732ed0d3d553bb74636e3b14c55d44c153 (handle w:gridBefore by faking cells (fdo#38414), 2014-04-23), except that the fake cells here are inserted after the real ones, not before. Change-Id: I4c03bd49e52016a58e0e002ae85dede6a96e5f55 Reviewed-on: https://gerrit.libreoffice.org/28487 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
2016-08-30treat even/odd header/footer enabled documents the same as othersJustin Luth
This doesn't have to do with even/odd section-breaks like I originally thought, so I'm comfortable removing the fail-safe exception that I originally included. Change-Id: I3eef867d275501615a502f76b71a16e3ecc7b58e Reviewed-on: https://gerrit.libreoffice.org/28464 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Justin Luth <justin_luth@sil.org>
2016-08-27fftester: topcontext checkCaolán McNamara
Change-Id: I2045ce82a1d536ab566e6a1218bea9c6a6696024
2016-08-23Remaining clang-tidy misc-move-constructor-initStephan Bergmann
...by turning the relevant ctor parameters into "const &" (following 8f30da6386fa414b9fe4c704b294a978df77347b "Some clang-tidy misc-move-constructor-init"). Change-Id: I6686dabe2f05156d6ecd49aa76a3a1166ccac045
2016-08-18cppcheck: passedByValueCaolán McNamara
Change-Id: I3ffcfe1294a1cbb06aadd3a1a79e9259876e38cc
2016-08-17writerfilter: fix Android buildMiklos Vajna
lround() is missing in the std namespace on the broken Android toolchain, work it around. Change-Id: Ib53ace52c3a7c345de1326e3566a279f2a3f1bce
2016-08-17tdf#86087: Convert relative URLs to absolute upon import of docx etc.Stephan Bergmann
...to fix the import part of tdf#86087. Apparently, "fragment-only" relative same-document URLs (like <#anchor>) are supposed to remain relative; otherwise, various tests like testFdo69548::Import in CppunitTest_sw_ooxmlimport fail. Change-Id: I2dbba2f2f1e225f85e21600e68a3c4cffdb023b2
2016-08-17sw: use std::lround() instead of manual rounding in RTFSdrImportMiklos Vajna
Change-Id: If869c3f987996918904dca76de92d3e35789efa5
2016-08-16tdf#100507 RTF import: don't set default para style to the 0th char styleMiklos Vajna
Regression from commit 1be0a3fa9ebb22b607c54b47739d4467acfed259 (n#825305: writerfilter RTF import: override style properties like Word, 2014-06-17), the problem was that the RTF_PARD handler wanted to set a default paragraph style, but it didn't check if the 0th style is actually a paragraph one. This resulted in using a character style name as a paragraph one, throwing in SwUnoCursorHelper::SetTextFormatColl() -> all paragraph properties were lost, including the left indent. Fix this by tracking the style type, and filtering out character styles when looking up a default paragraph style. Change-Id: I41faab0e72667b89ec9a507014b395a675847abf
2016-08-15tdf#97090 writerfilter - don't fill_SOLID with auto colorJustin Luth
fixes a regression from 24077b2d52ab3d0fd0db5afb25d8b94b62386e3e <w:shd w:val="clear" w:color="auto" w:fill="auto"> seems to be the default "fill disabled" state, so don't force a solid white fill in that case. Change-Id: Ia421e52e228bbf0d3a2cd9af72e0a580042e5dcd Reviewed-on: https://gerrit.libreoffice.org/27915 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Justin Luth <justin_luth@sil.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2016-08-12loplugin:countusersofdefaultparams in vcl..xmlsecurityNoel Grandin
Change-Id: I538596a99e632178d928ff7e66ad45c71b73c6fd Reviewed-on: https://gerrit.libreoffice.org/28018 Reviewed-by: Noel Grandin <noelgrandin@gmail.com> Tested-by: Noel Grandin <noelgrandin@gmail.com>
2016-08-11loplugin:constantparamNoel Grandin
Change-Id: Ia06b9b189033b9409d7a59a211866f66a0614886 Reviewed-on: https://gerrit.libreoffice.org/28016 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-08-07fftester: guard against empty table manager stackCaolán McNamara
Change-Id: Ibb4cadb58aa17eacfc9741f7f13c780be347cd8b
2016-08-04tdf#78506 RTF import: fix handling of invalid \levelnumbersMiklos Vajna
In case ';' is written in \u form in \levelnumbers, then Word ignores the whole \levelnumbers contents, do the same. Change-Id: I93ce5810af2b5ed703e804199c0b236d2c4c36b5 Reviewed-on: https://gerrit.libreoffice.org/27869 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
2016-08-02fftester: guard against no drawing object property setCaolán McNamara
Change-Id: I51736459f9f098d9d793bff3b9a1a403962e099d
2016-08-01sw, writerfilter: fix indentationMiklos Vajna
These files had a consistent style before, keep it that way. Change-Id: I325e13e402abb01c347d1185b85468f23a18bba3 Reviewed-on: https://gerrit.libreoffice.org/27773 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
2016-07-31fftester: another table manager stack checksCaolán McNamara
and a m_xTextFactory check too Change-Id: I9352410c42048b4dd7d6dbc3514351ab8f16790b
2016-07-30fftester: context stack checkCaolán McNamara
Change-Id: I4a135a9f9ac2f16f9dab096f5c234ff1d6e5e853
2016-07-30docx - inherit FollowPage before FirstPageJustin Luth
GetPageStyle(bTitlePage == true) will check if the follow exists. If not, it will create a new style - which defeats the purpose of inheriting from the previous section if this section didn't define a new follow. Change-Id: I235bc9b7bc35c9875295733313a6452ba8896c4f Reviewed-on: https://gerrit.libreoffice.org/27700 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Justin Luth <justin_luth@sil.org>
2016-07-29fftester: some more table manager stack checksCaolán McNamara
Change-Id: Ic8dd72da175fee656889910b55d31ea161b944cc
2016-07-29fftester: another empty table manager stackCaolán McNamara
Change-Id: If3148cb6e16cff4aad28c4f86467c66ed04bcd05
2016-07-29fftester: another null DestinationTextCaolán McNamara
Change-Id: I84bf3788ac092c491d7c5a9f86421f1cf9f3e814
2016-07-29fftester: null DestinationTextCaolán McNamara
Change-Id: Icdd71733c4e9f4b36e6e957e4dea772087890faa
2016-07-28fftester: throw on empty stack accessCaolán McNamara
rather than spend the rest of my life protecting each one Change-Id: I181df33b052a0303f072ce0252d98562231569e2
2016-07-28Related: tdf#75757 remove inheritance from std::dequeCaolán McNamara
Change-Id: Ia50ea146052c2014ea16474186e2d15ce93581c1
2016-07-28fftester: empty states stackCaolán McNamara
Change-Id: I05dfffced9a8677650a46b43f65a29e9b21c5524
2016-07-28fftester: empty table manager stackCaolán McNamara
Change-Id: Ia7f7ace8130d5dfe290207e0cd3d2e6a43b8ab46
2016-07-28tdf#99434 docx enable docprotection only when enforcedJustin Luth
Change-Id: I9454a34d7b386acffc50e74d5ef6eed1966d572a Reviewed-on: https://gerrit.libreoffice.org/27456 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Justin Luth <justin_luth@sil.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2016-07-27tdf#75573 - docx don't remove frame anchor paragraphJustin Luth
frames anchor to the following paragraph. Don't remove an empty paragraph if it follows a frame or else the frame will jump to the next page. This gets a bit complicated because headers/footers contain paragraphs that aren't really "following" the frame paragraph, and so wouldn't be used as anchor paragraphs. There may be similar sub-paragraphs for comments etc, but exceptions for those can be added when proof documents are found. Change-Id: I46988b40abe65e23a5c407dde38a951937978005 Reviewed-on: https://gerrit.libreoffice.org/27455 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Justin Luth <justin_luth@sil.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2016-07-27improve passstuffbyref return analysisNoel Grandin
Change-Id: I4258bcc97273d8bb7a8c4879fac02a427f76e18c Reviewed-on: https://gerrit.libreoffice.org/27317 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-07-26tdf#75573 allow style to define vAnchorJustin Luth
If the default property value is valid, a style is never able to override. oddball default caused by commit 20c1a485774c7586401f6c1821c52f0bc39cb84a Rüdiger Timm <rt@openoffice.org> 2008-04-18 11:36:12 (GMT) INTEGRATION: CWS xmlfilter04 (1.22.14); FILE MERGED 2008/03/05 11:07:44 os 1.22.14.3: default vAnchor changed Change-Id: I665b52ae75a9282d51c79f3351315cf3fed4776c Reviewed-on: https://gerrit.libreoffice.org/27454 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Justin Luth <justin_luth@sil.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2016-07-25tdf#75573 - docx handle frame properties at stylesJustin Luth
A frame with only a style defined doesn't create paragraph properties, so the settings were just being ignored. If the stylesheet is the top context, then the settings belong to the style. If this slightly aggressive approach causes a regression, then just use the style only if the paragraph properties don't exist. Change-Id: I3b14205dc2bc5305f1eeb4cb72a812e877b532c7 Reviewed-on: https://gerrit.libreoffice.org/27453 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Justin Luth <justin_luth@sil.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2016-07-18protect against empty m_aTableManagers stackCaolán McNamara
Change-Id: I29fecc5e0efb3b3d907f0c6505d42818fa464ffc
2016-07-15writerfilter: avoid inclusion of deprecated C++ headerMiklos Vajna
Change-Id: I2eb6dd36a51ffc2c48e5f4951fd6250e12e9aad3