Kaydet (Commit) b7d4b1da authored tarafından Caolán McNamara's avatar Caolán McNamara

weld SdTabTemplateDlg

Change-Id: I3aae53844f839ff54fab85ab4649c0bf0691e6de
Reviewed-on: https://gerrit.libreoffice.org/61927
Tested-by: Jenkins
Reviewed-by: 's avatarCaolán McNamara <caolanm@redhat.com>
Tested-by: 's avatarCaolán McNamara <caolanm@redhat.com>
üst 0e19bb25
...@@ -184,7 +184,7 @@ public: ...@@ -184,7 +184,7 @@ public:
virtual VclPtr<VclAbstractDialog> CreateRemoteDialog( vcl::Window* pWindow ) = 0; virtual VclPtr<VclAbstractDialog> CreateRemoteDialog( vcl::Window* pWindow ) = 0;
virtual VclPtr<SfxAbstractTabDialog> CreateSdPresLayoutTemplateDlg(SfxObjectShell* pDocSh, weld::Window* pParent, bool bBackgroundDlg, SfxStyleSheetBase& rStyleBase, PresentationObjects ePO, SfxStyleSheetBasePool* pSSPool) = 0; virtual VclPtr<SfxAbstractTabDialog> CreateSdPresLayoutTemplateDlg(SfxObjectShell* pDocSh, weld::Window* pParent, bool bBackgroundDlg, SfxStyleSheetBase& rStyleBase, PresentationObjects ePO, SfxStyleSheetBasePool* pSSPool) = 0;
virtual VclPtr<AbstractSdPresLayoutDlg> CreateSdPresLayoutDlg(weld::Window* pParent, ::sd::DrawDocShell* pDocShell, const SfxItemSet& rInAttrs) = 0; virtual VclPtr<AbstractSdPresLayoutDlg> CreateSdPresLayoutDlg(weld::Window* pParent, ::sd::DrawDocShell* pDocShell, const SfxItemSet& rInAttrs) = 0;
virtual VclPtr<SfxAbstractTabDialog> CreateSdTabTemplateDlg(vcl::Window* pParent, const SfxObjectShell* pDocShell, SfxStyleSheetBase& rStyleBase, SdrModel* pModel, SdrView* pView) = 0; virtual VclPtr<SfxAbstractTabDialog> CreateSdTabTemplateDlg(weld::Window* pParent, const SfxObjectShell* pDocShell, SfxStyleSheetBase& rStyleBase, SdrModel* pModel, SdrView* pView) = 0;
virtual VclPtr<SfxAbstractDialog> CreatSdActionDialog(vcl::Window* pParent, const SfxItemSet* pAttr, ::sd::View* pView) = 0; virtual VclPtr<SfxAbstractDialog> CreatSdActionDialog(vcl::Window* pParent, const SfxItemSet* pAttr, ::sd::View* pView) = 0;
virtual VclPtr<AbstractSdVectorizeDlg> CreateSdVectorizeDlg(weld::Window* pParent, const Bitmap& rBmp, ::sd::DrawDocShell* pDocShell) = 0; virtual VclPtr<AbstractSdVectorizeDlg> CreateSdVectorizeDlg(weld::Window* pParent, const Bitmap& rBmp, ::sd::DrawDocShell* pDocShell) = 0;
virtual VclPtr<AbstractSdPublishingDlg> CreateSdPublishingDlg( vcl::Window* pWindow, DocumentType eDocType) = 0; virtual VclPtr<AbstractSdPublishingDlg> CreateSdPublishingDlg( vcl::Window* pWindow, DocumentType eDocType) = 0;
......
...@@ -502,7 +502,7 @@ VclPtr<VclAbstractDialog> SdDialogsTest::createDialogByID(sal_uInt32 nID) ...@@ -502,7 +502,7 @@ VclPtr<VclAbstractDialog> SdDialogsTest::createDialogByID(sal_uInt32 nID)
SdDrawDocument* pDrawDoc = getSdXImpressDocument()->GetDoc(); SdDrawDocument* pDrawDoc = getSdXImpressDocument()->GetDoc();
CPPUNIT_ASSERT(pDrawDoc); CPPUNIT_ASSERT(pDrawDoc);
pRetval = getSdAbstractDialogFactory()->CreateSdTabTemplateDlg( pRetval = getSdAbstractDialogFactory()->CreateSdTabTemplateDlg(
getViewShell()->GetActiveWindow(), getViewShell()->GetFrameWeld(),
getDocShell(), getDocShell(),
*pStyleSheet, *pStyleSheet,
pDrawDoc, pDrawDoc,
......
...@@ -475,9 +475,9 @@ VclPtr<AbstractSdPresLayoutDlg> SdAbstractDialogFactory_Impl::CreateSdPresLayout ...@@ -475,9 +475,9 @@ VclPtr<AbstractSdPresLayoutDlg> SdAbstractDialogFactory_Impl::CreateSdPresLayout
return VclPtr<AbstractSdPresLayoutDlg_Impl>::Create(o3tl::make_unique<SdPresLayoutDlg>(pDocShell, pParent, rInAttrs)); return VclPtr<AbstractSdPresLayoutDlg_Impl>::Create(o3tl::make_unique<SdPresLayoutDlg>(pDocShell, pParent, rInAttrs));
} }
VclPtr<SfxAbstractTabDialog> SdAbstractDialogFactory_Impl::CreateSdTabTemplateDlg(vcl::Window* pParent, const SfxObjectShell* pDocShell, SfxStyleSheetBase& rStyleBase, SdrModel* pModel, SdrView* pView ) VclPtr<SfxAbstractTabDialog> SdAbstractDialogFactory_Impl::CreateSdTabTemplateDlg(weld::Window* pParent, const SfxObjectShell* pDocShell, SfxStyleSheetBase& rStyleBase, SdrModel* pModel, SdrView* pView)
{ {
return VclPtr<SdAbstractTabDialog_Impl>::Create( VclPtr<SdTabTemplateDlg>::Create( pParent, pDocShell, rStyleBase, pModel, pView ) ); return VclPtr<SdAbstractTabController_Impl>::Create(o3tl::make_unique<SdTabTemplateDlg>(pParent, pDocShell, rStyleBase, pModel, pView));
} }
VclPtr<SfxAbstractDialog> SdAbstractDialogFactory_Impl::CreatSdActionDialog(vcl::Window* pParent, const SfxItemSet* pAttr, ::sd::View* pView ) VclPtr<SfxAbstractDialog> SdAbstractDialogFactory_Impl::CreatSdActionDialog(vcl::Window* pParent, const SfxItemSet* pAttr, ::sd::View* pView )
......
...@@ -353,7 +353,7 @@ public: ...@@ -353,7 +353,7 @@ public:
virtual VclPtr<VclAbstractDialog> CreateRemoteDialog( vcl::Window* pWindow ) override; // add for RemoteDialog virtual VclPtr<VclAbstractDialog> CreateRemoteDialog( vcl::Window* pWindow ) override; // add for RemoteDialog
virtual VclPtr<SfxAbstractTabDialog> CreateSdPresLayoutTemplateDlg(SfxObjectShell* pDocSh, weld::Window* pParent, bool bBackgroundDlg, SfxStyleSheetBase& rStyleBase, PresentationObjects ePO, SfxStyleSheetBasePool* pSSPool) override; virtual VclPtr<SfxAbstractTabDialog> CreateSdPresLayoutTemplateDlg(SfxObjectShell* pDocSh, weld::Window* pParent, bool bBackgroundDlg, SfxStyleSheetBase& rStyleBase, PresentationObjects ePO, SfxStyleSheetBasePool* pSSPool) override;
virtual VclPtr<AbstractSdPresLayoutDlg> CreateSdPresLayoutDlg(weld::Window* pParent, ::sd::DrawDocShell* pDocShell, const SfxItemSet& rInAttrs) override; virtual VclPtr<AbstractSdPresLayoutDlg> CreateSdPresLayoutDlg(weld::Window* pParent, ::sd::DrawDocShell* pDocShell, const SfxItemSet& rInAttrs) override;
virtual VclPtr<SfxAbstractTabDialog> CreateSdTabTemplateDlg(vcl::Window* pParent, const SfxObjectShell* pDocShell, SfxStyleSheetBase& rStyleBase, SdrModel* pModel, SdrView* pView ) override; virtual VclPtr<SfxAbstractTabDialog> CreateSdTabTemplateDlg(weld::Window* pParent, const SfxObjectShell* pDocShell, SfxStyleSheetBase& rStyleBase, SdrModel* pModel, SdrView* pView ) override;
virtual VclPtr<SfxAbstractDialog> CreatSdActionDialog(vcl::Window* pParent, const SfxItemSet* pAttr, ::sd::View* pView) override; virtual VclPtr<SfxAbstractDialog> CreatSdActionDialog(vcl::Window* pParent, const SfxItemSet* pAttr, ::sd::View* pView) override;
virtual VclPtr<AbstractSdVectorizeDlg> CreateSdVectorizeDlg(weld::Window* pParent, const Bitmap& rBmp, ::sd::DrawDocShell* pDocShell) override; virtual VclPtr<AbstractSdVectorizeDlg> CreateSdVectorizeDlg(weld::Window* pParent, const Bitmap& rBmp, ::sd::DrawDocShell* pDocShell) override;
virtual VclPtr<AbstractSdPublishingDlg> CreateSdPublishingDlg(vcl::Window* pWindow, DocumentType eDocType) override; virtual VclPtr<AbstractSdPublishingDlg> CreateSdPublishingDlg(vcl::Window* pWindow, DocumentType eDocType) override;
......
...@@ -46,14 +46,13 @@ ...@@ -46,14 +46,13 @@
/** /**
* Constructor of the Tab dialog: appends pages to the dialog * Constructor of the Tab dialog: appends pages to the dialog
*/ */
SdTabTemplateDlg::SdTabTemplateDlg( vcl::Window* pParent, SdTabTemplateDlg::SdTabTemplateDlg(weld::Window* pParent,
const SfxObjectShell* pDocShell, const SfxObjectShell* pDocShell,
SfxStyleSheetBase& rStyleBase, SfxStyleSheetBase& rStyleBase,
SdrModel const * pModel, SdrModel const * pModel,
SdrView* pView ) SdrView* pView)
: SfxStyleDialog(pParent, "TemplateDialog", : SfxStyleDialogController(pParent, "modules/simpress/ui/templatedialog.ui",
"modules/simpress/ui/templatedialog.ui", "TemplateDialog", rStyleBase)
rStyleBase)
, rDocShell(*pDocShell) , rDocShell(*pDocShell)
, pSdrView(pView) , pSdrView(pView)
, pColorList(pModel->GetColorList()) , pColorList(pModel->GetColorList())
...@@ -63,31 +62,21 @@ SdTabTemplateDlg::SdTabTemplateDlg( vcl::Window* pParent, ...@@ -63,31 +62,21 @@ SdTabTemplateDlg::SdTabTemplateDlg( vcl::Window* pParent,
, pPatternList(pModel->GetPatternList()) , pPatternList(pModel->GetPatternList())
, pDashList(pModel->GetDashList()) , pDashList(pModel->GetDashList())
, pLineEndList(pModel->GetLineEndList()) , pLineEndList(pModel->GetLineEndList())
, m_nLineId(0)
, m_nAreaId(0)
, m_nShadowId(0)
, m_nTransparencyId(0)
, m_nFontId(0)
, m_nFontEffectId(0)
, m_nBackgroundId(0)
, m_nTextId(0)
, m_nDimensionId(0)
, m_nConnectorId(0)
{ {
// fill Listbox and set Select-Handler // fill Listbox and set Select-Handler
m_nLineId = AddTabPage("line", RID_SVXPAGE_LINE); AddTabPage("line", RID_SVXPAGE_LINE);
m_nAreaId = AddTabPage("area", RID_SVXPAGE_AREA); AddTabPage("area", RID_SVXPAGE_AREA);
m_nShadowId = AddTabPage("shadowing", RID_SVXPAGE_SHADOW); AddTabPage("shadowing", RID_SVXPAGE_SHADOW);
m_nTransparencyId = AddTabPage("transparency", RID_SVXPAGE_TRANSPARENCE); AddTabPage("transparency", RID_SVXPAGE_TRANSPARENCE);
m_nFontId = AddTabPage("font", RID_SVXPAGE_CHAR_NAME); AddTabPage("font", RID_SVXPAGE_CHAR_NAME);
m_nFontEffectId = AddTabPage("fonteffect", RID_SVXPAGE_CHAR_EFFECTS); AddTabPage("fonteffect", RID_SVXPAGE_CHAR_EFFECTS);
m_nBackgroundId = AddTabPage("background", RID_SVXPAGE_BACKGROUND); AddTabPage("background", RID_SVXPAGE_BACKGROUND);
AddTabPage("indents", RID_SVXPAGE_STD_PARAGRAPH); AddTabPage("indents", RID_SVXPAGE_STD_PARAGRAPH);
m_nTextId = AddTabPage("text", RID_SVXPAGE_TEXTATTR); AddTabPage("text", RID_SVXPAGE_TEXTATTR);
AddTabPage("animation", RID_SVXPAGE_TEXTANIMATION); AddTabPage("animation", RID_SVXPAGE_TEXTANIMATION);
m_nDimensionId = AddTabPage("dimensioning", RID_SVXPAGE_MEASURE); AddTabPage("dimensioning", RID_SVXPAGE_MEASURE);
m_nConnectorId = AddTabPage("connector", RID_SVXPAGE_CONNECTION); AddTabPage("connector", RID_SVXPAGE_CONNECTION);
AddTabPage("alignment", RID_SVXPAGE_ALIGN_PARAGRAPH); AddTabPage("alignment", RID_SVXPAGE_ALIGN_PARAGRAPH);
AddTabPage("tabs", RID_SVXPAGE_TABULATOR); AddTabPage("tabs", RID_SVXPAGE_TABULATOR);
SvtCJKOptions aCJKOptions; SvtCJKOptions aCJKOptions;
...@@ -97,10 +86,10 @@ SdTabTemplateDlg::SdTabTemplateDlg( vcl::Window* pParent, ...@@ -97,10 +86,10 @@ SdTabTemplateDlg::SdTabTemplateDlg( vcl::Window* pParent,
RemoveTabPage("asiantypo"); RemoveTabPage("asiantypo");
} }
void SdTabTemplateDlg::PageCreated( sal_uInt16 nId, SfxTabPage &rPage ) void SdTabTemplateDlg::PageCreated(const OString& rId, SfxTabPage &rPage)
{ {
SfxAllItemSet aSet(*(GetInputSetImpl()->GetPool())); SfxAllItemSet aSet(*(GetInputSetImpl()->GetPool()));
if (nId == m_nLineId) if (rId == "line")
{ {
aSet.Put (SvxColorListItem(pColorList,SID_COLOR_TABLE)); aSet.Put (SvxColorListItem(pColorList,SID_COLOR_TABLE));
aSet.Put (SvxDashListItem(pDashList,SID_DASH_LIST)); aSet.Put (SvxDashListItem(pDashList,SID_DASH_LIST));
...@@ -108,7 +97,7 @@ void SdTabTemplateDlg::PageCreated( sal_uInt16 nId, SfxTabPage &rPage ) ...@@ -108,7 +97,7 @@ void SdTabTemplateDlg::PageCreated( sal_uInt16 nId, SfxTabPage &rPage )
aSet.Put (SfxUInt16Item(SID_DLG_TYPE,1)); aSet.Put (SfxUInt16Item(SID_DLG_TYPE,1));
rPage.PageCreated(aSet); rPage.PageCreated(aSet);
} }
else if (nId == m_nAreaId) else if (rId == "area")
{ {
aSet.Put (SvxColorListItem(pColorList,SID_COLOR_TABLE)); aSet.Put (SvxColorListItem(pColorList,SID_COLOR_TABLE));
aSet.Put (SvxGradientListItem(pGradientList,SID_GRADIENT_LIST)); aSet.Put (SvxGradientListItem(pGradientList,SID_GRADIENT_LIST));
...@@ -120,20 +109,20 @@ void SdTabTemplateDlg::PageCreated( sal_uInt16 nId, SfxTabPage &rPage ) ...@@ -120,20 +109,20 @@ void SdTabTemplateDlg::PageCreated( sal_uInt16 nId, SfxTabPage &rPage )
aSet.Put (SvxPatternListItem(pPatternList,SID_PATTERN_LIST)); aSet.Put (SvxPatternListItem(pPatternList,SID_PATTERN_LIST));
rPage.PageCreated(aSet); rPage.PageCreated(aSet);
} }
else if (nId == m_nShadowId) else if (rId == "shadowing")
{ {
aSet.Put (SvxColorListItem(pColorList,SID_COLOR_TABLE)); aSet.Put (SvxColorListItem(pColorList,SID_COLOR_TABLE));
aSet.Put (SfxUInt16Item(SID_PAGE_TYPE,0)); aSet.Put (SfxUInt16Item(SID_PAGE_TYPE,0));
aSet.Put (SfxUInt16Item(SID_DLG_TYPE,1)); aSet.Put (SfxUInt16Item(SID_DLG_TYPE,1));
rPage.PageCreated(aSet); rPage.PageCreated(aSet);
} }
else if (nId == m_nTransparencyId) else if (rId == "transparency")
{ {
aSet.Put (SfxUInt16Item(SID_PAGE_TYPE,0)); aSet.Put (SfxUInt16Item(SID_PAGE_TYPE,0));
aSet.Put (SfxUInt16Item(SID_DLG_TYPE,1)); aSet.Put (SfxUInt16Item(SID_DLG_TYPE,1));
rPage.PageCreated(aSet); rPage.PageCreated(aSet);
} }
else if (nId == m_nFontId) else if (rId == "font")
{ {
SvxFontListItem aItem(*static_cast<const SvxFontListItem*>( SvxFontListItem aItem(*static_cast<const SvxFontListItem*>(
rDocShell.GetItem( SID_ATTR_CHAR_FONTLIST) ) ); rDocShell.GetItem( SID_ATTR_CHAR_FONTLIST) ) );
...@@ -141,25 +130,25 @@ void SdTabTemplateDlg::PageCreated( sal_uInt16 nId, SfxTabPage &rPage ) ...@@ -141,25 +130,25 @@ void SdTabTemplateDlg::PageCreated( sal_uInt16 nId, SfxTabPage &rPage )
aSet.Put (SvxFontListItem( aItem.GetFontList(), SID_ATTR_CHAR_FONTLIST)); aSet.Put (SvxFontListItem( aItem.GetFontList(), SID_ATTR_CHAR_FONTLIST));
rPage.PageCreated(aSet); rPage.PageCreated(aSet);
} }
else if (nId == m_nFontEffectId) else if (rId == "fonteffect")
{ {
rPage.PageCreated(aSet); rPage.PageCreated(aSet);
} }
else if (nId == m_nBackgroundId) else if (rId == "background")
{ {
aSet.Put(SfxUInt32Item(SID_FLAG_TYPE,static_cast<sal_uInt32>(SvxBackgroundTabFlags::SHOW_CHAR_BKGCOLOR))); aSet.Put(SfxUInt32Item(SID_FLAG_TYPE,static_cast<sal_uInt32>(SvxBackgroundTabFlags::SHOW_CHAR_BKGCOLOR)));
rPage.PageCreated(aSet); rPage.PageCreated(aSet);
} }
else if (nId == m_nTextId) else if (rId == "text")
{ {
rPage.PageCreated(aSet); rPage.PageCreated(aSet);
} }
else if (nId == m_nDimensionId) else if (rId == "dimensioning")
{ {
aSet.Put (OfaPtrItem(SID_OBJECT_LIST,pSdrView)); aSet.Put (OfaPtrItem(SID_OBJECT_LIST,pSdrView));
rPage.PageCreated(aSet); rPage.PageCreated(aSet);
} }
else if (nId == m_nConnectorId) else if (rId == "connector")
{ {
aSet.Put (OfaPtrItem(SID_OBJECT_LIST,pSdrView)); aSet.Put (OfaPtrItem(SID_OBJECT_LIST,pSdrView));
rPage.PageCreated(aSet); rPage.PageCreated(aSet);
......
...@@ -305,7 +305,7 @@ void FuTemplate::DoExecute( SfxRequest& rReq ) ...@@ -305,7 +305,7 @@ void FuTemplate::DoExecute( SfxRequest& rReq )
if (eFamily == SfxStyleFamily::Para) if (eFamily == SfxStyleFamily::Para)
{ {
pStdDlg.disposeAndReset(pFact ? pFact->CreateSdTabTemplateDlg(mpViewShell->GetActiveWindow(), mpDoc->GetDocSh(), *pStyleSheet, mpDoc, mpView) : nullptr); pStdDlg.disposeAndReset(pFact ? pFact->CreateSdTabTemplateDlg(mpViewShell->GetFrameWeld(), mpDoc->GetDocSh(), *pStyleSheet, mpDoc, mpView) : nullptr);
} }
else if (eFamily == SfxStyleFamily::Pseudo) else if (eFamily == SfxStyleFamily::Pseudo)
{ {
......
...@@ -30,7 +30,7 @@ class SdrView; ...@@ -30,7 +30,7 @@ class SdrView;
/** /**
* Template-Tab-Dialog * Template-Tab-Dialog
*/ */
class SdTabTemplateDlg : public SfxStyleDialog class SdTabTemplateDlg : public SfxStyleDialogController
{ {
private: private:
const SfxObjectShell& rDocShell; const SfxObjectShell& rDocShell;
...@@ -44,22 +44,11 @@ private: ...@@ -44,22 +44,11 @@ private:
XDashListRef const pDashList; XDashListRef const pDashList;
XLineEndListRef const pLineEndList; XLineEndListRef const pLineEndList;
sal_uInt16 m_nLineId; virtual void PageCreated(const OString& rId, SfxTabPage &rPage) override;
sal_uInt16 m_nAreaId;
sal_uInt16 m_nShadowId;
sal_uInt16 m_nTransparencyId;
sal_uInt16 m_nFontId;
sal_uInt16 m_nFontEffectId;
sal_uInt16 m_nBackgroundId;
sal_uInt16 m_nTextId;
sal_uInt16 m_nDimensionId;
sal_uInt16 m_nConnectorId;
virtual void PageCreated( sal_uInt16 nId, SfxTabPage &rPage ) override;
virtual void RefreshInputSet() override; virtual void RefreshInputSet() override;
public: public:
SdTabTemplateDlg(vcl::Window* pParent, SdTabTemplateDlg(weld::Window* pParent,
const SfxObjectShell* pDocShell, const SfxObjectShell* pDocShell,
SfxStyleSheetBase& rStyleBase, SfxStyleSheetBase& rStyleBase,
SdrModel const * pModel, SdrModel const * pModel,
......
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