diff options
Diffstat (limited to 'sw/source/ui/chrdlg/pardlg.cxx')
-rw-r--r-- | sw/source/ui/chrdlg/pardlg.cxx | 56 |
1 files changed, 24 insertions, 32 deletions
diff --git a/sw/source/ui/chrdlg/pardlg.cxx b/sw/source/ui/chrdlg/pardlg.cxx index 2f5b5329ed81..f3df6a32e9f2 100644 --- a/sw/source/ui/chrdlg/pardlg.cxx +++ b/sw/source/ui/chrdlg/pardlg.cxx @@ -43,55 +43,47 @@ #include <svx/dialogs.hrc> #include <svx/flagsdef.hxx> -SwParaDlg::SwParaDlg(vcl::Window *pParent, +SwParaDlg::SwParaDlg(weld::Window *pParent, SwView& rVw, const SfxItemSet& rCoreSet, sal_uInt8 nDialogMode, const OUString *pTitle, bool bDraw, const OString& sDefPage) - : SfxTabDialog(pParent, - "ParagraphPropertiesDialog", + : SfxTabDialogController(pParent, "modules/swriter/ui/paradialog.ui", + "ParagraphPropertiesDialog", &rCoreSet, nullptr != pTitle) , rView(rVw) , bDrawParaDlg(bDraw) - , m_nParaStd(0) - , m_nParaAlign(0) - , m_nParaExt(0) - , m_nParaNumPara(0) - , m_nParaDrpCps(0) - , m_nParaBorder(0) - , m_nAreaId(0) - , m_nTransparenceId(0) { nHtmlMode = ::GetHtmlMode(rVw.GetDocShell()); bool bHtmlMode = (nHtmlMode & HTMLMODE_ON) == HTMLMODE_ON; if(pTitle) { // Update title - SetText(GetText() + SwResId(STR_TEXTCOLL_HEADER) + *pTitle + ")"); + m_xDialog->set_title(m_xDialog->get_title() + SwResId(STR_TEXTCOLL_HEADER) + *pTitle + ")"); } // tabs common to paragraph and draw paragraphs (paragraphs inside a text box) SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); OSL_ENSURE(pFact->GetTabPageCreatorFunc(RID_SVXPAGE_STD_PARAGRAPH), "GetTabPageCreatorFunc fail!"); OSL_ENSURE(pFact->GetTabPageRangesFunc(RID_SVXPAGE_STD_PARAGRAPH), "GetTabPageRangesFunc fail!"); - m_nParaStd = AddTabPage("labelTP_PARA_STD", pFact->GetTabPageCreatorFunc(RID_SVXPAGE_STD_PARAGRAPH), - pFact->GetTabPageRangesFunc(RID_SVXPAGE_STD_PARAGRAPH) ); + AddTabPage("labelTP_PARA_STD", pFact->GetTabPageCreatorFunc(RID_SVXPAGE_STD_PARAGRAPH), + pFact->GetTabPageRangesFunc(RID_SVXPAGE_STD_PARAGRAPH) ); OSL_ENSURE(pFact->GetTabPageCreatorFunc(RID_SVXPAGE_ALIGN_PARAGRAPH), "GetTabPageCreatorFunc fail!"); OSL_ENSURE(pFact->GetTabPageRangesFunc(RID_SVXPAGE_ALIGN_PARAGRAPH), "GetTabPageRangesFunc fail!"); - m_nParaAlign = AddTabPage( "labelTP_PARA_ALIGN", pFact->GetTabPageCreatorFunc(RID_SVXPAGE_ALIGN_PARAGRAPH), - pFact->GetTabPageRangesFunc(RID_SVXPAGE_ALIGN_PARAGRAPH) ); + AddTabPage("labelTP_PARA_ALIGN", pFact->GetTabPageCreatorFunc(RID_SVXPAGE_ALIGN_PARAGRAPH), + pFact->GetTabPageRangesFunc(RID_SVXPAGE_ALIGN_PARAGRAPH)); SvxHtmlOptions& rHtmlOpt = SvxHtmlOptions::Get(); if (!bDrawParaDlg && (!bHtmlMode || rHtmlOpt.IsPrintLayoutExtension())) { OSL_ENSURE(pFact->GetTabPageCreatorFunc(RID_SVXPAGE_EXT_PARAGRAPH), "GetTabPageCreatorFunc fail!"); OSL_ENSURE(pFact->GetTabPageRangesFunc(RID_SVXPAGE_EXT_PARAGRAPH), "GetTabPageRangesFunc fail!"); - m_nParaExt = AddTabPage( "textflow", pFact->GetTabPageCreatorFunc(RID_SVXPAGE_EXT_PARAGRAPH), - pFact->GetTabPageRangesFunc(RID_SVXPAGE_EXT_PARAGRAPH) ); + AddTabPage("textflow", pFact->GetTabPageCreatorFunc(RID_SVXPAGE_EXT_PARAGRAPH), + pFact->GetTabPageRangesFunc(RID_SVXPAGE_EXT_PARAGRAPH)); } else @@ -132,17 +124,17 @@ SwParaDlg::SwParaDlg(vcl::Window *pParent, else { if(!(nDialogMode & DLG_ENVELOP)) - m_nParaNumPara = AddTabPage("labelTP_NUMPARA", SwParagraphNumTabPage::Create, SwParagraphNumTabPage::GetRanges); + AddTabPage("labelTP_NUMPARA", SwParagraphNumTabPage::Create, SwParagraphNumTabPage::GetRanges); else RemoveTabPage("labelTP_NUMPARA"); - m_nParaDrpCps = AddTabPage("labelTP_DROPCAPS", SwDropCapsPage::Create, SwDropCapsPage::GetRanges); + AddTabPage("labelTP_DROPCAPS", SwDropCapsPage::Create, SwDropCapsPage::GetRanges); if(!bHtmlMode || (nHtmlMode & (HTMLMODE_SOME_STYLES|HTMLMODE_FULL_STYLES))) { // add Area and Transparence TabPages - m_nAreaId = AddTabPage("area", pFact->GetTabPageCreatorFunc( RID_SVXPAGE_AREA ), pFact->GetTabPageRangesFunc( RID_SVXPAGE_AREA )); - m_nTransparenceId = AddTabPage("transparence", pFact->GetTabPageCreatorFunc( RID_SVXPAGE_TRANSPARENCE ), pFact->GetTabPageRangesFunc( RID_SVXPAGE_TRANSPARENCE ) ); + AddTabPage("area", pFact->GetTabPageCreatorFunc( RID_SVXPAGE_AREA ), pFact->GetTabPageRangesFunc( RID_SVXPAGE_AREA )); + AddTabPage("transparence", pFact->GetTabPageCreatorFunc( RID_SVXPAGE_TRANSPARENCE ), pFact->GetTabPageRangesFunc( RID_SVXPAGE_TRANSPARENCE ) ); } else { @@ -152,7 +144,7 @@ SwParaDlg::SwParaDlg(vcl::Window *pParent, OSL_ENSURE(pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BORDER ), "GetTabPageCreatorFunc fail!"); OSL_ENSURE(pFact->GetTabPageRangesFunc( RID_SVXPAGE_BORDER ), "GetTabPageRangesFunc fail!"); - m_nParaBorder = AddTabPage("labelTP_BORDER", pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BORDER ), pFact->GetTabPageRangesFunc( RID_SVXPAGE_BORDER ) ); + AddTabPage("labelTP_BORDER", pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BORDER ), pFact->GetTabPageRangesFunc( RID_SVXPAGE_BORDER ) ); } if (!sDefPage.isEmpty()) @@ -163,18 +155,18 @@ SwParaDlg::~SwParaDlg() { } -void SwParaDlg::PageCreated(sal_uInt16 nId, SfxTabPage& rPage) +void SwParaDlg::PageCreated(const OString& rId, SfxTabPage& rPage) { SwWrtShell& rSh = rView.GetWrtShell(); SfxAllItemSet aSet(*(GetInputSetImpl()->GetPool())); // Table borders cannot get any shade in Writer - if (nId == m_nParaBorder) + if (rId == "labelTP_BORDER") { aSet.Put (SfxUInt16Item(SID_SWMODE_TYPE,static_cast<sal_uInt16>(SwBorderModes::PARA))); rPage.PageCreated(aSet); } - else if( nId == m_nParaStd ) + else if (rId == "labelTP_PARA_STD") { aSet.Put(SfxUInt16Item(SID_SVXSTDPARAGRAPHTABPAGE_PAGEWIDTH, static_cast< sal_uInt16 >(rSh.GetAnyCurRect(CurRectType::PagePrt).Width()) )); @@ -188,7 +180,7 @@ void SwParaDlg::PageCreated(sal_uInt16 nId, SfxTabPage& rPage) } rPage.PageCreated(aSet); } - else if( m_nParaAlign == nId) + else if (rId == "labelTP_PARA_ALIGN") { if (!bDrawParaDlg) { @@ -196,7 +188,7 @@ void SwParaDlg::PageCreated(sal_uInt16 nId, SfxTabPage& rPage) rPage.PageCreated(aSet); } } - else if( m_nParaExt == nId ) + else if (rId == "textflow") { // pagebreak only when the cursor is in the body-area and not in a table const FrameTypeFlags eType = rSh.GetFrameType(nullptr,true); @@ -207,11 +199,11 @@ void SwParaDlg::PageCreated(sal_uInt16 nId, SfxTabPage& rPage) rPage.PageCreated(aSet); } } - else if( m_nParaDrpCps == nId ) + else if (rId == "labelTP_DROPCAPS") { static_cast<SwDropCapsPage&>(rPage).SetFormat(false); } - else if( m_nParaNumPara == nId) + else if (rId == "labelTP_NUMPARA") { SwTextFormatColl* pTmpColl = rSh.GetCurTextFormatColl(); if( pTmpColl && pTmpColl->IsAssignedToListLevelOfOutlineStyle() ) @@ -239,7 +231,7 @@ void SwParaDlg::PageCreated(sal_uInt16 nId, SfxTabPage& rPage) // these pages find the needed attributes for fill style suggestions. // These are added in SwDocStyleSheet::GetItemSet() for the SfxStyleFamily::Para on // demand, but could also be directly added from the DrawModel. - else if (m_nAreaId == nId) + else if (rId == "area") { SfxItemSet aNew(*aSet.GetPool(), svl::Items<SID_COLOR_TABLE, SID_PATTERN_LIST, @@ -252,7 +244,7 @@ void SwParaDlg::PageCreated(sal_uInt16 nId, SfxTabPage& rPage) rPage.PageCreated(aNew); } - else if (m_nTransparenceId == nId) + else if (rId == "transparence") { rPage.PageCreated(*GetInputSetImpl()); } |