split the creation of SfxStyleFamilies into a method
Change-Id: I2590180fc30d75c89e758c72246a8294b5c4b9a2
This commit is contained in:
@@ -37,6 +37,7 @@ class SfxObjectFactory;
|
|||||||
class SfxModule;
|
class SfxModule;
|
||||||
class SfxModule_Impl;
|
class SfxModule_Impl;
|
||||||
class SfxSlotPool;
|
class SfxSlotPool;
|
||||||
|
class SfxStyleFamilies;
|
||||||
struct SfxChildWinContextFactory;
|
struct SfxChildWinContextFactory;
|
||||||
struct SfxChildWinFactory;
|
struct SfxChildWinFactory;
|
||||||
struct SfxStbCtrlFactory;
|
struct SfxStbCtrlFactory;
|
||||||
@@ -84,6 +85,8 @@ public:
|
|||||||
const SfxItemSet& rSet );
|
const SfxItemSet& rSet );
|
||||||
virtual void Invalidate(sal_uInt16 nId = 0) override;
|
virtual void Invalidate(sal_uInt16 nId = 0) override;
|
||||||
|
|
||||||
|
SfxStyleFamilies* CreateStyleFamilies();
|
||||||
|
|
||||||
static SfxModule* GetActiveModule( SfxViewFrame* pFrame=nullptr );
|
static SfxModule* GetActiveModule( SfxViewFrame* pFrame=nullptr );
|
||||||
static FieldUnit GetCurrentFieldUnit();
|
static FieldUnit GetCurrentFieldUnit();
|
||||||
/** retrieves the field unit of the module belonging to the document displayed in the given frame
|
/** retrieves the field unit of the module belonging to the document displayed in the given frame
|
||||||
|
@@ -23,6 +23,7 @@
|
|||||||
#include <sfx2/module.hxx>
|
#include <sfx2/module.hxx>
|
||||||
#include <sfx2/app.hxx>
|
#include <sfx2/app.hxx>
|
||||||
#include <sfx2/sfxresid.hxx>
|
#include <sfx2/sfxresid.hxx>
|
||||||
|
#include <sfx2/styfitem.hxx>
|
||||||
#include <sfx2/msgpool.hxx>
|
#include <sfx2/msgpool.hxx>
|
||||||
#include <sfx2/tbxctrl.hxx>
|
#include <sfx2/tbxctrl.hxx>
|
||||||
#include <sfx2/stbitem.hxx>
|
#include <sfx2/stbitem.hxx>
|
||||||
@@ -291,4 +292,18 @@ FieldUnit SfxModule::GetFieldUnit() const
|
|||||||
return eUnit;
|
return eUnit;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
SfxStyleFamilies* SfxModule::CreateStyleFamilies()
|
||||||
|
{
|
||||||
|
SfxStyleFamilies *pStyleFamilies = nullptr;
|
||||||
|
ResMgr* pMgr = GetResMgr();
|
||||||
|
if (pMgr)
|
||||||
|
{
|
||||||
|
ResId aFamId(DLG_STYLE_DESIGNER, *pMgr);
|
||||||
|
aFamId.SetRT(RSC_SFX_STYLE_FAMILIES);
|
||||||
|
if (pMgr->IsAvailable(aFamId))
|
||||||
|
pStyleFamilies = new SfxStyleFamilies(aFamId);
|
||||||
|
}
|
||||||
|
return pStyleFamilies;
|
||||||
|
}
|
||||||
|
|
||||||
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|
||||||
|
@@ -95,9 +95,7 @@ SfxManageStyleSheetPage::SfxManageStyleSheetPage(vcl::Window* pParent, const Sfx
|
|||||||
else
|
else
|
||||||
m_pEditLinkStyleBtn->Enable();
|
m_pEditLinkStyleBtn->Enable();
|
||||||
|
|
||||||
ResMgr* pResMgr = SfxApplication::GetModule_Impl()->GetResMgr();
|
pFamilies = SfxApplication::GetModule_Impl()->CreateStyleFamilies();
|
||||||
OSL_ENSURE( pResMgr, "No ResMgr in Module" );
|
|
||||||
pFamilies = new SfxStyleFamilies( ResId( DLG_STYLE_DESIGNER, *pResMgr ) );
|
|
||||||
|
|
||||||
SfxStyleSheetBasePool* pPool = nullptr;
|
SfxStyleSheetBasePool* pPool = nullptr;
|
||||||
SfxObjectShell* pDocShell = SfxObjectShell::Current();
|
SfxObjectShell* pDocShell = SfxObjectShell::Current();
|
||||||
|
@@ -736,14 +736,8 @@ void SfxCommonTemplateDialog_Impl::ReadResource()
|
|||||||
SfxViewFrame* pViewFrame = pBindings->GetDispatcher_Impl()->GetFrame();
|
SfxViewFrame* pViewFrame = pBindings->GetDispatcher_Impl()->GetFrame();
|
||||||
pCurObjShell = pViewFrame->GetObjectShell();
|
pCurObjShell = pViewFrame->GetObjectShell();
|
||||||
pModule = pCurObjShell ? pCurObjShell->GetModule() : nullptr;
|
pModule = pCurObjShell ? pCurObjShell->GetModule() : nullptr;
|
||||||
ResMgr* pMgr = pModule ? pModule->GetResMgr() : nullptr;
|
if (pModule)
|
||||||
if (pMgr)
|
pStyleFamilies = pModule->CreateStyleFamilies();
|
||||||
{
|
|
||||||
ResId aFamId( DLG_STYLE_DESIGNER, *pMgr );
|
|
||||||
aFamId.SetRT(RSC_SFX_STYLE_FAMILIES);
|
|
||||||
if (pMgr->IsAvailable(aFamId))
|
|
||||||
pStyleFamilies = new SfxStyleFamilies( aFamId );
|
|
||||||
}
|
|
||||||
if (!pStyleFamilies)
|
if (!pStyleFamilies)
|
||||||
pStyleFamilies = new SfxStyleFamilies;
|
pStyleFamilies = new SfxStyleFamilies;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user