summaryrefslogtreecommitdiff
path: root/writerfilter
AgeCommit message (Collapse)Author
2014-05-01actually read brightness/contrast when reading docx (bnc#875713)Luboš Luňák
It's read for the shape in oox/ , but it didn't make it any further apparently. Change-Id: I0885a675f72d63b3d262f1ef7e42f5d2e03588b6 (cherry picked from commit 804da2a977989ba1f046847b9e00f00c83749e30) Reviewed-on: https://gerrit.libreoffice.org/9216 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2014-04-30fdo#70853 writerfilter: refactor to avoid redundant Papx class in doctokMiklos Vajna
(cherry picked from commit f453cf1d328f96dd5ad8e94b102bff3124e06154, but only the rtftok part, the rest is not needed to fix the bug) Conflicts: writerfilter/source/dmapper/DomainMapper.cxx writerfilter/source/dmapper/StyleSheetTable.cxx writerfilter/source/doctok/resources.xmi writerfilter/source/rtftok/rtfdocumentimpl.cxx Change-Id: Ic65e750bab99fb6b4c862418ccc53aa4b1f1298e Reviewed-on: https://gerrit.libreoffice.org/9173 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2014-04-30Resolves: rhbz#1089377 crash on loading a specific rtfCaolán McNamara
(cherry picked from commit 5aeaba2e6592dab0404301dcef644144f82ffcbf) Change-Id: I26864f3a2247f5d7184f395cfed91eaf92e36295 Reviewed-on: https://gerrit.libreoffice.org/9131 Tested-by: David Tardon <dtardon@redhat.com> Reviewed-by: David Tardon <dtardon@redhat.com>
2014-04-29123792: complete annotations on text ranges featureOliver-Rainer Wittmann
- rely annotations on text ranges on new annotation marks - support arbitrary text ranges for annotations - fix undo/redo regarding annotations an text ranges - support annotations on overlapping text ranges - fix *.docx import for annotations on overlapping text ranges - fix ODF import of annotations on text ranges cherry-picked from branch ooxml-osba (cherry picked from commit ebd2922ebd3cf2d3899fb80780d38f367197aadf) Conflicts: sw/Library_sw.mk sw/inc/IDocumentMarkAccess.hxx sw/inc/SidebarWin.hxx sw/inc/doc.hxx sw/inc/docufld.hxx sw/inc/hintids.hxx sw/inc/ndhints.hxx sw/inc/txatbase.hxx sw/inc/unobookmark.hxx sw/inc/unofield.hxx sw/inc/unoport.hxx sw/source/core/access/accpara.cxx sw/source/core/bastyp/init.cxx sw/source/core/crsr/bookmrk.cxx sw/source/core/crsr/findtxt.cxx sw/source/core/doc/dbgoutsw.cxx sw/source/core/doc/docbm.cxx sw/source/core/doc/doccorr.cxx sw/source/core/doc/docdde.cxx sw/source/core/doc/docedt.cxx sw/source/core/doc/docfld.cxx sw/source/core/doc/doclay.cxx sw/source/core/doc/tblrwcl.cxx sw/source/core/docnode/ndcopy.cxx sw/source/core/docnode/nodes.cxx sw/source/core/docnode/section.cxx sw/source/core/edit/edfld.cxx sw/source/core/fields/docufld.cxx sw/source/core/fields/postithelper.cxx sw/source/core/fields/reffld.cxx sw/source/core/inc/MarkManager.hxx sw/source/core/inc/crossrefbookmark.hxx sw/source/core/text/inftxt.cxx sw/source/core/text/itratr.cxx sw/source/core/text/txtfrm.cxx sw/source/core/txtnode/atrfld.cxx sw/source/core/txtnode/ndtxt.cxx sw/source/core/txtnode/thints.cxx sw/source/core/undo/undel.cxx sw/source/core/undo/undobj.cxx sw/source/core/unocore/unofield.cxx sw/source/core/unocore/unoport.cxx sw/source/core/unocore/unoportenum.cxx sw/source/filter/html/htmlatr.cxx sw/source/filter/html/htmlgrin.cxx sw/source/filter/html/wrthtml.cxx sw/source/filter/writer/writer.cxx sw/source/filter/ww1/fltshell.cxx sw/source/filter/ww8/wrtw8nds.cxx sw/source/filter/ww8/ww8par.cxx sw/source/ui/dialog/uiregionsw.cxx sw/source/ui/dochdl/swdtflvr.cxx sw/source/ui/docvw/PostItMgr.cxx sw/source/ui/docvw/SidebarWin.cxx sw/source/ui/fldui/fldmgr.cxx sw/source/ui/fldui/fldref.cxx sw/source/ui/inc/fldmgr.hxx sw/source/ui/inc/wrtsh.hxx sw/source/ui/shells/textfld.cxx sw/source/ui/uiview/view2.cxx sw/source/ui/utlui/navipi.cxx sw/source/ui/wrtsh/wrtsh2.cxx writerfilter/source/dmapper/DomainMapper_Impl.cxx writerfilter/source/dmapper/DomainMapper_Impl.hxx writerfilter/source/dmapper/PropertyMap.cxx xmloff/inc/txtfldi.hxx xmloff/source/text/txtfldi.cxx xmloff/source/text/txtparae.cxx (cherry picked from commit 0761f81643a6890457e9ef7d913ab5c88c2593a4) Conflicts: sw/source/core/access/accpara.cxx sw/source/core/fields/reffld.cxx sw/source/core/text/txtfrm.cxx sw/source/core/txtnode/modeltoviewhelper.cxx sw/source/core/txtnode/thints.cxx sw/source/core/unocore/unoportenum.cxx writerfilter/source/dmapper/DomainMapper_Impl.cxx Change-Id: Ie4cc467dbb837054c73742262ee20f35c151ff3f
2014-04-22handle properly page breaks even if a page contains only a frame (fdo#55381)Luboš Luňák
The test document has 4 pages which only contain frames, first 3 pages (sections) have <p> block with <framePr> and another <p> with just <sectPr>, and the second paragraph would be removed, thus there would be no nodes on which to actually set the page style and they would be set on nodes for the previous page, overwriting its page style. The last page does not have its own <p> at all, so it needs to be faked. The changes in finishParagraph() are because of e.g. the comments-nested.odt sw test, which there causes exception because of unknown property ParaStyleName (comments do not use those it seems) and the code is skipped over (which is probably a bug on its own, but it's unrelated to this change otherwise). Change-Id: I9d37f992407a9b649c710d2a031ec4447fb11771
2014-04-22fdo#75735 RTF import: fix COW when writing a nested structureMiklos Vajna
Regression from a48e2fd9049797110b3b2505c363557284987ca8 (fdo#44736 - convert RTFSprms to a copy-on-write structure., 2012-12-07) (cherry picked from commit 6b6e4d471c2954d34d280398ed1c986d7fb27ae1) Conflicts: writerfilter/source/rtftok/rtfsprm.hxx Change-Id: I2538f440e29cef6d40db2ea914e4afcbfe411890 Reviewed-on: https://gerrit.libreoffice.org/9100 Tested-by: David Tardon <dtardon@redhat.com> Reviewed-by: David Tardon <dtardon@redhat.com>
2014-04-16fdo#77267 RTF import: pard should reset current paragraph styleMiklos Vajna
Change-Id: I8d78ce262a4e57161325231a78e48750909b1bad (cherry picked from commit 904630a2272ac4dd540939f8a462bff5d636f066) Reviewed-on: https://gerrit.libreoffice.org/9055 Tested-by: Michael Stahl <mstahl@redhat.com> Reviewed-by: Michael Stahl <mstahl@redhat.com>
2014-04-16fdo#74599 RTF import: enable StylesNoDefault compat settingMiklos Vajna
The Writer 'Heading 3' paragraph style is gray by default, but (just like in case of DOCX) that shouldn't have any influence on the RTF import result. Fix this by moving the compat setting from the DOCX filter implementation to the common dmapper. Change-Id: I86c7cf1a66f82b438ce8379467773a88c9e229af (cherry picked from commit 2df53ef5002270bfe788e383e95002f636a242d9) Reviewed-on: https://gerrit.libreoffice.org/8945 Tested-by: Michael Stahl <mstahl@redhat.com> Reviewed-by: Michael Stahl <mstahl@redhat.com>
2014-04-16check that stacks are not empty before top()Caolán McNamara
Change-Id: Iad5b3381b8201c5ac32a5bdf99bd3d5872ea3afc (cherry picked from commit a1ea3838adee634ccf725bc5f2be7805c6294a16) Reviewed-on: https://gerrit.libreoffice.org/8932 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Miklos Vajna <vmiklos@collabora.co.uk>
2014-04-08fdo#74823 RTF import: work around wrong table column width on invalid inputMiklos Vajna
This scenario is not a valid one, Word doesn't handle it, either -- but the old LO 3.4 parser did. So add minimal support for it to avoid the regression. (cherry picked from commit 0a215b9a980e68f899ad548f780bbe5a1fec8732) Conflicts: sw/qa/extras/rtfimport/rtfimport.cxx Change-Id: Icc2e8d3bf314e9cadda57956668033aa6d092457 Reviewed-on: https://gerrit.libreoffice.org/8871 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2014-04-02apparently some table .docx properties shouldn't be < 0Luboš Luňák
Somewhat related to 10b4da63e3143108ba75891e9e98fdaa2f7953ab , a similar doc has negative value inside w:tblCellMar, which MSO seems to ignore (altering the value has no visible effect), so ignore it as well. Change-Id: I846e9b55fea0d4e66f03ce615584516360b8b7dd Reviewed-on: https://gerrit.libreoffice.org/8764 Reviewed-by: Tor Lillqvist <tml@collabora.com> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Miklos Vajna <vmiklos@collabora.co.uk>
2014-04-02Revert "rhbz#1075124: writerfilter: fix tables with negative left margin"Luboš Luňák
It appears that this was just a workaround that incidentally worked. Making the negative value even larger (in abs value) doesn't seem to make a difference for MSO, but LO fails again. A proper fix (better workaround?) will follow. This reverts commit 2e558f32ef79948858723b9781fbd388850b462b. Change-Id: I56fd5e9d7ce9aa178f7e508f8e7ac3bc0ff2b971 Reviewed-on: https://gerrit.libreoffice.org/8763 Reviewed-by: Tor Lillqvist <tml@collabora.com> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Miklos Vajna <vmiklos@collabora.co.uk>
2014-04-02Resolves: rhbz#1077780 crash on loading .docxCaolán McNamara
Change-Id: I92670b9c46a2c745ba47c6dcc1b4dd672942cf59 Reviewed-on: https://gerrit.libreoffice.org/8742 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Miklos Vajna <vmiklos@collabora.co.uk>
2014-03-25coverity#736084 Missing break in switchCaolán McNamara
Change-Id: I3c7a032441402455d0a6ed28fc2cd5ce958ead04 (cherry picked from commit 5c291a0287af46558d3ef96d18b114c371ddd31b) Reviewed-on: https://gerrit.libreoffice.org/8690 Reviewed-by: Matúš Kukan <matus.kukan@collabora.com> Tested-by: Matúš Kukan <matus.kukan@collabora.com>
2014-03-25Don't duplicate relationship sequences while walking them.Michael Meeks
Change-Id: If938f2f401af82d5d0122cbd0a78214829d1277c Reviewed-on: https://gerrit.libreoffice.org/8685 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2014-03-25RTF import: 3 drawing-object fixes:Miklos Vajna
This bring back the fdo#fdo42407 bugdoc to the state where it was around 4.0. - fix dobxpage before dptxbx The problem was that dobxpage arrived first, set HoriOrientRelation to FRAME, then dptxbx tried to apply defaults, which overwrote the already set HoriOrientRelation. Fix this by only applying properties which are not set yet. (cherry picked from commit 7c53577f325e5260c538f9ca42cda54ca1a24b7a) - anchor drawing objects at-character by default (cherry picked from commit d05b67a7b9448c67c3a923ecb33dac74b52dd192) - fix ordering of old-style dhght in case of equal values Commit 1eaab77c718ffa254068ae6032862dfb5a03db67 (fdo#60722 import RTF_SHPZ, 2013-03-06) changed how we handle z-order, in case two shapes have the same value. Turns out for drawing-objects the order is the opposite in this situation. So fix this by adding a new mode, that keeps the original testcase happy without breaking older documents. (cherry picked from commit e4fe3610eb17c441217c80536f0acf4123abd683) Change-Id: Ib2d284cefc3c0dce40ac2e516ba260d6cd04ce43 Reviewed-on: https://gerrit.libreoffice.org/8621 Reviewed-by: Andras Timar <andras.timar@collabora.com> Tested-by: Andras Timar <andras.timar@collabora.com>
2014-03-25fdo#69289 RTF import: handle cells with zero widthMiklos Vajna
Change-Id: I31b12a5afa5d501d57b56f515ee1d2fd46a09b32 (cherry picked from commit 3e2cda224e4119b31d85263ff16a383e693dcbbd) Reviewed-on: https://gerrit.libreoffice.org/8585 Tested-by: Caolán McNamara <caolanm@redhat.com> Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2014-03-25bnc#865381 DOCX import: table cell btLr text direction fixesMiklos Vajna
(cherry picked from commit 48b5b7641d0df960558082e8948da8598f801264) (cherry picked from commit 970160f78ef6cc7abacfa252daa8451e1f0117bb) Change-Id: I527955671e1100f05da717bffe002131baaf0291 Reviewed-on: https://gerrit.libreoffice.org/8553 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2014-03-25ignore large twips values like MSO does (cp#1000043)Luboš Luňák
(cherry picked from commit 10b4da63e3143108ba75891e9e98fdaa2f7953ab) Reviewed on: https://gerrit.libreoffice.org/8550 Change-Id: Ib304245b6ae64c15cfb6c999580f73e5e228c440
2014-03-25rhbz#1075124: writerfilter: fix tables with negative left marginMichael Stahl
SvxBoxItem::nLeftDist is unsigned; the bugdoc sets a very large value due to wrap-around which causes the table content not to be displayed. DomainMapperTableHandler::endTableGetTableStyle() tweaks the rInfo.nLeftBorderDistance by adding half the border line width to it, which makes it positive; at that point the value has already been used to init table::TableBorderDistances, so move that downward so it gets the positive value too. Change-Id: Ied2331b93f2e95845d7e8b2cc06e89e1ab24296e (cherry picked from commit 76aa23c59b4c81ea7b9d974a1a0a9e39c6bf8741) Reviewed-on: https://gerrit.libreoffice.org/8537 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2014-03-25writerfilter: initial strict DOCX supportMiklos Vajna
The generate-id() code is just necessary avoid duplicated elements in the for-each loop. http://mahahegde.com/xslt-distinct-values/ has a detailed description of the technique used here. (cherry picked from commit f9bf15e19ec823a58ee32bf94da81f3bb1a147bc) writerfilter: introduce ooxml::OOXMLUniversalMeasureValue In transitional DOCX, ST_UniversalMeasure is in practice a simple integer, which means twips. But in case of strict, ST_UniversalMeasure is in points in practice -- which is perfectly valid, but we didn't handle it so far. Add a separate Value class that is used only for handling ST_UniversalMeasure, then there we can handle the various additional suffixes. (cherry picked from commit d5d7c7d3b281e1a9060d60bc4ac7738ae616f167) DOCX import: handle points in ST_TwipsMeasure and ST_SignedTwipsMeasure This fixes page size and margins in case of strict DOCX. (cherry picked from commit 37cc7e7471ba3b11cefcb0218c27e2c745886a6d) DOCX strict import: fix headers Now that the document has a header, better to just test the bottom margin, as in case there is a header, the top margin has different semantics in Word and Writer. (cherry picked from commit 195b8491d0299038fb64d19463e3ce90905bf346) DOCX strict import: fix pictures as well (cherry picked from commit aaef39de32442203d631a65aecf23eeb27dfbb12) DOCX strict import: handle charts (cherry picked from commit 49c3aff8d8d3030b2acbffb6ff000b5d44445cc9) DOCX strict import: handle SmartArt (cherry picked from commit f5985685ddc519f760a7324fa60fd662f25404c1) DOCX strict import: handle lockedCanvas (cherry picked from commit d795fb224e52c66c4585ed1e079a2b7601a07eda) DOCX strict import: handle math (cherry picked from commit c98d649117dc776ac51807be3376924d1fce2035) Conflicts: sw/qa/extras/ooxmlimport/ooxmlimport.cxx Change-Id: I647efe9d4a0834d3756fe9fa6d706ba6ba4e00f1 Reviewed-on: https://gerrit.libreoffice.org/8532 Tested-by: Markus Mohrhard <markus.mohrhard@googlemail.com> Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
2014-03-25handle OOXML strict namespacesMarkus Mohrhard
Change-Id: I198862388426161e3f054a5f128639c59f3c9d24 support OOXML strict documents in Calc Conflicts: oox/source/core/relations.cxx Change-Id: I277d76aeec28e173d913ccc1506464afe4d09c6d import date cells from OOXML Change-Id: Id0b9ec034d559d489ca4ee2d1d6aca1bdf1beb9d no need to add another layer of macros Change-Id: I49992559a7d10127d55dbf0c7e257c86619fd8d6 fix one more relation type for OOXML strict Change-Id: Ia63309271ac225883540ca0453fc5da21844d3ad make more places aware of OOXML strict relations Change-Id: I292217537eb592cbad9af11f87402baa9f4cc442 fix strict namespace list generation The two perl scripts were apparently only generating the same order by luck. It did not work on all systems. Change-Id: Ib83ee5c6572d3bae2e2ac1846850bd65303e7d43 allow OOXML strict relationships in writer Conflicts: writerfilter/source/ooxml/OOXMLDocumentImpl.cxx writerfilter/source/ooxml/OOXMLStreamImpl.cxx Change-Id: I1c09280f68467748faedee19c4a66be3bc7d7aa3 make sure the two namespace lists are sorted the same way Change-Id: I90b3182e10dbbfc8993010dd885509537d2fe537 fix OOXML strict chart import Change-Id: I84a2fd575ced64d4774147063f13ebb8605c100f add the xml strict namespaces to misc/namespaces.txt Change-Id: Ie83b5c94f1f002851bff3b39b1d9b676a3e44aa1 Reviewed-on: https://gerrit.libreoffice.org/8515 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Miklos Vajna <vmiklos@collabora.co.uk>
2014-03-25rhbz#988516: DOCX import: fix context stack when importing header/footerMichael Stahl
When a header/footer substream is parsed, a ParagraphGroup is started, but not ended; so the properties of the last paragraph in the header/footer are applied to a paragraph in the body. The obvious fix to add a call to endParagraphGroup() at the end of w:p element breaks table cells. So add a call to endParagraphGroup() at the end of the "hdr"/"ftr" element. (The problem in the bugdoc became much more visible with commit ca555c596043c88894b964ac5e21f5a7271d5f3b, but was there before) Change-Id: Ib054f1882793049b39424c1076ba5d4b319cd027 (cherry picked from commit 2b78f2cd7b9e4bab0f3b3b9119238f36a1bbc7b2) Reviewed-on: https://gerrit.libreoffice.org/8477 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Miklos Vajna <vmiklos@collabora.co.uk>
2014-03-05fdo#47811: RTF import: fix Database field contentMichael Stahl
1. the Database field master does not have a "Content" property 2. SetFieldContent was called once for every chunk of text in the field result, always overwriting the previous value; accumulate the text. Change-Id: I63cfda19e2e416c52d100d9071796305a5d813c6 (cherry picked from commit e24ae38c8ef233e4b44840058e35959194724743) Reviewed-on: https://gerrit.libreoffice.org/8442 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Miklos Vajna <vmiklos@collabora.co.uk>
2014-03-05writerfilter: salvage a field parameter parsing train wreckMichael Stahl
Field parameters get horribly maimed by lcl_ExtractParameter which clearly has never worked in its 7 years of existence (and looking at the inanity at the call sites makes one wonder what the author was smoking). The format is actually quite annoying, since spaces between parameters are optional. The old RTF filter was at least able to parse "PAGEREF bookmark" fields, so this fixes such regressions (related: rhbz#1065629). (cherry picked from commit 3dc548476c7e88f7a67cc38daf622631a34e34dd) Conflicts: writerfilter/source/dmapper/DomainMapper_Impl.cxx Change-Id: I9b2e32c3c7264be0fc1077cb8fb3f1bc5c1955bb Reviewed-on: https://gerrit.libreoffice.org/8440 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Miklos Vajna <vmiklos@collabora.co.uk>
2014-03-03RTF import: fix spurious page breaks at doc end (related: rhbz#1065629)cp-4.2-branch-pointMichael Stahl
When a document ends with \sect it's possible that a spurious page break is created. In fact the spurious page break is always created by the RTF importer, sometimes it is deleted again by DomainMapper_Impl::RemoveLastParagraph() and sometimes not. It is created because on the final \sect RTFDocumentImpl::sectBreak() still calls startSectionGroup(), and the popState() for the \rtf1 group then calls sectBreak() another time. To prevent this, do not call startSectionGroup() from sectBreak() but instead from setNeedSect(), and ensure that it is called as soon as anything after \sect is read. One unit test fails because the \page is not handled properly: the conversion to \skbpage \sect \skbnone is not correct, because the \skb* keywords are an exception and affect the \sect that precedes them, not the following one; sending the \skbpage later unfortunately requires additional cleanup later. (cherry picked from commit e3f254ab8211fbab7541cde2100a35c875b0c240) RTF import: add unit test for page break in continuous section (cherry picked from commit f03218f43e8c25c2e136d364455f3cdaf95362b6) RTF import: fix paragraphs in header/footer (cherry picked from commit 74b3f4f00766d199df3b017d056cf7a00ae52988) Change-Id: I3c1a3bceb2c8b75bbecdc748170562451ce5f5c3 Reviewed-on: https://gerrit.libreoffice.org/8439 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Miklos Vajna <vmiklos@collabora.co.uk>
2014-02-25writerfilter: attempt to appease Mac tinderboxesMichael Stahl
Change-Id: I014f71642f275716c8ebe7a471bf211c342145fb (cherry picked from commit f7e1e0243318743f18b6cc6a87b7307e357f953f)
2014-02-25Related: #i124106# correct handling of page break attributesOliver-Rainer Wittmann
i.e. those which are providing the default value explicitly (cherry picked from commit 5a15ef3da683566d7bd443f96eeec3a9a3f70aeb) Conflicts: writerfilter/source/dmapper/DomainMapper.cxx writerfilter/source/dmapper/PropertyMap.cxx (cherry picked from commit c30fb7d7269b5bdd1853ac22120f57aa2bfd13a5) Conflicts: writerfilter/source/dmapper/DomainMapper.cxx Change-Id: Ib8721f2fce060d26ee75b0515b3bf62a603fd40c Signed-off-by: Miklos Vajna <vmiklos@collabora.co.uk>
2014-02-25RTFSdrImport::resolveDhgt(): fix crashing C-castMichael Stahl
Inside DomainMapper::graphicZOrderHelper() this is offset by 0x40 so whatever that cast does, it's doing it wrong. Change-Id: Ie48467c12828137a521cba47c2e04cac65201d1d (cherry picked from commit 8dcb56fdcea455012ef010c343ab036955678f4d) Reviewed-on: https://gerrit.libreoffice.org/8222 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Miklos Vajna <vmiklos@collabora.co.uk>
2014-02-25rhbz#1065629: RTF import: re-implement nested tablesMichael Stahl
The previous fix for this bug only fixed a symptom, this a fix for the real problem; with the real problem fixed the nCellEnds is unnecessary. Given that top-level table properties may be put either before or after the table cells, the only way that works to import tables is to buffer a whole top-level table row, but currently the buffer is replayed already at the end of a nested table row. Fortunately the RTF spec guarantees that \nesttableprops must occur after the nested table cells of the nested row, so it should be sufficient to remember the cell properties for the current nested table row only, in addition to the cell properties for the top-level table row. With this change, skipping a \nesttableprops destination when there is a table style turns out to mangle ooo98040-1.rtf badly, so stop doing that workaround. RTFDocumentImpl::popState() was copying various buffers up the state stack which is a clear indication that these shouldn't be members of RTFParserState in the first place, move them to RTFDocumentImpl. (cherry picked from commit c8f83ce1dbf5544f6aaa91775db6820a69c3c061) Conflicts: writerfilter/source/rtftok/rtfdocumentimpl.cxx Change-Id: Ic2d8f7b3e00844b224d61605b405ca651239e5f7 Reviewed-on: https://gerrit.libreoffice.org/8221 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Miklos Vajna <vmiklos@collabora.co.uk>
2014-02-25Fix a crash from crashtestJulien Nabet
4 0x00002aaaaad1b3ab in rtl_uString_newFromSubString (ppThis=0x7ffffffeba48, pFrom=0x2aaaaad4236c <aImplEmpty_rtl_uString>, beginIndex=1, count=-2) at /home/julien/compile-libreoffice/libo/sal/rtl/strtmpl.cxx:1231 5 0x00002aaaec13e2b1 in rtl::OUString::copy (this=0x7ffffffebed0, beginIndex=1, count=-2) at /home/julien/compile-libreoffice/libo/include/rtl/ustring.hxx:1483 6 0x00002aaaec1717e3 in writerfilter::rtftok::RTFSdrImport::resolve (this=0x1aa4710, rShape=..., bClose=true) at /home/julien/compile-libreoffice/libo/writerfilter/source/rtftok/rtfsdrimport.cxx:356 7 0x00002aaaec134dfb in writerfilter::rtftok::RTFDocumentImpl::popState (this=0x20508a0) at /home/julien/compile-libreoffice/libo/writerfilter/source/rtftok/rtfdocumentimpl.cxx:4100 8 0x00002aaaec18327f in writerfilter::rtftok::RTFTokenizer::resolveParse (this=0x1aa46c0) at /home/julien/compile-libreoffice/libo/writerfilter/source/rtftok/rtftokenizer.cxx:106 9 0x00002aaaec11b269 in writerfilter::rtftok::RTFDocumentImpl::resolve (this=0x20508a0, rMapper=...) at /home/julien/compile-libreoffice/libo/writerfilter/source/rtftok/rtfdocumentimpl.cxx:644 10 0x00002aaaec297aa6 in RtfFilter::filter (this=0x1b658b0, aDescriptor=uno::Sequence of length 13 = {...}) at /home/julien/compile-libreoffice/libo/writerfilter/source/filter/RtfFilter.cxx:122 Here are some debug: 8;5;(0,0);(0,13);(1694,13);(1694,0);(0,0); aToken (0,0) aToken (0,13) aToken (1694,13) aToken (1694,0) aToken (0,0) aToken So must test that aToken is not empty Change-Id: Ib5f0af3306a983c8531a5db732831d4d786ce9f5 Reviewed-on: https://gerrit.libreoffice.org/8173 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Miklos Vajna <vmiklos@collabora.co.uk>
2014-02-18fdo#74709 RTF import: implement RTF_CLPAD*Miklos Vajna
(cherry picked from commit 6b5ef795ed4a56195bf09633b03e88474f0b133c) Conflicts: sw/qa/extras/rtfexport/rtfexport.cxx Change-Id: I482735e3fc4091be983b2c7484e086f5d0dd283a Reviewed-on: https://gerrit.libreoffice.org/8056 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2014-02-18fdo#74357 DOCX import: avoid layout problem with automatic spacingMiklos Vajna
Commit 279ff2e03371542d014bf281e73282ba8080cf6b (bnc#816593 DOCX import: fix auto para spacing without compat option, 2013-08-28) corrected the value of "auto" paragraph spacing, but unfortunately this triggers a layout problem: warn:legacy.osl:12692:1:sw/source/core/layout/tabfrm.cxx:2513: debug assertion: <SwTabFrm::MakeAll()> - format of table lowers suppressed by fix i44910 resulting in "the rest of the table is not rendered by the layout". Given that we backported the original fix to stable branches as well, just stay on the safe side and revert back to the original behavior in case the document requests the web layout. (cherry picked from commit 8b6ff51bb89db0d7050bb4d00c0ec797b4754f25) Conflicts: writerfilter/source/dmapper/SettingsTable.cxx Change-Id: I72683530b5218beff084bec8218cc99946b44802 Reviewed-on: https://gerrit.libreoffice.org/8081 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2014-02-18fdo#74357 DOCX import: fix nested tables anchored inside tablesMiklos Vajna
Regression from bbef85c157169efa958ea1014d91d467cb243e6f (bnc#779620 DOCX import: try harder to convert floating tables to text frames, 2013-10-01), the conversion of nested tables is delayed by default till we know the page size. However, in case the anchor is in a table, we should convert it right away, because the conversion of the parent table would invalidate our XTextRange references. (cherry picked from commit e5fd7c2dacf3c128cdc62622e736ce8abbc578a5) Change-Id: Id41556e721c6e1c7239e4ea25abd57c999d2219b Reviewed-on: https://gerrit.libreoffice.org/8080 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2014-02-18rhbz#1065629: RTF import: don't drop nested cells if not enough \cellxMichael Stahl
In this document written by "XMLmind XSL-FO Converter" there are less \cellx than \cell and thus when reading \nestrow/\row a whole buffered nested table \cell is lost and then subsequently the rest of the nested table too. Try to fix that by counting both \cell and \cellx and replaying until the maximum of those. Cannot count \intbl since we synthesize that in various places. (regression in LO 3.5) Change-Id: I3b64ad94af842e076611418589a0c83bd18841c6 (cherry picked from commit 07ef4cf096015f0e427ffd17cd26bb6837e75481) Reviewed-on: https://gerrit.libreoffice.org/8100 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Miklos Vajna <vmiklos@collabora.co.uk>
2014-01-27fdo#66011 abi#2128 RTF import: fix memory leakMiklos Vajna
Commit 9389cf78e304a5a99bcf1745b9388e14ac36281a (cp#1000018 RTF import: empty para at the end of footnote text got lost, 2013-11-15) assumed that \par at the end of all substreams means an empty paragraph, but it turns out this is only true for footnotes/endnotes, but not for e.g. headers. Additionally, that commit actually causes a memory leak, which is detected by an assert in the SwIndexReg dtor, so crash-testing caught this. (cherry picked from commit f7ef84640258e4ee6ddc4cc5cbf58a2d89860afa) Change-Id: Idfa040bf3026a9515a120cd7afaf7d314553a131 Reviewed-on: https://gerrit.libreoffice.org/7663 Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com> Tested-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
2014-01-26RTF import: fix handling of font color from paragraph styleMiklos Vajna
Conflicts: sw/qa/extras/rtfimport/rtfimport.cxx Change-Id: I6bbad2d69863020ea870be800f49e13e763b80bf Reviewed-on: https://gerrit.libreoffice.org/7667 Reviewed-by: Andras Timar <andras.timar@collabora.com> Tested-by: Andras Timar <andras.timar@collabora.com>
2014-01-21fdo#73389 Writer does not show a docx-document with nested table correctlyZolnai Tamás
The table manager can work with more table simultaneously and so m_aCellWidths contains more table's properties.Only one item of it belongs to the current table (getCurrentCellwidths). Regression from 74c5ed19f430327988194cdcd6bdff09591a93fa (cherry picked from commit d0c383256ef72d5212d8e2db77582d0ebe417209) Conflicts: sw/qa/extras/ooxmlimport/ooxmlimport.cxx Change-Id: I93efac0c004af1b2524c955ffb20c3ecd74a2920 Reviewed-on: https://gerrit.libreoffice.org/7543 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Miklos Vajna <vmiklos@collabora.co.uk>
2013-12-29fdo#41109 RTF shape import: handle fBehindDocument propertyMiklos Vajna
Change-Id: I9bf24eb2d3087e855d54c0ee7aba4e98dc856cc2 (cherry picked from commit e8d10f215e9da65617988a9a471be18775afad00)
2013-12-29fdo#41109 RTF shape import: shpz has priority over dhgtMiklos Vajna
And not the other way around, how 24ee3df385cf2aa95cd888581c84fdf90cc682dc (RTF import: fix priority handling of shpz vs dhgt, 2012-04-10) did, this time with a reproducer. Change-Id: I9412341c6b35ca2760e4490a18f11bc6a0e0b78a (cherry picked from commit ff7ac1a9b82bc20fe6e3d82322e53a7024edb84f)
2013-12-28DOCX import: close rPrChange properly.Zolnai Tamás
Call endtrackchanges when rPrChange ends so the corresponding redline will be removed. (cherry picked from commit 75e7d6f12e914b63e66968890533b2a56d0b1a7e) Conflicts: sw/qa/extras/ooxmlimport/ooxmlimport.cxx Reviewed on: https://gerrit.libreoffice.org/7195 Change-Id: I4091d7b54e0a74f3158cc979f210577a2dc29783
2013-12-28fdo#65090 RTF filter: import RTF_CLMGF and RTF_CLMRGMiklos Vajna
These describe an explicit horizontal merge, that is not something Word itself creates, but it turns out the Calc RTF export does. (cherry picked from commits bb562304c1e1c61a882e6db65806cfdf8601bcbf, 97dcf77841d19d344d58d5bdacdab141cdea4817 and 6eb02ac8a77f9f89f256b190281029f6cbd60d95) Change-Id: I1b6ec10bb8e8bd40e24791ccc96f2f066dd0d5d5
2013-12-20fdo#72204 RTF import: fix crash on rotated, but not imported groupshapeMiklos Vajna
In case the groupshape contains textboxes and they contain table, we don't import the groupshape itself, just the children, as drawinglayer rectangles wouldn't handle tables. If that's the case, don't try to apply properties on the groupshape, as that would crash (the Writer drawpage implements XShapes, but not the XShape interface). Change-Id: Ie34039170314b772dd050eb354681cfaec61c1fa (cherry picked from commit 3e199f81473d1f85a75238ac03d38a220f3ab818)
2013-12-15Revert "DOCX: fdo#72560 better solution for exchange alignment for RTL"Faisal M. Al-Otaibi
This reverts commit 66e68fe28a7bfb37d4fdeee9bed1d9a0ff840935. there some error in this patch.
2013-12-15DOCX: fdo#72560 better solution for exchange alignment for RTLFaisal M. Al-Otaibi
Change-Id: I39462fc722a58b32e8829a9f2005a411871f255d
2013-12-05cp#1000017 DOCX/RTF import: avoid fake tab char in footnotesMiklos Vajna
Word wants this, so it's added by the exporter to the document, but on import we should ignore it. Change-Id: Idcb669ba624bf462a50a85eb4aacf397afb6efe6 (cherry picked from commit b38629ae210b204a6d24d6e9c5c62eaaf563d494)
2013-12-04Drop SAL_CALL to get it to build on Windows.Kohei Yoshida
Change-Id: I0f475c396ec76ee7faa2cd0699181c58934e61e7
2013-12-04Get it to build.Kohei Yoshida
Change-Id: Ib1cb82d46322bd7c6791fa9a8937492ef27ec370
2013-12-04fastparser: Avoid copying all tokens into a sequence.Michael Meeks
2013-11-22init nRotation [-Werror=maybe-uninitialized]Eike Rathke
Change-Id: Ia48c8e3ef9dfb1f1f881845813ada518231352f2 (cherry picked from commit 44397a6f36ae6db697899c4595afe617e5fbe8ca)