From 27aea68a073b1190d00d447d056657ad2dc49717 Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Oct 30 2018 04:51:39 +0000 Subject: import libreoffice-5.3.6.1-19.el7 --- diff --git a/SOURCES/0001-Related-tdf-100925-background-not-getting-set-under-.patch b/SOURCES/0001-Related-tdf-100925-background-not-getting-set-under-.patch new file mode 100644 index 0000000..d367dff --- /dev/null +++ b/SOURCES/0001-Related-tdf-100925-background-not-getting-set-under-.patch @@ -0,0 +1,44 @@ +From dd53132119ca8640eea82bfaf26c85f4542ce8c2 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= +Date: Thu, 12 Apr 2018 14:53:20 +0100 +Subject: [PATCH] Related: tdf#100925 background not getting set under X + sometimes + +not sure why this is the case, but it is reminiscent of rhbz#1283420 which +results in missing glyphs in some circumstances +X11CairoTextRender::getCairoContext has a hack in it for that problem, whic +forces a read from the underlying X Drawable before writing to it which seems +to have the effect of syncing it up. + +So, just before drawing the bg, draw a glyph on it to get it synced, and then +overwrite it. + +Change-Id: I2ffff7e8e989b91821869d8b75a59728ac513d1b +Reviewed-on: https://gerrit.libreoffice.org/52819 +Tested-by: Jenkins +Reviewed-by: Eike Rathke +--- + sc/source/ui/view/gridwin4.cxx | 7 ++++++- + 1 file changed, 6 insertions(+), 1 deletion(-) + +diff --git a/sc/source/ui/view/gridwin4.cxx b/sc/source/ui/view/gridwin4.cxx +index cc8b0ee..ba3622d 100644 +--- a/sc/source/ui/view/gridwin4.cxx ++++ b/sc/source/ui/view/gridwin4.cxx +@@ -1038,7 +1038,12 @@ void ScGridWindow::DrawContent(OutputDevice &rDevice, const ScTableInfo& rTableI + } + + // paint the background +- rDevice.DrawRect(rDevice.PixelToLogic(aBackground)); ++ Rectangle aLogicRect(rDevice.PixelToLogic(aBackground)); ++ //tdf#100925, rhbz#1283420, Draw some text here, to get ++ //X11CairoTextRender::getCairoContext called, so that the forced read ++ //from the underlying X Drawable gets it to sync. ++ rDevice.DrawText(aLogicRect.BottomLeft(), " "); ++ rDevice.DrawRect(aLogicRect); + + // paint the editeng text + Rectangle aEditRect(Point(nScrX, nScrY), Size(aOutputData.GetScrW(), aOutputData.GetScrH())); +-- +2.14.3 + diff --git a/SOURCES/0001-Related-tdf-106577-extend-damage-rect-a-little-for-T.patch b/SOURCES/0001-Related-tdf-106577-extend-damage-rect-a-little-for-T.patch new file mode 100644 index 0000000..269644d --- /dev/null +++ b/SOURCES/0001-Related-tdf-106577-extend-damage-rect-a-little-for-T.patch @@ -0,0 +1,29 @@ +From edc58993ec81824d2822f0aa623fcbaa0a679fa5 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= +Date: Mon, 20 Mar 2017 15:18:30 +0000 +Subject: [PATCH] Related: tdf#106577 extend damage rect a little for + TrackFrame + +Change-Id: I007ab53ba841c7c4a0f13bc9e7e306e88303191f +--- + vcl/headless/svpgdi.cxx | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/vcl/headless/svpgdi.cxx b/vcl/headless/svpgdi.cxx +index 925a5adecd55..8449c9988da0 100644 +--- a/vcl/headless/svpgdi.cxx ++++ b/vcl/headless/svpgdi.cxx +@@ -1189,6 +1189,10 @@ void SvpSalGraphics::invert(const basegfx::B2DPolygon &rPoly, SalInvert nFlags) + cairo_set_dash(cr, dashLengths, 2, 0); + + extents = getClippedStrokeDamage(cr); ++ //see tdf#106577 under wayland, some pixel droppings seen, maybe we're ++ //out by one somewhere, or cairo_stroke_extents is confused by ++ //dashes/line width ++ extents.grow(1); + + cairo_stroke(cr); + } +-- +2.17.1 + diff --git a/SOURCES/0001-Resolves-rhbz-1545262-Workaround-for-spurious-ppc64l.patch b/SOURCES/0001-Resolves-rhbz-1545262-Workaround-for-spurious-ppc64l.patch new file mode 100644 index 0000000..da164f8 --- /dev/null +++ b/SOURCES/0001-Resolves-rhbz-1545262-Workaround-for-spurious-ppc64l.patch @@ -0,0 +1,34 @@ +From b9071e63980ea644ed21cd5fa99850cbed44da79 Mon Sep 17 00:00:00 2001 +From: Stephan Bergmann +Date: Wed, 25 Jul 2018 11:10:17 +0200 +Subject: [PATCH] Resolves: rhbz#1545262 Workaround for spurious ppc64le + automated testing crash + +Change-Id: Ia24a3803bb02e0d6e12561566e11659d554fb739 +--- + vcl/unx/gtk3/gtk3gtkframe.cxx | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/vcl/unx/gtk3/gtk3gtkframe.cxx b/vcl/unx/gtk3/gtk3gtkframe.cxx +index 9d21f7b13b7b..ec1a63302e97 100644 +--- a/vcl/unx/gtk3/gtk3gtkframe.cxx ++++ b/vcl/unx/gtk3/gtk3gtkframe.cxx +@@ -2824,6 +2824,7 @@ void GtkSalFrame::gestureSwipe(GtkGestureSwipe* gesture, gdouble velocity_x, gdo + + void GtkSalFrame::gestureLongPress(GtkGestureLongPress* gesture, gpointer frame) + { ++#if !(defined __powerpc64__ && defined __LITTLE_ENDIAN__) // Hack to work around rhbz#1545262 + GtkSalFrame* pThis = static_cast(frame); + + if(pThis) +@@ -2838,6 +2839,7 @@ void GtkSalFrame::gestureLongPress(GtkGestureLongPress* gesture, gpointer frame) + + pThis->CallCallbackExc(SalEvent::LongPress, &aEvent); + } ++#endif + } + + #endif +-- +2.17.1 + diff --git a/SOURCES/0001-Resolves-rhbz-1546997-search-not-found-at-0-0-when-w.patch b/SOURCES/0001-Resolves-rhbz-1546997-search-not-found-at-0-0-when-w.patch new file mode 100644 index 0000000..71f76ef --- /dev/null +++ b/SOURCES/0001-Resolves-rhbz-1546997-search-not-found-at-0-0-when-w.patch @@ -0,0 +1,114 @@ +From d83c1e5de554b7722d0a3161ba757e6e4785810e Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= +Date: Tue, 20 Feb 2018 13:59:08 +0000 +Subject: [PATCH] Resolves: rhbz#1546997 'search not found' at 0,0 when window + too narrow +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +if the statusbar hadn't got space for the initial label, then it doesn't get set a position, +so when later forced visible it draws at 0,0 + +call Resize on the toolbox to get it to relayout, and while we're at it +set the required size of the label so we might have space for it if that +text is shorter than the original len allocation + +Change-Id: I37d20125d8195b2c75e83e9673c82c2011ceda8e +Reviewed-on: https://gerrit.libreoffice.org/50041 +Reviewed-by: Caolán McNamara +Tested-by: Caolán McNamara +--- + svx/source/dialog/srchdlg.cxx | 48 ++++++++++++++++++++----------------------- + 1 file changed, 22 insertions(+), 26 deletions(-) + +diff --git a/svx/source/dialog/srchdlg.cxx b/svx/source/dialog/srchdlg.cxx +index 4cea924..50c19a3 100644 +--- a/svx/source/dialog/srchdlg.cxx ++++ b/svx/source/dialog/srchdlg.cxx +@@ -2375,11 +2375,11 @@ SfxChildWinInfo SvxSearchDialogWrapper::GetInfo() const + } + + +-static vcl::Window* lcl_GetSearchLabelWindow() ++static void lcl_SetSearchLabelWindow(const OUString& rStr) + { + SfxViewFrame* pViewFrame = SfxViewFrame::Current(); + if (!pViewFrame) +- return nullptr; ++ return; + + css::uno::Reference< css::beans::XPropertySet > xPropSet( + pViewFrame->GetFrame().GetFrameInterface(), css::uno::UNO_QUERY_THROW); +@@ -2388,14 +2388,28 @@ static vcl::Window* lcl_GetSearchLabelWindow() + css::uno::Reference< css::ui::XUIElement > xUIElement = + xLayoutManager->getElement("private:resource/toolbar/findbar"); + if (!xUIElement.is()) +- return nullptr; ++ return; + css::uno::Reference< css::awt::XWindow > xWindow( + xUIElement->getRealInterface(), css::uno::UNO_QUERY_THROW); + VclPtr< ToolBox > pToolBox = static_cast( VCLUnoHelper::GetWindow(xWindow).get() ); +- for (size_t i = 0; pToolBox && i < pToolBox->GetItemCount(); ++i) ++ if (!pToolBox) ++ return; ++ for (size_t i = 0; i < pToolBox->GetItemCount(); ++i) ++ { + if (pToolBox->GetItemCommand(i) == ".uno:SearchLabel") +- return pToolBox->GetItemWindow(i); +- return nullptr; ++ { ++ vcl::Window* pSearchLabel = pToolBox->GetItemWindow(i); ++ assert(pSearchLabel); ++ pSearchLabel->Hide(); ++ pSearchLabel->SetText(rStr); ++ if (!rStr.isEmpty()) ++ { ++ pSearchLabel->SetSizePixel(pSearchLabel->get_preferred_size()); ++ pSearchLabel->Show(); ++ } ++ } ++ } ++ pToolBox->Resize(); + } + + void SvxSearchDialogWrapper::SetSearchLabel(const SearchLabel& rSL) +@@ -2410,16 +2424,7 @@ void SvxSearchDialogWrapper::SetSearchLabel(const SearchLabel& rSL) + else if (rSL == SearchLabel::NotFound) + sStr = SVX_RESSTR(RID_SVXSTR_SEARCH_NOT_FOUND); + +- if (vcl::Window *pSearchLabel = lcl_GetSearchLabelWindow()) +- { +- if (sStr.isEmpty()) +- pSearchLabel->Hide(); +- else +- { +- pSearchLabel->SetText(sStr); +- pSearchLabel->Show(); +- } +- } ++ lcl_SetSearchLabelWindow(sStr); + if (SvxSearchDialogWrapper *pWrp = static_cast( SfxViewFrame::Current()-> + GetChildWindow( SvxSearchDialogWrapper::GetChildWindowId() ))) + pWrp->getDialog()->SetSearchLabel(sStr); +@@ -2428,16 +2433,7 @@ void SvxSearchDialogWrapper::SetSearchLabel(const SearchLabel& rSL) + void SvxSearchDialogWrapper::SetSearchLabel(const OUString& sStr) + { + +- if (vcl::Window *pSearchLabel = lcl_GetSearchLabelWindow()) +- { +- if (sStr.isEmpty()) +- pSearchLabel->Hide(); +- else +- { +- pSearchLabel->SetText(sStr); +- pSearchLabel->Show(); +- } +- } ++ lcl_SetSearchLabelWindow(sStr); + if (SvxSearchDialogWrapper *pWrp = static_cast( SfxViewFrame::Current()-> + GetChildWindow( SvxSearchDialogWrapper::GetChildWindowId() ))) + pWrp->getDialog()->SetSearchLabel(sStr); +-- +2.14.3 + diff --git a/SOURCES/0001-Resolves-rhbz-1610692-rectangles-ctor-takes-topleft-.patch b/SOURCES/0001-Resolves-rhbz-1610692-rectangles-ctor-takes-topleft-.patch new file mode 100644 index 0000000..a3ac62d --- /dev/null +++ b/SOURCES/0001-Resolves-rhbz-1610692-rectangles-ctor-takes-topleft-.patch @@ -0,0 +1,38 @@ +From c80f2f59e9fb08543ec599c6552d610c0e41629b Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= +Date: Wed, 1 Aug 2018 10:10:16 +0100 +Subject: [PATCH] Resolves: rhbz#1610692 rectangles ctor takes topleft, + bottomright points + +so pass arguments in the topleft, bottomright order to avoid eventual... + +Gtk-CRITICAL **: 09:43:33.896: gtk_widget_queue_draw_area: assertion 'height >= 0' failed + +Change-Id: I2396f49470274331c49275a5e6d707f59277be4a +--- + vcl/source/control/fixed.cxx | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +diff --git a/vcl/source/control/fixed.cxx b/vcl/source/control/fixed.cxx +index 2cf897c2fd82..b758f3586a60 100644 +--- a/vcl/source/control/fixed.cxx ++++ b/vcl/source/control/fixed.cxx +@@ -531,11 +531,11 @@ void FixedLine::ImplDraw(vcl::RenderContext& rRenderContext) + rRenderContext.DrawText(aTextPt, aText, 0, aText.getLength()); + rRenderContext.Pop(); + if (aOutSize.Height() - aStartPt.Y() > FIXEDLINE_TEXT_BORDER) +- aDecoView.DrawSeparator(Point(aStartPt.X(), aOutSize.Height() - 1), +- Point(aStartPt.X(), aStartPt.Y() + FIXEDLINE_TEXT_BORDER)); ++ aDecoView.DrawSeparator(Point(aStartPt.X(), aStartPt.Y() + FIXEDLINE_TEXT_BORDER), ++ Point(aStartPt.X(), aOutSize.Height() - 1)); + if (aStartPt.Y() - nWidth - FIXEDLINE_TEXT_BORDER > 0) +- aDecoView.DrawSeparator(Point(aStartPt.X(), aStartPt.Y() - nWidth - FIXEDLINE_TEXT_BORDER), +- Point(aStartPt.X(), 0)); ++ aDecoView.DrawSeparator(Point(aStartPt.X(), 0), ++ Point(aStartPt.X(), aStartPt.Y() - nWidth - FIXEDLINE_TEXT_BORDER)); + } + else + { +-- +2.14.4 + diff --git a/SOURCES/0001-Resolves-rhbz-1614419-crash-in-pptx-nss-usage-under-.patch b/SOURCES/0001-Resolves-rhbz-1614419-crash-in-pptx-nss-usage-under-.patch new file mode 100644 index 0000000..67a4edb --- /dev/null +++ b/SOURCES/0001-Resolves-rhbz-1614419-crash-in-pptx-nss-usage-under-.patch @@ -0,0 +1,41 @@ +From 59f6c408ba822147fd4b9b47d84dab537fb8554d Mon Sep 17 00:00:00 2001 +From: rpmbuild +Date: Fri, 10 Aug 2018 08:26:23 +0100 +Subject: [PATCH] Resolves: rhbz#1614419 crash in pptx nss usage under fips + +--- + oox/source/crypto/CryptTools.cxx | 11 ++++++++--- + 1 file changed, 8 insertions(+), 3 deletions(-) + +diff --git a/oox/source/crypto/CryptTools.cxx b/oox/source/crypto/CryptTools.cxx +index 4bb3ec2..5ecf7b3 100644 +--- a/oox/source/crypto/CryptTools.cxx ++++ b/oox/source/crypto/CryptTools.cxx +@@ -36,9 +36,12 @@ Crypto::~Crypto() + EVP_CIPHER_CTX_cleanup( &mContext ); + #endif + #if USE_TLS_NSS +- PK11_DestroyContext( mContext, PR_TRUE ); +- PK11_FreeSymKey( mSymKey ); +- SECITEM_FreeItem( mSecParam, PR_TRUE ); ++ if (mContext) ++ PK11_DestroyContext(mContext, PR_TRUE); ++ if (mSymKey) ++ PK11_FreeSymKey(mSymKey); ++ if (mSecParam) ++ SECITEM_FreeItem(mSecParam, PR_TRUE); + #endif + } + +@@ -103,6 +106,8 @@ void Crypto::setupContext(vector& key, vector& iv, CryptoT + keyItem.len = key.size(); + + mSymKey = PK11_ImportSymKey( pSlot, mechanism, PK11_OriginUnwrap, CKA_ENCRYPT, &keyItem, nullptr ); ++ if (!mSymKey) ++ throw css::uno::RuntimeException("NSS SymKey failure", css::uno::Reference()); + mSecParam = PK11_ParamFromIV( mechanism, pIvItem ); + mContext = PK11_CreateContextBySymKey( mechanism, operation, mSymKey, mSecParam ); + } +-- +1.8.3.1 + diff --git a/SOURCES/0001-ofz-5747-short-sal_Int32-like-in-StgDataStrm.patch b/SOURCES/0001-ofz-5747-short-sal_Int32-like-in-StgDataStrm.patch new file mode 100644 index 0000000..4025bc9 --- /dev/null +++ b/SOURCES/0001-ofz-5747-short-sal_Int32-like-in-StgDataStrm.patch @@ -0,0 +1,60 @@ +From 368116f6d97e9bf10a6e12368191cd42844902b5 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= +Date: Sat, 27 Jan 2018 19:38:12 +0000 +Subject: [PATCH] ofz#5747 short->sal_Int32 like in StgDataStrm +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Change-Id: I254c00b1142d7187beabe5d18532efec036de494 +Reviewed-on: https://gerrit.libreoffice.org/48751 +Tested-by: Jenkins +Reviewed-by: Caolán McNamara +Tested-by: Caolán McNamara +--- + sot/source/sdstor/stgstrms.cxx | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +diff --git a/sot/source/sdstor/stgstrms.cxx b/sot/source/sdstor/stgstrms.cxx +index 7063a4c..d9ec341 100644 +--- a/sot/source/sdstor/stgstrms.cxx ++++ b/sot/source/sdstor/stgstrms.cxx +@@ -1047,7 +1047,7 @@ sal_Int32 StgSmallStrm::Read( void* pBuf, sal_Int32 n ) + // small stream is likely to be < 64 KBytes. + if( ( m_nPos + n ) > m_nSize ) + n = m_nSize - m_nPos; +- short nDone = 0; ++ sal_Int32 nDone = 0; + while( n ) + { + short nBytes = m_nPageSize - m_nOffset; +@@ -1059,7 +1059,7 @@ sal_Int32 StgSmallStrm::Read( void* pBuf, sal_Int32 n ) + break; + // all reading through the stream + short nRes = (short) m_pData->Read( static_cast(pBuf) + nDone, nBytes ); +- nDone = nDone + nRes; ++ nDone += nRes; + m_nPos += nRes; + n -= nRes; + m_nOffset = m_nOffset + nRes; +@@ -1078,7 +1078,7 @@ sal_Int32 StgSmallStrm::Write( const void* pBuf, sal_Int32 n ) + { + // you can safely assume that reads are not huge, since the + // small stream is likely to be < 64 KBytes. +- short nDone = 0; ++ sal_Int32 nDone = 0; + if( ( m_nPos + n ) > m_nSize ) + { + sal_Int32 nOld = m_nPos; +@@ -1102,7 +1102,7 @@ sal_Int32 StgSmallStrm::Write( const void* pBuf, sal_Int32 n ) + if( !m_pData->Pos2Page( nDataPos ) ) + break; + short nRes = (short) m_pData->Write( static_cast(pBuf) + nDone, nBytes ); +- nDone = nDone + nRes; ++ nDone += nRes; + m_nPos += nRes; + n -= nRes; + m_nOffset = m_nOffset + nRes; +-- +2.14.3 + diff --git a/SOURCES/0001-ofz-6173-check-index-before-use.patch b/SOURCES/0001-ofz-6173-check-index-before-use.patch new file mode 100644 index 0000000..64f49df --- /dev/null +++ b/SOURCES/0001-ofz-6173-check-index-before-use.patch @@ -0,0 +1,35 @@ +From ce58f18222a7b20e02bb5b3b8b328b11b1c29a31 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= +Date: Fri, 9 Feb 2018 10:49:39 +0000 +Subject: [PATCH] ofz#6173 check index before use +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Change-Id: I09d15ab324af0a8b3566f11868eb3266a68c4afe +Reviewed-on: https://gerrit.libreoffice.org/49486 +Tested-by: Jenkins +Reviewed-by: Caolán McNamara +Tested-by: Caolán McNamara +--- + sw/source/filter/ww8/ww8toolbar.cxx | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/sw/source/filter/ww8/ww8toolbar.cxx b/sw/source/filter/ww8/ww8toolbar.cxx +index 15c0abb..3686a73 100644 +--- a/sw/source/filter/ww8/ww8toolbar.cxx ++++ b/sw/source/filter/ww8/ww8toolbar.cxx +@@ -167,7 +167,9 @@ bool SwCTBWrapper::Read( SvStream& rS ) + std::vector< sal_Int16 >::iterator it_end = dropDownMenuIndices.end(); + for ( std::vector< sal_Int16 >::iterator it = dropDownMenuIndices.begin(); it != it_end; ++it ) + { +- rCustomizations[ *it ].bIsDroppedMenuTB = true; ++ if (*it < 0 || static_cast(*it) >= rCustomizations.size()) ++ continue; ++ rCustomizations[*it].bIsDroppedMenuTB = true; + } + return rS.good(); + } +-- +2.14.3 + diff --git a/SOURCES/0001-rhbz-1589029-impress-not-showing-text-highlight-in-p.patch b/SOURCES/0001-rhbz-1589029-impress-not-showing-text-highlight-in-p.patch new file mode 100644 index 0000000..f4eaf13 --- /dev/null +++ b/SOURCES/0001-rhbz-1589029-impress-not-showing-text-highlight-in-p.patch @@ -0,0 +1,471 @@ +From 84fd42edf49efd3af6966efb4e326c6fbb37d56f Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= +Date: Mon, 11 Jun 2018 09:00:46 +0100 +Subject: [PATCH] rhbz#1589029 impress not showing text highlight in + presentation mode + +the text hightlighting feature was implemented backed on to the vcl +TextFillColor feature. TextFillColor fills the background of the bounds +of the text with that color + +Likely either the same problem or similar as tdf#93789 + +Change-Id: Iace62cedc49e5f5844ac35d3caa23249b6cb4bc1 +--- + cppcanvas/source/mtfrenderer/emfplus.cxx | 2 + + cppcanvas/source/mtfrenderer/implrenderer.cxx | 6 + + cppcanvas/source/mtfrenderer/textaction.cxx | 131 +++++++++++++++--- + cppcanvas/source/mtfrenderer/textaction.hxx | 1 + + 4 files changed, 119 insertions(+), 21 deletions(-) + +diff --git a/cppcanvas/source/mtfrenderer/emfplus.cxx b/cppcanvas/source/mtfrenderer/emfplus.cxx +index 1da733bd9f73..9b5fae31d584 100644 +--- a/cppcanvas/source/mtfrenderer/emfplus.cxx ++++ b/cppcanvas/source/mtfrenderer/emfplus.cxx +@@ -1318,6 +1318,7 @@ namespace cppcanvas + ::Color(), + ::Size(), + ::Color(), ++ ::Color(), + text, + 0, + stringLength, +@@ -1633,6 +1634,7 @@ namespace cppcanvas + ::Color(), + ::Size(), + ::Color(), ++ ::Color(), + text, + 0, + glyphsCount, +diff --git a/cppcanvas/source/mtfrenderer/implrenderer.cxx b/cppcanvas/source/mtfrenderer/implrenderer.cxx +index ad9098defc69..38694caec091 100644 +--- a/cppcanvas/source/mtfrenderer/implrenderer.cxx ++++ b/cppcanvas/source/mtfrenderer/implrenderer.cxx +@@ -876,6 +876,7 @@ namespace cppcanvas + // TODO(F2): implement all text effects + // if( rState.textAlignment ); // TODO(F2): NYI + ++ ::Color aTextFillColor( COL_AUTO ); + ::Color aShadowColor( COL_AUTO ); + ::Color aReliefColor( COL_AUTO ); + ::Size aShadowOffset; +@@ -941,6 +942,9 @@ namespace cppcanvas + aReliefColor.SetTransparency( aTextColor.GetTransparency() ); + } + ++ if (rState.isTextFillColorSet) ++ aTextFillColor = vcl::unotools::doubleSequenceToColor(rState.textFillColor, xColorSpace); ++ + // create the actual text action + ActionSharedPtr pTextAction( + TextActionFactory::createTextAction( +@@ -949,6 +953,7 @@ namespace cppcanvas + aReliefColor, + aShadowOffset, + aShadowColor, ++ aTextFillColor, + rString, + nIndex, + nLength, +@@ -1015,6 +1020,7 @@ namespace cppcanvas + aReliefColor, + aShadowOffset, + aShadowColor, ++ aTextFillColor, + aStrikeoutText, + nStartPos, + aStrikeoutText.getLength(), +diff --git a/cppcanvas/source/mtfrenderer/textaction.cxx b/cppcanvas/source/mtfrenderer/textaction.cxx +index 51554a2e3595..0c5ef91354e3 100644 +--- a/cppcanvas/source/mtfrenderer/textaction.cxx ++++ b/cppcanvas/source/mtfrenderer/textaction.cxx +@@ -472,7 +472,7 @@ namespace cppcanvas + virtual ~TextRenderer() {} + + /// Render text with given RenderState +- virtual bool operator()( const rendering::RenderState& rRenderState ) const = 0; ++ virtual bool operator()( const rendering::RenderState& rRenderState, const ::Color& rTextFillColor ) const = 0; + }; + + /** Render effect text. +@@ -489,7 +489,8 @@ namespace cppcanvas + const ::Color& rShadowColor, + const ::basegfx::B2DSize& rShadowOffset, + const ::Color& rReliefColor, +- const ::basegfx::B2DSize& rReliefOffset ) ++ const ::basegfx::B2DSize& rReliefOffset, ++ const ::Color& rTextFillColor ) + { + ::Color aEmptyColor( COL_AUTO ); + uno::Reference xColorSpace( +@@ -510,7 +511,7 @@ namespace cppcanvas + vcl::unotools::colorToDoubleSequence( rShadowColor, + xColorSpace ); + +- rRenderer( aShadowState ); ++ rRenderer( aShadowState, rTextFillColor ); + } + + // draw relief text, if enabled +@@ -528,11 +529,11 @@ namespace cppcanvas + vcl::unotools::colorToDoubleSequence( rReliefColor, + xColorSpace ); + +- rRenderer( aReliefState ); ++ rRenderer( aReliefState, rTextFillColor ); + } + + // draw normal text +- rRenderer( rRenderState ); ++ rRenderer( rRenderState, rTextFillColor ); + + return true; + } +@@ -803,7 +804,10 @@ namespace cppcanvas + + private: + /// Interface TextRenderer +- virtual bool operator()( const rendering::RenderState& rRenderState ) const override; ++ virtual bool operator()( const rendering::RenderState& rRenderState, const ::Color& rTextFillColor ) const override; ++ ++ geometry::RealRectangle2D queryTextBounds() const; ++ css::uno::Reference queryTextBounds(const uno::Reference& rCanvas) const; + + // TODO(P2): This is potentially a real mass object + // (every character might be a separate TextAction), +@@ -824,6 +828,7 @@ namespace cppcanvas + const ::Color maReliefColor; + const ::basegfx::B2DSize maShadowOffset; + const ::Color maShadowColor; ++ const ::Color maTextFillColor; + const sal_Int8 maTextDirection; + }; + +@@ -906,7 +911,7 @@ namespace cppcanvas + "::cppcanvas::internal::EffectTextAction(): Invalid font or lines" ); + } + +- bool EffectTextAction::operator()( const rendering::RenderState& rRenderState ) const ++ bool EffectTextAction::operator()( const rendering::RenderState& rRenderState, const ::Color& rTextFillColor ) const + { + const rendering::ViewState& rViewState( mpCanvas->getViewState() ); + const uno::Reference< rendering::XCanvas >& rCanvas( mpCanvas->getUNOCanvas() ); +@@ -915,6 +920,18 @@ namespace cppcanvas + rViewState, + rRenderState ); + ++ //rhbz#1589029 non-transparent text fill background support ++ ::Color aEmptyColor( COL_AUTO ); ++ if (rTextFillColor != aEmptyColor) ++ { ++ rendering::RenderState aLocalState( rRenderState ); ++ aLocalState.DeviceColor = vcl::unotools::colorToDoubleSequence( ++ rTextFillColor, rCanvas->getDevice()->getDeviceColorSpace()); ++ auto xTextBounds = queryTextBounds(rCanvas); ++ // background of text ++ rCanvas->fillPolyPolygon(xTextBounds, rViewState, aLocalState); ++ } ++ + rCanvas->drawText( maStringContext, mxFont, + rViewState, + rRenderState, +@@ -938,7 +955,8 @@ namespace cppcanvas + maShadowColor, + maShadowOffset, + maReliefColor, +- maReliefOffset ); ++ maReliefOffset, ++ maTextFillColor); + } + + bool EffectTextAction::renderSubset( const ::basegfx::B2DHomMatrix& rTransformation, +@@ -953,7 +971,7 @@ namespace cppcanvas + return render( rTransformation ); + } + +- ::basegfx::B2DRange EffectTextAction::getBounds( const ::basegfx::B2DHomMatrix& rTransformation ) const ++ geometry::RealRectangle2D EffectTextAction::queryTextBounds() const + { + // create XTextLayout, to have the + // XTextLayout::queryTextBounds() method available +@@ -963,11 +981,24 @@ namespace cppcanvas + maTextDirection, + 0 ) ); + ++ return xTextLayout->queryTextBounds(); ++ } ++ ++ css::uno::Reference EffectTextAction::queryTextBounds(const uno::Reference& rCanvas) const ++ { ++ auto aTextBounds = queryTextBounds(); ++ auto aB2DBounds = ::basegfx::unotools::b2DRectangleFromRealRectangle2D(aTextBounds); ++ auto aTextBoundsPoly = ::basegfx::tools::createPolygonFromRect(aB2DBounds); ++ return ::basegfx::unotools::xPolyPolygonFromB2DPolygon(rCanvas->getDevice(), aTextBoundsPoly); ++ } ++ ++ ::basegfx::B2DRange EffectTextAction::getBounds( const ::basegfx::B2DHomMatrix& rTransformation ) const ++ { + rendering::RenderState aLocalState( maState ); + ::canvas::tools::prependToRenderState(aLocalState, rTransformation); + + return calcEffectTextBounds( ::basegfx::unotools::b2DRectangleFromRealRectangle2D( +- xTextLayout->queryTextBounds() ), ++ queryTextBounds() ), + ::basegfx::B2DRange( 0,0, + maLinesOverallSize.getX(), + maLinesOverallSize.getY() ), +@@ -1188,6 +1219,7 @@ namespace cppcanvas + const ::Color& rReliefColor, + const ::basegfx::B2DSize& rShadowOffset, + const ::Color& rShadowColor, ++ const ::Color& rTextFillColor, + const OUString& rText, + sal_Int32 nStartPos, + sal_Int32 nLen, +@@ -1200,6 +1232,7 @@ namespace cppcanvas + const ::Color& rReliefColor, + const ::basegfx::B2DSize& rShadowOffset, + const ::Color& rShadowColor, ++ const ::Color& rTextFillColor, + const OUString& rText, + sal_Int32 nStartPos, + sal_Int32 nLen, +@@ -1224,7 +1257,9 @@ namespace cppcanvas + + private: + // TextRenderer interface +- virtual bool operator()( const rendering::RenderState& rRenderState ) const override; ++ virtual bool operator()( const rendering::RenderState& rRenderState, const ::Color& rTextFillColor ) const override; ++ ++ css::uno::Reference queryTextBounds(const uno::Reference& rCanvas) const; + + // TODO(P2): This is potentially a real mass object + // (every character might be a separate TextAction), +@@ -1243,6 +1278,7 @@ namespace cppcanvas + const ::Color maReliefColor; + const ::basegfx::B2DSize maShadowOffset; + const ::Color maShadowColor; ++ const ::Color maTextFillColor; + }; + + EffectTextArrayAction::EffectTextArrayAction( const ::basegfx::B2DPoint& rStartPoint, +@@ -1250,6 +1286,7 @@ namespace cppcanvas + const ::Color& rReliefColor, + const ::basegfx::B2DSize& rShadowOffset, + const ::Color& rShadowColor, ++ const ::Color& rTextFillColor, + const OUString& rText, + sal_Int32 nStartPos, + sal_Int32 nLen, +@@ -1266,7 +1303,8 @@ namespace cppcanvas + maReliefOffset( rReliefOffset ), + maReliefColor( rReliefColor ), + maShadowOffset( rShadowOffset ), +- maShadowColor( rShadowColor ) ++ maShadowColor( rShadowColor ), ++ maTextFillColor( rTextFillColor ) + { + initEffectLinePolyPolygon( maLinesOverallSize, + mxTextLines, +@@ -1290,6 +1328,7 @@ namespace cppcanvas + const ::Color& rReliefColor, + const ::basegfx::B2DSize& rShadowOffset, + const ::Color& rShadowColor, ++ const ::Color& rTextFillColor, + const OUString& rText, + sal_Int32 nStartPos, + sal_Int32 nLen, +@@ -1307,7 +1346,8 @@ namespace cppcanvas + maReliefOffset( rReliefOffset ), + maReliefColor( rReliefColor ), + maShadowOffset( rShadowOffset ), +- maShadowColor( rShadowColor ) ++ maShadowColor( rShadowColor ), ++ maTextFillColor( rTextFillColor ) + { + initEffectLinePolyPolygon( maLinesOverallSize, + mxTextLines, +@@ -1327,7 +1367,15 @@ namespace cppcanvas + &rTextTransform ); + } + +- bool EffectTextArrayAction::operator()( const rendering::RenderState& rRenderState ) const ++ css::uno::Reference EffectTextArrayAction::queryTextBounds(const uno::Reference& rCanvas) const ++ { ++ const geometry::RealRectangle2D aTextBounds(mxTextLayout->queryTextBounds()); ++ auto aB2DBounds = ::basegfx::unotools::b2DRectangleFromRealRectangle2D(aTextBounds); ++ auto aTextBoundsPoly = ::basegfx::tools::createPolygonFromRect(aB2DBounds); ++ return ::basegfx::unotools::xPolyPolygonFromB2DPolygon(rCanvas->getDevice(), aTextBoundsPoly); ++ } ++ ++ bool EffectTextArrayAction::operator()( const rendering::RenderState& rRenderState, const ::Color& rTextFillColor ) const + { + const rendering::ViewState& rViewState( mpCanvas->getViewState() ); + const uno::Reference< rendering::XCanvas >& rCanvas( mpCanvas->getUNOCanvas() ); +@@ -1336,6 +1384,18 @@ namespace cppcanvas + rViewState, + rRenderState ); + ++ //rhbz#1589029 non-transparent text fill background support ++ ::Color aEmptyColor( COL_AUTO ); ++ if (rTextFillColor != aEmptyColor) ++ { ++ rendering::RenderState aLocalState(rRenderState); ++ aLocalState.DeviceColor = vcl::unotools::colorToDoubleSequence( ++ rTextFillColor, rCanvas->getDevice()->getDeviceColorSpace()); ++ auto xTextBounds = queryTextBounds(rCanvas); ++ // background of text ++ rCanvas->fillPolyPolygon(xTextBounds, rViewState, aLocalState); ++ } ++ + rCanvas->drawTextLayout( mxTextLayout, + rViewState, + rRenderState ); +@@ -1358,7 +1418,8 @@ namespace cppcanvas + maShadowColor, + maShadowOffset, + maReliefColor, +- maReliefOffset ); ++ maReliefOffset, ++ maTextFillColor); + } + + class EffectTextArrayRenderHelper : public TextRenderer +@@ -1376,12 +1437,24 @@ namespace cppcanvas + } + + // TextRenderer interface +- virtual bool operator()( const rendering::RenderState& rRenderState ) const override ++ virtual bool operator()( const rendering::RenderState& rRenderState, const ::Color& rTextFillColor ) const override + { + mrCanvas->fillPolyPolygon( mrLinePolygon, + mrViewState, + rRenderState ); + ++ //rhbz#1589029 non-transparent text fill background support ++ ::Color aEmptyColor( COL_AUTO ); ++ if (rTextFillColor != aEmptyColor) ++ { ++ rendering::RenderState aLocalState(rRenderState); ++ aLocalState.DeviceColor = vcl::unotools::colorToDoubleSequence( ++ rTextFillColor, mrCanvas->getDevice()->getDeviceColorSpace()); ++ auto xTextBounds = queryTextBounds(); ++ // background of text ++ mrCanvas->fillPolyPolygon(xTextBounds, mrViewState, aLocalState); ++ } ++ + mrCanvas->drawTextLayout( mrTextLayout, + mrViewState, + rRenderState ); +@@ -1390,6 +1463,15 @@ namespace cppcanvas + } + + private: ++ ++ css::uno::Reference queryTextBounds() const ++ { ++ const geometry::RealRectangle2D aTextBounds(mrTextLayout->queryTextBounds()); ++ auto aB2DBounds = ::basegfx::unotools::b2DRectangleFromRealRectangle2D(aTextBounds); ++ auto aTextBoundsPoly = ::basegfx::tools::createPolygonFromRect(aB2DBounds); ++ return ::basegfx::unotools::xPolyPolygonFromB2DPolygon(mrCanvas->getDevice(), aTextBoundsPoly); ++ } ++ + const uno::Reference< rendering::XCanvas >& mrCanvas; + const uno::Reference< rendering::XTextLayout >& mrTextLayout; + const uno::Reference< rendering::XPolyPolygon2D >& mrLinePolygon; +@@ -1448,7 +1530,8 @@ namespace cppcanvas + maShadowColor, + maShadowOffset, + maReliefColor, +- maReliefOffset ); ++ maReliefOffset, ++ maTextFillColor); + } + + ::basegfx::B2DRange EffectTextArrayAction::getBounds( const ::basegfx::B2DHomMatrix& rTransformation ) const +@@ -1560,7 +1643,7 @@ namespace cppcanvas + + private: + // TextRenderer interface +- virtual bool operator()( const rendering::RenderState& rRenderState ) const override; ++ virtual bool operator()( const rendering::RenderState& rRenderState, const ::Color& rTextFillColor ) const override; + + // TODO(P2): This is potentially a real mass object + // (every character might be a separate TextAction), +@@ -1584,6 +1667,7 @@ namespace cppcanvas + const ::Color maReliefColor; + const ::basegfx::B2DSize maShadowOffset; + const ::Color maShadowColor; ++ const ::Color maTextFillColor; + }; + + double calcOutlineWidth( const OutDevState& rState, +@@ -1682,7 +1766,7 @@ namespace cppcanvas + rTextTransform ); + } + +- bool OutlineAction::operator()( const rendering::RenderState& rRenderState ) const ++ bool OutlineAction::operator()( const rendering::RenderState& rRenderState, const ::Color& /*rTextFillColor*/ ) const + { + const rendering::ViewState& rViewState( mpCanvas->getViewState() ); + const uno::Reference< rendering::XCanvas >& rCanvas( mpCanvas->getUNOCanvas() ); +@@ -1739,7 +1823,8 @@ namespace cppcanvas + maShadowColor, + maShadowOffset, + maReliefColor, +- maReliefOffset ); ++ maReliefOffset, ++ maTextFillColor); + } + + #if 0 // see #if'ed out use in OutlineAction::renderSubset below: +@@ -2048,6 +2133,7 @@ namespace cppcanvas + const ::Color& rReliefColor, + const ::Size& rShadowOffset, + const ::Color& rShadowColor, ++ const ::Color& rTextFillColor, + const OUString& rText, + sal_Int32 nStartPos, + sal_Int32 nLen, +@@ -2181,7 +2267,8 @@ namespace cppcanvas + !rState.textUnderlineStyle && + !rState.textStrikeoutStyle && + rReliefColor == aEmptyColor && +- rShadowColor == aEmptyColor ) ++ rShadowColor == aEmptyColor && ++ rTextFillColor == aEmptyColor ) + { + // nope + if( rParms.maTextTransformation.is_initialized() ) +@@ -2214,6 +2301,7 @@ namespace cppcanvas + rReliefColor, + aShadowOffset, + rShadowColor, ++ rTextFillColor, + rText, + nStartPos, + nLen, +@@ -2229,6 +2317,7 @@ namespace cppcanvas + rReliefColor, + aShadowOffset, + rShadowColor, ++ rTextFillColor, + rText, + nStartPos, + nLen, +diff --git a/cppcanvas/source/mtfrenderer/textaction.hxx b/cppcanvas/source/mtfrenderer/textaction.hxx +index 2c0b240fc847..1770470f9fff 100644 +--- a/cppcanvas/source/mtfrenderer/textaction.hxx ++++ b/cppcanvas/source/mtfrenderer/textaction.hxx +@@ -66,6 +66,7 @@ namespace cppcanvas + const ::Color& rReliefColor, + const ::Size& rShadowOffset, + const ::Color& rShadowColor, ++ const ::Color& rTextFillColor, + const OUString& rText, + sal_Int32 nStartPos, + sal_Int32 nLen, +-- +2.17.0 + diff --git a/SOURCES/0001-rhbz-1614419-use-workaround-for-PK11_ImportSymKey-fa.patch b/SOURCES/0001-rhbz-1614419-use-workaround-for-PK11_ImportSymKey-fa.patch new file mode 100644 index 0000000..5948889 --- /dev/null +++ b/SOURCES/0001-rhbz-1614419-use-workaround-for-PK11_ImportSymKey-fa.patch @@ -0,0 +1,162 @@ +From 3fe2dd8094fcec76a1310d3ab33c1cc27c85c356 Mon Sep 17 00:00:00 2001 +From: rpmbuild +Date: Fri, 10 Aug 2018 09:45:56 +0100 +Subject: [PATCH] rhbz#1614419 use workaround for PK11_ImportSymKey failure + under FIPS + +--- + include/oox/crypto/CryptTools.hxx | 3 ++ + oox/source/crypto/CryptTools.cxx | 83 +++++++++++++++++++++++++++++++++++---- + 2 files changed, 79 insertions(+), 7 deletions(-) + +diff --git a/include/oox/crypto/CryptTools.hxx b/include/oox/crypto/CryptTools.hxx +index 84e4c48..07605da 100644 +--- a/include/oox/crypto/CryptTools.hxx ++++ b/include/oox/crypto/CryptTools.hxx +@@ -56,9 +56,12 @@ protected: + EVP_CIPHER_CTX mContext; + #endif + #if USE_TLS_NSS ++ PK11SlotInfo* mSlot; + PK11Context* mContext; + SECItem* mSecParam; + PK11SymKey* mSymKey; ++ PK11Context* mWrapKeyContext; ++ PK11SymKey* mWrapKey; + #endif + + #if USE_TLS_OPENSSL +diff --git a/oox/source/crypto/CryptTools.cxx b/oox/source/crypto/CryptTools.cxx +index 5ecf7b3..ee91925 100644 +--- a/oox/source/crypto/CryptTools.cxx ++++ b/oox/source/crypto/CryptTools.cxx +@@ -19,9 +19,12 @@ using namespace std; + + Crypto::Crypto() + #if USE_TLS_NSS +- : mContext(nullptr) ++ : mSlot(nullptr) ++ , mContext(nullptr) + , mSecParam(nullptr) + , mSymKey(nullptr) ++ , mWrapKeyContext(nullptr) ++ , mWrapKey(nullptr) + #endif + { + #if USE_TLS_NSS +@@ -38,10 +41,16 @@ Crypto::~Crypto() + #if USE_TLS_NSS + if (mContext) + PK11_DestroyContext(mContext, PR_TRUE); +- if (mSymKey) +- PK11_FreeSymKey(mSymKey); + if (mSecParam) + SECITEM_FreeItem(mSecParam, PR_TRUE); ++ if (mSymKey) ++ PK11_FreeSymKey(mSymKey); ++ if (mWrapKeyContext) ++ PK11_DestroyContext(mWrapKeyContext, PR_TRUE); ++ if (mWrapKey) ++ PK11_FreeSymKey(mWrapKey); ++ if (mSlot) ++ PK11_FreeSlot(mSlot); + #endif + } + +@@ -59,11 +68,14 @@ const EVP_CIPHER* Crypto::getCipher(CryptoType type) + default: + break; + } +- return NULL; ++ return nullptr; + } + #endif + + #if USE_TLS_NSS ++ ++#define MAX_WRAPPED_KEY_LEN 128 ++ + void Crypto::setupContext(vector& key, vector& iv, CryptoType type, CK_ATTRIBUTE_TYPE operation) + { + CK_MECHANISM_TYPE mechanism = static_cast(-1); +@@ -95,9 +107,9 @@ void Crypto::setupContext(vector& key, vector& iv, CryptoT + break; + } + +- PK11SlotInfo* pSlot( PK11_GetBestSlot( mechanism, nullptr ) ); ++ mSlot = PK11_GetBestSlot(mechanism, nullptr); + +- if (!pSlot) ++ if (!mSlot) + throw css::uno::RuntimeException("NSS Slot failure", css::uno::Reference()); + + SECItem keyItem; +@@ -105,7 +117,64 @@ void Crypto::setupContext(vector& key, vector& iv, CryptoT + keyItem.data = &key[0]; + keyItem.len = key.size(); + +- mSymKey = PK11_ImportSymKey( pSlot, mechanism, PK11_OriginUnwrap, CKA_ENCRYPT, &keyItem, nullptr ); ++ mSymKey = PK11_ImportSymKey( mSlot, mechanism, PK11_OriginUnwrap, CKA_ENCRYPT, &keyItem, nullptr ); ++ if (!mSymKey) //rhbz#1614419 maybe failed due to FIPS, use rhbz#1461450 style workaround ++ { ++ /* ++ * Without FIPS it would be possible to just use ++ * mSymKey = PK11_ImportSymKey( mSlot, mechanism, PK11_OriginUnwrap, CKA_ENCRYPT, &keyItem, nullptr ); ++ * with FIPS NSS Level 2 certification has to be "workarounded" (so it becomes Level 1) by using ++ * following method: ++ * 1. Generate wrap key ++ * 2. Encrypt authkey with wrap key ++ * 3. Unwrap encrypted authkey using wrap key ++ */ ++ ++ /* ++ * Generate wrapping key ++ */ ++ CK_MECHANISM_TYPE wrap_mechanism = PK11_GetBestWrapMechanism(mSlot); ++ int wrap_key_len = PK11_GetBestKeyLength(mSlot, wrap_mechanism); ++ mWrapKey = PK11_KeyGen(mSlot, wrap_mechanism, nullptr, wrap_key_len, nullptr); ++ if (!mWrapKey) ++ throw css::uno::RuntimeException("PK11_KeyGen SymKey failure", css::uno::Reference()); ++ ++ /* ++ * Encrypt authkey with wrapping key ++ */ ++ ++ /* ++ * Initialization of IV is not needed because PK11_GetBestWrapMechanism should return ECB mode ++ */ ++ SECItem tmp_sec_item; ++ memset(&tmp_sec_item, 0, sizeof(tmp_sec_item)); ++ mWrapKeyContext = PK11_CreateContextBySymKey(wrap_mechanism, CKA_ENCRYPT, mWrapKey, &tmp_sec_item); ++ if (!mWrapKeyContext) ++ throw css::uno::RuntimeException("PK11_CreateContextBySymKey failure", css::uno::Reference()); ++ ++ unsigned char wrapped_key_data[MAX_WRAPPED_KEY_LEN]; ++ int wrapped_key_len = sizeof(wrapped_key_data); ++ ++ if (PK11_CipherOp(mWrapKeyContext, wrapped_key_data, &wrapped_key_len, ++ sizeof(wrapped_key_data), keyItem.data, keyItem.len) != SECSuccess) ++ { ++ throw css::uno::RuntimeException("PK11_CipherOp failure", css::uno::Reference()); ++ } ++ ++ if (PK11_Finalize(mWrapKeyContext) != SECSuccess) ++ throw css::uno::RuntimeException("PK11_Finalize failure", css::uno::Reference()); ++ ++ /* ++ * Finally unwrap sym key ++ */ ++ SECItem wrapped_key; ++ memset(&tmp_sec_item, 0, sizeof(tmp_sec_item)); ++ wrapped_key.data = wrapped_key_data; ++ wrapped_key.len = wrapped_key_len; ++ ++ mSymKey = PK11_UnwrapSymKey(mWrapKey, wrap_mechanism, &tmp_sec_item, &wrapped_key, ++ mechanism, CKA_ENCRYPT, keyItem.len); ++ } + if (!mSymKey) + throw css::uno::RuntimeException("NSS SymKey failure", css::uno::Reference()); + mSecParam = PK11_ParamFromIV( mechanism, pIvItem ); +-- +1.8.3.1 + diff --git a/SOURCES/0001-set-Referer-on-link-mediadescriptor.patch b/SOURCES/0001-set-Referer-on-link-mediadescriptor.patch new file mode 100644 index 0000000..2ac6741 --- /dev/null +++ b/SOURCES/0001-set-Referer-on-link-mediadescriptor.patch @@ -0,0 +1,50 @@ +From daa1750bd6944f5202ccb7bc41c57a3f32be766e Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= +Date: Tue, 1 May 2018 12:57:02 +0100 +Subject: [PATCH] set Referer on link mediadescriptor + +to allow determining if the source document is from a trusted/untrusted +location + +Change-Id: I780568652d2ef0cc8543c27ba26289277b5d9d0c +Reviewed-on: https://gerrit.libreoffice.org/53693 +Tested-by: Jenkins +Reviewed-by: Stephan Bergmann +--- + sw/source/filter/xml/xmltexti.cxx | 13 +++++++++---- + 1 file changed, 9 insertions(+), 4 deletions(-) + +diff --git a/sw/source/filter/xml/xmltexti.cxx b/sw/source/filter/xml/xmltexti.cxx +index 06a6bbe..83d7734 100644 +--- a/sw/source/filter/xml/xmltexti.cxx ++++ b/sw/source/filter/xml/xmltexti.cxx +@@ -575,17 +575,22 @@ uno::Reference< XPropertySet > SwXMLTextImportHelper::createAndInsertOOoLink( + + uno::Sequence< beans::PropertyValue > aMediaDescriptor( 1 ); + aMediaDescriptor[0].Name = "URL"; +- aMediaDescriptor[0].Value <<= OUString( aURLObj.GetMainURL( INetURLObject::NO_DECODE ) ); +- if ( pDoc->GetDocShell() && pDoc->GetDocShell()->GetMedium() ) ++ aMediaDescriptor[0].Value <<= aURLObj.GetMainURL( INetURLObject::NO_DECODE ); ++ ++ if (SfxMedium* pMedium = pDoc->GetDocShell() ? pDoc->GetDocShell()->GetMedium() : nullptr) + { +- uno::Reference< task::XInteractionHandler > xInteraction = +- pDoc->GetDocShell()->GetMedium()->GetInteractionHandler(); ++ uno::Reference< task::XInteractionHandler > xInteraction = pMedium->GetInteractionHandler(); + if ( xInteraction.is() ) + { + aMediaDescriptor.realloc( 2 ); + aMediaDescriptor[1].Name = "InteractionHandler"; + aMediaDescriptor[1].Value <<= xInteraction; + } ++ ++ const auto nLen = aMediaDescriptor.getLength() + 1; ++ aMediaDescriptor.realloc(nLen); ++ aMediaDescriptor[nLen - 1].Name = "Referer"; ++ aMediaDescriptor[nLen - 1].Value <<= pMedium->GetName(); + } + + uno::Reference < embed::XEmbeddedObject > xObj( +-- +2.14.3 + diff --git a/SOURCES/0001-tdf-106577-cairo_mask-pattern-affects-more-surface-t.patch b/SOURCES/0001-tdf-106577-cairo_mask-pattern-affects-more-surface-t.patch new file mode 100644 index 0000000..0e87115 --- /dev/null +++ b/SOURCES/0001-tdf-106577-cairo_mask-pattern-affects-more-surface-t.patch @@ -0,0 +1,41 @@ +From ec864247bc40d92e32e3b0f9916d3e39974c9116 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= +Date: Mon, 20 Mar 2017 15:08:01 +0000 +Subject: [PATCH] tdf#106577 cairo_mask pattern affects more surface than + expected + +Change-Id: I7f967c401f7b84fd696fa4cf8a944f7a5730917c +--- + vcl/headless/svpgdi.cxx | 15 ++++++++++++++- + 1 file changed, 14 insertions(+), 1 deletion(-) + +diff --git a/vcl/headless/svpgdi.cxx b/vcl/headless/svpgdi.cxx +index 91b6f86e87cb..925a5adecd55 100644 +--- a/vcl/headless/svpgdi.cxx ++++ b/vcl/headless/svpgdi.cxx +@@ -1201,8 +1201,21 @@ void SvpSalGraphics::invert(const basegfx::B2DPolygon &rPoly, SalInvert nFlags) + if (nFlags & SalInvert::N50) + { + cairo_pattern_t *pattern = create_stipple(); +- cairo_mask(cr, pattern); ++ cairo_surface_t* surface = cairo_surface_create_similar(m_pSurface, ++ cairo_surface_get_content(m_pSurface), ++ extents.getWidth() * m_fScale, ++ extents.getHeight() * m_fScale); ++ ++#if CAIRO_VERSION >= CAIRO_VERSION_ENCODE(1, 14, 0) ++ cairo_surface_set_device_scale(surface, m_fScale, m_fScale); ++#endif ++ cairo_t* stipple_cr = cairo_create(surface); ++ cairo_set_source_rgb(stipple_cr, 1.0, 1.0, 1.0); ++ cairo_mask(stipple_cr, pattern); + cairo_pattern_destroy(pattern); ++ cairo_destroy(stipple_cr); ++ cairo_mask_surface(cr, surface, extents.getMinX(), extents.getMinY()); ++ cairo_surface_destroy(surface); + } + else + { +-- +2.17.1 + diff --git a/SOURCES/0001-tdf-95843-Wait-for-fire_glxtest_process-also-in-head.patch b/SOURCES/0001-tdf-95843-Wait-for-fire_glxtest_process-also-in-head.patch new file mode 100644 index 0000000..ab348de --- /dev/null +++ b/SOURCES/0001-tdf-95843-Wait-for-fire_glxtest_process-also-in-head.patch @@ -0,0 +1,132 @@ +From b81490dd5c9eebdd29c0848ca80d6ea78f4818bd Mon Sep 17 00:00:00 2001 +From: Stephan Bergmann +Date: Thu, 19 Apr 2018 13:59:16 +0200 +Subject: [PATCH] tdf#95843: Wait for fire_glxtest_process also in --headless + mode +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Discussed with mmeeks on IRC that fire_glxtest_process is probably called as +early as possible so that its reuslt is ready by the time it is needed in the +non-headless case. So best fix for headless is probably to just wait for the +sub-process at an opportune point, instead of redesigning the whole mess so that +fire_glxtest_process would only be called once its result is actually needed. + +Change-Id: I4ea9c9d54b83c9695a3b72317e68fed0c410da0e +Reviewed-on: https://gerrit.libreoffice.org/53154 +Tested-by: Jenkins +Reviewed-by: Stephan Bergmann +(cherry picked from commit 4bacf58f4af44ac8c4632b43289ccfcc07e5820c) +Reviewed-on: https://gerrit.libreoffice.org/53170 +Reviewed-by: Caolán McNamara +Tested-by: Caolán McNamara +--- + desktop/inc/app.hxx | 1 + + desktop/source/app/app.cxx | 9 +++++++++ + desktop/source/app/sofficemain.cxx | 4 ++++ + vcl/inc/opengl/x11/glxtest.hxx | 2 ++ + vcl/unx/glxtest.cxx | 16 ++++++++++++++++ + 5 files changed, 32 insertions(+) + +diff --git a/desktop/inc/app.hxx b/desktop/inc/app.hxx +index 91dde49..68fc4a3 100644 +--- a/desktop/inc/app.hxx ++++ b/desktop/inc/app.hxx +@@ -187,6 +187,7 @@ OUString ReplaceStringHookProc(const OUString& rStr); + + #if defined( UNX ) && !defined MACOSX && !defined IOS && !defined ANDROID && !defined LIBO_HEADLESS + bool fire_glxtest_process(); ++void reap_glxtest_process(); + #endif + + #endif // INCLUDED_DESKTOP_INC_APP_HXX +diff --git a/desktop/source/app/app.cxx b/desktop/source/app/app.cxx +index dc7ff1e..c8b8db5 100644 +--- a/desktop/source/app/app.cxx ++++ b/desktop/source/app/app.cxx +@@ -1649,6 +1649,15 @@ int Desktop::Main() + CheckOpenCLCompute(xDesktop); + #endif + ++ // In headless mode, reap the process started by fire_glxtest_process() early in soffice_main ++ // (desktop/source/app/sofficemain.cxx), in a code block that needs to be covered by the same ++ // #if condition as this code block: ++#if defined( UNX ) && !defined MACOSX && !defined IOS && !defined ANDROID && !defined(LIBO_HEADLESS) && HAVE_FEATURE_OPENGL ++ if (rCmdLineArgs.IsHeadless()) { ++ reap_glxtest_process(); ++ } ++#endif ++ + // Release solar mutex just before we wait for our client to connect + { + SolarMutexReleaser aReleaser; +diff --git a/desktop/source/app/sofficemain.cxx b/desktop/source/app/sofficemain.cxx +index 27b9efa..9cbcbc0 100644 +--- a/desktop/source/app/sofficemain.cxx ++++ b/desktop/source/app/sofficemain.cxx +@@ -125,6 +125,10 @@ extern "C" int DESKTOP_DLLPUBLIC soffice_main() + #if defined( UNX ) && !defined MACOSX && !defined IOS && !defined ANDROID && !defined(LIBO_HEADLESS) && HAVE_FEATURE_OPENGL + /* Run test for OpenGL support in own process to avoid crash with broken + * OpenGL drivers. Start process as early as possible. ++ * In non-headless mode, the process will be reaped in X11OpenGLDeviceInfo::GetData ++ * (vcl/opengl/x11/X11DeviceInfo.cxx). In headless mode, the process will be reaped late in ++ * Desktop::Main (desktop/source/app/app.cxx), in a code block that needs to be covered by the ++ * same #if condition as this code block. + */ + bool bSuccess = fire_glxtest_process(); + SAL_WARN_IF(!bSuccess, "desktop.opengl", "problems with glxtest"); +diff --git a/vcl/inc/opengl/x11/glxtest.hxx b/vcl/inc/opengl/x11/glxtest.hxx +index 979f795..d74436a 100644 +--- a/vcl/inc/opengl/x11/glxtest.hxx ++++ b/vcl/inc/opengl/x11/glxtest.hxx +@@ -18,6 +18,8 @@ VCL_DLLPUBLIC pid_t* getGlxPid(); + + bool fire_glxtest_process(); + ++void reap_glxtest_process(); ++ + #endif + + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ +diff --git a/vcl/unx/glxtest.cxx b/vcl/unx/glxtest.cxx +index efe5591..87c6044 100644 +--- a/vcl/unx/glxtest.cxx ++++ b/vcl/unx/glxtest.cxx +@@ -26,6 +26,8 @@ + #include "stdint.h" + #include + ++#include ++ + #include "opengl/x11/glxtest.hxx" + + #ifdef __SUNPRO_CC +@@ -35,6 +37,8 @@ + #include "X11/Xlib.h" + #include "X11/Xutil.h" + ++#include ++ + // stuff from glx.h + typedef struct __GLXcontextRec *GLXContext; + typedef XID GLXPixmap; +@@ -273,3 +277,15 @@ bool fire_glxtest_process() + *glxtest_pid = pid; + return true; + } ++ ++void reap_glxtest_process() { ++ pid_t * pid = getGlxPid(); ++ if (*pid != 0) { ++ // Use WNOHANG, as it is probably better to have a (rather harmless) zombie child process ++ // hanging around for the duration of the calling process, than to potentially block the ++ // calling process here: ++ pid_t e = waitpid(*pid, nullptr, WNOHANG); ++ SAL_INFO_IF( ++ e <= 0, "vcl.opengl", "waiting for glxtest process " << *pid << " failed with " << e); ++ } ++} +-- +2.14.3 + diff --git a/SPECS/libreoffice.spec b/SPECS/libreoffice.spec index d51d915..6e5ebc9 100644 --- a/SPECS/libreoffice.spec +++ b/SPECS/libreoffice.spec @@ -57,7 +57,7 @@ Summary: Free Software Productivity Suite Name: libreoffice Epoch: 1 Version: %{libo_version}.1 -Release: 10%{?libo_prerelease}%{?dist} +Release: 19%{?libo_prerelease}%{?dist} License: (MPLv1.1 or LGPLv3+) and LGPLv3 and LGPLv2+ and BSD and (MPLv1.1 or GPLv2 or LGPLv2 or Netscape) and Public Domain and ASL 2.0 and Artistic and MPLv2.0 and CC0 URL: http://www.libreoffice.org/ @@ -268,10 +268,23 @@ Patch38: 0001-rhbz-1527945-segv-on-failed-open-of-password-protect.patch Patch39: 0001-Resolves-rhbz-1535541-fdo-88004-mimetypes-are-.macro.patch Patch40: 0001-rhbz-1541486-Fix-localized-ness-of-ooSetupFactoryUIN.patch Patch41: 0001-limit-WEBSERVICE-to-http-s-protocols.patch +Patch42: 0001-ofz-5747-short-sal_Int32-like-in-StgDataStrm.patch +Patch43: 0001-ofz-6173-check-index-before-use.patch +Patch44: 0001-Resolves-rhbz-1546997-search-not-found-at-0-0-when-w.patch +Patch45: 0001-Related-tdf-100925-background-not-getting-set-under-.patch +Patch46: 0001-tdf-95843-Wait-for-fire_glxtest_process-also-in-head.patch +Patch47: 0001-set-Referer-on-link-mediadescriptor.patch +Patch48: 0001-rhbz-1589029-impress-not-showing-text-highlight-in-p.patch +Patch49: 0001-Resolves-rhbz-1610692-rectangles-ctor-takes-topleft-.patch +Patch50: 0001-tdf-106577-cairo_mask-pattern-affects-more-surface-t.patch +Patch51: 0001-Related-tdf-106577-extend-damage-rect-a-little-for-T.patch +Patch52: 0001-Resolves-rhbz-1614419-crash-in-pptx-nss-usage-under-.patch +Patch53: 0001-rhbz-1614419-use-workaround-for-PK11_ImportSymKey-fa.patch %if 0%{?rhel} # not upstreamed Patch500: 0001-disable-libe-book-support.patch +Patch501: 0001-Resolves-rhbz-1545262-Workaround-for-spurious-ppc64l.patch %endif %define instdir %{_libdir} @@ -2337,6 +2350,34 @@ done %{_includedir}/LibreOfficeKit %changelog +* Fri Aug 10 2018 Caolán McNamara - 1:5.3.6.1-19 +- Resolves: rhbz#1614419 detect PK11_ImportSymKey failure under FIPS + +* Fri Aug 03 2018 Caolán McNamara - 1:5.3.6.1-18 +- Resolves: rhbz#1610904 draw glitches in drag cursor + +* Wed Aug 01 2018 Stephan Bergmann - 1:5.3.6.1-17 +- Resolves: rhbz#1545262 Workaround for spurious ppc64le automated testing crash +- Resolves: rhbz#1610692 silence console warnings from print dialog + +* Mon Jun 11 2018 Caolán McNamara - 1:5.3.6.1-16 +- Resolves: rhbz#1589029 impress not showing text-highlight in presentation mode + +* Wed May 09 2018 Caolán McNamara - 1:5.3.6.1-15 +- Resolves: rhbz#1575826 CVE-2018-10583 + +* Thu Apr 26 2018 Caolán McNamara - 1:5.3.6.1-14 +- Resolves: rhbz#1568579 zombie when run in daemon mode + +* Wed Apr 25 2018 Caolán McNamara - 1:5.3.6.1-13 +- Resolves: rhbz#1388764 in calc old text shown underneath new text sometimes + +* Wed Apr 25 2018 Caolán McNamara - 1:5.3.6.1-12 +- Resolves: rhbz#1546997 'search not found' misplaced + +* Mon Apr 23 2018 Caolán McNamara - 1:5.3.6.1-11 +- Resolves: rhbz#1570487 rhbz#1570491 CVE-2018-10119 CVE-2018-10120 + * Fri Feb 16 2018 Stephan Bergmann - 1:5.3.6.1-10 - Resolves: rhbz#1545629 libreoffice-debuginfo doesn't contain debug info