Kaydet (Commit) 5ad5f5ec authored tarafından Noel Grandin's avatar Noel Grandin

make CreateStyleFamilies return std::unique_ptr

Change-Id: Ibb7bec9ede8045a6cea42c02f61f14ad36d2b434
Reviewed-on: https://gerrit.libreoffice.org/53730Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
üst 2bffccf7
......@@ -83,7 +83,7 @@ public:
const SfxItemSet& rSet );
virtual void Invalidate(sal_uInt16 nId = 0) override;
virtual SfxStyleFamilies* CreateStyleFamilies() { return nullptr; }
virtual std::unique_ptr<SfxStyleFamilies> CreateStyleFamilies() { return nullptr; }
static SfxModule* GetActiveModule( SfxViewFrame* pFrame=nullptr );
static FieldUnit GetCurrentFieldUnit();
......
......@@ -239,7 +239,7 @@ public:
virtual std::unique_ptr<SfxItemSet> CreateItemSet( sal_uInt16 nId ) override;
virtual void ApplyItemSet( sal_uInt16 nId, const SfxItemSet& rSet ) override;
virtual VclPtr<SfxTabPage> CreateTabPage( sal_uInt16 nId, TabPageParent pParent, const SfxItemSet& rSet ) override;
virtual SfxStyleFamilies* CreateStyleFamilies() override;
virtual std::unique_ptr<SfxStyleFamilies> CreateStyleFamilies() override;
void SetInSharedDocLoading( bool bNew ) { m_bIsInSharedDocLoading = bNew; }
bool IsInSharedDocLoading() const { return m_bIsInSharedDocLoading; }
......
......@@ -2271,9 +2271,9 @@ bool ScModule::HasThesaurusLanguage( LanguageType nLang )
return bHasLang;
}
SfxStyleFamilies* ScModule::CreateStyleFamilies()
std::unique_ptr<SfxStyleFamilies> ScModule::CreateStyleFamilies()
{
SfxStyleFamilies *pStyleFamilies = new SfxStyleFamilies;
std::unique_ptr<SfxStyleFamilies> pStyleFamilies(new SfxStyleFamilies);
pStyleFamilies->emplace_back(SfxStyleFamilyItem(SfxStyleFamily::Para,
ScResId(STR_STYLE_FAMILY_CELL),
......
......@@ -111,7 +111,7 @@ public:
virtual std::unique_ptr<SfxItemSet> CreateItemSet( sal_uInt16 nId ) override;
virtual void ApplyItemSet( sal_uInt16 nId, const SfxItemSet& rSet ) override;
virtual VclPtr<SfxTabPage> CreateTabPage( sal_uInt16 nId, TabPageParent pParent, const SfxItemSet& rSet ) override;
virtual SfxStyleFamilies* CreateStyleFamilies() override;
virtual std::unique_ptr<SfxStyleFamilies> CreateStyleFamilies() override;
SdExtPropertySetInfoCache gImplImpressPropertySetInfoCache;
SdExtPropertySetInfoCache gImplDrawPropertySetInfoCache;
......
......@@ -808,9 +808,9 @@ VclPtr<SfxTabPage> SdModule::CreateTabPage( sal_uInt16 nId, TabPageParent pParen
return pRet;
}
SfxStyleFamilies* SdModule::CreateStyleFamilies()
std::unique_ptr<SfxStyleFamilies> SdModule::CreateStyleFamilies()
{
SfxStyleFamilies *pStyleFamilies = new SfxStyleFamilies;
std::unique_ptr<SfxStyleFamilies> pStyleFamilies(new SfxStyleFamilies);
pStyleFamilies->emplace_back(SfxStyleFamilyItem(SfxStyleFamily::Para,
SdResId(STR_GRAPHICS_STYLE_FAMILY),
......
......@@ -92,7 +92,7 @@ SfxManageStyleSheetPage::SfxManageStyleSheetPage(vcl::Window* pParent, const Sfx
else
m_pEditLinkStyleBtn->Enable();
pFamilies.reset(SfxApplication::GetModule_Impl()->CreateStyleFamilies());
pFamilies = SfxApplication::GetModule_Impl()->CreateStyleFamilies();
SfxStyleSheetBasePool* pPool = nullptr;
SfxObjectShell* pDocShell = SfxObjectShell::Current();
......
......@@ -704,7 +704,7 @@ void SfxCommonTemplateDialog_Impl::ReadResource()
pCurObjShell = pViewFrame->GetObjectShell();
pModule = pCurObjShell ? pCurObjShell->GetModule() : nullptr;
if (pModule)
pStyleFamilies.reset(pModule->CreateStyleFamilies());
pStyleFamilies = pModule->CreateStyleFamilies();
if (!pStyleFamilies)
pStyleFamilies.reset(new SfxStyleFamilies);
......
......@@ -226,7 +226,7 @@ public:
virtual std::unique_ptr<SfxItemSet> CreateItemSet( sal_uInt16 nId ) override;
virtual void ApplyItemSet( sal_uInt16 nId, const SfxItemSet& rSet ) override;
virtual VclPtr<SfxTabPage> CreateTabPage( sal_uInt16 nId, TabPageParent pParent, const SfxItemSet& rSet ) override;
virtual SfxStyleFamilies* CreateStyleFamilies() override;
virtual std::unique_ptr<SfxStyleFamilies> CreateStyleFamilies() override;
// Pool is created here and set at SfxShell.
void InitAttrPool();
......
......@@ -400,9 +400,9 @@ void SwModule::RemoveAttrPool()
SfxItemPool::Free(m_pAttrPool);
}
SfxStyleFamilies* SwModule::CreateStyleFamilies()
std::unique_ptr<SfxStyleFamilies> SwModule::CreateStyleFamilies()
{
SfxStyleFamilies *pStyleFamilies = new SfxStyleFamilies;
std::unique_ptr<SfxStyleFamilies> pStyleFamilies(new SfxStyleFamilies);
pStyleFamilies->emplace_back(SfxStyleFamilyItem(SfxStyleFamily::Para,
SwResId(STR_PARAGRAPHSTYLEFAMILY),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment