diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-07-05 10:24:38 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-07-05 11:51:32 +0200 |
commit | db63000ea7805ddd762521a7cf39de203dbe6c3f (patch) | |
tree | bc65d8b7a1df7d312775692c52a75aa8e60b1c31 /xmloff | |
parent | c7a8033dff0f6d3a35260ccaf24f51020f335463 (diff) |
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.grandin@collabora.co.uk>
Diffstat (limited to 'xmloff')
-rw-r--r-- | xmloff/source/draw/shapeimport.cxx | 9 |
1 files changed, 5 insertions, 4 deletions
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. |