summaryrefslogtreecommitdiff
path: root/editeng
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2019-02-19 19:51:18 +0000
committerCaolán McNamara <caolanm@redhat.com>2019-02-21 13:20:55 +0100
commitb1f4bc27c0a6ec868bcce969f87aaf8ffc8b9d1f (patch)
treecda252baa6862079e6b912226c3bb18cb1d9ba79 /editeng
parent3d31e57fba29d3bf852abafad16f840adcfb33d9 (diff)
weld HangulHanjaConversionDialog
Change-Id: Ia41f1a03581a0a48d59706ac5b3c569fc39c7f4d Reviewed-on: https://gerrit.libreoffice.org/68099 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'editeng')
-rw-r--r--editeng/source/editeng/impedit4.cxx2
-rw-r--r--editeng/source/editeng/textconv.cxx12
-rw-r--r--editeng/source/editeng/textconv.hxx4
-rw-r--r--editeng/source/misc/hangulhanja.cxx42
4 files changed, 27 insertions, 33 deletions
diff --git a/editeng/source/editeng/impedit4.cxx b/editeng/source/editeng/impedit4.cxx
index 2ac00ef7481c..b26d2856ceee 100644
--- a/editeng/source/editeng/impedit4.cxx
+++ b/editeng/source/editeng/impedit4.cxx
@@ -1556,7 +1556,7 @@ void ImpEditEngine::Convert( EditView* pEditView,
else if ( CreateEPaM( aEditDoc.GetStartPaM() ) == pConvInfo->aConvStart )
bIsStart = true;
- TextConvWrapper aWrp( Application::GetDefDialogParent(),
+ TextConvWrapper aWrp( pEditView->GetWindow()->GetFrameWeld(),
::comphelper::getProcessComponentContext(),
LanguageTag::convertToLocale( nSrcLang ),
LanguageTag::convertToLocale( nDestLang ),
diff --git a/editeng/source/editeng/textconv.cxx b/editeng/source/editeng/textconv.cxx
index 7b544edafb3c..b4bb23e9af77 100644
--- a/editeng/source/editeng/textconv.cxx
+++ b/editeng/source/editeng/textconv.cxx
@@ -28,15 +28,14 @@
#include <editeng/fontitem.hxx>
#include "textconv.hxx"
#include <osl/diagnose.h>
-
+#include <vcl/weld.hxx>
using namespace com::sun::star;
using namespace com::sun::star::uno;
using namespace com::sun::star::beans;
using namespace com::sun::star::linguistic2;
-
-TextConvWrapper::TextConvWrapper( vcl::Window* pWindow,
+TextConvWrapper::TextConvWrapper( weld::Window* pWindow,
const Reference< XComponentContext >& rxContext,
const lang::Locale& rSourceLocale,
const lang::Locale& rTargetLocale,
@@ -110,22 +109,17 @@ bool TextConvWrapper::ConvNext_impl()
return false;
}
-
void TextConvWrapper::FindConvText_impl()
{
// modified version of SvxSpellWrapper::FindSpellError
-
- m_pWin->EnterWait();
-
+ weld::WaitObject aWait(m_pWin);
while ( true )
{
if (ConvContinue_impl() || !ConvNext_impl())
break;
}
- m_pWin->LeaveWait();
}
-
bool TextConvWrapper::ConvMore_impl()
{
// modified version of SvxSpellWrapper::SpellMore
diff --git a/editeng/source/editeng/textconv.hxx b/editeng/source/editeng/textconv.hxx
index d7b6ff10ae8d..f4873dd26c08 100644
--- a/editeng/source/editeng/textconv.hxx
+++ b/editeng/source/editeng/textconv.hxx
@@ -40,7 +40,7 @@ class TextConvWrapper final : public editeng::HangulHanjaConversion
// starts from the cursor position
EditView * m_pEditView;
- VclPtr<vcl::Window> m_pWin;
+ weld::Window * m_pWin;
bool m_bStartChk;
bool m_bStartDone;
@@ -92,7 +92,7 @@ class TextConvWrapper final : public editeng::HangulHanjaConversion
public:
- TextConvWrapper( vcl::Window* pWindow,
+ TextConvWrapper(weld::Window* pWindow,
const css::uno::Reference< css::uno::XComponentContext >& rxContext,
const css::lang::Locale& rSourceLocale,
const css::lang::Locale& rTargetLocale,
diff --git a/editeng/source/misc/hangulhanja.cxx b/editeng/source/misc/hangulhanja.cxx
index 3dff20212179..107d30e4441d 100644
--- a/editeng/source/misc/hangulhanja.cxx
+++ b/editeng/source/misc/hangulhanja.cxx
@@ -69,7 +69,7 @@ namespace editeng
// general
VclPtr<AbstractHangulHanjaConversionDialog>
m_pConversionDialog; // the dialog to display for user interaction
- VclPtr<vcl::Window> m_pUIParent; // the parent window for any UI we raise
+ weld::Window* m_pUIParent; // the parent window for any UI we raise
Reference< XComponentContext >
m_xContext; // the service factory to use
Reference< XExtendedTextConversion >
@@ -119,7 +119,7 @@ namespace editeng
public:
HangulHanjaConversion_Impl(
- vcl::Window* _pUIParent,
+ weld::Window* pUIParent,
const Reference< XComponentContext >& rxContext,
const lang::Locale& _rSourceLocale,
const lang::Locale& _rTargetLocale,
@@ -151,13 +151,13 @@ namespace editeng
private:
DECL_LINK( OnOptionsChanged, LinkParamNone*, void );
- DECL_LINK( OnIgnore, Button*, void );
- DECL_LINK( OnIgnoreAll, Button*, void );
- DECL_LINK( OnChange, Button*, void );
- DECL_LINK( OnChangeAll, Button*, void );
- DECL_LINK( OnByCharClicked, CheckBox*, void );
- DECL_LINK( OnConversionTypeChanged, Button*, void );
- DECL_LINK( OnFind, Button*, void );
+ DECL_LINK( OnIgnore, weld::Button&, void );
+ DECL_LINK( OnIgnoreAll, weld::Button&, void );
+ DECL_LINK( OnChange, weld::Button&, void );
+ DECL_LINK( OnChangeAll, weld::Button&, void );
+ DECL_LINK( OnByCharClicked, weld::ToggleButton&, void );
+ DECL_LINK( OnConversionTypeChanged, weld::Button&, void );
+ DECL_LINK( OnFind, weld::Button&, void );
/** proceed, after the current convertible has been handled
@@ -227,7 +227,7 @@ namespace editeng
HangulHanjaConversion_Impl::StringMap HangulHanjaConversion_Impl::m_aRecentlyUsedList = HangulHanjaConversion_Impl::StringMap();
- HangulHanjaConversion_Impl::HangulHanjaConversion_Impl( vcl::Window* _pUIParent,
+ HangulHanjaConversion_Impl::HangulHanjaConversion_Impl( weld::Window* pUIParent,
const Reference< XComponentContext >& rxContext,
const lang::Locale& _rSourceLocale,
const lang::Locale& _rTargetLocale,
@@ -236,7 +236,7 @@ namespace editeng
bool _bIsInteractive,
HangulHanjaConversion* _pAntiImpl )
: m_pConversionDialog()
- , m_pUIParent( _pUIParent )
+ , m_pUIParent( pUIParent )
, m_xContext( rxContext )
, m_aSourceLocale( _rSourceLocale )
, m_nSourceLang( LanguageTag::convertToLanguageType( _rSourceLocale ) )
@@ -811,13 +811,13 @@ namespace editeng
implUpdateData();
}
- IMPL_LINK_NOARG(HangulHanjaConversion_Impl, OnIgnore, Button*, void)
+ IMPL_LINK_NOARG(HangulHanjaConversion_Impl, OnIgnore, weld::Button&, void)
{
// simply ignore, and proceed
implProceed( false );
}
- IMPL_LINK_NOARG(HangulHanjaConversion_Impl, OnIgnoreAll, Button*, void)
+ IMPL_LINK_NOARG(HangulHanjaConversion_Impl, OnIgnoreAll, weld::Button&, void)
{
DBG_ASSERT( m_pConversionDialog, "HangulHanjaConversion_Impl::OnIgnoreAll: no dialog! How this?" );
@@ -835,7 +835,7 @@ namespace editeng
}
}
- IMPL_LINK_NOARG(HangulHanjaConversion_Impl, OnChange, Button*, void)
+ IMPL_LINK_NOARG(HangulHanjaConversion_Impl, OnChange, weld::Button&, void)
{
// change
DBG_ASSERT( m_pConversionDialog, "we should always have a dialog here!" );
@@ -845,7 +845,7 @@ namespace editeng
implProceed( false );
}
- IMPL_LINK_NOARG(HangulHanjaConversion_Impl, OnChangeAll, Button*, void)
+ IMPL_LINK_NOARG(HangulHanjaConversion_Impl, OnChangeAll, weld::Button&, void)
{
DBG_ASSERT( m_pConversionDialog, "HangulHanjaConversion_Impl::OnChangeAll: no dialog! How this?" );
if ( m_pConversionDialog )
@@ -867,22 +867,22 @@ namespace editeng
}
}
- IMPL_LINK( HangulHanjaConversion_Impl, OnByCharClicked, CheckBox*, _pBox, void )
+ IMPL_LINK(HangulHanjaConversion_Impl, OnByCharClicked, weld::ToggleButton&, rBox, void)
{
- m_bByCharacter = _pBox->IsChecked();
+ m_bByCharacter = rBox.get_active();
// continue conversion, without advancing to the next unit, but instead continuing with the current unit
implProceed( true );
}
- IMPL_LINK_NOARG(HangulHanjaConversion_Impl, OnConversionTypeChanged, Button*, void)
+ IMPL_LINK_NOARG(HangulHanjaConversion_Impl, OnConversionTypeChanged, weld::Button&, void)
{
DBG_ASSERT( m_pConversionDialog, "we should always have a dialog here!" );
if( m_pConversionDialog )
m_eConversionFormat = m_pConversionDialog->GetConversionFormat( );
}
- IMPL_LINK_NOARG(HangulHanjaConversion_Impl, OnFind, Button*, void)
+ IMPL_LINK_NOARG(HangulHanjaConversion_Impl, OnFind, weld::Button&, void)
{
DBG_ASSERT( m_pConversionDialog, "HangulHanjaConversion_Impl::OnFind: where did this come from?" );
if ( m_pConversionDialog )
@@ -944,12 +944,12 @@ namespace editeng
bool HangulHanjaConversion::m_bTryBothDirectionsSave = false;
HHC::ConversionDirection HangulHanjaConversion::m_ePrimaryConversionDirectionSave = HHC::eHangulToHanja;
- HangulHanjaConversion::HangulHanjaConversion( vcl::Window* _pUIParent,
+ HangulHanjaConversion::HangulHanjaConversion( weld::Window* pUIParent,
const Reference< XComponentContext >& rxContext,
const lang::Locale& _rSourceLocale, const lang::Locale& _rTargetLocale,
const vcl::Font* _pTargetFont,
sal_Int32 _nOptions, bool _bIsInteractive)
- :m_pImpl( new HangulHanjaConversion_Impl( _pUIParent, rxContext, _rSourceLocale, _rTargetLocale, _pTargetFont, _nOptions, _bIsInteractive, this ) )
+ :m_pImpl( new HangulHanjaConversion_Impl( pUIParent, rxContext, _rSourceLocale, _rTargetLocale, _pTargetFont, _nOptions, _bIsInteractive, this ) )
{
}