diff options
author | Caolán McNamara <caolanm@redhat.com> | 2018-08-30 09:43:59 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2018-09-07 14:42:31 +0200 |
commit | a2304f62e963b413b7575bedfb8d34e5f2d3ea58 (patch) | |
tree | e92b8fce9d381deb02a9823ca24cd20a272c08d0 /sw | |
parent | 1a86f5643f3c36ead2f9aee42571664c2454ccf7 (diff) |
weld writer page style dialog and SvxBorderBackgroundDlg
writer, format page is complete
Change-Id: I09f6e4354461c4374cdb0d0e0754dfee35415b45
Reviewed-on: https://gerrit.libreoffice.org/60058
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sw')
23 files changed, 383 insertions, 117 deletions
diff --git a/sw/inc/view.hxx b/sw/inc/view.hxx index c2543d6e463b..2bddda1a67cd 100644 --- a/sw/inc/view.hxx +++ b/sw/inc/view.hxx @@ -631,7 +631,7 @@ public: // methods for printing SAL_DLLPRIVATE virtual SfxPrinter* GetPrinter( bool bCreate = false ) override; SAL_DLLPRIVATE virtual bool HasPrintOptionsPage() const override; - SAL_DLLPRIVATE virtual VclPtr<SfxTabPage> CreatePrintOptionsPage(weld::Container* pParent, + SAL_DLLPRIVATE virtual VclPtr<SfxTabPage> CreatePrintOptionsPage(TabPageParent pParent, const SfxItemSet& rSet) override; static SvxSearchItem* GetSearchItem() { return m_pSrchItem; } /// See SfxViewShell::getPart(). @@ -660,9 +660,9 @@ inline const SwDocShell *SwView::GetDocShell() const return const_cast<SwView*>(this)->GetDocShell(); } -VclPtr<SfxTabPage> CreatePrintOptionsPage( weld::Container* pPage, - const SfxItemSet &rOptions, - bool bPreview); +VclPtr<SfxTabPage> CreatePrintOptionsPage(TabPageParent pParent, + const SfxItemSet &rOptions, + bool bPreview); extern bool bDocSzUpdated; diff --git a/sw/source/ui/chrdlg/drpcps.cxx b/sw/source/ui/chrdlg/drpcps.cxx index fafe26d3ca07..be094bddc51f 100644 --- a/sw/source/ui/chrdlg/drpcps.cxx +++ b/sw/source/ui/chrdlg/drpcps.cxx @@ -66,9 +66,9 @@ void SwDropCapsPict::SetText( const OUString& rT ) void SwDropCapsPict::SetDrawingArea(weld::DrawingArea* pDrawingArea) { + CustomWidgetController::SetDrawingArea(pDrawingArea); Size aPrefSize(getParagraphPreviewOptimalSize(pDrawingArea->get_ref_device())); pDrawingArea->set_size_request(aPrefSize.Width(), aPrefSize.Height()); - CustomWidgetController::SetDrawingArea(pDrawingArea); } void SwDropCapsPict::Resize() diff --git a/sw/source/ui/dialog/swdlgfact.cxx b/sw/source/ui/dialog/swdlgfact.cxx index 413f886a78b4..971fd2a057bb 100644 --- a/sw/source/ui/dialog/swdlgfact.cxx +++ b/sw/source/ui/dialog/swdlgfact.cxx @@ -240,6 +240,11 @@ void AbstractTabController_Impl::SetInputSet( const SfxItemSet* pInSet ) m_xDlg->SetInputSet( pInSet ); } +bool AbstractTabController_Impl::StartExecuteAsync(AsyncContext &rCtx) +{ + return SfxTabDialogController::runAsync(m_xDlg, rCtx.maEndDialogFn); +} + //From class Window. void AbstractTabController_Impl::SetText( const OUString& rStr ) { @@ -258,6 +263,18 @@ void AbstractApplyTabDialog_Impl::SetApplyHdl( const Link<LinkParamNone*,void>& pDlg->SetApplyHandler(LINK(this, AbstractApplyTabDialog_Impl, ApplyHdl)); } +IMPL_LINK_NOARG(AbstractApplyTabController_Impl, ApplyHdl, weld::Button&, void) +{ + if (m_xDlg->Apply()) + m_aHandler.Call(nullptr); +} + +void AbstractApplyTabController_Impl::SetApplyHdl( const Link<LinkParamNone*,void>& rLink ) +{ + m_aHandler = rLink; + m_xDlg->SetApplyHandler(LINK(this, AbstractApplyTabController_Impl, ApplyHdl)); +} + sal_uInt8 AbstractSwInsertAbstractDlg_Impl::GetLevel() const { return pDlg->GetLevel(); @@ -930,6 +947,10 @@ VclPtr<SfxAbstractApplyTabDialog> SwAbstractDialogFactory_Impl::CreateTemplateDi SwWrtShell* pActShell, bool bNew ) { + if (nRegion == SfxStyleFamily::Page) + { + return VclPtr<AbstractApplyTabController_Impl>::Create(o3tl::make_unique<SwTemplateDlgController>(pParent ? pParent->GetFrameWeld() : nullptr, rBase, nRegion, sPage, pActShell, bNew)); + } VclPtr<SfxTabDialog> pDlg = VclPtr<SwTemplateDlg>::Create(pParent, rBase, nRegion, sPage, pActShell, bNew); return VclPtr<AbstractApplyTabDialog_Impl>::Create(pDlg); } diff --git a/sw/source/ui/dialog/swdlgfact.hxx b/sw/source/ui/dialog/swdlgfact.hxx index c7315197ecb5..ef655833b3fc 100644 --- a/sw/source/ui/dialog/swdlgfact.hxx +++ b/sw/source/ui/dialog/swdlgfact.hxx @@ -227,13 +227,14 @@ class AbstractTabDialog_Impl : virtual public SfxAbstractTabDialog class AbstractTabController_Impl : virtual public SfxAbstractTabDialog { protected: - std::unique_ptr<SfxTabDialogController> m_xDlg; + std::shared_ptr<SfxTabDialogController> m_xDlg; public: explicit AbstractTabController_Impl(std::unique_ptr<SfxTabDialogController> p) : m_xDlg(std::move(p)) { } virtual short Execute() override; + virtual bool StartExecuteAsync(AsyncContext &rCtx) override; virtual void SetCurPageId( const OString &rName ) override; virtual const SfxItemSet* GetOutputItemSet() const override; virtual const sal_uInt16* GetInputRanges( const SfxItemPool& pItem ) override; @@ -255,6 +256,19 @@ private: virtual void SetApplyHdl( const Link<LinkParamNone*,void>& rLink ) override; }; +class AbstractApplyTabController_Impl : public AbstractTabController_Impl, virtual public SfxAbstractApplyTabDialog +{ +public: + explicit AbstractApplyTabController_Impl(std::unique_ptr<SfxTabDialogController> p) + : AbstractTabController_Impl(std::move(p)) + { + } + DECL_LINK(ApplyHdl, weld::Button&, void); +private: + Link<LinkParamNone*,void> m_aHandler; + virtual void SetApplyHdl( const Link<LinkParamNone*,void>& rLink ) override; +}; + class AbstractSwConvertTableDlg_Impl : public AbstractSwConvertTableDlg { protected: diff --git a/sw/source/ui/envelp/envlop1.cxx b/sw/source/ui/envelp/envlop1.cxx index 730351caeca3..16118d2ab258 100644 --- a/sw/source/ui/envelp/envlop1.cxx +++ b/sw/source/ui/envelp/envlop1.cxx @@ -51,9 +51,9 @@ SwEnvPreview::SwEnvPreview() void SwEnvPreview::SetDrawingArea(weld::DrawingArea* pDrawingArea) { + CustomWidgetController::SetDrawingArea(pDrawingArea); pDrawingArea->set_size_request(pDrawingArea->get_approximate_digit_width() * 20, pDrawingArea->get_text_height() * 8); - CustomWidgetController::SetDrawingArea(pDrawingArea); } void SwEnvPreview::Paint(vcl::RenderContext& rRenderContext, const tools::Rectangle&) diff --git a/sw/source/ui/envelp/envprt.cxx b/sw/source/ui/envelp/envprt.cxx index 9807e760e455..74860a832ff4 100644 --- a/sw/source/ui/envelp/envprt.cxx +++ b/sw/source/ui/envelp/envprt.cxx @@ -118,7 +118,7 @@ IMPL_LINK(SwEnvPrtPage, ButtonHdl, weld::Button&, rBtn, void) // Call printer setup if (m_xPrt) { - PrinterSetupDialog aDlg(GetDialogController()->getDialog()); + PrinterSetupDialog aDlg(GetDialogFrameWeld()); aDlg.SetPrinter(m_xPrt); aDlg.execute(); rBtn.grab_focus(); diff --git a/sw/source/ui/envelp/labfmt.cxx b/sw/source/ui/envelp/labfmt.cxx index eb7d9621b0c0..09f6792ccc0c 100644 --- a/sw/source/ui/envelp/labfmt.cxx +++ b/sw/source/ui/envelp/labfmt.cxx @@ -122,6 +122,8 @@ SwLabPreview::SwLabPreview() void SwLabPreview::SetDrawingArea(weld::DrawingArea* pWidget) { + CustomWidgetController::SetDrawingArea(pWidget); + pWidget->set_size_request(pWidget->get_approximate_digit_width() * 54, pWidget->get_text_height() * 15); @@ -133,8 +135,6 @@ void SwLabPreview::SetDrawingArea(weld::DrawingArea* pWidget) m_lColsWidth = pWidget->get_pixel_size(m_aColsStr).Width(); m_lXWidth = pWidget->get_pixel_size(OUString('X')).Width(); m_lXHeight = pWidget->get_text_height(); - - CustomWidgetController::SetDrawingArea(pWidget); } void SwLabPreview::Paint(vcl::RenderContext& rRenderContext, const tools::Rectangle&) diff --git a/sw/source/ui/fmtui/tmpdlg.cxx b/sw/source/ui/fmtui/tmpdlg.cxx index 9cdba0b23534..9e7f661872f1 100644 --- a/sw/source/ui/fmtui/tmpdlg.cxx +++ b/sw/source/ui/fmtui/tmpdlg.cxx @@ -107,7 +107,7 @@ SwTemplateDlg::SwTemplateDlg(vcl::Window* pParent, { nHtmlMode = ::GetHtmlMode(pWrtShell->GetView().GetDocShell()); SfxAbstractDialogFactory* pFact = SfxAbstractDialogFactory::Create(); - // tinker TabPages together + // stitch TabPages together switch( nRegion ) { // character styles @@ -253,11 +253,6 @@ SwTemplateDlg::SwTemplateDlg(vcl::Window* pParent, // page styles case SfxStyleFamily::Page: { - // remove? - //OSL_ENSURE(pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BACKGROUND ), "GetTabPageCreatorFunc fail!"); - //OSL_ENSURE(pFact->GetTabPageRangesFunc( RID_SVXPAGE_BACKGROUND ), "GetTabPageRangesFunc fail!"); - //m_nBackgroundId = AddTabPage("background", pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BACKGROUND ), pFact->GetTabPageRangesFunc( RID_SVXPAGE_BACKGROUND ) ); - // 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 ) ); @@ -595,4 +590,200 @@ void SwTemplateDlg::PageCreated( sal_uInt16 nId, SfxTabPage &rPage ) } } +// the dialog's carrier +SwTemplateDlgController::SwTemplateDlgController(weld::Window* pParent, + SfxStyleSheetBase& rBase, + SfxStyleFamily nRegion, + const OString& sPage, + SwWrtShell* pActShell, + bool /*bNew*/) + : SfxStyleDialogController(pParent, + "modules/swriter/ui/templatedialog" + + OUString::number(static_cast<sal_uInt16>(nRegion)) + ".ui", + "TemplateDialog" + OString::number(static_cast<sal_uInt16>(nRegion)), + rBase) + , nType(nRegion) + , pWrtShell(pActShell) +{ + nHtmlMode = ::GetHtmlMode(pWrtShell->GetView().GetDocShell()); + SfxAbstractDialogFactory* pFact = SfxAbstractDialogFactory::Create(); + // stitch TabPages together + switch( nRegion ) + { + // page styles + case SfxStyleFamily::Page: + { + // add Area and Transparence TabPages + AddTabPage("area", pFact->GetTabPageCreatorFunc( RID_SVXPAGE_AREA ), pFact->GetTabPageRangesFunc( RID_SVXPAGE_AREA )); + AddTabPage("transparence", pFact->GetTabPageCreatorFunc( RID_SVXPAGE_TRANSPARENCE ), pFact->GetTabPageRangesFunc( RID_SVXPAGE_TRANSPARENCE ) ); + AddTabPage("header", SvxHeaderPage::Create, SvxHeaderPage::GetRanges); + AddTabPage("footer", SvxFooterPage::Create, SvxFooterPage::GetRanges); + AddTabPage("page", pFact->GetTabPageCreatorFunc(RID_SVXPAGE_PAGE), pFact->GetTabPageRangesFunc(RID_SVXPAGE_PAGE)); + if (0 == ::GetHtmlMode(pWrtShell->GetView().GetDocShell())) + { + AddTabPage("borders", pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BORDER ), pFact->GetTabPageRangesFunc( RID_SVXPAGE_BORDER ) ); + AddTabPage("columns", SwColumnPage::Create, SwColumnPage::GetRanges ); + AddTabPage("footnotes", SwFootNotePage::Create, SwFootNotePage::GetRanges ); + AddTabPage("textgrid", SwTextGridPage::Create, SwTextGridPage::GetRanges ); + SvtCJKOptions aCJKOptions; + if(!aCJKOptions.IsAsianTypographyEnabled()) + RemoveTabPage("textgrid"); + } + else + { + RemoveTabPage("borders"); + RemoveTabPage("columns"); + RemoveTabPage("footnotes"); + RemoveTabPage("textgrid"); + } + } + break; + default: + OSL_ENSURE(false, "wrong family"); + } + + if (!sPage.isEmpty()) + SetCurPageId(sPage); +} + +short SwTemplateDlgController::Ok() +{ + short nRet = SfxTabDialogController::Ok(); + if( RET_OK == nRet ) + { + const SfxPoolItem *pOutItem, *pExItem; + if( SfxItemState::SET == m_xExampleSet->GetItemState( + SID_ATTR_NUMBERING_RULE, false, &pExItem ) && + ( !GetOutputItemSet() || + SfxItemState::SET != GetOutputItemSet()->GetItemState( + SID_ATTR_NUMBERING_RULE, false, &pOutItem ) || + *pExItem != *pOutItem )) + { + if( GetOutputItemSet() ) + const_cast<SfxItemSet*>(GetOutputItemSet())->Put( *pExItem ); + else + nRet = RET_CANCEL; + } + } + else + { + //JP 09.01.98 Bug #46446#: + // that's the Ok-Handler, so OK has to be default! + nRet = RET_OK; + } + return nRet; +} + +void SwTemplateDlgController::RefreshInputSet() +{ + SfxItemSet* pInSet = GetInputSetImpl(); + pInSet->ClearItem(); + pInSet->SetParent( &GetStyleSheet().GetItemSet() ); +} + +void SwTemplateDlgController::PageCreated(const OString& rId, SfxTabPage &rPage ) +{ + // set style's and metric's names + OUString sNumCharFormat, sBulletCharFormat; + SwStyleNameMapper::FillUIName( RES_POOLCHR_NUM_LEVEL, sNumCharFormat); + SwStyleNameMapper::FillUIName( RES_POOLCHR_BUL_LEVEL, sBulletCharFormat); + SfxAllItemSet aSet(*(GetInputSetImpl()->GetPool())); + + if (rId == "columns") + { + if( nType == SfxStyleFamily::Frame ) + static_cast<SwColumnPage&>(rPage).SetFrameMode(true); + static_cast<SwColumnPage&>(rPage).SetFormatUsed( true ); + } + // do not remove; many other style dialog combinations still use the SfxTabPage + // for the SvxBrushItem (see RID_SVXPAGE_BACKGROUND) + else if (rId == "background") + { + SvxBackgroundTabFlags nFlagType = SvxBackgroundTabFlags::NONE; + if( SfxStyleFamily::Char == nType || SfxStyleFamily::Para == nType ) + nFlagType |= SvxBackgroundTabFlags::SHOW_HIGHLIGHTING; + aSet.Put (SfxUInt32Item(SID_FLAG_TYPE, static_cast<sal_uInt32>(nFlagType))); + rPage.PageCreated(aSet); + } + else if (rId == "page") + { + if(0 == (nHtmlMode & HTMLMODE_ON )) + { + std::vector<OUString> aList; + OUString aNew; + SwStyleNameMapper::FillUIName( RES_POOLCOLL_TEXT, aNew ); + aList.push_back( aNew ); + if( pWrtShell ) + { + SfxStyleSheetBasePool* pStyleSheetPool = pWrtShell-> + GetView().GetDocShell()->GetStyleSheetPool(); + pStyleSheetPool->SetSearchMask(SfxStyleFamily::Para); + SfxStyleSheetBase *pFirstStyle = pStyleSheetPool->First(); + while(pFirstStyle) + { + aList.push_back( pFirstStyle->GetName() ); + pFirstStyle = pStyleSheetPool->Next(); + } + } + // set DrawingLayer FillStyles active + aSet.Put(SfxBoolItem(SID_DRAWINGLAYER_FILLSTYLES, true)); + aSet.Put(SfxStringListItem(SID_COLLECT_LIST, &aList)); + rPage.PageCreated(aSet); + } + } + else if (rId == "header") + { + if(0 == (nHtmlMode & HTMLMODE_ON )) + { + static_cast<SvxHeaderPage&>(rPage).EnableDynamicSpacing(); + } + + // set DrawingLayer FillStyles active + aSet.Put(SfxBoolItem(SID_DRAWINGLAYER_FILLSTYLES, true)); + rPage.PageCreated(aSet); + } + else if (rId == "footer") + { + if(0 == (nHtmlMode & HTMLMODE_ON )) + { + static_cast<SvxFooterPage&>(rPage).EnableDynamicSpacing(); + } + + // set DrawingLayer FillStyles active + aSet.Put(SfxBoolItem(SID_DRAWINGLAYER_FILLSTYLES, true)); + rPage.PageCreated(aSet); + } + else if (rId == "border") + { + if( SfxStyleFamily::Para == nType ) + { + aSet.Put (SfxUInt16Item(SID_SWMODE_TYPE,static_cast<sal_uInt16>(SwBorderModes::PARA))); + } + else if( SfxStyleFamily::Frame == nType ) + { + aSet.Put (SfxUInt16Item(SID_SWMODE_TYPE,static_cast<sal_uInt16>(SwBorderModes::FRAME))); + } + rPage.PageCreated(aSet); + } + // inits for Area and Transparency TabPages + // The selection attribute lists (XPropertyList derivates, e.g. XColorList for + // the color table) need to be added as items (e.g. SvxColorTableItem) to make + // 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 (rId == "area") + { + aSet.Put(GetStyleSheet().GetItemSet()); + + // add flag for direct graphic content selection + aSet.Put(SfxBoolItem(SID_OFFER_IMPORT, true)); + + rPage.PageCreated(aSet); + } + else if (rId == "transparence") + { + rPage.PageCreated(GetStyleSheet().GetItemSet()); + } +} + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/frmdlg/column.cxx b/sw/source/ui/frmdlg/column.cxx index 205510a2d8d0..5ad0abb3ae6c 100644 --- a/sw/source/ui/frmdlg/column.cxx +++ b/sw/source/ui/frmdlg/column.cxx @@ -164,7 +164,7 @@ SwColumnDlg::SwColumnDlg(weld::Window* pParent, SwWrtShell& rSh) assert(pColPgSet); // create TabPage - m_pTabPage = static_cast<SwColumnPage*>(SwColumnPage::Create(m_xContentArea.get(), pColPgSet).get()); + m_pTabPage = static_cast<SwColumnPage*>(SwColumnPage::Create(TabPageParent(m_xContentArea.get(), this), pColPgSet).get()); m_pTabPage->GetApplyLabel()->show(); weld::ComboBoxText* pApplyToLB = m_pTabPage->GetApplyComboBox(); pApplyToLB->show(); diff --git a/sw/source/ui/misc/pggrid.cxx b/sw/source/ui/misc/pggrid.cxx index d12fc4de6ffb..98dd7a271e87 100644 --- a/sw/source/ui/misc/pggrid.cxx +++ b/sw/source/ui/misc/pggrid.cxx @@ -70,7 +70,7 @@ SwTextGridPage::SwTextGridPage(TabPageParent pParent, const SfxItemSet &rSet) , m_xDisplayFL(m_xBuilder->weld_widget("frameFL_DISPLAY")) , m_xDisplayCB(m_xBuilder->weld_check_button("checkCB_DISPLAY")) , m_xPrintCB(m_xBuilder->weld_check_button("checkCB_PRINT")) - , m_xColorLB(new ColorListBox(m_xBuilder->weld_menu_button("listLB_COLOR"), GetFrameWeld(), true)) + , m_xColorLB(new ColorListBox(m_xBuilder->weld_menu_button("listLB_COLOR"), GetFrameWeld())) { Link<weld::SpinButton&,void> aLink = LINK(this, SwTextGridPage, CharorLineChangedHdl); m_xCharsPerLineNF->connect_value_changed(aLink); @@ -487,7 +487,7 @@ void SwTextGridPage::GridModifyHdl() { const SfxItemSet& rOldSet = GetItemSet(); SfxItemSet aSet(rOldSet); - const SfxItemSet* pExSet = GetTabDialog()->GetExampleSet(); + const SfxItemSet* pExSet = GetDialogController()->GetExampleSet(); if(pExSet) aSet.Put(*pExSet); PutGridItem(aSet); diff --git a/sw/source/uibase/docvw/HeaderFooterWin.cxx b/sw/source/uibase/docvw/HeaderFooterWin.cxx index e1c157ee3afe..84927a6a8d13 100644 --- a/sw/source/uibase/docvw/HeaderFooterWin.cxx +++ b/sw/source/uibase/docvw/HeaderFooterWin.cxx @@ -438,7 +438,7 @@ void SwHeaderFooterWin::ExecuteCommand(const OString& rIdent) aBoxInfo.SetValid( SvxBoxInfoItemValidFlags::DISABLE ); aSet.Put( aBoxInfo ); - if ( svx::ShowBorderBackgroundDlg( this, &aSet ) ) + if (svx::ShowBorderBackgroundDlg(GetFrameWeld(), &aSet)) { const SfxPoolItem* pItem; if ( SfxItemState::SET == aSet.GetItemState( RES_BACKGROUND, false, &pItem ) ) { diff --git a/sw/source/uibase/frmdlg/colex.cxx b/sw/source/uibase/frmdlg/colex.cxx index 4b10642a0ed5..5a31e58e4ad1 100644 --- a/sw/source/uibase/frmdlg/colex.cxx +++ b/sw/source/uibase/frmdlg/colex.cxx @@ -479,10 +479,10 @@ void SwColumnOnlyExample::SetColumns(const SwFormatCol& rCol) void SwColumnOnlyExample::SetDrawingArea(weld::DrawingArea* pDrawingArea) { + weld::CustomWidgetController::SetDrawingArea(pDrawingArea); OutputDevice& rRefDevice = pDrawingArea->get_ref_device(); Size aPrefSize(rRefDevice.LogicToPixel(Size(75, 46), MapMode(MapUnit::MapAppFont))); pDrawingArea->set_size_request(aPrefSize.Width(), aPrefSize.Height()); - weld::CustomWidgetController::SetDrawingArea(pDrawingArea); } void SwColumnOnlyExample::Resize() diff --git a/sw/source/uibase/inc/pview.hxx b/sw/source/uibase/inc/pview.hxx index 059aecd1c060..5d046f60933e 100644 --- a/sw/source/uibase/inc/pview.hxx +++ b/sw/source/uibase/inc/pview.hxx @@ -201,7 +201,7 @@ class SW_DLLPUBLIC SwPagePreview: public SfxViewShell SAL_DLLPRIVATE virtual SfxPrinter* GetPrinter( bool bCreate = false ) override; SAL_DLLPRIVATE virtual sal_uInt16 SetPrinter( SfxPrinter *pNewPrinter, SfxPrinterChangeFlags nDiffFlags = SFX_PRINTER_ALL ) override; SAL_DLLPRIVATE virtual bool HasPrintOptionsPage() const override; - SAL_DLLPRIVATE virtual VclPtr<SfxTabPage> CreatePrintOptionsPage(weld::Container* pParent, const SfxItemSet &rOptions) override; + SAL_DLLPRIVATE virtual VclPtr<SfxTabPage> CreatePrintOptionsPage(TabPageParent pParent, const SfxItemSet &rOptions) override; SAL_DLLPRIVATE void CalcAndSetBorderPixel( SvBorder &rToFill ); diff --git a/sw/source/uibase/inc/tmpdlg.hxx b/sw/source/uibase/inc/tmpdlg.hxx index 803e1820a007..b9a2c7253782 100644 --- a/sw/source/uibase/inc/tmpdlg.hxx +++ b/sw/source/uibase/inc/tmpdlg.hxx @@ -74,6 +74,30 @@ public: virtual short Ok() override; }; +// the tab dialog carrier of TabPages +class SwTemplateDlgController : public SfxStyleDialogController +{ + + SfxStyleFamily nType; + sal_uInt16 nHtmlMode; + SwWrtShell* pWrtShell; + +public: + /// @param sPage + /// Identifies name of page to open at by default + SwTemplateDlgController(weld::Window* pParent, + SfxStyleSheetBase& rBase, + SfxStyleFamily nRegion, + const OString& sPage, + SwWrtShell* pActShell, + bool bNew); + + virtual void RefreshInputSet() override; + + virtual void PageCreated(const OString& rId, SfxTabPage &rPage) override; + virtual short Ok() override; +}; + #endif /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/uibase/uiview/pview.cxx b/sw/source/uibase/uiview/pview.cxx index 3f4e568aa60c..f9da9a579afb 100644 --- a/sw/source/uibase/uiview/pview.cxx +++ b/sw/source/uibase/uiview/pview.cxx @@ -1702,10 +1702,10 @@ bool SwPagePreview::HasPrintOptionsPage() const return true; } -VclPtr<SfxTabPage> SwPagePreview::CreatePrintOptionsPage( weld::Container* pPage, - const SfxItemSet &rOptions ) +VclPtr<SfxTabPage> SwPagePreview::CreatePrintOptionsPage(TabPageParent pParent, + const SfxItemSet &rOptions) { - return ::CreatePrintOptionsPage(pPage, rOptions, !m_bNormalPrint); + return ::CreatePrintOptionsPage(pParent, rOptions, !m_bNormalPrint); } void SwPagePreviewWin::SetViewShell( SwViewShell* pShell ) diff --git a/sw/source/uibase/uiview/viewprt.cxx b/sw/source/uibase/uiview/viewprt.cxx index f3138353331c..f824291a7518 100644 --- a/sw/source/uibase/uiview/viewprt.cxx +++ b/sw/source/uibase/uiview/viewprt.cxx @@ -170,10 +170,10 @@ namespace // TabPage for application-specific print options -VclPtr<SfxTabPage> SwView::CreatePrintOptionsPage(weld::Container* pPage, +VclPtr<SfxTabPage> SwView::CreatePrintOptionsPage(TabPageParent pParent, const SfxItemSet& rSet) { - return ::CreatePrintOptionsPage(pPage, rSet, false); + return ::CreatePrintOptionsPage(pParent, rSet, false); } // Print dispatcher @@ -303,9 +303,9 @@ void SwView::NotifyCursor(SfxViewShell* pViewShell) const // Create page printer/additions for SwView and SwPagePreview -VclPtr<SfxTabPage> CreatePrintOptionsPage( weld::Container* pPage, - const SfxItemSet &rOptions, - bool bPreview ) +VclPtr<SfxTabPage> CreatePrintOptionsPage(TabPageParent pParent, + const SfxItemSet &rOptions, + bool bPreview) { SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); @@ -314,7 +314,7 @@ VclPtr<SfxTabPage> CreatePrintOptionsPage( weld::Container* pPage, if (!fnCreatePage) return nullptr; - VclPtr<SfxTabPage> pSfxPage = fnCreatePage(pPage, &rOptions); + VclPtr<SfxTabPage> pSfxPage = fnCreatePage(pParent, &rOptions); OSL_ENSURE(pSfxPage, "No page"); if (!pSfxPage) return nullptr; diff --git a/sw/uiconfig/swriter/ui/columnpage.ui b/sw/uiconfig/swriter/ui/columnpage.ui index b44a54bdfc8a..f2ba8e98ca6f 100644 --- a/sw/uiconfig/swriter/ui/columnpage.ui +++ b/sw/uiconfig/swriter/ui/columnpage.ui @@ -66,6 +66,7 @@ <object class="GtkGrid" id="ColumnPage"> <property name="visible">True</property> <property name="can_focus">False</property> + <property name="valign">start</property> <property name="hexpand">True</property> <property name="border_width">6</property> <property name="row_spacing">12</property> @@ -555,7 +556,6 @@ <property name="visible">True</property> <property name="can_focus">False</property> <property name="hexpand">True</property> - <property name="vexpand">True</property> <property name="column_spacing">12</property> <child> <object class="GtkFrame" id="frame2"> diff --git a/sw/uiconfig/swriter/ui/templatedialog1.ui b/sw/uiconfig/swriter/ui/templatedialog1.ui index 652c3e1ccc2a..b00290b5bac6 100644 --- a/sw/uiconfig/swriter/ui/templatedialog1.ui +++ b/sw/uiconfig/swriter/ui/templatedialog1.ui @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> -<!-- Generated with glade 3.20.4 --> +<!-- Generated with glade 3.22.1 --> <interface domain="sw"> <requires lib="gtk+" version="3.18"/> <object class="GtkDialog" id="TemplateDialog1"> @@ -8,6 +8,9 @@ <property name="title" translatable="yes" context="templatedialog1|TemplateDialog1">Character Style</property> <property name="resizable">False</property> <property name="type_hint">dialog</property> + <child> + <placeholder/> + </child> <child internal-child="vbox"> <object class="GtkBox" id="dialog-vbox1"> <property name="can_focus">False</property> @@ -18,8 +21,8 @@ <property name="can_focus">False</property> <property name="layout_style">end</property> <child> - <object class="GtkButton" id="help"> - <property name="label">gtk-help</property> + <object class="GtkButton" id="reset"> + <property name="label">gtk-revert-to-saved</property> <property name="visible">True</property> <property name="can_focus">True</property> <property name="receives_default">True</property> @@ -29,14 +32,15 @@ <property name="expand">False</property> <property name="fill">True</property> <property name="position">0</property> - <property name="secondary">True</property> </packing> </child> <child> - <object class="GtkButton" id="reset"> - <property name="label">gtk-revert-to-saved</property> + <object class="GtkButton" id="apply"> + <property name="label">gtk-apply</property> <property name="visible">True</property> <property name="can_focus">True</property> + <property name="can_default">True</property> + <property name="has_default">True</property> <property name="receives_default">True</property> <property name="use_stock">True</property> </object> @@ -78,24 +82,22 @@ </packing> </child> <child> - <object class="GtkButton" id="apply"> - <property name="label">gtk-apply</property> + <object class="GtkButton" id="cancel"> + <property name="label">gtk-cancel</property> <property name="visible">True</property> <property name="can_focus">True</property> - <property name="can_default">True</property> - <property name="has_default">True</property> <property name="receives_default">True</property> <property name="use_stock">True</property> </object> <packing> <property name="expand">False</property> <property name="fill">True</property> - <property name="position">5</property> + <property name="position">4</property> </packing> </child> <child> - <object class="GtkButton" id="cancel"> - <property name="label">gtk-cancel</property> + <object class="GtkButton" id="help"> + <property name="label">gtk-help</property> <property name="visible">True</property> <property name="can_focus">True</property> <property name="receives_default">True</property> @@ -104,7 +106,8 @@ <packing> <property name="expand">False</property> <property name="fill">True</property> - <property name="position">6</property> + <property name="position">5</property> + <property name="secondary">True</property> </packing> </child> </object> @@ -456,15 +459,9 @@ </object> </child> <action-widgets> - <action-widget response="-11">help</action-widget> - <action-widget response="0">reset</action-widget> - <action-widget response="0">standard</action-widget> <action-widget response="-5">ok</action-widget> - <action-widget response="0">apply</action-widget> <action-widget response="-6">cancel</action-widget> + <action-widget response="-11">help</action-widget> </action-widgets> - <child> - <placeholder/> - </child> </object> </interface> diff --git a/sw/uiconfig/swriter/ui/templatedialog16.ui b/sw/uiconfig/swriter/ui/templatedialog16.ui index b6d68421f324..815970c71fe1 100644 --- a/sw/uiconfig/swriter/ui/templatedialog16.ui +++ b/sw/uiconfig/swriter/ui/templatedialog16.ui @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> -<!-- Generated with glade 3.20.4 --> +<!-- Generated with glade 3.22.1 --> <interface domain="sw"> <requires lib="gtk+" version="3.18"/> <object class="GtkDialog" id="TemplateDialog16"> @@ -8,6 +8,9 @@ <property name="title" translatable="yes" context="templatedialog16|TemplateDialog16">Numbering Style</property> <property name="resizable">False</property> <property name="type_hint">dialog</property> + <child> + <placeholder/> + </child> <child internal-child="vbox"> <object class="GtkBox" id="dialog-vbox1"> <property name="can_focus">False</property> @@ -48,8 +51,8 @@ </packing> </child> <child> - <object class="GtkButton" id="ok"> - <property name="label">gtk-ok</property> + <object class="GtkButton" id="apply"> + <property name="label">gtk-apply</property> <property name="visible">True</property> <property name="can_focus">True</property> <property name="can_default">True</property> @@ -64,8 +67,23 @@ </packing> </child> <child> - <object class="GtkButton" id="apply"> - <property name="label">gtk-apply</property> + <object class="GtkButton" id="standard"> + <property name="label">Standard</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="can_default">True</property> + <property name="has_default">True</property> + <property name="receives_default">True</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">3</property> + </packing> + </child> + <child> + <object class="GtkButton" id="ok"> + <property name="label">gtk-ok</property> <property name="visible">True</property> <property name="can_focus">True</property> <property name="can_default">True</property> @@ -443,13 +461,8 @@ </child> <action-widgets> <action-widget response="-11">help</action-widget> - <action-widget response="0">reset</action-widget> <action-widget response="-5">ok</action-widget> - <action-widget response="0">apply</action-widget> <action-widget response="-6">cancel</action-widget> </action-widgets> - <child> - <placeholder/> - </child> </object> </interface> diff --git a/sw/uiconfig/swriter/ui/templatedialog2.ui b/sw/uiconfig/swriter/ui/templatedialog2.ui index 500f092a2407..7b4527418ede 100644 --- a/sw/uiconfig/swriter/ui/templatedialog2.ui +++ b/sw/uiconfig/swriter/ui/templatedialog2.ui @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> -<!-- Generated with glade 3.20.4 --> +<!-- Generated with glade 3.22.1 --> <interface domain="sw"> <requires lib="gtk+" version="3.18"/> <object class="GtkDialog" id="TemplateDialog2"> @@ -8,6 +8,9 @@ <property name="title" translatable="yes" context="templatedialog2|TemplateDialog2">Paragraph Style</property> <property name="resizable">False</property> <property name="type_hint">dialog</property> + <child> + <placeholder/> + </child> <child internal-child="vbox"> <object class="GtkBox" id="dialog-vbox1"> <property name="can_focus">False</property> @@ -18,8 +21,8 @@ <property name="can_focus">False</property> <property name="layout_style">end</property> <child> - <object class="GtkButton" id="help"> - <property name="label">gtk-help</property> + <object class="GtkButton" id="reset"> + <property name="label">gtk-revert-to-saved</property> <property name="visible">True</property> <property name="can_focus">True</property> <property name="receives_default">True</property> @@ -29,14 +32,15 @@ <property name="expand">False</property> <property name="fill">True</property> <property name="position">0</property> - <property name="secondary">True</property> </packing> </child> <child> - <object class="GtkButton" id="reset"> - <property name="label">gtk-revert-to-saved</property> + <object class="GtkButton" id="apply"> + <property name="label">gtk-apply</property> <property name="visible">True</property> <property name="can_focus">True</property> + <property name="can_default">True</property> + <property name="has_default">True</property> <property name="receives_default">True</property> <property name="use_stock">True</property> </object> @@ -78,24 +82,22 @@ </packing> </child> <child> - <object class="GtkButton" id="apply"> - <property name="label">gtk-apply</property> + <object class="GtkButton" id="cancel"> + <property name="label">gtk-cancel</property> <property name="visible">True</property> <property name="can_focus">True</property> - <property name="can_default">True</property> - <property name="has_default">True</property> <property name="receives_default">True</property> <property name="use_stock">True</property> </object> <packing> <property name="expand">False</property> <property name="fill">True</property> - <property name="position">5</property> + <property name="position">4</property> </packing> </child> <child> - <object class="GtkButton" id="cancel"> - <property name="label">gtk-cancel</property> + <object class="GtkButton" id="help"> + <property name="label">gtk-help</property> <property name="visible">True</property> <property name="can_focus">True</property> <property name="receives_default">True</property> @@ -104,7 +106,8 @@ <packing> <property name="expand">False</property> <property name="fill">True</property> - <property name="position">6</property> + <property name="position">5</property> + <property name="secondary">True</property> </packing> </child> </object> @@ -926,15 +929,9 @@ </object> </child> <action-widgets> - <action-widget response="-11">help</action-widget> - <action-widget response="0">reset</action-widget> - <action-widget response="0">standard</action-widget> <action-widget response="-5">ok</action-widget> - <action-widget response="0">apply</action-widget> <action-widget response="-6">cancel</action-widget> + <action-widget response="-11">help</action-widget> </action-widgets> - <child> - <placeholder/> - </child> </object> </interface> diff --git a/sw/uiconfig/swriter/ui/templatedialog4.ui b/sw/uiconfig/swriter/ui/templatedialog4.ui index 6a74407d2b2c..3f26a7034d6c 100644 --- a/sw/uiconfig/swriter/ui/templatedialog4.ui +++ b/sw/uiconfig/swriter/ui/templatedialog4.ui @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> -<!-- Generated with glade 3.20.4 --> +<!-- Generated with glade 3.22.1 --> <interface domain="sw"> <requires lib="gtk+" version="3.18"/> <object class="GtkDialog" id="TemplateDialog4"> @@ -8,6 +8,9 @@ <property name="title" translatable="yes" context="templatedialog4|TemplateDialog4">Frame Style</property> <property name="resizable">False</property> <property name="type_hint">dialog</property> + <child> + <placeholder/> + </child> <child internal-child="vbox"> <object class="GtkBox" id="dialog-vbox1"> <property name="can_focus">False</property> @@ -18,8 +21,8 @@ <property name="can_focus">False</property> <property name="layout_style">end</property> <child> - <object class="GtkButton" id="help"> - <property name="label">gtk-help</property> + <object class="GtkButton" id="reset"> + <property name="label">gtk-revert-to-saved</property> <property name="visible">True</property> <property name="can_focus">True</property> <property name="receives_default">True</property> @@ -29,14 +32,15 @@ <property name="expand">False</property> <property name="fill">True</property> <property name="position">0</property> - <property name="secondary">True</property> </packing> </child> <child> - <object class="GtkButton" id="reset"> - <property name="label">gtk-revert-to-saved</property> + <object class="GtkButton" id="apply"> + <property name="label">gtk-apply</property> <property name="visible">True</property> <property name="can_focus">True</property> + <property name="can_default">True</property> + <property name="has_default">True</property> <property name="receives_default">True</property> <property name="use_stock">True</property> </object> @@ -78,24 +82,22 @@ </packing> </child> <child> - <object class="GtkButton" id="apply"> - <property name="label">gtk-apply</property> + <object class="GtkButton" id="cancel"> + <property name="label">gtk-cancel</property> <property name="visible">True</property> <property name="can_focus">True</property> - <property name="can_default">True</property> - <property name="has_default">True</property> <property name="receives_default">True</property> <property name="use_stock">True</property> </object> <packing> <property name="expand">False</property> <property name="fill">True</property> - <property name="position">5</property> + <property name="position">4</property> </packing> </child> <child> - <object class="GtkButton" id="cancel"> - <property name="label">gtk-cancel</property> + <object class="GtkButton" id="help"> + <property name="label">gtk-help</property> <property name="visible">True</property> <property name="can_focus">True</property> <property name="receives_default">True</property> @@ -104,7 +106,8 @@ <packing> <property name="expand">False</property> <property name="fill">True</property> - <property name="position">6</property> + <property name="position">5</property> + <property name="secondary">True</property> </packing> </child> </object> @@ -550,15 +553,9 @@ </object> </child> <action-widgets> - <action-widget response="-11">help</action-widget> - <action-widget response="0">reset</action-widget> - <action-widget response="0">standard</action-widget> <action-widget response="-5">ok</action-widget> - <action-widget response="0">apply</action-widget> <action-widget response="-6">cancel</action-widget> + <action-widget response="-11">help</action-widget> </action-widgets> - <child> - <placeholder/> - </child> </object> </interface> diff --git a/sw/uiconfig/swriter/ui/templatedialog8.ui b/sw/uiconfig/swriter/ui/templatedialog8.ui index cc63cdc72407..0e8a16c7f99d 100644 --- a/sw/uiconfig/swriter/ui/templatedialog8.ui +++ b/sw/uiconfig/swriter/ui/templatedialog8.ui @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> -<!-- Generated with glade 3.20.4 --> +<!-- Generated with glade 3.22.1 --> <interface domain="sw"> <requires lib="gtk+" version="3.18"/> <object class="GtkDialog" id="TemplateDialog8"> @@ -8,6 +8,9 @@ <property name="title" translatable="yes" context="templatedialog8|TemplateDialog8">Page Style</property> <property name="resizable">False</property> <property name="type_hint">dialog</property> + <child> + <placeholder/> + </child> <child internal-child="vbox"> <object class="GtkBox" id="dialog-vbox1"> <property name="can_focus">False</property> @@ -48,8 +51,8 @@ </packing> </child> <child> - <object class="GtkButton" id="ok"> - <property name="label">gtk-ok</property> + <object class="GtkButton" id="apply"> + <property name="label">gtk-apply</property> <property name="visible">True</property> <property name="can_focus">True</property> <property name="can_default">True</property> @@ -64,8 +67,23 @@ </packing> </child> <child> - <object class="GtkButton" id="apply"> - <property name="label">gtk-apply</property> + <object class="GtkButton" id="standard"> + <property name="label">Standard</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="can_default">True</property> + <property name="has_default">True</property> + <property name="receives_default">True</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">3</property> + </packing> + </child> + <child> + <object class="GtkButton" id="ok"> + <property name="label">gtk-ok</property> <property name="visible">True</property> <property name="can_focus">True</property> <property name="can_default">True</property> @@ -107,6 +125,7 @@ <property name="can_focus">True</property> <property name="hexpand">True</property> <property name="vexpand">True</property> + <property name="scrollable">True</property> <child> <object class="GtkGrid"> <property name="visible">True</property> @@ -584,13 +603,8 @@ </child> <action-widgets> <action-widget response="-11">help</action-widget> - <action-widget response="0">reset</action-widget> <action-widget response="-5">ok</action-widget> - <action-widget response="0">apply</action-widget> <action-widget response="-6">cancel</action-widget> </action-widgets> - <child> - <placeholder/> - </child> </object> </interface> diff --git a/sw/uiconfig/swriter/ui/textgridpage.ui b/sw/uiconfig/swriter/ui/textgridpage.ui index 64ec3e518079..76cc6d1435d0 100644 --- a/sw/uiconfig/swriter/ui/textgridpage.ui +++ b/sw/uiconfig/swriter/ui/textgridpage.ui @@ -142,8 +142,6 @@ <property name="can_focus">False</property> <property name="halign">center</property> <property name="valign">center</property> - <property name="hexpand">True</property> - <property name="vexpand">True</property> </object> <packing> <property name="expand">True</property> |