cppcanvas/source/mtfrenderer/implrenderer.cxx | 3 +-- filter/source/msfilter/mscodec.cxx | 5 ++--- lotuswordpro/source/filter/xfilter/xfdrawpath.cxx | 8 ++++---- opencl/source/openclwrapper.cxx | 2 +- reportbuilder/java/org/libreoffice/report/pentaho/output/OfficeDocumentReportTarget.java | 7 ++++++- sc/source/core/data/document10.cxx | 6 +++--- sc/source/core/data/table4.cxx | 2 +- sc/source/filter/orcus/autofilter.cxx | 2 +- sc/source/ui/miscdlgs/conflictsdlg.cxx | 2 +- scripting/java/com/sun/star/script/framework/container/XMLParserFactory.java | 6 +++++- sd/source/ui/tools/SlideshowLayerRenderer.cxx | 2 +- vcl/source/gdi/gdimtf.cxx | 2 +- 12 files changed, 27 insertions(+), 20 deletions(-)
New commits: commit e4780ac521ddcce30ddc71d3cc67c696523f8407 Author: Caolán McNamara <caolan.mcnam...@collabora.com> AuthorDate: Wed Jul 30 10:45:12 2025 +0100 Commit: Caolán McNamara <caolan.mcnam...@collabora.com> CommitDate: Wed Jul 30 18:14:14 2025 +0200 cid#1660797 Variable copied when it could be moved and cid#1660561 Variable copied when it could be moved cid#1660555 Variable copied when it could be moved cid#1660552 Variable copied when it could be moved cid#1660549 Variable copied when it could be moved cid#1660548 Variable copied when it could be moved cid#1660444 Variable copied when it could be moved cid#1659838 Variable copied when it could be moved cid#1659835 Variable copied when it could be moved cid#1555526 Variable copied when it could be moved Change-Id: Ic3f69bc789861d06d33a7b23e7ed0d519df94ab7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/188589 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com> diff --git a/cppcanvas/source/mtfrenderer/implrenderer.cxx b/cppcanvas/source/mtfrenderer/implrenderer.cxx index 381387080bd3..56cc42a9a432 100644 --- a/cppcanvas/source/mtfrenderer/implrenderer.cxx +++ b/cppcanvas/source/mtfrenderer/implrenderer.cxx @@ -238,8 +238,7 @@ namespace cppcanvas::internal void VectorOfOutDevStates::clearStateStack() { m_aStates.clear(); - const OutDevState aDefaultState; - m_aStates.push_back(aDefaultState); + m_aStates.push_back(OutDevState()); } OutDevState& VectorOfOutDevStates::getState() diff --git a/filter/source/msfilter/mscodec.cxx b/filter/source/msfilter/mscodec.cxx index 42c1cd0e24d8..a75718b4d49b 100644 --- a/filter/source/msfilter/mscodec.cxx +++ b/filter/source/msfilter/mscodec.cxx @@ -377,10 +377,9 @@ void MSCodec_CryptoAPI::InitKey ( } // calculate SHA1 hash of initialData - std::vector<unsigned char> const sha1(::comphelper::Hash::calculateHash( + m_aDigestValue = ::comphelper::Hash::calculateHash( initialData.data(), initialData.size(), - ::comphelper::HashType::SHA1)); - m_aDigestValue = sha1; + ::comphelper::HashType::SHA1); lcl_PrintDigest(m_aDigestValue.data(), "digest value"); diff --git a/lotuswordpro/source/filter/xfilter/xfdrawpath.cxx b/lotuswordpro/source/filter/xfilter/xfdrawpath.cxx index 7be87eef0f91..c642cab2cb60 100644 --- a/lotuswordpro/source/filter/xfilter/xfdrawpath.cxx +++ b/lotuswordpro/source/filter/xfilter/xfdrawpath.cxx @@ -88,7 +88,7 @@ void XFDrawPath::MoveTo(XFPoint pt) entry.SetCommand(u"M"_ustr); entry.AddPoint(pt); - m_aPaths.push_back(entry); + m_aPaths.push_back(std::move(entry)); } void XFDrawPath::LineTo(XFPoint pt) @@ -97,7 +97,7 @@ void XFDrawPath::LineTo(XFPoint pt) entry.SetCommand(u"L"_ustr); entry.AddPoint(pt); - m_aPaths.push_back(entry); + m_aPaths.push_back(std::move(entry)); } void XFDrawPath::CurveTo(XFPoint dest, XFPoint ctrl1, XFPoint ctrl2) @@ -109,7 +109,7 @@ void XFDrawPath::CurveTo(XFPoint dest, XFPoint ctrl1, XFPoint ctrl2) entry.AddPoint(ctrl2); entry.AddPoint(dest); - m_aPaths.push_back(entry); + m_aPaths.push_back(std::move(entry)); } void XFDrawPath::ClosePath() @@ -118,7 +118,7 @@ void XFDrawPath::ClosePath() entry.SetCommand(u"Z"_ustr); - m_aPaths.push_back(entry); + m_aPaths.push_back(std::move(entry)); } void XFDrawPath::ToXml(IXFStream *pStrm) diff --git a/opencl/source/openclwrapper.cxx b/opencl/source/openclwrapper.cxx index e22a4e38fe23..a681db1f55bc 100644 --- a/opencl/source/openclwrapper.cxx +++ b/opencl/source/openclwrapper.cxx @@ -667,7 +667,7 @@ const std::vector<OpenCLPlatformInfo>& fillOpenCLInfo() { OpenCLPlatformInfo aPlatformInfo; if(createPlatformInfo(pPlatforms[i], aPlatformInfo)) - aPlatforms.push_back(aPlatformInfo); + aPlatforms.push_back(std::move(aPlatformInfo)); } return aPlatforms; diff --git a/sc/source/core/data/document10.cxx b/sc/source/core/data/document10.cxx index 0ae557e49ea1..68cbf2ea5b54 100644 --- a/sc/source/core/data/document10.cxx +++ b/sc/source/core/data/document10.cxx @@ -409,9 +409,9 @@ void ScDocument::EnableDelayStartListeningFormulaCells( ScColumn* column, bool d { if( it->second.first != -1 ) { - const auto pPosSet = std::make_shared<sc::ColumnBlockPositionSet>(*this); - sc::StartListeningContext aStartCxt(*this, pPosSet); - sc::EndListeningContext aEndCxt(*this, pPosSet); + auto xPosSet = std::make_shared<sc::ColumnBlockPositionSet>(*this); + sc::StartListeningContext aStartCxt(*this, xPosSet); + sc::EndListeningContext aEndCxt(*this, std::move(xPosSet)); column->StartListeningFormulaCells(aStartCxt, aEndCxt, it->second.first, it->second.second); } pDelayedStartListeningFormulaCells.erase( it ); diff --git a/sc/source/core/data/table4.cxx b/sc/source/core/data/table4.cxx index 7fdc1d116943..46635b64fda3 100644 --- a/sc/source/core/data/table4.cxx +++ b/sc/source/core/data/table4.cxx @@ -1254,7 +1254,7 @@ void ScTable::FillSparkline(bool bVertical, SCCOLROW nFixed, { auto pSparkline = bVertical ? GetSparkline(nFixed, nCurrent) : GetSparkline(nCurrent, nFixed); bHasSparklines = bHasSparklines || pSparkline; - aSparklineSeries.push_back(pSparkline); + aSparklineSeries.push_back(std::move(pSparkline)); } if (bHasSparklines) diff --git a/sc/source/filter/orcus/autofilter.cxx b/sc/source/filter/orcus/autofilter.cxx index 02f976423162..94015e87616a 100644 --- a/sc/source/filter/orcus/autofilter.cxx +++ b/sc/source/filter/orcus/autofilter.cxx @@ -189,7 +189,7 @@ void ScOrcusAutoFilterNode::append_item(os::col_t field, os::auto_filter_op_t op aEntry.eConnect = meConn; setQueryOp(aEntry, op); - maEntries.push_back(aEntry); + maEntries.push_back(std::move(aEntry)); } os::iface::import_auto_filter_node* ScOrcusAutoFilterNode::start_node(os::auto_filter_node_op_t op) diff --git a/sc/source/ui/miscdlgs/conflictsdlg.cxx b/sc/source/ui/miscdlgs/conflictsdlg.cxx index f461995d1c9a..aa451f9f2744 100644 --- a/sc/source/ui/miscdlgs/conflictsdlg.cxx +++ b/sc/source/ui/miscdlgs/conflictsdlg.cxx @@ -184,7 +184,7 @@ ScConflictsListEntry& ScConflictsFinder::GetEntry( sal_uLong nSharedAction, cons ScConflictsListEntry aEntry; aEntry.meConflictAction = SC_CONFLICT_ACTION_NONE; aEntry.maSharedActions.push_back( nSharedAction ); - mrConflictsList.push_back( aEntry ); + mrConflictsList.push_back(std::move(aEntry)); return mrConflictsList.back(); } diff --git a/sd/source/ui/tools/SlideshowLayerRenderer.cxx b/sd/source/ui/tools/SlideshowLayerRenderer.cxx index 90d7170561ed..459060c28503 100644 --- a/sd/source/ui/tools/SlideshowLayerRenderer.cxx +++ b/sd/source/ui/tools/SlideshowLayerRenderer.cxx @@ -503,7 +503,7 @@ public: aTextFieldPass.maFieldType = sTextFieldType; aTextFieldPass.mpObject = pObject; - mrRenderState.maTextFields.push_back(aTextFieldPass); + mrRenderState.maTextFields.push_back(std::move(aTextFieldPass)); } return; } diff --git a/vcl/source/gdi/gdimtf.cxx b/vcl/source/gdi/gdimtf.cxx index 5f39914adda4..77bdf0f555b3 100644 --- a/vcl/source/gdi/gdimtf.cxx +++ b/vcl/source/gdi/gdimtf.cxx @@ -2334,7 +2334,7 @@ bool GDIMetaFile::CreateThumbnail(Bitmap& rBitmap, BmpConversion eColorConversio if (aSize.Width() && aSize.Height()) aBitmap.Convert(eColorConversion); - rBitmap = aBitmap; + rBitmap = std::move(aBitmap); } return !rBitmap.IsEmpty(); commit ac8b714e984156612dde6b04afbeee81411f96c8 Author: Caolán McNamara <caolan.mcnam...@collabora.com> AuthorDate: Wed Jul 30 10:42:39 2025 +0100 Commit: Caolán McNamara <caolan.mcnam...@collabora.com> CommitDate: Wed Jul 30 18:14:06 2025 +0200 cid#1660317 XML external entity processing enabled and cid#1660375 XML external entity processing enabled Change-Id: I557e103d1aca74f824747d855007de033dc9c3ee Reviewed-on: https://gerrit.libreoffice.org/c/core/+/188588 Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com> Tested-by: Jenkins diff --git a/reportbuilder/java/org/libreoffice/report/pentaho/output/OfficeDocumentReportTarget.java b/reportbuilder/java/org/libreoffice/report/pentaho/output/OfficeDocumentReportTarget.java index 7d69f3b5887c..4ebb9cb1fc1d 100644 --- a/reportbuilder/java/org/libreoffice/report/pentaho/output/OfficeDocumentReportTarget.java +++ b/reportbuilder/java/org/libreoffice/report/pentaho/output/OfficeDocumentReportTarget.java @@ -41,6 +41,7 @@ import javax.xml.transform.dom.DOMSource; import javax.xml.transform.stream.StreamResult; import javax.xml.parsers.DocumentBuilderFactory; import javax.xml.parsers.DocumentBuilder; +import javax.xml.XMLConstants; import org.w3c.dom.Document; import org.w3c.dom.Node; import org.xml.sax.InputSource; @@ -1027,7 +1028,11 @@ public abstract class OfficeDocumentReportTarget extends AbstractReportTarget Node node = document.getFirstChild().getFirstChild().getFirstChild().getFirstChild(); String creator = node.getNodeValue(); node.setNodeValue(creator + "/report_builder"); - Transformer transformer = TransformerFactory.newInstance().newTransformer(); + TransformerFactory transformerFactory = TransformerFactory.newInstance(); + transformerFactory.setAttribute(XMLConstants.ACCESS_EXTERNAL_DTD, ""); + transformerFactory.setAttribute(XMLConstants.ACCESS_EXTERNAL_STYLESHEET, ""); + transformerFactory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true); + Transformer transformer = transformerFactory.newTransformer(); transformer.setOutputProperty(OutputKeys.METHOD, "xml"); final OutputStream outputMetaStream = getOutputRepository().createOutputStream("meta.xml", "text/xml"); diff --git a/scripting/java/com/sun/star/script/framework/container/XMLParserFactory.java b/scripting/java/com/sun/star/script/framework/container/XMLParserFactory.java index 7e67c3b384e5..9b162099c9bd 100644 --- a/scripting/java/com/sun/star/script/framework/container/XMLParserFactory.java +++ b/scripting/java/com/sun/star/script/framework/container/XMLParserFactory.java @@ -121,7 +121,11 @@ public class XMLParserFactory { public void write(Document doc, OutputStream out) throws IOException { try { - TransformerFactory.newInstance().newTransformer().transform( + TransformerFactory transformerFactory = TransformerFactory.newInstance(); + transformerFactory.setAttribute(XMLConstants.ACCESS_EXTERNAL_DTD, ""); + transformerFactory.setAttribute(XMLConstants.ACCESS_EXTERNAL_STYLESHEET, ""); + transformerFactory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true); + transformerFactory.newTransformer().transform( new DOMSource(doc), new StreamResult(out)); } catch (TransformerException ex1) { IOException ex2 = new IOException();