path: root/sw/qa/extras
AgeCommit message (Collapse)AuthorFilesLines
2015-10-14tdf#94804 sw: allow duplicate heading cross reference bookmarksMichael Stahl2-0/+150
... in ODF import, so that reference fields do not break that reference numbering cross reference bookmarks that were corrupted by commit 679faffc68bb854af0f55d0f218698e2f372f00b. This used to work by accident before commit 9d0c51daea67104349cac26de9839afa8baeb099 fixed it to actually check for duplicates properly. (cherry picked from commit 7c3c3006deaaaf1bb3f2f4eeeaf11da3bcebe53c) Change-Id: I5ed58eda7f3f2ce470a778852f6dda7a14356860 Reviewed-on: Reviewed-by: Caolán McNamara <> Tested-by: Caolán McNamara <>
2015-10-07tdf#92454 DOCX import: allow overriding para prop from num style in para styleMiklos Vajna2-0/+10
Word has a feature like this: a paragraph style can refer to a numbering style, and both can specify paragraph margins. If that's the case, then the ones from the paragraph style has priority. In Writer, the numbering style has priority, so the only chance for correct import result is to set the margin directly on the paragraph in this case. (cherry picked from commit f4badd9a485f32f787d78431ed673e2932973887) Conflicts: sw/qa/extras/ooxmlimport/ooxmlimport.cxx Change-Id: Iff3b03bcc56e0db3a48452c293acf41c91b8f159 Reviewed-on: Reviewed-by: Andras Timar <> Tested-by: Andras Timar <>
2015-10-01tdf#92521 DOCX export: handle section break right after a tableMiklos Vajna2-0/+7
DocxAttributeOutput::SectionBreaks() previously only handled the text-text and text-table node transitions; implement support for table-text to avoid loosing a page break on export for the bugdoc. (View this commit with whitespace ignored to filter out the noise about SectionBreaks() now accepting non-text nodes, too.) (cherry picked from commit c916152d8562cab868d4c522748ac30029fad179) Conflicts: sw/source/filter/ww8/attributeoutputbase.hxx sw/source/filter/ww8/docxattributeoutput.cxx sw/source/filter/ww8/docxattributeoutput.hxx sw/source/filter/ww8/rtfattributeoutput.cxx sw/source/filter/ww8/rtfattributeoutput.hxx sw/source/filter/ww8/ww8attributeoutput.hxx Change-Id: Ie8a1575374a207399351635bda8c0c076ce7268d Reviewed-on: Reviewed-by: Caolán McNamara <> Tested-by: Caolán McNamara <>
2015-10-01bnc#939996 tdf#93919 DOCX import: fix left-from-style and first-from-directMiklos Vajna2-0/+6
With this, <w:ind w:hanging="..."/> as direct paragraph formatting and <w:ind w:left="..." w:hanging="..."/> as a numbering level formatting is properly merged, i.e. w:left is not lost, defaulting to 0. (cherry picked from commit 56341e5d496f576dc45fe8e6c44831d780fecb73) Conflicts: sw/qa/extras/ooxmlimport/ooxmlimport.cxx Change-Id: If5534fbd9ee6d41139b0ed3a3df9d0cc5aad3239 Reviewed-on: Reviewed-by: Caolán McNamara <> Tested-by: Caolán McNamara <>
2015-09-17tdf#92586 xmloff: fix import of stretched background imageMiklos Vajna2-0/+7
The bug document has: <style:page-layout-properties ... style:repeat="no-repeat"> <style:background-image ... style:repeat="stretch"/> </style:page-layout-properties> When a stretched background image is set on a page style using the Writer UI, then these two style:repeat attributes always match, but not in the bugdoc. The later used to have priority, till commit 7d9bb549d498d6beed2c4050c402d09643febdfa (Related: #i124638# Second step of DrawingLayer FillAttributes..., 2014-06-02). Fix the problem by extending XMLBackgroundImageContext::EndElement(): if we know that the <style:page-layout-properties> sets the FillBitmapMode property, then don't blindly set BackGraphicLocation, but try to overwrite the exiting FillBitmapMode one. (cherry picked from commit 6621da38b3cd217314c2d2295fd1e71be7e1875e) Change-Id: I64ab4363b20cc95003d35acd63ea421472b1c071 Reviewed-on: Reviewed-by: Caolán McNamara <> Tested-by: Caolán McNamara <>
2015-09-15tdf#93449 Internal hyperlinks are not exported corectly in HTMLVasily Melenchuk2-1/+2
InetURLObject class does not work correctly with internal document links, containing not full url, but just a fragment. This case added as an exception for HTML link export. Change-Id: I44496a1cf186836d4194fc65ce7bf9aeb2f79b65 Reviewed-on: Reviewed-by: Thorsten Behrens <> Tested-by: Thorsten Behrens <> (cherry picked from commit fd3468024e1ac199f4a2f4108321ef8100d58414) Signed-off-by: Michael Stahl <>
2015-09-15tdf#83227 oox: reuse RelId in DML/VML export for the same graphicMiklos Vajna2-0/+12
So that large images are written only once to the ZIP container when they are exported using both markups. This affects drawinglayer images, the Writer ones are handled directly in sw and were already deduplicated. (cherry picked from commit b484e9814c66d8d51cea974390963a6944bc9d73) Conflicts: oox/source/export/drawingml.cxx Change-Id: Iff7c769329b42939833056b727b070f6a60da5e3 Reviewed-on: Reviewed-by: Caolán McNamara <> Tested-by: Caolán McNamara <>
2015-09-12Revert "Fix single node CopyRange"Michael Stahl2-0/+108
This reverts commit 9099e21b89184bd4e39def497e483cac4a77ec5a. It causes the problem that frames anchored to the same node where redlines start or end get duplicated during Hide. Jan-Marek said that the original mail-merge related problem this change was fixing is now most likely fixed differently, and the test in testMultiPageAnchoredDraws() still passes. (equivalent master commit e84f0a9b3223f49b0829f2f55dacbf11ae201c1e) sw: add unit test for the redline frame duplication regression (cherry picked from commit d5ffcba07acb4dd5bd68373d40f07af825f07fba) Change-Id: I4c2b425b0dc8d2706cc74ad93a485a501d44c072 Reviewed-on: Reviewed-by: Caolán McNamara <> Tested-by: Caolán McNamara <>
2015-09-03Related: tdf#93676 special 255 Percent Flag should not be exported to docxCaolán McNamara1-0/+0
as a true percentage value. 255 is a special flag that the value is synced to the other dimension. Without this word gives the frame in the attached example a huge height. (cherry picked from commit b2ad33fd5a1ee0cd9a1e657725aedc90da659f24) Change-Id: Ida0c15779d4583ca075428d77b8dc03c32f22edb Reviewed-on: Reviewed-by: Miklos Vajna <> Tested-by: Miklos Vajna <>
2015-09-03tdf#87924 DOCX import: rot=90 and vert=vert270 means no text rotationMiklos Vajna2-0/+8
If the shape is rotated 90 degrees clockwise and the text is further rotated 270 degrees clockwise that means we shouldn't do anything with the text and the result will be correct. Also: cid#1315264 incorrect expression (cherry picked from commit dbfed66eebde65f5844a0f1a2cfe548ad4eda962 and 1c09657c5c25cf941588610eeab653217399f9b5) Change-Id: I7c65319258136288520bd24fa2bf8e3c598b0878 Reviewed-on: Reviewed-by: Caolán McNamara <> Tested-by: Caolán McNamara <>
2015-08-29ODF import: workaround dubious draw:fill="solid" on frame stylesMichael Stahl2-0/+22
Since the gradient frame backgrounds were added in LO 4.1, we export this: fo:background-color="transparent" draw:fill="solid" Which doesn't make a whole lot of sense as this is really a "none" fill, and now with the backward compatibility stuff in the style import code we get the pool default color added when setting the BackTransparent property, and with the draw:fill="solid" it becomes visible and the background color is now Sky Blue 1. So try to detect draw:fill="solid" without draw:fill-color attribute and contradicting transparent legacy attribute and nerf it. This way we also export draw:fill="none" again, although still with a bogus draw:fill-color but that shouldn't cause any harm. (cherry picked from commit 68efa6f5128abf4cd097ae81a4cfd7fecbcb2a80) Change-Id: I1c2bea46ba7d9a3f042b875df0ca12c7f6037909 Reviewed-on: Reviewed-by: Caolán McNamara <> Tested-by: Caolán McNamara <>
2015-08-29related: tdf#92379: sw: backward compatible ODF export of overridingMichael Stahl1-0/+9
... frame/paragraph backgrounds. If a style is set to have draw:fill="solid" and a derived style to draw:fill="none" then the derived one must have fo:background-color="transparent" to override the parent for old consumers like LO <= 4.3/AOO <= 4.1 that don't understand draw:fill. Change-Id: I5b56c7ace927338239195c6bfcfef1950544c8d2 (cherry picked from commit 25c50a71ffdf7c43f8f3dd10736188271cc75ef0) Reviewed-on: Reviewed-by: Caolán McNamara <> Tested-by: Caolán McNamara <>
2015-08-29tdf#92379: sw: ODF import: fix fo:background-color="transparent"Michael Stahl2-1/+68
The problem is that if the FillStyle is NONE, setting only ParaBackTransparent but not ParaBackColor does absolutely nothing. This means that if a parent style sets a background color, then a derived style cannot override it to be transparent. Cause is that getSvxBrushItemFromSourceSet() defaults to setting a 0xFF transparency on the SvxBrushItem. There is still a problem that getSvxBrushItemFromSourceSet() sets the pool default item's color and that is also exported to ODF again as draw:fill-color, but together with draw:fill="none" it should not cause harm, at least for consumers that prefer draw:fill attributes like LO >= 4.4. (regression from 7d9bb549d498d6beed2c4050c402d09643febdfa) Change-Id: I5312901166a0e6f0cf02369b173dc8498e4113ed (cherry picked from commit f38f018053a43d1f7b473103e936abe2d4d8fa05) Reviewed-on: Reviewed-by: Caolán McNamara <> Tested-by: Caolán McNamara <>
2015-08-29tdf#92379: svx: don't overwrite fo:background-color on ODF importMichael Stahl2-0/+71
getSvxBrushItemFromSourceSet() is called once for each property of a frame style that is set, and the "solid" fill-style is set by first applying the BackColorRGB and then BackTransparency property. So there is an intermediate state that has fill-style NONE but a XFillColorItem set - don't reset the color to white in that case! Apparently writerfilter generally relies on the current reset-to-AUTO implementation (loads of test failures), so for now limit the fix for when we know that a frame style is imported from ODF. (regression from 3d399b0e45720354fc64dc3d121ee486e01eff89) (cherry picked from commit 79fb61efb847405fa47235002b52ee8efad5e339) tdf#92379: sw: unit test for frame style background color (cherry picked from commit 982537d77c2db463cc053cfdcd522530a3834c9e) Change-Id: Ia987fe586ec819a1f3cd85acdbfb03c74ca0ec2c Reviewed-on: Reviewed-by: Caolán McNamara <> Tested-by: Caolán McNamara <>
2015-08-20tdf#89720 sw: do not create text range overlay for reply annotationsMiklos Vajna2-0/+21
Regression from commit 0761f81643a6890457e9ef7d913ab5c88c2593a4 (123792: complete annotations on text ranges feature, 2013-12-19), the problem was that in case a comment had a reply, then both comments produced its range overlay, and this repeated semi-transparent overlay resulted in dark color. Go back to the old behavior of just painting the overlay for the non-reply comment; for real, partly overlapping comments showing the exact boundaries of the overlapping overlays still makes sense. (cherry picked from commit 780dd8c1cf5302ca503cf7b55357dace4d69beb9) Conflicts: sw/qa/extras/uiwriter/uiwriter.cxx Change-Id: Ic2673a1a41146ff547262ba681b34a63f41aa8ff Reviewed-on: Reviewed-by: Caolán McNamara <> Tested-by: Caolán McNamara <>
2015-08-17tdf#90575 sw: fix pasting DDE linksMiklos Vajna1-0/+40
Regression from commit 0761f81643a6890457e9ef7d913ab5c88c2593a4 (123792: complete annotations on text ranges feature, 2013-12-19), the problem was that the added additional IDocumentMarkAccess::GetType() check in lcl_FindDdeBookmark(), which means that the function no longer finds bookmarks with the matching name, only real DDE marks. This is a problem, as SwTrnsfrDdeLink::WriteData() depends on the fact that sw::mark::Bookmark inherits from sw::mark::DdeBookmark. As a result, the fast IDocumentMarkAccess::GetType() (that intentionally doesn't handle inheritance for performance reasons) can't be used here. (cherry picked from commit e06e2cb18874987d2dafd4faa0a8b71fc0aa6453) Conflicts: sw/qa/extras/uiwriter/uiwriter.cxx sw/source/core/doc/DocumentLinksAdministrationManager.cxx Change-Id: I2b7a07c18b641ac991f3227812a609dedc960e08 Reviewed-on: Reviewed-by: Caolán McNamara <> Tested-by: Caolán McNamara <>
2015-08-17tdf#86374 DOCX import: fix btLr text table direction without <w:cantSplit/>Miklos Vajna2-0/+10
Commit 0208ead70a9412ccd554fcef3e9308f8ca17037b (DOCX import: improve btLr table cell support, 2013-02-22) made any table row that has at least one btLr cell fixed height. This causes problems in case a table has a minimal height with lots of content, where the fixed height gives wrong layout, but the minimal height is correct. Fix the problem by only making the row fixed height if <w:cantSplit/> is set (as seen in the old bugdoc), and revert to setting the height type to minimal in any other case. (cherry picked from commit 233a634a112e6dae07dca5fb1296764cb0001503) Conflicts: writerfilter/source/dmapper/TableManager.hxx Change-Id: Ibaf91f542e64e5caa7904df97eb6eb52618e0023 Reviewed-on: Reviewed-by: Caolán McNamara <> Tested-by: Caolán McNamara <>
2015-08-10tdf#91594 misinterprets letters from Symbol font in docx filesMark Hung2-0/+17
Fix the issue caused by wrong assumption about symbol chracter and symbol font attributes order in writerfilter. Also allow symbols to be displayed if user's language is not Western. Reviewed-on: Tested-by: Jenkins <> Reviewed-by: Michael Stahl <> Conflicts: writerfilter/source/dmapper/DomainMapper.cxx Change-Id: I602d9fbfa79c33c90f655dbf5ee22738b6391ae6 Reviewed-on: Reviewed-by: Miklos Vajna <> Tested-by: Miklos Vajna <>
2015-07-29tdf#89702 DOCX import: fix too large bullet characterMiklos Vajna2-0/+14
Commit c1f8437dbed0e8b989e41a345ef7e658a6e8a4cd (fdo#83465 RTF import: handle font of numbering, 2014-09-25), changed the "get the me character style of the current numbering's current level" member function to be successfull even in case we're inside a DOCX run, not when we're inside a DOCX paragraph, but outside runs. While this is necessary for RTF, the side effect of this was that unwanted run properties started to affect the above mentioned character style in case of DOCX. Fix the problem by enabling the "in paragraph and run" looking for RTF only. Change-Id: I610bfce6cec15b918fe547402360f5a894401f7e (cherry picked from commit fc7c1a07d0d5e21a4e1533a0e5b0ac256763f973) Reviewed-on: Reviewed-by: Jan Holesovsky <> Tested-by: Jan Holesovsky <>
2015-07-24tdf#90046: RTF import: ensure that a run is started before \footnoteMichael Stahl2-0/+17
Avoids crashing with empty context stacks. Change-Id: I0ee8b457fdbb19b55f5c15876b7253680cde6e23 (cherry picked from commit a61fd02c819433a1206b3b3e61017ba2d0d3d467) Reviewed-on: Reviewed-by: Caolán McNamara <> Tested-by: Caolán McNamara <>
2015-07-17oox: fix invalid mime type "image/tif"Michael Stahl1-1/+1
(regression from ccfc02f7691848284403d339ee17054169fbff1d) Change-Id: I29a366228bf08f29edfa4a8e963889e34aa3d2ea (cherry picked from commit f18ca153aac53408284062309db513ab73f7dd2c) Reviewed-on: Reviewed-by: Adolfo Jayme Barrientos <> Tested-by: Adolfo Jayme Barrientos <>
2015-07-09tdf#90611 DOCX import: fix missing paragraph style on footnotesMiklos Vajna2-0/+10
One one hand, a problem since commit 330b860205c7ba69dd6603f65324d0f89ad9cd5f (fdo#68787 DOCX import: handle when w:separator is missing for footnotes, 2013-09-04) was that the type attribute from <w:footnote w:type="separator"> resulted in two ooxml:CT_FtnEdn_type tokens, ignoring too many paragraph ends for footnotes, which resulted in missing paragraph style on footnotes. On the other hand, fixing the first problem showed that it wasn't correct that commit 9389cf78e304a5a99bcf1745b9388e14ac36281a (cp#1000018 RTF import: empty para at the end of footnote text got lost, 2013-11-15) unconditionally removed the RemoveLastParagraph() call in DomainMapper_Impl::PopFootOrEndnote(). It turns out that RTF and DOCX have different semantics here, the footnote is always within a <p></p> pair in DOCX, while in RTF a \par at the end of a footnote means an empty paragraph. Fix that by conditionally restoring the removed RemoveLastParagraph() call. (cherry picked from commit 519b34300f73b1e08f6194d6ba49d4fc010cf186) Change-Id: I33020ac761c94addfec8164a17863565e4453b07 Reviewed-on: Reviewed-by: Caolán McNamara <> Tested-by: Caolán McNamara <>
2015-07-08tdf#89890 DOCX import: fix too large num pic bulletMiklos Vajna3-1/+24
Reading SwWW8ImplReader::CoreLoad()'s "update graphic bullet information" block, it turns out that the numbering picture bullet's height should be independent from the supplied bitmap, and only its aspect ratio should be respected. Reviewed-on: Reviewed-by: Miklos Vajna <> Tested-by: Jenkins <> (cherry picked from commit eab89b7f024a8c86decdcb3362c40c40a7df37df) Conflicts: sw/qa/extras/ooxmlexport/ooxmlexport.cxx Change-Id: I1300aa0397a8098df2a3170af795fbba47fd2a9e Reviewed-on: Reviewed-by: Caolán McNamara <> Tested-by: Caolán McNamara <>
2015-07-07tdf#89698 DOCX import: inline picture should have no spacingMiklos Vajna1-2/+2
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: Reviewed-by: Michael Stahl <> Tested-by: Michael Stahl <>
2015-07-07tdf#92281 - FILEOPEN: Only western font is set for symbols in DOC filesMark Hung2-0/+8
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: Tested-by: Jenkins <> Reviewed-by: Miklos Vajna <> Conflicts: sw/source/filter/ww8/ww8par6.cxx Change-Id: I7a61868e8078c81c68e471760f080b3ce7df589f Reviewed-on: Reviewed-by: Christian Lohmaier <> Tested-by: Christian Lohmaier <>
2015-07-03tdf#87460 DOCX import: fix missing endnote in floattableMiklos Vajna2-0/+9
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: Reviewed-by: Caolán McNamara <> Tested-by: Caolán McNamara <>
2015-06-30tdf#92061 RTF import: fix missing body text after footnoteMiklos Vajna2-0/+11
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: Reviewed-by: Caolán McNamara <> Tested-by: Caolán McNamara <>
2015-06-23tdf#91228: need to check the format's IsLockModified(), not the node'sMichael Stahl2-0/+9
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 <> (cherry picked from commit f36ac1aa3bef5ba218f3dae24f260ce7e4afba95) Change-Id: Ib3236f289c2c4202d48ac378a53ce02130d4ce2c Reviewed-on: Reviewed-by: Miklos Vajna <> Tested-by: Miklos Vajna <>
2015-06-16tdf#82553 DOCX import: handle table margin when converting floattablesMiklos Vajna2-0/+9
(cherry picked from commit 292ec5fe8d01af6119325f1a426422bb42e58615) Conflicts: sw/qa/extras/ooxmlimport/ooxmlimport.cxx Change-Id: I7a3a233a34453153b3e1c0fe3d60bb0ede65dc86 Reviewed-on: Reviewed-by: Caolán McNamara <> Tested-by: Caolán McNamara <>
2015-06-11tdf#90315 RTF import: fix \colsx default valueMiklos Vajna2-0/+13
See SectPageInformation::mnColsx on the libreoffice-3-6 branch + the spec agrees, too. Change-Id: I6f70a125f8d962621f319e3e75e2865e5f126859 (cherry picked from commit e18adb7369d140f33b947668a69da2fa78738e7b) Reviewed-on: Reviewed-by: Michael Stahl <> Tested-by: Michael Stahl <>
2015-06-08tdf#87574 - Outline numbering "None" is not retained in docxMark Hung2-0/+6
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: (cherry picked from commit 7f126fc8570da5c7275a4d4efe019b9ea3b5b073) Signed-off-by: Andras Timar <> Conflicts: sw/qa/extras/ooxmlexport/ooxmlexport.cxx Change-Id: I0876ecd982cfd8d97887495b23af0e0370821101 Reviewed-on: Reviewed-by: Andras Timar <> Tested-by: Andras Timar <>
2015-06-04sw: fix Win-x86@51-TDF buildMiklos Vajna1-0/+4
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: Reviewed-by: Michael Stahl <> Tested-by: Michael Stahl <>
2015-06-03tdf#86814 RTF import: fix sometimes lost bold styleMiklos Vajna2-0/+14
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: Reviewed-by: Caolán McNamara <> Tested-by: Caolán McNamara <>
2015-06-02tdf#70318 tdf#90260 writerfilter: pasted RTF documents may contain no \parMiklos Vajna4-2/+23
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 <> 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: Reviewed-by: Caolán McNamara <> Tested-by: Caolán McNamara <>
2015-05-28tdf#91074 RTF import: handle \dplineco* for text framesMiklos Vajna2-0/+14
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: Reviewed-by: Caolán McNamara <> Tested-by: Caolán McNamara <>
2015-05-27tdf#90421 RTF export: ignore hyperlinks without an URLMiklos Vajna3-0/+37
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: Reviewed-by: Thorsten Behrens <> Tested-by: Thorsten Behrens <>
2015-05-26fix assert on export of ooo40760-1.sxw to docxCaolán McNamara2-0/+8
and a pile more Change-Id: I7334233c789bb0ed7a60387ef7d84dd34ab5a187 (cherry picked from commit 3185b6c8caf97afa602c864f588d079cbbe04038) Reviewed-on: Tested-by: David Tardon <> Reviewed-by: David Tardon <>
2015-05-25tdf#91261: DOCX import: snapGrid property of paragraphs are ignoredMark Hung2-0/+19
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: 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: Reviewed-by: Michael Stahl <> Tested-by: Michael Stahl <> (cherry picked from commit b7c8c337d4ffad55fe111c9634c4c04afce78bad) Conflicts: sw/qa/extras/ooxmlexport/ooxmlexport.cxx Change-Id: I446b4c64c0ed86960896bcd61a1006c9173a757a Reviewed-on: Reviewed-by: Caolán McNamara <> Tested-by: Caolán McNamara <>
2015-05-19tdf#90905 fix for url encoding in internal urlsVasily Melenchuk2-0/+9
Do not try to use INetURLObject class for encoding of internal document links. External URLs are encoded as before. Change-Id: I90621819ed21c3f793171ac4ab3fc7d49ac69f56 Reviewed-on: Tested-by: Jenkins <> Reviewed-by: Michael Stahl <> (cherry picked from commit d82c035953347a19bbbc5eda61e1c9389bf3b73b) Signed-off-by: Michael Stahl <>
2015-05-18tdf#91140: ODF import: try to ignore invalid draw:fill="solid"Michael Stahl1-1/+1
... 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: Reviewed-by: Caolán McNamara <> Tested-by: Caolán McNamara <>
2015-04-30Resolves: tdf#85769 fix duplicate attribute export to docx...Caolán McNamara2-2/+10
with ooo69297-4.odt (cherry picked from commit 870a7ee60ab01246ad8d9beae5705f59c6b73cbf) Conflicts: sw/qa/extras/ooxmlexport/ooxmlexport5.cxx Change-Id: I193099d7fffc160f0198e3d42d5d6fd5835c79cf Reviewed-on: Reviewed-by: Miklos Vajna <> Tested-by: Miklos Vajna <>
2015-04-24tdf#80708 RTF export: fix unexpected table row breakMiklos Vajna2-0/+26
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: Reviewed-by: Caolán McNamara <> Tested-by: Caolán McNamara <>
2015-04-22tdf#86182 RTF import: fix handling of \rtlparMiklos Vajna2-0/+11
Commit 558d5c25a0b1d6a937d33291a4b6cd7fca6cb15b (implement RTF_LTRPAR and RTF_RTLPAR, 2011-06-09) was just a guess, this one is the proper mapping. (cherry picked from commit 4ee2a882dddb395a816cd54004b634d57cfb2446) Conflicts: sw/qa/extras/rtfimport/rtfimport.cxx writerfilter/source/rtftok/rtfdocumentimpl.cxx Change-Id: I1156ef5ddc34264d761d3e64dd0537bc6ec0ced7 Reviewed-on: Reviewed-by: Michael Stahl <> Tested-by: Michael Stahl <>
2015-04-14tdf#89478: svx: ODF import: SvxBrushItem Graphics should override ColorMichael Stahl2-0/+6
The bugdoc has: <style:page-layout-properties fo:background-color="#007f7f" > <style:background-image xlink:href="Pictures/2000003900002FA3000055F455EC9F63.svm"/> </style:page-layout-properties> In this case it's clearly better to prefer the Graphics. The old code could actually store both in the model but the UI only allows setting either Color or Graphic, so this should be good enough. (regression from 7d9bb549d498d6beed2c4050c402d09643febdfa) Change-Id: Id33231ad90815d9791f90289fb0b55455d334c14 (cherry picked from commit b82791e3c586d6e4247d0eb1bb94681bcb113762) Reviewed-on: Reviewed-by: Caolán McNamara <> Tested-by: Caolán McNamara <>
2015-04-14tdf#88337 tdf#89193: sw: add missing SwXPageStyle propertiesMichael Stahl2-0/+11
Add the fill style properties so background images etc. are not lost. (regression from 7d9bb549d498d6beed2c4050c402d09643febdfa) Change-Id: I517350eec2f32e4b4bb80427666aad23a31d666a (cherry picked from commit 65a56636a68451d15499a37c2d5bd9efb71b1279) Reviewed-on: Reviewed-by: Caolán McNamara <> Tested-by: Caolán McNamara <>
2015-04-14tdf#90230 SwDoc::AppendDoc: take care of marks when inserting page breakMiklos Vajna2-0/+5
SwDoc::AppendDoc() inserts nodes from an other document, and before doing that, it inserts a page break at the end of the document. In case there are marks at the end of the last paragraph, the insertion of the page break moves them to the next page. This is a rare situation, but happens e.g. when the source document is an empty one: then MM puts a mark at the first paragraph of each inserted MM part, and then the first paragraph == the last paragraph, so the mark of the only paragraph in the document gets moved to the next page. This is a problem on its own, but is detected by the SwIndexReg dtor when that empty paragraph gets deleted later in SwNodes::Delete() called by SwDoc::AppendDoc(), resulting in an assertion failure. Triggered by commit a305a2c91420652db450b7f8edd140e1d69f42cf (use bookmarks to mark mailmerge parts in a mailmerge document (fdo#80823), 2014-10-20), these not adjusted bookmarks were not detected before. (cherry picked from commit 2819ee71da631116662401f14f8a0fb78c2a7f3a) Conflicts: sw/qa/extras/mailmerge/mailmerge.cxx Change-Id: I89775b477a2fd3182b2bc87144aed2bfe7912aff Reviewed-on: Reviewed-by: Caolán McNamara <> Tested-by: Caolán McNamara <>
2015-04-14Resolves: tdf#90130 don't clobber new solid-color on seeing old transparencyCaolán McNamara3-0/+20
...and tdf#90130 gradient transparency goes missing (cherry picked from commit bc892b04144d82507ccd59953c9f4da357c2e7b4) Change-Id: I1ea86dca37cbce416564c5e198779dd132125b02 Reviewed-on: Tested-by: Michael Stahl <> Reviewed-by: Michael Stahl <>
2015-04-13tdf#75614 RTF import: fix missing text after footnoteMiklos Vajna2-0/+24
(cherry picked from commit cec5f2eab25578a9859134d697c200089c597faa) Conflicts: sw/qa/extras/rtfimport/rtfimport.cxx Change-Id: I5901094cb603c35a1cd8ac718fd434a9dd55729b Reviewed-on: Tested-by: David Tardon <> Reviewed-by: David Tardon <>
2015-04-11tdf#89214 SwDoc::GetUniqueNumRuleName: always return pChkStr if it's unusedMiklos Vajna2-0/+12
Regression from commit bb00a0097900ae054401f7758a915047cfde4065 (do not bother with nice unique names during mailmerge, 2014-11-08), SwAttrSet::CopyToModify() expects that in case SwDoc::FindNumRulePtr() returns 0 for a name, then the call to SwDoc::MakeNumRule() will use the not found name (as SwDoc::GetUniqueNumRuleName() will return the just checked name). As a result, simply always returning a random unique name during mail merge is a problem. Only return a cheap random unique name if no hint is given. (cherry picked from commit ceafd0a76fb062237f627cd9d49d4aad78cf3066) Conflicts: sw/qa/extras/mailmerge/mailmerge.cxx Change-Id: I49d65009ced97d00aa2e8db35a529f2f30ac9ae5 Reviewed-on: Reviewed-by: Caolán McNamara <> Tested-by: Caolán McNamara <>
2015-04-09tdf#89802: xmloff: fix ODF import of frame with empty style name refMichael Stahl2-0/+68
draw:fill-gradient-name="" in the graphic properties now causes BaseFrameProperties_Impl::FillBaseProperties() to fail and prevent insertion of the SwXTextFrame. (regression from 6e61ecd09679a66060f932835622821d39e92f01) (cherry picked from commit db1d278dcc308c73eb5edebc20481c96e7f479d8) Change-Id: I9b4f3ddb0f0e1b3a80e86bbdc1af2dade1c8edf7 Reviewed-on: Tested-by: Caolán McNamara <> Reviewed-by: Caolán McNamara <>