[Libreoffice-commits] core.git: 2 commits - reportdesign/source reportdesign/uiconfig sd/source
Libreoffice Gerrit user
logerrit at kemper.freedesktop.org
Sun Oct 7 17:43:59 UTC 2018
reportdesign/source/ui/dlg/PageNumber.cxx | 58 ++++++------------
reportdesign/source/ui/inc/PageNumber.hxx | 33 +++-------
reportdesign/source/ui/report/ReportController.cxx | 4 -
reportdesign/uiconfig/dbreport/ui/pagenumberdialog.ui | 13 ++--
sd/source/ui/func/fupoor.cxx | 12 ---
sd/source/ui/inc/fupoor.hxx | 3
6 files changed, 42 insertions(+), 81 deletions(-)
New commits:
commit 08d4100a81396c2c35f074efc41ee89c795e3ab6
Author: Caolán McNamara <caolanm at redhat.com>
AuthorDate: Sat Oct 6 20:48:02 2018 +0100
Commit: Caolán McNamara <caolanm at redhat.com>
CommitDate: Sun Oct 7 19:43:51 2018 +0200
weld OPageNumberDialog
Change-Id: I074dade23767e48bc1e0e311629ed4c0b55c1a00
Reviewed-on: https://gerrit.libreoffice.org/61480
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm at redhat.com>
Tested-by: Caolán McNamara <caolanm at redhat.com>
diff --git a/reportdesign/source/ui/dlg/PageNumber.cxx b/reportdesign/source/ui/dlg/PageNumber.cxx
index 27fb930b1205..4821b7ac9d52 100644
--- a/reportdesign/source/ui/dlg/PageNumber.cxx
+++ b/reportdesign/source/ui/dlg/PageNumber.cxx
@@ -36,46 +36,30 @@ using namespace ::comphelper;
// class OPageNumberDialog
-OPageNumberDialog::OPageNumberDialog( vcl::Window* _pParent
- ,const uno::Reference< report::XReportDefinition >& _xHoldAlive
- ,OReportController* _pController)
- : ModalDialog( _pParent, "PageNumberDialog" , "modules/dbreport/ui/pagenumberdialog.ui" )
- ,m_pController(_pController)
- ,m_xHoldAlive(_xHoldAlive)
+OPageNumberDialog::OPageNumberDialog(weld::Window* pParent,
+ const uno::Reference< report::XReportDefinition >& _xHoldAlive,
+ OReportController* _pController)
+ : GenericDialogController(pParent, "modules/dbreport/ui/pagenumberdialog.ui", "PageNumberDialog")
+ , m_pController(_pController)
+ , m_xHoldAlive(_xHoldAlive)
+ , m_xPageN(m_xBuilder->weld_radio_button("pagen"))
+ , m_xPageNofM(m_xBuilder->weld_radio_button("pagenofm"))
+ , m_xTopPage(m_xBuilder->weld_radio_button("toppage"))
+ , m_xBottomPage(m_xBuilder->weld_radio_button("bottompage"))
+ , m_xAlignmentLst(m_xBuilder->weld_combo_box("alignment"))
+ , m_xShowNumberOnFirstPage(m_xBuilder->weld_check_button("shownumberonfirstpage"))
{
- get(m_pPageN,"pagen");
- get(m_pPageNofM,"pagenofm");
- get(m_pTopPage,"toppage");
- get(m_pBottomPage,"bottompage");
- get(m_pAlignmentLst,"alignment");
- get(m_pShowNumberOnFirstPage,"shownumberonfirstpage");
-
-
- m_pShowNumberOnFirstPage->Hide();
-
+ m_xShowNumberOnFirstPage->hide();
}
-
OPageNumberDialog::~OPageNumberDialog()
{
- disposeOnce();
-}
-
-void OPageNumberDialog::dispose()
-{
- m_pPageN.clear();
- m_pPageNofM.clear();
- m_pTopPage.clear();
- m_pBottomPage.clear();
- m_pAlignmentLst.clear();
- m_pShowNumberOnFirstPage.clear();
- ModalDialog::dispose();
}
-short OPageNumberDialog::Execute()
+void OPageNumberDialog::execute()
{
- short nRet = ModalDialog::Execute();
- if ( nRet == RET_OK )
+ short nRet = m_xDialog->run();
+ if (nRet == RET_OK)
{
try
{
@@ -83,7 +67,7 @@ short OPageNumberDialog::Execute()
sal_Int32 nPosX = 0;
sal_Int32 nPos2X = 0;
awt::Size aRptSize = getStyleProperty<awt::Size>(m_xHoldAlive,PROPERTY_PAPERSIZE);
- switch ( m_pAlignmentLst->GetSelectedEntryPos() )
+ switch (m_xAlignmentLst->get_active())
{
case 0: // left
nPosX = getStyleProperty<sal_Int32>(m_xHoldAlive,PROPERTY_LEFTMARGIN);
@@ -102,23 +86,21 @@ short OPageNumberDialog::Execute()
default:
break;
}
- if ( m_pAlignmentLst->GetSelectedEntryPos() > 2 )
+ if (m_xAlignmentLst->get_active() > 2)
nPosX = nPos2X;
uno::Sequence<beans::PropertyValue> aValues( comphelper::InitPropertySequence({
{ PROPERTY_POSITION, uno::Any(awt::Point(nPosX,0)) },
- { PROPERTY_PAGEHEADERON, uno::Any(m_pTopPage->IsChecked()) },
- { PROPERTY_STATE, uno::Any(m_pPageNofM->IsChecked()) }
+ { PROPERTY_PAGEHEADERON, uno::Any(m_xTopPage->get_active()) },
+ { PROPERTY_STATE, uno::Any(m_xPageNofM->get_active()) }
}));
m_pController->executeChecked(SID_INSERT_FLD_PGNUMBER,aValues);
}
catch(uno::Exception&)
{
- nRet = RET_NO;
}
}
- return nRet;
}
} // rptui
diff --git a/reportdesign/source/ui/inc/PageNumber.hxx b/reportdesign/source/ui/inc/PageNumber.hxx
index 1bfe03dfcaad..8a5150698e2d 100644
--- a/reportdesign/source/ui/inc/PageNumber.hxx
+++ b/reportdesign/source/ui/inc/PageNumber.hxx
@@ -19,14 +19,9 @@
#ifndef INCLUDED_REPORTDESIGN_SOURCE_UI_INC_PAGENUMBER_HXX
#define INCLUDED_REPORTDESIGN_SOURCE_UI_INC_PAGENUMBER_HXX
-#include <vcl/dialog.hxx>
-#include <vcl/fixed.hxx>
-#include <vcl/lstbox.hxx>
-#include <vcl/field.hxx>
-#include <vcl/button.hxx>
+#include <vcl/weld.hxx>
#include <com/sun/star/report/XReportDefinition.hpp>
-
namespace rptui
{
class OReportController;
@@ -35,30 +30,26 @@ class OReportController;
|* Groups and Sorting dialog
|*
\************************************************************************/
-class OPageNumberDialog : public ModalDialog
+class OPageNumberDialog : public weld::GenericDialogController
{
- VclPtr<RadioButton> m_pPageN;
- VclPtr<RadioButton> m_pPageNofM;
-
- VclPtr<RadioButton> m_pTopPage;
- VclPtr<RadioButton> m_pBottomPage;
- VclPtr<ListBox> m_pAlignmentLst;
-
- VclPtr<CheckBox> m_pShowNumberOnFirstPage;
-
::rptui::OReportController* m_pController;
css::uno::Reference< css::report::XReportDefinition>
m_xHoldAlive;
+ std::unique_ptr<weld::RadioButton> m_xPageN;
+ std::unique_ptr<weld::RadioButton> m_xPageNofM;
+ std::unique_ptr<weld::RadioButton> m_xTopPage;
+ std::unique_ptr<weld::RadioButton> m_xBottomPage;
+ std::unique_ptr<weld::ComboBox> m_xAlignmentLst;
+ std::unique_ptr<weld::CheckButton> m_xShowNumberOnFirstPage;
OPageNumberDialog(const OPageNumberDialog&) = delete;
void operator =(const OPageNumberDialog&) = delete;
public:
- OPageNumberDialog( vcl::Window* pParent
- ,const css::uno::Reference< css::report::XReportDefinition>& _xHoldAlive
- ,::rptui::OReportController* _pController);
+ OPageNumberDialog(weld::Window* pParent,
+ const css::uno::Reference< css::report::XReportDefinition>& _xHoldAlive,
+ ::rptui::OReportController* _pController);
virtual ~OPageNumberDialog() override;
- virtual void dispose() override;
- virtual short Execute() override;
+ void execute();
};
} // namespace rptui
diff --git a/reportdesign/source/ui/report/ReportController.cxx b/reportdesign/source/ui/report/ReportController.cxx
index 92c417dd5c45..1319f3be33fc 100644
--- a/reportdesign/source/ui/report/ReportController.cxx
+++ b/reportdesign/source/ui/report/ReportController.cxx
@@ -1565,8 +1565,8 @@ void OReportController::Execute(sal_uInt16 _nId, const Sequence< PropertyValue >
{
if ( !aArgs.getLength() )
{
- ScopedVclPtrInstance< OPageNumberDialog > aDlg(getView(),m_xReportDefinition,this);
- aDlg->Execute();
+ OPageNumberDialog aDlg(getFrameWeld(), m_xReportDefinition, this);
+ aDlg.execute();
}
else
createPageNumber(aArgs);
diff --git a/reportdesign/uiconfig/dbreport/ui/pagenumberdialog.ui b/reportdesign/uiconfig/dbreport/ui/pagenumberdialog.ui
index a088d92519ab..f2a3c1c2f1c9 100644
--- a/reportdesign/uiconfig/dbreport/ui/pagenumberdialog.ui
+++ b/reportdesign/uiconfig/dbreport/ui/pagenumberdialog.ui
@@ -1,12 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
-<!-- Generated with glade 3.18.3 -->
+<!-- Generated with glade 3.22.1 -->
<interface domain="rpt">
<requires lib="gtk+" version="3.18"/>
<object class="GtkDialog" id="PageNumberDialog">
<property name="can_focus">False</property>
<property name="border_width">6</property>
<property name="title" translatable="yes" context="pagenumberdialog|PageNumberDialog">Page Numbers</property>
+ <property name="modal">True</property>
+ <property name="default_width">0</property>
+ <property name="default_height">0</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>
@@ -104,7 +110,6 @@
<property name="xalign">0</property>
<property name="active">True</property>
<property name="draw_indicator">True</property>
- <property name="group">pagenofm</property>
</object>
<packing>
<property name="left_attach">0</property>
@@ -120,7 +125,6 @@
<property name="hexpand">True</property>
<property name="use_underline">True</property>
<property name="xalign">0</property>
- <property name="active">True</property>
<property name="draw_indicator">True</property>
<property name="group">pagen</property>
</object>
@@ -183,7 +187,6 @@
<property name="xalign">0</property>
<property name="active">True</property>
<property name="draw_indicator">True</property>
- <property name="group">bottompage</property>
</object>
<packing>
<property name="left_attach">0</property>
@@ -273,10 +276,10 @@
<object class="GtkLabel" id="alignment_label">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="xalign">0</property>
<property name="label" translatable="yes" context="pagenumberdialog|alignment_label">_Alignment:</property>
<property name="use_underline">True</property>
<property name="mnemonic_widget">alignment</property>
+ <property name="xalign">0</property>
</object>
<packing>
<property name="left_attach">0</property>
commit 4b713fb40833ace1543d3645d429fe9a202dbfc8
Author: Caolán McNamara <caolanm at redhat.com>
AuthorDate: Sat Oct 6 20:38:11 2018 +0100
Commit: Caolán McNamara <caolanm at redhat.com>
CommitDate: Sun Oct 7 19:43:39 2018 +0200
unused Dialog field in FuPoor
Change-Id: Ic8ff613f7de37476054874f60bc83666d4cf404c
Reviewed-on: https://gerrit.libreoffice.org/61479
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm at redhat.com>
Tested-by: Caolán McNamara <caolanm at redhat.com>
diff --git a/sd/source/ui/func/fupoor.cxx b/sd/source/ui/func/fupoor.cxx
index 2e939b91d11b..078bdb610c5a 100644
--- a/sd/source/ui/func/fupoor.cxx
+++ b/sd/source/ui/func/fupoor.cxx
@@ -29,7 +29,6 @@
#include <sfx2/dispatch.hxx>
#include <sfx2/bindings.hxx>
#include <sfx2/request.hxx>
-#include <vcl/dialog.hxx>
#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/drawing/XLayer.hpp>
#include <com/sun/star/drawing/XLayerManager.hpp>
@@ -72,7 +71,6 @@ FuPoor::FuPoor (
mpDocSh( pDrDoc->GetDocSh() ),
mpDoc(pDrDoc),
nSlotId( rReq.GetSlot() ),
- pDialog(nullptr),
bIsInDragMode(false),
bNoScrollUntilInside (true),
bScrollable (false),
@@ -98,15 +96,10 @@ FuPoor::~FuPoor()
aDragTimer.Stop();
aScrollTimer.Stop();
aDelayToScrollTimer.Stop();
- pDialog.disposeAndClear();
}
void FuPoor::Activate()
{
- if (pDialog)
- {
- pDialog->Show();
- }
}
void FuPoor::Deactivate()
@@ -116,11 +109,6 @@ void FuPoor::Deactivate()
aDelayToScrollTimer.Stop ();
bScrollable = bDelayActive = false;
- if (pDialog)
- {
- pDialog->Hide();
- }
-
if (mpWindow && mpWindow->IsMouseCaptured())
mpWindow->ReleaseMouse();
}
diff --git a/sd/source/ui/inc/fupoor.hxx b/sd/source/ui/inc/fupoor.hxx
index 4f003c045709..ca77a62a83f3 100644
--- a/sd/source/ui/inc/fupoor.hxx
+++ b/sd/source/ui/inc/fupoor.hxx
@@ -29,7 +29,6 @@
class SdDrawDocument;
class SfxRequest;
-class Dialog;
class SdrObject;
class CommandEvent;
class HelpEvent;
@@ -152,8 +151,6 @@ protected:
sal_uInt16 nSlotId;
- VclPtr<Dialog> pDialog;
-
Timer aScrollTimer; ///< for auto-scrolling
DECL_LINK( ScrollHdl, Timer *, void );
void ForceScroll(const Point& aPixPos);
More information about the Libreoffice-commits
mailing list