summaryrefslogtreecommitdiff
path: root/sw
AgeCommit message (Collapse)Author
2015-10-14tdf#77014 fix input field breaking of words at new lineTomaž Vajngerl
SwTextInputFieldPortion::Format has previously tried to erase the input field special chars, which caused the words not breaking as expected or in the same way as normal text. It appears that it is actually not necessary to do this at all so just calling the super class method SwTextPortion::Format does the job and fixes the problem. After testing I could not find anything that is obviously wrong. (cherry picked from commit 5e1714fd7fcb45fa5f1220d892dba597da40b500) Change-Id: Ie763f55ad55863dd224425dc481b7100deb639fa Reviewed-on: https://gerrit.libreoffice.org/19357 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Reviewed-by: Jan Holesovsky <kendy@collabora.com> Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com> Tested-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com>
2015-10-14tdf#94804 sw: allow duplicate heading cross reference bookmarksMichael Stahl
... 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 (cherry picked from commit 495af52ac43aaa94c32691c0bd4de2f97ad1a28a) Reviewed-on: https://gerrit.libreoffice.org/19341 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com> Tested-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com>
2015-10-14tdf#94804: prefix to save cross reference bookmark fixedOliver Specht
bookmarks as references to numbered paragraphs are now saved using the prefix '__RefNumPara__' as the import already expects Change-Id: I6f7c41e95fa9f936a7eb21d4cb7461d4575c492a Reviewed-on: https://gerrit.libreoffice.org/19229 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Stahl <mstahl@redhat.com> (cherry picked from commit 85eb4d9514858c71fb22c5ed93d651ea24bc6c05) Reviewed-on: https://gerrit.libreoffice.org/19338 Tested-by: Michael Stahl <mstahl@redhat.com> (cherry picked from commit bdc5aab39be149b2fc7d37520414ae251341bc14) Reviewed-on: https://gerrit.libreoffice.org/19340 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com> Tested-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com>
2015-10-14tdf#94679 Writer: fix lost selection with Shift-PageDownJustin Luth
Push/Pop-ing the cursor led to selection loss. SelectHiddenRange() immediately returns false if the current cursor hasMark(), so avoid all of the bugs and expensive push/pop routines when there is a mark already. Change-Id: I4624a3e0b2267942812d0429d527ad97962ec7fc Reviewed-on: https://gerrit.libreoffice.org/19108 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com> (cherry picked from commit fb62052d5ac069d700a5410db35d6949a4c4008b) Reviewed-on: https://gerrit.libreoffice.org/19279 Reviewed-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com> Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com> Tested-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com>
2015-10-01tdf#92521 DOCX export: handle section break right after a tableMiklos Vajna
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: https://gerrit.libreoffice.org/18901 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2015-10-01bnc#939996 tdf#93919 DOCX import: fix left-from-style and first-from-directMiklos Vajna
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: https://gerrit.libreoffice.org/18907 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2015-09-28Fix tdf#87500 - Freeze with English/Japanese mixture undo.Mark Hung
Language poolitem will be inserted after user completes editing with IME, making it refer to valid range when undo. Reviewed-on: https://gerrit.libreoffice.org/18392 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com> Conflicts: sw/source/core/doc/extinput.cxx Change-Id: Id2876aa74dba6f7d134b8e2df4d9b36a8f429bb1 Reviewed-on: https://gerrit.libreoffice.org/18894 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Miklos Vajna <vmiklos@collabora.co.uk>
2015-09-23don't hang on busted subdocument offsetsCaolán McNamara
Change-Id: I5d1d18f864496ec98894703f0a22e211a9dd14a5 (cherry picked from commit a2b90cd04733c2ec3b9cb3bb56d95f3298571ecc) Reviewed-on: https://gerrit.libreoffice.org/18748 Reviewed-by: David Tardon <dtardon@redhat.com> Tested-by: David Tardon <dtardon@redhat.com>
2015-09-17tdf#92586 xmloff: fix import of stretched background imageMiklos Vajna
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: https://gerrit.libreoffice.org/18606 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2015-09-15tdf#79018: Prevent line break as footnote labelOliver Specht
footnote labels must not contain line breaks Reviewed-on: https://gerrit.libreoffice.org/18292 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de> (cherry picked from commit 089d7f53ea232972961c14706a54187f075fa973) Reviewed-on: https://gerrit.libreoffice.org/18297 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com> (cherry picked from commit adf39dbade8652ceca9007484bfa20f04c5ebec0) Signed-off-by: Michael Stahl <mstahl@redhat.com> Change-Id: I00d334197b960c4ed17fdee3ea8a1c734cbfa4c1
2015-09-15tdf#93449 Internal hyperlinks are not exported corectly in HTMLVasily Melenchuk
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: https://gerrit.libreoffice.org/17993 Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de> Tested-by: Thorsten Behrens <Thorsten.Behrens@CIB.de> (cherry picked from commit fd3468024e1ac199f4a2f4108321ef8100d58414) Signed-off-by: Michael Stahl <mstahl@redhat.com>
2015-09-15tdf#83227 oox: reuse RelId in DML/VML export for the same graphicMiklos Vajna
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: https://gerrit.libreoffice.org/18581 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2015-09-12Revert "Fix single node CopyRange"Michael Stahl
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: https://gerrit.libreoffice.org/18510 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2015-09-09stray debugging linesCaolán McNamara
(cherry picked from commit b95175cc41f96ce669d2a4d4c55034c1f80ac74b) Change-Id: I525009b9d037387b236cb4605fe0b93c94858d89
2015-09-03Related: tdf#93676 special 255 Percent Flag should not be exported to docxCaolán McNamara
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: https://gerrit.libreoffice.org/18303 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Miklos Vajna <vmiklos@collabora.co.uk>
2015-09-03doc para property ranges cannot be 0 lengthCaolán McNamara
Change-Id: If946204873343d8bbc0c1d391ca2c65d8b2f8561 (cherry picked from commit ed7d22049596ac91ad75bfad1a5675c13714e203) Reviewed-on: https://gerrit.libreoffice.org/18300 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Miklos Vajna <vmiklos@collabora.co.uk>
2015-09-03tdf#87922 SwDrawTextInfo::ApplyAutoColor: handle fill attributesMiklos Vajna
With this, if page background is set to e.g. black, then automatic color of text is again white, not black. (cherry picked from commit d48d0e81971266ff4625721b0f069a62ec7014e2) Change-Id: I8246fa4b7834f60872b0737f03906ccc86948cc1 Reviewed-on: https://gerrit.libreoffice.org/18293 Reviewed-by: Michael Stahl <mstahl@redhat.com> Tested-by: Michael Stahl <mstahl@redhat.com>
2015-09-03tdf#87924 DOCX import: rot=90 and vert=vert270 means no text rotationMiklos Vajna
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: https://gerrit.libreoffice.org/18274 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2015-09-02tdf#92612 Right-clicking after applying "paint buckets" leads to multiple UndoAshod Nakashian
In paint bucket mode the user can undo by right-clicking. Undoing, however, is only possible after the first paint op. After undoing is enabled, the user can undo indefinetely by righ-clicking. This is not consistent and can be confusing. This patch tracks the changes done after entering the paint bucket mode, and allows the user to undo them using right-clicking until they reach the first operation before entering this context. Because the user can undo/redo using other means, the patch takes it into account and will reset its tracking to accomodate this. Ultimately, the user is able to make any changes in paint bucket mode and undo them all by right-clicking, but no further than that. Reviewed-on: https://gerrit.libreoffice.org/16951 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de> (cherry picked from commit d0489d0827fc6cef04d0f3602023d82ceda82480) Change-Id: I93380fb60db83aee37a1d324218ba6ab1700a2e5 Reviewed-on: https://gerrit.libreoffice.org/18256 Reviewed-by: Michael Stahl <mstahl@redhat.com> Tested-by: Michael Stahl <mstahl@redhat.com>
2015-09-02detect if new offsets are the same as the previous ones and avoid loopCaolán McNamara
Change-Id: I4c53d4bce9a69d79e34bdd634c296d9b495e1904 (cherry picked from commit 137cf76573c89ea1b0b1f716a50731419a187473) Reviewed-on: https://gerrit.libreoffice.org/18275 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Miklos Vajna <vmiklos@collabora.co.uk>
2015-09-02check for over long record len and check readsCaolán McNamara
Change-Id: Ib77ce1b95db2dc4396f4fd2fdcff4c0344b20c9e (cherry picked from commit 0c191e2b757555b147ebab1688e72acde28062a1) Reviewed-on: https://gerrit.libreoffice.org/18180 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Miklos Vajna <vmiklos@collabora.co.uk>
2015-09-02check for ridiculous lengths and check stream statusCaolán McNamara
Change-Id: Iefe943794e005f03b2a6ea5fc642b8c3d21b3334 (cherry picked from commit 858257d465b7e7ce54819cc2f631efcb20632863) Reviewed-on: https://gerrit.libreoffice.org/18174 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Miklos Vajna <vmiklos@collabora.co.uk>
2015-09-02tdf#88986 sw: add missing XPropertyList pool items on TextFrame insertionMiklos Vajna
Regression from commit 6e61ecd09679a66060f932835622821d39e92f01 (Merge back branch alg_writerframes to trunk, 2014-03-19), the problem was while SwFrameShell::Execute() was modified to put the various pool items related to fill types (colors, gradients, etc) to the item set of the dialog, the same was missing in SwTextShell::ExecInsert(), so colors were missing on inserting a new frame, but not when editing an existing one. (cherry picked from commit 6c3ca675509101732d3d878d6ceb6226026cd9ac) Conflicts: sw/inc/drawdoc.hxx Change-Id: Id009f914c1c3b6509e31a4887e32a00624678cf4 Reviewed-on: https://gerrit.libreoffice.org/18232 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2015-08-29ODF import: workaround dubious draw:fill="solid" on frame stylesMichael Stahl
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: https://gerrit.libreoffice.org/18045 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2015-08-29related: tdf#92379: sw: backward compatible ODF export of overridingMichael Stahl
... 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: https://gerrit.libreoffice.org/18044 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2015-08-29tdf#92379: sw: ODF import: fix fo:background-color="transparent"Michael Stahl
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: https://gerrit.libreoffice.org/18043 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2015-08-29tdf#92379: svx: don't overwrite fo:background-color on ODF importMichael Stahl
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: https://gerrit.libreoffice.org/18042 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2015-08-29sw: Flat ODF import: set the InReading and InXMLImport flagsMichael Stahl
Flat ODF Import does not use SwReader but uses SwXMLImport::startDocument() and SwXMLImport::endDocument() to set up the document, so make sure those set the import relevant SwDoc flags. (cherry picked from commit 27a02d1708be7812668a84ea956edc8ecb312246) Change-Id: Ife3e58eeebd73ad895fe328662822b847cf9bfec Reviewed-on: https://gerrit.libreoffice.org/18041 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2015-08-26there may be no storage available in older formatsCaolán McNamara
(cherry picked from commit 666fb214e93d542dd80e48b9e008727129b5764f) Change-Id: I23cbaf7fc1320168eb75ca33fd6d704125508785 Reviewed-on: https://gerrit.libreoffice.org/17987 Reviewed-by: David Tardon <dtardon@redhat.com> Tested-by: David Tardon <dtardon@redhat.com>
2015-08-26behave like the native format filter for non-insert modeCaolán McNamara
just shove the unneeded pam into dead space (cherry picked from commit d9edac5d58aa3c4f15cf4022a1faf776d3003e78) Change-Id: Id0a3d550cd9d54394888e6b2d62e21eaded24a7c Reviewed-on: https://gerrit.libreoffice.org/18019 Reviewed-by: David Tardon <dtardon@redhat.com> Tested-by: David Tardon <dtardon@redhat.com>
2015-08-26we only need the PaM for its Point and only to create a uno cursorCaolán McNamara
so do that in the ctor and drop the arg from a bunch of places (cherry picked from commit 3d992d77d8ae319b31dca808e8c08f439a1bc9c3) Change-Id: Iaad71e9854b38d8632df057dfe9c96468d1d0098 Reviewed-on: https://gerrit.libreoffice.org/18018 Reviewed-by: David Tardon <dtardon@redhat.com> Tested-by: David Tardon <dtardon@redhat.com>
2015-08-26ensure editeng str len is in sync with attributesCaolán McNamara
for the duration of inserting attributes, and excess dos newline chars can be removed safely afterwards (cherry picked from commit cc596d8d0f2f896d000833ffcba0035e3812c657) Change-Id: If70e34fec1c0819f827f483d3d7ac4f19b3caef8 Reviewed-on: https://gerrit.libreoffice.org/17988 Reviewed-by: David Tardon <dtardon@redhat.com> Tested-by: David Tardon <dtardon@redhat.com>
2015-08-25tdf#91969: Parts of paragraph border is missingZolnai Tamás
...when border is around more than one paragraph Regression from: 16f637dab3c1b5f7ac9eacf2c57347800d3fdf09 Change-Id: Iea9455dd7cc3c301c3e2d5d7903c98d98e515595 (cherry picked from commit 8d933132ab01f0070225fae6cf704c9a1982e8f8) Reviewed-on: https://gerrit.libreoffice.org/17996 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2015-08-25Handle non-aligned FFNsStephan Bergmann
...as found by UBSan in CppunitTest_sw_filters_test (see below), and at the same time limit reads within the pA array to its bounds. > Testing file:///.../sw/qa/core/data/ww6/pass/crash-2.doc: > sw/source/filter/ww8/ww8scan.cxx:6473:32: runtime error: upcast of misaligned address 0x6200000e70e7 for type 'WW8_FFN_Ver6', which requires 2 byte alignment > 0x6200000e70e7: note: pointer points here > 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0e 00 00 6a 00 00 00 00 0e 00 00 6a 00 00 00 6a > ^ > WW8Fonts::WW8Fonts(SvStream&, WW8Fib&) sw/source/filter/ww8/ww8scan.cxx:6473:32 > SwWW8ImplReader::CoreLoad(WW8Glossary*, SwPosition const&) sw/source/filter/ww8/ww8par.cxx:4961:20 > SwWW8ImplReader::LoadThroughDecryption(SwPaM&, WW8Glossary*) sw/source/filter/ww8/ww8par.cxx:5767:19 > SwWW8ImplReader::LoadDoc(SwPaM&, WW8Glossary*) sw/source/filter/ww8/ww8par.cxx:6039:19 > WW8Reader::Read(SwDoc&, rtl::OUString const&, SwPaM&, rtl::OUString const&) sw/source/filter/ww8/ww8par.cxx:6157:20 > SwReader::Read(Reader const&) sw/source/filter/basflt/shellio.cxx:175:18 > SwDocShell::ConvertFrom(SfxMedium&) sw/source/uibase/app/docsh.cxx:258:22 > SfxObjectShell::DoLoad(SfxMedium*) sfx2/source/doc/objstor.cxx:790:23 > SwFiltersTest::filter(rtl::OUString const&, rtl::OUString const&, rtl::OUString const&, SfxFilterFlags, SotClipboardFormatId, unsigned int, bool) sw/qa/core/filters-test.cxx:112:20 > SwFiltersTest::load(rtl::OUString const&, rtl::OUString const&, rtl::OUString const&, SfxFilterFlags, SotClipboardFormatId, unsigned int) sw/qa/core/filters-test.cxx:71:12 > test::FiltersTest::recursiveScan(test::filterStatus, rtl::OUString const&, rtl::OUString const&, rtl::OUString const&, SfxFilterFlags, SotClipboardFormatId, unsigned int, bool) unotest/source/cpp/filters-test.cxx:129:20 > test::FiltersTest::testDir(rtl::OUString const&, rtl::OUString const&, rtl::OUString const&, SfxFilterFlags, SotClipboardFormatId, unsigned int, bool) unotest/source/cpp/filters-test.cxx:154:5 > SwFiltersTest::testCVEs() sw/qa/core/filters-test.cxx:154:5 (cherry picked from commit 6373886870503a981b65f204f9113aebff540ab8) Change-Id: I31ac8dc11d985745785c9dda1cec8a11a41098bb Reviewed-on: https://gerrit.libreoffice.org/17990 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2015-08-25Handle GetBaseCp overflowStephan Bergmann
...as found by UBSan in CppunitTest_sw_filters_test (see below); note the TODOs how best to report the errors up the call stack. > Testing file:///.../sw/qa/core/data/ww6/pass/crash-3.doc: > sw/source/filter/ww8/ww8scan.cxx:5240:63: runtime error: signed integer overflow: 1766665948 + 1768712052 cannot be represented in type 'int' > WW8Fib::GetBaseCp(ManTypes) const sw/source/filter/ww8/ww8scan.cxx:5240:63 > SwWW8ImplReader::Read_GrafLayer(long) sw/source/filter/ww8/ww8graf.cxx:2393:18 > SwWW8ImplReader::ReadChar(long, long) sw/source/filter/ww8/ww8par.cxx:3630:17 > SwWW8ImplReader::ReadChars(int&, int, long, long) sw/source/filter/ww8/ww8par.cxx:3432:27 > SwWW8ImplReader::ReadText(int, int, ManTypes) sw/source/filter/ww8/ww8par.cxx:3970:22 > SwWW8ImplReader::CoreLoad(WW8Glossary*, SwPosition const&) sw/source/filter/ww8/ww8par.cxx:5169:9 > SwWW8ImplReader::LoadThroughDecryption(SwPaM&, WW8Glossary*) sw/source/filter/ww8/ww8par.cxx:5767:19 > SwWW8ImplReader::LoadDoc(SwPaM&, WW8Glossary*) sw/source/filter/ww8/ww8par.cxx:6039:19 > WW8Reader::Read(SwDoc&, rtl::OUString const&, SwPaM&, rtl::OUString const&) sw/source/filter/ww8/ww8par.cxx:6157:20 > SwReader::Read(Reader const&) sw/source/filter/basflt/shellio.cxx:175:18 > SwDocShell::ConvertFrom(SfxMedium&) sw/source/uibase/app/docsh.cxx:258:22 > SfxObjectShell::DoLoad(SfxMedium*) sfx2/source/doc/objstor.cxx:790:23 > SwFiltersTest::filter(rtl::OUString const&, rtl::OUString const&, rtl::OUString const&, SfxFilterFlags, SotClipboardFormatId, unsigned int, bool) sw/qa/core/filters-test.cxx:112:20 > SwFiltersTest::load(rtl::OUString const&, rtl::OUString const&, rtl::OUString const&, SfxFilterFlags, SotClipboardFormatId, unsigned int) sw/qa/core/filters-test.cxx:71:12 > test::FiltersTest::recursiveScan(test::filterStatus, rtl::OUString const&, rtl::OUString const&, rtl::OUString const&, SfxFilterFlags, SotClipboardFormatId, unsigned int, bool) unotest/source/cpp/filters-test.cxx:129:20 > test::FiltersTest::testDir(rtl::OUString const&, rtl::OUString const&, rtl::OUString const&, SfxFilterFlags, SotClipboardFormatId, unsigned int, bool) unotest/source/cpp/filters-test.cxx:154:5 > SwFiltersTest::testCVEs() sw/qa/core/filters-test.cxx:154:5 Reviewed-on: https://gerrit.libreoffice.org/17965 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com> (cherry picked from commit d281b4607638231b8a3716bdc80846c24ce55cc7) Change-Id: I0b14f5c1e025565eb131e64590b7d5ff0135e767 Reviewed-on: https://gerrit.libreoffice.org/17970 Reviewed-by: David Tardon <dtardon@redhat.com> Tested-by: David Tardon <dtardon@redhat.com>
2015-08-25Handle zero nPLCFStephan Bergmann
...as found by ASan in CppunitTest_sw_filters_test: > Testing file:///.../sw/qa/core/data/ww6/pass/crash-1.doc: > ERROR: AddressSanitizer: heap-buffer-overflow on address 0x6020009382b0 at pc 0x2b1dcb5eabac bp 0x7fffe8ccbdb0 sp 0x7fffe8ccbda8 > READ of size 4 at 0x6020009382b0 thread T0 > WW8PLCF::SeekPos(int) sw/source/filter/ww8/ww8scan.cxx:2219:14 > WW8PLCF::WW8PLCF(SvStream&, int, int, int, int, int, int) sw/source/filter/ww8/ww8scan.cxx:2080:9 > WW8PLCFx_Fc_FKP::WW8PLCFx_Fc_FKP(SvStream*, SvStream*, SvStream*, WW8Fib const&, ePLCFT, int) sw/source/filter/ww8/ww8scan.cxx:2883:21 > WW8PLCFx_Cp_FKP::WW8PLCFx_Cp_FKP(SvStream*, SvStream*, SvStream*, WW8ScannerBase const&, ePLCFT) sw/source/filter/ww8/ww8scan.cxx:3088:7 > WW8ScannerBase::WW8ScannerBase(SvStream*, SvStream*, SvStream*, WW8Fib*) sw/source/filter/ww8/ww8scan.cxx:1588:20 > SwWW8ImplReader::CoreLoad(WW8Glossary*, SwPosition const&) sw/source/filter/ww8/ww8par.cxx:5022:20 > SwWW8ImplReader::LoadThroughDecryption(SwPaM&, WW8Glossary*) sw/source/filter/ww8/ww8par.cxx:5767:19 > SwWW8ImplReader::LoadDoc(SwPaM&, WW8Glossary*) sw/source/filter/ww8/ww8par.cxx:6039:19 > WW8Reader::Read(SwDoc&, rtl::OUString const&, SwPaM&, rtl::OUString const&) sw/source/filter/ww8/ww8par.cxx:6157:20 > SwReader::Read(Reader const&) sw/source/filter/basflt/shellio.cxx:175:18 > SwDocShell::ConvertFrom(SfxMedium&) sw/source/uibase/app/docsh.cxx:258:22 > SfxObjectShell::DoLoad(SfxMedium*) sfx2/source/doc/objstor.cxx:790:23 > SwFiltersTest::filter(rtl::OUString const&, rtl::OUString const&, rtl::OUString const&, SfxFilterFlags, SotClipboardFormatId, unsigned int, bool) sw/qa/core/filters-test.cxx:112:20 > SwFiltersTest::load(rtl::OUString const&, rtl::OUString const&, rtl::OUString const&, SfxFilterFlags, SotClipboardFormatId, unsigned int) sw/qa/core/filters-test.cxx:71:12 > test::FiltersTest::recursiveScan(test::filterStatus, rtl::OUString const&, rtl::OUString const&, rtl::OUString const&, SfxFilterFlags, SotClipboardFormatId, unsigned int, bool) unotest/source/cpp/filters-test.cxx:129:20 > test::FiltersTest::testDir(rtl::OUString const&, rtl::OUString const&, rtl::OUString const&, SfxFilterFlags, SotClipboardFormatId, unsigned int, bool) unotest/source/cpp/filters-test.cxx:154:5 > SwFiltersTest::testCVEs() sw/qa/core/filters-test.cxx:154:5 > 0x6020009382b1 is located 0 bytes to the right of 1-byte region [0x6020009382b0,0x6020009382b1) > allocated by thread T0 here: > operator new[](unsigned long) /home/sbergman/clang/trunk/src/projects/compiler-rt/lib/asan/asan_new_delete.cc:64 > WW8PLCF::ReadPLCF(SvStream&, int, unsigned int) sw/source/filter/ww8/ww8scan.cxx:2091:26 > WW8PLCF::WW8PLCF(SvStream&, int, int, int, int, int, int) sw/source/filter/ww8/ww8scan.cxx:2075:9 > WW8PLCFx_Fc_FKP::WW8PLCFx_Fc_FKP(SvStream*, SvStream*, SvStream*, WW8Fib const&, ePLCFT, int) sw/source/filter/ww8/ww8scan.cxx:2883:21 > WW8PLCFx_Cp_FKP::WW8PLCFx_Cp_FKP(SvStream*, SvStream*, SvStream*, WW8ScannerBase const&, ePLCFT) sw/source/filter/ww8/ww8scan.cxx:3088:7 > WW8ScannerBase::WW8ScannerBase(SvStream*, SvStream*, SvStream*, WW8Fib*) sw/source/filter/ww8/ww8scan.cxx:1588:20 > SwWW8ImplReader::CoreLoad(WW8Glossary*, SwPosition const&) sw/source/filter/ww8/ww8par.cxx:5022:20 > SwWW8ImplReader::LoadThroughDecryption(SwPaM&, WW8Glossary*) sw/source/filter/ww8/ww8par.cxx:5767:19 > SwWW8ImplReader::LoadDoc(SwPaM&, WW8Glossary*) sw/source/filter/ww8/ww8par.cxx:6039:19 > WW8Reader::Read(SwDoc&, rtl::OUString const&, SwPaM&, rtl::OUString const&) sw/source/filter/ww8/ww8par.cxx:6157:20 > SwReader::Read(Reader const&) sw/source/filter/basflt/shellio.cxx:175:18 > SwDocShell::ConvertFrom(SfxMedium&) sw/source/uibase/app/docsh.cxx:258:22 > SfxObjectShell::DoLoad(SfxMedium*) sfx2/source/doc/objstor.cxx:790:23 > SwFiltersTest::filter(rtl::OUString const&, rtl::OUString const&, rtl::OUString const&, SfxFilterFlags, SotClipboardFormatId, unsigned int, bool) sw/qa/core/filters-test.cxx:112:20 > SwFiltersTest::load(rtl::OUString const&, rtl::OUString const&, rtl::OUString const&, SfxFilterFlags, SotClipboardFormatId, unsigned int) sw/qa/core/filters-test.cxx:71:12 > test::FiltersTest::recursiveScan(test::filterStatus, rtl::OUString const&, rtl::OUString const&, rtl::OUString const&, SfxFilterFlags, SotClipboardFormatId, unsigned int, bool) unotest/source/cpp/filters-test.cxx:129:20 > test::FiltersTest::testDir(rtl::OUString const&, rtl::OUString const&, rtl::OUString const&, SfxFilterFlags, SotClipboardFormatId, unsigned int, bool) unotest/source/cpp/filters-test.cxx:154:5 > SwFiltersTest::testCVEs() sw/qa/core/filters-test.cxx:154:5 Change-Id: I97d995aad621b829b6fb6ee4622d386fec0bedea Reviewed-on: https://gerrit.libreoffice.org/17963 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com> (cherry picked from commit 1a871f9de6b23730e26fc6e4196723f67704ac8d) Reviewed-on: https://gerrit.libreoffice.org/17968 Reviewed-by: David Tardon <dtardon@redhat.com> Tested-by: David Tardon <dtardon@redhat.com>
2015-08-25loop over successfully read bookmarksCaolán McNamara
not over the amount that should be there Change-Id: Ia2c353f9d7e274a5bebf405e1743ef1d1872b4de (cherry picked from commit 02e9b490a9401744a8a0699ad5dd10281b6b0b30) Reviewed-on: https://gerrit.libreoffice.org/17960 Reviewed-by: David Tardon <dtardon@redhat.com> Tested-by: David Tardon <dtardon@redhat.com>
2015-08-25limit seeks to valid areaCaolán McNamara
(cherry picked from commit c0c9075163f06c0b5c2ad9cf428f1cfacf9fe1fb) Change-Id: I401d93491999a3fc3db4f597eea9c4fe5b9bc926 Reviewed-on: https://gerrit.libreoffice.org/17956 Reviewed-by: David Tardon <dtardon@redhat.com> Tested-by: David Tardon <dtardon@redhat.com>
2015-08-25guard against hangs with bogus unsorted plcfsCaolán McNamara
This reverts commit 6d21cbd1238556535ec1bb1adf35b25bc8eb898b. (cherry picked from commit 74c0f74422671f8005f2cfc0ae94e5656bcea31e) Change-Id: I309302ab5357b8404ee4c75bd0bfcb4f816e0588 Reviewed-on: https://gerrit.libreoffice.org/17953 Reviewed-by: David Tardon <dtardon@redhat.com> Tested-by: David Tardon <dtardon@redhat.com>
2015-08-24dismiss bad seek offsets earlyCaolán McNamara
Change-Id: Ia88bc1833d362547f45e073028203a4de581f3e2 (cherry picked from commit 8657e3795d2e0ef0653835e2d56c53512dd43aea) Reviewed-on: https://gerrit.libreoffice.org/17947 Reviewed-by: David Tardon <dtardon@redhat.com> Tested-by: David Tardon <dtardon@redhat.com>
2015-08-24fix crash with empty booknamesCaolán McNamara
Change-Id: Ifadb2129be53530720cb2023cdc0782b6e737f18 (cherry picked from commit 11e73a0880f64c99aec5059ff6122b831bc1de74) Reviewed-on: https://gerrit.libreoffice.org/17946 Reviewed-by: David Tardon <dtardon@redhat.com> Tested-by: David Tardon <dtardon@redhat.com>
2015-08-23check for bad locationsCaolán McNamara
(cherry picked from commit b164d08f0c12a3434fad1b40900ddc8cb510370c) Change-Id: I635585f664e700047d92821fb965d42b803a8a15 Reviewed-on: https://gerrit.libreoffice.org/17939 Reviewed-by: David Tardon <dtardon@redhat.com> Tested-by: David Tardon <dtardon@redhat.com>
2015-08-23check that src index is in doc rangeCaolán McNamara
(cherry picked from commit 3230c8cf1cf2dc486f038d369e7f4f44ffd6b0a7) check that dest index is in doc range (cherry picked from commit cd6c9aef7468120dd5ea5c747f35c98baf214613) Change-Id: Ic81e7a14701ff30aa46a9293dd6db351bd350ba5 3006cf03cf97399a6c418162178acdb1d41c3b23 Reviewed-on: https://gerrit.libreoffice.org/17928 Reviewed-by: David Tardon <dtardon@redhat.com> Tested-by: David Tardon <dtardon@redhat.com>
2015-08-23avoid hang in certain ww6 docsCaolán McNamara
(cherry picked from commit d0813b432f94d214a6961cb6a1eb11f65399e59b) Change-Id: Ife15f6a6e4b31c6e226a154dd708290266e86a2e Reviewed-on: https://gerrit.libreoffice.org/17927 Reviewed-by: David Tardon <dtardon@redhat.com> Tested-by: David Tardon <dtardon@redhat.com>
2015-08-21don't crash due to earlier short readsCaolán McNamara
Change-Id: I682a9bf72cbe18999c0c5acc495e813727e0e372 (cherry picked from commit 0030efe09ad9447933ac3b1875c270ed1649aee7) Reviewed-on: https://gerrit.libreoffice.org/17903 Reviewed-by: David Tardon <dtardon@redhat.com> Tested-by: David Tardon <dtardon@redhat.com>
2015-08-21fix another ww6 crashCaolán McNamara
Change-Id: I47b4ffb1d96041d51dde313c080ed1d9cd4000be (cherry picked from commit 6405203750f7f779a3655bc5f415e8e0a2071d1b) Reviewed-on: https://gerrit.libreoffice.org/17898 Reviewed-by: David Tardon <dtardon@redhat.com> Tested-by: David Tardon <dtardon@redhat.com>
2015-08-21clip text to skip to max text availableCaolán McNamara
(cherry picked from commit 684a210dd44ba5bb239eb07842ced767059a3fb8) Change-Id: I5c5c033954d5b6f869a05f19f312f9330df74efb Reviewed-on: https://gerrit.libreoffice.org/17886 Reviewed-by: David Tardon <dtardon@redhat.com> Tested-by: David Tardon <dtardon@redhat.com>
2015-08-21if read string was truncated, then truncate attributes range to matchCaolán McNamara
(cherry picked from commit 6071feec26743dacff1060658e57d5cf62cde2a8) Change-Id: I3501d31e0310481a5872e537bf53ad2faaf25779 Reviewed-on: https://gerrit.libreoffice.org/17895 Reviewed-by: David Tardon <dtardon@redhat.com> Tested-by: David Tardon <dtardon@redhat.com>
2015-08-21add ww6 test dir and fix a crashCaolán McNamara
Change-Id: Id08176640672095c03e0b124cd65a9dce26ac2db (cherry picked from commit 42a709d1ef647aab9a1c9422b4e25ecaee857aba) Reviewed-on: https://gerrit.libreoffice.org/17890 Reviewed-by: David Tardon <dtardon@redhat.com> Tested-by: David Tardon <dtardon@redhat.com>
2015-08-20it's no use to check for stream status after a seekCaolán McNamara
seek resets failures, need to check after a read and before a seek Change-Id: Ia249e258c51af5efc838f92c4ead6237b403c701 (cherry picked from commit 170ff56b1b99ec451e9adbc9ae9c2a94dd47a692) Reviewed-on: https://gerrit.libreoffice.org/17867 Reviewed-by: Michael Stahl <mstahl@redhat.com> Tested-by: Michael Stahl <mstahl@redhat.com>