summaryrefslogtreecommitdiff
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
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>
-rw-r--r--cui/source/dialogs/hangulhanjadlg.cxx689
-rw-r--r--cui/source/factory/dlgfact.cxx73
-rw-r--r--cui/source/factory/dlgfact.hxx25
-rw-r--r--cui/source/inc/hangulhanjadlg.hxx123
-rw-r--r--cui/source/inc/helpids.h1
-rw-r--r--cui/uiconfig/ui/hangulhanjaconversiondialog.ui362
-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
-rw-r--r--extras/source/glade/libreoffice-catalog.xml.in6
-rw-r--r--include/editeng/edtdlg.hxx17
-rw-r--r--include/editeng/hangulhanja.hxx2
-rw-r--r--include/svtools/valueset.hxx2
-rw-r--r--include/vcl/weld.hxx3
-rwxr-xr-xsolenv/bin/native-code.py2
-rw-r--r--solenv/gbuild/UIConfig.mk2
-rw-r--r--solenv/sanitizers/ui/cui.suppr9
-rw-r--r--svtools/source/control/valueimp.hxx1
-rw-r--r--svtools/source/control/valueset.cxx32
-rw-r--r--sw/source/uibase/lingu/hhcwrp.cxx2
-rw-r--r--vcl/source/app/salvtables.cxx28
-rw-r--r--vcl/unx/gtk3/gtk3gtkinst.cxx8
23 files changed, 689 insertions, 758 deletions
diff --git a/cui/source/dialogs/hangulhanjadlg.cxx b/cui/source/dialogs/hangulhanjadlg.cxx
index 9cd2f6d9a7d9..30f5cd6980e7 100644
--- a/cui/source/dialogs/hangulhanjadlg.cxx
+++ b/cui/source/dialogs/hangulhanjadlg.cxx
@@ -28,9 +28,8 @@
#include <osl/diagnose.h>
#include <tools/debug.hxx>
#include <i18nlangtag/languagetag.hxx>
-#include <vcl/controllayout.hxx>
-#include <vcl/builderfactory.hxx>
-#include <vcl/decoview.hxx>
+#include <vcl/svapp.hxx>
+#include <vcl/virdev.hxx>
#include <unotools/lingucfg.hxx>
#include <unotools/linguprops.hxx>
#include <com/sun/star/lang/NoSupportException.hpp>
@@ -42,8 +41,6 @@
#include <comphelper/processfactory.hxx>
#include <comphelper/string.hxx>
-#include <vcl/svlbitm.hxx>
-#include <vcl/treelistentry.hxx>
#define HHC editeng::HangulHanjaConversion
#define LINE_CNT static_cast< sal_uInt16 >(2)
@@ -208,116 +205,79 @@ namespace svx
*_pSecondaryLocation = aSecondaryRect;
}
- class RubyRadioButton : public RadioButton
+ class RubyRadioButton
{
-
public:
- RubyRadioButton( vcl::Window* _pParent, WinBits nBits );
- void init( const OUString& rPrimaryText, const OUString& rSecondaryText, const PseudoRubyText::RubyPosition& rPosition );
- virtual Size GetOptimalSize() const override;
+ RubyRadioButton(std::unique_ptr<weld::RadioButton> xControl);
+ void init(const OUString& rPrimaryText, const OUString& rSecondaryText, const PseudoRubyText::RubyPosition& rPosition);
- protected:
- virtual void Paint( vcl::RenderContext& /*rRenderContext*/, const ::tools::Rectangle& _rRect ) override;
+ void set_sensitive(bool sensitive) { m_xControl->set_sensitive(sensitive); }
+ void set_active(bool active) { m_xControl->set_active(active); }
+ bool get_active() const { return m_xControl->get_active(); }
+
+ void connect_clicked(const Link<weld::Button&, void>& rLink) { m_xControl->connect_clicked(rLink); }
private:
+ Size GetOptimalSize() const;
+ void Paint(vcl::RenderContext& rRenderContext);
+
+ ScopedVclPtr<VirtualDevice> m_xVirDev;
+ std::unique_ptr<weld::RadioButton> m_xControl;
PseudoRubyText m_aRubyText;
};
- RubyRadioButton::RubyRadioButton( vcl::Window* _pParent, WinBits nBits )
- :RadioButton( _pParent, nBits )
+ RubyRadioButton::RubyRadioButton(std::unique_ptr<weld::RadioButton> xControl)
+ : m_xVirDev(VclPtr<VirtualDevice>::Create())
+ , m_xControl(std::move(xControl))
{
+ m_xVirDev->SetBackground(m_xControl->get_wallpaper());
+ // expand the point size of the desired font to the equivalent pixel size
+ if (vcl::Window* pDefaultDevice = dynamic_cast<vcl::Window*>(Application::GetDefaultDevice()))
+ pDefaultDevice->SetPointFont(*m_xVirDev, m_xControl->get_font());
}
void RubyRadioButton::init( const OUString& rPrimaryText, const OUString& rSecondaryText, const PseudoRubyText::RubyPosition& rPosition )
{
- m_aRubyText.init( rPrimaryText, rSecondaryText, rPosition );
- }
+ m_aRubyText.init(rPrimaryText, rSecondaryText, rPosition);
+ m_xVirDev->SetOutputSizePixel(GetOptimalSize());
- void RubyRadioButton::Paint(vcl::RenderContext& rRenderContext, const ::tools::Rectangle&)
- {
- HideFocus();
+ Paint(*m_xVirDev);
- // calculate the size of the radio image - we're to paint our text _after_ this image
- DBG_ASSERT( !GetModeRadioImage(), "RubyRadioButton::Paint: images not supported!" );
- Size aImageSize = GetRadioImage(rRenderContext.GetSettings(), DrawButtonFlags::NONE).GetSizePixel();
- aImageSize.setWidth( CalcZoom( aImageSize.Width() ) + 2 ); // + 2 because otherwise the radiobuttons
- aImageSize.setHeight( CalcZoom( aImageSize.Height() ) + 2 ); // appear a bit cut from right and top.
+ m_xControl->set_image(m_xVirDev.get());
+ }
- ::tools::Rectangle aOverallRect( Point( 0, 0 ), GetOutputSizePixel() );
- aOverallRect.AdjustLeft(aImageSize.Width() + 4 ); // 4 is the separator between the image and the text
+ void RubyRadioButton::Paint(vcl::RenderContext& rRenderContext)
+ {
+ ::tools::Rectangle aOverallRect(Point(0, 0), rRenderContext.GetOutputSizePixel());
// inflate the rect a little bit (because the VCL radio button does the same)
::tools::Rectangle aTextRect( aOverallRect );
aTextRect.AdjustLeft( 1 ); aTextRect.AdjustRight( -1 );
aTextRect.AdjustTop( 1 ); aTextRect.AdjustBottom( -1 );
// calculate the text flags for the painting
- DrawTextFlags nTextStyle = DrawTextFlags::Mnemonic;
- WinBits nStyle = GetStyle( );
-
- // the horizontal alignment
- if ( nStyle & WB_RIGHT )
- nTextStyle |= DrawTextFlags::Right;
- else if ( nStyle & WB_CENTER )
- nTextStyle |= DrawTextFlags::Center;
- else
- nTextStyle |= DrawTextFlags::Left;
- // the vertical alignment
- if ( nStyle & WB_BOTTOM )
- nTextStyle |= DrawTextFlags::Bottom;
- else if ( nStyle & WB_VCENTER )
- nTextStyle |= DrawTextFlags::VCenter;
- else
- nTextStyle |= DrawTextFlags::Top;
- // mnemonics
- if ( 0 == ( nStyle & WB_NOLABEL ) )
- nTextStyle |= DrawTextFlags::Mnemonic;
+ DrawTextFlags nTextStyle = DrawTextFlags::Mnemonic |
+ DrawTextFlags::Left |
+ DrawTextFlags::VCenter;
// paint the ruby text
::tools::Rectangle aPrimaryTextLocation;
::tools::Rectangle aSecondaryTextLocation;
m_aRubyText.Paint(rRenderContext, aTextRect, nTextStyle, &aPrimaryTextLocation, &aSecondaryTextLocation);
-
- // the focus rectangle is to be painted around both texts
- ::tools::Rectangle aCombinedRect(aPrimaryTextLocation);
- aCombinedRect.Union(aSecondaryTextLocation);
- SetFocusRect(aCombinedRect);
-
- // let the base class paint the radio button
- // for this, give it the proper location to paint the image (vertically centered, relative to our text)
- ::tools::Rectangle aImageLocation( Point( 0, 0 ), aImageSize );
- sal_Int32 nTextHeight = aSecondaryTextLocation.Bottom() - aPrimaryTextLocation.Top();
- aImageLocation.SetTop( aPrimaryTextLocation.Top() + ( nTextHeight - aImageSize.Height() ) / 2 );
- aImageLocation.SetBottom( aImageLocation.Top() + aImageSize.Height() );
- SetStateRect( aImageLocation );
- DrawRadioButtonState(rRenderContext);
-
- // mouse clicks should be recognized in a rect which is one pixel larger in each direction, plus
- // includes the image
- aCombinedRect.SetLeft( aImageLocation.Left() );
- aCombinedRect.AdjustRight( 1 );
- aCombinedRect.AdjustTop( -1 );
- aCombinedRect.AdjustBottom( 1 );
-
- SetMouseRect(aCombinedRect);
-
- // paint the focus rect, if necessary
- if (HasFocus())
- ShowFocus(aTextRect);
}
Size RubyRadioButton::GetOptimalSize() const
{
- vcl::Font aSmallerFont( GetFont() );
+ vcl::Font aSmallerFont(m_xVirDev->GetFont());
aSmallerFont.SetFontHeight( static_cast<long>( 0.8 * aSmallerFont.GetFontHeight() ) );
::tools::Rectangle rect( Point(), Size( SAL_MAX_INT32, SAL_MAX_INT32 ) );
- Size aPrimarySize = GetTextRect( rect, m_aRubyText.getPrimaryText() ).GetSize();
+ Size aPrimarySize = m_xVirDev->GetTextRect( rect, m_aRubyText.getPrimaryText() ).GetSize();
Size aSecondarySize;
{
- FontSwitch aFontRestore( const_cast<RubyRadioButton&>(*this), aSmallerFont );
- aSecondarySize = GetTextRect( rect, m_aRubyText.getSecondaryText() ).GetSize();
+ FontSwitch aFontRestore(*m_xVirDev, aSmallerFont);
+ aSecondarySize = m_xVirDev->GetTextRect( rect, m_aRubyText.getSecondaryText() ).GetSize();
}
Size minimumSize;
@@ -326,23 +286,10 @@ namespace svx
return minimumSize;
}
- VCL_BUILDER_FACTORY_ARGS(RubyRadioButton, WB_LEFT|WB_VCENTER)
-
- SuggestionSet::SuggestionSet( vcl::Window* pParent )
- : ValueSet( pParent, pParent->GetStyle() | WB_BORDER )
-
- {
- }
-
- SuggestionSet::~SuggestionSet()
- {
- disposeOnce();
- }
+ SuggestionSet::SuggestionSet(std::unique_ptr<weld::ScrolledWindow> xScrolledWindow)
+ : SvtValueSet(std::move(xScrolledWindow))
- void SuggestionSet::dispose()
{
- ClearSet();
- ValueSet::dispose();
}
void SuggestionSet::UserDraw( const UserDrawEvent& rUDEvt )
@@ -363,146 +310,95 @@ namespace svx
Clear();
}
- SuggestionDisplay::SuggestionDisplay( vcl::Window* pParent, WinBits nBits )
- : Control( pParent, nBits )
- , m_bDisplayListBox( true )
- , m_aValueSet( VclPtr<SuggestionSet>::Create(this) )
- , m_aListBox( VclPtr<ListBox>::Create(this,GetStyle() | WB_BORDER) )
+ SuggestionDisplay::SuggestionDisplay(weld::Builder& rBuilder)
+ : m_bDisplayListBox( true )
, m_bInSelectionUpdate( false )
+ , m_xValueSet(new SuggestionSet(rBuilder.weld_scrolled_window("scrollwin")))
+ , m_xValueSetWin(new weld::CustomWeld(rBuilder, "valueset", *m_xValueSet))
+ , m_xListBox(rBuilder.weld_tree_view("listbox"))
{
- m_aValueSet->SetSelectHdl( LINK( this, SuggestionDisplay, SelectSuggestionValueSetHdl ) );
- m_aListBox->SetSelectHdl( LINK( this, SuggestionDisplay, SelectSuggestionListBoxHdl ) );
+ m_xValueSet->SetSelectHdl( LINK( this, SuggestionDisplay, SelectSuggestionValueSetHdl ) );
+ m_xListBox->connect_changed( LINK( this, SuggestionDisplay, SelectSuggestionListBoxHdl ) );
+
+ m_xValueSet->SetLineCount( LINE_CNT );
+ m_xValueSet->SetStyle( m_xValueSet->GetStyle() | WB_ITEMBORDER | WB_VSCROLL );
- m_aValueSet->SetLineCount( LINE_CNT );
- m_aValueSet->SetStyle( m_aValueSet->GetStyle() | WB_ITEMBORDER | WB_FLATVALUESET | WB_VSCROLL );
- m_aValueSet->SetBorderStyle( WindowBorderStyle::MONO );
OUString const aOneCharacter("AU");
- long nItemWidth = 2*GetTextWidth( aOneCharacter );
- m_aValueSet->SetItemWidth( nItemWidth );
+ auto nItemWidth = 2 * m_xListBox->get_pixel_size(aOneCharacter).Width();
+ m_xValueSet->SetItemWidth( nItemWidth );
- Size aSize( approximate_char_width() * 48, GetTextHeight() * 5 );
- m_aValueSet->SetSizePixel( aSize );
- m_aListBox->SetSizePixel( aSize );
+ Size aSize(m_xListBox->get_approximate_digit_width() * 42, m_xListBox->get_text_height() * 5);
+ m_xValueSet->set_size_request(aSize.Width(), aSize.Height());
+ m_xListBox->set_size_request(aSize.Width(), aSize.Height());
implUpdateDisplay();
}
- SuggestionDisplay::~SuggestionDisplay()
- {
- disposeOnce();
- }
-
- void SuggestionDisplay::dispose()
- {
- m_aValueSet.disposeAndClear();
- m_aListBox.disposeAndClear();
- Control::dispose();
- }
-
void SuggestionDisplay::implUpdateDisplay()
{
- bool bShowBox = IsVisible() && m_bDisplayListBox;
- bool bShowSet = IsVisible() && !m_bDisplayListBox;
-
- m_aListBox->Show( bShowBox );
- m_aValueSet->Show( bShowSet );
- }
-
- void SuggestionDisplay::StateChanged( StateChangedType nStateChange )
- {
- if( StateChangedType::Visible == nStateChange )
- implUpdateDisplay();
+ m_xListBox->show(m_bDisplayListBox);
+ if (!m_bDisplayListBox)
+ m_xValueSetWin->show();
+ else
+ m_xValueSetWin->hide();
}
bool SuggestionDisplay::hasCurrentControl()
{
- return m_bDisplayListBox || m_aValueSet;
+ return m_bDisplayListBox || m_xValueSet;
}
- Control& SuggestionDisplay::implGetCurrentControl()
+ weld::Widget& SuggestionDisplay::implGetCurrentControl()
{
- if( m_bDisplayListBox )
- return *m_aListBox.get();
- return *m_aValueSet.get();
- }
-
- void SuggestionDisplay::KeyInput( const KeyEvent& rKEvt )
- {
- implGetCurrentControl().KeyInput( rKEvt );
- }
- void SuggestionDisplay::KeyUp( const KeyEvent& rKEvt )
- {
- implGetCurrentControl().KeyUp( rKEvt );
- }
- void SuggestionDisplay::Activate()
- {
- implGetCurrentControl().Activate();
- }
- void SuggestionDisplay::Deactivate()
- {
- implGetCurrentControl().Deactivate();
- }
- void SuggestionDisplay::GetFocus()
- {
- if (hasCurrentControl())
- implGetCurrentControl().GetFocus();
- else
- Control::LoseFocus();
- }
- void SuggestionDisplay::LoseFocus()
- {
- if (hasCurrentControl())
- implGetCurrentControl().LoseFocus();
- else
- Control::LoseFocus();
- }
- void SuggestionDisplay::Command( const CommandEvent& rCEvt )
- {
- implGetCurrentControl().Command( rCEvt );
+ if (m_bDisplayListBox)
+ return *m_xListBox;
+ return *m_xValueSet->GetDrawingArea();
}
void SuggestionDisplay::DisplayListBox( bool bDisplayListBox )
{
if( m_bDisplayListBox != bDisplayListBox )
{
- Control& rOldControl = implGetCurrentControl();
- bool bHasFocus = rOldControl.HasFocus();
+ weld::Widget& rOldControl = implGetCurrentControl();
+ bool bHasFocus = rOldControl.has_focus();
m_bDisplayListBox = bDisplayListBox;
if( bHasFocus )
{
- Control& rNewControl = implGetCurrentControl();
- rNewControl.GrabFocus();
+ weld::Widget& rNewControl = implGetCurrentControl();
+ rNewControl.grab_focus();
}
implUpdateDisplay();
}
}
- IMPL_LINK( SuggestionDisplay, SelectSuggestionValueSetHdl, ValueSet*, pControl, void )
+ IMPL_LINK_NOARG(SuggestionDisplay, SelectSuggestionValueSetHdl, SvtValueSet*, void)
{
- SelectSuggestionHdl(pControl);
+ SelectSuggestionHdl(false);
}
- IMPL_LINK( SuggestionDisplay, SelectSuggestionListBoxHdl, ListBox&, rControl, void )
+
+ IMPL_LINK_NOARG(SuggestionDisplay, SelectSuggestionListBoxHdl, weld::TreeView&, void)
{
- SelectSuggestionHdl(&rControl);
+ SelectSuggestionHdl(true);
}
- void SuggestionDisplay::SelectSuggestionHdl( Control const * pControl )
+
+ void SuggestionDisplay::SelectSuggestionHdl(bool bListBox)
{
if( m_bInSelectionUpdate )
return;
m_bInSelectionUpdate = true;
- if( pControl == m_aListBox.get() )
+ if (bListBox)
{
- sal_uInt16 nPos = m_aListBox->GetSelectedEntryPos();
- m_aValueSet->SelectItem( nPos+1 ); //itemid == pos+1 (id 0 has special meaning)
+ sal_uInt16 nPos = m_xListBox->get_selected_index();
+ m_xValueSet->SelectItem( nPos+1 ); //itemid == pos+1 (id 0 has special meaning)
}
else
{
- sal_uInt16 nPos = m_aValueSet->GetSelectedItemId()-1; //itemid == pos+1 (id 0 has special meaning)
- m_aListBox->SelectEntryPos( nPos );
+ sal_uInt16 nPos = m_xValueSet->GetSelectedItemId()-1; //itemid == pos+1 (id 0 has special meaning)
+ m_xListBox->select(nPos);
}
m_bInSelectionUpdate = false;
m_aSelectLink.Call( *this );
@@ -512,410 +408,341 @@ namespace svx
{
m_aSelectLink = rLink;
}
+
void SuggestionDisplay::Clear()
{
- m_aListBox->Clear();
- m_aValueSet->Clear();
+ m_xListBox->clear();
+ m_xValueSet->Clear();
}
+
void SuggestionDisplay::InsertEntry( const OUString& rStr )
{
- sal_uInt16 nItemId = m_aListBox->InsertEntry( rStr ) + 1; //itemid == pos+1 (id 0 has special meaning)
- m_aValueSet->InsertItem( nItemId );
+ m_xListBox->append_text(rStr);
+ sal_uInt16 nItemId = m_xListBox->n_children(); //itemid == pos+1 (id 0 has special meaning)
+ m_xValueSet->InsertItem( nItemId );
OUString* pItemData = new OUString( rStr );
- m_aValueSet->SetItemData( nItemId, pItemData );
+ m_xValueSet->SetItemData( nItemId, pItemData );
}
+
void SuggestionDisplay::SelectEntryPos( sal_uInt16 nPos )
{
- m_aListBox->SelectEntryPos( nPos );
- m_aValueSet->SelectItem( nPos+1 ); //itemid == pos+1 (id 0 has special meaning)
+ m_xListBox->select(nPos);
+ m_xValueSet->SelectItem( nPos+1 ); //itemid == pos+1 (id 0 has special meaning)
}
+
sal_uInt16 SuggestionDisplay::GetEntryCount() const
{
- return m_aListBox->GetEntryCount();
+ return m_xListBox->n_children();
}
+
OUString SuggestionDisplay::GetEntry( sal_uInt16 nPos ) const
{
- return m_aListBox->GetEntry( nPos );
+ return m_xListBox->get_text( nPos );
}
+
OUString SuggestionDisplay::GetSelectedEntry() const
{
- return m_aListBox->GetSelectedEntry();
+ return m_xListBox->get_selected_text();
}
+
void SuggestionDisplay::SetHelpIds()
{
- SetHelpId( HID_HANGULDLG_SUGGESTIONS );
- m_aValueSet->SetHelpId( HID_HANGULDLG_SUGGESTIONS_GRID );
- m_aListBox->SetHelpId( HID_HANGULDLG_SUGGESTIONS_LIST );
- }
-
- VCL_BUILDER_FACTORY_ARGS( SuggestionDisplay, WB_ITEMBORDER | WB_FLATVALUESET | WB_VSCROLL );
-
- HangulHanjaConversionDialog::HangulHanjaConversionDialog(vcl::Window* _pParent)
- :ModalDialog( _pParent, "HangulHanjaConversionDialog", "cui/ui/hangulhanjaconversiondialog.ui" )
- ,m_bDocumentMode( true )
- {
- get( m_pFind, "find" );
- get( m_pIgnore, "ignore" );
- get( m_pSuggestions, "suggestions" );
- get( m_pSimpleConversion, "simpleconversion" );
- get( m_pHangulBracketed, "hangulbracket" );
- get( m_pHanjaBracketed, "hanjabracket" );
- get( m_pHangulOnly, "hangulonly" );
- get( m_pHanjaOnly, "hanjaonly" );
- get( m_pReplaceByChar, "replacebychar" );
- get( m_pOptions, "options" );
- get( m_pIgnore, "ignore" );
- get( m_pIgnoreAll, "ignoreall" );
- get( m_pReplace, "replace" );
- get( m_pReplaceAll, "replaceall" );
- get( m_pWordInput, "wordinput" );
- get( m_pOriginalWord, "originalword" );
- get( m_pHanjaAbove, "hanja_above" );
- get( m_pHanjaBelow, "hanja_below" );
- get( m_pHangulAbove, "hangul_above" );
- get( m_pHangulBelow, "hangul_below" );
-
- m_pSuggestions->set_height_request( m_pSuggestions->GetTextHeight() * 5 );
- m_pSuggestions->set_width_request( m_pSuggestions->approximate_char_width() * 48 );
+ m_xValueSet->SetHelpId(HID_HANGULDLG_SUGGESTIONS_GRID);
+ m_xListBox->set_help_id(HID_HANGULDLG_SUGGESTIONS_LIST);
+ }
+
+ HangulHanjaConversionDialog::HangulHanjaConversionDialog(weld::Window* pParent)
+ : GenericDialogController(pParent, "cui/ui/hangulhanjaconversiondialog.ui", "HangulHanjaConversionDialog")
+ , m_bDocumentMode( true )
+ , m_xFind(m_xBuilder->weld_button("find"))
+ , m_xIgnore(m_xBuilder->weld_button("ignore"))
+ , m_xIgnoreAll(m_xBuilder->weld_button("ignoreall"))
+ , m_xReplace(m_xBuilder->weld_button("replace"))
+ , m_xReplaceAll(m_xBuilder->weld_button("replaceall"))
+ , m_xOptions(m_xBuilder->weld_button("options"))
+ , m_xSuggestions(new SuggestionDisplay(*m_xBuilder))
+ , m_xSimpleConversion(m_xBuilder->weld_radio_button("simpleconversion"))
+ , m_xHangulBracketed(m_xBuilder->weld_radio_button("hangulbracket"))
+ , m_xHanjaBracketed(m_xBuilder->weld_radio_button("hanjabracket"))
+ , m_xWordInput(m_xBuilder->weld_entry("wordinput"))
+ , m_xOriginalWord(m_xBuilder->weld_label("originalword"))
+ , m_xHanjaAbove(new RubyRadioButton(m_xBuilder->weld_radio_button("hanja_above")))
+ , m_xHanjaBelow(new RubyRadioButton(m_xBuilder->weld_radio_button("hanja_below")))
+ , m_xHangulAbove(new RubyRadioButton(m_xBuilder->weld_radio_button("hangul_above")))
+ , m_xHangulBelow(new RubyRadioButton(m_xBuilder->weld_radio_button("hangul_below")))
+ , m_xHangulOnly(m_xBuilder->weld_check_button("hangulonly"))
+ , m_xHanjaOnly(m_xBuilder->weld_check_button("hanjaonly"))
+ , m_xReplaceByChar(m_xBuilder->weld_check_button("replacebychar"))
+ {
+ m_xSuggestions->set_size_request(m_xOriginalWord->get_approximate_digit_width() * 42,
+ m_xOriginalWord->get_text_height() * 5);
const OUString sHangul(CuiResId(RID_SVXSTR_HANGUL));
const OUString sHanja(CuiResId(RID_SVXSTR_HANJA));
- m_pHanjaAbove->init( sHangul, sHanja, PseudoRubyText::eAbove );
- m_pHanjaBelow->init( sHangul, sHanja, PseudoRubyText::eBelow );
- m_pHangulAbove->init( sHanja, sHangul, PseudoRubyText::eAbove );
- m_pHangulBelow->init( sHanja, sHangul, PseudoRubyText::eBelow );
-
- m_pWordInput->SetModifyHdl( LINK( this, HangulHanjaConversionDialog, OnSuggestionModified ) );
- m_pSuggestions->SetSelectHdl( LINK( this, HangulHanjaConversionDialog, OnSuggestionSelected ) );
- m_pReplaceByChar->SetClickHdl( LINK( this, HangulHanjaConversionDialog, ClickByCharacterHdl ) );
- m_pHangulOnly->SetClickHdl( LINK( this, HangulHanjaConversionDialog, OnConversionDirectionClicked ) );
- m_pHanjaOnly->SetClickHdl( LINK( this, HangulHanjaConversionDialog, OnConversionDirectionClicked ) );
- m_pOptions->SetClickHdl( LINK( this, HangulHanjaConversionDialog, OnOption ) );
+ m_xHanjaAbove->init( sHangul, sHanja, PseudoRubyText::eAbove );
+ m_xHanjaBelow->init( sHangul, sHanja, PseudoRubyText::eBelow );
+ m_xHangulAbove->init( sHanja, sHangul, PseudoRubyText::eAbove );
+ m_xHangulBelow->init( sHanja, sHangul, PseudoRubyText::eBelow );
+
+ m_xWordInput->connect_changed( LINK( this, HangulHanjaConversionDialog, OnSuggestionModified ) );
+ m_xSuggestions->SetSelectHdl( LINK( this, HangulHanjaConversionDialog, OnSuggestionSelected ) );
+ m_xReplaceByChar->connect_toggled( LINK( this, HangulHanjaConversionDialog, ClickByCharacterHdl ) );
+ m_xHangulOnly->connect_toggled( LINK( this, HangulHanjaConversionDialog, OnConversionDirectionClicked ) );
+ m_xHanjaOnly->connect_toggled( LINK( this, HangulHanjaConversionDialog, OnConversionDirectionClicked ) );
+ m_xOptions->connect_clicked(LINK(this, HangulHanjaConversionDialog, OnOption));
// initial focus
FocusSuggestion( );
// initial control values
- m_pSimpleConversion->Check();
+ m_xSimpleConversion->set_active(true);
- m_pSuggestions->SetHelpIds();
+ m_xSuggestions->SetHelpIds();
}
HangulHanjaConversionDialog::~HangulHanjaConversionDialog()
{
- disposeOnce();
- }
-
- void HangulHanjaConversionDialog::dispose()
- {
- m_pFind.clear();
- m_pIgnore.clear();
- m_pIgnoreAll.clear();
- m_pReplace.clear();
- m_pReplaceAll.clear();
- m_pOptions.clear();
- m_pSuggestions.clear();
- m_pSimpleConversion.clear();
- m_pHangulBracketed.clear();
- m_pHanjaBracketed.clear();
- m_pWordInput.clear();
- m_pOriginalWord.clear();
- m_pHanjaAbove.clear();
- m_pHanjaBelow.clear();
- m_pHangulAbove.clear();
- m_pHangulBelow.clear();
- m_pHangulOnly.clear();
- m_pHanjaOnly.clear();
- m_pReplaceByChar.clear();
- ModalDialog::dispose();
}
void HangulHanjaConversionDialog::FillSuggestions( const css::uno::Sequence< OUString >& _rSuggestions )
{
- m_pSuggestions->Clear();
+ m_xSuggestions->Clear();
for ( auto const & suggestion : _rSuggestions )
- m_pSuggestions->InsertEntry( suggestion );
+ m_xSuggestions->InsertEntry( suggestion );
// select the first suggestion, and fill in the suggestion edit field
OUString sFirstSuggestion;
- if ( m_pSuggestions->GetEntryCount() )
+ if ( m_xSuggestions->GetEntryCount() )
{
- sFirstSuggestion = m_pSuggestions->GetEntry( 0 );
- m_pSuggestions->SelectEntryPos( 0 );
+ sFirstSuggestion = m_xSuggestions->GetEntry( 0 );
+ m_xSuggestions->SelectEntryPos( 0 );
}
- m_pWordInput->SetText( sFirstSuggestion );
- m_pWordInput->SaveValue();
- OnSuggestionModified( *m_pWordInput );
+ m_xWordInput->set_text( sFirstSuggestion );
+ m_xWordInput->save_value();
+ OnSuggestionModified( *m_xWordInput );
}
-
- void HangulHanjaConversionDialog::SetOptionsChangedHdl( const Link<LinkParamNone*,void>& _rHdl )
+ void HangulHanjaConversionDialog::SetOptionsChangedHdl(const Link<LinkParamNone*,void>& rHdl)
{
- m_aOptionsChangedLink = _rHdl;
+ m_aOptionsChangedLink = rHdl;
}
-
- void HangulHanjaConversionDialog::SetIgnoreHdl( const Link<Button*,void>& _rHdl )
+ void HangulHanjaConversionDialog::SetIgnoreHdl(const Link<weld::Button&,void>& rHdl)
{
- m_pIgnore->SetClickHdl( _rHdl );
+ m_xIgnore->connect_clicked(rHdl);
}
-
- void HangulHanjaConversionDialog::SetIgnoreAllHdl( const Link<Button*,void>& _rHdl )
+ void HangulHanjaConversionDialog::SetIgnoreAllHdl(const Link<weld::Button&,void>& rHdl)
{
- m_pIgnoreAll->SetClickHdl( _rHdl );
+ m_xIgnoreAll->connect_clicked(rHdl);
}
-
- void HangulHanjaConversionDialog::SetChangeHdl( const Link<Button*,void>& _rHdl )
+ void HangulHanjaConversionDialog::SetChangeHdl(const Link<weld::Button&,void>& rHdl )
{
- m_pReplace->SetClickHdl( _rHdl );
+ m_xReplace->connect_clicked(rHdl);
}
-
- void HangulHanjaConversionDialog::SetChangeAllHdl( const Link<Button*,void>& _rHdl )
+ void HangulHanjaConversionDialog::SetChangeAllHdl(const Link<weld::Button&,void>& rHdl)
{
- m_pReplaceAll->SetClickHdl( _rHdl );
+ m_xReplaceAll->connect_clicked(rHdl);
}
-
- void HangulHanjaConversionDialog::SetFindHdl( const Link<Button*,void>& _rHdl )
+ void HangulHanjaConversionDialog::SetFindHdl(const Link<weld::Button&,void>& rHdl)
{
- m_pFind->SetClickHdl( _rHdl );
+ m_xFind->connect_clicked(rHdl);
}
-
- void HangulHanjaConversionDialog::SetConversionFormatChangedHdl( const Link<Button*,void>& _rHdl )
+ void HangulHanjaConversionDialog::SetConversionFormatChangedHdl( const Link<weld::Button&,void>& rHdl )
{
- m_pSimpleConversion->SetClickHdl( _rHdl );
- m_pHangulBracketed->SetClickHdl( _rHdl );
- m_pHanjaBracketed->SetClickHdl( _rHdl );
- m_pHanjaAbove->SetClickHdl( _rHdl );
- m_pHanjaBelow->SetClickHdl( _rHdl );
- m_pHangulAbove->SetClickHdl( _rHdl );
- m_pHangulBelow->SetClickHdl( _rHdl );
+ m_xSimpleConversion->connect_clicked( rHdl );
+ m_xHangulBracketed->connect_clicked( rHdl );
+ m_xHanjaBracketed->connect_clicked( rHdl );
+ m_xHanjaAbove->connect_clicked( rHdl );
+ m_xHanjaBelow->connect_clicked( rHdl );
+ m_xHangulAbove->connect_clicked( rHdl );
+ m_xHangulBelow->connect_clicked( rHdl );
}
-
- void HangulHanjaConversionDialog::SetClickByCharacterHdl( const Link<CheckBox*,void>& _rHdl )
+ void HangulHanjaConversionDialog::SetClickByCharacterHdl( const Link<weld::ToggleButton&,void>& _rHdl )
{
m_aClickByCharacterLink = _rHdl;
}
-
IMPL_LINK_NOARG( HangulHanjaConversionDialog, OnSuggestionSelected, SuggestionDisplay&, void )
{
- m_pWordInput->SetText( m_pSuggestions->GetSelectedEntry() );
- OnSuggestionModified( *m_pWordInput );
+ m_xWordInput->set_text(m_xSuggestions->GetSelectedEntry());
+ OnSuggestionModified( *m_xWordInput );
}
-
- IMPL_LINK_NOARG( HangulHanjaConversionDialog, OnSuggestionModified, Edit&, void )
+ IMPL_LINK_NOARG( HangulHanjaConversionDialog, OnSuggestionModified, weld::Entry&, void )
{
- m_pFind->Enable( m_pWordInput->IsValueChangedFromSaved() );
+ m_xFind->set_sensitive(m_xWordInput->get_value_changed_from_saved());
- bool bSameLen = m_pWordInput->GetText().getLength() == m_pOriginalWord->GetText().getLength();
- m_pReplace->Enable( m_bDocumentMode && bSameLen );
- m_pReplaceAll->Enable( m_bDocumentMode && bSameLen );
+ bool bSameLen = m_xWordInput->get_text().getLength() == m_xOriginalWord->get_label().getLength();
+ m_xReplace->set_sensitive( m_bDocumentMode && bSameLen );
+ m_xReplaceAll->set_sensitive( m_bDocumentMode && bSameLen );
}
-
- IMPL_LINK( HangulHanjaConversionDialog, ClickByCharacterHdl, Button*, pBox, void )
+ IMPL_LINK(HangulHanjaConversionDialog, ClickByCharacterHdl, weld::ToggleButton&, rBox, void)
{
- m_aClickByCharacterLink.Call( static_cast<CheckBox*>(pBox) );
-
- bool bByCharacter = static_cast<CheckBox*>(pBox)->IsChecked();
- m_pSuggestions->DisplayListBox( !bByCharacter );
+ m_aClickByCharacterLink.Call(rBox);
+ bool bByCharacter = rBox.get_active();
+ m_xSuggestions->DisplayListBox( !bByCharacter );
}
-
- IMPL_LINK( HangulHanjaConversionDialog, OnConversionDirectionClicked, Button *, pBox, void )
+ IMPL_LINK(HangulHanjaConversionDialog, OnConversionDirectionClicked, weld::ToggleButton&, rBox, void)
{
- CheckBox *pOtherBox = nullptr;
- if ( pBox == m_pHangulOnly )
- pOtherBox = m_pHanjaOnly;
- else if ( pBox == m_pHanjaOnly )
- pOtherBox = m_pHangulOnly;
- if ( pBox && pOtherBox )
- {
- bool bBoxChecked = static_cast<CheckBox*>(pBox)->IsChecked();
- if ( bBoxChecked )
- pOtherBox->Check( false );
- pOtherBox->Enable( !bBoxChecked );
- }
+ weld::CheckButton* pOtherBox = nullptr;
+ if (&rBox == m_xHangulOnly.get())
+ pOtherBox = m_xHanjaOnly.get();
+ else
+ pOtherBox = m_xHangulOnly.get();
+ bool bBoxChecked = rBox.get_active();
+ if (bBoxChecked)
+ pOtherBox->set_active(false);
+ pOtherBox->set_sensitive(!bBoxChecked);
}
- IMPL_LINK_NOARG( HangulHanjaConversionDialog, OnOption, Button*, void )
+ IMPL_LINK_NOARG(HangulHanjaConversionDialog, OnOption, weld::Button&, void)
{
- HangulHanjaOptionsDialog aOptDlg(GetFrameWeld());
+ HangulHanjaOptionsDialog aOptDlg(m_xDialog.get());
aOptDlg.run();
m_aOptionsChangedLink.Call( nullptr );
}
OUString HangulHanjaConversionDialog::GetCurrentString( ) const
{
- return m_pOriginalWord->GetText( );
+ return m_xOriginalWord->get_label();
}
void HangulHanjaConversionDialog::FocusSuggestion( )
{
- m_pWordInput->GrabFocus();
- }
-
- namespace
- {
- void lcl_modifyWindowStyle( vcl::Window* _pWin, WinBits _nSet, WinBits _nReset )
- {
- DBG_ASSERT( 0 == ( _nSet & _nReset ), "lcl_modifyWindowStyle: set _and_ reset the same bit?" );
- if ( _pWin )
- _pWin->SetStyle( ( _pWin->GetStyle() | _nSet ) & ~_nReset );
- }
+ m_xWordInput->grab_focus();
}
-
void HangulHanjaConversionDialog::SetCurrentString( const OUString& _rNewString,
const Sequence< OUString >& _rSuggestions, bool _bOriginatesFromDocument )
{
- m_pOriginalWord->SetText( _rNewString );
+ m_xOriginalWord->set_label(_rNewString);
bool bOldDocumentMode = m_bDocumentMode;
m_bDocumentMode = _bOriginatesFromDocument; // before FillSuggestions!
FillSuggestions( _rSuggestions );
- m_pIgnoreAll->Enable( m_bDocumentMode );
+ m_xIgnoreAll->set_sensitive( m_bDocumentMode );
// switch the def button depending if we're working for document text
- if ( bOldDocumentMode != m_bDocumentMode )
+ if (bOldDocumentMode != m_bDocumentMode)
{
- vcl::Window* pOldDefButton = nullptr;
- vcl::Window* pNewDefButton = nullptr;
- if ( m_bDocumentMode )
+ weld::Widget* pOldDefButton = nullptr;
+ weld::Widget* pNewDefButton = nullptr;
+ if (m_bDocumentMode)
{
- pOldDefButton = m_pFind;
- pNewDefButton = m_pReplace;
+ pOldDefButton = m_xFind.get();
+ pNewDefButton = m_xReplace.get();
}
else
{
- pOldDefButton = m_pReplace;
- pNewDefButton = m_pFind;
+ pOldDefButton = m_xReplace.get();
+ pNewDefButton = m_xFind.get();
}
- DBG_ASSERT( WB_DEFBUTTON == ( pOldDefButton->GetStyle( ) & WB_DEFBUTTON ),
- "HangulHanjaConversionDialog::SetCurrentString: wrong previous default button (1)!" );
- DBG_ASSERT( 0 == ( pNewDefButton->GetStyle( ) & WB_DEFBUTTON ),
- "HangulHanjaConversionDialog::SetCurrentString: wrong previous default button (2)!" );
-
- lcl_modifyWindowStyle( pOldDefButton, 0, WB_DEFBUTTON );
- lcl_modifyWindowStyle( pNewDefButton, WB_DEFBUTTON, 0 );
-
- // give the focus to the new def button temporarily - VCL is somewhat peculiar
- // in recognizing a new default button
- VclPtr<vcl::Window> xSaveFocusId = Window::SaveFocus();
- pNewDefButton->GrabFocus();
- Window::EndSaveFocus( xSaveFocusId );
+ pOldDefButton->set_has_default(false);
+ pNewDefButton->set_has_default(true);
}
}
-
OUString HangulHanjaConversionDialog::GetCurrentSuggestion( ) const
{
- return m_pWordInput->GetText();
+ return m_xWordInput->get_text();
}
-
void HangulHanjaConversionDialog::SetByCharacter( bool _bByCharacter )
{
- m_pReplaceByChar->Check( _bByCharacter );
- m_pSuggestions->DisplayListBox( !_bByCharacter );
+ m_xReplaceByChar->set_active( _bByCharacter );
+ m_xSuggestions->DisplayListBox( !_bByCharacter );
}
-
void HangulHanjaConversionDialog::SetConversionDirectionState(
bool _bTryBothDirections,
- HHC::ConversionDirection _ePrimaryConversionDirection )
+ HHC::ConversionDirection ePrimaryConversionDirection )
{
// default state: try both direction
- m_pHangulOnly->Check( false );
- m_pHangulOnly->Enable();
- m_pHanjaOnly->Check( false );
- m_pHanjaOnly->Enable();
+ m_xHangulOnly->set_active( false );
+ m_xHangulOnly->set_sensitive(true);
+ m_xHanjaOnly->set_active( false );
+ m_xHanjaOnly->set_sensitive(true);
if (!_bTryBothDirections)
{
- CheckBox *pBox = _ePrimaryConversionDirection == HHC::eHangulToHanja ?
- m_pHangulOnly.get() : m_pHanjaOnly.get();
- pBox->Check();
- OnConversionDirectionClicked( pBox );
+ weld::CheckButton* pBox = ePrimaryConversionDirection == HHC::eHangulToHanja ?
+ m_xHangulOnly.get() : m_xHanjaOnly.get();
+ pBox->set_active(true);
+ OnConversionDirectionClicked(*pBox);
}
}
-
bool HangulHanjaConversionDialog::GetUseBothDirections( ) const
{
- return !m_pHangulOnly->IsChecked() && !m_pHanjaOnly->IsChecked();
+ return !m_xHangulOnly->get_active() && !m_xHanjaOnly->get_active();
}
-
HHC::ConversionDirection HangulHanjaConversionDialog::GetDirection(
HHC::ConversionDirection eDefaultDirection ) const
{
HHC::ConversionDirection eDirection = eDefaultDirection;
- if ( m_pHangulOnly->IsChecked() && !m_pHanjaOnly->IsChecked() )
+ if (m_xHangulOnly->get_active() && !m_xHanjaOnly->get_active())
eDirection = HHC::eHangulToHanja;
- else if ( !m_pHangulOnly->IsChecked() && m_pHanjaOnly->IsChecked() )
+ else if (!m_xHangulOnly->get_active() && m_xHanjaOnly->get_active())
eDirection = HHC::eHanjaToHangul;
return eDirection;
}
-
void HangulHanjaConversionDialog::SetConversionFormat( HHC::ConversionFormat _eType )
{
switch ( _eType )
{
- case HHC::eSimpleConversion: m_pSimpleConversion->Check(); break;
- case HHC::eHangulBracketed: m_pHangulBracketed->Check(); break;
- case HHC::eHanjaBracketed: m_pHanjaBracketed->Check(); break;
- case HHC::eRubyHanjaAbove: m_pHanjaAbove->Check(); break;
- case HHC::eRubyHanjaBelow: m_pHanjaBelow->Check(); break;
- case HHC::eRubyHangulAbove: m_pHangulAbove->Check(); break;
- case HHC::eRubyHangulBelow: m_pHangulBelow->Check(); break;
+ case HHC::eSimpleConversion: m_xSimpleConversion->set_active(true); break;
+ case HHC::eHangulBracketed: m_xHangulBracketed->set_active(true); break;
+ case HHC::eHanjaBracketed: m_xHanjaBracketed->set_active(true); break;
+ case HHC::eRubyHanjaAbove: m_xHanjaAbove->set_active(true); break;
+ case HHC::eRubyHanjaBelow: m_xHanjaBelow->set_active(true); break;
+ case HHC::eRubyHangulAbove: m_xHangulAbove->set_active(true); break;
+ case HHC::eRubyHangulBelow: m_xHangulBelow->set_active(true); break;
default:
OSL_FAIL( "HangulHanjaConversionDialog::SetConversionFormat: unknown type!" );
}
}
-
HHC::ConversionFormat HangulHanjaConversionDialog::GetConversionFormat( ) const
{
- if ( m_pSimpleConversion->IsChecked() )
+ if ( m_xSimpleConversion->get_active() )
return HHC::eSimpleConversion;
- if ( m_pHangulBracketed->IsChecked() )
+ if ( m_xHangulBracketed->get_active() )
return HHC::eHangulBracketed;
- if ( m_pHanjaBracketed->IsChecked() )
+ if ( m_xHanjaBracketed->get_active() )
return HHC::eHanjaBracketed;
- if ( m_pHanjaAbove->IsChecked() )
+ if ( m_xHanjaAbove->get_active() )
return HHC::eRubyHanjaAbove;
- if ( m_pHanjaBelow->IsChecked() )
+ if ( m_xHanjaBelow->get_active() )
return HHC::eRubyHanjaBelow;
- if ( m_pHangulAbove->IsChecked() )
+ if ( m_xHangulAbove->get_active() )
return HHC::eRubyHangulAbove;
- if ( m_pHangulBelow->IsChecked() )
+ if ( m_xHangulBelow->get_active() )
return HHC::eRubyHangulBelow;
OSL_FAIL( "HangulHanjaConversionDialog::GetConversionFormat: no radio checked?" );
return HHC::eSimpleConversion;
}
-
void HangulHanjaConversionDialog::EnableRubySupport( bool bVal )
{
- m_pHanjaAbove->Enable( bVal );
- m_pHanjaBelow->Enable( bVal );
- m_pHangulAbove->Enable( bVal );
- m_pHangulBelow->Enable( bVal );
+ m_xHanjaAbove->set_sensitive( bVal );
+ m_xHanjaBelow->set_sensitive( bVal );
+ m_xHangulAbove->set_sensitive( bVal );
+ m_xHangulBelow->set_sensitive( bVal );
}
-
void HangulHanjaOptionsDialog::Init()
{
if( !m_xConversionDictionaryList.is() )
@@ -1431,15 +1258,15 @@ namespace svx
IMPL_LINK_NOARG( HangulHanjaEditDictDialog, NewPBPushHdl, weld::Button&, void )
{
- DBG_ASSERT( m_pSuggestions, "-HangulHanjaEditDictDialog::NewPBPushHdl(): no suggestions... search in hell..." );
+ DBG_ASSERT( m_xSuggestions, "-HangulHanjaEditDictDialog::NewPBPushHdl(): no suggestions... search in hell..." );
Reference< XConversionDictionary > xDict = m_rDictList[ m_nCurrentDict ];
- if( xDict.is() && m_pSuggestions )
+ if( xDict.is() && m_xSuggestions )
{
//delete old entry
bool bRemovedSomething = DeleteEntryFromDictionary( xDict );
OUString aLeft( m_aOriginal );
- const OUString* pRight = m_pSuggestions->First();
+ const OUString* pRight = m_xSuggestions->First();
bool bAddedSomething = false;
while( pRight )
{
@@ -1456,7 +1283,7 @@ namespace svx
{
}
- pRight = m_pSuggestions->Next();
+ pRight = m_xSuggestions->Next();
}
if( bAddedSomething || bRemovedSomething )
@@ -1509,8 +1336,8 @@ namespace svx
void HangulHanjaEditDictDialog::InitEditDictDialog( sal_uInt32 nSelDict )
{
- if( m_pSuggestions )
- m_pSuggestions->Clear();
+ if( m_xSuggestions )
+ m_xSuggestions->Clear();
if( m_nCurrentDict != nSelDict )
{
@@ -1555,7 +1382,7 @@ namespace svx
void HangulHanjaEditDictDialog::UpdateButtonStates()
{
bool bHaveValidOriginalString = !m_aOriginal.isEmpty() && m_aOriginal != m_aEditHintText;
- bool bNew = bHaveValidOriginalString && m_pSuggestions && m_pSuggestions->GetCount() > 0;
+ bool bNew = bHaveValidOriginalString && m_xSuggestions && m_xSuggestions->GetCount() > 0;
bNew = bNew && ( m_bModifiedSuggestions || m_bModifiedOriginal );
m_xNewPB->set_sensitive( bNew );
@@ -1570,21 +1397,21 @@ namespace svx
{
m_bModifiedOriginal = false;
- if( m_pSuggestions )
- m_pSuggestions->Clear();
+ if( m_xSuggestions )
+ m_xSuggestions->Clear();
//fill found entries into boxes
sal_uInt32 nCnt = aEntries.getLength();
if( nCnt )
{
- if( !m_pSuggestions )
- m_pSuggestions.reset(new SuggestionList);
+ if( !m_xSuggestions )
+ m_xSuggestions.reset(new SuggestionList);
const OUString* pSugg = aEntries.getConstArray();
sal_uInt32 n = 0;
while( nCnt )
{
- m_pSuggestions->Set( pSugg[ n ], sal_uInt16( n ) );
+ m_xSuggestions->Set( pSugg[ n ], sal_uInt16( n ) );
++n;
--nCnt;
}
@@ -1599,9 +1426,9 @@ namespace svx
void HangulHanjaEditDictDialog::SetEditText(SuggestionEdit& rEdit, sal_uInt16 nEntryNum)
{
OUString aStr;
- if( m_pSuggestions )
+ if( m_xSuggestions )
{
- aStr = m_pSuggestions->Get(nEntryNum);
+ aStr = m_xSuggestions->Get(nEntryNum);
}
rEdit.set_text(aStr);
@@ -1616,15 +1443,15 @@ namespace svx
if( aTxt.isEmpty() )
{
//reset suggestion
- if( m_pSuggestions )
- m_pSuggestions->Reset( nEntryNum );
+ if( m_xSuggestions )
+ m_xSuggestions->Reset( nEntryNum );
}
else
{
//set suggestion
- if( !m_pSuggestions )
- m_pSuggestions.reset(new SuggestionList);
- m_pSuggestions->Set( aTxt, nEntryNum );
+ if( !m_xSuggestions )
+ m_xSuggestions.reset(new SuggestionList);
+ m_xSuggestions->Set( aTxt, nEntryNum );
}
UpdateButtonStates();
diff --git a/cui/source/factory/dlgfact.cxx b/cui/source/factory/dlgfact.cxx
index 0d7de241f08d..51772b5395be 100644
--- a/cui/source/factory/dlgfact.cxx
+++ b/cui/source/factory/dlgfact.cxx
@@ -117,7 +117,10 @@ short AbstractSvxDistributeDialog_Impl::Execute()
return m_xDlg->run();
}
-IMPL_ABSTDLG_BASE(AbstractHangulHanjaConversionDialog_Impl);
+short AbstractHangulHanjaConversionDialog_Impl::Execute()
+{
+ return m_xDlg->run();
+}
short AbstractFmShowColsDialog_Impl::Execute()
{
@@ -385,76 +388,77 @@ SvxDistributeVertical AbstractSvxDistributeDialog_Impl::GetDistributeVer()const
void AbstractHangulHanjaConversionDialog_Impl::EndDialog(sal_Int32 nResult)
{
- pDlg->EndDialog(nResult);
+ m_xDlg->response(nResult);
}
void AbstractHangulHanjaConversionDialog_Impl::EnableRubySupport( bool _bVal )
{
- pDlg->EnableRubySupport(_bVal);
+ m_xDlg->EnableRubySupport(_bVal);
}
void AbstractHangulHanjaConversionDialog_Impl::SetByCharacter( bool _bByCharacter )
{
- pDlg->SetByCharacter(_bByCharacter);
+ m_xDlg->SetByCharacter(_bByCharacter);
}
void AbstractHangulHanjaConversionDialog_Impl::SetConversionDirectionState( bool _bTryBothDirections, editeng::HangulHanjaConversion::ConversionDirection _ePrimaryConversionDirection )
{
- pDlg->SetConversionDirectionState(_bTryBothDirections, _ePrimaryConversionDirection);
+ m_xDlg->SetConversionDirectionState(_bTryBothDirections, _ePrimaryConversionDirection);
}
void AbstractHangulHanjaConversionDialog_Impl::SetConversionFormat( editeng::HangulHanjaConversion::ConversionFormat _eType )
{
- pDlg->SetConversionFormat(_eType);
+ m_xDlg->SetConversionFormat(_eType);
}
void AbstractHangulHanjaConversionDialog_Impl::SetOptionsChangedHdl( const Link<LinkParamNone*,void>& _rHdl )
{
- pDlg->SetOptionsChangedHdl(_rHdl );
+ m_xDlg->SetOptionsChangedHdl(_rHdl );
}
-void AbstractHangulHanjaConversionDialog_Impl::SetIgnoreHdl( const Link<Button*,void>& _rHdl )
+void AbstractHangulHanjaConversionDialog_Impl::SetIgnoreHdl( const Link<weld::Button&,void>& _rHdl )
{
- pDlg->SetIgnoreHdl(_rHdl );
+ m_xDlg->SetIgnoreHdl(_rHdl );
}
-void AbstractHangulHanjaConversionDialog_Impl::SetIgnoreAllHdl( const Link<Button*,void>& _rHdl )
+void AbstractHangulHanjaConversionDialog_Impl::SetIgnoreAllHdl(const Link<weld::Button&,void>& rHdl)
{
- pDlg->SetIgnoreAllHdl(_rHdl );
+ m_xDlg->SetIgnoreAllHdl(rHdl);
}
-void AbstractHangulHanjaConversionDialog_Impl::SetChangeHdl( const Link<Button*,void>& _rHdl )
+void AbstractHangulHanjaConversionDialog_Impl::SetChangeHdl(const Link<weld::Button&,void>& rHdl)
{
- pDlg->SetChangeHdl(_rHdl );
+ m_xDlg->SetChangeHdl(rHdl);
}
-void AbstractHangulHanjaConversionDialog_Impl::SetChangeAllHdl( const Link<Button*,void>& _rHdl )
+void AbstractHangulHanjaConversionDialog_Impl::SetChangeAllHdl( const Link<weld::Button&,void>& rHdl )
{
- pDlg->SetChangeAllHdl(_rHdl );
+ m_xDlg->SetChangeAllHdl(rHdl);
}
-void AbstractHangulHanjaConversionDialog_Impl::SetClickByCharacterHdl( const Link<CheckBox*,void>& _rHdl )
+void AbstractHangulHanjaConversionDialog_Impl::SetClickByCharacterHdl( const Link<weld::ToggleButton&,void>& _rHdl )
{
- pDlg->SetClickByCharacterHdl(_rHdl );
+ m_xDlg->SetClickByCharacterHdl(_rHdl );
}
-void AbstractHangulHanjaConversionDialog_Impl::SetConversionFormatChangedHdl( const Link<Button*,void>& _rHdl )
+void AbstractHangulHanjaConversionDialog_Impl::SetConversionFormatChangedHdl(const Link<weld::Button&,void>& rHdl)
{
- pDlg->SetConversionFormatChangedHdl(_rHdl );
+ m_xDlg->SetConversionFormatChangedHdl(rHdl);
}
-void AbstractHangulHanjaConversionDialog_Impl::SetFindHdl( const Link<Button*,void>& _rHdl )
+
+void AbstractHangulHanjaConversionDialog_Impl::SetFindHdl( const Link<weld::Button&,void>& rHdl )
{
- pDlg->SetFindHdl(_rHdl );
+ m_xDlg->SetFindHdl(rHdl);
}
bool AbstractHangulHanjaConversionDialog_Impl::GetUseBothDirections( ) const
{
- return pDlg->GetUseBothDirections();
+ return m_xDlg->GetUseBothDirections();
}
editeng::HangulHanjaConversion::ConversionDirection AbstractHangulHanjaConversionDialog_Impl::GetDirection( editeng::HangulHanjaConversion::ConversionDirection _eDefaultDirection ) const
{
- return pDlg->GetDirection( _eDefaultDirection );
+ return m_xDlg->GetDirection( _eDefaultDirection );
}
void AbstractHangulHanjaConversionDialog_Impl::SetCurrentString(
@@ -463,25 +467,27 @@ void AbstractHangulHanjaConversionDialog_Impl::SetCurrentString(
bool _bOriginatesFromDocument
)
{
- pDlg->SetCurrentString(_rNewString,_rSuggestions,_bOriginatesFromDocument);
+ m_xDlg->SetCurrentString(_rNewString,_rSuggestions,_bOriginatesFromDocument);
}
-OUString AbstractHangulHanjaConversionDialog_Impl::GetCurrentString( ) const
+
+OUString AbstractHangulHanjaConversionDialog_Impl::GetCurrentString( ) const
{
- return pDlg->GetCurrentString();
+ return m_xDlg->GetCurrentString();
}
-editeng::HangulHanjaConversion::ConversionFormat AbstractHangulHanjaConversionDialog_Impl::GetConversionFormat( ) const
+
+editeng::HangulHanjaConversion::ConversionFormat AbstractHangulHanjaConversionDialog_Impl::GetConversionFormat( ) const
{
- return pDlg->GetConversionFormat();
+ return m_xDlg->GetConversionFormat();
}
void AbstractHangulHanjaConversionDialog_Impl::FocusSuggestion( )
{
- pDlg->FocusSuggestion();
+ m_xDlg->FocusSuggestion();
}
-OUString AbstractHangulHanjaConversionDialog_Impl::GetCurrentSuggestion( ) const
+OUString AbstractHangulHanjaConversionDialog_Impl::GetCurrentSuggestion( ) const
{
- return pDlg->GetCurrentSuggestion();
+ return m_xDlg->GetCurrentSuggestion();
}
OUString AbstractThesaurusDialog_Impl::GetWord()
@@ -1036,10 +1042,9 @@ VclPtr<AbstractSvxDistributeDialog> AbstractDialogFactory_Impl::CreateSvxDistrib
return VclPtr<AbstractSvxDistributeDialog_Impl>::Create(std::make_unique<SvxDistributeDialog>(pParent, rAttr, SvxDistributeHorizontal::NONE, SvxDistributeVertical::NONE));
}
-VclPtr<AbstractHangulHanjaConversionDialog> AbstractDialogFactory_Impl::CreateHangulHanjaConversionDialog(vcl::Window* pParent)
+VclPtr<AbstractHangulHanjaConversionDialog> AbstractDialogFactory_Impl::CreateHangulHanjaConversionDialog(weld::Window* pParent)
{
- VclPtrInstance<HangulHanjaConversionDialog> pDlg(pParent);
- return VclPtr<AbstractHangulHanjaConversionDialog_Impl>::Create( pDlg );
+ return VclPtr<AbstractHangulHanjaConversionDialog_Impl>::Create(std::make_unique<HangulHanjaConversionDialog>(pParent));
}
VclPtr<AbstractThesaurusDialog> AbstractDialogFactory_Impl::CreateThesaurusDialog( vcl::Window* pParent,
diff --git a/cui/source/factory/dlgfact.hxx b/cui/source/factory/dlgfact.hxx
index b9d598f40009..19c3d3a225d2 100644
--- a/cui/source/factory/dlgfact.hxx
+++ b/cui/source/factory/dlgfact.hxx
@@ -170,20 +170,27 @@ public:
class AbstractHangulHanjaConversionDialog_Impl: public AbstractHangulHanjaConversionDialog
{
- DECL_ABSTDLG_BASE(AbstractHangulHanjaConversionDialog_Impl,HangulHanjaConversionDialog)
+private:
+ std::unique_ptr<HangulHanjaConversionDialog> m_xDlg;
+public:
+ explicit AbstractHangulHanjaConversionDialog_Impl(std::unique_ptr<HangulHanjaConversionDialog> p)
+ : m_xDlg(std::move(p))
+ {
+ }
+ virtual short Execute() override;
virtual void EndDialog(sal_Int32 nResult) override;
virtual void EnableRubySupport( bool _bVal ) override;
virtual void SetByCharacter( bool _bByCharacter ) override ;
virtual void SetConversionDirectionState( bool _bTryBothDirections, editeng::HangulHanjaConversion::ConversionDirection _ePrimaryConversionDirection ) override;
virtual void SetConversionFormat( editeng::HangulHanjaConversion::ConversionFormat _eType ) override;
virtual void SetOptionsChangedHdl( const Link<LinkParamNone*,void>& _rHdl ) override;
- virtual void SetIgnoreHdl( const Link<Button*,void>& _rHdl ) override;
- virtual void SetIgnoreAllHdl( const Link<Button*,void>& _rHdl ) override ;
- virtual void SetChangeHdl( const Link<Button*,void>& _rHdl ) override ;
- virtual void SetChangeAllHdl( const Link<Button*,void>& _rHdl ) override ;
- virtual void SetClickByCharacterHdl( const Link<CheckBox*,void>& _rHdl ) override ;
- virtual void SetConversionFormatChangedHdl( const Link<Button*,void>& _rHdl ) override ;
- virtual void SetFindHdl( const Link<Button*,void>& _rHdl ) override;
+ virtual void SetIgnoreHdl( const Link<weld::Button&,void>& _rHdl ) override;
+ virtual void SetIgnoreAllHdl( const Link<weld::Button&,void>& _rHdl ) override ;
+ virtual void SetChangeHdl( const Link<weld::Button&,void>& _rHdl ) override ;
+ virtual void SetChangeAllHdl( const Link<weld::Button&,void>& rHdl ) override ;
+ virtual void SetClickByCharacterHdl( const Link<weld::ToggleButton&,void>& rHdl ) override ;
+ virtual void SetConversionFormatChangedHdl( const Link<weld::Button&,void>& _rHdl ) override ;
+ virtual void SetFindHdl( const Link<weld::Button&,void>& _rHdl ) override;
virtual bool GetUseBothDirections( ) const override;
virtual editeng::HangulHanjaConversion::ConversionDirection
GetDirection( editeng::HangulHanjaConversion::ConversionDirection _eDefaultDirection ) const override;
@@ -730,7 +737,7 @@ public:
virtual VclPtr<SfxAbstractPasteDialog> CreatePasteDialog(weld::Window* pParent) override;
virtual VclPtr<SfxAbstractLinksDialog> CreateLinksDialog(weld::Window* pParent, sfx2::LinkManager* pMgr, bool bHTML = false, sfx2::SvBaseLink* p=nullptr) override;
- virtual VclPtr<AbstractHangulHanjaConversionDialog> CreateHangulHanjaConversionDialog( vcl::Window* _pParent ) override;
+ virtual VclPtr<AbstractHangulHanjaConversionDialog> CreateHangulHanjaConversionDialog(weld::Window* pParent) override;
virtual VclPtr<AbstractThesaurusDialog> CreateThesaurusDialog( vcl::Window*, css::uno::Reference< css::linguistic2::XThesaurus > xThesaurus,
const OUString &rWord, LanguageType nLanguage ) override;
diff --git a/cui/source/inc/hangulhanjadlg.hxx b/cui/source/inc/hangulhanjadlg.hxx
index caaefe1465ca..53cf86124e5b 100644
--- a/cui/source/inc/hangulhanjadlg.hxx
+++ b/cui/source/inc/hangulhanjadlg.hxx
@@ -19,6 +19,7 @@
#ifndef INCLUDED_CUI_SOURCE_INC_HANGULHANJADLG_HXX
#define INCLUDED_CUI_SOURCE_INC_HANGULHANJADLG_HXX
+#include <vcl/customweld.hxx>
#include <vcl/dialog.hxx>
#include <vcl/button.hxx>
#include <vcl/lstbox.hxx>
@@ -39,23 +40,19 @@
namespace svx
{
- class SuggestionSet : public ValueSet
+ class SuggestionSet : public SvtValueSet
{
public:
- SuggestionSet( vcl::Window* pParent );
- virtual ~SuggestionSet() override;
- virtual void dispose() override;
+ SuggestionSet(std::unique_ptr<weld::ScrolledWindow> xScrolledWindow);
virtual void UserDraw( const UserDrawEvent& rUDEvt ) override;
void ClearSet();
};
- class SuggestionDisplay : public Control
+ class SuggestionDisplay
{
public:
- SuggestionDisplay( vcl::Window* pParent, WinBits nBits );
- virtual ~SuggestionDisplay() override;
- virtual void dispose() override;
+ SuggestionDisplay(weld::Builder& rBuilder);
void DisplayListBox( bool bDisplayListBox );
@@ -70,86 +67,80 @@ namespace svx
OUString GetEntry( sal_uInt16 nPos ) const;
OUString GetSelectedEntry() const;
- virtual void StateChanged( StateChangedType nStateChange ) override;
-
- virtual void KeyInput( const KeyEvent& rKEvt ) override;
- virtual void KeyUp( const KeyEvent& rKEvt ) override;
- virtual void Activate() override;
- virtual void Deactivate() override;
- virtual void GetFocus() override;
- virtual void LoseFocus() override;
- virtual void Command( const CommandEvent& rCEvt ) override;
-
- DECL_LINK( SelectSuggestionListBoxHdl, ListBox&, void );
- DECL_LINK( SelectSuggestionValueSetHdl, ValueSet*, void );
- void SelectSuggestionHdl(Control const *);
+ DECL_LINK( SelectSuggestionListBoxHdl, weld::TreeView&, void );
+ DECL_LINK( SelectSuggestionValueSetHdl, SvtValueSet*, void );
+ void SelectSuggestionHdl(bool bListBox);
void SetHelpIds();
+ void set_size_request(int nWidth, int nHeight)
+ {
+ m_xValueSetWin->set_size_request(nWidth, nHeight);
+ m_xListBox->set_size_request(nWidth, nHeight);
+ }
+
private:
void implUpdateDisplay();
bool hasCurrentControl();
- Control& implGetCurrentControl();
+ weld::Widget& implGetCurrentControl();
private:
- bool m_bDisplayListBox;//otherwise ValueSet
- VclPtr<SuggestionSet> m_aValueSet;
- VclPtr<ListBox> m_aListBox;
-
- Link<SuggestionDisplay&,void> m_aSelectLink;
+ bool m_bDisplayListBox; //otherwise ValueSet
bool m_bInSelectionUpdate;
+ Link<SuggestionDisplay&,void> m_aSelectLink;
+
+ std::unique_ptr<SuggestionSet> m_xValueSet;
+ std::unique_ptr<weld::CustomWeld> m_xValueSetWin;
+ std::unique_ptr<weld::TreeView> m_xListBox;
};
class RubyRadioButton;
- class HangulHanjaConversionDialog : public ModalDialog
+ class HangulHanjaConversionDialog : public weld::GenericDialogController
{
private:
-
- VclPtr<PushButton> m_pFind;
- VclPtr<PushButton> m_pIgnore;
- VclPtr<PushButton> m_pIgnoreAll;
- VclPtr<PushButton> m_pReplace;
- VclPtr<PushButton> m_pReplaceAll;
- VclPtr<PushButton> m_pOptions;
- VclPtr<SuggestionDisplay> m_pSuggestions;
- VclPtr<RadioButton> m_pSimpleConversion;
- VclPtr<RadioButton> m_pHangulBracketed;
- VclPtr<RadioButton> m_pHanjaBracketed;
- VclPtr<Edit> m_pWordInput;
- VclPtr<FixedText> m_pOriginalWord;
- VclPtr<RubyRadioButton> m_pHanjaAbove;
- VclPtr<RubyRadioButton> m_pHanjaBelow;
- VclPtr<RubyRadioButton> m_pHangulAbove;
- VclPtr<RubyRadioButton> m_pHangulBelow;
- VclPtr<CheckBox> m_pHangulOnly;
- VclPtr<CheckBox> m_pHanjaOnly;
- VclPtr<CheckBox> m_pReplaceByChar;
-
/** are we working for a document? This is normally true, but in case
the user uses the "find" functionality, we switch to working
with what the user entered, which then does not have any relation to
the document anymore. Some functionality must be disabled then */
bool m_bDocumentMode;
- Link<LinkParamNone*,void> m_aOptionsChangedLink;
- Link<CheckBox*,void> m_aClickByCharacterLink;
-
+ Link<LinkParamNone*,void> m_aOptionsChangedLink;
+ Link<weld::ToggleButton&,void> m_aClickByCharacterLink;
+
+ std::unique_ptr<weld::Button> m_xFind;
+ std::unique_ptr<weld::Button> m_xIgnore;
+ std::unique_ptr<weld::Button> m_xIgnoreAll;
+ std::unique_ptr<weld::Button> m_xReplace;
+ std::unique_ptr<weld::Button> m_xReplaceAll;
+ std::unique_ptr<weld::Button> m_xOptions;
+ std::unique_ptr<SuggestionDisplay> m_xSuggestions;
+ std::unique_ptr<weld::RadioButton> m_xSimpleConversion;
+ std::unique_ptr<weld::RadioButton> m_xHangulBracketed;
+ std::unique_ptr<weld::RadioButton> m_xHanjaBracketed;
+ std::unique_ptr<weld::Entry> m_xWordInput;
+ std::unique_ptr<weld::Label> m_xOriginalWord;
+ std::unique_ptr<RubyRadioButton> m_xHanjaAbove;
+ std::unique_ptr<RubyRadioButton> m_xHanjaBelow;
+ std::unique_ptr<RubyRadioButton> m_xHangulAbove;
+ std::unique_ptr<RubyRadioButton> m_xHangulBelow;
+ std::unique_ptr<weld::CheckButton> m_xHangulOnly;
+ std::unique_ptr<weld::CheckButton> m_xHanjaOnly;
+ std::unique_ptr<weld::CheckButton> m_xReplaceByChar;
public:
- HangulHanjaConversionDialog(vcl::Window* pParent);
+ HangulHanjaConversionDialog(weld::Window* pParent);
virtual ~HangulHanjaConversionDialog() override;
- virtual void dispose() override;
public:
void SetOptionsChangedHdl( const Link<LinkParamNone*,void>& _rHdl );
- void SetIgnoreHdl( const Link<Button*,void>& _rHdl );
- void SetIgnoreAllHdl( const Link<Button*,void>& _rHdl );
- void SetChangeHdl( const Link<Button*,void>& _rHdl );
- void SetChangeAllHdl( const Link<Button*,void>& _rHdl );
+ void SetIgnoreHdl( const Link<weld::Button&,void>& _rHdl );
+ void SetIgnoreAllHdl( const Link<weld::Button&,void>& _rHdl );
+ void SetChangeHdl( const Link<weld::Button&,void>& _rHdl );
+ void SetChangeAllHdl( const Link<weld::Button&,void>& _rHdl );
- void SetClickByCharacterHdl( const Link<CheckBox*,void>& _rHdl );
- void SetConversionFormatChangedHdl( const Link<Button*,void>& _rHdl );
- void SetFindHdl( const Link<Button*,void>& _rHdl );
+ void SetClickByCharacterHdl( const Link<weld::ToggleButton&,void>& _rHdl );
+ void SetConversionFormatChangedHdl( const Link<weld::Button&,void>& _rHdl );
+ void SetFindHdl( const Link<weld::Button&,void>& _rHdl );
OUString GetCurrentString( ) const;
void SetCurrentString(
@@ -180,11 +171,11 @@ namespace svx
void EnableRubySupport( bool bVal );
private:
- DECL_LINK( OnOption, Button*, void );
- DECL_LINK( OnSuggestionModified, Edit&, void );
+ DECL_LINK( OnOption, weld::Button&, void );
+ DECL_LINK( OnSuggestionModified, weld::Entry&, void );
DECL_LINK( OnSuggestionSelected, SuggestionDisplay&, void );
- DECL_LINK( OnConversionDirectionClicked, Button*, void );
- DECL_LINK( ClickByCharacterHdl, Button*, void );
+ DECL_LINK( OnConversionDirectionClicked, weld::ToggleButton&, void );
+ DECL_LINK( ClickByCharacterHdl, weld::ToggleButton&, void );
/// fill the suggestion list box with suggestions for the actual input
void FillSuggestions( const css::uno::Sequence< OUString >& _rSuggestions );
@@ -272,7 +263,7 @@ namespace svx
sal_uInt32 m_nCurrentDict;
OUString m_aOriginal;
- std::unique_ptr<SuggestionList> m_pSuggestions;
+ std::unique_ptr<SuggestionList> m_xSuggestions;
sal_uInt16 m_nTopPos;
bool m_bModifiedSuggestions;
diff --git a/cui/source/inc/helpids.h b/cui/source/inc/helpids.h
index c8b21efef94b..318abb331485 100644
--- a/cui/source/inc/helpids.h
+++ b/cui/source/inc/helpids.h
@@ -28,7 +28,6 @@
#define HID_OFADLG_TREELISTBOX "CUI_HID_OFADLG_TREELISTBOX"
#define HID_SVX_CONFIG_TOOLBAR "CUI_HID_SVX_CONFIG_TOOLBAR"
#define HID_SVX_CONFIG_TOOLBAR_CONTENTS "CUI_HID_SVX_CONFIG_TOOLBAR_CONTENTS"
-#define HID_HANGULDLG_SUGGESTIONS "CUI_HID_HANGULDLG_SUGGESTIONS"
#define HID_HANGULDLG_SUGGESTIONS_GRID "CUI_HID_HANGULDLG_SUGGESTIONS_GRID"
#define HID_HANGULDLG_SUGGESTIONS_LIST "CUI_HID_HANGULDLG_SUGGESTIONS_LIST"
#define HID_SVX_CONFIG_NAME_SUBMENU "CUI_HID_SVX_CONFIG_NAME_SUBMENU"
diff --git a/cui/uiconfig/ui/hangulhanjaconversiondialog.ui b/cui/uiconfig/ui/hangulhanjaconversiondialog.ui
index bed6c495cc16..08bb1b277071 100644
--- a/cui/uiconfig/ui/hangulhanjaconversiondialog.ui
+++ b/cui/uiconfig/ui/hangulhanjaconversiondialog.ui
@@ -1,11 +1,18 @@
<?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"/>
<object class="GtkDialog" id="HangulHanjaConversionDialog">
<property name="can_focus">False</property>
+ <property name="border_width">6</property>
<property name="title" translatable="yes" context="hangulhanjaconversiondialog|HangulHanjaConversionDialog">Hangul/Hanja Conversion</property>
+ <property name="modal">True</property>
+ <property name="default_width">0</property>
+ <property name="default_height">0</property>
<property name="type_hint">normal</property>
+ <child>
+ <placeholder/>
+ </child>
<child internal-child="vbox">
<object class="GtkBox" id="dialog-vbox1">
<property name="can_focus">False</property>
@@ -78,45 +85,48 @@
<property name="margin_bottom">6</property>
<property name="spacing">12</property>
<child>
- <object class="GtkBox" id="box3">
+ <object class="GtkGrid">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="orientation">vertical</property>
- <property name="spacing">6</property>
+ <property name="row_spacing">12</property>
+ <property name="column_spacing">6</property>
<child>
- <object class="GtkBox" id="box4">
+ <object class="GtkLabel" id="label1">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="spacing">6</property>
- <child>
- <object class="GtkLabel" id="label1">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="margin_right">28</property>
- <property name="label" translatable="yes" context="hangulhanjaconversiondialog|label1">Original</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="originalword">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">1</property>
- </packing>
- </child>
+ <property name="label" translatable="yes" context="hangulhanjaconversiondialog|label1">Original</property>
+ <property name="use_underline">True</property>
+ <property name="mnemonic_widget">originalword</property>
+ <property name="xalign">0</property>
</object>
<packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">0</property>
+ <property name="left_attach">0</property>
+ <property name="top_attach">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="originalword">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="xalign">0</property>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="top_attach">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="label3">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes" context="hangulhanjaconversiondialog|label3">Word</property>
+ <property name="use_underline">True</property>
+ <property name="mnemonic_widget">wordinput</property>
+ <property name="xalign">0</property>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">1</property>
</packing>
</child>
<child>
@@ -125,19 +135,6 @@
<property name="can_focus">False</property>
<property name="spacing">6</property>
<child>
- <object class="GtkLabel" id="label3">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="margin_right">42</property>
- <property name="label" translatable="yes" context="hangulhanjaconversiondialog|label3">Word</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
<object class="GtkEntry" id="wordinput">
<property name="visible">True</property>
<property name="can_focus">True</property>
@@ -164,9 +161,21 @@
</child>
</object>
<packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">1</property>
+ <property name="left_attach">1</property>
+ <property name="top_attach">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="label4">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes" context="hangulhanjaconversiondialog|label4">Suggestions</property>
+ <property name="use_underline">True</property>
+ <property name="xalign">0</property>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">2</property>
</packing>
</child>
<child>
@@ -175,132 +184,173 @@
<property name="can_focus">False</property>
<property name="spacing">6</property>
<child>
- <object class="GtkLabel" id="label4">
+ <object class="GtkScrolledWindow" id="scrollwin">
<property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="label" translatable="yes" context="hangulhanjaconversiondialog|label4">Suggestions</property>
+ <property name="can_focus">True</property>
+ <property name="hexpand">True</property>
+ <property name="vexpand">True</property>
+ <property name="hscrollbar_policy">never</property>
+ <property name="shadow_type">in</property>
+ <child>
+ <object class="GtkViewport">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="hexpand">True</property>
+ <property name="vexpand">True</property>
+ <child>
+ <object class="GtkDrawingArea" id="valueset">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="events">GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | GDK_KEY_PRESS_MASK | GDK_KEY_RELEASE_MASK | GDK_STRUCTURE_MASK</property>
+ <property name="hexpand">True</property>
+ <property name="vexpand">True</property>
+ </object>
+ </child>
+ </object>
+ </child>
</object>
<packing>
- <property name="expand">True</property>
+ <property name="expand">False</property>
<property name="fill">True</property>
- <property name="position">0</property>
+ <property name="position">1</property>
</packing>
</child>
<child>
- <object class="cuilo-SuggestionDisplay" id="suggestions:border">
+ <object class="GtkScrolledWindow">
<property name="visible">True</property>
<property name="can_focus">True</property>
+ <property name="hexpand">True</property>
+ <property name="shadow_type">in</property>
+ <child>
+ <object class="GtkTreeView" id="listbox">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="hexpand">True</property>
+ <property name="model">liststore2</property>
+ <property name="search_column">0</property>
+ <child internal-child="selection">
+ <object class="GtkTreeSelection"/>
+ </child>
+ <child>
+ <object class="GtkTreeViewColumn" id="treeviewcolumn5">
+ <property name="resizable">True</property>
+ <property name="spacing">6</property>
+ <child>
+ <object class="GtkCellRendererText" id="cellrenderer4"/>
+ <attributes>
+ <attribute name="text">0</attribute>
+ </attributes>
+ </child>
+ </object>
+ </child>
+ </object>
+ </child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
- <property name="position">1</property>
+ <property name="position">2</property>
</packing>
</child>
</object>
<packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">2</property>
+ <property name="left_attach">1</property>
+ <property name="top_attach">2</property>
</packing>
</child>
<child>
- <object class="GtkBox" id="box7">
+ <object class="GtkLabel" id="label5">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="halign">baseline</property>
- <property name="hexpand">True</property>
- <property name="spacing">6</property>
+ <property name="label" translatable="yes" context="hangulhanjaconversiondialog|label5">Format</property>
+ <property name="use_underline">True</property>
+ <property name="xalign">0</property>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">3</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkGrid" id="grid1">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="row_spacing">12</property>
+ <property name="column_spacing">12</property>
<child>
- <object class="GtkLabel" id="label5">
+ <object class="GtkRadioButton" id="hanja_above">
<property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="margin_right">28</property>
- <property name="label" translatable="yes" context="hangulhanjaconversiondialog|label5">Format</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="tooltip_text" translatable="yes" context="hangulhanjaconversiondialog|hanja_above">Hanja above</property>
+ <property name="xalign">0</property>
+ <property name="always_show_image">True</property>
+ <property name="draw_indicator">True</property>
+ <property name="group">simpleconversion</property>
</object>
<packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">0</property>
+ <property name="left_attach">0</property>
+ <property name="top_attach">1</property>
</packing>
</child>
<child>
- <object class="GtkRadioButton" id="simpleconversion">
- <property name="label" translatable="yes" context="hangulhanjaconversiondialog|simpleconversion">_Hangul/Hanja</property>
+ <object class="GtkRadioButton" id="hanja_below">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
- <property name="use_underline">True</property>
+ <property name="tooltip_text" translatable="yes" context="hangulhanjaconversiondialog|hanja_below">Hanja below</property>
<property name="xalign">0</property>
- <property name="active">True</property>
+ <property name="always_show_image">True</property>
<property name="draw_indicator">True</property>
- <property name="group">hangulbracket</property>
+ <property name="group">simpleconversion</property>
</object>
<packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">1</property>
+ <property name="left_attach">1</property>
+ <property name="top_attach">1</property>
</packing>
</child>
<child>
- <object class="GtkRadioButton" id="hangulbracket">
- <property name="label" translatable="yes" context="hangulhanjaconversiondialog|hangulbracket">Hanja (Han_gul)</property>
+ <object class="GtkRadioButton" id="hangul_above">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
- <property name="use_underline">True</property>
+ <property name="tooltip_text" translatable="yes" context="hangulhanjaconversiondialog|hangul_above">Hangul above</property>
<property name="xalign">0</property>
- <property name="active">True</property>
+ <property name="always_show_image">True</property>
<property name="draw_indicator">True</property>
+ <property name="group">simpleconversion</property>
</object>
<packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">2</property>
+ <property name="left_attach">0</property>
+ <property name="top_attach">2</property>
</packing>
</child>
<child>
- <object class="GtkRadioButton" id="hanjabracket">
- <property name="label" translatable="yes" context="hangulhanjaconversiondialog|hanjabracket">Hang_ul (Hanja)</property>
+ <object class="GtkRadioButton" id="hangul_below">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
- <property name="use_underline">True</property>
+ <property name="tooltip_text" translatable="yes" context="hangulhanjaconversiondialog|hangul_below">Hangul below</property>
<property name="xalign">0</property>
- <property name="active">True</property>
+ <property name="always_show_image">True</property>
<property name="draw_indicator">True</property>
<property name="group">simpleconversion</property>
</object>
<packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">3</property>
+ <property name="left_attach">1</property>
+ <property name="top_attach">2</property>
</packing>
</child>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">3</property>
- </packing>
- </child>
- <child>
- <object class="GtkGrid" id="grid1">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="row_spacing">12</property>
- <property name="column_spacing">12</property>
<child>
- <object class="cuilo-RubyRadioButton" id="hanja_above:border">
- <property name="label" translatable="yes" context="hangulhanjaconversiondialog|hanja_above">Hanja</property>
+ <object class="GtkRadioButton" id="simpleconversion">
+ <property name="label" translatable="yes" context="hangulhanjaconversiondialog|simpleconversion">_Hangul/Hanja</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
- <property name="margin_left">88</property>
- <property name="xalign">0.2</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">hanja_below</property>
</object>
<packing>
<property name="left_attach">0</property>
@@ -308,15 +358,15 @@
</packing>
</child>
<child>
- <object class="cuilo-RubyRadioButton" id="hanja_below:border">
- <property name="label" translatable="yes" context="hangulhanjaconversiondialog|hanja_below">Hanja</property>
+ <object class="GtkRadioButton" id="hangulbracket">
+ <property name="label" translatable="yes" context="hangulhanjaconversiondialog|hangulbracket">Hanja (Han_gul)</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
- <property name="margin_left">12</property>
- <property name="xalign">0.2</property>
+ <property name="use_underline">True</property>
+ <property name="xalign">0</property>
<property name="draw_indicator">True</property>
- <property name="group">hangul_above</property>
+ <property name="group">simpleconversion</property>
</object>
<packing>
<property name="left_attach">1</property>
@@ -324,42 +374,44 @@
</packing>
</child>
<child>
- <object class="cuilo-RubyRadioButton" id="hangul_above:border">
- <property name="label" translatable="yes" context="hangulhanjaconversiondialog|hangul_above">Hangul</property>
+ <object class="GtkRadioButton" id="hanjabracket">
+ <property name="label" translatable="yes" context="hangulhanjaconversiondialog|hanjabracket">Hang_ul (Hanja)</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
- <property name="margin_left">88</property>
- <property name="xalign">0.2</property>
+ <property name="use_underline">True</property>
+ <property name="xalign">0</property>
<property name="draw_indicator">True</property>
- <property name="group">hangul_below</property>
+ <property name="group">simpleconversion</property>
</object>
<packing>
- <property name="left_attach">0</property>
- <property name="top_attach">1</property>
+ <property name="left_attach">2</property>
+ <property name="top_attach">0</property>
</packing>
</child>
<child>
- <object class="cuilo-RubyRadioButton" id="hangul_below:border">
- <property name="label" translatable="yes" context="hangulhanjaconversiondialog|hangul_below">Hangul</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">False</property>
- <property name="margin_left">12</property>
- <property name="xalign">0.2</property>
- <property name="draw_indicator">True</property>
- <property name="group">hanja_above</property>
- </object>
- <packing>
- <property name="left_attach">1</property>
- <property name="top_attach">1</property>
- </packing>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
</child>
</object>
<packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">4</property>
+ <property name="left_attach">1</property>
+ <property name="top_attach">3</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="label6">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes" context="hangulhanjaconversiondialog|label6">Conversion</property>
+ <property name="use_underline">True</property>
+ <property name="xalign">0</property>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">4</property>
</packing>
</child>
<child>
@@ -369,24 +421,11 @@
<property name="vexpand">True</property>
<property name="spacing">6</property>
<child>
- <object class="GtkLabel" id="label6">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="label" translatable="yes" context="hangulhanjaconversiondialog|label6">Conversion</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
<object class="GtkCheckButton" id="hangulonly">
<property name="label" translatable="yes" context="hangulhanjaconversiondialog|hangulonly">Hangul _only</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
- <property name="margin_left">6</property>
<property name="use_underline">True</property>
<property name="xalign">0</property>
<property name="draw_indicator">True</property>
@@ -403,7 +442,6 @@
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
- <property name="margin_left">6</property>
<property name="use_underline">True</property>
<property name="xalign">0</property>
<property name="draw_indicator">True</property>
@@ -416,9 +454,8 @@
</child>
</object>
<packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">6</property>
+ <property name="left_attach">1</property>
+ <property name="top_attach">4</property>
</packing>
</child>
</object>
@@ -432,6 +469,7 @@
<object class="GtkBox" id="box2">
<property name="visible">True</property>
<property name="can_focus">False</property>
+ <property name="valign">start</property>
<property name="orientation">vertical</property>
<property name="spacing">6</property>
<property name="homogeneous">True</property>
@@ -494,9 +532,6 @@
</packing>
</child>
<child>
- <placeholder/>
- </child>
- <child>
<object class="GtkCheckButton" id="replacebychar">
<property name="label" translatable="yes" context="hangulhanjaconversiondialog|replacebychar">Replace b_y character</property>
<property name="visible">True</property>
@@ -547,4 +582,13 @@
<action-widget response="-11">help</action-widget>
</action-widgets>
</object>
+ <object class="GtkSizeGroup"/>
+ <object class="GtkTreeStore" id="liststore2">
+ <columns>
+ <!-- column-name text -->
+ <column type="gchararray"/>
+ <!-- column-name id -->
+ <column type="gchararray"/>
+ </columns>
+ </object>
</interface>
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 ) )
{
}
diff --git a/extras/source/glade/libreoffice-catalog.xml.in b/extras/source/glade/libreoffice-catalog.xml.in
index 784b173d5e33..abd450bb1d0a 100644
--- a/extras/source/glade/libreoffice-catalog.xml.in
+++ b/extras/source/glade/libreoffice-catalog.xml.in
@@ -521,12 +521,6 @@
generic-name="DataTreeListBox" parent="GtkTreeView"
icon-name="widget-gtk-treeview"/>
- <glade-widget-class title="Suggestion Display" name="cuilo-SuggestionDisplay"
- generic-name="SuggestionDisplay" parent="GtkTextView"
- icon-name="widget-gtk-textview"/>
- <glade-widget-class title="Ruby RadioButton" name="cuilo-RubyRadioButton"
- generic-name="RubyRadioButton" parent="GtkRadioButton"
- icon-name="widget-gtk-radiobutton"/>
<glade-widget-class title="Char Win" name="sfxlo-SvxCharViewControl"
generic-name="ShowText" parent="GtkDrawingArea"
icon-name="widget-gtk-drawingarea"/>
diff --git a/include/editeng/edtdlg.hxx b/include/editeng/edtdlg.hxx
index 6483f8c2f0a3..d1d6e3f1d184 100644
--- a/include/editeng/edtdlg.hxx
+++ b/include/editeng/edtdlg.hxx
@@ -25,6 +25,7 @@
#include <i18nlangtag/lang.h>
#include <com/sun/star/uno/Reference.hxx>
#include <vcl/abstdlg.hxx>
+#include <vcl/weld.hxx>
#include <editeng/hangulhanja.hxx>
namespace com { namespace sun { namespace star { namespace linguistic2
@@ -62,13 +63,13 @@ public:
virtual void SetConversionDirectionState( bool _bTryBothDirections, editeng::HangulHanjaConversion::ConversionDirection _ePrimaryConversionDirection ) = 0;
virtual void SetConversionFormat( editeng::HangulHanjaConversion::ConversionFormat _eType ) = 0;
virtual void SetOptionsChangedHdl( const Link<LinkParamNone*,void>& _rHdl ) = 0;
- virtual void SetIgnoreHdl( const Link<Button*,void>& _rHdl ) = 0;
- virtual void SetIgnoreAllHdl( const Link<Button*,void>& _rHdl ) = 0;
- virtual void SetChangeHdl( const Link<Button*,void>& _rHdl ) = 0;
- virtual void SetChangeAllHdl( const Link<Button*,void>& _rHdl ) = 0;
- virtual void SetClickByCharacterHdl( const Link<CheckBox*,void>& _rHdl ) = 0;
- virtual void SetConversionFormatChangedHdl( const Link<Button*,void>& _rHdl ) = 0;
- virtual void SetFindHdl( const Link<Button*,void>& _rHdl ) = 0;
+ virtual void SetIgnoreHdl( const Link<weld::Button&,void>& _rHdl ) = 0;
+ virtual void SetIgnoreAllHdl( const Link<weld::Button&,void>& _rHdl ) = 0;
+ virtual void SetChangeHdl( const Link<weld::Button&,void>& _rHdl ) = 0;
+ virtual void SetChangeAllHdl( const Link<weld::Button&,void>& _rHdl ) = 0;
+ virtual void SetClickByCharacterHdl( const Link<weld::ToggleButton&,void>& _rHdl ) = 0;
+ virtual void SetConversionFormatChangedHdl( const Link<weld::Button&,void>& _rHdl ) = 0;
+ virtual void SetFindHdl( const Link<weld::Button&,void>& _rHdl ) = 0;
virtual bool GetUseBothDirections() const= 0;
virtual editeng::HangulHanjaConversion::ConversionDirection
GetDirection( editeng::HangulHanjaConversion::ConversionDirection _eDefaultDirection ) const = 0;
@@ -95,7 +96,7 @@ public:
const OUString &rWord, LanguageType nLang,
css::uno::Reference< css::linguistic2::XHyphenator > &xHyphen,
SvxSpellWrapper* pWrapper) = 0;
- virtual VclPtr<AbstractHangulHanjaConversionDialog> CreateHangulHanjaConversionDialog( vcl::Window* _pParent ) = 0;
+ virtual VclPtr<AbstractHangulHanjaConversionDialog> CreateHangulHanjaConversionDialog(weld::Window* pParent) = 0;
};
#endif
diff --git a/include/editeng/hangulhanja.hxx b/include/editeng/hangulhanja.hxx
index 034db6022c8d..21eae6a2a726 100644
--- a/include/editeng/hangulhanja.hxx
+++ b/include/editeng/hangulhanja.hxx
@@ -107,7 +107,7 @@ namespace editeng
public:
HangulHanjaConversion(
- vcl::Window* _pUIParent,
+ weld::Window* pUIParent,
const css::uno::Reference< css::uno::XComponentContext >& rxContext,
const css::lang::Locale& _rSourceLocale,
const css::lang::Locale& _rTargetLocale,
diff --git a/include/svtools/valueset.hxx b/include/svtools/valueset.hxx
index d0a50fcf76c6..da25780b02cd 100644
--- a/include/svtools/valueset.hxx
+++ b/include/svtools/valueset.hxx
@@ -547,6 +547,8 @@ public:
void SetItemImage( sal_uInt16 nItemId, const Image& rImage );
Image GetItemImage( sal_uInt16 nItemId ) const;
Color GetItemColor( sal_uInt16 nItemId ) const;
+ void SetItemData( sal_uInt16 nItemId, void* pData );
+ void* GetItemData( sal_uInt16 nItemId ) const;
void SetItemText( sal_uInt16 nItemId, const OUString& rStr );
OUString GetItemText( sal_uInt16 nItemId ) const;
bool IsColor() const
diff --git a/include/vcl/weld.hxx b/include/vcl/weld.hxx
index aa0394d0ea87..7524d777a909 100644
--- a/include/vcl/weld.hxx
+++ b/include/vcl/weld.hxx
@@ -22,6 +22,7 @@
#include <vcl/font.hxx>
#include <vcl/menu.hxx>
#include <vcl/uitest/factory.hxx>
+#include <vcl/wall.hxx>
#include <com/sun/star/accessibility/XAccessibleRelationSet.hpp>
#include <com/sun/star/accessibility/XAccessible.hpp>
@@ -162,6 +163,8 @@ public:
// font size is in points, not pixels, e.g. see Window::[G]etPointFont
virtual vcl::Font get_font() = 0;
+ virtual Wallpaper get_wallpaper() const = 0;
+
//true for rtl, false otherwise
virtual bool get_direction() const = 0;
virtual void set_direction(bool bRTL) = 0;
diff --git a/solenv/bin/native-code.py b/solenv/bin/native-code.py
index be38032d6d90..2b887fd20976 100755
--- a/solenv/bin/native-code.py
+++ b/solenv/bin/native-code.py
@@ -471,7 +471,6 @@ custom_widgets = [
'RowEdit',
'RubyEdit',
'RubyPreview',
- 'RubyRadioButton',
'SFTreeListBox',
'SameContentListBox',
'ScAutoFmtPreview',
@@ -501,7 +500,6 @@ custom_widgets = [
'SpacingListBox',
'StatusBar',
'StructListBox',
- 'SuggestionDisplay',
'SvSimpleTableContainer',
'SvTreeListBox',
'SvtFileView',
diff --git a/solenv/gbuild/UIConfig.mk b/solenv/gbuild/UIConfig.mk
index 08922c5c955a..1b9c61fd80b6 100644
--- a/solenv/gbuild/UIConfig.mk
+++ b/solenv/gbuild/UIConfig.mk
@@ -144,7 +144,7 @@ gb_UIConfig_gla11y_PARAMETERS += --widgets-needlabel +foruilo-RefEdit
# These are storage, containers, or preview
gb_UIConfig_gla11y_PARAMETERS += --widgets-suffixignored +ValueSet,HBox,VBox,ToolBox,Preview,PreviewWin,PreviewWindow,PrevWindow
# These are buttons, thus already contain their label (but an image is not enough)
-gb_UIConfig_gla11y_PARAMETERS += --widgets-button +vcllo-SmallButton,cuilo-RubyRadioButton,chartcontrollerlo-LightButton,svtlo-ManagedMenuButton
+gb_UIConfig_gla11y_PARAMETERS += --widgets-button +vcllo-SmallButton,chartcontrollerlo-LightButton,svtlo-ManagedMenuButton
# All new warnings should be fatal except a few kinds which could be only doubtful
gb_UIConfig_gla11y_PARAMETERS += --fatal-all --not-fatal-type duplicate-mnemonic --not-fatal-type labelled-by-and-mnemonic --not-fatal-type orphan-label
diff --git a/solenv/sanitizers/ui/cui.suppr b/solenv/sanitizers/ui/cui.suppr
index c472d257df2a..b0ca8cdc1021 100644
--- a/solenv/sanitizers/ui/cui.suppr
+++ b/solenv/sanitizers/ui/cui.suppr
@@ -229,14 +229,15 @@ cui/uiconfig/ui/gallerygeneralpage.ui://GtkLabel[@id='contents'] orphan-label
cui/uiconfig/ui/gallerysearchprogress.ui://GtkLabel[@id='file'] orphan-label
cui/uiconfig/ui/gallerysearchprogress.ui://GtkLabel[@id='dir'] orphan-label
cui/uiconfig/ui/galleryupdateprogress.ui://GtkLabel[@id='file'] orphan-label
-cui/uiconfig/ui/hangulhanjaconversiondialog.ui://GtkLabel[@id='label1'] orphan-label
cui/uiconfig/ui/hangulhanjaconversiondialog.ui://GtkLabel[@id='originalword'] orphan-label
-cui/uiconfig/ui/hangulhanjaconversiondialog.ui://GtkLabel[@id='label3'] orphan-label
-cui/uiconfig/ui/hangulhanjaconversiondialog.ui://GtkEntry[@id='wordinput'] no-labelled-by
cui/uiconfig/ui/hangulhanjaconversiondialog.ui://GtkLabel[@id='label4'] orphan-label
-cui/uiconfig/ui/hangulhanjaconversiondialog.ui://cuilo-SuggestionDisplay[@id='suggestions:border'] no-labelled-by
+cui/uiconfig/ui/hangulhanjaconversiondialog.ui://GtkDrawingArea[@id='suggestions'] no-labelled-by
cui/uiconfig/ui/hangulhanjaconversiondialog.ui://GtkLabel[@id='label5'] orphan-label
cui/uiconfig/ui/hangulhanjaconversiondialog.ui://GtkLabel[@id='label6'] orphan-label
+cui/uiconfig/ui/hangulhanjaconversiondialog.ui://GtkRadioButton[@id='hanja_above'] button-no-label
+cui/uiconfig/ui/hangulhanjaconversiondialog.ui://GtkRadioButton[@id='hanja_below'] button-no-label
+cui/uiconfig/ui/hangulhanjaconversiondialog.ui://GtkRadioButton[@id='hangul_above'] button-no-label
+cui/uiconfig/ui/hangulhanjaconversiondialog.ui://GtkRadioButton[@id='hangul_below'] button-no-label
cui/uiconfig/ui/hangulhanjaeditdictdialog.ui://GtkEntry[@id='edit1'] no-labelled-by
cui/uiconfig/ui/hangulhanjaeditdictdialog.ui://GtkEntry[@id='edit2'] no-labelled-by
cui/uiconfig/ui/hangulhanjaeditdictdialog.ui://GtkEntry[@id='edit3'] no-labelled-by
diff --git a/svtools/source/control/valueimp.hxx b/svtools/source/control/valueimp.hxx
index 2fdd85590623..c960434a6159 100644
--- a/svtools/source/control/valueimp.hxx
+++ b/svtools/source/control/valueimp.hxx
@@ -78,6 +78,7 @@ struct SvtValueSetItem
Image maImage;
Color maColor;
OUString maText;
+ void* mpData;
css::uno::Reference< css::accessibility::XAccessible > mxAcc;
explicit SvtValueSetItem( SvtValueSet& rParent );
diff --git a/svtools/source/control/valueset.cxx b/svtools/source/control/valueset.cxx
index c9cfe843220c..3f8c91900fe5 100644
--- a/svtools/source/control/valueset.cxx
+++ b/svtools/source/control/valueset.cxx
@@ -3807,6 +3807,38 @@ void SvtValueSet::SetFormat()
mbFormat = true;
}
+void SvtValueSet::SetItemData( sal_uInt16 nItemId, void* pData )
+{
+ size_t nPos = GetItemPos( nItemId );
+
+ if ( nPos == VALUESET_ITEM_NOTFOUND )
+ return;
+
+ SvtValueSetItem* pItem = mItemList[nPos].get();
+ pItem->mpData = pData;
+
+ if ( pItem->meType == VALUESETITEM_USERDRAW )
+ {
+ if ( !mbFormat && IsReallyVisible() && IsUpdateMode() )
+ {
+ const tools::Rectangle aRect = ImplGetItemRect(nPos);
+ Invalidate(aRect);
+ }
+ else
+ mbFormat = true;
+ }
+}
+
+void* SvtValueSet::GetItemData( sal_uInt16 nItemId ) const
+{
+ size_t nPos = GetItemPos( nItemId );
+
+ if ( nPos != VALUESET_ITEM_NOTFOUND )
+ return mItemList[nPos]->mpData;
+ else
+ return nullptr;
+}
+
void SvtValueSet::SetItemText(sal_uInt16 nItemId, const OUString& rText)
{
size_t nPos = GetItemPos( nItemId );
diff --git a/sw/source/uibase/lingu/hhcwrp.cxx b/sw/source/uibase/lingu/hhcwrp.cxx
index 8fce3fae3a3a..652a9998f873 100644
--- a/sw/source/uibase/lingu/hhcwrp.cxx
+++ b/sw/source/uibase/lingu/hhcwrp.cxx
@@ -88,7 +88,7 @@ SwHHCWrapper::SwHHCWrapper(
sal_Int32 nConvOptions,
bool bIsInteractive,
bool bStart, bool bOther, bool bSelection )
- : editeng::HangulHanjaConversion( &pSwView->GetEditWin(), rxContext,
+ : editeng::HangulHanjaConversion(pSwView->GetEditWin().GetFrameWeld(), rxContext,
LanguageTag::convertToLocale( nSourceLanguage ),
LanguageTag::convertToLocale( nTargetLanguage ),
pTargetFont,
diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx
index 54faef46fec7..76650b141e0a 100644
--- a/vcl/source/app/salvtables.cxx
+++ b/vcl/source/app/salvtables.cxx
@@ -386,6 +386,11 @@ public:
return m_xWidget->GetPointFont(*m_xWidget);
}
+ virtual Wallpaper get_wallpaper() const override
+ {
+ return Wallpaper(Application::GetSettings().GetStyleSettings().GetDialogColor());
+ }
+
virtual OString get_buildable_name() const override
{
return m_xWidget->get_id().toUtf8();
@@ -1392,8 +1397,7 @@ public:
m_xButton->SetImageAlign(ImageAlign::Left);
if (pDevice)
{
- BitmapEx aBitmap(pDevice->GetBitmap(Point(0, 0), pDevice->GetOutputSize()));
- m_xButton->SetModeImage(Image(aBitmap));
+ m_xButton->SetModeImage(createImage(*pDevice));
}
else
m_xButton->SetModeImage(Image());
@@ -1589,6 +1593,9 @@ public:
}
};
+#include <vcl/pngwrite.hxx>
+#include <tools/stream.hxx>
+
IMPL_LINK_NOARG(SalInstanceLinkButton, ClickHdl, FixedHyperlink&, void)
{
signal_clicked();
@@ -1621,6 +1628,23 @@ public:
return m_xRadioButton->IsChecked();
}
+ virtual void set_image(VirtualDevice* pDevice) override
+ {
+ m_xRadioButton->SetImageAlign(ImageAlign::Center);
+ if (pDevice)
+ {
+ BitmapEx aBitmap(pDevice->GetBitmapEx(Point(0, 0), pDevice->GetOutputSize()));
+
+ vcl::PNGWriter aWriter(aBitmap);
+ SvFileStream sOutput("file:///tmp/demo.png", StreamMode::WRITE);
+ aWriter.Write(sOutput);
+
+ m_xRadioButton->SetModeImage(createImage(*pDevice));
+ }
+ else
+ m_xRadioButton->SetModeImage(Image());
+ }
+
virtual void set_from_icon_name(const OUString& rIconName) override
{
m_xRadioButton->SetModeRadioImage(::Image(StockImage::Yes, rIconName));
diff --git a/vcl/unx/gtk3/gtk3gtkinst.cxx b/vcl/unx/gtk3/gtk3gtkinst.cxx
index 1aa6a6ca36f0..e6ab4936dcfa 100644
--- a/vcl/unx/gtk3/gtk3gtkinst.cxx
+++ b/vcl/unx/gtk3/gtk3gtkinst.cxx
@@ -1428,6 +1428,11 @@ public:
Application::GetSettings().GetUILanguageTag().getLocale());
}
+ virtual Wallpaper get_wallpaper() const override
+ {
+ return Wallpaper(COL_TRANSPARENT);
+ }
+
virtual void set_grid_left_attach(int nAttach) override
{
GtkContainer* pParent = GTK_CONTAINER(gtk_widget_get_parent(m_pWidget));
@@ -3767,6 +3772,9 @@ public:
}
};
+#include <vcl/pngwrite.hxx>
+#include <tools/stream.hxx>
+
class GtkInstanceButton : public GtkInstanceContainer, public virtual weld::Button
{
private: