summaryrefslogtreecommitdiff
path: root/sw/source
AgeCommit message (Collapse)Author
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-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-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-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-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-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#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-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>
2015-04-21fix assert on exporting fdo79938-1.ott to .docCaolán McNamara
Change-Id: I93f331bd1c57bd016948e3ed784530724a1028b4 (cherry picked from commit 9c0788f545a9276d18060965794143179917e766) Reviewed-on: https://gerrit.libreoffice.org/15459 Reviewed-by: Michael Stahl <mstahl@redhat.com> Tested-by: Michael Stahl <mstahl@redhat.com>
2015-04-21sw: ODF import: frame background: do not override gradient transparencyMichael Stahl
... with style:background-transparency (regression from 102bb87ca1a5dee3a09442bf503a54bb703c79ea) Change-Id: Icead7a47c145eace51249896b6e05d65dfaa2f78 (cherry picked from commit 3670e3c0c1bfcea9dc50fefb20b67a828b1e35bb) Reviewed-on: https://gerrit.libreoffice.org/15464 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Miklos Vajna <vmiklos@collabora.co.uk>
2015-04-21tdf#90640: sw: ODF import: ignore style:background-transparency forMichael Stahl
... bitmap backgrounds of frames. OOo/LO versions <= 4.3 wrongly write fo:background-color="transparent" style:background-transparency="100%" for bitmap backgrounds, because of a stupid API implementation with SvxBrushItem. They overwrite that with draw:opacity="100%" on the child element style:background-image, which we don't read if we see draw:fill attributes, so ignore the background-transparency in that case. (regression from 5aa360cae0383f270c12708e7e94179a7fde6711) Change-Id: I4ca59d8932a8e5d034c35543a54528198ad7d51c (cherry picked from commit 09f0919f9a1686f6c1492777307e77f841294192) Reviewed-on: https://gerrit.libreoffice.org/15463 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Miklos Vajna <vmiklos@collabora.co.uk>
2015-04-21tdf#90640: sw: ODF export: be consistent when exporting RES_BACKGROUNDMichael Stahl
The emulation of legacy RES_BACKGROUND properties claims that (unless fillstyle is NONE) all of them are direct values, which causes export of legacy attributes like style:background-transparency without corresponding non-legacy draw:opacity. Especially problematic for style:background-transparency, which is set to 100% if style is bitmap, which is the reasonable default for API backward compatibility of BackColorTransparency, but wrong for ODF. Change-Id: I1fa4fa5df45eb00cbfcd2e171b4862c4e195cc7d (cherry picked from commit c3e49660e782816d1203cb936156ef6d6a1ad572) Reviewed-on: https://gerrit.libreoffice.org/15462 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Miklos Vajna <vmiklos@collabora.co.uk>
2015-04-21tdf#90640: sw: ODF export: fix wrong property types in FILL_PROPERTIES_SWMichael Stahl
Wrong type causes draw:opacity not to be exported from FillTransparence. (regression from 6e61ecd09679a66060f932835622821d39e92f01) Change-Id: I478fc34dfb614f0433a6e28b0260379528b86680 (cherry picked from commit 822cb231c9aee2b69d0e645d2fddbab1dfbe3d14) Reviewed-on: https://gerrit.libreoffice.org/15461 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Miklos Vajna <vmiklos@collabora.co.uk>
2015-04-15fix crash on re-export of fdo39974-1.odt to odtCaolán McNamara
(cherry picked from commit c2c22d26db03949771d5a0bb4f8abf6d2dc850ea) sw: DrawFillAttributes: move check for empty rPaintRegion Tweak c2c22d26db03949771d5a0bb4f8abf6d2dc850ea a bit: if the paint region is empty, nothing should be painted. (cherry picked from commit dc6a6475bcc7625a648e840de97ebd7a1ab03270) Change-Id: Ib4246987a3665f655ad44339ade0350b074c3266 Reviewed-on: https://gerrit.libreoffice.org/15329 Tested-by: Caolán McNamara <caolanm@redhat.com> Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2015-04-14tdf#88337 tdf#89193: sw: add missing SwXPageStyle propertiesMichael Stahl
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: https://gerrit.libreoffice.org/15305 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2015-04-14tdf#90230 SwDoc::AppendDoc: take care of marks when inserting page breakMiklos Vajna
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: https://gerrit.libreoffice.org/15310 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2015-04-14tdf#89630 Remove extra space added when assigning styles for TOCMatthew Francis
Change-Id: I05deaf5360fb2d64419f2e47ed348edc9e3adefe Reviewed-on: https://gerrit.libreoffice.org/15165 Tested-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com> Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com>
2015-04-14tdf#80960: Attempt to fix the cursor placement after document load.Jan Holesovsky
This is a blind attempt - don't have a 32bit system at hand to really try it. Change-Id: I4fe8c65b794d01e79aa93cbac440f710b630c7dd Reviewed-on: https://gerrit.libreoffice.org/15131 Tested-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com> Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com>
2015-04-14Resolves: tdf#90130 don't clobber new solid-color on seeing old transparencyCaolán McNamara
...and tdf#90130 gradient transparency goes missing (cherry picked from commit bc892b04144d82507ccd59953c9f4da357c2e7b4) Change-Id: I1ea86dca37cbce416564c5e198779dd132125b02 Reviewed-on: https://gerrit.libreoffice.org/15291 Tested-by: Michael Stahl <mstahl@redhat.com> Reviewed-by: Michael Stahl <mstahl@redhat.com>