editeng/source/editeng/impedit4.cxx | 13 ++++---- sd/source/core/stlfamily.cxx | 40 +++++++++++++-------------- sd/source/core/stlsheet.cxx | 4 +- sd/source/filter/ppt/pptin.cxx | 5 +-- sd/source/ui/inc/ViewShellBase.hxx | 2 - sd/source/ui/view/ViewShellBase.cxx | 8 ++--- sdext/source/pdfimport/pdfparse/pdfparse.cxx | 35 ----------------------- 7 files changed, 35 insertions(+), 72 deletions(-)
New commits: commit ecd3ab9a206882776343005399e66abe31425296 Author: Noel Grandin <[email protected]> AuthorDate: Mon Jun 30 13:22:41 2025 +0200 Commit: Noel Grandin <[email protected]> CommitDate: Tue Jul 1 09:36:44 2025 +0200 FormShellManager can be held by unique_ptr Change-Id: Ibfc8bfc1e0d08787d09e65dc75d25db98a61adeb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/187206 Tested-by: Jenkins Reviewed-by: Noel Grandin <[email protected]> diff --git a/sd/source/ui/inc/ViewShellBase.hxx b/sd/source/ui/inc/ViewShellBase.hxx index 921865624ff7..5d5441d82d4f 100644 --- a/sd/source/ui/inc/ViewShellBase.hxx +++ b/sd/source/ui/inc/ViewShellBase.hxx @@ -197,7 +197,7 @@ public: const ::tools::Rectangle& getClientRectangle() const; std::shared_ptr<ToolBarManager> const & GetToolBarManager() const; - std::shared_ptr<FormShellManager> const & GetFormShellManager() const; + FormShellManager* GetFormShellManager() const; DrawController* GetDrawController() const; diff --git a/sd/source/ui/view/ViewShellBase.cxx b/sd/source/ui/view/ViewShellBase.cxx index 93273630d8f5..295b66a850e3 100644 --- a/sd/source/ui/view/ViewShellBase.cxx +++ b/sd/source/ui/view/ViewShellBase.cxx @@ -142,7 +142,7 @@ public: std::shared_ptr<ToolBarManager> mpToolBarManager; std::shared_ptr<ViewShellManager> mpViewShellManager; std::shared_ptr<tools::EventMultiplexer> mpEventMultiplexer; - std::shared_ptr<FormShellManager> mpFormShellManager; + std::unique_ptr<FormShellManager> mpFormShellManager; explicit Implementation (ViewShellBase& rBase); ~Implementation(); @@ -306,7 +306,7 @@ void ViewShellBase::LateInit (const OUString& rsDefaultView) mpImpl->mpEventMultiplexer = std::make_shared<tools::EventMultiplexer>(*this); - mpImpl->mpFormShellManager = std::make_shared<FormShellManager>(*this); + mpImpl->mpFormShellManager = std::make_unique<FormShellManager>(*this); mpImpl->mpToolBarManager = ToolBarManager::Create( *this, @@ -969,12 +969,12 @@ std::shared_ptr<ToolBarManager> const & ViewShellBase::GetToolBarManager() const return mpImpl->mpToolBarManager; } -std::shared_ptr<FormShellManager> const & ViewShellBase::GetFormShellManager() const +FormShellManager* ViewShellBase::GetFormShellManager() const { OSL_ASSERT(mpImpl != nullptr); OSL_ASSERT(mpImpl->mpFormShellManager != nullptr); - return mpImpl->mpFormShellManager; + return mpImpl->mpFormShellManager.get(); } DrawController* ViewShellBase::GetDrawController() const commit 3ad35d16ec12f53a812e80ec68995710b1a15089 Author: Gabor Kelemen <[email protected]> AuthorDate: Fri Jun 27 12:31:27 2025 +0200 Commit: Gabor Kelemen <[email protected]> CommitDate: Tue Jul 1 09:36:42 2025 +0200 USE_ASSIGN_ACTOR is never defined since 2009 commit ef43d23e180d94f8a060388460c988d6d4126c6b Change-Id: Ie2594a11fb52be469edd337c7c575c96425adb49 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/187106 Tested-by: Jenkins Reviewed-by: Gabor Kelemen <[email protected]> diff --git a/sdext/source/pdfimport/pdfparse/pdfparse.cxx b/sdext/source/pdfimport/pdfparse/pdfparse.cxx index a340d0579e49..8f2661da9290 100644 --- a/sdext/source/pdfimport/pdfparse/pdfparse.cxx +++ b/sdext/source/pdfimport/pdfparse/pdfparse.cxx @@ -157,31 +157,16 @@ public: null_object = str_p( "null" )[boost::bind(&PDFGrammar::pushNull, pSelf, _1, _2)]; - #ifdef USE_ASSIGN_ACTOR - objectref = ( uint_p[push_back_a(pSelf->m_aUIntStack)] - >> uint_p[push_back_a(pSelf->m_aUIntStack)] - >> ch_p('R') - >> eps_p - )[boost::bind(&PDFGrammar::pushObjectRef, pSelf, _1, _2)]; - #else objectref = ( uint_p[boost::bind(&PDFGrammar::push_back_action_uint, pSelf, _1)] >> uint_p[boost::bind(&PDFGrammar::push_back_action_uint, pSelf, _1)] >> ch_p('R') >> eps_p )[boost::bind(&PDFGrammar::pushObjectRef, pSelf, _1, _2)]; - #endif - #ifdef USE_ASSIGN_ACTOR - simple_type = objectref | name | - ( real_p[assign_a(pSelf->m_fDouble)] >> eps_p ) - [boost::bind(&PDFGrammar::pushDouble, pSelf, _1, _2)] - | stringtype | boolean | null_object; - #else simple_type = objectref | name | ( real_p[boost::bind(&PDFGrammar::assign_action_double, pSelf, _1)] >> eps_p ) [boost::bind(&PDFGrammar::pushDouble, pSelf, _1, _2)] | stringtype | boolean | null_object; - #endif dict_begin = str_p( "<<" )[boost::bind(&PDFGrammar::beginDict, pSelf, _1, _2)]; dict_end = str_p( ">>" )[boost::bind(&PDFGrammar::endDict, pSelf, _1, _2)]; @@ -189,15 +174,9 @@ public: array_begin = str_p("[")[boost::bind(&PDFGrammar::beginArray,pSelf, _1, _2)]; array_end = str_p("]")[boost::bind(&PDFGrammar::endArray,pSelf, _1, _2)]; - #ifdef USE_ASSIGN_ACTOR - object_begin= uint_p[push_back_a(pSelf->m_aUIntStack)] - >> uint_p[push_back_a(pSelf->m_aUIntStack)] - >> str_p("obj" )[boost::bind(&PDFGrammar::beginObject, pSelf, _1, _2)]; - #else object_begin= uint_p[boost::bind(&PDFGrammar::push_back_action_uint, pSelf, _1)] >> uint_p[boost::bind(&PDFGrammar::push_back_action_uint, pSelf, _1)] >> str_p("obj" )[boost::bind(&PDFGrammar::beginObject, pSelf, _1, _2)]; - #endif object_end = str_p( "endobj" )[boost::bind(&PDFGrammar::endObject, pSelf, _1, _2)]; xref = str_p( "xref" ) >> uint_p >> uint_p @@ -224,17 +203,6 @@ public: >> uint_p >> str_p("%%EOF")[boost::bind(&PDFGrammar::endTrailer,pSelf,_1,_2)]; - #ifdef USE_ASSIGN_ACTOR - pdfrule = ! (lexeme_d[ - str_p( "%PDF-" ) - >> uint_p[push_back_a(pSelf->m_aUIntStack)] - >> ch_p('.') - >> uint_p[push_back_a(pSelf->m_aUIntStack)] - >> *((~ch_p(' ') & ~ch_p(' '))) - >> eol_p - ])[boost::bind(&PDFGrammar::haveFile,pSelf, _1, _2)] - >> *( comment | object | ( xref >> trailer ) ); - #else pdfrule = ! (lexeme_d[ str_p( "%PDF-" ) >> uint_p[boost::bind(&PDFGrammar::push_back_action_uint, pSelf, _1)] @@ -244,7 +212,6 @@ public: >> eol_p ])[boost::bind(&PDFGrammar::haveFile,pSelf, _1, _2)] >> *( comment | object | ( xref >> trailer ) ); - #endif } rule< ScannerT > comment, stream, boolean, name, stringtype, null_object, simple_type, objectref, array, value, dict_element, dict_begin, dict_end, @@ -254,7 +221,6 @@ public: const rule< ScannerT >& start() const { return pdfrule; } }; - #ifndef USE_ASSIGN_ACTOR void push_back_action_uint( unsigned int i ) { m_aUIntStack.push_back( i ); @@ -263,7 +229,6 @@ public: { m_fDouble = d; } - #endif [[noreturn]] static void parseError( const char* pMessage, const iteratorT& pLocation ) { commit dc5bb54dc34a1ce3d17daa1dd84ee8dbe39d50b3 Author: Noel Grandin <[email protected]> AuthorDate: Mon Jun 30 13:14:47 2025 +0200 Commit: Noel Grandin <[email protected]> CommitDate: Tue Jul 1 09:36:34 2025 +0200 no need to allocate SfxStyleSheetIterator on the heap here Change-Id: Ib4ecfea3c92b071786541128ab56e0fd979842a4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/187205 Tested-by: Jenkins Reviewed-by: Noel Grandin <[email protected]> diff --git a/editeng/source/editeng/impedit4.cxx b/editeng/source/editeng/impedit4.cxx index a3a349f04243..c21eecb893a2 100644 --- a/editeng/source/editeng/impedit4.cxx +++ b/editeng/source/editeng/impedit4.cxx @@ -498,12 +498,11 @@ ErrCode ImpEditEngine::WriteRTF( SvStream& rOutput, EditSelection aSel, bool bCl } } - std::shared_ptr<SfxStyleSheetIterator> aSSSIterator = std::make_shared<SfxStyleSheetIterator>(GetStyleSheetPool(), - SfxStyleFamily::All); + SfxStyleSheetIterator aSSSIterator(GetStyleSheetPool(), SfxStyleFamily::All); // fill aStyleSheetToIdMap sal_uInt32 nId = 1; - for ( SfxStyleSheetBase* pStyle = aSSSIterator->First(); pStyle; - pStyle = aSSSIterator->Next() ) + for ( SfxStyleSheetBase* pStyle = aSSSIterator.First(); pStyle; + pStyle = aSSSIterator.Next() ) { if (bClipboard && !aUsedParagraphStyles.contains(pStyle)) { @@ -514,14 +513,14 @@ ErrCode ImpEditEngine::WriteRTF( SvStream& rOutput, EditSelection aSel, bool bCl nId++; } - if ( aSSSIterator->Count() ) + if ( aSSSIterator.Count() ) { sal_uInt32 nStyle = 0; rOutput.WriteChar( '{' ).WriteOString( OOO_STRING_SVTOOLS_RTF_STYLESHEET ); - for ( SfxStyleSheetBase* pStyle = aSSSIterator->First(); pStyle; - pStyle = aSSSIterator->Next() ) + for ( SfxStyleSheetBase* pStyle = aSSSIterator.First(); pStyle; + pStyle = aSSSIterator.Next() ) { if (bClipboard && !aUsedParagraphStyles.contains(pStyle)) { diff --git a/sd/source/core/stlfamily.cxx b/sd/source/core/stlfamily.cxx index 2262ef1203d2..2139e3e6930c 100644 --- a/sd/source/core/stlfamily.cxx +++ b/sd/source/core/stlfamily.cxx @@ -79,9 +79,9 @@ PresStyleMap& SdStyleFamilyImpl::getStyleSheets() maStyleSheets.clear(); // The iterator will return only style sheets of family master page - std::shared_ptr<SfxStyleSheetIterator> aSSSIterator = std::make_shared<SfxStyleSheetIterator>(mxPool.get(), SfxStyleFamily::Page); - for ( SfxStyleSheetBase* pStyle = aSSSIterator->First(); pStyle; - pStyle = aSSSIterator->Next() ) + SfxStyleSheetIterator aSSSIterator(mxPool.get(), SfxStyleFamily::Page); + for ( SfxStyleSheetBase* pStyle = aSSSIterator.First(); pStyle; + pStyle = aSSSIterator.Next() ) { // we assume that we have only SdStyleSheets SdStyleSheet* pSdStyle = static_cast< SdStyleSheet* >( pStyle ); @@ -147,9 +147,9 @@ SdStyleSheet* SdStyleFamily::GetSheetByName( const OUString& rName ) } else { - std::shared_ptr<SfxStyleSheetIterator> aSSSIterator = std::make_shared<SfxStyleSheetIterator>(mxPool.get(), mnFamily); - for ( SfxStyleSheetBase* pStyle = aSSSIterator->First(); pStyle; - pStyle = aSSSIterator->Next() ) + SfxStyleSheetIterator aSSSIterator(mxPool.get(), mnFamily); + for ( SfxStyleSheetBase* pStyle = aSSSIterator.First(); pStyle; + pStyle = aSSSIterator.Next() ) { // we assume that we have only SdStyleSheets SdStyleSheet* pSdStyle = static_cast< SdStyleSheet* >( pStyle ); @@ -243,9 +243,9 @@ Sequence< OUString > SAL_CALL SdStyleFamily::getElementNames() else { std::vector< OUString > aNames; - std::shared_ptr<SfxStyleSheetIterator> aSSSIterator = std::make_shared<SfxStyleSheetIterator>(mxPool.get(), mnFamily); - for ( SfxStyleSheetBase* pStyle = aSSSIterator->First(); pStyle; - pStyle = aSSSIterator->Next() ) + SfxStyleSheetIterator aSSSIterator(mxPool.get(), mnFamily); + for ( SfxStyleSheetBase* pStyle = aSSSIterator.First(); pStyle; + pStyle = aSSSIterator.Next() ) { // we assume that we have only SdStyleSheets SdStyleSheet* pSdStyle = static_cast< SdStyleSheet* >( pStyle ); @@ -270,9 +270,9 @@ sal_Bool SAL_CALL SdStyleFamily::hasByName( const OUString& aName ) } else { - std::shared_ptr<SfxStyleSheetIterator> aSSSIterator = std::make_shared<SfxStyleSheetIterator>(mxPool.get(), mnFamily); - for ( SfxStyleSheetBase* pStyle = aSSSIterator->First(); pStyle; - pStyle = aSSSIterator->Next() ) + SfxStyleSheetIterator aSSSIterator(mxPool.get(), mnFamily); + for ( SfxStyleSheetBase* pStyle = aSSSIterator.First(); pStyle; + pStyle = aSSSIterator.Next() ) { // we assume that we have only SdStyleSheets SdStyleSheet* pSdStyle = static_cast< SdStyleSheet* >( pStyle ); @@ -305,8 +305,8 @@ sal_Bool SAL_CALL SdStyleFamily::hasElements() } else { - std::shared_ptr<SfxStyleSheetIterator> aSSSIterator = std::make_shared<SfxStyleSheetIterator>(mxPool.get(), mnFamily); - if (aSSSIterator->First()) + SfxStyleSheetIterator aSSSIterator(mxPool.get(), mnFamily); + if (aSSSIterator.First()) { return true; } @@ -329,9 +329,9 @@ sal_Int32 SAL_CALL SdStyleFamily::getCount() } else { - std::shared_ptr<SfxStyleSheetIterator> aSSSIterator = std::make_shared<SfxStyleSheetIterator>(mxPool.get(), mnFamily); - for ( SfxStyleSheetBase* pStyle = aSSSIterator->First(); pStyle; - pStyle = aSSSIterator->Next() ) + SfxStyleSheetIterator aSSSIterator(mxPool.get(), mnFamily); + for ( SfxStyleSheetBase* pStyle = aSSSIterator.First(); pStyle; + pStyle = aSSSIterator.Next() ) { nCount++; } @@ -359,9 +359,9 @@ Any SAL_CALL SdStyleFamily::getByIndex( sal_Int32 Index ) } else { - std::shared_ptr<SfxStyleSheetIterator> aSSSIterator = std::make_shared<SfxStyleSheetIterator>(mxPool.get(), mnFamily); - for ( SfxStyleSheetBase* pStyle = aSSSIterator->First(); pStyle; - pStyle = aSSSIterator->Next() ) + SfxStyleSheetIterator aSSSIterator(mxPool.get(), mnFamily); + for ( SfxStyleSheetBase* pStyle = aSSSIterator.First(); pStyle; + pStyle = aSSSIterator.Next() ) { // we assume that we have only SdStyleSheets SdStyleSheet* pSdStyle = static_cast< SdStyleSheet* >( pStyle ); diff --git a/sd/source/core/stlsheet.cxx b/sd/source/core/stlsheet.cxx index ea944df631b0..db64921180f7 100644 --- a/sd/source/core/stlsheet.cxx +++ b/sd/source/core/stlsheet.cxx @@ -941,8 +941,8 @@ void SAL_CALL SdStyleSheet::setParentStyle( const OUString& rParentName ) OUString const& name(GetName()); sal_Int32 const sep(name.indexOf(SD_LT_SEPARATOR)); OUString const master((sep == -1) ? OUString() : name.copy(0, sep)); - std::shared_ptr<SfxStyleSheetIterator> aSSSI = std::make_shared<SfxStyleSheetIterator>(mxPool.get(), nFamily); - for (SfxStyleSheetBase *pStyle = aSSSI->First(); pStyle; pStyle = aSSSI->Next()) + SfxStyleSheetIterator aSSSI(mxPool.get(), nFamily); + for (SfxStyleSheetBase *pStyle = aSSSI.First(); pStyle; pStyle = aSSSI.Next()) { // we hope that we have only sd style sheets SdStyleSheet* pSdStyleSheet = static_cast<SdStyleSheet*>(pStyle); diff --git a/sd/source/filter/ppt/pptin.cxx b/sd/source/filter/ppt/pptin.cxx index 510d25f1bd61..e774dc9f0048 100644 --- a/sd/source/filter/ppt/pptin.cxx +++ b/sd/source/filter/ppt/pptin.cxx @@ -135,10 +135,9 @@ SdPPTImport::SdPPTImport( SdDrawDocument& rDocument, SvStream& rDocStream, SotSt // iterate over all styles SdStyleSheetPool* pStyleSheetPool = rDocument.GetSdStyleSheetPool(); - std::shared_ptr<SfxStyleSheetIterator> aIter = - std::make_shared<SfxStyleSheetIterator>(pStyleSheetPool, SfxStyleFamily::All); + SfxStyleSheetIterator aIter(pStyleSheetPool, SfxStyleFamily::All); - for (SfxStyleSheetBase *pSheet = aIter->First(); pSheet; pSheet = aIter->Next()) + for (SfxStyleSheetBase *pSheet = aIter.First(); pSheet; pSheet = aIter.Next()) { SfxItemSet& rSet = pSheet->GetItemSet(); // if autokerning is set in style, override it, ppt has no autokerning
