summaryrefslogtreecommitdiff
path: root/sw
AgeCommit message (Collapse)Author
2015-07-07tdf#89698 DOCX import: inline picture should have no spacingMiklos Vajna
Commit 3d7e168a2a43c2414b0633379102ddb29437e75b (n#783638 DOCX import of wp:inline's distT/B/L/R attributes, 2012-10-11) was about a picture that had non-zero spacing in LO, but zero in Word. The hope was that the problem is just that the value is not imported. Then commit a88ac708403c03d0f950f09ec29c0d5a1e5a85b4 (fdo#63685 wp:inline's distT/B/L/R is in EMU's, not twips, 2013-04-19) was about a picture that had so large spacing that the picture become invisible. Fixing the unit of the spacing value made the picture visible again. What was missed is that this value is just stored in the doc model, but layout in Word doesn't use it at all till the anchoring is as-char. Given that in LO as-char anchoring supports real spacing, just don't import these values to have the same layout. That's what the WW8 import does, too. (cherry picked from commit 9781a8786da5c32e2250cbe1ae97bd10f84f39bb) Change-Id: I1244269e06c5d190e8340349ddc12ae7b0572a4d Reviewed-on: https://gerrit.libreoffice.org/16786 Reviewed-by: Michael Stahl <mstahl@redhat.com> Tested-by: Michael Stahl <mstahl@redhat.com>
2015-07-07tdf#92281 - FILEOPEN: Only western font is set for symbols in DOC filesMark Hung
Inserting a symbol in Writer set all fonts including CJK and CTL to the same one. This patch makes the behavior consistent with that, allows CJK and CTL user to see the symbols. Reviewed-on: https://gerrit.libreoffice.org/16604 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Conflicts: sw/source/filter/ww8/ww8par6.cxx Change-Id: I7a61868e8078c81c68e471760f080b3ce7df589f Reviewed-on: https://gerrit.libreoffice.org/16820 Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com> Tested-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com>
2015-07-03tdf#87460 DOCX import: fix missing endnote in floattableMiklos Vajna
Writer doesn't support foot or endnotes in TextFrames, so they are not supported in OOXML floattables, either. In the past, floattables were imported as normal tables, that's how this worked. Restore the old situation till the core limitation is there, so we at least don't regress. (cherry picked from commit 2fe248f2b36d541c0d243a620c217058a50a9d5d) Conflicts: writerfilter/source/dmapper/DomainMapperTableHandler.hxx writerfilter/source/dmapper/DomainMapper_Impl.hxx Change-Id: I4eb62617e3131176f7371e9ca69f11bc9e948a0b Reviewed-on: https://gerrit.libreoffice.org/16690 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2015-07-02tdf#91613 restore functionality of clicking to .uno:Size status bar elementAndras Timar
... in Writer. This (partially) reverts commit ebabf6d1fa648d62dd63529e9fe64dcb631caee8. I did not see the point to open Fields dialog by default, but other uses are fully valid. Reviewed-on: https://gerrit.libreoffice.org/16221 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Andras Timar <andras.timar@collabora.com> (cherry picked from commit a2716e53c140b09d886591a3d6611ee8f166e417) Change-Id: Ia06803fbb956266fb40c53f51099f9a32ddd6548 Reviewed-on: https://gerrit.libreoffice.org/16693 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2015-07-02tdf#92386: Writer crashes in print preview if document in 2 windowsJulien Nabet
2 changes for the 2 following bts First bt: see https://bugs.documentfoundation.org/attachment.cgi?id=116883 Second bt: see https://bugs.documentfoundation.org/attachment.cgi?id=116888 Reviewed-on: https://gerrit.libreoffice.org/16557 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com> (cherry picked from commit cb813b392d1f59ad8927b87e899d8a33d1db2504) Change-Id: I92ed3b7305bb5b714532f2dcffd615a8337db8b6 Reviewed-on: https://gerrit.libreoffice.org/16618 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2015-06-30tdf#92061 RTF import: fix missing body text after footnoteMiklos Vajna
A missing seek in the \footnote handler could result in a situation that the missed text contained a "{" but not its matching "}", which resulted in the parser terminating earlier than the end of the document. (cherry picked from commit 7b08304b55cf2284a3c583426c60baef618ba206) Conflicts: sw/qa/extras/rtfimport/rtfimport.cxx Change-Id: I6df476b2d6397dfa918111b33854dc2f95fbe81d Reviewed-on: https://gerrit.libreoffice.org/16501 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2015-06-23tdf#91228: need to check the format's IsLockModified(), not the node'sMichael Stahl
commit 9f01951b858453684f2622541af0eb85d4544fc6 also did the extra Remove/Add for Draw fly objects, and it turns out that that's actually wrong because SwTextFlyCnt::SetAnchor() will set the anchor without locking anything if it's a Draw object. Replace it with a different hack in SetAnchor() that applies only if it calls LockModify(). Thanks to Varun Dhall for creating a reproducer document. Not sure if the LockModify() could be replaced completely, perhaps it's just an optimization to avoid re-creating layout frames for the fly. (cherry picked from commit fae87e03ea3829718ec0381ed3b04ceb52c23720) Conflicts: sw/source/core/txtnode/atrflyin.cxx sw/source/core/txtnode/thints.cxx Added test for redline with as-char frame fixed by commits 4dd2e61 and fae87e0 Reviewed-by: Michael Stahl <mstahl@redhat.com> (cherry picked from commit f36ac1aa3bef5ba218f3dae24f260ce7e4afba95) Change-Id: Ib3236f289c2c4202d48ac378a53ce02130d4ce2c Reviewed-on: https://gerrit.libreoffice.org/16323 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Miklos Vajna <vmiklos@collabora.co.uk>
2015-06-23-Werror,-Winfinite-recursionStephan Bergmann
(cherry picked from commit 7b58b777bd15d5f34375e0325e4838e07f22dedc) Conflicts: sw/source/core/inc/frame.hxx Change-Id: I445302a2f51bbd244fcf7dbf2058efc30ac0b886 Reviewed-on: https://gerrit.libreoffice.org/16423 Reviewed-by: Michael Stahl <mstahl@redhat.com> Tested-by: Michael Stahl <mstahl@redhat.com>
2015-06-23LinkUpdateMode is a global settingStephan Bergmann
(cherry picked from commit 77cc71476bae2b3655102e2c29d36af40a393201) Conflicts: sw/source/core/doc/DocumentLinksAdministrationManager.cxx sw/source/filter/xml/xmlimp.cxx Change-Id: Ida1257337c6e0916f2228fe053d9c9f085183af6 Reviewed-on: https://gerrit.libreoffice.org/16422 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Miklos Vajna <vmiklos@collabora.co.uk>
2015-06-22tdf#88697: sw: make WW8 export of CITATION fields compatible withMichael Stahl
... older versions of Word and LO. Based on a prototype patch by Yury <yury.tarasievich@gmail.com> The problem is that Word 2003 does not understand the new CITATION field added in commit 06f7d1a96eef5aa69d4872ff6d96eb5085296d09. Word 2010 does appear to at least recognize it as a field. Also fix the textual field type, which was omitted for CITATION fields, except when the document was imported from DOCX. (cherry picked from commit f56289ac6d7f3da7fd45dd431ce4c540aadcad56) (cherry picked from commit 1bcd54e93245dfaea0a072493d8bab9e569bae93) Conflicts: sw/source/filter/ww8/ww8atr.cxx sw: remove the SwField::ExpandCitation disaster (cherry picked from commit 8ee3cb95638f25fea8dc85e2dc5eec89ea41fc38) (cherry picked from commit 1b5dc145e4e73fb2b8eaab1af3cb18d48048a1f0) Conflicts: sw/source/filter/ww8/ww8atr.cxx Change-Id: I62b13a4f585dce535d587555b357ab7e4ef0e460 Reviewed-on: https://gerrit.libreoffice.org/16410 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2015-06-20tdf#88290 Adapt the numbering popup to more than 8 itemsMaxim Monastirsky
The items count of NumberingTypeMgr is limited by 8, but some languages have more items, so remove that limitation. Also fix the behavior of the 10th item. The old sidebar popup had a "None" item, whose id was 10 (defined by DEFAULT_NONE from include/svx/nbdtmg.hxx), and that causes now the 10th item to behave as on/off toggle. Since we don't have a "None" item anymore, get rid of that behavior completely. Conflicts: include/svx/nbdtmg.hxx (cherry picked from commit 71b35212265bb93b10ca35ab964a36e6b6cc552b) Change-Id: I5546ca637f9951cc093a7bbf8fda11dc35341d4e Reviewed-on: https://gerrit.libreoffice.org/16337 Reviewed-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com> Tested-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com>
2015-06-18Resolves: tdf#81806 crash on certain table paste+undo+page cyclesCaolán McNamara
Undo of a delete always leaves a pam that points to the start of the undone area and a mark to the end of the undone area, even if that area is empty. (In the normal where there is a selection this can be seen by selecting something, deleting it, and undoing and the newly undeleted stuff is again selected) The table overwrite/paste thing looks to see if a mark is set and goes off to "do something very complex" if its set. So if after each undo cycle, you physically click at the point where the cursor is flashing (which clears the mark) and then paste, undo, *click*, paste you get a wonderfully stable experience. It seems reasonable to me to "do the simple thing" if there is no mark, or if the mark and point are the same, i.e. there is nothing actually selected by the PaM. (cherry picked from commit e06905df15ff03c6d3c84f61bd67860a91416c2d) (cherry picked from commit 5fbf5b10ca45528a075aba5d5f8e3f6af08c287f) Change-Id: Ib451090f3863fde41209cc1fc9cfa0c747d0be58 Reviewed-on: https://gerrit.libreoffice.org/16321 Reviewed-by: Muthu Subramanian K <muthusuba@gmail.com> Reviewed-by: Michael Stahl <mstahl@redhat.com> Tested-by: Michael Stahl <mstahl@redhat.com>
2015-06-18Resolves: tdf#86017 calc has more rows than writer tables can supportCaolán McNamara
as things stand right now in writer if the table doesn't fit it doesn't fit and don't try for back-ports reuse same bogus error used for 0 rows/cells (cherry picked from commit 550cff762d816c336adaf015f481443af1c6edab) (cherry picked from commit 799eef80581f2b39025ab1f388d6f4d741eabeac) Change-Id: I90cea4c8566460f614d9a1143a638597d5ab8ce6 Reviewed-on: https://gerrit.libreoffice.org/16338 Reviewed-by: Michael Stahl <mstahl@redhat.com> Tested-by: Michael Stahl <mstahl@redhat.com>
2015-06-16tdf#82553 DOCX import: handle table margin when converting floattablesMiklos Vajna
(cherry picked from commit 292ec5fe8d01af6119325f1a426422bb42e58615) Conflicts: sw/qa/extras/ooxmlimport/ooxmlimport.cxx Change-Id: I7a3a233a34453153b3e1c0fe3d60bb0ede65dc86 Reviewed-on: https://gerrit.libreoffice.org/16248 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2015-06-12Resolves: tdf#91878 vertical text entry missingCaolán McNamara
Change-Id: I3be1a13a00e3219cb8912ef61a9627d37036d19a (cherry picked from commit 29f6ef4632a53243b1bf60cb412d8c5ee8447dc6) (cherry picked from commit 37363e4e4f49a9cf9a699505da813c4daf8d7154) Reviewed-on: https://gerrit.libreoffice.org/16226 Reviewed-by: Katarina Behrens <Katarina.Behrens@cib.de> Tested-by: Katarina Behrens <Katarina.Behrens@cib.de>
2015-06-11tdf#90315 RTF import: fix \colsx default valueMiklos Vajna
See SectPageInformation::mnColsx on the libreoffice-3-6 branch + the spec agrees, too. Change-Id: I6f70a125f8d962621f319e3e75e2865e5f126859 (cherry picked from commit e18adb7369d140f33b947668a69da2fa78738e7b) Reviewed-on: https://gerrit.libreoffice.org/16225 Reviewed-by: Michael Stahl <mstahl@redhat.com> Tested-by: Michael Stahl <mstahl@redhat.com>
2015-06-09tdf#91602: sw: prevent recursive layout crashMichael Stahl
SwCrsrShell::UpdateCrsr() calls SwTextFrm::GetCharRect(), which does layout. It happens that a SdrObject is moved around during layout, which calls SwDrawContact::Changed(), which believes that there is no layout active because there is no SwLayAction and ViewShell::EndAction() has already been called, so we get recursive layout-in-layout action. (cherry picked from commit 587006cac508616f486aea45e265a170bcccdc87) tdf#91917 tdf#91602: avoid layout recursion differently (regression from 587006cac508616f486aea45e265a170bcccdc87) (cherry picked from commit 238e07ddca879e0951bef6391fdc5c3fc26bded5) Change-Id: I38e00a7469243088e25aa1a91e3581240b3bbdea Reviewed-on: https://gerrit.libreoffice.org/16184 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2015-06-08tdf#87574 - Outline numbering "None" is not retained in docxMark Hung
Partially revert commit d30a8ec448bcd08c6a52a37d6ae41a4b71c235da (Correct number format mapping for CJK numbered lists in rtf/doc/docx filters., 2014-11-04). Conflicts: sw/qa/extras/ooxmlexport/ooxmlexport.cxx Reviewed on: https://gerrit.libreoffice.org/14211 (cherry picked from commit 7f126fc8570da5c7275a4d4efe019b9ea3b5b073) Signed-off-by: Andras Timar <andras.timar@collabora.com> Conflicts: sw/qa/extras/ooxmlexport/ooxmlexport.cxx Change-Id: I0876ecd982cfd8d97887495b23af0e0370821101 Reviewed-on: https://gerrit.libreoffice.org/16145 Reviewed-by: Andras Timar <andras.timar@collabora.com> Tested-by: Andras Timar <andras.timar@collabora.com>
2015-06-04Resolves: tdf#91637 avoid -1 string indexCaolán McNamara
Change-Id: I006040f4589065141310fe2a89b8d2ba3e54ad2c (cherry picked from commit 4e96b278965875a95f02993590f30ab5859c1fed) Reviewed-on: https://gerrit.libreoffice.org/16089 Reviewed-by: Michael Stahl <mstahl@redhat.com> Tested-by: Michael Stahl <mstahl@redhat.com>
2015-06-04Resolves: tdf#84483 postit layout not available in print preview modeCaolán McNamara
for the moment don't crash anyway, maybe we can rearrange matters to make this possible. Change-Id: I2dc9831e5b026004b2f7603e618330154dbd6d1b (cherry picked from commit eea5ac7910d61796d77fe2cc03681dd24bb7dd95) (cherry picked from commit 84c9d54eb3c007066908794a1443dca6670a3922) Reviewed-on: https://gerrit.libreoffice.org/16084 Reviewed-by: Michael Stahl <mstahl@redhat.com> Tested-by: Michael Stahl <mstahl@redhat.com>
2015-06-04sw: fix Win-x86@51-TDF buildMiklos Vajna
I forgot that the paste() method in this suite is not available on Windows on 4-4, just on 5-0 and newer. Change-Id: I6b625c2c5af34e8c7d7a66dd138ce860fdf18a24 Reviewed-on: https://gerrit.libreoffice.org/16064 Reviewed-by: Michael Stahl <mstahl@redhat.com> Tested-by: Michael Stahl <mstahl@redhat.com>
2015-06-03tdf#86814 RTF import: fix sometimes lost bold styleMiklos Vajna
The problem was that commit 76c0d0abc89cd8948706083c2660b71a2dad670c (RTF import: adapt getProperties() to createStyleProperties(), 2014-09-07) only made the character style sprms/attributes a flat list, but not the paragraph style ones. Fixing that inconsistency avoids the tokenizer adding unwanted default sprms, which cause the bold sprms go away in the bugdoc. Change-Id: I86bd1b26af18cd968375c9b39be9c8e71d51271f (cherry picked from commit cbe79789a0fc9b80b2fd14a5abfe0973a2cb69dc) Reviewed-on: https://gerrit.libreoffice.org/16051 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2015-06-03tdf#91228 Fix Writer crashPhilippe Jung
Start Writer, Insert Image, Anchor as character, Go after image, press enter, writer crash This is because m_pAnchoredFly is not updated. JoinPrev, JoinNext and SplitContentNode all rely on CutText with calls InsertHint. InsertHint calls SetAnchor. SetAnchor calls Modify callback except if "LockModify"ed. This patch ensures that, whatever the value of LockModify, the references are kept correct. Reviewed-on: https://gerrit.libreoffice.org/16041 Reviewed-by: Michael Stahl <mstahl@redhat.com> Tested-by: Michael Stahl <mstahl@redhat.com> (cherry picked from commit 9f01951b858453684f2622541af0eb85d4544fc6) Signed-off-by: Michael Stahl <mstahl@redhat.com> Conflicts: sw/source/core/txtnode/thints.cxx Change-Id: Id7254784c6954db4b542b2c4228b388fb924bbc2
2015-06-02tdf#70318 tdf#90260 writerfilter: pasted RTF documents may contain no \parMiklos Vajna
This is a squash of 3 commits, as the first doesn't build without the second one. First commit: sw core is not yet adapted, will be done in the next commit. (cherry picked from commit e702c78843e387d83fd9c8fbd1597cbe27e3e656) Second commit: Author: Mike Kaganski <mikekaganski@hotmail.com> tdf#70318: don't forget to clean up second fake paragraph RTF insert is made into an empty paragraph. To do that, two splits are made before the insert, but only one is reverted afterwards. This patch removes the second. Also fixes a memory leak from unreleased heap object The corresponding unit test is corrected. It was incorrect because \par doesn't begin new paragraph; it only ends paragraph. If a RTF is ended with \par } then no newline is added to its end. The old unit test only worked because of the bug fixed by this patch. Correct way of inserting new paragraph in the end of a RTF is \par \par} (cherry picked from commit 0ddd9f9ff45f61013ea18763eca4c68aedce6caa) Third commit: tdf#90260 testcase (cherry picked from commit 8931abc0b9fded1ee78eca6bf28e8d2438a76add) Conflicts: writerfilter/source/filter/RtfFilter.cxx writerfilter/source/rtftok/rtfdocumentfactory.cxx writerfilter/source/rtftok/rtfdocumentimpl.cxx sw/source/filter/rtf/swparrtf.cxx Change-Id: If8da12427e0cdaced4c1c1776b9f0b8cbde5c57c 63d50a940d7960beb35f7d774c833ed8499acbef 06a5ff604e6782863c4a2d6e002c9d67d42912fb Reviewed-on: https://gerrit.libreoffice.org/15963 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2015-05-28tdf#91074 RTF import: handle \dplineco* for text framesMiklos Vajna
RTFSdrImport::resolve() already had the logic to use the relevant API depending on if the shape is a text frame or not -- extract that to a separate member function and use it from RTFDocumentImpl::popState(), too. (cherry picked from commit ec1a96e79e3e6225706151cb72eb3df763b0598d) Conflicts: sw/qa/extras/rtfimport/rtfimport.cxx writerfilter/source/rtftok/rtfsdrimport.cxx writerfilter/source/rtftok/rtfsdrimport.hxx Change-Id: I663b372244f09f002447ece62587143b2a575795 Reviewed-on: https://gerrit.libreoffice.org/15939 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2015-05-28Resolves: tdf#91403 no wrtshell during initial layoutCaolán McNamara
(cherry picked from commit ff44502d836880d2bdb057e7fdfd9b5abeb87842) (cherry picked from commit cf851cda7c943548d0ce60d0b4836ccbf6e76698) Change-Id: I0d0b8027e07f9dc2dfff584abd026d1b496d93dd Reviewed-on: https://gerrit.libreoffice.org/15933 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Miklos Vajna <vmiklos@collabora.co.uk>
2015-05-27tdf#90421 RTF export: ignore hyperlinks without an URLMiklos Vajna
Commit fe444d1f74abe417962be0bcd3340f40f2446b58 (fdo#62536: sw: fix AutoCorrect bold/underline on existing AUTOFMT, 2013-06-20) adds an empty inet format hint on the text node during autocorrection, on export we can safely ignore that to provide well-formed output. (cherry picked from commit 7d42346ba77c9c4df241ea40eaf550993ca18783) Change-Id: Iafae941a13e29dcc7d8b4bade5ce94a486b59638 Reviewed-on: https://gerrit.libreoffice.org/15906 Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de> Tested-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
2015-05-26fix assert on export of ooo40760-1.sxw to docxCaolán McNamara
and a pile more Change-Id: I7334233c789bb0ed7a60387ef7d84dd34ab5a187 (cherry picked from commit 3185b6c8caf97afa602c864f588d079cbbe04038) Reviewed-on: https://gerrit.libreoffice.org/15891 Tested-by: David Tardon <dtardon@redhat.com> Reviewed-by: David Tardon <dtardon@redhat.com>
2015-05-25tdf#91261: DOCX import: snapGrid property of paragraphs are ignoredMark Hung
Fix the situation for OOXML import filter: a) While handling DocGrid type, SnapToChars was treated as None. Now it is implemented as described in the article: http://linpeifeng.blogspot.tw/2007/02/text-grid-enhancement.html Both LinesAndChars and SnapToChars will be translated to Writer grid type "lines and characters", and set SnapToGrid property to false or true accordingly. b) All the imported paragraphs snap to grid because SnapToGrid was appended to grabbag, now it allows SnapToGrid property in paragraph and paragraph styles to be imported properly. Reviewed-on: https://gerrit.libreoffice.org/15732 Reviewed-by: Michael Stahl <mstahl@redhat.com> Tested-by: Michael Stahl <mstahl@redhat.com> (cherry picked from commit b7c8c337d4ffad55fe111c9634c4c04afce78bad) Conflicts: sw/qa/extras/ooxmlexport/ooxmlexport.cxx Change-Id: I446b4c64c0ed86960896bcd61a1006c9173a757a Reviewed-on: https://gerrit.libreoffice.org/15843 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2015-05-25tdf#91140: tweak fix a bit, turns out xmloff was also passing empty URLMichael Stahl
Change-Id: Ia6e1fbe18e72c9c06915e1b437076a1f56a6c206 (cherry picked from commit 12f907da9535ae9fb28fb7ef1b05240eabf51e82) Reviewed-on: https://gerrit.libreoffice.org/15867 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2015-05-25tdf#90946: sw: ODF import: ignore invalid gradient-name if style SOLIDMichael Stahl
The bugdoc has a fill-gradient-name that refers to a non-existent gradient and also draw:fill="solid"; handle this combination without exception. Change-Id: I2c912b28a6b1550e2e4c6c71ff8889ae1779c618 (cherry picked from commit 00eab70295cbce40368d57224c3f51c6e5f2457e) Reviewed-on: https://gerrit.libreoffice.org/15866 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2015-05-20tdf#89794: sw: implement SwXFlatParagraph::getPropertySetInfo()Michael Stahl
(regression from d477ff4a81ecba8a77ead5ff1a33d3e3ceed622e) Change-Id: Ic49d2c14a27d2fb188a1ba5f9a7d8c0180b8de13 (cherry picked from commit a4c121aa4a2f68d36f1ce41e94e8275230ec0866) Reviewed-on: https://gerrit.libreoffice.org/15792 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2015-05-20sw: fix assert with frames anchored as-char in redlines on rhbz490395-1.odtMichael Stahl
SwRangeRedline::Hide() will copy and delete the redlined text range, and during the delete it happens that FLY_AS_CHAR frames are not deleted before their anchor SwTxtNode is destroyed, so SwFmtAnchor::m_pCntntAnchor will have its NodeIndex adjusted by SwNodes::RemoveNode() to a wrong node and then it cannot call RemoveAnchoredFly() on the proper node. Avoid the problem by manually deleting all FLY_AS_CHAR from nodes before they are deleted and before the SwNodeIndex adjustment. (regression from 738fb2ad77e5a1a4d6e2dc540886a17f4527e4db, which had the equivalent problem with differing SwNodeIndex keys) (cherry picked from commit 4dd2e61e2a52d0b5c582f16732de544391bad3d2) Conflicts: sw/source/core/docnode/nodes.cxx Change-Id: I13c9577c01e3b8976b74fb9c58dc2ef2c2fc0666 Reviewed-on: https://gerrit.libreoffice.org/15784 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2015-05-20sw: fix assert with frames anchored in redlines on rhbz490395-1.odtMichael Stahl
SwRangeRedline::Show() will move nodes around in the nodes-array, which means that using SwNodeIndex as a key in a map that has a lifetime not limited by the stack is a bad idea, as the map will become unsorted. Remove SwFrmFmtAnchorMap from SwDoc and replace it with new SwNode::m_pAnchoredFlys to do the same mapping. (regression from 738fb2ad77e5a1a4d6e2dc540886a17f4527e4db) Change-Id: I396d92b9d0b2045e98bad6d0b374303cd4e62b59 (cherry picked from commit e07feb9457f2ffb373ae69b73dda290140e4005f) Reviewed-on: https://gerrit.libreoffice.org/15783 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2015-05-20Fix DocumentRedlineManager code that crashes Writer.Mark Hung
One of my document crashes Writer when I delete one table row, with change tracking enabled. I observed that in DeleteRedline(), either Start or End of the SwRangeRedline object has been changed so that it breaks the order of SwRedlineTable. Change-Id: I6e477488a894996dea4efb433eb3e03edf5fd26d Reviewed-on: https://gerrit.libreoffice.org/15002 Tested-by: Caolán McNamara <caolanm@redhat.com> Reviewed-by: Caolán McNamara <caolanm@redhat.com> (cherry picked from commit 77cb94613be6315b618783b2aa76226ad3107163) Reviewed-on: https://gerrit.libreoffice.org/15820 Reviewed-by: Michael Stahl <mstahl@redhat.com> Tested-by: Michael Stahl <mstahl@redhat.com>
2015-05-19tdf#90905 fix for url encoding in internal urlsVasily Melenchuk
Do not try to use INetURLObject class for encoding of internal document links. External URLs are encoded as before. Change-Id: I90621819ed21c3f793171ac4ab3fc7d49ac69f56 Reviewed-on: https://gerrit.libreoffice.org/15625 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Stahl <mstahl@redhat.com> (cherry picked from commit d82c035953347a19bbbc5eda61e1c9389bf3b73b) Signed-off-by: Michael Stahl <mstahl@redhat.com>
2015-05-18tdf#90808: sw: fix detection of duplicate CrossRefBookmarksMichael Stahl
The check for existing bookmark positions is using the wrong position. It must use the Start of the pam, because the constructor of CrossRefBookmark only uses the Start of the pam. (cherry picked from commit 9d0c51daea67104349cac26de9839afa8baeb099) Conflicts: sw/source/core/doc/docbm.cxx Change-Id: I343f1c0e3571847a965a27571f01136810e83485 Reviewed-on: https://gerrit.libreoffice.org/15745 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2015-05-18tdf#91140: ODF import: try to ignore invalid draw:fill="solid"Michael Stahl
... which was apparently written by LO >= 4.1 on a frame with image background, under unknown circumstances. Change-Id: Ie86643ab67f58bfe5c19d6a1f80a7af8f793edf2 (cherry picked from commit 97887cd810194ee556d2ec12f2a8be40075c29d2) Reviewed-on: https://gerrit.libreoffice.org/15743 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2015-05-14tdf#85424: sw: fix ~SwIndexReg assert in SwXText::insertControlCharacter()Michael Stahl
Remove pointless duplicate temporary PaM. Change-Id: I28a1937928b6c3c21442bbfcb77377372c1cf40b (cherry picked from commit 847b4537928ff64cfdd6532704f7c48d947ac00f) Reviewed-on: https://gerrit.libreoffice.org/15725 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2015-05-11Resolves: tdf#90141 layout crash with table in footnoteCaolán McNamara
this also makes cloudon File_1308.docx not crash, which is the last outstanding crashtesting import failure Change-Id: I06867a1b06316c6dab62ebd8a55f3a02b57b9f31 (cherry picked from commit 971adcd9e19e0bcab5855aae9be58d2203b46169) Reviewed-on: https://gerrit.libreoffice.org/15584 Reviewed-by: Michael Stahl <mstahl@redhat.com> Tested-by: Michael Stahl <mstahl@redhat.com>
2015-05-11fix assert on re-export of fdo72640-6.docx to docxCaolán McNamara
and hopefully loads more Change-Id: I04f9f757378e25191d7334bd52e418cf84bdf887 (cherry picked from commit 11cac95f57c5e7836413a73667d74128c4afd3e7) Signed-off-by: Michael Stahl <mstahl@redhat.com>
2015-05-09sw: remove bogus assert in SwDoc::IsInHeaderFooter()Michael Stahl
If the for loop has a break after the first frame anchored on that node, it makes no sense to assert that all frames have been visited. (regression from bb95f7e6f7c9b1281875e6d729b66b6018794ee0) Change-Id: Ibd8d65f286b441127be7735c63f4b84ba94dcb6f (cherry picked from commit fb0553d6b4905fe2c923a2b5591c001d0be52398) Reviewed-on: https://gerrit.libreoffice.org/15687 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2015-05-01tdf#90816: sw: fix bookmark loss in SwUndoDeleteMichael Stahl
_DelBookmarks() will actually delete marks that exactly match both start and end position of the range, so restrict the call to only the fully-deleted nodes that will be moved to the Undo-array. (regression from 370febbf19a5f362394d1c9e69b12dcb218f6501) (cherry picked from commit c7fb1d8334d2289906ac2a0a8c32946493d10e00) Conflicts: sw/qa/core/macros-test.cxx Change-Id: Icf5097774aa55ee152a1e20c0c7264330955c615 Reviewed-on: https://gerrit.libreoffice.org/15581 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2015-04-30coverity#1296209 Logically dead code (gold)Caolán McNamara
Change-Id: I68be0901ab0ee37caaa9338b6c499d0086c2c968 (cherry picked from commit 3a6866c2953c17a55536fa434b9fceda670d0685) Reviewed-on: https://gerrit.libreoffice.org/15573 Reviewed-by: Michael Stahl <mstahl@redhat.com> Tested-by: Michael Stahl <mstahl@redhat.com>
2015-04-30Resolves: tdf#85769 fix duplicate attribute export to docx...Caolán McNamara
with ooo69297-4.odt (cherry picked from commit 870a7ee60ab01246ad8d9beae5705f59c6b73cbf) Conflicts: sw/qa/extras/ooxmlexport/ooxmlexport5.cxx Change-Id: I193099d7fffc160f0198e3d42d5d6fd5835c79cf Reviewed-on: https://gerrit.libreoffice.org/15572 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Miklos Vajna <vmiklos@collabora.co.uk>
2015-04-30writerfilter: unused fill and CT_Fill resourcesMiklos Vajna
These were added by commit cfc4650c8594334edecc3b50ca54461f6bee2d43 (Added some teaks to 'model.xml', 2014-09-16), but the matching dmapper part is missing, so they aren't useful in practice, and cause a crash on import of crashtest's File_953.docx. Change-Id: I3d1c138534a37dc9ba500f1134ca4bb9ebae0e96 (cherry picked from commit 57d254d42b6e1d836bd21e6fb2e968af2b511c7d) Reviewed-on: https://gerrit.libreoffice.org/15574 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2015-04-27sw: fix SwAccessibleParagraph crash on deleteMichael Stahl
It happens that SwAccessibleParagraph::getCharacterBounds() is called from ATK with a clearly invalid pPortionData member; the SwTxtNode has no text but there are portions. This is because after a deletion both a POS_CHANGED and a INVALID_CONTENT event are created for the same SwAccessibleParagraph, and they are merged into one POS_CHANGED event by SwAccessibleMap::AppendEvent(), but SwAccessibleContext::InvalidatePosOrSize() returns early if the paragraph happens to not be visible, skipping the invalidation. (regression from 76c549eb01dcb7b5bf28a271ce00e386f3d388ba, which removed a Dispose() call; not sure if the Dispose() is needed here) Change-Id: I985e9a439ee6c7024963eace876186f2247b9e03 (cherry picked from commit 104ed86c382b73505b477bf3024982dd27823023) Reviewed-on: https://gerrit.libreoffice.org/15534 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Miklos Vajna <vmiklos@collabora.co.uk>
2015-04-27rhbz#1205072: sw: resource mangement SNAFU caused by SwPaM copy ctorMichael Stahl
SwPaM copy ctor has the surprising habit of linking the new one into the old one's Ring. If you copy a shell cursor, *this* epic fail happens: ==948== Thread 6 SelectionManager: ==948== Invalid free() / delete / delete[] / realloc() ==948== at 0x4A07CE9: free (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so) ==948== by 0x222F542B: SwPaM::operator delete(void*, unsigned long) (in /libreoffice-4-3/instdir/program/libswlo.so) ==948== by 0x2239E20E: SwPaM::~SwPaM() (pam.cxx:422) ==948== by 0x22368630: CheckRange(SwCursor*) (crsrsh.cxx:111) ==948== by 0x2236DECC: SwCrsrShell::UpdateCrsr(unsigned short, bool) (crsrsh.cxx:1397) ==948== by 0x22369113: SwCrsrShell::EndAction(bool) (crsrsh.cxx:290) ==948== by 0x2268971F: SwEditShell::EndAllAction() (edws.cxx:87) ==948== by 0x2262BEF3: SwBaseLink::DataChanged(rtl::OUString const&, com::sun::star::uno::Any const&) (swbaslnk.cxx:274) ==948== by 0x2262C78E: SwBaseLink::SwapIn(bool, bool) (swbaslnk.cxx:411) ==948== by 0x227102EC: SwGrfNode::SwapIn(bool) (ndgrf.cxx:539) ==948== by 0x227121BC: SwGrfNode::MakeCopy(SwDoc*, SwNodeIndex const&) const (ndgrf.cxx:999) ==948== by 0x22610E4D: SwNodes::_CopyNodes(SwNodeRange const&, SwNodeIndex const&, bool, bool) const (nodes.cxx:1862) ==948== by 0x225B98E0: SwDoc::CopyWithFlyInFly(SwNodeRange const&, int, SwNodeIndex const&, SwPaM const*, bool, bool, bool) const (ndcopy.cxx:1336) ==948== by 0x224AC1FF: SwDoc::CopyLayoutFmt(SwFrmFmt const&, SwFmtAnchor const&, bool, bool) (doclay.cxx:446) ==948== by 0x2294D2D4: SwTxtFlyCnt::CopyFlyFmt(SwDoc*) (atrflyin.cxx:130) ==948== by 0x229A5B96: MakeTxtAttr(SwDoc&, SfxPoolItem&, int, int, CopyOrNew_t, SwTxtNode*) (thints.cxx:1060) ==948== by 0x229A64E6: SwTxtNode::InsertItem(SfxPoolItem&, int, int, unsigned short) (thints.cxx:1224) ==948== by 0x2298E536: SwTxtNode::CopyText(SwTxtNode*, SwIndex const&, SwIndex const&, int, bool) (ndtxt.cxx:1773) ==948== by 0x2298DC08: SwTxtNode::CopyText(SwTxtNode*, SwIndex const&, int, bool) (ndtxt.cxx:1555) ==948== by 0x225B4C9D: SwTxtNode::MakeCopy(SwDoc*, SwNodeIndex const&) const (ndcopy.cxx:286) ==948== by 0x22610E4D: SwNodes::_CopyNodes(SwNodeRange const&, SwNodeIndex const&, bool, bool) const (nodes.cxx:1862) ==948== by 0x223EF3C2: SwNodes::_Copy(SwNodeRange const&, SwNodeIndex const&, bool) const (ndarr.hxx:182) ==948== by 0x225B5D8D: SwTableNode::MakeCopy(SwDoc*, SwNodeIndex const&) const (ndcopy.cxx:475) ==948== by 0x22610ACA: SwNodes::_CopyNodes(SwNodeRange const&, SwNodeIndex const&, bool, bool) const (nodes.cxx:1790) ==948== by 0x223EF3C2: SwNodes::_Copy(SwNodeRange const&, SwNodeIndex const&, bool) const (ndarr.hxx:182) ==948== by 0x225CA663: SwSectionNode::MakeCopy(SwDoc*, SwNodeIndex const&) const (ndsect.cxx:1270) ==948== by 0x22610BFC: SwNodes::_CopyNodes(SwNodeRange const&, SwNodeIndex const&, bool, bool) const (nodes.cxx:1817) ==948== by 0x223EF3C2: SwNodes::_Copy(SwNodeRange const&, SwNodeIndex const&, bool) const (ndarr.hxx:182) ==948== by 0x225CA663: SwSectionNode::MakeCopy(SwDoc*, SwNodeIndex const&) const (ndsect.cxx:1270) ==948== by 0x22610BFC: SwNodes::_CopyNodes(SwNodeRange const&, SwNodeIndex const&, bool, bool) const (nodes.cxx:1817) ==948== by 0x223EF3C2: SwNodes::_Copy(SwNodeRange const&, SwNodeIndex const&, bool) const (ndarr.hxx:182) ==948== by 0x225CA663: SwSectionNode::MakeCopy(SwDoc*, SwNodeIndex const&) const (ndsect.cxx:1270) ==948== by 0x22610BFC: SwNodes::_CopyNodes(SwNodeRange const&, SwNodeIndex const&, bool, bool) const (nodes.cxx:1817) ==948== by 0x225B98E0: SwDoc::CopyWithFlyInFly(SwNodeRange const&, int, SwNodeIndex const&, SwPaM const*, bool, bool, bool) const (ndcopy.cxx:1336) ==948== by 0x225B8F15: SwDoc::CopyImpl(SwPaM&, SwPosition&, bool, bool, SwPaM*) const (ndcopy.cxx:1239) ==948== by 0x225B6EE0: SwDoc::CopyRange(SwPaM&, SwPosition&, bool) const (ndcopy.cxx:707) ==948== by 0x22667E69: SwEditShell::_CopySelToDoc(SwDoc*, SwNodeIndex*) (edglss.cxx:244) ==948== by 0x226C8400: SwFEShell::Copy(SwDoc*, rtl::OUString const*) (fecopy.cxx:214) ==948== by 0x22DBF72B: (anonymous namespace)::lclOverWriteDoc(SwWrtShell&, SwDoc&) (swdtflvr.cxx:373) ==948== by 0x22DBFBC6: SwTransferable::GetData(com::sun::star::datatransfer::DataFlavor const&, rtl::OUString const&) (swdtflvr.cxx:439) ==948== by 0x7CB36C7: TransferableHelper::getTransferData2(com::sun::star::datatransfer::DataFlavor const&, rtl::OUString const&) (transfer.cxx:332) ==948== by 0x7CB34B5: TransferableHelper::getTransferData(com::sun::star::datatransfer::DataFlavor const&) (transfer.cxx:306) ==948== by 0x17A7E949: x11::SelectionManager::convertData(com::sun::star::uno::Reference<com::sun::star::datatransfer::XTransferable> const&, unsigned long, unsigned long, int&, com::sun::star::uno::Sequence<signed char>&) (X11_selection.cxx:655) ==948== by 0x17A823CA: x11::SelectionManager::sendData(x11::SelectionAdaptor*, unsigned long, unsigned long, unsigned long, unsigned long) (X11_selection.cxx:1503) ==948== by 0x17A82E03: x11::SelectionManager::handleSelectionRequest(XSelectionRequestEvent&) (X11_selection.cxx:1729) ==948== by 0x17A8A08A: x11::SelectionManager::handleXEvent(_XEvent&) (X11_selection.cxx:3574) ==948== Address 0x21e31a60 is on thread 6's stack ==948== in frame #40, created by SwEditShell::_CopySelToDoc(SwDoc*, SwNodeIndex*) (edglss.cxx:158) (regression from 49505336a629a75f4fb48bbe0c532b402e857ed4) (cherry picked from commit c55599fd0e7198773087c6433031f7119aaaca36) Conflicts: sw/source/core/edit/edglss.cxx Change-Id: I3d0a288a83b4719dda7977b4898dea656ea67388 Reviewed-on: https://gerrit.libreoffice.org/15533 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Miklos Vajna <vmiklos@collabora.co.uk>
2015-04-24tdf#80708 RTF export: fix unexpected table row breakMiklos Vajna
Regression from commit 1f77a5e8d5bf8a7f1b7bd7206996d2b2efc59462 (n#203704 fix RTF export table output for subtables, 2012-02-08), the problem is that RtfAttributeOutput::StartTableRow() has two callers depending on if it's the first or a later row, but the m_bTableRowEnded flag storing if that method is called is only set in one case. Fix the problem by moving the update of the flag to the method itself. (cherry picked from commit 5e2708a5a8cad3c2f4578742264610abab677395) Conflicts: sw/qa/extras/rtfexport/rtfexport.cxx Change-Id: Ieae1fb53f9528fc74d037d2fd783b3979b17cab8 Reviewed-on: https://gerrit.libreoffice.org/15506 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2015-04-24rhbz#1198848: sw: delete *all* table redlines to fix DOCX import crashMichael Stahl
SwExtraRedlineTbl::DeleteAllTableRedlines() increments its position even when deleting the current element from the vector. Change-Id: Ie827a7b66fa9690bbabaf53204e9ec77247239f2 (cherry picked from commit 28764d7ed5df874c2bfbc6025a97968e08cf2315) Reviewed-on: https://gerrit.libreoffice.org/15480 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Miklos Vajna <vmiklos@collabora.co.uk>