diff options
author | Caolán McNamara <caolanm@redhat.com> | 2018-09-19 13:47:11 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2018-09-20 09:56:54 +0200 |
commit | 41db073808566641a3c364e6490f33b7f204d0b0 (patch) | |
tree | 56748a1212bf2f2f049a47d8815d15224aee34d4 /cui | |
parent | da9a539999fc8ae47a78542ce646005f3a9be868 (diff) |
weld SvxHyphenWordDialog
Change-Id: If92d57c5c807a7fc04fe66a748aa385c558be664
Reviewed-on: https://gerrit.libreoffice.org/60774
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'cui')
-rw-r--r-- | cui/source/dialogs/hyphen.cxx | 188 | ||||
-rw-r--r-- | cui/source/factory/dlgfact.cxx | 19 | ||||
-rw-r--r-- | cui/source/factory/dlgfact.hxx | 14 | ||||
-rw-r--r-- | cui/source/inc/hyphen.hxx | 57 | ||||
-rw-r--r-- | cui/uiconfig/ui/hyphenate.ui | 17 |
5 files changed, 141 insertions, 154 deletions
diff --git a/cui/source/dialogs/hyphen.cxx b/cui/source/dialogs/hyphen.cxx index ba55b4c3bc26..c519f755e3d6 100644 --- a/cui/source/dialogs/hyphen.cxx +++ b/cui/source/dialogs/hyphen.cxx @@ -33,49 +33,31 @@ using namespace css; -HyphenEdit::HyphenEdit(vcl::Window* pParent) - : Edit(pParent, WB_LEFT|WB_VCENTER|WB_BORDER|WB_3DLOOK|WB_TABSTOP) +IMPL_LINK_NOARG(SvxHyphenWordDialog, CursorChangeHdl_Impl, weld::Entry&, void) { + int nStart, nEnd; + m_xWordEdit->get_selection_bounds(nStart, nEnd); + if (nStart == m_nOldPos && nEnd == m_nOldPos + 1) + return; + bool bReSelect; + if (nStart <= m_nOldPos) + bReSelect = !SelLeft(); + else + bReSelect = !SelRight(); + if (bReSelect) + select_region(m_nOldPos, m_nOldPos + 1); } -VCL_BUILDER_FACTORY(HyphenEdit) - -void HyphenEdit::KeyInput( const KeyEvent& rKEvt ) -{ - sal_uInt16 nCode = rKEvt.GetKeyCode().GetCode(); - - switch ( nCode ) - { - case KEY_LEFT: - static_cast<SvxHyphenWordDialog*>( GetParentDialog() )->SelLeft(); - break; - - case KEY_RIGHT: - static_cast<SvxHyphenWordDialog*>( GetParentDialog() )->SelRight(); - break; - - case KEY_TAB: - case KEY_ESCAPE: - case KEY_RETURN: - Edit::KeyInput(rKEvt); - break; - default: - Control::KeyInput( rKEvt ); // pass on to the dialog - break; - } -} - - void SvxHyphenWordDialog::EnableLRBtn_Impl() { const sal_Int32 nLen = m_aEditWord.getLength(); - m_pRightBtn->Disable(); + m_xRightBtn->set_sensitive(false); for ( sal_Int32 i = m_nOldPos + 2; i < nLen; ++i ) { if ( m_aEditWord[ i ] == sal_Unicode( HYPH_POS_CHAR ) ) { - m_pRightBtn->Enable(); + m_xRightBtn->set_sensitive(true); break; } } @@ -83,18 +65,17 @@ void SvxHyphenWordDialog::EnableLRBtn_Impl() DBG_ASSERT(m_nOldPos < nLen, "nOldPos out of range"); if (m_nOldPos >= nLen) m_nOldPos = nLen - 1; - m_pLeftBtn->Disable(); + m_xLeftBtn->set_sensitive(false); for ( sal_Int32 i = m_nOldPos; i-- > 0; ) { if ( m_aEditWord[ i ] == sal_Unicode( HYPH_POS_CHAR ) ) { - m_pLeftBtn->Enable(); + m_xLeftBtn->set_sensitive(true); break; } } } - OUString SvxHyphenWordDialog::EraseUnusableHyphens_Impl() { // returns a String showing only those hyphen positions which will result @@ -195,7 +176,6 @@ OUString SvxHyphenWordDialog::EraseUnusableHyphens_Impl() return aTxt; } - void SvxHyphenWordDialog::InitControls_Impl() { m_xPossHyph = nullptr; @@ -207,14 +187,13 @@ void SvxHyphenWordDialog::InitControls_Impl() if (m_xPossHyph.is()) m_aEditWord = EraseUnusableHyphens_Impl(); } - m_pWordEdit->SetText( m_aEditWord ); + m_xWordEdit->set_text(m_aEditWord); m_nOldPos = m_aEditWord.getLength(); SelLeft(); EnableLRBtn_Impl(); } - void SvxHyphenWordDialog::ContinueHyph_Impl( sal_Int32 nInsPos ) { if ( nInsPos >= 0 && m_xPossHyph.is() ) @@ -266,14 +245,14 @@ void SvxHyphenWordDialog::ContinueHyph_Impl( sal_Int32 nInsPos ) } else { - m_pCloseBtn->Disable(); - EndDialog(RET_OK); + m_xCloseBtn->set_sensitive(false); + m_xDialog->response(RET_OK); } } - -void SvxHyphenWordDialog::SelLeft() +bool SvxHyphenWordDialog::SelLeft() { + bool bRet = false; DBG_ASSERT( m_nOldPos > 0, "invalid hyphenation position" ); if (m_nOldPos > 0) { @@ -286,19 +265,21 @@ void SvxHyphenWordDialog::SelLeft() aTxt = aTxt.replaceAt( i, 1, OUString( CUR_HYPH_POS_CHAR ) ); m_nOldPos = i; - m_pWordEdit->SetText( aTxt ); - m_pWordEdit->GrabFocus(); - m_pWordEdit->SetSelection( Selection( i, i + 1 ) ); + m_xWordEdit->set_text(aTxt); + select_region(i, i + 1); + m_xWordEdit->grab_focus(); + bRet = true; break; } } EnableLRBtn_Impl(); } + return bRet; } - -void SvxHyphenWordDialog::SelRight() +bool SvxHyphenWordDialog::SelRight() { + bool bRet = false; OUString aTxt( m_aEditWord ); for ( sal_Int32 i = m_nOldPos + 1; i < aTxt.getLength(); ++i ) { @@ -307,17 +288,18 @@ void SvxHyphenWordDialog::SelRight() aTxt = aTxt.replaceAt( i, 1, OUString( CUR_HYPH_POS_CHAR ) ); m_nOldPos = i; - m_pWordEdit->SetText( aTxt ); - m_pWordEdit->GrabFocus(); - m_pWordEdit->SetSelection( Selection( i, i + 1 ) ); + m_xWordEdit->set_text(aTxt); + select_region(i, i + 1); + m_xWordEdit->grab_focus(); + bRet = true; break; } } EnableLRBtn_Impl(); + return bRet; } - -IMPL_LINK_NOARG(SvxHyphenWordDialog, CutHdl_Impl, Button*, void) +IMPL_LINK_NOARG(SvxHyphenWordDialog, CutHdl_Impl, weld::Button&, void) { if( !m_bBusy ) { @@ -327,8 +309,7 @@ IMPL_LINK_NOARG(SvxHyphenWordDialog, CutHdl_Impl, Button*, void) } } - -IMPL_LINK_NOARG( SvxHyphenWordDialog, HyphenateAllHdl_Impl, Button *, void ) +IMPL_LINK_NOARG(SvxHyphenWordDialog, HyphenateAllHdl_Impl, weld::Button&, void) { if( !m_bBusy ) { @@ -351,8 +332,7 @@ IMPL_LINK_NOARG( SvxHyphenWordDialog, HyphenateAllHdl_Impl, Button *, void ) } } - -IMPL_LINK_NOARG(SvxHyphenWordDialog, DeleteHdl_Impl, Button*, void) +IMPL_LINK_NOARG(SvxHyphenWordDialog, DeleteHdl_Impl, weld::Button&, void) { if( !m_bBusy ) { @@ -362,8 +342,7 @@ IMPL_LINK_NOARG(SvxHyphenWordDialog, DeleteHdl_Impl, Button*, void) } } - -IMPL_LINK_NOARG(SvxHyphenWordDialog, ContinueHdl_Impl, Button*, void) +IMPL_LINK_NOARG(SvxHyphenWordDialog, ContinueHdl_Impl, weld::Button&, void) { if( !m_bBusy ) { @@ -373,19 +352,17 @@ IMPL_LINK_NOARG(SvxHyphenWordDialog, ContinueHdl_Impl, Button*, void) } } - -IMPL_LINK_NOARG(SvxHyphenWordDialog, CancelHdl_Impl, Button*, void) +IMPL_LINK_NOARG(SvxHyphenWordDialog, CancelHdl_Impl, weld::Button&, void) { if( !m_bBusy ) { m_bBusy = true; - EndDialog(); + m_xDialog->response(RET_CANCEL); m_bBusy = false; } } - -IMPL_LINK_NOARG(SvxHyphenWordDialog, Left_Impl, Button*, void) +IMPL_LINK_NOARG(SvxHyphenWordDialog, Left_Impl, weld::Button&, void) { if( !m_bBusy ) { @@ -395,8 +372,7 @@ IMPL_LINK_NOARG(SvxHyphenWordDialog, Left_Impl, Button*, void) } } - -IMPL_LINK_NOARG(SvxHyphenWordDialog, Right_Impl, Button*, void) +IMPL_LINK_NOARG(SvxHyphenWordDialog, Right_Impl, weld::Button&, void) { if( !m_bBusy ) { @@ -406,21 +382,30 @@ IMPL_LINK_NOARG(SvxHyphenWordDialog, Right_Impl, Button*, void) } } - -IMPL_LINK_NOARG(SvxHyphenWordDialog, GetFocusHdl_Impl, Control&, void) +void SvxHyphenWordDialog::select_region(int nStart, int nEnd) { - m_pWordEdit->SetSelection( Selection( m_nOldPos, m_nOldPos + 1 ) ); + int nScrollPos = nStart + m_nWordEditWidth/2; + if (nScrollPos > m_aEditWord.getLength()) + nScrollPos = m_aEditWord.getLength() - m_nWordEditWidth/2; + if (nScrollPos < 0) + nScrollPos = 0; + m_xWordEdit->set_position(nScrollPos); + m_xWordEdit->select_region(nStart, nEnd); } +IMPL_LINK_NOARG(SvxHyphenWordDialog, GetFocusHdl_Impl, weld::Widget&, void) +{ + select_region(m_nOldPos, m_nOldPos + 1); +} // class SvxHyphenWordDialog --------------------------------------------- SvxHyphenWordDialog::SvxHyphenWordDialog( const OUString &rWord, LanguageType nLang, - vcl::Window* pParent, + weld::Window* pParent, uno::Reference< linguistic2::XHyphenator > const &xHyphen, SvxSpellWrapper* pWrapper) - : SfxModalDialog(pParent, "HyphenateDialog", "cui/ui/hyphenate.ui") + : weld::GenericDialogController(pParent, "cui/ui/hyphenate.ui", "HyphenateDialog") , m_pHyphWrapper(pWrapper) , m_aActWord(rWord) , m_nActLanguage(nLang) @@ -428,17 +413,17 @@ SvxHyphenWordDialog::SvxHyphenWordDialog( , m_nOldPos(0) , m_nHyphenationPositionsOffset(0) , m_bBusy(false) + , m_xWordEdit(m_xBuilder->weld_entry("worded")) + , m_xLeftBtn(m_xBuilder->weld_button("left")) + , m_xRightBtn(m_xBuilder->weld_button("right")) + , m_xOkBtn(m_xBuilder->weld_button("ok")) + , m_xContBtn(m_xBuilder->weld_button("continue")) + , m_xDelBtn(m_xBuilder->weld_button("delete")) + , m_xHyphAll(m_xBuilder->weld_button("hyphall")) + , m_xCloseBtn(m_xBuilder->weld_button("close")) { - get(m_pWordEdit, "worded"); - get(m_pLeftBtn, "left"); - get(m_pRightBtn, "right"); - get(m_pOkBtn, "ok"); - get(m_pContBtn, "continue"); - get(m_pDelBtn, "delete"); - get(m_pHyphAll, "hyphall"); - get(m_pCloseBtn, "close"); - - m_aLabel = GetText(); + m_nWordEditWidth = m_xWordEdit->get_width_chars(); + m_aLabel = m_xDialog->get_title(); m_xHyphenator = xHyphen; uno::Reference< linguistic2::XHyphenatedWord > xHyphWord( m_pHyphWrapper ? @@ -452,47 +437,34 @@ SvxHyphenWordDialog::SvxHyphenWordDialog( } InitControls_Impl(); - m_pWordEdit->GrabFocus(); - - m_pLeftBtn->SetClickHdl( LINK( this, SvxHyphenWordDialog, Left_Impl ) ); - m_pRightBtn->SetClickHdl( LINK( this, SvxHyphenWordDialog, Right_Impl ) ); - m_pOkBtn->SetClickHdl( LINK( this, SvxHyphenWordDialog, CutHdl_Impl ) ); - m_pContBtn->SetClickHdl( LINK( this, SvxHyphenWordDialog, ContinueHdl_Impl ) ); - m_pDelBtn->SetClickHdl( LINK( this, SvxHyphenWordDialog, DeleteHdl_Impl ) ); - m_pHyphAll->SetClickHdl( LINK( this, SvxHyphenWordDialog, HyphenateAllHdl_Impl ) ); - m_pCloseBtn->SetClickHdl( LINK( this, SvxHyphenWordDialog, CancelHdl_Impl ) ); - m_pWordEdit->SetGetFocusHdl( LINK( this, SvxHyphenWordDialog, GetFocusHdl_Impl ) ); + m_xWordEdit->grab_focus(); + + m_xLeftBtn->connect_clicked( LINK( this, SvxHyphenWordDialog, Left_Impl ) ); + m_xRightBtn->connect_clicked( LINK( this, SvxHyphenWordDialog, Right_Impl ) ); + m_xOkBtn->connect_clicked( LINK( this, SvxHyphenWordDialog, CutHdl_Impl ) ); + m_xContBtn->connect_clicked( LINK( this, SvxHyphenWordDialog, ContinueHdl_Impl ) ); + m_xDelBtn->connect_clicked( LINK( this, SvxHyphenWordDialog, DeleteHdl_Impl ) ); + m_xHyphAll->connect_clicked( LINK( this, SvxHyphenWordDialog, HyphenateAllHdl_Impl ) ); + m_xCloseBtn->connect_clicked( LINK( this, SvxHyphenWordDialog, CancelHdl_Impl ) ); + m_xWordEdit->connect_focus_in( LINK( this, SvxHyphenWordDialog, GetFocusHdl_Impl ) ); + m_xWordEdit->connect_cursor_position( LINK( this, SvxHyphenWordDialog, CursorChangeHdl_Impl ) ); SetWindowTitle( nLang ); // disable controls if service is not available if (!m_xHyphenator.is()) - Enable( false ); + m_xDialog->set_sensitive(false); } SvxHyphenWordDialog::~SvxHyphenWordDialog() { - disposeOnce(); -} - -void SvxHyphenWordDialog::dispose() -{ - if (m_pCloseBtn->IsEnabled()) + if (m_xCloseBtn->get_sensitive()) m_pHyphWrapper->SpellEnd(); - m_pWordEdit.clear(); - m_pLeftBtn.clear(); - m_pRightBtn.clear(); - m_pOkBtn.clear(); - m_pContBtn.clear(); - m_pDelBtn.clear(); - m_pHyphAll.clear(); - m_pCloseBtn.clear(); - SfxModalDialog::dispose(); } -void SvxHyphenWordDialog::SetWindowTitle( LanguageType nLang ) +void SvxHyphenWordDialog::SetWindowTitle(LanguageType nLang) { - SetText( m_aLabel + " (" + SvtLanguageTable::GetLanguageString( nLang ) + ")" ); + m_xDialog->set_title(m_aLabel + " (" + SvtLanguageTable::GetLanguageString(nLang) + ")"); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/cui/source/factory/dlgfact.cxx b/cui/source/factory/dlgfact.cxx index 2af171c3b6f2..fa44f29ac581 100644 --- a/cui/source/factory/dlgfact.cxx +++ b/cui/source/factory/dlgfact.cxx @@ -104,7 +104,12 @@ IMPL_ABSTDLG_BASE(CuiAbstractTabDialog_Impl); IMPL_ABSTDLG_BASE(AbstractSvxDistributeDialog_Impl); IMPL_ABSTDLG_BASE(AbstractHangulHanjaConversionDialog_Impl); IMPL_ABSTDLG_BASE(AbstractFmShowColsDialog_Impl); -IMPL_ABSTDLG_BASE(AbstractHyphenWordDialog_Impl) + +short AbstractHyphenWordDialog_Impl::Execute() +{ + return m_xDlg->run(); +} + IMPL_ABSTDLG_BASE(AbstractThesaurusDialog_Impl) short AbstractSvxZoomDialog_Impl::Execute() @@ -478,11 +483,6 @@ OUString AbstractThesaurusDialog_Impl::GetWord() return pDlg->GetWord(); }; -vcl::Window* AbstractHyphenWordDialog_Impl::GetWindow() -{ - return pDlg; -} - Reference < css::embed::XEmbeddedObject > AbstractInsertObjectDialog_Impl::GetObject() { return m_xDlg->GetObject(); @@ -1050,13 +1050,12 @@ VclPtr<AbstractThesaurusDialog> AbstractDialogFactory_Impl::CreateThesaurusDialo return VclPtr<AbstractThesaurusDialog_Impl>::Create( pDlg ); } -VclPtr<AbstractHyphenWordDialog> AbstractDialogFactory_Impl::CreateHyphenWordDialog( vcl::Window* pParent, +VclPtr<AbstractHyphenWordDialog> AbstractDialogFactory_Impl::CreateHyphenWordDialog(weld::Window* pParent, const OUString &rWord, LanguageType nLang, css::uno::Reference< css::linguistic2::XHyphenator > &xHyphen, - SvxSpellWrapper* pWrapper ) + SvxSpellWrapper* pWrapper) { - VclPtrInstance<SvxHyphenWordDialog> pDlg( rWord, nLang, pParent, xHyphen, pWrapper ); - return VclPtr<AbstractHyphenWordDialog_Impl>::Create( pDlg ); + return VclPtr<AbstractHyphenWordDialog_Impl>::Create(o3tl::make_unique<SvxHyphenWordDialog>(rWord, nLang, pParent, xHyphen, pWrapper)); } VclPtr<AbstractFmShowColsDialog> AbstractDialogFactory_Impl::CreateFmShowColsDialog() diff --git a/cui/source/factory/dlgfact.hxx b/cui/source/factory/dlgfact.hxx index 07b202371d26..55bcfa009b31 100644 --- a/cui/source/factory/dlgfact.hxx +++ b/cui/source/factory/dlgfact.hxx @@ -190,8 +190,14 @@ class AbstractThesaurusDialog_Impl : public AbstractThesaurusDialog class AbstractHyphenWordDialog_Impl: public AbstractHyphenWordDialog { - DECL_ABSTDLG_BASE(AbstractHyphenWordDialog_Impl,SvxHyphenWordDialog) - virtual vcl::Window* GetWindow() override; +protected: + std::unique_ptr<SvxHyphenWordDialog> m_xDlg; +public: + explicit AbstractHyphenWordDialog_Impl(std::unique_ptr<SvxHyphenWordDialog> p) + : m_xDlg(std::move(p)) + { + } + virtual short Execute() override; }; class FmShowColsDialog; @@ -680,10 +686,10 @@ public: virtual VclPtr<AbstractThesaurusDialog> CreateThesaurusDialog( vcl::Window*, css::uno::Reference< css::linguistic2::XThesaurus > xThesaurus, const OUString &rWord, LanguageType nLanguage ) override; - virtual VclPtr<AbstractHyphenWordDialog> CreateHyphenWordDialog( vcl::Window*, + virtual VclPtr<AbstractHyphenWordDialog> CreateHyphenWordDialog(weld::Window*, const OUString &rWord, LanguageType nLang, css::uno::Reference< css::linguistic2::XHyphenator > &xHyphen, - SvxSpellWrapper* pWrapper ) override; + SvxSpellWrapper* pWrapper) override; virtual VclPtr<AbstractFmShowColsDialog> CreateFmShowColsDialog() override; virtual VclPtr<AbstractSvxZoomDialog> CreateSvxZoomDialog(weld::Window* pParent, const SfxItemSet& rCoreSet) override; diff --git a/cui/source/inc/hyphen.hxx b/cui/source/inc/hyphen.hxx index 4e756c019c82..50b88db023d7 100644 --- a/cui/source/inc/hyphen.hxx +++ b/cui/source/inc/hyphen.hxx @@ -21,9 +21,7 @@ #include <memory> -#include <vcl/edit.hxx> -#include <vcl/button.hxx> -#include <vcl/fixed.hxx> +#include <vcl/weld.hxx> #include <sfx2/basedlgs.hxx> #include <com/sun/star/uno/Reference.hxx> #include <com/sun/star/linguistic2/XHyphenator.hpp> @@ -40,16 +38,8 @@ protected: virtual void KeyInput(const KeyEvent &rKEvt) override; }; -class SvxHyphenWordDialog : public SfxModalDialog +class SvxHyphenWordDialog : public weld::GenericDialogController { - VclPtr<HyphenEdit> m_pWordEdit; - VclPtr<PushButton> m_pLeftBtn; - VclPtr<PushButton> m_pRightBtn; - VclPtr<PushButton> m_pOkBtn; - VclPtr<PushButton> m_pContBtn; - VclPtr<PushButton> m_pDelBtn; - VclPtr<PushButton> m_pHyphAll; - VclPtr<CloseButton> m_pCloseBtn; OUString m_aLabel; SvxSpellWrapper *const m_pHyphWrapper; css::uno::Reference< css::linguistic2::XHyphenator > m_xHyphenator; @@ -60,37 +50,48 @@ class SvxHyphenWordDialog : public SfxModalDialog sal_Int16 m_nMaxHyphenationPos; // right most valid hyphenation pos sal_Int32 m_nOldPos; sal_Int32 m_nHyphenationPositionsOffset; + int m_nWordEditWidth; bool m_bBusy; + std::unique_ptr<weld::Entry> m_xWordEdit; + std::unique_ptr<weld::Button> m_xLeftBtn; + std::unique_ptr<weld::Button> m_xRightBtn; + std::unique_ptr<weld::Button> m_xOkBtn; + std::unique_ptr<weld::Button> m_xContBtn; + std::unique_ptr<weld::Button> m_xDelBtn; + std::unique_ptr<weld::Button> m_xHyphAll; + std::unique_ptr<weld::Button> m_xCloseBtn; + void EnableLRBtn_Impl(); OUString EraseUnusableHyphens_Impl(); void InitControls_Impl(); void ContinueHyph_Impl( sal_Int32 nInsPos = -1 ); // continue by default - DECL_LINK(Left_Impl, Button*, void); - DECL_LINK(Right_Impl, Button*, void); - DECL_LINK(CutHdl_Impl, Button*, void); - DECL_LINK(ContinueHdl_Impl, Button*, void); - DECL_LINK(DeleteHdl_Impl, Button*, void); - DECL_LINK( HyphenateAllHdl_Impl, Button*, void ); - DECL_LINK(CancelHdl_Impl, Button*, void); - DECL_LINK(GetFocusHdl_Impl, Control&, void); + void select_region(int nStart, int nEnd); + + DECL_LINK(Left_Impl, weld::Button&, void); + DECL_LINK(Right_Impl, weld::Button&, void); + DECL_LINK(CutHdl_Impl, weld::Button&, void); + DECL_LINK(ContinueHdl_Impl, weld::Button&, void); + DECL_LINK(DeleteHdl_Impl, weld::Button&, void); + DECL_LINK(HyphenateAllHdl_Impl, weld::Button&, void); + DECL_LINK(CancelHdl_Impl, weld::Button&, void); + DECL_LINK(GetFocusHdl_Impl, weld::Widget&, void); + DECL_LINK(CursorChangeHdl_Impl, weld::Entry&, void); public: - SvxHyphenWordDialog( const OUString &rWord, LanguageType nLang, - vcl::Window* pParent, - css::uno::Reference< css::linguistic2::XHyphenator > const &xHyphen, - SvxSpellWrapper* pWrapper ); + SvxHyphenWordDialog(const OUString &rWord, LanguageType nLang, + weld::Window* pParent, + css::uno::Reference<css::linguistic2::XHyphenator> const &xHyphen, + SvxSpellWrapper* pWrapper); virtual ~SvxHyphenWordDialog() override; - virtual void dispose() override; void SetWindowTitle( LanguageType nLang ); - void SelLeft(); - void SelRight(); + bool SelLeft(); + bool SelRight(); }; - #endif /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/cui/uiconfig/ui/hyphenate.ui b/cui/uiconfig/ui/hyphenate.ui index d097ccd27ead..ca2aee78fe40 100644 --- a/cui/uiconfig/ui/hyphenate.ui +++ b/cui/uiconfig/ui/hyphenate.ui @@ -1,8 +1,7 @@ <?xml version="1.0" encoding="UTF-8"?> -<!-- Generated with glade 3.18.3 --> +<!-- Generated with glade 3.22.1 --> <interface domain="cui"> <requires lib="gtk+" version="3.18"/> - <requires lib="LibreOffice" version="1.0"/> <object class="GtkImage" id="image1"> <property name="visible">True</property> <property name="can_focus">False</property> @@ -18,7 +17,13 @@ <property name="border_width">6</property> <property name="title" translatable="yes" context="hyphenate|HyphenateDialog">Hyphenation</property> <property name="resizable">False</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> @@ -98,6 +103,7 @@ <property name="label" translatable="yes" context="hyphenate|ok">Hyphenate</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> @@ -144,9 +150,10 @@ <object class="GtkLabel" id="label1"> <property name="visible">True</property> <property name="can_focus">False</property> - <property name="xalign">0</property> <property name="label" translatable="yes" context="hyphenate|label1">Word:</property> <property name="use_underline">True</property> + <property name="mnemonic_widget">worded</property> + <property name="xalign">0</property> </object> <packing> <property name="left_attach">0</property> @@ -162,10 +169,12 @@ <property name="row_spacing">6</property> <property name="column_spacing">12</property> <child> - <object class="cuilo-HyphenEdit" id="worded"> + <object class="GtkEntry" id="worded"> <property name="visible">True</property> <property name="can_focus">True</property> <property name="hexpand">True</property> + <property name="editable">False</property> + <property name="activates_default">True</property> <property name="width_chars">32</property> </object> <packing> |