summaryrefslogtreecommitdiff
path: root/writerfilter
AgeCommit message (Collapse)AuthorFilesLines
2016-09-02fftester: apparent wrong property tested for existenceCaolán McNamara2-1/+1
Change-Id: I5d208bb2a85d7aa4eea9b1c950eeb6f35493f759
2016-09-02tdf#62847 import image hyperlink in docxdrazil7-3/+75
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 Luth1-1/+1
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 Nabet2-11/+38
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 Vajna1-2/+2
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 Luth1-0/+1
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 Bergmann1-2/+1
Change-Id: Ia156b152a5df279d879e91cc0311c2f4da27cd05
2016-08-30tdf#101589 MS import: set 1-row table to don't split if row is setJustin Luth3-0/+15
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 Vajna4-4/+33
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 Luth1-24/+0
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 McNamara2-1/+2
Change-Id: I2045ce82a1d536ab566e6a1218bea9c6a6696024
2016-08-23Remaining clang-tidy misc-move-constructor-initStephan Bergmann8-8/+8
...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 McNamara2-8/+7
Change-Id: I3ffcfe1294a1cbb06aadd3a1a79e9259876e38cc
2016-08-17writerfilter: fix Android buildMiklos Vajna1-0/+11
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 Bergmann2-0/+23
...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 Vajna1-3/+4
Change-Id: If869c3f987996918904dca76de92d3e35789efa5
2016-08-16tdf#100507 RTF import: don't set default para style to the 0th char styleMiklos Vajna3-2/+24
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 Luth2-1/+9
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 Grandin1-1/+1
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 Grandin1-7/+5
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 McNamara2-3/+1
Change-Id: Ibb4cadb58aa17eacfc9741f7f13c780be347cd8b
2016-08-04tdf#78506 RTF import: fix handling of invalid \levelnumbersMiklos Vajna3-2/+23
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 McNamara2-1/+1
Change-Id: I51736459f9f098d9d793bff3b9a1a403962e099d
2016-08-01sw, writerfilter: fix indentationMiklos Vajna1-1/+1
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 McNamara2-2/+2
and a m_xTextFactory check too Change-Id: I9352410c42048b4dd7d6dbc3514351ab8f16790b
2016-07-30fftester: context stack checkCaolán McNamara2-3/+4
Change-Id: I4a135a9f9ac2f16f9dab096f5c234ff1d6e5e853
2016-07-30docx - inherit FollowPage before FirstPageJustin Luth1-10/+11
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 McNamara2-3/+3
Change-Id: Ic8dd72da175fee656889910b55d31ea161b944cc
2016-07-29fftester: another empty table manager stackCaolán McNamara3-3/+7
Change-Id: If3148cb6e16cff4aad28c4f86467c66ed04bcd05
2016-07-29fftester: another null DestinationTextCaolán McNamara3-19/+20
Change-Id: I84bf3788ac092c491d7c5a9f86421f1cf9f3e814
2016-07-29fftester: null DestinationTextCaolán McNamara3-3/+9
Change-Id: Icdd71733c4e9f4b36e6e957e4dea772087890faa
2016-07-28fftester: throw on empty stack accessCaolán McNamara5-2/+9
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 McNamara1-4/+23
Change-Id: Ia50ea146052c2014ea16474186e2d15ce93581c1
2016-07-28fftester: empty states stackCaolán McNamara2-0/+2
Change-Id: I05dfffced9a8677650a46b43f65a29e9b21c5524
2016-07-28fftester: empty table manager stackCaolán McNamara2-0/+3
Change-Id: Ia7f7ace8130d5dfe290207e0cd3d2e6a43b8ab46
2016-07-28tdf#99434 docx enable docprotection only when enforcedJustin Luth1-2/+5
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 Luth3-1/+18
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 Grandin10-27/+27
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 Luth1-2/+2
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 Luth1-6/+7
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 McNamara3-10/+19
Change-Id: I29fecc5e0efb3b3d907f0c6505d42818fa464ffc
2016-07-15writerfilter: avoid inclusion of deprecated C++ headerMiklos Vajna1-2/+2
Change-Id: I2eb6dd36a51ffc2c48e5f4951fd6250e12e9aad3
2016-07-12tdf75573 docx - complete frames before starting alternate streamsJustin Luth1-0/+4
An unused odd header was set to be discarded. The handling of unregistered frames occurred at the same time, and thus ended up being discarded as well. Since a frame shouldn't encompass both the alternate stream and the current stream, finalize any unfinished frames first. Change-Id: Ie9123769724da461dd265936aa6b97de7f4dfbbc Reviewed-on: https://gerrit.libreoffice.org/26972 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2016-07-08tdf#64372 docx import: don't ignore continuous section breakJustin Luth1-10/+2
If the previous break was also a continuous section break, this break was simply ignored ever since commit 1fdd61db155cf63d5dd55cc2bfb45af33796e131. Thus, the default handler took over and assigned PROP_PAGE_DESC if there was some kind of page style known (either the first page/Standard defaults or any "converted" styles that had been created) which effectively became a new page break. Change-Id: I839570b0330ba274552cc671014e997c42765f4b Reviewed-on: https://gerrit.libreoffice.org/26567 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Justin Luth <justin_luth@sil.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2016-07-07loplugin:passstuffbyref also for {css::uno,rtl}::ReferenceStephan Bergmann9-16/+16
Change-Id: I0add8faa004c14226ef76125a55dc9e82b37a488
2016-07-07loplugin:passstuffbyrefStephan Bergmann1-1/+1
Change-Id: I2793583f70057df36045505e318be7fc379aedaa
2016-07-07tdf#95367 inherit page style if no new one importedJustin Luth2-35/+95
CopyLastHeaderFooter doesn't do much good if the previous section has blank stylenames. (usually because of continuous section breaks). Change-Id: Ida1e42ab0b650c7c43f06539b3cc058fe5c27919 Reviewed-on: https://gerrit.libreoffice.org/26911 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Justin Luth <justin_luth@sil.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2016-07-05Resolves: tdf#100770 crash on loading specific docxCaolán McNamara1-2/+9
use same safeguards as RemoveLastParagraph does Change-Id: I43ed4eb28f44654054fd266bc464840af7014fea
2016-07-04tdf#96750 docx - ensure all styles are initializedJustin Luth2-6/+12
Change-Id: I50467cb2798ef81dd89006768c66aa7e93cb411c Reviewed-on: https://gerrit.libreoffice.org/26892 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Justin Luth <justin_luth@sil.org>
2016-06-29tdf#90697 docx - don't change continuous break into page breakJustin Luth1-1/+3
As soon as you set PROP_PAGE_DESC_NAME, you are inserting that style as a page break. Setting a pagebreak via a continous break was first introduced in commit 50cb1667020494906afaacb68d4163d1eda527cf but the unittest for that commit no longer uses this code. I'm suggesting it be reverted. It really messes up round-tripping when continuous breaks are removed/replaced with hard page breaks. There are a few odd cases where the very first section needs to set the page break via the continuous break, so it hasn't been eliminated completely. Change-Id: I5b0e4bb7612ee9df47e5c49b8c2316dc001b5238 Reviewed-on: https://gerrit.libreoffice.org/26662 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>