xmloff/source/draw/shapeimport.cxx | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-)
New commits: commit db63000ea7805ddd762521a7cf39de203dbe6c3f Author: Noel Grandin <noel.gran...@collabora.co.uk> AuthorDate: Tue Jul 5 10:24:38 2022 +0200 Commit: Noel Grandin <noel.gran...@collabora.co.uk> CommitDate: Tue Jul 5 11:51:32 2022 +0200 tdf#137544 reduce ref-counting traffic we can store a direct pointer here, shaves 5% off load time Change-Id: I418916df946f53ead28bb5cf76614a874283e7d2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136821 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> diff --git a/xmloff/source/draw/shapeimport.cxx b/xmloff/source/draw/shapeimport.cxx index 1a21953f39ff..538120d2bfaa 100644 --- a/xmloff/source/draw/shapeimport.cxx +++ b/xmloff/source/draw/shapeimport.cxx @@ -515,8 +515,9 @@ struct ZOrderHint { sal_Int32 nIs; sal_Int32 nShould; - /// The hint is for this shape. - uno::Reference<drawing::XShape> xShape; + /// The hint is for this shape. We don't use uno::Reference here to speed up + /// some operations, and because this shape is always held by mxShapes + drawing::XShape* pShape; bool operator<(const ZOrderHint& rComp) const { return nShould < rComp.nShould; } }; @@ -731,7 +732,7 @@ void XMLShapeImportHelper::shapeWithZIndexAdded( css::uno::Reference< css::drawi ZOrderHint aNewHint; aNewHint.nIs = mpImpl->mpGroupContext->mnCurrentZ++; aNewHint.nShould = nZIndex; - aNewHint.xShape = xShape; + aNewHint.pShape = xShape.get(); if( nZIndex == -1 ) { @@ -749,7 +750,7 @@ void XMLShapeImportHelper::shapeRemoved(const uno::Reference<drawing::XShape>& x { auto it = std::find_if(mpImpl->mpGroupContext->maZOrderList.begin(), mpImpl->mpGroupContext->maZOrderList.end(), [&xShape](const ZOrderHint& rHint) { - return rHint.xShape == xShape; + return rHint.pShape == xShape.get(); }); if (it == mpImpl->mpGroupContext->maZOrderList.end()) // Part of the unsorted list, nothing to do.