summaryrefslogtreecommitdiff
path: root/reportdesign/source
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2018-10-07 19:14:41 +0100
committerCaolán McNamara <caolanm@redhat.com>2018-10-08 10:13:15 +0200
commitecc6180d8158a6b4d998807bc78f78b9efcea677 (patch)
tree3abc6c453236aa0cbf21e647af77ef5e7e779880 /reportdesign/source
parentf5bafb4d9824956984d3bd2e1bc868996beca7fc (diff)
weld ORptPageDialog
Change-Id: I96bd38046e527c76782504edd408df1aee490e37 Reviewed-on: https://gerrit.libreoffice.org/61498 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'reportdesign/source')
-rw-r--r--reportdesign/source/ui/dlg/dlgpage.cxx14
-rw-r--r--reportdesign/source/ui/inc/dlgpage.hxx7
-rw-r--r--reportdesign/source/ui/misc/UITools.cxx8
-rw-r--r--reportdesign/source/ui/report/ReportController.cxx8
4 files changed, 17 insertions, 20 deletions
diff --git a/reportdesign/source/ui/dlg/dlgpage.cxx b/reportdesign/source/ui/dlg/dlgpage.cxx
index fa2a38ff9da0..23ee7bd4f6f6 100644
--- a/reportdesign/source/ui/dlg/dlgpage.cxx
+++ b/reportdesign/source/ui/dlg/dlgpage.cxx
@@ -36,11 +36,9 @@ namespace rptui
|*
\************************************************************************/
-ORptPageDialog::ORptPageDialog( vcl::Window* pParent, const SfxItemSet* pAttr, const OUString &rDialog)
- : SfxTabDialog (pParent, rDialog, "modules/dbreport/ui/" +
- rDialog.toAsciiLowerCase() +
- ".ui", pAttr)
- , m_nCharBgdId(0)
+ORptPageDialog::ORptPageDialog(weld::Window* pParent, const SfxItemSet* pAttr, const OUString &rDialog)
+ : SfxTabDialogController(pParent, "modules/dbreport/ui/" +
+ rDialog.toAsciiLowerCase() + ".ui", rDialog.toUtf8(), pAttr)
{
SfxAbstractDialogFactory* pFact = SfxAbstractDialogFactory::Create();
@@ -59,7 +57,7 @@ ORptPageDialog::ORptPageDialog( vcl::Window* pParent, const SfxItemSet* pAttr, c
AddTabPage("fonteffects", pFact->GetTabPageCreatorFunc( RID_SVXPAGE_CHAR_EFFECTS ), nullptr );
AddTabPage("position", pFact->GetTabPageCreatorFunc( RID_SVXPAGE_CHAR_POSITION ), nullptr );
AddTabPage("asianlayout", pFact->GetTabPageCreatorFunc( RID_SVXPAGE_CHAR_TWOLINES ), nullptr );
- m_nCharBgdId = AddTabPage("background", pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BACKGROUND ), nullptr );
+ AddTabPage("background", pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BACKGROUND ), nullptr );
AddTabPage("alignment", pFact->GetTabPageCreatorFunc( RID_SVXPAGE_ALIGNMENT ), nullptr );
}
else
@@ -70,10 +68,10 @@ ORptPageDialog::ORptPageDialog( vcl::Window* pParent, const SfxItemSet* pAttr, c
RemoveTabPage("asianlayout");
}
-void ORptPageDialog::PageCreated( sal_uInt16 nId, SfxTabPage &rPage )
+void ORptPageDialog::PageCreated(const OString& rId, SfxTabPage &rPage)
{
SfxAllItemSet aSet(*(GetInputSetImpl()->GetPool()));
- if (nId == m_nCharBgdId)
+ if (rId == "background")
{
aSet.Put(SfxUInt32Item(SID_FLAG_TYPE,static_cast<sal_uInt32>(SvxBackgroundTabFlags::SHOW_HIGHLIGHTING)));
rPage.PageCreated(aSet);
diff --git a/reportdesign/source/ui/inc/dlgpage.hxx b/reportdesign/source/ui/inc/dlgpage.hxx
index 49d82cf32502..5bebf0958945 100644
--- a/reportdesign/source/ui/inc/dlgpage.hxx
+++ b/reportdesign/source/ui/inc/dlgpage.hxx
@@ -28,17 +28,16 @@ namespace rptui
|* Page setup tab dialog
|*
\************************************************************************/
-class ORptPageDialog : public SfxTabDialog
+class ORptPageDialog : public SfxTabDialogController
{
private:
ORptPageDialog(const ORptPageDialog&) = delete;
void operator =(const ORptPageDialog&) = delete;
- sal_uInt16 m_nCharBgdId;
public:
- ORptPageDialog(vcl::Window* pParent, const SfxItemSet* pAttr, const OUString &rDialog);
- virtual void PageCreated( sal_uInt16 nId, SfxTabPage &rPage ) override;
+ ORptPageDialog(weld::Window* pParent, const SfxItemSet* pAttr, const OUString &rDialog);
+ virtual void PageCreated(const OString& rId, SfxTabPage &rPage) override;
};
} // namespace rptui
diff --git a/reportdesign/source/ui/misc/UITools.cxx b/reportdesign/source/ui/misc/UITools.cxx
index 8bbfd8820fb0..48b509663757 100644
--- a/reportdesign/source/ui/misc/UITools.cxx
+++ b/reportdesign/source/ui/misc/UITools.cxx
@@ -710,16 +710,16 @@ bool openCharDialog( const uno::Reference<report::XReportControlFormat >& _rxRep
lcl_CharPropertiesToItems( _rxReportControlFormat, *pDescriptor );
{ // want the dialog to be destroyed before our set
- ScopedVclPtrInstance< ORptPageDialog > aDlg(pParent, pDescriptor.get(), "CharDialog");
+ ORptPageDialog aDlg(Application::GetFrameWeld(_rxParentWindow), pDescriptor.get(), "CharDialog");
uno::Reference< report::XShape > xShape( _rxReportControlFormat, uno::UNO_QUERY );
if ( xShape.is() )
- aDlg->RemoveTabPage("background");
- bSuccess = ( RET_OK == aDlg->Execute() );
+ aDlg.RemoveTabPage("background");
+ bSuccess = aDlg.execute() == RET_OK;
if ( bSuccess )
{
lcl_itemsToCharProperties( lcl_getReportControlFont( _rxReportControlFormat,WESTERN ),
lcl_getReportControlFont( _rxReportControlFormat,ASIAN ),
- lcl_getReportControlFont( _rxReportControlFormat,COMPLEX ), *aDlg->GetOutputItemSet(), _out_rNewValues );
+ lcl_getReportControlFont( _rxReportControlFormat,COMPLEX ), *aDlg.GetOutputItemSet(), _out_rNewValues );
}
}
}
diff --git a/reportdesign/source/ui/report/ReportController.cxx b/reportdesign/source/ui/report/ReportController.cxx
index c0288eb92de6..7bc4c6a4f4d1 100644
--- a/reportdesign/source/ui/report/ReportController.cxx
+++ b/reportdesign/source/ui/report/ReportController.cxx
@@ -2422,16 +2422,16 @@ void OReportController::openPageDialog(const uno::Reference<report::XSection>& _
}
{ // want the dialog to be destroyed before our set
- ScopedVclPtrInstance<ORptPageDialog> aDlg(
- getView(), pDescriptor.get(),_xSection.is()
+ ORptPageDialog aDlg(
+ getFrameWeld(), pDescriptor.get(),_xSection.is()
? OUString("BackgroundDialog")
: OUString("PageDialog"));
- if (RET_OK == aDlg->Execute())
+ if (aDlg.execute() == RET_OK)
{
// ItemSet->UNO
// UNO-properties
- const SfxItemSet* pSet = aDlg->GetOutputItemSet();
+ const SfxItemSet* pSet = aDlg.GetOutputItemSet();
if ( _xSection.is() )
{
const SfxPoolItem* pItem;