summaryrefslogtreecommitdiff
path: root/sw
AgeCommit message (Collapse)Author
2017-08-22tdf#99692 sw: fix the fix: don't set bNullContent if node was splitMichael Stahl
When showing the redlines in rhbz908615-13.odt, the following assertion happens: Assertion `IDocumentMarkAccess::IsLegalPaMForCrossRefHeadingBookmark(rPaM) && "<CrossRefBookmark::CrossRefBookmark(..)>" "- creation of cross-reference bookmark with an illegal PaM that does not expand over exactly one whole paragraph."' failed. This is because in DocumentContentOperationsManager::MoveRange() the flag bNullContent is set after the node has been split; in this case the nContent is of course always 0. Later the function then restores aSavePam to the index 0 of the next node, when it actually shouldn't do anything because the JoinNext() already positioned it correctly at the merge-index of the re-joined node. (regression from 850795942b3e168cab8ce88b4f2b421945ff29ca) Change-Id: I64d50e70b19e2fd81537a9771fa8706898b17642 (cherry picked from commit 6a018363791945b6fd7f04f2aa311e4f4753f6aa) Reviewed-on: https://gerrit.libreoffice.org/41305 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com>
2017-08-21tdf#98700 docxexport: don't force on ParaKeepTogetherJustin Luth
The mere presence of SvxFormatKeepItem was ENABLING it during export, without checking to see if it was actually turned on or off. Both DOC and RTF check the value, and set accordingly, so do the same for DOCX. Merely toggling the setting on and off is enough to create the property, so this is a nasty bug that only affects inquisitive people. Change-Id: I02d83a255f5b4ff8c5124302a52a3126dad40b67 Reviewed-on: https://gerrit.libreoffice.org/41318 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Justin Luth <justin_luth@sil.org> Reviewed-on: https://gerrit.libreoffice.org/41324 Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com>
2017-08-11Resolves: tdf#111571 crash on restarting writer with modeless biblio dialogCaolán McNamara
Change-Id: I2663f84c28721f61c1ed7c8d92a228cafa8f1177 Reviewed-on: https://gerrit.libreoffice.org/41038 Reviewed-by: Michael Stahl <mstahl@redhat.com> Tested-by: Jenkins <ci@libreoffice.org>
2017-08-11tdf#105705 sw: fix another case of bookmarks becoming un-sortedMichael Stahl
The loop in SwTextNode::Update() that reassigns bookmark end positions away from the node to a temporary SwIndexReg can stop prematurely in a particular situation where there is a bookmark that is expanded and with both mark positions at the critical "rPos" insertion position, and also both their SwIndexes consecutive in the SwIndexReg::m_pFirst linked-list. What happens then is that the iteration gets to the first of the 2 consecutive positions of the bookmark, then calls GetMarkEnd() on the mark, which happens to return the other position, which is already stored in the "next" local variable. That other position is then moved to aTmpIdxReg, and in the next loop iteration GetNext() is null as it is the last one in aTmpIdxReg and the loop terminates. Thus various bookmark end positions don't get preserved, or the bAtLeastOneExpandedBookmarkAtInsertionPosition doesn't get set, either of which can cause the bookmark array to lose its sort order. This was found playing around with Zotero 4.0.29.10, while switching between different citation styles. (regression from 6a5dbe73537642b06bcde782118a34b4593d17eb) Change-Id: Ia35ce0656bcb2d6af7ea189458af3942ff83e4da (cherry picked from commit f78aadea74b99ba71f930c7cf52352da9ee965e9) Reviewed-on: https://gerrit.libreoffice.org/41016 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2017-08-09Resolves: tdf#99286 for jpeg dpi use apis that know about MapUnit::MapPixelCaolán McNamara
move the code which can do this from sw to vcl Change-Id: I9940fb80ecdbfe8f70afc500c691288ed0993701 Reviewed-on: https://gerrit.libreoffice.org/40932 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Stahl <mstahl@redhat.com>
2017-08-08ofz#2877: crash in SVTB16ShortCaolán McNamara
sal_uInt16 wraparound Change-Id: Ifd791bdd5f1b96576fdd4ca6665bb972fb8b1e4c Reviewed-on: https://gerrit.libreoffice.org/40853 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
2017-08-02tdf#107723 Import font name from text portions in shapesSamuel Mehrbrodt
Change-Id: Ib9b73b5c05ec2e6846ea3adc950ccab5d1c0a9b0 Reviewed-on: https://gerrit.libreoffice.org/40439 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> (cherry picked from commit 178b361c6379bc963c8a48925f1807c583f2d09f) Reviewed-on: https://gerrit.libreoffice.org/40529 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2017-08-02tdf#108944 writerfilter: fix missing footnote separatorJustin Luth
Fix regression from e79ef12b7a904f17d4147fa409d055c12b70f952 tdf#107033 DOCX import: fix unexpected missing footnote separator. Initially related to tdf#68787. If HandleMarginsHeaderFooter was called twice, then it automatically would have disabled the separator. Clearing the HasFtn/HasFtnSep flags also shouldn't be run when in the footnote sections. Reviewed-on: https://gerrit.libreoffice.org/40551 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Justin Luth <justin_luth@sil.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> (cherry picked from commit 6f57c09aadd40009173f8ae3654004dd0cad9fb8) Change-Id: I00cbd1cbc8dc86edf426f852c59c3f943e373b13 Reviewed-on: https://gerrit.libreoffice.org/40590 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2017-08-02tdf#105705 sw: sort bookmarks in ContentIdxStoreImpl::RestoreBkmks()Michael Stahl
The problem here is that the SplitNode() calls in SwRTFReader::Read() destroy the order of the bookmarks, which causes an assert later from the std::lower_bound() when a new mark is created. The 2 marks that cause the problem are: SwPosition (node 5, offset 0) SwPosition (node 5, offset 0), SwPosition (node 5, offset 0) During the 2 SplitNode calls, the second one is corrected by ContentIdxStore and remains on 5, but the first one is not and becomes: SwPosition (node 7, offset 0) ContentIdxStoreImpl::SaveBkmks() does different things when a mark position is exactly on the parameter position: if it has only one position, it is ignored, but if it has a second position, then both its positions are corrected. It is not possible to change the sort order so that marks with one position are sorted behind marks with 2 positions, because while SplitNode() corrects marks "backward", JoinNode() uses ContentIdxStore to correct marks "forward"; hence manually sort the marks. Change-Id: If5b35f18bfd47ffe98c0f67e84d380ca801411a3 (cherry picked from commit f2d2093b2198bd4c65475a60329a5a6a7a8575f1) Reviewed-on: https://gerrit.libreoffice.org/40544 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2017-08-01tdf#109228: FILESAVE: ODT: Anchor changed to 'to character' after RTTamás Zolnai
Ignore frames without names, becuase the code does not handle them well. It does not affect those use case for which the deduplication code was added. Reviewed-on: https://gerrit.libreoffice.org/40222 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Tamás Zolnai <tamas.zolnai@collabora.com> (cherry picked from commit 615c2a2c54d3e7aefb4986ae7d8de81a42022988) Change-Id: I08ad062b8b11cc06323467329d8c4e97bc4932dd Reviewed-on: https://gerrit.libreoffice.org/40236 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2017-07-28ofz#2759 null dereferenceCaolán McNamara
(cherry picked from commit 6f5841e60ed29ae2577e63623edacc9fe1467ba5) Change-Id: I23671f0cea592c92a05b34b3cf284a47a73962b1 Reviewed-on: https://gerrit.libreoffice.org/40506 Reviewed-by: Michael Stahl <mstahl@redhat.com> Tested-by: Jenkins <ci@libreoffice.org>
2017-07-27tdf#108867 sw: fix dangling text box frame format pointers in UndoMichael Stahl
If the text box is removed, the SwFrameFormat of the drawing shape still retains a pointer to the frame SwFrameFormat, and the latter is owned by the SwUndoFlyBase. This is pretty bad, so try to clear & reset the connection between them in SwUndoFlyBase::InsFly() and DelFly(). Hopefully nothing will actually delete the drawing shape SwFrameFormat while the Undo object is alive. Note that when the SwUndoInsLayFormat is created when the text box is added, the GetOtherTextBoxFormat() returns null as it's set later, that's why the constructor can't do anything. Change-Id: Iae562b6f8f272e47b2b5cf8ee80778db15d29ce0 (cherry picked from commit 2e486daff35ab16e810bfdafb24b19bcbf2fe8cd) Reviewed-on: https://gerrit.libreoffice.org/40283 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2017-07-27tdf#99692 sw: fix bookmark positions in tables at start of redlinesMichael Stahl
The code assumes that if it can move the cursor backward in line 2038, that move can be "inverted" by moving the cursor forward after the content has been moved - but if the cursor moved back a node, and the moved content does not start with a SwTextNode, the cursor will move forward skipping over the non-text nodes, so offsets in the aSaveBkmks (and aSaveRedl, presumably) are going to be wrong. Just don't use Move() if it leaves the current node. Change-Id: I95278a10c14aeba9f76558486bb2712f6726dbcb (cherry picked from commit 850795942b3e168cab8ce88b4f2b421945ff29ca) Reviewed-on: https://gerrit.libreoffice.org/40419 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2017-07-20tdf#109080 First page header/footer ODF (1/2)Luke Deller
The proposal to add <style:header-first> / <style:footer-first> to the ODF standard has not yet been accepted, so meanwhile we should be using an extension namespace for these elements. This first commit (intended for backport) adds support for reading <loext:header-first> / <loext:footer-first> (cherry picked from commit bff8cd3d52223002263dcb8c09758c4fc753b6e3) Change-Id: I616b6a0acaead9d767ae7d119e539b865f3a6774 Reviewed-on: https://gerrit.libreoffice.org/40228 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Stahl <mstahl@redhat.com>
2017-07-20tdf#109188 Always load documents read-only in SwOneExampleFrameSamuel Mehrbrodt
Should be no problem since 38a3743e0c5d52f9386f74097fd512d3133fbbe3 Change-Id: I0ce47bc2bdaa900559a16baf25305066977caa6d Reviewed-on: https://gerrit.libreoffice.org/40140 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Stahl <mstahl@redhat.com> Reviewed-on: https://gerrit.libreoffice.org/40213
2017-07-20tdf#107975: Revert "fix deleting an image anchored to last paragraphMichael Stahl
... in document" This reverts commit 2903d85d6197829633d7f96c95cd55821c2c20ff. It was a good idea, but is not complete. Change-Id: Ia0da2640889ce6e78b89b27c75fae9d6508afd40 (cherry picked from commit 14d2255cbd254dea6e87a04f747e7d6d3d54ceb9) Reviewed-on: https://gerrit.libreoffice.org/40191 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2017-07-20sw: make SwGrfNode::mpReplacementGraphic swappableMichael Stahl
Same as previous commit, but for sw. (cherry picked from commit a03a0cfb1e41c357950a40623c2f8b6f5507e97d) loplugin:staticmethods (cherry picked from commit 3039b7cae36abb7e9bfffa4fbbba023721376568) Change-Id: Id678de3f512204437e37aaedf24e24aff7a9e592 Reviewed-on: https://gerrit.libreoffice.org/39968 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> (cherry picked from commit 524377f1815773a678721c8ad179be9dbdaf7716) Reviewed-on: https://gerrit.libreoffice.org/40179
2017-07-14tdf#109053: DOCX: Multipage table is not imported properlyTamás Zolnai
An other use case when converting to a "floating table" is not a good idea. In this case we can check whether next to the table anything fits in the text area. If not then we can avoid floating table conversion. Reviewed-on: https://gerrit.libreoffice.org/39811 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Tamás Zolnai <tamas.zolnai@collabora.com> (cherry picked from commit fc55711f01af172eb3a034454405fa941454c781) Change-Id: I798a2f4c7a9dfe6aecbe4a73e3162b49ea5f0adc Reviewed-on: https://gerrit.libreoffice.org/39931 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Andras Timar <andras.timar@collabora.com>
2017-07-11tdf#101821 sw: fix layout footnote use-after-freeMichael Stahl
After inserting a header in the bugdoc, during SwFrame::Calc of a SwTextFrame that is in a footnote, it decides move forward to the next page. This deletes the SwFootnoteFrame and SwFootnoteContFrame that lcl_FormatContentOfLayoutFrame() are iterating over. For want of a more elegant solution, use a big hammer to prevent the problem and try to clean up so that no empty SwFootnoteFrame and SwFootnoteContFrame remain (as that is known to crash in other places, see commit c9fb347642729017ad0c613fe26310befd021db8) Invalid read of size 8 at 0x414E1F96: SwFrame::GetNext() (frame.hxx:485) by 0x41AFDD07: lcl_FormatContentOfLayoutFrame(SwLayoutFrame*, SwFrame*) (objectformattertxtfrm.cxx:646) by 0x41AFDCC0: lcl_FormatContentOfLayoutFrame(SwLayoutFrame*, SwFrame*) (objectformattertxtfrm.cxx:642) by 0x41AFDCC0: lcl_FormatContentOfLayoutFrame(SwLayoutFrame*, SwFrame*) (objectformattertxtfrm.cxx:642) by 0x41AFDEA7: SwObjectFormatterTextFrame::FormatAnchorFrameAndItsPrevs(SwTextFrame&) (objectformattertxtfrm.cxx:696) by 0x41AAA680: SwFlyAtContentFrame::MakeAll(OutputDevice*) (flycnt.cxx:415) by 0x41A7F211: SwFrame::PrepareMake(OutputDevice*) (calcmove.cxx:346) by 0x41B75758: SwFrame::Calc(OutputDevice*) const (trvlfrm.cxx:1761) by 0x41AA8927: SwFlyFrame::Calc(OutputDevice*) const (fly.cxx:2559) by 0x41ADB36B: SwLayAction::FormatLayoutFly(SwFlyFrame*) (layact.cxx:1414) by 0x41AF9658: SwObjectFormatter::FormatObj_(SwAnchoredObject&) (objectformatter.cxx:321) by 0x41AFCB6E: SwObjectFormatterTextFrame::DoFormatObj(SwAnchoredObject&, bool) (objectformattertxtfrm.cxx:126) by 0x41AF9A6A: SwObjectFormatter::FormatObjsAtFrame_(SwTextFrame*) (objectformatter.cxx:443) by 0x41AFD275: SwObjectFormatterTextFrame::DoFormatObjs() (objectformattertxtfrm.cxx:328) by 0x41AF924A: SwObjectFormatter::FormatObjsAtFrame(SwFrame&, SwPageFrame const&, SwLayAction*) (objectformatter.cxx:191) by 0x41ADC213: SwLayAction::FormatContent(SwPageFrame const*) (layact.cxx:1633) by 0x41AD88DE: SwLayAction::InternalAction(OutputDevice*) (layact.cxx:760) by 0x41AD7080: SwLayAction::Action(OutputDevice*) (layact.cxx:351) by 0x41ADE32E: SwLayIdle::SwLayIdle(SwRootFrame*, SwViewShellImp*) (layact.cxx:2133) by 0x41FFC97E: SwViewShell::LayoutIdle() (viewsh.cxx:711) Address 0x505541a8 is 72 bytes inside a block of size 272 free'd at 0x4C2F21A: operator delete(void*) (vg_replace_malloc.c:576) by 0x41AD371A: SwFootnoteFrame::~SwFootnoteFrame() (ftnfrm.hxx:52) by 0x41B5B74C: SwFrame::DestroyFrame(SwFrame*) (ssfrm.cxx:391) by 0x41A97294: SwFlowFrame::CutTree(SwFrame*) (flowfrm.cxx:406) by 0x41A979AE: SwFlowFrame::MoveSubTree(SwLayoutFrame*, SwFrame*) (flowfrm.cxx:592) by 0x41ACFB69: SwContentFrame::MoveFootnoteCntFwd(bool, SwFootnoteBossFrame*) (ftnfrm.cxx:2756) by 0x41A9B78E: SwFlowFrame::MoveFwd(bool, bool, bool) (flowfrm.cxx:1813) by 0x41A85864: SwContentFrame::MakeAll(OutputDevice*) (calcmove.cxx:1681) by 0x41A7F211: SwFrame::PrepareMake(OutputDevice*) (calcmove.cxx:346) by 0x41B75758: SwFrame::Calc(OutputDevice*) const (trvlfrm.cxx:1761) by 0x41AFDCFB: lcl_FormatContentOfLayoutFrame(SwLayoutFrame*, SwFrame*) (objectformattertxtfrm.cxx:644) by 0x41AFDCC0: lcl_FormatContentOfLayoutFrame(SwLayoutFrame*, SwFrame*) (objectformattertxtfrm.cxx:642) by 0x41AFDCC0: lcl_FormatContentOfLayoutFrame(SwLayoutFrame*, SwFrame*) (objectformattertxtfrm.cxx:642) by 0x41AFDCC0: lcl_FormatContentOfLayoutFrame(SwLayoutFrame*, SwFrame*) (objectformattertxtfrm.cxx:642) by 0x41AFDEA7: SwObjectFormatterTextFrame::FormatAnchorFrameAndItsPrevs(SwTextFrame&) (objectformattertxtfrm.cxx:696) by 0x41AAA680: SwFlyAtContentFrame::MakeAll(OutputDevice*) (flycnt.cxx:415) by 0x41A7F211: SwFrame::PrepareMake(OutputDevice*) (calcmove.cxx:346) by 0x41B75758: SwFrame::Calc(OutputDevice*) const (trvlfrm.cxx:1761) by 0x41AA8927: SwFlyFrame::Calc(OutputDevice*) const (fly.cxx:2559) by 0x41ADB36B: SwLayAction::FormatLayoutFly(SwFlyFrame*) (layact.cxx:1414) by 0x41AF9658: SwObjectFormatter::FormatObj_(SwAnchoredObject&) (objectformatter.cxx:321) by 0x41AFCB6E: SwObjectFormatterTextFrame::DoFormatObj(SwAnchoredObject&, bool) (objectformattertxtfrm.cxx:126) by 0x41AF9A6A: SwObjectFormatter::FormatObjsAtFrame_(SwTextFrame*) (objectformatter.cxx:443) by 0x41AFD275: SwObjectFormatterTextFrame::DoFormatObjs() (objectformattertxtfrm.cxx:328) by 0x41AF924A: SwObjectFormatter::FormatObjsAtFrame(SwFrame&, SwPageFrame const&, SwLayAction*) (objectformatter.cxx:191) by 0x41ADC213: SwLayAction::FormatContent(SwPageFrame const*) (layact.cxx:1633) by 0x41AD88DE: SwLayAction::InternalAction(OutputDevice*) (layact.cxx:760) by 0x41AD7080: SwLayAction::Action(OutputDevice*) (layact.cxx:351) by 0x41ADE32E: SwLayIdle::SwLayIdle(SwRootFrame*, SwViewShellImp*) (layact.cxx:2133) by 0x41FFC97E: SwViewShell::LayoutIdle() (viewsh.cxx:711) Change-Id: I656cc2303eeccd5eef68ad3b8e81bb0fd47b94fb (cherry picked from commit 9dcb767c5bdccdf6606240afd6aa2c6bd3dcc9f4) Reviewed-on: https://gerrit.libreoffice.org/39105 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2017-07-11sw: fix use-after-free in SwAccessibleMap::FireEvents()Michael Stahl
As seen when running JunitTest_sw_unoapi_3 against "make debugrun", the damn thing can call itself recursively via an odd corner case in GetContext(): 0 in SwAccessibleEventList_Impl::~SwAccessibleEventList_Impl() (this=0x9a6a170, __in_chrg=<optimized out>) at sw/source/core/access/accmap.cxx:498 1 in SwAccessibleMap::FireEvents() (this=0x8198bb0) at sw/source/core/access/accmap.cxx:3023 2 in SwAccessibleMap::InvalidateCursorPosition(com::sun::star::uno::Reference<com::sun::star::accessibility::XAccessible> const&) (this=0x8198bb0, rAcc=uno::Reference to (SwAccessibleParagraph *) 0x9a439d8) at sw/source/core/access/accmap.cxx:1069 3 in SwAccessibleMap::GetContext(SwFrame const*, bool) (this=0x8198bb0, pFrame=0x825ca10, bCreate=true) at sw/source/core/access/accmap.cxx:1925 4 in SwAccessibleMap::GetContextImpl(SwFrame const*, bool) (this=0x8198bb0, pFrame=0x825ca10, bCreate=true) at sw/source/core/access/accmap.cxx:1936 5 in SwAccessibleContext::InvalidateChildPosOrSize(sw::access::SwAccessibleChild const&, SwRect const&) (this=0x405a350, rChildFrameOrObj=..., rOldFrame=SwRect = {...}) at sw/source/core/access/acccontext.cxx:1196 6 in SwAccessibleMap::FireEvent(SwAccessibleEvent_Impl const&) (this=0x8198bb0, rEvent=...) at sw/source/core/access/accmap.cxx:898 7 in SwAccessibleMap::FireEvents() (this=0x8198bb0) at sw/source/core/access/accmap.cxx:3018 8 in SwViewShellImp::FireAccessibleEvents() (this=0x7744dc0) at sw/source/core/view/viewimp.cxx:460 9 in SwLayIdle::SwLayIdle(SwRootFrame*, SwViewShellImp*) (this=0x7ffc63395e30, pRt=0x7745120, pI=0x7744dc0) at sw/source/core/layout/layact.cxx:2267 Presumably all of mpEvents, mpEventMap and mpShapes must live until the outermost FireEvents() completes. Change-Id: I4e5a053035bf7fc12d9407913437d721889950ae (cherry picked from commit ddf8d9a150e3e1725de65577c48d47918b4b11a8) Reviewed-on: https://gerrit.libreoffice.org/39567 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Reviewed-by: Eike Rathke <erack@redhat.com>
2017-07-10Fix tdf#106029 - Add setting XML_doNotExpandShiftReturn when exporting to docxnikki
Change-Id: Ie8ffb0f2d5444c6ead13bdc894715c5a2e6d0baa Reviewed-on: https://gerrit.libreoffice.org/36485 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> (cherry picked from commit 9ad9c5183f348384b62ec88459a3a5922e423d83) Reviewed-on: https://gerrit.libreoffice.org/39749
2017-07-07tdf#104640, tdf#108469: Insert image where the cursor isXisco Fauli
Partially revert 72a4987434368bfb0b15f5ebb70a52 Besides, add bDelta to the condition so the statement is false if the image is resized Change-Id: Ib07d328e040c38c63a30f6230ed9f6b605d76d9f Reviewed-on: https://gerrit.libreoffice.org/38705 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Xisco Faulí <xiscofauli@libreoffice.org> (cherry picked from commit 3919d87210ea12ed3166c649ac52730026db01a4) Reviewed-on: https://gerrit.libreoffice.org/38772 Reviewed-by: Michael Stahl <mstahl@redhat.com>
2017-07-06ofz: stay inside stringCaolán McNamara
Change-Id: Ia0d0ddfce4ee3d5f8763be6804fe52c514375bb3 Reviewed-on: https://gerrit.libreoffice.org/39629 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com> (cherry picked from commit 073a2b2aef5c0b579aea8ed203dd9c1c5790b650) Reviewed-on: https://gerrit.libreoffice.org/39645 Reviewed-by: Michael Stahl <mstahl@redhat.com> Tested-by: Jenkins <ci@libreoffice.org>
2017-07-06tdf#108873 fix merge data handling in fieldsJan-Marek Glogowski
This is a regression from tdf#70346 / commit 4851cde7b98226b0f82ae2b191c290173e9b06c6 It added the whole DB row as variables to the SwCalc hash set. This works correct for conditionals when hiding sections, but not for conditionals used in fields - actually they break. Previously the field would do a fallback to query the DB again, if no variable was in the dict and the only possible variables in the dict could have been user-defined fields. This handles the added variables correctly for fields. Also fixes a bug to store the DB number values as number variables and adds the record number, as SwCalc::VarLook does. Change-Id: Ib0dbeda68234e671768ede55b2012235a3680276 Reviewed-on: https://gerrit.libreoffice.org/39509 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de> (cherry picked from commit f54c6938f73b94fb6f722f3ea68454fee424e62e) Reviewed-on: https://gerrit.libreoffice.org/39613
2017-07-04tdf#107976 sw: let a view handle multiple transferablesMiklos Vajna
Otherwise only the last transferable gets unregistered on closing the view, which means a use-after-free when trying to paste something copied from a closed document. (cherry picked from commit 336f893c57c3c0281d4899629ad55603837d5d40) Conflicts: sw/qa/extras/uiwriter/uiwriter.cxx sw/source/uibase/inc/uivwimp.hxx Change-Id: I65594e07fa4fefe7ae51a12455b755d64700a00d Reviewed-on: https://gerrit.libreoffice.org/39499 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Stahl <mstahl@redhat.com>
2017-07-04tdf#101821 sw: layout: don't move endnotes into footnotes' containerMichael Stahl
The bugdoc has a single 1-column section from start to end, no footnotes but lots of endnotes, and the section has the settings "Footnotes - collect at end of text" unchecked and "Endnotes - collect at end of section" checked. This means that the SwFootnoteContFrame for footnotes would be put directly below the SwPageFrame (so that multiple sections on a single page can share it), but the SwFootnoteContFrame for the endnotes is put below the SwColumnFrame (which is created despite only 1 column) below the SwSectionFrame. Hence content in endnotes has the mbInfSct flag set, and the crash happens because the endnotes are moved from below the SwSectionFrame to a new SwFootnoteContFrame that is directly below a SwPageFrame, without clearing the mbInfSct flag. Fix the wrong call in SwFootnoteBossFrame::MoveFootnotes_() to FindFootnoteBossFrame() that resulted in the wrong (unsuitable for endnotes) SwFootnoteContFrame to be used as the target for the move. Change-Id: I64f6b86441e5ac1f16433f005e97c274a1c69dfa (cherry picked from commit 4c0b3520b66477334a7971dbed7ffcdcd265e749) Reviewed-on: https://gerrit.libreoffice.org/39104 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2017-06-26ofz#2392 restored props don't match saved propsCaolán McNamara
Change-Id: Idb198f0121ac9c6b4083b157af07c5eb1cda66cb Reviewed-on: https://gerrit.libreoffice.org/39267 Reviewed-by: Michael Stahl <mstahl@redhat.com> Tested-by: Michael Stahl <mstahl@redhat.com>
2017-06-23tdf#101821 sw: fix layout footnote use-after-free in SwRootFrameMichael Stahl
The ClearSwLayouterEntries() accesses anchored objects and if they are anchored in footnotes then RemoveFootnotes() has already deleted them. (regression from 962d0500c4debaef43e5f146e47e08c66d851562) Invalid write of size 1 at 0x4143CCB3: SwAnchoredObject::SetTmpConsiderWrapInfluence(bool) (anchoredobject.cxx:739) by 0x414D8A21: SwObjsMarkedAsTmpConsiderWrapInfluence::Clear() (objstmpconsiderwrapinfl.cxx:58) by 0x414C943E: SwLayouter::ClearObjsTmpConsiderWrapInfluence(SwDoc const&) (layouter.cxx:401) by 0x411DBE57: sw::DocumentLayoutManager::ClearSwLayouterEntries() (DocumentLayoutManager.cxx:504) by 0x414D05D9: SwRootFrame::DestroyImpl() (newfrm.cxx:594) by 0x41535AB3: SwFrame::DestroyFrame(SwFrame*) (ssfrm.cxx:389) by 0x419E8171: std::_Sp_counted_deleter<SwRootFrame*, void (*)(SwFrame*), std::allocator<void>, (__gnu_cxx::_Lock_policy)2>::_M_dispose() (shared_ptr_base.h:464) by 0x40EB6DB5: std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)2>::_M_release() (shared_ptr_base.h:150) by 0x40EB5E76: std::__shared_count<(__gnu_cxx::_Lock_policy)2>::~__shared_count() (shared_ptr_base.h:662) by 0x419E65F9: std::__shared_ptr<SwRootFrame, (__gnu_cxx::_Lock_policy)2>::~__shared_ptr() (shared_ptr_base.h:928) by 0x419E6615: std::shared_ptr<SwRootFrame>::~shared_ptr() (shared_ptr.h:93) by 0x419E619D: SwViewShell::~SwViewShell() (vnew.cxx:285) Address 0x5feb6eee is 334 bytes inside a block of size 488 free'd at 0x4C2F21A: operator delete(void*) (vg_replace_malloc.c:576) by 0x41488962: SwFlyAtContentFrame::~SwFlyAtContentFrame() (flyfrms.hxx:134) by 0x41535AFC: SwFrame::DestroyFrame(SwFrame*) (ssfrm.cxx:391) by 0x415360BD: SwLayoutFrame::DestroyImpl() (ssfrm.cxx:477) by 0x41535AB3: SwFrame::DestroyFrame(SwFrame*) (ssfrm.cxx:389) by 0x414A2FF4: sw_RemoveFootnotes(SwFootnoteBossFrame*, bool, bool) (ftnfrm.cxx:852) by 0x414A3104: sw_RemoveFootnotes(SwFootnoteBossFrame*, bool, bool) (ftnfrm.cxx:874) by 0x414A321A: SwRootFrame::RemoveFootnotes(SwPageFrame*, bool, bool) (ftnfrm.cxx:897) by 0x414D0558: SwRootFrame::DestroyImpl() (newfrm.cxx:585) by 0x41535AB3: SwFrame::DestroyFrame(SwFrame*) (ssfrm.cxx:389) by 0x419E8171: std::_Sp_counted_deleter<SwRootFrame*, void (*)(SwFrame*), std::allocator<void>, (__gnu_cxx::_Lock_policy)2>::_M_dispose() (shared_ptr_base.h:464) by 0x40EB6DB5: std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)2>::_M_release() (shared_ptr_base.h:150) by 0x40EB5E76: std::__shared_count<(__gnu_cxx::_Lock_policy)2>::~__shared_count() (shared_ptr_base.h:662) by 0x419E65F9: std::__shared_ptr<SwRootFrame, (__gnu_cxx::_Lock_policy)2>::~__shared_ptr() (shared_ptr_base.h:928) by 0x419E6615: std::shared_ptr<SwRootFrame>::~shared_ptr() (shared_ptr.h:93) by 0x419E619D: SwViewShell::~SwViewShell() (vnew.cxx:285) Change-Id: I147f46d49c90de46189ad34feed66c289adddc15 (cherry picked from commit c7782c7c27d85866872cc24a618df02504ff12ca) Reviewed-on: https://gerrit.libreoffice.org/39106 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Björn Michaelsen <bjoern.michaelsen@libreoffice.org>
2017-06-22tdf#107684 DOCX export: fix duplicated <w:outlineLvl> element for stylesMiklos Vajna
Next to the existing OutlineNumbering() (which is only used for styles), commit fd2d14d5543c82eb875e720c98b51518699a8fbc (Implement DOCX export of paragraph outline level, 2013-10-04) added ParaOutlineLevel() to the attribute output class that also wrote the outline level of a paragraph (style), but worked for the cases when the style was imported by writerfilter as well. As a side-effect styles imported by xmloff now have their outline level property handled twice, leading to duplicated elements. Fix the problem by only writing <w:outlineLvl> in ParaOutlineLevel(): it covers both use-cases, so no need to do anything in OutlineNumbering(). Change-Id: Ic982dd70a00609cdfc3744a8ab69aaa828410fd0 Reviewed-on: https://gerrit.libreoffice.org/38132 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org> (cherry picked from commit fe13c249c8964355e39869a357c393f3208b6def) Reviewed-on: https://gerrit.libreoffice.org/38637 Reviewed-by: Michael Stahl <mstahl@redhat.com>
2017-06-19tdf#108418 Fix vertical alignment of checkbox textGabor Kelemen
Change-Id: I8daa6c2c5941a894259a5af74a16f7ef32f8a867 Reviewed-on: https://gerrit.libreoffice.org/38577 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Katarina Behrens <Katarina.Behrens@cib.de> (cherry picked from commit 9d0ed8352ac9f27552f62d536c506f5cbc2a4afe) Reviewed-on: https://gerrit.libreoffice.org/38956 Reviewed-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com> Tested-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com> (cherry picked from commit 50bab52194f570d48b92eb2f240dc4de7b3e1d3c) Reviewed-on: https://gerrit.libreoffice.org/38963
2017-06-18tdf#108118 sw: fix recursive layouting during SwCursorShell::Paint()Michael Stahl
The problem, in a nutshell, is that SwDrawContact::Changed() is called during layout, and recursively starts another layout that removes a drawing object that is being iterated over in frame #28 SwObjectFormatter::FormatObjsAtFrame_() from the layout. Apparently SwDrawContact::Changed() is by far the most dangerous function to call during layout; set the quite targeted flag SetCallbackActionEnabled() to prevent the recursion. 0 SwSortedObjs::Remove(SwAnchoredObject&) (this=0x73e4a00, _rAnchoredObj=...) at sw/source/core/layout/sortedobjs.cxx:228 1 SwFrame::RemoveDrawObj(SwAnchoredObject&) (this=0x9430e20, _rToRemoveObj=...) at sw/source/core/layout/fly.cxx:2076 2 SwDrawVirtObj::RemoveFromWriterLayout() (this=0x95ce130) at sw/source/core/draw/dcontact.cxx:2199 3 SwDrawContact::DisconnectObjFromLayout(SdrObject*) (this=0x70fef00, _pDrawObj=0x95ce130) at sw/source/core/draw/dcontact.cxx:1663 4 SwLayoutFrame::DestroyImpl() (this=0x91c6c60) at sw/source/core/layout/ssfrm.cxx:489 5 SwFrame::DestroyFrame(SwFrame*) (pFrame=0x91c6c60) at sw/source/core/layout/ssfrm.cxx:389 6 SwLayoutFrame::DestroyImpl() (this=0x9435cd0) at sw/source/core/layout/ssfrm.cxx:500 7 SwPageFrame::DestroyImpl() (this=0x9435cd0) at sw/source/core/layout/pagechg.cxx:270 8 SwFrame::DestroyFrame(SwFrame*) (pFrame=0x9435cd0) at sw/source/core/layout/ssfrm.cxx:389 9 SwRootFrame::RemovePage(SwPageFrame**, SwRemoveResult) (this=0x36b26f0, pDelRef=0x7ffeafbf2e38, eResult=SwRemoveResult::Prev) at sw/source/core/layout/pagechg.cxx:1351 10 SwRootFrame::RemoveSuperfluous() (this=0x36b26f0) at sw/source/core/layout/pagechg.cxx:1426 11 SwLayAction::InternalAction(OutputDevice*) (this=0x7ffeafbf3250, pRenderContext=0x3595030) at sw/source/core/layout/layact.cxx:502 12 SwLayAction::Action(OutputDevice*) (this=0x7ffeafbf3250, pRenderContext=0x3595030) at sw/source/core/layout/layact.cxx:351 13 SwViewShell::ImplEndAction(bool) (this=0x364cc00, bIdleEnd=false) at sw/source/core/view/viewsh.cxx:279 14 SwViewShell::EndAction(bool) (this=0x364cc00, bIdleEnd=false) at sw/inc/viewsh.hxx:605 15 SwCursorShell::EndAction(bool, bool) (this=0x364cc00, bIdleEnd=false, DoSetPosX=false) at sw/source/core/crsr/crsrsh.cxx:259 16 SwRootFrame::EndAllAction(bool) (this=0x36b26f0, bVirDev=false) at sw/source/core/layout/pagechg.cxx:1728 17 SwDrawContact::Changed(SdrObject const&, SdrUserCallType, tools::Rectangle const&) (this=0x70fef00, rObj=..., eType=SdrUserCallType::MoveOnly, rOldBoundRect=...) at sw/source/core/draw/dcontact.cxx:985 18 SdrObject::SendUserCall(SdrUserCallType, tools::Rectangle const&) const (this=0x95ce130, eUserCall=SdrUserCallType::MoveOnly, rBoundRect=...) at svx/source/svdraw/svdobj.cxx:2736 19 SdrObject::Move(Size const&) (this=0x95ce130, rSiz=Size = {...}) at svx/source/svdraw/svdobj.cxx:1482 20 SwDrawVirtObj::Move(Size const&) (this=0x95ce130, rSiz=Size = {...}) at sw/source/core/draw/dcontact.cxx:2366 21 SwAnchoredDrawObject::SetObjTop_(long) (this=0x95ce250, _nTop=777490) at sw/source/core/layout/anchoreddrawobject.cxx:677 22 SwAnchoredObject::SetObjTop(long) (this=0x95ce250, _nTop=777490) at sw/source/core/layout/anchoredobject.cxx:593 23 objectpositioning::SwToContentAnchoredObjectPosition::CalcPosition() (this=0x7ffeafbf3980) at sw/source/core/objectpositioning/tocntntanchoredobjectposition.cxx:739 24 SwAnchoredDrawObject::MakeObjPosAnchoredAtPara() (this=0x95ce250) at sw/source/core/layout/anchoreddrawobject.cxx:421 25 SwAnchoredDrawObject::MakeObjPos() (this=0x95ce250) at sw/source/core/layout/anchoreddrawobject.cxx:318 26 SwObjectFormatter::FormatObj_(SwAnchoredObject&) (this=0x90623d0, _rAnchoredObj=...) at sw/source/core/layout/objectformatter.cxx:374 27 SwObjectFormatterTextFrame::DoFormatObj(SwAnchoredObject&, bool) (this=0x90623d0, _rAnchoredObj=..., _bCheckForMovedFwd=false) at sw/source/core/layout/objectformattertxtfrm.cxx:126 28 SwObjectFormatter::FormatObjsAtFrame_(SwTextFrame*) (this=0x90623d0, _pMasterTextFrame=0x0) at sw/source/core/layout/objectformatter.cxx:443 29 SwObjectFormatterTextFrame::DoFormatObjs() (this=0x90623d0) at sw/source/core/layout/objectformattertxtfrm.cxx:328 30 SwObjectFormatter::FormatObjsAtFrame(SwFrame&, SwPageFrame const&, SwLayAction*) (_rAnchorFrame=..., _rPageFrame=..., _pLayAction=0x0) at sw/source/core/layout/objectformatter.cxx:191 31 SwHeadFootFrame::FormatSize(long, SwBorderAttrs const*) (this=0x91c6c60, nUL=663, pAttrs=0x8fbc530) at sw/source/core/layout/hffrm.cxx:263 32 SwHeadFootFrame::Format(OutputDevice*, SwBorderAttrs const*) (this=0x91c6c60, pRenderContext=0x3595030, pAttrs=0x8fbc530) at sw/source/core/layout/hffrm.cxx:416 33 SwLayoutFrame::MakeAll(OutputDevice*) (this=0x91c6c60) at sw/source/core/layout/calcmove.cxx:913 34 SwFrame::PrepareMake(OutputDevice*) (this=0x91c6c60, pRenderContext=0x3595030) at sw/source/core/layout/calcmove.cxx:346 35 SwFrame::Calc(OutputDevice*) const (this=0x91c6c60, pRenderContext=0x3595030) at sw/source/core/layout/trvlfrm.cxx:1783 36 lcl_FormatLay(SwLayoutFrame*) (pLay=0x91c6c60) at sw/source/core/layout/pagechg.cxx:360 37 lcl_FormatLay(SwLayoutFrame*) (pLay=0x9435cd0) at sw/source/core/layout/pagechg.cxx:357 38 SwPageFrame::PreparePage(bool) (this=0x9435cd0, bFootnote=false) at sw/source/core/layout/pagechg.cxx:456 39 (anonymous namespace)::doInsertPage(SwRootFrame*, SwPageFrame**, SwFrameFormat*, SwPageDesc*, bool, SwPageFrame**) (pRoot=0x36b26f0, pRefSibling=0x7ffeafbf43c8, pFormat=0x3076050, pDesc=0x3076010, bFootnote=false, pRefPage=0x7ffeafbf43d8) at sw/source/core/layout/pagechg.cxx:1210 40 SwFrame::InsertPage(SwPageFrame*, bool) (this=0x3620d70, pPrevPage=0x9227900, bFootnote=false) at sw/source/core/layout/pagechg.cxx:1269 41 SwFrame::GetNextLeaf(MakePageType) (this=0x3620d70, eMakePage=MAKEPAGE_INSERT) at sw/source/core/layout/flowfrm.cxx:994 42 SwFrame::GetLeaf(MakePageType, bool) (this=0x3620d70, eMakePage=MAKEPAGE_INSERT, bFwd=true) at sw/source/core/layout/flowfrm.cxx:797 43 SwFlowFrame::MoveFwd(bool, bool, bool) (this=0x3620e18, bMakePage=true, bPageBreak=false, bMoveAlways=false) at sw/source/core/layout/flowfrm.cxx:1851 44 SwContentFrame::MakeAll(OutputDevice*) (this=0x3620d70) at sw/source/core/layout/calcmove.cxx:1681 45 SwFrame::PrepareMake(OutputDevice*) (this=0x707a340, pRenderContext=0x3595030) at sw/source/core/layout/calcmove.cxx:312 46 SwFrame::Calc(OutputDevice*) const (this=0x707a340, pRenderContext=0x3595030) at sw/source/core/layout/trvlfrm.cxx:1783 47 GetFrameOfModify(SwRootFrame const*, SwModify const&, SwFrameType, Point const*, SwPosition const*, bool) (pLayout=0x36b26f0, rMod=..., nFrameType=(SwFrameType::Txt | SwFrameType::NoTxt), pPoint=0x707c6f0, pPos=0x707c720, bCalcFrame=true) at sw/source/core/layout/frmtool.cxx:3247 48 SwContentNode::getLayoutFrame(SwRootFrame const*, Point const*, SwPosition const*, bool) const (this=0x71328c0, _pRoot=0x36b26f0, pPoint=0x707c6f0, pPos=0x707c720, bCalcFrame=true) at sw/source/core/docnode/node.cxx:1118 49 SwRootFrame::CalcFrameRects(SwShellCursor&) (this=0x36b26f0, rCursor=...) at sw/source/core/layout/trvlfrm.cxx:2028 50 SwShellCursor::FillRects() (this=0x707c680) at sw/source/core/crsr/viscrs.cxx:609 51 SwSelPaintRects::Show(std::__debug::vector<rtl::OString, std::allocator<rtl::OString> >*) (this=0x707c680, pSelectionRectangles=0x7ffeafbf5570) at sw/source/core/crsr/viscrs.cxx:332 52 SwShellCursor::Show(SfxViewShell*) (this=0x707c680, pViewShell=0x0) at sw/source/core/crsr/viscrs.cxx:619 53 SwCursorShell::Paint(OutputDevice&, tools::Rectangle const&) (this=0x364cc00, rRenderContext=..., rRect=...) at sw/source/core/crsr/crsrsh.cxx:1283 54 SwEditWin::Paint(OutputDevice&, tools::Rectangle const&) (this=0x3595030, rRenderContext=..., rRect=...) at sw/source/uibase/docvw/edtwin2.cxx:476 Change-Id: I1b237f0f425e58bb95bae9f19019f26fe5da21fd (cherry picked from commit 2ca0360a6c75959bf61bd2ee0ef96b2729369a15) Reviewed-on: https://gerrit.libreoffice.org/38619 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2017-06-14tdf#103091 conditional style conditions not savedTroy Rollo
Change-Id: Iccf3eb531ee3382d27105e5ccce6013707a646b6 Reviewed-on: https://gerrit.libreoffice.org/38451 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Stahl <mstahl@redhat.com> (cherry picked from commit a5b4cb3f836c991d0647f55e1ef4920ce6115eac) Reviewed-on: https://gerrit.libreoffice.org/38747
2017-06-09tdf#108305 sw: fix crash on fly "Position and Size"Michael Stahl
Everything else in SwFrameShell::Execute() checks pArgs isn't null so do the same here. (regression from d02f75a8c36705924ddd6a5921fe3012fafce812) Change-Id: I73d85b111a5d2c088b9d888b8595ceb3979e8d2b (cherry picked from commit 28d760e5220a175a5eb8e859498baa4c7f97f3e2) Reviewed-on: https://gerrit.libreoffice.org/38521 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2017-06-06tdf#107795 fixed cursor position after inserting input fieldBernhard Widl
Change-Id: I3c063c0393b524132e522914a7a9885c8a9c3b78 Reviewed-on: https://gerrit.libreoffice.org/37536 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Stahl <mstahl@redhat.com> (cherry picked from commit 408a7e320db978a8f784fa25e35caedf931612c5) Reviewed-on: https://gerrit.libreoffice.org/38443 Reviewed-by: Katarina Behrens <Katarina.Behrens@cib.de>
2017-05-31tdf#108072: match sprmTFCantSplit with its correct idAron Budea
The behavior was adjusted with 72ef0d88e916b320de85fe2ebf08cb7aea28ca08 , but the ids for sprmTFCantSplit90 and sprmTFCantSplit remained mixed up. Change-Id: Ic97224a3af39e5df707a6dba59b785580c17b739 Reviewed-on: https://gerrit.libreoffice.org/38117 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Reviewed-on: https://gerrit.libreoffice.org/38277
2017-05-31tdf#100072 zero height of shape's path was causing geometry errorsVasily Melenchuk
DOCX custom geometry shape's path width and height are now used independently for scaling calculations. Reviewed-on: https://gerrit.libreoffice.org/37639 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de> (cherry picked from commit 5477f7274e4df1210298c0f503a54eabc0f06bfc) plus: tdf#100072 extra test for DOCX shape import with zero height Corresponding bug is already fixed in tdf#107104. However created tests do care only for width, but not for height, like we have in this testcase. Reviewed-on: https://gerrit.libreoffice.org/37538 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> (cherry picked from commit cffc5a04661fc0a84dff9fa5da954236d88a8b38) Change-Id: If5d5499f402379df125b0f31dd071ca51b2553f1 Reviewed-on: https://gerrit.libreoffice.org/38224 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
2017-05-30tdf#106131 no global drag when anchor drag activeArmin Le Grand
If in Writer dragging the anchor is already active it is not allowed to enter global object drag mode. This check was missing and may lead to various inconsistencies Change-Id: I7d8dd2a62737e6d5d72f69747ceb21bcb73c45ed Reviewed-on: https://gerrit.libreoffice.org/38059 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Armin Le Grand <Armin.Le.Grand@cib.de> (cherry picked from commit 1b27bed2d5b6915cda408c6f8d27d15bf13cc9be) Reviewed-on: https://gerrit.libreoffice.org/38188 Tested-by: Armin Le Grand <Armin.Le.Grand@cib.de> (cherry picked from commit c3c208e1fdfd60b95fc09ed48d9ee975bddb214d) Reviewed-on: https://gerrit.libreoffice.org/38209 Reviewed-by: Michael Stahl <mstahl@redhat.com>
2017-05-30tdf#107729: Disable toolbar items that are not available yet.Jan Holesovsky
Otherwise trying to use them crashes LibreOffice. Change-Id: I268e5b783905ec7aaaf50cbc629fd44e6341bf8d Reviewed-on: https://gerrit.libreoffice.org/38185 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Eike Rathke <erack@redhat.com>
2017-05-29sw: coverity#1409899 Null pointer dereferencesMichael Stahl
Change-Id: I152def3c629980aedb705ac511f154cc6e9d1b0f (cherry picked from commit 40587c191ecf6ec667f40e9148c197246e3c45a5) Reviewed-on: https://gerrit.libreoffice.org/38060 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
2017-05-26tdf#105002 Don't crash on mail wizard recreationMaxim Monastirsky
Change-Id: I8af4753cc654ec475d40223a64afa50a9de332ab Reviewed-on: https://gerrit.libreoffice.org/38007 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Jan Holesovsky <kendy@collabora.com> (cherry picked from commit ce40f2798f0fa2f8f6e3084e4bbbd50e749c55d6) Reviewed-on: https://gerrit.libreoffice.org/38037
2017-05-25tdf#106953 RTF import: fix missing paragraph left marginMiklos Vajna
See commit 3915bf2dc877d5f1140798e24933db0f21386a4a (tdf#95376 DOCX import: fix incorrectly indented tab stops, 2016-01-26) for the various sources that can determine the paragraph indentation. In this case the problem was that too aggressive RTF style deduplication removed a direct indent, which then meant a fallback to the ind-from-num value, not to the ind-from-parastyle one. (cherry picked from commit f528f9499bd91b700c549575e88fa102cfffede9) Change-Id: I3b47b2bbeaaedf405baef24505d23dc49bd01865 Reviewed-on: https://gerrit.libreoffice.org/37670 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2017-05-25tdf#103158 ctrl+shift should work on key upMaxim Monastirsky
Under gtk/gtk3 we send CommandEventId::ModKeyChange on key down, to support the auto-accelerator feature. But at least the handler in SwEditWin::Command must get it on key up, in order to not interfere with other ctrl+shift+X shortcuts, which work on key down. To achieve that, we need: - On key up pass the key that was just released, instead of the current state of nothing being pressed. - Have a flag of whether it's a key down or up event, so it can be checked by the application code. Reviewed-on: https://gerrit.libreoffice.org/37275 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Maxim Monastirsky <momonasmon@gmail.com> (cherry picked from commit fe0451259d2fb93c809c1bfa3baf5abd90019c58) Conflicts: include/vcl/commandevent.hxx vcl/source/window/commandevent.cxx vcl/unx/generic/window/salframe.cxx vcl/unx/gtk/gtksalframe.cxx vcl/unx/gtk3/gtk3gtkframe.cxx Change-Id: If188d6ccdc3b214a2c3ed20aad291d74d46b358f Reviewed-on: https://gerrit.libreoffice.org/37516 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2017-05-25tdf#106424 fix crash in SfxItemPool::PutJochen Nitschke
This fix reverts commit 304d3856c138fb54ff536f41be3eff26ab4d6315 Date: Wed Oct 16 07:55:09 2002 +0000 #103124# possible unremoved SwFmt object fixed and commit fab98924e01f211c1d1fc5823c0867019b590c60 Date: Wed Oct 16 10:18:26 2002 +0000 #103152# possible unremoved SwFmt object fixed as they are causing crashes: http://crashreport.libreoffice.org/stats/signature /SfxItemPool::Put(SfxPoolItem%20const%20&,unsigned%20short) The comments suggest there was/is a use-after-free when SwFormatCharFormat is changed with API. This happens in unoobj.cxx and unostyle.cxx by SwFormatDrop::SetCharFormat(). With following changes: commit bf2ae97a223df987d6b9bc649afe311b5421f61e INTEGRATION: CWS os7 (1.64.4.3.34); FILE MERGED 2003/03/25 14:23:43 os 1.64.4.3.34.1: #104245# table mode added to the SwXTextCursor::SetPropertyValue attribute list; 'Standard' character format not allowed as drop cap char style and commit 9625366d0b2fd36a57c6283a4a80c47b80d57707 INTEGRATION: CWS os8 (1.64.4.3.48); FILE MERGED 2003/04/09 09:11:53 os 1.64.4.3.48.3: #104245# Default not allowed as DropCapCharStyleName, too in unoobj.cxx, setting the documents' default SwFormatCharFormat is rejected by throwing an exception. Likely to fix the same issue as the first 2 commits. So we do the same in unostyle.cxx now too. Add an assert in SwFormatCharFormat::SetCharFormat and SwFormatDrop::SetCharFormat, to uncover other changes to the default SwFormatCharFormat or SwFormatDrop. Such an case could happen in SwXTextDefaults::setPropertyValue where we bail out now. Change-Id: Iac59dffbd6285dd28d1000a8eacda8ffd3bdc962 Reviewed-on: https://gerrit.libreoffice.org/37499 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Stahl <mstahl@redhat.com> (cherry picked from commit 6d51bb3d54ac52e4870bd00a21fce3a3b1c5010b) Reviewed-on: https://gerrit.libreoffice.org/38005 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com> (cherry picked from commit 69330c31f5e8c35fb5ede92dcd130fde0bdc7e4f) Reviewed-on: https://gerrit.libreoffice.org/38032
2017-05-22ofz: check for null paraCaolán McNamara
Change-Id: Id31273b2a203414f8ad4f827c334ae17689560af (cherry picked from commit ebc2abf207c8d903b07f53ecefbca5731edcb1d6) Reviewed-on: https://gerrit.libreoffice.org/37876 Reviewed-by: Michael Stahl <mstahl@redhat.com> Tested-by: Michael Stahl <mstahl@redhat.com>
2017-05-22tdf#100033: Frames with the same name are removedTamás Zolnai
Allow to have frames with the same name. For removing real duplicated frames (generated by LO earlier) check other things also next to the frame name: position, size or whether the two frames are anchored to the same position. Reviewed-on: https://gerrit.libreoffice.org/37702 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Tamás Zolnai <tamas.zolnai@collabora.com> (cherry picked from commit 6952d696439981962ad378aa28b0d16ea6e48f0e) Change-Id: I191ae5128d0228eb85f78f065b44b1f0b3ba6dcf Reviewed-on: https://gerrit.libreoffice.org/37706 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2017-05-16sw: table-in-footnote: delete SwFootnoteFrame if it becomes emptyMichael Stahl
Crashed in a11y code with a SwFootnoteFrame that survived a JoinNode and subsequent deletion of its reference-containing SwTextFrame and thus had a stale "pRef" member; presumably the SwTableFrame needs to delete an empty footnote frame like the SwTextFrame does from SwContentFrame::Cut(), called from DelFrames(), called from CutImpl(). Change-Id: I5a30357ecd3bf474bfc4a5451de89beb245fb0ae (cherry picked from commit c9fb347642729017ad0c613fe26310befd021db8) Reviewed-on: https://gerrit.libreoffice.org/37562 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2017-05-16tdf#107568 sw: prevent moving/splitting of tables in footnotesMichael Stahl
The problem here is that for a table in a footnote on page 42, SwTabFrm::MakeAll() calls Split(), which first creates a follow-table-frame and then reformats the last row of the table; somehow the SwTextFrame id="4636" in that row doesn't fit and wants to split and then move to the following page with that page's footnote container as its parent. So this doesn't work currently. commit 971adcd9e19e0bcab5855aae9be58d2203b46169 tried to prevent just the moving forward of the table itself, but the table can still be split; if IsMoveable() returns false then that also prevents splitting the table. Change-Id: I1977c65f97cb0f66dbe5b89d7ef7e2cd05125331 (cherry picked from commit f6785b99a3f7e7531c8ef7ed16402cc4e02c9750) Reviewed-on: https://gerrit.libreoffice.org/37561 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2017-05-16Resolves: tdf#107786 crash on null pointer accessCaolán McNamara
Change-Id: I371d509e7ab6e7e0ef757e302d54ab75aa6c4c9b (cherry picked from commit 858d1e065530997a695dc303b9224fd136137c8d) Reviewed-on: https://gerrit.libreoffice.org/37537 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2017-05-16tdf#107512 sw: fix rollback of text attributes in SwUndoDeleteMichael Stahl
The problem is that in SwUndoDelete::UndoImpl(), first the formatting attributes are restored via TmpRollback(), and then all footnote/fly attributes are restored via Rollback(). This means that the SwHistory doesn't actually store the original positions of the formatting hints; ideally there wouldn't be 2 separate steps here, but that appears difficult to change now given the plethora of calls to DelContentIndex() ... So work around the problem by adding a new SetAttrMode::NOHINTEXPAND to prevent expanding the existing hints when the CH_TXTATR_BREAKWORD are inserted from SwUndoDelLayFormat. This fixes 2 problematic cases: at the start of the paragraph, and if the hint ends at the position before the CH_TXTATR_BREAKWORD. Let's hope this won't break anything anybody cares about. (cherry picked from commit 771d85baf18e5b503eb6248e1f41928b00265d8d) sw: CPPUNIT_ASSERT_EQUAL vs. integer FAIL (cherry picked from commit 7f44ca113170a641a1aecc8a48e2b99860e1e2f7) Change-Id: I557c4c9136f4225ca502019730fb9f0a9c03d23b Reviewed-on: https://gerrit.libreoffice.org/37485 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2017-05-09tdf#107620 RTF export: handle DocumentSettingId::PARA_SPACE_MAX compat settingMiklos Vajna
As it turns out it has a dedicated RTF control word. With this, the bugdoc is again kept as a one-page document during DOCX -> RTF conversion. If we are at it, also write the automatic before/after paragraph spacing markup. (cherry picked from commit 3a9854a92923df8013ca832c48aa9f284bcb1adc, but the nice-to-have automatic spacing markup is not picked) Conflicts: sw/qa/extras/rtfexport/rtfexport.cxx sw/source/filter/ww8/rtfattributeoutput.cxx sw/source/filter/ww8/rtfexport.cxx Change-Id: I78de644f0631e59ef507dfaa07c5a812d4ef10cd Reviewed-on: https://gerrit.libreoffice.org/37428 Reviewed-by: Michael Stahl <mstahl@redhat.com> Tested-by: Jenkins <ci@libreoffice.org>