[Libreoffice-commits] core.git: Branch 'feature/jsdialogs' - 3151 commits - accessibility/inc accessibility/Library_acc.mk accessibility/source android/Bootstrap android/CustomTarget_lo_android.mk android/mobile-config.py android/README android/source autogen.sh avmedia/Library_avmedia.mk avmedia/source basctl/inc basctl/source basctl/uiconfig basic/source bin/check-elf-dynamic-objects bin/lo-all-static-libs bin/lo-xlate-lang bin/pack-debug bin/upload_symbols.py bridges/Library_cpp_uno.mk bridges/source canvas/source chart2/inc chart2/Library_chartcontroller.mk chart2/qa chart2/source chart2/uiconfig chart2/UIConfig_chart2.mk comphelper/Library_comphelper.mk comphelper/source compilerplugins/clang compilerplugins/LICENSE.TXT config_host/config_features.h.in config_host/config_vclplug.h.in config_host.mk.in configmgr/source configure.ac connectivity/Library_mysqlc.mk connectivity/Module_connectivity.mk connectivity/qa connectivity/registry connectivity/source cppcanvas/source cppuhelper/Library_cp puhelper.mk cppuhelper/source cppu/source cui/inc cui/qa cui/source cui/uiconfig dbaccess/Module_dbaccess.mk dbaccess/qa dbaccess/source dbaccess/uiconfig desktop/CppunitTest_desktop_lib.mk desktop/inc desktop/Library_offacc.mk desktop/Library_sofficeapp.mk desktop/qa desktop/source desktop/uiconfig desktop/unx dictionaries distro-configs/CPAndroidAarch64.conf distro-configs/CPAndroidBranding.conf distro-configs/CPAndroid.conf distro-configs/CPLinux.conf distro-configs/CPLinux-LOKit.conf distro-configs/CPOSX.conf distro-configs/CPWin32.conf distro-configs/CPWin32-MPL.conf distro-configs/Jenkins distro-configs/LibreOfficeAndroidAarch64.conf distro-configs/LibreOfficeAndroid.conf distro-configs/LibreOfficeAndroidX86_64.conf distro-configs/LibreOfficeAndroidX86.conf distro-configs/LibreOfficeFlatpak.conf distro-configs/LibreOfficeiOS.conf distro-configs/LibreOfficeiOS_Sim.conf distro-configs/LibreOfficeVanillaMacAppStore.conf download.lst drawinglayer/source dtrans/source editeng/sourc e embeddedobj/source emfio/source extensions/Executable_twain32shim.mk extensions/inc extensions/Library_oleautobridge.mk extensions/Library_scn.mk extensions/Module_extensions.mk extensions/source extensions/test extensions/uiconfig external/apr external/breakpad external/cairo external/curl external/epoxy external/expat external/gpgmepp external/graphite external/icu external/lcms2 external/libabw external/libcdr external/libcmis external/libetonyek external/libgpg-error external/libnumbertext external/liborcus external/libpng external/libqxp external/libvisio external/libwpd external/libwpg external/libxml2 external/libxslt external/mdnsresponder external/Module_external.mk external/more_fonts external/neon external/noto_font external/nss external/owncloud-android-lib external/poppler external/postgresql external/python3 external/twain_dsm extras/CustomTarget_autocorr.mk extras/Package_autocorr.mk extras/source filter/Configuration_filter.mk filter/CppunitTest_filter_svg.mk filte r/Module_filter.mk filter/qa filter/source filter/uiconfig forms/source formula/source fpicker/source framework/inc framework/Library_fwk.mk framework/qa framework/source framework/uiconfig .git-hooks/pre-commit .gitignore .gitreview helpcontent2 i18nlangtag/source i18npool/Library_localedata_others.mk i18npool/source i18nutil/source icon-themes/breeze icon-themes/breeze_dark icon-themes/breeze_svg icon-themes/colibre icon-themes/colibre_svg icon-themes/elementary icon-themes/elementary_svg icon-themes/galaxy icon-themes/karasa_jaga icon-themes/sifr icon-themes/sifr_dark icon-themes/sifr_svg icon-themes/tango include/android include/basegfx include/com include/comphelper include/connectivity include/editeng include/formula include/i18nutil include/ios include/IwyuFilter_include.yaml include/LibreOfficeKit include/o3tl include/oox include/osl include/sal include/sax include/sfx2 include/sot include/svl include/svtools include/svx include/test include/toolkit include/tools include/uno tools include/vcl include/xmloff instsetoo_native/CustomTarget_install.mk instsetoo_native/CustomTarget_setup.mk instsetoo_native/inc_common instsetoo_native/inc_ooohelppack instsetoo_native/inc_openoffice instsetoo_native/inc_sdkoo instsetoo_native/util ios/CustomTarget_iOS_setup.mk ios/LibreOfficeLight ios/Module_ios.mk ios/source ios/StaticLibrary_ios.mk jurt/com jvmfwk/distributions jvmfwk/inc jvmfwk/plugins jvmfwk/source l10ntools/inc l10ntools/source librelogo/source libreofficekit/qa libreofficekit/source lingucomponent/Library_MacOSXSpell.mk lingucomponent/Module_lingucomponent.mk lingucomponent/source lotuswordpro/source Makefile.fetch Makefile.in o3tl/qa odk/build-examples_common.mk odk/CustomTarget_javadoc.mk odk/docs odk/examples odk/index.html odk/index_online.html odk/Package_share_readme.mk offapi/com offapi/UnoApi_offapi.mk officecfg/registry oovbaapi/ooo oox/CppunitTest_oox_drawingml.mk oox/CppunitTest_oox_mathml.mk oox/documentation oox/inc oox/Library_oox.mk oox/M odule_oox.mk oox/qa oox/source package/Library_xstor.mk package/source postprocess/CustomTarget_registry.mk postprocess/Module_postprocess.mk postprocess/Rdb_services.mk postprocess/signing pyuno/source qadevOOo/runner qadevOOo/tests readlicense_oo/CustomTarget_license.mk readlicense_oo/docs readlicense_oo/license readlicense_oo/Module_readlicense_oo.mk readlicense_oo/Package_files.mk readlicense_oo/Package_license.mk readlicense_oo/README README.md registry/source reportbuilder/java reportdesign/inc reportdesign/source reportdesign/uiconfig RepositoryExternal.mk Repository.mk RepositoryModule_host.mk sal/android sal/osl sal/qa sal/rtl sax/source scaddins/source sc/CppunitTest_sc_pdf_export.mk schema/libreoffice sc/inc sc/Library_sc.mk sc/Module_sc.mk scp2/AutoInstall.mk scp2/InstallModule_spsupp.mk scp2/InstallScript_setup_osl.mk scp2/Module_scp2.mk scp2/source sc/qa scripting/examples scripting/Package_ScriptsPython.mk scripting/source sc/sdi sc/source sc/uiconfig sc/UIConfig_scal c.mk sd/CppunitTest_sd_activex_controls_tests.mk sd/CppunitTest_sd_import_tests.mk sd/CppunitTest_sd_uiimpress.mk sdext/Module_sdext.mk sdext/source sd/inc sd/Library_sd.mk sd/Module_sd.mk sd/qa sd/sdi sd/source sd/uiconfig sd/UIConfig_sdraw.mk setup_native/Library_reg_dlls.mk setup_native/Module_setup_native.mk setup_native/source sfx2/inc sfx2/Library_sfx.mk sfx2/qa sfx2/sdi sfx2/source sfx2/uiconfig sfx2/UIConfig_sfx.mk shell/AllLangMoTarget_shell.mk shell/CustomTarget_x64.mk shell/Executable_spsupp_helper.mk shell/inc shell/Library_spsupp.mk shell/Library_spsupp_x64.mk shell/Library_spsupp_x86.mk shell/Module_shell.mk shell/source shell/WinResTarget_spsupp_dlg.mk slideshow/Library_slideshow.mk slideshow/source slideshow/test solenv/bin solenv/clang-format solenv/flatpak-manifest.in solenv/gbuild solenv/sanitizers sot/source starmath/inc starmath/source starmath/uiconfig stoc/source svgio/CppunitTest_svgio_read.mk svgio/inc svgio/Library_svgio.mk svgio/Module_svgio.mk svgio/qa sv gio/source svl/CppunitTest_svl_lockfiles.mk svl/Library_svl.mk svl/Module_svl.mk svl/qa svl/source svtools/CppunitTest_svtools_dialogs_test.mk svtools/inc svtools/Library_svt.mk svtools/qa svtools/source svtools/uiconfig svx/inc svx/Library_svx.mk svx/sdi svx/source svx/uiconfig sw/CppunitTest_sw_core_doc.mk sw/CppunitTest_sw_core_layout.mk sw/CppunitTest_sw_core_text.mk sw/CppunitTest_sw_ooxmlexport13.mk sw/CppunitTest_sw_ooxmlimport2.mk sw/CppunitTest_sw_uibase_shells.mk sw/CppunitTest_sw_unowriter.mk sw/CppunitTest_sw_ww8import.mk sw/inc sw/Library_sw.mk sw/Library_swui.mk sw/Module_sw.mk sw/ooxmlexport_setup.mk sw/qa sw/sdi sw/source sw/uiconfig sw/UIConfig_swriter.mk sysui/CustomTarget_infoplist.mk sysui/desktop sysui/Package_infoplist.mk sysui/productlist.mk test/Library_test.mk test/source toolkit/CppunitTest_toolkit.mk toolkit/qa toolkit/source tools/Library_tl.mk tools/qa tools/source translations ucb/source uitest/writer_tests unotools/Library_utl.mk unotools/source unoxml /source uui/source uui/uiconfig vbahelper/source vcl/android vcl/CppunitTest_vcl_gen.mk vcl/CppunitTest_vcl_outdev.mk vcl/CppunitTest_vcl_widget_definition_reader_test.mk vcl/CustomTarget_qt5_moc.mk vcl/headless vcl/inc vcl/ios vcl/jsdialog vcl/Library_vcl.mk vcl/Library_vclplug_gtk3_kde5.mk vcl/Library_vclplug_qt5.mk vcl/Library_vclplug_win.mk vcl/Module_vcl.mk vcl/opengl vcl/osx vcl/Package_theme_definitions.mk vcl/qa vcl/qt5 vcl/quartz vcl/source vcl/uiconfig vcl/UIConfig_vcl.mk vcl/unx vcl/vcl.ios.component vcl/win vcl/workben wizards/com wizards/source writerfilter/CppunitTest_writerfilter_dmapper.mk writerfilter/Module_writerfilter.mk writerfilter/qa writerfilter/source xmloff/inc xmloff/source xmlscript/source xmlsecurity/CppunitTest_xmlsecurity_pdfsigning.mk xmlsecurity/CppunitTest_xmlsecurity_signing.mk xmlsecurity/inc xmlsecurity/Library_xsec_xmlsec.mk xmlsecurity/qa xmlsecurity/source xmlsecurity/uiconfig
Szymon KÅos (via logerrit)
logerrit at kemper.freedesktop.org
Mon Mar 2 07:29:49 UTC 2020
Rebased ref, commits from common ancestor:
commit 9831c2e9686760a7ad4ba60cde66f2f7035b4f4a
Author: Szymon Kłos <szymon.klos at collabora.com>
AuthorDate: Fri Feb 28 15:10:24 2020 +0100
Commit: Szymon Kłos <szymon.klos at collabora.com>
CommitDate: Fri Feb 28 15:10:24 2020 +0100
jsdialog: react on button state change
Change-Id: I19b8b4f123373da1acc7e2815086a67bcdb43e76
diff --git a/vcl/inc/jsdialog/jsdialogbuilder.hxx b/vcl/inc/jsdialog/jsdialogbuilder.hxx
index 263215819aa8..fedbbf860e82 100644
--- a/vcl/inc/jsdialog/jsdialogbuilder.hxx
+++ b/vcl/inc/jsdialog/jsdialogbuilder.hxx
@@ -8,6 +8,7 @@
#include <vcl/builder.hxx>
#include <salvtables.hxx>
#include <vcl/combobox.hxx>
+#include <vcl/button.hxx>
class JSDialogSender
{
@@ -26,6 +27,7 @@ public:
JSInstanceBuilder(weld::Widget* pParent, const OUString& rUIRoot, const OUString& rUIFile);
virtual std::unique_ptr<weld::Dialog> weld_dialog(const OString& id, bool bTakeOwnership = true) override;
virtual std::unique_ptr<weld::Label> weld_label(const OString &id, bool bTakeOwnership = false) override;
+ virtual std::unique_ptr<weld::Button> weld_button(const OString &id, bool bTakeOwnership = false) override;
virtual std::unique_ptr<weld::Entry> weld_entry(const OString& id, bool bTakeOwnership = false) override;
virtual std::unique_ptr<weld::ComboBox> weld_combo_box(const OString& id, bool bTakeOwnership = false) override;
};
@@ -51,6 +53,12 @@ public:
BaseInstanceClass::hide();
notifyDialogState();
}
+
+ virtual void set_sensitive(bool sensitive) override
+ {
+ BaseInstanceClass::set_sensitive(sensitive);
+ notifyDialogState();
+ }
};
class JSLabel : public JSWidget<SalInstanceLabel, FixedText>
@@ -61,6 +69,13 @@ public:
virtual void set_label(const OUString& rText) override;
};
+class JSButton : public JSWidget<SalInstanceButton, ::Button>
+{
+public:
+ JSButton(VclPtr<vcl::Window> aOwnedToplevel, ::Button* pButton,
+ SalInstanceBuilder* pBuilder, bool bTakeOwnership);
+};
+
class JSEntry : public JSWidget<SalInstanceEntry, ::Edit>
{
public:
diff --git a/vcl/jsdialog/jsdialogbuilder.cxx b/vcl/jsdialog/jsdialogbuilder.cxx
index fa54c3fb90ca..4a28ed1933a0 100644
--- a/vcl/jsdialog/jsdialogbuilder.cxx
+++ b/vcl/jsdialog/jsdialogbuilder.cxx
@@ -63,6 +63,12 @@ std::unique_ptr<weld::Label> JSInstanceBuilder::weld_label(const OString &id, bo
return std::make_unique<JSLabel>(m_aOwnedToplevel, pLabel, this, bTakeOwnership);
}
+std::unique_ptr<weld::Button> JSInstanceBuilder::weld_button(const OString &id, bool bTakeOwnership)
+{
+ ::Button* pButton = m_xBuilder->get<::Button>(id);
+ return pButton ? o3tl::make_unique<JSButton>(m_aOwnedToplevel, pButton, this, bTakeOwnership) : nullptr;
+}
+
std::unique_ptr<weld::Entry> JSInstanceBuilder::weld_entry(const OString& id, bool bTakeOwnership)
{
Edit* pEntry = m_xBuilder->get<Edit>(id);
@@ -94,6 +100,13 @@ void JSLabel::set_label(const OUString& rText)
notifyDialogState();
};
+JSButton::JSButton(VclPtr<vcl::Window> aOwnedToplevel, ::Button* pButton,
+ SalInstanceBuilder* pBuilder, bool bTakeOwnership)
+: JSWidget<SalInstanceButton, ::Button>(aOwnedToplevel, pButton, pBuilder, bTakeOwnership)
+{
+}
+
+
JSEntry::JSEntry(VclPtr<vcl::Window> aOwnedToplevel, ::Edit* pEntry,
SalInstanceBuilder* pBuilder, bool bTakeOwnership)
: JSWidget<SalInstanceEntry, ::Edit>(aOwnedToplevel, pEntry, pBuilder, bTakeOwnership)
commit 6ba7c4472481f21bbc83db5547eff383ca066ec6
Author: Szymon Kłos <szymon.klos at collabora.com>
AuthorDate: Fri Feb 28 14:40:03 2020 +0100
Commit: Szymon Kłos <szymon.klos at collabora.com>
CommitDate: Fri Feb 28 14:40:03 2020 +0100
Move SalInstanceButton to header file
Change-Id: I3f6aa1975ae5859e0c340c82627d95e49313a668
diff --git a/vcl/inc/salvtables.hxx b/vcl/inc/salvtables.hxx
index 042d738c2950..9426b3de1ca5 100644
--- a/vcl/inc/salvtables.hxx
+++ b/vcl/inc/salvtables.hxx
@@ -640,4 +640,27 @@ public:
virtual ~SalInstanceComboBoxWithEdit() override;
};
+class SalInstanceButton : public SalInstanceContainer, public virtual weld::Button
+{
+private:
+ VclPtr<::Button> m_xButton;
+ Link<::Button*,void> const m_aOldClickHdl;
+
+ DECL_LINK(ClickHdl, ::Button*, void);
+public:
+ SalInstanceButton(::Button* pButton, SalInstanceBuilder* pBuilder, bool bTakeOwnership);
+
+ virtual void set_label(const OUString& rText) override;
+
+ virtual void set_image(VirtualDevice* pDevice) override;
+
+ virtual void set_from_icon_name(const OUString& rIconName) override;
+
+ virtual void set_label_line_wrap(bool wrap) override;
+
+ virtual OUString get_label() const override;
+
+ virtual ~SalInstanceButton() override;
+};
+
#endif
\ No newline at end of file
diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx
index f9451e3c7f2d..f8be40736a3f 100644
--- a/vcl/source/app/salvtables.cxx
+++ b/vcl/source/app/salvtables.cxx
@@ -1196,64 +1196,55 @@ IMPL_LINK_NOARG(SalInstanceNotebook, ActivatePageHdl, TabControl*, void)
m_aEnterPageHdl.Call(get_current_page_ident());
}
-class SalInstanceButton : public SalInstanceContainer, public virtual weld::Button
+SalInstanceButton::SalInstanceButton(::Button* pButton, SalInstanceBuilder* pBuilder, bool bTakeOwnership)
+ : SalInstanceContainer(pButton, pBuilder, bTakeOwnership)
+ , m_xButton(pButton)
+ , m_aOldClickHdl(pButton->GetClickHdl())
{
-private:
- VclPtr<::Button> m_xButton;
- Link<::Button*,void> const m_aOldClickHdl;
-
- DECL_LINK(ClickHdl, ::Button*, void);
-public:
- SalInstanceButton(::Button* pButton, SalInstanceBuilder* pBuilder, bool bTakeOwnership)
- : SalInstanceContainer(pButton, pBuilder, bTakeOwnership)
- , m_xButton(pButton)
- , m_aOldClickHdl(pButton->GetClickHdl())
- {
- m_xButton->SetClickHdl(LINK(this, SalInstanceButton, ClickHdl));
- }
+ m_xButton->SetClickHdl(LINK(this, SalInstanceButton, ClickHdl));
+}
- virtual void set_label(const OUString& rText) override
- {
- m_xButton->SetText(rText);
- }
+void SalInstanceButton::set_label(const OUString& rText)
+{
+ m_xButton->SetText(rText);
+}
- virtual void set_image(VirtualDevice* pDevice) override
+void SalInstanceButton::set_image(VirtualDevice* pDevice)
+{
+ m_xButton->SetImageAlign(ImageAlign::Left);
+ if (pDevice)
{
- m_xButton->SetImageAlign(ImageAlign::Left);
- if (pDevice)
- {
- BitmapEx aBitmap(pDevice->GetBitmap(Point(0, 0), pDevice->GetOutputSize()));
- m_xButton->SetModeImage(Image(aBitmap));
- }
- else
- m_xButton->SetModeImage(Image());
+ BitmapEx aBitmap(pDevice->GetBitmap(Point(0, 0), pDevice->GetOutputSize()));
+ m_xButton->SetModeImage(Image(aBitmap));
}
+ else
+ m_xButton->SetModeImage(Image());
+}
- virtual void set_from_icon_name(const OUString& rIconName) override
- {
- m_xButton->SetModeImage(::Image(BitmapEx(rIconName)));
- }
+void SalInstanceButton::set_from_icon_name(const OUString& rIconName)
+{
+ m_xButton->SetModeImage(::Image(BitmapEx(rIconName)));
+}
- virtual void set_label_line_wrap(bool wrap) override
- {
- WinBits nBits = m_xButton->GetStyle();
- nBits &= ~WB_WORDBREAK;
- if (wrap)
- nBits |= WB_WORDBREAK;
- m_xButton->SetStyle(nBits);
- m_xButton->queue_resize();
- }
+void SalInstanceButton::set_label_line_wrap(bool wrap)
+{
+ WinBits nBits = m_xButton->GetStyle();
+ nBits &= ~WB_WORDBREAK;
+ if (wrap)
+ nBits |= WB_WORDBREAK;
+ m_xButton->SetStyle(nBits);
+ m_xButton->queue_resize();
+}
- virtual OUString get_label() const override
- {
- return m_xButton->GetText();
- }
+OUString SalInstanceButton::get_label() const
+{
+ return m_xButton->GetText();
+}
- virtual ~SalInstanceButton() override
- {
- m_xButton->SetClickHdl(Link<::Button*,void>());
- }
-};
+SalInstanceButton::~SalInstanceButton()
+{
+ m_xButton->SetClickHdl(Link<::Button*,void>());
+}
IMPL_LINK(SalInstanceButton, ClickHdl, ::Button*, pButton, void)
{
commit f230a6b3f3909b2949c4b2254c854f2b17b16e51
Author: Szymon Kłos <szymon.klos at collabora.com>
AuthorDate: Fri Feb 28 14:39:35 2020 +0100
Commit: Szymon Kłos <szymon.klos at collabora.com>
CommitDate: Fri Feb 28 14:39:35 2020 +0100
jsdialog: react on edit text change
Change-Id: Icc9f2c823824be2a7e6662fe4a6d7db78279b515
diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index d64e827e006a..91379bbbf1c8 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -3575,7 +3575,7 @@ static void doc_sendDialogEvent(LibreOfficeKitDocument* /*pThis*/, unsigned nWin
{
pUIWindow->execute(sDownAction, aMap);
}
- else if (aMap["cmd"] == "set")
+ else if (aMap["cmd"] == "set" || aMap["cmd"] == "change")
{
aMap["TEXT"] = aMap["data"];
commit 254c7d7f69bd08758aa7588c3899fea30e701f45
Author: Szymon Kłos <szymon.klos at collabora.com>
AuthorDate: Fri Feb 28 13:47:22 2020 +0100
Commit: Szymon Kłos <szymon.klos at collabora.com>
CommitDate: Fri Feb 28 13:48:30 2020 +0100
jsdialog: Common weld::Widget implementation
Change-Id: Iab21652c6abaf143fb421d6030f6acc394733bcb
diff --git a/vcl/inc/jsdialog/jsdialogbuilder.hxx b/vcl/inc/jsdialog/jsdialogbuilder.hxx
index 1bc390fadd33..263215819aa8 100644
--- a/vcl/inc/jsdialog/jsdialogbuilder.hxx
+++ b/vcl/inc/jsdialog/jsdialogbuilder.hxx
@@ -30,7 +30,30 @@ public:
virtual std::unique_ptr<weld::ComboBox> weld_combo_box(const OString& id, bool bTakeOwnership = false) override;
};
-class JSLabel : public SalInstanceLabel, public JSDialogSender
+template<class BaseInstanceClass, class VclClass>
+class JSWidget : public BaseInstanceClass, public JSDialogSender
+{
+public:
+ JSWidget(VclPtr<vcl::Window> aOwnedToplevel, VclClass* pObject,
+ SalInstanceBuilder* pBuilder, bool bTakeOwnership)
+ : BaseInstanceClass(pObject, pBuilder, bTakeOwnership)
+ , JSDialogSender(aOwnedToplevel)
+ {}
+
+ virtual void show() override
+ {
+ BaseInstanceClass::show();
+ notifyDialogState();
+ }
+
+ virtual void hide() override
+ {
+ BaseInstanceClass::hide();
+ notifyDialogState();
+ }
+};
+
+class JSLabel : public JSWidget<SalInstanceLabel, FixedText>
{
public:
JSLabel(VclPtr<vcl::Window> aOwnedToplevel, FixedText* pLabel,
@@ -38,7 +61,7 @@ public:
virtual void set_label(const OUString& rText) override;
};
-class JSEntry : public SalInstanceEntry, public JSDialogSender
+class JSEntry : public JSWidget<SalInstanceEntry, ::Edit>
{
public:
JSEntry(VclPtr<vcl::Window> aOwnedToplevel, ::Edit* pEntry,
@@ -46,7 +69,7 @@ public:
virtual void set_text(const OUString& rText) override;
};
-class JSListBox : public SalInstanceComboBoxWithoutEdit, public JSDialogSender
+class JSListBox : public JSWidget<SalInstanceComboBoxWithoutEdit, ::ListBox>
{
public:
JSListBox(VclPtr<vcl::Window> aOwnedToplevel, ::ListBox* pListBox,
@@ -56,7 +79,7 @@ public:
virtual void remove(int pos) override;
};
-class JSComboBox : public SalInstanceComboBoxWithEdit, public JSDialogSender
+class JSComboBox : public JSWidget<SalInstanceComboBoxWithEdit, ::ComboBox>
{
public:
JSComboBox(VclPtr<vcl::Window> aOwnedToplevel, ::ComboBox* pComboBox,
diff --git a/vcl/jsdialog/jsdialogbuilder.cxx b/vcl/jsdialog/jsdialogbuilder.cxx
index 7e4b6eb06e6e..fa54c3fb90ca 100644
--- a/vcl/jsdialog/jsdialogbuilder.cxx
+++ b/vcl/jsdialog/jsdialogbuilder.cxx
@@ -84,8 +84,7 @@ std::unique_ptr<weld::ComboBox> JSInstanceBuilder::weld_combo_box(const OString&
JSLabel::JSLabel(VclPtr<vcl::Window> aOwnedToplevel, FixedText* pLabel,
SalInstanceBuilder* pBuilder, bool bTakeOwnership)
-: SalInstanceLabel(pLabel, pBuilder, bTakeOwnership)
-, JSDialogSender(aOwnedToplevel)
+: JSWidget<SalInstanceLabel, FixedText>(aOwnedToplevel, pLabel, pBuilder, bTakeOwnership)
{
}
@@ -97,8 +96,7 @@ void JSLabel::set_label(const OUString& rText)
JSEntry::JSEntry(VclPtr<vcl::Window> aOwnedToplevel, ::Edit* pEntry,
SalInstanceBuilder* pBuilder, bool bTakeOwnership)
-: SalInstanceEntry(pEntry, pBuilder, bTakeOwnership)
-, JSDialogSender(aOwnedToplevel)
+: JSWidget<SalInstanceEntry, ::Edit>(aOwnedToplevel, pEntry, pBuilder, bTakeOwnership)
{
}
@@ -110,8 +108,7 @@ void JSEntry::set_text(const OUString& rText)
JSListBox::JSListBox(VclPtr<vcl::Window> aOwnedToplevel, ::ListBox* pListBox,
SalInstanceBuilder* pBuilder, bool bTakeOwnership)
-: SalInstanceComboBoxWithoutEdit(pListBox, pBuilder, bTakeOwnership)
-, JSDialogSender(aOwnedToplevel)
+: JSWidget<SalInstanceComboBoxWithoutEdit, ::ListBox>(aOwnedToplevel, pListBox, pBuilder, bTakeOwnership)
{
}
@@ -130,8 +127,7 @@ void JSListBox::remove(int pos)
JSComboBox::JSComboBox(VclPtr<vcl::Window> aOwnedToplevel, ::ComboBox* pComboBox,
SalInstanceBuilder* pBuilder, bool bTakeOwnership)
-: SalInstanceComboBoxWithEdit(pComboBox, pBuilder, bTakeOwnership)
-, JSDialogSender(aOwnedToplevel)
+: JSWidget<SalInstanceComboBoxWithEdit, ::ComboBox>(aOwnedToplevel, pComboBox, pBuilder, bTakeOwnership)
{
}
commit 904469c8be0a2e53e60c2765cffcdbe71566e954
Author: Caolán McNamara <caolanm at redhat.com>
AuthorDate: Fri Feb 8 21:39:14 2019 +0000
Commit: Szymon Kłos <szymon.klos at collabora.com>
CommitDate: Fri Feb 28 13:48:30 2020 +0100
weld SvxSearchAttributeDialog
Change-Id: Ib929afd143cd02b49f87ae6d910500354197e826
Reviewed-on: https://gerrit.libreoffice.org/67572
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm at redhat.com>
Tested-by: Caolán McNamara <caolanm at redhat.com>
diff --git a/cui/source/dialogs/srchxtra.cxx b/cui/source/dialogs/srchxtra.cxx
index a63691256f19..b41dcb987962 100644
--- a/cui/source/dialogs/srchxtra.cxx
+++ b/cui/source/dialogs/srchxtra.cxx
@@ -102,20 +102,21 @@ void SvxSearchFormatDialog::PageCreated(const OString& rId, SfxTabPage& rPage)
}
}
-SvxSearchAttributeDialog::SvxSearchAttributeDialog(vcl::Window* pParent,
+SvxSearchAttributeDialog::SvxSearchAttributeDialog(weld::Window* pParent,
SearchAttrItemList& rLst, const sal_uInt16* pWhRanges)
- : ModalDialog(pParent, "SearchAttrDialog", "cui/ui/searchattrdialog.ui")
+ : GenericDialogController(pParent, "cui/ui/searchattrdialog.ui", "SearchAttrDialog")
, rList(rLst)
+ , m_xAttrLB(m_xBuilder->weld_tree_view("treeview"))
+ , m_xOKBtn(m_xBuilder->weld_button("ok"))
{
- get(m_pOKBtn, "ok");
- get(m_pAttrLB, "treeview");
- m_pAttrLB->set_height_request(m_pAttrLB->GetTextHeight() * 12);
- m_pAttrLB->set_width_request(m_pAttrLB->approximate_char_width() * 56);
+ m_xAttrLB->set_size_request(m_xAttrLB->get_approximate_digit_width() * 50,
+ m_xAttrLB->get_height_rows(12));
- m_pAttrLB->SetStyle( GetStyle() | WB_CLIPCHILDREN | WB_HSCROLL | WB_SORT );
- m_pAttrLB->GetModel()->SetSortMode( SortAscending );
+ std::vector<int> aWidths;
+ aWidths.push_back(m_xAttrLB->get_approximate_digit_width() * 3 + 6);
+ m_xAttrLB->set_column_fixed_widths(aWidths);
- m_pOKBtn->SetClickHdl( LINK( this, SvxSearchAttributeDialog, OKHdl ) );
+ m_xOKBtn->connect_clicked(LINK( this, SvxSearchAttributeDialog, OKHdl));
SfxObjectShell* pSh = SfxObjectShell::Current();
DBG_ASSERT( pSh, "No DocShell" );
@@ -143,47 +144,38 @@ SvxSearchAttributeDialog::SvxSearchAttributeDialog(vcl::Window* pParent,
// item resources are in svx
sal_uInt32 nId = SvxAttrNameTable::FindIndex(nSlot);
- SvTreeListEntry* pEntry = nullptr;
- if ( RESARRAY_INDEX_NOTFOUND != nId )
- pEntry = m_pAttrLB->SvTreeListBox::InsertEntry(SvxAttrNameTable::GetString(nId));
- else
- SAL_WARN( "cui.dialogs", "no resource for slot id " << static_cast<sal_Int32>(nSlot) );
-
- if ( pEntry )
+ if (RESARRAY_INDEX_NOTFOUND != nId)
{
- m_pAttrLB->SetCheckButtonState( pEntry, bChecked ? SvButtonState::Checked : SvButtonState::Unchecked );
- pEntry->SetUserData( reinterpret_cast<void*>(nSlot) );
+ m_xAttrLB->insert(nullptr, -1, nullptr, nullptr, nullptr,
+ nullptr, nullptr, false);
+ const int nRow = m_xAttrLB->n_children() - 1;
+ m_xAttrLB->set_toggle(nRow, bChecked, 0);
+ m_xAttrLB->set_text(nRow, SvxAttrNameTable::GetString(nId), 1);
+ m_xAttrLB->set_id(nRow, OUString::number(nSlot));
}
+ else
+ SAL_WARN( "cui.dialogs", "no resource for slot id " << static_cast<sal_Int32>(nSlot) );
}
nWhich = aIter.NextWhich();
}
- m_pAttrLB->SetHighlightRange();
- m_pAttrLB->SelectEntryPos( 0 );
+ m_xAttrLB->make_sorted();
+ m_xAttrLB->select(0);
}
SvxSearchAttributeDialog::~SvxSearchAttributeDialog()
{
- disposeOnce();
}
-void SvxSearchAttributeDialog::dispose()
-{
- m_pAttrLB.clear();
- m_pOKBtn.clear();
- ModalDialog::dispose();
-}
-
-
-IMPL_LINK_NOARG(SvxSearchAttributeDialog, OKHdl, Button*, void)
+IMPL_LINK_NOARG(SvxSearchAttributeDialog, OKHdl, weld::Button&, void)
{
SearchAttrItem aInvalidItem;
aInvalidItem.pItem = INVALID_POOL_ITEM;
- for ( sal_uLong i = 0; i < m_pAttrLB->GetEntryCount(); ++i )
+ for (int i = 0, nCount = m_xAttrLB->n_children(); i < nCount; ++i)
{
- sal_uInt16 nSlot = static_cast<sal_uInt16>(reinterpret_cast<sal_uLong>(m_pAttrLB->GetEntryData(i)));
- bool bChecked = m_pAttrLB->IsChecked(i);
+ sal_uInt16 nSlot = m_xAttrLB->get_id(i).toUInt32();
+ bool bChecked = m_xAttrLB->get_toggle(i, 0);
sal_uInt16 j;
for ( j = rList.Count(); j; )
@@ -216,7 +208,7 @@ IMPL_LINK_NOARG(SvxSearchAttributeDialog, OKHdl, Button*, void)
if ( !rList[ --n ].pItem )
rList.Remove( n );
- EndDialog( RET_OK );
+ m_xDialog->response(RET_OK);
}
// class SvxSearchSimilarityDialog ---------------------------------------
diff --git a/cui/source/factory/dlgfact.cxx b/cui/source/factory/dlgfact.cxx
index 5e6a9348c2fa..e520ebb99928 100644
--- a/cui/source/factory/dlgfact.cxx
+++ b/cui/source/factory/dlgfact.cxx
@@ -1156,12 +1156,11 @@ VclPtr<SfxAbstractTabDialog> AbstractDialogFactory_Impl::CreateTabItemDialog(wel
pParent, rSet));
}
-VclPtr<VclAbstractDialog> AbstractDialogFactory_Impl::CreateSvxSearchAttributeDialog( vcl::Window* pParent,
+VclPtr<VclAbstractDialog> AbstractDialogFactory_Impl::CreateSvxSearchAttributeDialog(weld::Window* pParent,
SearchAttrItemList& rLst,
const sal_uInt16* pWhRanges )
{
- VclPtrInstance<SvxSearchAttributeDialog> pDlg( pParent, rLst, pWhRanges);
- return VclPtr<CuiVclAbstractDialog_Impl>::Create( pDlg );
+ return VclPtr<CuiAbstractController_Impl>::Create(std::make_unique<SvxSearchAttributeDialog>(pParent, rLst, pWhRanges));
}
VclPtr<AbstractSvxSearchSimilarityDialog> AbstractDialogFactory_Impl::CreateSvxSearchSimilarityDialog(weld::Window* pParent,
diff --git a/cui/source/factory/dlgfact.hxx b/cui/source/factory/dlgfact.hxx
index 8cb6f5591c8a..dd45dc48650b 100644
--- a/cui/source/factory/dlgfact.hxx
+++ b/cui/source/factory/dlgfact.hxx
@@ -757,7 +757,7 @@ public:
const OUString& rTarget, const OUString& rName,
TargetList& rTargetList ) override;
- virtual VclPtr<VclAbstractDialog> CreateSvxSearchAttributeDialog( vcl::Window* pParent,
+ virtual VclPtr<VclAbstractDialog> CreateSvxSearchAttributeDialog(weld::Window* pParent,
SearchAttrItemList& rLst,
const sal_uInt16* pWhRanges) override;
virtual VclPtr<AbstractSvxSearchSimilarityDialog> CreateSvxSearchSimilarityDialog( weld::Window* pParent,
diff --git a/cui/source/inc/srchxtra.hxx b/cui/source/inc/srchxtra.hxx
index e6ca82ba9697..38ee2955aa0d 100644
--- a/cui/source/inc/srchxtra.hxx
+++ b/cui/source/inc/srchxtra.hxx
@@ -19,13 +19,10 @@
#ifndef INCLUDED_CUI_SOURCE_INC_SRCHXTRA_HXX
#define INCLUDED_CUI_SOURCE_INC_SRCHXTRA_HXX
-#include <vcl/field.hxx>
-#include <vcl/weld.hxx>
-#include <svtools/ctrltool.hxx>
#include <sfx2/tabdlg.hxx>
-
-#include <svx/checklbx.hxx>
+#include <svtools/ctrltool.hxx>
#include <svx/srchdlg.hxx>
+#include <vcl/weld.hxx>
class SvxSearchFormatDialog : public SfxTabDialogController
{
@@ -42,21 +39,20 @@ private:
// class SvxSearchFormatDialog -------------------------------------------
-class SvxSearchAttributeDialog : public ModalDialog
+class SvxSearchAttributeDialog : public weld::GenericDialogController
{
public:
- SvxSearchAttributeDialog( vcl::Window* pParent, SearchAttrItemList& rLst,
- const sal_uInt16* pWhRanges );
+ SvxSearchAttributeDialog(weld::Window* pParent, SearchAttrItemList& rLst,
+ const sal_uInt16* pWhRanges);
virtual ~SvxSearchAttributeDialog() override;
- virtual void dispose() override;
private:
- VclPtr<SvxCheckListBox> m_pAttrLB;
- VclPtr<OKButton> m_pOKBtn;
-
SearchAttrItemList& rList;
- DECL_LINK(OKHdl, Button*, void);
+ std::unique_ptr<weld::TreeView> m_xAttrLB;
+ std::unique_ptr<weld::Button> m_xOKBtn;
+
+ DECL_LINK(OKHdl, weld::Button&, void);
};
// class SvxSearchSimilarityDialog ---------------------------------------
diff --git a/cui/uiconfig/ui/searchattrdialog.ui b/cui/uiconfig/ui/searchattrdialog.ui
index e5e0f249c6e2..f543ba732c8e 100644
--- a/cui/uiconfig/ui/searchattrdialog.ui
+++ b/cui/uiconfig/ui/searchattrdialog.ui
@@ -1,14 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
-<!-- Generated with glade 3.18.3 -->
+<!-- Generated with glade 3.22.1 -->
<interface domain="cui">
<requires lib="gtk+" version="3.18"/>
- <requires lib="LibreOffice" version="1.0"/>
+ <object class="GtkTreeStore" id="liststore1">
+ <columns>
+ <!-- column-name check1 -->
+ <column type="gboolean"/>
+ <!-- column-name text -->
+ <column type="gchararray"/>
+ <!-- column-name id -->
+ <column type="gchararray"/>
+ <!-- column-name checkvis1 -->
+ <column type="gboolean"/>
+ </columns>
+ </object>
<object class="GtkDialog" id="SearchAttrDialog">
<property name="can_focus">False</property>
<property name="border_width">6</property>
<property name="title" translatable="yes" context="searchattrdialog|SearchAttrDialog">Attributes</property>
<property name="resizable">False</property>
<property name="type_hint">dialog</property>
+ <child>
+ <placeholder/>
+ </child>
<child internal-child="vbox">
<object class="GtkBox" id="dialog-vbox1">
<property name="can_focus">False</property>
@@ -72,13 +86,52 @@
</packing>
</child>
<child>
- <object class="svxcorelo-SvxCheckListBox" id="treeview:border">
+ <object class="GtkScrolledWindow">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="hexpand">True</property>
<property name="vexpand">True</property>
- <child internal-child="selection">
- <object class="GtkTreeSelection" id="treeview-selection1"/>
+ <property name="shadow_type">in</property>
+ <child>
+ <object class="GtkTreeView" id="treeview">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="vexpand">True</property>
+ <property name="model">liststore1</property>
+ <property name="headers_visible">False</property>
+ <property name="search_column">0</property>
+ <property name="show_expanders">False</property>
+ <child internal-child="selection">
+ <object class="GtkTreeSelection" id="Macro Library List-selection2"/>
+ </child>
+ <child>
+ <object class="GtkTreeViewColumn" id="treeviewcolumn4">
+ <property name="resizable">True</property>
+ <property name="spacing">6</property>
+ <property name="alignment">0.5</property>
+ <child>
+ <object class="GtkCellRendererToggle" id="cellrenderer5"/>
+ <attributes>
+ <attribute name="visible">3</attribute>
+ <attribute name="active">0</attribute>
+ </attributes>
+ </child>
+ </object>
+ </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">1</attribute>
+ </attributes>
+ </child>
+ </object>
+ </child>
+ </object>
</child>
</object>
<packing>
diff --git a/include/svx/svxdlg.hxx b/include/svx/svxdlg.hxx
index e3e0f4a366e6..0147437c52e5 100644
--- a/include/svx/svxdlg.hxx
+++ b/include/svx/svxdlg.hxx
@@ -356,7 +356,7 @@ public:
TargetList& rTargetList ) = 0;
virtual VclPtr<SfxAbstractTabDialog> CreateTabItemDialog(weld::Window* pParent, const SfxItemSet& rSet) = 0;
- virtual VclPtr<VclAbstractDialog> CreateSvxSearchAttributeDialog( vcl::Window* pParent,
+ virtual VclPtr<VclAbstractDialog> CreateSvxSearchAttributeDialog(weld::Window* pParent,
SearchAttrItemList& rLst,
const sal_uInt16* pWhRanges)=0;
virtual VclPtr<AbstractSvxSearchSimilarityDialog> CreateSvxSearchSimilarityDialog( weld::Window* pParent,
commit 782da81f352962e89bb8c5e4f37b1a794bd3135a
Author: Caolán McNamara <caolanm at redhat.com>
AuthorDate: Fri Mar 22 15:59:00 2019 +0000
Commit: Szymon Kłos <szymon.klos at collabora.com>
CommitDate: Fri Feb 28 13:48:20 2020 +0100
weld SvxSearchDialog
I have to use the other way to specify an a11y role, both are implemented in
the vcl parser, but in my gtk3-3.24.7 the role tag crashes the gtk parser,
while the other route works fine.
The CONTENT_FLOWS_TO accessibility relation is another additional complexity
over the norm
Change-Id: Ia096bcbe9f00f9944e4e4d5ad9bb1a52d19c7b3f
Reviewed-on: https://gerrit.libreoffice.org/69569
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm at redhat.com>
Tested-by: Caolán McNamara <caolanm at redhat.com>
diff --git a/include/svx/srchdlg.hxx b/include/svx/srchdlg.hxx
index 4b82db88fe7c..3870dc57c63a 100644
--- a/include/svx/srchdlg.hxx
+++ b/include/svx/srchdlg.hxx
@@ -89,13 +89,13 @@ enum class SearchLabel
class SvxSearchDialog;
class SVX_DLLPUBLIC SvxSearchDialogWrapper : public SfxChildWindow
{
- VclPtr<SvxSearchDialog> dialog;
+ std::shared_ptr<SvxSearchDialog> dialog;
public:
SvxSearchDialogWrapper( vcl::Window*pParent, sal_uInt16 nId,
SfxBindings* pBindings, SfxChildWinInfo const * pInfo );
virtual ~SvxSearchDialogWrapper () override;
- SvxSearchDialog *getDialog () { return dialog;}
+ SvxSearchDialog *getDialog () { return dialog.get();}
static void SetSearchLabel(const SearchLabel& rSL);
static void SetSearchLabel(const OUString& sStr);
static OUString GetSearchLabel();
@@ -109,18 +109,18 @@ public:
*/
-class SvxSearchDialog : public SfxModelessDialog
+class SVX_DLLPUBLIC SvxSearchDialog : public SfxModelessDialogController
{
friend class SvxSearchController;
friend class SvxSearchDialogWrapper;
friend class SvxJSearchOptionsDialog;
public:
- SvxSearchDialog( vcl::Window* pParent, SfxChildWindow* pChildWin, SfxBindings& rBind );
+ SvxSearchDialog(weld::Window* pParent, SfxChildWindow* pChildWin, SfxBindings& rBind );
virtual ~SvxSearchDialog() override;
- virtual void dispose() override;
- virtual bool Close() override;
+ virtual void EndDialog();
+ virtual void Close();
// Window
virtual void Activate() override;
@@ -132,73 +132,16 @@ public:
TransliterationFlags GetTransliterationFlags() const;
- void SetDocWin( vcl::Window* pDocWin ) { mpDocWin = pDocWin; }
- vcl::Window* GetDocWin() { return mpDocWin; }
+ void SetDocWin(vcl::Window* pDocWin);
void SetSrchFlag( bool bSuccess ) { mbSuccess = bSuccess; }
bool GetSrchFlag() { return mbSuccess; }
- virtual css::uno::Reference< css::awt::XWindowPeer >
- GetComponentInterface( bool bCreate = true ) override;
-
void SetSaveToModule(bool b);
- void SetSearchLabel(const OUString& rStr) { m_pSearchLabel->SetText(rStr); }
+ void SetSearchLabel(const OUString& rStr) { m_xSearchLabel->set_label(rStr); }
private:
- VclPtr<vcl::Window> mpDocWin;
bool mbSuccess;
-
- VclPtr<VclFrame> m_pSearchFrame;
- VclPtr<ComboBox> m_pSearchLB;
- VclPtr<ListBox> m_pSearchTmplLB;
- VclPtr<FixedText> m_pSearchAttrText;
- VclPtr<FixedText> m_pSearchLabel;
-
- VclPtr<VclFrame> m_pReplaceFrame;
- VclPtr<ComboBox> m_pReplaceLB;
- VclPtr<ListBox> m_pReplaceTmplLB;
- VclPtr<FixedText> m_pReplaceAttrText;
-
- VclPtr<PushButton> m_pSearchBtn;
- VclPtr<PushButton> m_pBackSearchBtn;
- VclPtr<PushButton> m_pSearchAllBtn;
- VclPtr<PushButton> m_pReplaceBtn;
- VclPtr<PushButton> m_pReplaceAllBtn;
-
- VclPtr<VclFrame> m_pComponentFrame;
- VclPtr<PushButton> m_pSearchComponent1PB;
- VclPtr<PushButton> m_pSearchComponent2PB;
-
- VclPtr<CheckBox> m_pMatchCaseCB;
- VclPtr<CheckBox> m_pSearchFormattedCB;
- VclPtr<CheckBox> m_pWordBtn;
-
- VclPtr<PushButton> m_pCloseBtn;
- VclPtr<CheckBox> m_pIncludeDiacritics;
- VclPtr<CheckBox> m_pIncludeKashida;
- VclPtr<VclExpander> m_pOtherOptionsExpander;
- VclPtr<CheckBox> m_pSelectionBtn;
- VclPtr<CheckBox> m_pRegExpBtn;
- VclPtr<CheckBox> m_pWildcardBtn;
- VclPtr<CheckBox> m_pSimilarityBox;
- VclPtr<PushButton> m_pSimilarityBtn;
- VclPtr<CheckBox> m_pLayoutBtn;
- VclPtr<CheckBox> m_pNotesBtn;
- VclPtr<CheckBox> m_pJapMatchFullHalfWidthCB;
- VclPtr<CheckBox> m_pJapOptionsCB;
- VclPtr<CheckBox> m_pReplaceBackwardsCB;
- VclPtr<PushButton> m_pJapOptionsBtn;
-
- VclPtr<PushButton> m_pAttributeBtn;
- VclPtr<PushButton> m_pFormatBtn;
- VclPtr<PushButton> m_pNoFormatBtn;
-
- VclPtr<VclContainer> m_pCalcGrid;
- VclPtr<FixedText> m_pCalcSearchInFT;
- VclPtr<ListBox> m_pCalcSearchInLB;
- VclPtr<FixedText> m_pCalcSearchDirFT;
- VclPtr<RadioButton> m_pRowsBtn;
- VclPtr<RadioButton> m_pColumnsBtn;
- VclPtr<CheckBox> m_pAllSheetsCB;
+ bool mbClosing;
SfxBindings& rBindings;
bool bWriter;
@@ -232,41 +175,95 @@ private:
bool m_executingSubDialog = false;
- DECL_LINK( ModifyHdl_Impl, Edit&, void );
- DECL_LINK( FlagHdl_Impl, Button*, void );
- DECL_LINK( CommandHdl_Impl, Button*, void );
- DECL_LINK(TemplateHdl_Impl, Button*, void);
- DECL_LINK( FocusHdl_Impl, Control&, void );
- DECL_LINK( LBSelectHdl_Impl, ListBox&, void );
- DECL_LINK(LoseFocusHdl_Impl, Control&, void);
- DECL_LINK(FormatHdl_Impl, Button*, void);
- DECL_LINK(NoFormatHdl_Impl, Button*, void);
- DECL_LINK(AttributeHdl_Impl, Button*, void);
- DECL_LINK( TimeoutHdl_Impl, Timer*, void );
- void ClickHdl_Impl(void const * pCtrl);
-
- void Construct_Impl();
- void InitControls_Impl();
- void ShowOptionalControls_Impl();
- void Init_Impl( bool bHasItemSet );
- void InitAttrList_Impl( const SfxItemSet* pSSet,
+ std::unique_ptr<weld::Frame> m_xSearchFrame;
+ std::unique_ptr<weld::ComboBox> m_xSearchLB;
+ std::unique_ptr<weld::ComboBox> m_xSearchTmplLB;
+ std::unique_ptr<weld::Label> m_xSearchAttrText;
+ std::unique_ptr<weld::Label> m_xSearchLabel;
+
+ std::unique_ptr<weld::Frame> m_xReplaceFrame;
+ std::unique_ptr<weld::ComboBox> m_xReplaceLB;
+ std::unique_ptr<weld::ComboBox> m_xReplaceTmplLB;
+ std::unique_ptr<weld::Label> m_xReplaceAttrText;
+
+ std::unique_ptr<weld::Button> m_xSearchBtn;
+ std::unique_ptr<weld::Button> m_xBackSearchBtn;
+ std::unique_ptr<weld::Button> m_xSearchAllBtn;
+ std::unique_ptr<weld::Button> m_xReplaceBtn;
+ std::unique_ptr<weld::Button> m_xReplaceAllBtn;
+
+ std::unique_ptr<weld::Frame> m_xComponentFrame;
+ std::unique_ptr<weld::Button> m_xSearchComponent1PB;
+ std::unique_ptr<weld::Button> m_xSearchComponent2PB;
+
+ std::unique_ptr<weld::CheckButton> m_xMatchCaseCB;
+ std::unique_ptr<weld::CheckButton> m_xSearchFormattedCB;
+ std::unique_ptr<weld::CheckButton> m_xWordBtn;
+
+ std::unique_ptr<weld::Button> m_xCloseBtn;
+ std::unique_ptr<weld::CheckButton> m_xIncludeDiacritics;
+ std::unique_ptr<weld::CheckButton> m_xIncludeKashida;
+ std::unique_ptr<weld::Expander> m_xOtherOptionsExpander;
+ std::unique_ptr<weld::CheckButton> m_xSelectionBtn;
+ std::unique_ptr<weld::CheckButton> m_xRegExpBtn;
+ std::unique_ptr<weld::CheckButton> m_xWildcardBtn;
+ std::unique_ptr<weld::CheckButton> m_xSimilarityBox;
+ std::unique_ptr<weld::Button> m_xSimilarityBtn;
+ std::unique_ptr<weld::CheckButton> m_xLayoutBtn;
+ std::unique_ptr<weld::CheckButton> m_xNotesBtn;
+ std::unique_ptr<weld::CheckButton> m_xJapMatchFullHalfWidthCB;
+ std::unique_ptr<weld::CheckButton> m_xJapOptionsCB;
+ std::unique_ptr<weld::CheckButton> m_xReplaceBackwardsCB;
+ std::unique_ptr<weld::Button> m_xJapOptionsBtn;
+
+ std::unique_ptr<weld::Button> m_xAttributeBtn;
+ std::unique_ptr<weld::Button> m_xFormatBtn;
+ std::unique_ptr<weld::Button> m_xNoFormatBtn;
+
+ std::unique_ptr<weld::Widget> m_xCalcGrid;
+ std::unique_ptr<weld::Label> m_xCalcSearchInFT;
+ std::unique_ptr<weld::ComboBox> m_xCalcSearchInLB;
+ std::unique_ptr<weld::Label> m_xCalcSearchDirFT;
+ std::unique_ptr<weld::RadioButton> m_xRowsBtn;
+ std::unique_ptr<weld::RadioButton> m_xColumnsBtn;
+ std::unique_ptr<weld::CheckButton> m_xAllSheetsCB;
+ std::unique_ptr<weld::Label> m_xCalcStrFT;
+
+ DECL_DLLPRIVATE_LINK( ModifyHdl_Impl, weld::ComboBox&, void );
+ DECL_DLLPRIVATE_LINK( FlagHdl_Impl, weld::Button&, void );
+ DECL_DLLPRIVATE_LINK( CommandHdl_Impl, weld::Button&, void );
+ DECL_DLLPRIVATE_LINK(TemplateHdl_Impl, weld::Button&, void);
+ DECL_DLLPRIVATE_LINK( FocusHdl_Impl, weld::Widget&, void );
+ DECL_DLLPRIVATE_LINK( LBSelectHdl_Impl, weld::ComboBox&, void );
+ DECL_DLLPRIVATE_LINK(LoseFocusHdl_Impl, weld::Widget&, void);
+ DECL_DLLPRIVATE_LINK(FormatHdl_Impl, weld::Button&, void);
+ DECL_DLLPRIVATE_LINK(NoFormatHdl_Impl, weld::Button&, void);
+ DECL_DLLPRIVATE_LINK(AttributeHdl_Impl, weld::Button&, void);
+ DECL_DLLPRIVATE_LINK( TimeoutHdl_Impl, Timer*, void );
+ SVX_DLLPRIVATE void ClickHdl_Impl(const weld::Widget* pCtrl);
+
+ SVX_DLLPRIVATE void Construct_Impl();
+ SVX_DLLPRIVATE void InitControls_Impl();
+ SVX_DLLPRIVATE void ShowOptionalControls_Impl();
+ SVX_DLLPRIVATE void Init_Impl( bool bHasItemSet );
+ SVX_DLLPRIVATE void InitAttrList_Impl( const SfxItemSet* pSSet,
const SfxItemSet* pRSet );
- void Remember_Impl( const OUString &rStr, bool bSearch );
- void PaintAttrText_Impl();
- OUString& BuildAttrText_Impl( OUString& rStr, bool bSrchFlag ) const;
+ SVX_DLLPRIVATE void Remember_Impl( const OUString &rStr, bool bSearch );
+ SVX_DLLPRIVATE void PaintAttrText_Impl();
+ SVX_DLLPRIVATE OUString& BuildAttrText_Impl( OUString& rStr, bool bSrchFlag ) const;
- void TemplatesChanged_Impl( SfxStyleSheetBasePool& rPool );
- void EnableControls_Impl( const SearchOptionFlags nFlags );
- void EnableControl_Impl( Control const * pCtrl );
- void SetItem_Impl( const SvxSearchItem* pItem );
+ SVX_DLLPRIVATE void TemplatesChanged_Impl( SfxStyleSheetBasePool& rPool );
+ SVX_DLLPRIVATE void EnableControls_Impl( const SearchOptionFlags nFlags );
+ SVX_DLLPRIVATE void EnableControl_Impl(const weld::Widget& rCtrl);
+ SVX_DLLPRIVATE void SetItem_Impl( const SvxSearchItem* pItem );
- void SetModifyFlag_Impl( const Control* pCtrl );
- void SaveToModule_Impl();
+ SVX_DLLPRIVATE void SetModifyFlag_Impl(const weld::Widget* pCtrl);
+ SVX_DLLPRIVATE void SaveToModule_Impl();
- void ApplyTransliterationFlags_Impl( TransliterationFlags nSettings );
- bool IsOtherOptionsExpanded();
+ SVX_DLLPRIVATE void ApplyTransliterationFlags_Impl( TransliterationFlags nSettings );
+ SVX_DLLPRIVATE bool IsOtherOptionsExpanded();
- short executeSubDialog(VclAbstractDialog * dialog);
+ SVX_DLLPRIVATE short executeSubDialog(VclAbstractDialog * dialog);
};
#endif
diff --git a/include/vcl/weld.hxx b/include/vcl/weld.hxx
index 0017c56e2b1b..61630c93c4b2 100644
--- a/include/vcl/weld.hxx
+++ b/include/vcl/weld.hxx
@@ -97,6 +97,14 @@ public:
virtual OUString get_accessible_description() const = 0;
+ virtual void set_accessible_relation_labeled_by(weld::Widget* pLabel) = 0;
+ virtual void set_accessible_relation_label_for(weld::Widget* pLabeled) = 0;
+
+ virtual void
+ add_extra_accessible_relation(const css::accessibility::AccessibleRelation& rRelation)
+ = 0;
+ virtual void clear_extra_accessible_relations() = 0;
+
virtual void set_tooltip_text(const OUString& rTip) = 0;
virtual void connect_focus_in(const Link<Widget&, void>& rLink)
diff --git a/include/vcl/window.hxx b/include/vcl/window.hxx
index f95ad05cef5b..3585f6d14a23 100644
--- a/include/vcl/window.hxx
+++ b/include/vcl/window.hxx
@@ -76,6 +76,7 @@ enum class VclEventId;
namespace com { namespace sun { namespace star {
namespace accessibility {
+ struct AccessibleRelation;
class XAccessible;
}
namespace beans {
@@ -1292,6 +1293,9 @@ public:
void SetAccessibleRelationMemberOf( vcl::Window* pMemberOf );
vcl::Window* GetAccessibleRelationMemberOf() const;
+ void AddExtraAccessibleRelation(const css::accessibility::AccessibleRelation &rRelation);
+ const std::vector<css::accessibility::AccessibleRelation>& GetExtraAccessibleRelations() const;
+ void ClearExtraAccessibleRelations();
// to avoid sending accessibility events in cases like closing dialogs
// by default checks complete parent path
diff --git a/sc/source/ui/view/tabvwshe.cxx b/sc/source/ui/view/tabvwshe.cxx
index c0c96af2cb0e..d6557932ea34 100644
--- a/sc/source/ui/view/tabvwshe.cxx
+++ b/sc/source/ui/view/tabvwshe.cxx
@@ -250,11 +250,11 @@ void ScTabViewShell::ExecSearch( SfxRequest& rReq )
ScGlobal::SetSearchItem( *pSearchItem );
bool bSuccess = SearchAndReplace( pSearchItem, true, rReq.IsAPI() );
- const SfxChildWindow* pChildWindow = SfxViewFrame::Current()->GetChildWindow(
+ SfxChildWindow* pChildWindow = SfxViewFrame::Current()->GetChildWindow(
SvxSearchDialogWrapper::GetChildWindowId());
if (pChildWindow)
{
- SvxSearchDialog* pSearchDlg = static_cast<SvxSearchDialog*>(pChildWindow->GetWindow());
+ SvxSearchDialog* pSearchDlg = static_cast<SvxSearchDialog*>(pChildWindow->GetController().get());
if( pSearchDlg )
{
ScTabView* pTabView = GetViewData().GetView();
@@ -320,11 +320,11 @@ void ScTabViewShell::ExecSearch( SfxRequest& rReq )
rReq.IsAPI() ? SfxCallMode::API|SfxCallMode::SYNCHRON :
SfxCallMode::RECORD,
{ &aSearchItem });
- const SfxChildWindow* pChildWindow = SfxViewFrame::Current()->GetChildWindow(
+ SfxChildWindow* pChildWindow = SfxViewFrame::Current()->GetChildWindow(
SvxSearchDialogWrapper::GetChildWindowId());
if (pChildWindow)
{
- SvxSearchDialog* pSearchDlg = static_cast<SvxSearchDialog*>(pChildWindow->GetWindow());
+ SvxSearchDialog* pSearchDlg = static_cast<SvxSearchDialog*>(pChildWindow->GetController().get());
if( pSearchDlg )
{
ScTabView* pTabView = GetViewData().GetView();
diff --git a/sd/source/ui/view/Outliner.cxx b/sd/source/ui/view/Outliner.cxx
index 5d9181475d45..73f34cf64372 100644
--- a/sd/source/ui/view/Outliner.cxx
+++ b/sd/source/ui/view/Outliner.cxx
@@ -507,7 +507,7 @@ bool SdOutliner::StartSearchAndReplace (const SvxSearchItem* pSearchItem)
if (pChildWin)
{
SvxSearchDialog* pSearchDlg =
- static_cast<SvxSearchDialog*>(pChildWin->GetWindow());
+ static_cast<SvxSearchDialog*>(pChildWin->GetController().get());
pSearchDlg->SetDocWin( pViewShell->GetActiveWindow() );
pSearchDlg->SetSrchFlag(false);
}
diff --git a/solenv/clang-format/blacklist b/solenv/clang-format/blacklist
index 0f46e3b6630c..a3c7cd256659 100644
--- a/solenv/clang-format/blacklist
+++ b/solenv/clang-format/blacklist
@@ -14014,7 +14014,6 @@ svtools/source/uno/wizard/wizardpagecontroller.cxx
svtools/source/uno/wizard/wizardpagecontroller.hxx
svtools/source/uno/wizard/wizardshell.cxx
svtools/source/uno/wizard/wizardshell.hxx
-svx/inc/AccessibleSvxFindReplaceDialog.hxx
svx/inc/AccessibleTableShape.hxx
svx/inc/GalleryControl.hxx
svx/inc/dragmt3d.hxx
@@ -14134,7 +14133,6 @@ svx/source/accessibility/AccessibleOLEShape.cxx
svx/source/accessibility/AccessibleShape.cxx
svx/source/accessibility/AccessibleShapeInfo.cxx
svx/source/accessibility/AccessibleShapeTreeInfo.cxx
-svx/source/accessibility/AccessibleSvxFindReplaceDialog.cxx
svx/source/accessibility/AccessibleTextEventQueue.cxx
svx/source/accessibility/AccessibleTextEventQueue.hxx
svx/source/accessibility/AccessibleTextHelper.cxx
diff --git a/svx/Library_svx.mk b/svx/Library_svx.mk
index c4c865302b10..3a67830df165 100644
--- a/svx/Library_svx.mk
+++ b/svx/Library_svx.mk
@@ -90,7 +90,6 @@ $(eval $(call gb_Library_add_exception_objects,svx,\
svx/source/accessibility/AccessibleShape \
svx/source/accessibility/AccessibleShapeInfo \
svx/source/accessibility/AccessibleShapeTreeInfo \
- svx/source/accessibility/AccessibleSvxFindReplaceDialog \
svx/source/accessibility/AccessibleTextEventQueue \
svx/source/accessibility/AccessibleTextHelper \
svx/source/accessibility/ChildrenManager \
diff --git a/svx/inc/AccessibleSvxFindReplaceDialog.hxx b/svx/inc/AccessibleSvxFindReplaceDialog.hxx
deleted file mode 100644
index a460dcc80b4e..000000000000
--- a/svx/inc/AccessibleSvxFindReplaceDialog.hxx
+++ /dev/null
@@ -1,55 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This file incorporates work covered by the following license notice:
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed
- * with this work for additional information regarding copyright
- * ownership. The ASF licenses this file to you under the Apache
- * License, Version 2.0 (the "License"); you may not use this file
- * except in compliance with the License. You may obtain a copy of
- * the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-#ifndef INCLUDED_SVX_INC_ACCESSIBLESVXFINDREPLACEDIALOG_HXX
-#define INCLUDED_SVX_INC_ACCESSIBLESVXFINDREPLACEDIALOG_HXX
-
-#include <toolkit/awt/vclxwindow.hxx>
-#include <toolkit/awt/vclxaccessiblecomponent.hxx>
-#include <toolkit/awt/vclxwindows.hxx>
-
-
-class VCLXAccessibleSvxFindReplaceDialog : public VCLXAccessibleComponent
-{
-public:
- VCLXAccessibleSvxFindReplaceDialog(VCLXWindow* pVCLXindow);
- virtual ~VCLXAccessibleSvxFindReplaceDialog() override;
- virtual void FillAccessibleRelationSet( utl::AccessibleRelationSetHelper& rRelationSet ) override;
- // XServiceInfo
- virtual OUString SAL_CALL getImplementationName() override;
- virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
-
-};
-
-
-class VCLXSvxFindReplaceDialog : public VCLXDialog
-{
-public:
- VCLXSvxFindReplaceDialog(vcl::Window* pSplDlg)
- {
- SetWindow(pSplDlg);
- }
-private:
- virtual css::uno::Reference< css::accessibility::XAccessibleContext > CreateAccessibleContext() override
- {
- return new VCLXAccessibleSvxFindReplaceDialog(this);
- }
-};
-#endif
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svx/source/accessibility/AccessibleSvxFindReplaceDialog.cxx b/svx/source/accessibility/AccessibleSvxFindReplaceDialog.cxx
deleted file mode 100644
index 1e0ca231c092..000000000000
--- a/svx/source/accessibility/AccessibleSvxFindReplaceDialog.cxx
+++ /dev/null
@@ -1,95 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This file incorporates work covered by the following license notice:
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed
- * with this work for additional information regarding copyright
- * ownership. The ASF licenses this file to you under the Apache
- * License, Version 2.0 (the "License"); you may not use this file
- * except in compliance with the License. You may obtain a copy of
- * the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-#include <AccessibleSvxFindReplaceDialog.hxx>
-#include <svx/srchdlg.hxx>
-#include <toolkit/awt/vclxwindow.hxx>
-#include <unotools/accessiblerelationsethelper.hxx>
-#include <com/sun/star/accessibility/AccessibleRelationType.hpp>
-#include <com/sun/star/accessibility/XAccessibleGetAccFlowTo.hpp>
-
-using namespace ::com::sun::star;
-using namespace ::com::sun::star::uno;
-
-VCLXAccessibleSvxFindReplaceDialog::VCLXAccessibleSvxFindReplaceDialog(VCLXWindow* pVCLXindow)
- :VCLXAccessibleComponent( pVCLXindow )
-{
-
-}
-
-VCLXAccessibleSvxFindReplaceDialog::~VCLXAccessibleSvxFindReplaceDialog()
-{
-}
-
-void VCLXAccessibleSvxFindReplaceDialog::FillAccessibleRelationSet( utl::AccessibleRelationSetHelper& rRelationSet )
-{
- VCLXAccessibleComponent::FillAccessibleRelationSet( rRelationSet );
- VclPtr<vcl::Window> pDlg = GetWindow();
- if ( !pDlg )
- return;
-
- SvxSearchDialog* pSrchDlg = static_cast<SvxSearchDialog*>( pDlg.get() );
- vcl::Window* pDocWin = pSrchDlg->GetDocWin();
- if ( !pDocWin )
- {
- return;
- }
- Reference < css::accessibility::XAccessible > xDocAcc = pDocWin->GetAccessible();
- if ( !xDocAcc.is() )
- {
- return;
- }
- Reference< css::accessibility::XAccessibleGetAccFlowTo > xGetAccFlowTo( xDocAcc, UNO_QUERY );
- if ( !xGetAccFlowTo.is() )
- {
- return;
- }
-
- const sal_Int32 FORFINDREPLACEFLOWTO = 2;
- uno::Sequence<uno::Any> aAnySeq = xGetAccFlowTo->getAccFlowTo( Any(pSrchDlg->GetSrchFlag()), FORFINDREPLACEFLOWTO );
-
- sal_Int32 nLen = aAnySeq.getLength();
- if ( nLen )
- {
- uno::Sequence< uno::Reference< uno::XInterface > > aSequence( nLen );
- for ( sal_Int32 i = 0; i < nLen; i++ )
- {
- uno::Reference < css::accessibility::XAccessible > xAcc;
- aAnySeq[i] >>= xAcc;
- aSequence[i] = xAcc;
- }
- rRelationSet.AddRelation( css::accessibility::AccessibleRelation( css::accessibility::AccessibleRelationType::CONTENT_FLOWS_TO, aSequence ) );
- }
-}
-
-// XServiceInfo
-
-
-OUString VCLXAccessibleSvxFindReplaceDialog::getImplementationName()
-{
- return OUString( "VCLXAccessibleSvxFindReplaceDialog" );
-}
-
-
-Sequence< OUString > VCLXAccessibleSvxFindReplaceDialog::getSupportedServiceNames()
-{
- Sequence< OUString > aNames { "VCLXAccessibleSvxFindReplaceDialog" };
- return aNames;
-}
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svx/source/dialog/srchdlg.cxx b/svx/source/dialog/srchdlg.cxx
index 20cd94e06252..bec45a0d1aeb 100644
--- a/svx/source/dialog/srchdlg.cxx
+++ b/svx/source/dialog/srchdlg.cxx
@@ -35,11 +35,16 @@
#include <svl/cjkoptions.hxx>
#include <svl/ctloptions.hxx>
#include <com/sun/star/awt/XWindow.hpp>
+#include <com/sun/star/accessibility/AccessibleRelation.hpp>
+#include <com/sun/star/accessibility/AccessibleRelationType.hpp>
+#include <com/sun/star/accessibility/XAccessibleGetAccFlowTo.hpp>
#include <com/sun/star/container/XNameAccess.hpp>
#include <com/sun/star/frame/XDispatch.hpp>
#include <com/sun/star/frame/XDispatchProvider.hpp>
#include <com/sun/star/frame/XLayoutManager.hpp>
#include <com/sun/star/beans/PropertyValue.hpp>
+#include <com/sun/star/beans/XPropertySet.hpp>
+#include <com/sun/star/accessibility/XAccessible.hpp>
#include <com/sun/star/configuration/theDefaultProvider.hpp>
#include <com/sun/star/frame/ModuleManager.hpp>
#include <com/sun/star/ui/XUIElement.hpp>
@@ -59,7 +64,6 @@
#include <svx/svxitems.hrc>
#include <svl/srchitem.hxx>
-#include <AccessibleSvxFindReplaceDialog.hxx>
#include <svx/pageitem.hxx>
#include "srchctrl.hxx"
#include <svx/dialmgr.hxx>
@@ -108,13 +112,14 @@ namespace o3tl {
namespace
{
- bool GetCheckBoxValue(const CheckBox *pBox)
+ bool GetCheckBoxValue(const weld::CheckButton& rBox)
{
- return pBox->IsEnabled() && pBox->IsChecked();
+ return rBox.get_sensitive() && rBox.get_active();
}
- bool GetNegatedCheckBoxValue(const CheckBox *pBox)
+
+ bool GetNegatedCheckBoxValue(const weld::CheckButton& rBox)
{
- return pBox->IsEnabled() && !pBox->IsChecked();
+ return rBox.get_sensitive() && !rBox.get_active();
}
}
@@ -143,7 +148,7 @@ struct SearchDlg_Impl
}
};
-static void ListToStrArr_Impl( sal_uInt16 nId, std::vector<OUString>& rStrLst, ComboBox& rCBox )
+static void ListToStrArr_Impl( sal_uInt16 nId, std::vector<OUString>& rStrLst, weld::ComboBox& rCBox )
{
const SfxStringListItem* pSrchItem =
static_cast<const SfxStringListItem*>(SfxGetpApp()->GetItem( nId ));
@@ -155,7 +160,7 @@ static void ListToStrArr_Impl( sal_uInt16 nId, std::vector<OUString>& rStrLst, C
for (const OUString & s : aLst)
{
rStrLst.push_back(s);
- rCBox.InsertEntry(s);
+ rCBox.append_text(s);
}
}
}
@@ -174,13 +179,11 @@ SearchAttrItemList::SearchAttrItemList( const SearchAttrItemList& rList ) :
(*this)[i].pItem = (*this)[i].pItem->Clone();
}
-
SearchAttrItemList::~SearchAttrItemList()
{
Clear();
}
-
void SearchAttrItemList::Put( const SfxItemSet& rSet )
{
if ( !rSet.Count() )
@@ -252,11 +255,11 @@ void SearchAttrItemList::Remove(size_t nPos)
SrchAttrItemList::erase( begin() + nPos, begin() + nPos + nLen );
}
-SvxSearchDialog::SvxSearchDialog( vcl::Window* pParent, SfxChildWindow* pChildWin, SfxBindings& rBind )
- : SfxModelessDialog(&rBind, pChildWin, pParent, "FindReplaceDialog",
- "svx/ui/findreplacedialog.ui")
- , mpDocWin(nullptr)
+SvxSearchDialog::SvxSearchDialog(weld::Window* pParent, SfxChildWindow* pChildWin, SfxBindings& rBind)
+ : SfxModelessDialogController(&rBind, pChildWin, pParent,
+ "svx/ui/findreplacedialog.ui", "FindReplaceDialog")
, mbSuccess(false)
+ , mbClosing(false)
, rBindings(rBind)
, bWriter(false)
, bSearch(true)
@@ -268,148 +271,81 @@ SvxSearchDialog::SvxSearchDialog( vcl::Window* pParent, SfxChildWindow* pChildWi
, nModifyFlag(ModifyFlags::NONE)
, pReplaceList(new SearchAttrItemList)
, nTransliterationFlags(TransliterationFlags::NONE)
+ , m_xSearchFrame(m_xBuilder->weld_frame("searchframe"))
+ , m_xSearchLB(m_xBuilder->weld_combo_box("searchterm"))
+ , m_xSearchTmplLB(m_xBuilder->weld_combo_box("searchlist"))
+ , m_xSearchAttrText(m_xBuilder->weld_label("searchdesc"))
+ , m_xSearchLabel(m_xBuilder->weld_label("searchlabel"))
+ , m_xReplaceFrame(m_xBuilder->weld_frame("replaceframe"))
+ , m_xReplaceLB(m_xBuilder->weld_combo_box("replaceterm"))
+ , m_xReplaceTmplLB(m_xBuilder->weld_combo_box("replacelist"))
+ , m_xReplaceAttrText(m_xBuilder->weld_label("replacedesc"))
+ , m_xSearchBtn(m_xBuilder->weld_button("search"))
+ , m_xBackSearchBtn(m_xBuilder->weld_button("backsearch"))
+ , m_xSearchAllBtn(m_xBuilder->weld_button("searchall"))
+ , m_xReplaceBtn(m_xBuilder->weld_button("replace"))
+ , m_xReplaceAllBtn(m_xBuilder->weld_button("replaceall"))
+ , m_xComponentFrame(m_xBuilder->weld_frame("componentframe"))
+ , m_xSearchComponent1PB(m_xBuilder->weld_button("component1"))
+ , m_xSearchComponent2PB(m_xBuilder->weld_button("component2"))
+ , m_xMatchCaseCB(m_xBuilder->weld_check_button("matchcase"))
+ , m_xSearchFormattedCB(m_xBuilder->weld_check_button("searchformatted"))
+ , m_xWordBtn(m_xBuilder->weld_check_button("wholewords"))
+ , m_xCloseBtn(m_xBuilder->weld_button("close"))
+ , m_xIncludeDiacritics(m_xBuilder->weld_check_button("includediacritics"))
+ , m_xIncludeKashida(m_xBuilder->weld_check_button("includekashida"))
+ , m_xOtherOptionsExpander(m_xBuilder->weld_expander("OptionsExpander"))
+ , m_xSelectionBtn(m_xBuilder->weld_check_button("selection"))
+ , m_xRegExpBtn(m_xBuilder->weld_check_button("regexp"))
+ , m_xWildcardBtn(m_xBuilder->weld_check_button("wildcard"))
+ , m_xSimilarityBox(m_xBuilder->weld_check_button("similarity"))
+ , m_xSimilarityBtn(m_xBuilder->weld_button("similaritybtn"))
+ , m_xLayoutBtn(m_xBuilder->weld_check_button("layout"))
+ , m_xNotesBtn(m_xBuilder->weld_check_button("notes"))
+ , m_xJapMatchFullHalfWidthCB(m_xBuilder->weld_check_button("matchcharwidth"))
+ , m_xJapOptionsCB(m_xBuilder->weld_check_button("soundslike"))
+ , m_xReplaceBackwardsCB(m_xBuilder->weld_check_button("replace_backwards"))
+ , m_xJapOptionsBtn(m_xBuilder->weld_button("soundslikebtn"))
+ , m_xAttributeBtn(m_xBuilder->weld_button("attributes"))
+ , m_xFormatBtn(m_xBuilder->weld_button("format"))
+ , m_xNoFormatBtn(m_xBuilder->weld_button("noformat"))
+ , m_xCalcGrid(m_xBuilder->weld_widget("calcgrid"))
+ , m_xCalcSearchInFT(m_xBuilder->weld_label("searchinlabel"))
+ , m_xCalcSearchInLB(m_xBuilder->weld_combo_box("calcsearchin"))
+ , m_xCalcSearchDirFT(m_xBuilder->weld_label("searchdir"))
+ , m_xRowsBtn(m_xBuilder->weld_radio_button("rows"))
+ , m_xColumnsBtn(m_xBuilder->weld_radio_button("cols"))
+ , m_xAllSheetsCB(m_xBuilder->weld_check_button("allsheets"))
+ , m_xCalcStrFT(m_xBuilder->weld_label("entirecells"))
{
- get(m_pSearchFrame, "searchframe");
- get(m_pSearchLB, "searchterm");
- get(m_pSearchTmplLB, "searchlist");
- m_pSearchTmplLB->SetStyle(m_pSearchTmplLB->GetStyle() | WB_SORT);
- get(m_pSearchBtn, "search");
- get(m_pBackSearchBtn, "backsearch");
- get(m_pSearchAllBtn, "searchall");
- get(m_pSearchAttrText, "searchdesc");
- m_pSearchAttrText->SetStyle(m_pSearchAttrText->GetStyle() | WB_PATHELLIPSIS);
- m_pSearchAttrText->Hide();
- get(m_pSearchLabel, "searchlabel");
- m_pSearchLabel->SetStyle(m_pSearchLabel->GetStyle() | WB_PATHELLIPSIS);
- m_pSearchLabel->Show();
-
- get(m_pReplaceFrame, "replaceframe");
- get(m_pReplaceLB, "replaceterm");
- get(m_pReplaceTmplLB, "replacelist");
- m_pReplaceTmplLB->SetStyle(m_pReplaceTmplLB->GetStyle() | WB_SORT);
- get(m_pReplaceBtn, "replace");
- get(m_pReplaceAllBtn, "replaceall");
- get(m_pReplaceAttrText, "replacedesc");
- m_pReplaceAttrText->SetStyle(m_pReplaceAttrText->GetStyle() | WB_PATHELLIPSIS);
- m_pReplaceAttrText->Hide();
-
- get(m_pComponentFrame, "componentframe");
- get(m_pSearchComponent1PB, "component1");
- get(m_pSearchComponent2PB, "component2");
-
- get(m_pMatchCaseCB, "matchcase");
- get(m_pSearchFormattedCB, "searchformatted");
- get(m_pWordBtn, "wholewords");
- aCalcStr = get<FixedText>("entirecells")->GetText();
-
- get(m_pCloseBtn, "close");
-
- get(m_pOtherOptionsExpander, "OptionsExpander");
- get(m_pIncludeDiacritics, "includediacritics");
- get(m_pIncludeKashida, "includekashida");
- get(m_pSelectionBtn, "selection");
- get(m_pReplaceBackwardsCB, "replace_backwards");
- get(m_pRegExpBtn, "regexp");
- get(m_pWildcardBtn, "wildcard");
- get(m_pSimilarityBox, "similarity");
- get(m_pSimilarityBtn, "similaritybtn");
- get(m_pLayoutBtn, "layout");
- get(m_pNotesBtn, "notes");
- get(m_pJapMatchFullHalfWidthCB, "matchcharwidth");
- get(m_pJapOptionsCB, "soundslike");
- get(m_pJapOptionsBtn, "soundslikebtn");
-
- get(m_pAttributeBtn, "attributes");
- get(m_pFormatBtn, "format");
- get(m_pNoFormatBtn, "noformat");
-
- get(m_pCalcGrid, "calcgrid");
- get(m_pCalcSearchInFT, "searchinlabel");
- get(m_pCalcSearchInLB, "calcsearchin");
- get(m_pCalcSearchDirFT, "searchdir");
- get(m_pRowsBtn, "rows");
- get(m_pColumnsBtn, "cols");
- get(m_pAllSheetsCB, "allsheets");
-
- // m_pSimilarityBtn->set_height_request(m_pSimilarityBox->get_preferred_size().Height());
- // m_pJapOptionsBtn->set_height_request(m_pJapOptionsCB->get_preferred_size().Height());
-
- long nTermWidth = approximate_char_width() * 32;
- m_pSearchLB->set_width_request(nTermWidth);
- m_pSearchTmplLB->set_width_request(nTermWidth);
- m_pReplaceLB->set_width_request(nTermWidth);
- m_pReplaceTmplLB->set_width_request(nTermWidth);
+ m_xSearchTmplLB->make_sorted();
+ m_xSearchAttrText->hide();
+ m_xSearchLabel->show();
- Construct_Impl();
-}
+ m_xReplaceTmplLB->make_sorted();
+ m_xReplaceAttrText->hide();
+ aCalcStr = m_xCalcStrFT->get_label();
-SvxSearchDialog::~SvxSearchDialog()
-{
- disposeOnce();
+ // m_xSimilarityBtn->set_height_request(m_xSimilarityBox->get_preferred_size().Height());
+ // m_xJapOptionsBtn->set_height_request(m_xJapOptionsCB->get_preferred_size().Height());
+
+ auto nTermWidth = m_xSearchLB->get_approximate_digit_width() * 28;
+ m_xSearchLB->set_size_request(nTermWidth, -1);
+ m_xSearchTmplLB->set_size_request(nTermWidth, -1);
+ m_xReplaceLB->set_size_request(nTermWidth, -1);
+ m_xReplaceTmplLB->set_size_request(nTermWidth, -1);
+
+ Construct_Impl();
}
-void SvxSearchDialog::dispose()
+SvxSearchDialog::~SvxSearchDialog()
{
- Hide();
-
rBindings.EnterRegistrations();
pSearchController.reset();
pOptionsController.reset();
pFamilyController.reset();
rBindings.LeaveRegistrations();
-
- pSearchItem.reset();
- pImpl.reset();
- pSearchList.reset();
- pReplaceList.reset();
- mpDocWin.clear();
- m_pSearchFrame.clear();
- m_pSearchLB.clear();
- m_pSearchTmplLB.clear();
- m_pSearchAttrText.clear();
- m_pSearchLabel.clear();
- m_pReplaceFrame.clear();
- m_pReplaceLB.clear();
- m_pReplaceTmplLB.clear();
- m_pReplaceAttrText.clear();
- m_pSearchBtn.clear();
- m_pBackSearchBtn.clear();
- m_pSearchAllBtn.clear();
- m_pReplaceBtn.clear();
- m_pReplaceAllBtn.clear();
- m_pComponentFrame.clear();
- m_pSearchComponent1PB.clear();
- m_pSearchComponent2PB.clear();
- m_pMatchCaseCB.clear();
- m_pSearchFormattedCB.clear();
- m_pWordBtn.clear();
- m_pCloseBtn.clear();
- m_pIncludeDiacritics.clear();
- m_pIncludeKashida.clear();
- m_pOtherOptionsExpander.clear();
- m_pSelectionBtn.clear();
- m_pReplaceBackwardsCB.clear();
- m_pRegExpBtn.clear();
- m_pWildcardBtn.clear();
- m_pSimilarityBox.clear();
- m_pSimilarityBtn.clear();
- m_pLayoutBtn.clear();
- m_pNotesBtn.clear();
- m_pJapMatchFullHalfWidthCB.clear();
- m_pJapOptionsCB.clear();
- m_pJapOptionsBtn.clear();
- m_pAttributeBtn.clear();
- m_pFormatBtn.clear();
- m_pNoFormatBtn.clear();
- m_pCalcGrid.clear();
- m_pCalcSearchInFT.clear();
- m_pCalcSearchInLB.clear();
- m_pCalcSearchDirFT.clear();
- m_pRowsBtn.clear();
- m_pColumnsBtn.clear();
- m_pAllSheetsCB.clear();
- SfxModelessDialog::dispose();
}
void SvxSearchDialog::Construct_Impl()
@@ -420,20 +356,20 @@ void SvxSearchDialog::Construct_Impl()
LINK( this, SvxSearchDialog, TimeoutHdl_Impl ) );
EnableControls_Impl( SearchOptionFlags::NONE );
- // Store old Text from m_pWordBtn
+ // Store old Text from m_xWordBtn
aCalcStr += "#";
- aCalcStr += m_pWordBtn->GetText();
+ aCalcStr += m_xWordBtn->get_label();
aLayoutStr = SvxResId( RID_SVXSTR_SEARCH_STYLES );
aLayoutWriterStr = SvxResId( RID_SVXSTR_WRITER_STYLES );
aLayoutCalcStr = SvxResId( RID_SVXSTR_CALC_STYLES );
- aStylesStr = m_pLayoutBtn->GetText();
+ aStylesStr = m_xLayoutBtn->get_label();
// Get stored search-strings from the application
ListToStrArr_Impl(SID_SEARCHDLG_SEARCHSTRINGS,
- aSearchStrings, *m_pSearchLB);
+ aSearchStrings, *m_xSearchLB);
ListToStrArr_Impl(SID_SEARCHDLG_REPLACESTRINGS,
- aReplaceStrings, *m_pReplaceLB);
+ aReplaceStrings, *m_xReplaceLB);
InitControls_Impl();
@@ -465,25 +401,25 @@ void SvxSearchDialog::Construct_Impl()
SvtCJKOptions aCJKOptions;
if(!aCJKOptions.IsJapaneseFindEnabled())
{
- m_pJapOptionsCB->Check( false );
- m_pJapOptionsCB->Hide();
- m_pJapOptionsBtn->Hide();
+ m_xJapOptionsCB->set_active( false );
+ m_xJapOptionsCB->hide();
+ m_xJapOptionsBtn->hide();
}
if(!aCJKOptions.IsCJKFontEnabled())
{
- m_pJapMatchFullHalfWidthCB->Hide();
+ m_xJapMatchFullHalfWidthCB->hide();
}
SvtCTLOptions aCTLOptions;
- // Do not disable and hide the m_pIncludeDiacritics button.
+ // Do not disable and hide the m_xIncludeDiacritics button.
// Include Diacritics == Not Ignore Diacritics => A does not match A-Umlaut (Diaeresis).
// Confusingly these have negated names (following the UI) but the actual
// transliteration is to *ignore* diacritics if "included" (sensitive) is
// _not_ checked.
if(!aCTLOptions.IsCTLFontEnabled())
{
- m_pIncludeDiacritics->Check( true );
- m_pIncludeKashida->Check( true );
- m_pIncludeKashida->Hide();
+ m_xIncludeDiacritics->set_active( true );
+ m_xIncludeKashida->set_active( true );
+ m_xIncludeKashida->hide();
}
//component extension - show component search buttons if the commands
// vnd.sun.star::SearchViaComponent1 and 2 are supported
@@ -522,32 +458,38 @@ void SvxSearchDialog::Construct_Impl()
OUString sTemp;
uno::Any aRet = xDirectAccess->getByName("ComponentSearchGroupLabel");
aRet >>= sTemp;
- m_pComponentFrame->get_label_widget()->SetText(sTemp);
+ m_xComponentFrame->set_label(sTemp);
aRet = xDirectAccess->getByName("ComponentSearchCommandLabel1");
aRet >>= sTemp;
- m_pSearchComponent1PB->SetText( sTemp );
+ m_xSearchComponent1PB->set_label( sTemp );
aRet = xDirectAccess->getByName("ComponentSearchCommandLabel2");
aRet >>= sTemp;
- m_pSearchComponent2PB->SetText( sTemp );
+ m_xSearchComponent2PB->set_label( sTemp );
}
}
catch(uno::Exception&){}
- if(!m_pSearchComponent1PB->GetText().isEmpty() && bSearchComponent1 )
+ if(!m_xSearchComponent1PB->get_label().isEmpty() && bSearchComponent1 )
{
- m_pComponentFrame->Show();
- m_pSearchComponent1PB->Show();
+ m_xComponentFrame->show();
+ m_xSearchComponent1PB->show();
}
- if( !m_pSearchComponent2PB->GetText().isEmpty() )
+ if( !m_xSearchComponent2PB->get_label().isEmpty() )
{
- m_pComponentFrame->Show();
- m_pSearchComponent2PB->Show();
+ m_xComponentFrame->show();
+ m_xSearchComponent2PB->show();
}
}
}
+void SvxSearchDialog::EndDialog()
+{
+ mbClosing = true;
+ SfxModelessDialogController::EndDialog();
+ mbClosing = false;
+}
-bool SvxSearchDialog::Close()
+void SvxSearchDialog::Close()
{
// remember strings
if (!aSearchStrings.empty())
@@ -558,34 +500,38 @@ bool SvxSearchDialog::Close()
// save settings to configuration
SvtSearchOptions aOpt;
- aOpt.SetWholeWordsOnly ( m_pWordBtn->IsChecked() );
- aOpt.SetBackwards ( m_pReplaceBackwardsCB->IsChecked() );
- aOpt.SetUseRegularExpression ( m_pRegExpBtn->IsChecked() );
- aOpt.SetUseWildcard ( m_pWildcardBtn->IsChecked() );
- aOpt.SetSearchForStyles ( m_pLayoutBtn->IsChecked() );
- aOpt.SetSimilaritySearch ( m_pSimilarityBox->IsChecked() );
- aOpt.SetUseAsianOptions ( m_pJapOptionsCB->IsChecked() );
- aOpt.SetNotes ( m_pNotesBtn->IsChecked() );
- aOpt.SetIgnoreDiacritics_CTL ( !m_pIncludeDiacritics->IsChecked() );
- aOpt.SetIgnoreKashida_CTL ( !m_pIncludeKashida->IsChecked() );
- aOpt.SetSearchFormatted ( m_pSearchFormattedCB->IsChecked() );
+ aOpt.SetWholeWordsOnly ( m_xWordBtn->get_active() );
+ aOpt.SetBackwards ( m_xReplaceBackwardsCB->get_active() );
+ aOpt.SetUseRegularExpression ( m_xRegExpBtn->get_active() );
+ aOpt.SetUseWildcard ( m_xWildcardBtn->get_active() );
+ aOpt.SetSearchForStyles ( m_xLayoutBtn->get_active() );
+ aOpt.SetSimilaritySearch ( m_xSimilarityBox->get_active() );
+ aOpt.SetUseAsianOptions ( m_xJapOptionsCB->get_active() );
+ aOpt.SetNotes ( m_xNotesBtn->get_active() );
+ aOpt.SetIgnoreDiacritics_CTL ( !m_xIncludeDiacritics->get_active() );
+ aOpt.SetIgnoreKashida_CTL ( !m_xIncludeKashida->get_active() );
+ aOpt.SetSearchFormatted ( m_xSearchFormattedCB->get_active() );
aOpt.Commit();
+ if (mbClosing)
+ return;
+
const SfxPoolItem* ppArgs[] = { pSearchItem.get(), nullptr };
rBindings.GetDispatcher()->Execute( FID_SEARCH_OFF, SfxCallMode::SLOT, ppArgs );
- rBindings.Execute( SID_SEARCH_DLG );
+ rBindings.Invalidate(SID_SEARCH_DLG);
- return true;
+ SfxViewShell* pViewShell = SfxViewShell::Current();
+ if (pViewShell)
+ pViewShell->GetViewFrame()->ToggleChildWindow(SID_SEARCH_DLG);
}
-
TransliterationFlags SvxSearchDialog::GetTransliterationFlags() const
{
- if (!m_pMatchCaseCB->IsChecked())
+ if (!m_xMatchCaseCB->get_active())
nTransliterationFlags |= TransliterationFlags::IGNORE_CASE;
else
nTransliterationFlags &= ~TransliterationFlags::IGNORE_CASE;
- if ( !m_pJapMatchFullHalfWidthCB->IsChecked())
+ if ( !m_xJapMatchFullHalfWidthCB->get_active())
nTransliterationFlags |= TransliterationFlags::IGNORE_WIDTH;
else
nTransliterationFlags &= ~TransliterationFlags::IGNORE_WIDTH;
@@ -602,97 +548,95 @@ void SvxSearchDialog::ApplyTransliterationFlags_Impl( TransliterationFlags nSett
{
nTransliterationFlags = nSettings;
bool bVal(nSettings & TransliterationFlags::IGNORE_CASE);
- m_pMatchCaseCB->Check( !bVal );
+ m_xMatchCaseCB->set_active( !bVal );
bVal = bool(nSettings & TransliterationFlags::IGNORE_WIDTH);
- m_pJapMatchFullHalfWidthCB->Check( !bVal );
+ m_xJapMatchFullHalfWidthCB->set_active( !bVal );
}
bool SvxSearchDialog::IsOtherOptionsExpanded()
{
- return m_pReplaceBackwardsCB->IsChecked() ||
- m_pSelectionBtn->IsChecked() ||
- m_pRegExpBtn->IsChecked() ||
- m_pLayoutBtn->IsChecked() ||
- m_pSimilarityBox->IsChecked() ||
- m_pJapMatchFullHalfWidthCB->IsChecked() ||
- m_pJapOptionsCB->IsChecked() ||
- m_pWildcardBtn->IsChecked() ||
- m_pNotesBtn->IsChecked() ||
- m_pIncludeKashida->IsChecked() ||
- m_pIncludeDiacritics->IsChecked();
+ return m_xReplaceBackwardsCB->get_active() ||
+ m_xSelectionBtn->get_active() ||
+ m_xRegExpBtn->get_active() ||
+ m_xLayoutBtn->get_active() ||
+ m_xSimilarityBox->get_active() ||
+ m_xJapMatchFullHalfWidthCB->get_active() ||
+ m_xJapOptionsCB->get_active() ||
+ m_xWildcardBtn->get_active() ||
+ m_xNotesBtn->get_active() ||
+ m_xIncludeKashida->get_active() ||
+ m_xIncludeDiacritics->get_active();
}
-
void SvxSearchDialog::Activate()
{
// apply possible transliteration changes of the SvxSearchItem member
DBG_ASSERT( pSearchItem, "SearchItem missing" );
if (pSearchItem)
{
- m_pMatchCaseCB->Check( pSearchItem->GetExact() );
- m_pJapMatchFullHalfWidthCB->Check( !pSearchItem->IsMatchFullHalfWidthForms() );
+ m_xMatchCaseCB->set_active( pSearchItem->GetExact() );
+ m_xJapMatchFullHalfWidthCB->set_active( !pSearchItem->IsMatchFullHalfWidthForms() );
}
- SfxModelessDialog::Activate();
+ SfxModelessDialogController::Activate();
}
-
void SvxSearchDialog::InitControls_Impl()
{
// CaseSensitives AutoComplete
- m_pSearchLB->EnableAutocomplete( true, true );
- m_pSearchLB->Show();
- m_pReplaceLB->EnableAutocomplete( true, true );
- m_pReplaceLB->Show();
+ m_xSearchLB->set_entry_completion( true );
+ m_xSearchLB->show();
+ m_xReplaceLB->set_entry_completion( true );
+ m_xReplaceLB->show();
- m_pFormatBtn->Disable();
- m_pAttributeBtn->Disable();
+ m_xFormatBtn->set_sensitive(false);
+ m_xAttributeBtn->set_sensitive(false);
- m_pSearchLB->SetModifyHdl( LINK( this, SvxSearchDialog, ModifyHdl_Impl ) );
- m_pReplaceLB->SetModifyHdl( LINK( this, SvxSearchDialog, ModifyHdl_Impl ) );
+ m_xSearchLB->connect_changed( LINK( this, SvxSearchDialog, ModifyHdl_Impl ) );
+ m_xReplaceLB->connect_changed( LINK( this, SvxSearchDialog, ModifyHdl_Impl ) );
- Link<Control&,void> aLink = LINK( this, SvxSearchDialog, FocusHdl_Impl );
- m_pSearchLB->SetGetFocusHdl( aLink );
- m_pReplaceLB->SetGetFocusHdl( aLink );
+ Link<weld::Widget&,void> aLink = LINK( this, SvxSearchDialog, FocusHdl_Impl );
+ m_xSearchLB->connect_focus_in( aLink );
+ m_xReplaceLB->connect_focus_in( aLink );
aLink = LINK( this, SvxSearchDialog, LoseFocusHdl_Impl );
- m_pSearchLB->SetLoseFocusHdl( aLink );
- m_pReplaceLB->SetLoseFocusHdl( aLink );
-
- m_pSearchTmplLB->SetLoseFocusHdl( aLink );
- m_pReplaceTmplLB->SetLoseFocusHdl( aLink );
-
- Link<Button*,void> aLink2 = LINK( this, SvxSearchDialog, CommandHdl_Impl );
- m_pSearchBtn->SetClickHdl( aLink2 );
- m_pBackSearchBtn->SetClickHdl( aLink2 );
- m_pSearchAllBtn->SetClickHdl( aLink2 );
- m_pReplaceBtn->SetClickHdl( aLink2 );
- m_pReplaceAllBtn->SetClickHdl( aLink2 );
- m_pCloseBtn->SetClickHdl( aLink2 );
- m_pSimilarityBtn->SetClickHdl( aLink2 );
- m_pJapOptionsBtn->SetClickHdl( aLink2 );
- m_pSearchComponent1PB->SetClickHdl( aLink2 );
- m_pSearchComponent2PB->SetClickHdl( aLink2 );
+ m_xSearchLB->connect_focus_out( aLink );
+ m_xReplaceLB->connect_focus_out( aLink );
+
+ m_xSearchTmplLB->connect_focus_out( aLink );
+ m_xReplaceTmplLB->connect_focus_out( aLink );
+
+ Link<weld::Button&,void> aLink2 = LINK( this, SvxSearchDialog, CommandHdl_Impl );
+ m_xSearchBtn->connect_clicked( aLink2 );
+ m_xBackSearchBtn->connect_clicked( aLink2 );
+ m_xSearchAllBtn->connect_clicked( aLink2 );
+ m_xReplaceBtn->connect_clicked( aLink2 );
+ m_xReplaceAllBtn->connect_clicked( aLink2 );
+ m_xCloseBtn->connect_clicked( aLink2 );
+ m_xSimilarityBtn->connect_clicked( aLink2 );
+ m_xJapOptionsBtn->connect_clicked( aLink2 );
+ m_xSearchComponent1PB->connect_clicked( aLink2 );
+ m_xSearchComponent2PB->connect_clicked( aLink2 );
aLink2 = LINK( this, SvxSearchDialog, FlagHdl_Impl );
- m_pReplaceBackwardsCB->SetClickHdl( aLink2 );
- m_pWordBtn->SetClickHdl( aLink2 );
- m_pSelectionBtn->SetClickHdl( aLink2 );
- m_pMatchCaseCB->SetClickHdl( aLink2 );
- m_pRegExpBtn->SetClickHdl( aLink2 );
- m_pWildcardBtn->SetClickHdl( aLink2 );
- m_pNotesBtn->SetClickHdl( aLink2 );
- m_pSimilarityBox->SetClickHdl( aLink2 );
- m_pJapOptionsCB->SetClickHdl( aLink2 );
- m_pJapMatchFullHalfWidthCB->SetClickHdl( aLink2 );
- m_pIncludeDiacritics->SetClickHdl( aLink2 );
- m_pIncludeKashida->SetClickHdl( aLink2 );
- m_pLayoutBtn->SetClickHdl( LINK( this, SvxSearchDialog, TemplateHdl_Impl ) );
- m_pFormatBtn->SetClickHdl( LINK( this, SvxSearchDialog, FormatHdl_Impl ) );
- m_pNoFormatBtn->SetClickHdl(
+ m_xReplaceBackwardsCB->connect_clicked( aLink2 );
+ m_xWordBtn->connect_clicked( aLink2 );
+ m_xSelectionBtn->connect_clicked( aLink2 );
+ m_xMatchCaseCB->connect_clicked( aLink2 );
+ m_xRegExpBtn->connect_clicked( aLink2 );
+ m_xWildcardBtn->connect_clicked( aLink2 );
+ m_xNotesBtn->connect_clicked( aLink2 );
+ m_xSimilarityBox->connect_clicked( aLink2 );
+ m_xJapOptionsCB->connect_clicked( aLink2 );
+ m_xJapMatchFullHalfWidthCB->connect_clicked( aLink2 );
+ m_xIncludeDiacritics->connect_clicked( aLink2 );
+ m_xIncludeKashida->connect_clicked( aLink2 );
+ m_xLayoutBtn->connect_clicked( LINK( this, SvxSearchDialog, TemplateHdl_Impl ) );
+ m_xFormatBtn->connect_clicked( LINK( this, SvxSearchDialog, FormatHdl_Impl ) );
+ m_xNoFormatBtn->connect_clicked(
LINK( this, SvxSearchDialog, NoFormatHdl_Impl ) );
- m_pAttributeBtn->SetClickHdl(
+ m_xAttributeBtn->connect_clicked(
LINK( this, SvxSearchDialog, AttributeHdl_Impl ) );
}
@@ -732,36 +676,36 @@ void SvxSearchDialog::ShowOptionalControls_Impl()
eFactory == SvtModuleOptions::EFactory::WRITERGLOBAL;
bool bCalcApp = eFactory == SvtModuleOptions::EFactory::CALC;
- m_pLayoutBtn->Show(!bDrawApp);
- m_pNotesBtn->Show(bWriterApp);
- m_pRegExpBtn->Show(!bDrawApp);
- m_pWildcardBtn->Show(bCalcApp); /* TODO:WILDCARD enable for other apps if hey handle it */
- m_pReplaceBackwardsCB->Show();
- m_pSimilarityBox->Show();
- m_pSimilarityBtn->Show();
- m_pSelectionBtn->Show();
- m_pIncludeDiacritics->Show();
- m_pIncludeKashida->Show(aCTLOptions.IsCTLFontEnabled());
- m_pJapMatchFullHalfWidthCB->Show(aCJKOptions.IsCJKFontEnabled());
- m_pJapOptionsCB->Show(aCJKOptions.IsJapaneseFindEnabled());
- m_pJapOptionsBtn->Show(aCJKOptions.IsJapaneseFindEnabled());
+ m_xLayoutBtn->set_visible(!bDrawApp);
+ m_xNotesBtn->set_visible(bWriterApp);
+ m_xRegExpBtn->set_visible(!bDrawApp);
+ m_xWildcardBtn->set_visible(bCalcApp); /* TODO:WILDCARD enable for other apps if hey handle it */
+ m_xReplaceBackwardsCB->show();
+ m_xSimilarityBox->show();
+ m_xSimilarityBtn->show();
+ m_xSelectionBtn->show();
+ m_xIncludeDiacritics->show();
+ m_xIncludeKashida->set_visible(aCTLOptions.IsCTLFontEnabled());
+ m_xJapMatchFullHalfWidthCB->set_visible(aCJKOptions.IsCJKFontEnabled());
+ m_xJapOptionsCB->set_visible(aCJKOptions.IsJapaneseFindEnabled());
+ m_xJapOptionsBtn->set_visible(aCJKOptions.IsJapaneseFindEnabled());
if (bWriter)
{
- m_pAttributeBtn->Show();
- m_pFormatBtn->Show();
- m_pNoFormatBtn->Show();
+ m_xAttributeBtn->show();
+ m_xFormatBtn->show();
+ m_xNoFormatBtn->show();
}
if (bCalcApp)
{
- m_pCalcSearchInFT->Show();
- m_pCalcSearchInLB->Show();
- m_pCalcSearchDirFT->Show();
- m_pRowsBtn->Show();
- m_pColumnsBtn->Show();
- m_pAllSheetsCB->Show();
- m_pSearchFormattedCB->Show();
+ m_xCalcSearchInFT->show();
+ m_xCalcSearchInLB->show();
+ m_xCalcSearchDirFT->show();
+ m_xRowsBtn->show();
+ m_xColumnsBtn->show();
+ m_xAllSheetsCB->show();
+ m_xSearchFormattedCB->show();
}
}
@@ -800,45 +744,45 @@ void SvxSearchDialog::Init_Impl( bool bSearchPattern )
bWriter = ( pSearchItem->GetAppFlag() == SvxSearchApp::WRITER );
if ( !( nModifyFlag & ModifyFlags::Word ) )
- m_pWordBtn->Check( pSearchItem->GetWordOnly() );
+ m_xWordBtn->set_active( pSearchItem->GetWordOnly() );
if ( !( nModifyFlag & ModifyFlags::Exact ) )
- m_pMatchCaseCB->Check( pSearchItem->GetExact() );
+ m_xMatchCaseCB->set_active( pSearchItem->GetExact() );
if ( !( nModifyFlag & ModifyFlags::Backwards ) )
- m_pReplaceBackwardsCB->Check( bReplaceBackwards ); //adjustment to replace backwards
+ m_xReplaceBackwardsCB->set_active( bReplaceBackwards ); //adjustment to replace backwards
if ( !( nModifyFlag & ModifyFlags::Notes ) )
- m_pNotesBtn->Check( pSearchItem->GetNotes() );
+ m_xNotesBtn->set_active( pSearchItem->GetNotes() );
if ( !( nModifyFlag & ModifyFlags::Selection ) )
- m_pSelectionBtn->Check( pSearchItem->GetSelection() );
+ m_xSelectionBtn->set_active( pSearchItem->GetSelection() );
if ( !( nModifyFlag & ModifyFlags::Regexp ) )
- m_pRegExpBtn->Check( pSearchItem->GetRegExp() );
+ m_xRegExpBtn->set_active( pSearchItem->GetRegExp() );
if ( !( nModifyFlag & ModifyFlags::Wildcard ) )
- m_pWildcardBtn->Check( pSearchItem->GetWildcard() );
+ m_xWildcardBtn->set_active( pSearchItem->GetWildcard() );
if ( !( nModifyFlag & ModifyFlags::Layout ) )
- m_pLayoutBtn->Check( pSearchItem->GetPattern() );
- if (m_pNotesBtn->IsChecked())
- m_pLayoutBtn->Disable();
- m_pSimilarityBox->Check( pSearchItem->IsLevenshtein() );
- if ( m_pJapOptionsCB->IsVisible() )
- m_pJapOptionsCB->Check( pSearchItem->IsUseAsianOptions() );
- m_pIncludeDiacritics->Check( !aOpt.IsIgnoreDiacritics_CTL() );
- if ( m_pIncludeKashida->IsVisible() )
- m_pIncludeKashida->Check( !aOpt.IsIgnoreKashida_CTL() );
+ m_xLayoutBtn->set_active( pSearchItem->GetPattern() );
+ if (m_xNotesBtn->get_active())
+ m_xLayoutBtn->set_sensitive(false);
+ m_xSimilarityBox->set_active( pSearchItem->IsLevenshtein() );
+ if ( m_xJapOptionsCB->get_visible() )
+ m_xJapOptionsCB->set_active( pSearchItem->IsUseAsianOptions() );
+ m_xIncludeDiacritics->set_active( !aOpt.IsIgnoreDiacritics_CTL() );
+ if ( m_xIncludeKashida->get_visible() )
+ m_xIncludeKashida->set_active( !aOpt.IsIgnoreKashida_CTL() );
if ( SvxSearchDialog::IsOtherOptionsExpanded() )
- m_pOtherOptionsExpander->set_expanded( true );
+ m_xOtherOptionsExpander->set_expanded( true );
ApplyTransliterationFlags_Impl( pSearchItem->GetTransliterationFlags() );
ShowOptionalControls_Impl();
if ( pSearchItem->GetAppFlag() == SvxSearchApp::CALC )
{
- m_pCalcGrid->Show();
- m_pSearchFormattedCB->Check( aOpt.IsSearchFormatted() );
- Link<Button*,void> aLink = LINK( this, SvxSearchDialog, FlagHdl_Impl );
- m_pCalcSearchInLB->SetSelectHdl( LINK( this, SvxSearchDialog, LBSelectHdl_Impl ) );
- m_pRowsBtn->SetClickHdl( aLink );
- m_pColumnsBtn->SetClickHdl( aLink );
- m_pAllSheetsCB->SetClickHdl( aLink );
- m_pSearchFormattedCB->SetClickHdl( aLink );
+ m_xCalcGrid->show();
+ m_xSearchFormattedCB->set_active( aOpt.IsSearchFormatted() );
+ Link<weld::Button&,void> aLink = LINK( this, SvxSearchDialog, FlagHdl_Impl );
+ m_xCalcSearchInLB->connect_changed( LINK( this, SvxSearchDialog, LBSelectHdl_Impl ) );
+ m_xRowsBtn->connect_clicked( aLink );
+ m_xColumnsBtn->connect_clicked( aLink );
+ m_xAllSheetsCB->connect_clicked( aLink );
+ m_xSearchFormattedCB->connect_clicked( aLink );
ModifyFlags nModifyFlagCheck;
switch ( pSearchItem->GetCellType() )
@@ -859,46 +803,46 @@ void SvxSearchDialog::Init_Impl( bool bSearchPattern )
std::abort(); // cannot happen
}
if ( !(nModifyFlag & nModifyFlagCheck) )
- m_pCalcSearchInLB->SelectEntryPos( static_cast<sal_Int32>(pSearchItem->GetCellType()) );
+ m_xCalcSearchInLB->set_active( static_cast<sal_Int32>(pSearchItem->GetCellType()) );
- m_pWordBtn->SetText( aCalcStr.getToken( 0, '#' ) );
+ m_xWordBtn->set_label( aCalcStr.getToken( 0, '#' ) );
if ( pSearchItem->GetRowDirection() &&
!( nModifyFlag & ModifyFlags::Rows ) )
- m_pRowsBtn->Check();
+ m_xRowsBtn->set_active(true);
else if ( !pSearchItem->GetRowDirection() &&
!( nModifyFlag & ModifyFlags::Columns ) )
- m_pColumnsBtn->Check();
+ m_xColumnsBtn->set_active(true);
if ( !( nModifyFlag & ModifyFlags::AllTables ) )
- m_pAllSheetsCB->Check( pSearchItem->IsAllTables() );
+ m_xAllSheetsCB->set_active( pSearchItem->IsAllTables() );
// only look for formatting in Writer
- m_pFormatBtn->Hide();
- m_pNoFormatBtn->Hide();
- m_pAttributeBtn->Hide();
+ m_xFormatBtn->hide();
+ m_xNoFormatBtn->hide();
+ m_xAttributeBtn->hide();
}
else
{
- m_pSearchFormattedCB->Hide();
- m_pWordBtn->SetText( aCalcStr.getToken( 1, '#' ) );
+ m_xSearchFormattedCB->hide();
+ m_xWordBtn->set_label( aCalcStr.getToken( 1, '#' ) );
if ( pSearchItem->GetAppFlag() == SvxSearchApp::DRAW )
{
- m_pSearchAllBtn->Hide();
+ m_xSearchAllBtn->hide();
- m_pRegExpBtn->Hide();
- m_pWildcardBtn->Hide();
- m_pLayoutBtn->Hide();
+ m_xRegExpBtn->hide();
+ m_xWildcardBtn->hide();
+ m_xLayoutBtn->hide();
// only look for formatting in Writer
- m_pFormatBtn->Hide();
- m_pNoFormatBtn->Hide();
- m_pAttributeBtn->Hide();
+ m_xFormatBtn->hide();
+ m_xNoFormatBtn->hide();
+ m_xAttributeBtn->hide();
}
else
{
- m_pWildcardBtn->Hide(); /* TODO:WILDCARD do not hide for other apps if they handle it */
+ m_xWildcardBtn->hide(); /* TODO:WILDCARD do not hide for other apps if they handle it */
if ( !pSearchList )
{
@@ -921,11 +865,11 @@ void SvxSearchDialog::Init_Impl( bool bSearchPattern )
// similarity search?
if ( !( nModifyFlag & ModifyFlags::Similarity ) )
- m_pSimilarityBox->Check( pSearchItem->IsLevenshtein() );
+ m_xSimilarityBox->set_active( pSearchItem->IsLevenshtein() );
bSet = true;
- FlagHdl_Impl(m_pSimilarityBox);
- FlagHdl_Impl(m_pJapOptionsCB);
+ FlagHdl_Impl(*m_xSimilarityBox);
+ FlagHdl_Impl(*m_xJapOptionsCB);
bool bDisableSearch = false;
SfxViewShell* pViewShell = SfxViewShell::Current();
@@ -935,11 +879,11 @@ void SvxSearchDialog::Init_Impl( bool bSearchPattern )
bool bText = !bSearchPattern;
if ( pViewShell->HasSelection( bText ) )
- EnableControl_Impl(m_pSelectionBtn);
+ EnableControl_Impl(*m_xSelectionBtn);
else
{
- m_pSelectionBtn->Check( false );
- m_pSelectionBtn->Disable();
+ m_xSelectionBtn->set_active( false );
+ m_xSelectionBtn->set_sensitive(false);
}
}
@@ -951,8 +895,8 @@ void SvxSearchDialog::Init_Impl( bool bSearchPattern )
if ( pShell && pShell->GetStyleSheetPool() )
{
// Templates designed
- m_pSearchTmplLB->Clear();
- m_pReplaceTmplLB->Clear();
+ m_xSearchTmplLB->clear();
+ m_xReplaceTmplLB->clear();
SfxStyleSheetBasePool* pStylePool = pShell->GetStyleSheetPool();
pStylePool->SetSearchMask( pSearchItem->GetFamily() );
SfxStyleSheetBase* pBase = pStylePool->First();
@@ -960,29 +904,29 @@ void SvxSearchDialog::Init_Impl( bool bSearchPattern )
while ( pBase )
{
if ( pBase->IsUsed() )
- m_pSearchTmplLB->InsertEntry( pBase->GetName() );
- m_pReplaceTmplLB->InsertEntry( pBase->GetName() );
+ m_xSearchTmplLB->append_text( pBase->GetName() );
+ m_xReplaceTmplLB->append_text( pBase->GetName() );
pBase = pStylePool->Next();
}
- m_pSearchTmplLB->SelectEntry( pSearchItem->GetSearchString() );
- m_pReplaceTmplLB->SelectEntry( pSearchItem->GetReplaceString() );
+ m_xSearchTmplLB->set_active_text( pSearchItem->GetSearchString() );
+ m_xReplaceTmplLB->set_active_text( pSearchItem->GetReplaceString() );
}
- m_pSearchTmplLB->Show();
+ m_xSearchTmplLB->show();
if ( bConstruct )
// Grab focus only after creating
- m_pSearchTmplLB->GrabFocus();
- m_pReplaceTmplLB->Show();
- m_pSearchLB->Hide();
- m_pReplaceLB->Hide();
+ m_xSearchTmplLB->grab_focus();
+ m_xReplaceTmplLB->show();
+ m_xSearchLB->hide();
+ m_xReplaceLB->hide();
- m_pWordBtn->Disable();
- m_pRegExpBtn->Disable();
- m_pWildcardBtn->Disable();
- m_pMatchCaseCB->Disable();
+ m_xWordBtn->set_sensitive(false);
+ m_xRegExpBtn->set_sensitive(false);
+ m_xWildcardBtn->set_sensitive(false);
+ m_xMatchCaseCB->set_sensitive(false);
- bDisableSearch = !m_pSearchTmplLB->GetEntryCount();
+ bDisableSearch = !m_xSearchTmplLB->get_count();
}
else
{
@@ -990,7 +934,7 @@ void SvxSearchDialog::Init_Impl( bool bSearchPattern )
bool bSetReplace = !( nModifyFlag & ModifyFlags::Replace );
if ( !(pSearchItem->GetSearchString().isEmpty()) && bSetSearch )
- m_pSearchLB->SetText( pSearchItem->GetSearchString() );
+ m_xSearchLB->set_entry_text( pSearchItem->GetSearchString() );
else if (!aSearchStrings.empty())
{
bool bAttributes =
@@ -998,7 +942,7 @@ void SvxSearchDialog::Init_Impl( bool bSearchPattern )
( pReplaceList && pReplaceList->Count() ) );
if ( bSetSearch && !bAttributes )
- m_pSearchLB->SetText(aSearchStrings[0]);
+ m_xSearchLB->set_entry_text(aSearchStrings[0]);
OUString aReplaceTxt = pSearchItem->GetReplaceString();
@@ -1006,72 +950,72 @@ void SvxSearchDialog::Init_Impl( bool bSearchPattern )
aReplaceTxt = aReplaceStrings[0];
if ( bSetReplace && !bAttributes )
- m_pReplaceLB->SetText( aReplaceTxt );
+ m_xReplaceLB->set_entry_text( aReplaceTxt );
}
- m_pSearchLB->Show();
+ m_xSearchLB->show();
if ( bConstruct )
// Grab focus only after creating
- m_pSearchLB->GrabFocus();
- m_pReplaceLB->Show();
- m_pSearchTmplLB->Hide();
- m_pReplaceTmplLB->Hide();
+ m_xSearchLB->grab_focus();
+ m_xReplaceLB->show();
+ m_xSearchTmplLB->hide();
+ m_xReplaceTmplLB->hide();
- EnableControl_Impl(m_pRegExpBtn);
- EnableControl_Impl(m_pWildcardBtn);
- EnableControl_Impl(m_pMatchCaseCB);
+ EnableControl_Impl(*m_xRegExpBtn);
+ EnableControl_Impl(*m_xWildcardBtn);
+ EnableControl_Impl(*m_xMatchCaseCB);
- if ( m_pRegExpBtn->IsChecked() )
- m_pWordBtn->Disable();
+ if ( m_xRegExpBtn->get_active() )
+ m_xWordBtn->set_sensitive(false);
else
- EnableControl_Impl(m_pWordBtn);
+ EnableControl_Impl(*m_xWordBtn);
- bDisableSearch = m_pSearchLB->GetText().isEmpty() &&
- m_pSearchAttrText->GetText().isEmpty();
+ bDisableSearch = m_xSearchLB->get_active_text().isEmpty() &&
+ m_xSearchAttrText->get_label().isEmpty();
}
- FocusHdl_Impl(*m_pSearchLB);
+ FocusHdl_Impl(*m_xSearchLB);
if ( bDisableSearch )
{
- m_pSearchBtn->Disable();
- m_pBackSearchBtn->Disable();
- m_pSearchAllBtn->Disable();
- m_pReplaceBtn->Disable();
- m_pReplaceAllBtn->Disable();
- m_pComponentFrame->Enable(false);
+ m_xSearchBtn->set_sensitive(false);
+ m_xBackSearchBtn->set_sensitive(false);
+ m_xSearchAllBtn->set_sensitive(false);
+ m_xReplaceBtn->set_sensitive(false);
+ m_xReplaceAllBtn->set_sensitive(false);
+ m_xComponentFrame->set_sensitive(false);
}
else
{
- EnableControl_Impl(m_pSearchBtn);
- EnableControl_Impl(m_pBackSearchBtn);
- EnableControl_Impl(m_pReplaceBtn);
- if (!bWriter || !m_pNotesBtn->IsChecked())
+ EnableControl_Impl(*m_xSearchBtn);
+ EnableControl_Impl(*m_xBackSearchBtn);
+ EnableControl_Impl(*m_xReplaceBtn);
+ if (!bWriter || !m_xNotesBtn->get_active())
{
- EnableControl_Impl(m_pSearchAllBtn);
- EnableControl_Impl(m_pReplaceAllBtn);
+ EnableControl_Impl(*m_xSearchAllBtn);
+ EnableControl_Impl(*m_xReplaceAllBtn);
}
if (bWriter && pSearchItem->GetNotes())
{
- m_pSearchAllBtn->Disable();
- m_pReplaceAllBtn->Disable();
+ m_xSearchAllBtn->set_sensitive(false);
+ m_xReplaceAllBtn->set_sensitive(false);
}
}
- if (!m_pSearchAttrText->GetText().isEmpty())
- EnableControl_Impl(m_pNoFormatBtn);
+ if (!m_xSearchAttrText->get_label().isEmpty())
+ EnableControl_Impl(*m_xNoFormatBtn);
else
- m_pNoFormatBtn->Disable();
+ m_xNoFormatBtn->set_sensitive(false);
if ( !pSearchList )
{
- m_pAttributeBtn->Disable();
- m_pFormatBtn->Disable();
+ m_xAttributeBtn->set_sensitive(false);
+ m_xFormatBtn->set_sensitive(false);
}
- if ( m_pLayoutBtn->IsChecked() )
+ if ( m_xLayoutBtn->get_active() )
{
pImpl->bSaveToModule = false;
- TemplateHdl_Impl(m_pLayoutBtn);
+ TemplateHdl_Impl(*m_xLayoutBtn);
pImpl->bSaveToModule = true;
}
}
@@ -1110,13 +1054,13 @@ void SvxSearchDialog::InitAttrList_Impl( const SfxItemSet* pSSet,
{
pSearchList->Put( *pSSet );
- m_pSearchAttrText->SetText( BuildAttrText_Impl( aDesc, true ) );
+ m_xSearchAttrText->set_label( BuildAttrText_Impl( aDesc, true ) );
if ( !aDesc.isEmpty() )
{
- if (!m_pSearchAttrText->IsVisible())
+ if (!m_xSearchAttrText->get_visible())
{
- m_pSearchAttrText->Show();
+ m_xSearchAttrText->show();
bSetOptimalLayoutSize = true;
}
bFormat |= true;
@@ -1132,13 +1076,13 @@ void SvxSearchDialog::InitAttrList_Impl( const SfxItemSet* pSSet,
{
pReplaceList->Put( *pRSet );
- m_pReplaceAttrText->SetText( BuildAttrText_Impl( aDesc, false ) );
+ m_xReplaceAttrText->set_label( BuildAttrText_Impl( aDesc, false ) );
if ( !aDesc.isEmpty() )
{
- if (!m_pReplaceAttrText->IsVisible())
+ if (!m_xReplaceAttrText->get_visible())
{
- m_pReplaceAttrText->Show();
+ m_xReplaceAttrText->show();
bSetOptimalLayoutSize = true;
}
bFormat |= true;
@@ -1147,244 +1091,242 @@ void SvxSearchDialog::InitAttrList_Impl( const SfxItemSet* pSSet,
}
if (bSetOptimalLayoutSize)
- setOptimalLayoutSize();
+ m_xDialog->resize_to_request();
}
-
-IMPL_LINK( SvxSearchDialog, LBSelectHdl_Impl, ListBox&, rCtrl, void )
+IMPL_LINK( SvxSearchDialog, LBSelectHdl_Impl, weld::ComboBox&, rCtrl, void )
{
ClickHdl_Impl(&rCtrl);
}
-IMPL_LINK( SvxSearchDialog, FlagHdl_Impl, Button *, pCtrl, void )
+IMPL_LINK( SvxSearchDialog, FlagHdl_Impl, weld::Button&, rCtrl, void )
{
- ClickHdl_Impl(pCtrl);
+ ClickHdl_Impl(&rCtrl);
}
-void SvxSearchDialog::ClickHdl_Impl(void const * pCtrl)
+void SvxSearchDialog::ClickHdl_Impl(const weld::Widget* pCtrl)
{
if ( pCtrl && !bSet )
- SetModifyFlag_Impl( static_cast<Control const *>(pCtrl) );
+ SetModifyFlag_Impl(pCtrl);
else
bSet = false;
- if (pCtrl == m_pSimilarityBox)
+ if (pCtrl == m_xSimilarityBox.get())
{
- bool bIsChecked = m_pSimilarityBox->IsChecked();
+ bool bIsChecked = m_xSimilarityBox->get_active();
if ( bIsChecked )
{
- m_pSimilarityBtn->Enable();
- m_pRegExpBtn->Check( false );
- m_pRegExpBtn->Disable();
- m_pWildcardBtn->Check( false );
- m_pWildcardBtn->Disable();
- EnableControl_Impl(m_pWordBtn);
-
- if ( m_pLayoutBtn->IsChecked() )
+ m_xSimilarityBtn->set_sensitive(true);
+ m_xRegExpBtn->set_active( false );
+ m_xRegExpBtn->set_sensitive(false);
+ m_xWildcardBtn->set_active( false );
+ m_xWildcardBtn->set_sensitive(false);
+ EnableControl_Impl(*m_xWordBtn);
+
+ if ( m_xLayoutBtn->get_active() )
{
- EnableControl_Impl(m_pMatchCaseCB);
- m_pLayoutBtn->Check( false );
+ EnableControl_Impl(*m_xMatchCaseCB);
+ m_xLayoutBtn->set_active( false );
}
- m_pRegExpBtn->Disable();
- m_pWildcardBtn->Disable();
- m_pLayoutBtn->Disable();
- m_pFormatBtn->Disable();
- m_pNoFormatBtn->Disable();
- m_pAttributeBtn->Disable();
+ m_xRegExpBtn->set_sensitive(false);
+ m_xWildcardBtn->set_sensitive(false);
+ m_xLayoutBtn->set_sensitive(false);
+ m_xFormatBtn->set_sensitive(false);
+ m_xNoFormatBtn->set_sensitive(false);
+ m_xAttributeBtn->set_sensitive(false);
}
else
{
- EnableControl_Impl(m_pRegExpBtn);
- EnableControl_Impl(m_pWildcardBtn);
- if (!m_pNotesBtn->IsChecked())
- EnableControl_Impl(m_pLayoutBtn);
- EnableControl_Impl(m_pFormatBtn);
- EnableControl_Impl(m_pAttributeBtn);
- m_pSimilarityBtn->Disable();
+ EnableControl_Impl(*m_xRegExpBtn);
+ EnableControl_Impl(*m_xWildcardBtn);
+ if (!m_xNotesBtn->get_active())
+ EnableControl_Impl(*m_xLayoutBtn);
+ EnableControl_Impl(*m_xFormatBtn);
+ EnableControl_Impl(*m_xAttributeBtn);
+ m_xSimilarityBtn->set_sensitive(false);
}
pSearchItem->SetLevenshtein( bIsChecked );
}
- else if (pCtrl == m_pNotesBtn)
+ else if (pCtrl == m_xNotesBtn.get())
{
- if (m_pNotesBtn->IsChecked())
+ if (m_xNotesBtn->get_active())
{
- m_pLayoutBtn->Disable();
- m_pSearchAllBtn->Disable();
- m_pReplaceAllBtn->Disable();
+ m_xLayoutBtn->set_sensitive(false);
+ m_xSearchAllBtn->set_sensitive(false);
+ m_xReplaceAllBtn->set_sensitive(false);
}
else
{
- EnableControl_Impl(m_pLayoutBtn);
- ModifyHdl_Impl(*m_pSearchLB);
+ EnableControl_Impl(*m_xLayoutBtn);
+ ModifyHdl_Impl(*m_xSearchLB);
}
}
else
{
- if ( m_pLayoutBtn->IsChecked() && !bFormat )
+ if ( m_xLayoutBtn->get_active() && !bFormat )
{
- m_pWordBtn->Check( false );
- m_pWordBtn->Disable();
- m_pRegExpBtn->Check( false );
- m_pRegExpBtn->Disable();
- m_pWildcardBtn->Check( false );
- m_pWildcardBtn->Disable();
- m_pMatchCaseCB->Check( false );
- m_pMatchCaseCB->Disable();
- m_pNotesBtn->Disable();
-
- if ( m_pSearchTmplLB->GetEntryCount() )
+ m_xWordBtn->set_active( false );
+ m_xWordBtn->set_sensitive(false);
+ m_xRegExpBtn->set_active( false );
+ m_xRegExpBtn->set_sensitive(false);
+ m_xWildcardBtn->set_active( false );
+ m_xWildcardBtn->set_sensitive(false);
+ m_xMatchCaseCB->set_active( false );
+ m_xMatchCaseCB->set_sensitive(false);
+ m_xNotesBtn->set_sensitive(false);
+
+ if ( m_xSearchTmplLB->get_count() )
{
- EnableControl_Impl(m_pSearchBtn);
- EnableControl_Impl(m_pBackSearchBtn);
- EnableControl_Impl(m_pSearchAllBtn);
- EnableControl_Impl(m_pReplaceBtn);
- EnableControl_Impl(m_pReplaceAllBtn);
+ EnableControl_Impl(*m_xSearchBtn);
+ EnableControl_Impl(*m_xBackSearchBtn);
... etc. - the rest is truncated
More information about the Libreoffice-commits
mailing list