diff options
author | Caolán McNamara <caolanm@redhat.com> | 2018-11-02 09:50:31 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2018-11-05 13:21:29 +0100 |
commit | e3c6c89588fc6b85663444d701f782e73bb572c1 (patch) | |
tree | 47ecffe8be56efa3e150841d7de791308ef8ee03 /sw/source/uibase/inc | |
parent | 13b4c191cb251e9218bb9c99140cff7c52fd04db (diff) |
weld SwIndexMarkModalDlg cluster
Change-Id: Iff45d9deb5409cf0dbb35723da6bad886379531f
Reviewed-on: https://gerrit.libreoffice.org/62775
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sw/source/uibase/inc')
-rw-r--r-- | sw/source/uibase/inc/idxmrk.hxx | 16 | ||||
-rw-r--r-- | sw/source/uibase/inc/swuiidxmrk.hxx | 201 |
2 files changed, 78 insertions, 139 deletions
diff --git a/sw/source/uibase/inc/idxmrk.hxx b/sw/source/uibase/inc/idxmrk.hxx index 0ccfb3f3f745..26268026c04e 100644 --- a/sw/source/uibase/inc/idxmrk.hxx +++ b/sw/source/uibase/inc/idxmrk.hxx @@ -27,12 +27,12 @@ class SwWrtShell; class SwInsertIdxMarkWrapper final : public SfxChildWindow { - ScopedVclPtr<AbstractMarkFloatDlg> pAbstDlg; + ScopedVclPtr<AbstractMarkFloatDlg> xAbstDlg; - SwInsertIdxMarkWrapper( vcl::Window *pParentWindow, - sal_uInt16 nId, - SfxBindings* pBindings, - SfxChildWinInfo* pInfo ); + SwInsertIdxMarkWrapper(vcl::Window *pParentWindow, + sal_uInt16 nId, + SfxBindings* pBindings, + SfxChildWinInfo* pInfo); SFX_DECL_CHILDWINDOW_WITHID(SwInsertIdxMarkWrapper); @@ -42,12 +42,12 @@ public: class SwInsertAuthMarkWrapper final : public SfxChildWindow { - ScopedVclPtr<AbstractMarkFloatDlg> pAbstDlg; + ScopedVclPtr<AbstractMarkFloatDlg> xAbstDlg; - SwInsertAuthMarkWrapper( vcl::Window *pParentWindow, + SwInsertAuthMarkWrapper(vcl::Window *pParentWindow, sal_uInt16 nId, SfxBindings* pBindings, - SfxChildWinInfo* pInfo ); + SfxChildWinInfo* pInfo); SFX_DECL_CHILDWINDOW_WITHID(SwInsertAuthMarkWrapper); diff --git a/sw/source/uibase/inc/swuiidxmrk.hxx b/sw/source/uibase/inc/swuiidxmrk.hxx index f04c5eefe399..f95ace96ae5c 100644 --- a/sw/source/uibase/inc/swuiidxmrk.hxx +++ b/sw/source/uibase/inc/swuiidxmrk.hxx @@ -47,45 +47,10 @@ class SwIndexMarkModalDlg; class SwIndexMarkPane { - Dialog& m_rDialog; + std::shared_ptr<weld::Dialog> m_xDialog; friend class SwIndexMarkFloatDlg; friend class SwIndexMarkModalDlg; - VclPtr<VclFrame> m_pFrame; - VclPtr<FixedText> m_pTypeFT; - VclPtr<ListBox> m_pTypeDCB; - VclPtr<PushButton> m_pNewBT; - - VclPtr<Edit> m_pEntryED; - VclPtr<PushButton> m_pSyncED; - VclPtr<FixedText> m_pPhoneticFT0; - VclPtr<Edit> m_pPhoneticED0; - - VclPtr<FixedText> m_pKey1FT; - VclPtr<ComboBox> m_pKey1DCB; - VclPtr<FixedText> m_pPhoneticFT1; - VclPtr<Edit> m_pPhoneticED1; - - VclPtr<FixedText> m_pKey2FT; - VclPtr<ComboBox> m_pKey2DCB; - VclPtr<FixedText> m_pPhoneticFT2; - VclPtr<Edit> m_pPhoneticED2; - - VclPtr<FixedText> m_pLevelFT; - VclPtr<NumericField> m_pLevelNF; - VclPtr<CheckBox> m_pMainEntryCB; - VclPtr<CheckBox> m_pApplyToAllCB; - VclPtr<CheckBox> m_pSearchCaseSensitiveCB; - VclPtr<CheckBox> m_pSearchCaseWordOnlyCB; - - VclPtr<PushButton> m_pOKBT; - VclPtr<CloseButton> m_pCloseBT; - VclPtr<PushButton> m_pDelBT; - - VclPtr<PushButton> m_pPrevSameBT; - VclPtr<PushButton> m_pNextSameBT; - VclPtr<PushButton> m_pPrevBT; - VclPtr<PushButton> m_pNextBT; OUString m_aOrgStr; bool m_bDel; @@ -104,26 +69,56 @@ class SwIndexMarkPane m_pTOXMgr; SwWrtShell* m_pSh; + std::unique_ptr<weld::Widget> m_xFrame; + std::unique_ptr<weld::Label> m_xTypeFT; + std::unique_ptr<weld::ComboBox> m_xTypeDCB; + std::unique_ptr<weld::Button> m_xNewBT; + std::unique_ptr<weld::Entry> m_xEntryED; + std::unique_ptr<weld::Button> m_xSyncED; + std::unique_ptr<weld::Label> m_xPhoneticFT0; + std::unique_ptr<weld::Entry> m_xPhoneticED0; + std::unique_ptr<weld::Label> m_xKey1FT; + std::unique_ptr<weld::ComboBox> m_xKey1DCB; + std::unique_ptr<weld::Label> m_xPhoneticFT1; + std::unique_ptr<weld::Entry> m_xPhoneticED1; + std::unique_ptr<weld::Label> m_xKey2FT; + std::unique_ptr<weld::ComboBox> m_xKey2DCB; + std::unique_ptr<weld::Label> m_xPhoneticFT2; + std::unique_ptr<weld::Entry> m_xPhoneticED2; + std::unique_ptr<weld::Label> m_xLevelFT; + std::unique_ptr<weld::SpinButton> m_xLevelNF; + std::unique_ptr<weld::CheckButton> m_xMainEntryCB; + std::unique_ptr<weld::CheckButton> m_xApplyToAllCB; + std::unique_ptr<weld::CheckButton> m_xSearchCaseSensitiveCB; + std::unique_ptr<weld::CheckButton> m_xSearchCaseWordOnlyCB; + std::unique_ptr<weld::Button> m_xOKBT; + std::unique_ptr<weld::Button> m_xCloseBT; + std::unique_ptr<weld::Button> m_xDelBT; + std::unique_ptr<weld::Button> m_xPrevSameBT; + std::unique_ptr<weld::Button> m_xNextSameBT; + std::unique_ptr<weld::Button> m_xPrevBT; + std::unique_ptr<weld::Button> m_xNextBT; + void Apply(); void InitControls(); void InsertMark(); void UpdateMark(); - DECL_LINK( InsertHdl, Button *, void ); - DECL_LINK( CloseHdl, Button*, void ); - DECL_LINK( SyncSelectionHdl, Button*, void ); - DECL_LINK( DelHdl, Button*, void ); - DECL_LINK( NextHdl, Button*, void ); - DECL_LINK( NextSameHdl, Button*, void ); - DECL_LINK( PrevHdl, Button*, void ); - DECL_LINK( PrevSameHdl, Button*, void ); - DECL_LINK( ModifyListBoxHdl, ListBox&, void ); - DECL_LINK( ModifyEditHdl, Edit&, void ); - void ModifyHdl(Control const *); - DECL_LINK( KeyDCBModifyHdl, Edit&, void ); - DECL_LINK( NewUserIdxHdl, Button*, void ); - DECL_LINK( SearchTypeHdl, Button*, void ); - DECL_LINK( PhoneticEDModifyHdl, Edit&, void ); + DECL_LINK(InsertHdl, weld::Button&, void); + DECL_LINK(CloseHdl, weld::Button&, void); + DECL_LINK(SyncSelectionHdl, weld::Button&, void); + DECL_LINK(DelHdl, weld::Button&, void); + DECL_LINK( NextHdl, weld::Button&, void ); + DECL_LINK( NextSameHdl, weld::Button&, void ); + DECL_LINK( PrevHdl, weld::Button&, void ); + DECL_LINK( PrevSameHdl, weld::Button&, void ); + DECL_LINK( ModifyListBoxHdl, weld::ComboBox&, void ); + DECL_LINK( ModifyEditHdl, weld::Entry&, void ); + void ModifyHdl(const weld::Widget& rWidget); + DECL_LINK( KeyDCBModifyHdl, weld::ComboBox&, void ); + DECL_LINK( NewUserIdxHdl, weld::Button&, void ); + DECL_LINK( SearchTypeHdl, weld::ToggleButton&, void ); + DECL_LINK( PhoneticEDModifyHdl, weld::Entry&, void ); //this method updates the values from 'nLangForPhoneticReading' and 'bIsPhoneticReadingEnabled' //it needs to be called ones if this dialog is opened to create a new entry (in InitControls), @@ -140,97 +135,41 @@ class SwIndexMarkPane public: - SwIndexMarkPane(Dialog &rDialog, - bool bNewDlg, - SwWrtShell& rWrtShell); - - weld::Window* GetFrameWeld() { return m_rDialog.GetFrameWeld(); } + SwIndexMarkPane(const std::shared_ptr<weld::Dialog>& rDialog, weld::Builder& rBuilder, + bool bNewDlg, SwWrtShell& rWrtShell); ~SwIndexMarkPane(); void ReInitDlg(SwWrtShell& rWrtShell, SwTOXMark const * pCurTOXMark = nullptr); - bool IsTOXType(const OUString& rName) - {return LISTBOX_ENTRY_NOTFOUND != m_pTypeDCB->GetEntryPos(rName);} + bool IsTOXType(const OUString& rName) { return m_xTypeDCB->find_text(rName) != -1; } }; -class SwIndexMarkFloatDlg : public SfxModelessDialog +class SwIndexMarkFloatDlg : public SfxModelessDialogController { SwIndexMarkPane m_aContent; + virtual void Activate() override; public: - SwIndexMarkFloatDlg( SfxBindings* pBindings, - SfxChildWindow* pChild, - vcl::Window *pParent, - SfxChildWinInfo const * pInfo, - bool bNew); + SwIndexMarkFloatDlg(SfxBindings* pBindings, + SfxChildWindow* pChild, + weld::Window *pParent, + SfxChildWinInfo const * pInfo, + bool bNew); void ReInitDlg(SwWrtShell& rWrtShell); }; -class SwIndexMarkModalDlg : public SvxStandardDialog +class SwIndexMarkModalDlg : public SfxDialogController { SwIndexMarkPane m_aContent; public: - SwIndexMarkModalDlg(vcl::Window *pParent, SwWrtShell& rSh, SwTOXMark const * pCurTOXMark); - - virtual void Apply() override; - virtual void dispose() override; + SwIndexMarkModalDlg(weld::Window *pParent, SwWrtShell& rSh, SwTOXMark const * pCurTOXMark); + virtual short int run() override; }; class SwAuthMarkModalDlg; class SwAuthorMarkPane { - Dialog& m_rDialog; - - static bool bIsFromComponent; - - friend class SwAuthMarkModalDlg; - friend class SwAuthMarkFloatDlg; - - VclPtr<RadioButton> m_pFromComponentRB; - VclPtr<RadioButton> m_pFromDocContentRB; - VclPtr<FixedText> m_pAuthorFI; - VclPtr<FixedText> m_pTitleFI; - VclPtr<Edit> m_pEntryED; - VclPtr<ListBox> m_pEntryLB; - - VclPtr<PushButton> m_pActionBT; - VclPtr<CloseButton> m_pCloseBT; - VclPtr<PushButton> m_pCreateEntryPB; - VclPtr<PushButton> m_pEditEntryPB; - - bool const bNewEntry; - bool bBibAccessInitialized; - - SwWrtShell* pSh; - - OUString m_sColumnTitles[AUTH_FIELD_END]; - OUString m_sFields[AUTH_FIELD_END]; - - OUString m_sCreatedEntry[AUTH_FIELD_END]; - - css::uno::Reference< css::container::XNameAccess > xBibAccess; - - DECL_LINK(InsertHdl, Button*, void); - DECL_LINK(CloseHdl, Button*, void); - DECL_LINK(CreateEntryHdl, Button*, void); - DECL_LINK(CompEntryHdl, ListBox&, void); - DECL_LINK(ChangeSourceHdl, Button*, void); - DECL_LINK(IsEditAllowedHdl, Edit*, bool); - DECL_LINK(IsEntryAllowedHdl, weld::Entry&, bool); - DECL_LINK(EditModifyHdl, Edit&, void); - - void InitControls(); - void Activate(); - -public: - SwAuthorMarkPane( Dialog &rDialog, bool bNew); - - void ReInitDlg(SwWrtShell& rWrtShell); -}; - -class AuthorMarkPane -{ weld::DialogController& m_rDialog; static bool bIsFromComponent; @@ -271,33 +210,33 @@ class AuthorMarkPane DECL_LINK(EditModifyHdl, weld::Entry&, void); void InitControls(); + void Activate(); public: - AuthorMarkPane(weld::DialogController& rDialog, weld::Builder& rBuilder, bool bNew); - - void ReInitDlg(SwWrtShell& rWrtShell); + SwAuthorMarkPane(weld::DialogController& rDialog, weld::Builder& rBuilder, bool bNew); + void ReInitDlg(SwWrtShell& rWrtShell); }; -class SwAuthMarkFloatDlg : public SfxModelessDialog +class SwAuthMarkFloatDlg : public SfxModelessDialogController { SwAuthorMarkPane m_aContent; virtual void Activate() override; public: - SwAuthMarkFloatDlg( SfxBindings* pBindings, - SfxChildWindow* pChild, - vcl::Window *pParent, - SfxChildWinInfo const * pInfo, - bool bNew); + SwAuthMarkFloatDlg(SfxBindings* pBindings, + SfxChildWindow* pChild, + weld::Window *pParent, + SfxChildWinInfo const * pInfo, + bool bNew); void ReInitDlg(SwWrtShell& rWrtShell); }; class SwAuthMarkModalDlg : public SfxDialogController { - AuthorMarkPane m_aContent; + SwAuthorMarkPane m_aContent; + void Apply(); public: SwAuthMarkModalDlg(weld::Window *pParent, SwWrtShell& rSh); - virtual short int run() override; }; |