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

weld SwCaptionDialog

Change-Id: I5babfbf3489f88c5d6cdeffbd514d86368f04fa9
Reviewed-on: https://gerrit.libreoffice.org/65014
Tested-by: Jenkins
Reviewed-by: 's avatarCaolán McNamara <caolanm@redhat.com>
Tested-by: 's avatarCaolán McNamara <caolanm@redhat.com>
(cherry picked from commit 72ebf150)
Reviewed-on: https://gerrit.libreoffice.org/65078
üst 2a70f6a2
...@@ -223,9 +223,6 @@ ...@@ -223,9 +223,6 @@
<glade-widget-class title="Calc Table Preview" name="sclo-ScAutoFmtPreview" <glade-widget-class title="Calc Table Preview" name="sclo-ScAutoFmtPreview"
generic-name="Calc Table Preview Window" parent="GtkDrawingArea" generic-name="Calc Table Preview Window" parent="GtkDrawingArea"
icon-name="widget-gtk-drawingarea"/> icon-name="widget-gtk-drawingarea"/>
<glade-widget-class title="Caption Preview" name="swuilo-SwCaptionPreview"
generic-name="Caption Preview Window" parent="GtkDrawingArea"
icon-name="widget-gtk-drawingarea"/>
<glade-widget-class title="Extension List" name="deploymentgui-ExtensionBox" <glade-widget-class title="Extension List" name="deploymentgui-ExtensionBox"
generic-name="Extensions List" parent="GtkDrawingArea" generic-name="Extensions List" parent="GtkDrawingArea"
icon-name="widget-gtk-drawingarea"/> icon-name="widget-gtk-drawingarea"/>
......
...@@ -508,7 +508,6 @@ custom_widgets = [ ...@@ -508,7 +508,6 @@ custom_widgets = [
'SvxTextEncodingBox', 'SvxTextEncodingBox',
'SvxTextEncodingBox', 'SvxTextEncodingBox',
'SwAddressPreview', 'SwAddressPreview',
'SwCaptionPreview',
'SwFieldRefTreeListBox', 'SwFieldRefTreeListBox',
'SwGlTreeListBox', 'SwGlTreeListBox',
'SwIdxTreeListBox', 'SwIdxTreeListBox',
......
...@@ -377,7 +377,7 @@ public: ...@@ -377,7 +377,7 @@ public:
virtual VclPtr<SfxAbstractTabDialog> CreateSwCharDlg(weld::Window* pParent, SwView& pVw, const SfxItemSet& rCoreSet, virtual VclPtr<SfxAbstractTabDialog> CreateSwCharDlg(weld::Window* pParent, SwView& pVw, const SfxItemSet& rCoreSet,
SwCharDlgMode nDialogMode, const OUString* pFormatStr = nullptr) = 0; SwCharDlgMode nDialogMode, const OUString* pFormatStr = nullptr) = 0;
virtual VclPtr<AbstractSwConvertTableDlg> CreateSwConvertTableDlg(SwView& rView, bool bToTable) = 0; virtual VclPtr<AbstractSwConvertTableDlg> CreateSwConvertTableDlg(SwView& rView, bool bToTable) = 0;
virtual VclPtr<VclAbstractDialog> CreateSwCaptionDialog ( vcl::Window *pParent, SwView &rV) = 0; virtual VclPtr<VclAbstractDialog> CreateSwCaptionDialog(weld::Window *pParent, SwView &rV) = 0;
virtual VclPtr<AbstractSwInsertDBColAutoPilot> CreateSwInsertDBColAutoPilot(SwView& rView, virtual VclPtr<AbstractSwInsertDBColAutoPilot> CreateSwInsertDBColAutoPilot(SwView& rView,
css::uno::Reference< css::sdbc::XDataSource> rxSource, css::uno::Reference< css::sdbc::XDataSource> rxSource,
......
...@@ -495,7 +495,6 @@ void CaptionPreview::Paint(vcl::RenderContext& rRenderContext, const tools::Rect ...@@ -495,7 +495,6 @@ void CaptionPreview::Paint(vcl::RenderContext& rRenderContext, const tools::Rect
rRenderContext.DrawText(Point(4, 6), maText); rRenderContext.DrawText(Point(4, 6), maText);
} }
IMPL_LINK(SwCaptionOptPage, TextFilterHdl, OUString&, rTest, bool) IMPL_LINK(SwCaptionOptPage, TextFilterHdl, OUString&, rTest, bool)
{ {
rTest = m_aTextFilter.filter(rTest); rTest = m_aTextFilter.filter(rTest);
......
...@@ -829,10 +829,9 @@ VclPtr<AbstractSwConvertTableDlg> SwAbstractDialogFactory_Impl::CreateSwConvertT ...@@ -829,10 +829,9 @@ VclPtr<AbstractSwConvertTableDlg> SwAbstractDialogFactory_Impl::CreateSwConvertT
return VclPtr<AbstractSwConvertTableDlg_Impl>::Create(o3tl::make_unique<SwConvertTableDlg>(rView, bToTable)); return VclPtr<AbstractSwConvertTableDlg_Impl>::Create(o3tl::make_unique<SwConvertTableDlg>(rView, bToTable));
} }
VclPtr<VclAbstractDialog> SwAbstractDialogFactory_Impl::CreateSwCaptionDialog ( vcl::Window *pParent, SwView &rV) VclPtr<VclAbstractDialog> SwAbstractDialogFactory_Impl::CreateSwCaptionDialog(weld::Window *pParent, SwView &rV)
{ {
VclPtr<Dialog> pDlg = VclPtr<SwCaptionDialog>::Create( pParent, rV ); return VclPtr<AbstractGenericDialog_Impl>::Create(o3tl::make_unique<SwCaptionDialog>(pParent, rV));
return VclPtr<VclAbstractDialog_Impl>::Create( pDlg );
} }
VclPtr<AbstractSwInsertDBColAutoPilot> SwAbstractDialogFactory_Impl::CreateSwInsertDBColAutoPilot( SwView& rView, VclPtr<AbstractSwInsertDBColAutoPilot> SwAbstractDialogFactory_Impl::CreateSwInsertDBColAutoPilot( SwView& rView,
......
...@@ -615,7 +615,7 @@ public: ...@@ -615,7 +615,7 @@ public:
virtual VclPtr<SfxAbstractTabDialog> CreateSwCharDlg(weld::Window* pParent, SwView& pVw, const SfxItemSet& rCoreSet, virtual VclPtr<SfxAbstractTabDialog> CreateSwCharDlg(weld::Window* pParent, SwView& pVw, const SfxItemSet& rCoreSet,
SwCharDlgMode nDialogMode, const OUString* pFormatStr = nullptr) override; SwCharDlgMode nDialogMode, const OUString* pFormatStr = nullptr) override;
virtual VclPtr<AbstractSwConvertTableDlg> CreateSwConvertTableDlg(SwView& rView, bool bToTable) override; virtual VclPtr<AbstractSwConvertTableDlg> CreateSwConvertTableDlg(SwView& rView, bool bToTable) override;
virtual VclPtr<VclAbstractDialog> CreateSwCaptionDialog ( vcl::Window *pParent, SwView &rV) override; virtual VclPtr<VclAbstractDialog> CreateSwCaptionDialog(weld::Window *pParent, SwView &rV) override;
virtual VclPtr<AbstractSwInsertDBColAutoPilot> CreateSwInsertDBColAutoPilot(SwView& rView, virtual VclPtr<AbstractSwInsertDBColAutoPilot> CreateSwInsertDBColAutoPilot(SwView& rView,
css::uno::Reference< css::sdbc::XDataSource> rxSource, css::uno::Reference< css::sdbc::XDataSource> rxSource,
css::uno::Reference<css::sdbcx::XColumnsSupplier> xColSupp, css::uno::Reference<css::sdbcx::XColumnsSupplier> xColSupp,
......
This diff is collapsed.
...@@ -19,11 +19,7 @@ ...@@ -19,11 +19,7 @@
#ifndef INCLUDED_SW_SOURCE_UIBASE_INC_CPTION_HXX #ifndef INCLUDED_SW_SOURCE_UIBASE_INC_CPTION_HXX
#define INCLUDED_SW_SOURCE_UIBASE_INC_CPTION_HXX #define INCLUDED_SW_SOURCE_UIBASE_INC_CPTION_HXX
#include <svx/stddlg.hxx> #include <sfx2/basedlgs.hxx>
#include <vcl/fixed.hxx>
#include <vcl/lstbox.hxx>
#include <vcl/edit.hxx>
#include <vcl/button.hxx>
#include "actctrl.hxx" #include "actctrl.hxx"
#include <com/sun/star/container/XNameAccess.hpp> #include <com/sun/star/container/XNameAccess.hpp>
...@@ -34,28 +30,10 @@ ...@@ -34,28 +30,10 @@
class SwFieldMgr; class SwFieldMgr;
class SwView; class SwView;
class SwCaptionDialog : public SfxDialogController
class SwCaptionDialog : public SvxStandardDialog
{ {
VclPtr<Edit> m_pTextEdit;
VclPtr<ComboBox> m_pCategoryBox;
OUString const m_sNone; OUString const m_sNone;
TextFilterAutoConvert m_aTextFilter; TextFilterAutoConvert m_aTextFilter;
VclPtr<FixedText> m_pFormatText;
VclPtr<ListBox> m_pFormatBox;
//#i61007# order of captions
VclPtr<FixedText> m_pNumberingSeparatorFT;
VclPtr<Edit> m_pNumberingSeparatorED;
VclPtr<FixedText> m_pSepText;
VclPtr<Edit> m_pSepEdit;
VclPtr<FixedText> m_pPosText;
VclPtr<ListBox> m_pPosBox;
VclPtr<OKButton> m_pOKButton;
VclPtr<PushButton> m_pAutoCaptionButton;
VclPtr<PushButton> m_pOptionButton;
VclPtr<SwCaptionPreview> m_pPreview;
SwView &rView; // search per active, avoid View SwView &rView; // search per active, avoid View
std::unique_ptr<SwFieldMgr> pMgr; // pointer to save the include std::unique_ptr<SwFieldMgr> pMgr; // pointer to save the include
...@@ -65,22 +43,41 @@ class SwCaptionDialog : public SvxStandardDialog ...@@ -65,22 +43,41 @@ class SwCaptionDialog : public SvxStandardDialog
css::uno::Reference< css::container::XNameAccess > xNameAccess; css::uno::Reference< css::container::XNameAccess > xNameAccess;
DECL_LINK(SelectHdl, ComboBox&, void); CaptionPreview m_aPreview;
DECL_LINK(SelectListBoxHdl, ListBox&, void); std::unique_ptr<weld::Entry> m_xTextEdit;
DECL_LINK(ModifyHdl, Edit&, void); std::unique_ptr<weld::ComboBox> m_xCategoryBox;
DECL_LINK(OptionHdl, Button *, void); std::unique_ptr<weld::Label> m_xFormatText;
DECL_LINK(CaptionHdl, Button *, void); std::unique_ptr<weld::ComboBox> m_xFormatBox;
//#i61007# order of captions
virtual void Apply() override; std::unique_ptr<weld::Label> m_xNumberingSeparatorFT;
std::unique_ptr<weld::Entry> m_xNumberingSeparatorED;
void DrawSample(); std::unique_ptr<weld::Label> m_xSepText;
void ApplyCaptionOrder(); //#i61007# order of captions std::unique_ptr<weld::Entry> m_xSepEdit;
std::unique_ptr<weld::Label> m_xPosText;
std::unique_ptr<weld::ComboBox> m_xPosBox;
std::unique_ptr<weld::Button> m_xOKButton;
std::unique_ptr<weld::Button> m_xAutoCaptionButton;
std::unique_ptr<weld::Button> m_xOptionButton;
std::unique_ptr<weld::CustomWeld> m_xPreview;
DECL_LINK(SelectListBoxHdl, weld::ComboBox&, void);
DECL_LINK(ModifyEntryHdl, weld::Entry&, void);
DECL_LINK(ModifyComboHdl, weld::ComboBox&, void);
DECL_LINK(OptionHdl, weld::Button&, void);
DECL_LINK(CaptionHdl, weld::Button&, void);
DECL_LINK(TextFilterHdl, OUString&, bool);
void Apply();
void ModifyHdl();
void DrawSample();
void ApplyCaptionOrder(); //#i61007# order of captions
static OUString our_aSepTextSave; // Save caption separator text static OUString our_aSepTextSave; // Save caption separator text
public: public:
SwCaptionDialog( vcl::Window *pParent, SwView &rV ); SwCaptionDialog(weld::Window *pParent, SwView &rV);
virtual short run() override;
virtual ~SwCaptionDialog() override; virtual ~SwCaptionDialog() override;
virtual void dispose() override;
}; };
#endif #endif
......
...@@ -46,14 +46,12 @@ using namespace css; ...@@ -46,14 +46,12 @@ using namespace css;
void SwView::ExecDlgExt(SfxRequest const &rReq) void SwView::ExecDlgExt(SfxRequest const &rReq)
{ {
vcl::Window& rMDI = GetViewFrame()->GetWindow();
switch ( rReq.GetSlot() ) switch ( rReq.GetSlot() )
{ {
case FN_INSERT_CAPTION: case FN_INSERT_CAPTION:
{ {
SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
ScopedVclPtr<VclAbstractDialog> pDialog(pFact->CreateSwCaptionDialog( &rMDI, *this )); ScopedVclPtr<VclAbstractDialog> pDialog(pFact->CreateSwCaptionDialog(GetFrameWeld(), *this ));
pDialog->Execute(); pDialog->Execute();
break; break;
} }
......
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