diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-05-31 15:26:13 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-05-31 21:36:40 +0200 |
commit | a8c4db643eb4c332f2e8f25b2fd8c84401a847ac (patch) | |
tree | 9721d745686a3d46bcd21bb065de5db17d5787c3 /sd | |
parent | d1dfb7d56137ea62d6f3cdfb07f3ee841eb28f9e (diff) |
flatten vector
Change-Id: I7459bcc499d6734328b5be63a4bebd2102d52e0f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116481
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sd')
-rw-r--r-- | sd/source/filter/eppt/grouptable.hxx | 7 | ||||
-rw-r--r-- | sd/source/filter/eppt/pptx-grouptable.cxx | 12 |
2 files changed, 9 insertions, 10 deletions
diff --git a/sd/source/filter/eppt/grouptable.hxx b/sd/source/filter/eppt/grouptable.hxx index 6d252ceb8f29..885f9574164e 100644 --- a/sd/source/filter/eppt/grouptable.hxx +++ b/sd/source/filter/eppt/grouptable.hxx @@ -49,15 +49,14 @@ class GroupTable sal_uInt32 mnIndex; sal_uInt32 mnGroupsClosed; - std::vector<std::unique_ptr<GroupEntry>> - mvGroupEntry; + std::vector<GroupEntry> mvGroupEntry; public: sal_uInt32 GetCurrentGroupIndex() const { return mnIndex; }; sal_Int32 GetCurrentGroupLevel() const { return mvGroupEntry.size() - 1; }; - css::uno::Reference< css::container::XIndexAccess > & - GetCurrentGroupAccess() const { return mvGroupEntry.back()->mXIndexAccess; }; + const css::uno::Reference< css::container::XIndexAccess > & + GetCurrentGroupAccess() const { return mvGroupEntry.back().mXIndexAccess; }; sal_uInt32 GetGroupsClosed(); void ResetGroupTable( sal_uInt32 nCount ); void ClearGroupTable(); diff --git a/sd/source/filter/eppt/pptx-grouptable.cxx b/sd/source/filter/eppt/pptx-grouptable.cxx index 1f743df45911..bf91f2fb692e 100644 --- a/sd/source/filter/eppt/pptx-grouptable.cxx +++ b/sd/source/filter/eppt/pptx-grouptable.cxx @@ -37,10 +37,10 @@ bool GroupTable::EnterGroup( css::uno::Reference< css::container::XIndexAccess > bool bRet = false; if ( rXIndexAccessRef.is() ) { - std::unique_ptr<GroupEntry> pNewGroup( new GroupEntry( rXIndexAccessRef ) ); - if ( pNewGroup->mnCount ) + GroupEntry aNewGroup( rXIndexAccessRef ); + if ( aNewGroup.mnCount ) { - mvGroupEntry.push_back( std::move(pNewGroup) ); + mvGroupEntry.push_back( std::move(aNewGroup) ); bRet = true; } } @@ -62,16 +62,16 @@ void GroupTable::ClearGroupTable() void GroupTable::ResetGroupTable( sal_uInt32 nCount ) { ClearGroupTable(); - mvGroupEntry.push_back( std::unique_ptr<GroupEntry>(new GroupEntry( nCount )) ); + mvGroupEntry.push_back( GroupEntry( nCount ) ); } bool GroupTable::GetNextGroupEntry() { while ( !mvGroupEntry.empty() ) { - mnIndex = mvGroupEntry.back()->mnCurrentPos++; + mnIndex = mvGroupEntry.back().mnCurrentPos++; - if ( mvGroupEntry.back()->mnCount > mnIndex ) + if ( mvGroupEntry.back().mnCount > mnIndex ) return true; mvGroupEntry.pop_back(); |