diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-05-28 09:53:29 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-05-28 13:19:18 +0200 |
commit | 6eb3d37fdc75537aa94144eef97493ec6192792f (patch) | |
tree | 4f65352402590eee8dd6164644ee2140ad0e79da /sw | |
parent | a4b66458a7b8da2f5580014813e5dabe3fa670b6 (diff) |
no need to allocate SfxStyleFamilies on the heap
Change-Id: Ibedb36dec14c61927ef594ddf47fda94728530a8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116319
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sw')
-rw-r--r-- | sw/inc/swmodule.hxx | 2 | ||||
-rw-r--r-- | sw/source/ui/chrdlg/swuiccoll.cxx | 2 | ||||
-rw-r--r-- | sw/source/uibase/app/swmodule.cxx | 18 |
3 files changed, 11 insertions, 11 deletions
diff --git a/sw/inc/swmodule.hxx b/sw/inc/swmodule.hxx index 987e75e61559..3b59b529bfa0 100644 --- a/sw/inc/swmodule.hxx +++ b/sw/inc/swmodule.hxx @@ -230,7 +230,7 @@ public: virtual std::unique_ptr<SfxItemSet> CreateItemSet( sal_uInt16 nId ) override; virtual void ApplyItemSet( sal_uInt16 nId, const SfxItemSet& rSet ) override; virtual std::unique_ptr<SfxTabPage> CreateTabPage( sal_uInt16 nId, weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& rSet ) override; - virtual std::unique_ptr<SfxStyleFamilies> CreateStyleFamilies() override; + virtual std::optional<SfxStyleFamilies> CreateStyleFamilies() override; // Pool is created here and set at SfxShell. void InitAttrPool(); diff --git a/sw/source/ui/chrdlg/swuiccoll.cxx b/sw/source/ui/chrdlg/swuiccoll.cxx index 642651283428..6b35b6a309e5 100644 --- a/sw/source/ui/chrdlg/swuiccoll.cxx +++ b/sw/source/ui/chrdlg/swuiccoll.cxx @@ -72,7 +72,7 @@ SwCondCollPage::SwCondCollPage(weld::Container* pPage, weld::DialogController* p m_xStyleLB->connect_changed(LINK(this, SwCondCollPage, SelectTreeListBoxHdl)); m_xFilterLB->connect_changed(LINK(this, SwCondCollPage, SelectListBoxHdl)); - std::unique_ptr<SfxStyleFamilies> xFamilies(SW_MOD()->CreateStyleFamilies()); + std::optional<SfxStyleFamilies> xFamilies(SW_MOD()->CreateStyleFamilies()); size_t nCount = xFamilies->size(); for (size_t j = 0; j < nCount; ++j) { diff --git a/sw/source/uibase/app/swmodule.cxx b/sw/source/uibase/app/swmodule.cxx index 485bb7a52d41..1a9622ebbd5f 100644 --- a/sw/source/uibase/app/swmodule.cxx +++ b/sw/source/uibase/app/swmodule.cxx @@ -341,41 +341,41 @@ void SwModule::RemoveAttrPool() m_pAttrPool.clear(); } -std::unique_ptr<SfxStyleFamilies> SwModule::CreateStyleFamilies() +std::optional<SfxStyleFamilies> SwModule::CreateStyleFamilies() { - std::unique_ptr<SfxStyleFamilies> pStyleFamilies(new SfxStyleFamilies); + SfxStyleFamilies aStyleFamilies; - pStyleFamilies->emplace_back(SfxStyleFamily::Para, + aStyleFamilies.emplace_back(SfxStyleFamily::Para, SwResId(STR_PARAGRAPHSTYLEFAMILY), BMP_STYLES_FAMILY_PARA, RID_PARAGRAPHSTYLEFAMILY, GetResLocale()); - pStyleFamilies->emplace_back(SfxStyleFamily::Char, + aStyleFamilies.emplace_back(SfxStyleFamily::Char, SwResId(STR_CHARACTERSTYLEFAMILY), BMP_STYLES_FAMILY_CHAR, RID_CHARACTERSTYLEFAMILY, GetResLocale()); - pStyleFamilies->emplace_back(SfxStyleFamily::Frame, + aStyleFamilies.emplace_back(SfxStyleFamily::Frame, SwResId(STR_FRAMESTYLEFAMILY), BMP_STYLES_FAMILY_FRAME, RID_FRAMESTYLEFAMILY, GetResLocale()); - pStyleFamilies->emplace_back(SfxStyleFamily::Page, + aStyleFamilies.emplace_back(SfxStyleFamily::Page, SwResId(STR_PAGESTYLEFAMILY), BMP_STYLES_FAMILY_PAGE, RID_PAGESTYLEFAMILY, GetResLocale()); - pStyleFamilies->emplace_back(SfxStyleFamily::Pseudo, + aStyleFamilies.emplace_back(SfxStyleFamily::Pseudo, SwResId(STR_LISTSTYLEFAMILY), BMP_STYLES_FAMILY_LIST, RID_LISTSTYLEFAMILY, GetResLocale()); - pStyleFamilies->emplace_back(SfxStyleFamily::Table, + aStyleFamilies.emplace_back(SfxStyleFamily::Table, SwResId(STR_TABLESTYLEFAMILY), BMP_STYLES_FAMILY_TABLE, RID_TABLESTYLEFAMILY, GetResLocale()); - return pStyleFamilies; + return aStyleFamilies; } void SwModule::RegisterAutomationApplicationEventsCaller(css::uno::Reference< ooo::vba::XSinkCaller > const& xCaller) |