From 4c7a3286fd05b1939acb45b2333c1ee927b0d4db Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Tue, 23 Jun 2020 14:01:00 +0200 Subject: inline typedef WeakSdrObjectContainerType Change-Id: Icdbdc73552b81a71d2551c36f54218deba6149bb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96949 Tested-by: Jenkins Reviewed-by: Noel Grandin --- include/svx/svdpage.hxx | 3 +-- svx/source/svdraw/svdpage.cxx | 29 +++++++++-------------------- 2 files changed, 10 insertions(+), 22 deletions(-) diff --git a/include/svx/svdpage.hxx b/include/svx/svdpage.hxx index 7d55b0fab697..d2fd71482476 100644 --- a/include/svx/svdpage.hxx +++ b/include/svx/svdpage.hxx @@ -226,10 +226,9 @@ public: virtual void dumpAsXml(xmlTextWriterPtr pWriter) const; private: - class WeakSdrObjectContainerType; /// This list, if it exists, defines the navigation order. If it does /// not exist then maList defines the navigation order. - std::unique_ptr mxNavigationOrder; + std::unique_ptr>> mxNavigationOrder; /// This flag is when the mpNavigation list has been changed but /// the indices of the referenced SdrObjects still have their old values. diff --git a/svx/source/svdraw/svdpage.cxx b/svx/source/svdraw/svdpage.cxx index 734becaf3c7d..489e20653fad 100644 --- a/svx/source/svdraw/svdpage.cxx +++ b/svx/source/svdraw/svdpage.cxx @@ -55,14 +55,6 @@ using namespace ::com::sun::star; -class SdrObjList::WeakSdrObjectContainerType - : public ::std::vector> -{ -public: - explicit WeakSdrObjectContainerType (const sal_Int32 nInitialSize) - : ::std::vector>(nInitialSize) {}; -}; - static const sal_Int32 InitialObjectContainerCapacity (64); //////////////////////////////////////////////////////////////////////////////////////////////////// @@ -841,11 +833,8 @@ void SdrObjList::SetObjectNavigationPosition ( // maList. if (mxNavigationOrder == nullptr) { - mxNavigationOrder.reset(new WeakSdrObjectContainerType(maList.size())); - ::std::copy( - maList.begin(), - maList.end(), - mxNavigationOrder->begin()); + mxNavigationOrder.reset(new std::vector>(maList.begin(), + maList.end())); } OSL_ASSERT(mxNavigationOrder != nullptr); OSL_ASSERT( mxNavigationOrder->size() == maList.size()); @@ -853,10 +842,10 @@ void SdrObjList::SetObjectNavigationPosition ( tools::WeakReference aReference (&rObject); // Look up the object whose navigation position is to be changed. - WeakSdrObjectContainerType::iterator iObject (::std::find( + auto iObject = ::std::find( mxNavigationOrder->begin(), mxNavigationOrder->end(), - aReference)); + aReference); if (iObject == mxNavigationOrder->end()) { // The given object is not a member of the navigation order. @@ -950,7 +939,7 @@ void SdrObjList::SetNavigationOrder (const uno::Reference>(nCount)); for (sal_Int32 nIndex=0; nIndex aReference (maList[nObjectPosition]); - WeakSdrObjectContainerType::iterator iObject (::std::find( + auto iObject = ::std::find( mxNavigationOrder->begin(), mxNavigationOrder->end(), - aReference)); + aReference); if (iObject != mxNavigationOrder->end()) mxNavigationOrder->erase(iObject); @@ -1044,10 +1033,10 @@ void SdrObjList::RemoveObjectFromContainer ( if (HasObjectNavigationOrder()) { tools::WeakReference aReference (maList[nObjectPosition]); - WeakSdrObjectContainerType::iterator iObject (::std::find( + auto iObject = ::std::find( mxNavigationOrder->begin(), mxNavigationOrder->end(), - aReference)); + aReference); if (iObject != mxNavigationOrder->end()) mxNavigationOrder->erase(iObject); mbIsNavigationOrderDirty = true; -- cgit