external/gpgmepp/UnpackedTarball_gpgmepp.mk | 1 external/gpgmepp/gpgme.git-4b64774b6d13ffa4f59dddf947a97d61bcfa2f2e.patch.1 | 32 +++++ include/sal/log.hxx | 5 sw/qa/extras/layout/data/birt_min.odt |binary sw/qa/extras/layout/layout.cxx | 6 + sw/source/core/doc/htmltbl.cxx | 2 sw/source/core/inc/layact.hxx | 5 sw/source/core/inc/tabfrm.hxx | 13 -- sw/source/core/layout/layact.cxx | 19 --- sw/source/core/layout/tabfrm.cxx | 54 ++++++++-- 10 files changed, 91 insertions(+), 46 deletions(-)
New commits: commit d148326ca8dfe8f152801eb341940c69a150c7ee Author: Michael Stahl <michael.st...@allotropia.de> AuthorDate: Fri Jun 18 19:49:46 2021 +0200 Commit: Samuel Mehrbrodt <samuel.mehrbr...@allotropia.de> CommitDate: Mon Jan 17 16:16:06 2022 +0100 tdf#116501 sw: layout: check for flys in SwTabFrame::ShouldBwdMoved() On loading, this hits loop control warn:legacy.osl:580715:580715:sw/source/core/layout/layact.cxx:543: LoopControl_1 in SwLayAction::InternalAction This is because there's a fly frame 404 anchored at the last text frame 353 on page 2 inside the nested table 347. ShouldBwdMoved() sees that there is space on the bottom of page 2 and hence the follow flow row joined, but then it immediately splits again in the same way as before due to the fly with WrapTextMode_NONE. But then the outer table's cell 273 (upper of 347) is invalidated again, hence the loop. Try to check for overlapping flys in SwTabFrame::ShouldBwdMoved() by reusing CalcFlyOffsets(), which is ... not quite ideal, but perhaps better than copy-pasting half of it to a new function. This should have less side effects than the previous fix, but a problem remains that clicking on the shape on bottom of page 2 causes the layout to go wonky, but that was also the case with previous fix. Note there's a check of SwLayouter::DoesRowContainMovedFwdFrame() there already, but that doesn't help because it will only detect when the fly itself was moved forward, but in this case the fly remains on the page. Also likely it wouldn't be a good idea to move a text frame forward if the only thing of it that fits on a page is an anchored fly (i.e. its follow has mnOffset=0) because that can be intentional. Change-Id: I0376f7dcb784c006990336233c97f5093aaccb77 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117473 Tested-by: Jenkins Tested-by: László Németh <nem...@numbertext.org> Reviewed-by: László Németh <nem...@numbertext.org> (cherry picked from commit f1439db62eb36ef5fbc9111b87dc4e0f24b3cb86) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117602 Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org> (cherry picked from commit 35a0bfa7bf52ca713ea8e57cd982d16723be920d) diff --git a/sw/source/core/doc/htmltbl.cxx b/sw/source/core/doc/htmltbl.cxx index 346c67c552fe..5482a984238a 100644 --- a/sw/source/core/doc/htmltbl.cxx +++ b/sw/source/core/doc/htmltbl.cxx @@ -363,7 +363,7 @@ sal_uInt16 SwHTMLTableLayout::GetBrowseWidthByTabFrame( SwTwips nUpperDummy = 0; long nRightOffset = 0, nLeftOffset = 0; - rTabFrame.CalcFlyOffsets( nUpperDummy, nLeftOffset, nRightOffset ); + rTabFrame.CalcFlyOffsets(nUpperDummy, nLeftOffset, nRightOffset, nullptr); nWidth -= (nLeftOffset + nRightOffset); return static_cast<sal_uInt16>(std::min(nWidth, SwTwips(SAL_MAX_UINT16))); diff --git a/sw/source/core/inc/tabfrm.hxx b/sw/source/core/inc/tabfrm.hxx index 176396c6667a..73768558ac10 100644 --- a/sw/source/core/inc/tabfrm.hxx +++ b/sw/source/core/inc/tabfrm.hxx @@ -201,7 +201,8 @@ public: bool CalcFlyOffsets( SwTwips& rUpper, long& rLeftOffset, - long& rRightOffset ) const; + long& rRightOffset, + SwTwips * pSpaceBelowBottom) const; SwTwips CalcHeightOfFirstContentLine() const; diff --git a/sw/source/core/layout/tabfrm.cxx b/sw/source/core/layout/tabfrm.cxx index ba85082edcaf..c00a7294e8c3 100644 --- a/sw/source/core/layout/tabfrm.cxx +++ b/sw/source/core/layout/tabfrm.cxx @@ -2740,7 +2740,8 @@ static bool IsNextOnSamePage(SwPageFrame const& rPage, /// Calculate the offsets arising because of FlyFrames bool SwTabFrame::CalcFlyOffsets( SwTwips& rUpper, long& rLeftOffset, - long& rRightOffset ) const + long& rRightOffset, + SwTwips *const pSpaceBelowBottom) const { bool bInvalidatePrtArea = false; const SwPageFrame *pPage = FindPageFrame(); @@ -2760,9 +2761,17 @@ bool SwTabFrame::CalcFlyOffsets( SwTwips& rUpper, long nPrtPos = aRectFnSet.GetTop(getFrameArea()); nPrtPos = aRectFnSet.YInc( nPrtPos, rUpper ); SwRect aRect( getFrameArea() ); - long nYDiff = aRectFnSet.YDiff( aRectFnSet.GetTop(getFramePrintArea()), rUpper ); - if( nYDiff > 0 ) - aRectFnSet.AddBottom( aRect, -nYDiff ); + if (pSpaceBelowBottom) + { // set to space below table frame + aRectFnSet.SetTopAndHeight(aRect, aRectFnSet.GetBottom(aRect), *pSpaceBelowBottom); + } + else + { + long nYDiff = aRectFnSet.YDiff( aRectFnSet.GetTop(getFramePrintArea()), rUpper ); + if (nYDiff > 0) + aRectFnSet.AddBottom( aRect, -nYDiff ); + } + for ( size_t i = 0; i < pPage->GetSortedObjs()->size(); ++i ) { SwAnchoredObject* pAnchoredObj = (*pPage->GetSortedObjs())[i]; @@ -2797,8 +2806,9 @@ bool SwTabFrame::CalcFlyOffsets( SwTwips& rUpper, aFlyRect.IsOver( aRect ) && // fly isn't lower of table and // anchor character frame of fly isn't lower of table - ( !IsAnLower( pFly ) && - ( !pAnchorCharFrame || !IsAnLower( pAnchorCharFrame ) ) ) && + (pSpaceBelowBottom // not if in ShouldBwdMoved + || (!IsAnLower( pFly ) && + (!pAnchorCharFrame || !IsAnLower(pAnchorCharFrame)))) && // table isn't lower of fly !pFly->IsAnLower( this ) && // fly is lower of fly, the table is in @@ -2853,6 +2863,20 @@ bool SwTabFrame::CalcFlyOffsets( SwTwips& rUpper, { if (aRectFnSet.YDiff( nPrtPos, nBottom ) < 0) nPrtPos = nBottom; + // tdf#116501 subtract flys blocking space from below + // TODO this may not work ideally for multiple flys + if (pSpaceBelowBottom + && aRectFnSet.YDiff(aRectFnSet.GetBottom(aRect), nBottom) < 0) + { + if (aRectFnSet.YDiff(aRectFnSet.GetTop(aRect), aRectFnSet.GetTop(aFlyRect)) < 0) + { + aRectFnSet.SetBottom(aRect, aRectFnSet.GetTop(aFlyRect)); + } + else + { + aRectFnSet.SetHeight(aRect, 0); + } + } bInvalidatePrtArea = true; } } @@ -2880,6 +2904,10 @@ bool SwTabFrame::CalcFlyOffsets( SwTwips& rUpper, } } rUpper = aRectFnSet.YDiff( nPrtPos, aRectFnSet.GetTop(getFrameArea()) ); + if (pSpaceBelowBottom) + { + *pSpaceBelowBottom = aRectFnSet.GetHeight(aRect); + } } return bInvalidatePrtArea; @@ -2915,7 +2943,7 @@ void SwTabFrame::Format( vcl::RenderContext* /*pRenderContext*/, const SwBorderA // are right or left aligned, those set the minimum for the borders. long nTmpRight = -1000000, nLeftOffset = 0; - if( CalcFlyOffsets( nUpper, nLeftOffset, nTmpRight ) ) + if (CalcFlyOffsets(nUpper, nLeftOffset, nTmpRight, nullptr)) { setFramePrintAreaValid(false); } @@ -3549,6 +3577,14 @@ bool SwTabFrame::ShouldBwdMoved( SwLayoutFrame *pNewUpper, bool, bool &rReformat const SwViewShell *pSh = getRootFrame()->GetCurrShell(); if( pSh && pSh->GetViewOptions()->getBrowseMode() ) nSpace += pNewUpper->Grow( LONG_MAX, true ); + if (0 < nSpace && GetPrecede()) + { + SwTwips nUpperDummy(0); + long nLeftOffsetDummy(0), nRightOffsetDummy(0); + // tdf#116501 check for no-wrap fly overlap + static_cast<const SwTabFrame*>(GetPrecede())->CalcFlyOffsets( + nUpperDummy, nLeftOffsetDummy, nRightOffsetDummy, &nSpace); + } } } else if (!m_bLockBackMove) commit 3857705b16a5cc2ae5c67a3b0501d922e6c70d6b Author: Michael Stahl <michael.st...@allotropia.de> AuthorDate: Mon Jun 21 14:44:29 2021 +0200 Commit: Samuel Mehrbrodt <samuel.mehrbr...@allotropia.de> CommitDate: Mon Jan 17 16:04:51 2022 +0100 sw: add BIRT layout test document This nested table is an example that was broken by commit 91b2239783dc716bd71ce7962bfd7e341dfe4175 - if loaded with a wide window, it goes into layout loop; if loaded with a tall window size where page 2 is visible, strangely it doesn't loop. Change-Id: I5e73cfcd928ff1a321667c1a75b0ba7f348d4b77 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117587 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.st...@allotropia.de> (cherry picked from commit a41c71838d4662adf1ada9d46ec6e070cae7e695) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117603 Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org> (cherry picked from commit 5e658c91a5d1e69e34384dd50ac8ada358ebd8ba) diff --git a/sw/qa/extras/layout/data/birt_min.odt b/sw/qa/extras/layout/data/birt_min.odt new file mode 100644 index 000000000000..44bcecb976ff Binary files /dev/null and b/sw/qa/extras/layout/data/birt_min.odt differ diff --git a/sw/qa/extras/layout/layout.cxx b/sw/qa/extras/layout/layout.cxx index 8d9f2a476f2a..0bd25d45b4b6 100644 --- a/sw/qa/extras/layout/layout.cxx +++ b/sw/qa/extras/layout/layout.cxx @@ -3437,6 +3437,12 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testBtlrTableRowSpan) assertXPathContent(pXmlDoc, "//textarray[1]/text", "USA"); } +CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testBIRT) +{ + // this looped + load(DATA_DIRECTORY, "birt_min.odt"); +} + CPPUNIT_PLUGIN_IMPLEMENT(); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ commit 38b51b53f025b1d76399b33ecf39746b820363d4 Author: Michael Stahl <michael.st...@allotropia.de> AuthorDate: Wed Jun 16 15:34:40 2021 +0200 Commit: Samuel Mehrbrodt <samuel.mehrbr...@allotropia.de> CommitDate: Mon Jan 17 15:48:48 2022 +0100 Revert "tdf#116501 fix freezing at embedded text tables" This reverts commit 91b2239783dc716bd71ce7962bfd7e341dfe4175. This breaks documents that have many nested tables. For example Eclipse BIRT generates reports with tables nested 8 levels deep, they run into the counter in no time and, ironically, one goes into a layout loop because of this counter. Change-Id: I7451d01787903bbc60b305da3dc72f8259175e97 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117472 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.st...@allotropia.de> (cherry picked from commit ee042a371e98cdcc59848f0b953f1ce545e18e31) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117601 Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org> (cherry picked from commit 0f026c6e7186ef57e5806348a320f8383dfb7dc7) diff --git a/sw/source/core/inc/layact.hxx b/sw/source/core/inc/layact.hxx index 2b1b17a4afd2..50335077694c 100644 --- a/sw/source/core/inc/layact.hxx +++ b/sw/source/core/inc/layact.hxx @@ -97,11 +97,6 @@ class SwLayAction // OD 14.04.2003 #106346# - new flag for content formatting on interrupt. bool mbFormatContentOnInterrupt; - // for loop control by disabling in-row splitting within embedded tables - const SwPageFrame *m_pCurPage; - sal_uInt16 m_nTabLevel; // embedding level - sal_uInt32 m_nCallCount; // calling FormatLayoutTab on the same page - void PaintContent( const SwContentFrame *, const SwPageFrame *, const SwRect &rOldRect, long nOldBottom ); bool PaintWithoutFlys( const SwRect &, const SwContentFrame *, diff --git a/sw/source/core/inc/tabfrm.hxx b/sw/source/core/inc/tabfrm.hxx index cc57d46d8492..176396c6667a 100644 --- a/sw/source/core/inc/tabfrm.hxx +++ b/sw/source/core/inc/tabfrm.hxx @@ -84,8 +84,6 @@ class SwTabFrame: public SwLayoutFrame, public SwFlowFrame bool m_bInRecalcLowerRow : 1; - bool m_bSplitRowDisabled : 1; // loop control - /** * Split() splits the Frame at the specified position: a Follow is * created and constructed and inserted directly after this. @@ -175,14 +173,6 @@ public: { m_bInRecalcLowerRow = bNew; } - bool IsSplitRowDisabled() const - { - return m_bSplitRowDisabled; - } - void SetSplitRowDisabled() - { - m_bSplitRowDisabled = true; - } // #i26945# bool IsConsiderObjsForMinCellHeight() const diff --git a/sw/source/core/layout/layact.cxx b/sw/source/core/layout/layact.cxx index 74fe4e85bcfd..96796cca4662 100644 --- a/sw/source/core/layout/layact.cxx +++ b/sw/source/core/layout/layact.cxx @@ -261,10 +261,7 @@ SwLayAction::SwLayAction( SwRootFrame *pRt, SwViewShellImp *pI ) : m_nStartTicks( std::clock() ), m_nInputType( VclInputFlags::NONE ), m_nEndPage( USHRT_MAX ), - m_nCheckPageNum( USHRT_MAX ), - m_pCurPage( nullptr ), - m_nTabLevel( 0 ), - m_nCallCount( 0 ) + m_nCheckPageNum( USHRT_MAX ) { m_bPaintExtraData = ::IsExtraData( m_pImp->GetShell()->GetDoc() ); m_bPaint = m_bComplete = m_bWaitAllowed = m_bCheckPages = true; @@ -292,7 +289,6 @@ void SwLayAction::Reset() m_bPaint = m_bComplete = m_bWaitAllowed = m_bCheckPages = true; m_bInput = m_bAgain = m_bNextCycle = m_bCalcLayout = m_bIdle = m_bReschedule = m_bUpdateExpFields = m_bBrowseActionStop = false; - m_pCurPage = nullptr; } bool SwLayAction::RemoveEmptyBrowserPages() @@ -1183,12 +1179,6 @@ bool SwLayAction::IsShortCut( SwPageFrame *&prPage ) // introduce support for vertical layout bool SwLayAction::FormatLayout( OutputDevice *pRenderContext, SwLayoutFrame *pLay, bool bAddRect ) { - // save page for loop control - if( pLay->IsPageFrame() && static_cast<SwPageFrame*>(pLay) != m_pCurPage ) - { - m_nCallCount = 0; - m_pCurPage = static_cast<SwPageFrame*>(pLay); - } OSL_ENSURE( !IsAgain(), "Attention to the invalid page." ); if ( IsAgain() ) return false; @@ -1369,14 +1359,7 @@ bool SwLayAction::FormatLayout( OutputDevice *pRenderContext, SwLayoutFrame *pLa { if ( pLow->IsTabFrame() ) { - // loop control for embedded tables - if ( m_nTabLevel > 0 && ++m_nCallCount > 50 ) { - static_cast<SwTabFrame*>(pLow)->SetSplitRowDisabled(); - } - - ++m_nTabLevel; bTabChanged |= FormatLayoutTab( static_cast<SwTabFrame*>(pLow), bAddRect ); - --m_nTabLevel; } // Skip the ones already registered for deletion else if( !pLow->IsSctFrame() || static_cast<SwSectionFrame*>(pLow)->GetSection() ) diff --git a/sw/source/core/layout/tabfrm.cxx b/sw/source/core/layout/tabfrm.cxx index 781355964448..ba85082edcaf 100644 --- a/sw/source/core/layout/tabfrm.cxx +++ b/sw/source/core/layout/tabfrm.cxx @@ -82,7 +82,6 @@ SwTabFrame::SwTabFrame( SwTable &rTab, SwFrame* pSib ) , m_bConsiderObjsForMinCellHeight(true) , m_bObjsDoesFit(true) , m_bInRecalcLowerRow(false) - , m_bSplitRowDisabled(false) { mbFixSize = false; //Don't fall for import filter again. mnFrameType = SwFrameType::Tab; @@ -121,7 +120,6 @@ SwTabFrame::SwTabFrame( SwTabFrame &rTab ) , m_bConsiderObjsForMinCellHeight(true) , m_bObjsDoesFit(true) , m_bInRecalcLowerRow(false) - , m_bSplitRowDisabled(false) { mbFixSize = false; //Don't fall for import filter again. mnFrameType = SwFrameType::Tab; @@ -1054,7 +1052,7 @@ bool SwTabFrame::Split( const SwTwips nCutPos, bool bTryToSplit, bool bTableRowK // table, or it will be set to false under certain // conditions that are not suitable for splitting // the row. - bool bSplitRowAllowed = pRow->IsRowSplitAllowed() && !IsSplitRowDisabled(); + bool bSplitRowAllowed = pRow->IsRowSplitAllowed(); // #i29438# // #i26945# - Floating screen objects no longer forbid commit 182058bca63761ced9654e9ae767a718b33c669b Author: Stephan Bergmann <sberg...@redhat.com> AuthorDate: Tue May 18 12:58:34 2021 +0200 Commit: Samuel Mehrbrodt <samuel.mehrbr...@allotropia.de> CommitDate: Mon Jan 17 11:48:04 2022 +0100 tdf#142326: Adapt to "libstdc++: Implement LWG 1203 for rvalue iostreams" ...for libstdc++ 11.2, similar to 1f3dddd6f21d91c429190ae314dadeec409f35f4 "Adapt to "libstdc++: Implement LWG 1203 for rvalue iostreams" for libstdc++ 12. The libstdc++ change referenced there has been backported to the releases/gcc-11 branch past the releases/gcc-11.1.0 tag (i.e., only towards libstdc++ 11.2) as <https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=ca7d2f2ec9142995179a5d832a946b50de05e659> "libstdc++: Implement LWG 1203 for rvalue iostreams". According to <https://gcc.gnu.org/onlinedocs/libstdc++/manual/using_macros.html>, <https://gcc.gnu.org/onlinedocs/libstdc++/manual/abi.html#abi.versioning.__GLIBCXX__>, and <https://gcc.gnu.org/develop.html#timeline>, the right __GLIBCXX__ value for libstdc++ 11.1 should be 20210427, but at least libstdc++-devel-11.1.1-1.fc34.x86_64 defines it as 20210428 while not including the above "libstdc++: Implement LWG 1203 for rvalue iostreams" commit, so use that value here. Change-Id: I4e2c6d6ad8156a83f5c4bc861e4a118271928a20 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115738 Reviewed-by: Stephan Bergmann <sberg...@redhat.com> Tested-by: Jenkins (cherry picked from commit 95e26d3dce4f5a3b2d010d5ca47b4e450905a100) diff --git a/include/sal/log.hxx b/include/sal/log.hxx index 87ffba65490b..f85c7d882134 100644 --- a/include/sal/log.hxx +++ b/include/sal/log.hxx @@ -161,7 +161,9 @@ inline char const * unwrapStream(SAL_UNUSED_PARAMETER StreamIgnore const &) { @since LibreOffice 3.5 */ -#if defined _LIBCPP_VERSION || (defined _GLIBCXX_RELEASE && _GLIBCXX_RELEASE >= 12) \ +#if defined _LIBCPP_VERSION \ + || (defined _GLIBCXX_RELEASE \ + && (_GLIBCXX_RELEASE >= 12 || (_GLIBCXX_RELEASE == 11 && __GLIBCXX__ > 20210428))) \ || (defined _MSC_VER && _MSC_VER >= 1915) #define SAL_STREAM(stream) \ (::std::ostringstream() << stream).str() commit d83a246b2358c9e2dcf43e963d27e369c5039d91 Author: Stephan Bergmann <sberg...@redhat.com> AuthorDate: Wed May 5 08:20:18 2021 +0200 Commit: Samuel Mehrbrodt <samuel.mehrbr...@allotropia.de> CommitDate: Mon Jan 17 11:47:50 2022 +0100 Adapt to "libstdc++: Implement LWG 1203 for rvalue iostreams" <https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=aa475c4ac80733f85ba47b109fc1900f05e810e2> towards GCC 12, so that now "the return type is the original rvalue stream type not its base class." (And which would thus have caused issues like > sfx2/source/control/bindings.cxx:1323:19: error: dynamic_cast from rvalue to reference type '::std::ostringstream &' (aka 'basic_ostringstream<char> &') > ? SAL_STREAM("File: " << pFile << " Line: " << nLine) : "")); > ~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > include/sal/log.hxx:198:6: note: expanded from macro 'SAL_STREAM' > (dynamic_cast< ::std::ostringstream & >(::std::ostringstream() << stream).str()) > ^ > include/sal/log.hxx:341:20: note: expanded from macro 'SAL_INFO' > SAL_WHERE, stream) > ~~~~~~~~~~~^~~~~~~ > include/sal/log.hxx:155:68: note: expanded from macro 'SAL_DETAIL_LOG_STREAM' > SAL_DETAIL_LOG_STREAM_PRIVATE_(level, area, where, stream); \ > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~ > include/sal/log.hxx:133:45: note: expanded from macro 'SAL_DETAIL_LOG_STREAM_PRIVATE_' > ::sal::detail::StreamStart() << stream) == 1) \ > ^~~~~~ now. While the issue with old libstdc++ that originally prompted the dynamic_cast was > sfx2/source/control/bindings.cxx:1323:19: error: no member named 'str' in 'std::basic_ostream<char>' > ? SAL_STREAM("File: " << pFile << " Line: " << nLine) : "")); > ~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > include/sal/log.hxx:194:40: note: expanded from macro 'SAL_STREAM' > (::std::ostringstream() << stream).str() > ^ > include/sal/log.hxx:336:20: note: expanded from macro 'SAL_INFO' > SAL_WHERE, stream) > ~~~~~~~~~~~^~~~~~~ > include/sal/log.hxx:155:68: note: expanded from macro 'SAL_DETAIL_LOG_STREAM' > SAL_DETAIL_LOG_STREAM_PRIVATE_(level, area, where, stream); \ > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~ > include/sal/log.hxx:133:45: note: expanded from macro 'SAL_DETAIL_LOG_STREAM_PRIVATE_' > ::sal::detail::StreamStart() << stream) == 1) \ > ^~~~~~ .) The libstdc++ macro _GLIBCXX_RELEASE is reportedly available since GCC 7.1. Change-Id: I1ee6eabb66355c1f28b9d305cbd85bac50d6b0e1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115121 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sberg...@redhat.com> (cherry picked from commit 1f3dddd6f21d91c429190ae314dadeec409f35f4) diff --git a/include/sal/log.hxx b/include/sal/log.hxx index 00d533ab5495..87ffba65490b 100644 --- a/include/sal/log.hxx +++ b/include/sal/log.hxx @@ -161,7 +161,8 @@ inline char const * unwrapStream(SAL_UNUSED_PARAMETER StreamIgnore const &) { @since LibreOffice 3.5 */ -#if defined _LIBCPP_VERSION || (defined _MSC_VER && _MSC_VER >= 1915) +#if defined _LIBCPP_VERSION || (defined _GLIBCXX_RELEASE && _GLIBCXX_RELEASE >= 12) \ + || (defined _MSC_VER && _MSC_VER >= 1915) #define SAL_STREAM(stream) \ (::std::ostringstream() << stream).str() #else commit 4bd37fef4c97cc18bd12247dc8b4fad0d4cea591 Author: Mike Kaganski <mike.kagan...@collabora.com> AuthorDate: Fri Oct 8 17:06:01 2021 +0300 Commit: Samuel Mehrbrodt <samuel.mehrbr...@allotropia.de> CommitDate: Mon Jan 17 11:43:01 2022 +0100 Fix gpgmepp build with glibc posix-io.c: In function '_gpgme_io_spawn': posix-io.c:492:23: error: void value not ignored as it ought to be 492 | while ((i = closefrom (fd)) && errno == EINTR) | ^ make[1]: *** [Makefile:964: posix-io.lo] Error 1 Change-Id: I0e7abc33200ca7436c72e925447e681fd241c6a7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123260 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com> Reviewed-by: Jan Holesovsky <ke...@collabora.com> diff --git a/external/gpgmepp/UnpackedTarball_gpgmepp.mk b/external/gpgmepp/UnpackedTarball_gpgmepp.mk index 4dfee72890b5..66206cea0939 100644 --- a/external/gpgmepp/UnpackedTarball_gpgmepp.mk +++ b/external/gpgmepp/UnpackedTarball_gpgmepp.mk @@ -30,5 +30,6 @@ $(eval $(call gb_UnpackedTarball_add_patches,gpgmepp, \ $(if $(filter LINUX,$(OS)),external/gpgmepp/rpath.patch) \ external/gpgmepp/gcc9.patch \ external/gpgmepp/version.patch \ + external/gpgmepp/gpgme.git-4b64774b6d13ffa4f59dddf947a97d61bcfa2f2e.patch.1 \ )) # vim: set noet sw=4 ts=4: diff --git a/external/gpgmepp/gpgme.git-4b64774b6d13ffa4f59dddf947a97d61bcfa2f2e.patch.1 b/external/gpgmepp/gpgme.git-4b64774b6d13ffa4f59dddf947a97d61bcfa2f2e.patch.1 new file mode 100644 index 000000000000..538a5264bed4 --- /dev/null +++ b/external/gpgmepp/gpgme.git-4b64774b6d13ffa4f59dddf947a97d61bcfa2f2e.patch.1 @@ -0,0 +1,32 @@ +From 4b64774b6d13ffa4f59dddf947a97d61bcfa2f2e Mon Sep 17 00:00:00 2001 +From: Jiri Kucera <sanc...@gmail.com> +Date: Sun, 25 Jul 2021 11:35:54 +0200 +Subject: [PATCH] core: Support closefrom also for glibc. + +* src/posix-io.c (_gpgme_io_spawn): Use glibc's closefrom. +-- + +Since 2.34, glibc introduces closefrom (the implementation +follows *BSD standard). + +Signed-off-by: Werner Koch <w...@gnupg.org> +--- + src/posix-io.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/posix-io.c b/src/posix-io.c +index e712ef28..2a3a81fc 100644 +--- a/src/posix-io.c ++++ b/src/posix-io.c +@@ -570,7 +570,7 @@ _gpgme_io_spawn (const char *path, char *const argv[], unsigned int flags, + if (fd_list[i].fd > fd) + fd = fd_list[i].fd; + fd++; +-#ifdef __sun ++#if defined(__sun) || defined(__GLIBC__) + closefrom (fd); + max_fds = fd; + #else /*!__sun */ +-- +2.11.0 +