[Libreoffice-commits] core.git: Branch 'libreoffice-7-0' - sw/source
sw/source/core/frmedt/feshview.cxx |8 1 file changed, 8 insertions(+) New commits: commit 925ed355f096c0b005cfddbbe4c78400472de5bc Author: Jeff Huang AuthorDate: Mon Apr 12 14:16:02 2021 +0800 Commit: Michael Stahl CommitDate: Tue Apr 20 10:42:46 2021 +0200 tdf#141525 Fix "Line with Arrow/Circle" insertion error. When you insert "Line with Arrow/Circle" from "Lines and Arrows", it will show "Line Starts with Arrow" instead of "Line with Arrow/Circle". This patch can fix this issue. (This issue exists at least since 6.3 series.) Change-Id: I827b9582951fe359d89245970e73d63f7697553f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113963 Tested-by: Jenkins Reviewed-by: Mark Hung (cherry picked from commit 2b498e380a91a536d177376e854cf3a6e2fb0b35) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114179 Reviewed-by: Po-Yen Huang Reviewed-by: Xisco Fauli (cherry picked from commit 4ee3d213e8d3c4afdc3714b50def117dfe5c8023) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114275 Reviewed-by: Michael Stahl diff --git a/sw/source/core/frmedt/feshview.cxx b/sw/source/core/frmedt/feshview.cxx index 9da71abf8b8c..33134f5858a6 100644 --- a/sw/source/core/frmedt/feshview.cxx +++ b/sw/source/core/frmedt/feshview.cxx @@ -1005,6 +1005,14 @@ void SwFEShell::SetLineEnds(SfxItemSet& rAttr, SdrObject const & rObj, sal_uInt1 // and again, for the still missing ends switch (nSlotId) { +case SID_LINE_ARROW_CIRCLE: +{ +// circle end +rAttr.Put(XLineEndItem(SvxResId(RID_SVXSTR_CIRCLE), aCircle)); +rAttr.Put(XLineEndWidthItem(nWidth)); +} +break; + case SID_LINE_CIRCLE_ARROW: { // circle start ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-7-0' - sw/source
sw/source/uibase/utlui/glbltree.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 30fb31983a3492da9db09cdfccdd2f8f9550bb0d Author: Caolán McNamara AuthorDate: Mon Mar 29 14:17:31 2021 +0100 Commit: Michael Stahl CommitDate: Tue Mar 30 12:07:15 2021 +0200 tdf#140556 master document view not launching subdocument from context menu Change-Id: I0ae61e51266ae050e340c1af99e0dd6a481e6ff9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113282 Tested-by: Jenkins Reviewed-by: Michael Stahl diff --git a/sw/source/uibase/utlui/glbltree.cxx b/sw/source/uibase/utlui/glbltree.cxx index 3261050f3a6c..360a2ddbea8b 100644 --- a/sw/source/uibase/utlui/glbltree.cxx +++ b/sw/source/uibase/utlui/glbltree.cxx @@ -608,7 +608,7 @@ void SwGlobalTree::ExecuteContextMenuAction(const OString& rSelectedPopupEntry) pCont = nullptr; bUpdateHard = true; } -else if (rSelectedPopupEntry == "edit") +else if (rSelectedPopupEntry == "editcontent") { OSL_ENSURE(pCont, "edit without entry ? " ); if (pCont) ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-7-0' - sw/source
sw/source/core/edit/autofmt.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit ca9e8a3d2315b44f9f3eb59ab825fc1ede7e10df Author: Julien Nabet AuthorDate: Sun Mar 7 10:40:42 2021 +0100 Commit: Caolán McNamara CommitDate: Mon Mar 29 15:19:13 2021 +0200 sw fr_FR AutoCorrect: fix crash using "Apply and Edit changes" Bad calling of SvxAutoCorrect::FnAddNonBrkSpace() in French documents, see tdf#140849 for a similar problem. Change-Id: I19b964fb8fe437c7f98342a873a456ffded75d82 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112120 (cherry picked from commit df41967a29c4f8243d1df2d9b23d7c41d4a13819) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112792 Tested-by: Jenkins Reviewed-by: László Németh Reviewed-by: Caolán McNamara diff --git a/sw/source/core/edit/autofmt.cxx b/sw/source/core/edit/autofmt.cxx index 5c3e22aaed4a..5e806d73ea38 100644 --- a/sw/source/core/edit/autofmt.cxx +++ b/sw/source/core/edit/autofmt.cxx @@ -2184,7 +2184,7 @@ void SwAutoFormat::AutoCorrect(TextFrameIndex nPos) continue; // do not check further } -if ( m_aFlags.bAddNonBrkSpace ) +if ( m_aFlags.bAddNonBrkSpace && nPos < TextFrameIndex(pText->getLength()) ) { SetRedlineText( STR_AUTOFMTREDL_NON_BREAK_SPACE ); pATst->FnAddNonBrkSpace(aACorrDoc, *pText, sal_Int32(nPos), eLang, bNbspRunNext); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-7-0' - sw/source
sw/source/ui/misc/outline.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit e826753132ccd77f7bdcc096712d577f42911968 Author: Noel Grandin AuthorDate: Sat Mar 13 18:12:24 2021 +0200 Commit: Noel Grandin CommitDate: Fri Mar 26 14:23:51 2021 +0100 tdf#140590 Writer crash in Tools>Chapter Numbering and an assert in vcl to catch it a little higher up the stack. Change-Id: Iaa2e70f901f93ca9f678118e4f5a8bc1b6eda20a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112459 Tested-by: Jenkins Reviewed-by: Noel Grandin Signed-off-by: Xisco Fauli Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112866 (cherry picked from commit ebbf550f7087b173bdcf600a02bb87c0b655e787) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113124 diff --git a/sw/source/ui/misc/outline.cxx b/sw/source/ui/misc/outline.cxx index 8a62e03054ea..3ad4e369bd75 100644 --- a/sw/source/ui/misc/outline.cxx +++ b/sw/source/ui/misc/outline.cxx @@ -92,7 +92,7 @@ void SwNumNamesDlg::SetUserNames(const OUString *pList[]) nSelect++; } } -m_xFormBox->select(nSelect); +m_xFormBox->select(std::min(nSelect, static_cast(m_xFormBox->n_children() - 1))); SelectHdl(*m_xFormBox); } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-7-0' - sw/source
sw/source/core/doc/notxtfrm.cxx | 52 1 file changed, 1 insertion(+), 51 deletions(-) New commits: commit cf453e399c94f3af49a614c266f7c2e9a1ad45fa Author: Xisco Fauli AuthorDate: Thu Mar 11 12:42:47 2021 +0100 Commit: Caolán McNamara CommitDate: Tue Mar 16 21:39:33 2021 +0100 Revert "tdf#114076: Expand ClipRange to next PixelBound" ... and "tdf#124272 use ClipRegion's geometry if not a rectangle" This commit reverts c1230cede19ae3633e51c7ca780cb34d9dbaa20f and 362c1cf2bd580f6dc8bf27bdcd79174111bc1b5c tdf#114076, or any of its duplicates, is not reproducible in master if c1230cede19ae3633e51c7ca780cb34d9dbaa20f ("tdf#114076: Expand ClipRange to next PixelBound") is reverted. (Tested on Linux and Windows) So, if we revert it, we no longer need 362c1cf2bd580f6dc8bf27bdcd79174111bc1b5c ("tdf#124272 use ClipRegion's geometry if not a rectangle"), which was a follow-up fix for a regression introduced by the first commit. This also fixes tdf#129085 and all the duplicates, which were introduced by the follow-up commit. I plan to add the unittests in a different commit Change-Id: Ie4328c15b24b521127c1b653bd621bfc92ac39cf Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112340 Tested-by: Jenkins Reviewed-by: Xisco Fauli Signed-off-by: Xisco Fauli Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112398 Reviewed-by: Armin Le Grand (cherry picked from commit 8926d9282fe84793ce909471b5caec3583fd3ec9) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112530 Reviewed-by: Caolán McNamara diff --git a/sw/source/core/doc/notxtfrm.cxx b/sw/source/core/doc/notxtfrm.cxx index 550f0df508db..291608431bfa 100644 --- a/sw/source/core/doc/notxtfrm.cxx +++ b/sw/source/core/doc/notxtfrm.cxx @@ -982,59 +982,9 @@ void paintGraphicUsingPrimitivesHelper( if(0 != aClip.count()) { -// tdf#114076: Expand ClipRange to next PixelBound -// Do this by going to basegfx::B2DRange, adding a -// single pixel size and using floor/ceil to go to -// full integer (as needed for pixels). Also need -// to go back to basegfx::B2DPolyPolygon for the -// creation of the needed MaskPrimitive2D. -// The general problem is that Writer is scrolling -// using blitting the unchanged parts, this forces -// this part of the scroll to pixel coordinate steps, -// while the ViewTransformation for paint nowadays has -// a sub-pixel precision. This results in an offset -// up to one pixel in radius. To solve this for now, -// we need to expand to the next outer pixel bound. -// Hopefully in the future we will someday be able to -// stay on the full available precision, but this -// will need a change in the repaint/scroll paradigm. -const basegfx::B2DRange aClipRange(aClip.getB2DRange()); -const basegfx::B2DVector aSinglePixelXY(rOutputDevice.GetInverseViewTransformation() * basegfx::B2DVector(1.0, 1.0)); -const basegfx::B2DRange aExpandedClipRange( -floor(aClipRange.getMinX() - aSinglePixelXY.getX()), -floor(aClipRange.getMinY() - aSinglePixelXY.getY()), -ceil(aClipRange.getMaxX() + aSinglePixelXY.getX()), -ceil(aClipRange.getMaxY() + aSinglePixelXY.getY())); - -// create the enclosing rectangle as polygon -basegfx::B2DPolyPolygon aTarget(basegfx::utils::createPolygonFromRect(aExpandedClipRange)); - -// tdf#124272 the fix above (tdf#114076) was too rough - the -// clip region used may be a PolyPolygon. In that case that -// PolyPolygon would have to be scaled to mentioned PixelBounds. -// Since that is not really possible geometrically (would need -// more some 'grow in outside direction' but with unequal grow -// values in all directions - just maaany problems -// involved), use a graphical trick: The topology of the -// PolyPolygon uses the standard FillRule, so adding the now -// guaranteed to be bigger or equal bounding (enclosing) -// rectangle twice as polygon will expand the BoundRange, but -// not change the geometry visualization at all -if(!rOutputDevice.GetClipRegion().IsRectangle()) -{ -// double the outer rectangle range polygon to have it -// included twice -aTarget.append(aTarget.getB2DPolygon(0)); - -// add the original clip 'inside' (due to being smaller -// or equal). That PolyPolygon may have an unknown number -// of polygons (>=1) -aTarget.append(aClip); -
[Libreoffice-commits] core.git: Branch 'libreoffice-7-0' - sw/source
sw/source/uibase/index/toxmgr.cxx | 17 - 1 file changed, 4 insertions(+), 13 deletions(-) New commits: commit 74a273836169ad5b78b22c4bdc6724c66ca9007f Author: Michael Stahl AuthorDate: Wed Jan 27 15:41:40 2021 +0100 Commit: Thorsten Behrens CommitDate: Fri Jan 29 21:48:52 2021 +0100 sw: fix SwTOXMgr::UpdateOrInsertTOX() for user-defined The main problem is that when editing an existing user-defined index, the "Create From" changes aren't applied, because it does pCurTOX->SetCreate() and not pNewTOX->SetCreate(). But that wasn't obvious as the function is obviosly very confused about its 3 different TOX variables. pTOX is just used at the end, so just move it there. pCurTOX can be const. Then there is an odd condition on pSh->HasSelection() which ends up doing DelRight() but fortunately it's dead code since commit e9da29679bce3b544add9233a4aca2b19b78da1a #i97572# cleared the selection already. The pNewTOX = pCurTOX there seems pointless because pNewTOX is already a copy of *pCurTOX. Change-Id: I1e9c8178e314a188a50272410fbe566e4a566742 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110021 Tested-by: Jenkins Reviewed-by: Michael Stahl (cherry picked from commit 960e88835e0b2f7ff5fc57393b74017198c314e3) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110064 Reviewed-by: Thorsten Behrens diff --git a/sw/source/uibase/index/toxmgr.cxx b/sw/source/uibase/index/toxmgr.cxx index 4e7e65f9c4d0..fe4885830ffa 100644 --- a/sw/source/uibase/index/toxmgr.cxx +++ b/sw/source/uibase/index/toxmgr.cxx @@ -269,13 +269,9 @@ bool SwTOXMgr::UpdateOrInsertTOX(const SwTOXDescription& rDesc, { SwWait aWait( *pSh->GetView().GetDocShell(), true ); bool bRet = true; -const SwTOXBase* pCurTOX = ppBase && *ppBase ? *ppBase : pSh->GetCurTOX(); -SwTOXBase* pTOX = const_cast(pCurTOX); +const SwTOXBase *const pCurTOX = ppBase && *ppBase ? *ppBase : pSh->GetCurTOX(); -SwTOXBase * pNewTOX = nullptr; - -if (pTOX) -pNewTOX = new SwTOXBase(*pTOX); +SwTOXBase * pNewTOX = pCurTOX ? new SwTOXBase(*pCurTOX) : nullptr; TOXTypes eCurTOXType = rDesc.GetTOXType(); if(pCurTOX && !ppBase && pSh->HasSelection()) @@ -330,7 +326,7 @@ bool SwTOXMgr::UpdateOrInsertTOX(const SwTOXDescription& rDesc, } else { -const_cast( pCurTOX )->SetCreate(rDesc.GetContentOptions()); +pNewTOX->SetCreate(rDesc.GetContentOptions()); } pNewTOX->SetLevelFromChapter(rDesc.IsLevelFromChapter()); } @@ -385,12 +381,6 @@ bool SwTOXMgr::UpdateOrInsertTOX(const SwTOXDescription& rDesc, TOX_AUTHORITIES == eCurTOXType ? SwTOXElement::Mark : SwTOXElement::NONE, pType->GetTypeName()); } -else -{ -if((!ppBase || !(*ppBase)) && pSh->HasSelection()) -pSh->DelRight(); -pNewTOX = const_cast(pCurTOX); -} pNewTOX->SetFromObjectNames(rDesc.IsCreateFromObjectNames()); pNewTOX->SetOLEOptions(rDesc.GetOLEOptions()); } @@ -437,6 +427,7 @@ bool SwTOXMgr::UpdateOrInsertTOX(const SwTOXDescription& rDesc, pDoc->GetIDocumentUndoRedo().StartUndo(SwUndoId::TOXCHANGE, nullptr); } +SwTOXBase *const pTOX = const_cast(pCurTOX); pDoc->ChangeTOX(*pTOX, *pNewTOX); pTOX->DisableKeepExpression(); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-7-0' - sw/source
sw/source/uibase/dbui/dbtree.cxx |6 -- 1 file changed, 4 insertions(+), 2 deletions(-) New commits: commit ebdf896c9d3260b544ebe67ffa09d21be603d170 Author: Justin Luth AuthorDate: Wed Jan 13 21:27:56 2021 +0300 Commit: Michael Stahl CommitDate: Wed Jan 20 12:17:28 2021 +0100 tdf#119610 tdf#112634: Don't show broken connections - RevB This changes LO 6.0 commit 75a881829f19439245cdb859fc16d59461992f79 to use a light-weight check to see if a database exists. The previous way made a connection, which is extremely expensive if there is a password, or if network traffic needs to timeout, etc. And if there are multiple registered databases like that... Change-Id: I980cb6979cfc7cae8f1251f3459718192459aaee Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109242 Tested-by: Jenkins Reviewed-by: Justin Luth (cherry picked from commit 647c9de0338350c1b5eff4b9adf08bd06930e36b) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109402 Reviewed-by: Xisco Fauli (cherry picked from commit 6c580008d397f5f5f4a0bfd879308018b5d2a54f) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109582 Reviewed-by: Michael Stahl diff --git a/sw/source/uibase/dbui/dbtree.cxx b/sw/source/uibase/dbui/dbtree.cxx index cf31941c31db..f9ffad0f26ab 100644 --- a/sw/source/uibase/dbui/dbtree.cxx +++ b/sw/source/uibase/dbui/dbtree.cxx @@ -157,8 +157,10 @@ void SwDBTreeList::InitTreeList() OUString aImg(RID_BMP_DB); for (const OUString& rDBName : std::as_const(aDBNames)) { -Reference xConnection = pImpl->GetConnection(rDBName); -if (xConnection.is()) +// If this database has a password or a (missing) remote connection, +// then it might take a long time or spam for unnecessary credentials. +// Just check that it basically exists to weed out any broken/obsolete registrations. +if (SwDBManager::getDataSourceAsParent(Reference(), rDBName).is()) { m_xTreeView->insert(nullptr, -1, , nullptr, nullptr, nullptr, , true, nullptr); } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-7-0' - sw/source
sw/source/core/edit/autofmt.cxx | 11 +++ 1 file changed, 7 insertions(+), 4 deletions(-) New commits: commit 008dc7a128c1f49093eefadc83c125c3c6b1bb00 Author: Justin Luth AuthorDate: Fri Jan 15 20:32:43 2021 +0300 Commit: Michael Stahl CommitDate: Mon Jan 18 13:48:07 2021 +0100 tdf#136704 sw autofmt: prevent crash if no nextNode The second GetNextNode() was a nullptr that was being dereferenced. Now, when enter is pressed after some text followed by a colon, that line is made into a heading3, and the new blank line is properly using the text body paragraph style. Change-Id: If10dc85e490ac57fc150b3d541f5033dfd5293bb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109413 Tested-by: Jenkins Reviewed-by: Justin Luth Reviewed-by: Michael Stahl (cherry picked from commit fea7b531a4c9e8326a64426325b16585675a) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109520 diff --git a/sw/source/core/edit/autofmt.cxx b/sw/source/core/edit/autofmt.cxx index 7588104d5c7f..5c3e22aaed4a 100644 --- a/sw/source/core/edit/autofmt.cxx +++ b/sw/source/core/edit/autofmt.cxx @@ -1896,11 +1896,14 @@ void SwAutoFormat::BuildHeadLine( sal_uInt16 nLvl ) JoinPrevPara(); DeleteLeadingTrailingBlanks( true, false ); -const SwTextFrame *const pNextFrame = GetNextNode(false); -(void)DeleteJoinCurNextPara(pNextFrame, true); - +const SwTextFrame* pNextFrame = GetNextNode(false); +if (pNextFrame->GetNext()) +{ +(void)DeleteJoinCurNextPara(pNextFrame, true); +pNextFrame = GetNextNode(false); +} m_aDelPam.DeleteMark(); -m_aDelPam.GetPoint()->nNode = *GetNextNode(false)->GetTextNodeForParaProps(); +m_aDelPam.GetPoint()->nNode = *pNextFrame->GetTextNodeForParaProps(); m_aDelPam.GetPoint()->nContent.Assign( m_aDelPam.GetContentNode(), 0 ); m_pDoc->SetTextFormatColl( m_aDelPam, ); } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-7-0' - sw/source
sw/source/core/doc/DocumentRedlineManager.cxx |2 ++ sw/source/core/text/txtfrm.cxx|2 ++ 2 files changed, 4 insertions(+) New commits: commit 092f1a810d5b10aa8d6d8455491f7ae42caf3a08 Author: Michael Stahl AuthorDate: Thu Jan 14 20:10:24 2021 +0100 Commit: Caolán McNamara CommitDate: Sat Jan 16 17:59:55 2021 +0100 tdf#135014 sw_redlinehide: fix missing frames when removing fieldmark A fieldmark was deleted. UpdateFramesForRemoveDeleteRedline() deleted the MergedPara but its start node was before the start node of the fieldmark, and then MakeFrames() didn't find a frame on the preceding node and did nothing. Similar problem likely possible with redline. Change-Id: I532f9a67c0268f3287736a61da4cc9fefec7b8e4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109307 Tested-by: Jenkins Reviewed-by: Michael Stahl (cherry picked from commit 32e104c1d6be0ffe6ed6c4e08af868c87b3c258c) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109347 Reviewed-by: Caolán McNamara diff --git a/sw/source/core/doc/DocumentRedlineManager.cxx b/sw/source/core/doc/DocumentRedlineManager.cxx index f3aaa13a60d1..90d957bab92f 100644 --- a/sw/source/core/doc/DocumentRedlineManager.cxx +++ b/sw/source/core/doc/DocumentRedlineManager.cxx @@ -301,6 +301,8 @@ void UpdateFramesForRemoveDeleteRedline(SwDoc & rDoc, SwPaM const& rPam) pFrame->SetMergedPara(sw::CheckParaRedlineMerge( *pFrame, rFirstNode, eMode)); eMode = sw::FrameMode::New; // Existing is not idempotent! +// update pNode so MakeFrames starts on 2nd node +pNode = } } if (pLast != pNode) diff --git a/sw/source/core/text/txtfrm.cxx b/sw/source/core/text/txtfrm.cxx index 2d585994ec05..ec1957dbaaaf 100644 --- a/sw/source/core/text/txtfrm.cxx +++ b/sw/source/core/text/txtfrm.cxx @@ -1278,6 +1278,8 @@ void SwTextFrame::SetMergedPara(std::unique_ptr p) pFirst->Add(this); // must register at node again } } +// postcondition: frame must be listening somewhere +assert(m_pMergedPara || GetDep()); } const OUString& SwTextFrame::GetText() const ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-7-0' - sw/source
sw/source/filter/ww8/writerhelper.hxx |2 + sw/source/filter/ww8/ww8atr.cxx | 55 -- 2 files changed, 29 insertions(+), 28 deletions(-) New commits: commit 36038264400f591a529a18f0b742410e53db73d3 Author: Caolán McNamara AuthorDate: Sun Oct 4 14:16:53 2020 +0100 Commit: Xisco Fauli CommitDate: Wed Jan 13 21:19:35 2021 +0100 tdf#139580: combine these identical blocks together into a function Change-Id: I783c7f649d0624de9fb46c2b8379fc47ec311f63 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103917 Tested-by: Jenkins Reviewed-by: Caolán McNamara Signed-off-by: Xisco Fauli Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109226 diff --git a/sw/source/filter/ww8/writerhelper.hxx b/sw/source/filter/ww8/writerhelper.hxx index f9d186ec58df..9ad16d0c2f14 100644 --- a/sw/source/filter/ww8/writerhelper.hxx +++ b/sw/source/filter/ww8/writerhelper.hxx @@ -650,6 +650,8 @@ namespace sw */ explicit SetLayer(const SwDoc ); }; + +const SwCharFormat* GetSwCharFormat(const SwFormatINetFormat& rINet, SwDoc& rDoc); } namespace hack diff --git a/sw/source/filter/ww8/ww8atr.cxx b/sw/source/filter/ww8/ww8atr.cxx index e081b730f037..5ff2f7be0f7e 100644 --- a/sw/source/filter/ww8/ww8atr.cxx +++ b/sw/source/filter/ww8/ww8atr.cxx @@ -226,22 +226,10 @@ void MSWordExportBase::ExportPoolItemsToCHP( ww8::PoolItems , sal_uInt16 if (pINetItem) { const SwFormatINetFormat& rINet = static_cast(*pINetItem); - - if ( rINet.GetValue().isEmpty() ) + const SwCharFormat* pINetFormat = GetSwCharFormat(rINet, *m_pDoc); + if (!pINetFormat) continue; - const sal_uInt16 nId = rINet.GetINetFormatId(); - const OUString& rStr = rINet.GetINetFormat(); - - if (rStr.isEmpty()) - { - SAL_WARN("sw.ww8", "MSWordExportBase::ExportPoolItemsToCHP(..) - missing unvisited character format at hyperlink attribute" ); - } - - const SwCharFormat* pINetFormat = IsPoolUserFormat( nId ) -? m_pDoc->FindCharFormatByName( rStr ) -: m_pDoc->getIDocumentStylePoolAccess().GetCharFormatFromPool( nId ); - const SwCharFormat* pFormat = static_cast(*pItem).GetCharFormat(); ww8::PoolItems aCharItems, aINetItems; GetPoolItems(pFormat->GetAttrSet(), aCharItems, false); @@ -1645,25 +1633,36 @@ void WW8AttributeOutput::CharBackground( const SvxBrushItem& rBrush ) m_rWW8Export.InsUInt16( 0x); } -void WW8AttributeOutput::TextINetFormat( const SwFormatINetFormat& rINet ) +namespace sw { namespace util { + +const SwCharFormat* GetSwCharFormat(const SwFormatINetFormat& rINet, SwDoc& rDoc) { -if ( !rINet.GetValue().isEmpty() ) +if (rINet.GetValue().isEmpty()) +return nullptr; + +const sal_uInt16 nId = rINet.GetINetFormatId(); +const OUString& rStr = rINet.GetINetFormat(); +if (rStr.isEmpty()) { -const sal_uInt16 nId = rINet.GetINetFormatId(); -const OUString& rStr = rINet.GetINetFormat(); -if (rStr.isEmpty()) -{ -OSL_ENSURE( false, "WW8AttributeOutput::TextINetFormat(..) - missing unvisited character format at hyperlink attribute" ); -} +OSL_ENSURE( false, "WW8AttributeOutput::TextINetFormat(..) - missing unvisited character format at hyperlink attribute" ); +} -const SwCharFormat* pFormat = IsPoolUserFormat( nId ) -? m_rWW8Export.m_pDoc->FindCharFormatByName( rStr ) -: m_rWW8Export.m_pDoc->getIDocumentStylePoolAccess().GetCharFormatFromPool( nId ); +return IsPoolUserFormat( nId ) + ? rDoc.FindCharFormatByName( rStr ) + : rDoc.getIDocumentStylePoolAccess().GetCharFormatFromPool( nId ); +} -m_rWW8Export.InsUInt16( NS_sprm::sprmCIstd ); +} } -m_rWW8Export.InsUInt16( m_rWW8Export.GetId( pFormat ) ); -} +void WW8AttributeOutput::TextINetFormat( const SwFormatINetFormat& rINet ) +{ +const SwCharFormat* pFormat = GetSwCharFormat(rINet, *m_rWW8Export.m_pDoc); +if (!pFormat) +return; + +m_rWW8Export.InsUInt16( NS_sprm::sprmCIstd ); + +m_rWW8Export.InsUInt16( m_rWW8Export.GetId( pFormat ) ); } // #i43956# - add optional parameter ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-7-0' - sw/source
sw/source/core/access/accdoc.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 3745df317f500e95a301f0a883111ec2c7f06405 Author: Julien Nabet AuthorDate: Sun Jan 10 15:42:31 2021 +0100 Commit: Caolán McNamara CommitDate: Mon Jan 11 17:54:05 2021 +0100 Related tdf#123632: fix crash in accdoc (sw) Make sure to use gtk3 rendering - Open https://bugs.documentfoundation.org/attachment.cgi?id=149492 - Click F5 to open the navigator - Go to Images - Try double click the third and last image at least 15 times -> crash, here's part of bt: Thread 1 "soffice.bin" received signal SIGSEGV, Segmentation fault. SwFrame::IsInTab (this=0x0) at sw/source/core/inc/frame.hxx:938 938 if ( mbInfInvalid ) (gdb) bt 0 SwFrame::IsInTab() const (this=0x0) at sw/source/core/inc/frame.hxx:938 1 0x7fd7e78caf9c in SwAccessibleDocument::getExtendedAttributes() (this=0x7e4e090) at sw/source/core/access/accdoc.cxx:596 2 0x7fd7e78cbf9d in non-virtual thunk to SwAccessibleDocument::getExtendedAttributes() () at sw/source/core/access/accdoc.cxx:708 3 0x7fd7f18f90ad in attribute_set_new_from_extended_attributes(com::sun::star::uno::Reference const&) (rExtendedAttributes=uno::Reference to (SwAccessibleDocument *) 0x7e4e180) at vcl/unx/gtk3/a11y/gtk3atktextattributes.cxx:1229 4 0x7fd7f19113f3 in wrapper_get_attributes(_AtkObject*) (atk_obj=0x7df37d0) at vcl/unx/gtk3/a11y/gtk3atkwrapper.cxx:394 I put "Related" because I don't know if it corresponds to the initial bug but I used the attached file of the bugtracker Change-Id: Ief9fda9f7bcf277d18490169eee2e43fb046a1bf Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109051 Tested-by: Jenkins Reviewed-by: Michael Stahl (cherry picked from commit 003b45624788610fba98e3f3334f99140017e472) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109002 Reviewed-by: Caolán McNamara diff --git a/sw/source/core/access/accdoc.cxx b/sw/source/core/access/accdoc.cxx index bf2c0e844a2b..f95b5776fee5 100644 --- a/sw/source/core/access/accdoc.cxx +++ b/sw/source/core/access/accdoc.cxx @@ -585,7 +585,7 @@ uno::Any SAL_CALL SwAccessibleDocument::getExtendedAttributes() { if (!(pCurrTextFrame->IsInTab() || pCurrTextFrame->IsInFootnote())) { -while( pTextFrame != pCurrTextFrame ) +while( pTextFrame && pTextFrame != pCurrTextFrame ) { //check header/footer pFrame = pTextFrame; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-7-0' - sw/source
sw/source/filter/xml/xmltbli.cxx |4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) New commits: commit 428244a88ab01c68a8dec4d39eff3c0ece69b784 Author: Eike Rathke AuthorDate: Wed Jan 6 15:02:05 2021 +0100 Commit: Xisco Fauli CommitDate: Thu Jan 7 10:52:28 2021 +0100 Resolves: tdf#139126 DBL_MAX is a valid value, just not for Writer Restore the old side effect behaviour where "1.79769313486232E+308" was not converted back to DBL_MAX, Writer doesn't check cell value after import for this "special value", *cough*. Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108875 Tested-by: Jenkins Reviewed-by: Eike Rathke (cherry picked from commit 0e37ded8d4aea25e5d9f7325fba0597f509147bc) Conflicts: sw/source/filter/xml/xmltbli.cxx Change-Id: I31cf598d5f91d1f727d5f1f0e936a3505ea1b9e0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108900 Tested-by: Jenkins Reviewed-by: Xisco Fauli diff --git a/sw/source/filter/xml/xmltbli.cxx b/sw/source/filter/xml/xmltbli.cxx index 5a95befacf47..de540a39e17a 100644 --- a/sw/source/filter/xml/xmltbli.cxx +++ b/sw/source/filter/xml/xmltbli.cxx @@ -498,8 +498,10 @@ SwXMLTableCellContext_Impl::SwXMLTableCellContext_Impl( break; case XML_TOK_TABLE_VALUE: { +// Writer wrongly uses DBL_MAX to flag error but fails to +// check for it after import, so check that here, tdf#139126. double fTmp; -if (::sax::Converter::convertDouble(fTmp, rValue)) +if (::sax::Converter::convertDouble(fTmp, rValue) && fTmp < DBL_MAX) { m_fValue = fTmp; m_bHasValue = true; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-7-0' - sw/source
sw/source/uibase/inc/inputwin.hxx |8 1 file changed, 8 insertions(+) New commits: commit cc54ea4412b2561fc4eb57e40f6eeec66cc30c16 Author: Caolán McNamara AuthorDate: Tue Dec 22 14:14:39 2020 + Commit: Adolfo Jayme Barrientos CommitDate: Wed Dec 23 17:39:03 2020 +0100 tdf#138457 Cursor position wrong when using functions in a writer table Change-Id: I70156d8492afbab2c5993e1627a024ef8e07c492 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108176 Tested-by: Jenkins Reviewed-by: Adolfo Jayme Barrientos diff --git a/sw/source/uibase/inc/inputwin.hxx b/sw/source/uibase/inc/inputwin.hxx index 6698e192421c..a5b97af36c3d 100644 --- a/sw/source/uibase/inc/inputwin.hxx +++ b/sw/source/uibase/inc/inputwin.hxx @@ -79,7 +79,15 @@ public: void replace_selection(const OUString& rText) { +int nStartPos, nEndPos; +m_xWidget->get_selection_bounds(nStartPos, nEndPos); +if (nStartPos > nEndPos) +std::swap(nStartPos, nEndPos); + m_xWidget->replace_selection(rText); + +nStartPos = nStartPos + rText.getLength(); +m_xWidget->select_region(nStartPos, nStartPos); } void select_region(int nStartPos, int nEndPos) ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-7-0' - sw/source
sw/source/core/crsr/swcrsr.cxx | 10 -- 1 file changed, 8 insertions(+), 2 deletions(-) New commits: commit a60f4a6222fdbcb4a1adebe670eaf1636a014da6 Author: Xisco Fauli AuthorDate: Thu Dec 10 17:04:59 2020 +0100 Commit: Caolán McNamara CommitDate: Fri Dec 11 20:51:22 2020 +0100 sw: add missing nullptr check introduced by 0aa0fda64057647219954480ac1bab86b0f0e433 See: https://crashreport.libreoffice.org/stats/signature/SwCursor::UpDown(bool,unsigned%20short,Point%20const%20*,long,SwRootFrame%20&) Change-Id: Ifb7a86b0dfd1477d6ffa15c7d4d3289984747f87 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107561 Tested-by: Jenkins Reviewed-by: Miklos Vajna (cherry picked from commit 0a80dcad342c1be71f467e46a0cf4f5dd1259056) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107615 Reviewed-by: Caolán McNamara diff --git a/sw/source/core/crsr/swcrsr.cxx b/sw/source/core/crsr/swcrsr.cxx index e1237d8cffab..879d632dfc8b 100644 --- a/sw/source/core/crsr/swcrsr.cxx +++ b/sw/source/core/crsr/swcrsr.cxx @@ -2044,9 +2044,15 @@ bool SwCursor::UpDown( bool bUp, sal_uInt16 nCnt, } else { +sal_Int32 nOffset = 0; + // Jump to beginning or end of line when the cursor at first or last line. -SwNode& rNode = GetPoint()->nNode.GetNode(); -const sal_Int32 nOffset = bUp ? 0 : rNode.GetTextNode()->GetText().getLength(); +if(!bUp) +{ +SwTextNode* pTextNd = GetPoint()->nNode.GetNode().GetTextNode(); +if (pTextNd) +nOffset = pTextNd->GetText().getLength(); +} const SwPosition aPos(*GetContentNode(), nOffset); //if cursor has already been at start or end of file, ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-7-0' - sw/source
sw/source/uibase/docvw/AnnotationWin2.cxx | 11 ++- 1 file changed, 6 insertions(+), 5 deletions(-) New commits: commit 2e6ecdfec95ac18a197cf31a67455cd103b73198 Author: Caolán McNamara AuthorDate: Thu Dec 10 13:14:18 2020 + Commit: Adolfo Jayme Barrientos CommitDate: Fri Dec 11 03:18:11 2020 +0100 fix printing of 'margins in comment' mangled since... commit c200aa27ee4a0f5a89af6e970c2c22580029eded Author: Caolán McNamara Date: Thu May 21 15:54:15 2020 +0100 remove Size arg from Window::Draw and depend on GetSizePixel which was a real monday-morning commit that bizarrely dropped drawing of the date/resolved widgets entirely and failed to notice that the PixelToLogic call in SwPostItMgr::DrawNotesForPage was originally called on the input pPostIt, not the output pDev Change-Id: I73b87f5889ef13018bcc43f97cd65169a3b77a65 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107534 Tested-by: Jenkins Reviewed-by: Adolfo Jayme Barrientos diff --git a/sw/source/uibase/docvw/AnnotationWin2.cxx b/sw/source/uibase/docvw/AnnotationWin2.cxx index 9c3539f2e6d7..04c1f8332695 100644 --- a/sw/source/uibase/docvw/AnnotationWin2.cxx +++ b/sw/source/uibase/docvw/AnnotationWin2.cxx @@ -260,7 +260,7 @@ void SwAnnotationWin::SetCursorLogicPosition(const Point& rPosition, bool bPoint void SwAnnotationWin::Draw(OutputDevice* pDev, const Point& rPt, DrawFlags nInFlags) { -Size aSz = pDev->PixelToLogic(GetSizePixel()); +Size aSz = PixelToLogic(GetSizePixel()); if (mpMetadataAuthor->IsVisible() ) { @@ -287,6 +287,7 @@ void SwAnnotationWin::Draw(OutputDevice* pDev, const Point& rPt, DrawFlags nInFl aPos += rPt; vcl::Font aFont( mpMetadataDate->GetSettings().GetStyleSettings().GetFieldFont() ); mpMetadataDate->SetControlFont( aFont ); +mpMetadataDate->Draw(pDev, aPos, nInFlags); mpMetadataDate->SetControlFont( aOrigFont ); } @@ -297,13 +298,11 @@ void SwAnnotationWin::Draw(OutputDevice* pDev, const Point& rPt, DrawFlags nInFl aPos += rPt; vcl::Font aFont( mpMetadataResolved->GetSettings().GetStyleSettings().GetFieldFont() ); mpMetadataResolved->SetControlFont( aFont ); +mpMetadataResolved->Draw(pDev, aPos, nInFlags); mpMetadataResolved->SetControlFont( aOrigFont ); } -Size aOrigSize(mpSidebarTextControl->GetSizePixel()); -mpSidebarTextControl->SetSizePixel(aSz); mpSidebarTextControl->Draw(pDev, rPt, nInFlags); -mpSidebarTextControl->SetSizePixel(aOrigSize); const drawinglayer::geometry::ViewInformation2D aNewViewInfos; std::unique_ptr pProcessor( @@ -319,6 +318,8 @@ void SwAnnotationWin::Draw(OutputDevice* pDev, const Point& rPt, DrawFlags nInFl if (!mpVScrollbar->IsVisible()) return; +// if there is a scrollbar shown, draw "..." to indicate the comment isn't +// completely shown vcl::Font aOrigFont(mpMetadataDate->GetControlFont()); Color aOrigBg( mpMetadataDate->GetControlBackground() ); OUString sOrigText(mpMetadataDate->GetText()); @@ -330,7 +331,7 @@ void SwAnnotationWin::Draw(OutputDevice* pDev, const Point& rPt, DrawFlags nInFl mpMetadataDate->SetControlFont( aFont ); mpMetadataDate->SetControlBackground( Color(0xFF) ); mpMetadataDate->SetText("..."); -aOrigSize = mpMetadataDate->GetSizePixel(); +Size aOrigSize = mpMetadataDate->GetSizePixel(); mpMetadataDate->SetSizePixel(mpMenuButton->GetSizePixel()); mpMetadataDate->Draw(pDev, aPos, nInFlags); mpMetadataDate->SetSizePixel(aOrigSize); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-7-0' - sw/source
sw/source/uibase/dochdl/swdtflvr.cxx |4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) New commits: commit 5a98daf9f6e6bec4ccaead5df256f8f1cd9c1b15 Author: Caolán McNamara AuthorDate: Wed Dec 9 09:11:58 2020 + Commit: Michael Stahl CommitDate: Thu Dec 10 15:23:43 2020 +0100 uninit_member Change-Id: Idd42a139dabf74ee20afa8b6fb3c9ec25c7b0b19 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107390 Tested-by: Jenkins Reviewed-by: Michael Stahl diff --git a/sw/source/uibase/dochdl/swdtflvr.cxx b/sw/source/uibase/dochdl/swdtflvr.cxx index b4e91dcec5f0..27ac5dbbef58 100644 --- a/sw/source/uibase/dochdl/swdtflvr.cxx +++ b/sw/source/uibase/dochdl/swdtflvr.cxx @@ -244,7 +244,9 @@ SwTransferable::SwTransferable( SwWrtShell& rSh ) : m_pWrtShell( ), m_pCreatorView( nullptr ), m_pOrigGraphic( nullptr ), -m_eBufferType( TransferBufferType::NONE ) +m_eBufferType( TransferBufferType::NONE ), +m_bOldIdle(false), +m_bCleanUp(false) { rSh.GetView().AddTransferable(*this); SwDocShell* pDShell = rSh.GetDoc()->GetDocShell(); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-7-0' - sw/source
sw/source/core/layout/frmtool.cxx |9 - 1 file changed, 8 insertions(+), 1 deletion(-) New commits: commit d0de2750e28d99df9f342c29fec555b7df566c01 Author: Michael Stahl AuthorDate: Mon Dec 7 20:00:32 2020 +0100 Commit: Thorsten Behrens CommitDate: Tue Dec 8 00:27:42 2020 +0100 sw: layout: SwFlyNotify should invalidate a content or tab frame The problem happens during layout for a temporary mail merge document, but that is probably incidental. (The SwRootFrame is the 2nd one out of 3 being createed, the one for the target document.) The problem is that a text frame with a fly moves backward, and ~SwFlyNotify() invalidates the position of the next frame, but the next frame is a section frame, and this does not encourage the text frame inside the section frame to move backward at a later time, which leads to general user unhappiness. So invalidate the lower of the section frame too. Change-Id: I14fa20a279979c029c468f5c6f2e5ecad4ccd240 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107360 Tested-by: Jenkins Reviewed-by: Samuel Mehrbrodt (cherry picked from commit c797fc768152a57f6cc7fb9dd447138e4b0629ee) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107311 Reviewed-by: Thorsten Behrens diff --git a/sw/source/core/layout/frmtool.cxx b/sw/source/core/layout/frmtool.cxx index 295000c0aa64..ed8a46259f79 100644 --- a/sw/source/core/layout/frmtool.cxx +++ b/sw/source/core/layout/frmtool.cxx @@ -678,9 +678,16 @@ SwFlyNotify::~SwFlyNotify() if ( pFly->IsFlyAtContentFrame() ) { SwFrame *pNxt = pFly->AnchorFrame()->FindNext(); -if ( pNxt ) +while (pNxt) { pNxt->InvalidatePos(); +if (!pNxt->IsSctFrame()) +{ +break; +} +// invalidating pos of a section frame doesn't have much +// effect, so try again with its lower +pNxt = static_cast(pNxt)->Lower(); } } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-7-0' - sw/source
sw/source/core/doc/docbm.cxx |7 --- 1 file changed, 4 insertions(+), 3 deletions(-) New commits: commit 8ea3a9230e8975a5ec5516c6c59a1f69f1160b20 Author: Michael Stahl AuthorDate: Thu Nov 26 19:55:27 2020 +0100 Commit: Caolán McNamara CommitDate: Tue Dec 1 20:33:44 2020 +0100 sw_fieldmarkhide: fix getFieldMarkFor() to return innermost field ... like it's supposed to; if it finds the outer field and then the next field is inside but ends *before* the rPos then the loop is erroneously terminated. Change-Id: Ic5e469d1c05cecd7feca275dc1689af2c40567f3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106710 Tested-by: Jenkins Reviewed-by: Michael Stahl (cherry picked from commit 6a11f94ab366e1d736e97e31e908e86aa5d8b533) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106689 (cherry picked from commit fd596591b385a8b03459a7dd3f79e65a59f530f4) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106939 Reviewed-by: Caolán McNamara diff --git a/sw/source/core/doc/docbm.cxx b/sw/source/core/doc/docbm.cxx index c76e4417c020..fb8206e61d21 100644 --- a/sw/source/core/doc/docbm.cxx +++ b/sw/source/core/doc/docbm.cxx @@ -1383,10 +1383,11 @@ namespace sw::mark return nullptr; auto pFieldmark(*itFieldmark); for ( ; itFieldmark != m_vFieldmarks.end() -&& (**itFieldmark).IsCoveringPosition(rPos); ++itFieldmark) +&& (**itFieldmark).GetMarkStart() <= rPos; ++itFieldmark) { // find the innermost fieldmark -if (pFieldmark->GetMarkStart() < (**itFieldmark).GetMarkStart() -|| (**itFieldmark).GetMarkEnd() < pFieldmark->GetMarkEnd()) +if (rPos < (**itFieldmark).GetMarkEnd() +&& (pFieldmark->GetMarkStart() < (**itFieldmark).GetMarkStart() +|| (**itFieldmark).GetMarkEnd() < pFieldmark->GetMarkEnd())) { pFieldmark = *itFieldmark; } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-7-0' - sw/source
sw/source/core/txtnode/ndtxt.cxx | 11 --- 1 file changed, 4 insertions(+), 7 deletions(-) New commits: commit 0b4257bae19500083f530fa78afb6a67f68db75a Author: Caolán McNamara AuthorDate: Tue Nov 17 12:51:32 2020 + Commit: Xisco Fauli CommitDate: Tue Dec 1 15:25:42 2020 +0100 tdf#134626 assertion in ~SwTextNode taking the simplest example of... http://bugs.documentfoundation.org/attachment.cgi?id=167361 a) on ctrl+v paste into the new document: DocumentContentOperationsManager::CopyImplImpl is called and that (at "Also copy all format templates") causes SwTextNode::ChgTextCollUpdateNum to call rDoc.GetNodes().UpdateOutlineNode(*this) so the new paragraph is now set as an outline node of the document DocNodes that seems perfectly reasonable b) ctrl+v again no new paragraph, text appended to node of a) c) ctrl+z SwUndoSaveContent::MoveToUndoNds is called and rNodes.MakeTextNode is called to make a new TextNode to move the content into. The SwNodes the TextNode is created in are rNds = rDoc.GetUndoManager().GetUndoNodes(), i.e. the undo nodes. MakeTextNode calls... SwTextNode *pNode = new SwTextNode( rWhere, pColl, nullptr ) and the SwTextNode ctor unconditionally does... GetNodes().UpdateOutlineNode(*this); so its set as an outline node in those undo SwNodes In SwNodes::MakeTextNode right after the SwTextNode *pNode = new SwTextNode( rWhere, pColl, nullptr ) call we have... // call method only for the document nodes array if ( IsDocNodes() ) UpdateOutlineNode(*pNode); That seems odd, because we have *already* unconditionally called UpdateOutlineNode in the SwTextNode ctor. d) ctrl+z The SwTextFormatColl is destroyed and SwTextNode::TriggerNodeUpdate is called for the TextNode of a) and is updated. It is also called for the TextNode of c) but due to... // #125329# - assure that text node is in document nodes array if ( !rDoc.IsInDtor() && () == () ) c is *not* updated, so on eventual dtor of c the assert fires. Change-Id: I56f9b00dd4665fd44359a01baef66c82937c2781 --- If the conditional UpdateOutlineNode call in SwNodes::MakeTextNode is the right thing to do where only TextNodes in the DocNodes should be updated, then presumably the equivalent call in the SwTextNode ctor should be also conditional, making that MakeTextNode call redundant in any case. ChgTextCollUpdateNum always calls rDoc.GetNodes().UpdateOutlineNode(*this); which suggests that the SwTextNode::ChgFormatColl function should rely on that to call UpdateOutlineNode and not call it directly to also avoid a UpdateOutlineNode in the undo nodes Change-Id: Iedc3fb4d41c24dbbe41fbac259abe41d3757be09 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106011 Tested-by: Jenkins Tested-by: Xisco Fauli Reviewed-by: Michael Stahl (cherry picked from commit 138cf950dcdc8a1240452cad6867e197279f42b0) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106937 Reviewed-by: Xisco Fauli diff --git a/sw/source/core/txtnode/ndtxt.cxx b/sw/source/core/txtnode/ndtxt.cxx index 62b8171387b5..3d48aded03cc 100644 --- a/sw/source/core/txtnode/ndtxt.cxx +++ b/sw/source/core/txtnode/ndtxt.cxx @@ -110,10 +110,6 @@ SwTextNode *SwNodes::MakeTextNode( const SwNodeIndex & rWhere, SwNodeIndex aIdx( *pNode ); -// call method only for the document nodes array -if ( IsDocNodes() ) -UpdateOutlineNode(*pNode); - // if there is no layout or it is in a hidden section, MakeFrames is not needed const SwSectionNode* pSectNd; if (!bNewFrames || @@ -220,7 +216,10 @@ SwTextNode::SwTextNode( const SwNodeIndex , SwTextFormatColl *pTextColl, } AddToList(); } -GetNodes().UpdateOutlineNode(*this); + +// call method only for the document nodes array +if (GetNodes().IsDocNodes()) +GetNodes().UpdateOutlineNode(*this); m_bNotifiable = true; @@ -3932,8 +3931,6 @@ SwFormatColl* SwTextNode::ChgFormatColl( SwFormatColl *pNewColl ) ChgTextCollUpdateNum( pOldColl, static_cast(pNewColl) ); } -GetNodes().UpdateOutlineNode(*this); - return pOldColl; } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-7-0' - sw/source
sw/source/core/txtnode/ndtxt.cxx |7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) New commits: commit 61826c1a7c01bfa9766fd1000a66990fff9e759b Author: Michael Stahl AuthorDate: Wed Nov 18 15:48:28 2020 +0100 Commit: Caolán McNamara CommitDate: Thu Nov 19 13:27:55 2020 +0100 sw_redlinehide: fix assert on Replace with nothing SwTextNode::ReplaceText() doesn't need to notify in that case, avoids assert in UpdateMergedParaForInsert(), seen in testDateFormFieldContentOperations. Change-Id: Ie80c14bc903d91a289f470f8a732932342a283be Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106062 Tested-by: Jenkins Reviewed-by: Michael Stahl (cherry picked from commit 53f17e2a0f2a113a8b677940a314b5934c49acc3) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106007 Reviewed-by: Caolán McNamara diff --git a/sw/source/core/txtnode/ndtxt.cxx b/sw/source/core/txtnode/ndtxt.cxx index fc0a965fe943..62b8171387b5 100644 --- a/sw/source/core/txtnode/ndtxt.cxx +++ b/sw/source/core/txtnode/ndtxt.cxx @@ -3719,8 +3719,11 @@ void SwTextNode::ReplaceText( const SwIndex& rStart, const sal_Int32 nDelLen, SwDelText aDelHint( nStartPos, nDelLen ); NotifyClients( nullptr, ); -SwInsText aHint( nStartPos, sInserted.getLength() ); -NotifyClients( nullptr, ); +if (sInserted.getLength()) +{ +SwInsText aHint( nStartPos, sInserted.getLength() ); +NotifyClients( nullptr, ); +} } namespace { ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-7-0' - sw/source
sw/source/core/crsr/pam.cxx | 24 1 file changed, 16 insertions(+), 8 deletions(-) New commits: commit cb9ec4a95b0f2ac3db6cb51678bd55f73c44c874 Author: Michael Stahl AuthorDate: Tue Nov 17 17:58:33 2020 +0100 Commit: Adolfo Jayme Barrientos CommitDate: Thu Nov 19 02:17:04 2020 +0100 sw_redlinehide: replace bogus implementation of SwPaM::InvalidatePaM() Sending SwInsText will mess up merged paragraphs. Instead, send SwUpdateAttr with which-id 0, which results in InvalidateRange_() being called with at least 1 character. This appears to be called only by fieldmark UI, and now asserts in UITest_writer_tests5 DateFormFieldPropertiesDialog.dateFormFieldDialog.test_date_field_with_custom_format Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106022 Tested-by: Jenkins Reviewed-by: Michael Stahl (cherry picked from commit 93b1adf7442839dcfbf16660b1fbe1139f14a4d0) sw_redlinehide: use correct node in SwPaM::InvalidatePaM() (oopsie from 93b1adf7442839dcfbf16660b1fbe1139f14a4d0) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106046 Tested-by: Jenkins Reviewed-by: Michael Stahl (cherry picked from commit 53c69d392b1e55267a44994a889688cc80fbbd98) Change-Id: I948ddefa3acece8809e4bf3d2beee6cec3ed56f5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106065 Tested-by: Jenkins Reviewed-by: Adolfo Jayme Barrientos diff --git a/sw/source/core/crsr/pam.cxx b/sw/source/core/crsr/pam.cxx index 0473d8bacfd1..d1fccd357f5e 100644 --- a/sw/source/core/crsr/pam.cxx +++ b/sw/source/core/crsr/pam.cxx @@ -1121,15 +1121,23 @@ OUString SwPaM::GetText() const void SwPaM::InvalidatePaM() { -const SwNode &_pNd = GetNode(); -const SwTextNode *_pTextNd = _pNd.GetTextNode(); -if (_pTextNd != nullptr) +for (SwNodeIndex index = Start()->nNode; index <= End()->nNode; ++index) { -// pretend that the PaM marks inserted text to recalc the portion... -SwInsText aHint( Start()->nContent.GetIndex(), -End()->nContent.GetIndex() - Start()->nContent.GetIndex() + 1 ); -SwModify *_pModify=const_cast(static_cast(_pTextNd)); -_pModify->ModifyNotification( nullptr, ); +if (SwTextNode *const pTextNode = index.GetNode().GetTextNode()) +{ +// pretend that the PaM marks changed formatting to reformat... +sal_Int32 const nStart( +index == Start()->nNode ? Start()->nContent.GetIndex() : 0); +// this should work even for length of 0 +SwUpdateAttr const aHint( +nStart, +index == End()->nNode +? End()->nContent.GetIndex() - nStart +: pTextNode->Len() - nStart, +0); +pTextNode->CallSwClientNotify(sw::LegacyModifyHint(, )); +} +// other node types not invalidated } } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-7-0' - sw/source
sw/source/core/frmedt/feshview.cxx |5 + 1 file changed, 5 insertions(+) New commits: commit 46d6effe3373a39938bde57b43dc45c4a30ce33f Author: Jim Raykowski AuthorDate: Mon Nov 16 08:09:11 2020 -0900 Commit: Xisco Fauli CommitDate: Wed Nov 18 11:28:23 2020 +0100 tdf#130629 Don't add object insert undo twice Change-Id: I074afd4397b6fc4631bd00655de56b8a154d7dff Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105955 Tested-by: Jenkins Tested-by: Xisco Fauli Reviewed-by: Xisco Fauli Reviewed-by: Jim Raykowski (cherry picked from commit 5110cca39cc55c8977b81f7b09873e626144b29b) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105995 diff --git a/sw/source/core/frmedt/feshview.cxx b/sw/source/core/frmedt/feshview.cxx index ac98cefd0c63..9da71abf8b8c 100644 --- a/sw/source/core/frmedt/feshview.cxx +++ b/sw/source/core/frmedt/feshview.cxx @@ -3137,7 +3137,12 @@ long SwFEShell::GetSectionWidth( SwFormat const & rFormat ) const } SdrPageView* pPageView = pDrawView->GetSdrPageView(); SdrCreateView::SetupObjLayer(pPageView, pDrawView->GetActiveLayer(), pObj); +// switch undo off or this combined with ImpEndCreate will cause two undos +// see comment made in SwFEShell::EndCreate (we create our own undo-object!) +const bool bUndo(GetDoc()->GetIDocumentUndoRedo().DoesUndo()); +GetDoc()->GetIDocumentUndoRedo().DoUndo(false); pDrawView->InsertObjectAtView(pObj, *pPageView); +GetDoc()->GetIDocumentUndoRedo().DoUndo(bUndo); } ImpEndCreate(); } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-7-0' - sw/source
sw/source/uibase/docvw/edtwin2.cxx |7 +++ 1 file changed, 7 insertions(+) New commits: commit 8d317a4f8159117c27721192cc8f8ac6c694fdc0 Author: Caolán McNamara AuthorDate: Fri Nov 13 16:55:07 2020 + Commit: Adolfo Jayme Barrientos CommitDate: Sat Nov 14 21:01:00 2020 +0100 tdf#136336 ensure tooltip area surrounds the current mouse position with at least a pixel margin Change-Id: I74935f0275863cfd5a799927034d0a31dae073cf Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105547 Tested-by: Jenkins Reviewed-by: Adolfo Jayme Barrientos diff --git a/sw/source/uibase/docvw/edtwin2.cxx b/sw/source/uibase/docvw/edtwin2.cxx index c023047a5560..b48b18ec43d2 100644 --- a/sw/source/uibase/docvw/edtwin2.cxx +++ b/sw/source/uibase/docvw/edtwin2.cxx @@ -364,6 +364,13 @@ void SwEditWin::RequestHelp(const HelpEvent ) aRect.SetRight( aPt.X() ); aRect.SetBottom( aPt.Y() ); +// tdf#136336 ensure tooltip area surrounds the current mouse position with at least a pixel margin +aRect.Union(tools::Rectangle(rEvt.GetMousePosPixel(), Size(1, 1))); +aRect.AdjustLeft(-1); +aRect.AdjustRight(1); +aRect.AdjustTop(-1); +aRect.AdjustBottom(1); + if( bBalloon ) Help::ShowBalloon( this, rEvt.GetMousePosPixel(), aRect, sText ); else ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-7-0' - sw/source
sw/source/filter/ww8/wrtw8nds.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 23839d6ba4b221e7438a98a20dd2023ac0c786e5 Author: László Németh AuthorDate: Tue Nov 10 17:16:59 2020 +0100 Commit: Noel Grandin CommitDate: Thu Nov 12 07:46:51 2020 +0100 DOCX: fix memory leak of cell formula export clean-up of commit cf596c43315bb96b5e7256a82256f1ccb8c9c4d0 (tdf#133163 DOCX: export formula cell). The problem was reported by Miklós Vajna. Change-Id: Ia636a6ffe8386e58e31e37c0d8afc283e6f2fc4d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105558 Tested-by: Jenkins Reviewed-by: Miklos Vajna (cherry picked from commit b0b5812bc6b74369c7909313fcb7fd86c535aea3) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105536 Reviewed-by: Noel Grandin diff --git a/sw/source/filter/ww8/wrtw8nds.cxx b/sw/source/filter/ww8/wrtw8nds.cxx index 4f3b98089658..30f06c8d5cce 100644 --- a/sw/source/filter/ww8/wrtw8nds.cxx +++ b/sw/source/filter/ww8/wrtw8nds.cxx @@ -2252,7 +2252,7 @@ void MSWordExportBase::OutputTextNode( SwTextNode& rNode ) if ( pBox->IsFormulaOrValueBox() == RES_BOXATR_FORMULA && GetExportFormat() == MSWordExportBase::ExportFormat::DOCX ) { -SwTableBoxFormula* pFormula = pBox->GetFrameFormat()->GetTableBoxFormula().Clone(); +std::unique_ptr pFormula(pBox->GetFrameFormat()->GetTableBoxFormula().Clone()); pFormula->PtrToBoxNm( >GetTable() ); OutputField( nullptr, ww::eEquals, " = " + pFormula->GetFormula(), FieldFlags::Start | FieldFlags::CmdStart | FieldFlags::CmdEnd | FieldFlags::Close ); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-7-0' - sw/source
sw/source/ui/dbui/mmdocselectpage.cxx |7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) New commits: commit e49e10f8fecac4b65f913c1bab9f2e3e9ba154ad Author: Caolán McNamara AuthorDate: Wed Nov 4 12:01:31 2020 + Commit: Michael Weghorn CommitDate: Thu Nov 5 17:45:28 2020 +0100 don't select entry 0 if there are no entries Change-Id: I99b13796501dca1551d32eb966db1afcca16e225 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105220 Tested-by: Jenkins Reviewed-by: Michael Weghorn diff --git a/sw/source/ui/dbui/mmdocselectpage.cxx b/sw/source/ui/dbui/mmdocselectpage.cxx index 1336a7dc8374..f19089126a03 100644 --- a/sw/source/ui/dbui/mmdocselectpage.cxx +++ b/sw/source/ui/dbui/mmdocselectpage.cxx @@ -71,11 +71,10 @@ SwMailMergeDocSelectPage::SwMailMergeDocSelectPage(weld::Container* pPage, SwMai //insert in reverse order m_xRecentDocLB->insert_text(0, rDoc); } -m_xRecentDocLB->set_active(0); -if(!rDocs.hasElements()) -{ +if (!rDocs.hasElements()) m_xRecentDocRB->set_sensitive(false); -} +else +m_xRecentDocLB->set_active(0); } SwMailMergeDocSelectPage::~SwMailMergeDocSelectPage() ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-7-0' - sw/source
sw/source/ui/dbui/dbtablepreviewdialog.cxx | 53 +++-- sw/source/ui/dbui/dbtablepreviewdialog.hxx |4 +- 2 files changed, 46 insertions(+), 11 deletions(-) New commits: commit a986db4b2d24669e502e447036851e118cc23036 Author: Caolán McNamara AuthorDate: Wed Nov 4 13:01:53 2020 + Commit: Michael Stahl CommitDate: Thu Nov 5 10:45:26 2020 +0100 tdf#137982 m_xFrame is already disposed move the frame cleanup into a helper that listens to see if it got disposed by the preview itself Change-Id: I523285268118300f18b0f0f0a10fab7a9cced9c6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105221 Tested-by: Jenkins Reviewed-by: Michael Stahl diff --git a/sw/source/ui/dbui/dbtablepreviewdialog.cxx b/sw/source/ui/dbui/dbtablepreviewdialog.cxx index be0178dddbc1..b8c755d83e46 100644 --- a/sw/source/ui/dbui/dbtablepreviewdialog.cxx +++ b/sw/source/ui/dbui/dbtablepreviewdialog.cxx @@ -19,6 +19,8 @@ #include "dbtablepreviewdialog.hxx" #include +#include +#include #include using namespace ::com::sun::star; @@ -28,6 +30,34 @@ using namespace ::com::sun::star::beans; using namespace ::com::sun::star::lang; using namespace ::com::sun::star::util; +class DBTablePreviewFrame +: public cppu::WeakImplHelper +{ +private: +css::uno::Reference m_xFrame; + +virtual void SAL_CALL disposing(const lang::EventObject& /*Source*/) override +{ +m_xFrame.clear(); +} + +public: +DBTablePreviewFrame(css::uno::Reference& rFrame) +: m_xFrame(rFrame) +{ +} + +void cleanup() +{ +if (m_xFrame.is()) +{ +m_xFrame->setComponent(nullptr, nullptr); +m_xFrame->dispose(); +m_xFrame.clear(); +} +} +}; + SwDBTablePreviewDialog::SwDBTablePreviewDialog(weld::Window* pParent, uno::Sequence< beans::PropertyValue> const & rValues) : SfxDialogController(pParent, "modules/swriter/ui/tablepreviewdialog.ui", "TablePreviewDialog") , m_xDescriptionFI(m_xBuilder->weld_label("description")) @@ -47,22 +77,26 @@ SwDBTablePreviewDialog::SwDBTablePreviewDialog(weld::Window* pParent, uno::Seque m_xDescriptionFI->set_label(sDescription.replaceFirst("%1", sTemp)); } +css::uno::Reference xFrame; try { // create a frame wrapper for myself -m_xFrame = frame::Frame::create( comphelper::getProcessComponentContext() ); -m_xFrame->initialize(m_xBeamerWIN->CreateChildFrame()); +xFrame = frame::Frame::create( comphelper::getProcessComponentContext() ); +xFrame->initialize(m_xBeamerWIN->CreateChildFrame()); } catch (uno::Exception const &) { -m_xFrame.clear(); +xFrame.clear(); } -if (m_xFrame.is()) +if (xFrame.is()) { +m_xFrameListener.set(new DBTablePreviewFrame(xFrame)); +xFrame->addEventListener(m_xFrameListener.get()); + util::URL aURL; aURL.Complete = ".component:DB/DataSourceBrowser"; -uno::Reference xD = m_xFrame->queryDispatch(aURL, "", 0x0C); -if(xD.is()) +uno::Reference xD = xFrame->queryDispatch(aURL, "", 0x0C); +if (xD.is()) { xD->dispatch(aURL, rValues); m_xBeamerWIN->show(); @@ -72,11 +106,10 @@ SwDBTablePreviewDialog::SwDBTablePreviewDialog(weld::Window* pParent, uno::Seque SwDBTablePreviewDialog::~SwDBTablePreviewDialog() { -if(m_xFrame.is()) +if (m_xFrameListener) { -m_xFrame->setComponent(nullptr, nullptr); -m_xFrame->dispose(); -m_xFrame.clear(); +m_xFrameListener->cleanup(); +m_xFrameListener.clear(); } } diff --git a/sw/source/ui/dbui/dbtablepreviewdialog.hxx b/sw/source/ui/dbui/dbtablepreviewdialog.hxx index f914ea2bde58..99315fa01771 100644 --- a/sw/source/ui/dbui/dbtablepreviewdialog.hxx +++ b/sw/source/ui/dbui/dbtablepreviewdialog.hxx @@ -27,12 +27,14 @@ namespace com::sun::star{ namespace frame{ class XFrame2; } } +class DBTablePreviewFrame; + class SwDBTablePreviewDialog : public SfxDialogController { std::unique_ptr m_xDescriptionFI; std::unique_ptr m_xBeamerWIN; -css::uno::Reference< css::frame::XFrame2 > m_xFrame; +rtl::Reference m_xFrameListener; public: SwDBTablePreviewDialog(weld::Window* pParent, css::uno::Sequence< css::beans::PropertyValue> const & rValues ); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-7-0' - sw/source
sw/source/filter/basflt/fltshell.cxx | 27 +++ sw/source/filter/html/htmltab.cxx| 35 --- sw/source/filter/inc/fltshell.hxx| 22 ++ sw/source/filter/ww8/ww8par.cxx |3 +-- sw/source/filter/ww8/ww8par.hxx |2 +- sw/source/filter/ww8/ww8par2.cxx | 12 +++- sw/source/filter/ww8/ww8par6.cxx |2 +- 7 files changed, 59 insertions(+), 44 deletions(-) New commits: commit 50723986993c453a3bc254b91b70e40488b937fb Author: Caolán McNamara AuthorDate: Tue Nov 3 16:53:55 2020 + Commit: Michael Stahl CommitDate: Wed Nov 4 10:28:48 2020 +0100 ofz#26943 detect if FormatOfJustInsertedApo was deleted move FrameDeleteWatch for reuse in the doc filter Change-Id: I6e53549a837968cb738b5188e8670dd3e38a9c0e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105266 Tested-by: Jenkins Reviewed-by: Michael Stahl diff --git a/sw/source/filter/basflt/fltshell.cxx b/sw/source/filter/basflt/fltshell.cxx index ceae383380af..8486eb3ce692 100644 --- a/sw/source/filter/basflt/fltshell.cxx +++ b/sw/source/filter/basflt/fltshell.cxx @@ -1101,4 +1101,31 @@ void UpdatePageDescs(SwDoc , size_t nInPageDescOffset) rDoc.ChgPageDesc(i, rDoc.GetPageDesc(i)); } +FrameDeleteWatch::FrameDeleteWatch(SwFrameFormat* pFormat) +: m_pFormat(pFormat) +{ +if(m_pFormat) +StartListening(pFormat->GetNotifier()); +} + +void FrameDeleteWatch::Notify(const SfxHint& rHint) +{ +bool bDying = false; +if (rHint.GetId() == SfxHintId::Dying) +bDying = true; +else if (auto pDrawFrameFormatHint = dynamic_cast()) +bDying = pDrawFrameFormatHint->m_eId == sw::DrawFrameFormatHintId::DYING; +if (bDying) +{ +m_pFormat = nullptr; +EndListeningAll(); +} +} + +FrameDeleteWatch::~FrameDeleteWatch() +{ +m_pFormat = nullptr; +EndListeningAll(); +} + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/filter/html/htmltab.cxx b/sw/source/filter/html/htmltab.cxx index 9104497ccd2e..87f8858c94b6 100644 --- a/sw/source/filter/html/htmltab.cxx +++ b/sw/source/filter/html/htmltab.cxx @@ -4880,41 +4880,6 @@ HTMLTableOptions::HTMLTableOptions( const HTMLOptions& rOptions, namespace { -class FrameDeleteWatch final: public SvtListener -{ -SwFrameFormat* m_pFormat; -public: -FrameDeleteWatch(SwFrameFormat* pFormat) -: m_pFormat(pFormat) -{ -if(m_pFormat) -StartListening(pFormat->GetNotifier()); -} - -virtual void Notify(const SfxHint& rHint) override -{ -if (auto pDrawFrameFormatHint = dynamic_cast()) -{ -if (pDrawFrameFormatHint->m_eId == sw::DrawFrameFormatHintId::DYING) -{ -m_pFormat = nullptr; -EndListeningAll(); -} -} -} - -bool WasDeleted() const -{ -return !m_pFormat; -} - -virtual ~FrameDeleteWatch() override -{ -m_pFormat = nullptr; -EndListeningAll(); -} -}; - class IndexInRange { private: diff --git a/sw/source/filter/inc/fltshell.hxx b/sw/source/filter/inc/fltshell.hxx index 615917929475..186ae1578c31 100644 --- a/sw/source/filter/inc/fltshell.hxx +++ b/sw/source/filter/inc/fltshell.hxx @@ -330,6 +330,28 @@ public: } }; +// detect if the SwFrameFormat it is watching was deleted +class SW_DLLPUBLIC FrameDeleteWatch final: public SvtListener +{ +SwFrameFormat* m_pFormat; +public: +FrameDeleteWatch(SwFrameFormat* pFormat); + +virtual void Notify(const SfxHint& rHint) override; + +SwFrameFormat* GetFormat() +{ +return m_pFormat; +} + +bool WasDeleted() const +{ +return !m_pFormat; +} + +virtual ~FrameDeleteWatch() override; +}; + #endif /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx index d83e47ebb52c..16691bdb5315 100644 --- a/sw/source/filter/ww8/ww8par.cxx +++ b/sw/source/filter/ww8/ww8par.cxx @@ -2181,7 +2181,7 @@ long SwWW8ImplReader::Read_And(WW8PLCFManResult* pRes) std::unique_ptr pOutliner = ImportAsOutliner( sText, pRes->nCp2OrIdx, pRes->nCp2OrIdx + pRes->nMemLen, MAN_AND ); -m_pFormatOfJustInsertedApo = nullptr; +m_xFormatOfJustInsertedApo.reset(); SwPostItField aPostIt( static_cast(m_rDoc.getIDocumentFieldsAccess().GetSysFieldType(SwFieldIds::Postit)), sAuthor, sText, sInitials, OUString(), aDate ); @@ -4271,7 +4271,6 @@ SwWW8ImplReader::SwWW8ImplReader(sal_uInt8 nVersionPara, SotStorage* pStorage, , m_aParaStyleMapper(rD) , m_aCharStyleMapper(rD) , m_pFlyFormatOfJustInsertedGraphic(nullptr) -,
[Libreoffice-commits] core.git: Branch 'libreoffice-7-0' - sw/source
sw/source/ui/index/swuiidxmrk.cxx |3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) New commits: commit 16b9be87a59383ac04319e7d5297fcd63facb49c Author: Caolán McNamara AuthorDate: Mon Nov 2 19:27:04 2020 + Commit: Michael Stahl CommitDate: Tue Nov 3 10:41:04 2020 +0100 Resolves: rhbz#1893846 if last close had insert, index dialog open when starting a new writer document Change-Id: I83131c01aa53208a321abade48d48a6f7965d0ff Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105210 Tested-by: Jenkins Reviewed-by: Michael Stahl diff --git a/sw/source/ui/index/swuiidxmrk.cxx b/sw/source/ui/index/swuiidxmrk.cxx index d8b3481b3286..150ca24920ad 100644 --- a/sw/source/ui/index/swuiidxmrk.cxx +++ b/sw/source/ui/index/swuiidxmrk.cxx @@ -960,7 +960,8 @@ SwIndexMarkFloatDlg::SwIndexMarkFloatDlg(SfxBindings* _pBindings, "modules/swriter/ui/indexentry.ui", "IndexEntryDialog") , m_aContent(m_xDialog, *m_xBuilder, bNew, *::GetActiveWrtShell()) { -m_aContent.ReInitDlg(*::GetActiveWrtShell()); +if (SwWrtShell* pSh = ::GetActiveWrtShell()) +m_aContent.ReInitDlg(*pSh); Initialize(pInfo); } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-7-0' - sw/source
sw/source/filter/ww8/ww8par.hxx |2 +- sw/source/filter/ww8/ww8par6.cxx | 17 - 2 files changed, 13 insertions(+), 6 deletions(-) New commits: commit 039279d081dac9d6fe3fe80a635fcf8ce1cb8234 Author: Caolán McNamara AuthorDate: Fri Oct 30 10:01:45 2020 + Commit: Caolán McNamara CommitDate: Fri Oct 30 15:36:34 2020 +0100 ofz#26753 avoid infinite regress Change-Id: I3f5f14aa63c234ffdf1acd8bb730ce0ff08c7a81 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104967 Reviewed-by: Michael Stahl Tested-by: Jenkins diff --git a/sw/source/filter/ww8/ww8par.hxx b/sw/source/filter/ww8/ww8par.hxx index 810b692ee6aa..162b6a3be255 100644 --- a/sw/source/filter/ww8/ww8par.hxx +++ b/sw/source/filter/ww8/ww8par.hxx @@ -1757,7 +1757,7 @@ public: // really private, but can only be done public void SetRelativeJustify( bool bRel ); bool IsRelativeJustify(); -bool IsRelativeJustify( sal_uInt16 nColl ); +bool IsRelativeJustify(sal_uInt16 nColl, o3tl::sorted_vector& rVisitedStyles); void Read_Justify(sal_uInt16, const sal_uInt8*, short nLen); void Read_IdctHint(sal_uInt16, const sal_uInt8*, short nLen); diff --git a/sw/source/filter/ww8/ww8par6.cxx b/sw/source/filter/ww8/ww8par6.cxx index 99d9c22ce2ee..58e48a236238 100644 --- a/sw/source/filter/ww8/ww8par6.cxx +++ b/sw/source/filter/ww8/ww8par6.cxx @@ -326,7 +326,10 @@ bool SwWW8ImplReader::IsRelativeJustify() { sal_Int16 nRelative = m_vColl[m_nCurrentColl].m_nRelativeJustify; if ( nRelative < 0 && m_nCurrentColl ) -bRet = IsRelativeJustify( m_vColl[m_nCurrentColl].m_nBase ); +{ +o3tl::sorted_vector aVisitedStyles; +bRet = IsRelativeJustify(m_vColl[m_nCurrentColl].m_nBase, aVisitedStyles); +} else bRet = nRelative > 0; } @@ -334,7 +337,10 @@ bool SwWW8ImplReader::IsRelativeJustify() { sal_Int16 nRelative = m_xPlcxMan->GetPap()->nRelativeJustify; if ( nRelative < 0 ) -bRet = IsRelativeJustify( m_nCurrentColl ); +{ +o3tl::sorted_vector aVisitedStyles; +bRet = IsRelativeJustify(m_nCurrentColl, aVisitedStyles); +} else bRet = nRelative > 0; } @@ -343,19 +349,20 @@ bool SwWW8ImplReader::IsRelativeJustify() return bRet; } -bool SwWW8ImplReader::IsRelativeJustify( sal_uInt16 nColl ) +bool SwWW8ImplReader::IsRelativeJustify(sal_uInt16 nColl, o3tl::sorted_vector& rVisitedStyles) { assert( m_xWwFib->GetFIBVersion() >= ww::eWW8 && "pointless to search styles if relative justify is impossible"); bool bRet = true; if ( StyleExists(nColl) ) { +rVisitedStyles.insert(nColl); // if relativeJustify is undefined (-1), then check the parent style. sal_Int16 nRelative = m_vColl[nColl].m_nRelativeJustify; if ( nColl == 0 || nRelative >= 0 ) bRet = nRelative > 0; -else if ( nColl != m_vColl[nColl].m_nBase ) -bRet = IsRelativeJustify( m_vColl[nColl].m_nBase ); +else if (rVisitedStyles.find(m_vColl[nColl].m_nBase) == rVisitedStyles.end()) // detect loop in chain +bRet = IsRelativeJustify(m_vColl[nColl].m_nBase, rVisitedStyles); } return bRet; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-7-0' - sw/source
sw/source/filter/html/htmlgrin.cxx |2 +- sw/source/filter/html/swhtml.cxx | 21 - sw/source/filter/html/swhtml.hxx | 11 ++- 3 files changed, 31 insertions(+), 3 deletions(-) New commits: commit 1b7a02b4e48ca2d8160443517e03adcd8aaa77d0 Author: Caolán McNamara AuthorDate: Mon Oct 26 20:38:03 2020 + Commit: Michael Stahl CommitDate: Wed Oct 28 09:35:49 2020 +0100 ofz#26619 detect if SwFrameFormat deleted during import Change-Id: I5dc778e44dcb670353e83037a5a5d469fa437186 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104853 Tested-by: Jenkins Reviewed-by: Caolán McNamara (cherry picked from commit 7ae9e8b6ba35dec2c556f6fac4034cd9bba1) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104835 Reviewed-by: Michael Stahl diff --git a/sw/source/filter/html/htmlgrin.cxx b/sw/source/filter/html/htmlgrin.cxx index 628ef2704630..11ac33e698d4 100644 --- a/sw/source/filter/html/htmlgrin.cxx +++ b/sw/source/filter/html/htmlgrin.cxx @@ -280,7 +280,7 @@ void SwHTMLParser::RegisterFlyFrame( SwFrameFormat *pFlyFormat ) (RndStdIds::FLY_AT_PARA == pFlyFormat->GetAnchor().GetAnchorId()) && css::text::WrapTextMode_THROUGH == pFlyFormat->GetSurround().GetSurround() ) { -m_aMoveFlyFrames.push_back( pFlyFormat ); + m_aMoveFlyFrames.emplace_back(std::make_unique(pFlyFormat)); m_aMoveFlyCnts.push_back( m_pPam->GetPoint()->nContent.GetIndex() ); } } diff --git a/sw/source/filter/html/swhtml.cxx b/sw/source/filter/html/swhtml.cxx index 940642a816d4..8503c342c858 100644 --- a/sw/source/filter/html/swhtml.cxx +++ b/sw/source/filter/html/swhtml.cxx @@ -2696,6 +2696,18 @@ SwViewShell *SwHTMLParser::CheckActionViewShell() return m_pActionViewShell; } +SwHTMLFrameFormatListener::SwHTMLFrameFormatListener(SwFrameFormat* pFrameFormat) +: m_pFrameFormat(pFrameFormat) +{ +StartListening(m_pFrameFormat->GetNotifier()); +} + +void SwHTMLFrameFormatListener::Notify(const SfxHint& rHint) +{ +if (rHint.GetId() == SfxHintId::Dying) +m_pFrameFormat = nullptr; +} + void SwHTMLParser::SetAttr_( bool bChkEnd, bool bBeforeTable, std::deque> *pPostIts ) { @@ -2955,7 +2967,14 @@ void SwHTMLParser::SetAttr_( bool bChkEnd, bool bBeforeTable, for( auto n = m_aMoveFlyFrames.size(); n; ) { -SwFrameFormat *pFrameFormat = m_aMoveFlyFrames[ --n ]; +SwFrameFormat *pFrameFormat = m_aMoveFlyFrames[--n]->GetFrameFormat(); +if (!pFrameFormat) +{ +SAL_WARN("sw.html", "SwFrameFormat deleted during import"); +m_aMoveFlyFrames.erase( m_aMoveFlyFrames.begin() + n ); +m_aMoveFlyCnts.erase( m_aMoveFlyCnts.begin() + n ); +continue; +} const SwFormatAnchor& rAnchor = pFrameFormat->GetAnchor(); OSL_ENSURE( RndStdIds::FLY_AT_PARA == rAnchor.GetAnchorId(), diff --git a/sw/source/filter/html/swhtml.hxx b/sw/source/filter/html/swhtml.hxx index 59b7db28c467..9fb7dbfce7b5 100644 --- a/sw/source/filter/html/swhtml.hxx +++ b/sw/source/filter/html/swhtml.hxx @@ -331,6 +331,15 @@ namespace o3tl template<> struct typed_flags : is_typed_flags {}; } +class SwHTMLFrameFormatListener : public SvtListener +{ +SwFrameFormat* m_pFrameFormat; +public: +SwHTMLFrameFormatListener(SwFrameFormat* pFrameFormat); +SwFrameFormat* GetFrameFormat() { return m_pFrameFormat; } +virtual void Notify(const SfxHint&) override; +}; + class SwHTMLParser : public SfxHTMLParser, public SvtListener { friend class SectionSaveStruct; @@ -366,7 +375,7 @@ class SwHTMLParser : public SfxHTMLParser, public SvtListener HTMLAttrs m_aParaAttrs; // temporary paragraph attributes std::shared_ptr m_xAttrTab; // "open" attributes HTMLAttrContexts m_aContexts;// the current context of attribute/token -std::vector m_aMoveFlyFrames;// Fly-Frames, the anchor is moved +std::vector> m_aMoveFlyFrames;// Fly-Frames, the anchor is moved std::deque m_aMoveFlyCnts;// and the Content-Positions //stray SwTableBoxes which need to be deleted to avoid leaking, but hold //onto them until parsing is done ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-7-0' - sw/source
sw/source/core/layout/fly.cxx | 49 -- 1 file changed, 47 insertions(+), 2 deletions(-) New commits: commit 8d51308a91206f6dc1bbd71bfe2a865cf5f3849e Author: Michael Stahl AuthorDate: Thu Oct 22 19:17:24 2020 +0200 Commit: Caolán McNamara CommitDate: Tue Oct 27 11:15:43 2020 +0100 tdf#131679 sw: fix crash when copying fly via context menu sw::DocumentContentOperationsManager::CopyImplImpl() is called with a rPam that's on an SwOLENode. The problem (which i can't reproduce in --enable-dbgutil build, presumably for timing reasons) is that after the context menu pops up, some idle layout runs and reformats the document and deletes a SwFlyFrame and that calls SdrMarkView::UnmarkAllObj(). Then when SwFEShell::Copy() is called, it finds IsFrameSelected() returns false, and it tries to copy normal text when the cursor is on an SwOLENode. Fix this in SwFlyFrame::FinitDrawObj() by first moving the cursor out of any selected flys. (regression from 81ec0039b2085faab49380c7a56af0c562d4c9e4 - previously CopyImplImpl() would return early) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104697 Tested-by: Jenkins Reviewed-by: Michael Stahl (cherry picked from commit 40bff2567fa4a3fa8ec4445182cbbe3547c17410) tdf#131679 sw: follow-up: Unmark before SetSelection() Backporting this to 6.4, it crashes in CppunitTest_desktop_lib because some sidebar is loaded from SwView::AttrChangedNotify()/SelectShell() and that ends up calling SwView::StateTabWin() about 40 stack frames later and this calls SwFEShell::GetAnyCurRect() which gets the still selected fly but its page frame is null. So make sure shells don't see the deleted fly. Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104815 Tested-by: Jenkins Reviewed-by: Michael Stahl (cherry picked from commit f63afb95b5c2d80d33a35820ef1d9abd9e70d3ca) Change-Id: Id135fcc002c03c07c34fbdc0355f2895d8b6565b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104682 Tested-by: Jenkins Reviewed-by: Caolán McNamara diff --git a/sw/source/core/layout/fly.cxx b/sw/source/core/layout/fly.cxx index 252101334374..e3c52a03549b 100644 --- a/sw/source/core/layout/fly.cxx +++ b/sw/source/core/layout/fly.cxx @@ -366,6 +366,32 @@ void SwFlyFrame::InitDrawObj() : nHellId ); } +static SwPosition ResolveFlyAnchor(SwFrameFormat const& rFlyFrame) +{ +SwFormatAnchor const& rAnch(rFlyFrame.GetAnchor()); +if (rAnch.GetAnchorId() == RndStdIds::FLY_AT_PAGE) +{ // arbitrarily pick last node +return SwPosition(SwNodeIndex(rFlyFrame.GetDoc()->GetNodes().GetEndOfContent(), -1)); +} +else +{ +SwPosition const*const pPos(rAnch.GetContentAnchor()); +assert(pPos); +if (SwFrameFormat const*const pParent = pPos->nNode.GetNode().GetFlyFormat()) +{ +return ResolveFlyAnchor(*pParent); +} +else if (pPos->nContent.GetIdxReg()) +{ +return *pPos; +} +else +{ +return SwPosition(*pPos->nNode.GetNode().GetContentNode(), 0); +} +} +} + void SwFlyFrame::FinitDrawObj() { if(!GetVirtDrawObj() ) @@ -380,8 +406,27 @@ void SwFlyFrame::FinitDrawObj() for(SwViewShell& rCurrentShell : p1St->GetRingContainer()) { // At the moment the Drawing can do just do an Unmark on everything, // as the Object was already removed -if(rCurrentShell.HasDrawView() ) -rCurrentShell.Imp()->GetDrawView()->UnmarkAll(); +if (rCurrentShell.HasDrawView() && + rCurrentShell.Imp()->GetDrawView()->GetMarkedObjectList().GetMarkCount()) +{ +if (SwFEShell *const pFEShell = dynamic_cast()) +{ // tdf#131679 move any cursor out of fly +SwFlyFrame const*const pOldSelFly = ::GetFlyFromMarked(nullptr, pFEShell); +rCurrentShell.Imp()->GetDrawView()->UnmarkAll(); +if (pOldSelFly) +{ +SwPosition const pos(ResolveFlyAnchor(*pOldSelFly->GetFormat())); +SwPaM const temp(pos); +pFEShell->SetSelection(temp); +// could also call SetCursor() like SwFEShell::SelectObj() +// does, but that would access layout a bit much... +} +} +else +{ +rCurrentShell.Imp()->GetDrawView()->UnmarkAll(); +} +} } } } ___
[Libreoffice-commits] core.git: Branch 'libreoffice-7-0' - sw/source
sw/source/core/text/portxt.cxx |8 1 file changed, 4 insertions(+), 4 deletions(-) New commits: commit b8dd7d02a072c80961838b00c9e8cbdbddc9ce08 Author: Mark Hung AuthorDate: Fri Oct 2 11:24:31 2020 +0800 Commit: Xisco Fauli CommitDate: Mon Oct 26 19:29:49 2020 +0100 tdf#130314 space counting for input field. 1. Input field should be counted like other fields, with its content expanded with GetExpText(). 2. Use only GetLen() instead of rInf.GetLen() in SwTextInputFieldPortion::GetExpText() because when justifying the text, rInf.GetLen() isn't always updated corresponding to rInf.GetIdx(). ( Check SwTextAdjuster::CalcNewBlock() for ref.) Change-Id: I6a41275295607887c476fdd3f8e5a90c936c9d31 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103782 Tested-by: Jenkins Reviewed-by: Mark Hung Signed-off-by: Xisco Fauli This commit also contains the following commit: tdf#130314 fix incorrect logic in last commit Previous commit ( ac76f9e8ad8b ) contains a logical mistake. Change && to || there. Change-Id: Id982ce6f22b0022316b564029f813da9072b71e9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104089 Tested-by: Jenkins Reviewed-by: Mark Hung Signed-off-by: Xisco Fauli Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104806 diff --git a/sw/source/core/text/portxt.cxx b/sw/source/core/text/portxt.cxx index 84bbee847d72..65d6a58f3dc2 100644 --- a/sw/source/core/text/portxt.cxx +++ b/sw/source/core/text/portxt.cxx @@ -583,7 +583,7 @@ TextFrameIndex SwTextPortion::GetSpaceCnt(const SwTextSizeInfo , return TextFrameIndex(0); } -if ( InExpGrp() ) +if ( InExpGrp() || PortionType::InputField == GetWhichPor() ) { if( !IsBlankPortion() && !InNumberGrp() && !IsCombinedPortion() ) { @@ -620,7 +620,7 @@ long SwTextPortion::CalcSpacing( long nSpaceAdd, const SwTextSizeInfo ) co return 0; } -if ( InExpGrp() ) +if ( InExpGrp() || PortionType::InputField == GetWhichPor() ) { if( !IsBlankPortion() && !InNumberGrp() && !IsCombinedPortion() ) { @@ -717,13 +717,13 @@ void SwTextInputFieldPortion::Paint( const SwTextPaintInfo ) const bool SwTextInputFieldPortion::GetExpText( const SwTextSizeInfo , OUString ) const { sal_Int32 nIdx(rInf.GetIdx()); -sal_Int32 nLen(rInf.GetLen()); +sal_Int32 nLen(GetLen()); if ( rInf.GetChar( rInf.GetIdx() ) == CH_TXT_ATR_INPUTFIELDSTART ) { ++nIdx; --nLen; } -if (rInf.GetChar(rInf.GetIdx() + rInf.GetLen() - TextFrameIndex(1)) == CH_TXT_ATR_INPUTFIELDEND) +if (rInf.GetChar(rInf.GetIdx() + GetLen() - TextFrameIndex(1)) == CH_TXT_ATR_INPUTFIELDEND) { --nLen; } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-7-0' - sw/source
sw/source/core/doc/docfly.cxx| 26 ++ sw/source/core/layout/anchoreddrawobject.cxx | 11 ++- 2 files changed, 20 insertions(+), 17 deletions(-) New commits: commit 4e7b60682d48c7f3950e341c496dc7fc6f9b4367 Author: Michael Stahl AuthorDate: Tue Oct 20 19:19:35 2020 +0200 Commit: Xisco Fauli CommitDate: Wed Oct 21 15:31:36 2020 +0200 tdf#136385 sw: fix Undo of changing anchor type There were a few problems here: 1. the changes to positions in SwAnchoredDrawObject::AdjustPositioningAttr() weren't recorded 2. the Undo of setting the anchor type ran last, which ended up calling SwDrawContact::Changed_() via some callback, which changed the position from the correct one to a wrong one 3. if the fixup for FLY_AT_PAGE is done after AdjustPositioningAttr() then that doesn't need to take into account the anchor type (regression from 1de2b0d3234462b488db54d36ebc17e2b579b0f0) Change-Id: If70408ad6140a5bec739dea176936ffcbfe3f5ed Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104571 Tested-by: Jenkins Reviewed-by: Michael Stahl (cherry picked from commit 1b3310a5805cf50f7aca88a83768ffa5adc42a0b) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104588 Reviewed-by: Xisco Fauli diff --git a/sw/source/core/doc/docfly.cxx b/sw/source/core/doc/docfly.cxx index e435920da879..988e59c76a58 100644 --- a/sw/source/core/doc/docfly.cxx +++ b/sw/source/core/doc/docfly.cxx @@ -932,18 +932,6 @@ bool SwDoc::ChgAnchor( const SdrMarkList& _rMrkList, // #i26791# - Direct object positioning no longer needed. Apply // of attributes (method call ) takes care of the // invalidation of the object position. -SetAttr( aNewAnch, *pContact->GetFormat() ); -if (aNewAnch.GetAnchorId() == RndStdIds::FLY_AT_PAGE) -{ -SwFormatHoriOrient item(pContact->GetFormat()->GetHoriOrient()); -sal_Int16 nRelOrient(item.GetRelationOrient()); -if (sw::GetAtPageRelOrientation(nRelOrient, false)) -{ -SAL_INFO("sw.ui", "fixing horizontal RelOrientation for at-page anchor"); - item.SetRelationOrient(text::RelOrientation::PAGE_FRAME); -SetAttr(item, *pContact->GetFormat()); -} -} if ( _bPosCorr ) { // #i33313# - consider not connected 'virtual' drawing @@ -962,6 +950,20 @@ bool SwDoc::ChgAnchor( const SdrMarkList& _rMrkList, ->AdjustPositioningAttr( pNewAnchorFrame ); } } +if (aNewAnch.GetAnchorId() == RndStdIds::FLY_AT_PAGE) +{ +SwFormatHoriOrient item(pContact->GetFormat()->GetHoriOrient()); +sal_Int16 nRelOrient(item.GetRelationOrient()); +if (sw::GetAtPageRelOrientation(nRelOrient, false)) +{ +SAL_INFO("sw.ui", "fixing horizontal RelOrientation for at-page anchor"); +item.SetRelationOrient(nRelOrient); +SetAttr(item, *pContact->GetFormat()); +} +} +// tdf#136385 set the anchor last - otherwise it messes up the +// position in SwDrawContact::Changed_() callback +SetAttr(aNewAnch, *pContact->GetFormat()); } // we have changed the anchoring attributes, and those are used to diff --git a/sw/source/core/layout/anchoreddrawobject.cxx b/sw/source/core/layout/anchoreddrawobject.cxx index d3be5402febf..2cbe4bab0f3b 100644 --- a/sw/source/core/layout/anchoreddrawobject.cxx +++ b/sw/source/core/layout/anchoreddrawobject.cxx @@ -776,11 +776,12 @@ void SwAnchoredDrawObject::AdjustPositioningAttr( const SwFrame* _pNewAnchorFram nVertRelPos = aObjRect.Top() - aAnchorPos.Y(); } -GetFrameFormat().SetFormatAttr( SwFormatHoriOrient( nHoriRelPos, text::HoriOrientation::NONE, -GetFrameFormat().GetAnchor().GetAnchorId() == RndStdIds::FLY_AT_PAGE -? text::RelOrientation::PAGE_FRAME -: text::RelOrientation::FRAME ) ); -GetFrameFormat().SetFormatAttr( SwFormatVertOrient( nVertRelPos, text::VertOrientation::NONE, text::RelOrientation::FRAME ) ); +SwFormatHoriOrient hori(nHoriRelPos, text::HoriOrientation::NONE, text::RelOrientation::FRAME); +SwFormatVertOrient vert(nVertRelPos, text::VertOrientation::NONE, text::RelOrientation::FRAME); +SfxItemSet items(GetFrameFormat().GetDoc()->GetAttrPool(), svl::Items()); +items.Put(hori); +items.Put(vert); +GetFrameFormat().GetDoc()->SetAttr(items, GetFrameFormat()); } // --> #i34748# -
[Libreoffice-commits] core.git: Branch 'libreoffice-7-0' - sw/source
sw/source/core/undo/untblk.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit ae6069c073365d8b5162a42b2618f077c7738caf Author: Michael Stahl AuthorDate: Fri Oct 16 14:27:04 2020 +0200 Commit: Thorsten Behrens CommitDate: Sat Oct 17 10:53:30 2020 +0200 tdf#135733 sw: fix mistake in SwUndoInserts::SetInsertRange() First init m_nDeleteTextNodes, then check it; it is inited to 1 in the ctor so the ++m_nSttNode was skipped. This then caused bJoinNext to be true in UndoImpl() when it should be false. (regression from dc7e7b94a7211c576454267c09eb108e761e4487) Change-Id: I74038ef7f8036581dd77341dc8372e87139bdb6c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104433 Tested-by: Jenkins Reviewed-by: Michael Stahl (cherry picked from commit 7221b7638c74b13e229f7ff50349a253ebb74cfc) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104343 Reviewed-by: Thorsten Behrens diff --git a/sw/source/core/undo/untblk.cxx b/sw/source/core/undo/untblk.cxx index 512a02921546..3742414041d4 100644 --- a/sw/source/core/undo/untblk.cxx +++ b/sw/source/core/undo/untblk.cxx @@ -124,11 +124,11 @@ void SwUndoInserts::SetInsertRange( const SwPaM& rPam, bool bScanFlys, m_nSttNode = pTmpPos->nNode.GetIndex(); m_nSttContent = pTmpPos->nContent.GetIndex(); +m_nDeleteTextNodes = nDeleteTextNodes; if (m_nDeleteTextNodes == 0) // if a table selection is added... { ++m_nSttNode; // ... then the CopyPam is not fully correct } -m_nDeleteTextNodes = nDeleteTextNodes; } // Fill m_FlyUndos with flys anchored to first and last paragraphs ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-7-0' - sw/source
sw/source/ui/frmdlg/column.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit a362277bd133832c71e66603a10e4e4e19492b4d Author: Jan-Marek Glogowski AuthorDate: Fri Oct 16 11:35:56 2020 +0200 Commit: Michael Weghorn CommitDate: Fri Oct 16 19:53:29 2020 +0200 tdf#136924 draw lines using field text color Interestingly, these are not icon images, as I expected, but it's a custom DrawingArea widget, which is completely drawn by some algorithm. Currently it uses the themes field color as background fill color and an independent font color for the lines. So just use the themed, matching field text color instead. Regressed-by: 39e027c669fc0a91e223d7635c10adb5778586c7 Change-Id: I9f0073f41127207d2391ee23c9553512ffe4ba01 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104422 Reviewed-by: Jan-Marek Glogowski Tested-by: Jan-Marek Glogowski (cherry picked from commit 160bd8cf3c9c6680b9a9291f2d2c4929ec0785c1) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104342 Reviewed-by: Michael Weghorn Tested-by: Jenkins diff --git a/sw/source/ui/frmdlg/column.cxx b/sw/source/ui/frmdlg/column.cxx index 50822c644e6b..343ce664a4e3 100644 --- a/sw/source/ui/frmdlg/column.cxx +++ b/sw/source/ui/frmdlg/column.cxx @@ -1325,7 +1325,7 @@ void ColumnValueSet::UserDraw(const UserDrawEvent& rUDEvt) Color aFillColor(pDev->GetFillColor()); Color aLineColor(pDev->GetLineColor()); pDev->SetFillColor(rStyleSettings.GetFieldColor()); -pDev->SetLineColor(SwViewOption::GetFontColor()); +pDev->SetLineColor(rStyleSettings.GetFieldTextColor()); long nStep = std::abs(std::abs(nRectHeight * 95 /100) / 11); long nTop = (nRectHeight - 11 * nStep ) / 2; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-7-0' - sw/source
sw/source/uibase/shells/drwbassh.cxx |5 + 1 file changed, 5 insertions(+) New commits: commit d7b67e6fe3e449c8c5b95a57d8cc7b9ca70c7a99 Author: Bakos Attila AuthorDate: Mon Jul 20 14:30:39 2020 +0200 Commit: Michael Stahl CommitDate: Fri Oct 16 11:07:51 2020 +0200 tdf#124430 Writer Editing: Fix textbox aligning Before, when align function was used the textboxes (shape+frame) went apart, now the textframe follows the shape. Co-authored-by: Attila Bánhegyi (NISZ) Change-Id: I4d69a2f7f4e5ef50d17bb0871c501d6e0026d0e2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99048 Reviewed-by: Attila Bakos Reviewed-by: László Németh Tested-by: Jenkins Tested-by: László Németh (cherry picked from commit 06fd06597796d9e92117602245f3968c93707708) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102769 Reviewed-by: Michael Stahl diff --git a/sw/source/uibase/shells/drwbassh.cxx b/sw/source/uibase/shells/drwbassh.cxx index bccbe313bdf9..c707b803736b 100644 --- a/sw/source/uibase/shells/drwbassh.cxx +++ b/sw/source/uibase/shells/drwbassh.cxx @@ -53,6 +53,7 @@ #include #include #include +#include using namespace ::com::sun::star; @@ -478,6 +479,8 @@ void SwDrawBaseShell::Execute(SfxRequest const ) SwFormatHoriOrient aHOrient(pFrameFormat->GetFormatAttr(RES_HORI_ORIENT)); aHOrient.SetHoriOrient( nHorizOrient ); pFrameFormat->SetFormatAttr(aHOrient); +if (auto pTxFrm = SwTextBoxHelper::getOtherTextBoxFormat(pFrameFormat, RES_DRAWFRMFMT)) +pTxFrm->SetFormatAttr(aHOrient); pSh->EndAction(); } @@ -489,6 +492,8 @@ void SwDrawBaseShell::Execute(SfxRequest const ) SwFormatVertOrient aVOrient(pFrameFormat->GetFormatAttr(RES_VERT_ORIENT)); aVOrient.SetVertOrient( nVertOrient ); pFrameFormat->SetFormatAttr(aVOrient); +if (auto pTxFrm = SwTextBoxHelper::getOtherTextBoxFormat(pFrameFormat, RES_DRAWFRMFMT)) +pTxFrm->SetFormatAttr(aVOrient); pSh->EndAction(); } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-7-0' - sw/source
sw/source/core/doc/DocumentContentOperationsManager.cxx | 10 -- sw/source/uibase/wrtsh/wrtsh1.cxx |4 2 files changed, 4 insertions(+), 10 deletions(-) New commits: commit 10c638e520096a0cc282d91ac2a447509f674a6f Author: Michael Stahl AuthorDate: Wed Oct 14 12:42:54 2020 +0200 Commit: Caolán McNamara CommitDate: Wed Oct 14 21:39:18 2020 +0200 tdf#135260 sw_redlinehide: fix insert-with-delete differently The problem with the fix for tdf#127635 is that now the cursor doesn't move left on backspace if change tracking is on. (regression from 398ba26077f9029bdf6f7378bfc9ce8376b6f02d) Revert that and fix the autocorrect position in SwWrtShell::Insert() instead. Change-Id: I5989a589b654fc6e5ba3dd66922af15eff758ecc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104280 Tested-by: Jenkins Reviewed-by: Michael Stahl (cherry picked from commit be4616d6b49b8c9cf1a90b212b24ead3dabcab6c) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104299 Reviewed-by: Caolán McNamara diff --git a/sw/source/core/doc/DocumentContentOperationsManager.cxx b/sw/source/core/doc/DocumentContentOperationsManager.cxx index ecd43d62dbbd..bee95bec1d3c 100644 --- a/sw/source/core/doc/DocumentContentOperationsManager.cxx +++ b/sw/source/core/doc/DocumentContentOperationsManager.cxx @@ -2008,11 +2008,6 @@ void DocumentContentOperationsManager::DeleteRange( SwPaM & rPam ) { lcl_DoWithBreaks( *this, rPam, ::DeleteRangeImpl ); -if (m_rDoc.getIDocumentRedlineAccess().IsRedlineOn()) -{ -rPam.Normalize(false); // tdf#127635 put point at the end of deletion -} - if (!m_rDoc.getIDocumentRedlineAccess().IsIgnoreRedline() && !m_rDoc.getIDocumentRedlineAccess().GetRedlineTable().empty()) { @@ -2189,11 +2184,6 @@ bool DocumentContentOperationsManager::DeleteAndJoin( SwPaM & rPam, : ::DeleteAndJoinImpl, bForceJoinNext ); -if (m_rDoc.getIDocumentRedlineAccess().IsRedlineOn()) -{ -rPam.Normalize(false); // tdf#127635 put point at the end of deletion -} - return ret; } diff --git a/sw/source/uibase/wrtsh/wrtsh1.cxx b/sw/source/uibase/wrtsh/wrtsh1.cxx index 0dbb7aaf0796..da49506b45f4 100644 --- a/sw/source/uibase/wrtsh/wrtsh1.cxx +++ b/sw/source/uibase/wrtsh/wrtsh1.cxx @@ -225,7 +225,11 @@ void SwWrtShell::Insert( const OUString ) StartUndo(SwUndoId::REPLACE, ); bStarted = true; +Push(); bDeleted = DelRight(); +Pop(SwCursorShell::PopMode::DeleteCurrent); // Restore selection (if tracking changes) +NormalizePam(false); // tdf#127635 put point at the end of deletion +ClearMark(); } bCallIns ? ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-7-0' - sw/source
sw/source/core/doc/DocumentContentOperationsManager.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit ba5584a3ce86c2db52e2e4a4b91254741b2616ec Author: Michael Stahl AuthorDate: Wed Oct 14 16:10:29 2020 +0200 Commit: Caolán McNamara CommitDate: Wed Oct 14 21:40:00 2020 +0200 tdf#136577 sw: fix Undo of Replace with nothing The UI doesn't allow to replace an empty selection anyway, but it now happens on Undo. (regression from e1629c210ad78310e3d48c0756723134a27b89df) Change-Id: I468f28335beaeb8c42df8ed4cfc90f2c03129239 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104308 Tested-by: Jenkins Reviewed-by: Michael Stahl (cherry picked from commit d3eca4177a78c3db17b4699ea6e071e52488c46f) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104305 Reviewed-by: Caolán McNamara diff --git a/sw/source/core/doc/DocumentContentOperationsManager.cxx b/sw/source/core/doc/DocumentContentOperationsManager.cxx index bee95bec1d3c..17bbd2b562f1 100644 --- a/sw/source/core/doc/DocumentContentOperationsManager.cxx +++ b/sw/source/core/doc/DocumentContentOperationsManager.cxx @@ -4256,7 +4256,7 @@ bool DocumentContentOperationsManager::DeleteRangeImplImpl(SwPaM & rPam) bool DocumentContentOperationsManager::ReplaceRangeImpl( SwPaM& rPam, const OUString& rStr, const bool bRegExReplace ) { -if( !rPam.HasMark() || *rPam.GetPoint() == *rPam.GetMark() ) +if (!rPam.HasMark()) return false; bool bJoinText, bJoinPrev; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-7-0' - sw/source
sw/source/uibase/utlui/content.cxx |9 + 1 file changed, 5 insertions(+), 4 deletions(-) New commits: commit af26393963ed2ed19607d3f0cb42c0c6243d25c3 Author: Caolán McNamara AuthorDate: Wed Oct 7 15:21:52 2020 +0100 Commit: Michael Stahl CommitDate: Thu Oct 8 10:15:27 2020 +0200 Resolves: tdf#137274 comment node not expandable when there are comments if it was opened and closed before deleting (or undoing thereof) comments If the node is currently not expanded, but it was previously expanded, then it is not filled-on-demand because it is already filled. If the content it tracks has changed, remove its current children and set it to filled-on-demand if there would be a non-zero set of new children Change-Id: Ic8eafea7f298d285d1e6c4a60cb21b57a971bd86 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103980 Tested-by: Jenkins Reviewed-by: Michael Stahl diff --git a/sw/source/uibase/utlui/content.cxx b/sw/source/uibase/utlui/content.cxx index 44ce6c197a9e..4729818da11f 100644 --- a/sw/source/uibase/utlui/content.cxx +++ b/sw/source/uibase/utlui/content.cxx @@ -2377,8 +2377,9 @@ bool SwContentTree::HasContentChanged() // i.e. in header/footer pArrType->FillMemberList(); bool bRemoveChildren = false; -const size_t nChildCount = GetChildCount(*xEntry); -if (nChildCount != pArrType->GetMemberCount()) +const size_t nOldChildCount = GetChildCount(*xEntry); +const size_t nNewChildCount = pArrType->GetMemberCount(); +if (nOldChildCount != nNewChildCount) { bRemoveChildren = true; } @@ -2386,7 +2387,7 @@ bool SwContentTree::HasContentChanged() { std::unique_ptr xChild(m_xTreeView->make_iterator(xEntry.get())); (void)m_xTreeView->iter_children(*xChild); -for (size_t j = 0; j < nChildCount; ++j) +for (size_t j = 0; j < nOldChildCount; ++j) { const SwContent* pCnt = pArrType->GetMember(j); OUString sSubId(OUString::number(reinterpret_cast(pCnt))); @@ -2406,8 +2407,8 @@ bool SwContentTree::HasContentChanged() remove(*xRemove); m_xTreeView->copy_iterator(*xEntry, *xRemove); } +m_xTreeView->set_children_on_demand(*xEntry, nNewChildCount != 0); } -m_xTreeView->set_children_on_demand(*xEntry, !nChildCount); } else if((nCntCount != 0) != (pArrType->GetMemberCount()!=0)) ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-7-0' - sw/source
sw/source/ui/dbui/createaddresslistdialog.cxx |8 1 file changed, 8 insertions(+) New commits: commit a9291f02c6eb9aa97a287dd5a99ad4b4d9448572 Author: Caolán McNamara AuthorDate: Fri Oct 2 16:21:02 2020 +0100 Commit: Miklos Vajna CommitDate: Tue Oct 6 12:41:02 2020 +0200 tdf#137209 unparent widgets in fragment dtor Change-Id: I819514fd2b97e2cc8daad71a7f3b0b27afe6136d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103795 Tested-by: Jenkins Reviewed-by: Miklos Vajna diff --git a/sw/source/ui/dbui/createaddresslistdialog.cxx b/sw/source/ui/dbui/createaddresslistdialog.cxx index d7c9ca8c9b6d..4f0a49acd88c 100644 --- a/sw/source/ui/dbui/createaddresslistdialog.cxx +++ b/sw/source/ui/dbui/createaddresslistdialog.cxx @@ -47,11 +47,13 @@ struct SwAddressFragment std::unique_ptr m_xBuilder; std::unique_ptr m_xLabel; std::unique_ptr m_xEntry; +weld::Container* m_pGrid; SwAddressFragment(weld::Container* pGrid, int nLine) : m_xBuilder(Application::CreateBuilder(pGrid, "modules/swriter/ui/addressfragment.ui")) , m_xLabel(m_xBuilder->weld_label("label")) , m_xEntry(m_xBuilder->weld_entry("entry")) +, m_pGrid(pGrid) { m_xLabel->set_grid_left_attach(0); m_xLabel->set_grid_top_attach(nLine); @@ -59,6 +61,12 @@ struct SwAddressFragment m_xEntry->set_grid_left_attach(1); m_xEntry->set_grid_top_attach(nLine); } + +virtual ~SwAddressFragment() +{ +m_pGrid->move(m_xEntry.get(), nullptr); +m_pGrid->move(m_xLabel.get(), nullptr); +} }; } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-7-0' - sw/source
sw/source/filter/ww8/ww8atr.cxx | 20 ++-- 1 file changed, 18 insertions(+), 2 deletions(-) New commits: commit c426d851fd7a66f826d08691d19ff288a636a445 Author: Xisco Fauli AuthorDate: Fri Oct 2 15:27:46 2020 +0200 Commit: Michael Stahl CommitDate: Tue Oct 6 09:42:29 2020 +0200 related: tdf#127579: make use of FindCharFormatByName more robust the same way it's done in WW8AttributeOutput::TextINetFormat This might fix crashes like https://crashreport.libreoffice.org/stats/crash_details/3538a470-23d7-4e37-9504-fe6e81da301b unfortunatelly, I have no steps to reproduce it at the moment Change-Id: I509ee439643dfbaf6f08477142bbbd171e13eed8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103859 Tested-by: Jenkins Reviewed-by: Caolán McNamara Signed-off-by: Xisco Fauli Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103934 Reviewed-by: Michael Stahl diff --git a/sw/source/filter/ww8/ww8atr.cxx b/sw/source/filter/ww8/ww8atr.cxx index 04f35eb23aaa..e081b730f037 100644 --- a/sw/source/filter/ww8/ww8atr.cxx +++ b/sw/source/filter/ww8/ww8atr.cxx @@ -222,11 +222,27 @@ void MSWordExportBase::ExportPoolItemsToCHP( ww8::PoolItems , sal_uInt16 if (nWhich == RES_TXTATR_CHARFMT) { const SfxPoolItem* pINetItem = SearchPoolItems(rItems, RES_TXTATR_INETFMT); + if (pINetItem) { + const SwFormatINetFormat& rINet = static_cast(*pINetItem); + + if ( rINet.GetValue().isEmpty() ) + continue; + + const sal_uInt16 nId = rINet.GetINetFormatId(); + const OUString& rStr = rINet.GetINetFormat(); + + if (rStr.isEmpty()) + { + SAL_WARN("sw.ww8", "MSWordExportBase::ExportPoolItemsToCHP(..) - missing unvisited character format at hyperlink attribute" ); + } + + const SwCharFormat* pINetFormat = IsPoolUserFormat( nId ) +? m_pDoc->FindCharFormatByName( rStr ) +: m_pDoc->getIDocumentStylePoolAccess().GetCharFormatFromPool( nId ); + const SwCharFormat* pFormat = static_cast(*pItem).GetCharFormat(); - const SwCharFormat* pINetFormat = m_pDoc->FindCharFormatByName( - static_cast(*pINetItem).GetINetFormat()); ww8::PoolItems aCharItems, aINetItems; GetPoolItems(pFormat->GetAttrSet(), aCharItems, false); GetPoolItems(pINetFormat->GetAttrSet(), aINetItems, false); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-7-0' - sw/source
sw/source/filter/ascii/parasc.cxx |5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) New commits: commit a4f06c2498349a353c30d82eae826b36265c9599 Author: Caolán McNamara AuthorDate: Fri Oct 2 14:43:53 2020 +0100 Commit: Michael Stahl CommitDate: Mon Oct 5 15:29:48 2020 +0200 crashtesting: an odd number of bytes for RTL_TEXTENCODING_UCS2 encoding seen with id:000316,src:000190+000204,op:splice,rep:32.doc Change-Id: Ia4eb13ed617828f0d35bed26651a7b9e9a4b6056 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103796 Tested-by: Jenkins Reviewed-by: Michael Stahl diff --git a/sw/source/filter/ascii/parasc.cxx b/sw/source/filter/ascii/parasc.cxx index 2cf851d0b558..162459ff1819 100644 --- a/sw/source/filter/ascii/parasc.cxx +++ b/sw/source/filter/ascii/parasc.cxx @@ -347,12 +347,13 @@ ErrCode SwASCIIParser::ReadChars() else { pStt = pLastStt = reinterpret_cast(pArr.get()); -pEnd = reinterpret_cast(pArr.get() + lGCount); +auto nChars = lGCount / 2; +pEnd = pStt + nChars; if( bSwapUnicode ) { char* pF = pArr.get(), *pN = pArr.get() + 1; -for( sal_uLong n = 0; n < lGCount; n += 2, pF += 2, pN += 2 ) +for( sal_uLong n = 0; n < nChars; ++n, pF += 2, pN += 2 ) { char c = *pF; *pF = *pN; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-7-0' - sw/source
sw/source/core/undo/unattr.cxx |5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) New commits: commit fdc92d35d95f5b89a333cc48fdc36108e1094973 Author: Caolán McNamara AuthorDate: Mon Sep 28 14:05:00 2020 +0100 Commit: Xisco Fauli CommitDate: Tue Sep 29 15:28:21 2020 +0200 tdf#133358 fix crash in redoing indent since... commit b070202b420129b5edd368420e0e50ec45261d01 Date: Tue Nov 20 18:26:18 2018 +0100 sw_redlinehide_4a: SwEditShell::IsMoveLeftMargin(), MoveLeftMargin() Change-Id: Ie28207747560153020341305015f1693f6ca9f50 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103552 Tested-by: Jenkins Reviewed-by: Michael Stahl (cherry picked from commit dc6e005c79b6c23b805dea44cd89fa83ea945f03) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103577 Reviewed-by: Xisco Fauli diff --git a/sw/source/core/undo/unattr.cxx b/sw/source/core/undo/unattr.cxx index efc6999fb7c4..bccbaba80d6f 100644 --- a/sw/source/core/undo/unattr.cxx +++ b/sw/source/core/undo/unattr.cxx @@ -913,14 +913,15 @@ void SwUndoMoveLeftMargin::RedoImpl(::sw::UndoRedoContext & rContext) SwPaM & rPam = AddUndoRedoPaM(rContext); rDoc.MoveLeftMargin( rPam, - GetId() == SwUndoId::INC_LEFTMARGIN, m_bModulus ); + GetId() == SwUndoId::INC_LEFTMARGIN, m_bModulus, + rDoc.getIDocumentLayoutAccess().GetCurrentLayout() ); } void SwUndoMoveLeftMargin::RepeatImpl(::sw::RepeatContext & rContext) { SwDoc & rDoc = rContext.GetDoc(); rDoc.MoveLeftMargin(rContext.GetRepeatPaM(), GetId() == SwUndoId::INC_LEFTMARGIN, -m_bModulus ); +m_bModulus, rDoc.getIDocumentLayoutAccess().GetCurrentLayout()); } SwUndoChangeFootNote::SwUndoChangeFootNote( ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-7-0' - sw/source
sw/source/uibase/docvw/AnnotationWin2.cxx | 27 +++ 1 file changed, 27 insertions(+) New commits: commit 45096d16b82678873964802fd21922368a25296d Author: Caolán McNamara AuthorDate: Fri Sep 25 19:54:16 2020 +0100 Commit: Michael Stahl CommitDate: Tue Sep 29 12:03:11 2020 +0200 Resolves: tdf#136985 bogus undo steps added by comment manipulation Change-Id: I33d699375dcb1f7a9ed4d30e3f60f7161620c9a8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103546 Tested-by: Caolán McNamara Reviewed-by: Caolán McNamara (cherry picked from commit 071e31fdb77b34ea90fbfa0e0001669500395119) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103444 Tested-by: Jenkins Reviewed-by: Michael Stahl diff --git a/sw/source/uibase/docvw/AnnotationWin2.cxx b/sw/source/uibase/docvw/AnnotationWin2.cxx index f74ff69fdb25..f3734704e1ed 100644 --- a/sw/source/uibase/docvw/AnnotationWin2.cxx +++ b/sw/source/uibase/docvw/AnnotationWin2.cxx @@ -24,6 +24,7 @@ #include "SidebarWinAcc.hxx" #include #include +#include #include #include "SidebarTxtControl.hxx" #include "SidebarScrollBar.hxx" @@ -1074,6 +1075,20 @@ void SwAnnotationWin::SetReadonly(bool bSet) void SwAnnotationWin::SetLanguage(const SvxLanguageItem& rNewItem) { +IDocumentUndoRedo& rUndoRedo( +mrView.GetDocShell()->GetDoc()->GetIDocumentUndoRedo()); +const bool bDocUndoEnabled = rUndoRedo.DoesUndo(); +const bool bOutlinerUndoEnabled = mpOutliner->IsUndoEnabled(); +const bool bOutlinerModified = mpOutliner->IsModified(); +const bool bDisableAndRestoreUndoMode = !bDocUndoEnabled && bOutlinerUndoEnabled; + +if (bDisableAndRestoreUndoMode) +{ +// doc undo is disabled, but outliner was enabled, turn outliner undo off +// for the duration of this function +mpOutliner->EnableUndo(false); +} + Link aLink = mpOutliner->GetModifyHdl(); mpOutliner->SetModifyHdl( Link() ); ESelection aOld = GetOutlinerView()->GetSelection(); @@ -1084,6 +1099,13 @@ void SwAnnotationWin::SetLanguage(const SvxLanguageItem& rNewItem) aEditAttr.Put(rNewItem); GetOutlinerView()->SetAttribs( aEditAttr ); +if (!mpOutliner->IsUndoEnabled() && !bOutlinerModified) +{ +// if undo was disabled (e.g. this is a redo action) and we were +// originally 'unmodified' keep it that way +mpOutliner->ClearModifyFlag(); +} + GetOutlinerView()->SetSelection(aOld); mpOutliner->SetModifyHdl( aLink ); @@ -1101,6 +1123,11 @@ void SwAnnotationWin::SetLanguage(const SvxLanguageItem& rNewItem) mpOutliner->SetControlWord(nCntrl); mpOutliner->CompleteOnlineSpelling(); + +// restore original mode +if (bDisableAndRestoreUndoMode) +mpOutliner->EnableUndo(true); + Invalidate(); } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-7-0' - sw/source
sw/source/uibase/shells/annotsh.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 4677f06baff2ac3d667f74d84d85de45f8c35849 Author: Caolán McNamara AuthorDate: Fri Sep 25 16:48:44 2020 +0100 Commit: Michael Stahl CommitDate: Tue Sep 29 12:00:34 2020 +0200 Related: tdf#136985 apparent phantom redo entries with cursor in comment with a redo element in redo stack but the cursor in a comment the redo dropdown list appears empty even though the toolbar button is active. The problem doesn't appear in the undo case. This typo appears tobe there since original checkin of commit 9b67ca9c73b72a889811123269854ab2ca89d6a9 Date: Tue Feb 19 12:57:51 2008 + INTEGRATION: CWS notes2 (1.1.2); FILE ADDED Change-Id: I8715989c3e9958e3d2a0041129fbed81501057ed Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103440 Tested-by: Jenkins Reviewed-by: Michael Stahl diff --git a/sw/source/uibase/shells/annotsh.cxx b/sw/source/uibase/shells/annotsh.cxx index ccc7b10e3428..5bcda2e9a072 100644 --- a/sw/source/uibase/shells/annotsh.cxx +++ b/sw/source/uibase/shells/annotsh.cxx @@ -1645,7 +1645,7 @@ void SwAnnotationShell::StateUndo(SfxItemSet ) else if ((nWhich == SID_GETREDOSTRINGS) && (rSh.GetFirstRedoInfo(nullptr, nullptr))) { -rSh.GetDoStrings( SwWrtShell::UNDO, aItem ); +rSh.GetDoStrings( SwWrtShell::REDO, aItem ); } sList.append(aItem.GetString()); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-7-0' - sw/source
sw/source/filter/basflt/fltshell.cxx | 16 +--- 1 file changed, 9 insertions(+), 7 deletions(-) New commits: commit c70d803de936449926c779b3a30af31526e5a4a7 Author: Caolán McNamara AuthorDate: Thu Sep 24 16:06:00 2020 +0100 Commit: Michael Stahl CommitDate: Tue Sep 29 11:37:44 2020 +0200 ofz#25908 detect if the SwFrameFormat is deleted Change-Id: Ie9b1587903fef33c5e0471a18e5cbaee1a26f01c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103329 Tested-by: Jenkins Reviewed-by: Michael Stahl diff --git a/sw/source/filter/basflt/fltshell.cxx b/sw/source/filter/basflt/fltshell.cxx index 4f725a98b9a9..ceae383380af 100644 --- a/sw/source/filter/basflt/fltshell.cxx +++ b/sw/source/filter/basflt/fltshell.cxx @@ -962,7 +962,15 @@ SwFltAnchorListener::SwFltAnchorListener(SwFltAnchor* pFltAnchor) void SwFltAnchorListener::Notify(const SfxHint& rHint) { -if(auto pLegacyHint = dynamic_cast()) +if (rHint.GetId() == SfxHintId::Dying) +m_pFltAnchor->SetFrameFormat(nullptr); +else if (auto pDrawFrameFormatHint = dynamic_cast()) +{ +if (pDrawFrameFormatHint->m_eId != sw::DrawFrameFormatHintId::DYING) +return; +m_pFltAnchor->SetFrameFormat(nullptr); +} +else if (auto pLegacyHint = dynamic_cast()) { if(pLegacyHint->m_pNew->Which() != RES_FMT_CHG) return; @@ -971,12 +979,6 @@ void SwFltAnchorListener::Notify(const SfxHint& rHint) if(pFrameFormat) m_pFltAnchor->SetFrameFormat(pFrameFormat); } -else if (auto pDrawFrameFormatHint = dynamic_cast()) -{ -if (pDrawFrameFormatHint->m_eId != sw::DrawFrameFormatHintId::DYING) -return; -m_pFltAnchor->SetFrameFormat(nullptr); -} } // methods of SwFltRedline follow ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-7-0' - sw/source
sw/source/uibase/shells/tabsh.cxx |3 --- 1 file changed, 3 deletions(-) New commits: commit 75bae11e0867c440b9cf0923c236b518380fe87e Author: Caolán McNamara AuthorDate: Sun Sep 27 20:55:02 2020 +0100 Commit: Adolfo Jayme Barrientos CommitDate: Tue Sep 29 10:51:09 2020 +0200 tdf#135916 just set the target table as selection don't save and restore the cursor when the format is applied Change-Id: I320b714193b604cb480a517add4a4a61f5a5128e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103436 Tested-by: Jenkins Reviewed-by: Adolfo Jayme Barrientos diff --git a/sw/source/uibase/shells/tabsh.cxx b/sw/source/uibase/shells/tabsh.cxx index 04dfbda01131..d2e2380444d5 100644 --- a/sw/source/uibase/shells/tabsh.cxx +++ b/sw/source/uibase/shells/tabsh.cxx @@ -600,7 +600,6 @@ void SwTableShell::Execute(SfxRequest ) pDlg->StartExecuteAsync([pDlg, pRequest, pTableRep, , , xPaM](sal_Int32 nResult){ if (RET_OK == nResult) { -rSh.Push(); // save current cursor on stack rSh.SetSelection(*xPaM); // tdf#135636 set the table selected at dialog launch as current selection const SfxItemSet* pOutSet = pDlg->GetOutputItemSet(); @@ -610,8 +609,6 @@ void SwTableShell::Execute(SfxRequest ) pRequest->Done(*pOutSet); ItemSetToTableParam(*pOutSet, rSh); - -rSh.Pop(SwCursorShell::PopMode::DeleteCurrent); // restore cursor from stack } rBindings.Update(SID_RULER_BORDERS); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-7-0' - sw/source
sw/source/uibase/shells/annotsh.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit fdcbf9b65e8ebffde270bf0a5486f1505bd58e26 Author: Caolán McNamara AuthorDate: Fri Sep 25 16:23:31 2020 +0100 Commit: Michael Weghorn CommitDate: Mon Sep 28 17:03:59 2020 +0200 Related: tdf#136985 comment select all adds an undo action to the stack so ctrl+a in an unmodified document causes the undo toolbar item to become active Change-Id: Ie9fe97d64c89d2ca1cacf2ec89408b9ca6e3b418 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103342 Tested-by: Jenkins Reviewed-by: Michael Weghorn diff --git a/sw/source/uibase/shells/annotsh.cxx b/sw/source/uibase/shells/annotsh.cxx index 0c81d1d9..ccc7b10e3428 100644 --- a/sw/source/uibase/shells/annotsh.cxx +++ b/sw/source/uibase/shells/annotsh.cxx @@ -576,7 +576,7 @@ void SwAnnotationShell::Exec( SfxRequest ) } tools::Rectangle aOutRect = pOLV->GetOutputArea(); -if (tools::Rectangle() != aOutRect) +if (tools::Rectangle() != aOutRect && aNewAttr.Count()) pOLV->SetAttribs(aNewAttr); rView.GetViewFrame()->GetBindings().InvalidateAll(false); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-7-0' - sw/source
sw/source/core/crsr/crstrvl.cxx |2 +- sw/source/core/txtnode/ndtxt.cxx |2 +- 2 files changed, 2 insertions(+), 2 deletions(-) New commits: commit e60e70d544d67237d11943dd4004d6540d8edce6 Author: Samuel Mehrbrodt AuthorDate: Thu Aug 20 15:33:49 2020 +0200 Commit: Thorsten Behrens CommitDate: Tue Sep 22 01:06:05 2020 +0200 Related tdf#100492 Detect click into empty field Change-Id: Ic2937d619a8361b9d17b7dfa16698a5005f34ec6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101076 Tested-by: Jenkins Reviewed-by: Samuel Mehrbrodt (cherry picked from commit 2c7bf3543ab798d1c117d9f3258467e4aef9a8db) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103054 Reviewed-by: Thorsten Behrens diff --git a/sw/source/core/crsr/crstrvl.cxx b/sw/source/core/crsr/crstrvl.cxx index dd0d50c58d2c..4dbb5e7328fa 100644 --- a/sw/source/core/crsr/crstrvl.cxx +++ b/sw/source/core/crsr/crstrvl.cxx @@ -961,7 +961,7 @@ bool SwCursorShell::CursorInsideInputField() const { for(SwPaM& rCursor : GetCursor()->GetRingContainer()) { -if (dynamic_cast(GetTextFieldAtCursor(, false))) +if (dynamic_cast(GetTextFieldAtCursor(, true))) return true; } return false; diff --git a/sw/source/core/txtnode/ndtxt.cxx b/sw/source/core/txtnode/ndtxt.cxx index 0d272486e295..a3667e53e386 100644 --- a/sw/source/core/txtnode/ndtxt.cxx +++ b/sw/source/core/txtnode/ndtxt.cxx @@ -1780,7 +1780,7 @@ SwTextField* SwTextNode::GetFieldTextAttrAt( dynamic_cast( GetTextAttrAt( nIndex, RES_TXTATR_INPUTFIELD, -bIncludeInputFieldAtStart ? DEFAULT : PARENT )); +bIncludeInputFieldAtStart ? DEFAULT : EXPAND )); } return pTextField; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-7-0' - sw/source
sw/source/ui/misc/bookmark.cxx |1 + 1 file changed, 1 insertion(+) New commits: commit 88084ceca708a343fc79249f91eb9de34d26b3e9 Author: Michael Stahl AuthorDate: Fri Sep 18 17:12:38 2020 +0200 Commit: Caolán McNamara CommitDate: Mon Sep 21 13:11:45 2020 +0200 tdf#135879 sw: fix bookmark dialog's Delete button (regression from cb5d18871b46ef4f7bc47eb4d71df5374d712575) Change-Id: Ic8c66504a760ef26fbf95a5a1a13b37346982024 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103015 Tested-by: Jenkins Reviewed-by: Michael Stahl (cherry picked from commit fefcad1186232b26180d095bbafdf8e8bdda8209) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103049 Reviewed-by: Caolán McNamara diff --git a/sw/source/ui/misc/bookmark.cxx b/sw/source/ui/misc/bookmark.cxx index be22962fcf8d..731fe0651cf7 100644 --- a/sw/source/ui/misc/bookmark.cxx +++ b/sw/source/ui/misc/bookmark.cxx @@ -164,6 +164,7 @@ IMPL_LINK_NOARG(SwInsertBookmarkDlg, SelectionChangedHdl, weld::TreeView&, void) m_xInsertBtn->set_sensitive(false); m_xGotoBtn->set_sensitive(nSelectedRows == 1); m_xRenameBtn->set_sensitive(nSelectedRows == 1 && !m_bAreProtected); +m_xDeleteBtn->set_sensitive(!m_bAreProtected); m_xEditBox->set_text(sEditBoxText.makeStringAndClear()); } else ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-7-0' - sw/source
sw/source/core/doc/doclay.cxx |8 +++- 1 file changed, 3 insertions(+), 5 deletions(-) New commits: commit c514e9cfca2901f325644a65ee1b87455a56e7f0 Author: Vasily Melenchuk AuthorDate: Fri Sep 11 14:06:23 2020 +0300 Commit: Vasily Melenchuk CommitDate: Mon Sep 14 14:05:08 2020 +0200 tdf#135623: modified generation of unique fly name Modified lcl_GetUniqueFlyName() is right now always marks current fly format name number as used. Yes, this can lead to some gaps in numbering is some cases, but meanwhile guarantee that there will be no duplicates if format name does not match SdrObject name. Change-Id: If39ed993614ae1665deba21ae8d5e6bd542fb6e0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102460 Tested-by: Jenkins Reviewed-by: Thorsten Behrens (cherry picked from commit 07a695ec1988ee8b02256cab2e07a1b429ead24b) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102636 Reviewed-by: Vasily Melenchuk diff --git a/sw/source/core/doc/doclay.cxx b/sw/source/core/doc/doclay.cxx index 9929ec8ae599..ce33b8c213c6 100644 --- a/sw/source/core/doc/doclay.cxx +++ b/sw/source/core/doc/doclay.cxx @@ -1353,11 +1353,9 @@ static OUString lcl_GetUniqueFlyName(const SwDoc* pDoc, const char* pDefStrId, s if (pObj) lcl_collectUsedNums(aUsedNums, nNmLen, *pObj, aName); } -else -{ -OUString sName = pFlyFormat->GetName(); -lcl_collectUsedNums(aUsedNums, nNmLen, sName, aName); -} + +OUString sName = pFlyFormat->GetName(); +lcl_collectUsedNums(aUsedNums, nNmLen, sName, aName); } // All numbers are flagged accordingly, so determine the right one ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-7-0' - sw/source
sw/source/filter/basflt/shellio.cxx |1 + 1 file changed, 1 insertion(+) New commits: commit 7c140177879d259a6d41ea2383105b5eabef958c Author: Caolán McNamara AuthorDate: Thu Sep 10 10:03:26 2020 +0100 Commit: Xisco Fauli CommitDate: Thu Sep 10 15:31:02 2020 +0200 tdf#135950 crash in format->character with selected text in table Change-Id: I66e36a638d040d2a38ac234383d6f314a2ff4d88 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102309 Tested-by: Jenkins Reviewed-by: Xisco Fauli diff --git a/sw/source/filter/basflt/shellio.cxx b/sw/source/filter/basflt/shellio.cxx index d467a21d8a1c..74b314277bb8 100644 --- a/sw/source/filter/basflt/shellio.cxx +++ b/sw/source/filter/basflt/shellio.cxx @@ -895,6 +895,7 @@ ErrCode SwWriter::Write( WriterRef const & rxWriter, const OUString* pRealFileNa if ( xDoc.is() ) { +pTempCursor.reset(); xDoc.clear(); m_bWriteAll = false; } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-7-0' - sw/source
sw/source/uibase/shells/textsh1.cxx | 17 - 1 file changed, 17 deletions(-) New commits: commit 535ba982950eb8edfaa57430639cb861fb0769b4 Author: Tamás Zolnai AuthorDate: Mon Sep 7 16:49:29 2020 +0200 Commit: Adolfo Jayme Barrientos CommitDate: Wed Sep 9 13:14:24 2020 +0200 tdf#136471: Applying a spell checker suggestion adds the result .. also to the autocorrect replacement list Change-Id: I68d055fd55ffae210fff59ada1b925cdf7b34fb7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102193 Tested-by: Tamás Zolnai Reviewed-by: Tamás Zolnai (cherry picked from commit 36bd42e1e57604731fafd556331010578f9233fa) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102204 Tested-by: Jenkins Reviewed-by: Adolfo Jayme Barrientos diff --git a/sw/source/uibase/shells/textsh1.cxx b/sw/source/uibase/shells/textsh1.cxx index f24e8127f6bb..4342ed71380c 100644 --- a/sw/source/uibase/shells/textsh1.cxx +++ b/sw/source/uibase/shells/textsh1.cxx @@ -1566,23 +1566,6 @@ void SwTextShell::Execute(SfxRequest ) rWrtSh.Replace(aTmp, false); -/* #102505# EndAction/EndUndo moved down since insertion - of temporary auto correction is now undoable two and - must reside in the same undo group.*/ - -// record only if it's NOT already present in autocorrection -SvxAutoCorrect* pACorr = SvxAutoCorrCfg::Get().GetAutoCorrect(); - -OUString aOrigWord( bGrammar ? OUString() : xSpellAlt->getWord() ) ; -OUString aNewWord( sApplyText ); -SvxPrepareAutoCorrect( aOrigWord, aNewWord ); - -if (xSpellAlt.is()) -pACorr->PutText( aOrigWord, aNewWord, LanguageTag( xSpellAlt->getLocale() ).getLanguageType() ); - -/* #102505# EndAction/EndUndo moved down since insertion - of temporary auto correction is now undoable two and - must reside in the same undo group.*/ rWrtSh.EndAction(); rWrtSh.EndUndo(); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-7-0' - sw/source
sw/source/core/txtnode/thints.cxx |2 ++ 1 file changed, 2 insertions(+) New commits: commit 9ec49c6c2dd58eb60ca0ac5e99edee9ee098302a Author: Noel Grandin AuthorDate: Thu Sep 3 14:40:32 2020 +0200 Commit: Caolán McNamara CommitDate: Sun Sep 6 13:28:54 2020 +0200 tdf#132688 diacritics broken in lines with punctuation regression from commit 4b2d4f3c4a68361a6bc03c9ab110ce9376b14b20 tdf#119227 fix freeze when copying a large bulleted list Change-Id: I7d54b19c7a02c717426edce7896caaadf909154e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102000 Reviewed-by: Ilmari Lauhakangas Reviewed-by: Noel Grandin Tested-by: Jenkins (cherry picked from commit 18e4367c33f327cf09985105bde583cdcc7b2a46) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101972 Reviewed-by: Caolán McNamara diff --git a/sw/source/core/txtnode/thints.cxx b/sw/source/core/txtnode/thints.cxx index 51b3edd81cb6..711e29dda0d9 100644 --- a/sw/source/core/txtnode/thints.cxx +++ b/sw/source/core/txtnode/thints.cxx @@ -2822,6 +2822,8 @@ bool SwpHints::MergePortions( SwTextNode& rNode ) eMerge = DIFFER; break; } +if (iter1.IsAtEnd() && iter2.IsAtEnd()) +break; if (iter1.IsAtEnd() || iter2.IsAtEnd()) { eMerge = DIFFER; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-7-0' - sw/source
sw/source/uibase/shells/tabsh.cxx |8 +++- 1 file changed, 7 insertions(+), 1 deletion(-) New commits: commit af002a22eea1a3a94649ab5154db55b266696787 Author: Caolán McNamara AuthorDate: Mon Aug 31 15:23:58 2020 +0100 Commit: Miklos Vajna CommitDate: Tue Sep 1 13:41:09 2020 +0200 tdf#135636 the selection at dialog-launch time is lost by dialog-apply time since... commit c3a085d22742f88e91ff92f319a26d6e8d1d9a98 Date: Tue Jan 23 18:13:01 2018 +0100 lokdialog: Convert the Table -> Properties... to async exec. so save it at launch and temp apply it during ok handler. This is somewhat similar to tdf#134439 Change-Id: Ia0869307b1a37e5efa1703e68b946793b0ddc91b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101679 Tested-by: Jenkins Reviewed-by: Miklos Vajna diff --git a/sw/source/uibase/shells/tabsh.cxx b/sw/source/uibase/shells/tabsh.cxx index 0348f461f0e0..04dfbda01131 100644 --- a/sw/source/uibase/shells/tabsh.cxx +++ b/sw/source/uibase/shells/tabsh.cxx @@ -596,9 +596,13 @@ void SwTableShell::Execute(SfxRequest ) auto pRequest = std::make_shared(rReq); rReq.Ignore(); // the 'old' request is not relevant any more -pDlg->StartExecuteAsync([pDlg, pRequest, pTableRep, , ](sal_Int32 nResult){ +auto xPaM(std::make_shared(*rSh.GetCursor(), nullptr)); // tdf#135636 make a copy to use at later apply +pDlg->StartExecuteAsync([pDlg, pRequest, pTableRep, , , xPaM](sal_Int32 nResult){ if (RET_OK == nResult) { +rSh.Push(); // save current cursor on stack +rSh.SetSelection(*xPaM); // tdf#135636 set the table selected at dialog launch as current selection + const SfxItemSet* pOutSet = pDlg->GetOutputItemSet(); //to record FN_INSERT_TABLE correctly @@ -606,6 +610,8 @@ void SwTableShell::Execute(SfxRequest ) pRequest->Done(*pOutSet); ItemSetToTableParam(*pOutSet, rSh); + +rSh.Pop(SwCursorShell::PopMode::DeleteCurrent); // restore cursor from stack } rBindings.Update(SID_RULER_BORDERS); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-7-0' - sw/source
sw/source/core/draw/dcontact.cxx |3 +++ 1 file changed, 3 insertions(+) New commits: commit 921021b5d208fef12854bcf878489b1c05cde136 Author: Michael Stahl AuthorDate: Mon Aug 31 15:24:48 2020 +0200 Commit: Caolán McNamara CommitDate: Tue Sep 1 09:52:38 2020 +0200 tdf#135661 sw: fix Undo of text deletion of SdrObject This creates a non-working SwXShape without m_pFormat initialised: 0 SwXShape::SwXShape(com::sun::star::uno::Reference&, SwDoc const*) (this=0x278de80, xShape=uno::Reference to (SvxCustomShape *) 0x73ec840, pDoc=0x0) at sw/source/core/unocore/unodraw.cxx:889 1 SwFmDrawPage::CreateShape(SdrObject*) const (this=0x637a980, pObj=0x6409410) at sw/source/core/unocore/unodraw.cxx:372 2 SdrObject::getUnoShape() (this=0x6409410) at svx/source/svdraw/svdobj.cxx:2836 3 GetXShapeForSdrObject(SdrObject*) (pObj=0x6409410) at svx/source/unodraw/unoshape.cxx:3928 4 SdrObjCustomShape::GetCustomShapeEngine() const (this=0x6409410) at svx/source/svdraw/svdoashp.cxx:381 5 SdrObjCustomShape::GetTextBounds(tools::Rectangle&) const (this=0x6409410, rTextBound=...) at svx/source/svdraw/svdoashp.cxx:534 6 SdrObjCustomShape::AdaptTextMinSize() (this=0x6409410) at svx/source/svdraw/svdoashp.cxx:1397 7 SdrObjCustomShape::NbcSetSnapRect(tools::Rectangle const&) (this=0x6409410, rRect=...) at svx/source/svdraw/svdoashp.cxx:1421 8 SdrObjCustomShape::handlePageChange(SdrPage*, SdrPage*) (this=0x6409410, pOldPage=0x0, pNewPage=0x627fc80) at svx/source/svdraw/svdoashp.cxx:2855 9 SdrObject::setParentOfSdrObject(SdrObjList*) (this=0x6409410, pNewObjList=0x627fc80) at svx/source/svdraw/svdobj.cxx:294 10 SetParentAtSdrObjectFromSdrObjList(SdrObject&, SdrObjList*) (rSdrObject=..., pNew=0x627fc80) at svx/source/svdraw/svdpage.cxx:65 11 SdrObjList::NbcInsertObject(SdrObject*, unsigned long) (this=0x627fc80, pObj=0x6409410, nPos=0) at svx/source/svdraw/svdpage.cxx:305 12 SdrObjList::InsertObject(SdrObject*, unsigned long) (this=0x627fc80, pObj=0x6409410, nPos=0) at svx/source/svdraw/svdpage.cxx:358 13 FmFormPage::InsertObject(SdrObject*, unsigned long) (this=0x627fc80, pObj=0x6409410, nPos=0) at svx/source/form/fmpage.cxx:79 14 SwDrawContact::InsertMasterIntoDrawPage() (this=0x640d6b0) at sw/source/core/draw/dcontact.cxx:1909 15 SwDrawContact::SwClientNotify(SwModify const&, SfxHint const&) (this=0x640d6b0, rMod=..., rHint=...) at sw/source/core/draw/dcontact.cxx:1457 16 SwModify::CallSwClientNotify(SfxHint const&) const (this=0x640d090, rHint=...) at sw/source/core/attr/calbck.cxx:373 17 sw::BroadcastingModify::CallSwClientNotify(SfxHint const&) const (this=0x640d090, rHint=...) at sw/source/core/attr/calbck.cxx:378 18 SwUndoFlyBase::InsFly(sw::UndoRedoContext&, bool) (this=0x78cdfd0, rContext=..., bShowSelFrame=false) at sw/source/core/undo/undobj1.cxx:97 19 SwUndoDelLayFormat::UndoImpl(sw::UndoRedoContext&) (this=0x78cdfd0, rContext=...) at sw/source/core/undo/undobj1.cxx:440 20 SwHistoryTextFlyCnt::SetInDoc(SwDoc*, bool) (this=0x60d14c0, pDoc=0x625aa30) at sw/source/core/undo/rolbck.cxx:581 Whereas if the shape is selected and deleted that way, a completely different Undo is created, which doesn't have this problem: 0 SwXShape::SetFrameFormat(SwFrameFormat*) (this=0x2497d50, pFormat=0x564b470) at sw/inc/unodraw.hxx:206 1 SwXShape::AddExistingShapeToFormat(SdrObject const&) (_rObj=...) at sw/source/core/unocore/unodraw.cxx:945 2 SwDrawContact::SwDrawContact(SwFrameFormat*, SdrObject*) (this=0x6bad330, pToRegisterIn=0x564b470, pObj=0x5647880) at sw/source/core/draw/dcontact.cxx:709 3 SwUndoDrawDelete::UndoImpl(sw::UndoRedoContext&) (this=0x56ebcd0, rContext=...) at sw/source/core/undo/undraw.cxx:501 In SwUndoDelLayFormat, the SdrObject is apparently removed from SdrPage and the SwDrawContact remains, whereas in SwUndoDrawDelete, the SdrObject remains on SdrPage but is moved to invisible layer, and SwDrawContact is destroyed (presumably). Include obligatory rant why sw has 2 undos doing the same thing here. (reportedly regression from 2d89b9929e85bede4c72684a12e7508751875f0e but probably this can be triggered before, at least since 91b2325808a75174f284c48c8b8afc118fad74e4) Change-Id: I4fbb3620bfe1ac07f47e4441625797db7a87cecd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101740 Tested-by: Jenkins Reviewed-by: Michael Stahl (cherry picked from commit a609bc9cc03a0a23c8f20fee808cc6cc2887170d) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101680 Reviewed-by: Caolán McNamara diff --git a/sw/source/core/draw/dcontact.cxx b/sw/source/core/draw/dcontact.cxx index 4d077fe401b4..ad672260a834 100644 --- a/sw/source/core/draw/dcontact.cxx +++ b/sw/source/core/draw/dcontact.cxx @@ -1457,6 +1457,9 @@ void SwDrawContact::SwClientNotify(const SwModify& rMod,
[Libreoffice-commits] core.git: Branch 'libreoffice-7-0' - sw/source
sw/source/core/layout/frmtool.cxx | 10 +- 1 file changed, 9 insertions(+), 1 deletion(-) New commits: commit 139ce6588a2980e52df9a106a254c16e6f27ea8d Author: Michael Stahl AuthorDate: Fri Aug 28 22:05:06 2020 +0200 Commit: Caolán McNamara CommitDate: Mon Aug 31 15:41:46 2020 +0200 tdf#135001 sw_redlinehide: fix IsShown() for AT_PARA flys There is one merged text frame from node 102 to node 328 with no extents, and of course a shape anchored at node 271 should not be visible at all. This crashes because the shape was removed from the layout during CheckParaRedlineMerge() but then moved to the visible heaven layer again via sw::AddRemoveFlysAnchoredToFrameStartingAtNode() and the layer determines if it's visible as far as Sdr* is concerned; it lacks a connection to a SwFrame though. warn:legacy.osl:3547848:3547848:sw/source/core/layout/paintfrm.cxx:3861: - paint of drawing object without anchor frame!? (regression from 6aaae44da382f4bc3eafc287b4a21734b740cf21) Change-Id: Ia20449b3a7d251f0c049eb979c88df1e80cd7d5f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101584 Tested-by: Jenkins Reviewed-by: Michael Stahl (cherry picked from commit 586750da40c5b332d2442ef24ae121795e88e903) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101672 Reviewed-by: Caolán McNamara diff --git a/sw/source/core/layout/frmtool.cxx b/sw/source/core/layout/frmtool.cxx index 22217f5c0655..f5b2cc813e4a 100644 --- a/sw/source/core/layout/frmtool.cxx +++ b/sw/source/core/layout/frmtool.cxx @@ -1052,7 +1052,15 @@ static bool IsShown(sal_uLong const nIndex, { return false; } -if (pIter && rAnch.GetAnchorId() != RndStdIds::FLY_AT_PARA) +if (rAnch.GetAnchorId() == RndStdIds::FLY_AT_PARA) +{ +return pIter == nullptr // not merged +|| pIter != pEnd// at least one char visible in node +|| !IsSelectFrameAnchoredAtPara(rAnchor, +SwPosition(const_cast(*pFirstNode), 0), +SwPosition(const_cast(*pLastNode), pLastNode->Len())); +} +if (pIter) { // note: frames are not sorted by anchor position. assert(pEnd); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-7-0' - sw/source
sw/source/core/doc/DocumentLayoutManager.cxx |9 + 1 file changed, 9 insertions(+) New commits: commit 42770e9c231bec7cec383b4c0d6979b0d7a329ee Author: Vasily Melenchuk AuthorDate: Thu Aug 20 12:06:03 2020 +0300 Commit: Michael Stahl CommitDate: Thu Aug 27 13:01:02 2020 +0200 tdf#133490: set name for pasted frame format In some copy/paste operations resulting frame format name can be empty. This can lead to problems with udo/redo which relies on format names. Change-Id: I3cb542321d37cc00e2dee83d0f667164d83ead78 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101042 Tested-by: Jenkins Reviewed-by: Thorsten Behrens (cherry picked from commit a6c2a87612a10d55fc59fa01e44d67d95505834f) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101366 Reviewed-by: Michael Stahl diff --git a/sw/source/core/doc/DocumentLayoutManager.cxx b/sw/source/core/doc/DocumentLayoutManager.cxx index 57f8af08920b..8d5cc79dc648 100644 --- a/sw/source/core/doc/DocumentLayoutManager.cxx +++ b/sw/source/core/doc/DocumentLayoutManager.cxx @@ -41,6 +41,7 @@ #include #include #include +#include using namespace ::com::sun::star; @@ -484,6 +485,14 @@ SwFrameFormat *DocumentLayoutManager::CopyLayoutFormat( pDestTextBox->SetOtherTextBoxFormat(pDest); } +if (pDest->GetName().isEmpty()) +{ +// Format name should have unique name. Let's use object name as a fallback +SdrObject *pObj = pDest->FindSdrObject(); +if (pObj) +pDest->SetName(pObj->GetName()); +} + return pDest; } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-7-0' - sw/source
sw/source/core/docnode/ndsect.cxx |1 + 1 file changed, 1 insertion(+) New commits: commit cc1d627b647ac842d6bdbceb309bc67f2227f68e Author: Vasily Melenchuk AuthorDate: Thu Aug 20 12:09:49 2020 +0300 Commit: Michael Stahl CommitDate: Thu Aug 27 12:59:30 2020 +0200 sw: set name for section format on creation Section format is derived from frame format and better to have own unique name for undo/redo work. Change-Id: If41890443c2d71886164e0b94721b92bc2e9573a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101043 Tested-by: Jenkins Reviewed-by: Thorsten Behrens (cherry picked from commit 5f23f241704f798164df498e24dbf6b0daf27c44) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101368 Reviewed-by: Michael Stahl diff --git a/sw/source/core/docnode/ndsect.cxx b/sw/source/core/docnode/ndsect.cxx index 86207616fce5..67dea3850311 100644 --- a/sw/source/core/docnode/ndsect.cxx +++ b/sw/source/core/docnode/ndsect.cxx @@ -191,6 +191,7 @@ SwDoc::InsertSwSection(SwPaM const& rRange, SwSectionData & rNewData, } SwSectionFormat* const pFormat = MakeSectionFormat(); +pFormat->SetName(rNewData.GetSectionName()); if ( pAttr ) { pFormat->SetFormatAttr( *pAttr ); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-7-0' - sw/source
sw/source/core/txtnode/ndtxt.cxx |5 - 1 file changed, 4 insertions(+), 1 deletion(-) New commits: commit db5bcab9c0a1d4736fbffd79afd00de9daa2afac Author: Michael Stahl AuthorDate: Tue Aug 25 17:30:16 2020 +0200 Commit: Caolán McNamara CommitDate: Wed Aug 26 10:58:26 2020 +0200 tdf#135018 sw_redlinehide: fix accept delete redline at start of body There is no predecessor text node. (regression from 34b32f56e7f76639ee3a31cfc230a3340acf635a) Change-Id: I5f6a1a7a1a35a2a6e600166dc1afcf6c4bf9d389 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101337 Tested-by: Jenkins Reviewed-by: Michael Stahl (cherry picked from commit a64511dc929a91926ade0c132b310214fdb1bdea) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101353 Reviewed-by: Caolán McNamara diff --git a/sw/source/core/txtnode/ndtxt.cxx b/sw/source/core/txtnode/ndtxt.cxx index 37400645b2fc..0d272486e295 100644 --- a/sw/source/core/txtnode/ndtxt.cxx +++ b/sw/source/core/txtnode/ndtxt.cxx @@ -870,7 +870,10 @@ void CheckResetRedlineMergeFlag(SwTextNode & rNode, Recreate const eRecreateMerg if (eRecreateMerged != sw::Recreate::No) { SwTextNode * pMergeNode(); -if (eRecreateMerged == sw::Recreate::Predecessor) +if (eRecreateMerged == sw::Recreate::Predecessor +// tdf#135018 check that there is a predecessor node, i.e. rNode +// isn't the first node after the body start node +&& rNode.GetNodes()[rNode.GetIndex() - 1]->StartOfSectionIndex() != 0) { for (sal_uLong i = rNode.GetIndex() - 1; ; --i) { ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-7-0' - sw/source
sw/source/core/doc/DocumentRedlineManager.cxx | 54 ++ 1 file changed, 38 insertions(+), 16 deletions(-) New commits: commit 5f01eb16dc1832e1b354d6d5782ce451892555c9 Author: Michael Stahl AuthorDate: Mon Aug 24 19:29:14 2020 +0200 Commit: Caolán McNamara CommitDate: Wed Aug 26 10:57:51 2020 +0200 tdf#132160 sw_redlinehide: more pathological redline problems This is similar to 63dba5203e8bc7fc390943cb8208ae904f18e3bb except here the redline starts with a section (in particular an entire alphabetical index); this one is at node 13489 to node 14206. There's another fun one, starts with a table but has a text node following it, at node 8222 to 8231; this case also wasn't handled correctly at least in one direction. Fix that by continuing iteration of text-nodes once table/section at the start are handled. (regression from d258fc29560baa5ecae03ebc2740e11420643e27) Change-Id: I3f75ad473881f01be80d2c3804b9ac209f430bdf Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101287 Tested-by: Jenkins Reviewed-by: Michael Stahl (cherry picked from commit 0bbc397dc5b4440144627330c2b6ee479bdcf074) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101169 Reviewed-by: Caolán McNamara diff --git a/sw/source/core/doc/DocumentRedlineManager.cxx b/sw/source/core/doc/DocumentRedlineManager.cxx index 143e20e21005..ace591d95dae 100644 --- a/sw/source/core/doc/DocumentRedlineManager.cxx +++ b/sw/source/core/doc/DocumentRedlineManager.cxx @@ -140,24 +140,38 @@ void UpdateFramesForAddDeleteRedline(SwDoc & rDoc, SwPaM const& rPam) // no need to call UpdateFootnoteNums for FTNNUM_PAGE: // the AppendFootnote/RemoveFootnote will do it by itself! rDoc.GetFootnoteIdxs().UpdateFootnote(rPam.Start()->nNode); -SwTextNode *const pStartNode(rPam.Start()->nNode.GetNode().GetTextNode()); -if (!pStartNode) +SwPosition currentStart(*rPam.Start()); +SwTextNode * pStartNode(rPam.Start()->nNode.GetNode().GetTextNode()); +while (!pStartNode) { -SwTableNode *const pTableNode(rPam.Start()->nNode.GetNode().GetTableNode()); -assert(pTableNode); // known pathology -for (sal_uLong j = pTableNode->GetIndex(); j <= pTableNode->EndOfSectionIndex(); ++j) +SwStartNode *const pTableOrSectionNode( +currentStart.nNode.GetNode().IsTableNode() +? static_cast(currentStart.nNode.GetNode().GetTableNode()) +: static_cast(currentStart.nNode.GetNode().GetSectionNode())); +assert(pTableOrSectionNode); // known pathology +for (sal_uLong j = pTableOrSectionNode->GetIndex(); j <= pTableOrSectionNode->EndOfSectionIndex(); ++j) { - pTableNode->GetNodes()[j]->SetRedlineMergeFlag(SwNode::Merge::Hidden); + pTableOrSectionNode->GetNodes()[j]->SetRedlineMergeFlag(SwNode::Merge::Hidden); } for (SwRootFrame const*const pLayout : rDoc.GetAllLayouts()) { if (pLayout->IsHideRedlines()) { -pTableNode->DelFrames(pLayout); +if (pTableOrSectionNode->IsTableNode()) +{ + static_cast(pTableOrSectionNode)->DelFrames(pLayout); +} +else +{ + static_cast(pTableOrSectionNode)->DelFrames(pLayout); +} } } +currentStart.nNode = pTableOrSectionNode->EndOfSectionIndex() + 1; + currentStart.nContent.Assign(currentStart.nNode.GetNode().GetContentNode(), 0); +pStartNode = currentStart.nNode.GetNode().GetTextNode(); } -else +if (currentStart < *rPam.End()) { SwTextNode * pNode(pStartNode); do @@ -221,24 +235,32 @@ void UpdateFramesForRemoveDeleteRedline(SwDoc & rDoc, SwPaM const& rPam) { bool isAppendObjsCalled(false); rDoc.GetFootnoteIdxs().UpdateFootnote(rPam.Start()->nNode); -SwTextNode *const pStartNode(rPam.Start()->nNode.GetNode().GetTextNode()); -if (!pStartNode) +SwPosition currentStart(*rPam.Start()); +SwTextNode * pStartNode(rPam.Start()->nNode.GetNode().GetTextNode()); +while (!pStartNode) { -SwTableNode const*const pTableNode(rPam.Start()->nNode.GetNode().GetTableNode()); -assert(pTableNode); // known pathology -for (sal_uLong j = pTableNode->GetIndex(); j <= pTableNode->EndOfSectionIndex(); ++j) +SwStartNode const*const pTableOrSectionNode( +currentStart.nNode.GetNode().IsTableNode() +? static_cast(currentStart.nNode.GetNode().GetTableNode()) +: static_cast(currentStart.nNode.GetNode().GetSectionNode())); +assert(pTableOrSectionNode); // known pathology +for (sal_uLong j = pTableOrSectionNode->GetIndex(); j <= pTableOrSectionNode->EndOfSectionIndex(); ++j) { -
[Libreoffice-commits] core.git: Branch 'libreoffice-7-0' - sw/source
sw/source/filter/ww8/ww8par.cxx | 10 ++ 1 file changed, 6 insertions(+), 4 deletions(-) New commits: commit 9662a743ab8dd1f9a3ce1552e9d23a5e5259f5b5 Author: Caolán McNamara AuthorDate: Sun Aug 23 20:47:00 2020 +0100 Commit: Adolfo Jayme Barrientos CommitDate: Tue Aug 25 00:57:39 2020 +0200 ofz#25169 insertion into set might find a duplicate in which case pImpRec is deleted and pImpRecTmp is invalid Change-Id: I2a273a436ebd88cb53e329bbcb4f171dda6ed840 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101154 Reviewed-by: Michael Stahl Tested-by: Jenkins diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx index 054b0a98e9ee..b733cad8ce83 100644 --- a/sw/source/filter/ww8/ww8par.cxx +++ b/sw/source/filter/ww8/ww8par.cxx @@ -1082,7 +1082,9 @@ SdrObject* SwMSDffManager::ProcessObj(SvStream& rSt, if( pImpRec->nShapeId ) { -auto pImpRecTmp = pImpRec.get(); +auto nShapeId = pImpRec->nShapeId; +auto nShapeOrder = (static_cast(pImpRec->aTextId.nTxBxS) << 16) ++ pImpRec->aTextId.nSequence; // Complement Import Record List pImpRec->pObj = pObj; rImportData.insert(std::move(pImpRec)); @@ -1094,9 +1096,9 @@ SdrObject* SwMSDffManager::ProcessObj(SvStream& rSt, ( (rObjData.nSpFlags & ShapeFlag::Group) && (rObjData.nCalledByGroup < 2) ) ) -StoreShapeOrder( pImpRecTmp->nShapeId, -( static_cast(pImpRecTmp->aTextId.nTxBxS) << 16 ) -+ pImpRecTmp->aTextId.nSequence, pObj ); +{ +StoreShapeOrder(nShapeId, nShapeOrder, pObj); +} } else pImpRec.reset(); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-7-0' - sw/source
sw/source/uibase/lingu/olmenu.cxx |3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) New commits: commit a8ff48c342c4c883319f17cb652cdbf23ed36dfc Author: Michael Stahl AuthorDate: Thu Aug 20 14:00:04 2020 +0200 Commit: Caolán McNamara CommitDate: Thu Aug 20 18:23:03 2020 +0200 tdf#135721 sw: fix SwSpellPopup::Execute() deleting flys Follow-up to ec579354af954867b829e7d08e4d752518c83728 : in 6.4, this is the location of the spell check menu code; not sure how to call this but it has the same bug... (regression from 28b77c89dfcafae82cf2a6d85731b643ff9290e5) Change-Id: I0e6ce9c97d810f7c92dff320d403c986a947c266 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101073 Tested-by: Jenkins Reviewed-by: Michael Stahl (cherry picked from commit a58fe88b5b406749f6e47c14f56d7490a7958bda) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101060 Reviewed-by: Caolán McNamara diff --git a/sw/source/uibase/lingu/olmenu.cxx b/sw/source/uibase/lingu/olmenu.cxx index 813cfae970af..27d4b19fffc1 100644 --- a/sw/source/uibase/lingu/olmenu.cxx +++ b/sw/source/uibase/lingu/olmenu.cxx @@ -722,9 +722,8 @@ void SwSpellPopup::Execute( sal_uInt16 nId ) m_pSh->StartUndo(SwUndoId::UI_REPLACE, ); m_pSh->StartAction(); -m_pSh->DelLeft(); -m_pSh->Insert( aTmp ); +m_pSh->Replace(aTmp, false); /* #102505# EndAction/EndUndo moved down since insertion of temporary auto correction is now undoable two and ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-7-0' - sw/source
sw/source/uibase/shells/textsh1.cxx |3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) New commits: commit 0089f37fcfb166040326aedb99a11f7ce659fdb9 Author: Michael Stahl AuthorDate: Wed Aug 19 18:55:27 2020 +0200 Commit: Caolán McNamara CommitDate: Thu Aug 20 18:22:39 2020 +0200 tdf#135721 sw: fix spell check context menu deleting flys Kind of similar to e1629c210ad78310e3d48c0756723134a27b89df but the problem is at a higher level: SwTextShell::Execute() with SID_SPELLCHECK_APPLY_SUGGESTION should not DelLeft() + Insert() but just Replace(). (regression from 28b77c89dfcafae82cf2a6d85731b643ff9290e5) Change-Id: I78487c7841ba22ccc6751240a8e55e08a86fba32 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101014 Tested-by: Jenkins Reviewed-by: Michael Stahl (cherry picked from commit ec579354af954867b829e7d08e4d752518c83728) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101059 Reviewed-by: Caolán McNamara diff --git a/sw/source/uibase/shells/textsh1.cxx b/sw/source/uibase/shells/textsh1.cxx index c9e74390289a..f24e8127f6bb 100644 --- a/sw/source/uibase/shells/textsh1.cxx +++ b/sw/source/uibase/shells/textsh1.cxx @@ -1563,9 +1563,8 @@ void SwTextShell::Execute(SfxRequest ) rWrtSh.StartUndo(SwUndoId::UI_REPLACE, ); rWrtSh.StartAction(); -rWrtSh.DelLeft(); -rWrtSh.Insert( aTmp ); +rWrtSh.Replace(aTmp, false); /* #102505# EndAction/EndUndo moved down since insertion of temporary auto correction is now undoable two and ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-7-0' - sw/source
sw/source/core/doc/docfmt.cxx |2 ++ 1 file changed, 2 insertions(+) New commits: commit cb168fa5a2b732438266baf07a08c4c1d9fe671d Author: Vasily Melenchuk AuthorDate: Mon Jul 20 09:55:19 2020 +0300 Commit: Thorsten Behrens CommitDate: Wed Aug 19 14:55:12 2020 +0200 sw: generate unique style name for table box and line frames Since SwTableBoxFormat and SwTableLineFormat are derived from SwFrameFormat they can behave incorrectly during undo/redo. Undo/redo code is trying to rely style names instead of pointers to format: this is dangerous. Any problems with SwTableBoxFormat and SwTableLineFormat, I was not able to reproduce with GUI. But external access to document via UNO can bring surprises. For example: NumberFormat for table cells in GUI is modified, but can be changed to another by UNO call (see example/usecase in /sw/qa/python/check_table.py: test_tdf32082. And such replacement looks from core as a new style, not a modification of attributes in existing one. Change-Id: I6afc992f6cdb9ce692167204b3c98e8234cd87d0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99023 Tested-by: Jenkins Reviewed-by: Thorsten Behrens (cherry picked from commit 083fe09958658de8c3da87a28e0f8ff7b3b8a5e9) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100940 diff --git a/sw/source/core/doc/docfmt.cxx b/sw/source/core/doc/docfmt.cxx index f0a3e2a5fb35..230337e9d22a 100644 --- a/sw/source/core/doc/docfmt.cxx +++ b/sw/source/core/doc/docfmt.cxx @@ -1705,6 +1705,7 @@ bool SwDoc::DontExpandFormat( const SwPosition& rPos, bool bFlag ) SwTableBoxFormat* SwDoc::MakeTableBoxFormat() { SwTableBoxFormat* pFormat = new SwTableBoxFormat( GetAttrPool(), mpDfltFrameFormat.get() ); +pFormat->SetName("TableBox" + OUString::number(reinterpret_cast(pFormat))); getIDocumentState().SetModified(); return pFormat; } @@ -1712,6 +1713,7 @@ SwTableBoxFormat* SwDoc::MakeTableBoxFormat() SwTableLineFormat* SwDoc::MakeTableLineFormat() { SwTableLineFormat* pFormat = new SwTableLineFormat( GetAttrPool(), mpDfltFrameFormat.get() ); +pFormat->SetName("TableLine" + OUString::number(reinterpret_cast(pFormat))); getIDocumentState().SetModified(); return pFormat; } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-7-0' - sw/source
sw/source/core/undo/undobj.cxx | 12 +++- 1 file changed, 7 insertions(+), 5 deletions(-) New commits: commit 4860c07c58c25fe89b0eea792f4a273145a3f9d6 Author: Michael Stahl AuthorDate: Wed Aug 12 16:32:07 2020 +0200 Commit: Thorsten Behrens CommitDate: Tue Aug 18 08:52:27 2020 +0200 sw: avoid assert when deletion starts at fieldmark end This hit assert(bSavePos && bSaveOtherPos); Tweak SwUndoSaveContent::DelContentIndex() for fieldmarks to only accept an equal end position if the start position was in range as well. (regression from 24fd14b387dca458a1b6e9415e936d26562ddb1e) Change-Id: If6c9b049193bb7f1bc39ec66d1c965512f9d6ec1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100660 Tested-by: Jenkins Reviewed-by: Michael Stahl (cherry picked from commit 5364c0815734d864e3c26090f1219d58a4022f8b) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100671 Reviewed-by: Thorsten Behrens diff --git a/sw/source/core/undo/undobj.cxx b/sw/source/core/undo/undobj.cxx index a7a6119176fd..db2fee97bb6b 100644 --- a/sw/source/core/undo/undobj.cxx +++ b/sw/source/core/undo/undobj.cxx @@ -1105,12 +1105,14 @@ void SwUndoSaveContent::DelContentIndex( const SwPosition& rMark, if( pBkmk->IsExpanded() && *pStt <= pBkmk->GetOtherMarkPos() && pBkmk->GetOtherMarkPos() <= *pEnd ) { -if ( bSavePos || bSaveOtherPos +assert(!bSaveOtherPos); +if ( bSavePos || (*pStt < pBkmk->GetOtherMarkPos() && pBkmk->GetOtherMarkPos() < *pEnd) -|| type == IDocumentMarkAccess::MarkType::TEXT_FIELDMARK -|| type == IDocumentMarkAccess::MarkType::CHECKBOX_FIELDMARK -|| type == IDocumentMarkAccess::MarkType::DROPDOWN_FIELDMARK -|| type == IDocumentMarkAccess::MarkType::DATE_FIELDMARK) +|| (bMaybe +&& ( type == IDocumentMarkAccess::MarkType::TEXT_FIELDMARK +|| type == IDocumentMarkAccess::MarkType::CHECKBOX_FIELDMARK +|| type == IDocumentMarkAccess::MarkType::DROPDOWN_FIELDMARK +|| type == IDocumentMarkAccess::MarkType::DATE_FIELDMARK))) { if( bMaybe ) bSavePos = true; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-7-0' - sw/source
sw/source/core/txtnode/ndtxt.cxx |9 - 1 file changed, 4 insertions(+), 5 deletions(-) New commits: commit 13c3e22bcea72aa1b41e5891ff65647f7eeb02d9 Author: Caolán McNamara AuthorDate: Fri Aug 14 16:52:23 2020 +0100 Commit: Michael Stahl CommitDate: Mon Aug 17 13:27:38 2020 +0200 tdf#132892 Revert "sw: paragraph-sign: erase metafields ... correctly" This reverts commit b402d0112a0bb53221b847fa372bfa3f6390a0e2. Change-Id: I210d2fded01fb952d7384b78240e32d868b08575 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100795 Reviewed-by: Michael Stahl Tested-by: Jenkins diff --git a/sw/source/core/txtnode/ndtxt.cxx b/sw/source/core/txtnode/ndtxt.cxx index 6200eb040abd..37400645b2fc 100644 --- a/sw/source/core/txtnode/ndtxt.cxx +++ b/sw/source/core/txtnode/ndtxt.cxx @@ -2002,7 +2002,7 @@ void SwTextNode::CopyText( SwTextNode *const pDest, { CHECK_SWPHINTS_IF_FRM(this); CHECK_SWPHINTS(pDest); -const sal_Int32 nTextStartIdx = rStart.GetIndex(); +sal_Int32 nTextStartIdx = rStart.GetIndex(); sal_Int32 nDestStart = rDestStart.GetIndex(); // remember old Pos if (pDest->GetDoc()->IsClipBoard() && GetNum()) @@ -2093,6 +2093,7 @@ void SwTextNode::CopyText( SwTextNode *const pDest, // Fetch end only now, because copying into self updates the start index // and all attributes +nTextStartIdx = rStart.GetIndex(); const sal_Int32 nEnd = nTextStartIdx + nLen; // 2. copy attributes @@ -2240,10 +2241,8 @@ void SwTextNode::CopyText( SwTextNode *const pDest, std::reverse(metaFieldRanges.begin(), metaFieldRanges.end()); for (const auto& pair : metaFieldRanges) { -const SwIndex aIdx(pDest, std::max(pair.first - nTextStartIdx, 0)); -const sal_Int32 nCount = pair.second - pair.first; -if (nCount > 0) -pDest->EraseText(aIdx, nCount); +const SwIndex aIdx(pDest, pair.first); +pDest->EraseText(aIdx, pair.second - pair.first); } } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-7-0' - sw/source
sw/source/uibase/shells/textsh1.cxx |5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) New commits: commit 9818f708979098b315eed7c6e4e19bc81ceb Author: Caolán McNamara AuthorDate: Thu Aug 13 15:48:16 2020 +0100 Commit: Michael Stahl CommitDate: Mon Aug 17 11:42:58 2020 +0200 tdf#134439 honor FN_PARAM_PAM arguments which was dropped by commit bba8e5aa6d1968e5279b3fe368c0f81145513d04 Date: Thu Mar 1 21:00:24 2018 +0100 tdf#116070: Use a valid PaM when confirming the dialog. when fixing commit 34527cec54ca634b831cfa5ac1098c4046818ac3 Date: Tue Jan 16 18:54:19 2018 +0100 lokdialog: Convert the Format -> Paragraph... dialog to async exec. so, go back to using pPaM instead of rWrtSh.GetCursor but make a copy of pPaM to avoid the crash of tdf#116070 Change-Id: I0aaaf5173c6be47dd306b77eacbb07d0e1c4eaf1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100527 Tested-by: Jenkins Reviewed-by: Michael Stahl diff --git a/sw/source/uibase/shells/textsh1.cxx b/sw/source/uibase/shells/textsh1.cxx index a7eef3d5cf6f..c9e74390289a 100644 --- a/sw/source/uibase/shells/textsh1.cxx +++ b/sw/source/uibase/shells/textsh1.cxx @@ -1076,7 +1076,8 @@ void SwTextShell::Execute(SfxRequest ) auto pRequest = std::make_shared(rReq); rReq.Ignore(); // the 'old' request is not relevant any more -pDlg->StartExecuteAsync([pDlg, , pRequest, nDefDist](sal_Int32 nResult){ +auto xPaM(std::make_shared(*pPaM, nullptr)); // tdf#134439 make a copy to use at later apply +pDlg->StartExecuteAsync([pDlg, , pRequest, nDefDist, xPaM](sal_Int32 nResult){ if (nResult == RET_OK) { // Apply defaults if necessary. @@ -1106,7 +1107,7 @@ void SwTextShell::Execute(SfxRequest ) pSet->Put(SfxStringItem(FN_DROP_CHAR_STYLE_NAME, sCharStyleName)); } -sw_ParagraphDialogResult(pSet, rWrtSh, *pRequest, rWrtSh.GetCursor()); +sw_ParagraphDialogResult(pSet, rWrtSh, *pRequest, xPaM.get()); } pDlg->disposeOnce(); }); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-7-0' - sw/source
sw/source/core/txtnode/atrfld.cxx |2 +- sw/source/core/undo/undobj.cxx|4 2 files changed, 5 insertions(+), 1 deletion(-) New commits: commit 27e9ead64d4e3a3f3b3d1203f7b9fee50eb0d04d Author: Michael Stahl AuthorDate: Fri Aug 14 16:35:32 2020 +0200 Commit: Caolán McNamara CommitDate: Mon Aug 17 10:36:24 2020 +0200 tdf#135457 sw: fix invalidation of SwXTextField This was supposed to happen from SwNodes::ChgNode() when moving to the undo nodes array. There are fields with a range that contains other fields, when the outer field's range is deleted, the contained field moves to the undo array and its position is no longer valid to be given out by SwXTextField::getAnchor(). (regression from c73b5e969b2f9abdb2b9191938ca30bec5af725d) Change-Id: I38c8b3393a777ca8dc8739b5ca4233a7f124961e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100749 Tested-by: Jenkins Reviewed-by: Michael Stahl (cherry picked from commit 14fd4b54113f884cfd6871aeff693734fc06224b) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100705 Reviewed-by: Caolán McNamara diff --git a/sw/source/core/txtnode/atrfld.cxx b/sw/source/core/txtnode/atrfld.cxx index b41eb943c429..b8027bcd5d65 100644 --- a/sw/source/core/txtnode/atrfld.cxx +++ b/sw/source/core/txtnode/atrfld.cxx @@ -217,7 +217,7 @@ void SwFormatField::InvalidateField() { SwPtrMsgPoolItem const item(RES_REMOVE_UNO_OBJECT, _cast(*this)); // cast to base class (void*) -NotifyClients(, ); +CallSwClientNotify(sw::LegacyModifyHint{ , }); } void SwFormatField::SwClientNotify( const SwModify& rModify, const SfxHint& rHint ) diff --git a/sw/source/core/undo/undobj.cxx b/sw/source/core/undo/undobj.cxx index 30fc2ed24b4d..a7a6119176fd 100644 --- a/sw/source/core/undo/undobj.cxx +++ b/sw/source/core/undo/undobj.cxx @@ -853,6 +853,10 @@ void SwUndoSaveContent::DelContentIndex( const SwPosition& rMark, SwDoc* pDoc = rMark.nNode.GetNode().GetDoc(); +// if it's not in the doc array, probably missing some invalidation somewhere +assert(() == >GetNodes()); +assert(() == >GetNodes()); + ::sw::UndoGuard const undoGuard(pDoc->GetIDocumentUndoRedo()); // 1. Footnotes ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-7-0' - sw/source
sw/source/core/layout/frmtool.cxx | 11 +++ 1 file changed, 11 insertions(+) New commits: commit 9f18678432086ccf659bd9d4cbadc7e09f800897 Author: Michael Stahl AuthorDate: Tue Aug 11 17:54:09 2020 +0200 Commit: Caolán McNamara CommitDate: Mon Aug 17 10:35:55 2020 +0200 tdf#134746 sw: fix redline hiding of at-char fly on empty paragraphs If a merged paragraph has no extents, a fly anchored at the start or at the end should be shown. (regression from 28b77c89dfcafae82cf2a6d85731b643ff9290e5) Change-Id: I78135f3c033cf08aad81c86b0ac693528e3f3f8e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100543 Tested-by: Jenkins Reviewed-by: Michael Stahl (cherry picked from commit f3cb59c46398b3a0646b8b374d5626f715fa6884) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100702 Reviewed-by: Caolán McNamara diff --git a/sw/source/core/layout/frmtool.cxx b/sw/source/core/layout/frmtool.cxx index 15e1d71eb7e8..22217f5c0655 100644 --- a/sw/source/core/layout/frmtool.cxx +++ b/sw/source/core/layout/frmtool.cxx @@ -1274,6 +1274,17 @@ bool IsAnchoredObjShown(SwTextFrame const& rFrame, SwFormatAnchor const& rAnchor ret = false; auto const pAnchor(rAnchor.GetContentAnchor()); auto iterFirst(pMergedPara->extents.cbegin()); +if (iterFirst == pMergedPara->extents.end() +&& (rAnchor.GetAnchorId() == RndStdIds::FLY_AT_PARA +|| rAnchor.GetAnchorId() == RndStdIds::FLY_AT_CHAR)) +{ +ret = (>nNode.GetNode() == pMergedPara->pFirstNode +&& (rAnchor.GetAnchorId() == RndStdIds::FLY_AT_PARA +|| pAnchor->nContent == 0)) +|| (>nNode.GetNode() == pMergedPara->pLastNode +&& (rAnchor.GetAnchorId() == RndStdIds::FLY_AT_PARA +|| pAnchor->nContent == pMergedPara->pLastNode->Len())); +} auto iter(iterFirst); SwTextNode const* pNode(pMergedPara->pFirstNode); for ( ; ; ++iter) ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-7-0' - sw/source
sw/source/filter/ww8/wrtw8nds.cxx | 24 +++- 1 file changed, 23 insertions(+), 1 deletion(-) New commits: commit f8837995fab0a37e514fda53dd6c9cbcf34e5e6c Author: Michael Stahl AuthorDate: Wed Aug 12 17:07:18 2020 +0200 Commit: Caolán McNamara CommitDate: Fri Aug 14 20:24:23 2020 +0200 sw: MS Word export: don't insert section breaks in field instructions MSWordExportBase::NeedTextNodeSplit() simply uses the soft-page-break positions to potentially insert section breaks - but now that Writer can display field instructions, it's quite silly to insert section breaks inside them. Change-Id: Ie57e6281a0287aac36984e5467920852db19a8ad Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100661 Tested-by: Jenkins Reviewed-by: Michael Stahl (cherry picked from commit 68cc91cd2c461b7062c3f3b89b2c677e41c9a8d4) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100529 Reviewed-by: Caolán McNamara diff --git a/sw/source/filter/ww8/wrtw8nds.cxx b/sw/source/filter/ww8/wrtw8nds.cxx index 763e4669..b520279b7345 100644 --- a/sw/source/filter/ww8/wrtw8nds.cxx +++ b/sw/source/filter/ww8/wrtw8nds.cxx @@ -2162,7 +2162,29 @@ bool MSWordExportBase::NeedSectionBreak( const SwNode& rNd ) const bool MSWordExportBase::NeedTextNodeSplit( const SwTextNode& rNd, SwSoftPageBreakList& pList ) const { -rNd.fillSoftPageBreakList( pList ); +SwSoftPageBreakList tmp; +rNd.fillSoftPageBreakList(tmp); +// hack: move the break behind any field marks; currently we can't hide the +// field mark instruction so the layout position is quite meaningless +IDocumentMarkAccess const& rIDMA(*rNd.GetDoc()->getIDocumentMarkAccess()); +sal_Int32 pos(-1); +for (auto const& it : tmp) +{ +if (pos < it) // previous one might have skipped over it +{ +pos = it; +while (auto const*const pMark = rIDMA.getFieldmarkFor(SwPosition(const_cast(rNd), pos))) +{ +if (pMark->GetMarkEnd().nNode != rNd) +{ +pos = rNd.Len(); // skip everything +break; +} +pos = pMark->GetMarkEnd().nContent.GetIndex(); // no +1, it's behind the char +} +pList.insert(pos); +} +} pList.insert(0); pList.insert( rNd.GetText().getLength() ); return pList.size() > 2 && NeedSectionBreak( rNd ); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-7-0' - sw/source
sw/source/core/docnode/ndtbl.cxx |9 + 1 file changed, 9 insertions(+) New commits: commit 1bef764ac84d113a0bcb237a0634579ee8dccec0 Author: Caolán McNamara AuthorDate: Wed Aug 5 21:08:04 2020 +0100 Commit: Xisco Fauli CommitDate: Mon Aug 10 11:56:07 2020 +0200 tdf#135098 update SwTableCursor m_SelectedBoxes before merge so it does not contain the soon to-be-deleted SwTableBox so if the rPam is queried via a11y it doesn't claim the deleted cell still exists. tdf#122844 may be the same issue Change-Id: I1ac3752676162ba5a29c0916039b2b467e2ac41a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100213 Tested-by: Jenkins Reviewed-by: Xisco Fauli diff --git a/sw/source/core/docnode/ndtbl.cxx b/sw/source/core/docnode/ndtbl.cxx index 4d5469e8fdac..5dcbdf86575f 100644 --- a/sw/source/core/docnode/ndtbl.cxx +++ b/sw/source/core/docnode/ndtbl.cxx @@ -2285,6 +2285,15 @@ TableMergeErr SwDoc::MergeTable( SwPaM& rPam ) while( != ( pTmp = pTmp->GetNext() )) for( int i = 0; i < 2; ++i ) pTmp->GetBound( static_cast(i) ) = *rPam.GetPoint(); + +if (SwTableCursor* pTableCursor = dynamic_cast()) +{ +// tdf#135098 update selection so rPam's m_SelectedBoxes is updated +// to not contain the soon to-be-deleted SwTableBox so if the rPam +// is queried via a11y it doesn't claim the deleted cell still +// exists +pTableCursor->NewTableSelection(); +} } // Merge them ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-7-0' - sw/source
sw/source/uibase/sidebar/ThemePanel.cxx | 23 ++- 1 file changed, 14 insertions(+), 9 deletions(-) New commits: commit bfcb7d1ef8185739de3fae4940bf46b3fe0e754b Author: Caolán McNamara AuthorDate: Thu Aug 6 11:30:49 2020 +0100 Commit: Xisco Fauli CommitDate: Mon Aug 10 11:38:03 2020 +0200 tdf#135488 ensure something is selected in experimental theme colorset so double click without something selected can't normally happen, and bail out and do nothing if it does happen Change-Id: Ic9ed756d4b2b51b87f09786ab7b8506b2d720d84 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100217 Tested-by: Jenkins Reviewed-by: Xisco Fauli diff --git a/sw/source/uibase/sidebar/ThemePanel.cxx b/sw/source/uibase/sidebar/ThemePanel.cxx index 18abd157b71a..290ca4106fb3 100644 --- a/sw/source/uibase/sidebar/ThemePanel.cxx +++ b/sw/source/uibase/sidebar/ThemePanel.cxx @@ -444,6 +444,9 @@ ThemePanel::ThemePanel(vcl::Window* pParent, } mxValueSetColors->SetOptimalSize(); + +if (!aColorSets.empty()) +mxValueSetColors->SelectItem(1); // ItemId 1, position 0 } ThemePanel::~ThemePanel() @@ -480,17 +483,19 @@ IMPL_LINK_NOARG(ThemePanel, DoubleClickHdl, weld::TreeView&, bool) void ThemePanel::DoubleClickHdl() { SwDocShell* pDocSh = static_cast(SfxObjectShell::Current()); -if (pDocSh) -{ -OUString sEntryFonts = mxListBoxFonts->get_selected_text(); -sal_uInt32 nItemId = mxValueSetColors->GetSelectedItemId(); -sal_uInt32 nIndex = nItemId - 1; -OUString sEntryColors = maColorSets.getColorSet(nIndex).getName(); +if (!pDocSh) +return; -StyleSet aStyleSet = setupThemes(); +sal_uInt32 nItemId = mxValueSetColors->GetSelectedItemId(); +if (!nItemId) +return; +OUString sEntryFonts = mxListBoxFonts->get_selected_text(); +sal_uInt32 nIndex = nItemId - 1; +OUString sEntryColors = maColorSets.getColorSet(nIndex).getName(); -applyTheme(pDocSh->GetStyleSheetPool(), sEntryFonts, sEntryColors, aStyleSet, maColorSets); -} +StyleSet aStyleSet = setupThemes(); + +applyTheme(pDocSh->GetStyleSheetPool(), sEntryFonts, sEntryColors, aStyleSet, maColorSets); } void ThemePanel::NotifyItemUpdate(const sal_uInt16 /*nSId*/, ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-7-0' - sw/source
sw/source/core/doc/docfly.cxx| 28 +++ sw/source/core/layout/anchoreddrawobject.cxx |5 +++- 2 files changed, 32 insertions(+), 1 deletion(-) New commits: commit 0de435962fc2ffbbcf3dc4a9bac13894372dfd5e Author: Michael Stahl AuthorDate: Tue Aug 4 19:09:38 2020 +0200 Commit: Thorsten Behrens CommitDate: Fri Aug 7 00:40:51 2020 +0200 tdf#135464 sw: avoid invalid combinations of HoriOrientRelation and FLY_AT_PAGE ... when using Anchor->To Page context menu. For shapes, in SwDoc::ChgAnchor() and for sw flys in SwDoc::SetFlyFrameAnchor(). Change-Id: I7d747b2558ef69df99636ea0fb0409deb461a79a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100131 Tested-by: Jenkins Reviewed-by: Michael Stahl (cherry picked from commit 1de2b0d3234462b488db54d36ebc17e2b579b0f0) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100215 Reviewed-by: Thorsten Behrens diff --git a/sw/source/core/doc/docfly.cxx b/sw/source/core/doc/docfly.cxx index ad65549c6fa1..e435920da879 100644 --- a/sw/source/core/doc/docfly.cxx +++ b/sw/source/core/doc/docfly.cxx @@ -373,6 +373,7 @@ sal_Int8 SwDoc::SetFlyFrameAnchor( SwFrameFormat& rFormat, SfxItemSet& rSet, boo pItem = nullptr; SwFormatHoriOrient aOldH( rFormat.GetHoriOrient() ); +bool bPutOldH(false); if( text::HoriOrientation::NONE == aOldH.GetHoriOrient() && ( !pItem || aOldH.GetPos() == static_cast(pItem)->GetPos() )) @@ -387,6 +388,22 @@ sal_Int8 SwDoc::SetFlyFrameAnchor( SwFrameFormat& rFormat, SfxItemSet& rSet, boo aOldH.SetRelationOrient( pH->GetRelationOrient() ); } aOldH.SetPos( nPos ); +bPutOldH = true; +} +if (nNew == RndStdIds::FLY_AT_PAGE) +{ +sal_Int16 nRelOrient(pItem +? static_cast(pItem)->GetRelationOrient() +: aOldH.GetRelationOrient()); +if (sw::GetAtPageRelOrientation(nRelOrient, false)) +{ +SAL_INFO("sw.ui", "fixing horizontal RelOrientation for at-page anchor"); +aOldH.SetRelationOrient(nRelOrient); +bPutOldH = true; +} +} +if (bPutOldH) +{ rSet.Put( aOldH ); } @@ -916,6 +933,17 @@ bool SwDoc::ChgAnchor( const SdrMarkList& _rMrkList, // of attributes (method call ) takes care of the // invalidation of the object position. SetAttr( aNewAnch, *pContact->GetFormat() ); +if (aNewAnch.GetAnchorId() == RndStdIds::FLY_AT_PAGE) +{ +SwFormatHoriOrient item(pContact->GetFormat()->GetHoriOrient()); +sal_Int16 nRelOrient(item.GetRelationOrient()); +if (sw::GetAtPageRelOrientation(nRelOrient, false)) +{ +SAL_INFO("sw.ui", "fixing horizontal RelOrientation for at-page anchor"); + item.SetRelationOrient(text::RelOrientation::PAGE_FRAME); +SetAttr(item, *pContact->GetFormat()); +} +} if ( _bPosCorr ) { // #i33313# - consider not connected 'virtual' drawing diff --git a/sw/source/core/layout/anchoreddrawobject.cxx b/sw/source/core/layout/anchoreddrawobject.cxx index 1af32ed2fa80..d3be5402febf 100644 --- a/sw/source/core/layout/anchoreddrawobject.cxx +++ b/sw/source/core/layout/anchoreddrawobject.cxx @@ -776,7 +776,10 @@ void SwAnchoredDrawObject::AdjustPositioningAttr( const SwFrame* _pNewAnchorFram nVertRelPos = aObjRect.Top() - aAnchorPos.Y(); } -GetFrameFormat().SetFormatAttr( SwFormatHoriOrient( nHoriRelPos, text::HoriOrientation::NONE, text::RelOrientation::FRAME ) ); +GetFrameFormat().SetFormatAttr( SwFormatHoriOrient( nHoriRelPos, text::HoriOrientation::NONE, +GetFrameFormat().GetAnchor().GetAnchorId() == RndStdIds::FLY_AT_PAGE +? text::RelOrientation::PAGE_FRAME +: text::RelOrientation::FRAME ) ); GetFrameFormat().SetFormatAttr( SwFormatVertOrient( nVertRelPos, text::VertOrientation::NONE, text::RelOrientation::FRAME ) ); } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-7-0' - sw/source
sw/source/core/doc/docdesc.cxx |8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) New commits: commit ae3fb60f749066aa69dd1c32d2d963562a93eabb Author: Michael Stahl AuthorDate: Tue Aug 4 12:26:23 2020 +0200 Commit: Xisco Fauli CommitDate: Wed Aug 5 15:10:50 2020 +0200 tdf#135144 sw: copy bookmarks in SwDoc::CopyMasterHeader() ... and SwDoc::CopyMasterFooter(); this is the same as commit 9f7ee38acec0cb614e37aecc5ea9c5f1c63b61b6 but for 2 other functions that do the same thing. Change-Id: Id7ed449a004ee3c9452d4603bf8632e2720651ed Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100077 Tested-by: Jenkins Reviewed-by: Michael Stahl (cherry picked from commit af38654b4b8388f0a0236601742b7ab3d1590ae8) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100058 Reviewed-by: Xisco Fauli diff --git a/sw/source/core/doc/docdesc.cxx b/sw/source/core/doc/docdesc.cxx index 036185e88d7d..51dc930f06d9 100644 --- a/sw/source/core/doc/docdesc.cxx +++ b/sw/source/core/doc/docdesc.cxx @@ -293,7 +293,9 @@ void SwDoc::CopyMasterHeader(const SwPageDesc , const SwFormatHeader GetNodes().Copy_( aRange, aTmp, false ); aTmp = *pSttNd; GetDocumentContentOperationsManager().CopyFlyInFlyImpl(aRange, nullptr, aTmp); - +SwPaM const source(aRange.aStart, aRange.aEnd); +SwPosition dest(aTmp); +sw::CopyBookmarks(source, dest); pFormat->SetFormatAttr( SwFormatContent( pSttNd ) ); rDescFrameFormat.SetFormatAttr( SwFormatHeader( pFormat ) ); } @@ -365,7 +367,9 @@ void SwDoc::CopyMasterFooter(const SwPageDesc , const SwFormatFooter GetNodes().Copy_( aRange, aTmp, false ); aTmp = *pSttNd; GetDocumentContentOperationsManager().CopyFlyInFlyImpl(aRange, nullptr, aTmp); - +SwPaM const source(aRange.aStart, aRange.aEnd); +SwPosition dest(aTmp); +sw::CopyBookmarks(source, dest); pFormat->SetFormatAttr( SwFormatContent( pSttNd ) ); rDescFrameFormat.SetFormatAttr( SwFormatFooter( pFormat ) ); } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-7-0' - sw/source
sw/source/filter/ww8/docxexport.cxx | 26 +++--- 1 file changed, 7 insertions(+), 19 deletions(-) New commits: commit 2a755d748aecd65d1a3d0c2685678a85472481cd Author: Balazs Varga AuthorDate: Tue Jul 21 16:23:29 2020 +0200 Commit: Xisco Fauli CommitDate: Tue Aug 4 09:25:06 2020 +0200 tdf#131288 Chart: fix export of embedded xlsx To avoid exporting a broken DOCX, we have to seek the 'embeddingsStream', so we avoid to export an empty (0 Kb) embedded xlsx. Co-authored-by: Balázs Regényi Change-Id: I1723091aab3e2070f3db75ce866897e38021718d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99151 Reviewed-by: Mike Kaganski Tested-by: Jenkins (cherry picked from commit b115d4899d827f885f7d35ced4cb64d2385e3422) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99926 Reviewed-by: Xisco Fauli diff --git a/sw/source/filter/ww8/docxexport.cxx b/sw/source/filter/ww8/docxexport.cxx index 5e9dcc6718e3..849c987845cc 100644 --- a/sw/source/filter/ww8/docxexport.cxx +++ b/sw/source/filter/ww8/docxexport.cxx @@ -33,6 +33,7 @@ #include #include #include +#include #include #include #include @@ -426,7 +427,7 @@ OString DocxExport::WriteOLEObject(SwOLEObj& rObject, OUString & io_rProgID) try { -::comphelper::OStorageHelper::CopyInputToOutput(xInStream, xOutStream); +comphelper::OStorageHelper::CopyInputToOutput(xInStream, xOutStream); } catch (uno::Exception const&) { @@ -1596,24 +1597,11 @@ void DocxExport::WriteEmbeddings() contentType); try { -sal_Int32 nBufferSize = 512; -uno::Sequence< sal_Int8 > aDataBuffer(nBufferSize); -sal_Int32 nRead; -do -{ -nRead = embeddingsStream->readBytes( aDataBuffer, nBufferSize ); -if( nRead ) -{ -if( nRead < nBufferSize ) -{ -nBufferSize = nRead; -aDataBuffer.realloc(nRead); -} -xOutStream->writeBytes( aDataBuffer ); -} -} -while( nRead ); -xOutStream->flush(); +// tdf#131288: the stream must be seekable for direct access +uno::Reference< io::XSeekable > xSeekable(embeddingsStream, uno::UNO_QUERY); +if (xSeekable) +xSeekable->seek(0); // tdf#131288: a previous save could position it elsewhere + comphelper::OStorageHelper::CopyInputToOutput(embeddingsStream, xOutStream); } catch(const uno::Exception&) { ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-7-0' - sw/source
sw/source/core/access/acccell.cxx |3 +++ 1 file changed, 3 insertions(+) New commits: commit 48f48eea8a57d0da9defae77d9fc51dfe84bcfca Author: Caolán McNamara AuthorDate: Sun Aug 2 15:23:54 2020 +0100 Commit: Adolfo Jayme Barrientos CommitDate: Mon Aug 3 06:37:59 2020 +0200 tdf#135098 assert/crash on checking IsSelected on cell being disposed Change-Id: I32ce9fcca86de4608939d385f42c43afc46bfb7d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99956 Tested-by: Jenkins Reviewed-by: Caolán McNamara (cherry picked from commit 9445a5633b167c84eb96c515f3ae765ab427442a) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99915 Reviewed-by: Adolfo Jayme Barrientos diff --git a/sw/source/core/access/acccell.cxx b/sw/source/core/access/acccell.cxx index f7d689a62980..ee533636e29d 100644 --- a/sw/source/core/access/acccell.cxx +++ b/sw/source/core/access/acccell.cxx @@ -86,6 +86,9 @@ void SwAccessibleCell::GetStates( ::utl::AccessibleStateSetHelper& rStateSet ) //Add resizable state to table cell. rStateSet.AddState( AccessibleStateType::RESIZABLE ); +if (IsDisposing()) // tdf#135098 +return; + // SELECTED if( IsSelected() ) { ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-7-0' - sw/source
sw/source/core/layout/tabfrm.cxx |1 + 1 file changed, 1 insertion(+) New commits: commit 2d681cd9433c5e68cdb24c00128fe1153c278fce Author: Michael Stahl AuthorDate: Fri Jul 31 14:46:13 2020 +0200 Commit: Thorsten Behrens CommitDate: Sun Aug 2 00:05:44 2020 +0200 tdf#134965 sw: avoid RemoveFollowFlowLine() SNAFU A follow-flow-line SwRowFrame is deleted in RemoveFollowFlowLine() while it is being iterated in stack frame #18. 0 SwRowFrame::~SwRowFrame() (this=0xaa035b0, __in_chrg=) at sw/source/core/layout/tabfrm.cxx:3807 1 SwFrame::DestroyFrame(SwFrame*) (pFrame=0xaa035b0) at sw/source/core/layout/ssfrm.cxx:389 2 SwTabFrame::RemoveFollowFlowLine() (this=0x9c16790) at sw/source/core/layout/tabfrm.cxx:945 3 SwTabFrame::MakeAll(OutputDevice*) (this=0x9c16790, pRenderContext=0x72afaf0) at sw/source/core/layout/tabfrm.cxx:2203 4 SwFrame::PrepareMake(OutputDevice*) (this=0x9c16790, pRenderContext=0x72afaf0) at sw/source/core/layout/calcmove.cxx:370 5 SwFrame::Calc(OutputDevice*) const (this=0x9c16790, pRenderContext=0x72afaf0) at sw/source/core/layout/trvlfrm.cxx:1791 6 SwFrame::PrepareMake(OutputDevice*) (this=0x925b740, pRenderContext=0x72afaf0) at sw/source/core/layout/calcmove.cxx:248 7 SwFrame::Calc(OutputDevice*) const (this=0x925b740, pRenderContext=0x72afaf0) at sw/source/core/layout/trvlfrm.cxx:1791 8 SwFrame::PrepareMake(OutputDevice*) (this=0x925b8e0, pRenderContext=0x72afaf0) at sw/source/core/layout/calcmove.cxx:248 9 SwFrame::Calc(OutputDevice*) const (this=0x925b8e0, pRenderContext=0x72afaf0) at sw/source/core/layout/trvlfrm.cxx:1791 10 SwFrame::PrepareMake(OutputDevice*) (this=0x925ba70, pRenderContext=0x72afaf0) at sw/source/core/layout/calcmove.cxx:248 11 SwFrame::Calc(OutputDevice*) const (this=0x925ba70, pRenderContext=0x72afaf0) at sw/source/core/layout/trvlfrm.cxx:1791 12 SwFrame::MakePos() (this=0x925bc20) at sw/source/core/layout/calcmove.cxx:552 13 SwTextFrame::MakePos() (this=0x925bc20) at sw/source/core/text/frmform.cxx:339 14 SwContentFrame::MakeAll(OutputDevice*) (this=0x925bc20) at sw/source/core/layout/calcmove.cxx:1408 15 SwFrame::PrepareMake(OutputDevice*) (this=0x925bc20, pRenderContext=0x72afaf0) at sw/source/core/layout/calcmove.cxx:370 16 SwFrame::Calc(OutputDevice*) const (this=0x925bc20, pRenderContext=0x72afaf0) at sw/source/core/layout/trvlfrm.cxx:1791 17 SwContentFrame::CalcLowers(SwLayoutFrame&, SwLayoutFrame const&, long, bool) (rLay=..., rDontLeave=..., nBottom=168478, bSkipRowSpanCells=true) at sw/source/core/layout/tabfrm.cxx:1521 18 lcl_RecalcRow(SwRowFrame&, long) (rRow=..., nBottom=168478) at sw/source/core/layout/tabfrm.cxx:1651 19 SwTabFrame::MakeAll(OutputDevice*) (this=0x93ec7e0, pRenderContext=0x72afaf0) at sw/source/core/layout/tabfrm.cxx:2421 20 SwFrame::PrepareMake(OutputDevice*) (this=0x3df3cc0, pRenderContext=0x72afaf0) at sw/source/core/layout/calcmove.cxx:316 21 SwFrame::Calc(OutputDevice*) const (this=0x3df3cc0, pRenderContext=0x72afaf0) at sw/source/core/layout/trvlfrm.cxx:1791 22 GetFrameOfModify(SwRootFrame const*, SwModify const&, SwFrameType, SwPosition const*, std::pair const*) (pLayout=0x72aa850, rMod=..., nFrameType=(SwFrameType::Txt | SwFrameType::NoTxt), pPos=0x71f35e0, pViewPosAndCalcFrame=0x7ffc99f591a0) at sw/source/core/layout/frmtool.cxx:3697 23 SwContentNode::getLayoutFrame(SwRootFrame const*, SwPosition const*, std::pair const*) const (this=0x6fcfb50, _pRoot=0x72aa850, pPos=0x71f35e0, pViewPosAndCalcFrame=0x7ffc99f591a0) at sw/source/core/docnode/node.cxx:1194 24 SwCursorShell::GetCurrFrame(bool) const (this=0x72a9730, bCalcFrame=true) at sw/source/core/crsr/crsrsh.cxx:2455 25 SwFEShell::GetAnyCurRect(CurRectType, Point const*, com::sun::star::uno::Reference const&) const (this=0x72a9730, eType=CurRectType::PageCalc, pPt=0x0, xObj=empty uno::Reference) at sw/source/core/frmedt/fews.cxx:113 26 SwView::StateStatusLine(SfxItemSet&) (this=0x72af430, rSet=SfxItemSet of pool 0x6fa3d50 with parent 0x0 and Which ranges: [(1, 1), (10221, 10221), (10223, 10225), (11064, 11065), (21182, 21182), (21185, 21185), (21189, 21189)] = {...}) at sw/source/uibase/uiview/view2.cxx:1517 Not obvious why this changed with calling MakeFrames() instead of SwNodes::CopyNodes(bNewFrames=true) or how to best prevent it; adding another FrameDeleteGuard avoids the crash at least. (regression from 166b5010b402a41b192b1659093a25acf9065fd9) Change-Id: Ifd5a0c93064c9536429dda30a2c4ebc7a31b7e7d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99870 Tested-by: Jenkins Reviewed-by: Michael Stahl (cherry picked from commit aed92491f356b008fe1cd25b5cd6cc43279db3a3) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99847 Reviewed-by: Thorsten Behrens diff --git a/sw/source/core/layout/tabfrm.cxx
[Libreoffice-commits] core.git: Branch 'libreoffice-7-0' - sw/source
sw/source/core/layout/frmtool.cxx |4 1 file changed, 4 insertions(+) New commits: commit 31f083b483c2932dff515dfdef7f330c6142a485 Author: Michael Stahl AuthorDate: Fri Jul 31 13:32:29 2020 +0200 Commit: Thorsten Behrens CommitDate: Sun Aug 2 00:03:39 2020 +0200 tdf#134931 sw_redlinehide: fix layout following paste of table The pasted table does get a SwTabFrame but the problem is that TurboAction() is called and formats the pre-existing SwTextFrame and somehow that just sets all the valid flags on the new SwTabFrame without doing any formatting. Previously, SwNodes::CopyNodes(bNewFrames=true) would call SwTabFrame::Paste() which invalidates the page. In InsertCnt_(), for new SwSectionFrames InvalidatePage() is already called so do the same for SwTabFrame which gets rid of the "turbo". (regression from 166b5010b402a41b192b1659093a25acf9065fd9) Change-Id: I970a04bd8e76f5418bddb66af915ac466f44daf3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99867 Tested-by: Jenkins Reviewed-by: Michael Stahl (cherry picked from commit 5f7b937e9f81824f11022bc6b4dd222f700883cd) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99844 Reviewed-by: Thorsten Behrens diff --git a/sw/source/core/layout/frmtool.cxx b/sw/source/core/layout/frmtool.cxx index 05ab000c359c..15e1d71eb7e8 100644 --- a/sw/source/core/layout/frmtool.cxx +++ b/sw/source/core/layout/frmtool.cxx @@ -1615,6 +1615,10 @@ void InsertCnt_( SwLayoutFrame *pLay, SwDoc *pDoc, pPageMaker->CheckInsert( nIndex ); pFrame->InsertBehind( pLay, pPrv ); +if (pPage) // would null in SwCellFrame ctor +{ // tdf#134931 call ResetTurbo(); not sure if Paste() would be +pFrame->InvalidatePage(pPage); // better than InsertBehind()? +} // #i27138# // notify accessibility paragraphs objects about changed // CONTENT_FLOWS_FROM/_TO relation. ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-7-0' - sw/source
sw/source/core/doc/DocumentContentOperationsManager.cxx |9 - 1 file changed, 8 insertions(+), 1 deletion(-) New commits: commit 6319847c3ec3facea6aaeaf065337f2592511b67 Author: Michael Stahl AuthorDate: Tue Jul 28 19:03:24 2020 +0200 Commit: Caolán McNamara CommitDate: Thu Jul 30 21:25:01 2020 +0200 tdf#134250 sw_redlinehide: fix copy non-empty node before non-textnode The problem in CopyImplImpl() is that pCopyPam's end position was updated to index 0 but text was copied into the node, which is thus not covered by pCopyPam and thus also not by SwUndoInserts. Then SwUndoInserts::UndoImpl() doesn't delete the bookmarks in the end node and the bookmark positions cause ~SwIndexReg asserts. Change-Id: I4cc03e846eae4cabd9eb4346a98c1e5c2866050d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99643 Tested-by: Jenkins Reviewed-by: Michael Stahl (cherry picked from commit 8ec8da5638ab465e69900a08067ad496bcb5d3d5) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99771 Reviewed-by: Caolán McNamara diff --git a/sw/source/core/doc/DocumentContentOperationsManager.cxx b/sw/source/core/doc/DocumentContentOperationsManager.cxx index f19c8f6c3e03..d8c2c0cd8796 100644 --- a/sw/source/core/doc/DocumentContentOperationsManager.cxx +++ b/sw/source/core/doc/DocumentContentOperationsManager.cxx @@ -5062,7 +5062,14 @@ bool DocumentContentOperationsManager::CopyImplImpl(SwPaM& rPam, SwPosition& rPo if( rPos.nNode != aInsPos ) { pCopyPam->GetMark()->nNode = aInsPos; -pCopyPam->GetMark()->nContent.Assign(pCopyPam->GetContentNode(false), 0); +if (aInsPos < rPos.nNode) +{ // tdf#134250 decremented in (pEndTextNd && !pDestTextNd) above + pCopyPam->GetContentNode(false)->MakeEndIndex(>GetMark()->nContent); +} +else // incremented in (!pSttTextNd && pDestTextNd) above +{ + pCopyPam->GetMark()->nContent.Assign(pCopyPam->GetContentNode(false), 0); +} rPos = *pCopyPam->GetMark(); } else ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-7-0' - sw/source
sw/source/core/layout/trvlfrm.cxx | 61 +++--- 1 file changed, 31 insertions(+), 30 deletions(-) New commits: commit bdb4638074e8baf9f765194d98fa8dc41de6a976 Author: Michael Stahl AuthorDate: Wed Jul 29 14:55:49 2020 +0200 Commit: Caolán McNamara CommitDate: Thu Jul 30 21:23:08 2020 +0200 (related: tdf#134252) sw: fix assert when moving mouse pointer SwPageFrame::GetModelPositionForViewPoint() was calling GetCharRect() on a frame that doesn't match the passed prevTextPos; it was supposed to be initialised by GetModelPositionForViewPoint() call but that didn't work because the point was outside the frame so nothing was inited. (regression from edd2db1c783bd571ff796a5298385cacc91877b9) Change-Id: Ic064c3efc1b7f29d18d713206e5ea5ac0b67fbc8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99692 Tested-by: Jenkins Reviewed-by: Michael Stahl (cherry picked from commit 63308aa3b109271ffb4fd47e9fea2e3281a1552d) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99737 Reviewed-by: Caolán McNamara diff --git a/sw/source/core/layout/trvlfrm.cxx b/sw/source/core/layout/trvlfrm.cxx index c7de73e4e0e7..7ec33dcea85c 100644 --- a/sw/source/core/layout/trvlfrm.cxx +++ b/sw/source/core/layout/trvlfrm.cxx @@ -292,42 +292,43 @@ bool SwPageFrame::GetModelPositionForViewPoint( SwPosition *pPos, Point , comphelper::FlagRestorationGuard g( pState->m_bPosMatchesBounds, true); SwPosition prevTextPos(*pPos); -SwLayoutFrame::GetModelPositionForViewPoint(, aPoint, pState); - -SwRect aTextRect; -pTextFrame->GetCharRect(aTextRect, prevTextPos); - -if (prevTextPos.nContent < pContentNode->Len()) +if (SwLayoutFrame::GetModelPositionForViewPoint(, aPoint, pState)) { -// aRextRect is just a line on the left edge of the -// previous character; to get a better measure from -// lcl_getDistance, extend that to a rectangle over -// the entire character. -SwPosition const nextTextPos(prevTextPos.nNode, -SwIndex(prevTextPos.nContent, +1)); -SwRect nextTextRect; -pTextFrame->GetCharRect(nextTextRect, nextTextPos); -SwRectFnSet aRectFnSet(pTextFrame); -if (aRectFnSet.GetTop(aTextRect) == -aRectFnSet.GetTop(nextTextRect)) // same line? +SwRect aTextRect; +pTextFrame->GetCharRect(aTextRect, prevTextPos); + +if (prevTextPos.nContent < pContentNode->Len()) { -// need to handle mixed RTL/LTR portions somehow -if (aRectFnSet.GetLeft(aTextRect) < -aRectFnSet.GetLeft(nextTextRect)) +// aRextRect is just a line on the left edge of the +// previous character; to get a better measure from +// lcl_getDistance, extend that to a rectangle over +// the entire character. +SwPosition const nextTextPos(prevTextPos.nNode, +SwIndex(prevTextPos.nContent, +1)); +SwRect nextTextRect; +pTextFrame->GetCharRect(nextTextRect, nextTextPos); +SwRectFnSet aRectFnSet(pTextFrame); +if (aRectFnSet.GetTop(aTextRect) == +aRectFnSet.GetTop(nextTextRect)) // same line? { -aRectFnSet.SetRight( aTextRect, -aRectFnSet.GetLeft(nextTextRect)); -} -else // RTL -{ -aRectFnSet.SetLeft( aTextRect, -aRectFnSet.GetLeft(nextTextRect)); +// need to handle mixed RTL/LTR portions somehow +if (aRectFnSet.GetLeft(aTextRect) < +aRectFnSet.GetLeft(nextTextRect)) +{ +aRectFnSet.SetRight( aTextRect, +aRectFnSet.GetLeft(nextTextRect)); +} +else // RTL +{ +aRectFnSet.SetLeft( aTextRect, +aRectFnSet.GetLeft(nextTextRect)); +} } } -} -nTextDistance = lcl_getDistance(aTextRect, rPoint); -bValidTextDistance = true; +
[Libreoffice-commits] core.git: Branch 'libreoffice-7-0' - sw/source
sw/source/core/text/txtfrm.cxx |5 + 1 file changed, 5 insertions(+) New commits: commit 3afb71ee89f450217cbe232d636f40f10d425198 Author: Michael Stahl AuthorDate: Mon Jul 27 18:12:19 2020 +0200 Commit: Xisco Fauli CommitDate: Tue Jul 28 22:10:04 2020 +0200 tdf#133967 sw_redlinehide: fix assert on undo-redo-undo Assertion `pNode->GetRedlineMergeFlag() != SwNode::Merge::Hidden' failed. 4 IsAnchoredObjShown(SwTextFrame const&, SwFormatAnchor const&) (rFrame=..., rAnchor=...) at sw/source/core/layout/frmtool.cxx:1284 5 SwFlyFrameFormat::MakeFrames() (this=0x7a97860) at sw/source/core/layout/atrfrm.cxx:3001 6 AppendAllObjs(SwFrameFormats const*, SwFrame const*) (pTable=0x72457e0, pSib=0x4002800) at sw/source/core/layout/frmtool.cxx:1337 7 InsertCnt_(SwLayoutFrame*, SwDoc*, unsigned long, bool, unsigned long, SwFrame*, sw::FrameMode) (pLay=0x8e86ce0, pDoc=0x7242220, nIndex=854, bPages=true, nEndIndex=854, pPrv=0x7a79850, eMode=sw::FrameMode::Existing) at sw/source/core/layout/frmtool.cxx:1892 8 MakeFrames(SwDoc*, SwNodeIndex const&, SwNodeIndex const&) (pDoc=0x7242220, rSttIdx=SwNodeIndex (node 372), rEndIdx=SwNodeIndex (node 854)) at sw/source/core/layout/frmtool.cxx:2055 9 sw::UpdateFramesForRemoveDeleteRedline(SwDoc&, SwPaM const&) (rDoc=..., rPam=SwPaM = {...}) at sw/source/core/doc/DocumentRedlineManager.cxx:292 because this added an extent for the node but it still had its flag set to Hidden: 11 sw::UpdateMergedParaForInsert(sw::MergedPara&, bool, SwTextNode const&, sal_Int32, sal_Int32) (rMerged=..., isRealInsert=false, rNode=..., nIndex=0, nLen=279) at sw/source/core/text/txtfrm.cxx:1002 12 SwTextFrame::SwClientNotify(SwModify const&, SfxHint const&) (this=0x7337940, rModify=..., rHint=...) at sw/source/core/text/txtfrm.cxx:2076 17 SwRangeRedline::InvalidateRange(SwRangeRedline::Invalidation) (this=0x8b3a120, eWhy=SwRangeRedline::Invalidation::Remove) at sw/source/core/doc/docredln.cxx:1261 18 sw::DocumentRedlineManager::DeleteRedline(SwPaM const&, bool, RedlineType) (this=0x7250b60, rRange=SwPaM = {...}, bSaveInUndo=true, nDelType=-1) at sw/source/core/doc/DocumentRedlineManager.cxx:2386 19 SwUndoRedlineDelete::UndoRedlineImpl(SwDoc&, SwPaM&) (this=0x8a65a00, rDoc=..., rPam=SwPaM = {...}) at sw/source/core/undo/unredln.cxx:198 Change-Id: I7f36705f1abb2df97a00b359e40534aef0e10d93 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99524 Tested-by: Jenkins Reviewed-by: Michael Stahl (cherry picked from commit b33034e7faee2cb8a602ed3342803bf731da8a8b) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99582 Reviewed-by: Xisco Fauli diff --git a/sw/source/core/text/txtfrm.cxx b/sw/source/core/text/txtfrm.cxx index 6b6771ad93d9..6445b593e5f8 100644 --- a/sw/source/core/text/txtfrm.cxx +++ b/sw/source/core/text/txtfrm.cxx @@ -1009,6 +1009,11 @@ static TextFrameIndex UpdateMergedParaForInsert(MergedPara & rMerged, rMerged.pParaPropsNode = _cast(rNode); rMerged.pParaPropsNode->AddToListRLHidden(); } +// called from SwRangeRedline::InvalidateRange() +if (rNode.GetRedlineMergeFlag() == SwNode::Merge::Hidden) +{ + const_cast(rNode).SetRedlineMergeFlag(SwNode::Merge::NonFirst); +} } rMerged.mergedText = text.makeStringAndClear(); return TextFrameIndex(nInserted); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-7-0' - sw/source
sw/source/core/layout/frmtool.cxx |2 ++ 1 file changed, 2 insertions(+) New commits: commit bf69a8761bf5595aa3db6dc18c34352f2d00412c Author: Michael Stahl AuthorDate: Mon Jul 27 18:11:30 2020 +0200 Commit: Xisco Fauli CommitDate: Tue Jul 28 22:09:38 2020 +0200 tdf#133967 sw_redlinehide: delete existing MergedPara before ... creating new one in RecreateStartTextFrames(). This was causing a problem with duplicate call of AddToListRLHidden() on a node that was already added by the existing MergedPara; logically the add would need to be reverted when the existing MergedPara dies, but there's no count on it, so the safe way to fix this is to delete existing MergedPara first. This was on node 1083 in the bugdoc. Change-Id: I1fec613829b3b12e3846fc4b195559d9a6079560 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99523 Tested-by: Jenkins Reviewed-by: Michael Stahl (cherry picked from commit c363568fcedb6b7b425b735614db0600a0362ead) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99581 Reviewed-by: Xisco Fauli diff --git a/sw/source/core/layout/frmtool.cxx b/sw/source/core/layout/frmtool.cxx index 7cea094eb270..05ab000c359c 100644 --- a/sw/source/core/layout/frmtool.cxx +++ b/sw/source/core/layout/frmtool.cxx @@ -1379,6 +1379,8 @@ void RecreateStartTextFrames(SwTextNode & rNode) ? *pFrame->GetMergedPara()->pFirstNode : rNode); assert(rFirstNode.GetIndex() <= rNode.GetIndex()); +// clear old one first to avoid DelFrames confusing updates & asserts... +pFrame->SetMergedPara(nullptr); pFrame->SetMergedPara(sw::CheckParaRedlineMerge( *pFrame, rFirstNode, eMode)); eMode = sw::FrameMode::New; // Existing is not idempotent! ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-7-0' - sw/source
sw/source/core/doc/DocumentRedlineManager.cxx | 148 +- 1 file changed, 97 insertions(+), 51 deletions(-) New commits: commit 49d1ef7907f5a7a0934fbfa03318ddc6d3ad69b8 Author: Michael Stahl AuthorDate: Fri Jul 24 19:41:29 2020 +0200 Commit: Xisco Fauli CommitDate: Tue Jul 28 22:08:53 2020 +0200 tdf#133967 sw_redlinehide: fix redline deletion of table containing redlines A delete redline is created from node 371 to node 1625; there are existing redlines in the range, so AppendRedline() splits the new redline into pieces between and on the existing redlines. Even worse, because some of the existing redlines are in a table, InsertWithValidRanges() then splits the pieces that overlap the table into even smaller pieces, such that there are now the table structural nodes that were in the initial new delete redline's range but are now covered by none of the pieces. This means that multiple merged text frames are created, with non-merged frames between them, and thus the functions UpdateFramesForAddDeleteRedline() and UpdateFramesForRemoveDeleteRedline() [for Undo] have to deal with this unexpected complication. (regression from sw_redlinehide) Change-Id: Ibf71c1deb2bc3fa2af16035954d5ef71b6827be5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99411 Tested-by: Jenkins Reviewed-by: Michael Stahl (cherry picked from commit 14e87a4b15d31a34e6053f6194688f3aa23af991) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99409 Reviewed-by: Xisco Fauli diff --git a/sw/source/core/doc/DocumentRedlineManager.cxx b/sw/source/core/doc/DocumentRedlineManager.cxx index 6996ad067aef..143e20e21005 100644 --- a/sw/source/core/doc/DocumentRedlineManager.cxx +++ b/sw/source/core/doc/DocumentRedlineManager.cxx @@ -159,31 +159,55 @@ void UpdateFramesForAddDeleteRedline(SwDoc & rDoc, SwPaM const& rPam) } else { -std::vector frames; -SwIterator aIter(*pStartNode); -for (SwTextFrame * pFrame = aIter.First(); pFrame; pFrame = aIter.Next()) +SwTextNode * pNode(pStartNode); +do { -if (pFrame->getRootFrame()->IsHideRedlines()) +std::vector frames; +SwIterator aIter(*pNode); +for (SwTextFrame * pFrame = aIter.First(); pFrame; pFrame = aIter.Next()) { -frames.push_back(pFrame); +if (pFrame->getRootFrame()->IsHideRedlines()) +{ +frames.push_back(pFrame); +} } +if (frames.empty()) +{ +auto const& layouts(rDoc.GetAllLayouts()); +assert(std::none_of(layouts.begin(), layouts.end(), +[](SwRootFrame const*const pLayout) { return pLayout->IsHideRedlines(); })); +(void) layouts; +break; +} +auto eMode(sw::FrameMode::Existing); +SwTextNode * pLast(pNode); +for (SwTextFrame * pFrame : frames) +{ +SwTextNode & rFirstNode(pFrame->GetMergedPara() +? *pFrame->GetMergedPara()->pFirstNode +: *pNode); +assert(pNode == pStartNode +? rFirstNode.GetIndex() <= pNode->GetIndex() +: == pNode); +// clear old one first to avoid DelFrames confusing updates & asserts... +pFrame->SetMergedPara(nullptr); +pFrame->SetMergedPara(sw::CheckParaRedlineMerge( +*pFrame, rFirstNode, eMode)); +eMode = sw::FrameMode::New; // Existing is not idempotent! +// the first node of the new redline is not necessarily the first +// node of the merged frame, there could be another redline nearby +sw::AddRemoveFlysAnchoredToFrameStartingAtNode(*pFrame, *pNode, nullptr); +// if redline is split across table and table cell is empty, there's no redline in the cell and so no merged para +if (pFrame->GetMergedPara()) +{ +pLast = const_cast(pFrame->GetMergedPara()->pLastNode); +} +} +SwNodeIndex tmp(*pLast); +// skip over hidden sections! +pNode = static_cast(pLast->GetNodes().GoNextSection(, /*bSkipHidden=*/true, /*bSkipProtect=*/false)); } -auto eMode(sw::FrameMode::Existing); -for (SwTextFrame * pFrame : frames) -{ -SwTextNode & rFirstNode(pFrame->GetMergedPara() -? *pFrame->GetMergedPara()->pFirstNode -: *pStartNode); -assert(rFirstNode.GetIndex() <= pStartNode->GetIndex()); -// clear old one first to avoid DelFrames confusing updates & asserts... -
[Libreoffice-commits] core.git: Branch 'libreoffice-7-0' - sw/source
sw/source/core/doc/DocumentRedlineManager.cxx | 22 -- sw/source/core/inc/UndoDelete.hxx |2 -- sw/source/core/undo/undel.cxx | 26 +++--- 3 files changed, 3 insertions(+), 47 deletions(-) New commits: commit 3c12f166f96f5f6472457b7fa63effb6a6c6d847 Author: Michael Stahl AuthorDate: Mon Jul 27 16:33:06 2020 +0200 Commit: Xisco Fauli CommitDate: Tue Jul 28 22:08:10 2020 +0200 Revert "tdf#132944 sw_redlinehide: delete of insert redline" This reverts commit ad0351b84926075297fb74abbe9b31a0455782af. It turns out that this conflicts with commit 14e87a4b15d31a34e6053f6194688f3aa23af991 "tdf#133967 sw_redlinehide: fix redline deletion of table containing redlines" but oddly enough that fix fixes tdf#132944 as well, but both commmits combined don't work e.g. on node 1083/1084 in the tdf#133967 bugdoc we got no text frame because SwUndoDelete has deleted it, but since it's not merged it would be left alone by the new fix anyway. This fix was quite hacky anyway, so just revert it. Change-Id: Id17f3575c742b8761a8458914a28ae8047360fff Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99522 Tested-by: Jenkins Reviewed-by: Michael Stahl (cherry picked from commit 4c9b292bb4ff3ad516dad37e2e0dd0ac8bbb4aa0) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99580 Reviewed-by: Xisco Fauli diff --git a/sw/source/core/doc/DocumentRedlineManager.cxx b/sw/source/core/doc/DocumentRedlineManager.cxx index c0e1aa6add8c..6996ad067aef 100644 --- a/sw/source/core/doc/DocumentRedlineManager.cxx +++ b/sw/source/core/doc/DocumentRedlineManager.cxx @@ -25,8 +25,6 @@ #include #include #include -#include -#include #include #include #include @@ -891,21 +889,6 @@ namespace static_cast(m_rRedline) = *m_pCursor; } }; - -auto UndoDeleteDisableFrames(SwDoc & rDoc) -> void -{ -// inside AppendRedline(), a SwUndoDelete was created; -// prevent it from creating duplicate layout frames on Undo -auto & rUndo(rDoc.GetUndoManager()); -if (rUndo.DoesUndo()) -{ -SwUndo *const pUndo(rUndo.GetLastUndo()); -assert(pUndo); -SwUndoDelete *const pUndoDel(dynamic_cast(pUndo)); -assert(pUndoDel); -pUndoDel->DisableMakeFrames(); // tdf#132944 -} -} } namespace sw @@ -1581,14 +1564,12 @@ DocumentRedlineManager::AppendRedline(SwRangeRedline* pNewRedl, bool const bCall } else m_rDoc.getIDocumentContentOperations().DeleteAndJoin( *pNewRedl ); -UndoDeleteDisableFrames(m_rDoc); // tdf#132944 bCompress = true; } if( !bCallDelete && !bDec && *pEnd == *pREnd ) { m_rDoc.getIDocumentContentOperations().DeleteAndJoin( *pNewRedl ); -UndoDeleteDisableFrames(m_rDoc); bCompress = true; } else if ( bCallDelete || !bDec ) @@ -1608,7 +1589,6 @@ DocumentRedlineManager::AppendRedline(SwRangeRedline* pNewRedl, bool const bCall { TemporaryRedlineUpdater const u(m_rDoc, *pNewRedl); m_rDoc.getIDocumentContentOperations().DeleteAndJoin( *pRedl ); -UndoDeleteDisableFrames(m_rDoc); n = 0; // re-initialize } delete pRedl; @@ -1633,7 +1613,6 @@ DocumentRedlineManager::AppendRedline(SwRangeRedline* pNewRedl, bool const bCall { TemporaryRedlineUpdater const u(m_rDoc, *pNewRedl); m_rDoc.getIDocumentContentOperations().DeleteAndJoin( aPam ); -UndoDeleteDisableFrames(m_rDoc); n = 0; // re-initialize } bDec = true; @@ -1656,7 +1635,6 @@ DocumentRedlineManager::AppendRedline(SwRangeRedline* pNewRedl, bool const bCall { TemporaryRedlineUpdater const u(m_rDoc, *pNewRedl); m_rDoc.getIDocumentContentOperations().DeleteAndJoin( aPam ); -UndoDeleteDisableFrames(m_rDoc); n = 0; // re-initialize bDec = true;
[Libreoffice-commits] core.git: Branch 'libreoffice-7-0' - sw/source
sw/source/core/doc/DocumentRedlineManager.cxx | 41 +- 1 file changed, 28 insertions(+), 13 deletions(-) New commits: commit 7e1deb190dcac5cf169e55989769551b326d454e Author: Michael Stahl AuthorDate: Wed Jul 22 13:24:15 2020 +0200 Commit: Xisco Fauli CommitDate: Tue Jul 28 22:07:17 2020 +0200 sw: fix AppendRedline() creating empty redlines for Outside This happens on tdf#133967 bugdoc with the Delete/Delete case first, in line 1445 - the start positions are equal, so the new redline is empty => DocumentRedlineManager.cxx:92: redline table corrupted: empty redline Similar bugs exist for Delete/Insert case in line 1725 and Format/? case in line 1892, the latter even checks a nonsensical condition *pEnd != *pRStt that is always true for Outside case. It's like that since inital CVS import. Change-Id: I7ade25380a5a43b14e87db37da8fc84267e89dd2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99389 Tested-by: Jenkins Reviewed-by: Michael Stahl (cherry picked from commit 632cc0507353c8a85e7438d6ef082bafb2a2137a) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99405 Reviewed-by: Xisco Fauli diff --git a/sw/source/core/doc/DocumentRedlineManager.cxx b/sw/source/core/doc/DocumentRedlineManager.cxx index 6bce5c1d9364..c0e1aa6add8c 100644 --- a/sw/source/core/doc/DocumentRedlineManager.cxx +++ b/sw/source/core/doc/DocumentRedlineManager.cxx @@ -1445,7 +1445,15 @@ DocumentRedlineManager::AppendRedline(SwRangeRedline* pNewRedl, bool const bCall { // Overlaps the current one completely, // split the new one -if( *pEnd != *pREnd ) +if (*pEnd == *pREnd) +{ +pNewRedl->SetEnd(*pRStt, pEnd); +} +else if (*pStt == *pRStt) +{ +pNewRedl->SetStart(*pREnd, pStt); +} +else { SwRangeRedline* pNew = new SwRangeRedline( *pNewRedl ); pNew->SetStart( *pREnd ); @@ -1454,8 +1462,6 @@ DocumentRedlineManager::AppendRedline(SwRangeRedline* pNewRedl, bool const bCall n = 0; // re-initialize bDec = true; } -else -pNewRedl->SetEnd( *pRStt, pEnd ); } break; @@ -1724,7 +1730,13 @@ DocumentRedlineManager::AppendRedline(SwRangeRedline* pNewRedl, bool const bCall { pRedl->PushData( *pNewRedl ); if( *pEnd == *pREnd ) +{ pNewRedl->SetEnd( *pRStt, pEnd ); +} +else if (*pStt == *pRStt) +{ +pNewRedl->SetStart(*pREnd, pStt); +} else { pNew = new SwRangeRedline( *pNewRedl ); @@ -1891,20 +1903,23 @@ DocumentRedlineManager::AppendRedline(SwRangeRedline* pNewRedl, bool const bCall case SwComparePosition::Outside: // Overlaps the current one completely, // split or shorten the new one -if( *pEnd != *pREnd ) +if (*pEnd == *pREnd) { -if( *pEnd != *pRStt ) -{ -SwRangeRedline* pNew = new SwRangeRedline( *pNewRedl ); -pNew->SetStart( *pREnd ); -pNewRedl->SetEnd( *pRStt, pEnd ); -AppendRedline( pNew, bCallDelete ); -n = 0; // re-initialize -bDec = true; -} +pNewRedl->SetEnd(*pRStt, pEnd); +} +else if (*pStt == *pRStt) +{ +pNewRedl->SetStart(*pREnd, pStt); } else +{ +SwRangeRedline* pNew = new SwRangeRedline( *pNewRedl ); +pNew->SetStart( *pREnd ); pNewRedl->SetEnd( *pRStt, pEnd ); +AppendRedline( pNew, bCallDelete
[Libreoffice-commits] core.git: Branch 'libreoffice-7-0' - sw/source
sw/source/uibase/inc/navipi.hxx |1 + sw/source/uibase/utlui/navipi.cxx | 21 ++--- 2 files changed, 15 insertions(+), 7 deletions(-) New commits: commit 021019e0310363daed12d4a006e1785e3184c33e Author: Caolán McNamara AuthorDate: Tue Jul 28 12:33:15 2020 +0100 Commit: Caolán McNamara CommitDate: Tue Jul 28 16:25:47 2020 +0200 tdf#134959 move focus on activate, but leave focus on value-changed if the user presses enter to activate the Entry try to go to the page, and on success we move focus to the document. if the SpinButton changed value a Timer was launched, when it times-out, move to the desired page, but leave focus where it currently is, i.e. typically remaining in the spinbutton, or whatever other widget the user moved to in the meantime This replaces always grabbing focus to the document on a page-change and re-grabbing focus back to the spinbutton. Change-Id: I597597aedb1753aee755671a2a55779ca6196c09 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99595 Tested-by: Jenkins Reviewed-by: Caolán McNamara diff --git a/sw/source/uibase/inc/navipi.hxx b/sw/source/uibase/inc/navipi.hxx index 14e066c73380..fee94525d577 100644 --- a/sw/source/uibase/inc/navipi.hxx +++ b/sw/source/uibase/inc/navipi.hxx @@ -107,6 +107,7 @@ class SwNavigationPI : public PanelLayout DECL_LINK( GlobalMenuSelectHdl, const OString&, void ); DECL_LINK( ChangePageHdl, Timer*, void ); DECL_LINK( PageEditModifyHdl, weld::SpinButton&, void ); +DECL_LINK( EditActionHdl, weld::Entry&, bool ); bool EditAction(); void UsePage(); diff --git a/sw/source/uibase/utlui/navipi.cxx b/sw/source/uibase/utlui/navipi.cxx index 0e3af56e48ec..577aba8fc645 100644 --- a/sw/source/uibase/utlui/navipi.cxx +++ b/sw/source/uibase/utlui/navipi.cxx @@ -412,13 +412,7 @@ bool SwNavigationPI::EditAction() SwWrtShell = m_pCreateView->GetWrtShell(); sal_uInt16 nNewPage = m_xEdit->get_value(); -sal_uInt16 nPhyPage, nVirPage; -rSh.GetPageNum(nPhyPage, nVirPage); -if (nPhyPage == nNewPage) -return false; - rSh.GotoPage(nNewPage, true); -m_pCreateView->GetEditWin().GrabFocus(); m_pCreateView->GetViewFrame()->GetBindings().Invalidate(FN_STAT_PAGE); return true; @@ -554,6 +548,7 @@ SwNavigationPI::SwNavigationPI(vcl::Window* pParent, // Insert the numeric field in the toolbox. m_xEdit->set_accessible_name(m_xEdit->get_tooltip_text()); m_xEdit->set_width_chars(3); +m_xEdit->connect_activate(LINK(this, SwNavigationPI, EditActionHdl)); m_xEdit->connect_value_changed(LINK(this, SwNavigationPI, PageEditModifyHdl)); m_xEdit->set_help_id("modules/swriter/ui/navigatorpanel/numericfield"); @@ -1054,8 +1049,20 @@ IMPL_LINK_NOARG(SwNavigationPI, ChangePageHdl, Timer *, void) { if (IsDisposed()) return; +// tdf#134959 if the SpinButton changed value this Timer was launched, now +// change to the desired page, but we leave focus where it currently is, +// i.e. typically remaining in the spinbutton, or whatever other widget the +// user moved to in the meantime +EditAction(); +} + +IMPL_LINK_NOARG(SwNavigationPI, EditActionHdl, weld::Entry&, bool) +{ +// tdf#134959 if the user presses enter to activate the Entry +// go to the page, and on success we move focus to the document if (EditAction()) -m_xEdit->grab_focus(); +m_pCreateView->GetEditWin().GrabFocus(); +return true; } IMPL_LINK_NOARG(SwNavigationPI, PageEditModifyHdl, weld::SpinButton&, void) ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-7-0' - sw/source
sw/source/core/doc/DocumentContentOperationsManager.cxx |6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) New commits: commit 724d5240f69abc675397260fad359080766d0ec5 Author: Michael Stahl AuthorDate: Tue Jul 21 17:30:55 2020 +0200 Commit: Xisco Fauli CommitDate: Wed Jul 22 13:16:25 2020 +0200 tdf#132911 sw_redlinehide: fix assert in CopyImplImpl() With Ctrl+A, Ctrl+X, Ctrl+V we get the bAfterTable = true case; line 4722 does pCopyPam->GetPoint()->nNode-- and then line 5085 does pCopyPam->GetPoint()->nNode++ but the problem is that nContent still points to the same node as initially while the node after the table end node is now a different one, i.e. nNode and nContent point to different nodes and something in redlining asserts becuase of that with "Assertion `m_pIndexReg == rIndex.m_pIndexReg' failed."; we don't get to step 4 anyway. (reportedly something changed with commit 4532845e22c10f252840887e55002307227b2390 but it's a mystery what that would be) Change-Id: I23744fad543e1e7bfcc11c4b488d4469ba9e509c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99166 Tested-by: Jenkins Reviewed-by: Michael Stahl (cherry picked from commit 14bdbc36f0cf3913f6de10c746044b6aadf37095) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99193 Reviewed-by: Xisco Fauli diff --git a/sw/source/core/doc/DocumentContentOperationsManager.cxx b/sw/source/core/doc/DocumentContentOperationsManager.cxx index 67bda981d6ea..4db8ad56c16c 100644 --- a/sw/source/core/doc/DocumentContentOperationsManager.cxx +++ b/sw/source/core/doc/DocumentContentOperationsManager.cxx @@ -5078,10 +5078,10 @@ bool DocumentContentOperationsManager::CopyImplImpl(SwPaM& rPam, SwPosition& rPo pCopyPam->Move( fnMoveForward, bCanMoveBack ? GoInContent : GoInNode ); else { -// Reset the offset to 0 as it was before the insertion -pCopyPam->GetPoint()->nContent = 0; - pCopyPam->GetPoint()->nNode++; + +// Reset the offset to 0 as it was before the insertion + pCopyPam->GetPoint()->nContent.Assign(pCopyPam->GetPoint()->nNode.GetNode().GetContentNode(), 0); // If the next node is a start node, then step back: the start node // has been copied and needs to be in the selection for the undo if (pCopyPam->GetPoint()->nNode.GetNode().IsStartNode()) ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-7-0' - sw/source
sw/source/filter/ww8/docxexport.cxx |7 +++ 1 file changed, 7 insertions(+) New commits: commit f533b6f9764e96be14aafe4ed125c8ed44a281bc Author: Mike Kaganski AuthorDate: Mon Jul 20 14:10:51 2020 +0300 Commit: Adolfo Jayme Barrientos CommitDate: Tue Jul 21 14:59:28 2020 +0200 tdf#134973: restore unmodified status of chart on export Upon first save, the chart model may get modified during export when accessing subtitle which gets created when not yet existing. That modified state hadn't been reset previously, when the save was done in the DocxAttributeOutput::WritePostponedChart. Prior to 129f55097f926661f00919329fb28c6a85ecebbb, because of double insertion of the same object, EmbeddedObjectContainer::StoreChildren stored the duplicate of the chart again (after the "modification" happened in DocxAttributeOutput::WritePostponedChart), and reset the status in ChartModel::impl_store. The mentioned commit made the old problem manifest itself. Change-Id: Ib6b11bf85fcef93c6d86f7ab5c0e4b0d6508860c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99044 Tested-by: Jenkins Reviewed-by: Mike Kaganski (cherry picked from commit 346bc3661bfde0c4e000716601a26f91e0bd523f) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99051 Reviewed-by: Adolfo Jayme Barrientos diff --git a/sw/source/filter/ww8/docxexport.cxx b/sw/source/filter/ww8/docxexport.cxx index 1b8f95f48115..5e9dcc6718e3 100644 --- a/sw/source/filter/ww8/docxexport.cxx +++ b/sw/source/filter/ww8/docxexport.cxx @@ -35,6 +35,7 @@ #include #include #include +#include #include #include @@ -385,7 +386,13 @@ OString DocxExport::OutputChart( uno::Reference< frame::XModel > const & xModel, "application/vnd.openxmlformats-officedocument.drawingml.chart+xml" ); oox::drawingml::ChartExport aChartExport(XML_w, pChartFS, xModel, m_pFilter, oox::drawingml::DOCUMENT_DOCX); +css::uno::Reference xModifiable(xModel, css::uno::UNO_QUERY); +const bool bOldModified = xModifiable && xModifiable->isModified(); aChartExport.ExportContent(); +if (!bOldModified && xModifiable && xModifiable->isModified()) +// tdf#134973: the model could get modified: e.g., calling XChartDocument::getSubTitle(), +// which creates the object if absent, and sets the modified state. +xModifiable->setModified(bOldModified); return OUStringToOString( sId, RTL_TEXTENCODING_UTF8 ); } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-7-0' - sw/source
sw/source/filter/ww8/ww8par3.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit cf70de0a5c76eca0709efa59240051379bdec72e Author: Caolán McNamara AuthorDate: Wed Jul 15 09:53:27 2020 +0100 Commit: Caolán McNamara CommitDate: Wed Jul 15 16:19:52 2020 +0200 ofz#24130 check level before accessing array Change-Id: Ic583ac6d8904332ae744d8e7c6639570e74a6338 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98769 Tested-by: Jenkins Reviewed-by: Caolán McNamara diff --git a/sw/source/filter/ww8/ww8par3.cxx b/sw/source/filter/ww8/ww8par3.cxx index 395a1bf2e9db..5b49f98386f7 100644 --- a/sw/source/filter/ww8/ww8par3.cxx +++ b/sw/source/filter/ww8/ww8par3.cxx @@ -891,7 +891,7 @@ bool WW8ListManager::ReadLVL(SwNumFormat& rNumFormat, std::unique_ptrhttps://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-7-0' - sw/source
sw/source/uibase/shells/textsh1.cxx |4 1 file changed, 4 insertions(+) New commits: commit 8901f44746f3df147d327e95125cbd4a08049843 Author: Justin Luth AuthorDate: Tue Jul 14 14:18:36 2020 +0300 Commit: Justin Luth CommitDate: Tue Jul 14 19:19:03 2020 +0200 tdf#134654 sw: Alt-X - end keyboard selection too The selection itself was cancelled, but not the fact that a keyboard selection was "in progress". EndSelect is slightly heavy, so wrap it in a very lightweight if statement. ClearMark also checks HasMark, so real purpose in first checking it. Change-Id: I969a694c46d92201f3c3f2121e3fa3a2af27253c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98719 Tested-by: Jenkins Reviewed-by: Justin Luth Reviewed-by: Mike Kaganski (cherry picked from commit cef5a2d780ad01105dae860f6293f6f137603027) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98649 diff --git a/sw/source/uibase/shells/textsh1.cxx b/sw/source/uibase/shells/textsh1.cxx index 9567067f13e7..a7eef3d5cf6f 100644 --- a/sw/source/uibase/shells/textsh1.cxx +++ b/sw/source/uibase/shells/textsh1.cxx @@ -365,7 +365,11 @@ void SwTextShell::Execute(SfxRequest ) aRewriter.AddRule( UndoArg3, sReplacement ); rWrtSh.StartUndo(SwUndoId::REPLACE, ); rWrtSh.GetCursor()->Normalize(false); + rWrtSh.ClearMark(); +if( rWrtSh.IsInSelect() ) // cancel any in-progress keyboard selection as well +rWrtSh.EndSelect(); + for( sal_uInt32 i=aToggle.CharsToDelete(); i > 0; --i ) rWrtSh.DelLeft(); rWrtSh.Insert2( sReplacement ); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-7-0' - sw/source
sw/source/filter/ww8/ww8par5.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 0db72dda395a1ee3b7e45ba2c5d5be1457389c29 Author: Michael Stahl AuthorDate: Fri Jul 10 17:13:08 2020 +0200 Commit: Xisco Fauli CommitDate: Tue Jul 14 16:50:13 2020 +0200 tdf#134618 sw: WW8 import: don't insert fieldmark for SHAPE field Follow DomainMapper_Impl::CloseFieldCommand() and just don't waste effort creating a fieldmark that doesn't provide any benefit. This should avoid any fieldmark related problems introduced in e511a0ca5dde6d731bb126bbfe21768867890102..d9030ad6298e2f49ee63489d6158ea6ad23c0111 Change-Id: I6688dcda1e3b41ac648f3d69740f05d34bb46191 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98542 Tested-by: Jenkins Reviewed-by: Michael Stahl (cherry picked from commit 4e0aa38afd674f5ad16b4bc3222dc393543ad915) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98468 Reviewed-by: Xisco Fauli diff --git a/sw/source/filter/ww8/ww8par5.cxx b/sw/source/filter/ww8/ww8par5.cxx index 95e96f9357b6..9178b7961c82 100644 --- a/sw/source/filter/ww8/ww8par5.cxx +++ b/sw/source/filter/ww8/ww8par5.cxx @@ -613,7 +613,7 @@ sal_uInt16 SwWW8ImplReader::End_Field() } default: OUString aCode = m_aFieldStack.back().GetBookmarkCode(); -if ( !aCode.isEmpty() ) +if (!aCode.isEmpty() && !aCode.trim().startsWith("SHAPE")) { // Unhandled field with stored code SwPosition aEndPos = *m_pPaM->GetPoint(); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-7-0' - sw/source
sw/source/filter/ww8/docxattributeoutput.cxx | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) New commits: commit 6715ba7af16b7ada2ee031f98f442c48c948a907 Author: Michael Stahl AuthorDate: Fri Jul 10 19:29:27 2020 +0200 Commit: Xisco Fauli CommitDate: Tue Jul 14 16:50:32 2020 +0200 tdf#134618 sw: DOCX export: fix order of as-char and at-char fly... ...at same position. The problem is that in this case the as-char fly was written before the at-char fly but the positioning of the at-char fly can be relative to its character position, i.e. before the as-char fly. Apparently as-char flys are written in DocxAttributeOutput::EndRunProperties() via WritePostponedDMLDrawing(), wheras at-char flys are written earlier, in SwWW8AttrIter::OutFlys() via DocxAttributeOutput::OutputFlyFrame_Impl(). So this undoes the swap that these undergo via the magic of the mark stack. Change-Id: I83a72bb2affbf321fc4dea4e7fb37bdb43cea2e7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98543 Tested-by: Jenkins Reviewed-by: Michael Stahl (cherry picked from commit 7b156d37cfc92292323694ec064fe51ae57b3257) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98632 Reviewed-by: Xisco Fauli diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx index 4a694015b098..8a3791a9d898 100644 --- a/sw/source/filter/ww8/docxattributeoutput.cxx +++ b/sw/source/filter/ww8/docxattributeoutput.cxx @@ -2681,6 +2681,10 @@ void DocxAttributeOutput::EndRunProperties( const SwRedlineData* pRedlineData ) // write footnotes/endnotes if we have any FootnoteEndnoteReference(); +// merge the properties _before_ the run text (strictly speaking, just +// after the start of the run) +m_pSerializer->mergeTopMarks(Tag_StartRunProperties, sax_fastparser::MergeMarks::PREPEND); + WritePostponedGraphic(); WritePostponedDiagram(); @@ -2693,10 +2697,6 @@ void DocxAttributeOutput::EndRunProperties( const SwRedlineData* pRedlineData ) WritePostponedOLE(); WritePostponedActiveXControl(true); - -// merge the properties _before_ the run text (strictly speaking, just -// after the start of the run) -m_pSerializer->mergeTopMarks(Tag_StartRunProperties, sax_fastparser::MergeMarks::PREPEND); } void DocxAttributeOutput::GetSdtEndBefore(const SdrObject* pSdrObj) @@ -5855,7 +5855,7 @@ void DocxAttributeOutput::OutputFlyFrame_Impl( const ww8::Frame , const P break; } -m_pSerializer->mergeTopMarks(Tag_OutputFlyFrame, sax_fastparser::MergeMarks::POSTPONE); +m_pSerializer->mergeTopMarks(Tag_OutputFlyFrame); } void DocxAttributeOutput::WriteOutliner(const OutlinerParaObject& rParaObj) ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-7-0' - sw/source
sw/source/filter/ww8/ww8par2.cxx |3 +++ 1 file changed, 3 insertions(+) New commits: commit 4bc9d9d0c49881ca8f66f7e744174ee6f8ff4ae3 Author: Caolán McNamara AuthorDate: Tue Jul 7 16:05:19 2020 +0100 Commit: Caolán McNamara CommitDate: Wed Jul 8 15:01:30 2020 +0200 ofz#23961 pad back to original length in case of multi-byte input encoding resulting in a shorter output string than input Change-Id: Ieb4bb7b5f4551ca22e87c573233f083901f3d3c0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98272 Tested-by: Jenkins Reviewed-by: Caolán McNamara diff --git a/sw/source/filter/ww8/ww8par2.cxx b/sw/source/filter/ww8/ww8par2.cxx index db9f07ec5ce6..407b6e91aae6 100644 --- a/sw/source/filter/ww8/ww8par2.cxx +++ b/sw/source/filter/ww8/ww8par2.cxx @@ -609,6 +609,9 @@ void SwWW8ImplReader::SetAnlvStrings(SwNumFormat , WW8_ANLV const , return; } sText = OUString(reinterpret_cast(pText), nLen, eCharSet); +// ofz#23961 in case of multi-byte input encoding resulting in shorter +// output pad to full length with something semi-arbitrary +comphelper::string::padToLength(sText, nLen, cBulletChar); } else { ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-7-0' - sw/source
sw/source/core/layout/paintfrm.cxx | 16 1 file changed, 8 insertions(+), 8 deletions(-) New commits: commit 5e95aa716d58f80aaec259008b95d8b4d501fc6d Author: Noel Grandin AuthorDate: Thu Jul 2 09:44:33 2020 +0200 Commit: Noel Grandin CommitDate: Mon Jul 6 13:27:50 2020 +0200 tdf#133944 writer image shadow incorrect regression from commit 1f59cbe36c9899f6fa9a869331c9be454abd4606 Date: Fri Apr 17 15:38:05 2020 +0200 simplify some SwRect code - use the SwRect Add* variants Change-Id: I435b1153f272b08a2bfe7d90145de1ee5a702b08 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97720 Tested-by: Jenkins Reviewed-by: Noel Grandin (cherry picked from commit 006572e4d808e95a6624d0c5f37be8b8d14449ce) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97808 diff --git a/sw/source/core/layout/paintfrm.cxx b/sw/source/core/layout/paintfrm.cxx index a77960ee3e98..7e398600603d 100644 --- a/sw/source/core/layout/paintfrm.cxx +++ b/sw/source/core/layout/paintfrm.cxx @@ -4243,8 +4243,8 @@ static void lcl_PaintShadow( const SwRect& rRect, SwRect& rOutRect, if ( bDrawFullShadowRectangle ) { // draw full shadow rectangle -aOut.AddTop( nHeight ); -aOut.AddLeft( nWidth ); +aOut.Top( rOutRect.Top() + nHeight ); +aOut.Left( rOutRect.Left() + nWidth ); aRegion.push_back( aOut ); } else @@ -4253,18 +4253,18 @@ static void lcl_PaintShadow( const SwRect& rRect, SwRect& rOutRect, { aOut.Top( rOutRect.Bottom() - nHeight ); if( bLeft ) -aOut.AddLeft( nWidth ); +aOut.Left( rOutRect.Left() + nWidth ); aRegion.push_back( aOut ); } if( bRight ) { aOut.Left( rOutRect.Right() - nWidth ); if( bTop ) -aOut.AddTop( nHeight ); +aOut.Top( rOutRect.Top() + nHeight ); else aOut.Top( rOutRect.Top() ); if( bBottom ) -aOut.AddBottom( - nHeight ); +aOut.Bottom( rOutRect.Bottom() - nHeight ); aRegion.push_back( aOut ); } } @@ -4280,8 +4280,8 @@ static void lcl_PaintShadow( const SwRect& rRect, SwRect& rOutRect, if ( bDrawFullShadowRectangle ) { // draw full shadow rectangle -aOut.AddBottom( - nHeight ); -aOut.AddRight( - nWidth ); +aOut.Bottom( rOutRect.Bottom() - nHeight ); +aOut.Right( rOutRect.Right() - nWidth ); aRegion.push_back( aOut ); } else @@ -4290,7 +4290,7 @@ static void lcl_PaintShadow( const SwRect& rRect, SwRect& rOutRect, { aOut.Bottom( rOutRect.Top() + nHeight ); if( bRight ) -aOut.AddRight( - nWidth ); +aOut.Right( rOutRect.Right() - nWidth ); aRegion.push_back( aOut ); } if( bLeft ) ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-7-0' - sw/source
sw/source/uibase/sidebar/TableEditPanel.cxx | 24 ++-- 1 file changed, 10 insertions(+), 14 deletions(-) New commits: commit c4eb732bc38156d2d6c373c6ce3520eecf323d32 Author: Caolán McNamara AuthorDate: Tue Jun 30 20:05:30 2020 +0100 Commit: Caolán McNamara CommitDate: Wed Jul 1 21:13:25 2020 +0200 Related: tdf#134360 table row/height widgets can get stuck insensitive Change-Id: I1be53f33f60c510757c67f1da8f863539ecbffdb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97573 Tested-by: Caolán McNamara Reviewed-by: Caolán McNamara diff --git a/sw/source/uibase/sidebar/TableEditPanel.cxx b/sw/source/uibase/sidebar/TableEditPanel.cxx index 4d76cc0878dd..46f75cd9a9d6 100644 --- a/sw/source/uibase/sidebar/TableEditPanel.cxx +++ b/sw/source/uibase/sidebar/TableEditPanel.cxx @@ -45,6 +45,9 @@ void TableEditPanel::NotifyItemUpdate(const sal_uInt16 nSID, const SfxItemState { case SID_ATTR_TABLE_ROW_HEIGHT: { +bool bDisabled = eState == SfxItemState::DISABLED; +m_xRowHeightEdit->set_sensitive(!bDisabled); + if (pState && eState >= SfxItemState::DEFAULT) { const SfxUInt32Item* pItem = static_cast(pState); @@ -55,18 +58,16 @@ void TableEditPanel::NotifyItemUpdate(const sal_uInt16 nSID, const SfxItemState m_xRowHeightEdit->set_value(nNewHeight, FieldUnit::TWIP); } } -else if (eState == SfxItemState::DISABLED) -{ -m_xRowHeightEdit->set_sensitive(false); -} -else -{ +else if (eState != SfxItemState::DISABLED) m_xRowHeightEdit->set_text(""); -} + break; } case SID_ATTR_TABLE_COLUMN_WIDTH: { +bool bDisabled = eState == SfxItemState::DISABLED; +m_xColumnWidthEdit->set_sensitive(!bDisabled); + if (pState && eState >= SfxItemState::DEFAULT) { const SfxUInt32Item* pItem = static_cast(pState); @@ -77,14 +78,9 @@ void TableEditPanel::NotifyItemUpdate(const sal_uInt16 nSID, const SfxItemState m_xColumnWidthEdit->set_value(nNewWidth, FieldUnit::TWIP); } } -else if (eState == SfxItemState::DISABLED) -{ -m_xColumnWidthEdit->set_sensitive(false); -} -else -{ +else if (eState != SfxItemState::DISABLED) m_xColumnWidthEdit->set_text(""); -} + break; } } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-7-0' - sw/source
sw/source/uibase/uno/unotxdoc.cxx |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) New commits: commit 3bd01dc22c18acbca14b52bb982e7effd5a2b8a8 Author: Samuel Mehrbrodt AuthorDate: Mon Jun 29 14:58:57 2020 +0200 Commit: Xisco Fauli CommitDate: Wed Jul 1 17:09:42 2020 +0200 tdf#130151 Fix toc pointing to wrong page Change-Id: I26c1027722613f751bd39fde97f1e14d3238eefa Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97413 Reviewed-by: Ilmari Lauhakangas Reviewed-by: Samuel Mehrbrodt Tested-by: Jenkins (cherry picked from commit 63f3485b57904de4e77c04f5759e6563fcce6748) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97504 Reviewed-by: Xisco Fauli diff --git a/sw/source/uibase/uno/unotxdoc.cxx b/sw/source/uibase/uno/unotxdoc.cxx index 1fb4ce3713be..b65386a7c392 100644 --- a/sw/source/uibase/uno/unotxdoc.cxx +++ b/sw/source/uibase/uno/unotxdoc.cxx @@ -2583,8 +2583,6 @@ sal_Int32 SAL_CALL SwXTextDocument::getRendererCount( // there is no time to sort this out. //TODO: check what exactly needs to be done and make just one function for that pViewShell->CalcLayout(); -pViewShell->CalcPagesForPrint( pViewShell->GetPageCount() ); - // #122919# Force field update before PDF export, but after layout init (tdf#121962) bool bStateChanged = false; @@ -2598,6 +2596,8 @@ sal_Int32 SAL_CALL SwXTextDocument::getRendererCount( if( bStateChanged ) pRenderDocShell->EnableSetModified(); +pViewShell->CalcPagesForPrint( pViewShell->GetPageCount() ); + pViewShell->SetPDFExportOption( false ); // enable view again ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-7-0' - sw/source
sw/source/core/undo/undobj.cxx |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) New commits: commit 9227a7ba84b6c5323d45ff427cb0f90e16530be1 Author: Michael Stahl AuthorDate: Tue Jun 30 12:24:01 2020 +0200 Commit: Michael Stahl CommitDate: Tue Jun 30 17:26:31 2020 +0200 tdf#134404 sw: another subtlety with start/end of section (at-para flys) fix this problem by comparing the start/end of the selection instead of the anchor position, which always has an index of 0: 1. new document with image anchored to paragraph 2. insert one letter 3. press Enter 4. Backspace -> Image gone (regression from cc4b5091e739116a7ec83513fa1cd856f0130330) Change-Id: I1219a9f58ce19ea88d697c90c862fe9005318177 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97511 Tested-by: Jenkins Reviewed-by: Michael Stahl (cherry picked from commit 17aeb522f566cf225baa5ce524e747089f76728d) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97498 diff --git a/sw/source/core/undo/undobj.cxx b/sw/source/core/undo/undobj.cxx index 3a17d8d98f21..30fc2ed24b4d 100644 --- a/sw/source/core/undo/undobj.cxx +++ b/sw/source/core/undo/undobj.cxx @@ -1634,14 +1634,14 @@ bool IsSelectFrameAnchoredAtPara(SwPosition const & rAnchorPos, && ((rStart.nNode != rEnd.nNode && rStart.nContent == 0 // but not if the selection is backspace/delete! && IsNotBackspaceHeuristic(rStart, rEnd)) -|| (IsAtStartOfSection(rAnchorPos) && IsAtEndOfSection2(rEnd) +|| (IsAtStartOfSection2(rStart) && IsAtEndOfSection2(rEnd) && ((rAnchorPos.nNode < rEnd.nNode) || (rAnchorPos.nNode == rEnd.nNode && !(nDelContentType & DelContentType::ExcludeFlyAtStartEnd) // special case: fully deleted node && ((rEnd.nNode != rStart.nNode && rEnd.nContent == rEnd.nNode.GetNode().GetTextNode()->Len() && IsNotBackspaceHeuristic(rStart, rEnd)) -|| (IsAtEndOfSection(rAnchorPos) && IsAtStartOfSection2(rStart); +|| (IsAtEndOfSection2(rEnd) && IsAtStartOfSection2(rStart); } bool IsFlySelectedByCursor(SwDoc const & rDoc, ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-7-0' - sw/source
sw/source/filter/ww8/wrtww8.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 39fd223cd65c8b6405fa3b33a9f6be680c745713 Author: Julien Nabet AuthorDate: Sat Jun 27 10:34:24 2020 +0200 Commit: Caolán McNamara CommitDate: Sat Jun 27 17:32:01 2020 +0200 cid#1464967: RESOURCE_LEAK (sw/wrtww8) Change-Id: Ic1aa0d42f174808c7700875cb31f1c726b3160e9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97298 Tested-by: Jenkins Reviewed-by: Caolán McNamara diff --git a/sw/source/filter/ww8/wrtww8.cxx b/sw/source/filter/ww8/wrtww8.cxx index c3fe9c0a36f9..5fedd5bb39b7 100644 --- a/sw/source/filter/ww8/wrtww8.cxx +++ b/sw/source/filter/ww8/wrtww8.cxx @@ -3751,7 +3751,7 @@ ErrCode SwWW8Writer::WriteStorage() break; } -SotStorageStream* pStream = pStorage->OpenSotStream(sFileName); +tools::SvRef pStream = pStorage->OpenSotStream(sFileName); if (!pStream) { nErrorCode = ERRCODE_IO_GENERAL; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-7-0' - sw/source
sw/source/core/unocore/unosett.cxx |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) New commits: commit 2838868784825ad99141454829c711c5c36e75fd Author: Julien Nabet AuthorDate: Sat Jun 27 09:27:50 2020 +0200 Commit: Caolán McNamara CommitDate: Sat Jun 27 17:17:05 2020 +0200 cid#1464974: Null pointer dereferences (sw/unosett) Change-Id: I4ea6de59ce1d1cb3133b0fb57176caee5497878f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97297 Tested-by: Jenkins Reviewed-by: Caolán McNamara diff --git a/sw/source/core/unocore/unosett.cxx b/sw/source/core/unocore/unosett.cxx index 817938749bf7..81f1a6a2e33a 100644 --- a/sw/source/core/unocore/unosett.cxx +++ b/sw/source/core/unocore/unosett.cxx @@ -1771,8 +1771,8 @@ void SwXNumberingRules::SetPropertiesToNumFormat( { OUString sBulletFontName; rProp.Value >>= sBulletFontName; -SwDocShell* pLclDocShell = pDoc->GetDocShell(); -if( !sBulletFontName.isEmpty() && pLclDocShell ) +SwDocShell* pLclDocShell = nullptr; +if( !sBulletFontName.isEmpty() && pDoc && (pLclDocShell = pDoc->GetDocShell()) ) { const SvxFontListItem* pFontListItem = static_cast(pLclDocShell ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits