diff options
Diffstat (limited to 'extensions')
195 files changed, 2532 insertions, 3063 deletions
diff --git a/extensions/CppunitTest_extensions_test_update.mk b/extensions/CppunitTest_extensions_test_update.mk index 02876aab74d5..da6b83a311b8 100644 --- a/extensions/CppunitTest_extensions_test_update.mk +++ b/extensions/CppunitTest_extensions_test_update.mk @@ -18,12 +18,12 @@ $(eval $(call gb_CppunitTest_add_exception_objects,extensions_test_update, \ $(eval $(call gb_CppunitTest_use_external,extensions_test_update,boost_headers)) $(eval $(call gb_CppunitTest_use_libraries,extensions_test_update, \ + comphelper \ cppu \ cppuhelper \ sal \ salhelper \ test \ - tl \ utl \ unotest \ vcl \ diff --git a/extensions/IwyuFilter_extensions.yaml b/extensions/IwyuFilter_extensions.yaml index 4dd6ee91c36e..0e0ba4c9c16c 100644 --- a/extensions/IwyuFilter_extensions.yaml +++ b/extensions/IwyuFilter_extensions.yaml @@ -1,6 +1,9 @@ --- assumeFilename: extensions/source/propctrlr/formcomponenthandler.cxx excludelist: + extensions/inc/strings.hrc: + # Needed for TranslateId macro + - unotools/resmgr.hxx extensions/source/logging/loghandler.hxx: # Don't propose hxx -> h change in URE libs - cppuhelper/interfacecontainer.hxx @@ -80,3 +83,6 @@ excludelist: extensions/source/propctrlr/xsdvalidationpropertyhandler.cxx: # Actually used - com/sun/star/inspection/XObjectInspectorUI.hpp + extensions/source/scanner/grid.cxx: + # Needed for rtl::math::expm1 + - rtl/math.hxx diff --git a/extensions/Library_WinUserInfoBe.mk b/extensions/Library_WinUserInfoBe.mk index 34a635851a82..3e20e09419af 100644 --- a/extensions/Library_WinUserInfoBe.mk +++ b/extensions/Library_WinUserInfoBe.mk @@ -11,7 +11,11 @@ $(eval $(call gb_Library_Library,WinUserInfoBe)) -$(eval $(call gb_Library_set_componentfile,WinUserInfoBe,extensions/source/config/WinUserInfo/WinUserInfoBe)) +$(eval $(call gb_Library_set_componentfile,WinUserInfoBe,extensions/source/config/WinUserInfo/WinUserInfoBe,services)) + +$(eval $(call gb_Library_use_custom_headers,WinUserInfoBe,\ + officecfg/registry \ +)) $(eval $(call gb_Library_use_sdk_api,WinUserInfoBe)) diff --git a/extensions/Library_abp.mk b/extensions/Library_abp.mk index 0262b3a02e0b..85d0942efd25 100644 --- a/extensions/Library_abp.mk +++ b/extensions/Library_abp.mk @@ -11,7 +11,7 @@ $(eval $(call gb_Library_Library,abp)) -$(eval $(call gb_Library_set_componentfile,abp,extensions/source/abpilot/abp)) +$(eval $(call gb_Library_set_componentfile,abp,extensions/source/abpilot/abp,services)) $(eval $(call gb_Library_set_include,abp,\ $$(INCLUDE) \ diff --git a/extensions/Library_bib.mk b/extensions/Library_bib.mk index 04787f16058e..147b8034f3e4 100644 --- a/extensions/Library_bib.mk +++ b/extensions/Library_bib.mk @@ -11,7 +11,7 @@ $(eval $(call gb_Library_Library,bib)) -$(eval $(call gb_Library_set_componentfile,bib,extensions/source/bibliography/bib)) +$(eval $(call gb_Library_set_componentfile,bib,extensions/source/bibliography/bib,services)) $(eval $(call gb_Library_set_include,bib,\ $$(INCLUDE) \ diff --git a/extensions/Library_dbp.mk b/extensions/Library_dbp.mk index 38c58e4f1f0d..ec5f75c127a2 100644 --- a/extensions/Library_dbp.mk +++ b/extensions/Library_dbp.mk @@ -11,7 +11,7 @@ $(eval $(call gb_Library_Library,dbp)) -$(eval $(call gb_Library_set_componentfile,dbp,extensions/source/dbpilots/dbp)) +$(eval $(call gb_Library_set_componentfile,dbp,extensions/source/dbpilots/dbp,services)) $(eval $(call gb_Library_set_include,dbp,\ $$(INCLUDE) \ diff --git a/extensions/Library_ldapbe2.mk b/extensions/Library_ldapbe2.mk index 6d81426ad53e..c08ed88f744e 100644 --- a/extensions/Library_ldapbe2.mk +++ b/extensions/Library_ldapbe2.mk @@ -11,7 +11,7 @@ $(eval $(call gb_Library_Library,ldapbe2)) -$(eval $(call gb_Library_set_componentfile,ldapbe2,extensions/source/config/ldap/ldapbe2)) +$(eval $(call gb_Library_set_componentfile,ldapbe2,extensions/source/config/ldap/ldapbe2,services)) $(eval $(call gb_Library_use_sdk_api,ldapbe2)) @@ -46,9 +46,7 @@ else # 0S!=WNT $(eval $(call gb_Library_use_externals,ldapbe2,\ boost_headers \ openldap \ - nss3 \ - plc4 \ - ssl3 \ + openssl \ )) endif diff --git a/extensions/Library_log.mk b/extensions/Library_log.mk index 4db9012adaa1..edf42d35e1dc 100644 --- a/extensions/Library_log.mk +++ b/extensions/Library_log.mk @@ -11,7 +11,7 @@ $(eval $(call gb_Library_Library,log)) -$(eval $(call gb_Library_set_componentfile,log,extensions/source/logging/log)) +$(eval $(call gb_Library_set_componentfile,log,extensions/source/logging/log,services)) $(eval $(call gb_Library_use_external,log,boost_headers)) diff --git a/extensions/Library_oleautobridge.mk b/extensions/Library_oleautobridge.mk index ec59f715c504..38bd19eb8f06 100644 --- a/extensions/Library_oleautobridge.mk +++ b/extensions/Library_oleautobridge.mk @@ -11,7 +11,11 @@ $(eval $(call gb_Library_Library,oleautobridge)) -$(eval $(call gb_Library_set_componentfile,oleautobridge,extensions/source/ole/oleautobridge)) +$(eval $(call gb_Library_use_custom_headers,oleautobridge,\ + officecfg/registry \ +)) + +$(eval $(call gb_Library_set_componentfile,oleautobridge,extensions/source/ole/oleautobridge,services)) $(eval $(call gb_Library_use_api,oleautobridge,\ offapi \ diff --git a/extensions/Library_pcr.mk b/extensions/Library_pcr.mk index f01c00233dee..14187b9608bc 100644 --- a/extensions/Library_pcr.mk +++ b/extensions/Library_pcr.mk @@ -11,7 +11,7 @@ $(eval $(call gb_Library_Library,pcr)) -$(eval $(call gb_Library_set_componentfile,pcr,extensions/source/propctrlr/pcr)) +$(eval $(call gb_Library_set_componentfile,pcr,extensions/source/propctrlr/pcr,services)) $(eval $(call gb_Library_use_sdk_api,pcr)) diff --git a/extensions/Library_scn.mk b/extensions/Library_scn.mk index 4fc8788e851d..51c48fbfdf68 100644 --- a/extensions/Library_scn.mk +++ b/extensions/Library_scn.mk @@ -21,7 +21,7 @@ $(eval $(call gb_Library_set_include,scn,\ $$(INCLUDE) \ )) -$(eval $(call gb_Library_set_componentfile,scn,extensions/source/scanner/scn)) +$(eval $(call gb_Library_set_componentfile,scn,extensions/source/scanner/scn,services)) $(eval $(call gb_Library_use_sdk_api,scn)) diff --git a/extensions/Library_updatecheckui.mk b/extensions/Library_updatecheckui.mk index 86c59b608389..d889defa89c2 100644 --- a/extensions/Library_updatecheckui.mk +++ b/extensions/Library_updatecheckui.mk @@ -14,7 +14,7 @@ $(eval $(call gb_Library_set_include,updatecheckui,\ $$(INCLUDE) \ )) -$(eval $(call gb_Library_set_componentfile,updatecheckui,extensions/source/update/ui/updchk)) +$(eval $(call gb_Library_set_componentfile,updatecheckui,extensions/source/update/ui/updchk,services)) $(eval $(call gb_Library_use_external,updatecheckui,boost_headers)) diff --git a/extensions/Library_updatefeed.mk b/extensions/Library_updatefeed.mk index 8b9328e30e23..5b9baa7b1be7 100644 --- a/extensions/Library_updatefeed.mk +++ b/extensions/Library_updatefeed.mk @@ -9,7 +9,7 @@ $(eval $(call gb_Library_Library,updatefeed)) -$(eval $(call gb_Library_set_componentfile,updatefeed,extensions/source/update/feed/updatefeed)) +$(eval $(call gb_Library_set_componentfile,updatefeed,extensions/source/update/feed/updatefeed,services)) $(eval $(call gb_Library_use_externals,updatefeed, \ boost_headers \ diff --git a/extensions/Library_updchk.mk b/extensions/Library_updchk.mk index c7f1a54bb65e..85c0293231fa 100644 --- a/extensions/Library_updchk.mk +++ b/extensions/Library_updchk.mk @@ -9,7 +9,7 @@ $(eval $(call gb_Library_Library,updchk)) -$(eval $(call gb_Library_set_componentfile,updchk,extensions/source/update/check/updchk.uno)) +$(eval $(call gb_Library_set_componentfile,updchk,extensions/source/update/check/updchk.uno,services)) $(eval $(call gb_Library_set_include,updchk,\ $$(INCLUDE) \ @@ -18,12 +18,16 @@ $(eval $(call gb_Library_set_include,updchk,\ $(eval $(call gb_Library_use_sdk_api,updchk)) +$(eval $(call gb_Library_use_custom_headers,updchk,\ + officecfg/registry \ +)) + $(eval $(call gb_Library_use_libraries,updchk,\ + comphelper \ cppuhelper \ cppu \ sal \ salhelper \ - tl \ utl \ vcl \ )) diff --git a/extensions/Module_extensions.mk b/extensions/Module_extensions.mk index c28f97b9cbd8..f7bd82978382 100644 --- a/extensions/Module_extensions.mk +++ b/extensions/Module_extensions.mk @@ -13,7 +13,7 @@ $(eval $(call gb_Module_add_l10n_targets,extensions,\ AllLangMoTarget_pcr \ )) -ifneq ($(filter-out iOS ANDROID,$(OS)),) +ifeq (,$(DISABLE_DYNLOADING)) $(eval $(call gb_Module_add_targets,extensions,\ Library_abp \ Library_scn \ @@ -56,6 +56,7 @@ $(eval $(call gb_Module_add_targets,extensions,\ endif ifneq (,$(filter DESKTOP,$(BUILD_TYPE))) +ifeq (,$(ENABLE_WASM_STRIP_BASIC_DRAW_MATH_IMPRESS)) $(eval $(call gb_Module_add_targets,extensions,\ Library_updatefeed \ )) @@ -71,6 +72,7 @@ $(eval $(call gb_Module_add_check_targets,extensions,\ CppunitTest_extensions_test_update \ )) endif +endif # !ENABLE_WASM_STRIP_BASIC_DRAW_MATH_IMPRESS endif ifeq ($(OS),WNT) diff --git a/extensions/README.md b/extensions/README.md index 94cf2acbebd6..cc32c1f825cb 100644 --- a/extensions/README.md +++ b/extensions/README.md @@ -16,6 +16,12 @@ we have reached the time when we should ask for the update. If yes, asks for that, and shows the download button in the menu (if the new update is available). +The update server will decide if there is an update available based on the user-agent +string created by UpdateInformationProvider::getUserAgent, the data used there is +extracted from instdir/program/versionrc and the update server takes the buildid into +account, so to experiment with the updates from a dev version getUserAgent needs +to return a recognized id. + ## OLE Automation Bridge A bridge between "OLE automation" and UNO, so you can use UNO services diff --git a/extensions/inc/bitmaps.hlst b/extensions/inc/bitmaps.hlst index c07bc6ec16d1..de784683b35a 100644 --- a/extensions/inc/bitmaps.hlst +++ b/extensions/inc/bitmaps.hlst @@ -10,43 +10,39 @@ #ifndef INCLUDED_EXTENSIONS_INC_BITMAPS_HRC #define INCLUDED_EXTENSIONS_INC_BITMAPS_HRC -#define RID_EXTBMP_CONTROL "res/sx10144.png" -#define RID_EXTBMP_BUTTON "res/sx10594.png" -#define RID_EXTBMP_RADIOBUTTON "res/sx10595.png" -#define RID_EXTBMP_CHECKBOX "res/sx10596.png" -#define RID_EXTBMP_FIXEDTEXT "res/sx10597.png" -#define RID_EXTBMP_GROUPBOX "res/sx10598.png" -#define RID_EXTBMP_EDITBOX "res/sx10599.png" -#define RID_EXTBMP_LISTBOX "res/sx10600.png" -#define RID_EXTBMP_COMBOBOX "res/sx10601.png" -#define RID_EXTBMP_GRID "res/sx10603.png" -#define RID_EXTBMP_IMAGEBUTTON "res/sx10604.png" -#define RID_EXTBMP_FILECONTROL "res/sx10605.png" -#define RID_EXTBMP_DATEFIELD "res/sx10704.png" -#define RID_EXTBMP_TIMEFIELD "res/sx10705.png" -#define RID_EXTBMP_NUMERICFIELD "res/sx10706.png" -#define RID_EXTBMP_CURRENCYFIELD "res/sx10707.png" -#define RID_EXTBMP_PATTERNFIELD "res/sx10708.png" -#define RID_EXTBMP_IMAGECONTROL "res/sx10710.png" -#define RID_EXTBMP_HIDDEN "res/sx18022.png" -#define RID_EXTBMP_FORMATTEDFIELD "res/sx10728.png" -#define RID_EXTBMP_FILTER "res/sx10715.png" -#define RID_EXTBMP_FORMS "res/sx18013.png" -#define RID_EXTBMP_FORM "res/sx10593.png" -#define RID_EXTBMP_COLLAPSEDNODE "res/sx18002.png" -#define RID_EXTBMP_EXPANDEDNODE "res/sx18003.png" -#define RID_EXTBMP_SCROLLBAR "res/sx10768.png" -#define RID_EXTBMP_SPINBUTTON "res/sx10769.png" -#define RID_EXTBMP_NAVIGATIONBAR "res/sx10607.png" -#define RID_SCANNER_HANDLE "extensions/res/scanner/handle.png" -#define BMP_TABLE "res/sx03188.png" -#define BMP_QUERY "res/sx03202.png" -#define RID_EXTBMP_AUTOFILTER_SC "res/sc10716.png" -#define RID_EXTBMP_FILTERCRIT_SC "res/sc10715.png" -#define RID_EXTBMP_REMOVE_FILTER_SORT_SC "res/sc10711.png" -#define RID_EXTBMP_AUTOFILTER_LC "res/lc10716.png" -#define RID_EXTBMP_FILTERCRIT_LC "res/lc10715.png" -#define RID_EXTBMP_REMOVE_FILTER_SORT_LC "res/lc10711.png" +inline constexpr OUString RID_EXTBMP_CONTROL = u"res/sx10144.png"_ustr; +inline constexpr OUString RID_EXTBMP_BUTTON = u"res/sx10594.png"_ustr; +inline constexpr OUString RID_EXTBMP_RADIOBUTTON = u"res/sx10595.png"_ustr; +inline constexpr OUString RID_EXTBMP_CHECKBOX = u"res/sx10596.png"_ustr; +inline constexpr OUString RID_EXTBMP_FIXEDTEXT = u"res/sx10597.png"_ustr; +inline constexpr OUString RID_EXTBMP_GROUPBOX = u"res/sx10598.png"_ustr; +inline constexpr OUString RID_EXTBMP_EDITBOX = u"res/sx10599.png"_ustr; +inline constexpr OUString RID_EXTBMP_LISTBOX = u"res/sx10600.png"_ustr; +inline constexpr OUString RID_EXTBMP_COMBOBOX = u"res/sx10601.png"_ustr; +inline constexpr OUString RID_EXTBMP_GRID = u"res/sx10603.png"_ustr; +inline constexpr OUString RID_EXTBMP_IMAGEBUTTON = u"res/sx10604.png"_ustr; +inline constexpr OUString RID_EXTBMP_FILECONTROL = u"res/sx10605.png"_ustr; +inline constexpr OUString RID_EXTBMP_DATEFIELD = u"res/sx10704.png"_ustr; +inline constexpr OUString RID_EXTBMP_TIMEFIELD = u"res/sx10705.png"_ustr; +inline constexpr OUString RID_EXTBMP_NUMERICFIELD = u"res/sx10706.png"_ustr; +inline constexpr OUString RID_EXTBMP_CURRENCYFIELD = u"res/sx10707.png"_ustr; +inline constexpr OUString RID_EXTBMP_PATTERNFIELD = u"res/sx10708.png"_ustr; +inline constexpr OUString RID_EXTBMP_IMAGECONTROL = u"res/sx10710.png"_ustr; +inline constexpr OUString RID_EXTBMP_HIDDEN = u"res/sx18022.png"_ustr; +inline constexpr OUString RID_EXTBMP_FORMS = u"res/sx18013.png"_ustr; +inline constexpr OUString RID_EXTBMP_FORM = u"res/sx10593.png"_ustr; +inline constexpr OUString RID_EXTBMP_SCROLLBAR = u"res/sx10768.png"_ustr; +inline constexpr OUString RID_EXTBMP_SPINBUTTON = u"res/sx10769.png"_ustr; +inline constexpr OUString RID_EXTBMP_NAVIGATIONBAR = u"res/sx10607.png"_ustr; +inline constexpr OUString RID_SCANNER_HANDLE = u"extensions/res/scanner/handle.png"_ustr; +inline constexpr OUString BMP_TABLE = u"res/sx03188.png"_ustr; +inline constexpr OUString BMP_QUERY = u"res/sx03202.png"_ustr; +inline constexpr OUString RID_EXTBMP_AUTOFILTER_SC = u"res/sc10716.png"_ustr; +inline constexpr OUString RID_EXTBMP_FILTERCRIT_SC = u"res/sc10715.png"_ustr; +inline constexpr OUString RID_EXTBMP_REMOVE_FILTER_SORT_SC = u"res/sc10711.png"_ustr; +inline constexpr OUString RID_EXTBMP_AUTOFILTER_LC = u"res/lc10716.png"_ustr; +inline constexpr OUString RID_EXTBMP_FILTERCRIT_LC = u"res/lc10715.png"_ustr; +inline constexpr OUString RID_EXTBMP_REMOVE_FILTER_SORT_LC = u"res/lc10711.png"_ustr; #define SV_RESID_BITMAP_INFOBOX "vcl/res/infobox.png" #endif diff --git a/extensions/inc/command.hrc b/extensions/inc/command.hrc index ca05f1c4e732..fe77e4940847 100644 --- a/extensions/inc/command.hrc +++ b/extensions/inc/command.hrc @@ -22,7 +22,7 @@ #include <unotools/resmgr.hxx> -#define NC_(Context, String) TranslateId(Context, reinterpret_cast<char const *>(u8##String)) +#define NC_(Context, String) TranslateId(Context, u8##String) namespace { diff --git a/extensions/inc/helpids.h b/extensions/inc/helpids.h index e4a609aafc82..345af0c05430 100644 --- a/extensions/inc/helpids.h +++ b/extensions/inc/helpids.h @@ -20,307 +20,296 @@ #ifndef EXTENSIONS_HELPIDS_H #define EXTENSIONS_HELPIDS_H -#define HID_ABSPILOT_PREVIOUS "EXTENSIONS_HID_ABSPILOT_PREVIOUS" -#define HID_ABSPILOT_NEXT "EXTENSIONS_HID_ABSPILOT_NEXT" -#define HID_ABSPILOT_CANCEL "EXTENSIONS_HID_ABSPILOT_CANCEL" -#define HID_ABSPILOT_FINISH "EXTENSIONS_HID_ABSPILOT_FINISH" -#define UID_ABSPILOT_HELP "EXTENSIONS_UID_ABSPILOT_HELP" -#define HID_ABSPILOT "EXTENSIONS_HID_ABSPILOT" +#include <rtl/ustring.hxx> -#define HID_BIB_IDENTIFIER_POS "EXTENSIONS_HID_BIB_IDENTIFIER_POS" -#define HID_BIB_AUTHORITYTYPE_POS "EXTENSIONS_HID_BIB_AUTHORITYTYPE_POS" -#define HID_BIB_AUTHOR_POS "EXTENSIONS_HID_BIB_AUTHOR_POS" -#define HID_BIB_TITLE_POS "EXTENSIONS_HID_BIB_TITLE_POS" -#define HID_BIB_YEAR_POS "EXTENSIONS_HID_BIB_YEAR_POS" -#define HID_BIB_ISBN_POS "EXTENSIONS_HID_BIB_ISBN_POS" -#define HID_BIB_BOOKTITLE_POS "EXTENSIONS_HID_BIB_BOOKTITLE_POS" -#define HID_BIB_CHAPTER_POS "EXTENSIONS_HID_BIB_CHAPTER_POS" -#define HID_BIB_EDITION_POS "EXTENSIONS_HID_BIB_EDITION_POS" -#define HID_BIB_EDITOR_POS "EXTENSIONS_HID_BIB_EDITOR_POS" -#define HID_BIB_HOWPUBLISHED_POS "EXTENSIONS_HID_BIB_HOWPUBLISHED_POS" -#define HID_BIB_INSTITUTION_POS "EXTENSIONS_HID_BIB_INSTITUTION_POS" -#define HID_BIB_JOURNAL_POS "EXTENSIONS_HID_BIB_JOURNAL_POS" -#define HID_BIB_MONTH_POS "EXTENSIONS_HID_BIB_MONTH_POS" -#define HID_BIB_NOTE_POS "EXTENSIONS_HID_BIB_NOTE_POS" -#define HID_BIB_ANNOTE_POS "EXTENSIONS_HID_BIB_ANNOTE_POS" -#define HID_BIB_NUMBER_POS "EXTENSIONS_HID_BIB_NUMBER_POS" -#define HID_BIB_ORGANIZATIONS_POS "EXTENSIONS_HID_BIB_ORGANIZATIONS_POS" -#define HID_BIB_PAGES_POS "EXTENSIONS_HID_BIB_PAGES_POS" -#define HID_BIB_PUBLISHER_POS "EXTENSIONS_HID_BIB_PUBLISHER_POS" -#define HID_BIB_ADDRESS_POS "EXTENSIONS_HID_BIB_ADDRESS_POS" -#define HID_BIB_SCHOOL_POS "EXTENSIONS_HID_BIB_SCHOOL_POS" -#define HID_BIB_SERIES_POS "EXTENSIONS_HID_BIB_SERIES_POS" -#define HID_BIB_REPORTTYPE_POS "EXTENSIONS_HID_BIB_REPORTTYPE_POS" -#define HID_BIB_VOLUME_POS "EXTENSIONS_HID_BIB_VOLUME_POS" -#define HID_BIB_URL_POS "EXTENSIONS_HID_BIB_URL_POS" -#define HID_BIB_CUSTOM1_POS "EXTENSIONS_HID_BIB_CUSTOM1_POS" -#define HID_BIB_CUSTOM2_POS "EXTENSIONS_HID_BIB_CUSTOM2_POS" -#define HID_BIB_CUSTOM3_POS "EXTENSIONS_HID_BIB_CUSTOM3_POS" -#define HID_BIB_CUSTOM4_POS "EXTENSIONS_HID_BIB_CUSTOM4_POS" -#define HID_BIB_CUSTOM5_POS "EXTENSIONS_HID_BIB_CUSTOM5_POS" -#define HID_BIB_LOCAL_URL_POS "EXTENSIONS_HID_BIB_LOCAL_URL_POS" +inline constexpr OUString HID_ABSPILOT_PREVIOUS = u"EXTENSIONS_HID_ABSPILOT_PREVIOUS"_ustr; +inline constexpr OUString HID_ABSPILOT_NEXT = u"EXTENSIONS_HID_ABSPILOT_NEXT"_ustr; +inline constexpr OUString HID_ABSPILOT_CANCEL = u"EXTENSIONS_HID_ABSPILOT_CANCEL"_ustr; +inline constexpr OUString HID_ABSPILOT_FINISH = u"EXTENSIONS_HID_ABSPILOT_FINISH"_ustr; +inline constexpr OUString UID_ABSPILOT_HELP = u"EXTENSIONS_UID_ABSPILOT_HELP"_ustr; +inline constexpr OUString HID_ABSPILOT = u"EXTENSIONS_HID_ABSPILOT"_ustr; + +inline constexpr OUString HID_BIB_IDENTIFIER_POS = u"EXTENSIONS_HID_BIB_IDENTIFIER_POS"_ustr; +inline constexpr OUString HID_BIB_AUTHORITYTYPE_POS = u"EXTENSIONS_HID_BIB_AUTHORITYTYPE_POS"_ustr; +inline constexpr OUString HID_BIB_AUTHOR_POS = u"EXTENSIONS_HID_BIB_AUTHOR_POS"_ustr; +inline constexpr OUString HID_BIB_TITLE_POS = u"EXTENSIONS_HID_BIB_TITLE_POS"_ustr; +inline constexpr OUString HID_BIB_YEAR_POS = u"EXTENSIONS_HID_BIB_YEAR_POS"_ustr; +inline constexpr OUString HID_BIB_ISBN_POS = u"EXTENSIONS_HID_BIB_ISBN_POS"_ustr; +inline constexpr OUString HID_BIB_BOOKTITLE_POS = u"EXTENSIONS_HID_BIB_BOOKTITLE_POS"_ustr; +inline constexpr OUString HID_BIB_CHAPTER_POS = u"EXTENSIONS_HID_BIB_CHAPTER_POS"_ustr; +inline constexpr OUString HID_BIB_EDITION_POS = u"EXTENSIONS_HID_BIB_EDITION_POS"_ustr; +inline constexpr OUString HID_BIB_EDITOR_POS = u"EXTENSIONS_HID_BIB_EDITOR_POS"_ustr; +inline constexpr OUString HID_BIB_HOWPUBLISHED_POS = u"EXTENSIONS_HID_BIB_HOWPUBLISHED_POS"_ustr; +inline constexpr OUString HID_BIB_INSTITUTION_POS = u"EXTENSIONS_HID_BIB_INSTITUTION_POS"_ustr; +inline constexpr OUString HID_BIB_JOURNAL_POS = u"EXTENSIONS_HID_BIB_JOURNAL_POS"_ustr; +inline constexpr OUString HID_BIB_MONTH_POS = u"EXTENSIONS_HID_BIB_MONTH_POS"_ustr; +inline constexpr OUString HID_BIB_NOTE_POS = u"EXTENSIONS_HID_BIB_NOTE_POS"_ustr; +inline constexpr OUString HID_BIB_ANNOTE_POS = u"EXTENSIONS_HID_BIB_ANNOTE_POS"_ustr; +inline constexpr OUString HID_BIB_NUMBER_POS = u"EXTENSIONS_HID_BIB_NUMBER_POS"_ustr; +inline constexpr OUString HID_BIB_ORGANIZATIONS_POS = u"EXTENSIONS_HID_BIB_ORGANIZATIONS_POS"_ustr; +inline constexpr OUString HID_BIB_PAGES_POS = u"EXTENSIONS_HID_BIB_PAGES_POS"_ustr; +inline constexpr OUString HID_BIB_PUBLISHER_POS = u"EXTENSIONS_HID_BIB_PUBLISHER_POS"_ustr; +inline constexpr OUString HID_BIB_ADDRESS_POS = u"EXTENSIONS_HID_BIB_ADDRESS_POS"_ustr; +inline constexpr OUString HID_BIB_SCHOOL_POS = u"EXTENSIONS_HID_BIB_SCHOOL_POS"_ustr; +inline constexpr OUString HID_BIB_SERIES_POS = u"EXTENSIONS_HID_BIB_SERIES_POS"_ustr; +inline constexpr OUString HID_BIB_REPORTTYPE_POS = u"EXTENSIONS_HID_BIB_REPORTTYPE_POS"_ustr; +inline constexpr OUString HID_BIB_VOLUME_POS = u"EXTENSIONS_HID_BIB_VOLUME_POS"_ustr; +inline constexpr OUString HID_BIB_URL_POS = u"EXTENSIONS_HID_BIB_URL_POS"_ustr; +inline constexpr OUString HID_BIB_CUSTOM1_POS = u"EXTENSIONS_HID_BIB_CUSTOM1_POS"_ustr; +inline constexpr OUString HID_BIB_CUSTOM2_POS = u"EXTENSIONS_HID_BIB_CUSTOM2_POS"_ustr; +inline constexpr OUString HID_BIB_CUSTOM3_POS = u"EXTENSIONS_HID_BIB_CUSTOM3_POS"_ustr; +inline constexpr OUString HID_BIB_CUSTOM4_POS = u"EXTENSIONS_HID_BIB_CUSTOM4_POS"_ustr; +inline constexpr OUString HID_BIB_CUSTOM5_POS = u"EXTENSIONS_HID_BIB_CUSTOM5_POS"_ustr; +inline constexpr OUString HID_BIB_LOCAL_URL_POS = u"EXTENSIONS_HID_BIB_LOCAL_URL_POS"_ustr; #define HID_BIB_DB_GRIDCTRL "EXTENSIONS_HID_BIB_DB_GRIDCTRL" -#define HID_GROUPWIZARD_PREVIOUS "EXTENSIONS_HID_GROUPWIZARD_PREVIOUS" -#define HID_GROUPWIZARD_NEXT "EXTENSIONS_HID_GROUPWIZARD_NEXT" -#define HID_GROUPWIZARD_CANCEL "EXTENSIONS_HID_GROUPWIZARD_CANCEL" -#define HID_GROUPWIZARD_FINISH "EXTENSIONS_HID_GROUPWIZARD_FINISH" -#define HID_LISTWIZARD_PREVIOUS "EXTENSIONS_HID_LISTWIZARD_PREVIOUS" -#define HID_LISTWIZARD_NEXT "EXTENSIONS_HID_LISTWIZARD_NEXT" -#define HID_LISTWIZARD_CANCEL "EXTENSIONS_HID_LISTWIZARD_CANCEL" -#define HID_LISTWIZARD_FINISH "EXTENSIONS_HID_LISTWIZARD_FINISH" -#define HID_GRIDWIZARD_PREVIOUS "EXTENSIONS_HID_GRIDWIZARD_PREVIOUS" -#define HID_GRIDWIZARD_NEXT "EXTENSIONS_HID_GRIDWIZARD_NEXT" -#define HID_GRIDWIZARD_CANCEL "EXTENSIONS_HID_GRIDWIZARD_CANCEL" -#define HID_GRIDWIZARD_FINISH "EXTENSIONS_HID_GRIDWIZARD_FINISH" +inline constexpr OUString HID_GROUPWIZARD_PREVIOUS = u"EXTENSIONS_HID_GROUPWIZARD_PREVIOUS"_ustr; +inline constexpr OUString HID_GROUPWIZARD_NEXT = u"EXTENSIONS_HID_GROUPWIZARD_NEXT"_ustr; +inline constexpr OUString HID_GROUPWIZARD_CANCEL = u"EXTENSIONS_HID_GROUPWIZARD_CANCEL"_ustr; +inline constexpr OUString HID_GROUPWIZARD_FINISH = u"EXTENSIONS_HID_GROUPWIZARD_FINISH"_ustr; +inline constexpr OUString HID_LISTWIZARD_PREVIOUS = u"EXTENSIONS_HID_LISTWIZARD_PREVIOUS"_ustr; +inline constexpr OUString HID_LISTWIZARD_NEXT = u"EXTENSIONS_HID_LISTWIZARD_NEXT"_ustr; +inline constexpr OUString HID_LISTWIZARD_CANCEL = u"EXTENSIONS_HID_LISTWIZARD_CANCEL"_ustr; +inline constexpr OUString HID_LISTWIZARD_FINISH = u"EXTENSIONS_HID_LISTWIZARD_FINISH"_ustr; +inline constexpr OUString HID_GRIDWIZARD_PREVIOUS = u"EXTENSIONS_HID_GRIDWIZARD_PREVIOUS"_ustr; +inline constexpr OUString HID_GRIDWIZARD_NEXT = u"EXTENSIONS_HID_GRIDWIZARD_NEXT"_ustr; +inline constexpr OUString HID_GRIDWIZARD_CANCEL = u"EXTENSIONS_HID_GRIDWIZARD_CANCEL"_ustr; +inline constexpr OUString HID_GRIDWIZARD_FINISH = u"EXTENSIONS_HID_GRIDWIZARD_FINISH"_ustr; -#define HID_PROP_INPUT_REQUIRED "EXTENSIONS_HID_PROP_INPUT_REQUIRED" -#define HID_PROP_GROUPBOX "EXTENSIONS_HID_PROP_GROUPBOX" -#define HID_PROP_CONTROLSOURCE "EXTENSIONS_HID_PROP_CONTROLSOURCE" -#define HID_PROP_NAME "EXTENSIONS_HID_PROP_NAME" -#define HID_PROP_TABINDEX "EXTENSIONS_HID_PROP_TABINDEX" -#define HID_PROP_MASTERFIELDS "EXTENSIONS_HID_PROP_MASTERFIELDS" -#define HID_PROP_SLAVEFIELDS "EXTENSIONS_HID_PROP_SLAVEFIELDS" -#define HID_PROP_DATASOURCE "EXTENSIONS_HID_PROP_DATASOURCE" -#define HID_PROP_CURSORSOURCE "EXTENSIONS_HID_PROP_CURSORSOURCE" -#define HID_PROP_CURSORSOURCETYPE "EXTENSIONS_HID_PROP_CURSORSOURCETYPE" -#define HID_PROP_CURSORTYPE "EXTENSIONS_HID_PROP_CURSORTYPE" -#define HID_PROP_READONLY "EXTENSIONS_HID_PROP_READONLY" -#define HID_PROP_DATAENTRY "EXTENSIONS_HID_PROP_DATAENTRY" -#define HID_PROP_NAVIGATION "EXTENSIONS_HID_PROP_NAVIGATION" -#define HID_PROP_CYCLE "EXTENSIONS_HID_PROP_CYCLE" -#define HID_PROP_ALLOW_ADDITIONS "EXTENSIONS_HID_PROP_ALLOW_ADDITIONS" -#define HID_PROP_ALLOW_EDITS "EXTENSIONS_HID_PROP_ALLOW_EDITS" -#define HID_PROP_ALLOW_DELETIONS "EXTENSIONS_HID_PROP_ALLOW_DELETIONS" -#define HID_PROP_DIRTY "EXTENSIONS_HID_PROP_DIRTY" -#define HID_PROP_OLDVALUE "EXTENSIONS_HID_PROP_OLDVALUE" -#define HID_PROP_VALUE "EXTENSIONS_HID_PROP_VALUE" -#define HID_PROP_LOCKED "EXTENSIONS_HID_PROP_LOCKED" -#define HID_PROP_FORMATKEY "EXTENSIONS_HID_PROP_FORMATKEY" -#define HID_PROP_REQUIRED "EXTENSIONS_HID_PROP_REQUIRED" -#define HID_PROP_WHEEL_BEHAVIOR "EXTENSIONS_HID_PROP_WHEEL_BEHAVIOR" -#define HID_PROP_UNIQUE "EXTENSIONS_HID_PROP_UNIQUE" -#define HID_PROP_CLASSID "EXTENSIONS_HID_PROP_CLASSID" -#define HID_PROP_LEFT "EXTENSIONS_HID_PROP_LEFT" -#define HID_PROP_RIGHT "EXTENSIONS_HID_PROP_RIGHT" -#define HID_PROP_HEIGHT "EXTENSIONS_HID_PROP_HEIGHT" -#define HID_PROP_WIDTH "EXTENSIONS_HID_PROP_WIDTH" -#define HID_PROP_AUTOGROW "EXTENSIONS_HID_PROP_AUTOGROW" -#define HID_PROP_BOUNDCOLUMN "EXTENSIONS_HID_PROP_BOUNDCOLUMN" -#define HID_PROP_LISTSOURCETYPE "EXTENSIONS_HID_PROP_LISTSOURCETYPE" -#define HID_PROP_LISTSOURCE "EXTENSIONS_HID_PROP_LISTSOURCE" -#define HID_PROP_LISTINDEX "EXTENSIONS_HID_PROP_LISTINDEX" -#define HID_PROP_TEXT "EXTENSIONS_HID_PROP_TEXT" -#define HID_PROP_LABEL "EXTENSIONS_HID_PROP_LABEL" -#define HID_PROP_STRINGITEMLIST "EXTENSIONS_HID_PROP_STRINGITEMLIST" -#define HID_PROP_SEARCHING "EXTENSIONS_HID_PROP_SEARCHING" -#define HID_PROP_FONT "EXTENSIONS_HID_PROP_FONT" -#define HID_PROP_ROWHEIGHT "EXTENSIONS_HID_PROP_ROWHEIGHT" -#define HID_PROP_BACKGROUNDCOLOR "EXTENSIONS_HID_PROP_BACKGROUNDCOLOR" -#define HID_PROP_FILLCOLOR "EXTENSIONS_HID_PROP_FILLCOLOR" -#define HID_PROP_LINECOLOR "EXTENSIONS_HID_PROP_LINECOLOR" -#define HID_PROP_BORDER "EXTENSIONS_HID_PROP_BORDER" -#define HID_PROP_ALIGN "EXTENSIONS_HID_PROP_ALIGN" -#define HID_PROP_VERTICAL_ALIGN "EXTENSIONS_HID_PROP_VERTICAL_ALIGN" -#define HID_PROP_DROPDOWN "EXTENSIONS_HID_PROP_DROPDOWN" -#define HID_PROP_MULTILINE "EXTENSIONS_HID_PROP_MULTILINE" -#define HID_PROP_HSCROLL "EXTENSIONS_HID_PROP_HSCROLL" -#define HID_PROP_VSCROLL "EXTENSIONS_HID_PROP_VSCROLL" -#define HID_PROP_TABSTOP "EXTENSIONS_HID_PROP_TABSTOP" -#define HID_PROP_REFVALUE "EXTENSIONS_HID_PROP_REFVALUE" -#define HID_PROP_BUTTONTYPE "EXTENSIONS_HID_PROP_BUTTONTYPE" -#define HID_PROP_SUBMIT_ACTION "EXTENSIONS_HID_PROP_SUBMIT_ACTION" -#define HID_PROP_SUBMIT_METHOD "EXTENSIONS_HID_PROP_SUBMIT_METHOD" -#define HID_PROP_SUBMIT_ENCODING "EXTENSIONS_HID_PROP_SUBMIT_ENCODING" -#define HID_PROP_DEFAULTVALUE "EXTENSIONS_HID_PROP_DEFAULTVALUE" -#define HID_PROP_SUBMIT_TARGET "EXTENSIONS_HID_PROP_SUBMIT_TARGET" -#define HID_PROP_DEFAULT_STATE "EXTENSIONS_HID_PROP_DEFAULT_STATE" -#define HID_PROP_IMAGE_URL "EXTENSIONS_HID_PROP_IMAGE_URL" -#define HID_PROP_DEFAULT_SELECT_SEQ "EXTENSIONS_HID_PROP_DEFAULT_SELECT_SEQ" -#define HID_PROP_MULTISELECTION "EXTENSIONS_HID_PROP_MULTISELECTION" -#define HID_PROP_DATE "EXTENSIONS_HID_PROP_DATE" -#define HID_PROP_DATEMIN "EXTENSIONS_HID_PROP_DATEMIN" -#define HID_PROP_DATEMAX "EXTENSIONS_HID_PROP_DATEMAX" -#define HID_PROP_DATEFORMAT "EXTENSIONS_HID_PROP_DATEFORMAT" -#define HID_PROP_TIME "EXTENSIONS_HID_PROP_TIME" -#define HID_PROP_TIMEMIN "EXTENSIONS_HID_PROP_TIMEMIN" -#define HID_PROP_TIMEMAX "EXTENSIONS_HID_PROP_TIMEMAX" -#define HID_PROP_TIMEFORMAT "EXTENSIONS_HID_PROP_TIMEFORMAT" -#define HID_PROP_VALUEMIN "EXTENSIONS_HID_PROP_VALUEMIN" -#define HID_PROP_VALUEMAX "EXTENSIONS_HID_PROP_VALUEMAX" -#define HID_PROP_VALUESTEP "EXTENSIONS_HID_PROP_VALUESTEP" -#define HID_PROP_CURRENCYSYMBOL "EXTENSIONS_HID_PROP_CURRENCYSYMBOL" -#define HID_PROP_EDITMASK "EXTENSIONS_HID_PROP_EDITMASK" -#define HID_PROP_LITERALMASK "EXTENSIONS_HID_PROP_LITERALMASK" -#define HID_PROP_ENABLED "EXTENSIONS_HID_PROP_ENABLED" -#define HID_PROP_AUTOCOMPLETE "EXTENSIONS_HID_PROP_AUTOCOMPLETE" -#define HID_PROP_LINECOUNT "EXTENSIONS_HID_PROP_LINECOUNT" -#define HID_PROP_MAXTEXTLEN "EXTENSIONS_HID_PROP_MAXTEXTLEN" -#define HID_PROP_SPIN "EXTENSIONS_HID_PROP_SPIN" -#define HID_PROP_STRICTFORMAT "EXTENSIONS_HID_PROP_STRICTFORMAT" -#define HID_PROP_SHOWTHOUSANDSEP "EXTENSIONS_HID_PROP_SHOWTHOUSANDSEP" -#define HID_PROP_PRINTABLE "EXTENSIONS_HID_PROP_PRINTABLE" -#define HID_PROP_TARGET_URL "EXTENSIONS_HID_PROP_TARGET_URL" -#define HID_PROP_TARGET_FRAME "EXTENSIONS_HID_PROP_TARGET_FRAME" -#define HID_PROP_TAG "EXTENSIONS_HID_PROP_TAG" -#define HID_PROP_ECHO_CHAR "EXTENSIONS_HID_PROP_ECHO_CHAR" -#define HID_PROP_EMPTY_IS_NULL "EXTENSIONS_HID_PROP_EMPTY_IS_NULL" -#define HID_PROP_DECIMAL_ACCURACY "EXTENSIONS_HID_PROP_DECIMAL_ACCURACY" -#define HID_PROP_ENABLE_VISIBLE "EXTENSIONS_HID_PROP_ENABLE_VISIBLE" -#define HID_PROP_DEFAULT_BUTTON "EXTENSIONS_HID_PROP_DEFAULT_BUTTON" -#define HID_PROP_HIDDEN_VALUE "EXTENSIONS_HID_PROP_HIDDEN_VALUE" -#define HID_PROP_TRISTATE "EXTENSIONS_HID_PROP_TRISTATE" -#define HID_PROP_NAVIGATIONBAR "EXTENSIONS_HID_PROP_NAVIGATIONBAR" -#define HID_PROP_FILTER "EXTENSIONS_HID_PROP_FILTER" -#define HID_PROP_SORT_CRITERIA "EXTENSIONS_HID_PROP_SORT_CRITERIA" -#define HID_PROP_DEFAULT_LONG_VALUE "EXTENSIONS_HID_PROP_DEFAULT_LONG_VALUE" -#define HID_PROP_DEFAULT_TIME "EXTENSIONS_HID_PROP_DEFAULT_TIME" -#define HID_PROP_DEFAULT_DATE "EXTENSIONS_HID_PROP_DEFAULT_DATE" -#define HID_PROP_HELPTEXT "EXTENSIONS_HID_PROP_HELPTEXT" -#define HID_PROP_HELPURL "EXTENSIONS_HID_PROP_HELPURL" -#define HID_PROP_RECORDMARKER "EXTENSIONS_HID_PROP_RECORDMARKER" -#define HID_PROP_FILTERPROPOSAL "EXTENSIONS_HID_PROP_FILTERPROPOSAL" -#define HID_PROP_EFFECTIVEMIN "EXTENSIONS_HID_PROP_EFFECTIVEMIN" -#define HID_PROP_EFFECTIVEMAX "EXTENSIONS_HID_PROP_EFFECTIVEMAX" -#define HID_PROP_EFFECTIVEDEFAULT "EXTENSIONS_HID_PROP_EFFECTIVEDEFAULT" -#define HID_PROP_CONTROLLABEL "EXTENSIONS_HID_PROP_CONTROLLABEL" -#define HID_PROP_CURRSYM_POSITION "EXTENSIONS_HID_PROP_CURRSYM_POSITION" -#define HID_PROP_ESCAPE_PROCESSING "EXTENSIONS_HID_PROP_ESCAPE_PROCESSING" -#define HID_PROP_TITLE "EXTENSIONS_HID_PROP_TITLE" -#define HID_PROP_STEP "EXTENSIONS_HID_PROP_STEP" -#define HID_PROP_PROGRESSVALUE "EXTENSIONS_HID_PROP_PROGRESSVALUE" -#define HID_PROP_PROGRESSVALUE_MIN "EXTENSIONS_HID_PROP_PROGRESSVALUE_MIN" -#define HID_PROP_PROGRESSVALUE_MAX "EXTENSIONS_HID_PROP_PROGRESSVALUE_MAX" -#define HID_PROP_SCROLLVALUE "EXTENSIONS_HID_PROP_SCROLLVALUE" -#define HID_PROP_SCROLLVALUE_MAX "EXTENSIONS_HID_PROP_SCROLLVALUE_MAX" -#define HID_PROP_SCROLL_WIDTH "EXTENSIONS_HID_PROP_SCROLL_WIDTH" -#define HID_PROP_SCROLL_HEIGHT "EXTENSIONS_HID_PROP_SCROLL_HEIGHT" -#define HID_PROP_SCROLL_TOP "EXTENSIONS_HID_PROP_SCROLL_TOP" -#define HID_PROP_SCROLL_LEFT "EXTENSIONS_HID_PROP_SCROLL_LEFT" -#define HID_PROP_LINEINCREMENT "EXTENSIONS_HID_PROP_LINEINCREMENT" -#define HID_PROP_BLOCKINCREMENT "EXTENSIONS_HID_PROP_BLOCKINCREMENT" -#define HID_PROP_VISIBLESIZE "EXTENSIONS_HID_PROP_VISIBLESIZE" -#define HID_PROP_ORIENTATION "EXTENSIONS_HID_PROP_ORIENTATION" -#define HID_PROP_POSITIONX "EXTENSIONS_HID_PROP_POSITIONX" -#define HID_PROP_POSITIONY "EXTENSIONS_HID_PROP_POSITIONY" -#define HID_PROP_PUSHBUTTONTYPE "EXTENSIONS_HID_PROP_PUSHBUTTONTYPE" -#define HID_PROP_STATE "EXTENSIONS_HID_PROP_STATE" -#define HID_PROP_SCALEIMAGE "EXTENSIONS_HID_PROP_SCALEIMAGE" -#define HID_PROP_BOUND_CELL "EXTENSIONS_HID_PROP_BOUND_CELL" -#define HID_PROP_LIST_CELL_RANGE "EXTENSIONS_HID_PROP_LIST_CELL_RANGE" -#define HID_PROP_CELL_EXCHANGE_TYPE "EXTENSIONS_HID_PROP_CELL_EXCHANGE_TYPE" -#define HID_PROP_SELECTEDITEMS "EXTENSIONS_HID_PROP_SELECTEDITEMS" -#define HID_PROP_SCROLLVALUE_MIN "EXTENSIONS_HID_PROP_SCROLLVALUE_MIN" -#define HID_PROP_DEFAULT_SCROLLVALUE "EXTENSIONS_HID_PROP_DEFAULT_SCROLLVALUE" -#define HID_PROP_REPEAT_DELAY "EXTENSIONS_HID_PROP_REPEAT_DELAY" -#define HID_PROP_SYMBOLCOLOR "EXTENSIONS_HID_PROP_SYMBOLCOLOR" -#define HID_PROP_SPINVALUE "EXTENSIONS_HID_PROP_SPINVALUE" -#define HID_PROP_SPINVALUE_MIN "EXTENSIONS_HID_PROP_SPINVALUE_MIN" -#define HID_PROP_SPINVALUE_MAX "EXTENSIONS_HID_PROP_SPINVALUE_MAX" -#define HID_PROP_DEFAULT_SPINVALUE "EXTENSIONS_HID_PROP_DEFAULT_SPINVALUE" -#define HID_PROP_SPININCREMENT "EXTENSIONS_HID_PROP_SPININCREMENT" -#define HID_PROP_REPEAT "EXTENSIONS_HID_PROP_REPEAT" -#define HID_PROP_WORDBREAK "EXTENSIONS_HID_PROP_WORDBREAK" -#define HID_PROP_SHOW_SCROLLBARS "EXTENSIONS_HID_PROP_SHOW_SCROLLBARS" -#define HID_PROP_ICONSIZE "EXTENSIONS_HID_PROP_ICONSIZE" -#define HID_PROP_SHOW_POSITION "EXTENSIONS_HID_PROP_SHOW_POSITION" -#define HID_PROP_SHOW_NAVIGATION "EXTENSIONS_HID_PROP_SHOW_NAVIGATION" -#define HID_PROP_SHOW_RECORDACTIONS "EXTENSIONS_HID_PROP_SHOW_RECORDACTIONS" -#define HID_PROP_SHOW_FILTERSORT "EXTENSIONS_HID_PROP_SHOW_FILTERSORT" -#define HID_PROP_AUTOLINEBREAK "EXTENSIONS_HID_PROP_AUTOLINEBREAK" -#define HID_PROP_TEXTTYPE "EXTENSIONS_HID_PROP_TEXTTYPE" -#define HID_PROP_LINEEND_FORMAT "EXTENSIONS_HID_PROP_LINEEND_FORMAT" -#define HID_PROP_XSD_TOTAL_DIGITS "EXTENSIONS_HID_PROP_XSD_TOTAL_DIGITS" -#define HID_PROP_XSD_FRACTION_DIGITS "EXTENSIONS_HID_PROP_XSD_FRACTION_DIGITS" -#define HID_PROP_XSD_MAX_INCLUSIVE "EXTENSIONS_HID_PROP_XSD_MAX_INCLUSIVE" -#define HID_PROP_XSD_MAX_EXCLUSIVE "EXTENSIONS_HID_PROP_XSD_MAX_EXCLUSIVE" -#define HID_PROP_XSD_MIN_INCLUSIVE "EXTENSIONS_HID_PROP_XSD_MIN_INCLUSIVE" -#define HID_PROP_XSD_MIN_EXCLUSIVE "EXTENSIONS_HID_PROP_XSD_MIN_EXCLUSIVE" -#define HID_PROP_UNCHECKEDREFVALUE "EXTENSIONS_HID_PROP_UNCHECKEDREFVALUE" -#define HID_PROP_SUBMISSION_ID "EXTENSIONS_HID_PROP_SUBMISSION_ID" -#define HID_PROP_XML_DATA_MODEL "EXTENSIONS_HID_PROP_XML_DATA_MODEL" -#define HID_PROP_BIND_EXPRESSION "EXTENSIONS_HID_PROP_BIND_EXPRESSION" -#define HID_PROP_XSD_REQUIRED "EXTENSIONS_HID_PROP_XSD_REQUIRED" -#define HID_PROP_XSD_RELEVANT "EXTENSIONS_HID_PROP_XSD_RELEVANT" -#define HID_PROP_XSD_READONLY "EXTENSIONS_HID_PROP_XSD_READONLY" -#define HID_PROP_XSD_CONSTRAINT "EXTENSIONS_HID_PROP_XSD_CONSTRAINT" -#define HID_PROP_XSD_CALCULATION "EXTENSIONS_HID_PROP_XSD_CALCULATION" -#define HID_PROP_XSD_DATA_TYPE "EXTENSIONS_HID_PROP_XSD_DATA_TYPE" -#define HID_PROP_XSD_WHITESPACES "EXTENSIONS_HID_PROP_XSD_WHITESPACES" -#define HID_PROP_URL "EXTENSIONS_HID_PROP_URL" -#define HID_PROP_XSD_PATTERN "EXTENSIONS_HID_PROP_XSD_PATTERN" -#define HID_PROP_XSD_LENGTH "EXTENSIONS_HID_PROP_XSD_LENGTH" -#define HID_PROP_XSD_MIN_LENGTH "EXTENSIONS_HID_PROP_XSD_MIN_LENGTH" -#define HID_PROP_XSD_MAX_LENGTH "EXTENSIONS_HID_PROP_XSD_MAX_LENGTH" -#define HID_PROP_LIST_BINDING "EXTENSIONS_HID_PROP_LIST_BINDING" -#define HID_PROP_BINDING_NAME "EXTENSIONS_HID_PROP_BINDING_NAME" -#define HID_PROP_SELECTION_TYPE "EXTENSIONS_HID_PROP_SELECTION_TYPE" -#define HID_PROP_ROOT_DISPLAYED "EXTENSIONS_HID_PROP_ROOT_DISPLAYED" -#define HID_PROP_SHOWS_HANDLES "EXTENSIONS_HID_PROP_SHOWS_HANDLES" -#define HID_PROP_SHOWS_ROOT_HANDLES "EXTENSIONS_HID_PROP_SHOWS_ROOT_HANDLES" -#define HID_PROP_EDITABLE "EXTENSIONS_HID_PROP_EDITABLE" -#define HID_PROP_INVOKES_STOP_NOT_EDITING "EXTENSIONS_HID_PROP_INVOKES_STOP_NOT_EDITING" -#define HID_PROP_ROW_HEIGHT "EXTENSIONS_HID_PROP_ROW_HEIGHT" -#define HID_PROP_DECORATION "EXTENSIONS_HID_PROP_DECORATION" -#define HID_EVT_ACTIONPERFORMED "EXTENSIONS_HID_EVT_ACTIONPERFORMED" -#define HID_EVT_AFTERUPDATE "EXTENSIONS_HID_EVT_AFTERUPDATE" -#define HID_EVT_BEFOREUPDATE "EXTENSIONS_HID_EVT_BEFOREUPDATE" -#define HID_EVT_CONFIRMDELETE "EXTENSIONS_HID_EVT_CONFIRMDELETE" -#define HID_EVT_ERROROCCURRED "EXTENSIONS_HID_EVT_ERROROCCURRED" -#define HID_EVT_FOCUSGAINED "EXTENSIONS_HID_EVT_FOCUSGAINED" -#define HID_EVT_FOCUSLOST "EXTENSIONS_HID_EVT_FOCUSLOST" -#define HID_EVT_ITEMSTATECHANGED "EXTENSIONS_HID_EVT_ITEMSTATECHANGED" -#define HID_EVT_KEYTYPED "EXTENSIONS_HID_EVT_KEYTYPED" -#define HID_EVT_LOADED "EXTENSIONS_HID_EVT_LOADED" -#define HID_EVT_MOUSEDRAGGED "EXTENSIONS_HID_EVT_MOUSEDRAGGED" -#define HID_EVT_MOUSEENTERED "EXTENSIONS_HID_EVT_MOUSEENTERED" -#define HID_EVT_MOUSEEXITED "EXTENSIONS_HID_EVT_MOUSEEXITED" -#define HID_EVT_MOUSEMOVED "EXTENSIONS_HID_EVT_MOUSEMOVED" -#define HID_EVT_MOUSEPRESSED "EXTENSIONS_HID_EVT_MOUSEPRESSED" -#define HID_EVT_MOUSERELEASED "EXTENSIONS_HID_EVT_MOUSERELEASED" -#define HID_EVT_POSITIONED "EXTENSIONS_HID_EVT_POSITIONED" -#define HID_EVT_RESETTED "EXTENSIONS_HID_EVT_RESETTED" -#define HID_EVT_SUBMITTED "EXTENSIONS_HID_EVT_SUBMITTED" -#define HID_EVT_TEXTCHANGED "EXTENSIONS_HID_EVT_TEXTCHANGED" -#define HID_EVT_UNLOADED "EXTENSIONS_HID_EVT_UNLOADED" -#define HID_EVT_CHANGED "EXTENSIONS_HID_EVT_CHANGED" -#define HID_EVT_APPROVEACTIONPERFORMED "EXTENSIONS_HID_EVT_APPROVEACTIONPERFORMED" -#define HID_EVT_APPROVERESETTED "EXTENSIONS_HID_EVT_APPROVERESETTED" -#define HID_EVT_KEYUP "EXTENSIONS_HID_EVT_KEYUP" -#define HID_EVT_APPROVEPARAMETER "EXTENSIONS_HID_EVT_APPROVEPARAMETER" -#define HID_EVT_POSITIONING "EXTENSIONS_HID_EVT_POSITIONING" -#define HID_EVT_RELOADED "EXTENSIONS_HID_EVT_RELOADED" -#define HID_EVT_APPROVEROWCHANGE "EXTENSIONS_HID_EVT_APPROVEROWCHANGE" -#define HID_EVT_ROWCHANGE "EXTENSIONS_HID_EVT_ROWCHANGE" -#define HID_EVT_RELOADING "EXTENSIONS_HID_EVT_RELOADING" -#define HID_EVT_UNLOADING "EXTENSIONS_HID_EVT_UNLOADING" -#define HID_EVT_ADJUSTMENTVALUECHANGED "EXTENSIONS_HID_EVT_ADJUSTMENTVALUECHANGED" -#define HID_PROP_TOGGLE "EXTENSIONS_HID_PROP_TOGGLE" -#define HID_PROP_FOCUSONCLICK "EXTENSIONS_HID_PROP_FOCUSONCLICK" -#define HID_PROP_HIDEINACTIVESELECTION "EXTENSIONS_HID_PROP_HIDEINACTIVESELECTION" -#define HID_PROP_VISUALEFFECT "EXTENSIONS_HID_PROP_VISUALEFFECT" -#define HID_PROP_BORDERCOLOR "EXTENSIONS_HID_PROP_BORDERCOLOR" -#define HID_PROP_IMAGEPOSITION "EXTENSIONS_HID_PROP_IMAGEPOSITION" -#define HID_PROP_NOLABEL "EXTENSIONS_HID_PROP_NOLABEL" -#define HID_PROP_WRITING_MODE "EXTENSIONS_HID_PROP_WRITING_MODE" -#define HID_PROP_ANCHOR_TYPE "EXTENSIONS_HID_PROP_ANCHOR_TYPE" -#define HID_FM_PROPDLG_TABCTR "EXTENSIONS_HID_FM_PROPDLG_TABCTR" -#define HID_FM_PROPDLG_TAB_GENERAL "EXTENSIONS_HID_FM_PROPDLG_TAB_GENERAL" -#define HID_FM_PROPDLG_TAB_DATA "EXTENSIONS_HID_FM_PROPDLG_TAB_DATA" -#define HID_FM_PROPDLG_TAB_EVT "EXTENSIONS_HID_FM_PROPDLG_TAB_EVT" -#define HID_PROP_GROUP_NAME "EXTENSIONS_HID_PROP_GROUP_NAME" +inline constexpr OUString HID_PROP_INPUT_REQUIRED = u"EXTENSIONS_HID_PROP_INPUT_REQUIRED"_ustr; +inline constexpr OUString HID_PROP_CONTROLSOURCE = u"EXTENSIONS_HID_PROP_CONTROLSOURCE"_ustr; +inline constexpr OUString HID_PROP_NAME = u"EXTENSIONS_HID_PROP_NAME"_ustr; +inline constexpr OUString HID_PROP_TABINDEX = u"EXTENSIONS_HID_PROP_TABINDEX"_ustr; +inline constexpr OUString HID_PROP_MASTERFIELDS = u"EXTENSIONS_HID_PROP_MASTERFIELDS"_ustr; +inline constexpr OUString HID_PROP_SLAVEFIELDS = u"EXTENSIONS_HID_PROP_SLAVEFIELDS"_ustr; +inline constexpr OUString HID_PROP_DATASOURCE = u"EXTENSIONS_HID_PROP_DATASOURCE"_ustr; +inline constexpr OUString HID_PROP_CURSORSOURCE = u"EXTENSIONS_HID_PROP_CURSORSOURCE"_ustr; +inline constexpr OUString HID_PROP_CURSORSOURCETYPE = u"EXTENSIONS_HID_PROP_CURSORSOURCETYPE"_ustr; +inline constexpr OUString HID_PROP_READONLY = u"EXTENSIONS_HID_PROP_READONLY"_ustr; +inline constexpr OUString HID_PROP_DATAENTRY = u"EXTENSIONS_HID_PROP_DATAENTRY"_ustr; +inline constexpr OUString HID_PROP_NAVIGATION = u"EXTENSIONS_HID_PROP_NAVIGATION"_ustr; +inline constexpr OUString HID_PROP_CYCLE = u"EXTENSIONS_HID_PROP_CYCLE"_ustr; +inline constexpr OUString HID_PROP_ALLOW_ADDITIONS = u"EXTENSIONS_HID_PROP_ALLOW_ADDITIONS"_ustr; +inline constexpr OUString HID_PROP_ALLOW_EDITS = u"EXTENSIONS_HID_PROP_ALLOW_EDITS"_ustr; +inline constexpr OUString HID_PROP_ALLOW_DELETIONS = u"EXTENSIONS_HID_PROP_ALLOW_DELETIONS"_ustr; +inline constexpr OUString HID_PROP_VALUE = u"EXTENSIONS_HID_PROP_VALUE"_ustr; +inline constexpr OUString HID_PROP_FORMATKEY = u"EXTENSIONS_HID_PROP_FORMATKEY"_ustr; +inline constexpr OUString HID_PROP_WHEEL_BEHAVIOR = u"EXTENSIONS_HID_PROP_WHEEL_BEHAVIOR"_ustr; +inline constexpr OUString HID_PROP_HEIGHT = u"EXTENSIONS_HID_PROP_HEIGHT"_ustr; +inline constexpr OUString HID_PROP_WIDTH = u"EXTENSIONS_HID_PROP_WIDTH"_ustr; +inline constexpr OUString HID_PROP_AUTOGROW = u"EXTENSIONS_HID_PROP_AUTOGROW"_ustr; +inline constexpr OUString HID_PROP_BOUNDCOLUMN = u"EXTENSIONS_HID_PROP_BOUNDCOLUMN"_ustr; +inline constexpr OUString HID_PROP_LISTSOURCETYPE = u"EXTENSIONS_HID_PROP_LISTSOURCETYPE"_ustr; +inline constexpr OUString HID_PROP_LISTSOURCE = u"EXTENSIONS_HID_PROP_LISTSOURCE"_ustr; +inline constexpr OUString HID_PROP_LISTINDEX = u"EXTENSIONS_HID_PROP_LISTINDEX"_ustr; +inline constexpr OUString HID_PROP_TEXT = u"EXTENSIONS_HID_PROP_TEXT"_ustr; +inline constexpr OUString HID_PROP_LABEL = u"EXTENSIONS_HID_PROP_LABEL"_ustr; +inline constexpr OUString HID_PROP_STRINGITEMLIST = u"EXTENSIONS_HID_PROP_STRINGITEMLIST"_ustr; +inline constexpr OUString HID_PROP_FONT = u"EXTENSIONS_HID_PROP_FONT"_ustr; +inline constexpr OUString HID_PROP_ROWHEIGHT = u"EXTENSIONS_HID_PROP_ROWHEIGHT"_ustr; +inline constexpr OUString HID_PROP_BACKGROUNDCOLOR = u"EXTENSIONS_HID_PROP_BACKGROUNDCOLOR"_ustr; +inline constexpr OUString HID_PROP_FILLCOLOR = u"EXTENSIONS_HID_PROP_FILLCOLOR"_ustr; +inline constexpr OUString HID_PROP_LINECOLOR = u"EXTENSIONS_HID_PROP_LINECOLOR"_ustr; +inline constexpr OUString HID_PROP_BORDER = u"EXTENSIONS_HID_PROP_BORDER"_ustr; +inline constexpr OUString HID_PROP_ALIGN = u"EXTENSIONS_HID_PROP_ALIGN"_ustr; +inline constexpr OUString HID_PROP_VERTICAL_ALIGN = u"EXTENSIONS_HID_PROP_VERTICAL_ALIGN"_ustr; +inline constexpr OUString HID_PROP_DROPDOWN = u"EXTENSIONS_HID_PROP_DROPDOWN"_ustr; +inline constexpr OUString HID_PROP_MULTILINE = u"EXTENSIONS_HID_PROP_MULTILINE"_ustr; +inline constexpr OUString HID_PROP_HSCROLL = u"EXTENSIONS_HID_PROP_HSCROLL"_ustr; +inline constexpr OUString HID_PROP_VSCROLL = u"EXTENSIONS_HID_PROP_VSCROLL"_ustr; +inline constexpr OUString HID_PROP_TABSTOP = u"EXTENSIONS_HID_PROP_TABSTOP"_ustr; +inline constexpr OUString HID_PROP_REFVALUE = u"EXTENSIONS_HID_PROP_REFVALUE"_ustr; +inline constexpr OUString HID_PROP_BUTTONTYPE = u"EXTENSIONS_HID_PROP_BUTTONTYPE"_ustr; +inline constexpr OUString HID_PROP_SUBMIT_ACTION = u"EXTENSIONS_HID_PROP_SUBMIT_ACTION"_ustr; +inline constexpr OUString HID_PROP_SUBMIT_METHOD = u"EXTENSIONS_HID_PROP_SUBMIT_METHOD"_ustr; +inline constexpr OUString HID_PROP_SUBMIT_ENCODING = u"EXTENSIONS_HID_PROP_SUBMIT_ENCODING"_ustr; +inline constexpr OUString HID_PROP_DEFAULTVALUE = u"EXTENSIONS_HID_PROP_DEFAULTVALUE"_ustr; +inline constexpr OUString HID_PROP_SUBMIT_TARGET = u"EXTENSIONS_HID_PROP_SUBMIT_TARGET"_ustr; +inline constexpr OUString HID_PROP_DEFAULT_STATE = u"EXTENSIONS_HID_PROP_DEFAULT_STATE"_ustr; +inline constexpr OUString HID_PROP_IMAGE_URL = u"EXTENSIONS_HID_PROP_IMAGE_URL"_ustr; +inline constexpr OUString HID_PROP_DEFAULT_SELECT_SEQ = u"EXTENSIONS_HID_PROP_DEFAULT_SELECT_SEQ"_ustr; +inline constexpr OUString HID_PROP_MULTISELECTION = u"EXTENSIONS_HID_PROP_MULTISELECTION"_ustr; +inline constexpr OUString HID_PROP_DATE = u"EXTENSIONS_HID_PROP_DATE"_ustr; +inline constexpr OUString HID_PROP_DATEMIN = u"EXTENSIONS_HID_PROP_DATEMIN"_ustr; +inline constexpr OUString HID_PROP_DATEMAX = u"EXTENSIONS_HID_PROP_DATEMAX"_ustr; +inline constexpr OUString HID_PROP_DATEFORMAT = u"EXTENSIONS_HID_PROP_DATEFORMAT"_ustr; +inline constexpr OUString HID_PROP_TIME = u"EXTENSIONS_HID_PROP_TIME"_ustr; +inline constexpr OUString HID_PROP_TIMEMIN = u"EXTENSIONS_HID_PROP_TIMEMIN"_ustr; +inline constexpr OUString HID_PROP_TIMEMAX = u"EXTENSIONS_HID_PROP_TIMEMAX"_ustr; +inline constexpr OUString HID_PROP_TIMEFORMAT = u"EXTENSIONS_HID_PROP_TIMEFORMAT"_ustr; +inline constexpr OUString HID_PROP_VALUEMIN = u"EXTENSIONS_HID_PROP_VALUEMIN"_ustr; +inline constexpr OUString HID_PROP_VALUEMAX = u"EXTENSIONS_HID_PROP_VALUEMAX"_ustr; +inline constexpr OUString HID_PROP_VALUESTEP = u"EXTENSIONS_HID_PROP_VALUESTEP"_ustr; +inline constexpr OUString HID_PROP_CURRENCYSYMBOL = u"EXTENSIONS_HID_PROP_CURRENCYSYMBOL"_ustr; +inline constexpr OUString HID_PROP_EDITMASK = u"EXTENSIONS_HID_PROP_EDITMASK"_ustr; +inline constexpr OUString HID_PROP_LITERALMASK = u"EXTENSIONS_HID_PROP_LITERALMASK"_ustr; +inline constexpr OUString HID_PROP_ENABLED = u"EXTENSIONS_HID_PROP_ENABLED"_ustr; +inline constexpr OUString HID_PROP_AUTOCOMPLETE = u"EXTENSIONS_HID_PROP_AUTOCOMPLETE"_ustr; +inline constexpr OUString HID_PROP_LINECOUNT = u"EXTENSIONS_HID_PROP_LINECOUNT"_ustr; +inline constexpr OUString HID_PROP_MAXTEXTLEN = u"EXTENSIONS_HID_PROP_MAXTEXTLEN"_ustr; +inline constexpr OUString HID_PROP_SPIN = u"EXTENSIONS_HID_PROP_SPIN"_ustr; +inline constexpr OUString HID_PROP_STRICTFORMAT = u"EXTENSIONS_HID_PROP_STRICTFORMAT"_ustr; +inline constexpr OUString HID_PROP_SHOWTHOUSANDSEP = u"EXTENSIONS_HID_PROP_SHOWTHOUSANDSEP"_ustr; +inline constexpr OUString HID_PROP_PRINTABLE = u"EXTENSIONS_HID_PROP_PRINTABLE"_ustr; +inline constexpr OUString HID_PROP_TARGET_URL = u"EXTENSIONS_HID_PROP_TARGET_URL"_ustr; +inline constexpr OUString HID_PROP_TARGET_FRAME = u"EXTENSIONS_HID_PROP_TARGET_FRAME"_ustr; +inline constexpr OUString HID_PROP_TAG = u"EXTENSIONS_HID_PROP_TAG"_ustr; +inline constexpr OUString HID_PROP_ECHO_CHAR = u"EXTENSIONS_HID_PROP_ECHO_CHAR"_ustr; +inline constexpr OUString HID_PROP_EMPTY_IS_NULL = u"EXTENSIONS_HID_PROP_EMPTY_IS_NULL"_ustr; +inline constexpr OUString HID_PROP_DECIMAL_ACCURACY = u"EXTENSIONS_HID_PROP_DECIMAL_ACCURACY"_ustr; +inline constexpr OUString HID_PROP_ENABLE_VISIBLE = u"EXTENSIONS_HID_PROP_ENABLE_VISIBLE"_ustr; +inline constexpr OUString HID_PROP_DEFAULT_BUTTON = u"EXTENSIONS_HID_PROP_DEFAULT_BUTTON"_ustr; +inline constexpr OUString HID_PROP_HIDDEN_VALUE = u"EXTENSIONS_HID_PROP_HIDDEN_VALUE"_ustr; +inline constexpr OUString HID_PROP_TRISTATE = u"EXTENSIONS_HID_PROP_TRISTATE"_ustr; +inline constexpr OUString HID_PROP_NAVIGATIONBAR = u"EXTENSIONS_HID_PROP_NAVIGATIONBAR"_ustr; +inline constexpr OUString HID_PROP_FILTER = u"EXTENSIONS_HID_PROP_FILTER"_ustr; +inline constexpr OUString HID_PROP_SORT_CRITERIA = u"EXTENSIONS_HID_PROP_SORT_CRITERIA"_ustr; +inline constexpr OUString HID_PROP_DEFAULT_LONG_VALUE = u"EXTENSIONS_HID_PROP_DEFAULT_LONG_VALUE"_ustr; +inline constexpr OUString HID_PROP_DEFAULT_TIME = u"EXTENSIONS_HID_PROP_DEFAULT_TIME"_ustr; +inline constexpr OUString HID_PROP_DEFAULT_DATE = u"EXTENSIONS_HID_PROP_DEFAULT_DATE"_ustr; +inline constexpr OUString HID_PROP_HELPTEXT = u"EXTENSIONS_HID_PROP_HELPTEXT"_ustr; +inline constexpr OUString HID_PROP_HELPURL = u"EXTENSIONS_HID_PROP_HELPURL"_ustr; +inline constexpr OUString HID_PROP_RECORDMARKER = u"EXTENSIONS_HID_PROP_RECORDMARKER"_ustr; +inline constexpr OUString HID_PROP_FILTERPROPOSAL = u"EXTENSIONS_HID_PROP_FILTERPROPOSAL"_ustr; +inline constexpr OUString HID_PROP_EFFECTIVEMIN = u"EXTENSIONS_HID_PROP_EFFECTIVEMIN"_ustr; +inline constexpr OUString HID_PROP_EFFECTIVEMAX = u"EXTENSIONS_HID_PROP_EFFECTIVEMAX"_ustr; +inline constexpr OUString HID_PROP_EFFECTIVEDEFAULT = u"EXTENSIONS_HID_PROP_EFFECTIVEDEFAULT"_ustr; +inline constexpr OUString HID_PROP_CONTROLLABEL = u"EXTENSIONS_HID_PROP_CONTROLLABEL"_ustr; +inline constexpr OUString HID_PROP_CURRSYM_POSITION = u"EXTENSIONS_HID_PROP_CURRSYM_POSITION"_ustr; +inline constexpr OUString HID_PROP_ESCAPE_PROCESSING = u"EXTENSIONS_HID_PROP_ESCAPE_PROCESSING"_ustr; +inline constexpr OUString HID_PROP_TITLE = u"EXTENSIONS_HID_PROP_TITLE"_ustr; +inline constexpr OUString HID_PROP_STEP = u"EXTENSIONS_HID_PROP_STEP"_ustr; +inline constexpr OUString HID_PROP_PROGRESSVALUE = u"EXTENSIONS_HID_PROP_PROGRESSVALUE"_ustr; +inline constexpr OUString HID_PROP_PROGRESSVALUE_MIN = u"EXTENSIONS_HID_PROP_PROGRESSVALUE_MIN"_ustr; +inline constexpr OUString HID_PROP_PROGRESSVALUE_MAX = u"EXTENSIONS_HID_PROP_PROGRESSVALUE_MAX"_ustr; +inline constexpr OUString HID_PROP_SCROLLVALUE = u"EXTENSIONS_HID_PROP_SCROLLVALUE"_ustr; +inline constexpr OUString HID_PROP_SCROLLVALUE_MAX = u"EXTENSIONS_HID_PROP_SCROLLVALUE_MAX"_ustr; +inline constexpr OUString HID_PROP_SCROLL_WIDTH = u"EXTENSIONS_HID_PROP_SCROLL_WIDTH"_ustr; +inline constexpr OUString HID_PROP_SCROLL_HEIGHT = u"EXTENSIONS_HID_PROP_SCROLL_HEIGHT"_ustr; +inline constexpr OUString HID_PROP_SCROLL_TOP = u"EXTENSIONS_HID_PROP_SCROLL_TOP"_ustr; +inline constexpr OUString HID_PROP_SCROLL_LEFT = u"EXTENSIONS_HID_PROP_SCROLL_LEFT"_ustr; +inline constexpr OUString HID_PROP_LINEINCREMENT = u"EXTENSIONS_HID_PROP_LINEINCREMENT"_ustr; +inline constexpr OUString HID_PROP_BLOCKINCREMENT = u"EXTENSIONS_HID_PROP_BLOCKINCREMENT"_ustr; +inline constexpr OUString HID_PROP_VISIBLESIZE = u"EXTENSIONS_HID_PROP_VISIBLESIZE"_ustr; +inline constexpr OUString HID_PROP_ORIENTATION = u"EXTENSIONS_HID_PROP_ORIENTATION"_ustr; +inline constexpr OUString HID_PROP_POSITIONX = u"EXTENSIONS_HID_PROP_POSITIONX"_ustr; +inline constexpr OUString HID_PROP_POSITIONY = u"EXTENSIONS_HID_PROP_POSITIONY"_ustr; +inline constexpr OUString HID_PROP_PUSHBUTTONTYPE = u"EXTENSIONS_HID_PROP_PUSHBUTTONTYPE"_ustr; +inline constexpr OUString HID_PROP_STATE = u"EXTENSIONS_HID_PROP_STATE"_ustr; +inline constexpr OUString HID_PROP_SCALEIMAGE = u"EXTENSIONS_HID_PROP_SCALEIMAGE"_ustr; +inline constexpr OUString HID_PROP_BOUND_CELL = u"EXTENSIONS_HID_PROP_BOUND_CELL"_ustr; +inline constexpr OUString HID_PROP_LIST_CELL_RANGE = u"EXTENSIONS_HID_PROP_LIST_CELL_RANGE"_ustr; +inline constexpr OUString HID_PROP_CELL_EXCHANGE_TYPE = u"EXTENSIONS_HID_PROP_CELL_EXCHANGE_TYPE"_ustr; +inline constexpr OUString HID_PROP_SELECTEDITEMS = u"EXTENSIONS_HID_PROP_SELECTEDITEMS"_ustr; +inline constexpr OUString HID_PROP_SCROLLVALUE_MIN = u"EXTENSIONS_HID_PROP_SCROLLVALUE_MIN"_ustr; +inline constexpr OUString HID_PROP_DEFAULT_SCROLLVALUE = u"EXTENSIONS_HID_PROP_DEFAULT_SCROLLVALUE"_ustr; +inline constexpr OUString HID_PROP_REPEAT_DELAY = u"EXTENSIONS_HID_PROP_REPEAT_DELAY"_ustr; +inline constexpr OUString HID_PROP_SYMBOLCOLOR = u"EXTENSIONS_HID_PROP_SYMBOLCOLOR"_ustr; +inline constexpr OUString HID_PROP_SPINVALUE = u"EXTENSIONS_HID_PROP_SPINVALUE"_ustr; +inline constexpr OUString HID_PROP_SPINVALUE_MIN = u"EXTENSIONS_HID_PROP_SPINVALUE_MIN"_ustr; +inline constexpr OUString HID_PROP_SPINVALUE_MAX = u"EXTENSIONS_HID_PROP_SPINVALUE_MAX"_ustr; +inline constexpr OUString HID_PROP_DEFAULT_SPINVALUE = u"EXTENSIONS_HID_PROP_DEFAULT_SPINVALUE"_ustr; +inline constexpr OUString HID_PROP_SPININCREMENT = u"EXTENSIONS_HID_PROP_SPININCREMENT"_ustr; +inline constexpr OUString HID_PROP_REPEAT = u"EXTENSIONS_HID_PROP_REPEAT"_ustr; +inline constexpr OUString HID_PROP_WORDBREAK = u"EXTENSIONS_HID_PROP_WORDBREAK"_ustr; +inline constexpr OUString HID_PROP_SHOW_SCROLLBARS = u"EXTENSIONS_HID_PROP_SHOW_SCROLLBARS"_ustr; +inline constexpr OUString HID_PROP_ICONSIZE = u"EXTENSIONS_HID_PROP_ICONSIZE"_ustr; +inline constexpr OUString HID_PROP_SHOW_POSITION = u"EXTENSIONS_HID_PROP_SHOW_POSITION"_ustr; +inline constexpr OUString HID_PROP_SHOW_NAVIGATION = u"EXTENSIONS_HID_PROP_SHOW_NAVIGATION"_ustr; +inline constexpr OUString HID_PROP_SHOW_RECORDACTIONS = u"EXTENSIONS_HID_PROP_SHOW_RECORDACTIONS"_ustr; +inline constexpr OUString HID_PROP_SHOW_FILTERSORT = u"EXTENSIONS_HID_PROP_SHOW_FILTERSORT"_ustr; +inline constexpr OUString HID_PROP_TEXTTYPE = u"EXTENSIONS_HID_PROP_TEXTTYPE"_ustr; +inline constexpr OUString HID_PROP_LINEEND_FORMAT = u"EXTENSIONS_HID_PROP_LINEEND_FORMAT"_ustr; +inline constexpr OUString HID_PROP_XSD_TOTAL_DIGITS = u"EXTENSIONS_HID_PROP_XSD_TOTAL_DIGITS"_ustr; +inline constexpr OUString HID_PROP_XSD_FRACTION_DIGITS = u"EXTENSIONS_HID_PROP_XSD_FRACTION_DIGITS"_ustr; +inline constexpr OUString HID_PROP_XSD_MAX_INCLUSIVE = u"EXTENSIONS_HID_PROP_XSD_MAX_INCLUSIVE"_ustr; +inline constexpr OUString HID_PROP_XSD_MAX_EXCLUSIVE = u"EXTENSIONS_HID_PROP_XSD_MAX_EXCLUSIVE"_ustr; +inline constexpr OUString HID_PROP_XSD_MIN_INCLUSIVE = u"EXTENSIONS_HID_PROP_XSD_MIN_INCLUSIVE"_ustr; +inline constexpr OUString HID_PROP_XSD_MIN_EXCLUSIVE = u"EXTENSIONS_HID_PROP_XSD_MIN_EXCLUSIVE"_ustr; +inline constexpr OUString HID_PROP_UNCHECKEDREFVALUE = u"EXTENSIONS_HID_PROP_UNCHECKEDREFVALUE"_ustr; +inline constexpr OUString HID_PROP_SUBMISSION_ID = u"EXTENSIONS_HID_PROP_SUBMISSION_ID"_ustr; +inline constexpr OUString HID_PROP_XML_DATA_MODEL = u"EXTENSIONS_HID_PROP_XML_DATA_MODEL"_ustr; +inline constexpr OUString HID_PROP_BIND_EXPRESSION = u"EXTENSIONS_HID_PROP_BIND_EXPRESSION"_ustr; +inline constexpr OUString HID_PROP_XSD_REQUIRED = u"EXTENSIONS_HID_PROP_XSD_REQUIRED"_ustr; +inline constexpr OUString HID_PROP_XSD_RELEVANT = u"EXTENSIONS_HID_PROP_XSD_RELEVANT"_ustr; +inline constexpr OUString HID_PROP_XSD_READONLY = u"EXTENSIONS_HID_PROP_XSD_READONLY"_ustr; +inline constexpr OUString HID_PROP_XSD_CONSTRAINT = u"EXTENSIONS_HID_PROP_XSD_CONSTRAINT"_ustr; +inline constexpr OUString HID_PROP_XSD_CALCULATION = u"EXTENSIONS_HID_PROP_XSD_CALCULATION"_ustr; +inline constexpr OUString HID_PROP_XSD_DATA_TYPE = u"EXTENSIONS_HID_PROP_XSD_DATA_TYPE"_ustr; +inline constexpr OUString HID_PROP_XSD_WHITESPACES = u"EXTENSIONS_HID_PROP_XSD_WHITESPACES"_ustr; +inline constexpr OUString HID_PROP_URL = u"EXTENSIONS_HID_PROP_URL"_ustr; +inline constexpr OUString HID_PROP_XSD_PATTERN = u"EXTENSIONS_HID_PROP_XSD_PATTERN"_ustr; +inline constexpr OUString HID_PROP_XSD_LENGTH = u"EXTENSIONS_HID_PROP_XSD_LENGTH"_ustr; +inline constexpr OUString HID_PROP_XSD_MIN_LENGTH = u"EXTENSIONS_HID_PROP_XSD_MIN_LENGTH"_ustr; +inline constexpr OUString HID_PROP_XSD_MAX_LENGTH = u"EXTENSIONS_HID_PROP_XSD_MAX_LENGTH"_ustr; +inline constexpr OUString HID_PROP_LIST_BINDING = u"EXTENSIONS_HID_PROP_LIST_BINDING"_ustr; +inline constexpr OUString HID_PROP_BINDING_NAME = u"EXTENSIONS_HID_PROP_BINDING_NAME"_ustr; +inline constexpr OUString HID_PROP_SELECTION_TYPE = u"EXTENSIONS_HID_PROP_SELECTION_TYPE"_ustr; +inline constexpr OUString HID_PROP_ROOT_DISPLAYED = u"EXTENSIONS_HID_PROP_ROOT_DISPLAYED"_ustr; +inline constexpr OUString HID_PROP_SHOWS_HANDLES = u"EXTENSIONS_HID_PROP_SHOWS_HANDLES"_ustr; +inline constexpr OUString HID_PROP_SHOWS_ROOT_HANDLES = u"EXTENSIONS_HID_PROP_SHOWS_ROOT_HANDLES"_ustr; +inline constexpr OUString HID_PROP_EDITABLE = u"EXTENSIONS_HID_PROP_EDITABLE"_ustr; +inline constexpr OUString HID_PROP_INVOKES_STOP_NOT_EDITING = u"EXTENSIONS_HID_PROP_INVOKES_STOP_NOT_EDITING"_ustr; +inline constexpr OUString HID_PROP_DECORATION = u"EXTENSIONS_HID_PROP_DECORATION"_ustr; +inline constexpr OUString HID_EVT_ACTIONPERFORMED = u"EXTENSIONS_HID_EVT_ACTIONPERFORMED"_ustr; +inline constexpr OUString HID_EVT_AFTERUPDATE = u"EXTENSIONS_HID_EVT_AFTERUPDATE"_ustr; +inline constexpr OUString HID_EVT_BEFOREUPDATE = u"EXTENSIONS_HID_EVT_BEFOREUPDATE"_ustr; +inline constexpr OUString HID_EVT_CONFIRMDELETE = u"EXTENSIONS_HID_EVT_CONFIRMDELETE"_ustr; +inline constexpr OUString HID_EVT_ERROROCCURRED = u"EXTENSIONS_HID_EVT_ERROROCCURRED"_ustr; +inline constexpr OUString HID_EVT_FOCUSGAINED = u"EXTENSIONS_HID_EVT_FOCUSGAINED"_ustr; +inline constexpr OUString HID_EVT_FOCUSLOST = u"EXTENSIONS_HID_EVT_FOCUSLOST"_ustr; +inline constexpr OUString HID_EVT_ITEMSTATECHANGED = u"EXTENSIONS_HID_EVT_ITEMSTATECHANGED"_ustr; +inline constexpr OUString HID_EVT_KEYTYPED = u"EXTENSIONS_HID_EVT_KEYTYPED"_ustr; +inline constexpr OUString HID_EVT_LOADED = u"EXTENSIONS_HID_EVT_LOADED"_ustr; +inline constexpr OUString HID_EVT_MOUSEDRAGGED = u"EXTENSIONS_HID_EVT_MOUSEDRAGGED"_ustr; +inline constexpr OUString HID_EVT_MOUSEENTERED = u"EXTENSIONS_HID_EVT_MOUSEENTERED"_ustr; +inline constexpr OUString HID_EVT_MOUSEEXITED = u"EXTENSIONS_HID_EVT_MOUSEEXITED"_ustr; +inline constexpr OUString HID_EVT_MOUSEMOVED = u"EXTENSIONS_HID_EVT_MOUSEMOVED"_ustr; +inline constexpr OUString HID_EVT_MOUSEPRESSED = u"EXTENSIONS_HID_EVT_MOUSEPRESSED"_ustr; +inline constexpr OUString HID_EVT_MOUSERELEASED = u"EXTENSIONS_HID_EVT_MOUSERELEASED"_ustr; +inline constexpr OUString HID_EVT_POSITIONED = u"EXTENSIONS_HID_EVT_POSITIONED"_ustr; +inline constexpr OUString HID_EVT_RESETTED = u"EXTENSIONS_HID_EVT_RESETTED"_ustr; +inline constexpr OUString HID_EVT_SUBMITTED = u"EXTENSIONS_HID_EVT_SUBMITTED"_ustr; +inline constexpr OUString HID_EVT_TEXTCHANGED = u"EXTENSIONS_HID_EVT_TEXTCHANGED"_ustr; +inline constexpr OUString HID_EVT_UNLOADED = u"EXTENSIONS_HID_EVT_UNLOADED"_ustr; +inline constexpr OUString HID_EVT_CHANGED = u"EXTENSIONS_HID_EVT_CHANGED"_ustr; +inline constexpr OUString HID_EVT_APPROVEACTIONPERFORMED = u"EXTENSIONS_HID_EVT_APPROVEACTIONPERFORMED"_ustr; +inline constexpr OUString HID_EVT_APPROVERESETTED = u"EXTENSIONS_HID_EVT_APPROVERESETTED"_ustr; +inline constexpr OUString HID_EVT_KEYUP = u"EXTENSIONS_HID_EVT_KEYUP"_ustr; +inline constexpr OUString HID_EVT_APPROVEPARAMETER = u"EXTENSIONS_HID_EVT_APPROVEPARAMETER"_ustr; +inline constexpr OUString HID_EVT_POSITIONING = u"EXTENSIONS_HID_EVT_POSITIONING"_ustr; +inline constexpr OUString HID_EVT_RELOADED = u"EXTENSIONS_HID_EVT_RELOADED"_ustr; +inline constexpr OUString HID_EVT_APPROVEROWCHANGE = u"EXTENSIONS_HID_EVT_APPROVEROWCHANGE"_ustr; +inline constexpr OUString HID_EVT_ROWCHANGE = u"EXTENSIONS_HID_EVT_ROWCHANGE"_ustr; +inline constexpr OUString HID_EVT_RELOADING = u"EXTENSIONS_HID_EVT_RELOADING"_ustr; +inline constexpr OUString HID_EVT_UNLOADING = u"EXTENSIONS_HID_EVT_UNLOADING"_ustr; +inline constexpr OUString HID_EVT_ADJUSTMENTVALUECHANGED = u"EXTENSIONS_HID_EVT_ADJUSTMENTVALUECHANGED"_ustr; +inline constexpr OUString HID_PROP_TOGGLE = u"EXTENSIONS_HID_PROP_TOGGLE"_ustr; +inline constexpr OUString HID_PROP_FOCUSONCLICK = u"EXTENSIONS_HID_PROP_FOCUSONCLICK"_ustr; +inline constexpr OUString HID_PROP_HIDEINACTIVESELECTION = u"EXTENSIONS_HID_PROP_HIDEINACTIVESELECTION"_ustr; +inline constexpr OUString HID_PROP_VISUALEFFECT = u"EXTENSIONS_HID_PROP_VISUALEFFECT"_ustr; +inline constexpr OUString HID_PROP_BORDERCOLOR = u"EXTENSIONS_HID_PROP_BORDERCOLOR"_ustr; +inline constexpr OUString HID_PROP_IMAGEPOSITION = u"EXTENSIONS_HID_PROP_IMAGEPOSITION"_ustr; +inline constexpr OUString HID_PROP_NOLABEL = u"EXTENSIONS_HID_PROP_NOLABEL"_ustr; +inline constexpr OUString HID_PROP_WRITING_MODE = u"EXTENSIONS_HID_PROP_WRITING_MODE"_ustr; +inline constexpr OUString HID_PROP_ANCHOR_TYPE = u"EXTENSIONS_HID_PROP_ANCHOR_TYPE"_ustr; +inline constexpr OUString HID_FM_PROPDLG_TABCTR = u"EXTENSIONS_HID_FM_PROPDLG_TABCTR"_ustr; +inline constexpr OUString HID_FM_PROPDLG_TAB_GENERAL = u"EXTENSIONS_HID_FM_PROPDLG_TAB_GENERAL"_ustr; +inline constexpr OUString HID_FM_PROPDLG_TAB_DATA = u"EXTENSIONS_HID_FM_PROPDLG_TAB_DATA"_ustr; +inline constexpr OUString HID_FM_PROPDLG_TAB_EVT = u"EXTENSIONS_HID_FM_PROPDLG_TAB_EVT"_ustr; +inline constexpr OUString HID_PROP_GROUP_NAME = u"EXTENSIONS_HID_PROP_GROUP_NAME"_ustr; -#define HID_PROP_SELECTIONMODEL "EXTENSIONS_HID_PROP_SELECTIONMODEL" -#define HID_PROP_USEGRIDLINE "EXTENSIONS_HID_PROP_USEGRIDLINE" -#define HID_PROP_GRIDLINECOLOR "EXTENSIONS_HID_PROP_GRIDLINECOLOR" -#define HID_PROP_SHOWCOLUMNHEADER "EXTENSIONS_HID_PROP_SHOWCOLUMNHEADER" -#define HID_PROP_SHOWROWHEADER "EXTENSIONS_HID_PROP_SHOWROWHEADER" -#define HID_PROP_HEADERBACKGROUNDCOLOR "EXTENSIONS_HID_PROP_HEADERBACKGROUNDCOLOR" -#define HID_PROP_HEADERTEXTCOLOR "EXTENSIONS_HID_PROP_HEADERTEXTCOLOR" -#define HID_PROP_ACTIVESELECTIONBACKGROUNDCOLOR "EXTENSIONS_HID_PROP_ACTIVESELECTIONBACKGROUNDCOLOR" -#define HID_PROP_ACTIVESELECTIONTEXTCOLOR "EXTENSIONS_HID_PROP_ACTIVESELECTIONTEXTCOLOR" -#define HID_PROP_INACTIVESELECTIONBACKGROUNDCOLOR "EXTENSIONS_HID_PROP_INACTIVESELECTIONBACKGROUNDCOLOR" -#define HID_PROP_INACTIVESELECTIONTEXTCOLOR "EXTENSIONS_HID_PROP_INACTIVESELECTIONTEXTCOLOR" +inline constexpr OUString HID_PROP_SELECTIONMODEL = u"EXTENSIONS_HID_PROP_SELECTIONMODEL"_ustr; +inline constexpr OUString HID_PROP_USEGRIDLINE = u"EXTENSIONS_HID_PROP_USEGRIDLINE"_ustr; +inline constexpr OUString HID_PROP_GRIDLINECOLOR = u"EXTENSIONS_HID_PROP_GRIDLINECOLOR"_ustr; +inline constexpr OUString HID_PROP_SHOWCOLUMNHEADER = u"EXTENSIONS_HID_PROP_SHOWCOLUMNHEADER"_ustr; +inline constexpr OUString HID_PROP_SHOWROWHEADER = u"EXTENSIONS_HID_PROP_SHOWROWHEADER"_ustr; +inline constexpr OUString HID_PROP_HEADERBACKGROUNDCOLOR = u"EXTENSIONS_HID_PROP_HEADERBACKGROUNDCOLOR"_ustr; +inline constexpr OUString HID_PROP_HEADERTEXTCOLOR = u"EXTENSIONS_HID_PROP_HEADERTEXTCOLOR"_ustr; +inline constexpr OUString HID_PROP_ACTIVESELECTIONBACKGROUNDCOLOR = u"EXTENSIONS_HID_PROP_ACTIVESELECTIONBACKGROUNDCOLOR"_ustr; +inline constexpr OUString HID_PROP_ACTIVESELECTIONTEXTCOLOR = u"EXTENSIONS_HID_PROP_ACTIVESELECTIONTEXTCOLOR"_ustr; +inline constexpr OUString HID_PROP_INACTIVESELECTIONBACKGROUNDCOLOR = u"EXTENSIONS_HID_PROP_INACTIVESELECTIONBACKGROUNDCOLOR"_ustr; +inline constexpr OUString HID_PROP_INACTIVESELECTIONTEXTCOLOR = u"EXTENSIONS_HID_PROP_INACTIVESELECTIONTEXTCOLOR"_ustr; #define HID_CHECK_FOR_UPD_DLG "EXTENSIONS_HID_CHECK_FOR_UPD_DLG" #define HID_CHECK_FOR_UPD_CLOSE "EXTENSIONS_HID_CHECK_FOR_UPD_CLOSE" @@ -328,7 +317,6 @@ #define HID_CHECK_FOR_UPD_RESUME "EXTENSIONS_HID_CHECK_FOR_UPD_RESUME" #define HID_CHECK_FOR_UPD_DOWNLOAD "EXTENSIONS_HID_CHECK_FOR_UPD_DOWNLOAD" #define HID_CHECK_FOR_UPD_DOWNLOAD2 "EXTENSIONS_HID_CHECK_FOR_UPD_DOWNLOAD2" -#define HID_CHECK_FOR_UPD_INSTALL "EXTENSIONS_HID_CHECK_FOR_UPD_INSTALL" #define HID_CHECK_FOR_UPD_STATUS "EXTENSIONS_HID_CHECK_FOR_UPD_STATUS" #define HID_CHECK_FOR_UPD_DESCRIPTION "EXTENSIONS_HID_CHECK_FOR_UPD_DESCRIPTION" #define HID_CHECK_FOR_UPD_CANCEL "EXTENSIONS_HID_CHECK_FOR_UPD_CANCEL" diff --git a/extensions/inc/propctrlr.h b/extensions/inc/propctrlr.h index 9a819cc08c25..80e276b553c7 100644 --- a/extensions/inc/propctrlr.h +++ b/extensions/inc/propctrlr.h @@ -20,64 +20,66 @@ #ifndef EXTENSIONS_PROPCTRLR_H #define EXTENSIONS_PROPCTRLR_H -#define UID_PROP_DLG_FONT_TYPE "EXTENSIONS_UID_PROP_DLG_FONT_TYPE" -#define UID_PROP_DLG_IMAGE_URL "EXTENSIONS_UID_PROP_DLG_IMAGE_URL" -#define UID_PROP_DLG_BACKGROUNDCOLOR "EXTENSIONS_UID_PROP_DLG_BACKGROUNDCOLOR" -#define UID_PROP_DLG_SYMBOLCOLOR "EXTENSIONS_UID_PROP_DLG_SYMBOLCOLOR" -#define UID_PROP_DLG_ATTR_DATASOURCE "EXTENSIONS_UID_PROP_DLG_ATTR_DATASOURCE" -#define UID_PROP_DLG_ATTR_TARGET_URL "EXTENSIONS_UID_PROP_DLG_ATTR_TARGET_URL" -#define UID_PROP_DLG_NUMBER_FORMAT "EXTENSIONS_UID_PROP_DLG_NUMBER_FORMAT" -#define UID_PROP_DLG_CONTROLLABEL "EXTENSIONS_UID_PROP_DLG_CONTROLLABEL" -#define UID_PROP_DLG_FILLCOLOR "EXTENSIONS_UID_PROP_DLG_FILLCOLOR" -#define UID_PROP_DLG_TABINDEX "EXTENSIONS_UID_PROP_DLG_TABINDEX" -#define UID_PROP_DLG_SQLCOMMAND "EXTENSIONS_UID_PROP_DLG_SQLCOMMAND" -#define UID_PROP_DLG_FORMLINKFIELDS "EXTENSIONS_UID_PROP_DLG_FORMLINKFIELDS" -#define UID_PROP_DLG_FILTER "EXTENSIONS_UID_PROP_DLG_FILTER" -#define UID_PROP_DLG_ORDER "EXTENSIONS_UID_PROP_DLG_ORDER" -#define UID_PROP_DLG_SELECTION "EXTENSIONS_UID_PROP_DLG_SELECTION" -#define UID_PROP_DLG_BIND_EXPRESSION "EXTENSIONS_UID_PROP_DLG_BIND_EXPRESSION" -#define UID_PROP_DLG_XSD_REQUIRED "EXTENSIONS_UID_PROP_DLG_XSD_REQUIRED" -#define UID_PROP_DLG_XSD_RELEVANT "EXTENSIONS_UID_PROP_DLG_XSD_RELEVANT" -#define UID_PROP_DLG_XSD_READONLY "EXTENSIONS_UID_PROP_DLG_XSD_READONLY" -#define UID_PROP_DLG_XSD_CONSTRAINT "EXTENSIONS_UID_PROP_DLG_XSD_CONSTRAINT" -#define UID_PROP_DLG_XSD_CALCULATION "EXTENSIONS_UID_PROP_DLG_XSD_CALCULATION" -#define UID_PROP_ADD_DATA_TYPE "EXTENSIONS_UID_PROP_ADD_DATA_TYPE" -#define UID_PROP_REMOVE_DATA_TYPE "EXTENSIONS_UID_PROP_REMOVE_DATA_TYPE" -#define UID_PROP_DLG_BORDERCOLOR "EXTENSIONS_UID_PROP_DLG_BORDERCOLOR" +#include <rtl/ustring.hxx> -#define UID_BRWEVT_APPROVEACTIONPERFORMED "EXTENSIONS_UID_BRWEVT_APPROVEACTIONPERFORMED" -#define UID_BRWEVT_ACTIONPERFORMED "EXTENSIONS_UID_BRWEVT_ACTIONPERFORMED" -#define UID_BRWEVT_CHANGED "EXTENSIONS_UID_BRWEVT_CHANGED" -#define UID_BRWEVT_TEXTCHANGED "EXTENSIONS_UID_BRWEVT_TEXTCHANGED" -#define UID_BRWEVT_ITEMSTATECHANGED "EXTENSIONS_UID_BRWEVT_ITEMSTATECHANGED" -#define UID_BRWEVT_FOCUSGAINED "EXTENSIONS_UID_BRWEVT_FOCUSGAINED" -#define UID_BRWEVT_FOCUSLOST "EXTENSIONS_UID_BRWEVT_FOCUSLOST" -#define UID_BRWEVT_KEYTYPED "EXTENSIONS_UID_BRWEVT_KEYTYPED" -#define UID_BRWEVT_KEYUP "EXTENSIONS_UID_BRWEVT_KEYUP" -#define UID_BRWEVT_MOUSEENTERED "EXTENSIONS_UID_BRWEVT_MOUSEENTERED" -#define UID_BRWEVT_MOUSEDRAGGED "EXTENSIONS_UID_BRWEVT_MOUSEDRAGGED" -#define UID_BRWEVT_MOUSEMOVED "EXTENSIONS_UID_BRWEVT_MOUSEMOVED" -#define UID_BRWEVT_MOUSEPRESSED "EXTENSIONS_UID_BRWEVT_MOUSEPRESSED" -#define UID_BRWEVT_MOUSERELEASED "EXTENSIONS_UID_BRWEVT_MOUSERELEASED" -#define UID_BRWEVT_MOUSEEXITED "EXTENSIONS_UID_BRWEVT_MOUSEEXITED" -#define UID_BRWEVT_APPROVERESETTED "EXTENSIONS_UID_BRWEVT_APPROVERESETTED" -#define UID_BRWEVT_RESETTED "EXTENSIONS_UID_BRWEVT_RESETTED" -#define UID_BRWEVT_SUBMITTED "EXTENSIONS_UID_BRWEVT_SUBMITTED" -#define UID_BRWEVT_BEFOREUPDATE "EXTENSIONS_UID_BRWEVT_BEFOREUPDATE" -#define UID_BRWEVT_AFTERUPDATE "EXTENSIONS_UID_BRWEVT_AFTERUPDATE" -#define UID_BRWEVT_LOADED "EXTENSIONS_UID_BRWEVT_LOADED" -#define UID_BRWEVT_RELOADING "EXTENSIONS_UID_BRWEVT_RELOADING" -#define UID_BRWEVT_RELOADED "EXTENSIONS_UID_BRWEVT_RELOADED" -#define UID_BRWEVT_UNLOADING "EXTENSIONS_UID_BRWEVT_UNLOADING" -#define UID_BRWEVT_UNLOADED "EXTENSIONS_UID_BRWEVT_UNLOADED" -#define UID_BRWEVT_CONFIRMDELETE "EXTENSIONS_UID_BRWEVT_CONFIRMDELETE" -#define UID_BRWEVT_APPROVEROWCHANGE "EXTENSIONS_UID_BRWEVT_APPROVEROWCHANGE" -#define UID_BRWEVT_ROWCHANGE "EXTENSIONS_UID_BRWEVT_ROWCHANGE" -#define UID_BRWEVT_POSITIONING "EXTENSIONS_UID_BRWEVT_POSITIONING" -#define UID_BRWEVT_POSITIONED "EXTENSIONS_UID_BRWEVT_POSITIONED" -#define UID_BRWEVT_APPROVEPARAMETER "EXTENSIONS_UID_BRWEVT_APPROVEPARAMETER" -#define UID_BRWEVT_ERROROCCURRED "EXTENSIONS_UID_BRWEVT_ERROROCCURRED" -#define UID_BRWEVT_ADJUSTMENTVALUECHANGED "EXTENSIONS_UID_BRWEVT_ADJUSTMENTVALUECHANGED" +inline constexpr OUString UID_PROP_DLG_FONT_TYPE = u"EXTENSIONS_UID_PROP_DLG_FONT_TYPE"_ustr; +inline constexpr OUString UID_PROP_DLG_IMAGE_URL = u"EXTENSIONS_UID_PROP_DLG_IMAGE_URL"_ustr; +inline constexpr OUString UID_PROP_DLG_BACKGROUNDCOLOR = u"EXTENSIONS_UID_PROP_DLG_BACKGROUNDCOLOR"_ustr; +inline constexpr OUString UID_PROP_DLG_SYMBOLCOLOR = u"EXTENSIONS_UID_PROP_DLG_SYMBOLCOLOR"_ustr; +inline constexpr OUString UID_PROP_DLG_ATTR_DATASOURCE = u"EXTENSIONS_UID_PROP_DLG_ATTR_DATASOURCE"_ustr; +inline constexpr OUString UID_PROP_DLG_ATTR_TARGET_URL = u"EXTENSIONS_UID_PROP_DLG_ATTR_TARGET_URL"_ustr; +inline constexpr OUString UID_PROP_DLG_NUMBER_FORMAT = u"EXTENSIONS_UID_PROP_DLG_NUMBER_FORMAT"_ustr; +inline constexpr OUString UID_PROP_DLG_CONTROLLABEL = u"EXTENSIONS_UID_PROP_DLG_CONTROLLABEL"_ustr; +inline constexpr OUString UID_PROP_DLG_FILLCOLOR = u"EXTENSIONS_UID_PROP_DLG_FILLCOLOR"_ustr; +inline constexpr OUString UID_PROP_DLG_TABINDEX = u"EXTENSIONS_UID_PROP_DLG_TABINDEX"_ustr; +inline constexpr OUString UID_PROP_DLG_SQLCOMMAND = u"EXTENSIONS_UID_PROP_DLG_SQLCOMMAND"_ustr; +inline constexpr OUString UID_PROP_DLG_FORMLINKFIELDS = u"EXTENSIONS_UID_PROP_DLG_FORMLINKFIELDS"_ustr; +inline constexpr OUString UID_PROP_DLG_FILTER = u"EXTENSIONS_UID_PROP_DLG_FILTER"_ustr; +inline constexpr OUString UID_PROP_DLG_ORDER = u"EXTENSIONS_UID_PROP_DLG_ORDER"_ustr; +inline constexpr OUString UID_PROP_DLG_SELECTION = u"EXTENSIONS_UID_PROP_DLG_SELECTION"_ustr; +inline constexpr OUString UID_PROP_DLG_BIND_EXPRESSION = u"EXTENSIONS_UID_PROP_DLG_BIND_EXPRESSION"_ustr; +inline constexpr OUString UID_PROP_DLG_XSD_REQUIRED = u"EXTENSIONS_UID_PROP_DLG_XSD_REQUIRED"_ustr; +inline constexpr OUString UID_PROP_DLG_XSD_RELEVANT = u"EXTENSIONS_UID_PROP_DLG_XSD_RELEVANT"_ustr; +inline constexpr OUString UID_PROP_DLG_XSD_READONLY = u"EXTENSIONS_UID_PROP_DLG_XSD_READONLY"_ustr; +inline constexpr OUString UID_PROP_DLG_XSD_CONSTRAINT = u"EXTENSIONS_UID_PROP_DLG_XSD_CONSTRAINT"_ustr; +inline constexpr OUString UID_PROP_DLG_XSD_CALCULATION = u"EXTENSIONS_UID_PROP_DLG_XSD_CALCULATION"_ustr; +inline constexpr OUString UID_PROP_ADD_DATA_TYPE = u"EXTENSIONS_UID_PROP_ADD_DATA_TYPE"_ustr; +inline constexpr OUString UID_PROP_REMOVE_DATA_TYPE = u"EXTENSIONS_UID_PROP_REMOVE_DATA_TYPE"_ustr; +inline constexpr OUString UID_PROP_DLG_BORDERCOLOR = u"EXTENSIONS_UID_PROP_DLG_BORDERCOLOR"_ustr; + +inline constexpr OString UID_BRWEVT_APPROVEACTIONPERFORMED = "EXTENSIONS_UID_BRWEVT_APPROVEACTIONPERFORMED"_ostr; +inline constexpr OString UID_BRWEVT_ACTIONPERFORMED = "EXTENSIONS_UID_BRWEVT_ACTIONPERFORMED"_ostr; +inline constexpr OString UID_BRWEVT_CHANGED = "EXTENSIONS_UID_BRWEVT_CHANGED"_ostr; +inline constexpr OString UID_BRWEVT_TEXTCHANGED = "EXTENSIONS_UID_BRWEVT_TEXTCHANGED"_ostr; +inline constexpr OString UID_BRWEVT_ITEMSTATECHANGED = "EXTENSIONS_UID_BRWEVT_ITEMSTATECHANGED"_ostr; +inline constexpr OString UID_BRWEVT_FOCUSGAINED = "EXTENSIONS_UID_BRWEVT_FOCUSGAINED"_ostr; +inline constexpr OString UID_BRWEVT_FOCUSLOST = "EXTENSIONS_UID_BRWEVT_FOCUSLOST"_ostr; +inline constexpr OString UID_BRWEVT_KEYTYPED = "EXTENSIONS_UID_BRWEVT_KEYTYPED"_ostr; +inline constexpr OString UID_BRWEVT_KEYUP = "EXTENSIONS_UID_BRWEVT_KEYUP"_ostr; +inline constexpr OString UID_BRWEVT_MOUSEENTERED = "EXTENSIONS_UID_BRWEVT_MOUSEENTERED"_ostr; +inline constexpr OString UID_BRWEVT_MOUSEDRAGGED = "EXTENSIONS_UID_BRWEVT_MOUSEDRAGGED"_ostr; +inline constexpr OString UID_BRWEVT_MOUSEMOVED = "EXTENSIONS_UID_BRWEVT_MOUSEMOVED"_ostr; +inline constexpr OString UID_BRWEVT_MOUSEPRESSED = "EXTENSIONS_UID_BRWEVT_MOUSEPRESSED"_ostr; +inline constexpr OString UID_BRWEVT_MOUSERELEASED = "EXTENSIONS_UID_BRWEVT_MOUSERELEASED"_ostr; +inline constexpr OString UID_BRWEVT_MOUSEEXITED = "EXTENSIONS_UID_BRWEVT_MOUSEEXITED"_ostr; +inline constexpr OString UID_BRWEVT_APPROVERESETTED = "EXTENSIONS_UID_BRWEVT_APPROVERESETTED"_ostr; +inline constexpr OString UID_BRWEVT_RESETTED = "EXTENSIONS_UID_BRWEVT_RESETTED"_ostr; +inline constexpr OString UID_BRWEVT_SUBMITTED = "EXTENSIONS_UID_BRWEVT_SUBMITTED"_ostr; +inline constexpr OString UID_BRWEVT_BEFOREUPDATE = "EXTENSIONS_UID_BRWEVT_BEFOREUPDATE"_ostr; +inline constexpr OString UID_BRWEVT_AFTERUPDATE = "EXTENSIONS_UID_BRWEVT_AFTERUPDATE"_ostr; +inline constexpr OString UID_BRWEVT_LOADED = "EXTENSIONS_UID_BRWEVT_LOADED"_ostr; +inline constexpr OString UID_BRWEVT_RELOADING = "EXTENSIONS_UID_BRWEVT_RELOADING"_ostr; +inline constexpr OString UID_BRWEVT_RELOADED = "EXTENSIONS_UID_BRWEVT_RELOADED"_ostr; +inline constexpr OString UID_BRWEVT_UNLOADING = "EXTENSIONS_UID_BRWEVT_UNLOADING"_ostr; +inline constexpr OString UID_BRWEVT_UNLOADED = "EXTENSIONS_UID_BRWEVT_UNLOADED"_ostr; +inline constexpr OString UID_BRWEVT_CONFIRMDELETE = "EXTENSIONS_UID_BRWEVT_CONFIRMDELETE"_ostr; +inline constexpr OString UID_BRWEVT_APPROVEROWCHANGE = "EXTENSIONS_UID_BRWEVT_APPROVEROWCHANGE"_ostr; +inline constexpr OString UID_BRWEVT_ROWCHANGE = "EXTENSIONS_UID_BRWEVT_ROWCHANGE"_ostr; +inline constexpr OString UID_BRWEVT_POSITIONING = "EXTENSIONS_UID_BRWEVT_POSITIONING"_ostr; +inline constexpr OString UID_BRWEVT_POSITIONED = "EXTENSIONS_UID_BRWEVT_POSITIONED"_ostr; +inline constexpr OString UID_BRWEVT_APPROVEPARAMETER = "EXTENSIONS_UID_BRWEVT_APPROVEPARAMETER"_ostr; +inline constexpr OString UID_BRWEVT_ERROROCCURRED = "EXTENSIONS_UID_BRWEVT_ERROROCCURRED"_ostr; +inline constexpr OString UID_BRWEVT_ADJUSTMENTVALUECHANGED = "EXTENSIONS_UID_BRWEVT_ADJUSTMENTVALUECHANGED"_ostr; #endif // EXTENSIONS_PROPCTRLR_HRC diff --git a/extensions/inc/showhide.hrc b/extensions/inc/showhide.hrc index 5f96170a71f9..3b5a931419a2 100644 --- a/extensions/inc/showhide.hrc +++ b/extensions/inc/showhide.hrc @@ -20,7 +20,9 @@ #ifndef INCLUDED_EXTENSIONS_INC_SHOWHIDE_HRC #define INCLUDED_EXTENSIONS_INC_SHOWHIDE_HRC -#define NC_(Context, String) TranslateId(Context, reinterpret_cast<char const *>(u8##String)) +#include <unotools/resmgr.hxx> + +#define NC_(Context, String) TranslateId(Context, u8##String) namespace { diff --git a/extensions/inc/stringarrays.hrc b/extensions/inc/stringarrays.hrc index 2de092317cac..6eadf46cc42f 100644 --- a/extensions/inc/stringarrays.hrc +++ b/extensions/inc/stringarrays.hrc @@ -20,7 +20,9 @@ #ifndef INCLUDED_EXTENSIONS_INC_STRINGARRAYS_HRC #define INCLUDED_EXTENSIONS_INC_STRINGARRAYS_HRC -#define NC_(Context, String) TranslateId(Context, reinterpret_cast<char const *>(u8##String)) +#include <unotools/resmgr.hxx> + +#define NC_(Context, String) TranslateId(Context, u8##String) const TranslateId RID_RSC_ENUM_VERTICAL_ALIGN[] = { @@ -76,12 +78,6 @@ const TranslateId RID_RSC_ENUM_BUTTONTYPE[] = NC_("RID_RSC_ENUM_BUTTONTYPE", "Refresh form") }; -const TranslateId RID_RSC_ENUM_SUBMIT_METHOD[] = -{ - NC_("RID_RSC_ENUM_SUBMIT_METHOD", "Get"), - NC_("RID_RSC_ENUM_SUBMIT_METHOD", "Post" ) -}; - const TranslateId RID_RSC_ENUM_SUBMIT_ENCODING[] = { NC_("RID_RSC_ENUM_SUBMIT_ENCODING", "URL"), diff --git a/extensions/inc/strings.hrc b/extensions/inc/strings.hrc index 8d6ed0580256..a14f66ef78a2 100644 --- a/extensions/inc/strings.hrc +++ b/extensions/inc/strings.hrc @@ -22,7 +22,7 @@ #include <unotools/resmgr.hxx> -#define NC_(Context, String) TranslateId(Context, reinterpret_cast<char const *>(u8##String)) +#define NC_(Context, String) TranslateId(Context, u8##String) #define RID_STR_EDITMASK NC_("RID_STR_EDITMASK", "Edit mask") #define RID_STR_LITERALMASK NC_("RID_STR_LITERALMASK", "Literal mask") @@ -283,7 +283,7 @@ #define RID_STR_PROPTITLE_NUMERICFIELD NC_("RID_STR_PROPTITLE_NUMERICFIELD", "Numeric Field") #define RID_STR_PROPTITLE_CURRENCYFIELD NC_("RID_STR_PROPTITLE_CURRENCYFIELD", "Currency Field") #define RID_STR_PROPTITLE_PATTERNFIELD NC_("RID_STR_PROPTITLE_PATTERNFIELD", "Pattern Field") -#define RID_STR_PROPTITLE_DBGRID NC_("RID_STR_PROPTITLE_DBGRID", "Table Control ") +#define RID_STR_PROPTITLE_DBGRID NC_("RID_STR_PROPTITLE_DBGRID", "Table Control") #define STR_DETAIL_FORM NC_("STR_DETAIL_FORM", "Sub Form") #define STR_MASTER_FORM NC_("STR_MASTER_FORM", "Master Form") @@ -305,8 +305,6 @@ #define RID_UPDATE_STR_DOWNLOADING NC_("RID_UPDATE_STR_DOWNLOADING", "Downloading %PRODUCTNAME %NEXTVERSION...") #define RID_UPDATE_STR_READY_INSTALL NC_("RID_UPDATE_STR_READY_INSTALL", "Download of %PRODUCTNAME %NEXTVERSION completed. Ready for installation.") #define RID_UPDATE_STR_CANCEL_DOWNLOAD NC_("RID_UPDATE_STR_CANCEL_DOWNLOAD", "Do you really want to cancel the download?") -#define RID_UPDATE_STR_BEGIN_INSTALL NC_("RID_UPDATE_STR_BEGIN_INSTALL", "To install the update, %PRODUCTNAME %PRODUCTVERSION needs to be closed. Do you want to install the update now?") -#define RID_UPDATE_STR_INSTALL_ERROR NC_("RID_UPDATE_STR_INSTALL_ERROR", "Could not run the installer application, please run %FILE_NAME in %DOWNLOAD_PATH manually.") #define RID_UPDATE_STR_OVERWRITE_WARNING NC_("RID_UPDATE_STR_OVERWRITE_WARNING", "A file with that name already exists! Do you want to overwrite the existing file?") #define RID_UPDATE_STR_RELOAD_WARNING NC_("RID_UPDATE_STR_RELOAD_WARNING", "A file with the name '%FILENAME' already exists in '%DOWNLOAD_PATH'! Do you want to continue with the download or delete and reload the file?") #define RID_UPDATE_STR_RELOAD_RELOAD NC_("RID_UPDATE_STR_RELOAD_RELOAD", "Reload File") @@ -316,7 +314,6 @@ #define RID_UPDATE_FT_DESCRIPTION NC_("RID_UPDATE_FT_DESCRIPTION", "Description") #define RID_UPDATE_BTN_CLOSE NC_("RID_UPDATE_BTN_CLOSE", "Close") #define RID_UPDATE_BTN_DOWNLOAD NC_("RID_UPDATE_BTN_DOWNLOAD", "~Download") -#define RID_UPDATE_BTN_INSTALL NC_("RID_UPDATE_BTN_INSTALL", "~Install") #define RID_UPDATE_BTN_PAUSE NC_("RID_UPDATE_BTN_PAUSE", "~Pause") #define RID_UPDATE_BTN_RESUME NC_("RID_UPDATE_BTN_RESUME", "~Resume") #define RID_UPDATE_BTN_CANCEL NC_("RID_UPDATE_BTN_CANCEL", "Cancel") diff --git a/extensions/inc/yesno.hrc b/extensions/inc/yesno.hrc index 32792bb81300..d205e604c495 100644 --- a/extensions/inc/yesno.hrc +++ b/extensions/inc/yesno.hrc @@ -22,7 +22,7 @@ #include <unotools/resmgr.hxx> -#define NC_(Context, String) TranslateId(Context, reinterpret_cast<char const *>(u8##String)) +#define NC_(Context, String) TranslateId(Context, u8##String) namespace { diff --git a/extensions/qa/bibliography/bibliography.cxx b/extensions/qa/bibliography/bibliography.cxx index af68ee95eb70..3919b787f3fe 100644 --- a/extensions/qa/bibliography/bibliography.cxx +++ b/extensions/qa/bibliography/bibliography.cxx @@ -39,7 +39,7 @@ CPPUNIT_TEST_FIXTURE(Test, testBibliographyLoader) // Without the accompanying fix in place, this test would have failed, as the last column // (LOCAL_URL) had an empty field name: - for (const auto& rPair : std::as_const(aSeq)) + for (const auto& rPair : aSeq) { CPPUNIT_ASSERT(!rPair.Name.isEmpty()); } diff --git a/extensions/qa/update/test_update.cxx b/extensions/qa/update/test_update.cxx index f99855dc6198..27d634b3b374 100644 --- a/extensions/qa/update/test_update.cxx +++ b/extensions/qa/update/test_update.cxx @@ -37,8 +37,7 @@ public: m_xProvider = deployment::UpdateInformationProvider::create( m_xContext ); // repositories that we will be checking - m_aRepositoryList.realloc( 1 ); - m_aRepositoryList[0] = m_directories.getURLFromSrc( u"/extensions/qa/update/simple.xml" ); + m_aRepositoryList = { m_directories.getURLFromSrc( u"/extensions/qa/update/simple.xml" ) }; } virtual void tearDown() override diff --git a/extensions/source/abpilot/abpfinalpage.cxx b/extensions/source/abpilot/abpfinalpage.cxx index 028a08413bb0..c75f9cc5b168 100644 --- a/extensions/source/abpilot/abpfinalpage.cxx +++ b/extensions/source/abpilot/abpfinalpage.cxx @@ -27,13 +27,10 @@ #include <unotools/pathoptions.hxx> #include <svl/filenotation.hxx> #include <sfx2/docfilt.hxx> +#include <o3tl/string_view.hxx> namespace abp { - - using namespace ::svt; - using namespace ::utl; - static std::shared_ptr<const SfxFilter> lcl_getBaseFilter() { std::shared_ptr<const SfxFilter> pFilter = SfxFilter::GetFilterByName("StarOffice XML (Base)"); @@ -94,14 +91,14 @@ namespace abp INetURLObject aURL( rSettings.sDataSourceName ); if( aURL.GetProtocol() == INetProtocol::NotValid ) { - OUString sPath = SvtPathOptions().GetWorkPath(); - sPath += "/" + rSettings.sDataSourceName; + OUString sPath = SvtPathOptions().GetWorkPath() + + "/" + rSettings.sDataSourceName; std::shared_ptr<const SfxFilter> pFilter = lcl_getBaseFilter(); if ( pFilter ) { OUString sExt = pFilter->GetDefaultExtension(); - sPath += sExt.getToken(1,'*'); + sPath += o3tl::getToken(sExt,1,'*'); } aURL.SetURL(sPath); @@ -113,7 +110,7 @@ namespace abp sal_Int32 nPos = sName.indexOf(aURL.GetFileExtension()); if ( nPos != -1 ) { - sName = sName.replaceAt(nPos-1, 4, ""); + sName = sName.replaceAt(nPos-1, 4, u""); } m_xName->set_text(sName); diff --git a/extensions/source/abpilot/abspage.cxx b/extensions/source/abpilot/abspage.cxx index ee36cee27ab1..fbe338ea56c8 100644 --- a/extensions/source/abpilot/abspage.cxx +++ b/extensions/source/abpilot/abspage.cxx @@ -23,9 +23,8 @@ namespace abp { using namespace ::com::sun::star::uno; - using namespace ::com::sun::star::lang; - AddressBookSourcePage::AddressBookSourcePage(weld::Container* pPage, OAddressBookSourcePilot* pDialog, const OUString& rUIXMLDescription, const OString& rID) + AddressBookSourcePage::AddressBookSourcePage(weld::Container* pPage, OAddressBookSourcePilot* pDialog, const OUString& rUIXMLDescription, const OUString& rID) : AddressBookSourcePage_Base(pPage, pDialog, rUIXMLDescription, rID) , m_pDialog(pDialog) { diff --git a/extensions/source/abpilot/abspage.hxx b/extensions/source/abpilot/abspage.hxx index 4d78533ad885..407713fab99d 100644 --- a/extensions/source/abpilot/abspage.hxx +++ b/extensions/source/abpilot/abspage.hxx @@ -37,7 +37,7 @@ namespace abp OAddressBookSourcePilot* m_pDialog; protected: - AddressBookSourcePage(weld::Container* pPage, OAddressBookSourcePilot* pController, const OUString& rUIXMLDescription, const OString& rID); + AddressBookSourcePage(weld::Container* pPage, OAddressBookSourcePilot* pController, const OUString& rUIXMLDescription, const OUString& rID); protected: // helper diff --git a/extensions/source/abpilot/abspilot.cxx b/extensions/source/abpilot/abspilot.cxx index 0a5cba073f0b..fc135ec80c8f 100644 --- a/extensions/source/abpilot/abspilot.cxx +++ b/extensions/source/abpilot/abspilot.cxx @@ -50,7 +50,6 @@ namespace abp #define PATH_NO_SETTINGS_NO_FIELDS 4 using namespace ::com::sun::star::uno; - using namespace ::com::sun::star::lang; OAddressBookSourcePilot::OAddressBookSourcePilot(weld::Window* _pParent, const Reference< XComponentContext >& _rxORB) :OAddressBookSourcePilot_Base( _pParent ) @@ -361,7 +360,7 @@ namespace abp std::unique_ptr<BuilderPage> OAddressBookSourcePilot::createPage(WizardState _nState) { - OString sIdent(OString::number(_nState)); + OUString sIdent(OUString::number(_nState)); weld::Container* pPageContainer = m_xAssistant->append_page(sIdent); std::unique_ptr<vcl::OWizardPage> xRet; diff --git a/extensions/source/abpilot/admininvokationimpl.cxx b/extensions/source/abpilot/admininvokationimpl.cxx index c8ec00b681a7..7e919c7e7ce0 100644 --- a/extensions/source/abpilot/admininvokationimpl.cxx +++ b/extensions/source/abpilot/admininvokationimpl.cxx @@ -18,7 +18,7 @@ */ #include "admininvokationimpl.hxx" -#include <tools/diagnose_ex.h> +#include <comphelper/diagnose_ex.hxx> #include <tools/debug.hxx> #include <com/sun/star/ui/dialogs/XExecutableDialog.hpp> #include <com/sun/star/awt/XWindow.hpp> @@ -26,6 +26,7 @@ #include <comphelper/propertysequence.hxx> #include <strings.hrc> #include <componentmodule.hxx> +#include <utility> #include <vcl/stdtext.hxx> #include <vcl/weld.hxx> @@ -36,15 +37,14 @@ namespace abp using namespace ::com::sun::star::uno; using namespace ::com::sun::star::lang; using namespace ::com::sun::star::beans; - using namespace ::com::sun::star::awt; using namespace ::com::sun::star::ui::dialogs; using namespace ::com::sun::star::sdbc; OAdminDialogInvokation::OAdminDialogInvokation(const Reference< XComponentContext >& _rxContext, - const css::uno::Reference< css::beans::XPropertySet >& _rxDataSource, + css::uno::Reference< css::beans::XPropertySet > _xDataSource, weld::Window* _pMessageParent) :m_xContext(_rxContext) - ,m_xDataSource(_rxDataSource) + ,m_xDataSource(std::move(_xDataSource)) ,m_pMessageParent(_pMessageParent) { DBG_ASSERT(m_xContext.is(), "OAdminDialogInvokation::OAdminDialogInvokation: invalid service factory!"); diff --git a/extensions/source/abpilot/admininvokationimpl.hxx b/extensions/source/abpilot/admininvokationimpl.hxx index 2003809c8727..fef7a11eb388 100644 --- a/extensions/source/abpilot/admininvokationimpl.hxx +++ b/extensions/source/abpilot/admininvokationimpl.hxx @@ -40,7 +40,7 @@ namespace abp public: OAdminDialogInvokation( const css::uno::Reference< css::uno::XComponentContext >& _rxContext, - const css::uno::Reference< css::beans::XPropertySet >& _rDataSource, + css::uno::Reference< css::beans::XPropertySet > _xDataSource, weld::Window* _pMessageParent ); diff --git a/extensions/source/abpilot/datasourcehandling.cxx b/extensions/source/abpilot/datasourcehandling.cxx index 806acca41f16..c26066b8daaa 100644 --- a/extensions/source/abpilot/datasourcehandling.cxx +++ b/extensions/source/abpilot/datasourcehandling.cxx @@ -43,7 +43,7 @@ #include <comphelper/interaction.hxx> #include <comphelper/processfactory.hxx> #include <tools/debug.hxx> -#include <tools/diagnose_ex.h> +#include <comphelper/diagnose_ex.hxx> #include <unotools/sharedunocomponent.hxx> #include <vcl/stdtext.hxx> #include <vcl/weld.hxx> @@ -141,7 +141,7 @@ namespace abp { xNewDataSource->setPropertyValue( "URL", - makeAny( OUString::createFromAscii( _pInitialAsciiURL ) ) + Any( OUString::createFromAscii( _pInitialAsciiURL ) ) ); } @@ -199,12 +199,8 @@ namespace abp m_pImpl->xContext.set( lcl_getDataSourceContext( _rxORB ), UNO_QUERY_THROW ); // collect the data source names - Sequence< OUString > aDSNames = m_pImpl->xContext->getElementNames(); - const OUString* pDSNames = aDSNames.getConstArray(); - const OUString* pDSNamesEnd = pDSNames + aDSNames.getLength(); - - for ( ;pDSNames != pDSNamesEnd; ++pDSNames ) - m_pImpl->aDataSourceNames.insert( *pDSNames ); + for (auto& rDSName : m_pImpl->xContext->getElementNames()) + m_pImpl->aDataSourceNames.insert(rDSName); } catch( const Exception& ) { @@ -360,9 +356,9 @@ namespace abp uno::Reference<embed::XStorage> xStorage = pObjectShell->GetStorage(); uno::Sequence<beans::PropertyValue> aSequence = comphelper::InitPropertySequence( { - {"TargetStorage", uno::makeAny(xStorage)}, - {"StreamRelPath", uno::makeAny(aStreamRelPath)}, - {"BaseURI", uno::makeAny(aOwnURL)} + {"TargetStorage", uno::Any(xStorage)}, + {"StreamRelPath", uno::Any(aStreamRelPath)}, + {"BaseURI", uno::Any(aOwnURL)} }); xStorable->storeAsURL(sTmpName, aSequence); m_pImpl->sName = sTmpName; @@ -371,7 +367,7 @@ namespace abp // we can load it again next time the file is imported. uno::Reference<lang::XMultiServiceFactory> xFactory(pObjectShell->GetModel(), uno::UNO_QUERY); uno::Reference<beans::XPropertySet> xPropertySet(xFactory->createInstance("com.sun.star.document.Settings"), uno::UNO_QUERY); - xPropertySet->setPropertyValue("EmbeddedDatabaseName", uno::makeAny(aStreamRelPath)); + xPropertySet->setPropertyValue("EmbeddedDatabaseName", uno::Any(aStreamRelPath)); } } } @@ -487,10 +483,8 @@ namespace abp aTableNames = xTables->getElementNames( ); // copy the names - const OUString* pTableNames = aTableNames.getConstArray(); - const OUString* pTableNamesEnd = pTableNames + aTableNames.getLength(); - for (;pTableNames < pTableNamesEnd; ++pTableNames) - m_pImpl->aTables.insert( *pTableNames ); + for (auto& rTableName : aTableNames) + m_pImpl->aTables.insert(rTableName); } catch(const Exception&) { @@ -558,17 +552,17 @@ namespace abp if ( aException.Message.isEmpty() ) { // prepend some context info - SQLContext aDetailedError; - aDetailedError.Message = compmodule::ModuleRes(RID_STR_NOCONNECTION); - aDetailedError.Details = compmodule::ModuleRes(RID_STR_PLEASECHECKSETTINGS); - aDetailedError.NextException = aError; + SQLContext aDetailedError(compmodule::ModuleRes(RID_STR_NOCONNECTION), // message + {}, {}, 0, + aError, // next exception + compmodule::ModuleRes(RID_STR_PLEASECHECKSETTINGS)); // details // handle (aka display) the new context info - xInteractions->handle( new OInteractionRequest( makeAny( aDetailedError ) ) ); + xInteractions->handle( new OInteractionRequest( Any( aDetailedError ) ) ); } else { // handle (aka display) the original error - xInteractions->handle( new OInteractionRequest( makeAny( aException ) ) ); + xInteractions->handle( new OInteractionRequest( Any( aException ) ) ); } } catch( const Exception& ) diff --git a/extensions/source/abpilot/datasourcehandling.hxx b/extensions/source/abpilot/datasourcehandling.hxx index 485c3c15bd90..c6058e45e30a 100644 --- a/extensions/source/abpilot/datasourcehandling.hxx +++ b/extensions/source/abpilot/datasourcehandling.hxx @@ -163,7 +163,7 @@ namespace abp */ bool hasTable( const OUString& _rTableName ) const; - /// return the intern data source object + /// return the internal data source object css::uno::Reference< css::beans::XPropertySet > getDataSource() const; diff --git a/extensions/source/abpilot/fieldmappingimpl.cxx b/extensions/source/abpilot/fieldmappingimpl.cxx index 43a75cf19ee4..3b54e7504f1d 100644 --- a/extensions/source/abpilot/fieldmappingimpl.cxx +++ b/extensions/source/abpilot/fieldmappingimpl.cxx @@ -24,13 +24,12 @@ #include <com/sun/star/awt/XWindow.hpp> #include <com/sun/star/sdb/CommandType.hpp> #include <tools/debug.hxx> -#include <tools/diagnose_ex.h> +#include <comphelper/diagnose_ex.hxx> #include <vcl/weld.hxx> #include <com/sun/star/util/AliasProgrammaticPair.hpp> #include <strings.hrc> #include <componentmodule.hxx> #include <unotools/confignode.hxx> -#include <sal/macros.h> #include <sal/log.hxx> @@ -50,7 +49,7 @@ namespace abp const char16_t sDriverSettingsNodeName[] = u"/org.openoffice.Office.DataAccess/DriverSettings/com.sun.star.comp.sdbc.MozabDriver"; - constexpr OUStringLiteral sAddressBookNodeName = u"/org.openoffice.Office.DataAccess/AddressBook"; + constexpr OUString sAddressBookNodeName = u"/org.openoffice.Office.DataAccess/AddressBook"_ustr; namespace fieldmapping { @@ -91,10 +90,8 @@ namespace abp DBG_ASSERT( bSuccess, "fieldmapping::invokeDialog: invalid property type for FieldMapping!" ); // and copy it into the map - const AliasProgrammaticPair* pMapping = aMapping.getConstArray(); - const AliasProgrammaticPair* pMappingEnd = pMapping + aMapping.getLength(); - for (;pMapping != pMappingEnd; ++pMapping) - _rSettings.aFieldMapping[ pMapping->ProgrammaticName ] = pMapping->Alias; + for (auto& rMapping : aMapping) + _rSettings.aFieldMapping[rMapping.ProgrammaticName] = rMapping.Alias; return true; } @@ -162,10 +159,10 @@ namespace abp _rxContext, sDriverAliasesNodeName, -1, OConfigurationTreeRoot::CM_READONLY); // loop through all programmatic pairs - DBG_ASSERT( 0 == SAL_N_ELEMENTS( pMappingProgrammatics ) % 2, + DBG_ASSERT( 0 == std::size( pMappingProgrammatics ) % 2, "fieldmapping::defaultMapping: invalid programmatic map!" ); // number of pairs - sal_Int32 const nIntersectedProgrammatics = SAL_N_ELEMENTS( pMappingProgrammatics ) / 2; + sal_Int32 const nIntersectedProgrammatics = std::size( pMappingProgrammatics ) / 2; const char** pProgrammatic = pMappingProgrammatics; OUString sAddressProgrammatic; @@ -215,37 +212,33 @@ namespace abp OConfigurationNode aFields = aAddressBookSettings.openNode( OUString( "Fields" ) ); // loop through all existent fields - Sequence< OUString > aExistentFields = aFields.getNodeNames(); - const OUString* pExistentFields = aExistentFields.getConstArray(); - const OUString* pExistentFieldsEnd = pExistentFields + aExistentFields.getLength(); + static constexpr OUString sProgrammaticNodeName( u"ProgrammaticFieldName"_ustr ); + static constexpr OUString sAssignedNodeName( u"AssignedFieldName"_ustr ); - static const OUStringLiteral sProgrammaticNodeName( u"ProgrammaticFieldName" ); - static const OUStringLiteral sAssignedNodeName( u"AssignedFieldName" ); - - for ( ; pExistentFields != pExistentFieldsEnd; ++pExistentFields ) + for (auto& rExistentField : aFields.getNodeNames()) { SAL_WARN_IF( - ((aFields.openNode(*pExistentFields) + ((aFields.openNode(rExistentField) .getNodeValue(sProgrammaticNodeName).get<OUString>()) - != *pExistentFields), + != rExistentField), "extensions.abpilot", "fieldmapping::writeTemplateAddressFieldMapping: inconsistent config data!"); // there should be a redundancy in the config data... if this asserts, there isn't anymore! // do we have a new alias for the programmatic? - MapString2String::iterator aPos = aFieldAssignment.find( *pExistentFields ); + MapString2String::iterator aPos = aFieldAssignment.find(rExistentField); if ( aFieldAssignment.end() != aPos ) { // yes // -> set a new value - OConfigurationNode aExistentField = aFields.openNode( *pExistentFields ); - aExistentField.setNodeValue( sAssignedNodeName, makeAny( aPos->second ) ); + OConfigurationNode aExistentField = aFields.openNode(rExistentField); + aExistentField.setNodeValue( sAssignedNodeName, Any( aPos->second ) ); // and remove the mapping entry - aFieldAssignment.erase( *pExistentFields ); + aFieldAssignment.erase(rExistentField); } else { // no // -> remove it - aFields.removeNode( *pExistentFields ); + aFields.removeNode(rExistentField); } } @@ -258,8 +251,8 @@ namespace abp // in case the config node for the fields already has the node named <aNewMapping->first>, // the entry should have been removed from aNewMapping (in the above loop) OConfigurationNode aNewField = aFields.createNode( elem.first ); - aNewField.setNodeValue( sProgrammaticNodeName, makeAny( elem.first ) ); - aNewField.setNodeValue( sAssignedNodeName, makeAny( elem.second ) ); + aNewField.setNodeValue( sProgrammaticNodeName, Any( elem.first ) ); + aNewField.setNodeValue( sAssignedNodeName, Any( elem.second ) ); } // commit the changes done @@ -283,9 +276,9 @@ namespace abp OConfigurationTreeRoot aAddressBookSettings = OConfigurationTreeRoot::createWithComponentContext( _rxContext, sAddressBookNodeName); - aAddressBookSettings.setNodeValue( OUString( "DataSourceName" ), makeAny( _rDataSourceName ) ); - aAddressBookSettings.setNodeValue( OUString( "Command" ), makeAny( _rTableName ) ); - aAddressBookSettings.setNodeValue( OUString( "CommandType" ), makeAny( sal_Int16(CommandType::TABLE) ) ); + aAddressBookSettings.setNodeValue( OUString( "DataSourceName" ), Any( _rDataSourceName ) ); + aAddressBookSettings.setNodeValue( OUString( "Command" ), Any( _rTableName ) ); + aAddressBookSettings.setNodeValue( OUString( "CommandType" ), Any( sal_Int16(CommandType::TABLE) ) ); // commit the changes done aAddressBookSettings.commit(); @@ -301,7 +294,7 @@ namespace abp _rxContext, sAddressBookNodeName); // set the flag - aAddressBookSettings.setNodeValue( OUString( "AutoPilotCompleted" ), makeAny( true ) ); + aAddressBookSettings.setNodeValue( OUString( "AutoPilotCompleted" ), Any( true ) ); // commit the changes done aAddressBookSettings.commit(); diff --git a/extensions/source/abpilot/typeselectionpage.cxx b/extensions/source/abpilot/typeselectionpage.cxx index 79cfd5d6b035..8db9f5a2ae43 100644 --- a/extensions/source/abpilot/typeselectionpage.cxx +++ b/extensions/source/abpilot/typeselectionpage.cxx @@ -107,13 +107,13 @@ namespace abp #endif // Items are displayed in list order - m_aAllTypes.push_back( ButtonItem( m_xEvolution.get(), AST_EVOLUTION, bHaveEvolution ) ); - m_aAllTypes.push_back( ButtonItem( m_xEvolutionGroupwise.get(), AST_EVOLUTION_GROUPWISE, bHaveEvolution ) ); - m_aAllTypes.push_back( ButtonItem( m_xEvolutionLdap.get(), AST_EVOLUTION_LDAP, bHaveEvolution ) ); - m_aAllTypes.push_back( ButtonItem( m_xThunderbird.get(), AST_THUNDERBIRD, true ) ); - m_aAllTypes.push_back( ButtonItem( m_xKab.get(), AST_KAB, bHaveKab ) ); - m_aAllTypes.push_back( ButtonItem( m_xMacab.get(), AST_MACAB, bHaveMacab ) ); - m_aAllTypes.push_back( ButtonItem( m_xOther.get(), AST_OTHER, true ) ); + m_aAllTypes.emplace_back(m_xEvolution.get(), AST_EVOLUTION, bHaveEvolution); + m_aAllTypes.emplace_back(m_xEvolutionGroupwise.get(), AST_EVOLUTION_GROUPWISE, bHaveEvolution); + m_aAllTypes.emplace_back(m_xEvolutionLdap.get(), AST_EVOLUTION_LDAP, bHaveEvolution); + m_aAllTypes.emplace_back(m_xThunderbird.get(), AST_THUNDERBIRD, true); + m_aAllTypes.emplace_back(m_xKab.get(), AST_KAB, bHaveKab); + m_aAllTypes.emplace_back(m_xMacab.get(), AST_MACAB, bHaveMacab); + m_aAllTypes.emplace_back(m_xOther.get(), AST_OTHER, true); Link<weld::Toggleable&,void> aTypeSelectionHandler = LINK(this, TypeSelectionPage, OnTypeSelected ); for (auto const& elem : m_aAllTypes) diff --git a/extensions/source/abpilot/unodialogabp.cxx b/extensions/source/abpilot/unodialogabp.cxx index a9836d910535..9608f2551f2b 100644 --- a/extensions/source/abpilot/unodialogabp.cxx +++ b/extensions/source/abpilot/unodialogabp.cxx @@ -31,7 +31,6 @@ namespace abp { using namespace ::com::sun::star; using namespace ::com::sun::star::uno; - using namespace ::com::sun::star::lang; using namespace ::com::sun::star::beans; using namespace ::com::sun::star::ui::dialogs; @@ -105,8 +104,8 @@ namespace abp { Reference<awt::XWindow> xParentWindow; if (aArguments.getLength() == 1 && (aArguments[0] >>= xParentWindow) ) { - Sequence< Any > aNewArgs(1); - aNewArgs[0] <<= PropertyValue( "ParentWindow", 0, makeAny(xParentWindow), PropertyState_DIRECT_VALUE ); + Sequence< Any > aNewArgs{ Any(PropertyValue( + "ParentWindow", 0, Any(xParentWindow), PropertyState_DIRECT_VALUE )) }; OGenericUnoDialog::initialize(aNewArgs); } else { OGenericUnoDialog::initialize(aArguments); @@ -129,8 +128,8 @@ namespace abp // User has one chance to accept it or not. // (or he can start it again by using wizard-menu!) // So we should deregister it on our general job execution service by using right protocol parameters. - css::uno::Sequence< css::beans::NamedValue > lProtocol { { "Deactivate", css::uno::makeAny( true ) } }; - return makeAny( lProtocol ); + css::uno::Sequence< css::beans::NamedValue > lProtocol { { "Deactivate", css::uno::Any( true ) } }; + return Any( lProtocol ); } void OABSPilotUno::executedDialog(sal_Int16 _nExecutionResult) diff --git a/extensions/source/activex/SOActionsApproval.cxx b/extensions/source/activex/SOActionsApproval.cxx index a4092166272b..6fd6d0888141 100644 --- a/extensions/source/activex/SOActionsApproval.cxx +++ b/extensions/source/activex/SOActionsApproval.cxx @@ -17,7 +17,7 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -// SOActionsApproval.cpp : Implementation of CHelpApp and DLL registration. +// SOActionsApproval.cxx : Implementation of CHelpApp and DLL registration. #include <sal/config.h> @@ -25,33 +25,14 @@ #include "StdAfx2.h" +#include <so_activex.h> #include "SOActionsApproval.h" #include <sal/macros.h> -#if defined __clang__ -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wnon-virtual-dtor" -#endif -#include <so_activex.h> -#if defined __clang__ -#pragma clang diagnostic pop -#endif - COM_DECLSPEC_NOTHROW STDMETHODIMP SOActionsApproval::InterfaceSupportsErrorInfo(REFIID riid) { - static const IID* arr[] = { - &IID_ISOActionsApproval, - }; - - for (std::size_t i = 0; i < SAL_N_ELEMENTS(arr); i++) - { -#ifdef _MSC_VER - if (InlineIsEqualGUID(*arr[i], riid)) -#else - if (::ATL::InlineIsEqualGUID(*arr[i], riid)) -#endif - return S_OK; - } + if (InlineIsEqualGUID(IID_ISOActionsApproval, riid)) + return S_OK; return S_FALSE; } diff --git a/extensions/source/activex/SOActionsApproval.h b/extensions/source/activex/SOActionsApproval.h index 2484e74620dd..9b8f4c1e992e 100644 --- a/extensions/source/activex/SOActionsApproval.h +++ b/extensions/source/activex/SOActionsApproval.h @@ -32,14 +32,7 @@ #include <atlctl.h> -#if defined __clang__ -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wnon-virtual-dtor" -#endif #include <so_activex.h> -#if defined __clang__ -#pragma clang diagnostic pop -#endif // SOActionsApproval diff --git a/extensions/source/activex/SOActiveX.cxx b/extensions/source/activex/SOActiveX.cxx index 6e102cf51202..b72ab0d66ca0 100644 --- a/extensions/source/activex/SOActiveX.cxx +++ b/extensions/source/activex/SOActiveX.cxx @@ -20,21 +20,13 @@ // SOActiveX.cpp : Implementation of CSOActiveX #include "StdAfx2.h" +#include <so_activex.h> #include "SOActiveX.h" #include "SOComWindowPeer.h" #include "SODispatchInterceptor.h" #include "SOActionsApproval.h" #include "com_uno_helper.h" -#if defined __clang__ -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wnon-virtual-dtor" -#endif -#include <so_activex.h> -#if defined __clang__ -#pragma clang diagnostic pop -#endif - #define STAROFFICE_WINDOWCLASS L"SOParentWindow" @@ -359,7 +351,7 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CSOActiveX::Load( LPPROPERTYBAG pPropBag, LPER // all information from the 'object' tag is in strings if (aVal[ind].vt == VT_BSTR && !wcscmp(aPropNames[ind].pstrName, L"src")) { - mCurFileUrl = wcsdup( aVal[ind].bstrVal ); + mCurFileUrl.AssignBSTR(aVal[ind].bstrVal); } else if( aVal[ind].vt == VT_BSTR && !wcscmp(aPropNames[ind].pstrName, L"readonly")) @@ -384,16 +376,10 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CSOActiveX::Load( LPPROPERTYBAG pPropBag, LPER return hr; mbReadyForActivation = FALSE; - if (BSTR bStrUrl = SysAllocString(mCurFileUrl)) - { - hr = CBindStatusCallback<CSOActiveX>::Download( - this, &CSOActiveX::CallbackCreateXInputStream, bStrUrl, m_spClientSite, FALSE); - SysFreeString(bStrUrl); - if (hr == MK_S_ASYNCHRONOUS) - hr = S_OK; - } - else - hr = E_OUTOFMEMORY; + hr = CBindStatusCallback<CSOActiveX>::Download( + this, &CSOActiveX::CallbackCreateXInputStream, mCurFileUrl, m_spClientSite, FALSE); + if (hr == MK_S_ASYNCHRONOUS) + hr = S_OK; if ( !SUCCEEDED( hr ) ) { @@ -801,13 +787,6 @@ HRESULT CSOActiveX::LoadURLToFrame( ) HRESULT hr = CallDispatchMethod( mCurFileUrl, aArgNames, aArgVals, nCount ); if( !SUCCEEDED( hr ) ) return hr; - CComVariant aBarName( L"MenuBarVisible" ); - CComVariant aBarVis; - aBarVis.vt = VT_BOOL; aBarVis.boolVal = VARIANT_FALSE; - hr = CallDispatchMethod( L"slot:6661", &aBarName, &aBarVis, 1 ); - // does not work for some documents, but it is no error - // if( !SUCCEEDED( hr ) ) return hr; - // try to get the model and set the presentation specific property, the setting will fail for other document formats CComPtr<IDispatch> pdispController; hr = GetIDispByFunc( mpDispFrame, L"getController", nullptr, 0, pdispController ); diff --git a/extensions/source/activex/SOActiveX.h b/extensions/source/activex/SOActiveX.h index f3a66e183ed5..49f33d796047 100644 --- a/extensions/source/activex/SOActiveX.h +++ b/extensions/source/activex/SOActiveX.h @@ -29,14 +29,7 @@ #include <atlctl.h> -#if defined __clang__ -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wnon-virtual-dtor" -#endif #include <so_activex.h> -#if defined __clang__ -#pragma clang diagnostic pop -#endif class SODispatchInterceptor; @@ -81,7 +74,7 @@ protected: CComPtr<IDispatch> mpDispFrame; CComPtr<IDispatch> mpInstanceLocker; CComPtr<IDispatch> mpDispWin; - OLECHAR const * mCurFileUrl; + CComBSTR mCurFileUrl; BOOL mbLoad; BOOL mbViewOnly; WNDCLASSW mPWinClass; diff --git a/extensions/source/activex/SOComWindowPeer.cxx b/extensions/source/activex/SOComWindowPeer.cxx index 0a556466d32f..59510c24a7a7 100644 --- a/extensions/source/activex/SOComWindowPeer.cxx +++ b/extensions/source/activex/SOComWindowPeer.cxx @@ -17,40 +17,21 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -// SOComWindowPeer.cpp : Implementation of CHelpApp and DLL registration. +// SOComWindowPeer.cxx : Implementation of CHelpApp and DLL registration. #include <sal/config.h> #include <cstddef> #include "StdAfx2.h" +#include <so_activex.h> #include "SOComWindowPeer.h" #include <sal/macros.h> -#if defined __clang__ -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wnon-virtual-dtor" -#endif -#include <so_activex.h> -#if defined __clang__ -#pragma clang diagnostic pop -#endif - COM_DECLSPEC_NOTHROW STDMETHODIMP SOComWindowPeer::InterfaceSupportsErrorInfo(REFIID riid) { - static const IID* arr[] = { - &IID_ISOComWindowPeer, - }; - - for (std::size_t i = 0; i < SAL_N_ELEMENTS(arr); i++) - { -#ifdef _MSC_VER - if (InlineIsEqualGUID(*arr[i], riid)) -#else - if (::ATL::InlineIsEqualGUID(*arr[i], riid)) -#endif - return S_OK; - } + if (InlineIsEqualGUID(IID_ISOComWindowPeer, riid)) + return S_OK; return S_FALSE; } diff --git a/extensions/source/activex/SOComWindowPeer.h b/extensions/source/activex/SOComWindowPeer.h index 379ca767a66a..58136e813637 100644 --- a/extensions/source/activex/SOComWindowPeer.h +++ b/extensions/source/activex/SOComWindowPeer.h @@ -32,14 +32,7 @@ #include <atlctl.h> -#if defined __clang__ -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wnon-virtual-dtor" -#endif #include <so_activex.h> -#if defined __clang__ -#pragma clang diagnostic pop -#endif // SOComWindowPeer diff --git a/extensions/source/activex/SODispatchInterceptor.cxx b/extensions/source/activex/SODispatchInterceptor.cxx index f40f6263512d..97ea07568fde 100644 --- a/extensions/source/activex/SODispatchInterceptor.cxx +++ b/extensions/source/activex/SODispatchInterceptor.cxx @@ -17,7 +17,7 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -// SODispatchInterceptor.cpp : Implementation of CHelpApp and DLL registration. +// SODispatchInterceptor.cxx : Implementation of CHelpApp and DLL registration. #include <sal/config.h> @@ -25,36 +25,16 @@ #include <stdio.h> #include "StdAfx2.h" +#include <so_activex.h> #include "SOActiveX.h" #include "SODispatchInterceptor.h" #include "com_uno_helper.h" #include <sal/macros.h> -#if defined __clang__ -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wnon-virtual-dtor" -#endif -#include <so_activex.h> -#if defined __clang__ -#pragma clang diagnostic pop -#endif - COM_DECLSPEC_NOTHROW STDMETHODIMP SODispatchInterceptor::InterfaceSupportsErrorInfo(REFIID riid) { - static const IID* arr[] = - { - &IID_ISODispatchInterceptor, - }; - - for (std::size_t i=0;i<SAL_N_ELEMENTS(arr);i++) - { -#ifdef _MSC_VER - if (InlineIsEqualGUID(*arr[i],riid)) -#else - if (::ATL::InlineIsEqualGUID(*arr[i],riid)) -#endif - return S_OK; - } + if (InlineIsEqualGUID(IID_ISODispatchInterceptor, riid)) + return S_OK; return S_FALSE; } diff --git a/extensions/source/activex/StdAfx2.h b/extensions/source/activex/StdAfx2.h index 56bd75b8ac32..b2ab095e91f3 100644 --- a/extensions/source/activex/StdAfx2.h +++ b/extensions/source/activex/StdAfx2.h @@ -41,7 +41,6 @@ #pragma clang diagnostic ignored "-Wmicrosoft" #pragma clang diagnostic ignored "-Wmissing-field-initializers" #pragma clang diagnostic ignored "-Wnon-pod-varargs" -#pragma clang diagnostic ignored "-Wnon-virtual-dtor" #pragma clang diagnostic ignored "-Wnonportable-include-path" #pragma clang diagnostic ignored "-Wsequence-point" #pragma clang diagnostic ignored "-Wsign-compare" @@ -56,6 +55,7 @@ extern CComModule _Module; #include <atlcom.h> #include <atlctl.h> +#undef min #if defined __clang__ #pragma clang diagnostic pop diff --git a/extensions/source/activex/so_activex.cxx b/extensions/source/activex/so_activex.cxx index 5840e36b6521..a4ce480613dc 100644 --- a/extensions/source/activex/so_activex.cxx +++ b/extensions/source/activex/so_activex.cxx @@ -27,15 +27,7 @@ #include "StdAfx2.h" #include "resource.h" #include <initguid.h> - -#if defined __clang__ -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wnon-virtual-dtor" -#endif #include <so_activex.h> -#if defined __clang__ -#pragma clang diagnostic pop -#endif #if defined __clang__ #pragma clang diagnostic push @@ -69,17 +61,6 @@ END_OBJECT_MAP() #define X64_LIB_NAME L"so_activex_x64.dll" #define X32_LIB_NAME L"so_activex.dll" -// to provide windows xp as build systems for mingw we need to define KEY_WOW64_64KEY -// in mingw 3.13 KEY_WOW64_64KEY isn't available < Win2003 systems. -// Also defined in setup_native\source\win32\customactions\reg64\reg64.cxx,source\win32\customactions\shellextensions\shellextensions.cxx and -// extensions\source\activex\main\so_activex.cpp -#ifndef KEY_WOW64_64KEY - #define KEY_WOW64_64KEY (0x0100) -#endif -#ifndef KEY_WOW64_32KEY - #define KEY_WOW64_32KEY (0x0200) -#endif - const REGSAM n64KeyAccess = KEY_ALL_ACCESS | KEY_WOW64_64KEY; const REGSAM n32KeyAccess = KEY_ALL_ACCESS; @@ -178,43 +159,43 @@ const char* const aFileExt[] = { ".vor", ".sxw", ".sxc", ".sxi", ".sxd", ".sxg", ".sxm", ".ott", ".otg", ".otp", ".ots", ".otf", ".odt", ".oth", ".odm", ".odg", ".odp", ".ods", ".odf"}; -const char* const aMimeType[] = { - "application/vnd.stardivision.writer", - - "application/vnd.stardivision.chart", - "application/vnd.stardivision.draw", - "application/vnd.stardivision.impress", - "application/vnd.stardivision.impress-packed", - "application/vnd.stardivision.calc", - "application/vnd.stardivision.writer", - "application/vnd.stardivision.math", - - MIMETYPE_VND_SUN_XML_WRITER_TEMPLATE_ASCII, - MIMETYPE_VND_SUN_XML_CALC_TEMPLATE_ASCII, - MIMETYPE_VND_SUN_XML_IMPRESS_TEMPLATE_ASCII, - MIMETYPE_VND_SUN_XML_DRAW_TEMPLATE_ASCII, - - MIMETYPE_VND_SUN_XML_WRITER_ASCII, - MIMETYPE_VND_SUN_XML_CALC_ASCII, - MIMETYPE_VND_SUN_XML_IMPRESS_ASCII, - MIMETYPE_VND_SUN_XML_DRAW_ASCII, - MIMETYPE_VND_SUN_XML_WRITER_GLOBAL_ASCII, - MIMETYPE_VND_SUN_XML_MATH_ASCII, - - MIMETYPE_OASIS_OPENDOCUMENT_TEXT_TEMPLATE_ASCII, - MIMETYPE_OASIS_OPENDOCUMENT_TEXT_GLOBAL_TEMPLATE_ASCII, - MIMETYPE_OASIS_OPENDOCUMENT_DRAWING_TEMPLATE_ASCII, - MIMETYPE_OASIS_OPENDOCUMENT_PRESENTATION_TEMPLATE_ASCII, - MIMETYPE_OASIS_OPENDOCUMENT_SPREADSHEET_TEMPLATE_ASCII, - MIMETYPE_OASIS_OPENDOCUMENT_FORMULA_TEMPLATE_ASCII, - - MIMETYPE_OASIS_OPENDOCUMENT_TEXT_ASCII, - MIMETYPE_OASIS_OPENDOCUMENT_TEXT_WEB_ASCII, - MIMETYPE_OASIS_OPENDOCUMENT_TEXT_GLOBAL_ASCII, - MIMETYPE_OASIS_OPENDOCUMENT_DRAWING_ASCII, - MIMETYPE_OASIS_OPENDOCUMENT_PRESENTATION_ASCII, - MIMETYPE_OASIS_OPENDOCUMENT_SPREADSHEET_ASCII, - MIMETYPE_OASIS_OPENDOCUMENT_FORMULA_ASCII }; +const sal_Unicode* const aMimeType[] = { + u"application/vnd.stardivision.writer", + + u"application/vnd.stardivision.chart", + u"application/vnd.stardivision.draw", + u"application/vnd.stardivision.impress", + u"application/vnd.stardivision.impress-packed", + u"application/vnd.stardivision.calc", + u"application/vnd.stardivision.writer", + u"application/vnd.stardivision.math", + + MIMETYPE_VND_SUN_XML_WRITER_TEMPLATE_ASCII.getStr(), + MIMETYPE_VND_SUN_XML_CALC_TEMPLATE_ASCII.getStr(), + MIMETYPE_VND_SUN_XML_IMPRESS_TEMPLATE_ASCII.getStr(), + MIMETYPE_VND_SUN_XML_DRAW_TEMPLATE_ASCII.getStr(), + + MIMETYPE_VND_SUN_XML_WRITER_ASCII.getStr(), + MIMETYPE_VND_SUN_XML_CALC_ASCII.getStr(), + MIMETYPE_VND_SUN_XML_IMPRESS_ASCII.getStr(), + MIMETYPE_VND_SUN_XML_DRAW_ASCII.getStr(), + MIMETYPE_VND_SUN_XML_WRITER_GLOBAL_ASCII.getStr(), + MIMETYPE_VND_SUN_XML_MATH_ASCII.getStr(), + + MIMETYPE_OASIS_OPENDOCUMENT_TEXT_TEMPLATE_ASCII.getStr(), + MIMETYPE_OASIS_OPENDOCUMENT_TEXT_GLOBAL_TEMPLATE_ASCII.getStr(), + MIMETYPE_OASIS_OPENDOCUMENT_DRAWING_TEMPLATE_ASCII.getStr(), + MIMETYPE_OASIS_OPENDOCUMENT_PRESENTATION_TEMPLATE_ASCII.getStr(), + MIMETYPE_OASIS_OPENDOCUMENT_SPREADSHEET_TEMPLATE_ASCII.getStr(), + MIMETYPE_OASIS_OPENDOCUMENT_FORMULA_TEMPLATE_ASCII.getStr(), + + MIMETYPE_OASIS_OPENDOCUMENT_TEXT_ASCII.getStr(), + MIMETYPE_OASIS_OPENDOCUMENT_TEXT_WEB_ASCII.getStr(), + MIMETYPE_OASIS_OPENDOCUMENT_TEXT_GLOBAL_ASCII.getStr(), + MIMETYPE_OASIS_OPENDOCUMENT_DRAWING_ASCII.getStr(), + MIMETYPE_OASIS_OPENDOCUMENT_PRESENTATION_ASCII.getStr(), + MIMETYPE_OASIS_OPENDOCUMENT_SPREADSHEET_ASCII.getStr(), + MIMETYPE_OASIS_OPENDOCUMENT_FORMULA_ASCII.getStr() }; const int nForModes[] = { 16, 1, 2, 4, 4, 8, 16, 32, @@ -423,7 +404,7 @@ static HRESULT DllRegisterServerNative_Impl( int nMode, bool bForAllUsers, REGSA { if (nForModes[ind] & nMode) { - wsprintfA(aSubKey, "%sMIME\\DataBase\\Content Type\\%s", aPrefix, aMimeType[ind]); + wsprintfA(aSubKey, "%sMIME\\DataBase\\Content Type\\%ls", aPrefix, aMimeType[ind]); HRegKey hkey; s.upd(RegCreateKeyExA(bForAllUsers ? HKEY_LOCAL_MACHINE : HKEY_CURRENT_USER, aSubKey, 0, nullptr, REG_OPTION_NON_VOLATILE, nKeyAccess, @@ -495,7 +476,7 @@ static HRESULT DllUnregisterServerNative_Impl( int nMode, bool bForAllUsers, REG if( nForModes[ind] & nMode ) { DWORD nSubKeys = 0, nValues = 0; - wsprintfA(aSubKey, "%sMIME\\DataBase\\Content Type\\%s", aPrefix, aMimeType[ind]); + wsprintfA(aSubKey, "%sMIME\\DataBase\\Content Type\\%ls", aPrefix, aMimeType[ind]); Status s1(false); // no throw { HRegKey hkey; @@ -742,17 +723,20 @@ STDAPI DllRegisterServer() { HRESULT aResult = E_FAIL; - HMODULE aCurModule = GetModuleHandleW( bX64 ? X64_LIB_NAME : X32_LIB_NAME ); - DWORD nLibNameLen = sal::static_int_cast<DWORD>( - wcslen(bX64 ? X64_LIB_NAME : X32_LIB_NAME)); - + HMODULE aCurModule{}; + GetModuleHandleExW(GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS + | GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT, + reinterpret_cast<LPCWSTR>(&DllRegisterServer), &aCurModule); if( aCurModule ) { wchar_t pProgramPath[1024]; - DWORD nLen = GetModuleFileNameW( aCurModule, pProgramPath, 1024 ); - if ( nLen && nLen > nLibNameLen + 1 ) + wchar_t* pPathEnd = nullptr; + DWORD nLen = GetModuleFileNameW( aCurModule, pProgramPath, SAL_N_ELEMENTS(pProgramPath) ); + if ( nLen && nLen < SAL_N_ELEMENTS(pProgramPath) ) + pPathEnd = wcsrchr(pProgramPath, '\\'); + if (pPathEnd) { - pProgramPath[ nLen - nLibNameLen - 1 ] = 0; + *pPathEnd = 0; aResult = DllRegisterServerNative( 31, TRUE, bX64, pProgramPath ); if( SUCCEEDED( aResult ) ) aResult = DllRegisterServerDoc( 31, TRUE, bX64 ); diff --git a/extensions/source/bibliography/bibconfig.cxx b/extensions/source/bibliography/bibconfig.cxx index 1b9ce9e53d02..746e136c25f3 100644 --- a/extensions/source/bibliography/bibconfig.cxx +++ b/extensions/source/bibliography/bibconfig.cxx @@ -24,16 +24,16 @@ #include <com/sun/star/beans/PropertyValue.hpp> #include <com/sun/star/sdb/DatabaseContext.hpp> #include <comphelper/processfactory.hxx> +#include <comphelper/propertyvalue.hxx> #include <o3tl/any.hxx> using namespace ::com::sun::star::uno; using namespace ::com::sun::star::beans; using namespace ::com::sun::star::container; -using namespace ::com::sun::star::lang; using namespace ::com::sun::star::sdb; -constexpr OUStringLiteral cDataSourceHistory = u"DataSourceHistory"; +constexpr OUString cDataSourceHistory = u"DataSourceHistory"_ustr; Sequence<OUString> const & BibConfig::GetPropertyNames() { @@ -95,24 +95,23 @@ BibConfig::BibConfig() const Sequence< OUString > aPropertyNames = GetPropertyNames(); const Sequence<Any> aPropertyValues = GetProperties( aPropertyNames ); - const Any* pValues = aPropertyValues.getConstArray(); if(aPropertyValues.getLength() == aPropertyNames.getLength()) { for(int nProp = 0; nProp < aPropertyNames.getLength(); nProp++) { - if(pValues[nProp].hasValue()) + if (aPropertyValues[nProp].hasValue()) { switch(nProp) { - case 0: pValues[nProp] >>= sDataSource; break; - case 1: pValues[nProp] >>= sTableOrQuery; break; - case 2: pValues[nProp] >>= nTblOrQuery; break; - case 3: pValues[nProp] >>= nBeamerSize; break; - case 4: pValues[nProp] >>= nViewSize ; break; - case 5: pValues[nProp] >>= sQueryText ; break; - case 6: pValues[nProp] >>= sQueryField; break; + case 0: aPropertyValues[nProp] >>= sDataSource; break; + case 1: aPropertyValues[nProp] >>= sTableOrQuery; break; + case 2: aPropertyValues[nProp] >>= nTblOrQuery; break; + case 3: aPropertyValues[nProp] >>= nBeamerSize; break; + case 4: aPropertyValues[nProp] >>= nViewSize ; break; + case 5: aPropertyValues[nProp] >>= sQueryText ; break; + case 6: aPropertyValues[nProp] >>= sQueryField; break; case 7: - bShowColumnAssignmentWarning = *o3tl::doAccess<bool>(pValues[nProp]); + bShowColumnAssignmentWarning = *o3tl::doAccess<bool>(aPropertyValues[nProp]); break; } } @@ -130,14 +129,13 @@ BibConfig::BibConfig() pHistoryNames[2] = sPrefix + "CommandType"; Sequence<Any> aHistoryValues = GetProperties( aHistoryNames ); - const Any* pHistoryValues = aHistoryValues.getConstArray(); if(aHistoryValues.getLength() == aHistoryNames.getLength()) { Mapping* pMapping = new Mapping; - pHistoryValues[0] >>= pMapping->sURL; - pHistoryValues[1] >>= pMapping->sTableName; - pHistoryValues[2] >>= pMapping->nCommandType; + aHistoryValues[0] >>= pMapping->sURL; + aHistoryValues[1] >>= pMapping->sTableName; + aHistoryValues[2] >>= pMapping->nCommandType; //field assignment is contained in another set sPrefix += "Fields"; const Sequence< OUString > aAssignmentNodeNames = GetNodeNames(sPrefix); @@ -153,15 +151,14 @@ BibConfig::BibConfig() pAssignmentPropertyNames[nFieldIdx++] += "/AssignedFieldName"; } Sequence<Any> aAssignmentValues = GetProperties(aAssignmentPropertyNames); - const Any* pAssignmentValues = aAssignmentValues.getConstArray(); OUString sTempLogical; OUString sTempReal; sal_Int16 nSetMapping = 0; nFieldIdx = 0; for(sal_Int32 nFieldVal = 0; nFieldVal < aAssignmentValues.getLength() / 2; nFieldVal++) { - pAssignmentValues[nFieldIdx++] >>= sTempLogical; - pAssignmentValues[nFieldIdx++] >>= sTempReal; + aAssignmentValues[nFieldIdx++] >>= sTempLogical; + aAssignmentValues[nFieldIdx++] >>= sTempReal; if(!(sTempLogical.isEmpty() || sTempReal.isEmpty())) { pMapping->aColumnPairs[nSetMapping].sLogicalColumnName = sTempLogical; @@ -235,14 +232,11 @@ void BibConfig::ImplCommit() !pMapping->aColumnPairs[nFieldAssignment].sLogicalColumnName.isEmpty()) { OUString sSubPrefix = sPrefix + "/_" + OUString::number(nFieldAssignment); - Sequence< PropertyValue > aAssignmentValues(2); - PropertyValue* pAssignmentValues = aAssignmentValues.getArray(); - pAssignmentValues[0].Name = sSubPrefix; - pAssignmentValues[0].Name += sFieldName; - pAssignmentValues[0].Value <<= pMapping->aColumnPairs[nFieldAssignment].sLogicalColumnName; - pAssignmentValues[1].Name = sSubPrefix; - pAssignmentValues[1].Name += sDatabaseFieldName; - pAssignmentValues[1].Value <<= pMapping->aColumnPairs[nFieldAssignment].sRealColumnName; + Sequence< PropertyValue > aAssignmentValues + { + comphelper::makePropertyValue(sSubPrefix + sFieldName, pMapping->aColumnPairs[nFieldAssignment].sLogicalColumnName), + comphelper::makePropertyValue(sSubPrefix + sDatabaseFieldName, pMapping->aColumnPairs[nFieldAssignment].sRealColumnName) + }; SetSetProperties( sPrefix, aAssignmentValues ); nFieldAssignment++; } diff --git a/extensions/source/bibliography/bibcont.cxx b/extensions/source/bibliography/bibcont.cxx index 7c24b0fb3fd2..7e31f8b9b095 100644 --- a/extensions/source/bibliography/bibcont.cxx +++ b/extensions/source/bibliography/bibcont.cxx @@ -49,7 +49,6 @@ BibSplitWindow::BibSplitWindow( vcl::Window* pParent, WinBits nStyle ) : SplitWi } using namespace ::com::sun::star; -using namespace ::com::sun::star::uno; //split window size is a percent value #define WIN_MIN_HEIGHT 10 @@ -193,7 +192,7 @@ void BibBookContainer::GetFocus() bool BibBookContainer::PreNotify( NotifyEvent& rNEvt ) { bool bHandled = false; - if( MouseNotifyEvent::KEYINPUT == rNEvt.GetType() ) + if( NotifyEventType::KEYINPUT == rNEvt.GetType() ) { const KeyEvent* pKEvt = rNEvt.GetKeyEvent(); const vcl::KeyCode aKeyCode = pKEvt->GetKeyCode(); diff --git a/extensions/source/bibliography/bibload.cxx b/extensions/source/bibliography/bibload.cxx index 546b16e054ee..755b43d8defa 100644 --- a/extensions/source/bibliography/bibload.cxx +++ b/extensions/source/bibliography/bibload.cxx @@ -18,11 +18,12 @@ */ #include <tools/debug.hxx> -#include <tools/diagnose_ex.h> +#include <comphelper/diagnose_ex.hxx> #include <cppuhelper/supportsservice.hxx> #include <svl/itemprop.hxx> #include <toolkit/helper/vclunohelper.hxx> #include <comphelper/processfactory.hxx> +#include <com/sun/star/awt/XVclWindowPeer.hpp> #include <com/sun/star/sdbc/ResultSetType.hpp> #include <com/sun/star/sdbc/ResultSetConcurrency.hpp> #include <com/sun/star/sdbc/SQLException.hpp> @@ -52,6 +53,7 @@ #include "bibconfig.hxx" #include <cppuhelper/implbase.hxx> #include <rtl/ref.hxx> +#include <o3tl/string_view.hxx> using namespace ::com::sun::star; using namespace ::com::sun::star::uno; @@ -174,7 +176,7 @@ void BibliographyLoader::load(const Reference< XFrame > & rFrame, const OUString m_pBibMod = OpenBibModul(); - OUString aPartName = rURL.getToken( 1, '/' ); + std::u16string_view aPartName = o3tl::getToken(rURL, 1, '/' ); Reference<XPropertySet> xPrSet(rFrame, UNO_QUERY); if(xPrSet.is()) { @@ -182,7 +184,7 @@ void BibliographyLoader::load(const Reference< XFrame > & rFrame, const OUString aTitle <<= BibResId(RID_BIB_STR_FRAME_TITLE); xPrSet->setPropertyValue("Title", aTitle); } - if(aPartName == "View" || aPartName == "View1") + if(aPartName == u"View" || aPartName == u"View1") { loadView(rFrame, rListener); } @@ -205,7 +207,7 @@ void BibliographyLoader::loadView(const Reference< XFrame > & rFrame, DBChangeDialogConfig_Impl aConfig; const Sequence<OUString> aSources = aConfig.GetDataSourceNames(); if(aSources.hasElements()) - aBibDesc.sDataSource = aSources.getConstArray()[0]; + aBibDesc.sDataSource = aSources[0]; } m_xDatMan->createDatabaseForm( aBibDesc ); @@ -513,8 +515,7 @@ Reference< XPropertySetInfo > BibliographyLoader::getPropertySetInfo() { static const SfxItemPropertyMapEntry aBibProps_Impl[] = { - { u"BibliographyDataFieldNames", 0, cppu::UnoType<Sequence<PropertyValue>>::get(), PropertyAttribute::READONLY, 0}, - { u"", 0, css::uno::Type(), 0, 0 } + { u"BibliographyDataFieldNames"_ustr, 0, cppu::UnoType<Sequence<PropertyValue>>::get(), PropertyAttribute::READONLY, 0}, }; static Reference< XPropertySetInfo > xRet = SfxItemPropertySet(aBibProps_Impl).getPropertySetInfo(); diff --git a/extensions/source/bibliography/bibmod.cxx b/extensions/source/bibliography/bibmod.cxx index 3a6d06672004..9d7ac60330ba 100644 --- a/extensions/source/bibliography/bibmod.cxx +++ b/extensions/source/bibliography/bibmod.cxx @@ -29,10 +29,6 @@ static BibModul* pBibModul=nullptr; static sal_uInt32 nBibModulCount=0; using namespace ::com::sun::star; -using namespace ::com::sun::star::uno; -using namespace ::com::sun::star::util; -using namespace ::com::sun::star::lang; -using namespace ::com::sun::star::ucb; HdlBibModul OpenBibModul() { diff --git a/extensions/source/bibliography/bibview.cxx b/extensions/source/bibliography/bibview.cxx index 09925e6c4ca4..0809789854ce 100644 --- a/extensions/source/bibliography/bibview.cxx +++ b/extensions/source/bibliography/bibview.cxx @@ -28,13 +28,10 @@ #include <vcl/svapp.hxx> -#include <com/sun/star/sdbc/XResultSetUpdate.hpp> #include <vcl/weld.hxx> -#include <tools/debug.hxx> using namespace ::com::sun::star; using namespace ::com::sun::star::form; -using namespace ::com::sun::star::beans; using namespace ::com::sun::star::lang; using namespace ::com::sun::star::uno; diff --git a/extensions/source/bibliography/datman.cxx b/extensions/source/bibliography/datman.cxx index e53d2b0392b9..407645c1df89 100644 --- a/extensions/source/bibliography/datman.cxx +++ b/extensions/source/bibliography/datman.cxx @@ -21,7 +21,7 @@ #include <o3tl/any.hxx> #include <sal/log.hxx> -#include <tools/diagnose_ex.h> +#include <comphelper/diagnose_ex.hxx> #include <comphelper/processfactory.hxx> #include <com/sun/star/sdbc/ResultSetType.hpp> #include <com/sun/star/sdbc/ResultSetConcurrency.hpp> @@ -73,7 +73,7 @@ using namespace ::com::sun::star::lang; // PropertyNames constexpr OUStringLiteral FM_PROP_LABEL = u"Label"; -constexpr OUStringLiteral FM_PROP_CONTROLSOURCE = u"DataField"; +constexpr OUString FM_PROP_CONTROLSOURCE = u"DataField"_ustr; constexpr OUStringLiteral FM_PROP_NAME = u"Name"; static Reference< XConnection > getConnection(const OUString& _rURL) @@ -530,9 +530,7 @@ void SAL_CALL BibInterceptorHelper::setMasterDispatchProvider( const css::uno::R constexpr OUStringLiteral gGridName(u"theGrid"); BibDataManager::BibDataManager() - :BibDataManager_Base( GetMutex() ) - ,m_aLoadListeners(m_aMutex) - ,pBibView( nullptr ) + :pBibView( nullptr ) ,pToolbar(nullptr) { } @@ -630,11 +628,11 @@ void BibDataManager::InsertFields(const Reference< XFormComponent > & _rxGrid) Any aFormatted(bFormattedIsNumeric); xCurrentCol->setPropertyValue("TreatAsNumber", aFormatted); } - Any aColName = makeAny( rField ); + Any aColName( rField ); xCurrentCol->setPropertyValue(FM_PROP_CONTROLSOURCE, aColName); xCurrentCol->setPropertyValue(FM_PROP_LABEL, aColName); - xColContainer->insertByName( rField, makeAny( xCurrentCol ) ); + xColContainer->insertByName( rField, Any( xCurrentCol ) ); } } catch (const Exception&) @@ -661,7 +659,7 @@ Reference< awt::XControlModel > const & BibDataManager::updateGridModel(const Re m_xGridModel = createGridModel( gGridName ); Reference< XNameContainer > xNameCont(xDbForm, UNO_QUERY); - xNameCont->insertByName( sName, makeAny( m_xGridModel ) ); + xNameCont->insertByName( sName, Any( m_xGridModel ) ); } // insert the fields @@ -788,8 +786,8 @@ void BibDataManager::setFilter(const OUString& rQuery) m_xParser->setFilter( rQuery ); OUString aQuery = m_xParser->getFilter(); Reference< XPropertySet > xFormProps( m_xForm, UNO_QUERY_THROW ); - xFormProps->setPropertyValue( "Filter", makeAny( aQuery ) ); - xFormProps->setPropertyValue( "ApplyFilter", makeAny( true ) ); + xFormProps->setPropertyValue( "Filter", Any( aQuery ) ); + xFormProps->setPropertyValue( "ApplyFilter", Any( true ) ); reload(); } catch (const Exception&) @@ -899,7 +897,7 @@ void BibDataManager::setActiveDataSource(const OUString& rURL) aActiveDataTable = aTableNameSeq[0]; aVal <<= aActiveDataTable; aPropertySet->setPropertyValue("Command", aVal); - aPropertySet->setPropertyValue("CommandType", makeAny(CommandType::TABLE)); + aPropertySet->setPropertyValue("CommandType", Any(CommandType::TABLE)); //Caching for Performance aVal <<= sal_Int32(50); aPropertySet->setPropertyValue("FetchSize", aVal); @@ -950,48 +948,42 @@ void BibDataManager::setActiveDataTable(const OUString& rTable) Reference< XConnection > xConnection = getConnection( m_xForm ); Reference< XTablesSupplier > xSupplyTables(xConnection, UNO_QUERY); Reference< XNameAccess > xAccess = xSupplyTables->getTables(); - Sequence< OUString > aTableNameSeq = xAccess->getElementNames(); - sal_uInt32 nCount = aTableNameSeq.getLength(); - const OUString* pTableNames = aTableNameSeq.getConstArray(); - const OUString* pTableNamesEnd = pTableNames + nCount; - - for ( ; pTableNames != pTableNamesEnd; ++pTableNames ) + for (auto& rTableName: xAccess->getElementNames()) { - if ( rTable == *pTableNames ) + if (rTable == rTableName) { aActiveDataTable = rTable; Any aVal; aVal <<= rTable; aPropertySet->setPropertyValue( "Command", aVal ); - break; - } - } - if (pTableNames != pTableNamesEnd) - { - Reference< XDatabaseMetaData > xMetaData = xConnection->getMetaData(); - aQuoteChar = xMetaData->getIdentifierQuoteString(); - Reference< XMultiServiceFactory > xFactory(xConnection, UNO_QUERY); - if ( xFactory.is() ) - m_xParser.set( xFactory->createInstance("com.sun.star.sdb.SingleSelectQueryComposer"), UNO_QUERY ); + Reference<XDatabaseMetaData> xMetaData = xConnection->getMetaData(); + aQuoteChar = xMetaData->getIdentifierQuoteString(); - OUString aString("SELECT * FROM "); + Reference<XMultiServiceFactory> xFactory(xConnection, UNO_QUERY); + if (xFactory.is()) + m_xParser.set( xFactory->createInstance("com.sun.star.sdb.SingleSelectQueryComposer"), UNO_QUERY ); - OUString sCatalog, sSchema, sName; - ::dbtools::qualifiedNameComponents( xMetaData, aActiveDataTable, sCatalog, sSchema, sName, ::dbtools::EComposeRule::InDataManipulation ); - aString += ::dbtools::composeTableNameForSelect( xConnection, sCatalog, sSchema, sName ); + OUString aString("SELECT * FROM "); - m_xParser->setElementaryQuery(aString); + OUString sCatalog, sSchema, sName; + ::dbtools::qualifiedNameComponents( xMetaData, aActiveDataTable, sCatalog, sSchema, sName, ::dbtools::EComposeRule::InDataManipulation ); + aString += ::dbtools::composeTableNameForSelect( xConnection, sCatalog, sSchema, sName ); - BibConfig* pConfig = BibModul::GetConfig(); - pConfig->setQueryField(getQueryField()); - startQueryWith(pConfig->getQueryText()); + m_xParser->setElementaryQuery(aString); + + BibConfig* pConfig = BibModul::GetConfig(); + pConfig->setQueryField(getQueryField()); + startQueryWith(pConfig->getQueryText()); + + BibDBDescriptor aDesc; + aDesc.sDataSource = aDataSourceURL; + aDesc.sTableOrQuery = aActiveDataTable; + aDesc.nCommandType = CommandType::TABLE; + BibModul::GetConfig()->SetBibliographyURL(aDesc); - BibDBDescriptor aDesc; - aDesc.sDataSource = aDataSourceURL; - aDesc.sTableOrQuery = aActiveDataTable; - aDesc.nCommandType = CommandType::TABLE; - BibModul::GetConfig()->SetBibliographyURL(aDesc); + break; + } } } } @@ -1014,8 +1006,9 @@ void SAL_CALL BibDataManager::load( ) { xFormAsLoadable->load(); + std::unique_lock g(m_aMutex); EventObject aEvt( static_cast< XWeak* >( this ) ); - m_aLoadListeners.notifyEach( &XLoadListener::loaded, aEvt ); + m_aLoadListeners.notifyEach( g, &XLoadListener::loaded, aEvt ); } } @@ -1034,13 +1027,15 @@ void SAL_CALL BibDataManager::unload( ) EventObject aEvt( static_cast< XWeak* >( this ) ); { - m_aLoadListeners.notifyEach( &XLoadListener::unloading, aEvt ); + std::unique_lock g(m_aMutex); + m_aLoadListeners.notifyEach( g, &XLoadListener::unloading, aEvt ); } xFormAsLoadable->unload(); { - m_aLoadListeners.notifyEach( &XLoadListener::unloaded, aEvt ); + std::unique_lock g(m_aMutex); + m_aLoadListeners.notifyEach( g, &XLoadListener::unloaded, aEvt ); } } @@ -1059,13 +1054,15 @@ void SAL_CALL BibDataManager::reload( ) EventObject aEvt( static_cast< XWeak* >( this ) ); { - m_aLoadListeners.notifyEach( &XLoadListener::reloading, aEvt ); + std::unique_lock g(m_aMutex); + m_aLoadListeners.notifyEach( g, &XLoadListener::reloading, aEvt ); } xFormAsLoadable->reload(); { - m_aLoadListeners.notifyEach( &XLoadListener::reloaded, aEvt ); + std::unique_lock g(m_aMutex); + m_aLoadListeners.notifyEach( g, &XLoadListener::reloaded, aEvt ); } } @@ -1084,13 +1081,15 @@ sal_Bool SAL_CALL BibDataManager::isLoaded( ) void SAL_CALL BibDataManager::addLoadListener( const Reference< XLoadListener >& aListener ) { - m_aLoadListeners.addInterface( aListener ); + std::unique_lock g(m_aMutex); + m_aLoadListeners.addInterface( g, aListener ); } void SAL_CALL BibDataManager::removeLoadListener( const Reference< XLoadListener >& aListener ) { - m_aLoadListeners.removeInterface( aListener ); + std::unique_lock g(m_aMutex); + m_aLoadListeners.removeInterface( g, aListener ); } @@ -1107,7 +1106,7 @@ Reference< awt::XControlModel > BibDataManager::createGridModel(const OUString& // set the Reference< XPropertySet > xPropSet( xModel, UNO_QUERY ); - xPropSet->setPropertyValue( "Name", makeAny( rName ) ); + xPropSet->setPropertyValue( "Name", Any( rName ) ); // set the name of the to-be-created control Any aAny(OUString("com.sun.star.form.control.InteractionGridControl")); @@ -1119,7 +1118,7 @@ Reference< awt::XControlModel > BibDataManager::createGridModel(const OUString& if (xPropInfo->hasPropertyByName(uProp)) { xPropSet->setPropertyValue( - uProp, makeAny<OUString>(INET_HID_SCHEME HID_BIB_DB_GRIDCTRL)); + uProp, Any(OUString(INET_HID_SCHEME + HID_BIB_DB_GRIDCTRL))); } } catch (const Exception&) @@ -1206,8 +1205,8 @@ Reference< awt::XControlModel > BibDataManager::loadControlModel( Any aFieldName; aFieldName <<= aName; xPropSet->setPropertyValue( FM_PROP_NAME,aFieldName); - xPropSet->setPropertyValue( FM_PROP_CONTROLSOURCE, makeAny( rName ) ); - xPropSet->setPropertyValue("NativeWidgetLook", makeAny( true ) ); + xPropSet->setPropertyValue( FM_PROP_CONTROLSOURCE, Any( rName ) ); + xPropSet->setPropertyValue("NativeWidgetLook", Any( true ) ); if (bForceListBox) { @@ -1265,7 +1264,7 @@ Reference< awt::XControlModel > BibDataManager::loadControlModel( Reference< XFormComponent > aFormComp(xModel,UNO_QUERY ); Reference< XNameContainer > xNameCont( m_xForm, UNO_QUERY ); - xNameCont->insertByName(aName, makeAny( aFormComp ) ); + xNameCont->insertByName(aName, Any( aFormComp ) ); // now if the form where we inserted the new model is already loaded, notify the model of this // Note that this implementation below is a HACK as it relies on the fact that the model adds itself diff --git a/extensions/source/bibliography/datman.hxx b/extensions/source/bibliography/datman.hxx index 36cbdcd594b6..405cf83d85a5 100644 --- a/extensions/source/bibliography/datman.hxx +++ b/extensions/source/bibliography/datman.hxx @@ -25,10 +25,9 @@ #include <com/sun/star/form/XForm.hpp> #include <com/sun/star/sdb/XSingleSelectQueryComposer.hpp> #include <com/sun/star/form/runtime/XFormController.hpp> -#include <cppuhelper/compbase.hxx> -#include <comphelper/interfacecontainer2.hxx> +#include <comphelper/compbase.hxx> +#include <comphelper/interfacecontainer4.hxx> #include <com/sun/star/form/XLoadable.hpp> -#include <comphelper/broadcasthelper.hxx> #include <com/sun/star/frame/XDispatchProviderInterceptor.hpp> #include <com/sun/star/frame/XDispatchProviderInterception.hpp> #include <cppuhelper/implbase.hxx> @@ -72,11 +71,9 @@ public: virtual void SAL_CALL setMasterDispatchProvider( const css::uno::Reference< css::frame::XDispatchProvider >& xNewMasterDispatchProvider ) override; }; -typedef cppu::WeakComponentImplHelper < css::form::XLoadable +typedef comphelper::WeakComponentImplHelper < css::form::XLoadable > BibDataManager_Base; -class BibDataManager final - :public ::comphelper::OMutexAndBroadcastHelper - ,public BibDataManager_Base +class BibDataManager final : public BibDataManager_Base { private: css::uno::Reference< css::form::XForm > m_xForm; @@ -90,7 +87,7 @@ private: OUString aDataSourceURL; OUString aQuoteChar; - ::comphelper::OInterfaceContainerHelper2 m_aLoadListeners; + ::comphelper::OInterfaceContainerHelper4<css::form::XLoadListener> m_aLoadListeners; VclPtr< ::bib::BibView> pBibView; VclPtr<BibToolBar> pToolbar; diff --git a/extensions/source/bibliography/formcontrolcontainer.cxx b/extensions/source/bibliography/formcontrolcontainer.cxx index c6ec73700656..f8d43a8a7c88 100644 --- a/extensions/source/bibliography/formcontrolcontainer.cxx +++ b/extensions/source/bibliography/formcontrolcontainer.cxx @@ -19,7 +19,7 @@ #include "formcontrolcontainer.hxx" #include <sal/log.hxx> -#include <tools/diagnose_ex.h> +#include <comphelper/diagnose_ex.hxx> #include <algorithm> diff --git a/extensions/source/bibliography/framectr.cxx b/extensions/source/bibliography/framectr.cxx index 8c1d6eefddc3..7e0ec6e93938 100644 --- a/extensions/source/bibliography/framectr.cxx +++ b/extensions/source/bibliography/framectr.cxx @@ -18,16 +18,19 @@ */ #include <comphelper/types.hxx> +#include <comphelper/propertyvalue.hxx> #include <comphelper/sequence.hxx> #include "framectr.hxx" #include "datman.hxx" #include <toolkit/helper/vclunohelper.hxx> #include "bibconfig.hxx" #include <cppuhelper/implbase.hxx> +#include <utility> #include <vcl/event.hxx> #include <vcl/svapp.hxx> #include <comphelper/processfactory.hxx> #include <com/sun/star/awt/XTextComponent.hpp> +#include <com/sun/star/awt/XVclWindowPeer.hpp> #include <com/sun/star/form/XConfirmDeleteListener.hpp> #include <com/sun/star/form/runtime/XFormController.hpp> #include <com/sun/star/beans/PropertyValue.hpp> @@ -42,7 +45,7 @@ #include <cppuhelper/supportsservice.hxx> #include <sot/exchange.hxx> #include <sot/formats.hxx> -#include <tools/diagnose_ex.h> +#include <comphelper/diagnose_ex.hxx> #include <vcl/weld.hxx> #include <osl/mutex.hxx> @@ -145,9 +148,9 @@ void BibFrameCtrl_Impl::disposing( const lang::EventObject& /*Source*/ ) pController->getFrame()->removeFrameActionListener( this ); } -BibFrameController_Impl::BibFrameController_Impl( const uno::Reference< awt::XWindow > & xComponent, +BibFrameController_Impl::BibFrameController_Impl( uno::Reference< awt::XWindow > xComponent, BibDataManager* pDataManager) - :m_xWindow( xComponent ) + :m_xWindow(std::move( xComponent )) ,m_xDatMan( pDataManager ) { m_bDisposing = false; @@ -225,12 +228,15 @@ void BibFrameController_Impl::dispose() if (xFrame.is()) xFrame->removeFrameActionListener( m_xImpl ); + m_xFrame.clear(); aObject.Source = static_cast<XController*>(this); m_xImpl->aLC.disposeAndClear(aObject); m_xDatMan.clear(); m_aStatusListeners.clear(); m_xLastQueriedFocusWin.clear(); + m_xWindow.clear(); + m_xImpl.clear(); } void BibFrameController_Impl::addEventListener( const uno::Reference< lang::XEventListener > & aListener ) @@ -263,19 +269,18 @@ uno::Reference< frame::XDispatch > BibFrameController_Impl::queryDispatch( cons uno::Sequence<uno::Reference< XDispatch > > BibFrameController_Impl::queryDispatches( const uno::Sequence<DispatchDescriptor>& aDescripts ) { uno::Sequence< uno::Reference< XDispatch > > aDispatches( aDescripts.getLength() ); + auto aDispatchesRange = asNonConstRange(aDispatches); for ( sal_Int32 i=0; i<aDescripts.getLength(); ++i ) - aDispatches[i] = queryDispatch( aDescripts[i].FeatureURL, aDescripts[i].FrameName, aDescripts[i].SearchFlags ); + aDispatchesRange[i] = queryDispatch( aDescripts[i].FeatureURL, aDescripts[i].FrameName, aDescripts[i].SearchFlags ); return aDispatches; } uno::Sequence< ::sal_Int16 > SAL_CALL BibFrameController_Impl::getSupportedCommandGroups() { - uno::Sequence< ::sal_Int16 > aDispatchInfo( 4 ); - - aDispatchInfo[0] = frame::CommandGroup::EDIT; - aDispatchInfo[1] = frame::CommandGroup::DOCUMENT; - aDispatchInfo[2] = frame::CommandGroup::DATA; - aDispatchInfo[3] = frame::CommandGroup::VIEW; + uno::Sequence< ::sal_Int16 > aDispatchInfo{ frame::CommandGroup::EDIT, + frame::CommandGroup::DOCUMENT, + frame::CommandGroup::DATA, + frame::CommandGroup::VIEW }; return aDispatchInfo; } @@ -394,10 +399,11 @@ void BibFrameController_Impl::dispatch(const util::URL& _rURL, const uno::Sequen { try { - uno::Sequence< beans::PropertyValue > aNewDataSource(2); - beans::PropertyValue* pProps = aNewDataSource.getArray(); - pProps[0].Value <<= OUString(); - pProps[1].Value <<= aURL; + uno::Sequence< beans::PropertyValue > aNewDataSource + { + comphelper::makePropertyValue( {}, OUString() ), + comphelper::makePropertyValue( {}, aURL ) + }; ChangeDataSource(aNewDataSource); } catch(const Exception&) @@ -425,14 +431,11 @@ void BibFrameController_Impl::dispatch(const util::URL& _rURL, const uno::Sequen } } - const beans::PropertyValue* pPropertyValue = aArgs.getConstArray(); - uno::Any aValue=pPropertyValue[0].Value; OUString aQuery; - aValue >>= aQuery; + aArgs[0].Value >>= aQuery; - aValue=pPropertyValue[1].Value; OUString aQueryField; - aValue >>= aQueryField; + aArgs[1].Value >>= aQueryField; BibConfig* pConfig = BibModul::GetConfig(); pConfig->setQueryField(aQueryField); m_xDatMan->startQueryWith(aQuery); @@ -479,7 +482,7 @@ void BibFrameController_Impl::dispatch(const util::URL& _rURL, const uno::Sequen { RemoveFilter(); } - else if( _rURL.Complete == "slot:5503" || aCommand == "CloseDoc" ) + else if( _rURL.Complete == ".uno:CloseDoc" || aCommand == "CloseDoc" ) { Application::PostUserEvent( LINK( this, BibFrameController_Impl, DisposeHdl ) ); @@ -800,15 +803,14 @@ void BibFrameController_Impl::RemoveFilter() void BibFrameController_Impl::ChangeDataSource(const uno::Sequence< beans::PropertyValue >& aArgs) { - const beans::PropertyValue* pPropertyValue = aArgs.getConstArray(); - uno::Any aValue=pPropertyValue[0].Value; + uno::Any aValue = aArgs[0].Value; OUString aDBTableName; aValue >>= aDBTableName; if(aArgs.getLength() > 1) { - uno::Any aDB = pPropertyValue[1].Value; + uno::Any aDB = aArgs[1].Value; OUString aURL; aDB >>= aURL; m_xDatMan->setActiveDataSource(aURL); diff --git a/extensions/source/bibliography/framectr.hxx b/extensions/source/bibliography/framectr.hxx index be91982ccfe4..9aac2cee0dab 100644 --- a/extensions/source/bibliography/framectr.hxx +++ b/extensions/source/bibliography/framectr.hxx @@ -27,6 +27,7 @@ #include <cppuhelper/implbase.hxx> #include <rtl/ref.hxx> #include <tools/link.hxx> +#include <utility> #include <vcl/window.hxx> #include <vector> #include <memory> @@ -44,9 +45,9 @@ class BibStatusDispatch public: css::util::URL aURL; css::uno::Reference< css::frame::XStatusListener > xListener; - BibStatusDispatch( const css::util::URL& rURL, const css::uno::Reference< css::frame::XStatusListener >& rRef ) - : aURL( rURL ) - , xListener( rRef ) + BibStatusDispatch( css::util::URL _aURL, css::uno::Reference< css::frame::XStatusListener > xRef ) + : aURL(std::move( _aURL )) + , xListener(std::move( xRef )) {} }; @@ -73,7 +74,7 @@ friend class BibFrameCtrl_Impl; static bool SaveModified(const css::uno::Reference< css::form::runtime::XFormController>& xController); public: - BibFrameController_Impl( const css::uno::Reference< css::awt::XWindow > & xComponent, + BibFrameController_Impl( css::uno::Reference< css::awt::XWindow > xComponent, BibDataManager* pDatMan); virtual ~BibFrameController_Impl() override; diff --git a/extensions/source/bibliography/general.cxx b/extensions/source/bibliography/general.cxx index ad3a8c957b66..92a4c6843ec1 100644 --- a/extensions/source/bibliography/general.cxx +++ b/extensions/source/bibliography/general.cxx @@ -19,20 +19,21 @@ #include <comphelper/processfactory.hxx> #include <com/sun/star/beans/XPropertyChangeListener.hpp> +#include <com/sun/star/form/XBoundComponent.hpp> #include <com/sun/star/sdbc/XRowSet.hpp> #include <com/sun/star/sdb/XColumn.hpp> #include <com/sun/star/sdb/CommandType.hpp> -#include <com/sun/star/sdbcx/XColumnsSupplier.hpp> -#include <com/sun/star/awt/XWindow.hpp> -#include <com/sun/star/uno/XComponentContext.hpp> #include <com/sun/star/ui/dialogs/TemplateDescription.hpp> #include <com/sun/star/uri/UriReferenceFactory.hpp> -#include <toolkit/helper/vclunohelper.hxx> +#include <o3tl/safeint.hxx> +#include <o3tl/string_view.hxx> +#include <sal/log.hxx> +#include <osl/diagnose.h> #include <cppuhelper/implbase.hxx> +#include <utility> #include <vcl/event.hxx> #include <vcl/mnemonic.hxx> -#include <vcl/settings.hxx> #include "general.hxx" #include "bibresid.hxx" #include "datman.hxx" @@ -40,11 +41,7 @@ #include <strings.hrc> #include "bibmod.hxx" #include <helpids.h> -#include <tools/debug.hxx> -#include <vcl/svapp.hxx> -#include <vcl/i18nhelp.hxx> #include <algorithm> -#include <tools/urlobj.hxx> #include <sfx2/filedlghelper.hxx> #include <sfx2/objsh.hxx> @@ -78,7 +75,7 @@ bool SplitUrlAndPage(const OUString& rText, OUString& rUrl, int& nPageNumber) return false; } - nPageNumber = xUriRef->getFragment().copy(aPagePrefix.getLength()).toInt32(); + nPageNumber = o3tl::toInt32(xUriRef->getFragment().subView(aPagePrefix.getLength())); xUriRef->clearFragment(); rUrl = xUriRef->getUriReference(); return true; @@ -366,9 +363,8 @@ IMPL_LINK_NOARG(BibGeneralPage, BrowseHdl, weld::Button&, void) } else { - SfxObjectShell* pShell = SfxObjectShell::Current(); OUString aBaseURL; - if (pShell) + if (SfxObjectShell* pShell = SfxObjectShell::Current()) { aBaseURL = pShell->getDocumentBaseURL(); } @@ -452,27 +448,25 @@ IMPL_LINK(BibGeneralPage, LastElementKeyInputHdl, const KeyEvent&, rKeyEvent, bo bool bShift = rKeyEvent.GetKeyCode().IsShift(); bool bCtrl = rKeyEvent.GetKeyCode().IsMod1(); bool bAlt = rKeyEvent.GetKeyCode().IsMod2(); - if (KEY_TAB == nCode && !bShift && !bCtrl && !bAlt) + if (KEY_TAB != nCode || bShift || bCtrl || bAlt) + return false; + SaveChanges(); + uno::Reference<sdbc::XRowSet> xRowSet(pDatMan->getForm(), UNO_QUERY); + if (xRowSet.is()) { - SaveChanges(); - uno::Reference<sdbc::XRowSet> xRowSet(pDatMan->getForm(), UNO_QUERY); - if (xRowSet.is()) + if (xRowSet->isLast()) { - if (xRowSet->isLast()) - { - uno::Reference<sdbc::XResultSetUpdate> xUpdateCursor(xRowSet, UNO_QUERY); - if (xUpdateCursor.is()) - xUpdateCursor->moveToInsertRow(); - } - else - (void)xRowSet->next(); + uno::Reference<sdbc::XResultSetUpdate> xUpdateCursor(xRowSet, UNO_QUERY); + if (xUpdateCursor.is()) + xUpdateCursor->moveToInsertRow(); } - xIdentifierED->grab_focus(); - xIdentifierED->select_region(0, -1); - GainFocusHdl(*xIdentifierED); - return true; + else + (void)xRowSet->next(); } - return false; + xIdentifierED->grab_focus(); + xIdentifierED->select_region(0, -1); + GainFocusHdl(*xIdentifierED); + return true; } BibGeneralPage::~BibGeneralPage() @@ -483,8 +477,8 @@ BibGeneralPage::~BibGeneralPage() class ChangeListener : public cppu::WeakImplHelper<css::beans::XPropertyChangeListener> { public: - explicit ChangeListener(const css::uno::Reference<css::beans::XPropertySet>& rPropSet) - : m_xPropSet(rPropSet) + explicit ChangeListener(css::uno::Reference<css::beans::XPropertySet> xPropSet) + : m_xPropSet(std::move(xPropSet)) , m_bSelfChanging(false) { } @@ -600,7 +594,7 @@ namespace { aText = m_rEntry.get_text(); } - m_xPropSet->setPropertyValue("Text", makeAny(aText)); + m_xPropSet->setPropertyValue("Text", Any(aText)); css::uno::Reference<css::form::XBoundComponent> xBound(m_xPropSet, css::uno::UNO_QUERY); if (xBound.is()) @@ -673,9 +667,8 @@ namespace return; m_bSelfChanging = true; - Sequence<sal_Int16> aSelection(1); - aSelection[0] = m_rComboBox.get_active(); - m_xPropSet->setPropertyValue("SelectedItems", makeAny(aSelection)); + Sequence<sal_Int16> aSelection{ o3tl::narrowing<sal_Int16>(m_rComboBox.get_active()) }; + m_xPropSet->setPropertyValue("SelectedItems", Any(aSelection)); css::uno::Reference<css::form::XBoundComponent> xBound(m_xPropSet, css::uno::UNO_QUERY); if (xBound.is()) @@ -790,7 +783,6 @@ bool BibGeneralPage::AddXControl(const OUString& rName, weld::Entry& rEntry) if( xPropSet.is()) { - uno::Reference< beans::XPropertySetInfo > xPropInfo = xPropSet->getPropertySetInfo(); maChangeListeners.emplace_back(new EntryChangeListener(rEntry, xPropSet, *this)); maChangeListeners.back()->start(); if (&rEntry == m_xLocalURLED.get()) @@ -831,7 +823,7 @@ IMPL_LINK(BibGeneralPage, GainFocusHdl, weld::Widget&, rWidget, void) } template<class Target> void BibGeneralPage::AddControlWithError(const OUString& rColumnName, const OUString& rColumnUIName, - Target& rWidget, OUString& rErrorString, const OString& rHelpId) + Target& rWidget, OUString& rErrorString, const OUString& rHelpId) { rWidget.set_help_id(rHelpId); rWidget.connect_focus_in(LINK(this, BibGeneralPage, GainFocusHdl)); @@ -857,11 +849,9 @@ bool BibGeneralPage::AddXControl(const OUString& rName, weld::ComboBox& rList) if( xPropSet.is()) { - uno::Reference< beans::XPropertySetInfo > xPropInfo = xPropSet->getPropertySetInfo(); - css::uno::Sequence<OUString> aEntries; xPropSet->getPropertyValue("StringItemList") >>= aEntries; - for (const OUString& rString : std::as_const(aEntries)) + for (const OUString& rString : aEntries) rList.append_text(rString); sal_Int16 nSelection = -1; diff --git a/extensions/source/bibliography/general.hxx b/extensions/source/bibliography/general.hxx index ae8d587886ab..9708174ffa1f 100644 --- a/extensions/source/bibliography/general.hxx +++ b/extensions/source/bibliography/general.hxx @@ -21,15 +21,7 @@ #include <sal/config.h> -#include <string_view> - -#include <com/sun/star/awt/XFocusListener.hpp> -#include <com/sun/star/awt/XControlContainer.hpp> -#include <com/sun/star/form/XBoundComponent.hpp> -#include <com/sun/star/sdbc/XRowSetListener.hpp> - #include <vcl/InterimItemWindow.hxx> -#include <cppuhelper/implbase1.hxx> #include "bibshortcuthandler.hxx" @@ -135,7 +127,7 @@ class BibGeneralPage : public InterimItemWindow bool AddXControl(const OUString& rName, weld::ComboBox& rList); template<class Target> void AddControlWithError(const OUString& rColumnName, const OUString& rColumnUIName, - Target& rWidget, OUString& rErrorString, const OString& rHelpId); + Target& rWidget, OUString& rErrorString, const OUString& rHelpId); void SaveChanges(); diff --git a/extensions/source/bibliography/toolbar.cxx b/extensions/source/bibliography/toolbar.cxx index ef6c8b8559a1..35bd6b2320fb 100644 --- a/extensions/source/bibliography/toolbar.cxx +++ b/extensions/source/bibliography/toolbar.cxx @@ -19,8 +19,7 @@ #include <sal/config.h> -#include <string_view> - +#include <comphelper/propertyvalue.hxx> #include <comphelper/processfactory.hxx> #include <com/sun/star/frame/XDispatch.hpp> #include <com/sun/star/frame/XDispatchProvider.hpp> @@ -32,6 +31,7 @@ #include <o3tl/any.hxx> #include <svtools/miscopt.hxx> #include <svtools/imgdef.hxx> +#include <utility> #include <vcl/svapp.hxx> #include <vcl/settings.hxx> #include <vcl/mnemonic.hxx> @@ -49,9 +49,9 @@ using namespace ::com::sun::star::beans; // Constants -------------------------------------------------------------- -BibToolBarListener::BibToolBarListener(BibToolBar *pTB, const OUString& aStr, ToolBoxItemId nId): +BibToolBarListener::BibToolBarListener(BibToolBar *pTB, OUString aStr, ToolBoxItemId nId): nIndex(nId), - aCommand(aStr), + aCommand(std::move(aStr)), pToolBar(pTB) { } @@ -100,13 +100,8 @@ void BibTBListBoxListener::statusChanged(const css::frame::FeatureStateEvent& rE pToolBar->UpdateSourceList(false); pToolBar->ClearSourceList(); - const OUString* pStringArray = pStringSeq->getConstArray(); - - sal_uInt32 nCount = pStringSeq->getLength(); - OUString aEntry; - for( sal_uInt32 i=0; i<nCount; i++ ) + for (auto& aEntry : *pStringSeq) { - aEntry = pStringArray[i]; pToolBar->InsertSourceEntry(aEntry); } pToolBar->UpdateSourceList(true); @@ -139,13 +134,10 @@ void BibTBQueryMenuListener::statusChanged(const frame::FeatureStateEvent& rEvt) pToolBar->ClearFilterMenu(); - const OUString* pStringArray = pStringSeq->getConstArray(); - - sal_uInt32 nCount = pStringSeq->getLength(); - for( sal_uInt32 i=0; i<nCount; i++ ) + for (auto& string : *pStringSeq) { - sal_uInt16 nID = pToolBar->InsertFilterItem(pStringArray[i]); - if(pStringArray[i]==rEvt.FeatureDescriptor) + sal_uInt16 nID = pToolBar->InsertFilterItem(string); + if (string == rEvt.FeatureDescriptor) { pToolBar->SelectFilterItem(nID); } @@ -235,8 +227,7 @@ BibToolBar::BibToolBar(vcl::Window* pParent, Link<void*,void> aLink) , aLayoutManager(aLink) , nSymbolsSize(SFX_SYMBOLS_SIZE_SMALL) { - SvtMiscOptions aSvtMiscOptions; - nSymbolsSize = aSvtMiscOptions.GetCurrentSymbolsSize(); + nSymbolsSize = SvtMiscOptions::GetCurrentSymbolsSize(); xSource->Show(); pLbSource->connect_changed(LINK( this, BibToolBar, SelHdl)); @@ -350,14 +341,11 @@ void BibToolBar::Select() } else { - Sequence<PropertyValue> aPropVal(2); - PropertyValue* pPropertyVal = const_cast<PropertyValue*>(aPropVal.getConstArray()); - pPropertyVal[0].Name="QueryText"; - OUString aSelection = pEdQuery->get_text(); - pPropertyVal[0].Value <<= aSelection; - - pPropertyVal[1].Name="QueryField"; - pPropertyVal[1].Value <<= aQueryField; + Sequence<PropertyValue> aPropVal + { + comphelper::makePropertyValue("QueryText", pEdQuery->get_text()), + comphelper::makePropertyValue("QueryField", aQueryField) + }; SendDispatch(nId,aPropVal); } } @@ -427,7 +415,7 @@ sal_uInt16 BibToolBar::InsertFilterItem(const OUString& rMenuEntry) void BibToolBar::SelectFilterItem(sal_uInt16 nId) { - OString sId = OString::number(nId); + OUString sId = OUString::number(nId); xPopupMenu->set_active(sId, true); sSelMenuItem = sId; aQueryField = MnemonicGenerator::EraseAllMnemonicChars(xPopupMenu->get_label(sId)); @@ -475,20 +463,18 @@ bool BibToolBar::PreNotify( NotifyEvent& rNEvt ) { bool bResult = true; - MouseNotifyEvent nSwitch=rNEvt.GetType(); - if (pEdQuery && pEdQuery->has_focus() && nSwitch == MouseNotifyEvent::KEYINPUT) + NotifyEventType nSwitch=rNEvt.GetType(); + if (pEdQuery && pEdQuery->has_focus() && nSwitch == NotifyEventType::KEYINPUT) { const vcl::KeyCode& aKeyCode=rNEvt.GetKeyEvent()->GetKeyCode(); sal_uInt16 nKey = aKeyCode.GetCode(); if(nKey == KEY_RETURN) { - Sequence<PropertyValue> aPropVal(2); - PropertyValue* pPropertyVal = const_cast<PropertyValue*>(aPropVal.getConstArray()); - pPropertyVal[0].Name = "QueryText"; - OUString aSelection = pEdQuery->get_text(); - pPropertyVal[0].Value <<= aSelection; - pPropertyVal[1].Name="QueryField"; - pPropertyVal[1].Value <<= aQueryField; + Sequence<PropertyValue> aPropVal + { + comphelper::makePropertyValue("QueryText", pEdQuery->get_text()), + comphelper::makePropertyValue("QueryField", aQueryField) + }; SendDispatch(nTBC_BT_AUTOFILTER, aPropVal); return bResult; } @@ -507,11 +493,10 @@ IMPL_LINK_NOARG( BibToolBar, SelHdl, weld::ComboBox&, void ) IMPL_LINK_NOARG( BibToolBar, SendSelHdl, Timer*, void ) { - Sequence<PropertyValue> aPropVal(1); - PropertyValue* pPropertyVal = const_cast<PropertyValue*>(aPropVal.getConstArray()); - pPropertyVal[0].Name = "DataSourceName"; - OUString aEntry( MnemonicGenerator::EraseAllMnemonicChars( pLbSource->get_active_text() ) ); - pPropertyVal[0].Value <<= aEntry; + Sequence<PropertyValue> aPropVal + { + comphelper::makePropertyValue("DataSourceName", MnemonicGenerator::EraseAllMnemonicChars( pLbSource->get_active_text() )) + }; SendDispatch(nTBC_SOURCE, aPropVal); } @@ -527,7 +512,7 @@ IMPL_LINK_NOARG(BibToolBar, MenuHdl, ToolBox*, void) tools::Rectangle aRect(GetItemRect(nTBC_BT_AUTOFILTER)); weld::Window* pParent = weld::GetPopupParent(*this, aRect); - OString sId = xPopupMenu->popup_at_rect(pParent, aRect); + OUString sId = xPopupMenu->popup_at_rect(pParent, aRect); if (!sId.isEmpty()) { @@ -535,13 +520,11 @@ IMPL_LINK_NOARG(BibToolBar, MenuHdl, ToolBox*, void) xPopupMenu->set_active(sId, true); sSelMenuItem = sId; aQueryField = MnemonicGenerator::EraseAllMnemonicChars(xPopupMenu->get_label(sId)); - Sequence<PropertyValue> aPropVal(2); - PropertyValue* pPropertyVal = const_cast<PropertyValue*>(aPropVal.getConstArray()); - pPropertyVal[0].Name = "QueryText"; - OUString aSelection = pEdQuery->get_text(); - pPropertyVal[0].Value <<= aSelection; - pPropertyVal[1].Name="QueryField"; - pPropertyVal[1].Value <<= aQueryField; + Sequence<PropertyValue> aPropVal + { + comphelper::makePropertyValue("QueryText", pEdQuery->get_text()), + comphelper::makePropertyValue("QueryField", aQueryField) + }; SendDispatch(nTBC_BT_AUTOFILTER, aPropVal); } @@ -569,7 +552,7 @@ void BibToolBar::DataChanged( const DataChangedEvent& rDCEvt ) IMPL_LINK_NOARG( BibToolBar, OptionsChanged_Impl, LinkParamNone*, void ) { bool bRebuildToolBar = false; - sal_Int16 eSymbolsSize = SvtMiscOptions().GetCurrentSymbolsSize(); + sal_Int16 eSymbolsSize = SvtMiscOptions::GetCurrentSymbolsSize(); if ( nSymbolsSize != eSymbolsSize ) { nSymbolsSize = eSymbolsSize; @@ -583,7 +566,7 @@ IMPL_LINK_NOARG( BibToolBar, OptionsChanged_Impl, LinkParamNone*, void ) IMPL_LINK_NOARG( BibToolBar, SettingsChanged_Impl, VclSimpleEvent&, void ) { // Check if toolbar button size have changed and we have to use system settings - sal_Int16 eSymbolsSize = SvtMiscOptions().GetCurrentSymbolsSize(); + sal_Int16 eSymbolsSize = SvtMiscOptions::GetCurrentSymbolsSize(); if ( eSymbolsSize != nSymbolsSize ) { nSymbolsSize = eSymbolsSize; @@ -600,9 +583,9 @@ void BibToolBar::RebuildToolbar() void BibToolBar::ApplyImageList() { - SetItemImage(nTBC_BT_AUTOFILTER, Image(StockImage::Yes, nSymbolsSize == SFX_SYMBOLS_SIZE_SMALL ? OUString(RID_EXTBMP_AUTOFILTER_SC) : OUString(RID_EXTBMP_AUTOFILTER_LC))); - SetItemImage(nTBC_BT_FILTERCRIT, Image(StockImage::Yes, nSymbolsSize == SFX_SYMBOLS_SIZE_SMALL ? OUString(RID_EXTBMP_FILTERCRIT_SC) : OUString(RID_EXTBMP_FILTERCRIT_LC))); - SetItemImage(nTBC_BT_REMOVEFILTER, Image(StockImage::Yes, nSymbolsSize == SFX_SYMBOLS_SIZE_SMALL ? OUString(RID_EXTBMP_REMOVE_FILTER_SORT_SC) : OUString(RID_EXTBMP_REMOVE_FILTER_SORT_LC))); + SetItemImage(nTBC_BT_AUTOFILTER, Image(StockImage::Yes, nSymbolsSize == SFX_SYMBOLS_SIZE_SMALL ? RID_EXTBMP_AUTOFILTER_SC : RID_EXTBMP_AUTOFILTER_LC)); + SetItemImage(nTBC_BT_FILTERCRIT, Image(StockImage::Yes, nSymbolsSize == SFX_SYMBOLS_SIZE_SMALL ? RID_EXTBMP_FILTERCRIT_SC : RID_EXTBMP_FILTERCRIT_LC)); + SetItemImage(nTBC_BT_REMOVEFILTER, Image(StockImage::Yes, nSymbolsSize == SFX_SYMBOLS_SIZE_SMALL ? RID_EXTBMP_REMOVE_FILTER_SORT_SC : RID_EXTBMP_REMOVE_FILTER_SORT_LC)); AdjustToolBox(); } diff --git a/extensions/source/bibliography/toolbar.hxx b/extensions/source/bibliography/toolbar.hxx index 4f800f050b66..d4e45b2e0b80 100644 --- a/extensions/source/bibliography/toolbar.hxx +++ b/extensions/source/bibliography/toolbar.hxx @@ -44,7 +44,7 @@ protected: public: - BibToolBarListener(BibToolBar *pTB, const OUString& aStr, ToolBoxItemId nId); + BibToolBarListener(BibToolBar *pTB, OUString aStr, ToolBoxItemId nId); virtual ~BibToolBarListener() override; const OUString& GetCommand() const { return aCommand;} @@ -150,7 +150,7 @@ class BibToolBar: public ToolBox std::unique_ptr<weld::Builder> xBuilder; std::unique_ptr<weld::Menu> xPopupMenu; sal_uInt16 nMenuId; - OString sSelMenuItem; + OUString sSelMenuItem; OUString aQueryField; Link<void*,void> aLayoutManager; sal_Int16 nSymbolsSize; diff --git a/extensions/source/config/WinUserInfo/WinUserInfoBe.cxx b/extensions/source/config/WinUserInfo/WinUserInfoBe.cxx index f9f5f9545439..3e76f6faa9ce 100644 --- a/extensions/source/config/WinUserInfo/WinUserInfoBe.cxx +++ b/extensions/source/config/WinUserInfo/WinUserInfoBe.cxx @@ -11,14 +11,12 @@ #include <com/sun/star/beans/Optional.hpp> #include <comphelper/base64.hxx> -#include <comphelper/configurationhelper.hxx> -#include <com/sun/star/container/XNameAccess.hpp> -#include <com/sun/star/container/XNameReplace.hpp> -#include <com/sun/star/util/XChangesBatch.hpp> +#include <comphelper/configuration.hxx> #include <cppuhelper/supportsservice.hxx> #include <map> #include <o3tl/char16_t2wchar_t.hxx> -#include <tools/diagnose_ex.h> +#include <comphelper/diagnose_ex.hxx> +#include <officecfg/UserProfile.hxx> #include <Iads.h> #include <Adshlp.h> @@ -26,6 +24,9 @@ #define SECURITY_WIN32 #include <Security.h> +#include <systools/win32/comtools.hxx> +#include <systools/win32/oleauto.hxx> + namespace extensions { namespace config @@ -60,23 +61,23 @@ public: namespace { -constexpr OUStringLiteral givenname(u"givenname"); -constexpr OUStringLiteral sn(u"sn"); -constexpr char fathersname[]("fathersname"); -constexpr OUStringLiteral initials(u"initials"); -constexpr OUStringLiteral street(u"street"); -constexpr OUStringLiteral l(u"l"); -constexpr OUStringLiteral st(u"st"); -constexpr char apartment[]("apartment"); -constexpr OUStringLiteral postalcode(u"postalcode"); -constexpr OUStringLiteral c(u"c"); -constexpr OUStringLiteral o(u"o"); -constexpr char position[]("position"); -constexpr OUStringLiteral title(u"title"); -constexpr OUStringLiteral homephone(u"homephone"); -constexpr OUStringLiteral telephonenumber(u"telephonenumber"); -constexpr OUStringLiteral facsimiletelephonenumber(u"facsimiletelephonenumber"); -constexpr OUStringLiteral mail(u"mail"); +constexpr OUString _givenname(u"givenname"_ustr); +constexpr OUString _sn(u"sn"_ustr); +constexpr char _fathersname[]("fathersname"); +constexpr OUString _initials(u"initials"_ustr); +constexpr OUString _street(u"street"_ustr); +constexpr OUString _l(u"l"_ustr); +constexpr OUString _st(u"st"_ustr); +constexpr char _apartment[]("apartment"); +constexpr OUString _postalcode(u"postalcode"_ustr); +constexpr OUString _c(u"c"_ustr); +constexpr OUString _o(u"o"_ustr); +constexpr char _position[]("position"); +constexpr OUString _title(u"title"_ustr); +constexpr OUString _homephone(u"homephone"_ustr); +constexpr OUString _telephonenumber(u"telephonenumber"_ustr); +constexpr OUString _facsimiletelephonenumber(u"facsimiletelephonenumber"_ustr); +constexpr OUString _mail(u"mail"_ustr); // Backend class implementing access to Active Directory user data. It caches its encoded data // in a configuration entry, to allow reusing it when user later doesn't have access to AD DC @@ -84,118 +85,85 @@ constexpr OUStringLiteral mail(u"mail"); class ADsUserAccess : public extensions::config::WinUserInfo::WinUserInfoBe_Impl { public: - ADsUserAccess(const css::uno::Reference<css::uno::XComponentContext>& xContext) + ADsUserAccess() { try { - struct CoInitializeGuard - { - CoInitializeGuard() - { - if (FAILED(CoInitializeEx(nullptr, COINIT_APARTMENTTHREADED))) - throw css::uno::RuntimeException(); - } - ~CoInitializeGuard() { CoUninitialize(); } - } aCoInitializeGuard; - - IADsADSystemInfo* pADsys; - HRESULT hr = CoCreateInstance(CLSID_ADSystemInfo, nullptr, CLSCTX_INPROC_SERVER, - IID_IADsADSystemInfo, reinterpret_cast<void**>(&pADsys)); - if (FAILED(hr)) - throw css::uno::RuntimeException(); - CoIfPtr<IADsADSystemInfo> aADsysGuard(pADsys); + sal::systools::CoInitializeGuard aCoInitializeGuard(COINIT_APARTMENTTHREADED); - BSTR sUserDN; - hr = pADsys->get_UserName(&sUserDN); - if (FAILED(hr)) - throw css::uno::RuntimeException(); - BSTRGuard aUserNameGuard(sUserDN, SysFreeString); + sal::systools::COMReference<IADsADSystemInfo> pADsys(CLSID_ADSystemInfo, nullptr, + CLSCTX_INPROC_SERVER); + + sal::systools::BStr sUserDN; + sal::systools::ThrowIfFailed(pADsys->get_UserName(&sUserDN), "get_UserName failed"); // If this user is an AD user, then without an active connection to the domain, all the // above will succeed, and m_sUserDN will be correctly initialized, but the following // call to ADsGetObject will fail, and we will attempt reading cached values. - m_sUserDN = o3tl::toU(sUserDN); + m_sUserDN = sUserDN; OUString sLdapUserDN = "LDAP://" + m_sUserDN; - IADsUser* pUser; - hr = ADsGetObject(o3tl::toW(sLdapUserDN.getStr()), IID_IADsUser, - reinterpret_cast<void**>(&pUser)); - if (FAILED(hr)) - throw css::uno::RuntimeException(); - CoIfPtr<IADsUser> pUserGuard(pUser); + sal::systools::COMReference<IADsUser> pUser; + sal::systools::ThrowIfFailed(ADsGetObject(o3tl::toW(sLdapUserDN.getStr()), IID_IADsUser, + reinterpret_cast<void**>(&pUser)), + "ADsGetObject failed"); // Fetch all the required information right now, when we know to have access to AD // (later the connection may already be lost) - m_aMap[givenname] = Str(pUser, &IADsUser::get_FirstName); - m_aMap[sn] = Str(pUser, &IADsUser::get_LastName); - m_aMap[initials] = Str(pUser, L"initials"); - m_aMap[street] = Str(pUser, L"streetAddress"); - m_aMap[l] = Str(pUser, L"l"); - m_aMap[st] = Str(pUser, L"st"); - m_aMap[postalcode] = Str(pUser, L"postalCode"); - m_aMap[c] = Str(pUser, L"co"); - m_aMap[o] = Str(pUser, L"company"); - m_aMap[title] = Str(pUser, &IADsUser::get_Title); - m_aMap[homephone] = Str(pUser, L"homePhone"); - m_aMap[telephonenumber] = Str(pUser, L"TelephoneNumber"); - m_aMap[facsimiletelephonenumber] = Str(pUser, L"facsimileTelephoneNumber"); - m_aMap[mail] = Str(pUser, &IADsUser::get_EmailAddress); - - CacheData(xContext); + m_aMap[_givenname] = Str(pUser, &IADsUser::get_FirstName); + m_aMap[_sn] = Str(pUser, &IADsUser::get_LastName); + m_aMap[_initials] = Str(pUser, L"initials"); + m_aMap[_street] = Str(pUser, L"streetAddress"); + m_aMap[_l] = Str(pUser, L"l"); + m_aMap[_st] = Str(pUser, L"st"); + m_aMap[_postalcode] = Str(pUser, L"postalCode"); + m_aMap[_c] = Str(pUser, L"co"); + m_aMap[_o] = Str(pUser, L"company"); + m_aMap[_title] = Str(pUser, &IADsUser::get_Title); + m_aMap[_homephone] = Str(pUser, L"homePhone"); + m_aMap[_telephonenumber] = Str(pUser, L"TelephoneNumber"); + m_aMap[_facsimiletelephonenumber] = Str(pUser, L"facsimileTelephoneNumber"); + m_aMap[_mail] = Str(pUser, &IADsUser::get_EmailAddress); + + CacheData(); } - catch (css::uno::Exception&) + catch (sal::systools::ComError&) { // Maybe we temporarily lost connection to AD; try to get cached data - GetCachedData(xContext); + GetCachedData(); } } - virtual OUString GetGivenName() override { return m_aMap[givenname]; } - virtual OUString GetSn() override { return m_aMap[sn]; } - virtual OUString GetInitials() override { return m_aMap[initials]; } - virtual OUString GetStreet() override { return m_aMap[street]; } - virtual OUString GetCity() override { return m_aMap[l]; } - virtual OUString GetState() override { return m_aMap[st]; } - virtual OUString GetPostalCode() override { return m_aMap[postalcode]; } - virtual OUString GetCountry() override { return m_aMap[c]; } - virtual OUString GetOrganization() override { return m_aMap[o]; } - virtual OUString GetTitle() override { return m_aMap[title]; } - virtual OUString GetHomePhone() override { return m_aMap[homephone]; } - virtual OUString GetTelephoneNumber() override { return m_aMap[telephonenumber]; } - virtual OUString GetFaxNumber() override { return m_aMap[facsimiletelephonenumber]; } - virtual OUString GetMail() override { return m_aMap[mail]; } + virtual OUString GetGivenName() override { return m_aMap[_givenname]; } + virtual OUString GetSn() override { return m_aMap[_sn]; } + virtual OUString GetInitials() override { return m_aMap[_initials]; } + virtual OUString GetStreet() override { return m_aMap[_street]; } + virtual OUString GetCity() override { return m_aMap[_l]; } + virtual OUString GetState() override { return m_aMap[_st]; } + virtual OUString GetPostalCode() override { return m_aMap[_postalcode]; } + virtual OUString GetCountry() override { return m_aMap[_c]; } + virtual OUString GetOrganization() override { return m_aMap[_o]; } + virtual OUString GetTitle() override { return m_aMap[_title]; } + virtual OUString GetHomePhone() override { return m_aMap[_homephone]; } + virtual OUString GetTelephoneNumber() override { return m_aMap[_telephonenumber]; } + virtual OUString GetFaxNumber() override { return m_aMap[_facsimiletelephonenumber]; } + virtual OUString GetMail() override { return m_aMap[_mail]; } private: - static void ReleaseIUnknown(IUnknown* p) - { - if (p) - p->Release(); - } - template <class If> class CoIfPtr : public std::unique_ptr<If, decltype(&ReleaseIUnknown)> - { - public: - CoIfPtr(If* p = nullptr) - : std::unique_ptr<If, decltype(&ReleaseIUnknown)>(p, ReleaseIUnknown) - { - } - }; - typedef std::unique_ptr<OLECHAR, decltype(&SysFreeString)> BSTRGuard; - typedef HRESULT (__stdcall IADsUser::*getstrfunc)(BSTR*); static OUString Str(IADsUser* pUser, getstrfunc func) { - BSTR sBstr; + sal::systools::BStr sBstr; if (FAILED((pUser->*func)(&sBstr))) return ""; - BSTRGuard aBstrGuard(sBstr, SysFreeString); - return OUString(o3tl::toU(sBstr)); + return OUString(sBstr); } static OUString Str(IADsUser* pUser, const wchar_t* property) { - BSTRGuard sBstrProp(SysAllocString(property), SysFreeString); + sal::systools::BStr sBstrProp{ o3tl::toU(property) }; struct AutoVariant : public VARIANT { AutoVariant() { VariantInit(this); } ~AutoVariant() { VariantClear(this); } } varArr; - if (FAILED(pUser->GetEx(sBstrProp.get(), &varArr))) + if (FAILED(pUser->GetEx(sBstrProp, &varArr))) return ""; SAFEARRAY* sa = V_ARRAY(&varArr); LONG nStart, nEnd; @@ -213,41 +181,35 @@ private: return ""; } - void CacheData(const css::uno::Reference<css::uno::XComponentContext>& xContext) + void CacheData() { try { OUString sCachedData = "user=" + m_sUserDN // user DN - + "\0" + givenname + "=" + GetGivenName() // 1st name - + "\0" + sn + "=" + GetSn() // sn - + "\0" + initials + "=" + GetInitials() // initials - + "\0" + street + "=" + GetStreet() // street - + "\0" + l + "=" + GetCity() // l - + "\0" + st + "=" + GetState() // st - + "\0" + postalcode + "=" + GetPostalCode() // p.code - + "\0" + c + "=" + GetCountry() // c - + "\0" + o + "=" + GetOrganization() // o - + "\0" + title + "=" + GetTitle() // title - + "\0" + homephone + "=" + GetHomePhone() // h.phone - + "\0" + telephonenumber + "=" + GetTelephoneNumber() // tel - + "\0" + facsimiletelephonenumber + "=" + GetFaxNumber() // fax - + "\0" + mail + "=" + GetMail(); // mail + + "\0" + _givenname + "=" + GetGivenName() // 1st name + + "\0" + _sn + "=" + GetSn() // sn + + "\0" + _initials + "=" + GetInitials() // initials + + "\0" + _street + "=" + GetStreet() // street + + "\0" + _l + "=" + GetCity() // l + + "\0" + _st + "=" + GetState() // st + + "\0" + _postalcode + "=" + GetPostalCode() // p.code + + "\0" + _c + "=" + GetCountry() // c + + "\0" + _o + "=" + GetOrganization() // o + + "\0" + _title + "=" + GetTitle() // title + + "\0" + _homephone + "=" + GetHomePhone() // h.phone + + "\0" + _telephonenumber + "=" + GetTelephoneNumber() // tel + + "\0" + _facsimiletelephonenumber + "=" + GetFaxNumber() // fax + + "\0" + _mail + "=" + GetMail(); // mail const css::uno::Sequence<sal_Int8> seqCachedData( reinterpret_cast<const sal_Int8*>(sCachedData.getStr()), sCachedData.getLength() * sizeof(sal_Unicode)); OUStringBuffer sOutBuf; comphelper::Base64::encode(sOutBuf, seqCachedData); - auto xIface = comphelper::ConfigurationHelper::openConfig( - xContext, "org.openoffice.UserProfile/WinUserInfo", - comphelper::EConfigurationModes::Standard); - css::uno::Reference<css::container::XNameReplace> xNameReplace( - xIface, css::uno::UNO_QUERY_THROW); - xNameReplace->replaceByName("Cache", css::uno::makeAny(sOutBuf.makeStringAndClear())); - - css::uno::Reference<css::util::XChangesBatch> xChangesBatch(xIface, - css::uno::UNO_QUERY_THROW); - xChangesBatch->commitChanges(); + std::shared_ptr<comphelper::ConfigurationChanges> batch( + comphelper::ConfigurationChanges::create()); + officecfg::UserProfile::WinUserInfo::Cache::set(sOutBuf.makeStringAndClear(), batch); + batch->commit(); } catch (const css::uno::Exception&) { @@ -256,18 +218,13 @@ private: } } - void GetCachedData(const css::uno::Reference<css::uno::XComponentContext>& xContext) + void GetCachedData() { if (m_sUserDN.isEmpty()) throw css::uno::RuntimeException(); - auto xIface = comphelper::ConfigurationHelper::openConfig( - xContext, "org.openoffice.UserProfile/WinUserInfo", - comphelper::EConfigurationModes::ReadOnly); - css::uno::Reference<css::container::XNameAccess> xNameAccess(xIface, - css::uno::UNO_QUERY_THROW); - OUString sCache; - xNameAccess->getByName("Cache") >>= sCache; + OUString sCache = officecfg::UserProfile::WinUserInfo::Cache::get(); + if (sCache.isEmpty()) throw css::uno::RuntimeException(); @@ -346,13 +303,13 @@ namespace config { namespace WinUserInfo { -WinUserInfoBe::WinUserInfoBe(const css::uno::Reference<css::uno::XComponentContext>& xContext) +WinUserInfoBe::WinUserInfoBe() : WinUserInfoMutexHolder() , BackendBase(mMutex) { try { - m_pImpl.reset(new ADsUserAccess(xContext)); + m_pImpl.reset(new ADsUserAccess()); } catch (css::uno::RuntimeException&) { @@ -373,79 +330,79 @@ css::uno::Any WinUserInfoBe::getPropertyValue(OUString const& PropertyName) OUString sValue; // Only process the first argument of possibly multiple space- or comma-separated arguments OUString sToken = PropertyName.getToken(0, ' ').getToken(0, ','); - if (sToken == givenname) + if (sToken == _givenname) { sValue = m_pImpl->GetGivenName(); } - else if (sToken == sn) + else if (sToken == _sn) { sValue = m_pImpl->GetSn(); } - else if (sToken == fathersname) + else if (sToken == _fathersname) { sValue = m_pImpl->GetFathersname(); } - else if (sToken == initials) + else if (sToken == _initials) { sValue = m_pImpl->GetInitials(); } - else if (sToken == street) + else if (sToken == _street) { sValue = m_pImpl->GetStreet(); } - else if (sToken == l) + else if (sToken == _l) { sValue = m_pImpl->GetCity(); } - else if (sToken == st) + else if (sToken == _st) { sValue = m_pImpl->GetState(); } - else if (sToken == apartment) + else if (sToken == _apartment) { sValue = m_pImpl->GetApartment(); } - else if (sToken == postalcode) + else if (sToken == _postalcode) { sValue = m_pImpl->GetPostalCode(); } - else if (sToken == c) + else if (sToken == _c) { sValue = m_pImpl->GetCountry(); } - else if (sToken == o) + else if (sToken == _o) { sValue = m_pImpl->GetOrganization(); } - else if (sToken == position) + else if (sToken == _position) { sValue = m_pImpl->GetPosition(); } - else if (sToken == title) + else if (sToken == _title) { sValue = m_pImpl->GetTitle(); } - else if (sToken == homephone) + else if (sToken == _homephone) { sValue = m_pImpl->GetHomePhone(); } - else if (sToken == telephonenumber) + else if (sToken == _telephonenumber) { sValue = m_pImpl->GetTelephoneNumber(); } - else if (sToken == facsimiletelephonenumber) + else if (sToken == _facsimiletelephonenumber) { sValue = m_pImpl->GetFaxNumber(); } - else if (sToken == mail) + else if (sToken == _mail) { sValue = m_pImpl->GetMail(); } else throw css::beans::UnknownPropertyException(sToken, static_cast<cppu::OWeakObject*>(this)); - return css::uno::makeAny(css::beans::Optional<css::uno::Any>( - !sValue.isEmpty(), sValue.isEmpty() ? css::uno::Any() : css::uno::makeAny(sValue))); + return css::uno::Any(css::beans::Optional<css::uno::Any>( + !sValue.isEmpty(), sValue.isEmpty() ? css::uno::Any() : css::uno::Any(sValue))); } OUString SAL_CALL WinUserInfoBe::getImplementationName() @@ -467,10 +424,10 @@ css::uno::Sequence<OUString> SAL_CALL WinUserInfoBe::getSupportedServiceNames() } extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface* -extensions_WinUserInfoBe_get_implementation(css::uno::XComponentContext* context, +extensions_WinUserInfoBe_get_implementation(css::uno::XComponentContext*, css::uno::Sequence<css::uno::Any> const&) { - return cppu::acquire(new extensions::config::WinUserInfo::WinUserInfoBe(context)); + return cppu::acquire(new extensions::config::WinUserInfo::WinUserInfoBe()); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/extensions/source/config/WinUserInfo/WinUserInfoBe.hxx b/extensions/source/config/WinUserInfo/WinUserInfoBe.hxx index 7914121469c7..30ca088c3aca 100644 --- a/extensions/source/config/WinUserInfo/WinUserInfoBe.hxx +++ b/extensions/source/config/WinUserInfo/WinUserInfoBe.hxx @@ -51,7 +51,7 @@ struct WinUserInfoMutexHolder class WinUserInfoBe : private WinUserInfoMutexHolder, public BackendBase { public: - explicit WinUserInfoBe(const css::uno::Reference<css::uno::XComponentContext>& xContext); + explicit WinUserInfoBe(); virtual ~WinUserInfoBe() override; // XServiceInfo diff --git a/extensions/source/config/ldap/ldapuserprofilebe.cxx b/extensions/source/config/ldap/ldapuserprofilebe.cxx index 8be633a4ca3e..a735b5fbd71a 100644 --- a/extensions/source/config/ldap/ldapuserprofilebe.cxx +++ b/extensions/source/config/ldap/ldapuserprofilebe.cxx @@ -21,7 +21,7 @@ #include "ldapaccess.hxx" #include "ldapuserprofilebe.hxx" #include <sal/log.hxx> -#include <tools/diagnose_ex.h> +#include <comphelper/diagnose_ex.hxx> #include <rtl/instance.hxx> #include <com/sun/star/beans/NamedValue.hpp> @@ -35,8 +35,7 @@ namespace extensions::config::ldap { LdapUserProfileBe::LdapUserProfileBe( const uno::Reference<uno::XComponentContext>& xContext) -: LdapProfileMutexHolder(), - BackendBase(mMutex) +: BackendBase(m_aMutex) { LdapDefinition aDefinition; OUString loggedOnUser; @@ -47,7 +46,7 @@ LdapUserProfileBe::LdapUserProfileBe( const uno::Reference<uno::XComponentContex // the configuration for the backend would create another instance of the // backend, which would try and read the configuration which would... { - osl::Mutex & aInitMutex = rtl::Static< osl::Mutex, LdapUserProfileBe >::get(); + static osl::Mutex aInitMutex; osl::MutexGuard aInitGuard(aInitMutex); static bool bReentrantCall; // = false @@ -94,10 +93,9 @@ bool LdapUserProfileBe::readLdapConfiguration( uno::Reference< lang::XMultiServiceFactory > xCfgProvider( css::configuration::theDefaultProvider::get(context)); - css::beans::NamedValue aPath("nodepath", uno::makeAny(OUString("org.openoffice.LDAP/UserDirectory")) ); + css::beans::NamedValue aPath("nodepath", uno::Any(OUString("org.openoffice.LDAP/UserDirectory")) ); - uno::Sequence< uno::Any > aArgs(1); - aArgs[0] <<= aPath; + uno::Sequence< uno::Any > aArgs{ uno::Any(aPath) }; xIface = xCfgProvider->createInstanceWithArguments("com.sun.star.configuration.ConfigurationAccess", aArgs); @@ -174,16 +172,16 @@ css::uno::Any LdapUserProfileBe::getPropertyValue( } LdapData::iterator k(data_.find(PropertyName.copy(i, j - i))); if (k != data_.end()) { - return css::uno::makeAny( + return css::uno::Any( css::beans::Optional< css::uno::Any >( - true, css::uno::makeAny(k->second))); + true, css::uno::Any(k->second))); } if (j == PropertyName.getLength()) { break; } i = j + 1; } - return css::uno::makeAny(css::beans::Optional< css::uno::Any >()); + return css::uno::Any(css::beans::Optional< css::uno::Any >()); } diff --git a/extensions/source/config/ldap/ldapuserprofilebe.hxx b/extensions/source/config/ldap/ldapuserprofilebe.hxx index 06e8c8f5a0dd..2f05365328db 100644 --- a/extensions/source/config/ldap/ldapuserprofilebe.hxx +++ b/extensions/source/config/ldap/ldapuserprofilebe.hxx @@ -23,6 +23,7 @@ #include <com/sun/star/lang/XServiceInfo.hpp> #include <com/sun/star/container/XNameAccess.hpp> #include <cppuhelper/compbase.hxx> +#include <cppuhelper/basemutex.hxx> #include "ldapaccess.hxx" @@ -41,13 +42,12 @@ struct LdapDefinition; typedef cppu::WeakComponentImplHelper<css::beans::XPropertySet, lang::XServiceInfo> BackendBase ; -struct LdapProfileMutexHolder { osl::Mutex mMutex; }; /** Implements the PlatformBackend service, a specialization of the XPropertySet service for retrieving LDAP user profile configuration settings from an LDAP repository. */ -class LdapUserProfileBe : private LdapProfileMutexHolder, public BackendBase +class LdapUserProfileBe : private cppu::BaseMutex, public BackendBase { public: diff --git a/extensions/source/dbpilots/commonpagesdbp.cxx b/extensions/source/dbpilots/commonpagesdbp.cxx index 3566e91c5c61..8bac5d09c42c 100644 --- a/extensions/source/dbpilots/commonpagesdbp.cxx +++ b/extensions/source/dbpilots/commonpagesdbp.cxx @@ -31,7 +31,7 @@ #include <com/sun/star/sdb/CommandType.hpp> #include <com/sun/star/ui/dialogs/TemplateDescription.hpp> #include <tools/debug.hxx> -#include <tools/diagnose_ex.h> +#include <comphelper/diagnose_ex.hxx> #include <comphelper/interaction.hxx> #include <connectivity/dbtools.hxx> #include <sfx2/docfilt.hxx> @@ -46,7 +46,6 @@ namespace dbp using namespace ::com::sun::star; using namespace ::com::sun::star::uno; - using namespace ::com::sun::star::lang; using namespace ::com::sun::star::container; using namespace ::com::sun::star::sdb; using namespace ::com::sun::star::sdbc; @@ -58,7 +57,6 @@ namespace dbp : OControlWizardPage(pPage, pWizard, "modules/sabpilot/ui/tableselectionpage.ui", "TableSelectionPage") , m_xTable(m_xBuilder->weld_tree_view("table")) , m_xDatasource(m_xBuilder->weld_tree_view("datasource")) - , m_xDatasourceLabel(m_xBuilder->weld_label("datasourcelabel")) , m_xSearchDatabase(m_xBuilder->weld_button("search")) , m_xSourceBox(m_xBuilder->weld_container("sourcebox")) { @@ -162,13 +160,13 @@ namespace dbp xOldConn = getFormConnection(); OUString sDataSource = m_xDatasource->get_selected_text(); - rContext.xForm->setPropertyValue("DataSourceName", makeAny( sDataSource ) ); + rContext.xForm->setPropertyValue("DataSourceName", Any( sDataSource ) ); } OUString sCommand = m_xTable->get_selected_text(); sal_Int32 nCommandType = m_xTable->get_selected_id().toInt32(); - rContext.xForm->setPropertyValue("Command", makeAny( sCommand ) ); - rContext.xForm->setPropertyValue("CommandType", makeAny( nCommandType ) ); + rContext.xForm->setPropertyValue("Command", Any( sCommand ) ); + rContext.xForm->setPropertyValue("CommandType", Any( nCommandType ) ); if ( !rContext.bEmbedded ) setFormConnection( xOldConn, false ); @@ -344,7 +342,7 @@ namespace dbp lcl_fillEntries(*m_xTable, aQueryNames, BMP_QUERY, CommandType::QUERY); } - OMaybeListSelectionPage::OMaybeListSelectionPage(weld::Container* pPage, OControlWizard* pWizard, const OUString& rUIXMLDescription, const OString& rID) + OMaybeListSelectionPage::OMaybeListSelectionPage(weld::Container* pPage, OControlWizard* pWizard, const OUString& rUIXMLDescription, const OUString& rID) : OControlWizardPage(pPage, pWizard, rUIXMLDescription, rID) , m_pYes(nullptr) , m_pNo(nullptr) diff --git a/extensions/source/dbpilots/commonpagesdbp.hxx b/extensions/source/dbpilots/commonpagesdbp.hxx index 1ae74215009a..66115a14451c 100644 --- a/extensions/source/dbpilots/commonpagesdbp.hxx +++ b/extensions/source/dbpilots/commonpagesdbp.hxx @@ -29,7 +29,6 @@ namespace dbp { std::unique_ptr<weld::TreeView> m_xTable; std::unique_ptr<weld::TreeView> m_xDatasource; - std::unique_ptr<weld::Label> m_xDatasourceLabel; std::unique_ptr<weld::Button> m_xSearchDatabase; std::unique_ptr<weld::Container> m_xSourceBox; @@ -66,7 +65,7 @@ namespace dbp weld::ComboBox* m_pList; public: - OMaybeListSelectionPage(weld::Container* pPage, OControlWizard* pWizard, const OUString& rUIXMLDescription, const OString& rID); + OMaybeListSelectionPage(weld::Container* pPage, OControlWizard* pWizard, const OUString& rUIXMLDescription, const OUString& rID); virtual ~OMaybeListSelectionPage() override; protected: @@ -89,7 +88,6 @@ namespace dbp class ODBFieldPage : public OMaybeListSelectionPage { - protected: std::unique_ptr<weld::Label> m_xDescription; std::unique_ptr<weld::RadioButton> m_xStoreYes; std::unique_ptr<weld::RadioButton> m_xStoreNo; diff --git a/extensions/source/dbpilots/controlwizard.cxx b/extensions/source/dbpilots/controlwizard.cxx index e8a2dfef1189..5a3eca35b539 100644 --- a/extensions/source/dbpilots/controlwizard.cxx +++ b/extensions/source/dbpilots/controlwizard.cxx @@ -19,7 +19,7 @@ #include "controlwizard.hxx" #include <tools/debug.hxx> -#include <tools/diagnose_ex.h> +#include <comphelper/diagnose_ex.hxx> #include <com/sun/star/container/XNameAccess.hpp> #include <com/sun/star/sdbcx/XTablesSupplier.hpp> #include <com/sun/star/sdb/DatabaseContext.hpp> @@ -50,7 +50,6 @@ namespace dbp { using namespace ::com::sun::star::uno; using namespace ::com::sun::star::awt; - using namespace ::com::sun::star::lang; using namespace ::com::sun::star::sdb; using namespace ::com::sun::star::sdbc; using namespace ::com::sun::star::sdbcx; @@ -72,7 +71,7 @@ namespace dbp OAccessRegulator() { } }; - OControlWizardPage::OControlWizardPage(weld::Container* pPage, OControlWizard* pWizard, const OUString& rUIXMLDescription, const OString& rID) + OControlWizardPage::OControlWizardPage(weld::Container* pPage, OControlWizard* pWizard, const OUString& rUIXMLDescription, const OUString& rID) : OControlWizardPage_Base(pPage, pWizard, rUIXMLDescription, rID) , m_pDialog(pWizard) { @@ -117,23 +116,18 @@ namespace dbp void OControlWizardPage::fillListBox(weld::TreeView& _rList, const Sequence< OUString >& _rItems) { _rList.clear(); - const OUString* pItems = _rItems.getConstArray(); - const OUString* pEnd = pItems + _rItems.getLength(); - sal_Int32 nIndex = 0; - for (;pItems < pEnd; ++pItems, ++nIndex) + for (sal_Int32 nIndex = 0; nIndex < _rItems.getLength(); ++nIndex) { - _rList.append(OUString::number(nIndex), *pItems); + _rList.append(OUString::number(nIndex), _rItems[nIndex]); } } void OControlWizardPage::fillListBox(weld::ComboBox& _rList, const Sequence< OUString >& _rItems) { _rList.clear(); - const OUString* pItems = _rItems.getConstArray(); - const OUString* pEnd = pItems + _rItems.getLength(); - for (;pItems < pEnd; ++pItems) + for (auto& item : _rItems) { - _rList.append_text(*pItems); + _rList.append_text(item); } } @@ -150,7 +144,6 @@ namespace dbp m_xFormDatasource = m_xBuilder->weld_label("datasource"); m_xFormDatasourceLabel = m_xBuilder->weld_label("datasourcelabel"); m_xFormTable = m_xBuilder->weld_label("formtable"); - m_xFormTableLabel = m_xBuilder->weld_label("formtablelabel"); const OControlWizardContext& rContext = getContext(); if ( rContext.bEmbedded ) @@ -411,7 +404,7 @@ namespace dbp } else { - m_aContext.xForm->setPropertyValue("ActiveConnection", makeAny( _rxConn ) ); + m_aContext.xForm->setPropertyValue("ActiveConnection", Any( _rxConn ) ); } } catch(const Exception&) @@ -527,7 +520,7 @@ namespace dbp // not interested in any results, only in the fields Reference< XPropertySet > xStatementProps(xStatement, UNO_QUERY); - xStatementProps->setPropertyValue("MaxRows", makeAny(sal_Int32(0))); + xStatementProps->setPropertyValue("MaxRows", Any(sal_Int32(0))); // TODO: think about handling local SQLExceptions here ... Reference< XColumnsSupplier > xSupplyCols(xStatement->executeQuery(), UNO_QUERY); @@ -541,15 +534,13 @@ namespace dbp if (xColumns.is()) { m_aContext.aFieldNames = xColumns->getElementNames(); - const OUString* pBegin = m_aContext.aFieldNames.getConstArray(); - const OUString* pEnd = pBegin + m_aContext.aFieldNames.getLength(); - for(;pBegin != pEnd;++pBegin) + for (auto& name : m_aContext.aFieldNames) { sal_Int32 nFieldType = DataType::OTHER; try { Reference< XPropertySet > xColumn; - xColumns->getByName(*pBegin) >>= xColumn; + xColumns->getByName(name) >>= xColumn; xColumn->getPropertyValue("Type") >>= nFieldType; } catch(const Exception&) @@ -558,7 +549,7 @@ namespace dbp "extensions.dbpilots", "unexpected exception while gathering column information!"); } - m_aContext.aTypes.emplace(*pBegin,nFieldType); + m_aContext.aTypes.emplace(name, nFieldType); } } } @@ -576,16 +567,15 @@ namespace dbp { // an SQLException (or derivee) was thrown ... // prepend an extra SQLContext explaining what we were doing - SQLContext aContext; - aContext.Message = compmodule::ModuleRes(RID_STR_COULDNOTOPENTABLE); - aContext.NextException = aSQLException; + SQLContext aContext(compmodule::ModuleRes(RID_STR_COULDNOTOPENTABLE), {}, {}, 0, + aSQLException, {}); // create an interaction handler to display this exception Reference< XInteractionHandler > xHandler = getInteractionHandler(m_xAssistant.get()); if ( !xHandler.is() ) return false; - Reference< XInteractionRequest > xRequest = new OInteractionRequest(makeAny(aContext)); + Reference< XInteractionRequest > xRequest = new OInteractionRequest(Any(aContext)); try { xHandler->handle(xRequest); @@ -613,7 +603,7 @@ namespace dbp OUString sControlLabel(_pSettings->sControlLabel); m_aContext.xObjectModel->setPropertyValue( "Label", - makeAny(sControlLabel) + Any(sControlLabel) ); } } diff --git a/extensions/source/dbpilots/controlwizard.hxx b/extensions/source/dbpilots/controlwizard.hxx index cf55c655e574..12138899f9dd 100644 --- a/extensions/source/dbpilots/controlwizard.hxx +++ b/extensions/source/dbpilots/controlwizard.hxx @@ -49,7 +49,6 @@ namespace dbp std::unique_ptr<weld::Label> m_xFormDatasource; std::unique_ptr<weld::Label> m_xFormContentTypeLabel; std::unique_ptr<weld::Label> m_xFormContentType; - std::unique_ptr<weld::Label> m_xFormTableLabel; std::unique_ptr<weld::Label> m_xFormTable; std::unique_ptr<weld::Frame> m_xFrame; @@ -62,7 +61,7 @@ namespace dbp css::uno::Reference< css::sdbc::XConnection > getFormConnection() const; public: - OControlWizardPage(weld::Container* pPage, OControlWizard* pWizard, const OUString& rUIXMLDescription, const OString& rID); + OControlWizardPage(weld::Container* pPage, OControlWizard* pWizard, const OUString& rUIXMLDescription, const OUString& rID); virtual ~OControlWizardPage() override; protected: diff --git a/extensions/source/dbpilots/gridwizard.cxx b/extensions/source/dbpilots/gridwizard.cxx index 0559858ca1ca..ec61df855503 100644 --- a/extensions/source/dbpilots/gridwizard.cxx +++ b/extensions/source/dbpilots/gridwizard.cxx @@ -40,7 +40,6 @@ namespace dbp using namespace ::com::sun::star::uno; - using namespace ::com::sun::star::lang; using namespace ::com::sun::star::beans; using namespace ::com::sun::star::sdbc; using namespace ::com::sun::star::container; @@ -93,8 +92,8 @@ namespace dbp if (!xColumnFactory.is() || !xColumnContainer.is()) return; - static constexpr OUStringLiteral s_sMouseWheelBehavior = u"MouseWheelBehavior"; - static constexpr OUStringLiteral s_sEmptyString = u""; + static constexpr OUString s_sMouseWheelBehavior = u"MouseWheelBehavior"_ustr; + static constexpr OUString s_sEmptyString = u""_ustr; // collect "descriptors" for the to-be-created (grid)columns std::vector< OUString > aColumnServiceNames; // service names to be used with the XGridColumnFactory @@ -106,29 +105,27 @@ namespace dbp aFormFieldNames.reserve(getSettings().aSelectedFields.getLength()); // loop through the selected field names - const OUString* pSelectedFields = getSettings().aSelectedFields.getConstArray(); - const OUString* pEnd = pSelectedFields + getSettings().aSelectedFields.getLength(); - for (;pSelectedFields < pEnd; ++pSelectedFields) + for (auto& selectedField : getSettings().aSelectedFields) { // get the information for the selected column sal_Int32 nFieldType = DataType::OTHER; - OControlWizardContext::TNameTypeMap::const_iterator aFind = rContext.aTypes.find(*pSelectedFields); + OControlWizardContext::TNameTypeMap::const_iterator aFind = rContext.aTypes.find(selectedField); if ( aFind != rContext.aTypes.end() ) nFieldType = aFind->second; - aFormFieldNames.push_back(*pSelectedFields); + aFormFieldNames.push_back(selectedField); switch (nFieldType) { case DataType::BIT: case DataType::BOOLEAN: - aColumnServiceNames.push_back(OUString("CheckBox")); + aColumnServiceNames.emplace_back("CheckBox"); aColumnLabelPostfixes.push_back(s_sEmptyString); break; case DataType::TINYINT: case DataType::SMALLINT: case DataType::INTEGER: - aColumnServiceNames.push_back(OUString("NumericField")); + aColumnServiceNames.emplace_back("NumericField"); aColumnLabelPostfixes.push_back(s_sEmptyString); break; @@ -137,31 +134,31 @@ namespace dbp case DataType::DOUBLE: case DataType::NUMERIC: case DataType::DECIMAL: - aColumnServiceNames.push_back(OUString("FormattedField")); + aColumnServiceNames.emplace_back("FormattedField"); aColumnLabelPostfixes.push_back(s_sEmptyString); break; case DataType::DATE: - aColumnServiceNames.push_back(OUString("DateField")); + aColumnServiceNames.emplace_back("DateField"); aColumnLabelPostfixes.push_back(s_sEmptyString); break; case DataType::TIME: - aColumnServiceNames.push_back(OUString("TimeField")); + aColumnServiceNames.emplace_back("TimeField"); aColumnLabelPostfixes.push_back(s_sEmptyString); break; case DataType::TIMESTAMP: - aColumnServiceNames.push_back(OUString("DateField")); + aColumnServiceNames.emplace_back("DateField"); aColumnLabelPostfixes.push_back(compmodule::ModuleRes(RID_STR_DATEPOSTFIX)); - aFormFieldNames.push_back(*pSelectedFields); - aColumnServiceNames.push_back(OUString("TimeField")); + aFormFieldNames.push_back(selectedField); + aColumnServiceNames.emplace_back("TimeField"); aColumnLabelPostfixes.push_back(compmodule::ModuleRes(RID_STR_TIMEPOSTFIX)); break; default: - aColumnServiceNames.push_back(OUString("TextField")); + aColumnServiceNames.emplace_back("TextField"); aColumnLabelPostfixes.push_back(s_sEmptyString); } } @@ -189,17 +186,17 @@ namespace dbp disambiguateName(xExistenceChecker, sColumnName); // the data field the column should be bound to - xColumn->setPropertyValue("DataField", makeAny(*pFormFieldName)); + xColumn->setPropertyValue("DataField", Any(*pFormFieldName)); // the label - xColumn->setPropertyValue("Label", makeAny(*pFormFieldName + *pColumnLabelPostfix)); + xColumn->setPropertyValue("Label", Any(*pFormFieldName + *pColumnLabelPostfix)); // the width (<void/> => column will be auto-sized) xColumn->setPropertyValue("Width", Any()); if ( xColumnPSI->hasPropertyByName( s_sMouseWheelBehavior ) ) - xColumn->setPropertyValue( s_sMouseWheelBehavior, makeAny( MouseWheelBehavior::SCROLL_DISABLED ) ); + xColumn->setPropertyValue( s_sMouseWheelBehavior, Any( MouseWheelBehavior::SCROLL_DISABLED ) ); // insert the column - xColumnContainer->insertByName(sColumnName, makeAny(xColumn)); + xColumnContainer->insertByName(sColumnName, Any(xColumn)); } catch(const Exception&) { @@ -216,7 +213,7 @@ namespace dbp std::unique_ptr<BuilderPage> OGridWizard::createPage(WizardState _nState) { - OString sIdent(OString::number(_nState)); + OUString sIdent(OUString::number(_nState)); weld::Container* pPageContainer = m_xAssistant->append_page(sIdent); switch (_nState) @@ -325,13 +322,10 @@ namespace dbp fillListBox(*m_xExistFields, rContext.aFieldNames); m_xSelFields->clear(); - const OGridSettings& rSettings = getSettings(); - const OUString* pSelected = rSettings.aSelectedFields.getConstArray(); - const OUString* pEnd = pSelected + rSettings.aSelectedFields.getLength(); - for (; pSelected < pEnd; ++pSelected) + for (auto& field : getSettings().aSelectedFields) { - m_xSelFields->append_text(*pSelected); - m_xExistFields->remove_text(*pSelected); + m_xSelFields->append_text(field); + m_xExistFields->remove_text(field); } implCheckButtons(); diff --git a/extensions/source/dbpilots/gridwizard.hxx b/extensions/source/dbpilots/gridwizard.hxx index 774e6cd69d34..dc2c069e9f76 100644 --- a/extensions/source/dbpilots/gridwizard.hxx +++ b/extensions/source/dbpilots/gridwizard.hxx @@ -60,7 +60,7 @@ namespace dbp class OGridPage : public OControlWizardPage { public: - OGridPage(weld::Container* pPage, OGridWizard* pWizard, const OUString& rUIXMLDescription, const OString& rID) + OGridPage(weld::Container* pPage, OGridWizard* pWizard, const OUString& rUIXMLDescription, const OUString& rID) : OControlWizardPage(pPage, pWizard, rUIXMLDescription, rID) { } diff --git a/extensions/source/dbpilots/groupboxwiz.cxx b/extensions/source/dbpilots/groupboxwiz.cxx index ead0e4a4e48e..37b79d8ed4e3 100644 --- a/extensions/source/dbpilots/groupboxwiz.cxx +++ b/extensions/source/dbpilots/groupboxwiz.cxx @@ -20,7 +20,7 @@ #include "groupboxwiz.hxx" #include "commonpagesdbp.hxx" #include <tools/debug.hxx> -#include <tools/diagnose_ex.h> +#include <comphelper/diagnose_ex.hxx> #include "optiongrouplayouter.hxx" #include <helpids.h> #include <o3tl/safeint.hxx> @@ -34,7 +34,6 @@ namespace dbp { using namespace ::com::sun::star::uno; - using namespace ::com::sun::star::lang; using namespace ::com::sun::star::beans; using namespace ::com::sun::star::form; @@ -60,7 +59,7 @@ namespace dbp std::unique_ptr<BuilderPage> OGroupBoxWizard::createPage(::vcl::WizardTypes::WizardState _nState) { - OString sIdent(OString::number(_nState)); + OUString sIdent(OUString::number(_nState)); weld::Container* pPageContainer = m_xAssistant->append_page(sIdent); switch (_nState) @@ -280,17 +279,21 @@ namespace dbp m_xMoveLeft->set_sensitive(bSelectedSome); m_xMoveRight->set_sensitive(bUnfinishedInput); - getDialog()->enableButtons(WizardButtonFlags::NEXT, bHaveSome); + OControlWizard* pDialogController = getDialog(); + + pDialogController->enableButtons(WizardButtonFlags::NEXT, bHaveSome); + + weld::Dialog* pDialog = pDialogController->getDialog(); if (bUnfinishedInput) { - if (!m_xMoveRight->get_has_default()) - getDialog()->defaultButton(m_xMoveRight.get()); + if (!pDialog->is_default_widget(m_xMoveRight.get())) + pDialogController->defaultButton(m_xMoveRight.get()); } else { - if (m_xMoveRight->get_has_default()) - getDialog()->defaultButton(WizardButtonFlags::NEXT); + if (pDialog->is_default_widget(m_xMoveRight.get())) + pDialogController->defaultButton(WizardButtonFlags::NEXT); } } diff --git a/extensions/source/dbpilots/groupboxwiz.hxx b/extensions/source/dbpilots/groupboxwiz.hxx index 18fa12c7ffe5..73950ed36918 100644 --- a/extensions/source/dbpilots/groupboxwiz.hxx +++ b/extensions/source/dbpilots/groupboxwiz.hxx @@ -65,7 +65,7 @@ namespace dbp class OGBWPage : public OControlWizardPage { public: - OGBWPage(weld::Container* pPage, OControlWizard* pWizard, const OUString& rUIXMLDescription, const OString& rID) + OGBWPage(weld::Container* pPage, OControlWizard* pWizard, const OUString& rUIXMLDescription, const OUString& rID) : OControlWizardPage(pPage, pWizard, rUIXMLDescription, rID) { } diff --git a/extensions/source/dbpilots/listcombowizard.cxx b/extensions/source/dbpilots/listcombowizard.cxx index cde03e22356e..1e90b3c33df9 100644 --- a/extensions/source/dbpilots/listcombowizard.cxx +++ b/extensions/source/dbpilots/listcombowizard.cxx @@ -25,7 +25,7 @@ #include <com/sun/star/form/ListSourceType.hpp> #include <com/sun/star/sdbcx/XColumnsSupplier.hpp> #include <tools/debug.hxx> -#include <tools/diagnose_ex.h> +#include <comphelper/diagnose_ex.hxx> #include <connectivity/dbtools.hxx> #include <helpids.h> #include <osl/diagnose.h> @@ -36,7 +36,6 @@ namespace dbp using namespace ::com::sun::star::uno; - using namespace ::com::sun::star::lang; using namespace ::com::sun::star::beans; using namespace ::com::sun::star::sdbc; using namespace ::com::sun::star::sdbcx; @@ -83,7 +82,7 @@ namespace dbp std::unique_ptr<BuilderPage> OListComboWizard::createPage(WizardState _nState) { - OString sIdent(OString::number(_nState)); + OUString sIdent(OUString::number(_nState)); weld::Container* pPageContainer = m_xAssistant->append_page(sIdent); switch (_nState) @@ -170,19 +169,20 @@ namespace dbp } // ListSourceType: SQL - getContext().xObjectModel->setPropertyValue("ListSourceType", makeAny(sal_Int32(ListSourceType_SQL))); + getContext().xObjectModel->setPropertyValue("ListSourceType", Any(sal_Int32(ListSourceType_SQL))); if (isListBox()) { // BoundColumn: 1 - getContext().xObjectModel->setPropertyValue("BoundColumn", makeAny(sal_Int16(1))); - - // build the statement to set as list source - OUString sStatement = "SELECT " + - getSettings().sListContentField + ", " + getSettings().sLinkedListField + - " FROM " + getSettings().sListContentTable; - Sequence< OUString > aListSource { sStatement }; - getContext().xObjectModel->setPropertyValue("ListSource", makeAny(aListSource)); + getContext().xObjectModel->setPropertyValue("BoundColumn", Any(sal_Int16(1))); + + Sequence< OUString > aListSource { + // build the statement to set as list source + OUString("SELECT " + + getSettings().sListContentField + ", " + getSettings().sLinkedListField + + " FROM " + getSettings().sListContentTable) + }; + getContext().xObjectModel->setPropertyValue("ListSource", Any(aListSource)); } else { @@ -190,11 +190,11 @@ namespace dbp OUString sStatement = "SELECT DISTINCT " + getSettings().sListContentField + " FROM " + getSettings().sListContentTable; - getContext().xObjectModel->setPropertyValue( "ListSource", makeAny(sStatement)); + getContext().xObjectModel->setPropertyValue( "ListSource", Any(sStatement)); } // the bound field - getContext().xObjectModel->setPropertyValue("DataField", makeAny(getSettings().sLinkedFormField)); + getContext().xObjectModel->setPropertyValue("DataField", Any(getSettings().sLinkedFormField)); } catch(const Exception&) { diff --git a/extensions/source/dbpilots/listcombowizard.hxx b/extensions/source/dbpilots/listcombowizard.hxx index 7ab6a8a21d0f..5e61296f89be 100644 --- a/extensions/source/dbpilots/listcombowizard.hxx +++ b/extensions/source/dbpilots/listcombowizard.hxx @@ -77,7 +77,7 @@ namespace dbp class OLCPage : public OControlWizardPage { public: - OLCPage(weld::Container* pPage, OListComboWizard* pWizard, const OUString& rUIXMLDescription, const OString& rID) + OLCPage(weld::Container* pPage, OListComboWizard* pWizard, const OUString& rUIXMLDescription, const OUString& rID) : OControlWizardPage(pPage, pWizard, rUIXMLDescription, rID) { } diff --git a/extensions/source/dbpilots/optiongrouplayouter.cxx b/extensions/source/dbpilots/optiongrouplayouter.cxx index 23afd922cec4..c35b0cefc8d7 100644 --- a/extensions/source/dbpilots/optiongrouplayouter.cxx +++ b/extensions/source/dbpilots/optiongrouplayouter.cxx @@ -28,7 +28,7 @@ #include <com/sun/star/view/XSelectionSupplier.hpp> #include "groupboxwiz.hxx" #include "dbptools.hxx" -#include <tools/diagnose_ex.h> +#include <comphelper/diagnose_ex.hxx> namespace dbp @@ -116,20 +116,20 @@ namespace dbp UNO_QUERY); // the label - xRadioModel->setPropertyValue("Label", makeAny(*aLabelIter)); + xRadioModel->setPropertyValue("Label", Any(*aLabelIter)); // the value - xRadioModel->setPropertyValue("RefValue", makeAny(*aValueIter)); + xRadioModel->setPropertyValue("RefValue", Any(*aValueIter)); // default selection if (_rSettings.sDefaultField == *aLabelIter) - xRadioModel->setPropertyValue("DefaultState", makeAny(sal_Int16(1))); + xRadioModel->setPropertyValue("DefaultState", Any(sal_Int16(1))); // the connection to the database field if (!_rSettings.sDBField.isEmpty()) - xRadioModel->setPropertyValue("DataField", makeAny(_rSettings.sDBField)); + xRadioModel->setPropertyValue("DataField", Any(_rSettings.sDBField)); // the name for the model - xRadioModel->setPropertyValue("Name", makeAny(sElementsName)); + xRadioModel->setPropertyValue("Name", Any(sElementsName)); // create a shape for the radio button Reference< XControlShape > xRadioShape( @@ -164,7 +164,7 @@ namespace dbp // set the GroupBox as "LabelControl" for the RadioButton // (_after_ having inserted the model into the page!) - xRadioModel->setPropertyValue("LabelControl", makeAny(_rContext.xObjectModel)); + xRadioModel->setPropertyValue("LabelControl", Any(_rContext.xObjectModel)); } // group the shapes @@ -176,7 +176,7 @@ namespace dbp Reference< XShapeGroup > xGroupedOptions = xGrouper->group(xButtonCollection); Reference< XSelectionSupplier > xSelector(_rContext.xDocumentModel->getCurrentController(), UNO_QUERY); if (xSelector.is()) - xSelector->select(makeAny(xGroupedOptions)); + xSelector->select(Any(xGroupedOptions)); } } catch(Exception&) @@ -189,12 +189,12 @@ namespace dbp void OOptionGroupLayouter::implAnchorShape(const Reference< XPropertySet >& _rxShapeProps) { - static constexpr OUStringLiteral s_sAnchorPropertyName = u"AnchorType"; + static constexpr OUString s_sAnchorPropertyName = u"AnchorType"_ustr; Reference< XPropertySetInfo > xPropertyInfo; if (_rxShapeProps.is()) xPropertyInfo = _rxShapeProps->getPropertySetInfo(); if (xPropertyInfo.is() && xPropertyInfo->hasPropertyByName(s_sAnchorPropertyName)) - _rxShapeProps->setPropertyValue(s_sAnchorPropertyName, makeAny(TextContentAnchorType_AT_PAGE)); + _rxShapeProps->setPropertyValue(s_sAnchorPropertyName, Any(TextContentAnchorType_AT_PAGE)); } diff --git a/extensions/source/dbpilots/unoautopilot.hxx b/extensions/source/dbpilots/unoautopilot.hxx index a61df8a6a205..ea6e886d2d13 100644 --- a/extensions/source/dbpilots/unoautopilot.hxx +++ b/extensions/source/dbpilots/unoautopilot.hxx @@ -26,6 +26,7 @@ #include <cppuhelper/typeprovider.hxx> #include <com/sun/star/beans/XPropertySet.hpp> #include <com/sun/star/beans/PropertyValue.hpp> +#include <utility> #include <vcl/svapp.hxx> namespace dbp @@ -41,7 +42,7 @@ namespace dbp OUString aImplementationName, const css::uno::Sequence<OUString>& aSupportedServices) : OUnoAutoPilot_Base(_rxORB), - m_ImplementationName(aImplementationName), + m_ImplementationName(std::move(aImplementationName)), m_SupportedServices(aSupportedServices) { } diff --git a/extensions/source/logging/csvformatter.cxx b/extensions/source/logging/csvformatter.cxx index 0d0ec6479c5e..a9ea13f208ca 100644 --- a/extensions/source/logging/csvformatter.cxx +++ b/extensions/source/logging/csvformatter.cxx @@ -28,6 +28,8 @@ #include <cppuhelper/supportsservice.hxx> #include <rtl/ustrbuf.hxx> +#include <sal/macros.h> +#include <sal/types.h> #include <stdio.h> #include <string_view> @@ -88,32 +90,34 @@ namespace { const sal_Unicode quote_char = '"'; const sal_Unicode comma_char = ','; - constexpr OUStringLiteral dos_newline = u"\r\n"; + constexpr OUString dos_newline = u"\r\n"_ustr; bool needsQuoting(std::u16string_view str) { return str.find_first_of(u"\",\n\r") != std::u16string_view::npos; }; - void appendEncodedString(OUStringBuffer& buf, const OUString& str) + void appendEncodedString(OUStringBuffer& buf, std::u16string_view str) { if(needsQuoting(str)) { // each double-quote will get replaced by two double-quotes buf.append(quote_char); const sal_Int32 buf_offset = buf.getLength(); - const sal_Int32 str_length = str.getLength(); + const size_t str_length = str.size(); buf.append(str); // special treatment for the last character if(quote_char==str[str_length-1]) buf.append(quote_char); // iterating backwards because the index at which we insert won't be shifted // when moving that way. - for(sal_Int32 i = str_length; i>=0; ) + for(size_t i = str_length;; ) { - i=str.lastIndexOf(quote_char, --i); - if(i!=-1) - buf.insert(buf_offset + i, quote_char); + --i; + i=str.substr(i).rfind(quote_char); + if(i==std::u16string_view::npos) + break; + buf.insert(buf_offset + i, quote_char); } buf.append(quote_char); } @@ -198,8 +202,7 @@ namespace logging sal_Int32 columns = m_Columnnames.getLength(); for(sal_Int32 i=0; i<columns; i++) { - buf.append(m_Columnnames[i]); - buf.append(comma_char); + buf.append(m_Columnnames[i] + OUStringChar(comma_char)); } buf.setLength(buf.getLength()-1); buf.append(dos_newline); @@ -212,14 +215,12 @@ namespace logging if(m_LogEventNo) { - aLogEntry.append( record.SequenceNumber ); - aLogEntry.append(comma_char); + aLogEntry.append(record.SequenceNumber + comma_char); } if(m_LogThread) { - aLogEntry.append( record.ThreadID ); - aLogEntry.append(comma_char); + aLogEntry.append(record.ThreadID + OUStringChar(comma_char)); } if(m_LogTimestamp) @@ -236,16 +237,16 @@ namespace logging } // ISO 8601 - char buffer[ 31 ]; + char buffer[ SAL_N_ELEMENTS("-32768-65535-65535T65535:65535:65535.4294967295") ]; const size_t buffer_size = sizeof( buffer ); - snprintf( buffer, buffer_size, "%04i-%02i-%02iT%02i:%02i:%02i.%09i", + snprintf( buffer, buffer_size, "%04i-%02u-%02uT%02u:%02u:%02u.%09" SAL_PRIuUINT32, static_cast<int>(record.LogTime.Year), - static_cast<int>(record.LogTime.Month), - static_cast<int>(record.LogTime.Day), - static_cast<int>(record.LogTime.Hours), - static_cast<int>(record.LogTime.Minutes), - static_cast<int>(record.LogTime.Seconds), - static_cast<int>(record.LogTime.NanoSeconds) ); + static_cast<unsigned int>(record.LogTime.Month), + static_cast<unsigned int>(record.LogTime.Day), + static_cast<unsigned int>(record.LogTime.Hours), + static_cast<unsigned int>(record.LogTime.Minutes), + static_cast<unsigned int>(record.LogTime.Seconds), + record.LogTime.NanoSeconds ); aLogEntry.appendAscii( buffer ); aLogEntry.append(comma_char); } diff --git a/extensions/source/logging/filehandler.cxx b/extensions/source/logging/filehandler.cxx index 200a3a64bbd0..8108f7c6abf8 100644 --- a/extensions/source/logging/filehandler.cxx +++ b/extensions/source/logging/filehandler.cxx @@ -29,7 +29,7 @@ #include <com/sun/star/util/PathSubstitution.hpp> #include <com/sun/star/util/XStringSubstitution.hpp> -#include <tools/diagnose_ex.h> +#include <comphelper/diagnose_ex.hxx> #include <cppuhelper/compbase.hxx> #include <cppuhelper/basemutex.hxx> diff --git a/extensions/source/logging/logger.cxx b/extensions/source/logging/logger.cxx index a49f8de87c93..4ae2f79362fc 100644 --- a/extensions/source/logging/logger.cxx +++ b/extensions/source/logging/logger.cxx @@ -32,8 +32,8 @@ #include <cppuhelper/implbase.hxx> #include <cppuhelper/supportsservice.hxx> #include <cppuhelper/weakref.hxx> -#include <rtl/ref.hxx> #include <map> +#include <utility> namespace logging @@ -64,7 +64,7 @@ namespace logging // </attributes> public: - EventLogger( const Reference< XComponentContext >& _rxContext, const OUString& _rName ); + EventLogger( const Reference< XComponentContext >& _rxContext, OUString _aName ); // XLogger virtual OUString SAL_CALL getName() override; @@ -114,11 +114,11 @@ namespace logging } - EventLogger::EventLogger( const Reference< XComponentContext >& _rxContext, const OUString& _rName ) + EventLogger::EventLogger( const Reference< XComponentContext >& _rxContext, OUString _aName ) :m_aHandlers( m_aMutex ) ,m_nEventNumber( 0 ) ,m_nLogLevel( css::logging::LogLevel::OFF ) - ,m_sName( _rName ) + ,m_sName(std::move( _aName )) { osl_atomic_increment( &m_refCount ); { diff --git a/extensions/source/logging/loggerconfig.cxx b/extensions/source/logging/loggerconfig.cxx index 4fd183099544..daf42859b833 100644 --- a/extensions/source/logging/loggerconfig.cxx +++ b/extensions/source/logging/loggerconfig.cxx @@ -34,7 +34,7 @@ #include <com/sun/star/logging/XLogHandler.hpp> #include <com/sun/star/logging/XLogFormatter.hpp> -#include <tools/diagnose_ex.h> +#include <comphelper/diagnose_ex.hxx> #include <osl/process.h> #include <cppuhelper/component_context.hxx> @@ -54,7 +54,6 @@ namespace logging using ::com::sun::star::lang::XSingleServiceFactory; using ::com::sun::star::uno::XInterface; using ::com::sun::star::util::XChangesBatch; - using ::com::sun::star::uno::makeAny; using ::com::sun::star::lang::NullPointerException; using ::com::sun::star::uno::Exception; using ::com::sun::star::lang::ServiceNotRegisteredException; @@ -105,22 +104,19 @@ namespace logging ::sal::static_int_cast< sal_Int16 >( aDateTime.NanoSeconds / 10000000 ) ); OUString sTime = OUString::createFromAscii( buffer ); - OUString sDateTime = sDate + "." + sTime; - oslProcessIdentifier aProcessId = 0; oslProcessInfo info; info.Size = sizeof (oslProcessInfo); if ( osl_getProcessInfo ( nullptr, osl_Process_IDENTIFIER, &info ) == osl_Process_E_None) aProcessId = info.Ident; - OUString aPID = OUString::number( aProcessId ); Variable const aVariables[] = { {std::u16string_view(u"$(loggername)"), sLoggerName}, {std::u16string_view(u"$(date)"), sDate}, {std::u16string_view(u"$(time)"), sTime}, - {std::u16string_view(u"$(datetime)"), sDateTime}, - {std::u16string_view(u"$(pid)"), aPID} + {std::u16string_view(u"$(datetime)"), sDate + "." + sTime }, + {std::u16string_view(u"$(pid)"), OUString::number(aProcessId)} }; for (Variable const & aVariable : aVariables) @@ -191,8 +187,7 @@ namespace logging bool bSuccess = false; if ( aSettings.hasElements() ) { - Sequence< Any > aConstructionArgs(1); - aConstructionArgs[0] <<= aSettings; + Sequence< Any > aConstructionArgs{ Any(aSettings) }; xInstance = _rContext->getServiceManager()->createInstanceWithArgumentsAndContext(sServiceName, aConstructionArgs, _rContext); bSuccess = xInstance.is(); } @@ -222,11 +217,8 @@ namespace logging css::configuration::theDefaultProvider::get(_rContext)); // write access to the "Settings" node (which includes settings for all loggers) - Sequence< Any > aArguments(1); - aArguments[0] <<= NamedValue( - "nodepath", - makeAny( OUString( "/org.openoffice.Office.Logging/Settings" ) ) - ); + Sequence<Any> aArguments{ Any(NamedValue( + "nodepath", Any(OUString("/org.openoffice.Office.Logging/Settings")))) }; Reference< XNameContainer > xAllSettings( xConfigProvider->createInstanceWithArguments( "com.sun.star.configuration.ConfigurationUpdateAccess", aArguments @@ -238,7 +230,7 @@ namespace logging // no node yet for this logger. Create default settings. Reference< XSingleServiceFactory > xNodeFactory( xAllSettings, UNO_QUERY_THROW ); Reference< XInterface > xLoggerSettings( xNodeFactory->createInstance(), css::uno::UNO_SET_THROW ); - xAllSettings->insertByName( sLoggerName, makeAny( xLoggerSettings ) ); + xAllSettings->insertByName( sLoggerName, Any( xLoggerSettings ) ); Reference< XChangesBatch > xChanges( xAllSettings, UNO_QUERY_THROW ); xChanges->commitChanges(); } diff --git a/extensions/source/logging/loghandler.cxx b/extensions/source/logging/loghandler.cxx index afc33605b9fc..a398bd053acd 100644 --- a/extensions/source/logging/loghandler.cxx +++ b/extensions/source/logging/loghandler.cxx @@ -25,7 +25,7 @@ #include <com/sun/star/lang/DisposedException.hpp> #include <com/sun/star/logging/PlainTextFormatter.hpp> -#include <tools/diagnose_ex.h> +#include <comphelper/diagnose_ex.hxx> #include <rtl/tencinfo.h> @@ -36,7 +36,6 @@ namespace logging using ::com::sun::star::uno::Reference; using ::com::sun::star::uno::XComponentContext; using ::com::sun::star::logging::LogRecord; - using ::com::sun::star::uno::UNO_QUERY_THROW; using ::com::sun::star::logging::XLogFormatter; using ::com::sun::star::uno::Exception; using ::com::sun::star::lang::IllegalArgumentException; diff --git a/extensions/source/logging/plaintextformatter.cxx b/extensions/source/logging/plaintextformatter.cxx index 23392b61c491..2c534a2a2e8f 100644 --- a/extensions/source/logging/plaintextformatter.cxx +++ b/extensions/source/logging/plaintextformatter.cxx @@ -105,14 +105,11 @@ namespace logging if ( !(_rRecord.SourceClassName.isEmpty() || _rRecord.SourceMethodName.isEmpty()) ) { - aLogEntry.append( _rRecord.SourceClassName ); - aLogEntry.append( "::" ); - aLogEntry.append( _rRecord.SourceMethodName ); - aLogEntry.append( ": " ); + aLogEntry.append( _rRecord.SourceClassName + "::" + + _rRecord.SourceMethodName + ": " ); } - aLogEntry.append( _rRecord.Message ); - aLogEntry.append( "\n" ); + aLogEntry.append( _rRecord.Message + "\n" ); return aLogEntry.makeStringAndClear(); } diff --git a/extensions/source/logging/simpletextformatter.cxx b/extensions/source/logging/simpletextformatter.cxx index 71e40a362562..b54fea5a645b 100644 --- a/extensions/source/logging/simpletextformatter.cxx +++ b/extensions/source/logging/simpletextformatter.cxx @@ -27,8 +27,6 @@ #include <cppuhelper/implbase.hxx> #include <cppuhelper/supportsservice.hxx> -#include <rtl/ustrbuf.hxx> - namespace logging { using css::logging::LogRecord; diff --git a/extensions/source/ole/oledll.cxx b/extensions/source/ole/oledll.cxx index 1275f4dc60c5..9ed73a33042d 100644 --- a/extensions/source/ole/oledll.cxx +++ b/extensions/source/ole/oledll.cxx @@ -30,7 +30,6 @@ #pragma clang diagnostic ignored "-Winvalid-noreturn" #pragma clang diagnostic ignored "-Wmicrosoft" #pragma clang diagnostic ignored "-Wnon-pod-varargs" -#pragma clang diagnostic ignored "-Wnon-virtual-dtor" #endif #include <atlbase.h> diff --git a/extensions/source/ole/oleobjw.cxx b/extensions/source/ole/oleobjw.cxx index ba33772c171a..160b094acb64 100644 --- a/extensions/source/ole/oleobjw.cxx +++ b/extensions/source/ole/oleobjw.cxx @@ -1018,7 +1018,9 @@ Any IUnknownWrapper::invokeWithDispIdUnoTlb(const OUString& sFunctionName, if( outParameterCount && pMethod) { OutParamIndex.realloc( outParameterCount); + auto pOutParamIndex = OutParamIndex.getArray(); OutParam.realloc( outParameterCount); + auto pOutParam = OutParam.getArray(); sal_Int32 outIndex=0; int i = 0; try @@ -1027,13 +1029,13 @@ Any IUnknownWrapper::invokeWithDispIdUnoTlb(const OUString& sFunctionName, { if( pMethod->pParams[i].bOut ) { - OutParamIndex[outIndex]= static_cast<sal_Int16>(i); + pOutParamIndex[outIndex]= static_cast<sal_Int16>(i); Any outAny; if( !bJScriptObject) { variantToAny( &pVarParamsRef[outIndex], outAny, Type(pMethod->pParams[i].pTypeRef), false); - OutParam[outIndex++]= outAny; + pOutParam[outIndex++]= outAny; } else //JScriptObject { @@ -1047,7 +1049,7 @@ Any IUnknownWrapper::invokeWithDispIdUnoTlb(const OUString& sFunctionName, { variantToAny( &varOut, outAny, Type(pMethod->pParams[parameterCount - 1 - i].pTypeRef), false); - OutParam[outParameterCount - 1 - outIndex++]= outAny; + pOutParam[outParameterCount - 1 - outIndex++]= outAny; } else bConvRet= false; @@ -1548,7 +1550,7 @@ TypeDescription IUnknownWrapper::getInterfaceMemberDescOfCurrentCall(std::u16str { TypeDescription ret; - for( auto const & rType : std::as_const(m_seqTypes) ) + for (auto const& rType : m_seqTypes) { TypeDescription _curDesc( rType ); _curDesc.makeComplete(); @@ -1985,6 +1987,8 @@ Any IUnknownWrapper::invokeWithDispIdComTlb(FuncDesc& aFuncDesc, // Convert out params if (outParamsCount) { + auto pOutParamIndex = OutParamIndex.getArray(); + auto pOutParam = OutParam.getArray(); int outParamIndex=0; for (int paramIndex = 0; paramIndex < nUnoArgs; paramIndex ++) { @@ -2021,8 +2025,8 @@ Any IUnknownWrapper::invokeWithDispIdComTlb(FuncDesc& aFuncDesc, e.ArgumentIndex = paramIndex; throw; } - OutParam[outParamIndex] = outAny; - OutParamIndex[outParamIndex] = ::sal::static_int_cast< sal_Int16, int >( paramIndex ); + pOutParam[outParamIndex] = outAny; + pOutParamIndex[outParamIndex] = ::sal::static_int_cast< sal_Int16, int >( paramIndex ); outParamIndex++; } OutParam.realloc(outParamIndex); diff --git a/extensions/source/ole/olethread.cxx b/extensions/source/ole/olethread.cxx index 1580c0b7d44a..503f8bc096c1 100644 --- a/extensions/source/ole/olethread.cxx +++ b/extensions/source/ole/olethread.cxx @@ -34,14 +34,17 @@ void o2u_attachCurrentThread() { // FIXME: is it a problem that this ends up in STA currently? assert(RPC_E_CHANGED_MODE == hr); // Let's find out explicitly what apartment mode we are in. - SAL_WARN("extensions.olebridge", "CoInitializeEx failed" - << (hr == RPC_E_CHANGED_MODE ? " (expectedly)" : "") - << ": " << WindowsErrorStringFromHRESULT(hr)); + if (hr == RPC_E_CHANGED_MODE) + SAL_INFO("extensions.olebridge", "CoInitializeEx failed (expectedly): " + << WindowsErrorStringFromHRESULT(hr)); + else + SAL_WARN("extensions.olebridge", + "CoInitializeEx failed: " << WindowsErrorStringFromHRESULT(hr)); APTTYPE nAptType; APTTYPEQUALIFIER nAptTypeQualifier; if (SUCCEEDED(CoGetApartmentType(&nAptType, &nAptTypeQualifier))) { - SAL_WARN("extensions.olebridge", + SAL_INFO("extensions.olebridge", " Thread is in a " << (nAptType == APTTYPE_STA ? OUString("single-threaded") : (nAptType == APTTYPE_MTA ? OUString("multi-threaded") : diff --git a/extensions/source/ole/servprov.cxx b/extensions/source/ole/servprov.cxx index ea69be1d9fe2..0c3920ccca11 100644 --- a/extensions/source/ole/servprov.cxx +++ b/extensions/source/ole/servprov.cxx @@ -33,6 +33,7 @@ #include <cppuhelper/supportsservice.hxx> #include <o3tl/any.hxx> #include <o3tl/char16_t2wchar_t.hxx> +#include <officecfg/Office/Common.hxx> #include <ooo/vba/XHelperInterface.hpp> #include <sal/log.hxx> @@ -144,8 +145,12 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP OneInstanceOleWrapper::CreateInstance(IUnknown SAL_INFO("extensions.olebridge", "OneInstanceOleWrapper::CreateInstance(" << riid << ")"); - HRESULT ret = ResultFromScode(E_UNEXPECTED); + if (officecfg::Office::Common::Security::Scripting::DisableOLEAutomation::get()) + { + return ResultFromScode(E_NOINTERFACE); + } + HRESULT ret = ResultFromScode(E_UNEXPECTED); const Reference<XInterface>& xInst = m_xInstFunction(); if (xInst.is()) { @@ -305,8 +310,7 @@ css::uno::Sequence<OUString> OleConverter::getSupportedServiceNames() "com.sun.star.bridge.OleBridgeSupplier2", "com.sun.star.bridge.oleautomation.BridgeSupplier"}; } - return css::uno::Sequence<OUString>{ - "com.sun.star.bridge.OleBridgeSupplierVar1"}; + return {"com.sun.star.bridge.OleBridgeSupplierVar1"}; } // XInitialize ------------------------------------------------------------------------------ diff --git a/extensions/source/ole/unoconversionutilities.hxx b/extensions/source/ole/unoconversionutilities.hxx index 338d85b622da..a73a714abe55 100644 --- a/extensions/source/ole/unoconversionutilities.hxx +++ b/extensions/source/ole/unoconversionutilities.hxx @@ -405,7 +405,7 @@ void UnoConversionUtilities<T>::variantToAny( const VARIANTARG* pArg, Any& rAny, { try { - Any anySeq = makeAny(unoSeq); + Any anySeq(unoSeq); Any convAny = conv->convertTo(anySeq, ptype); rAny = convAny; } @@ -1280,7 +1280,7 @@ void UnoConversionUtilities<T>::getElementCountAndTypeOfSequence( const Any& rS { sal_Int32 dimCount= (*static_cast<uno_Sequence* const *>(rSeq.getValue()))->nElements; if( dimCount > seqElementCounts[ dim-1]) - seqElementCounts[ dim-1]= dimCount; + seqElementCounts.getArray()[ dim-1]= dimCount; // we need the element type to construct the any that is // passed into getElementCountAndTypeOfSequence again @@ -2331,11 +2331,12 @@ Sequence<Type> UnoConversionUtilities<T>::getImplementedInterfaces(IUnknown* pUn if( anyNames >>= seqAny) { seqTypes.realloc( seqAny.getLength()); + auto pseqTypes = seqTypes.getArray(); for( sal_Int32 i=0; i < seqAny.getLength(); i++) { OUString typeName; seqAny[i] >>= typeName; - seqTypes[i]= Type( TypeClass_INTERFACE, typeName); + pseqTypes[i]= Type( TypeClass_INTERFACE, typeName); } } } diff --git a/extensions/source/ole/unoobjw.cxx b/extensions/source/ole/unoobjw.cxx index 81fbae1a0aca..915ecd92f8fc 100644 --- a/extensions/source/ole/unoobjw.cxx +++ b/extensions/source/ole/unoobjw.cxx @@ -41,7 +41,6 @@ #pragma clang diagnostic ignored "-Winvalid-noreturn" #pragma clang diagnostic ignored "-Wmicrosoft" #pragma clang diagnostic ignored "-Wnon-pod-varargs" -#pragma clang diagnostic ignored "-Wnon-virtual-dtor" #pragma clang diagnostic ignored "-Wnonportable-include-path" #pragma clang diagnostic ignored "-Wsequence-point" #pragma clang diagnostic ignored "-Wtypename-missing" @@ -1818,7 +1817,7 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP InterfaceOleWrapper::Invoke(DISPID dispidMembe sParams += ","; std::stringstream aStringStream; aStringStream << pdispparams->rgvarg[i]; - sParams += OUString::createFromAscii(aStringStream.str().c_str()); + sParams += OUString::createFromAscii(aStringStream.str()); } sParams += "]"; #endif @@ -2326,6 +2325,7 @@ Sink::Call( const OUString& Method, Sequence< Any >& Arguments ) aMethods.getLength() > 0); int nMemId = 1; + auto ArgumentsRange = asNonConstRange(Arguments); // Skip the three XInterface methods for (int i = 3; i < aMethods.getLength(); i++) { @@ -2374,9 +2374,7 @@ Sink::Call( const OUString& Method, Sequence< Any >& Arguments ) aDispParams.rgvarg[j].vt |= VT_BYREF; break; case VT_BOOL: - // SAL_ DEBUG("===> VT_BOOL is initially " << (int)aDispParams.rgvarg[j].boolVal); aDispParams.rgvarg[j].byref = new VARIANT_BOOL(aDispParams.rgvarg[j].boolVal); - // SAL_ DEBUG(" byref=" << aDispParams.rgvarg[j].byref); aDispParams.rgvarg[j].vt |= VT_BYREF; break; default: @@ -2419,21 +2417,21 @@ Sink::Call( const OUString& Method, Sequence< Any >& Arguments ) case VT_BYREF|VT_I2: { SHORT *pI = static_cast<SHORT*>(aDispParams.rgvarg[j].byref); - Arguments[nIncomingArgIndex] <<= static_cast<sal_Int16>(*pI); + ArgumentsRange[nIncomingArgIndex] <<= static_cast<sal_Int16>(*pI); delete pI; } break; case VT_BYREF|VT_I4: { LONG *pL = static_cast<LONG*>(aDispParams.rgvarg[j].byref); - Arguments[nIncomingArgIndex] <<= static_cast<sal_Int32>(*pL); + ArgumentsRange[nIncomingArgIndex] <<= static_cast<sal_Int32>(*pL); delete pL; } break; case VT_BYREF|VT_BSTR: { BSTR *pBstr = static_cast<BSTR*>(aDispParams.rgvarg[j].byref); - Arguments[nIncomingArgIndex] <<= OUString(o3tl::toU(*pBstr)); + ArgumentsRange[nIncomingArgIndex] <<= OUString(o3tl::toU(*pBstr)); // Undo SysAllocString() done in anyToVariant() SysFreeString(*pBstr); delete pBstr; @@ -2442,8 +2440,7 @@ Sink::Call( const OUString& Method, Sequence< Any >& Arguments ) case VT_BYREF|VT_BOOL: { VARIANT_BOOL *pBool = static_cast<VARIANT_BOOL*>(aDispParams.rgvarg[j].byref); - // SAL_ DEBUG("===> VT_BOOL: byref is now " << aDispParams.rgvarg[j].byref << ", " << (int)*pBool); - Arguments[nIncomingArgIndex] <<= (*pBool != VARIANT_FALSE); + ArgumentsRange[nIncomingArgIndex] <<= (*pBool != VARIANT_FALSE); delete pBool; } break; diff --git a/extensions/source/ole/wincrap.hxx b/extensions/source/ole/wincrap.hxx index 4da57d53c173..3c8417cf929a 100644 --- a/extensions/source/ole/wincrap.hxx +++ b/extensions/source/ole/wincrap.hxx @@ -43,7 +43,6 @@ #pragma clang diagnostic ignored "-Winvalid-noreturn" #pragma clang diagnostic ignored "-Wmicrosoft" #pragma clang diagnostic ignored "-Wnon-pod-varargs" -#pragma clang diagnostic ignored "-Wnon-virtual-dtor" #endif // from oleobjw.hxx diff --git a/extensions/source/ole/windata.hxx b/extensions/source/ole/windata.hxx index edf3c1d45ab8..d9c4cb31436d 100644 --- a/extensions/source/ole/windata.hxx +++ b/extensions/source/ole/windata.hxx @@ -29,7 +29,6 @@ #pragma clang diagnostic ignored "-Winvalid-noreturn" #pragma clang diagnostic ignored "-Wmicrosoft" #pragma clang diagnostic ignored "-Wnon-pod-varargs" -#pragma clang diagnostic ignored "-Wnon-virtual-dtor" #endif #include <atlbase.h> diff --git a/extensions/source/propctrlr/MasterDetailLinkDialog.cxx b/extensions/source/propctrlr/MasterDetailLinkDialog.cxx index 5f38856fc9c4..4f4e6d9a97f1 100644 --- a/extensions/source/propctrlr/MasterDetailLinkDialog.cxx +++ b/extensions/source/propctrlr/MasterDetailLinkDialog.cxx @@ -28,7 +28,6 @@ namespace pcr using namespace ::com::sun::star::uno; - using namespace ::com::sun::star::lang; using namespace ::com::sun::star::beans; MasterDetailLinkDialog::MasterDetailLinkDialog(const Reference< XComponentContext >& _rxContext ) diff --git a/extensions/source/propctrlr/browserline.cxx b/extensions/source/propctrlr/browserline.cxx index d4770ba3e5d1..f4619000dcf8 100644 --- a/extensions/source/propctrlr/browserline.cxx +++ b/extensions/source/propctrlr/browserline.cxx @@ -25,9 +25,11 @@ #include <com/sun/star/graphic/XGraphicProvider.hpp> #include <comphelper/processfactory.hxx> +#include <comphelper/propertyvalue.hxx> #include <comphelper/string.hxx> #include <tools/debug.hxx> -#include <tools/diagnose_ex.h> +#include <comphelper/diagnose_ex.hxx> +#include <utility> #include <vcl/settings.hxx> #include <vcl/svapp.hxx> #include <vcl/weld.hxx> @@ -41,19 +43,17 @@ namespace pcr using ::com::sun::star::uno::XComponentContext; using ::com::sun::star::inspection::XPropertyControl; using ::com::sun::star::inspection::XPropertyControlContext; - using ::com::sun::star::uno::UNO_QUERY_THROW; using ::com::sun::star::uno::Exception; using ::com::sun::star::graphic::GraphicProvider; using ::com::sun::star::graphic::XGraphicProvider; using ::com::sun::star::uno::Sequence; - using ::com::sun::star::beans::PropertyValue; using ::com::sun::star::graphic::XGraphic; namespace PropertyLineElement = ::com::sun::star::inspection::PropertyLineElement; - OBrowserLine::OBrowserLine(const OUString& rEntryName, weld::Container* pParent, weld::SizeGroup* pLabelGroup, + OBrowserLine::OBrowserLine(OUString aEntryName, weld::Container* pParent, weld::SizeGroup* pLabelGroup, weld::Container* pInitialControlParent) - : m_sEntryName(rEntryName) + : m_sEntryName(std::move(aEntryName)) , m_xBuilder(Application::CreateBuilder(pParent, "modules/spropctrlr/ui/browserline.ui")) , m_xContainer(m_xBuilder->weld_container("BrowserLine")) , m_xFtTitle(m_xBuilder->weld_label("label")) @@ -88,7 +88,7 @@ namespace pcr } } - void OBrowserLine::SetComponentHelpIds(const OString& rHelpId) + void OBrowserLine::SetComponentHelpIds(const OUString& rHelpId) { if (m_pControlWindow) m_pControlWindow->set_help_id(rHelpId); @@ -178,7 +178,7 @@ namespace pcr OUStringBuffer aText(m_xFtTitle->get_label()); int n10DotsWidth = m_xFtTitle->get_pixel_size("..........").Width(); - int nTextWidth = m_xFtTitle->get_pixel_size(aText.toString()).Width(); + int nTextWidth = m_xFtTitle->get_pixel_size(OUString::unacquired(aText)).Width(); int nDiff = m_nNameWidth - nTextWidth; int nExtraChars = (nDiff * 10) / n10DotsWidth; for (int i = 0; i < nExtraChars; ++i) @@ -314,9 +314,7 @@ namespace pcr Reference< XComponentContext > xContext( ::comphelper::getProcessComponentContext() ); Reference< XGraphicProvider > xGraphicProvider( GraphicProvider::create(xContext) ); - Sequence< PropertyValue > aMediaProperties(1); - aMediaProperties[0].Name = "URL"; - aMediaProperties[0].Value <<= rImageURL; + Sequence aMediaProperties{ comphelper::makePropertyValue("URL", rImageURL) }; xGraphic = Reference<XGraphic>(xGraphicProvider->queryGraphic(aMediaProperties), css::uno::UNO_SET_THROW); } diff --git a/extensions/source/propctrlr/browserline.hxx b/extensions/source/propctrlr/browserline.hxx index db33b7a5560f..dfde2969f41f 100644 --- a/extensions/source/propctrlr/browserline.hxx +++ b/extensions/source/propctrlr/browserline.hxx @@ -68,7 +68,7 @@ namespace pcr bool m_bReadOnly; public: - OBrowserLine(const OUString& rEntryName, weld::Container* pParent, weld::SizeGroup* pLabelGroup, + OBrowserLine(OUString aEntryName, weld::Container* pParent, weld::SizeGroup* pLabelGroup, weld::Container* pInitialControlParent); ~OBrowserLine(); @@ -84,7 +84,7 @@ namespace pcr const OUString& GetEntryName() const { return m_sEntryName; } - void SetComponentHelpIds(const OString& rHelpId); + void SetComponentHelpIds(const OUString& rHelpId); void SetTitle(const OUString& rString ); void FullFillTitleString(); diff --git a/extensions/source/propctrlr/browserlistbox.cxx b/extensions/source/propctrlr/browserlistbox.cxx index 04e9e44b388d..b48fc7fa227e 100644 --- a/extensions/source/propctrlr/browserlistbox.cxx +++ b/extensions/source/propctrlr/browserlistbox.cxx @@ -29,7 +29,7 @@ #include <com/sun/star/lang/XComponent.hpp> #include <com/sun/star/inspection/PropertyControlType.hpp> #include <tools/debug.hxx> -#include <tools/diagnose_ex.h> +#include <comphelper/diagnose_ex.hxx> #include <comphelper/asyncnotification.hxx> #include <cppuhelper/implbase.hxx> #include <vcl/svapp.hxx> diff --git a/extensions/source/propctrlr/browserlistbox.hxx b/extensions/source/propctrlr/browserlistbox.hxx index 1a7232612a29..fc1f35541208 100644 --- a/extensions/source/propctrlr/browserlistbox.hxx +++ b/extensions/source/propctrlr/browserlistbox.hxx @@ -23,6 +23,7 @@ #include <com/sun/star/inspection/XPropertyControl.hpp> #include <com/sun/star/inspection/XPropertyHandler.hpp> +#include <utility> #include <vcl/weld.hxx> #include <rtl/ref.hxx> @@ -53,10 +54,10 @@ namespace pcr css::uno::Reference< css::inspection::XPropertyHandler > xHandler; - ListBoxLine( const OUString& rName, const BrowserLinePointer& _pLine, const css::uno::Reference< css::inspection::XPropertyHandler >& _rxHandler ) - : aName( rName ), - pLine( _pLine ), - xHandler( _rxHandler ) + ListBoxLine( OUString _aName, BrowserLinePointer _pLine, css::uno::Reference< css::inspection::XPropertyHandler > _xHandler ) + : aName(std::move( _aName )), + pLine(std::move( _pLine )), + xHandler(std::move( _xHandler )) { } }; diff --git a/extensions/source/propctrlr/browserpage.hxx b/extensions/source/propctrlr/browserpage.hxx index 0db6cc3c7522..5f9220a7961f 100644 --- a/extensions/source/propctrlr/browserpage.hxx +++ b/extensions/source/propctrlr/browserpage.hxx @@ -37,7 +37,7 @@ namespace pcr explicit OBrowserPage(weld::Container* pParent, weld::Container* pContainer); ~OBrowserPage(); - void SetHelpId(const OString& rHelpId) { m_xContainer->set_help_id(rHelpId); } + void SetHelpId(const OUString& rHelpId) { m_xContainer->set_help_id(rHelpId); } OBrowserListBox& getListBox() { return *m_xListBox; } const OBrowserListBox& getListBox() const { return *m_xListBox; } diff --git a/extensions/source/propctrlr/browserview.cxx b/extensions/source/propctrlr/browserview.cxx index df0c6693b9bd..3be48abe41a2 100644 --- a/extensions/source/propctrlr/browserview.cxx +++ b/extensions/source/propctrlr/browserview.cxx @@ -35,9 +35,9 @@ namespace pcr m_xPropBox->setPageActivationHandler(LINK(this, OPropertyBrowserView, OnPageActivation)); } - IMPL_LINK_NOARG(OPropertyBrowserView, OnPageActivation, LinkParamNone*, void) + IMPL_LINK(OPropertyBrowserView, OnPageActivation, const OUString&, rNewPage, void) { - m_nActivePage = m_xPropBox->GetCurPage(); + m_nActivePage = rNewPage.toUInt32(); m_aPageActivationHandler.Call(nullptr); } diff --git a/extensions/source/propctrlr/browserview.hxx b/extensions/source/propctrlr/browserview.hxx index 35195d20e199..d64039813757 100644 --- a/extensions/source/propctrlr/browserview.hxx +++ b/extensions/source/propctrlr/browserview.hxx @@ -48,7 +48,7 @@ namespace pcr css::awt::Size getMinimumSize() const; private: - DECL_LINK(OnPageActivation, LinkParamNone*, void); + DECL_LINK(OnPageActivation, const OUString&, void); }; } // namespace pcr diff --git a/extensions/source/propctrlr/buttonnavigationhandler.cxx b/extensions/source/propctrlr/buttonnavigationhandler.cxx index dc5b8d521c94..43ed02a952d6 100644 --- a/extensions/source/propctrlr/buttonnavigationhandler.cxx +++ b/extensions/source/propctrlr/buttonnavigationhandler.cxx @@ -29,10 +29,7 @@ namespace pcr using namespace ::com::sun::star::uno; - using namespace ::com::sun::star::lang; using namespace ::com::sun::star::beans; - using namespace ::com::sun::star::script; - using namespace ::com::sun::star::frame; using namespace ::com::sun::star::inspection; ButtonNavigationHandler::ButtonNavigationHandler( const Reference< XComponentContext >& _rxContext ) @@ -183,9 +180,7 @@ namespace pcr Sequence< OUString > SAL_CALL ButtonNavigationHandler::getActuatingProperties( ) { - Sequence< OUString > aActuating( 2 ); - aActuating[0] = PROPERTY_BUTTONTYPE; - aActuating[1] = PROPERTY_TARGET_URL; + Sequence< OUString > aActuating{ PROPERTY_BUTTONTYPE, PROPERTY_TARGET_URL }; return aActuating; } diff --git a/extensions/source/propctrlr/cellbindinghandler.cxx b/extensions/source/propctrlr/cellbindinghandler.cxx index d73d8cfeeb8a..bd1628192eb8 100644 --- a/extensions/source/propctrlr/cellbindinghandler.cxx +++ b/extensions/source/propctrlr/cellbindinghandler.cxx @@ -27,7 +27,7 @@ #include <com/sun/star/table/CellAddress.hpp> #include <com/sun/star/inspection/XObjectInspectorUI.hpp> #include <tools/debug.hxx> -#include <tools/diagnose_ex.h> +#include <comphelper/diagnose_ex.hxx> namespace pcr @@ -38,7 +38,6 @@ namespace pcr using namespace ::com::sun::star::table; using namespace ::com::sun::star::lang; using namespace ::com::sun::star::beans; - using namespace ::com::sun::star::script; using namespace ::com::sun::star::frame; using namespace ::com::sun::star::inspection; using namespace ::com::sun::star::form::binding; @@ -81,10 +80,9 @@ namespace pcr Sequence< OUString > SAL_CALL CellBindingPropertyHandler::getActuatingProperties( ) { - Sequence< OUString > aInterestingProperties( 3 ); - aInterestingProperties[0] = PROPERTY_LIST_CELL_RANGE; - aInterestingProperties[1] = PROPERTY_BOUND_CELL; - aInterestingProperties[2] = PROPERTY_CONTROLSOURCE; + Sequence< OUString > aInterestingProperties{ PROPERTY_LIST_CELL_RANGE, + PROPERTY_BOUND_CELL, + PROPERTY_CONTROLSOURCE }; return aInterestingProperties; } @@ -130,7 +128,7 @@ namespace pcr // ensure that the "transfer selection as" property is reset. Since we can't remember // it at the object itself, but derive it from the binding only, we have to normalize // it now that there *is* no binding anymore. - setPropertyValue( PROPERTY_CELL_EXCHANGE_TYPE, makeAny( sal_Int16(0) ) ); + setPropertyValue( PROPERTY_CELL_EXCHANGE_TYPE, Any( sal_Int16(0) ) ); } } break; @@ -157,8 +155,8 @@ namespace pcr { if ( !xSource.is() ) { - setPropertyValue( PROPERTY_STRINGITEMLIST, makeAny( Sequence< OUString >() ) ); - setPropertyValue( PROPERTY_TYPEDITEMLIST, makeAny( Sequence< Any >() ) ); + setPropertyValue( PROPERTY_STRINGITEMLIST, Any( Sequence< OUString >() ) ); + setPropertyValue( PROPERTY_TYPEDITEMLIST, Any( Sequence< Any >() ) ); } } catch( const Exception& ) diff --git a/extensions/source/propctrlr/cellbindinghelper.cxx b/extensions/source/propctrlr/cellbindinghelper.cxx index 90dd8b77277b..bd2c6d41989c 100644 --- a/extensions/source/propctrlr/cellbindinghelper.cxx +++ b/extensions/source/propctrlr/cellbindinghelper.cxx @@ -32,10 +32,11 @@ #include <com/sun/star/sheet/XSpreadsheet.hpp> #include <unotools/transliterationwrapper.hxx> #include <osl/diagnose.h> -#include <tools/diagnose_ex.h> +#include <comphelper/diagnose_ex.hxx> #include "formstrings.hxx" #include <algorithm> +#include <utility> namespace pcr @@ -51,7 +52,6 @@ namespace pcr using namespace ::com::sun::star::table; using namespace ::com::sun::star::form; using namespace ::com::sun::star::lang; - using namespace ::com::sun::star::i18n; using namespace ::com::sun::star::form::binding; namespace @@ -63,7 +63,7 @@ namespace pcr OUString m_sReference; public: - explicit StringCompare( const OUString& _rReference ) : m_sReference( _rReference ) { } + explicit StringCompare( OUString _aReference ) : m_sReference(std::move( _aReference )) { } bool operator()( std::u16string_view _rCompare ) { @@ -146,7 +146,7 @@ namespace pcr Any aAddress; return doConvertAddressRepresentations( PROPERTY_UI_REPRESENTATION, - makeAny( _rAddressDescription ), + Any( _rAddressDescription ), PROPERTY_ADDRESS, aAddress, false @@ -162,7 +162,7 @@ namespace pcr Reference< XPropertySet > xConverter( createDocumentDependentInstance( - _bIsRange ? OUString(SERVICE_RANGEADDRESS_CONVERSION) : OUString(SERVICE_ADDRESS_CONVERSION), + _bIsRange ? SERVICE_RANGEADDRESS_CONVERSION : SERVICE_ADDRESS_CONVERSION, OUString(), Any() ), @@ -174,7 +174,7 @@ namespace pcr try { Reference< XSpreadsheet > xSheet; - xConverter->setPropertyValue( PROPERTY_REFERENCE_SHEET, makeAny( static_cast<sal_Int32>(getControlSheetIndex( xSheet )) ) ); + xConverter->setPropertyValue( PROPERTY_REFERENCE_SHEET, Any( static_cast<sal_Int32>(getControlSheetIndex( xSheet )) ) ); xConverter->setPropertyValue( _rInputProperty, _rInputValue ); _rOutputValue = xConverter->getPropertyValue( _rOutputProperty ); bSuccess = true; @@ -195,7 +195,7 @@ namespace pcr Any aAddress; return doConvertAddressRepresentations( PROPERTY_UI_REPRESENTATION, - makeAny( _rAddressDescription ), + Any( _rAddressDescription ), PROPERTY_ADDRESS, aAddress, true @@ -207,9 +207,9 @@ namespace pcr Reference< XValueBinding > CellBindingHelper::createCellBindingFromAddress( const CellAddress& _rAddress, bool _bSupportIntegerExchange ) const { Reference< XValueBinding > xBinding( createDocumentDependentInstance( - _bSupportIntegerExchange ? OUString(SERVICE_SHEET_CELL_INT_BINDING) : OUString(SERVICE_SHEET_CELL_BINDING), + _bSupportIntegerExchange ? SERVICE_SHEET_CELL_INT_BINDING : SERVICE_SHEET_CELL_BINDING, PROPERTY_BOUND_CELL, - makeAny( _rAddress ) + Any( _rAddress ) ), UNO_QUERY ); return xBinding; @@ -244,7 +244,7 @@ namespace pcr xSource.set(createDocumentDependentInstance( SERVICE_SHEET_CELLRANGE_LISTSOURCE, PROPERTY_LIST_CELL_RANGE, - makeAny( aRangeAddress ) + Any( aRangeAddress ) ), css::uno::UNO_QUERY); return xSource; @@ -264,13 +264,7 @@ namespace pcr { if ( !_rArgumentName.isEmpty() ) { - NamedValue aArg; - aArg.Name = _rArgumentName; - aArg.Value = _rArgumentValue; - - Sequence< Any > aArgs( 1 ); - aArgs[ 0 ] <<= aArg; - + Sequence aArgs{ Any(NamedValue(_rArgumentName, _rArgumentValue)) }; xReturn = xDocumentFactory->createInstanceWithArguments( _rService, aArgs ); } else @@ -322,7 +316,7 @@ namespace pcr if ( getAddressFromCellBinding( _rxBinding, aAddress ) ) { Any aStringAddress; - doConvertAddressRepresentations( PROPERTY_ADDRESS, makeAny( aAddress ), + doConvertAddressRepresentations( PROPERTY_ADDRESS, Any( aAddress ), PROPERTY_UI_REPRESENTATION, aStringAddress, false ); aStringAddress >>= sAddress; @@ -351,7 +345,7 @@ namespace pcr xSourceProps->getPropertyValue( PROPERTY_LIST_CELL_RANGE ) >>= aRangeAddress; Any aStringAddress; - doConvertAddressRepresentations( PROPERTY_ADDRESS, makeAny( aRangeAddress ), + doConvertAddressRepresentations( PROPERTY_ADDRESS, Any( aRangeAddress ), PROPERTY_UI_REPRESENTATION, aStringAddress, true ); aStringAddress >>= sAddress; } @@ -501,7 +495,6 @@ namespace pcr return bDoes; } - Reference< XValueBinding > CellBindingHelper::getCurrentBinding( ) const { Reference< XValueBinding > xBinding; @@ -511,17 +504,14 @@ namespace pcr return xBinding; } - Reference< XListEntrySource > CellBindingHelper::getCurrentListSource( ) const { - Reference< XListEntrySource > xSource; Reference< XListEntrySink > xSink( m_xControlModel, UNO_QUERY ); - if ( xSink.is() ) - xSource = xSink->getListEntrySource(); - return xSource; + if (xSink.is()) + return xSink->getListEntrySource(); + return Reference<XListEntrySource>(); } - void CellBindingHelper::setBinding( const Reference< XValueBinding >& _rxBinding ) { Reference< XBindableValue > xBindable( m_xControlModel, UNO_QUERY ); @@ -530,7 +520,6 @@ namespace pcr xBindable->setValueBinding( _rxBinding ); } - void CellBindingHelper::setListSource( const Reference< XListEntrySource >& _rxSource ) { Reference< XListEntrySink > xSink( m_xControlModel, UNO_QUERY ); @@ -539,7 +528,6 @@ namespace pcr xSink->setListEntrySource( _rxSource ); } - } // namespace pcr diff --git a/extensions/source/propctrlr/commoncontrol.cxx b/extensions/source/propctrlr/commoncontrol.cxx index 243bbd813b57..4f44f3e568ca 100644 --- a/extensions/source/propctrlr/commoncontrol.cxx +++ b/extensions/source/propctrlr/commoncontrol.cxx @@ -18,7 +18,7 @@ */ #include "commoncontrol.hxx" -#include <tools/diagnose_ex.h> +#include <comphelper/diagnose_ex.hxx> namespace pcr diff --git a/extensions/source/propctrlr/composeduiupdate.cxx b/extensions/source/propctrlr/composeduiupdate.cxx index 0e32ef19a9db..247dd4ab3e71 100644 --- a/extensions/source/propctrlr/composeduiupdate.cxx +++ b/extensions/source/propctrlr/composeduiupdate.cxx @@ -766,7 +766,7 @@ namespace pcr singleUI.second->dispose(); } m_pCollectedUIs.reset(); - m_xDelegatorUI.set( nullptr ); + m_xDelegatorUI.clear(); } diff --git a/extensions/source/propctrlr/controlfontdialog.cxx b/extensions/source/propctrlr/controlfontdialog.cxx index 436770e60316..33da88b14ff4 100644 --- a/extensions/source/propctrlr/controlfontdialog.cxx +++ b/extensions/source/propctrlr/controlfontdialog.cxx @@ -19,8 +19,9 @@ #include <com/sun/star/beans/PropertyAttribute.hpp> -#include <com/sun/star/beans/PropertyValue.hpp> #include "controlfontdialog.hxx" + +#include <comphelper/propertyvalue.hxx> #include <vcl/svapp.hxx> #include "fontdialog.hxx" #include "formstrings.hxx" @@ -31,14 +32,13 @@ namespace pcr using namespace ::com::sun::star::uno; - using namespace ::com::sun::star::lang; using namespace ::com::sun::star::beans; OControlFontDialog::OControlFontDialog(const Reference< XComponentContext >& _rxContext ) - :OGenericUnoDialog( _rxContext ) - ,m_pItemPoolDefaults(nullptr) + : OGenericUnoDialog( _rxContext ) + , maFontList(Application::GetDefaultDevice()) { - registerProperty(PROPERTY_INTROSPECTEDOBJECT, OWN_PROPERTY_ID_INTROSPECTEDOBJECT, + registerProperty(PROPERTY_INTROSPECTEDOBJECT, static_cast<sal_Int32>(OwnPropertyId::INTROSPECTEDOBJECT), PropertyAttribute::BOUND | PropertyAttribute::TRANSIENT, &m_xControlModel, cppu::UnoType<decltype(m_xControlModel)>::get()); } @@ -52,7 +52,7 @@ namespace pcr if (m_xDialog) { destroyDialog(); - ControlCharacterDialog::destroyItemSet(m_pFontItems, m_pItemPool, m_pItemPoolDefaults); + ControlCharacterDialog::destroyItemSet(m_pFontItems, m_pItemPool); } } } @@ -80,11 +80,8 @@ namespace pcr Reference<XPropertySet> xGridModel; if (aArguments.getLength() == 1 && (aArguments[0] >>= xGridModel)) { - PropertyValue aArg; - aArg.Name = "IntrospectedObject"; - aArg.Value <<= xGridModel; - Sequence< Any > aNewArguments(1); - aNewArguments[0] <<= aArg; + Sequence aNewArguments{ Any(comphelper::makePropertyValue("IntrospectedObject", + xGridModel)) }; OControlFontDialog_DBase::initialize(aNewArguments); } else @@ -114,7 +111,7 @@ namespace pcr std::unique_ptr<weld::DialogController> OControlFontDialog::createDialog(const css::uno::Reference<css::awt::XWindow>& rParent) { - ControlCharacterDialog::createItemSet(m_pFontItems, m_pItemPool, m_pItemPoolDefaults); + ControlCharacterDialog::createItemSet(m_pFontItems, m_pItemPool, maFontList); OSL_ENSURE(m_xControlModel.is(), "OControlFontDialog::createDialog: no introspectee set!"); if (m_xControlModel.is()) diff --git a/extensions/source/propctrlr/controlfontdialog.hxx b/extensions/source/propctrlr/controlfontdialog.hxx index 8dc52010273f..29dd95d2192a 100644 --- a/extensions/source/propctrlr/controlfontdialog.hxx +++ b/extensions/source/propctrlr/controlfontdialog.hxx @@ -21,10 +21,10 @@ #include <comphelper/proparrhlp.hxx> #include <svtools/genericunodialog.hxx> +#include <svtools/ctrltool.hxx> class SfxItemSet; class SfxItemPool; -class SfxPoolItem; namespace pcr { @@ -45,8 +45,7 @@ namespace pcr std::unique_ptr<SfxItemSet> m_pFontItems; // item set for the dialog rtl::Reference<SfxItemPool> m_pItemPool; // item pool for the item set for the dialog - std::vector<SfxPoolItem*>* - m_pItemPoolDefaults; // pool defaults + FontList maFontList; public: explicit OControlFontDialog(const css::uno::Reference< css::uno::XComponentContext >& _rxContext); diff --git a/extensions/source/propctrlr/defaultforminspection.cxx b/extensions/source/propctrlr/defaultforminspection.cxx index 0ecb9815ac4a..3fa7fa5658a5 100644 --- a/extensions/source/propctrlr/defaultforminspection.cxx +++ b/extensions/source/propctrlr/defaultforminspection.cxx @@ -34,7 +34,6 @@ namespace pcr { - using ::com::sun::star::uno::Reference; using ::com::sun::star::uno::Sequence; using ::com::sun::star::uno::Any; using ::com::sun::star::uno::XInterface; @@ -131,8 +130,8 @@ namespace pcr { const char* programmaticName; TranslateId uiNameResId; - const char* helpId; - } const aCategories[] = { + OUString helpId; + } constexpr aCategories[] = { { "General", RID_STR_PROPPAGE_DEFAULT, HID_FM_PROPDLG_TAB_GENERAL }, { "Data", RID_STR_PROPPAGE_DATA, HID_FM_PROPDLG_TAB_DATA }, { "Events", RID_STR_EVENTS, HID_FM_PROPDLG_TAB_EVT } diff --git a/extensions/source/propctrlr/defaulthelpprovider.cxx b/extensions/source/propctrlr/defaulthelpprovider.cxx index 8f1e22b82f12..96c99af67e27 100644 --- a/extensions/source/propctrlr/defaulthelpprovider.cxx +++ b/extensions/source/propctrlr/defaulthelpprovider.cxx @@ -27,7 +27,7 @@ #include <toolkit/helper/vclunohelper.hxx> #include <vcl/window.hxx> -#include <tools/diagnose_ex.h> +#include <comphelper/diagnose_ex.hxx> #include <cppuhelper/supportsservice.hxx> @@ -47,7 +47,6 @@ namespace pcr using ::com::sun::star::ucb::AlreadyInitializedException; using ::com::sun::star::lang::IllegalArgumentException; using ::com::sun::star::uno::UNO_QUERY; - using ::com::sun::star::uno::UNO_QUERY_THROW; using ::com::sun::star::awt::XWindow; DefaultHelpProvider::DefaultHelpProvider() diff --git a/extensions/source/propctrlr/editpropertyhandler.cxx b/extensions/source/propctrlr/editpropertyhandler.cxx index 72fc1042ab48..272e24428e20 100644 --- a/extensions/source/propctrlr/editpropertyhandler.cxx +++ b/extensions/source/propctrlr/editpropertyhandler.cxx @@ -23,13 +23,17 @@ #include <com/sun/star/inspection/XObjectInspectorUI.hpp> #include <com/sun/star/lang/NullPointerException.hpp> -#include <tools/diagnose_ex.h> - -#define TEXTTYPE_SINGLELINE 0 -#define TEXTTYPE_MULTILINE 1 -#define TEXTTYPE_RICHTEXT 2 - +#include <comphelper/diagnose_ex.hxx> +namespace +{ + enum class TextType + { + SINGLELINE = 0, + MULTILINE = 1, + RICHTEXT = 2 + }; +}; namespace pcr { @@ -37,8 +41,6 @@ namespace pcr using namespace ::com::sun::star::uno; using namespace ::com::sun::star::lang; using namespace ::com::sun::star::beans; - using namespace ::com::sun::star::script; - using namespace ::com::sun::star::frame; using namespace ::com::sun::star::inspection; @@ -91,21 +93,21 @@ namespace pcr case PROPERTY_ID_TEXTTYPE: { - sal_Int32 nTextType = TEXTTYPE_SINGLELINE; + TextType nTextType = TextType::SINGLELINE; bool bRichText = false; OSL_VERIFY( m_xComponent->getPropertyValue( PROPERTY_RICHTEXT ) >>= bRichText ); if ( bRichText ) - nTextType = TEXTTYPE_RICHTEXT; + nTextType = TextType::RICHTEXT; else { bool bMultiLine = false; OSL_VERIFY( m_xComponent->getPropertyValue( PROPERTY_MULTILINE ) >>= bMultiLine ); if ( bMultiLine ) - nTextType = TEXTTYPE_MULTILINE; + nTextType = TextType::MULTILINE; else - nTextType = TEXTTYPE_SINGLELINE; + nTextType = TextType::SINGLELINE; } - aReturn <<= nTextType; + aReturn <<= static_cast<sal_Int32>(nTextType); } break; @@ -141,8 +143,8 @@ namespace pcr bool bHasVScroll = 0 != ( nScrollbars & 2 ); bool bHasHScroll = 0 != ( nScrollbars & 1 ); - m_xComponent->setPropertyValue( PROPERTY_VSCROLL, makeAny( bHasVScroll ) ); - m_xComponent->setPropertyValue( PROPERTY_HSCROLL, makeAny( bHasHScroll ) ); + m_xComponent->setPropertyValue( PROPERTY_VSCROLL, Any( bHasVScroll ) ); + m_xComponent->setPropertyValue( PROPERTY_HSCROLL, Any( bHasHScroll ) ); } break; @@ -150,19 +152,19 @@ namespace pcr { bool bMultiLine = false; bool bRichText = false; - sal_Int32 nTextType = TEXTTYPE_SINGLELINE; + sal_Int32 nTextType = static_cast<sal_Int32>(TextType::SINGLELINE); OSL_VERIFY( _rValue >>= nTextType ); - switch ( nTextType ) + switch ( static_cast<TextType>(nTextType) ) { - case TEXTTYPE_SINGLELINE: bMultiLine = bRichText = false; break; - case TEXTTYPE_MULTILINE: bMultiLine = true; bRichText = false; break; - case TEXTTYPE_RICHTEXT: bMultiLine = true; bRichText = true; break; + case TextType::SINGLELINE: bMultiLine = bRichText = false; break; + case TextType::MULTILINE: bMultiLine = true; bRichText = false; break; + case TextType::RICHTEXT: bMultiLine = true; bRichText = true; break; default: OSL_FAIL( "EditPropertyHandler::setPropertyValue: invalid text type!" ); } - m_xComponent->setPropertyValue( PROPERTY_MULTILINE, makeAny( bMultiLine ) ); - m_xComponent->setPropertyValue( PROPERTY_RICHTEXT, makeAny( bRichText ) ); + m_xComponent->setPropertyValue( PROPERTY_MULTILINE, Any( bMultiLine ) ); + m_xComponent->setPropertyValue( PROPERTY_RICHTEXT, Any( bRichText ) ); } break; @@ -261,21 +263,23 @@ namespace pcr { case PROPERTY_ID_TEXTTYPE: { - sal_Int32 nTextType = TEXTTYPE_SINGLELINE; - getPropertyValue( PROPERTY_TEXTTYPE ) >>= nTextType; + sal_Int32 nTextTypeInt = static_cast<sal_Int32>(TextType::SINGLELINE); + getPropertyValue( PROPERTY_TEXTTYPE ) >>= nTextTypeInt; + + TextType nTextType = static_cast<TextType>(nTextTypeInt); if ( impl_isSupportedProperty_nothrow( PROPERTY_ID_WORDBREAK ) ) - _rxInspectorUI->enablePropertyUI( PROPERTY_WORDBREAK, nTextType == TEXTTYPE_RICHTEXT ); - _rxInspectorUI->enablePropertyUI( PROPERTY_MAXTEXTLEN, nTextType != TEXTTYPE_RICHTEXT ); - _rxInspectorUI->enablePropertyUI( PROPERTY_ECHO_CHAR, nTextType == TEXTTYPE_SINGLELINE ); - _rxInspectorUI->enablePropertyUI( PROPERTY_FONT, nTextType != TEXTTYPE_RICHTEXT ); - _rxInspectorUI->enablePropertyUI( PROPERTY_ALIGN, nTextType != TEXTTYPE_RICHTEXT ); - _rxInspectorUI->enablePropertyUI( PROPERTY_DEFAULT_TEXT, nTextType != TEXTTYPE_RICHTEXT ); - _rxInspectorUI->enablePropertyUI( PROPERTY_SHOW_SCROLLBARS, nTextType != TEXTTYPE_SINGLELINE ); - _rxInspectorUI->enablePropertyUI( PROPERTY_LINEEND_FORMAT, nTextType != TEXTTYPE_SINGLELINE ); - _rxInspectorUI->enablePropertyUI( PROPERTY_VERTICAL_ALIGN, nTextType == TEXTTYPE_SINGLELINE ); - - _rxInspectorUI->showCategory( "Data", nTextType != TEXTTYPE_RICHTEXT ); + _rxInspectorUI->enablePropertyUI( PROPERTY_WORDBREAK, nTextType == TextType::RICHTEXT ); + _rxInspectorUI->enablePropertyUI( PROPERTY_MAXTEXTLEN, nTextType != TextType::RICHTEXT ); + _rxInspectorUI->enablePropertyUI( PROPERTY_ECHO_CHAR, nTextType == TextType::SINGLELINE ); + _rxInspectorUI->enablePropertyUI( PROPERTY_FONT, nTextType != TextType::RICHTEXT ); + _rxInspectorUI->enablePropertyUI( PROPERTY_ALIGN, nTextType != TextType::RICHTEXT ); + _rxInspectorUI->enablePropertyUI( PROPERTY_DEFAULT_TEXT, nTextType != TextType::RICHTEXT ); + _rxInspectorUI->enablePropertyUI( PROPERTY_SHOW_SCROLLBARS, nTextType != TextType::SINGLELINE ); + _rxInspectorUI->enablePropertyUI( PROPERTY_LINEEND_FORMAT, nTextType != TextType::SINGLELINE ); + _rxInspectorUI->enablePropertyUI( PROPERTY_VERTICAL_ALIGN, nTextType == TextType::SINGLELINE ); + + _rxInspectorUI->showCategory( "Data", nTextType != TextType::RICHTEXT ); } break; diff --git a/extensions/source/propctrlr/eformshelper.cxx b/extensions/source/propctrlr/eformshelper.cxx index ff0a91e0e518..bcc0b25987c8 100644 --- a/extensions/source/propctrlr/eformshelper.cxx +++ b/extensions/source/propctrlr/eformshelper.cxx @@ -17,7 +17,6 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#include <memory> #include <string_view> #include "eformshelper.hxx" @@ -32,7 +31,7 @@ #include <com/sun/star/xforms/XFormsUIHelper1.hpp> #include <com/sun/star/xsd/DataTypeClass.hpp> #include <com/sun/star/form/binding/XListEntrySink.hpp> -#include <tools/diagnose_ex.h> +#include <comphelper/diagnose_ex.hxx> #include <algorithm> #include <o3tl/functional.hxx> @@ -241,10 +240,10 @@ namespace pcr { if ( !_bDoListen ) { - ::comphelper::OInterfaceIteratorHelper2 aListenerIterator = m_aPropertyListeners.createIterator(); + ::comphelper::OInterfaceIteratorHelper3 aListenerIterator(m_aPropertyListeners); while ( aListenerIterator.hasMoreElements() ) { - PropertyEventTranslation* pTranslator = dynamic_cast< PropertyEventTranslation* >( aListenerIterator.next() ); + PropertyEventTranslation* pTranslator = dynamic_cast< PropertyEventTranslation* >( aListenerIterator.next().get() ); OSL_ENSURE( pTranslator, "EFormsHelper::impl_toggleBindingPropertyListening_throw: invalid listener element in my container!" ); if ( !pTranslator ) continue; @@ -255,7 +254,7 @@ namespace pcr if ( pTranslator->getDelegator() == _rxConcreteListenerOrNull ) { impl_switchBindingListening_throw( false, xEventSourceTranslator ); - m_aPropertyListeners.removeListener( xEventSourceTranslator ); + m_aPropertyListeners.removeInterface( xEventSourceTranslator ); break; } } @@ -270,17 +269,14 @@ namespace pcr if ( _rxConcreteListenerOrNull.is() ) { Reference< XPropertyChangeListener > xEventSourceTranslator( new PropertyEventTranslation( _rxConcreteListenerOrNull, m_xBindableControl ) ); - m_aPropertyListeners.addListener( xEventSourceTranslator ); + m_aPropertyListeners.addInterface( xEventSourceTranslator ); impl_switchBindingListening_throw( true, xEventSourceTranslator ); } else { - ::comphelper::OInterfaceIteratorHelper2 aListenerIterator = m_aPropertyListeners.createIterator(); + ::comphelper::OInterfaceIteratorHelper3 aListenerIterator(m_aPropertyListeners); while ( aListenerIterator.hasMoreElements() ) - { - Reference< XPropertyChangeListener > xListener( aListenerIterator.next(), UNO_QUERY ); - impl_switchBindingListening_throw( true, xListener ); - } + impl_switchBindingListening_throw( true, aListenerIterator.next() ); } } } @@ -378,7 +374,6 @@ namespace pcr return xModel; } - OUString EFormsHelper::getCurrentFormModelName() const { OUString sModelName; @@ -395,7 +390,6 @@ namespace pcr return sModelName; } - Reference< XPropertySet > EFormsHelper::getCurrentBinding() const { Reference< XPropertySet > xBinding; @@ -413,7 +407,6 @@ namespace pcr return xBinding; } - OUString EFormsHelper::getCurrentBindingName() const { OUString sBindingName; @@ -433,19 +426,18 @@ namespace pcr Reference< XListEntrySource > EFormsHelper::getCurrentListSourceBinding() const { - Reference< XListEntrySource > xReturn; try { Reference< XListEntrySink > xAsSink( m_xControlModel, UNO_QUERY ); OSL_ENSURE( xAsSink.is(), "EFormsHelper::getCurrentListSourceBinding: you should have used isListEntrySink before!" ); - if ( xAsSink.is() ) - xReturn = xAsSink->getListEntrySource(); + if (xAsSink.is()) + return xAsSink->getListEntrySource(); } catch( const Exception& ) { TOOLS_WARN_EXCEPTION( "extensions.propctrlr", "EFormsHelper::getCurrentListSourceBinding" ); } - return xReturn; + return Reference<XListEntrySource>(); } @@ -464,7 +456,6 @@ namespace pcr } } - void EFormsHelper::setBinding( const Reference< css::beans::XPropertySet >& _rxBinding ) { if ( !m_xBindableControl.is() ) @@ -529,8 +520,8 @@ namespace pcr xBinding = xModel->createBinding( ); if ( xBinding.is() ) { - xBinding->setPropertyValue( PROPERTY_BINDING_ID, makeAny( _rBindingName ) ); - xModel->getBindings()->insert( makeAny( xBinding ) ); + xBinding->setPropertyValue( PROPERTY_BINDING_ID, Any( _rBindingName ) ); + xModel->getBindings()->insert( Any( xBinding ) ); } } } @@ -551,7 +542,7 @@ namespace pcr Reference< XNamed > xName( xBinding, UNO_QUERY_THROW ); xName->setName( sNewName ); // and insert into the model - xModel->getBindings()->insert( makeAny( xBinding ) ); + xModel->getBindings()->insert( Any( xBinding ) ); } } } @@ -678,7 +669,7 @@ namespace pcr xElement->getPropertyValue( PROPERTY_MODEL ) >>= xElementsModel; OSL_ENSURE( xElementsModel == xModel, "EFormsHelper::getAllElementUINames: inconsistency in the model-element relationship!" ); if ( xElementsModel != xModel ) - xElement->setPropertyValue( PROPERTY_MODEL, makeAny( xModel ) ); + xElement->setPropertyValue( PROPERTY_MODEL, Any( xModel ) ); } #endif OUString sElementName = ( _eType == Submission ) ? xHelper->getSubmissionName( xElement, true ) : xHelper->getBindingName( xElement, true ); @@ -702,7 +693,7 @@ namespace pcr void EFormsHelper::firePropertyChange( const OUString& _rName, const Any& _rOldValue, const Any& _rNewValue ) const { - if ( m_aPropertyListeners.empty() ) + if ( m_aPropertyListeners.getLength() == 0 ) return; if ( _rOldValue == _rNewValue ) @@ -717,7 +708,7 @@ namespace pcr aEvent.OldValue = _rOldValue; aEvent.NewValue = _rNewValue; - const_cast< EFormsHelper* >( this )->m_aPropertyListeners.notify( aEvent, &XPropertyChangeListener::propertyChange ); + const_cast< EFormsHelper* >( this )->m_aPropertyListeners.notifyEach( &XPropertyChangeListener::propertyChange, aEvent ); } catch( const Exception& ) { @@ -728,7 +719,7 @@ namespace pcr void EFormsHelper::firePropertyChanges( const Reference< XPropertySet >& _rxOldProps, const Reference< XPropertySet >& _rxNewProps, std::set< OUString >& _rFilter ) const { - if ( m_aPropertyListeners.empty() ) + if ( m_aPropertyListeners.getLength() == 0 ) return; try diff --git a/extensions/source/propctrlr/eformspropertyhandler.cxx b/extensions/source/propctrlr/eformspropertyhandler.cxx index 23d468a7d909..68e8ebb4f423 100644 --- a/extensions/source/propctrlr/eformspropertyhandler.cxx +++ b/extensions/source/propctrlr/eformspropertyhandler.cxx @@ -29,7 +29,7 @@ #include <com/sun/star/inspection/PropertyControlType.hpp> #include <com/sun/star/inspection/XObjectInspectorUI.hpp> #include <tools/debug.hxx> -#include <tools/diagnose_ex.h> +#include <comphelper/diagnose_ex.hxx> #include <sal/log.hxx> @@ -42,7 +42,6 @@ namespace pcr using namespace ::com::sun::star::lang; using namespace ::com::sun::star::beans; using namespace ::com::sun::star::xforms; - using namespace ::com::sun::star::script; using namespace ::com::sun::star::ui::dialogs; using namespace ::com::sun::star::form::binding; using namespace ::com::sun::star::inspection; @@ -178,7 +177,7 @@ namespace pcr OUString sOldBindingName = m_pHelper->getCurrentBindingName(); m_pHelper->setBinding( nullptr ); firePropertyChange( PROPERTY_BINDING_NAME, PROPERTY_ID_BINDING_NAME, - makeAny( sOldBindingName ), makeAny( OUString() ) ); + Any( sOldBindingName ), Any( OUString() ) ); } } break; @@ -211,7 +210,7 @@ namespace pcr // However, there's no such mechanism in place currently. m_bSimulatingModelChange = true; firePropertyChange( PROPERTY_XML_DATA_MODEL, PROPERTY_ID_XML_DATA_MODEL, - makeAny( OUString() ), makeAny( getModelNamePropertyValue() ) ); + Any( OUString() ), Any( getModelNamePropertyValue() ) ); m_bSimulatingModelChange = false; } } @@ -281,7 +280,7 @@ namespace pcr { if ( m_pHelper->canBindToAnyDataType() ) { - aProperties.reserve( 7 ); + aProperties.reserve(9); addStringPropertyDescription( aProperties, PROPERTY_XML_DATA_MODEL ); addStringPropertyDescription( aProperties, PROPERTY_BINDING_NAME ); addStringPropertyDescription( aProperties, PROPERTY_BIND_EXPRESSION ); @@ -499,9 +498,9 @@ namespace pcr if ( !xModel.is() || !xBinding.is() || sFacetName.isEmpty() ) return InteractiveSelectionResult_Cancelled; - xDialogProps->setPropertyValue("FormModel", makeAny( xModel ) ); - xDialogProps->setPropertyValue("Binding", makeAny( xBinding ) ); - xDialogProps->setPropertyValue("FacetName", makeAny( sFacetName ) ); + xDialogProps->setPropertyValue("FormModel", Any( xModel ) ); + xDialogProps->setPropertyValue("Binding", Any( xBinding ) ); + xDialogProps->setPropertyValue("FacetName", Any( sFacetName ) ); if ( !xDialog->execute() ) // cancelled diff --git a/extensions/source/propctrlr/eventhandler.cxx b/extensions/source/propctrlr/eventhandler.cxx index b920a4262650..7e4ca0747cb4 100644 --- a/extensions/source/propctrlr/eventhandler.cxx +++ b/extensions/source/propctrlr/eventhandler.cxx @@ -51,6 +51,7 @@ #include <comphelper/namedvaluecollection.hxx> #include <comphelper/evtmethodhelper.hxx> +#include <comphelper/propertyvalue.hxx> #include <comphelper/sequence.hxx> #include <comphelper/types.hxx> #include <cppuhelper/implbase.hxx> @@ -58,12 +59,13 @@ #include <rtl/ref.hxx> #include <rtl/ustrbuf.hxx> #include <svx/svxdlg.hxx> -#include <tools/diagnose_ex.h> +#include <comphelper/diagnose_ex.hxx> #include <map> #include <algorithm> #include <iterator> #include <string_view> +#include <utility> namespace pcr { @@ -97,7 +99,6 @@ namespace pcr using ::com::sun::star::form::runtime::FormController; using ::com::sun::star::form::runtime::XFormController; using ::com::sun::star::beans::UnknownPropertyException; - using ::com::sun::star::uno::makeAny; using ::com::sun::star::container::NoSuchElementException; using ::com::sun::star::beans::XPropertySetInfo; using ::com::sun::star::container::XNameReplace; @@ -116,34 +117,28 @@ namespace pcr using com::sun::star::uri::UriReferenceFactory; using com::sun::star::uri::XUriReferenceFactory; using com::sun::star::uri::XVndSunStarScriptUrlReference; - using ::com::sun::star::lang::XEventListener; namespace PropertyControlType = css::inspection::PropertyControlType; namespace PropertyAttribute = css::beans::PropertyAttribute; namespace FormComponentType = css::form::FormComponentType; - EventDescription::EventDescription( EventId _nId, const char* _pListenerNamespaceAscii, const char* _pListenerClassAsciiName, - const char* _pListenerMethodAsciiName, TranslateId pDisplayNameResId, const OString& _sHelpId, const OString& _sUniqueBrowseId ) + EventDescription::EventDescription( EventId _nId, std::u16string_view listenerClassName, + std::u16string_view listenerMethodName, TranslateId pDisplayNameResId, OUString _sHelpId, OString _sUniqueBrowseId ) :sDisplayName(PcrRes( pDisplayNameResId )) - ,sListenerMethodName( OUString::createFromAscii( _pListenerMethodAsciiName ) ) - ,sHelpId( _sHelpId ) - ,sUniqueBrowseId( _sUniqueBrowseId ) + ,sListenerClassName( listenerClassName ) + ,sListenerMethodName( listenerMethodName ) + ,sHelpId(std::move( _sHelpId )) + ,sUniqueBrowseId(std::move( _sUniqueBrowseId )) ,nId( _nId ) { - OUStringBuffer aQualifiedListenerClass; - aQualifiedListenerClass.append( "com.sun.star." ); - aQualifiedListenerClass.appendAscii( _pListenerNamespaceAscii ); - aQualifiedListenerClass.append( "." ); - aQualifiedListenerClass.appendAscii( _pListenerClassAsciiName ); - sListenerClassName = aQualifiedListenerClass.makeStringAndClear(); } namespace { - #define DESCRIBE_EVENT( map, asciinamespace, asciilistener, asciimethod, id_postfix ) \ + #define DESCRIBE_EVENT( map, listener, method, id_postfix ) \ map.emplace( \ - asciimethod, \ - EventDescription( ++nEventId, asciinamespace, asciilistener, asciimethod, RID_STR_EVT_##id_postfix, HID_EVT_##id_postfix, UID_BRWEVT_##id_postfix ) ) + u"" method##_ustr, \ + EventDescription( ++nEventId, u"com.sun.star." listener, u"" method, RID_STR_EVT_##id_postfix, HID_EVT_##id_postfix, UID_BRWEVT_##id_postfix ) ) bool lcl_getEventDescriptionForMethod( const OUString& _rMethodName, EventDescription& _out_rDescription ) { @@ -151,39 +146,39 @@ namespace pcr EventMap aMap; sal_Int32 nEventId = 0; - DESCRIBE_EVENT(aMap, "form", "XApproveActionListener", "approveAction", APPROVEACTIONPERFORMED); - DESCRIBE_EVENT(aMap, "awt", "XActionListener", "actionPerformed", ACTIONPERFORMED); - DESCRIBE_EVENT(aMap, "form", "XChangeListener", "changed", CHANGED); - DESCRIBE_EVENT(aMap, "awt", "XTextListener", "textChanged", TEXTCHANGED); - DESCRIBE_EVENT(aMap, "awt", "XItemListener", "itemStateChanged", ITEMSTATECHANGED); - DESCRIBE_EVENT(aMap, "awt", "XFocusListener", "focusGained", FOCUSGAINED); - DESCRIBE_EVENT(aMap, "awt", "XFocusListener", "focusLost", FOCUSLOST); - DESCRIBE_EVENT(aMap, "awt", "XKeyListener", "keyPressed", KEYTYPED); - DESCRIBE_EVENT(aMap, "awt", "XKeyListener", "keyReleased", KEYUP); - DESCRIBE_EVENT(aMap, "awt", "XMouseListener", "mouseEntered", MOUSEENTERED); - DESCRIBE_EVENT(aMap, "awt", "XMouseMotionListener", "mouseDragged", MOUSEDRAGGED); - DESCRIBE_EVENT(aMap, "awt", "XMouseMotionListener", "mouseMoved", MOUSEMOVED); - DESCRIBE_EVENT(aMap, "awt", "XMouseListener", "mousePressed", MOUSEPRESSED); - DESCRIBE_EVENT(aMap, "awt", "XMouseListener", "mouseReleased", MOUSERELEASED); - DESCRIBE_EVENT(aMap, "awt", "XMouseListener", "mouseExited", MOUSEEXITED); - DESCRIBE_EVENT(aMap, "form", "XResetListener", "approveReset", APPROVERESETTED); - DESCRIBE_EVENT(aMap, "form", "XResetListener", "resetted", RESETTED); - DESCRIBE_EVENT(aMap, "form", "XSubmitListener", "approveSubmit", SUBMITTED); - DESCRIBE_EVENT(aMap, "form", "XUpdateListener", "approveUpdate", BEFOREUPDATE); - DESCRIBE_EVENT(aMap, "form", "XUpdateListener", "updated", AFTERUPDATE); - DESCRIBE_EVENT(aMap, "form", "XLoadListener", "loaded", LOADED); - DESCRIBE_EVENT(aMap, "form", "XLoadListener", "reloading", RELOADING); - DESCRIBE_EVENT(aMap, "form", "XLoadListener", "reloaded", RELOADED); - DESCRIBE_EVENT(aMap, "form", "XLoadListener", "unloading", UNLOADING); - DESCRIBE_EVENT(aMap, "form", "XLoadListener", "unloaded", UNLOADED); - DESCRIBE_EVENT(aMap, "form", "XConfirmDeleteListener", "confirmDelete", CONFIRMDELETE); - DESCRIBE_EVENT(aMap, "sdb", "XRowSetApproveListener", "approveRowChange", APPROVEROWCHANGE); - DESCRIBE_EVENT(aMap, "sdbc", "XRowSetListener", "rowChanged", ROWCHANGE); - DESCRIBE_EVENT(aMap, "sdb", "XRowSetApproveListener", "approveCursorMove", POSITIONING); - DESCRIBE_EVENT(aMap, "sdbc", "XRowSetListener", "cursorMoved", POSITIONED); - DESCRIBE_EVENT(aMap, "form", "XDatabaseParameterListener", "approveParameter", APPROVEPARAMETER); - DESCRIBE_EVENT(aMap, "sdb", "XSQLErrorListener", "errorOccured", ERROROCCURRED); - DESCRIBE_EVENT(aMap, "awt", "XAdjustmentListener", "adjustmentValueChanged", ADJUSTMENTVALUECHANGED); + DESCRIBE_EVENT(aMap, "form.XApproveActionListener", "approveAction", APPROVEACTIONPERFORMED); + DESCRIBE_EVENT(aMap, "awt.XActionListener", "actionPerformed", ACTIONPERFORMED); + DESCRIBE_EVENT(aMap, "form.XChangeListener", "changed", CHANGED); + DESCRIBE_EVENT(aMap, "awt.XTextListener", "textChanged", TEXTCHANGED); + DESCRIBE_EVENT(aMap, "awt.XItemListener", "itemStateChanged", ITEMSTATECHANGED); + DESCRIBE_EVENT(aMap, "awt.XFocusListener", "focusGained", FOCUSGAINED); + DESCRIBE_EVENT(aMap, "awt.XFocusListener", "focusLost", FOCUSLOST); + DESCRIBE_EVENT(aMap, "awt.XKeyListener", "keyPressed", KEYTYPED); + DESCRIBE_EVENT(aMap, "awt.XKeyListener", "keyReleased", KEYUP); + DESCRIBE_EVENT(aMap, "awt.XMouseListener", "mouseEntered", MOUSEENTERED); + DESCRIBE_EVENT(aMap, "awt.XMouseMotionListener", "mouseDragged", MOUSEDRAGGED); + DESCRIBE_EVENT(aMap, "awt.XMouseMotionListener", "mouseMoved", MOUSEMOVED); + DESCRIBE_EVENT(aMap, "awt.XMouseListener", "mousePressed", MOUSEPRESSED); + DESCRIBE_EVENT(aMap, "awt.XMouseListener", "mouseReleased", MOUSERELEASED); + DESCRIBE_EVENT(aMap, "awt.XMouseListener", "mouseExited", MOUSEEXITED); + DESCRIBE_EVENT(aMap, "form.XResetListener", "approveReset", APPROVERESETTED); + DESCRIBE_EVENT(aMap, "form.XResetListener", "resetted", RESETTED); + DESCRIBE_EVENT(aMap, "form.XSubmitListener", "approveSubmit", SUBMITTED); + DESCRIBE_EVENT(aMap, "form.XUpdateListener", "approveUpdate", BEFOREUPDATE); + DESCRIBE_EVENT(aMap, "form.XUpdateListener", "updated", AFTERUPDATE); + DESCRIBE_EVENT(aMap, "form.XLoadListener", "loaded", LOADED); + DESCRIBE_EVENT(aMap, "form.XLoadListener", "reloading", RELOADING); + DESCRIBE_EVENT(aMap, "form.XLoadListener", "reloaded", RELOADED); + DESCRIBE_EVENT(aMap, "form.XLoadListener", "unloading", UNLOADING); + DESCRIBE_EVENT(aMap, "form.XLoadListener", "unloaded", UNLOADED); + DESCRIBE_EVENT(aMap, "form.XConfirmDeleteListener", "confirmDelete", CONFIRMDELETE); + DESCRIBE_EVENT(aMap, "sdb.XRowSetApproveListener", "approveRowChange", APPROVEROWCHANGE); + DESCRIBE_EVENT(aMap, "sdbc.XRowSetListener", "rowChanged", ROWCHANGE); + DESCRIBE_EVENT(aMap, "sdb.XRowSetApproveListener", "approveCursorMove", POSITIONING); + DESCRIBE_EVENT(aMap, "sdbc.XRowSetListener", "cursorMoved", POSITIONED); + DESCRIBE_EVENT(aMap, "form.XDatabaseParameterListener", "approveParameter", APPROVEPARAMETER); + DESCRIBE_EVENT(aMap, "sdb.XSQLErrorListener", "errorOccured", ERROROCCURRED); + DESCRIBE_EVENT(aMap, "awt.XAdjustmentListener", "adjustmentValueChanged", ADJUSTMENTVALUECHANGED); return aMap; }(); @@ -236,11 +231,11 @@ namespace pcr sal_Int32 nPrefixLen = aScriptEvent.ScriptCode.indexOf( ':' ); OSL_ENSURE( nPrefixLen > 0, "lcl_getAssignedScriptEvent: illegal location!" ); - OUString sLocation = aScriptEvent.ScriptCode.copy( 0, nPrefixLen ); - OUString sMacroPath = aScriptEvent.ScriptCode.copy( nPrefixLen + 1 ); + std::u16string_view sLocation = aScriptEvent.ScriptCode.subView( 0, nPrefixLen ); + std::u16string_view sMacroPath = aScriptEvent.ScriptCode.subView( nPrefixLen + 1 ); aScriptEvent.ScriptCode = - "vnd.sun.star.script:" + + OUString::Concat("vnd.sun.star.script:") + sMacroPath + "?language=Basic&location=" + sLocation; @@ -274,7 +269,7 @@ namespace pcr OSL_PRECOND( _rxIntrospection.is(), "lcl_addListenerTypesFor_throw: this will crash!" ); Reference< XIntrospectionAccess > xIntrospectionAccess( - _rxIntrospection->inspect( makeAny( _rxComponent ) ), UNO_SET_THROW ); + _rxIntrospection->inspect( Any( _rxComponent ) ), UNO_SET_THROW ); const Sequence< Type > aListeners( xIntrospectionAccess->getSupportedListeners() ); @@ -375,13 +370,12 @@ namespace pcr { ScriptEventDescriptor aDescriptor( impl_getDescriptor_throw( _rName ) ); - Sequence< PropertyValue > aScriptDescriptor( 2 ); - aScriptDescriptor[0].Name = "EventType"; - aScriptDescriptor[0].Value <<= aDescriptor.ScriptType; - aScriptDescriptor[1].Name = "Script"; - aScriptDescriptor[1].Value <<= aDescriptor.ScriptCode; + Sequence< PropertyValue > aScriptDescriptor{ + comphelper::makePropertyValue("EventType", aDescriptor.ScriptType), + comphelper::makePropertyValue("Script", aDescriptor.ScriptCode) + }; - return makeAny( aScriptDescriptor ); + return Any( aScriptDescriptor ); } Sequence< OUString > SAL_CALL EventHolder::getElementNames( ) @@ -511,7 +505,7 @@ namespace pcr } } - return makeAny( aPropertyValue ); + return Any( aPropertyValue ); } void SAL_CALL EventHandler::setPropertyValue( const OUString& _rPropertyName, const Any& _rValue ) @@ -541,7 +535,7 @@ namespace pcr aEvent.PropertyName = _rPropertyName; aEvent.OldValue <<= aOldScriptEvent; aEvent.NewValue <<= aNewScriptEvent; - m_aPropertyListeners.notify( aEvent, &XPropertyChangeListener::propertyChange ); + m_aPropertyListeners.notifyEach( &XPropertyChangeListener::propertyChange, aEvent ); } Any SAL_CALL EventHandler::convertToPropertyValue( const OUString& _rPropertyName, const Any& _rControlValue ) @@ -568,7 +562,7 @@ namespace pcr // there is no need for this code... aAssignedScript.ScriptCode = sNewScriptCode; - return makeAny( aAssignedScript ); + return Any( aAssignedScript ); } Any SAL_CALL EventHandler::convertToControlValue( const OUString& /*_rPropertyName*/, const Any& _rPropertyValue, const Type& _rControlValueType ) @@ -608,8 +602,7 @@ namespace pcr OSL_ENSURE( !sLocation.isEmpty(), "EventHandler::convertToControlValue: unexpected: no location!" ); if ( !sLocation.isEmpty() ) { - aComposeBuffer.append( sLocation ); - aComposeBuffer.append( ", " ); + aComposeBuffer.append( sLocation + ", " ); } // language @@ -629,7 +622,7 @@ namespace pcr } } - return makeAny( sScript ); + return Any( sScript ); } PropertyState SAL_CALL EventHandler::getPropertyState( const OUString& /*_rPropertyName*/ ) @@ -642,13 +635,13 @@ namespace pcr ::osl::MutexGuard aGuard( m_aMutex ); if ( !_rxListener.is() ) throw NullPointerException(); - m_aPropertyListeners.addListener( _rxListener ); + m_aPropertyListeners.addInterface( _rxListener ); } void SAL_CALL EventHandler::removePropertyChangeListener( const Reference< XPropertyChangeListener >& _rxListener ) { ::osl::MutexGuard aGuard( m_aMutex ); - m_aPropertyListeners.removeListener( _rxListener ); + m_aPropertyListeners.removeInterface( _rxListener ); } Sequence< Property > SAL_CALL EventHandler::getSupportedProperties() @@ -802,7 +795,7 @@ namespace pcr // set the new "property value" setPropertyValue( lcl_getEventPropertyName( event.second.sListenerClassName, event.second.sListenerMethodName ), - makeAny( aScriptDescriptor ) + Any( aScriptDescriptor ) ); } } @@ -973,14 +966,14 @@ namespace pcr namespace { - bool lcl_endsWith( const OUString& _rText, const OUString& _rCheck ) + bool lcl_endsWith( std::u16string_view _rText, std::u16string_view _rCheck ) { - sal_Int32 nTextLen = _rText.getLength(); - sal_Int32 nCheckLen = _rCheck.getLength(); + size_t nTextLen = _rText.size(); + size_t nCheckLen = _rCheck.size(); if ( nCheckLen > nTextLen ) return false; - return _rText.indexOf( _rCheck ) == ( nTextLen - nCheckLen ); + return _rText.find( _rCheck ) == ( nTextLen - nCheckLen ); } } diff --git a/extensions/source/propctrlr/eventhandler.hxx b/extensions/source/propctrlr/eventhandler.hxx index 1447276a3b62..4fa5c85d2ed5 100644 --- a/extensions/source/propctrlr/eventhandler.hxx +++ b/extensions/source/propctrlr/eventhandler.hxx @@ -45,7 +45,7 @@ namespace pcr OUString sDisplayName; OUString sListenerClassName; OUString sListenerMethodName; - OString sHelpId; + OUString sHelpId; OString sUniqueBrowseId; EventId nId; @@ -56,12 +56,11 @@ namespace pcr EventDescription( EventId _nId, - const char* _pListenerNamespaceAscii, - const char* _pListenerClassAsciiName, - const char* _pListenerMethodAsciiName, + std::u16string_view listenerClassName, + std::u16string_view listenerMethodName, TranslateId pDisplayNameResId, - const OString& _sHelpId, - const OString& _sUniqueBrowseId ); + OUString _sHelpId, + OString _sUniqueBrowseId ); }; typedef std::unordered_map< OUString, EventDescription > EventMap; diff --git a/extensions/source/propctrlr/fontdialog.cxx b/extensions/source/propctrlr/fontdialog.cxx index 89e6fb80e635..78dd50c8475d 100644 --- a/extensions/source/propctrlr/fontdialog.cxx +++ b/extensions/source/propctrlr/fontdialog.cxx @@ -32,7 +32,6 @@ #include <com/sun/star/awt/FontUnderline.hpp> #include <com/sun/star/awt/FontStrikeout.hpp> #include "formstrings.hxx" -#include "fontitemids.hxx" #include <editeng/charreliefitem.hxx> #include <editeng/emphasismarkitem.hxx> #include <editeng/fontitem.hxx> @@ -49,7 +48,7 @@ #include <editeng/shdditem.hxx> #include <editeng/flstitem.hxx> #include <svtools/ctrltool.hxx> -#include <tools/diagnose_ex.h> +#include <comphelper/diagnose_ex.hxx> #include <com/sun/star/beans/XPropertyState.hpp> #include <svx/svxids.hrc> #include <svx/svxdlg.hxx> @@ -67,6 +66,35 @@ namespace pcr //= OFontPropertyExtractor + namespace FontItemIds + { + constexpr sal_uInt16 CFID_FONT = 1; + constexpr sal_uInt16 CFID_HEIGHT = 2; + constexpr sal_uInt16 CFID_WEIGHT = 3; + constexpr sal_uInt16 CFID_POSTURE = 4; + constexpr sal_uInt16 CFID_LANGUAGE = 5; + constexpr sal_uInt16 CFID_UNDERLINE = 6; + constexpr sal_uInt16 CFID_STRIKEOUT = 7; + constexpr TypedWhichId<SvxWordLineModeItem> CFID_WORDLINEMODE(8); + constexpr sal_uInt16 CFID_CHARCOLOR = 9; + constexpr sal_uInt16 CFID_RELIEF = 10; + constexpr TypedWhichId<SvxEmphasisMarkItem> CFID_EMPHASIS(11); + + constexpr sal_uInt16 CFID_CJK_FONT = 12; + constexpr sal_uInt16 CFID_CJK_HEIGHT = 13; + constexpr sal_uInt16 CFID_CJK_WEIGHT = 14; + constexpr sal_uInt16 CFID_CJK_POSTURE = 15; + constexpr sal_uInt16 CFID_CJK_LANGUAGE = 16; + constexpr sal_uInt16 CFID_CASEMAP = 17; + constexpr TypedWhichId<SvxContourItem> CFID_CONTOUR(18); + constexpr TypedWhichId<SvxShadowedItem> CFID_SHADOWED(19); + + constexpr sal_uInt16 CFID_FONTLIST = 20; + + constexpr sal_uInt16 CFID_FIRST_ITEM_ID = CFID_FONT; + constexpr sal_uInt16 CFID_LAST_ITEM_ID = CFID_FONTLIST; + } + namespace { class OFontPropertyExtractor @@ -216,32 +244,32 @@ namespace pcr sal_Int32 nColor32 = aPropExtractor.getInt32FontProperty(PROPERTY_TEXTCOLOR, 0); // build SfxItems with the values - SvxFontItem aFontItem(static_cast<FontFamily>(nFontFamily), aFontName, aFontStyleName, PITCH_DONTKNOW, nFontCharset, CFID_FONT); + SvxFontItem aFontItem(static_cast<FontFamily>(nFontFamily), aFontName, aFontStyleName, PITCH_DONTKNOW, nFontCharset, FontItemIds::CFID_FONT); nFontHeight = static_cast<float>(o3tl::convert(nFontHeight, o3tl::Length::pt, o3tl::Length::twip)); - SvxFontHeightItem aSvxFontHeightItem(static_cast<sal_uInt32>(nFontHeight),100,CFID_HEIGHT); + SvxFontHeightItem aSvxFontHeightItem(static_cast<sal_uInt32>(nFontHeight),100,FontItemIds::CFID_HEIGHT); FontWeight eWeight=vcl::unohelper::ConvertFontWeight(nFontWeight); FontItalic eItalic=vcl::unohelper::ConvertFontSlant(nFontSlant); FontLineStyle eUnderline=static_cast<FontLineStyle>(nFontLineStyle); FontStrikeout eStrikeout=static_cast<FontStrikeout>(nFontStrikeout); - SvxWeightItem aWeightItem(eWeight,CFID_WEIGHT); - SvxPostureItem aPostureItem(eItalic,CFID_POSTURE); + SvxWeightItem aWeightItem(eWeight,FontItemIds::CFID_WEIGHT); + SvxPostureItem aPostureItem(eItalic,FontItemIds::CFID_POSTURE); - SvxCrossedOutItem aCrossedOutItem(eStrikeout,CFID_STRIKEOUT); - SvxWordLineModeItem aWordLineModeItem(bWordLineMode, CFID_WORDLINEMODE); + SvxCrossedOutItem aCrossedOutItem(eStrikeout,FontItemIds::CFID_STRIKEOUT); + SvxWordLineModeItem aWordLineModeItem(bWordLineMode, FontItemIds::CFID_WORDLINEMODE); - SvxUnderlineItem aUnderlineItem(eUnderline,CFID_UNDERLINE); + SvxUnderlineItem aUnderlineItem(eUnderline,FontItemIds::CFID_UNDERLINE); aUnderlineItem.SetColor(Color(ColorTransparency, nTextLineColor)); - SvxColorItem aSvxColorItem(Color(ColorTransparency, nColor32),CFID_CHARCOLOR); - SvxLanguageItem aLanguageItem(Application::GetSettings().GetUILanguageTag().getLanguageType(), CFID_LANGUAGE); + SvxColorItem aSvxColorItem(Color(ColorTransparency, nColor32),FontItemIds::CFID_CHARCOLOR); + SvxLanguageItem aLanguageItem(Application::GetSettings().GetUILanguageTag().getLanguageType(), FontItemIds::CFID_LANGUAGE); // the 2 CJK props - SvxCharReliefItem aFontReliefItem(static_cast<FontRelief>(nFontRelief), CFID_RELIEF); - SvxEmphasisMarkItem aEmphasisMarkitem(static_cast<FontEmphasisMark>(nFontEmphasisMark), CFID_EMPHASIS); + SvxCharReliefItem aFontReliefItem(static_cast<FontRelief>(nFontRelief), FontItemIds::CFID_RELIEF); + SvxEmphasisMarkItem aEmphasisMarkitem(static_cast<FontEmphasisMark>(nFontEmphasisMark), FontItemIds::CFID_EMPHASIS); _pSet->Put(aFontItem); _pSet->Put(aSvxFontHeightItem); @@ -255,16 +283,16 @@ namespace pcr _pSet->Put(aFontReliefItem); _pSet->Put(aEmphasisMarkitem); - aPropExtractor.invalidateItem(PROPERTY_FONT_NAME, CFID_FONT, *_pSet); - aPropExtractor.invalidateItem(PROPERTY_FONT_HEIGHT, CFID_HEIGHT, *_pSet); - aPropExtractor.invalidateItem(PROPERTY_FONT_WEIGHT, CFID_WEIGHT, *_pSet, css::awt::FontWeight::DONTKNOW == nFontWeight); - aPropExtractor.invalidateItem(PROPERTY_FONT_SLANT, CFID_POSTURE, *_pSet, css::awt::FontSlant_DONTKNOW == nFontSlant); - aPropExtractor.invalidateItem(PROPERTY_FONT_UNDERLINE, CFID_UNDERLINE, *_pSet, css::awt::FontUnderline::DONTKNOW == nFontLineStyle); - aPropExtractor.invalidateItem(PROPERTY_FONT_STRIKEOUT, CFID_STRIKEOUT, *_pSet, css::awt::FontStrikeout::DONTKNOW == nFontStrikeout); - aPropExtractor.invalidateItem(PROPERTY_WORDLINEMODE, CFID_WORDLINEMODE, *_pSet); - aPropExtractor.invalidateItem(PROPERTY_TEXTCOLOR, CFID_CHARCOLOR, *_pSet); - aPropExtractor.invalidateItem(PROPERTY_FONT_RELIEF, CFID_RELIEF, *_pSet); - aPropExtractor.invalidateItem(PROPERTY_FONT_EMPHASIS_MARK, CFID_EMPHASIS, *_pSet); + aPropExtractor.invalidateItem(PROPERTY_FONT_NAME, FontItemIds::CFID_FONT, *_pSet); + aPropExtractor.invalidateItem(PROPERTY_FONT_HEIGHT, FontItemIds::CFID_HEIGHT, *_pSet); + aPropExtractor.invalidateItem(PROPERTY_FONT_WEIGHT, FontItemIds::CFID_WEIGHT, *_pSet, css::awt::FontWeight::DONTKNOW == nFontWeight); + aPropExtractor.invalidateItem(PROPERTY_FONT_SLANT, FontItemIds::CFID_POSTURE, *_pSet, css::awt::FontSlant_DONTKNOW == nFontSlant); + aPropExtractor.invalidateItem(PROPERTY_FONT_UNDERLINE, FontItemIds::CFID_UNDERLINE, *_pSet, css::awt::FontUnderline::DONTKNOW == nFontLineStyle); + aPropExtractor.invalidateItem(PROPERTY_FONT_STRIKEOUT, FontItemIds::CFID_STRIKEOUT, *_pSet, css::awt::FontStrikeout::DONTKNOW == nFontStrikeout); + aPropExtractor.invalidateItem(PROPERTY_WORDLINEMODE, FontItemIds::CFID_WORDLINEMODE, *_pSet); + aPropExtractor.invalidateItem(PROPERTY_TEXTCOLOR, FontItemIds::CFID_CHARCOLOR, *_pSet); + aPropExtractor.invalidateItem(PROPERTY_FONT_RELIEF, FontItemIds::CFID_RELIEF, *_pSet); + aPropExtractor.invalidateItem(PROPERTY_FONT_EMPHASIS_MARK, FontItemIds::CFID_EMPHASIS, *_pSet); } catch (const Exception&) { @@ -298,70 +326,70 @@ namespace pcr { // font name - SfxItemState eState = _rSet.GetItemState(CFID_FONT); + SfxItemState eState = _rSet.GetItemState(FontItemIds::CFID_FONT); if ( eState == SfxItemState::SET ) { const SvxFontItem& rFontItem = - static_cast<const SvxFontItem&>(_rSet.Get(CFID_FONT)); + static_cast<const SvxFontItem&>(_rSet.Get(FontItemIds::CFID_FONT)); - lcl_pushBackPropertyValue( _out_properties, PROPERTY_FONT_NAME , makeAny(rFontItem.GetFamilyName())); - lcl_pushBackPropertyValue( _out_properties, PROPERTY_FONT_STYLENAME, makeAny(rFontItem.GetStyleName())); - lcl_pushBackPropertyValue( _out_properties, PROPERTY_FONT_FAMILY , makeAny(static_cast<sal_Int16>(rFontItem.GetFamily()))); - lcl_pushBackPropertyValue( _out_properties, PROPERTY_FONT_CHARSET , makeAny(static_cast<sal_Int16>(rFontItem.GetCharSet()))); + lcl_pushBackPropertyValue( _out_properties, PROPERTY_FONT_NAME , Any(rFontItem.GetFamilyName())); + lcl_pushBackPropertyValue( _out_properties, PROPERTY_FONT_STYLENAME, Any(rFontItem.GetStyleName())); + lcl_pushBackPropertyValue( _out_properties, PROPERTY_FONT_FAMILY , Any(static_cast<sal_Int16>(rFontItem.GetFamily()))); + lcl_pushBackPropertyValue( _out_properties, PROPERTY_FONT_CHARSET , Any(static_cast<sal_Int16>(rFontItem.GetCharSet()))); } // font height - eState = _rSet.GetItemState(CFID_HEIGHT); + eState = _rSet.GetItemState(FontItemIds::CFID_HEIGHT); if ( eState == SfxItemState::SET ) { const SvxFontHeightItem& rSvxFontHeightItem = - static_cast<const SvxFontHeightItem&>(_rSet.Get(CFID_HEIGHT)); + static_cast<const SvxFontHeightItem&>(_rSet.Get(FontItemIds::CFID_HEIGHT)); float nHeight = static_cast<float>(o3tl::convert(rSvxFontHeightItem.GetHeight(), o3tl::Length::twip, o3tl::Length::pt)); - lcl_pushBackPropertyValue( _out_properties, PROPERTY_FONT_HEIGHT,makeAny(nHeight)); + lcl_pushBackPropertyValue( _out_properties, PROPERTY_FONT_HEIGHT,Any(nHeight)); } // font weight - eState = _rSet.GetItemState(CFID_WEIGHT); + eState = _rSet.GetItemState(FontItemIds::CFID_WEIGHT); if ( eState == SfxItemState::SET ) { const SvxWeightItem& rWeightItem = - static_cast<const SvxWeightItem&>(_rSet.Get(CFID_WEIGHT)); + static_cast<const SvxWeightItem&>(_rSet.Get(FontItemIds::CFID_WEIGHT)); float nWeight = vcl::unohelper::ConvertFontWeight(rWeightItem.GetWeight()); - lcl_pushBackPropertyValue( _out_properties, PROPERTY_FONT_WEIGHT,makeAny(nWeight)); + lcl_pushBackPropertyValue( _out_properties, PROPERTY_FONT_WEIGHT,Any(nWeight)); } // font slant - eState = _rSet.GetItemState(CFID_POSTURE); + eState = _rSet.GetItemState(FontItemIds::CFID_POSTURE); if ( eState == SfxItemState::SET ) { const SvxPostureItem& rPostureItem = - static_cast<const SvxPostureItem&>(_rSet.Get(CFID_POSTURE)); + static_cast<const SvxPostureItem&>(_rSet.Get(FontItemIds::CFID_POSTURE)); css::awt::FontSlant eSlant = vcl::unohelper::ConvertFontSlant(rPostureItem.GetPosture()); - lcl_pushBackPropertyValue( _out_properties, PROPERTY_FONT_SLANT, makeAny(static_cast<sal_Int16>(eSlant))); + lcl_pushBackPropertyValue( _out_properties, PROPERTY_FONT_SLANT, Any(static_cast<sal_Int16>(eSlant))); } // font underline - eState = _rSet.GetItemState(CFID_UNDERLINE); + eState = _rSet.GetItemState(FontItemIds::CFID_UNDERLINE); if ( eState == SfxItemState::SET ) { const SvxUnderlineItem& rUnderlineItem = - static_cast<const SvxUnderlineItem&>(_rSet.Get(CFID_UNDERLINE)); + static_cast<const SvxUnderlineItem&>(_rSet.Get(FontItemIds::CFID_UNDERLINE)); sal_Int16 nUnderline = static_cast<sal_Int16>(rUnderlineItem.GetLineStyle()); - lcl_pushBackPropertyValue( _out_properties, PROPERTY_FONT_UNDERLINE,makeAny(nUnderline)); + lcl_pushBackPropertyValue( _out_properties, PROPERTY_FONT_UNDERLINE,Any(nUnderline)); // the text line color is transported in this item, too Color nColor = rUnderlineItem.GetColor(); @@ -375,37 +403,37 @@ namespace pcr // font strikeout - eState = _rSet.GetItemState(CFID_STRIKEOUT); + eState = _rSet.GetItemState(FontItemIds::CFID_STRIKEOUT); if ( eState == SfxItemState::SET ) { const SvxCrossedOutItem& rCrossedOutItem = - static_cast<const SvxCrossedOutItem&>(_rSet.Get(CFID_STRIKEOUT)); + static_cast<const SvxCrossedOutItem&>(_rSet.Get(FontItemIds::CFID_STRIKEOUT)); sal_Int16 nStrikeout = static_cast<sal_Int16>(rCrossedOutItem.GetStrikeout()); - lcl_pushBackPropertyValue( _out_properties, PROPERTY_FONT_STRIKEOUT,makeAny(nStrikeout)); + lcl_pushBackPropertyValue( _out_properties, PROPERTY_FONT_STRIKEOUT,Any(nStrikeout)); } // font wordline mode - eState = _rSet.GetItemState(CFID_WORDLINEMODE); + eState = _rSet.GetItemState(FontItemIds::CFID_WORDLINEMODE); if ( eState == SfxItemState::SET ) { const SvxWordLineModeItem& rWordLineModeItem = - static_cast<const SvxWordLineModeItem&>(_rSet.Get(CFID_WORDLINEMODE)); + _rSet.Get(FontItemIds::CFID_WORDLINEMODE); - lcl_pushBackPropertyValue( _out_properties, PROPERTY_WORDLINEMODE, css::uno::makeAny(rWordLineModeItem.GetValue())); + lcl_pushBackPropertyValue( _out_properties, PROPERTY_WORDLINEMODE, css::uno::Any(rWordLineModeItem.GetValue())); } // text color - eState = _rSet.GetItemState(CFID_CHARCOLOR); + eState = _rSet.GetItemState(FontItemIds::CFID_CHARCOLOR); if ( eState == SfxItemState::SET ) { const SvxColorItem& rColorItem = - static_cast<const SvxColorItem&>(_rSet.Get(CFID_CHARCOLOR)); + static_cast<const SvxColorItem&>(_rSet.Get(FontItemIds::CFID_CHARCOLOR)); Color nColor = rColorItem.GetValue(); @@ -418,26 +446,25 @@ namespace pcr // font relief - eState = _rSet.GetItemState(CFID_RELIEF); + eState = _rSet.GetItemState(FontItemIds::CFID_RELIEF); if ( eState == SfxItemState::SET ) { const SvxCharReliefItem& rReliefItem = - static_cast<const SvxCharReliefItem&>(_rSet.Get(CFID_RELIEF)); + static_cast<const SvxCharReliefItem&>(_rSet.Get(FontItemIds::CFID_RELIEF)); - lcl_pushBackPropertyValue( _out_properties, PROPERTY_FONT_RELIEF, makeAny(static_cast<sal_Int16>(rReliefItem.GetValue())) ); + lcl_pushBackPropertyValue( _out_properties, PROPERTY_FONT_RELIEF, Any(static_cast<sal_Int16>(rReliefItem.GetValue())) ); } // font emphasis mark - eState = _rSet.GetItemState(CFID_EMPHASIS); + eState = _rSet.GetItemState(FontItemIds::CFID_EMPHASIS); if ( eState == SfxItemState::SET ) { - const SvxEmphasisMarkItem& rEmphMarkItem = - static_cast<const SvxEmphasisMarkItem&>(_rSet.Get(CFID_EMPHASIS)); + const SvxEmphasisMarkItem& rEmphMarkItem = _rSet.Get(FontItemIds::CFID_EMPHASIS); - lcl_pushBackPropertyValue( _out_properties, PROPERTY_FONT_EMPHASIS_MARK, makeAny(static_cast<sal_Int16>(rEmphMarkItem.GetEmphasisMark())) ); + lcl_pushBackPropertyValue( _out_properties, PROPERTY_FONT_EMPHASIS_MARK, Any(static_cast<sal_Int16>(rEmphMarkItem.GetEmphasisMark())) ); } } catch (const Exception& ) @@ -465,103 +492,89 @@ namespace pcr } } - void ControlCharacterDialog::createItemSet(std::unique_ptr<SfxItemSet>& _rpSet, rtl::Reference<SfxItemPool>& _rpPool, std::vector<SfxPoolItem*>*& _rpDefaults) + static ItemInfoPackage& getItemInfoPackageCntChrDlg() { - // just to be sure... - _rpSet = nullptr; - _rpPool = nullptr; - _rpDefaults = nullptr; - - // create and initialize the defaults - _rpDefaults = new std::vector<SfxPoolItem*>(CFID_LAST_ITEM_ID - CFID_FIRST_ITEM_ID + 1); - - vcl::Font aDefaultVCLFont = Application::GetDefaultDevice()->GetSettings().GetStyleSettings().GetAppFont(); - - SfxPoolItem** pCounter = _rpDefaults->data(); // want to modify this without affecting the out param _rppDefaults - *pCounter++ = new SvxFontItem(aDefaultVCLFont.GetFamilyType(), aDefaultVCLFont.GetFamilyName(), aDefaultVCLFont.GetStyleName(), aDefaultVCLFont.GetPitch(), aDefaultVCLFont.GetCharSet(), CFID_FONT); - *pCounter++ = new SvxFontHeightItem(aDefaultVCLFont.GetFontHeight(), 100, CFID_HEIGHT); - *pCounter++ = new SvxWeightItem(aDefaultVCLFont.GetWeight(), CFID_WEIGHT); - *pCounter++ = new SvxPostureItem(aDefaultVCLFont.GetItalic(), CFID_POSTURE); - *pCounter++ = new SvxLanguageItem(Application::GetSettings().GetUILanguageTag().getLanguageType(), CFID_LANGUAGE); - *pCounter++ = new SvxUnderlineItem(aDefaultVCLFont.GetUnderline(), CFID_UNDERLINE); - *pCounter++ = new SvxCrossedOutItem(aDefaultVCLFont.GetStrikeout(), CFID_STRIKEOUT); - *pCounter++ = new SvxWordLineModeItem(aDefaultVCLFont.IsWordLineMode(), CFID_WORDLINEMODE); - *pCounter++ = new SvxColorItem(aDefaultVCLFont.GetColor(), CFID_CHARCOLOR); - *pCounter++ = new SvxCharReliefItem(aDefaultVCLFont.GetRelief(), CFID_RELIEF); - *pCounter++ = new SvxEmphasisMarkItem(aDefaultVCLFont.GetEmphasisMark(), CFID_EMPHASIS); - - *pCounter++ = new SvxFontItem(aDefaultVCLFont.GetFamilyType(), aDefaultVCLFont.GetFamilyName(), aDefaultVCLFont.GetStyleName(), aDefaultVCLFont.GetPitch(), aDefaultVCLFont.GetCharSet(), CFID_CJK_FONT); - *pCounter++ = new SvxFontHeightItem(aDefaultVCLFont.GetFontHeight(), 100, CFID_CJK_HEIGHT); - *pCounter++ = new SvxWeightItem(aDefaultVCLFont.GetWeight(), CFID_CJK_WEIGHT); - *pCounter++ = new SvxPostureItem(aDefaultVCLFont.GetItalic(), CFID_CJK_POSTURE); - *pCounter++ = new SvxLanguageItem(Application::GetSettings().GetUILanguageTag().getLanguageType(), CFID_CJK_LANGUAGE); - - *pCounter++ = new SvxCaseMapItem(SvxCaseMap::NotMapped, CFID_CASEMAP); - *pCounter++ = new SvxContourItem(false, CFID_CONTOUR); - *pCounter++ = new SvxShadowedItem(false, CFID_SHADOWED); - - *pCounter++ = new SvxFontListItem (new FontList(Application::GetDefaultDevice()), CFID_FONTLIST); - - // create the pool - static SfxItemInfo const aItemInfos[CFID_LAST_ITEM_ID - CFID_FIRST_ITEM_ID + 1] = + class ItemInfoPackageCntChrDlg : public ItemInfoPackage { - { SID_ATTR_CHAR_FONT, false }, - { SID_ATTR_CHAR_FONTHEIGHT, false }, - { SID_ATTR_CHAR_WEIGHT, false }, - { SID_ATTR_CHAR_POSTURE, false }, - { SID_ATTR_CHAR_LANGUAGE, false }, - { SID_ATTR_CHAR_UNDERLINE, false }, - { SID_ATTR_CHAR_STRIKEOUT, false }, - { SID_ATTR_CHAR_WORDLINEMODE, false }, - { SID_ATTR_CHAR_COLOR, false }, - { SID_ATTR_CHAR_RELIEF, false }, - { SID_ATTR_CHAR_EMPHASISMARK, false }, - { 0, false }, - { 0, false }, - { 0, false }, - { 0, false }, - { 0, false }, - { 0, false }, - { 0, false }, - { 0, false }, - { SID_ATTR_CHAR_FONTLIST, false } + vcl::Font maDefaultVCLFont{Application::GetDefaultDevice()->GetSettings().GetStyleSettings().GetAppFont()}; + typedef std::array<ItemInfoStatic, FontItemIds::CFID_LAST_ITEM_ID - FontItemIds::CFID_FIRST_ITEM_ID + 1> ItemInfoArrayCntChrDlg; + ItemInfoArrayCntChrDlg maItemInfos {{ + // m_nWhich, m_pItem, m_nSlotID, m_nItemInfoFlags + { FontItemIds::CFID_FONT, new SvxFontItem(maDefaultVCLFont.GetFamilyType(), maDefaultVCLFont.GetFamilyName(), maDefaultVCLFont.GetStyleName(), maDefaultVCLFont.GetPitch(), maDefaultVCLFont.GetCharSet(), FontItemIds::CFID_FONT), SID_ATTR_CHAR_FONT, SFX_ITEMINFOFLAG_NONE }, + { FontItemIds::CFID_HEIGHT, new SvxFontHeightItem(maDefaultVCLFont.GetFontHeight(), 100, FontItemIds::CFID_HEIGHT), SID_ATTR_CHAR_FONTHEIGHT, SFX_ITEMINFOFLAG_NONE }, + { FontItemIds::CFID_WEIGHT, new SvxWeightItem(maDefaultVCLFont.GetWeight(), FontItemIds::CFID_WEIGHT), SID_ATTR_CHAR_WEIGHT, SFX_ITEMINFOFLAG_NONE }, + { FontItemIds::CFID_POSTURE, new SvxPostureItem(maDefaultVCLFont.GetItalic(), FontItemIds::CFID_POSTURE), SID_ATTR_CHAR_POSTURE, SFX_ITEMINFOFLAG_NONE }, + { FontItemIds::CFID_LANGUAGE, new SvxLanguageItem(Application::GetSettings().GetUILanguageTag().getLanguageType(), FontItemIds::CFID_LANGUAGE), SID_ATTR_CHAR_LANGUAGE, SFX_ITEMINFOFLAG_NONE }, + { FontItemIds::CFID_UNDERLINE, new SvxUnderlineItem(maDefaultVCLFont.GetUnderline(), FontItemIds::CFID_UNDERLINE), SID_ATTR_CHAR_UNDERLINE, SFX_ITEMINFOFLAG_NONE }, + { FontItemIds::CFID_STRIKEOUT, new SvxCrossedOutItem(maDefaultVCLFont.GetStrikeout(), FontItemIds::CFID_STRIKEOUT), SID_ATTR_CHAR_STRIKEOUT, SFX_ITEMINFOFLAG_NONE }, + { FontItemIds::CFID_WORDLINEMODE, new SvxWordLineModeItem(maDefaultVCLFont.IsWordLineMode(), FontItemIds::CFID_WORDLINEMODE), SID_ATTR_CHAR_WORDLINEMODE, SFX_ITEMINFOFLAG_NONE }, + { FontItemIds::CFID_CHARCOLOR, new SvxColorItem(maDefaultVCLFont.GetColor(), FontItemIds::CFID_CHARCOLOR), SID_ATTR_CHAR_COLOR, SFX_ITEMINFOFLAG_NONE }, + { FontItemIds::CFID_RELIEF, new SvxCharReliefItem(maDefaultVCLFont.GetRelief(), FontItemIds::CFID_RELIEF), SID_ATTR_CHAR_RELIEF, SFX_ITEMINFOFLAG_NONE }, + { FontItemIds::CFID_EMPHASIS, new SvxEmphasisMarkItem(maDefaultVCLFont.GetEmphasisMark(), FontItemIds::CFID_EMPHASIS), SID_ATTR_CHAR_EMPHASISMARK, SFX_ITEMINFOFLAG_NONE }, + { FontItemIds::CFID_CJK_FONT, new SvxFontItem(maDefaultVCLFont.GetFamilyType(), maDefaultVCLFont.GetFamilyName(), maDefaultVCLFont.GetStyleName(), maDefaultVCLFont.GetPitch(), maDefaultVCLFont.GetCharSet(), FontItemIds::CFID_CJK_FONT), 0, SFX_ITEMINFOFLAG_NONE }, + { FontItemIds::CFID_CJK_HEIGHT, new SvxFontHeightItem(maDefaultVCLFont.GetFontHeight(), 100, FontItemIds::CFID_CJK_HEIGHT), 0, SFX_ITEMINFOFLAG_NONE }, + { FontItemIds::CFID_CJK_WEIGHT, new SvxWeightItem(maDefaultVCLFont.GetWeight(), FontItemIds::CFID_CJK_WEIGHT), 0, SFX_ITEMINFOFLAG_NONE }, + { FontItemIds::CFID_CJK_POSTURE, new SvxPostureItem(maDefaultVCLFont.GetItalic(), FontItemIds::CFID_CJK_POSTURE), 0, SFX_ITEMINFOFLAG_NONE }, + { FontItemIds::CFID_CJK_LANGUAGE, new SvxLanguageItem(Application::GetSettings().GetUILanguageTag().getLanguageType(), FontItemIds::CFID_CJK_LANGUAGE), 0, SFX_ITEMINFOFLAG_NONE }, + { FontItemIds::CFID_CASEMAP, new SvxCaseMapItem(SvxCaseMap::NotMapped, FontItemIds::CFID_CASEMAP), 0, SFX_ITEMINFOFLAG_NONE }, + { FontItemIds::CFID_CONTOUR, new SvxContourItem(false, FontItemIds::CFID_CONTOUR), 0, SFX_ITEMINFOFLAG_NONE }, + { FontItemIds::CFID_SHADOWED, new SvxShadowedItem(false, FontItemIds::CFID_SHADOWED), 0, SFX_ITEMINFOFLAG_NONE }, + + // SvxFontListItem has to be DynamicDefault. It is pool-dependent in the sense + // that it cannot/should not exist. Additionally SvxFontListItem has NO destructor + // and does not delete the contained/set FontList - this is done 'handish' in + // ControlCharacterDialog::destroyItemSet, see below... + { FontItemIds::CFID_FONTLIST, nullptr, SID_ATTR_CHAR_FONTLIST, SFX_ITEMINFOFLAG_NONE } + }}; + + virtual const ItemInfoStatic& getItemInfoStatic(size_t nIndex) const override { return maItemInfos[nIndex]; } + + public: + virtual size_t size() const override { return maItemInfos.size(); } + virtual const ItemInfo& getItemInfo(size_t nIndex, SfxItemPool& /*rPool*/) override { return maItemInfos[nIndex]; } }; - _rpPool = new SfxItemPool("PCRControlFontItemPool", CFID_FIRST_ITEM_ID, CFID_LAST_ITEM_ID, - aItemInfos, _rpDefaults); - _rpPool->FreezeIdRanges(); + static std::unique_ptr<ItemInfoPackageCntChrDlg> g_aItemInfoPackageCntChrDlg; + if (!g_aItemInfoPackageCntChrDlg) + g_aItemInfoPackageCntChrDlg.reset(new ItemInfoPackageCntChrDlg); + return *g_aItemInfoPackageCntChrDlg; + } + + void ControlCharacterDialog::createItemSet(std::unique_ptr<SfxItemSet>& _rpSet, rtl::Reference<SfxItemPool>& _rpPool, FontList& rFontList) + { + // just to be sure... + _rpSet = nullptr; + _rpPool = nullptr; + _rpPool = new SfxItemPool("PCRControlFontItemPool"); + _rpPool->registerItemInfoPackage( + getItemInfoPackageCntChrDlg(), + [&rFontList](sal_uInt16 nWhich) + { + SfxPoolItem* pRetval(nullptr); + if (FontItemIds::CFID_FONTLIST == nWhich) + pRetval = new SvxFontListItem(&rFontList, FontItemIds::CFID_FONTLIST); + return pRetval; + }); // and, finally, the set _rpSet.reset(new SfxItemSet(*_rpPool)); } - void ControlCharacterDialog::destroyItemSet(std::unique_ptr<SfxItemSet>& _rpSet, rtl::Reference<SfxItemPool>& _rpPool, std::vector<SfxPoolItem*>*& _rpDefaults) + void ControlCharacterDialog::destroyItemSet(std::unique_ptr<SfxItemSet>& _rpSet, rtl::Reference<SfxItemPool>& _rpPool) { - // from the pool, get and remember the font list (needs to be deleted) - const SvxFontListItem& rFontListItem = static_cast<const SvxFontListItem&>(_rpPool->GetDefaultItem(CFID_FONTLIST)); - const FontList* pFontList = rFontListItem.GetFontList(); - // _first_ delete the set (referring the pool) _rpSet.reset(); // delete the pool - _rpPool->ReleaseDefaults(true); - // the "true" means delete the items, too _rpPool = nullptr; - - // reset the defaults ptr - _rpDefaults = nullptr; - // no need to explicitly delete the defaults, this has been done by the ReleaseDefaults - - delete pFontList; } - void ControlCharacterDialog::PageCreated(const OString& rId, SfxTabPage& rPage) + void ControlCharacterDialog::PageCreated(const OUString& rId, SfxTabPage& rPage) { SfxAllItemSet aSet(*(GetInputSetImpl()->GetPool())); if (rId == "font") { - aSet.Put (static_cast<const SvxFontListItem&>(GetInputSetImpl()->Get(CFID_FONTLIST))); + aSet.Put (static_cast<const SvxFontListItem&>(GetInputSetImpl()->Get(FontItemIds::CFID_FONTLIST))); aSet.Put (SfxUInt16Item(SID_DISABLE_CTL,DISABLE_HIDE_LANGUAGE)); rPage.PageCreated(aSet); } diff --git a/extensions/source/propctrlr/fontdialog.hxx b/extensions/source/propctrlr/fontdialog.hxx index eaba29db0b9c..07d72a600f4d 100644 --- a/extensions/source/propctrlr/fontdialog.hxx +++ b/extensions/source/propctrlr/fontdialog.hxx @@ -22,6 +22,7 @@ #include <sfx2/tabdlg.hxx> #include <com/sun/star/beans/XPropertySet.hpp> #include <com/sun/star/beans/NamedValue.hpp> +#include <svtools/ctrltool.hxx> namespace pcr @@ -36,10 +37,10 @@ namespace pcr virtual ~ControlCharacterDialog() override; /// creates an item set to be used with this dialog - static void createItemSet(std::unique_ptr<SfxItemSet>& _rpSet, rtl::Reference<SfxItemPool>& _rpPool, std::vector<SfxPoolItem*>*& _rpDefaults); + static void createItemSet(std::unique_ptr<SfxItemSet>& _rpSet, rtl::Reference<SfxItemPool>& _rpPool, FontList& rFontList); /// destroys an item previously created with <method>createItemSet</method> - static void destroyItemSet(std::unique_ptr<SfxItemSet>& _rpSet, rtl::Reference<SfxItemPool>& _rpPool, std::vector<SfxPoolItem*>*& _rpDefaults); + static void destroyItemSet(std::unique_ptr<SfxItemSet>& _rpSet, rtl::Reference<SfxItemPool>& _rpPool); /// fills the given item set with values obtained from the given property set static void translatePropertiesToItems( @@ -59,7 +60,7 @@ namespace pcr std::vector< css::beans::NamedValue >& _out_properties ); protected: - virtual void PageCreated(const OString& rId, SfxTabPage& rPage) override; + virtual void PageCreated(const OUString& rId, SfxTabPage& rPage) override; }; } // namespace pcr diff --git a/extensions/source/propctrlr/fontitemids.hxx b/extensions/source/propctrlr/fontitemids.hxx deleted file mode 100644 index c9b3a455ffb8..000000000000 --- a/extensions/source/propctrlr/fontitemids.hxx +++ /dev/null @@ -1,48 +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 . - */ - -#pragma once - -#define CFID_FONT 1 -#define CFID_HEIGHT 2 -#define CFID_WEIGHT 3 -#define CFID_POSTURE 4 -#define CFID_LANGUAGE 5 -#define CFID_UNDERLINE 6 -#define CFID_STRIKEOUT 7 -#define CFID_WORDLINEMODE 8 -#define CFID_CHARCOLOR 9 -#define CFID_RELIEF 10 -#define CFID_EMPHASIS 11 - -#define CFID_CJK_FONT 12 -#define CFID_CJK_HEIGHT 13 -#define CFID_CJK_WEIGHT 14 -#define CFID_CJK_POSTURE 15 -#define CFID_CJK_LANGUAGE 16 -#define CFID_CASEMAP 17 -#define CFID_CONTOUR 18 -#define CFID_SHADOWED 19 - -#define CFID_FONTLIST 20 - -#define CFID_FIRST_ITEM_ID CFID_FONT -#define CFID_LAST_ITEM_ID CFID_FONTLIST - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/extensions/source/propctrlr/formbrowsertools.hxx b/extensions/source/propctrlr/formbrowsertools.hxx index 08d48747ce75..707ae2bc6b02 100644 --- a/extensions/source/propctrlr/formbrowsertools.hxx +++ b/extensions/source/propctrlr/formbrowsertools.hxx @@ -24,6 +24,7 @@ #include <rtl/ustring.hxx> #include <set> +#include <utility> namespace pcr @@ -54,7 +55,7 @@ namespace pcr OUString m_sName; public: - explicit FindPropertyByName( const OUString& _rName ) : m_sName( _rName ) { } + explicit FindPropertyByName( OUString _aName ) : m_sName(std::move( _aName )) { } bool operator()( const css::beans::Property& _rProp ) const { return m_sName == _rProp.Name; diff --git a/extensions/source/propctrlr/formcomponenthandler.cxx b/extensions/source/propctrlr/formcomponenthandler.cxx index a783f1e49bd0..1b36dd64e387 100644 --- a/extensions/source/propctrlr/formcomponenthandler.cxx +++ b/extensions/source/propctrlr/formcomponenthandler.cxx @@ -100,9 +100,10 @@ #include <svx/svxids.hrc> #include <vcl/graph.hxx> #include <vcl/unohelp.hxx> -#include <tools/diagnose_ex.h> +#include <comphelper/diagnose_ex.hxx> #include <sal/macros.h> #include <sal/log.hxx> +#include <vcl/svapp.hxx> #include <limits> #include <memory> @@ -117,7 +118,6 @@ namespace pcr using namespace lang; using namespace beans; using namespace frame; - using namespace script; using namespace form; using namespace util; using namespace awt; @@ -192,14 +192,14 @@ namespace pcr namespace { - bool lcl_isLanguageDependentProperty( const OUString& aName ) + bool lcl_isLanguageDependentProperty( std::u16string_view aName ) { bool bRet = false; const LanguageDependentProp* pLangDepProp = aLanguageDependentProp; while( pLangDepProp->pPropName != nullptr ) { - if( aName.equalsAsciiL( pLangDepProp->pPropName, pLangDepProp->nPropNameLength )) + if( o3tl::equalsAscii( aName, std::string_view(pLangDepProp->pPropName, pLangDepProp->nPropNameLength) )) { bRet = true; break; @@ -210,7 +210,7 @@ namespace pcr } Reference< resource::XStringResourceResolver > lcl_getStringResourceResolverForProperty - ( const Reference< XPropertySet >& _xComponent, const OUString& _rPropertyName, + ( const Reference< XPropertySet >& _xComponent, std::u16string_view _rPropertyName, const Any& _rPropertyValue ) { Reference< resource::XStringResourceResolver > xRet; @@ -243,6 +243,10 @@ namespace pcr { const PropertyId nPropId( impl_getPropertyId_throwUnknownProperty( _rPropertyName ) ); + // tdf#117159 crash with chart in database report + if (!m_xComponent) + return Any(); + Any aPropertyValue( m_xComponent->getPropertyValue( _rPropertyName ) ); Reference< resource::XStringResourceResolver > xStringResourceResolver @@ -274,7 +278,7 @@ namespace pcr aResolvedStrings.reserve( aStrings.getLength() ); try { - for ( const OUString& rIdStr : std::as_const(aStrings) ) + for (const OUString& rIdStr : aStrings) { OUString aPureIdStr = rIdStr.copy( 1 ); if( xStringResourceResolver->hasEntryForId( aPureIdStr ) ) @@ -318,7 +322,7 @@ namespace pcr if ( PROPERTY_ID_IMAGE_URL == nPropId && ( _rValue >>= xGrfObj ) ) { DBG_ASSERT( xGrfObj.is(), "FormComponentPropertyHandler::setPropertyValue() xGrfObj is invalid"); - m_xComponent->setPropertyValue(PROPERTY_GRAPHIC, uno::makeAny(xGrfObj->getGraphic())); + m_xComponent->setPropertyValue(PROPERTY_GRAPHIC, uno::Any(xGrfObj->getGraphic())); } else if ( PROPERTY_ID_FONT == nPropId ) { @@ -327,7 +331,7 @@ namespace pcr if( ! (_rValue >>= aFontPropertyValues) ) SAL_WARN("extensions.propctrlr", "setPropertyValue: unable to get property " << PROPERTY_ID_FONT); - for ( const NamedValue& fontPropertyValue : std::as_const(aFontPropertyValues) ) + for (const NamedValue& fontPropertyValue : aFontPropertyValues) m_xComponent->setPropertyValue( fontPropertyValue.Name, fontPropertyValue.Value ); } else @@ -440,7 +444,7 @@ namespace pcr aValue <<= aNewIdStrings; // Remove old ids from resource for all locales - for( const OUString& rIdStr : std::as_const(aOldIdStrings) ) + for (const OUString& rIdStr : aOldIdStrings) { OUString aPureIdStr = rIdStr.copy( 1 ); for ( const Locale& rLocale : aLocaleSeq ) @@ -519,7 +523,7 @@ namespace pcr if( ! (_rControlValue >>= sControlValue) ) SAL_WARN("extensions.propctrlr", "convertToControlValue: unable to get property for Show/Hide"); - assert(SAL_N_ELEMENTS(RID_RSC_ENUM_SHOWHIDE) == 2 && "FormComponentPropertyHandler::convertToPropertyValue: broken resource for Show/Hide!"); + static_assert(SAL_N_ELEMENTS(RID_RSC_ENUM_SHOWHIDE) == 2, "FormComponentPropertyHandler::convertToPropertyValue: broken resource for Show/Hide!"); bool bShow = sControlValue == PcrRes(RID_RSC_ENUM_SHOWHIDE[1]); aPropertyValue <<= bShow; @@ -627,7 +631,7 @@ namespace pcr case PROPERTY_ID_SHOW_RECORDACTIONS: case PROPERTY_ID_SHOW_FILTERSORT: { - assert(SAL_N_ELEMENTS(RID_RSC_ENUM_SHOWHIDE) == 2 && "FormComponentPropertyHandler::convertToPropertyValue: broken resource for Show/Hide!"); + static_assert(SAL_N_ELEMENTS(RID_RSC_ENUM_SHOWHIDE) == 2, "FormComponentPropertyHandler::convertToPropertyValue: broken resource for Show/Hide!"); OUString sControlValue = ::comphelper::getBOOL(_rPropertyValue) ? PcrRes(RID_RSC_ENUM_SHOWHIDE[1]) : PcrRes(RID_RSC_ENUM_SHOWHIDE[0]); @@ -666,7 +670,7 @@ namespace pcr { OUString sLabel; if( ! (xSet->getPropertyValue( PROPERTY_LABEL) >>= sLabel) ) - SAL_WARN("extensions.propctrlr", "convertToPropertyValue: unable to get property " PROPERTY_LABEL); + SAL_WARN("extensions.propctrlr", "convertToPropertyValue: unable to get property " << PROPERTY_LABEL); sControlValue = "<" + sLabel + ">"; } @@ -717,7 +721,7 @@ namespace pcr break; } - aControlValue = PropertyHandlerComponent::convertToControlValue( _rPropertyName, makeAny( nNormalized ), _rControlValueType ); + aControlValue = PropertyHandlerComponent::convertToControlValue( _rPropertyName, Any( nNormalized ), _rControlValueType ); } break; @@ -735,8 +739,7 @@ namespace pcr else { // font name - displayName.append( aFont.Name ); - displayName.append( ", " ); + displayName.append( aFont.Name + ", " ); // font style ::FontWeight eWeight = vcl::unohelper::ConvertFontWeight( aFont.Weight ); @@ -758,8 +761,7 @@ namespace pcr // font size if ( aFont.Height ) { - displayName.append( ", " ); - displayName.append( sal_Int32( aFont.Height ) ); + displayName.append( ", " + OUString::number( sal_Int32( aFont.Height ) ) ); } } @@ -877,7 +879,6 @@ namespace pcr Sequence< OUString > SAL_CALL FormComponentPropertyHandler::getActuatingProperties( ) { - ::osl::MutexGuard aGuard( m_aMutex ); return { PROPERTY_DATASOURCE, @@ -999,8 +1000,8 @@ namespace pcr aDescriptor.Control = pControl; aDescriptor.PrimaryButtonId = PROPERTY_ID_TARGET_URL == nPropId - ? std::u16string_view(u"" UID_PROP_DLG_ATTR_TARGET_URL) - : std::u16string_view(u"" UID_PROP_DLG_IMAGE_URL); + ? UID_PROP_DLG_ATTR_TARGET_URL + : UID_PROP_DLG_IMAGE_URL; break; } @@ -1484,7 +1485,7 @@ namespace pcr OSL_PRECOND( _rxInspectorUI.is(), "lcl_rebuildAndResetCommand: invalid BrowserUI!" ); OSL_PRECOND( _rxHandler.is(), "lcl_rebuildAndResetCommand: invalid handler!" ); _rxInspectorUI->rebuildPropertyUI( PROPERTY_COMMAND ); - _rxHandler->setPropertyValue( PROPERTY_COMMAND, makeAny( OUString() ) ); + _rxHandler->setPropertyValue( PROPERTY_COMMAND, Any( OUString() ) ); } } @@ -1670,7 +1671,7 @@ namespace pcr // ----- TriState ----- case PROPERTY_ID_TRISTATE: if ( !_bFirstTimeInit ) - _rxInspectorUI->rebuildPropertyUI( m_eComponentClass == eFormControl ? OUString(PROPERTY_DEFAULT_STATE) : OUString(PROPERTY_STATE) ); + _rxInspectorUI->rebuildPropertyUI( m_eComponentClass == eFormControl ? PROPERTY_DEFAULT_STATE : PROPERTY_STATE ); break; // case PROPERTY_ID_TRISTATE // ----- DecimalAccuracy ----- @@ -1693,7 +1694,7 @@ namespace pcr } // propagate the changes to the min/max/default fields - OUString aAffectedProps[] = { OUString(PROPERTY_VALUE), OUString(PROPERTY_DEFAULT_VALUE), OUString(PROPERTY_VALUEMIN), OUString(PROPERTY_VALUEMAX) }; + OUString aAffectedProps[] = { PROPERTY_VALUE, PROPERTY_DEFAULT_VALUE, PROPERTY_VALUEMIN, PROPERTY_VALUEMAX }; for (const OUString & aAffectedProp : aAffectedProps) { Reference< XPropertyControl > xControl; @@ -1738,7 +1739,7 @@ namespace pcr // give each control which has to know this an own copy of the description OUString aFormattedPropertyControls[] = { - OUString(PROPERTY_EFFECTIVE_MIN), OUString(PROPERTY_EFFECTIVE_MAX), OUString(PROPERTY_EFFECTIVE_DEFAULT), OUString(PROPERTY_EFFECTIVE_VALUE) + PROPERTY_EFFECTIVE_MIN, PROPERTY_EFFECTIVE_MAX, PROPERTY_EFFECTIVE_DEFAULT, PROPERTY_EFFECTIVE_VALUE }; for (const OUString & aFormattedPropertyControl : aFormattedPropertyControls) { @@ -1795,7 +1796,7 @@ namespace pcr { ListSourceType eLSType = ListSourceType_VALUELIST; if( ! (impl_getPropertyValue_throw( PROPERTY_LISTSOURCETYPE ) >>= eLSType) ) - SAL_WARN("extensions.propctrlr", "impl_updateDependentProperty_nothrow: unable to get property " PROPERTY_LISTSOURCETYPE); + SAL_WARN("extensions.propctrlr", "impl_updateDependentProperty_nothrow: unable to get property " << PROPERTY_LISTSOURCETYPE); OUString sListSource; { @@ -1808,7 +1809,7 @@ namespace pcr } else if( ! (aListSourceValue >>= sListSource) ) - SAL_WARN("extensions.propctrlr", "impl_updateDependentProperty_nothrow: unable to get property " PROPERTY_LISTSOURCE); + SAL_WARN("extensions.propctrlr", "impl_updateDependentProperty_nothrow: unable to get property " << PROPERTY_LISTSOURCE); } bool bIsEnabled = ( ( eLSType == ListSourceType_VALUELIST ) @@ -1830,7 +1831,7 @@ namespace pcr { ListSourceType eLSType = ListSourceType_VALUELIST; if( ! (impl_getPropertyValue_throw( PROPERTY_LISTSOURCETYPE ) >>= eLSType) ) - SAL_WARN("extensions.propctrlr", "impl_updateDependentProperty_nothrow: unable to get property " PROPERTY_LISTSOURCETYPE); + SAL_WARN("extensions.propctrlr", "impl_updateDependentProperty_nothrow: unable to get property " << PROPERTY_LISTSOURCETYPE); _rxInspectorUI->enablePropertyUI( PROPERTY_BOUNDCOLUMN, ( eLSType != ListSourceType_VALUELIST ) @@ -1860,13 +1861,13 @@ namespace pcr { OUString sControlSource; if( ! (impl_getPropertyValue_throw( PROPERTY_CONTROLSOURCE ) >>= sControlSource) ) - SAL_WARN("extensions.propctrlr", "impl_updateDependentProperty_nothrow: unable to get property " PROPERTY_CONTROLSOURCE); + SAL_WARN("extensions.propctrlr", "impl_updateDependentProperty_nothrow: unable to get property " << PROPERTY_CONTROLSOURCE); bool bEmptyIsNULL = false; bool bHasEmptyIsNULL = impl_componentHasProperty_throw( PROPERTY_EMPTY_IS_NULL ); if ( bHasEmptyIsNULL ) if( ! (impl_getPropertyValue_throw( PROPERTY_EMPTY_IS_NULL ) >>= bEmptyIsNULL) ) - SAL_WARN("extensions.propctrlr", "impl_updateDependentProperty_nothrow: unable to get property " PROPERTY_EMPTY_IS_NULL); + SAL_WARN("extensions.propctrlr", "impl_updateDependentProperty_nothrow: unable to get property " << PROPERTY_EMPTY_IS_NULL); // if the control is not bound to a DB field, there is no sense in having the "Input required" // property @@ -1907,7 +1908,7 @@ namespace pcr if ( 0 != m_nClassId ) { if( ! (impl_getPropertyValue_throw( PROPERTY_BUTTONTYPE ) >>= eButtonType) ) - SAL_WARN("extensions.propctrlr", "impl_updateDependentProperty_nothrow: unable to get property " PROPERTY_BUTTONTYPE); + SAL_WARN("extensions.propctrlr", "impl_updateDependentProperty_nothrow: unable to get property " << PROPERTY_BUTTONTYPE); } // if m_nClassId is 0, then we're inspecting a form. In this case, eButtonType is always // FormButtonType_URL here @@ -1949,7 +1950,7 @@ namespace pcr { sal_Int32 nCommandType( CommandType::COMMAND ); if( ! (impl_getPropertyValue_throw( PROPERTY_COMMANDTYPE ) >>= nCommandType) ) - SAL_WARN("extensions.propctrlr", "impl_updateDependentProperty_nothrow: unable to get property " PROPERTY_COMMANDTYPE); + SAL_WARN("extensions.propctrlr", "impl_updateDependentProperty_nothrow: unable to get property " << PROPERTY_COMMANDTYPE); impl_ensureRowsetConnection_nothrow(); Reference< XConnection > xConnection = m_xRowSetConnection.getTyped(); @@ -2083,7 +2084,7 @@ namespace pcr if ( impl_componentHasProperty_throw( PROPERTY_CLASSID ) ) { if( ! (m_xComponent->getPropertyValue( PROPERTY_CLASSID ) >>= m_nClassId) ) - SAL_WARN("extensions.propctrlr", "impl_classifyControlModel_throw: unable to get property " PROPERTY_CLASSID); + SAL_WARN("extensions.propctrlr", "impl_classifyControlModel_throw: unable to get property " << PROPERTY_CLASSID); } else if ( eDialogControl == m_eComponentClass ) { @@ -2269,7 +2270,7 @@ namespace pcr break; case PROPERTY_ID_WRITING_MODE: - if ( !SvtCTLOptions().IsCTLFontEnabled() ) + if ( !SvtCTLOptions::IsCTLFontEnabled() ) return true; break; } @@ -2348,16 +2349,16 @@ namespace pcr OUString sObjectName; if( ! (xFormSet->getPropertyValue( PROPERTY_COMMAND ) >>= sObjectName) ) - SAL_WARN("extensions.propctrlr", "impl_initFieldList_nothrow: unable to get property " PROPERTY_COMMAND); + SAL_WARN("extensions.propctrlr", "impl_initFieldList_nothrow: unable to get property " << PROPERTY_COMMAND); // when there is no command we don't need to ask for columns if ( !sObjectName.isEmpty() && impl_ensureRowsetConnection_nothrow() ) { OUString aDatabaseName; if( ! (xFormSet->getPropertyValue( PROPERTY_DATASOURCE ) >>= aDatabaseName) ) - SAL_WARN("extensions.propctrlr", "impl_initFieldList_nothrow: unable to get property " PROPERTY_DATASOURCE); + SAL_WARN("extensions.propctrlr", "impl_initFieldList_nothrow: unable to get property " << PROPERTY_DATASOURCE); sal_Int32 nObjectType = CommandType::COMMAND; if( ! (xFormSet->getPropertyValue( PROPERTY_COMMANDTYPE ) >>= nObjectType) ) - SAL_WARN("extensions.propctrlr", "impl_initFieldList_nothrow: unable to get property " PROPERTY_COMMANDTYPE); + SAL_WARN("extensions.propctrlr", "impl_initFieldList_nothrow: unable to get property " << PROPERTY_COMMANDTYPE); const Sequence<OUString> aNames = ::dbtools::getFieldNamesByCommandDescriptor( m_xRowSetConnection, nObjectType, sObjectName ); _rFieldNames.insert( _rFieldNames.end(), aNames.begin(), aNames.end() ); @@ -2421,9 +2422,7 @@ namespace pcr if ( aParser.GetProtocol() != INetProtocol::NotValid ) sDataSourceName = aParser.getBase( INetURLObject::LAST_SEGMENT, true, INetURLObject::DecodeMechanism::WithCharset ); OUString sInfo(PcrRes(RID_STR_UNABLETOCONNECT).replaceAll("$name$", sDataSourceName)); - SQLContext aContext; - aContext.Message = sInfo; - aContext.NextException = aError.get(); + SQLContext aContext(sInfo, {}, {}, 0, aError.get(), {}); impl_displaySQLError_nothrow( aContext ); } @@ -2523,13 +2522,12 @@ namespace pcr OUStringBuffer sTemp; if ( bAdd ) { - sTemp.append(_sName); - sTemp.append("/"); + sTemp.append(OUString::Concat(_sName) + "/"); } sTemp.append(rQueryName); Reference< XNameAccess > xSubQueries(_xQueryNames->getByName(rQueryName),UNO_QUERY); if ( xSubQueries.is() ) - impl_fillQueryNames_throw(xSubQueries,_out_rNames,sTemp.makeStringAndClear()); + impl_fillQueryNames_throw(xSubQueries,_out_rNames,sTemp); else _out_rNames.push_back( sTemp.makeStringAndClear() ); } @@ -2629,11 +2627,11 @@ namespace pcr // initialize the dialog Reference< XPropertySet > xDialogProps( xDialog, UNO_QUERY_THROW ); - xDialogProps->setPropertyValue("QueryComposer", makeAny( xComposer ) ); - xDialogProps->setPropertyValue("RowSet", makeAny( m_xComponent ) ); + xDialogProps->setPropertyValue("QueryComposer", Any( xComposer ) ); + xDialogProps->setPropertyValue("RowSet", Any( m_xComponent ) ); if (auto pTopLevel = impl_getDefaultDialogFrame_nothrow()) - xDialogProps->setPropertyValue("ParentWindow", makeAny(pTopLevel->GetXWindow())); - xDialogProps->setPropertyValue("Title", makeAny( sPropertyUIName ) ); + xDialogProps->setPropertyValue("ParentWindow", Any(pTopLevel->GetXWindow())); + xDialogProps->setPropertyValue("Title", Any( sPropertyUIName ) ); _rClearBeforeDialog.clear(); bSuccess = ( xDialog->execute() != 0 ); @@ -2715,18 +2713,15 @@ namespace pcr { const SfxItemSet* pResult = aDialog.GetOutputItemSet(); - const SfxPoolItem* pItem = pResult->GetItem( SID_ATTR_NUMBERFORMAT_INFO ); - const SvxNumberInfoItem* pInfoItem = dynamic_cast< const SvxNumberInfoItem* >( pItem ); - if (pInfoItem) + if (const SvxNumberInfoItem* pInfoItem = pResult->GetItem( SID_ATTR_NUMBERFORMAT_INFO )) { for (sal_uInt32 key : pInfoItem->GetDelFormats()) pFormatter->DeleteEntry(key); } - pItem = nullptr; - if ( SfxItemState::SET == pResult->GetItemState( SID_ATTR_NUMBERFORMAT_VALUE, false, &pItem ) ) + if ( const SfxUInt32Item* pItem = pResult->GetItemIfSet( SID_ATTR_NUMBERFORMAT_VALUE, false ) ) { - _out_rNewValue <<= static_cast<sal_Int32>( static_cast< const SfxUInt32Item* >( pItem )->GetValue() ); + _out_rNewValue <<= static_cast<sal_Int32>( pItem->GetValue() ); bChanged = true; } } @@ -2777,7 +2772,7 @@ namespace pcr OUString sCurValue; if( ! (impl_getPropertyValue_throw( PROPERTY_IMAGE_URL ) >>= sCurValue) ) - SAL_WARN("extensions.propctrlr", "impl_browseForImage_nothrow: unable to get property " PROPERTY_IMAGE_URL); + SAL_WARN("extensions.propctrlr", "impl_browseForImage_nothrow: unable to get property " << PROPERTY_IMAGE_URL); if (!sCurValue.isEmpty()) { aFileDlg.SetDisplayDirectory( sCurValue ); @@ -2818,7 +2813,7 @@ namespace pcr OUString sURL; if( ! (impl_getPropertyValue_throw( PROPERTY_TARGET_URL ) >>= sURL) ) - SAL_WARN("extensions.propctrlr", "impl_browseForTargetURL_nothrow: unable to get property " PROPERTY_TARGET_URL); + SAL_WARN("extensions.propctrlr", "impl_browseForTargetURL_nothrow: unable to get property " << PROPERTY_TARGET_URL); INetURLObject aParser( sURL ); if ( INetProtocol::File == aParser.GetProtocol() ) // set the initial directory only for file-URLs. Everything else @@ -2839,8 +2834,8 @@ namespace pcr // create an item set for use with the dialog std::unique_ptr<SfxItemSet> pSet; rtl::Reference<SfxItemPool> pPool; - std::vector<SfxPoolItem*>* pDefaults = nullptr; - ControlCharacterDialog::createItemSet(pSet, pPool, pDefaults); + FontList aFontList(Application::GetDefaultDevice()); + ControlCharacterDialog::createItemSet(pSet, pPool, aFontList); ControlCharacterDialog::translatePropertiesToItems(m_xComponent, pSet.get()); { // do this in an own block. The dialog needs to be destroyed before we call @@ -2860,7 +2855,7 @@ namespace pcr } } - ControlCharacterDialog::destroyItemSet(pSet, pPool, pDefaults); + ControlCharacterDialog::destroyItemSet(pSet, pPool); return bSuccess; } @@ -2874,7 +2869,7 @@ namespace pcr OUString sDataSource; if( ! (impl_getPropertyValue_throw( PROPERTY_DATASOURCE ) >>= sDataSource) ) - SAL_WARN("extensions.propctrlr", "impl_browseForDatabaseDocument_throw: unable to get property " PROPERTY_DATASOURCE); + SAL_WARN("extensions.propctrlr", "impl_browseForDatabaseDocument_throw: unable to get property " << PROPERTY_DATASOURCE); INetURLObject aParser( sDataSource ); if ( INetProtocol::File == aParser.GetProtocol() ) // set the initial directory only for file-URLs. Everything else @@ -3009,7 +3004,7 @@ namespace pcr { OUString sCommand; if( ! (m_xObject->getPropertyValue( PROPERTY_COMMAND ) >>= sCommand) ) - SAL_WARN("extensions.propctrlr", "getSQLCommand: unable to get property " PROPERTY_COMMAND); + SAL_WARN("extensions.propctrlr", "getSQLCommand: unable to get property " << PROPERTY_COMMAND); return sCommand; } @@ -3018,30 +3013,30 @@ namespace pcr { bool bEscapeProcessing( false ); if( ! (m_xObject->getPropertyValue( PROPERTY_ESCAPE_PROCESSING ) >>= bEscapeProcessing) ) - SAL_WARN("extensions.propctrlr", "getSQLCommand: unable to get property " PROPERTY_ESCAPE_PROCESSING); + SAL_WARN("extensions.propctrlr", "getSQLCommand: unable to get property " << PROPERTY_ESCAPE_PROCESSING); return bEscapeProcessing; } void FormSQLCommandUI::setSQLCommand( const OUString& _rCommand ) const { - m_xObject->setPropertyValue( PROPERTY_COMMAND, makeAny( _rCommand ) ); + m_xObject->setPropertyValue( PROPERTY_COMMAND, Any( _rCommand ) ); } void FormSQLCommandUI::setEscapeProcessing( const bool _bEscapeProcessing ) const { - m_xObject->setPropertyValue( PROPERTY_ESCAPE_PROCESSING, makeAny( _bEscapeProcessing ) ); + m_xObject->setPropertyValue( PROPERTY_ESCAPE_PROCESSING, Any( _bEscapeProcessing ) ); } OUString* FormSQLCommandUI::getPropertiesToDisable() { static OUString s_aCommandProps[] = { - OUString(PROPERTY_DATASOURCE), - OUString(PROPERTY_COMMAND), - OUString(PROPERTY_COMMANDTYPE), - OUString(PROPERTY_ESCAPE_PROCESSING), + PROPERTY_DATASOURCE, + PROPERTY_COMMAND, + PROPERTY_COMMANDTYPE, + PROPERTY_ESCAPE_PROCESSING, OUString() }; return s_aCommandProps; @@ -3105,7 +3100,7 @@ namespace pcr { ListSourceType eType = ListSourceType_SQL; if( ! (m_xObject->getPropertyValue( PROPERTY_LISTSOURCETYPE ) >>= eType) ) - SAL_WARN("extensions.propctrlr", "getEscapeProcessing: unable to get property " PROPERTY_LISTSOURCETYPE); + SAL_WARN("extensions.propctrlr", "getEscapeProcessing: unable to get property " << PROPERTY_LISTSOURCETYPE); OSL_ENSURE( ( eType == ListSourceType_SQL ) || ( eType == ListSourceType_SQLPASSTHROUGH ), "ValueListCommandUI::getEscapeProcessing: unexpected list source type!" ); return ( eType == ListSourceType_SQL ); @@ -3125,7 +3120,7 @@ namespace pcr void ValueListCommandUI::setEscapeProcessing( const bool _bEscapeProcessing ) const { - m_xObject->setPropertyValue( PROPERTY_LISTSOURCETYPE, makeAny( + m_xObject->setPropertyValue( PROPERTY_LISTSOURCETYPE, Any( _bEscapeProcessing ? ListSourceType_SQL : ListSourceType_SQLPASSTHROUGH ) ); } @@ -3133,8 +3128,8 @@ namespace pcr OUString* ValueListCommandUI::getPropertiesToDisable() { static OUString s_aListSourceProps[] = { - OUString(PROPERTY_LISTSOURCETYPE), - OUString(PROPERTY_LISTSOURCE), + PROPERTY_LISTSOURCETYPE, + PROPERTY_LISTSOURCE, OUString() }; return s_aListSourceProps; @@ -3154,7 +3149,7 @@ namespace pcr return true; } m_xCommandDesigner->dispose(); - m_xCommandDesigner.set( nullptr ); + m_xCommandDesigner.clear(); } if ( !impl_ensureRowsetConnection_nothrow() ) diff --git a/extensions/source/propctrlr/formcomponenthandler.hxx b/extensions/source/propctrlr/formcomponenthandler.hxx index 79b83fb927ed..bc7367abbeae 100644 --- a/extensions/source/propctrlr/formcomponenthandler.hxx +++ b/extensions/source/propctrlr/formcomponenthandler.hxx @@ -255,7 +255,7 @@ namespace pcr */ bool impl_dialogFilterOrSort_nothrow( bool _bFilter, OUString& _out_rSelectedClause, ::osl::ClearableMutexGuard& _rClearBeforeDialog ) const; - /** executes a dialog which allows the user to chose the columns linking + /** executes a dialog which allows the user to choose the columns linking a sub to a master form, and sets the respective MasterFields / SlaveFields properties at the form. @precond diff --git a/extensions/source/propctrlr/formcontroller.cxx b/extensions/source/propctrlr/formcontroller.cxx index e6be69492f2c..f2daf2dbd329 100644 --- a/extensions/source/propctrlr/formcontroller.cxx +++ b/extensions/source/propctrlr/formcontroller.cxx @@ -25,6 +25,7 @@ #include <com/sun/star/beans/PropertyAttribute.hpp> #include <com/sun/star/util/VetoException.hpp> #include <cppuhelper/typeprovider.hxx> +#include <utility> namespace pcr @@ -56,12 +57,12 @@ namespace pcr FormController::FormController( const Reference< XComponentContext >& _rxContext, - const OUString& sImplementationName, + OUString sImplementationName, const css::uno::Sequence<OUString>& aSupportedServiceNames, bool _bUseFormFormComponentHandlers ) :OPropertyBrowserController( _rxContext ) ,FormController_PropertyBase1( m_aBHelper ) - ,m_sImplementationName( sImplementationName ) + ,m_sImplementationName(std::move( sImplementationName )) ,m_aSupportedServiceNames( aSupportedServiceNames ) { osl_atomic_increment( &m_refCount ); @@ -108,7 +109,7 @@ namespace pcr { Sequence< OUString > aSupported( m_aSupportedServiceNames ); aSupported.realloc( aSupported.getLength() + 1 ); - aSupported[ aSupported.getLength() - 1 ] = "com.sun.star.inspection.ObjectInspector"; + aSupported.getArray()[ aSupported.getLength() - 1 ] = "com.sun.star.inspection.ObjectInspector"; return aSupported; } @@ -127,35 +128,38 @@ namespace pcr ::cppu::IPropertyArrayHelper* FormController::createArrayHelper( ) const { - Sequence< Property > aProps( 2 ); - aProps[0] = Property( - PROPERTY_CURRENTPAGE, - OWN_PROPERTY_ID_CURRENTPAGE, - ::cppu::UnoType<OUString>::get(), - PropertyAttribute::TRANSIENT - ); - aProps[1] = Property( - PROPERTY_INTROSPECTEDOBJECT, - OWN_PROPERTY_ID_INTROSPECTEDOBJECT, - cppu::UnoType<XPropertySet>::get(), - PropertyAttribute::TRANSIENT | PropertyAttribute::CONSTRAINED - ); + Sequence< Property > aProps{ + Property( + PROPERTY_CURRENTPAGE, + static_cast<sal_Int32>(OwnPropertyId::CURRENTPAGE), + ::cppu::UnoType<OUString>::get(), + PropertyAttribute::TRANSIENT + ), + Property( + PROPERTY_INTROSPECTEDOBJECT, + static_cast<sal_Int32>(OwnPropertyId::INTROSPECTEDOBJECT), + cppu::UnoType<XPropertySet>::get(), + PropertyAttribute::TRANSIENT | PropertyAttribute::CONSTRAINED + ) + }; return new ::cppu::OPropertyArrayHelper( aProps ); } sal_Bool SAL_CALL FormController::convertFastPropertyValue( Any & rConvertedValue, Any & rOldValue, sal_Int32 nHandle, const Any& rValue ) { - switch ( nHandle ) + switch ( static_cast<OwnPropertyId>(nHandle) ) { - case OWN_PROPERTY_ID_INTROSPECTEDOBJECT: + case OwnPropertyId::INTROSPECTEDOBJECT: if ( rValue.getValueTypeClass() != TypeClass_INTERFACE ) throw IllegalArgumentException(); break; - case OWN_PROPERTY_ID_CURRENTPAGE: + case OwnPropertyId::CURRENTPAGE: if ( rValue.getValueTypeClass() != TypeClass_STRING ) throw IllegalArgumentException(); break; + default: + break; } getFastPropertyValue( rOldValue, nHandle ); @@ -166,9 +170,9 @@ namespace pcr void SAL_CALL FormController::setFastPropertyValue_NoBroadcast(sal_Int32 _nHandle, const Any& _rValue) { - switch ( _nHandle ) + switch ( static_cast<OwnPropertyId>(_nHandle) ) { - case OWN_PROPERTY_ID_INTROSPECTEDOBJECT: + case OwnPropertyId::INTROSPECTEDOBJECT: { Reference< XObjectInspectorModel > xModel( getInspectorModel() ); if ( xModel.is() ) @@ -179,8 +183,7 @@ namespace pcr Sequence< Reference< XInterface > > aObjects; if ( m_xCurrentInspectee.is() ) { - aObjects.realloc( 1 ); - aObjects[0] = m_xCurrentInspectee; + aObjects = { m_xCurrentInspectee }; } Reference< XObjectInspector > xInspector( *this, UNO_QUERY_THROW ); @@ -193,24 +196,28 @@ namespace pcr } } break; - case OWN_PROPERTY_ID_CURRENTPAGE: + case OwnPropertyId::CURRENTPAGE: restoreViewData( _rValue ); break; + default: + break; } } void SAL_CALL FormController::getFastPropertyValue( css::uno::Any& rValue, sal_Int32 nHandle ) const { - switch ( nHandle ) + switch ( static_cast<OwnPropertyId>(nHandle) ) { - case OWN_PROPERTY_ID_INTROSPECTEDOBJECT: + case OwnPropertyId::INTROSPECTEDOBJECT: rValue <<= m_xCurrentInspectee; break; - case OWN_PROPERTY_ID_CURRENTPAGE: + case OwnPropertyId::CURRENTPAGE: rValue = const_cast< FormController* >( this )->getViewData(); break; + default: + break; } } diff --git a/extensions/source/propctrlr/formcontroller.hxx b/extensions/source/propctrlr/formcontroller.hxx index 8c285160e676..f3415057fc80 100644 --- a/extensions/source/propctrlr/formcontroller.hxx +++ b/extensions/source/propctrlr/formcontroller.hxx @@ -52,7 +52,7 @@ namespace pcr public: FormController( const css::uno::Reference< css::uno::XComponentContext >& _rxContext, - const OUString& sImplementName, + OUString sImplementName, const css::uno::Sequence<OUString>& aSupportedServiceNames, bool _bUseFormFormComponentHandlers ); diff --git a/extensions/source/propctrlr/formgeometryhandler.cxx b/extensions/source/propctrlr/formgeometryhandler.cxx index f33ee1a6df78..b07cd7eb145e 100644 --- a/extensions/source/propctrlr/formgeometryhandler.cxx +++ b/extensions/source/propctrlr/formgeometryhandler.cxx @@ -41,9 +41,11 @@ #include <cppuhelper/implbase.hxx> #include <cppuhelper/interfacecontainer.hxx> +#include <comphelper/interfacecontainer2.hxx> #include <comphelper/componentbase.hxx> #include <rtl/ref.hxx> -#include <tools/diagnose_ex.h> +#include <utility> +#include <comphelper/diagnose_ex.hxx> namespace pcr { @@ -57,7 +59,6 @@ namespace pcr using ::com::sun::star::uno::Exception; using ::com::sun::star::uno::RuntimeException; using ::com::sun::star::uno::Any; - using ::com::sun::star::uno::makeAny; using ::com::sun::star::uno::Sequence; using ::com::sun::star::uno::XComponentContext; using ::com::sun::star::beans::Property; @@ -305,7 +306,7 @@ namespace pcr Reference< XMap > xControlMap; Any any = m_xContext->getValueByName( "ControlShapeAccess" ); any >>= xControlMap; - m_xAssociatedShape.set( xControlMap->get( makeAny( xControlModel ) ), UNO_QUERY_THROW ); + m_xAssociatedShape.set( xControlMap->get( Any( xControlModel ) ), UNO_QUERY_THROW ); m_xShapeProperties.set( m_xAssociatedShape, UNO_QUERY_THROW ); } } @@ -639,7 +640,7 @@ namespace pcr continue; sal_Int32 nHeightOrWidth( 0 ); - OSL_VERIFY( xRowOrColumn->getPropertyValue( _bRows ? OUString(PROPERTY_HEIGHT) : OUString(PROPERTY_WIDTH) ) >>= nHeightOrWidth ); + OSL_VERIFY( xRowOrColumn->getPropertyValue( _bRows ? PROPERTY_HEIGHT : PROPERTY_WIDTH ) >>= nHeightOrWidth ); if ( nAccumulated + nHeightOrWidth > rRelativePos ) break; @@ -670,7 +671,7 @@ namespace pcr if ( xSheet.is() ) { css::awt::Point aPreservePosition( m_xAssociatedShape->getPosition() ); - m_xShapeProperties->setPropertyValue( PROPERTY_ANCHOR, makeAny( xSheet ) ); + m_xShapeProperties->setPropertyValue( PROPERTY_ANCHOR, Any( xSheet ) ); m_xAssociatedShape->setPosition( aPreservePosition ); } break; @@ -719,9 +720,9 @@ namespace pcr OUString sPropertyName; Any aNewPropertyValue; - EventTranslation( const OUString& _propertyName, const Any& _newPropertyValue ) - :sPropertyName( _propertyName ) - ,aNewPropertyValue( _newPropertyValue ) + EventTranslation( OUString _propertyName, Any _newPropertyValue ) + :sPropertyName(std::move( _propertyName )) + ,aNewPropertyValue(std::move( _newPropertyValue )) { } }; @@ -738,22 +739,22 @@ namespace pcr if ( _event.PropertyName == "Position" ) { css::awt::Point aPos = m_xShape->getPosition(); - aEventTranslations.push_back( EventTranslation( PROPERTY_POSITIONX, makeAny( aPos.X ) ) ); - aEventTranslations.push_back( EventTranslation( PROPERTY_POSITIONY, makeAny( aPos.Y ) ) ); + aEventTranslations.emplace_back(PROPERTY_POSITIONX, Any( aPos.X )); + aEventTranslations.emplace_back(PROPERTY_POSITIONY, Any( aPos.Y )); } else if ( _event.PropertyName == "Size" ) { css::awt::Size aSize = m_xShape->getSize(); - aEventTranslations.push_back( EventTranslation( PROPERTY_WIDTH, makeAny( aSize.Width ) ) ); - aEventTranslations.push_back( EventTranslation( PROPERTY_HEIGHT, makeAny( aSize.Height ) ) ); + aEventTranslations.emplace_back(PROPERTY_WIDTH, Any( aSize.Width )); + aEventTranslations.emplace_back(PROPERTY_HEIGHT, Any( aSize.Height )); } else if ( _event.PropertyName == PROPERTY_ANCHOR_TYPE ) { - aEventTranslations.push_back( EventTranslation( PROPERTY_TEXT_ANCHOR_TYPE, _event.NewValue ) ); + aEventTranslations.emplace_back(PROPERTY_TEXT_ANCHOR_TYPE, _event.NewValue); } else if ( _event.PropertyName == PROPERTY_ANCHOR ) { - aEventTranslations.push_back( EventTranslation( PROPERTY_SHEET_ANCHOR_TYPE, _event.NewValue ) ); + aEventTranslations.emplace_back(PROPERTY_SHEET_ANCHOR_TYPE, _event.NewValue); } PropertyChangeEvent aTranslatedEvent( _event ); diff --git a/extensions/source/propctrlr/formlinkdialog.cxx b/extensions/source/propctrlr/formlinkdialog.cxx index 7f2d794b4010..605837c5d1b3 100644 --- a/extensions/source/propctrlr/formlinkdialog.cxx +++ b/extensions/source/propctrlr/formlinkdialog.cxx @@ -24,7 +24,8 @@ #include <strings.hrc> #include "formstrings.hxx" #include <sal/log.hxx> -#include <tools/diagnose_ex.h> +#include <comphelper/diagnose_ex.hxx> +#include <utility> #include <vcl/svapp.hxx> #include <connectivity/dbtools.hxx> #include <connectivity/dbexception.hxx> @@ -45,7 +46,6 @@ namespace pcr using namespace ::com::sun::star::uno; - using namespace ::com::sun::star::lang; using namespace ::com::sun::star::sdb; using namespace ::com::sun::star::sdbc; using namespace ::com::sun::star::sdbcx; @@ -136,14 +136,14 @@ namespace pcr FormLinkDialog::FormLinkDialog(weld::Window* _pParent, const Reference< XPropertySet >& _rxDetailForm, const Reference< XPropertySet >& _rxMasterForm, const Reference< XComponentContext >& _rxContext, const OUString& _sExplanation, - const OUString& _sDetailLabel, - const OUString& _sMasterLabel) + OUString _sDetailLabel, + OUString _sMasterLabel) : GenericDialogController(_pParent, "modules/spropctrlr/ui/formlinksdialog.ui", "FormLinks") , m_xContext ( _rxContext ) , m_xDetailForm( _rxDetailForm ) , m_xMasterForm( _rxMasterForm ) - , m_sDetailLabel(_sDetailLabel) - , m_sMasterLabel(_sMasterLabel) + , m_sDetailLabel(std::move(_sDetailLabel)) + , m_sMasterLabel(std::move(_sMasterLabel)) , m_xExplanation(m_xBuilder->weld_label("explanationLabel")) , m_xDetailLabel(m_xBuilder->weld_label("detailLabel")) , m_xMasterLabel(m_xBuilder->weld_label("masterLabel")) @@ -209,8 +209,8 @@ namespace pcr { if ( m_xDetailForm.is() ) { - m_xDetailForm->setPropertyValue( PROPERTY_DETAILFIELDS, makeAny( Sequence< OUString >( aDetailFields.data(), aDetailFields.size() ) ) ); - m_xDetailForm->setPropertyValue( PROPERTY_MASTERFIELDS, makeAny( Sequence< OUString >( aMasterFields.data(), aMasterFields.size() ) ) ); + m_xDetailForm->setPropertyValue( PROPERTY_DETAILFIELDS, Any( Sequence< OUString >( aDetailFields.data(), aDetailFields.size() ) ) ); + m_xDetailForm->setPropertyValue( PROPERTY_MASTERFIELDS, Any( Sequence< OUString >( aMasterFields.data(), aMasterFields.size() ) ) ); } } catch( const Exception& ) @@ -413,9 +413,7 @@ namespace pcr sErrorMessage = sErrorMessage.replaceFirst("#", sCommand); } - SQLContext aContext; - aContext.Message = sErrorMessage; - aContext.NextException = aErrorInfo.get(); + SQLContext aContext(sErrorMessage, {}, {}, 0, aErrorInfo.get(), {}); ::dbtools::showError(aContext, m_xDialog->GetXWindow(), m_xContext); } diff --git a/extensions/source/propctrlr/formlinkdialog.hxx b/extensions/source/propctrlr/formlinkdialog.hxx index 80cc086cc156..58e9fe27dea0 100644 --- a/extensions/source/propctrlr/formlinkdialog.hxx +++ b/extensions/source/propctrlr/formlinkdialog.hxx @@ -67,8 +67,8 @@ namespace pcr const css::uno::Reference< css::beans::XPropertySet >& _rxMasterForm, const css::uno::Reference< css::uno::XComponentContext >& _rxContext, const OUString& _sExplanation = OUString(), - const OUString& _sDetailLabel = OUString(), - const OUString& _sMasterLabel = OUString() + OUString _sDetailLabel = OUString(), + OUString _sMasterLabel = OUString() ); virtual ~FormLinkDialog() override; diff --git a/extensions/source/propctrlr/formmetadata.cxx b/extensions/source/propctrlr/formmetadata.cxx index f9147cb4469a..c6e1e0d6020e 100644 --- a/extensions/source/propctrlr/formmetadata.cxx +++ b/extensions/source/propctrlr/formmetadata.cxx @@ -25,9 +25,10 @@ #include <strings.hrc> #include <stringarrays.hrc> #include <comphelper/extract.hxx> +#include <o3tl/safeint.hxx> #include <osl/diagnose.h> -#include <sal/macros.h> #include <algorithm> +#include <utility> namespace pcr { @@ -40,26 +41,26 @@ namespace pcr { OUString sName; OUString sTranslation; - OString sHelpId; + OUString sHelpId; sal_Int32 nId; sal_uInt16 nPos; sal_uInt32 nUIFlags; OPropertyInfoImpl( - const OUString& rName, + OUString aName, sal_Int32 _nId, - const OUString& aTranslation, + OUString aTranslation, sal_uInt16 nPosId, - const OString&, + OUString , sal_uInt32 _nUIFlags); }; - OPropertyInfoImpl::OPropertyInfoImpl(const OUString& _rName, sal_Int32 _nId, - const OUString& aString, sal_uInt16 nP, const OString& sHid, sal_uInt32 _nUIFlags) - :sName(_rName) - ,sTranslation(aString) - ,sHelpId(sHid) + OPropertyInfoImpl::OPropertyInfoImpl(OUString _aName, sal_Int32 _nId, + OUString aString, sal_uInt16 nP, OUString sHid, sal_uInt32 _nUIFlags) + :sName(std::move(_aName)) + ,sTranslation(std::move(aString)) + ,sHelpId(std::move(sHid)) ,nId(_nId) ,nPos(nP) ,nUIFlags(_nUIFlags) @@ -97,7 +98,7 @@ namespace pcr #define DEF_INFO_4( ident, uinameres, pos, helpid, flag1, flag2, flag3, flag4 ) \ DEF_INFO( ident, uinameres, pos, helpid, PROP_FLAG_##flag1 | PROP_FLAG_##flag2 | PROP_FLAG_##flag3 | PROP_FLAG_##flag4 ) - sal_uInt16 OPropertyInfoService::s_nCount = 0; + std::size_t OPropertyInfoService::s_nCount = 0; OPropertyInfoImpl* OPropertyInfoService::s_pPropertyInfos = nullptr; const OPropertyInfoImpl* OPropertyInfoService::getPropertyInfo() @@ -358,7 +359,7 @@ namespace pcr }; s_pPropertyInfos = aPropertyInfos; - s_nCount = SAL_N_ELEMENTS(aPropertyInfos); + s_nCount = std::size(aPropertyInfos); // sort std::sort( s_pPropertyInfos, s_pPropertyInfos + s_nCount, PropertyInfoLessByName() ); @@ -387,10 +388,10 @@ namespace pcr return pInfo ? pInfo->sTranslation : OUString(); } - OString OPropertyInfoService::getPropertyHelpId(sal_Int32 _nId) const + OUString OPropertyInfoService::getPropertyHelpId(sal_Int32 _nId) const { const OPropertyInfoImpl* pInfo = getPropertyInfo(_nId); - return pInfo ? pInfo->sHelpId : OString(); + return pInfo ? pInfo->sHelpId : OUString(); } sal_Int16 OPropertyInfoService::getPropertyPos(sal_Int32 _nId) const @@ -410,131 +411,131 @@ namespace pcr OSL_ENSURE( ( ( getPropertyUIFlags( _nId ) & PROP_FLAG_ENUM ) != 0 ) || ( _nId == PROPERTY_ID_TARGET_FRAME ), "OPropertyInfoService::getPropertyEnumRepresentations: this is no enum property!" ); + if (_nId == PROPERTY_ID_SUBMIT_METHOD) + { + return { "Get", "Post" }; + } const TranslateId* pStringItemsResId = nullptr; - int nElements = 0; + std::size_t nElements = 0; switch ( _nId ) { case PROPERTY_ID_IMAGEPOSITION: pStringItemsResId = RID_RSC_ENUM_IMAGE_POSITION; - nElements = SAL_N_ELEMENTS(RID_RSC_ENUM_IMAGE_POSITION); + nElements = std::size(RID_RSC_ENUM_IMAGE_POSITION); break; case PROPERTY_ID_BORDER: pStringItemsResId = RID_RSC_ENUM_BORDER_TYPE; - nElements = SAL_N_ELEMENTS(RID_RSC_ENUM_BORDER_TYPE); + nElements = std::size(RID_RSC_ENUM_BORDER_TYPE); break; case PROPERTY_ID_ICONSIZE: pStringItemsResId = RID_RSC_ENUM_ICONSIZE_TYPE; - nElements = SAL_N_ELEMENTS(RID_RSC_ENUM_ICONSIZE_TYPE); + nElements = std::size(RID_RSC_ENUM_ICONSIZE_TYPE); break; case PROPERTY_ID_COMMANDTYPE: pStringItemsResId = RID_RSC_ENUM_COMMAND_TYPE; - nElements = SAL_N_ELEMENTS(RID_RSC_ENUM_COMMAND_TYPE); + nElements = std::size(RID_RSC_ENUM_COMMAND_TYPE); break; case PROPERTY_ID_LISTSOURCETYPE: pStringItemsResId = RID_RSC_ENUM_LISTSOURCE_TYPE; - nElements = SAL_N_ELEMENTS(RID_RSC_ENUM_LISTSOURCE_TYPE); + nElements = std::size(RID_RSC_ENUM_LISTSOURCE_TYPE); break; case PROPERTY_ID_ALIGN: pStringItemsResId = RID_RSC_ENUM_ALIGNMENT; - nElements = SAL_N_ELEMENTS(RID_RSC_ENUM_ALIGNMENT); + nElements = std::size(RID_RSC_ENUM_ALIGNMENT); break; case PROPERTY_ID_VERTICAL_ALIGN: pStringItemsResId = RID_RSC_ENUM_VERTICAL_ALIGN; - nElements = SAL_N_ELEMENTS(RID_RSC_ENUM_VERTICAL_ALIGN); + nElements = std::size(RID_RSC_ENUM_VERTICAL_ALIGN); break; case PROPERTY_ID_BUTTONTYPE: pStringItemsResId = RID_RSC_ENUM_BUTTONTYPE; - nElements = SAL_N_ELEMENTS(RID_RSC_ENUM_BUTTONTYPE); + nElements = std::size(RID_RSC_ENUM_BUTTONTYPE); break; case PROPERTY_ID_PUSHBUTTONTYPE: pStringItemsResId = RID_RSC_ENUM_PUSHBUTTONTYPE; - nElements = SAL_N_ELEMENTS(RID_RSC_ENUM_PUSHBUTTONTYPE); - break; - case PROPERTY_ID_SUBMIT_METHOD: - pStringItemsResId = RID_RSC_ENUM_SUBMIT_METHOD; - nElements = SAL_N_ELEMENTS(RID_RSC_ENUM_SUBMIT_METHOD); + nElements = std::size(RID_RSC_ENUM_PUSHBUTTONTYPE); break; case PROPERTY_ID_SUBMIT_ENCODING: pStringItemsResId = RID_RSC_ENUM_SUBMIT_ENCODING; - nElements = SAL_N_ELEMENTS(RID_RSC_ENUM_SUBMIT_ENCODING); + nElements = std::size(RID_RSC_ENUM_SUBMIT_ENCODING); break; case PROPERTY_ID_DATEFORMAT: pStringItemsResId = RID_RSC_ENUM_DATEFORMAT_LIST; - nElements = SAL_N_ELEMENTS(RID_RSC_ENUM_DATEFORMAT_LIST); + nElements = std::size(RID_RSC_ENUM_DATEFORMAT_LIST); break; case PROPERTY_ID_TIMEFORMAT: pStringItemsResId = RID_RSC_ENUM_TIMEFORMAT_LIST; - nElements = SAL_N_ELEMENTS(RID_RSC_ENUM_TIMEFORMAT_LIST); + nElements = std::size(RID_RSC_ENUM_TIMEFORMAT_LIST); break; case PROPERTY_ID_DEFAULT_STATE: case PROPERTY_ID_STATE: pStringItemsResId = RID_RSC_ENUM_CHECKED; - nElements = SAL_N_ELEMENTS(RID_RSC_ENUM_CHECKED); + nElements = std::size(RID_RSC_ENUM_CHECKED); break; case PROPERTY_ID_CYCLE: pStringItemsResId = RID_RSC_ENUM_CYCLE; - nElements = SAL_N_ELEMENTS(RID_RSC_ENUM_CYCLE); + nElements = std::size(RID_RSC_ENUM_CYCLE); break; case PROPERTY_ID_NAVIGATION: pStringItemsResId = RID_RSC_ENUM_NAVIGATION; - nElements = SAL_N_ELEMENTS(RID_RSC_ENUM_NAVIGATION); + nElements = std::size(RID_RSC_ENUM_NAVIGATION); break; case PROPERTY_ID_TARGET_FRAME: pStringItemsResId = RID_RSC_ENUM_SUBMIT_TARGET; - nElements = SAL_N_ELEMENTS(RID_RSC_ENUM_SUBMIT_TARGET); + nElements = std::size(RID_RSC_ENUM_SUBMIT_TARGET); break; case PROPERTY_ID_ORIENTATION: pStringItemsResId = RID_RSC_ENUM_ORIENTATION; - nElements = SAL_N_ELEMENTS(RID_RSC_ENUM_ORIENTATION); + nElements = std::size(RID_RSC_ENUM_ORIENTATION); break; case PROPERTY_ID_CELL_EXCHANGE_TYPE: pStringItemsResId = RID_RSC_ENUM_CELL_EXCHANGE_TYPE; - nElements = SAL_N_ELEMENTS(RID_RSC_ENUM_CELL_EXCHANGE_TYPE); + nElements = std::size(RID_RSC_ENUM_CELL_EXCHANGE_TYPE); break; case PROPERTY_ID_SHOW_SCROLLBARS: pStringItemsResId = RID_RSC_ENUM_SCROLLBARS; - nElements = SAL_N_ELEMENTS(RID_RSC_ENUM_SCROLLBARS); + nElements = std::size(RID_RSC_ENUM_SCROLLBARS); break; case PROPERTY_ID_VISUALEFFECT: pStringItemsResId = RID_RSC_ENUM_VISUALEFFECT; - nElements = SAL_N_ELEMENTS(RID_RSC_ENUM_VISUALEFFECT); + nElements = std::size(RID_RSC_ENUM_VISUALEFFECT); break; case PROPERTY_ID_TEXTTYPE: pStringItemsResId = RID_RSC_ENUM_TEXTTYPE; - nElements = SAL_N_ELEMENTS(RID_RSC_ENUM_TEXTTYPE); + nElements = std::size(RID_RSC_ENUM_TEXTTYPE); break; case PROPERTY_ID_LINEEND_FORMAT: pStringItemsResId = RID_RSC_ENUM_LINEEND_FORMAT; - nElements = SAL_N_ELEMENTS(RID_RSC_ENUM_LINEEND_FORMAT); + nElements = std::size(RID_RSC_ENUM_LINEEND_FORMAT); break; case PROPERTY_ID_XSD_WHITESPACES: pStringItemsResId = RID_RSC_ENUM_WHITESPACE_HANDLING; - nElements = SAL_N_ELEMENTS(RID_RSC_ENUM_WHITESPACE_HANDLING); + nElements = std::size(RID_RSC_ENUM_WHITESPACE_HANDLING); break; case PROPERTY_ID_SELECTION_TYPE: case PROPERTY_ID_SELECTIONMODEL: pStringItemsResId = RID_RSC_ENUM_SELECTION_TYPE; - nElements = SAL_N_ELEMENTS(RID_RSC_ENUM_SELECTION_TYPE); + nElements = std::size(RID_RSC_ENUM_SELECTION_TYPE); break; case PROPERTY_ID_SCALE_MODE: pStringItemsResId = RID_RSC_ENUM_SCALE_MODE; - nElements = SAL_N_ELEMENTS(RID_RSC_ENUM_SCALE_MODE); + nElements = std::size(RID_RSC_ENUM_SCALE_MODE); break; case PROPERTY_ID_WRITING_MODE: pStringItemsResId = RID_RSC_ENUM_WRITING_MODE; - nElements = SAL_N_ELEMENTS(RID_RSC_ENUM_WRITING_MODE); + nElements = std::size(RID_RSC_ENUM_WRITING_MODE); break; case PROPERTY_ID_WHEEL_BEHAVIOR: pStringItemsResId = RID_RSC_ENUM_WHEEL_BEHAVIOR; - nElements = SAL_N_ELEMENTS(RID_RSC_ENUM_WHEEL_BEHAVIOR); + nElements = std::size(RID_RSC_ENUM_WHEEL_BEHAVIOR); break; case PROPERTY_ID_TEXT_ANCHOR_TYPE: pStringItemsResId = RID_RSC_ENUM_TEXT_ANCHOR_TYPE; - nElements = SAL_N_ELEMENTS(RID_RSC_ENUM_TEXT_ANCHOR_TYPE); + nElements = std::size(RID_RSC_ENUM_TEXT_ANCHOR_TYPE); break; case PROPERTY_ID_SHEET_ANCHOR_TYPE: pStringItemsResId = RID_RSC_ENUM_SHEET_ANCHOR_TYPE; - nElements = SAL_N_ELEMENTS(RID_RSC_ENUM_SHEET_ANCHOR_TYPE); + nElements = std::size(RID_RSC_ENUM_SHEET_ANCHOR_TYPE); break; default: OSL_FAIL( "OPropertyInfoService::getPropertyEnumRepresentations: unknown enum property!" ); @@ -544,7 +545,7 @@ namespace pcr std::vector< OUString > aReturn; aReturn.reserve(nElements); - for (int i = 0; i < nElements; ++i) + for (std::size_t i = 0; i < nElements; ++i) { aReturn.push_back(PcrRes(pStringItemsResId[i])); } @@ -590,7 +591,7 @@ namespace pcr getPropertyInfo(); // TODO: a real structure which allows quick access by name as well as by id - for (sal_uInt16 i = 0; i < s_nCount; i++) + for (std::size_t i = 0; i < s_nCount; ++i) if (s_pPropertyInfos[i].nId == _nId) return &s_pPropertyInfos[i]; @@ -675,7 +676,7 @@ namespace pcr --nIntValue; std::vector< OUString > aEnumStrings = m_rMetaData.getPropertyEnumRepresentations( m_nPropertyId ); - if ( ( nIntValue >= 0 ) && ( nIntValue < static_cast<sal_Int32>(aEnumStrings.size()) ) ) + if ( ( nIntValue >= 0 ) && ( o3tl::make_unsigned(nIntValue) < aEnumStrings.size() ) ) { sReturn = aEnumStrings[ nIntValue ]; } diff --git a/extensions/source/propctrlr/formmetadata.hxx b/extensions/source/propctrlr/formmetadata.hxx index 121e0bfde4c4..c2c297740b01 100644 --- a/extensions/source/propctrlr/formmetadata.hxx +++ b/extensions/source/propctrlr/formmetadata.hxx @@ -35,7 +35,7 @@ namespace pcr class OPropertyInfoService final :public IPropertyInfoService { - static sal_uInt16 s_nCount; + static std::size_t s_nCount; static OPropertyInfoImpl* s_pPropertyInfos; // TODO: a real structure which allows quick access by name as well as by id @@ -43,7 +43,7 @@ namespace pcr // IPropertyInfoService virtual sal_Int32 getPropertyId(const OUString& _rName) const override; virtual OUString getPropertyTranslation(sal_Int32 _nId) const override; - virtual OString getPropertyHelpId(sal_Int32 _nId) const override; + virtual OUString getPropertyHelpId(sal_Int32 _nId) const override; virtual sal_Int16 getPropertyPos(sal_Int32 _nId) const override; virtual sal_uInt32 getPropertyUIFlags(sal_Int32 _nId) const override; virtual std::vector< OUString > getPropertyEnumRepresentations(sal_Int32 _nId) const override; diff --git a/extensions/source/propctrlr/formstrings.hxx b/extensions/source/propctrlr/formstrings.hxx index 4a55cd8280a8..41deed74c8fb 100644 --- a/extensions/source/propctrlr/formstrings.hxx +++ b/extensions/source/propctrlr/formstrings.hxx @@ -19,294 +19,284 @@ #pragma once +#include <rtl/ustring.hxx> -namespace pcr -{ +inline constexpr OUString PROPERTY_DEFAULTCONTROL = u"DefaultControl"_ustr; +inline constexpr OUString PROPERTY_INTROSPECTEDOBJECT = u"IntrospectedObject"_ustr; +inline constexpr OUString PROPERTY_CURRENTPAGE = u"CurrentPage"_ustr; +inline constexpr OUString PROPERTY_CONTROLCONTEXT = u"ControlContext"_ustr; +// properties +inline constexpr OUString PROPERTY_CLASSID = u"ClassId"_ustr; +inline constexpr OUString PROPERTY_CONTROLLABEL = u"LabelControl"_ustr; +inline constexpr OUString PROPERTY_LABEL = u"Label"_ustr; +inline constexpr OUString PROPERTY_TABINDEX = u"TabIndex"_ustr; +inline constexpr OUString PROPERTY_WHEEL_BEHAVIOR = u"MouseWheelBehavior"_ustr; +inline constexpr OUString PROPERTY_TAG = u"Tag"_ustr; +inline constexpr OUString PROPERTY_NAME = u"Name"_ustr; +inline constexpr OUString PROPERTY_GROUP_NAME = u"GroupName"_ustr; +inline constexpr OUString PROPERTY_VALUE = u"Value"_ustr; +inline constexpr OUString PROPERTY_TEXT = u"Text"_ustr; +inline constexpr OUString PROPERTY_NAVIGATION = u"NavigationBarMode"_ustr; +inline constexpr OUString PROPERTY_CYCLE = u"Cycle"_ustr; +inline constexpr OUString PROPERTY_CONTROLSOURCE = u"DataField"_ustr; +inline constexpr OUString PROPERTY_INPUT_REQUIRED = u"InputRequired"_ustr; +inline constexpr OUString PROPERTY_ENABLED = u"Enabled"_ustr; +inline constexpr OUString PROPERTY_ENABLE_VISIBLE = u"EnableVisible"_ustr; +inline constexpr OUString PROPERTY_READONLY = u"ReadOnly"_ustr; +inline constexpr OUString PROPERTY_FILTER = u"Filter"_ustr; +inline constexpr OUString PROPERTY_WIDTH = u"Width"_ustr; +inline constexpr OUString PROPERTY_MULTILINE = u"MultiLine"_ustr; +inline constexpr OUString PROPERTY_WORDBREAK = u"WordBreak"_ustr; +inline constexpr OUString PROPERTY_TARGET_URL = u"TargetURL"_ustr; +inline constexpr OUString PROPERTY_TARGET_FRAME = u"TargetFrame"_ustr; +inline constexpr OUString PROPERTY_MAXTEXTLEN = u"MaxTextLen"_ustr; +inline constexpr OUString PROPERTY_EDITMASK = u"EditMask"_ustr; +inline constexpr OUString PROPERTY_SPIN = u"Spin"_ustr; +inline constexpr OUString PROPERTY_TRISTATE = u"TriState"_ustr; +inline constexpr OUString PROPERTY_HIDDEN_VALUE = u"HiddenValue"_ustr; +inline constexpr OUString PROPERTY_BUTTONTYPE = u"ButtonType"_ustr; +inline constexpr OUString PROPERTY_XFORMS_BUTTONTYPE = u"XFormsButtonType"_ustr; +inline constexpr OUString PROPERTY_STRINGITEMLIST = u"StringItemList"_ustr; +inline constexpr OUString PROPERTY_TYPEDITEMLIST = u"TypedItemList"_ustr; +inline constexpr OUString PROPERTY_DEFAULT_TEXT = u"DefaultText"_ustr; +inline constexpr OUString PROPERTY_DEFAULT_STATE = u"DefaultState"_ustr; +inline constexpr OUString PROPERTY_FORMATKEY = u"FormatKey"_ustr; +inline constexpr OUString PROPERTY_FORMATSSUPPLIER = u"FormatsSupplier"_ustr; +inline constexpr OUString PROPERTY_SUBMIT_ACTION = u"SubmitAction"_ustr; +inline constexpr OUString PROPERTY_SUBMIT_TARGET = u"SubmitTarget"_ustr; +inline constexpr OUString PROPERTY_SUBMIT_METHOD = u"SubmitMethod"_ustr; +inline constexpr OUString PROPERTY_SUBMIT_ENCODING = u"SubmitEncoding"_ustr; +inline constexpr OUString PROPERTY_IMAGE_URL = u"ImageURL"_ustr; +inline constexpr OUString PROPERTY_GRAPHIC = u"Graphic"_ustr; +inline constexpr OUString PROPERTY_EMPTY_IS_NULL = u"ConvertEmptyToNull"_ustr; +inline constexpr OUString PROPERTY_LISTSOURCETYPE = u"ListSourceType"_ustr; +inline constexpr OUString PROPERTY_LISTSOURCE = u"ListSource"_ustr; +inline constexpr OUString PROPERTY_DEFAULT_SELECT_SEQ = u"DefaultSelection"_ustr; +inline constexpr OUString PROPERTY_MULTISELECTION = u"MultiSelection"_ustr; +inline constexpr OUString PROPERTY_ALIGN = u"Align"_ustr; +inline constexpr OUString PROPERTY_VERTICAL_ALIGN = u"VerticalAlign"_ustr; +inline constexpr OUString PROPERTY_DEFAULT_DATE = u"DefaultDate"_ustr; +inline constexpr OUString PROPERTY_DEFAULT_TIME = u"DefaultTime"_ustr; +inline constexpr OUString PROPERTY_DEFAULT_VALUE = u"DefaultValue"_ustr; +inline constexpr OUString PROPERTY_DECIMAL_ACCURACY = u"DecimalAccuracy"_ustr; +inline constexpr OUString PROPERTY_REFVALUE = u"RefValue"_ustr; +inline constexpr OUString PROPERTY_UNCHECKEDREFVALUE = u"SecondaryRefValue"_ustr; +inline constexpr OUString PROPERTY_VALUEMIN = u"ValueMin"_ustr; +inline constexpr OUString PROPERTY_VALUEMAX = u"ValueMax"_ustr; +inline constexpr OUString PROPERTY_STRICTFORMAT = u"StrictFormat"_ustr; +inline constexpr OUString PROPERTY_ALLOWADDITIONS = u"AllowInserts"_ustr; +inline constexpr OUString PROPERTY_ALLOWEDITS = u"AllowUpdates"_ustr; +inline constexpr OUString PROPERTY_ALLOWDELETIONS = u"AllowDeletes"_ustr; +inline constexpr OUString PROPERTY_MASTERFIELDS = u"MasterFields"_ustr; +inline constexpr OUString PROPERTY_LITERALMASK = u"LiteralMask"_ustr; +inline constexpr OUString PROPERTY_VALUESTEP = u"ValueStep"_ustr; +inline constexpr OUString PROPERTY_SHOWTHOUSANDSEP = u"ShowThousandsSeparator"_ustr; +inline constexpr OUString PROPERTY_CURRENCYSYMBOL = u"CurrencySymbol"_ustr; +inline constexpr OUString PROPERTY_DATEFORMAT = u"DateFormat"_ustr; +inline constexpr OUString PROPERTY_DATEMIN = u"DateMin"_ustr; +inline constexpr OUString PROPERTY_DATEMAX = u"DateMax"_ustr; +inline constexpr OUString PROPERTY_TIMEFORMAT = u"TimeFormat"_ustr; +inline constexpr OUString PROPERTY_TIMEMIN = u"TimeMin"_ustr; +inline constexpr OUString PROPERTY_TIMEMAX = u"TimeMax"_ustr; +inline constexpr OUString PROPERTY_LINECOUNT = u"LineCount"_ustr; +inline constexpr OUString PROPERTY_BOUNDCOLUMN = u"BoundColumn"_ustr; +inline constexpr OUString PROPERTY_BACKGROUNDCOLOR = u"BackgroundColor"_ustr; +inline constexpr OUString PROPERTY_FILLCOLOR = u"FillColor"_ustr; +inline constexpr OUString PROPERTY_TEXTCOLOR = u"TextColor"_ustr; +inline constexpr OUString PROPERTY_LINECOLOR = u"LineColor"_ustr; +inline constexpr OUString PROPERTY_BORDER = u"Border"_ustr; +inline constexpr OUString PROPERTY_ICONSIZE = u"IconSize"_ustr; +inline constexpr OUString PROPERTY_DROPDOWN = u"Dropdown"_ustr; +inline constexpr OUString PROPERTY_HSCROLL = u"HScroll"_ustr; +inline constexpr OUString PROPERTY_VSCROLL = u"VScroll"_ustr; +inline constexpr OUString PROPERTY_SHOW_SCROLLBARS = u"ShowScrollbars"_ustr; +inline constexpr OUString PROPERTY_TABSTOP = u"Tabstop"_ustr; +inline constexpr OUString PROPERTY_AUTOCOMPLETE = u"Autocomplete"_ustr; +inline constexpr OUString PROPERTY_PRINTABLE = u"Printable"_ustr; +inline constexpr OUString PROPERTY_ECHO_CHAR = u"EchoChar"_ustr; +inline constexpr OUString PROPERTY_ROWHEIGHT = u"RowHeight"_ustr; +inline constexpr OUString PROPERTY_HELPTEXT = u"HelpText"_ustr; +inline constexpr OUString PROPERTY_FONT = u"FontDescriptor"_ustr; +inline constexpr OUString PROPERTY_FONT_NAME = u"FontName"_ustr; +inline constexpr OUString PROPERTY_FONT_STYLENAME = u"FontStyleName"_ustr; +inline constexpr OUString PROPERTY_FONT_FAMILY = u"FontFamily"_ustr; +inline constexpr OUString PROPERTY_FONT_CHARSET = u"FontCharset"_ustr; +inline constexpr OUString PROPERTY_FONT_HEIGHT = u"FontHeight"_ustr; +inline constexpr OUString PROPERTY_FONT_WEIGHT = u"FontWeight"_ustr; +inline constexpr OUString PROPERTY_FONT_SLANT = u"FontSlant"_ustr; +inline constexpr OUString PROPERTY_FONT_UNDERLINE = u"FontUnderline"_ustr; +inline constexpr OUString PROPERTY_FONT_STRIKEOUT = u"FontStrikeout"_ustr; +inline constexpr OUString PROPERTY_FONT_RELIEF = u"FontRelief"_ustr; +inline constexpr OUString PROPERTY_FONT_EMPHASIS_MARK = u"FontEmphasisMark"_ustr; +inline constexpr OUString PROPERTY_TEXTLINECOLOR = u"TextLineColor"_ustr; +inline constexpr OUString PROPERTY_HELPURL = u"HelpURL"_ustr; +inline constexpr OUString PROPERTY_RECORDMARKER = u"HasRecordMarker"_ustr; +inline constexpr OUString PROPERTY_EFFECTIVE_DEFAULT = u"EffectiveDefault"_ustr; +inline constexpr OUString PROPERTY_EFFECTIVE_MIN = u"EffectiveMin"_ustr; +inline constexpr OUString PROPERTY_EFFECTIVE_MAX = u"EffectiveMax"_ustr; +inline constexpr OUString PROPERTY_FILTERPROPOSAL = u"UseFilterValueProposal"_ustr; +inline constexpr OUString PROPERTY_CURRSYM_POSITION = u"PrependCurrencySymbol"_ustr; +inline constexpr OUString PROPERTY_COMMAND = u"Command"_ustr; +inline constexpr OUString PROPERTY_COMMANDTYPE = u"CommandType"_ustr; +inline constexpr OUString PROPERTY_INSERTONLY = u"IgnoreResult"_ustr; +inline constexpr OUString PROPERTY_ESCAPE_PROCESSING = u"EscapeProcessing"_ustr; +inline constexpr OUString PROPERTY_TITLE = u"Title"_ustr; +inline constexpr OUString PROPERTY_SORT = u"Order"_ustr; +inline constexpr OUString PROPERTY_DATASOURCE = u"DataSourceName"_ustr; +inline constexpr OUString PROPERTY_DETAILFIELDS = u"DetailFields"_ustr; +inline constexpr OUString PROPERTY_DEFAULTBUTTON = u"DefaultButton"_ustr; +inline constexpr OUString PROPERTY_LISTINDEX = u"ListIndex"_ustr; +inline constexpr OUString PROPERTY_HEIGHT = u"Height"_ustr; +inline constexpr OUString PROPERTY_HASNAVIGATION = u"HasNavigationBar"_ustr; +inline constexpr OUString PROPERTY_POSITIONX = u"PositionX"_ustr; +inline constexpr OUString PROPERTY_POSITIONY = u"PositionY"_ustr; +inline constexpr OUString PROPERTY_AUTOGROW = u"AutoGrow"_ustr; +inline constexpr OUString PROPERTY_STEP = u"Step"_ustr; +inline constexpr OUString PROPERTY_WORDLINEMODE = u"FontWordLineMode"_ustr; +inline constexpr OUString PROPERTY_PROGRESSVALUE = u"ProgressValue"_ustr; +inline constexpr OUString PROPERTY_PROGRESSVALUE_MIN = u"ProgressValueMin"_ustr; +inline constexpr OUString PROPERTY_PROGRESSVALUE_MAX = u"ProgressValueMax"_ustr; +inline constexpr OUString PROPERTY_SCROLLVALUE = u"ScrollValue"_ustr; +inline constexpr OUString PROPERTY_DEFAULT_SCROLLVALUE = u"DefaultScrollValue"_ustr; +inline constexpr OUString PROPERTY_SCROLLVALUE_MIN = u"ScrollValueMin"_ustr; +inline constexpr OUString PROPERTY_SCROLLVALUE_MAX = u"ScrollValueMax"_ustr; +inline constexpr OUString PROPERTY_SCROLL_WIDTH = u"ScrollWidth"_ustr; +inline constexpr OUString PROPERTY_SCROLL_HEIGHT = u"ScrollHeight"_ustr; +inline constexpr OUString PROPERTY_SCROLL_TOP = u"ScrollTop"_ustr; +inline constexpr OUString PROPERTY_SCROLL_LEFT = u"ScrollLeft"_ustr; +inline constexpr OUString PROPERTY_LINEINCREMENT = u"LineIncrement"_ustr; +inline constexpr OUString PROPERTY_BLOCKINCREMENT = u"BlockIncrement"_ustr; +inline constexpr OUString PROPERTY_VISIBLESIZE = u"VisibleSize"_ustr; +inline constexpr OUString PROPERTY_ORIENTATION = u"Orientation"_ustr; +inline constexpr OUString PROPERTY_IMAGEPOSITION = u"ImagePosition"_ustr; +inline constexpr OUString PROPERTY_ACTIVE_CONNECTION = u"ActiveConnection"_ustr; +inline constexpr OUString PROPERTY_ACTIVECOMMAND = u"ActiveCommand"_ustr; +inline constexpr OUString PROPERTY_DATE = u"Date"_ustr; +inline constexpr OUString PROPERTY_STATE = u"State"_ustr; +inline constexpr OUString PROPERTY_TIME = u"Time"_ustr; +inline constexpr OUString PROPERTY_SCALEIMAGE = u"ScaleImage"_ustr; +inline constexpr OUString PROPERTY_SCALE_MODE = u"ScaleMode"_ustr; +inline constexpr OUString PROPERTY_PUSHBUTTONTYPE = u"PushButtonType"_ustr; +inline constexpr OUString PROPERTY_EFFECTIVE_VALUE = u"EffectiveValue"_ustr; +inline constexpr OUString PROPERTY_SELECTEDITEMS = u"SelectedItems"_ustr; +inline constexpr OUString PROPERTY_REPEAT = u"Repeat"_ustr; +inline constexpr OUString PROPERTY_REPEAT_DELAY = u"RepeatDelay"_ustr; +inline constexpr OUString PROPERTY_SYMBOLCOLOR = u"SymbolColor"_ustr; +inline constexpr OUString PROPERTY_SPINVALUE = u"SpinValue"_ustr; +inline constexpr OUString PROPERTY_SPINVALUE_MIN = u"SpinValueMin"_ustr; +inline constexpr OUString PROPERTY_SPINVALUE_MAX = u"SpinValueMax"_ustr; +inline constexpr OUString PROPERTY_DEFAULT_SPINVALUE = u"DefaultSpinValue"_ustr; +inline constexpr OUString PROPERTY_SPININCREMENT = u"SpinIncrement"_ustr; +inline constexpr OUString PROPERTY_SHOW_POSITION = u"ShowPosition"_ustr; +inline constexpr OUString PROPERTY_SHOW_NAVIGATION = u"ShowNavigation"_ustr; +inline constexpr OUString PROPERTY_SHOW_RECORDACTIONS = u"ShowRecordActions"_ustr; +inline constexpr OUString PROPERTY_SHOW_FILTERSORT = u"ShowFilterSort"_ustr; +inline constexpr OUString PROPERTY_LINEEND_FORMAT = u"LineEndFormat"_ustr; +inline constexpr OUString PROPERTY_DECORATION = u"Decoration"_ustr; +inline constexpr OUString PROPERTY_NOLABEL = u"NoLabel"_ustr; +inline constexpr OUString PROPERTY_URL = u"URL"_ustr; - #define PROPERTY_DEFAULTCONTROL "DefaultControl" - #define PROPERTY_INTROSPECTEDOBJECT "IntrospectedObject" - #define PROPERTY_CURRENTPAGE "CurrentPage" - #define PROPERTY_CONTROLCONTEXT "ControlContext" +inline constexpr OUString PROPERTY_SELECTION_TYPE = u"SelectionType"_ustr; +inline constexpr OUString PROPERTY_ROOT_DISPLAYED = u"RootDisplayed"_ustr; +inline constexpr OUString PROPERTY_SHOWS_HANDLES = u"ShowsHandles"_ustr; +inline constexpr OUString PROPERTY_SHOWS_ROOT_HANDLES = u"ShowsRootHandles"_ustr; +inline constexpr OUString PROPERTY_EDITABLE = u"Editable"_ustr; +inline constexpr OUString PROPERTY_INVOKES_STOP_NOT_EDITING = u"InvokesStopNodeEditing"_ustr; - // properties - #define PROPERTY_CLASSID "ClassId" - #define PROPERTY_CONTROLLABEL "LabelControl" - #define PROPERTY_LABEL "Label" - #define PROPERTY_TABINDEX "TabIndex" - #define PROPERTY_WHEEL_BEHAVIOR "MouseWheelBehavior" - #define PROPERTY_TAG "Tag" - #define PROPERTY_NAME "Name" - #define PROPERTY_GROUP_NAME "GroupName" - #define PROPERTY_VALUE "Value" - #define PROPERTY_TEXT "Text" - #define PROPERTY_NAVIGATION "NavigationBarMode" - #define PROPERTY_CYCLE "Cycle" - #define PROPERTY_CONTROLSOURCE "DataField" - #define PROPERTY_INPUT_REQUIRED "InputRequired" - #define PROPERTY_ENABLED "Enabled" - #define PROPERTY_ENABLE_VISIBLE "EnableVisible" - #define PROPERTY_READONLY "ReadOnly" - #define PROPERTY_ISREADONLY "IsReadOnly" - #define PROPERTY_FILTER "Filter" - #define PROPERTY_WIDTH "Width" - #define PROPERTY_MULTILINE "MultiLine" - #define PROPERTY_WORDBREAK "WordBreak" - #define PROPERTY_TARGET_URL "TargetURL" - #define PROPERTY_TARGET_FRAME "TargetFrame" - #define PROPERTY_MAXTEXTLEN "MaxTextLen" - #define PROPERTY_EDITMASK "EditMask" - #define PROPERTY_SPIN "Spin" - #define PROPERTY_TRISTATE "TriState" - #define PROPERTY_HIDDEN_VALUE "HiddenValue" - #define PROPERTY_BUTTONTYPE "ButtonType" - #define PROPERTY_XFORMS_BUTTONTYPE "XFormsButtonType" - #define PROPERTY_STRINGITEMLIST "StringItemList" - #define PROPERTY_TYPEDITEMLIST "TypedItemList" - #define PROPERTY_DEFAULT_TEXT "DefaultText" - #define PROPERTY_DEFAULT_STATE "DefaultState" - #define PROPERTY_FORMATKEY "FormatKey" - #define PROPERTY_FORMATSSUPPLIER "FormatsSupplier" - #define PROPERTY_SUBMIT_ACTION "SubmitAction" - #define PROPERTY_SUBMIT_TARGET "SubmitTarget" - #define PROPERTY_SUBMIT_METHOD "SubmitMethod" - #define PROPERTY_SUBMIT_ENCODING "SubmitEncoding" - #define PROPERTY_IMAGE_URL "ImageURL" - #define PROPERTY_GRAPHIC "Graphic" - #define PROPERTY_EMPTY_IS_NULL "ConvertEmptyToNull" - #define PROPERTY_LISTSOURCETYPE "ListSourceType" - #define PROPERTY_LISTSOURCE "ListSource" - #define PROPERTY_DEFAULT_SELECT_SEQ "DefaultSelection" - #define PROPERTY_MULTISELECTION "MultiSelection" - #define PROPERTY_ALIGN "Align" - #define PROPERTY_VERTICAL_ALIGN "VerticalAlign" - #define PROPERTY_DEFAULT_DATE "DefaultDate" - #define PROPERTY_DEFAULT_TIME "DefaultTime" - #define PROPERTY_DEFAULT_VALUE "DefaultValue" - #define PROPERTY_DECIMAL_ACCURACY "DecimalAccuracy" - #define PROPERTY_REFVALUE "RefValue" - #define PROPERTY_UNCHECKEDREFVALUE "SecondaryRefValue" - #define PROPERTY_VALUEMIN "ValueMin" - #define PROPERTY_VALUEMAX "ValueMax" - #define PROPERTY_STRICTFORMAT "StrictFormat" - #define PROPERTY_ALLOWADDITIONS "AllowInserts" - #define PROPERTY_ALLOWEDITS "AllowUpdates" - #define PROPERTY_ALLOWDELETIONS "AllowDeletes" - #define PROPERTY_MASTERFIELDS "MasterFields" - #define PROPERTY_LITERALMASK "LiteralMask" - #define PROPERTY_VALUESTEP "ValueStep" - #define PROPERTY_SHOWTHOUSANDSEP "ShowThousandsSeparator" - #define PROPERTY_CURRENCYSYMBOL "CurrencySymbol" - #define PROPERTY_DATEFORMAT "DateFormat" - #define PROPERTY_DATEMIN "DateMin" - #define PROPERTY_DATEMAX "DateMax" - #define PROPERTY_TIMEFORMAT "TimeFormat" - #define PROPERTY_TIMEMIN "TimeMin" - #define PROPERTY_TIMEMAX "TimeMax" - #define PROPERTY_LINECOUNT "LineCount" - #define PROPERTY_BOUNDCOLUMN "BoundColumn" - #define PROPERTY_BACKGROUNDCOLOR "BackgroundColor" - #define PROPERTY_FILLCOLOR "FillColor" - #define PROPERTY_TEXTCOLOR "TextColor" - #define PROPERTY_LINECOLOR "LineColor" - #define PROPERTY_BORDER "Border" - #define PROPERTY_ICONSIZE "IconSize" - #define PROPERTY_DROPDOWN "Dropdown" - #define PROPERTY_HSCROLL "HScroll" - #define PROPERTY_VSCROLL "VScroll" - #define PROPERTY_SHOW_SCROLLBARS "ShowScrollbars" - #define PROPERTY_TABSTOP "Tabstop" - #define PROPERTY_AUTOCOMPLETE "Autocomplete" - #define PROPERTY_PRINTABLE "Printable" - #define PROPERTY_ECHO_CHAR "EchoChar" - #define PROPERTY_ROWHEIGHT "RowHeight" - #define PROPERTY_HELPTEXT "HelpText" - #define PROPERTY_FONT "FontDescriptor" - #define PROPERTY_FONT_NAME "FontName" - #define PROPERTY_FONT_STYLENAME "FontStyleName" - #define PROPERTY_FONT_FAMILY "FontFamily" - #define PROPERTY_FONT_CHARSET "FontCharset" - #define PROPERTY_FONT_HEIGHT "FontHeight" - #define PROPERTY_FONT_WEIGHT "FontWeight" - #define PROPERTY_FONT_SLANT "FontSlant" - #define PROPERTY_FONT_UNDERLINE "FontUnderline" - #define PROPERTY_FONT_STRIKEOUT "FontStrikeout" - #define PROPERTY_FONT_RELIEF "FontRelief" - #define PROPERTY_FONT_EMPHASIS_MARK "FontEmphasisMark" - #define PROPERTY_TEXTLINECOLOR "TextLineColor" - #define PROPERTY_HELPURL "HelpURL" - #define PROPERTY_RECORDMARKER "HasRecordMarker" - #define PROPERTY_EFFECTIVE_DEFAULT "EffectiveDefault" - #define PROPERTY_EFFECTIVE_MIN "EffectiveMin" - #define PROPERTY_EFFECTIVE_MAX "EffectiveMax" - #define PROPERTY_FILTERPROPOSAL "UseFilterValueProposal" - #define PROPERTY_CURRSYM_POSITION "PrependCurrencySymbol" - #define PROPERTY_COMMAND "Command" - #define PROPERTY_COMMANDTYPE "CommandType" - #define PROPERTY_INSERTONLY "IgnoreResult" - #define PROPERTY_ESCAPE_PROCESSING "EscapeProcessing" - #define PROPERTY_TITLE "Title" - #define PROPERTY_SORT "Order" - #define PROPERTY_DATASOURCE "DataSourceName" - #define PROPERTY_DETAILFIELDS "DetailFields" - #define PROPERTY_DEFAULTBUTTON "DefaultButton" - #define PROPERTY_LISTINDEX "ListIndex" - #define PROPERTY_HEIGHT "Height" - #define PROPERTY_HASNAVIGATION "HasNavigationBar" - #define PROPERTY_POSITIONX "PositionX" - #define PROPERTY_POSITIONY "PositionY" - #define PROPERTY_AUTOGROW "AutoGrow" - #define PROPERTY_STEP "Step" - #define PROPERTY_WORDLINEMODE "FontWordLineMode" - #define PROPERTY_PROGRESSVALUE "ProgressValue" - #define PROPERTY_PROGRESSVALUE_MIN "ProgressValueMin" - #define PROPERTY_PROGRESSVALUE_MAX "ProgressValueMax" - #define PROPERTY_SCROLLVALUE "ScrollValue" - #define PROPERTY_DEFAULT_SCROLLVALUE "DefaultScrollValue" - #define PROPERTY_SCROLLVALUE_MIN "ScrollValueMin" - #define PROPERTY_SCROLLVALUE_MAX "ScrollValueMax" - #define PROPERTY_SCROLL_WIDTH "ScrollWidth" - #define PROPERTY_SCROLL_HEIGHT "ScrollHeight" - #define PROPERTY_SCROLL_TOP "ScrollTop" - #define PROPERTY_SCROLL_LEFT "ScrollLeft" - #define PROPERTY_LINEINCREMENT "LineIncrement" - #define PROPERTY_BLOCKINCREMENT "BlockIncrement" - #define PROPERTY_VISIBLESIZE "VisibleSize" - #define PROPERTY_ORIENTATION "Orientation" - #define PROPERTY_IMAGEPOSITION "ImagePosition" - #define PROPERTY_ACTIVE_CONNECTION "ActiveConnection" - #define PROPERTY_ACTIVECOMMAND "ActiveCommand" - #define PROPERTY_DATE "Date" - #define PROPERTY_STATE "State" - #define PROPERTY_TIME "Time" - #define PROPERTY_SCALEIMAGE "ScaleImage" - #define PROPERTY_SCALE_MODE "ScaleMode" - #define PROPERTY_PUSHBUTTONTYPE "PushButtonType" - #define PROPERTY_EFFECTIVE_VALUE "EffectiveValue" - #define PROPERTY_SELECTEDITEMS "SelectedItems" - #define PROPERTY_REPEAT "Repeat" - #define PROPERTY_REPEAT_DELAY "RepeatDelay" - #define PROPERTY_SYMBOLCOLOR "SymbolColor" - #define PROPERTY_SPINVALUE "SpinValue" - #define PROPERTY_SPINVALUE_MIN "SpinValueMin" - #define PROPERTY_SPINVALUE_MAX "SpinValueMax" - #define PROPERTY_DEFAULT_SPINVALUE "DefaultSpinValue" - #define PROPERTY_SPININCREMENT "SpinIncrement" - #define PROPERTY_SHOW_POSITION "ShowPosition" - #define PROPERTY_SHOW_NAVIGATION "ShowNavigation" - #define PROPERTY_SHOW_RECORDACTIONS "ShowRecordActions" - #define PROPERTY_SHOW_FILTERSORT "ShowFilterSort" - #define PROPERTY_LINEEND_FORMAT "LineEndFormat" - #define PROPERTY_DECORATION "Decoration" - #define PROPERTY_NOLABEL "NoLabel" - #define PROPERTY_URL "URL" +inline constexpr OUString PROPERTY_TOGGLE = u"Toggle"_ustr; +inline constexpr OUString PROPERTY_FOCUSONCLICK = u"FocusOnClick"_ustr; +inline constexpr OUString PROPERTY_HIDEINACTIVESELECTION = u"HideInactiveSelection"_ustr; +inline constexpr OUString PROPERTY_VISUALEFFECT = u"VisualEffect"_ustr; +inline constexpr OUString PROPERTY_BORDERCOLOR = u"BorderColor"_ustr; - #define PROPERTY_SELECTION_TYPE "SelectionType" - #define PROPERTY_ROOT_DISPLAYED "RootDisplayed" - #define PROPERTY_SHOWS_HANDLES "ShowsHandles" - #define PROPERTY_SHOWS_ROOT_HANDLES "ShowsRootHandles" - #define PROPERTY_EDITABLE "Editable" - #define PROPERTY_INVOKES_STOP_NOT_EDITING "InvokesStopNodeEditing" +inline constexpr OUString PROPERTY_ADDRESS = u"Address"_ustr; +inline constexpr OUString PROPERTY_REFERENCE_SHEET = u"ReferenceSheet"_ustr; +inline constexpr OUString PROPERTY_UI_REPRESENTATION = u"UserInterfaceRepresentation"_ustr; - #define PROPERTY_HARDLINEBREAKS "HardLineBreaks" +inline constexpr OUString PROPERTY_XML_DATA_MODEL = u"XMLDataModel"_ustr; +inline constexpr OUString PROPERTY_BINDING_NAME = u"BindingName"_ustr; +inline constexpr OUString PROPERTY_BIND_EXPRESSION = u"BindingExpression"_ustr; +inline constexpr OUString PROPERTY_LIST_BINDING = u"ListBinding"_ustr; +inline constexpr OUString PROPERTY_XSD_REQUIRED = u"RequiredExpression"_ustr; +inline constexpr OUString PROPERTY_XSD_RELEVANT = u"RelevantExpression"_ustr; +inline constexpr OUString PROPERTY_XSD_READONLY = u"ReadonlyExpression"_ustr; +inline constexpr OUString PROPERTY_XSD_CONSTRAINT = u"ConstraintExpression"_ustr; +inline constexpr OUString PROPERTY_XSD_CALCULATION = u"CalculateExpression"_ustr; +inline constexpr OUString PROPERTY_XSD_DATA_TYPE = u"Type"_ustr; +inline constexpr OUString PROPERTY_XSD_WHITESPACES = u"WhiteSpace"_ustr; +inline constexpr OUString PROPERTY_XSD_PATTERN = u"Pattern"_ustr; +inline constexpr OUString PROPERTY_XSD_LENGTH = u"Length"_ustr; +inline constexpr OUString PROPERTY_XSD_MIN_LENGTH = u"MinLength"_ustr; +inline constexpr OUString PROPERTY_XSD_MAX_LENGTH = u"MaxLength"_ustr; +inline constexpr OUString PROPERTY_XSD_TOTAL_DIGITS = u"TotalDigits"_ustr; +inline constexpr OUString PROPERTY_XSD_FRACTION_DIGITS = u"FractionDigits"_ustr; +inline constexpr OUString PROPERTY_XSD_MAX_INCLUSIVE_INT = u"MaxInclusiveInt"_ustr; +inline constexpr OUString PROPERTY_XSD_MAX_EXCLUSIVE_INT = u"MaxExclusiveInt"_ustr; +inline constexpr OUString PROPERTY_XSD_MIN_INCLUSIVE_INT = u"MinInclusiveInt"_ustr; +inline constexpr OUString PROPERTY_XSD_MIN_EXCLUSIVE_INT = u"MinExclusiveInt"_ustr; +inline constexpr OUString PROPERTY_XSD_MAX_INCLUSIVE_DOUBLE = u"MaxInclusiveDouble"_ustr; +inline constexpr OUString PROPERTY_XSD_MAX_EXCLUSIVE_DOUBLE = u"MaxExclusiveDouble"_ustr; +inline constexpr OUString PROPERTY_XSD_MIN_INCLUSIVE_DOUBLE = u"MinInclusiveDouble"_ustr; +inline constexpr OUString PROPERTY_XSD_MIN_EXCLUSIVE_DOUBLE = u"MinExclusiveDouble"_ustr; +inline constexpr OUString PROPERTY_XSD_MAX_INCLUSIVE_DATE = u"MaxInclusiveDate"_ustr; +inline constexpr OUString PROPERTY_XSD_MAX_EXCLUSIVE_DATE = u"MaxExclusiveDate"_ustr; +inline constexpr OUString PROPERTY_XSD_MIN_INCLUSIVE_DATE = u"MinInclusiveDate"_ustr; +inline constexpr OUString PROPERTY_XSD_MIN_EXCLUSIVE_DATE = u"MinExclusiveDate"_ustr; +inline constexpr OUString PROPERTY_XSD_MAX_INCLUSIVE_TIME = u"MaxInclusiveTime"_ustr; +inline constexpr OUString PROPERTY_XSD_MAX_EXCLUSIVE_TIME = u"MaxExclusiveTime"_ustr; +inline constexpr OUString PROPERTY_XSD_MIN_INCLUSIVE_TIME = u"MinInclusiveTime"_ustr; +inline constexpr OUString PROPERTY_XSD_MIN_EXCLUSIVE_TIME = u"MinExclusiveTime"_ustr; +inline constexpr OUString PROPERTY_XSD_MAX_INCLUSIVE_DATE_TIME = u"MaxInclusiveDateTime"_ustr; +inline constexpr OUString PROPERTY_XSD_MAX_EXCLUSIVE_DATE_TIME = u"MaxExclusiveDateTime"_ustr; +inline constexpr OUString PROPERTY_XSD_MIN_INCLUSIVE_DATE_TIME = u"MinInclusiveDateTime"_ustr; +inline constexpr OUString PROPERTY_XSD_MIN_EXCLUSIVE_DATE_TIME = u"MinExclusiveDateTime"_ustr; +inline constexpr OUString PROPERTY_SUBMISSION_ID = u"SubmissionID"_ustr; +inline constexpr OUString PROPERTY_BINDING_ID = u"BindingID"_ustr; +inline constexpr OUString PROPERTY_WRITING_MODE = u"WritingMode"_ustr; +inline constexpr OUString PROPERTY_TEXT_ANCHOR_TYPE = u"TextAnchorType"_ustr; +inline constexpr OUString PROPERTY_SHEET_ANCHOR_TYPE = u"SheetAnchorType"_ustr; +inline constexpr OUString PROPERTY_ANCHOR_TYPE = u"AnchorType"_ustr; +inline constexpr OUString PROPERTY_ANCHOR = u"Anchor"_ustr; +inline constexpr OUString PROPERTY_IS_VISIBLE = u"IsVisible"_ustr; - #define PROPERTY_TOGGLE "Toggle" - #define PROPERTY_FOCUSONCLICK "FocusOnClick" - #define PROPERTY_HIDEINACTIVESELECTION "HideInactiveSelection" - #define PROPERTY_VISUALEFFECT "VisualEffect" - #define PROPERTY_BORDERCOLOR "BorderColor" +inline constexpr OUString PROPERTY_MODEL = u"Model"_ustr; - #define PROPERTY_ADDRESS "Address" - #define PROPERTY_REFERENCE_SHEET "ReferenceSheet" - #define PROPERTY_UI_REPRESENTATION "UserInterfaceRepresentation" +inline constexpr OUString PROPERTY_CELL_EXCHANGE_TYPE = u"ExchangeSelectionIndex"_ustr; +inline constexpr OUString PROPERTY_BOUND_CELL = u"BoundCell"_ustr; +inline constexpr OUString PROPERTY_LIST_CELL_RANGE = u"CellRange"_ustr; +inline constexpr OUString PROPERTY_TEXTTYPE = u"TextType"_ustr; +inline constexpr OUString PROPERTY_RICHTEXT = u"RichText"_ustr; +inline constexpr OUString PROPERTY_ROWSET = u"RowSet"_ustr; +inline constexpr OUString PROPERTY_SELECTIONMODEL = u"SelectionModel"_ustr; +inline constexpr OUString PROPERTY_USEGRIDLINE = u"UseGridLines"_ustr; +inline constexpr OUString PROPERTY_GRIDLINECOLOR = u"GridLineColor"_ustr; +inline constexpr OUString PROPERTY_SHOWCOLUMNHEADER = u"ShowColumnHeader"_ustr; +inline constexpr OUString PROPERTY_SHOWROWHEADER = u"ShowRowHeader"_ustr; +inline constexpr OUString PROPERTY_HEADERBACKGROUNDCOLOR = u"HeaderBackgroundColor"_ustr; +inline constexpr OUString PROPERTY_HEADERTEXTCOLOR = u"HeaderTextColor"_ustr; +inline constexpr OUString PROPERTY_ACTIVESELECTIONBACKGROUNDCOLOR = u"ActiveSelectionBackgroundColor"_ustr; +inline constexpr OUString PROPERTY_ACTIVESELECTIONTEXTCOLOR = u"ActiveSelectionTextColor"_ustr; +inline constexpr OUString PROPERTY_INACTIVESELECTIONBACKGROUNDCOLOR = u"InactiveSelectionBackgroundColor"_ustr; +inline constexpr OUString PROPERTY_INACTIVESELECTIONTEXTCOLOR = u"InactiveSelectionTextColor"_ustr; - #define PROPERTY_XML_DATA_MODEL "XMLDataModel" - #define PROPERTY_BINDING_NAME "BindingName" - #define PROPERTY_BIND_EXPRESSION "BindingExpression" - #define PROPERTY_LIST_BINDING "ListBinding" - #define PROPERTY_XSD_REQUIRED "RequiredExpression" - #define PROPERTY_XSD_RELEVANT "RelevantExpression" - #define PROPERTY_XSD_READONLY "ReadonlyExpression" - #define PROPERTY_XSD_CONSTRAINT "ConstraintExpression" - #define PROPERTY_XSD_CALCULATION "CalculateExpression" - #define PROPERTY_XSD_DATA_TYPE "Type" - #define PROPERTY_XSD_WHITESPACES "WhiteSpace" - #define PROPERTY_XSD_PATTERN "Pattern" - #define PROPERTY_XSD_LENGTH "Length" - #define PROPERTY_XSD_MIN_LENGTH "MinLength" - #define PROPERTY_XSD_MAX_LENGTH "MaxLength" - #define PROPERTY_XSD_TOTAL_DIGITS "TotalDigits" - #define PROPERTY_XSD_FRACTION_DIGITS "FractionDigits" - #define PROPERTY_XSD_MAX_INCLUSIVE_INT "MaxInclusiveInt" - #define PROPERTY_XSD_MAX_EXCLUSIVE_INT "MaxExclusiveInt" - #define PROPERTY_XSD_MIN_INCLUSIVE_INT "MinInclusiveInt" - #define PROPERTY_XSD_MIN_EXCLUSIVE_INT "MinExclusiveInt" - #define PROPERTY_XSD_MAX_INCLUSIVE_DOUBLE "MaxInclusiveDouble" - #define PROPERTY_XSD_MAX_EXCLUSIVE_DOUBLE "MaxExclusiveDouble" - #define PROPERTY_XSD_MIN_INCLUSIVE_DOUBLE "MinInclusiveDouble" - #define PROPERTY_XSD_MIN_EXCLUSIVE_DOUBLE "MinExclusiveDouble" - #define PROPERTY_XSD_MAX_INCLUSIVE_DATE "MaxInclusiveDate" - #define PROPERTY_XSD_MAX_EXCLUSIVE_DATE "MaxExclusiveDate" - #define PROPERTY_XSD_MIN_INCLUSIVE_DATE "MinInclusiveDate" - #define PROPERTY_XSD_MIN_EXCLUSIVE_DATE "MinExclusiveDate" - #define PROPERTY_XSD_MAX_INCLUSIVE_TIME "MaxInclusiveTime" - #define PROPERTY_XSD_MAX_EXCLUSIVE_TIME "MaxExclusiveTime" - #define PROPERTY_XSD_MIN_INCLUSIVE_TIME "MinInclusiveTime" - #define PROPERTY_XSD_MIN_EXCLUSIVE_TIME "MinExclusiveTime" - #define PROPERTY_XSD_MAX_INCLUSIVE_DATE_TIME "MaxInclusiveDateTime" - #define PROPERTY_XSD_MAX_EXCLUSIVE_DATE_TIME "MaxExclusiveDateTime" - #define PROPERTY_XSD_MIN_INCLUSIVE_DATE_TIME "MinInclusiveDateTime" - #define PROPERTY_XSD_MIN_EXCLUSIVE_DATE_TIME "MinExclusiveDateTime" - #define PROPERTY_SUBMISSION_ID "SubmissionID" - #define PROPERTY_BINDING_ID "BindingID" - #define PROPERTY_ID "ID" - #define PROPERTY_WRITING_MODE "WritingMode" - #define PROPERTY_TEXT_ANCHOR_TYPE "TextAnchorType" - #define PROPERTY_SHEET_ANCHOR_TYPE "SheetAnchorType" - #define PROPERTY_ANCHOR_TYPE "AnchorType" - #define PROPERTY_ANCHOR "Anchor" - #define PROPERTY_IS_VISIBLE "IsVisible" +// services +inline constexpr OUString SERVICE_COMPONENT_GROUPBOX = u"com.sun.star.form.component.GroupBox"_ustr; +inline constexpr OUString SERVICE_COMPONENT_FIXEDTEXT = u"com.sun.star.form.component.FixedText"_ustr; +inline constexpr OUString SERVICE_COMPONENT_FORMATTEDFIELD = u"com.sun.star.form.component.FormattedField"_ustr; - #define PROPERTY_MODEL "Model" +inline constexpr OUString SERVICE_TEXT_DOCUMENT = u"com.sun.star.text.TextDocument"_ustr; +inline constexpr OUString SERVICE_WEB_DOCUMENT = u"com.sun.star.text.WebDocument"_ustr; +inline constexpr OUString SERVICE_SPREADSHEET_DOCUMENT = u"com.sun.star.sheet.SpreadsheetDocument"_ustr; +inline constexpr OUString SERVICE_DRAWING_DOCUMENT = u"com.sun.star.drawing.DrawingDocument"_ustr; +inline constexpr OUString SERVICE_PRESENTATION_DOCUMENT = u"com.sun.star.presentation.PresentationDocument"_ustr; - #define PROPERTY_CELL_EXCHANGE_TYPE "ExchangeSelectionIndex" - #define PROPERTY_BOUND_CELL "BoundCell" - #define PROPERTY_LIST_CELL_RANGE "CellRange" - #define PROPERTY_AUTOLINEBREAK "AutomaticLineBreak" - #define PROPERTY_TEXTTYPE "TextType" - #define PROPERTY_RICHTEXT "RichText" - #define PROPERTY_ROWSET "RowSet" - #define PROPERTY_SELECTIONMODEL "SelectionModel" - #define PROPERTY_USEGRIDLINE "UseGridLines" - #define PROPERTY_GRIDLINECOLOR "GridLineColor" - #define PROPERTY_SHOWCOLUMNHEADER "ShowColumnHeader" - #define PROPERTY_SHOWROWHEADER "ShowRowHeader" - #define PROPERTY_HEADERBACKGROUNDCOLOR "HeaderBackgroundColor" - #define PROPERTY_HEADERTEXTCOLOR "HeaderTextColor" - #define PROPERTY_ACTIVESELECTIONBACKGROUNDCOLOR "ActiveSelectionBackgroundColor" - #define PROPERTY_ACTIVESELECTIONTEXTCOLOR "ActiveSelectionTextColor" - #define PROPERTY_INACTIVESELECTIONBACKGROUNDCOLOR "InactiveSelectionBackgroundColor" - #define PROPERTY_INACTIVESELECTIONTEXTCOLOR "InactiveSelectionTextColor" +inline constexpr OUString SERVICE_SHEET_CELL_BINDING = u"com.sun.star.table.CellValueBinding"_ustr; +inline constexpr OUString SERVICE_SHEET_CELL_INT_BINDING = u"com.sun.star.table.ListPositionCellBinding"_ustr; +inline constexpr OUString SERVICE_SHEET_CELLRANGE_LISTSOURCE = u"com.sun.star.table.CellRangeListSource"_ustr; +inline constexpr OUString SERVICE_ADDRESS_CONVERSION = u"com.sun.star.table.CellAddressConversion"_ustr; +inline constexpr OUString SERVICE_RANGEADDRESS_CONVERSION = u"com.sun.star.table.CellRangeAddressConversion"_ustr; - // services - #define SERVICE_COMPONENT_GROUPBOX "com.sun.star.form.component.GroupBox" - #define SERVICE_COMPONENT_FIXEDTEXT "com.sun.star.form.component.FixedText" - #define SERVICE_COMPONENT_FORMATTEDFIELD "com.sun.star.form.component.FormattedField" - - #define SERVICE_TEXT_DOCUMENT "com.sun.star.text.TextDocument" - #define SERVICE_WEB_DOCUMENT "com.sun.star.text.WebDocument" - #define SERVICE_SPREADSHEET_DOCUMENT "com.sun.star.sheet.SpreadsheetDocument" - #define SERVICE_DRAWING_DOCUMENT "com.sun.star.drawing.DrawingDocument" - #define SERVICE_PRESENTATION_DOCUMENT "com.sun.star.presentation.PresentationDocument" - - #define SERVICE_SHEET_CELL_BINDING "com.sun.star.table.CellValueBinding" - #define SERVICE_SHEET_CELL_INT_BINDING "com.sun.star.table.ListPositionCellBinding" - #define SERVICE_SHEET_CELLRANGE_LISTSOURCE "com.sun.star.table.CellRangeListSource" - #define SERVICE_ADDRESS_CONVERSION "com.sun.star.table.CellAddressConversion" - #define SERVICE_RANGEADDRESS_CONVERSION "com.sun.star.table.CellRangeAddressConversion" - - -} // namespace pcr /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/extensions/source/propctrlr/genericpropertyhandler.cxx b/extensions/source/propctrlr/genericpropertyhandler.cxx index 485c6937c2f6..322bc3405143 100644 --- a/extensions/source/propctrlr/genericpropertyhandler.cxx +++ b/extensions/source/propctrlr/genericpropertyhandler.cxx @@ -36,10 +36,12 @@ #include <cppuhelper/implbase.hxx> #include <cppuhelper/supportsservice.hxx> #include <comphelper/extract.hxx> +#include <comphelper/propertyvalue.hxx> #include <comphelper/sequence.hxx> #include <comphelper/types.hxx> +#include <o3tl/safeint.hxx> #include <tools/debug.hxx> -#include <tools/diagnose_ex.h> +#include <comphelper/diagnose_ex.hxx> #include <algorithm> @@ -165,7 +167,7 @@ namespace pcr sal_Int32 index = std::find( std::cbegin(aValues), std::cend(aValues), nAsInt ) - std::cbegin(aValues); std::vector< OUString > aDescriptions( getDescriptions() ); - if ( ( index >= 0 ) && ( index < static_cast<sal_Int32>(aDescriptions.size()) ) ) + if ( ( index >= 0 ) && ( o3tl::make_unsigned(index) < aDescriptions.size() ) ) sDescription = aDescriptions[ index ]; else { @@ -248,9 +250,7 @@ namespace pcr Reference< XDesktop2 > xDispProv = Desktop::create( m_xContext ); Reference< XDispatch > xDispatch( xDispProv->queryDispatch( aURL, OUString(), 0 ), UNO_SET_THROW ); - Sequence< PropertyValue > aDispatchArgs(1); - aDispatchArgs[0].Name = "URL"; - aDispatchArgs[0].Value <<= _rURL; + Sequence aDispatchArgs{ comphelper::makePropertyValue("URL", _rURL) }; xDispatch->dispatch( aURL, aDispatchArgs ); } @@ -304,7 +304,7 @@ namespace pcr // create an introspection adapter for the component Reference< XIntrospection > xIntrospection = theIntrospection::get( m_xContext ); - Reference< XIntrospectionAccess > xIntrospectionAccess( xIntrospection->inspect( makeAny( _rxIntrospectee ) ) ); + Reference< XIntrospectionAccess > xIntrospectionAccess( xIntrospection->inspect( Any( _rxIntrospectee ) ) ); if ( !xIntrospectionAccess.is() ) throw RuntimeException("The introspection service could not handle the given component.", *this ); @@ -458,7 +458,7 @@ namespace pcr aProperties = xPSI->getProperties(); DBG_ASSERT( aProperties.hasElements(), "GenericPropertyHandler::getSupportedProperties: no properties!" ); - for ( auto const & property : std::as_const(aProperties) ) + for (auto const& property : aProperties) { switch ( property.Type.getTypeClass() ) { @@ -605,7 +605,22 @@ namespace pcr // at this handler instance } - IMPLEMENT_FORWARD_XCOMPONENT( GenericPropertyHandler, GenericPropertyHandler_Base ); + void SAL_CALL GenericPropertyHandler::dispose( ) + { + GenericPropertyHandler_Base::WeakComponentImplHelperBase::dispose(); + m_xComponentIntrospectionAccess.clear(); + m_xComponent.clear(); + m_xTypeConverter.clear(); + m_xPropertyState.clear(); + } + void SAL_CALL GenericPropertyHandler::addEventListener( const css::uno::Reference< css::lang::XEventListener >& Listener ) + { + GenericPropertyHandler_Base::WeakComponentImplHelperBase::addEventListener( Listener ); + } + void SAL_CALL GenericPropertyHandler::removeEventListener( const css::uno::Reference< css::lang::XEventListener >& Listener ) + { + GenericPropertyHandler_Base::WeakComponentImplHelperBase::removeEventListener( Listener ); + } } // namespace pcr diff --git a/extensions/source/propctrlr/genericpropertyhandler.hxx b/extensions/source/propctrlr/genericpropertyhandler.hxx index 152279347a7a..b2114be3cc5e 100644 --- a/extensions/source/propctrlr/genericpropertyhandler.hxx +++ b/extensions/source/propctrlr/genericpropertyhandler.hxx @@ -29,6 +29,7 @@ #include <com/sun/star/inspection/XPropertyHandler.hpp> #include <com/sun/star/script/XTypeConverter.hpp> #include <com/sun/star/uno/XComponentContext.hpp> +#include <comphelper/interfacecontainer2.hxx> #include <cppuhelper/compbase.hxx> #include <rtl/ref.hxx> diff --git a/extensions/source/propctrlr/handlerhelper.cxx b/extensions/source/propctrlr/handlerhelper.cxx index 1f274def355f..77743c622ad7 100644 --- a/extensions/source/propctrlr/handlerhelper.cxx +++ b/extensions/source/propctrlr/handlerhelper.cxx @@ -29,7 +29,7 @@ #include <com/sun/star/inspection/PropertyControlType.hpp> #include <com/sun/star/inspection/XStringListControl.hpp> #include <com/sun/star/inspection/XNumericControl.hpp> -#include <tools/diagnose_ex.h> +#include <comphelper/diagnose_ex.hxx> #include <vcl/svapp.hxx> #include <vcl/weld.hxx> #include <vcl/weldutils.hxx> @@ -299,7 +299,7 @@ namespace pcr { Reference<css::container::XNameContainer> xName(rContext, UNO_QUERY_THROW); Reference<XWindow> xWindow(new weld::TransportAsXWindow(pParent)); - xName->insertByName("BuilderParent", makeAny(xWindow)); + xName->insertByName("BuilderParent", Any(xWindow)); } void PropertyHandlerHelper::clearBuilderParent(const css::uno::Reference<css::uno::XComponentContext>& rContext) diff --git a/extensions/source/propctrlr/handlerhelper.hxx b/extensions/source/propctrlr/handlerhelper.hxx index 761c1d03d250..555b8ee825e8 100644 --- a/extensions/source/propctrlr/handlerhelper.hxx +++ b/extensions/source/propctrlr/handlerhelper.hxx @@ -27,6 +27,7 @@ #include <com/sun/star/beans/Optional.hpp> #include <unotools/resmgr.hxx> +#include <memory> #include <vector> namespace weld { class Builder; class Widget; class Window; } diff --git a/extensions/source/propctrlr/inspectormodelbase.cxx b/extensions/source/propctrlr/inspectormodelbase.cxx index 1fdc8a0b5dfc..aaa994e94abd 100644 --- a/extensions/source/propctrlr/inspectormodelbase.cxx +++ b/extensions/source/propctrlr/inspectormodelbase.cxx @@ -28,18 +28,20 @@ namespace pcr { - - -#define MODEL_PROPERTY_ID_HAS_HELP_SECTION 2000 -#define MODEL_PROPERTY_ID_MIN_HELP_TEXT_LINES 2001 -#define MODEL_PROPERTY_ID_MAX_HELP_TEXT_LINES 2002 -#define MODEL_PROPERTY_ID_IS_READ_ONLY 2003 - + namespace + { + enum class ModelPropertyId + { + HAS_HELP_SECTION = 2000, + MIN_HELP_TEXT_LINES = 2001, + MAX_HELP_TEXT_LINES = 2002, + IS_READ_ONLY = 2003 + }; + }; using ::com::sun::star::uno::Reference; using ::com::sun::star::beans::XPropertySetInfo; using ::com::sun::star::uno::Any; using ::com::sun::star::uno::Sequence; - using ::com::sun::star::uno::makeAny; using ::com::sun::star::beans::Property; namespace PropertyAttribute = ::com::sun::star::beans::PropertyAttribute; @@ -95,25 +97,25 @@ namespace pcr { registerProperty( "HasHelpSection", - MODEL_PROPERTY_ID_HAS_HELP_SECTION, + static_cast<sal_Int32>(ModelPropertyId::HAS_HELP_SECTION), PropertyAttribute::READONLY, &m_bHasHelpSection, cppu::UnoType<decltype(m_bHasHelpSection)>::get() ); registerProperty( "MinHelpTextLines", - MODEL_PROPERTY_ID_MIN_HELP_TEXT_LINES, + static_cast<sal_Int32>(ModelPropertyId::MIN_HELP_TEXT_LINES), PropertyAttribute::READONLY, &m_nMinHelpTextLines, cppu::UnoType<decltype(m_nMinHelpTextLines)>::get() ); registerProperty( "MaxHelpTextLines", - MODEL_PROPERTY_ID_MAX_HELP_TEXT_LINES, + static_cast<sal_Int32>(ModelPropertyId::MAX_HELP_TEXT_LINES), PropertyAttribute::READONLY, &m_nMaxHelpTextLines, cppu::UnoType<decltype(m_nMaxHelpTextLines)>::get() ); registerProperty( "IsReadOnly", - MODEL_PROPERTY_ID_IS_READ_ONLY, + static_cast<sal_Int32>(ModelPropertyId::IS_READ_ONLY), PropertyAttribute::BOUND, &m_bIsReadOnly, cppu::UnoType<decltype(m_bIsReadOnly)>::get() ); @@ -226,7 +228,7 @@ namespace pcr void SAL_CALL ImplInspectorModel::setIsReadOnly( sal_Bool IsReadOnly ) { - setFastPropertyValue( MODEL_PROPERTY_ID_IS_READ_ONLY, makeAny( IsReadOnly ) ); + setFastPropertyValue( static_cast<sal_Int32>(ModelPropertyId::IS_READ_ONLY), Any( IsReadOnly ) ); } sal_Bool SAL_CALL ImplInspectorModel::supportsService( const OUString& ServiceName ) diff --git a/extensions/source/propctrlr/listselectiondlg.cxx b/extensions/source/propctrlr/listselectiondlg.cxx index 3dec4d7a79d3..521afdf449fa 100644 --- a/extensions/source/propctrlr/listselectiondlg.cxx +++ b/extensions/source/propctrlr/listselectiondlg.cxx @@ -21,7 +21,8 @@ #include "formstrings.hxx" #include <comphelper/sequence.hxx> -#include <tools/diagnose_ex.h> +#include <utility> +#include <comphelper/diagnose_ex.hxx> namespace pcr { @@ -29,10 +30,10 @@ namespace pcr using namespace ::com::sun::star::beans; ListSelectionDialog::ListSelectionDialog(weld::Window* pParent, const Reference< XPropertySet >& _rxListBox, - const OUString& _rPropertyName, const OUString& _rPropertyUIName) + OUString _sPropertyName, const OUString& _rPropertyUIName) : GenericDialogController(pParent, "modules/spropctrlr/ui/listselectdialog.ui", "ListSelectDialog") , m_xListBox ( _rxListBox ) - , m_sPropertyName( _rPropertyName ) + , m_sPropertyName(std::move( _sPropertyName )) , m_xFrame(m_xBuilder->weld_frame("frame")) , m_xEntries(m_xBuilder->weld_tree_view("treeview")) { @@ -99,7 +100,7 @@ namespace pcr try { - m_xListBox->setPropertyValue( m_sPropertyName, makeAny( comphelper::containerToSequence(aSelection) ) ); + m_xListBox->setPropertyValue( m_sPropertyName, Any( comphelper::containerToSequence(aSelection) ) ); } catch( const Exception& ) { diff --git a/extensions/source/propctrlr/listselectiondlg.hxx b/extensions/source/propctrlr/listselectiondlg.hxx index 51469c091856..368e9e9aac94 100644 --- a/extensions/source/propctrlr/listselectiondlg.hxx +++ b/extensions/source/propctrlr/listselectiondlg.hxx @@ -37,7 +37,7 @@ namespace pcr ListSelectionDialog( weld::Window* _pParent, const css::uno::Reference< css::beans::XPropertySet >& _rxListBox, - const OUString& _rPropertyName, + OUString _sPropertyName, const OUString& _rPropertyUIName ); virtual ~ListSelectionDialog() override; diff --git a/extensions/source/propctrlr/newdatatype.cxx b/extensions/source/propctrlr/newdatatype.cxx index 09c774d3aa42..b2399d680668 100644 --- a/extensions/source/propctrlr/newdatatype.cxx +++ b/extensions/source/propctrlr/newdatatype.cxx @@ -26,7 +26,7 @@ namespace pcr //= NewDataTypeDialog - NewDataTypeDialog::NewDataTypeDialog(weld::Window* pParent, const OUString& _rNameBase, const std::vector< OUString >& _rProhibitedNames) + NewDataTypeDialog::NewDataTypeDialog(weld::Window* pParent, std::u16string_view _rNameBase, const std::vector< OUString >& _rProhibitedNames) : GenericDialogController(pParent, "modules/spropctrlr/ui/datatypedialog.ui", "DataTypeDialog") , m_aProhibitedNames( _rProhibitedNames.begin(), _rProhibitedNames.end() ) , m_xName(m_xBuilder->weld_entry("entry")) @@ -36,7 +36,7 @@ namespace pcr // find an initial name // for this, first remove trailing digits - sal_Int32 nStripUntil = _rNameBase.getLength(); + sal_Int32 nStripUntil = _rNameBase.size(); while ( nStripUntil > 0 ) { sal_Unicode nChar = _rNameBase[ --nStripUntil ]; @@ -48,7 +48,7 @@ namespace pcr } } - OUString sNameBase = OUString::Concat(_rNameBase.subView( 0, nStripUntil ? nStripUntil + 1 : 0 )) + " "; + OUString sNameBase = OUString::Concat(_rNameBase.substr( 0, nStripUntil ? nStripUntil + 1 : 0 )) + " "; OUString sInitialName; sal_Int32 nPostfixNumber = 1; do diff --git a/extensions/source/propctrlr/newdatatype.hxx b/extensions/source/propctrlr/newdatatype.hxx index e6d46f1af329..ba4b6fa38269 100644 --- a/extensions/source/propctrlr/newdatatype.hxx +++ b/extensions/source/propctrlr/newdatatype.hxx @@ -36,7 +36,7 @@ namespace pcr std::unique_ptr<weld::Entry> m_xName; std::unique_ptr<weld::Button> m_xOK; public: - NewDataTypeDialog(weld::Window* _pParent, const OUString& _rNameBase, + NewDataTypeDialog(weld::Window* _pParent, std::u16string_view _rNameBase, const std::vector< OUString >& _rProhibitedNames ); virtual ~NewDataTypeDialog() override; diff --git a/extensions/source/propctrlr/objectinspectormodel.cxx b/extensions/source/propctrlr/objectinspectormodel.cxx index c0f6bf6b703e..a05d9347f979 100644 --- a/extensions/source/propctrlr/objectinspectormodel.cxx +++ b/extensions/source/propctrlr/objectinspectormodel.cxx @@ -29,7 +29,6 @@ namespace pcr { - using ::com::sun::star::uno::Reference; using ::com::sun::star::uno::XComponentContext; using ::com::sun::star::uno::Sequence; using ::com::sun::star::uno::Any; @@ -152,8 +151,7 @@ namespace pcr void ObjectInspectorModel::createDefault() { - m_aFactories.realloc( 1 ); - m_aFactories[0] <<= OUString( "com.sun.star.inspection.GenericPropertyHandler" ); + m_aFactories = { Any(OUString( "com.sun.star.inspection.GenericPropertyHandler" )) }; } diff --git a/extensions/source/propctrlr/pcrcommon.cxx b/extensions/source/propctrlr/pcrcommon.cxx index b6c826b61a5e..6b0cee5c7ca8 100644 --- a/extensions/source/propctrlr/pcrcommon.cxx +++ b/extensions/source/propctrlr/pcrcommon.cxx @@ -28,30 +28,26 @@ namespace pcr { - using namespace ::com::sun::star::util; - - //= HelpIdUrl - OString HelpIdUrl::getHelpId( const OUString& _rHelpURL ) + OUString HelpIdUrl::getHelpId( std::u16string_view _rHelpURL ) { INetURLObject aHID( _rHelpURL ); if ( aHID.GetProtocol() == INetProtocol::Hid ) - return OUStringToOString( aHID.GetURLPath(), RTL_TEXTENCODING_UTF8 ); + return aHID.GetURLPath(); else - return OUStringToOString( _rHelpURL, RTL_TEXTENCODING_UTF8 ); + return OUString(_rHelpURL); } - OUString HelpIdUrl::getHelpURL( std::string_view sHelpId ) + OUString HelpIdUrl::getHelpURL( std::u16string_view sHelpId ) { OUStringBuffer aBuffer; - OUString aTmp( OStringToOUString(sHelpId, RTL_TEXTENCODING_UTF8) ); - INetURLObject aHID( aTmp ); + INetURLObject aHID( sHelpId ); if ( aHID.GetProtocol() == INetProtocol::NotValid ) aBuffer.append( INET_HID_SCHEME ); - aBuffer.append( aTmp ); + aBuffer.append( sHelpId ); return aBuffer.makeStringAndClear(); } diff --git a/extensions/source/propctrlr/pcrcommon.hxx b/extensions/source/propctrlr/pcrcommon.hxx index 9d164c341b56..f2a8b847c000 100644 --- a/extensions/source/propctrlr/pcrcommon.hxx +++ b/extensions/source/propctrlr/pcrcommon.hxx @@ -24,29 +24,25 @@ #include <sal/config.h> -#include <string_view> - #include <com/sun/star/uno/Sequence.hxx> #include <com/sun/star/beans/XPropertyChangeListener.hpp> -#include <com/sun/star/beans/PropertyChangeEvent.hpp> - -#include <comphelper/listenernotification.hxx> - +#include <comphelper/interfacecontainer3.hxx> namespace pcr { - - #define OWN_PROPERTY_ID_INTROSPECTEDOBJECT 0x0010 - #define OWN_PROPERTY_ID_CURRENTPAGE 0x0011 - #define OWN_PROPERTY_ID_CONTROLCONTEXT 0x0012 - #define OWN_PROPERTY_ID_TABBINGMODEL 0x0013 + enum class OwnPropertyId + { + INTROSPECTEDOBJECT = 0x0010, + CURRENTPAGE = 0x0011, + CONTROLCONTEXT = 0x0012, + TABBINGMODEL = 0x0013 + }; //= types - typedef ::comphelper::OSimpleListenerContainer < css::beans::XPropertyChangeListener - , css::beans::PropertyChangeEvent + typedef ::comphelper::OInterfaceContainerHelper3 < css::beans::XPropertyChangeListener > PropertyChangeListeners; @@ -67,8 +63,8 @@ namespace pcr class HelpIdUrl { public: - static OString getHelpId( const OUString& _rHelpURL ); - static OUString getHelpURL( std::string_view ); + static OUString getHelpId( std::u16string_view _rHelpURL ); + static OUString getHelpURL( std::u16string_view ); }; diff --git a/extensions/source/propctrlr/pcrstrings.hxx b/extensions/source/propctrlr/pcrstrings.hxx index 759c4a0742cd..3e9ac3ea55e6 100644 --- a/extensions/source/propctrlr/pcrstrings.hxx +++ b/extensions/source/propctrlr/pcrstrings.hxx @@ -19,13 +19,14 @@ #pragma once +#include <rtl/ustring.hxx> namespace pcr { // properties - #define PROPERTY_TABBINGMODEL "TabbingModel" + constexpr OUString PROPERTY_TABBINGMODEL = u"TabbingModel"_ustr; } // namespace pcr diff --git a/extensions/source/propctrlr/pcrunodialogs.cxx b/extensions/source/propctrlr/pcrunodialogs.cxx index 2c6113647855..f36aedf39d76 100644 --- a/extensions/source/propctrlr/pcrunodialogs.cxx +++ b/extensions/source/propctrlr/pcrunodialogs.cxx @@ -35,7 +35,6 @@ namespace pcr using namespace ::com::sun::star::uno; - using namespace ::com::sun::star::lang; using namespace ::com::sun::star::beans; @@ -45,11 +44,11 @@ namespace pcr OTabOrderDialog::OTabOrderDialog( const Reference< XComponentContext >& _rxContext ) :OGenericUnoDialog( _rxContext ) { - registerProperty( PROPERTY_CONTROLCONTEXT, OWN_PROPERTY_ID_CONTROLCONTEXT, + registerProperty( PROPERTY_CONTROLCONTEXT, static_cast<sal_Int32>(OwnPropertyId::CONTROLCONTEXT), PropertyAttribute::BOUND | PropertyAttribute::TRANSIENT, &m_xControlContext, cppu::UnoType<decltype(m_xControlContext)>::get() ); - registerProperty( PROPERTY_TABBINGMODEL, OWN_PROPERTY_ID_TABBINGMODEL, + registerProperty( PROPERTY_TABBINGMODEL, static_cast<sal_Int32>(OwnPropertyId::TABBINGMODEL), PropertyAttribute::BOUND | PropertyAttribute::TRANSIENT, &m_xTabbingModel, cppu::UnoType<decltype(m_xTabbingModel)>::get() ); } @@ -111,19 +110,20 @@ namespace pcr Reference<css::awt::XWindow> xParentWindow; if (aArguments.getLength() == 3 && (aArguments[0] >>= xTabbingModel) && (aArguments[1] >>= xControlContext) && (aArguments[2] >>= xParentWindow)) { - Sequence< Any > aNewArguments( 3 ); - aNewArguments[0] <<= NamedValue( - "TabbingModel", - makeAny( xTabbingModel ) - ); - aNewArguments[1] <<= NamedValue( - "ControlContext", - makeAny( xControlContext ) - ); - aNewArguments[2] <<= NamedValue( - "ParentWindow", - makeAny( xParentWindow ) - ); + Sequence< Any > aNewArguments{ + Any(NamedValue( + "TabbingModel", + Any( xTabbingModel ) + )), + Any(NamedValue( + "ControlContext", + Any( xControlContext ) + )), + Any(NamedValue( + "ParentWindow", + Any( xParentWindow ) + )) + }; OTabOrderDialog_DBase::initialize(aNewArguments); } else diff --git a/extensions/source/propctrlr/propcontroller.cxx b/extensions/source/propctrlr/propcontroller.cxx index 4fd878441f90..f6a37893a11b 100644 --- a/extensions/source/propctrlr/propcontroller.cxx +++ b/extensions/source/propctrlr/propcontroller.cxx @@ -37,7 +37,7 @@ #include <com/sun/star/lang/XSingleServiceFactory.hpp> #include <com/sun/star/util/VetoException.hpp> #include <tools/debug.hxx> -#include <tools/diagnose_ex.h> +#include <comphelper/diagnose_ex.hxx> #include <toolkit/helper/vclunohelper.hxx> #include <vcl/svapp.hxx> #include <vcl/weld.hxx> @@ -55,9 +55,7 @@ namespace pcr using namespace ::com::sun::star::uno; using namespace ::com::sun::star::awt; using namespace ::com::sun::star::beans; - using namespace ::com::sun::star::script; using namespace ::com::sun::star::lang; - using namespace ::com::sun::star::container; using namespace ::com::sun::star::frame; using namespace ::com::sun::star::util; using namespace ::com::sun::star::inspection; @@ -443,7 +441,7 @@ namespace pcr Any SAL_CALL OPropertyBrowserController::getViewData( ) { - return makeAny( m_sPageSelection ); + return Any( m_sPageSelection ); } @@ -490,6 +488,9 @@ namespace pcr m_aInspectedObjects.clear(); impl_bindToNewModel_nothrow( nullptr ); + m_xModel.clear(); + m_xInteractiveHandler.clear(); + m_xFrame.clear(); } void SAL_CALL OPropertyBrowserController::addEventListener( const Reference< XEventListener >& _rxListener ) @@ -956,7 +957,7 @@ namespace pcr } // append these properties to our "all properties" array - aProperties.reserve( aProperties.size() + aThisHandlersProperties.size() ); + aProperties.reserve( std::max<size_t>(aProperties.size() + aThisHandlersProperties.size(), aProperties.size() * 2) ); for (const auto & aThisHandlersProperty : aThisHandlersProperties) { auto noPrevious = std::none_of( @@ -1111,7 +1112,7 @@ namespace pcr { weld::Widget* m_pControlWindow = pTunnel->getWidget(); if (m_pControlWindow) - m_pControlWindow->set_buildable_name(m_pControlWindow->get_buildable_name() + "-" + _rDescriptor.DisplayName.toUtf8()); + m_pControlWindow->set_buildable_name(m_pControlWindow->get_buildable_name() + "-" + _rDescriptor.DisplayName); } } @@ -1178,7 +1179,7 @@ namespace pcr // this category does not yet exist. This is allowed, as an inspector model might be lazy, and not provide // any category information of its own. In this case, we have a fallback ... m_aPageIds[ aDescriptor.Category ] = - getPropertyBox().AppendPage( aDescriptor.Category, OString() ); + getPropertyBox().AppendPage(aDescriptor.Category, {}); nTargetPageId = impl_getPageIdForCategory_nothrow( aDescriptor.Category ); } @@ -1398,7 +1399,7 @@ namespace pcr if ( m_xModel.is() ) aHandlerFactories = m_xModel->getHandlerFactories(); - for ( auto const & handlerFactory : std::as_const(aHandlerFactories) ) + for (auto const& handlerFactory : aHandlerFactories) { if ( _rObjects.size() == 1 ) { // we're inspecting only one object -> one handler diff --git a/extensions/source/propctrlr/propcontroller.hxx b/extensions/source/propctrlr/propcontroller.hxx index a56a839796f4..a149d7ff2338 100644 --- a/extensions/source/propctrlr/propcontroller.hxx +++ b/extensions/source/propctrlr/propcontroller.hxx @@ -76,10 +76,7 @@ namespace pcr typedef std::vector< css::uno::Reference< css::uno::XInterface > > InterfaceArray; - protected: css::uno::Reference< css::uno::XComponentContext > m_xContext; - - private: css::uno::Reference< css::frame::XFrame > m_xFrame; css::uno::Reference< css::awt::XWindow > m_xView; diff --git a/extensions/source/propctrlr/propertycomposer.cxx b/extensions/source/propctrlr/propertycomposer.cxx index b19e32fd9ff1..869cba77c7fe 100644 --- a/extensions/source/propctrlr/propertycomposer.cxx +++ b/extensions/source/propctrlr/propertycomposer.cxx @@ -23,10 +23,11 @@ #include <com/sun/star/lang/IllegalArgumentException.hpp> #include <comphelper/sequence.hxx> #include <osl/diagnose.h> -#include <tools/diagnose_ex.h> +#include <comphelper/diagnose_ex.hxx> #include <algorithm> #include <iterator> +#include <utility> namespace pcr @@ -48,7 +49,7 @@ namespace pcr { OUString sPropertyName; const Any& rValue; - SetPropertyValue( const OUString& _rPropertyName, const Any& _rValue ) : sPropertyName( _rPropertyName ), rValue( _rValue ) { } + SetPropertyValue( OUString _aPropertyName, const Any& _rValue ) : sPropertyName(std::move( _aPropertyName )), rValue( _rValue ) { } void operator()( const Reference< XPropertyHandler >& _rHandler ) { _rHandler->setPropertyValue( sPropertyName, rValue ); @@ -186,14 +187,14 @@ namespace pcr void SAL_CALL PropertyComposer::addPropertyChangeListener( const Reference< XPropertyChangeListener >& _rxListener ) { MethodGuard aGuard( *this ); - m_aPropertyListeners.addListener( _rxListener ); + m_aPropertyListeners.addInterface( _rxListener ); } void SAL_CALL PropertyComposer::removePropertyChangeListener( const Reference< XPropertyChangeListener >& _rxListener ) { MethodGuard aGuard( *this ); - m_aPropertyListeners.removeListener( _rxListener ); + m_aPropertyListeners.removeInterface( _rxListener ); } @@ -432,14 +433,14 @@ namespace pcr { DBG_UNHANDLED_EXCEPTION("extensions.propctrlr"); } - m_aPropertyListeners.notify( aTranslatedEvent, &XPropertyChangeListener::propertyChange ); + m_aPropertyListeners.notifyEach( &XPropertyChangeListener::propertyChange, aTranslatedEvent ); } void SAL_CALL PropertyComposer::disposing( const EventObject& Source ) { MethodGuard aGuard( *this ); - m_aPropertyListeners.disposing( Source ); + m_aPropertyListeners.disposeAndClear( Source ); } diff --git a/extensions/source/propctrlr/propertycontrolextender.cxx b/extensions/source/propctrlr/propertycontrolextender.cxx index 142e288ddeb9..f2854f447a17 100644 --- a/extensions/source/propctrlr/propertycontrolextender.cxx +++ b/extensions/source/propctrlr/propertycontrolextender.cxx @@ -22,7 +22,7 @@ #include <com/sun/star/awt/KeyFunction.hpp> -#include <tools/diagnose_ex.h> +#include <comphelper/diagnose_ex.hxx> namespace pcr @@ -33,7 +33,6 @@ namespace pcr using ::com::sun::star::uno::UNO_SET_THROW; using ::com::sun::star::uno::Exception; using ::com::sun::star::uno::Any; - using ::com::sun::star::awt::XWindow; using ::com::sun::star::awt::KeyEvent; using ::com::sun::star::inspection::XPropertyControl; using ::com::sun::star::lang::EventObject; @@ -42,26 +41,16 @@ namespace pcr namespace KeyFunction = ::com::sun::star::awt::KeyFunction; - //= PropertyControlExtender_Data - - struct PropertyControlExtender_Data - { - Reference< XPropertyControl > xControl; - Reference< XWindow > xControlWindow; - }; - - //= PropertyControlExtender PropertyControlExtender::PropertyControlExtender( const Reference< XPropertyControl >& _rxObservedControl ) - :m_pData( new PropertyControlExtender_Data ) { try { - m_pData->xControl.set( _rxObservedControl, UNO_SET_THROW ); - m_pData->xControlWindow.set( m_pData->xControl->getControlWindow(), UNO_SET_THROW ); - m_pData->xControlWindow->addKeyListener( this ); + mxControl.set( _rxObservedControl, UNO_SET_THROW ); + mxControlWindow.set( mxControl->getControlWindow(), UNO_SET_THROW ); + mxControlWindow->addKeyListener( this ); } catch( const Exception& ) { @@ -77,7 +66,7 @@ namespace pcr void SAL_CALL PropertyControlExtender::keyPressed( const KeyEvent& _event ) { - OSL_ENSURE( _event.Source == m_pData->xControlWindow, "PropertyControlExtender::keyPressed: where does this come from?" ); + OSL_ENSURE( _event.Source == mxControlWindow, "PropertyControlExtender::keyPressed: where does this come from?" ); if ( ( _event.KeyFunc != KeyFunction::DELETE ) || ( _event.Modifiers != 0 ) ) @@ -85,7 +74,7 @@ namespace pcr try { - Reference< XPropertyControl > xControl( m_pData->xControl, UNO_SET_THROW ); + Reference< XPropertyControl > xControl( mxControl, UNO_SET_THROW ); // reset the value xControl->setValue( Any() ); @@ -112,10 +101,10 @@ namespace pcr void SAL_CALL PropertyControlExtender::disposing( const EventObject& Source ) { - OSL_ENSURE( Source.Source == m_pData->xControlWindow, "PropertyControlExtender::disposing: where does this come from?" ); + OSL_ENSURE( Source.Source == mxControlWindow, "PropertyControlExtender::disposing: where does this come from?" ); (void)Source.Source; - m_pData->xControlWindow.clear(); - m_pData->xControl.clear(); + mxControlWindow.clear(); + mxControl.clear(); } diff --git a/extensions/source/propctrlr/propertycontrolextender.hxx b/extensions/source/propctrlr/propertycontrolextender.hxx index ed7c4a06c448..e376223ebf35 100644 --- a/extensions/source/propctrlr/propertycontrolextender.hxx +++ b/extensions/source/propctrlr/propertycontrolextender.hxx @@ -53,7 +53,8 @@ namespace pcr virtual ~PropertyControlExtender() override; private: - std::unique_ptr< PropertyControlExtender_Data > m_pData; + css::uno::Reference< css::inspection::XPropertyControl > mxControl; + css::uno::Reference< css::awt::XWindow > mxControlWindow; }; diff --git a/extensions/source/propctrlr/propertyeditor.cxx b/extensions/source/propctrlr/propertyeditor.cxx index 3c94a3a24bf3..1e026c5b5bb4 100644 --- a/extensions/source/propctrlr/propertyeditor.cxx +++ b/extensions/source/propctrlr/propertyeditor.cxx @@ -23,6 +23,7 @@ #include "linedescriptor.hxx" #include <tools/debug.hxx> +#include <utility> #include <osl/diagnose.h> namespace pcr @@ -64,7 +65,7 @@ namespace pcr int nCount = m_xTabControl->get_n_pages(); for (int i = nCount - 1; i >= 0; --i) { - OString sID = m_xTabControl->get_page_ident(i); + OUString sID = m_xTabControl->get_page_ident(i); m_xTabControl->remove_page(sID); } @@ -115,12 +116,12 @@ namespace pcr return const_cast<OPropertyEditor*>(this)->getPage(rPageId); } - sal_uInt16 OPropertyEditor::AppendPage(const OUString& rText, const OString& rHelpId) + sal_uInt16 OPropertyEditor::AppendPage(const OUString& rText, const OUString& rHelpId) { // obtain a new id sal_uInt16 nId = m_nNextId++; // insert the id - OString sIdent = OString::number(nId); + OUString sIdent = OUString::number(nId); m_xTabControl->append_page(sIdent, rText); // create a new page @@ -139,7 +140,7 @@ namespace pcr return nId; } - void OPropertyEditor::SetHelpId( const OString& rHelpId ) + void OPropertyEditor::SetHelpId( const OUString& rHelpId ) { m_xTabControl->set_help_id(rHelpId); } @@ -151,13 +152,13 @@ namespace pcr return; m_aShownPages.erase(aPagePos); - OString sIdent(OString::number(nID)); + OUString sIdent(OUString::number(nID)); m_xTabControl->remove_page(sIdent); } void OPropertyEditor::SetPage(sal_uInt16 nId) { - m_xTabControl->set_current_page(OString::number(nId)); + m_xTabControl->set_current_page(OUString::number(nId)); } sal_uInt16 OPropertyEditor::GetCurPage() const @@ -289,7 +290,7 @@ namespace pcr { assert((m_aHiddenPages.find(nPageId) != m_aHiddenPages.end() || m_aShownPages.find(nPageId) != m_aShownPages.end()) && "page doesn't exist"); - OString sIdent(OString::number(nPageId)); + OUString sIdent(OUString::number(nPageId)); if (!bShow) { auto aPagePos = m_aShownPages.find(nPageId); @@ -346,12 +347,12 @@ namespace pcr return xControl; } - IMPL_LINK_NOARG(OPropertyEditor, OnPageActivate, const OString&, void) + IMPL_LINK(OPropertyEditor, OnPageActivate, const OUString&, rNewPage, void) { - m_aPageActivationHandler.Call(nullptr); + m_aPageActivationHandler.Call(rNewPage); } - IMPL_LINK(OPropertyEditor, OnPageDeactivate, const OString&, rIdent, bool) + IMPL_LINK(OPropertyEditor, OnPageDeactivate, const OUString&, rIdent, bool) { // commit the data on the current (to-be-deactivated) tab page // (79404) @@ -370,8 +371,8 @@ namespace pcr { } - OPropertyEditor::PropertyPage::PropertyPage(sal_uInt16 nPagePos, const OUString& rLabel, std::unique_ptr<OBrowserPage> pPage) - : nPos(nPagePos), sLabel(rLabel), xPage(std::move(pPage)) + OPropertyEditor::PropertyPage::PropertyPage(sal_uInt16 nPagePos, OUString aLabel, std::unique_ptr<OBrowserPage> pPage) + : nPos(nPagePos), sLabel(std::move(aLabel)), xPage(std::move(pPage)) { } diff --git a/extensions/source/propctrlr/propertyeditor.hxx b/extensions/source/propctrlr/propertyeditor.hxx index 5ca271d0d14a..96199b31af4c 100644 --- a/extensions/source/propctrlr/propertyeditor.hxx +++ b/extensions/source/propctrlr/propertyeditor.hxx @@ -46,7 +46,7 @@ namespace pcr OUString sLabel; std::unique_ptr<OBrowserPage> xPage; PropertyPage(); - PropertyPage(sal_uInt16 nPagePos, const OUString& rLabel, std::unique_ptr<OBrowserPage> pPage); + PropertyPage(sal_uInt16 nPagePos, OUString aLabel, std::unique_ptr<OBrowserPage> pPage); }; std::unique_ptr<weld::Container> m_xContainer; @@ -57,7 +57,7 @@ namespace pcr IPropertyLineListener* m_pListener; IPropertyControlObserver* m_pObserver; sal_uInt16 m_nNextId; - Link<LinkParamNone*,void> m_aPageActivationHandler; + Link<const OUString&,void> m_aPageActivationHandler; bool m_bHasHelpSection; MapStringToPageId m_aPropertyPageIds; @@ -75,8 +75,8 @@ namespace pcr bool HasHelpSection() const { return m_bHasHelpSection; } void SetHelpText( const OUString& _rHelpText ); - void SetHelpId( const OString& sHelpId ); - sal_uInt16 AppendPage( const OUString& r, const OString& _rHelpId ); + void SetHelpId( const OUString& sHelpId ); + sal_uInt16 AppendPage( const OUString& r, const OUString& _rHelpId ); void SetPage( sal_uInt16 ); void RemovePage(sal_uInt16 nID); sal_uInt16 GetCurPage() const; @@ -95,7 +95,7 @@ namespace pcr void RemoveEntry( const OUString& _rName ); void ChangeEntry( const OLineDescriptor& ); - void setPageActivationHandler(const Link<LinkParamNone*,void>& _rHdl) { m_aPageActivationHandler = _rHdl; } + void setPageActivationHandler(const Link<const OUString&,void>& _rHdl) { m_aPageActivationHandler = _rHdl; } Size get_preferred_size() const; @@ -122,8 +122,8 @@ namespace pcr void enableHelpSection( OBrowserPage& _rPage, const void* ); static void setHelpSectionText( OBrowserPage& _rPage, const void* _pPointerToOUString ); - DECL_LINK(OnPageDeactivate, const OString&, bool); - DECL_LINK(OnPageActivate, const OString&, void); + DECL_LINK(OnPageDeactivate, const OUString&, bool); + DECL_LINK(OnPageActivate, const OUString&, void); }; diff --git a/extensions/source/propctrlr/propertyhandler.cxx b/extensions/source/propctrlr/propertyhandler.cxx index a1817393324f..bd6ba2af7407 100644 --- a/extensions/source/propctrlr/propertyhandler.cxx +++ b/extensions/source/propctrlr/propertyhandler.cxx @@ -42,7 +42,6 @@ namespace pcr { using namespace ::com::sun::star::uno; - using namespace ::com::sun::star::awt; using namespace ::com::sun::star::beans; using namespace ::com::sun::star::script; using namespace ::com::sun::star::lang; @@ -79,11 +78,11 @@ namespace pcr return; // remove all old property change listeners - ::comphelper::OInterfaceIteratorHelper2 removeListener = m_aPropertyListeners.createIterator(); - ::comphelper::OInterfaceIteratorHelper2 readdListener = m_aPropertyListeners.createIterator(); // will copy the container as needed + ::comphelper::OInterfaceIteratorHelper3 removeListener(m_aPropertyListeners); + ::comphelper::OInterfaceIteratorHelper3 readdListener(m_aPropertyListeners); // will copy the container as needed while ( removeListener.hasMoreElements() ) - removePropertyChangeListener( static_cast< XPropertyChangeListener* >( removeListener.next() ) ); - OSL_ENSURE( m_aPropertyListeners.empty(), "PropertyHandler::inspect: derived classes are expected to forward the removePropertyChangeListener call to their base class (me)!" ); + removePropertyChangeListener( removeListener.next() ); + OSL_ENSURE( m_aPropertyListeners.getLength() == 0, "PropertyHandler::inspect: derived classes are expected to forward the removePropertyChangeListener call to their base class (me)!" ); // remember the new component, and give derived classes the chance to react on it m_xComponent = xNewComponent; @@ -91,7 +90,7 @@ namespace pcr // add the listeners, again while ( readdListener.hasMoreElements() ) - addPropertyChangeListener( static_cast< XPropertyChangeListener* >( readdListener.next() ) ); + addPropertyChangeListener( readdListener.next() ); } void PropertyHandler::onNewComponent() @@ -164,7 +163,7 @@ namespace pcr ::rtl::Reference< IPropertyEnumRepresentation > aEnumConversion( new DefaultEnumRepresentation( *m_pInfoService, _rPropertyValue.getValueType(), nPropId ) ); // TODO/UNOize: cache those converters? - return makeAny( aEnumConversion->getDescriptionForValue( _rPropertyValue ) ); + return Any( aEnumConversion->getDescriptionForValue( _rPropertyValue ) ); } return PropertyHandlerHelper::convertToControlValue( @@ -228,13 +227,13 @@ namespace pcr ::osl::MutexGuard aGuard( m_aMutex ); if ( !_rxListener.is() ) throw NullPointerException(); - m_aPropertyListeners.addListener( _rxListener ); + m_aPropertyListeners.addInterface( _rxListener ); } void SAL_CALL PropertyHandler::removePropertyChangeListener( const Reference< XPropertyChangeListener >& _rxListener ) { ::osl::MutexGuard aGuard( m_aMutex ); - m_aPropertyListeners.removeListener( _rxListener ); + m_aPropertyListeners.removeInterface( _rxListener ); } sal_Bool SAL_CALL PropertyHandler::suspend( sal_Bool /*_bSuspend*/ ) @@ -242,7 +241,22 @@ namespace pcr return true; } - IMPLEMENT_FORWARD_XCOMPONENT( PropertyHandler, PropertyHandler_Base ) + void SAL_CALL PropertyHandler::dispose( ) + { + PropertyHandler_Base::WeakComponentImplHelperBase::dispose(); + m_xComponent.clear(); + m_xComponentPropertyInfo.clear(); + m_xTypeConverter.clear(); + } + void SAL_CALL PropertyHandler::addEventListener( const css::uno::Reference< css::lang::XEventListener >& Listener ) + { + PropertyHandler_Base::WeakComponentImplHelperBase::addEventListener( Listener ); + } + void SAL_CALL PropertyHandler::removeEventListener( const css::uno::Reference< css::lang::XEventListener >& Listener ) + { + PropertyHandler_Base::WeakComponentImplHelperBase::removeEventListener( Listener ); + } + void SAL_CALL PropertyHandler::disposing() { @@ -260,7 +274,7 @@ namespace pcr aEvent.PropertyName = _rPropName; aEvent.OldValue = _rOldValue; aEvent.NewValue = _rNewValue; - m_aPropertyListeners.notify( aEvent, &XPropertyChangeListener::propertyChange ); + m_aPropertyListeners.notifyEach( &XPropertyChangeListener::propertyChange, aEvent ); } const Property* PropertyHandler::impl_getPropertyFromId_nothrow( PropertyId _nPropId ) const diff --git a/extensions/source/propctrlr/propertyinfo.hxx b/extensions/source/propctrlr/propertyinfo.hxx index 92e731b07683..592557c2a315 100644 --- a/extensions/source/propctrlr/propertyinfo.hxx +++ b/extensions/source/propctrlr/propertyinfo.hxx @@ -21,7 +21,6 @@ #include <sal/types.h> #include <rtl/ustring.hxx> -#include <rtl/string.hxx> #include <vector> @@ -36,7 +35,7 @@ namespace pcr public: virtual sal_Int32 getPropertyId(const OUString& _rName) const = 0; virtual OUString getPropertyTranslation(sal_Int32 _nId) const = 0; - virtual OString getPropertyHelpId(sal_Int32 _nId) const = 0; + virtual OUString getPropertyHelpId(sal_Int32 _nId) const = 0; virtual sal_Int16 getPropertyPos(sal_Int32 _nId) const = 0; virtual sal_uInt32 getPropertyUIFlags(sal_Int32 _nId) const = 0; virtual std::vector< OUString > getPropertyEnumRepresentations(sal_Int32 _nId) const = 0; diff --git a/extensions/source/propctrlr/pushbuttonnavigation.cxx b/extensions/source/propctrlr/pushbuttonnavigation.cxx index 3d1bf748c712..130cf322d15d 100644 --- a/extensions/source/propctrlr/pushbuttonnavigation.cxx +++ b/extensions/source/propctrlr/pushbuttonnavigation.cxx @@ -22,8 +22,9 @@ #include "formstrings.hxx" #include <comphelper/extract.hxx> #include <comphelper/property.hxx> +#include <o3tl/string_view.hxx> #include <osl/diagnose.h> -#include <tools/diagnose_ex.h> +#include <comphelper/diagnose_ex.hxx> namespace pcr @@ -53,12 +54,12 @@ namespace pcr nullptr }; - sal_Int32 lcl_getNavigationURLIndex( const OUString& _rNavURL ) + sal_Int32 lcl_getNavigationURLIndex( std::u16string_view _rNavURL ) { const char** pLookup = pNavigationURLs; while ( *pLookup ) { - if ( _rNavURL.equalsAscii( *pLookup ) ) + if ( o3tl::equalsAscii( _rNavURL, *pLookup ) ) return pLookup - pNavigationURLs; ++pLookup; } @@ -157,8 +158,8 @@ namespace pcr nButtonType = sal_Int32(FormButtonType_URL); } - m_xControlModel->setPropertyValue( PROPERTY_BUTTONTYPE, makeAny( static_cast< FormButtonType >( nButtonType ) ) ); - m_xControlModel->setPropertyValue( PROPERTY_TARGET_URL, makeAny( sTargetURL ) ); + m_xControlModel->setPropertyValue( PROPERTY_BUTTONTYPE, Any( static_cast< FormButtonType >( nButtonType ) ) ); + m_xControlModel->setPropertyValue( PROPERTY_TARGET_URL, Any( sTargetURL ) ); } catch( const Exception& ) { diff --git a/extensions/source/propctrlr/selectlabeldialog.cxx b/extensions/source/propctrlr/selectlabeldialog.cxx index 9fbadf38cae4..706e6eb3c807 100644 --- a/extensions/source/propctrlr/selectlabeldialog.cxx +++ b/extensions/source/propctrlr/selectlabeldialog.cxx @@ -19,8 +19,6 @@ #include <sal/config.h> -#include <string_view> - #include "selectlabeldialog.hxx" #include <strings.hrc> #include <bitmaps.hlst> @@ -37,7 +35,6 @@ #include <comphelper/types.hxx> #include <sal/log.hxx> #include <tools/debug.hxx> -#include <rtl/ustrbuf.hxx> namespace pcr @@ -73,7 +70,7 @@ namespace pcr nClassID = ::comphelper::getINT16(m_xControlModel->getPropertyValue(PROPERTY_CLASSID)); sDescription = sDescription.replaceAll("$controlclass$", - GetUIHeadlineName(nClassID, makeAny(m_xControlModel))); + GetUIHeadlineName(nClassID, Any(m_xControlModel))); OUString sName = ::comphelper::getString(m_xControlModel->getPropertyValue(PROPERTY_NAME)); sDescription = sDescription.replaceAll("$controlname$", sName); m_xMainDesc->set_label(sDescription); @@ -95,8 +92,8 @@ namespace pcr // check which service the allowed components must support sal_Int16 nClassId = 0; try { nClassId = ::comphelper::getINT16(m_xControlModel->getPropertyValue(PROPERTY_CLASSID)); } catch(...) { } - m_sRequiredService = (FormComponentType::RADIOBUTTON == nClassId) ? std::u16string_view(u"" SERVICE_COMPONENT_GROUPBOX) : std::u16string_view(u"" SERVICE_COMPONENT_FIXEDTEXT); - m_aRequiredControlImage = (FormComponentType::RADIOBUTTON == nClassId) ? std::u16string_view(u"" RID_EXTBMP_GROUPBOX) : std::u16string_view(u"" RID_EXTBMP_FIXEDTEXT); + m_sRequiredService = (FormComponentType::RADIOBUTTON == nClassId) ? SERVICE_COMPONENT_GROUPBOX : SERVICE_COMPONENT_FIXEDTEXT; + m_aRequiredControlImage = (FormComponentType::RADIOBUTTON == nClassId) ? RID_EXTBMP_GROUPBOX : RID_EXTBMP_FIXEDTEXT; // calc the currently set label control (so InsertEntries can calc m_xInitialSelection) Any aCurrentLabelControl( m_xControlModel->getPropertyValue(PROPERTY_CONTROLLABEL) ); @@ -211,7 +208,7 @@ namespace pcr // all requirements met -> insert m_xUserData.emplace_back(new Reference<XPropertySet>(xAsSet)); - OUString sId(OUString::number(reinterpret_cast<sal_Int64>(m_xUserData.back().get()))); + OUString sId(weld::toId(m_xUserData.back().get())); m_xControlTree->insert(&rContainerEntry, -1, &sDisplayName, &sId, nullptr, nullptr, false, m_xScratchIter.get()); m_xControlTree->set_image(*m_xScratchIter, m_aRequiredControlImage); @@ -235,7 +232,7 @@ namespace pcr bool bSelected = m_xControlTree->get_selected(xIter.get()); OUString sData = bSelected ? m_xControlTree->get_id(*xIter) : OUString(); if (!sData.isEmpty()) - m_xSelectedControl.set(*reinterpret_cast<Reference<XPropertySet>*>(sData.toInt64())); + m_xSelectedControl.set(*weld::fromId<Reference<XPropertySet>*>(sData)); m_xNoAssignment->set_active(sData.isEmpty()); } diff --git a/extensions/source/propctrlr/sqlcommanddesign.cxx b/extensions/source/propctrlr/sqlcommanddesign.cxx index c5bd8a34c749..d98b2a569234 100644 --- a/extensions/source/propctrlr/sqlcommanddesign.cxx +++ b/extensions/source/propctrlr/sqlcommanddesign.cxx @@ -37,7 +37,9 @@ #include <com/sun/star/frame/XDispatchProvider.hpp> #include <com/sun/star/sdb/CommandType.hpp> -#include <tools/diagnose_ex.h> +#include <comphelper/propertyvalue.hxx> +#include <utility> +#include <comphelper/diagnose_ex.hxx> #include <osl/diagnose.h> @@ -89,9 +91,9 @@ namespace pcr SQLCommandDesigner::SQLCommandDesigner( const Reference< XComponentContext >& _rxContext, const ::rtl::Reference< ISQLCommandAdapter >& _rxPropertyAdapter, - const ::dbtools::SharedConnection& _rConnection, const Link<SQLCommandDesigner&,void>& _rCloseLink ) + ::dbtools::SharedConnection _aConnection, const Link<SQLCommandDesigner&,void>& _rCloseLink ) :m_xContext( _rxContext ) - ,m_xConnection( _rConnection ) + ,m_xConnection(std::move( _aConnection )) ,m_xObjectAdapter( _rxPropertyAdapter ) ,m_aCloseLink( _rCloseLink ) { @@ -161,6 +163,8 @@ namespace pcr m_xConnection.clear(); m_xContext.clear(); m_xORB.clear(); + m_xDesigner.clear(); + m_xObjectAdapter.clear(); } @@ -221,19 +225,14 @@ namespace pcr // thus, we create a blank frame at the desktop, remove it from the desktop's frame list // immediately, and then load the component into this blank (and now parent-less) frame Reference< XComponentLoader > xLoader( impl_createEmptyParentlessTask_nothrow(), UNO_QUERY_THROW ); - Sequence< PropertyValue > aArgs( 5 ); - aArgs[0].Name = PROPERTY_ACTIVE_CONNECTION; - aArgs[0].Value <<= m_xConnection.getTyped(); - - aArgs[1].Name = PROPERTY_COMMAND; - aArgs[1].Value <<= m_xObjectAdapter->getSQLCommand(); - aArgs[2].Name = PROPERTY_COMMANDTYPE; - aArgs[2].Value <<= sal_Int32(CommandType::COMMAND); - aArgs[3].Name = PROPERTY_ESCAPE_PROCESSING; - aArgs[3].Value <<= m_xObjectAdapter->getEscapeProcessing(); - - aArgs[4].Name = "GraphicalDesign"; - aArgs[4].Value <<= m_xObjectAdapter->getEscapeProcessing(); + const bool bEscapeProcessing = m_xObjectAdapter->getEscapeProcessing(); + Sequence< PropertyValue > aArgs{ + comphelper::makePropertyValue(PROPERTY_ACTIVE_CONNECTION, m_xConnection.getTyped()), + comphelper::makePropertyValue(PROPERTY_COMMAND, m_xObjectAdapter->getSQLCommand()), + comphelper::makePropertyValue(PROPERTY_COMMANDTYPE, CommandType::COMMAND), + comphelper::makePropertyValue(PROPERTY_ESCAPE_PROCESSING, bEscapeProcessing), + comphelper::makePropertyValue("GraphicalDesign", bEscapeProcessing) + }; Reference< XComponent > xQueryDesign = xLoader->loadComponentFromURL( ".component:DB/QueryDesign", diff --git a/extensions/source/propctrlr/sqlcommanddesign.hxx b/extensions/source/propctrlr/sqlcommanddesign.hxx index a72ba11b0571..767506eca7bf 100644 --- a/extensions/source/propctrlr/sqlcommanddesign.hxx +++ b/extensions/source/propctrlr/sqlcommanddesign.hxx @@ -72,7 +72,7 @@ namespace pcr SQLCommandDesigner( const css::uno::Reference< css::uno::XComponentContext >& _rxContext, const ::rtl::Reference< ISQLCommandAdapter >& _rxPropertyAdapter, - const ::dbtools::SharedConnection& _rConnection, + ::dbtools::SharedConnection _aConnection, const Link<SQLCommandDesigner&,void>& _rCloseLink ); diff --git a/extensions/source/propctrlr/standardcontrol.cxx b/extensions/source/propctrlr/standardcontrol.cxx index 8c33d0598711..ad978253b076 100644 --- a/extensions/source/propctrlr/standardcontrol.cxx +++ b/extensions/source/propctrlr/standardcontrol.cxx @@ -38,6 +38,7 @@ #include <tools/datetime.hxx> #include <unotools/datetime.hxx> +#include <o3tl/string_view.hxx> #include <limits> #include <memory> @@ -229,16 +230,16 @@ namespace pcr notifyModifiedValue(); } - static int ImplCalcLongValue( double nValue, sal_uInt16 nDigits ) + static sal_Int64 ImplCalcLongValue( double nValue, sal_uInt16 nDigits ) { double n = nValue; for ( sal_uInt16 d = 0; d < nDigits; ++d ) n *= 10; - return o3tl::saturating_cast<int>(n); + return o3tl::saturating_cast<sal_Int64>(n); } - static double ImplCalcDoubleValue( int nValue, sal_uInt16 nDigits ) + static double ImplCalcDoubleValue(sal_Int64 nValue, sal_uInt16 nDigits ) { double n = nValue; for ( sal_uInt16 d = 0; d < nDigits; ++d ) @@ -313,7 +314,7 @@ namespace pcr Any SAL_CALL OHyperlinkControl::getValue() { OUString sText = m_xEntry->get_text(); - return makeAny( sText ); + return Any( sText ); } void SAL_CALL OHyperlinkControl::setValue( const Any& _value ) @@ -376,7 +377,7 @@ namespace pcr void SAL_CALL ONumericControl::setDecimalDigits( ::sal_Int16 decimaldigits ) { weld::MetricSpinButton* pControlWindow = getTypedControlWindow(); - int min, max; + sal_Int64 min, max; pControlWindow->get_range(min, max, FieldUnit::NONE); pControlWindow->set_digits(decimaldigits); pControlWindow->set_range(min, max, FieldUnit::NONE); @@ -386,8 +387,8 @@ namespace pcr { Optional< double > aReturn( true, 0 ); - int minValue = getTypedControlWindow()->get_min(FieldUnit::NONE); - if ( minValue == std::numeric_limits<int>::min() ) + sal_Int64 minValue = getTypedControlWindow()->get_min(FieldUnit::NONE); + if ( minValue == std::numeric_limits<sal_Int64>::min() ) aReturn.IsPresent = false; else aReturn.Value = static_cast<double>(minValue); @@ -398,7 +399,7 @@ namespace pcr void SAL_CALL ONumericControl::setMinValue( const Optional< double >& _minvalue ) { if ( !_minvalue.IsPresent ) - getTypedControlWindow()->set_min( std::numeric_limits<int>::min(), FieldUnit::NONE ); + getTypedControlWindow()->set_min( std::numeric_limits<sal_Int64>::min(), FieldUnit::NONE ); else getTypedControlWindow()->set_min( impl_apiValueToFieldValue_nothrow( _minvalue.Value ) , m_eValueUnit); } @@ -407,8 +408,8 @@ namespace pcr { Optional< double > aReturn( true, 0 ); - int maxValue = getTypedControlWindow()->get_max(FieldUnit::NONE); - if ( maxValue == std::numeric_limits<int>::max() ) + sal_Int64 maxValue = getTypedControlWindow()->get_max(FieldUnit::NONE); + if ( maxValue == std::numeric_limits<sal_Int64>::max() ) aReturn.IsPresent = false; else aReturn.Value = static_cast<double>(maxValue); @@ -419,7 +420,7 @@ namespace pcr void SAL_CALL ONumericControl::setMaxValue( const Optional< double >& _maxvalue ) { if ( !_maxvalue.IsPresent ) - getTypedControlWindow()->set_max( std::numeric_limits<int>::max(), FieldUnit::NONE ); + getTypedControlWindow()->set_max( std::numeric_limits<sal_Int64>::max(), FieldUnit::NONE ); else getTypedControlWindow()->set_max( impl_apiValueToFieldValue_nothrow( _maxvalue.Value ), m_eValueUnit ); } @@ -478,14 +479,14 @@ namespace pcr } } - int ONumericControl::impl_apiValueToFieldValue_nothrow( double _nApiValue ) const + sal_Int64 ONumericControl::impl_apiValueToFieldValue_nothrow( double _nApiValue ) const { - int nControlValue = ImplCalcLongValue( _nApiValue, getTypedControlWindow()->get_digits() ); + sal_Int64 nControlValue = ImplCalcLongValue( _nApiValue, getTypedControlWindow()->get_digits() ); nControlValue /= m_nFieldToUNOValueFactor; return nControlValue; } - double ONumericControl::impl_fieldValueToApiValue_nothrow( int nFieldValue ) const + double ONumericControl::impl_fieldValueToApiValue_nothrow(sal_Int64 nFieldValue) const { double nApiValue = ImplCalcDoubleValue( nFieldValue, getTypedControlWindow()->get_digits() ); nApiValue *= m_nFieldToUNOValueFactor; @@ -498,7 +499,8 @@ namespace pcr if ( !getTypedControlWindow()->get_text().isEmpty() ) { double nValue = impl_fieldValueToApiValue_nothrow( getTypedControlWindow()->get_value( m_eValueUnit ) ); - aPropValue <<= nValue; + if (nValue) + aPropValue <<= nValue; } return aPropValue; } @@ -637,7 +639,7 @@ namespace pcr Any SAL_CALL OComboboxControl::getValue() { - return makeAny( getTypedControlWindow()->get_active_text() ); + return Any( getTypedControlWindow()->get_active_text() ); } Type SAL_CALL OComboboxControl::getValueType() @@ -680,7 +682,7 @@ namespace pcr namespace { - StlSyntaxSequence< OUString > lcl_convertMultiLineToList( const OUString& _rCompsedTextWithLineBreaks ) + StlSyntaxSequence< OUString > lcl_convertMultiLineToList( std::u16string_view _rCompsedTextWithLineBreaks ) { sal_Int32 nLines = comphelper::string::getTokenCount(_rCompsedTextWithLineBreaks, '\n'); StlSyntaxSequence< OUString > aStrings( nLines ); @@ -690,7 +692,7 @@ namespace pcr sal_Int32 nIdx {0}; do { - *stringItem = _rCompsedTextWithLineBreaks.getToken( 0, '\n', nIdx ); + *stringItem = o3tl::getToken(_rCompsedTextWithLineBreaks, 0, '\n', nIdx ); ++stringItem; } while (nIdx>0); @@ -723,9 +725,7 @@ namespace pcr { if ( strings != _rStrings.begin() ) aComposed.append( ';' ); - aComposed.append( '\"' ); - aComposed.append( *strings ); - aComposed.append( '\"' ); + aComposed.append( "\"" + *strings + "\"" ); } return aComposed.makeStringAndClear(); } diff --git a/extensions/source/propctrlr/standardcontrol.hxx b/extensions/source/propctrlr/standardcontrol.hxx index a54af78c3a3a..fcd194886a1a 100644 --- a/extensions/source/propctrlr/standardcontrol.hxx +++ b/extensions/source/propctrlr/standardcontrol.hxx @@ -26,6 +26,7 @@ #include <com/sun/star/inspection/XStringListControl.hpp> #include <com/sun/star/inspection/XHyperlinkControl.hpp> #include <com/sun/star/uno/Sequence.hxx> +#include <comphelper/interfacecontainer2.hxx> #include <svtools/ctrlbox.hxx> #include <svx/colorbox.hxx> @@ -245,12 +246,12 @@ namespace pcr The conversion respects our decimal digits as well as our value factor (<member>m_nFieldToUNOValueFactor</member>). */ - int impl_apiValueToFieldValue_nothrow( double nApiValue ) const; + sal_Int64 impl_apiValueToFieldValue_nothrow( double nApiValue ) const; /** converts a control value, as obtained from our Numeric field, into a value which can passed to outer callers via our UNO API. */ - double impl_fieldValueToApiValue_nothrow( int nFieldValue ) const; + double impl_fieldValueToApiValue_nothrow(sal_Int64 nFieldValue) const; }; //= OColorControl diff --git a/extensions/source/propctrlr/stringrepresentation.cxx b/extensions/source/propctrlr/stringrepresentation.cxx index da468e5b51ef..6f40c09c9d84 100644 --- a/extensions/source/propctrlr/stringrepresentation.cxx +++ b/extensions/source/propctrlr/stringrepresentation.cxx @@ -37,8 +37,10 @@ #include <osl/diagnose.h> #include <rtl/ustrbuf.hxx> #include <sal/log.hxx> +#include <utility> #include <yesno.hrc> #include <comphelper/types.hxx> +#include <o3tl/string_view.hxx> #include "modulepcr.hxx" #include <algorithm> @@ -57,7 +59,7 @@ class StringRepresentation: lang::XInitialization> { public: - explicit StringRepresentation(uno::Reference< uno::XComponentContext > const & context); + explicit StringRepresentation(uno::Reference< uno::XComponentContext > context); StringRepresentation (const StringRepresentation&) = delete; StringRepresentation& operator=(const StringRepresentation&) = delete; @@ -127,8 +129,8 @@ private: } -StringRepresentation::StringRepresentation(uno::Reference< uno::XComponentContext > const & context) : - m_xContext(context) +StringRepresentation::StringRepresentation(uno::Reference< uno::XComponentContext > context) : + m_xContext(std::move(context)) {} // com.sun.star.uno.XServiceInfo: @@ -304,9 +306,9 @@ namespace { return OUString::number( _rIntValue ); } - sal_Int32 operator()( const OUString& _rStringValue ) const + sal_Int32 operator()( std::u16string_view _rStringValue ) const { - return _rStringValue.toInt32(); + return o3tl::toInt32(_rStringValue); } }; @@ -327,8 +329,7 @@ namespace // (separated by a line break) for (const auto& rElement : _rElements) { - sCompose.append(OUString(_rTransformer(rElement))); - sCompose.append("\n"); + sCompose.append(OUString(_rTransformer(rElement)) + "\n"); } sCompose.stripEnd('\n'); @@ -336,16 +337,16 @@ namespace } template < class ElementType, class Transformer > - void splitComposedStringToSequence( const OUString& _rComposed, Sequence< ElementType >& _out_SplitUp, const Transformer& _rTransformer ) + void splitComposedStringToSequence( std::u16string_view _rComposed, Sequence< ElementType >& _out_SplitUp, const Transformer& _rTransformer ) { _out_SplitUp.realloc( 0 ); - if ( _rComposed.isEmpty() ) + if ( _rComposed.empty() ) return; sal_Int32 tokenPos = 0; do { _out_SplitUp.realloc( _out_SplitUp.getLength() + 1 ); - _out_SplitUp[ _out_SplitUp.getLength() - 1 ] = static_cast<ElementType>(_rTransformer( _rComposed.getToken( 0, '\n', tokenPos ) )); + _out_SplitUp.getArray()[ _out_SplitUp.getLength() - 1 ] = static_cast<ElementType>(_rTransformer( OUString(o3tl::getToken(_rComposed, 0, '\n', tokenPos )) )); } while ( tokenPos != -1 ); } @@ -416,10 +417,6 @@ bool StringRepresentation::convertGenericValueToString( const uno::Any& _rValue, } break; case uno::TypeClass_CONSTANT: - { - int i = 0; - ++i; - } break; // some structs @@ -482,7 +479,7 @@ uno::Any StringRepresentation::convertStringToSimple( const OUString& _rValue,co } if ( !aReturn.hasValue() ) - aReturn = m_xTypeConverter->convertToSimpleType( makeAny( _rValue ), _ePropertyType ); + aReturn = m_xTypeConverter->convertToSimpleType( Any( _rValue ), _ePropertyType ); } catch( const script::CannotConvertException& ) { } catch( const lang::IllegalArgumentException& ) { } diff --git a/extensions/source/propctrlr/submissionhandler.cxx b/extensions/source/propctrlr/submissionhandler.cxx index 3d2dfeff4ee2..05e25e4d71a8 100644 --- a/extensions/source/propctrlr/submissionhandler.cxx +++ b/extensions/source/propctrlr/submissionhandler.cxx @@ -29,7 +29,7 @@ #include <com/sun/star/inspection/XObjectInspectorUI.hpp> #include <com/sun/star/lang/NullPointerException.hpp> #include <tools/debug.hxx> -#include <tools/diagnose_ex.h> +#include <comphelper/diagnose_ex.hxx> namespace pcr @@ -41,10 +41,8 @@ namespace pcr using namespace ::com::sun::star::uno; using namespace ::com::sun::star::lang; using namespace ::com::sun::star::beans; - using namespace ::com::sun::star::script; using namespace ::com::sun::star::form; using namespace ::com::sun::star::xforms; - using namespace ::com::sun::star::container; using namespace ::com::sun::star::inspection; @@ -216,10 +214,9 @@ namespace pcr if (!m_pHelper) return Sequence< OUString >(); - Sequence< OUString > aReturn( 3 ); - aReturn[ 0 ] = PROPERTY_TARGET_URL; - aReturn[ 1 ] = PROPERTY_TARGET_FRAME; - aReturn[ 2 ] = PROPERTY_BUTTONTYPE; + Sequence< OUString > aReturn{ PROPERTY_TARGET_URL, + PROPERTY_TARGET_FRAME, + PROPERTY_BUTTONTYPE }; return aReturn; } diff --git a/extensions/source/propctrlr/taborder.cxx b/extensions/source/propctrlr/taborder.cxx index d41018a833b3..af7b9ced7480 100644 --- a/extensions/source/propctrlr/taborder.cxx +++ b/extensions/source/propctrlr/taborder.cxx @@ -29,7 +29,7 @@ #include <com/sun/star/form/runtime/FormController.hpp> #include <osl/diagnose.h> #include <tools/debug.hxx> -#include <tools/diagnose_ex.h> +#include <comphelper/diagnose_ex.hxx> namespace pcr { @@ -180,7 +180,7 @@ namespace pcr aName = ::comphelper::getString( xControl->getPropertyValue( PROPERTY_NAME ) ); // TODO: do Basic controls have a name? aImage = GetImage( xControl ); - OUString sId(OUString::number(reinterpret_cast<sal_Int64>(xControl.get()))); + OUString sId(weld::toId(xControl.get())); m_xLB_Controls->append(sId, aName, aImage); } } @@ -243,7 +243,7 @@ namespace pcr for (int i = 0; i < nEntryCount; ++i) { - XPropertySet* pEntry = reinterpret_cast<XPropertySet*>(m_xLB_Controls->get_id(i).toInt64()); + XPropertySet* pEntry = weld::fromId<XPropertySet*>(m_xLB_Controls->get_id(i)); for( auto const& rControlModel : aControlModels ) { Reference< XPropertySet > xSet(rControlModel, UNO_QUERY); diff --git a/extensions/source/propctrlr/unourl.cxx b/extensions/source/propctrlr/unourl.cxx index 88c9630129e4..dba37915e647 100644 --- a/extensions/source/propctrlr/unourl.cxx +++ b/extensions/source/propctrlr/unourl.cxx @@ -22,7 +22,7 @@ #include <com/sun/star/util/XURLTransformer.hpp> #include <comphelper/processfactory.hxx> #include <osl/diagnose.h> -#include <tools/diagnose_ex.h> +#include <comphelper/diagnose_ex.hxx> namespace pcr diff --git a/extensions/source/propctrlr/xsddatatypes.cxx b/extensions/source/propctrlr/xsddatatypes.cxx index fdaea8e21fc8..25af46895adb 100644 --- a/extensions/source/propctrlr/xsddatatypes.cxx +++ b/extensions/source/propctrlr/xsddatatypes.cxx @@ -24,7 +24,7 @@ #include <com/sun/star/beans/XPropertySet.hpp> #include <tools/debug.hxx> #include <osl/diagnose.h> -#include <tools/diagnose_ex.h> +#include <comphelper/diagnose_ex.hxx> namespace pcr diff --git a/extensions/source/propctrlr/xsdvalidationhelper.cxx b/extensions/source/propctrlr/xsdvalidationhelper.cxx index 390993de6aca..5580a8ec3a4f 100644 --- a/extensions/source/propctrlr/xsdvalidationhelper.cxx +++ b/extensions/source/propctrlr/xsdvalidationhelper.cxx @@ -29,7 +29,7 @@ #include <com/sun/star/xforms/XDataTypeRepository.hpp> #include <unotools/syslocale.hxx> #include <i18nlangtag/languagetag.hxx> -#include <tools/diagnose_ex.h> +#include <comphelper/diagnose_ex.hxx> namespace pcr @@ -257,7 +257,7 @@ namespace pcr } catch( const Exception& ) { } // set the new data type name - xBinding->setPropertyValue( PROPERTY_XSD_DATA_TYPE, makeAny( _rName ) ); + xBinding->setPropertyValue( PROPERTY_XSD_DATA_TYPE, Any( _rName ) ); // retrieve the new data type object Reference< XPropertySet > xNewType = getDataType( _rName ); @@ -269,7 +269,7 @@ namespace pcr // fire the change in the Data Type property OUString sNewDataTypeName; OSL_VERIFY( xBinding->getPropertyValue( PROPERTY_XSD_DATA_TYPE ) >>= sNewDataTypeName ); - firePropertyChange( PROPERTY_XSD_DATA_TYPE, makeAny( sOldDataTypeName ), makeAny( sNewDataTypeName ) ); + firePropertyChange( PROPERTY_XSD_DATA_TYPE, Any( sOldDataTypeName ), Any( sNewDataTypeName ) ); } } catch( const Exception& ) @@ -361,7 +361,7 @@ namespace pcr sal_Int32 nDesiredFormat = xFormatTypes->getStandardFormat( nNumberFormatType, SvtSysLocale().GetLanguageTag().getLocale() ); // set this at the introspectee - m_xControlModel->setPropertyValue( PROPERTY_FORMATKEY, makeAny( nDesiredFormat ) ); + m_xControlModel->setPropertyValue( PROPERTY_FORMATKEY, Any( nDesiredFormat ) ); } } catch( const Exception& ) diff --git a/extensions/source/propctrlr/xsdvalidationpropertyhandler.cxx b/extensions/source/propctrlr/xsdvalidationpropertyhandler.cxx index 3f61549b62d0..29bc09a65a7f 100644 --- a/extensions/source/propctrlr/xsdvalidationpropertyhandler.cxx +++ b/extensions/source/propctrlr/xsdvalidationpropertyhandler.cxx @@ -56,9 +56,7 @@ namespace pcr using namespace ::com::sun::star::uno; using namespace ::com::sun::star::lang; using namespace ::com::sun::star::beans; - using namespace ::com::sun::star::xforms; using namespace ::com::sun::star::xsd; - using namespace ::com::sun::star::script; using namespace ::com::sun::star::inspection; using ::com::sun::star::beans::PropertyAttribute::MAYBEVOID; @@ -102,9 +100,9 @@ namespace pcr switch ( nPropId ) { // common facets - case PROPERTY_ID_XSD_DATA_TYPE: aReturn = pType.is() ? pType->getFacet( PROPERTY_NAME ) : makeAny( OUString() ); break; - case PROPERTY_ID_XSD_WHITESPACES:aReturn = pType.is() ? pType->getFacet( PROPERTY_XSD_WHITESPACES ) : makeAny( WhiteSpaceTreatment::Preserve ); break; - case PROPERTY_ID_XSD_PATTERN: aReturn = pType.is() ? pType->getFacet( PROPERTY_XSD_PATTERN ) : makeAny( OUString() ); break; + case PROPERTY_ID_XSD_DATA_TYPE: aReturn = pType.is() ? pType->getFacet( PROPERTY_NAME ) : Any( OUString() ); break; + case PROPERTY_ID_XSD_WHITESPACES:aReturn = pType.is() ? pType->getFacet( PROPERTY_XSD_WHITESPACES ) : Any( WhiteSpaceTreatment::Preserve ); break; + case PROPERTY_ID_XSD_PATTERN: aReturn = pType.is() ? pType->getFacet( PROPERTY_XSD_PATTERN ) : Any( OUString() ); break; // all other properties are simply forwarded, if they exist at the given type default: @@ -171,7 +169,7 @@ namespace pcr if ( bAllowBinding ) { - aProperties.reserve( 12 ); + aProperties.reserve( 28 ); addStringPropertyDescription( aProperties, PROPERTY_XSD_DATA_TYPE ); addInt16PropertyDescription ( aProperties, PROPERTY_XSD_WHITESPACES ); @@ -221,27 +219,27 @@ namespace pcr std::vector< OUString > aSuperfluous; if (m_pHelper) { - aSuperfluous.push_back( OUString(PROPERTY_CONTROLSOURCE) ); - aSuperfluous.push_back( OUString(PROPERTY_EMPTY_IS_NULL) ); - aSuperfluous.push_back( OUString(PROPERTY_FILTERPROPOSAL) ); - aSuperfluous.push_back( OUString(PROPERTY_LISTSOURCETYPE) ); - aSuperfluous.push_back( OUString(PROPERTY_LISTSOURCE) ); - aSuperfluous.push_back( OUString(PROPERTY_BOUNDCOLUMN) ); + aSuperfluous.push_back( PROPERTY_CONTROLSOURCE ); + aSuperfluous.push_back( PROPERTY_EMPTY_IS_NULL ); + aSuperfluous.push_back( PROPERTY_FILTERPROPOSAL ); + aSuperfluous.push_back( PROPERTY_LISTSOURCETYPE ); + aSuperfluous.push_back( PROPERTY_LISTSOURCE ); + aSuperfluous.push_back( PROPERTY_BOUNDCOLUMN ); bool bAllowBinding = m_pHelper->canBindToAnyDataType(); if ( bAllowBinding ) { - aSuperfluous.push_back( OUString(PROPERTY_MAXTEXTLEN) ); - aSuperfluous.push_back( OUString(PROPERTY_VALUEMIN) ); - aSuperfluous.push_back( OUString(PROPERTY_VALUEMAX) ); - aSuperfluous.push_back( OUString(PROPERTY_DECIMAL_ACCURACY) ); - aSuperfluous.push_back( OUString(PROPERTY_TIMEMIN) ); - aSuperfluous.push_back( OUString(PROPERTY_TIMEMAX) ); - aSuperfluous.push_back( OUString(PROPERTY_DATEMIN) ); - aSuperfluous.push_back( OUString(PROPERTY_DATEMAX) ); - aSuperfluous.push_back( OUString(PROPERTY_EFFECTIVE_MIN) ); - aSuperfluous.push_back( OUString(PROPERTY_EFFECTIVE_MAX) ); + aSuperfluous.push_back( PROPERTY_MAXTEXTLEN ); + aSuperfluous.push_back( PROPERTY_VALUEMIN ); + aSuperfluous.push_back( PROPERTY_VALUEMAX ); + aSuperfluous.push_back( PROPERTY_DECIMAL_ACCURACY ); + aSuperfluous.push_back( PROPERTY_TIMEMIN ); + aSuperfluous.push_back( PROPERTY_TIMEMAX ); + aSuperfluous.push_back( PROPERTY_DATEMIN ); + aSuperfluous.push_back( PROPERTY_DATEMAX ); + aSuperfluous.push_back( PROPERTY_EFFECTIVE_MIN ); + aSuperfluous.push_back( PROPERTY_EFFECTIVE_MAX ); } } @@ -255,8 +253,8 @@ namespace pcr std::vector< OUString > aInterestedInActuations; if (m_pHelper) { - aInterestedInActuations.push_back( OUString(PROPERTY_XSD_DATA_TYPE) ); - aInterestedInActuations.push_back( OUString(PROPERTY_XML_DATA_MODEL) ); + aInterestedInActuations.push_back( PROPERTY_XSD_DATA_TYPE ); + aInterestedInActuations.push_back( PROPERTY_XML_DATA_MODEL ); } return comphelper::containerToSequence( aInterestedInActuations ); } @@ -575,29 +573,29 @@ namespace pcr // show the facets which are available at the data type OUString aFacets[] = { - OUString(PROPERTY_XSD_WHITESPACES), OUString(PROPERTY_XSD_PATTERN), - OUString(PROPERTY_XSD_LENGTH), OUString(PROPERTY_XSD_MIN_LENGTH), OUString(PROPERTY_XSD_MAX_LENGTH), OUString(PROPERTY_XSD_TOTAL_DIGITS), - OUString(PROPERTY_XSD_FRACTION_DIGITS), - OUString(PROPERTY_XSD_MAX_INCLUSIVE_INT), - OUString(PROPERTY_XSD_MAX_EXCLUSIVE_INT), - OUString(PROPERTY_XSD_MIN_INCLUSIVE_INT), - OUString(PROPERTY_XSD_MIN_EXCLUSIVE_INT), - OUString(PROPERTY_XSD_MAX_INCLUSIVE_DOUBLE), - OUString(PROPERTY_XSD_MAX_EXCLUSIVE_DOUBLE), - OUString(PROPERTY_XSD_MIN_INCLUSIVE_DOUBLE), - OUString(PROPERTY_XSD_MIN_EXCLUSIVE_DOUBLE), - OUString(PROPERTY_XSD_MAX_INCLUSIVE_DATE), - OUString(PROPERTY_XSD_MAX_EXCLUSIVE_DATE), - OUString(PROPERTY_XSD_MIN_INCLUSIVE_DATE), - OUString(PROPERTY_XSD_MIN_EXCLUSIVE_DATE), - OUString(PROPERTY_XSD_MAX_INCLUSIVE_TIME), - OUString(PROPERTY_XSD_MAX_EXCLUSIVE_TIME), - OUString(PROPERTY_XSD_MIN_INCLUSIVE_TIME), - OUString(PROPERTY_XSD_MIN_EXCLUSIVE_TIME), - OUString(PROPERTY_XSD_MAX_INCLUSIVE_DATE_TIME), - OUString(PROPERTY_XSD_MAX_EXCLUSIVE_DATE_TIME), - OUString(PROPERTY_XSD_MIN_INCLUSIVE_DATE_TIME), - OUString(PROPERTY_XSD_MIN_EXCLUSIVE_DATE_TIME) + PROPERTY_XSD_WHITESPACES, PROPERTY_XSD_PATTERN, + PROPERTY_XSD_LENGTH, PROPERTY_XSD_MIN_LENGTH, PROPERTY_XSD_MAX_LENGTH, PROPERTY_XSD_TOTAL_DIGITS, + PROPERTY_XSD_FRACTION_DIGITS, + PROPERTY_XSD_MAX_INCLUSIVE_INT, + PROPERTY_XSD_MAX_EXCLUSIVE_INT, + PROPERTY_XSD_MIN_INCLUSIVE_INT, + PROPERTY_XSD_MIN_EXCLUSIVE_INT, + PROPERTY_XSD_MAX_INCLUSIVE_DOUBLE, + PROPERTY_XSD_MAX_EXCLUSIVE_DOUBLE, + PROPERTY_XSD_MIN_INCLUSIVE_DOUBLE, + PROPERTY_XSD_MIN_EXCLUSIVE_DOUBLE, + PROPERTY_XSD_MAX_INCLUSIVE_DATE, + PROPERTY_XSD_MAX_EXCLUSIVE_DATE, + PROPERTY_XSD_MIN_INCLUSIVE_DATE, + PROPERTY_XSD_MIN_EXCLUSIVE_DATE, + PROPERTY_XSD_MAX_INCLUSIVE_TIME, + PROPERTY_XSD_MAX_EXCLUSIVE_TIME, + PROPERTY_XSD_MIN_INCLUSIVE_TIME, + PROPERTY_XSD_MIN_EXCLUSIVE_TIME, + PROPERTY_XSD_MAX_INCLUSIVE_DATE_TIME, + PROPERTY_XSD_MAX_EXCLUSIVE_DATE_TIME, + PROPERTY_XSD_MIN_INCLUSIVE_DATE_TIME, + PROPERTY_XSD_MIN_EXCLUSIVE_DATE_TIME }; size_t i=0; diff --git a/extensions/source/scanner/grid.cxx b/extensions/source/scanner/grid.cxx index 85f22fb017e7..7d87010ea152 100644 --- a/extensions/source/scanner/grid.cxx +++ b/extensions/source/scanner/grid.cxx @@ -18,9 +18,9 @@ */ #include <sal/config.h> +#include <o3tl/sprintf.hxx> #include <osl/thread.h> #include <rtl/math.hxx> -#include <cstdio> #include <bitmaps.hlst> #include <cmath> @@ -206,7 +206,6 @@ void GridWindow::SetDrawingArea(weld::DrawingArea* pDrawingArea) GridDialog::GridDialog(weld::Window* pParent, double* pXValues, double* pYValues, int nValues) : GenericDialogController(pParent, "modules/scanner/ui/griddialog.ui", "GridDialog") - , m_xOKButton(m_xBuilder->weld_button("ok")) , m_xResetTypeBox(m_xBuilder->weld_combo_box("resetTypeCombobox")) , m_xResetButton(m_xBuilder->weld_button("resetButton")) , m_xGridWindow(new GridWindow) @@ -446,7 +445,7 @@ void GridWindow::drawGrid(vcl::RenderContext& rRenderContext) drawLine(rRenderContext, fX, m_fMinY, fX, m_fMaxY); // draw tickmarks Point aPt = transform(fX, m_fMinY); - std::sprintf(pBuf, "%g", fX); + o3tl::sprintf(pBuf, "%g", fX); OUString aMark(pBuf, strlen(pBuf), osl_getThreadTextEncoding()); Size aTextSize(rRenderContext.GetTextWidth(aMark), rRenderContext.GetTextHeight()); aPt.AdjustX( -(aTextSize.Width() / 2) ); @@ -459,7 +458,7 @@ void GridWindow::drawGrid(vcl::RenderContext& rRenderContext) drawLine(rRenderContext, m_fMinX, fY, m_fMaxX, fY); // draw tickmarks Point aPt = transform(m_fMinX, fY); - std::sprintf(pBuf, "%g", fY); + o3tl::sprintf(pBuf, "%g", fY); OUString aMark(pBuf, strlen(pBuf), osl_getThreadTextEncoding()); Size aTextSize(rRenderContext.GetTextWidth(aMark), rRenderContext.GetTextHeight()); aPt.AdjustX( -(aTextSize.Width() + 2) ); @@ -523,32 +522,32 @@ void GridWindow::Paint(vcl::RenderContext& rRenderContext, const tools::Rectangl bool GridWindow::MouseMove( const MouseEvent& rEvt ) { - if( rEvt.GetButtons() == MOUSE_LEFT && m_nDragIndex != npos ) - { - Point aPoint( rEvt.GetPosPixel() ); + if( rEvt.GetButtons() != MOUSE_LEFT || m_nDragIndex == npos ) + return false; - if( m_nDragIndex == 0 || m_nDragIndex == m_aHandles.size() - 1) - { - aPoint.setX( m_aHandles[m_nDragIndex].maPos.X() ); - } - else - { - if(aPoint.X() < m_aGridArea.Left()) - aPoint.setX( m_aGridArea.Left() ); - else if(aPoint.X() > m_aGridArea.Right()) - aPoint.setX( m_aGridArea.Right() ); - } + Point aPoint( rEvt.GetPosPixel() ); + + if( m_nDragIndex == 0 || m_nDragIndex == m_aHandles.size() - 1) + { + aPoint.setX( m_aHandles[m_nDragIndex].maPos.X() ); + } + else + { + if(aPoint.X() < m_aGridArea.Left()) + aPoint.setX( m_aGridArea.Left() ); + else if(aPoint.X() > m_aGridArea.Right()) + aPoint.setX( m_aGridArea.Right() ); + } - if( aPoint.Y() < m_aGridArea.Top() ) - aPoint.setY( m_aGridArea.Top() ); - else if( aPoint.Y() > m_aGridArea.Bottom() ) - aPoint.setY( m_aGridArea.Bottom() ); + if( aPoint.Y() < m_aGridArea.Top() ) + aPoint.setY( m_aGridArea.Top() ); + else if( aPoint.Y() > m_aGridArea.Bottom() ) + aPoint.setY( m_aGridArea.Bottom() ); - if( aPoint != m_aHandles[m_nDragIndex].maPos ) - { - m_aHandles[m_nDragIndex].maPos = aPoint; - Invalidate( m_aGridArea ); - } + if( aPoint != m_aHandles[m_nDragIndex].maPos ) + { + m_aHandles[m_nDragIndex].maPos = aPoint; + Invalidate( m_aGridArea ); } return false; @@ -648,7 +647,7 @@ void GridWindow::ChangeMode(ResetType nType) { for( int i = 0; i < m_nValues; i++ ) { - m_pNewYValues[ i ] = m_fMinY + (m_fMaxY-m_fMinY)*(rtl::math::expm1((m_pXValues[i]-m_fMinX)/(m_fMaxX-m_fMinX)))/(M_E-1.0); + m_pNewYValues[ i ] = m_fMinY + (m_fMaxY-m_fMinY)*(std::expm1((m_pXValues[i]-m_fMinX)/(m_fMaxX-m_fMinX)))/(M_E-1.0); } } break; diff --git a/extensions/source/scanner/grid.hxx b/extensions/source/scanner/grid.hxx index 86f1a521c6e1..319de77129d7 100644 --- a/extensions/source/scanner/grid.hxx +++ b/extensions/source/scanner/grid.hxx @@ -33,7 +33,6 @@ enum class ResetType class GridDialog : public weld::GenericDialogController { - std::unique_ptr<weld::Button> m_xOKButton; std::unique_ptr<weld::ComboBox> m_xResetTypeBox; std::unique_ptr<weld::Button> m_xResetButton; std::unique_ptr<GridWindow> m_xGridWindow; diff --git a/extensions/source/scanner/sane.cxx b/extensions/source/scanner/sane.cxx index 839602458e6e..0e92a8796433 100644 --- a/extensions/source/scanner/sane.cxx +++ b/extensions/source/scanner/sane.cxx @@ -169,6 +169,7 @@ Sane::~Sane() void Sane::Init() { +#ifndef DISABLE_DYNLOADING OUString sSaneLibName( "libsane" SAL_DLLEXTENSION ); pSaneLib = osl_loadModule( sSaneLibName.pData, SAL_LOADMODULE_LAZY ); if( ! pSaneLib ) @@ -183,7 +184,7 @@ void Sane::Init() osl_getFileURLFromSystemPath( sSaneLibSystemPath.pData, &sSaneLibName.pData ); pSaneLib = osl_loadModule( sSaneLibName.pData, SAL_LOADMODULE_LAZY ); } - +#endif if( pSaneLib ) { bSaneSymbolLoadFailed = false; @@ -243,7 +244,9 @@ void Sane::DeInit() if( pSaneLib ) { p_exit(); +#ifndef DISABLE_DYNLOADING osl_unloadModule( pSaneLib ); +#endif pSaneLib = nullptr; } } @@ -695,7 +698,7 @@ bool Sane::Start( BitmapTransporter& rBitmap ) if( nStatus != SANE_STATUS_GOOD ) bSynchronousRead = true; } - utl::TempFile aFrame; + utl::TempFileNamed aFrame; aFrame.EnableKillingFile(); FILE* pFrame = fopen(OUStringToOString(aFrame.GetFileName(), osl_getThreadTextEncoding()).getStr(), "w+b"); if( ! pFrame ) diff --git a/extensions/source/scanner/sanedlg.cxx b/extensions/source/scanner/sanedlg.cxx index e76575cd9bc9..b4f5e9a36cb7 100644 --- a/extensions/source/scanner/sanedlg.cxx +++ b/extensions/source/scanner/sanedlg.cxx @@ -17,13 +17,14 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#include <stdio.h> #include <stdlib.h> +#include <o3tl/sprintf.hxx> #include <tools/config.hxx> #include <unotools/resmgr.hxx> #include <vcl/bitmapex.hxx> #include <vcl/customweld.hxx> #include <vcl/dibtools.hxx> +#include <vcl/lineinfo.hxx> #include <vcl/weld.hxx> #include <vcl/svapp.hxx> #include <vcl/event.hxx> @@ -43,28 +44,52 @@ namespace { -void DrawRectangles(vcl::RenderContext& rRenderContext, Point const & rUL, Point const & rBR) +void DrawRect(vcl::RenderContext& rRenderContext, const tools::Rectangle& rRect) { - int nMiddleX, nMiddleY; - Point aBL, aUR; + tools::Rectangle aRect(rRect); + rRenderContext.SetFillColor(COL_BLACK); + rRenderContext.SetLineColor(); + rRenderContext.DrawRect(aRect); + aRect.Move(1, 1); + aRect.AdjustRight(-2); + aRect.AdjustBottom(-2); + rRenderContext.SetFillColor(); + rRenderContext.SetLineColor(COL_WHITE); + rRenderContext.DrawRect(aRect); +} - aUR = Point(rBR.X(), rUL.Y()); - aBL = Point(rUL.X(), rBR.Y()); - nMiddleX = (rBR.X() - rUL.X()) / 2 + rUL.X(); - nMiddleY = (rBR.Y() - rUL.Y()) / 2 + rUL.Y(); +void DrawRectangles(vcl::RenderContext& rRenderContext, Point const & rUL, Point const & rBR) +{ + Point aUR(rBR.X(), rUL.Y()); + Point aBL(rUL.X(), rBR.Y()); + int nMiddleX = (rBR.X() - rUL.X()) / 2 + rUL.X(); + int nMiddleY = (rBR.Y() - rUL.Y()) / 2 + rUL.Y(); + rRenderContext.SetLineColor(COL_WHITE); rRenderContext.DrawLine(rUL, aBL); rRenderContext.DrawLine(aBL, rBR); rRenderContext.DrawLine(rBR, aUR); rRenderContext.DrawLine(aUR, rUL); - rRenderContext.DrawRect(tools::Rectangle(rUL, Size(RECT_SIZE_PIX,RECT_SIZE_PIX))); - rRenderContext.DrawRect(tools::Rectangle(aBL, Size(RECT_SIZE_PIX, -RECT_SIZE_PIX))); - rRenderContext.DrawRect(tools::Rectangle(rBR, Size(-RECT_SIZE_PIX, -RECT_SIZE_PIX))); - rRenderContext.DrawRect(tools::Rectangle(aUR, Size(-RECT_SIZE_PIX, RECT_SIZE_PIX ))); - rRenderContext.DrawRect(tools::Rectangle(Point(nMiddleX - RECT_SIZE_PIX / 2, rUL.Y()), Size(RECT_SIZE_PIX, RECT_SIZE_PIX))); - rRenderContext.DrawRect(tools::Rectangle(Point(nMiddleX - RECT_SIZE_PIX / 2, rBR.Y()), Size(RECT_SIZE_PIX, -RECT_SIZE_PIX))); - rRenderContext.DrawRect(tools::Rectangle(Point(rUL.X(), nMiddleY - RECT_SIZE_PIX / 2), Size(RECT_SIZE_PIX, RECT_SIZE_PIX))); - rRenderContext.DrawRect(tools::Rectangle(Point(rBR.X(), nMiddleY - RECT_SIZE_PIX / 2), Size(-RECT_SIZE_PIX, RECT_SIZE_PIX))); + + rRenderContext.SetLineColor(COL_BLACK); + LineInfo aInfo(LineStyle::Dash, 1); + aInfo.SetDistance(8); + aInfo.SetDotLen(4); + aInfo.SetDotCount(1); + rRenderContext.DrawLine(rUL, aBL, aInfo); + rRenderContext.DrawLine(aBL, rBR, aInfo); + rRenderContext.DrawLine(rBR, aUR, aInfo); + rRenderContext.DrawLine(aUR, rUL, aInfo); + + Size aSize(RECT_SIZE_PIX, RECT_SIZE_PIX); + DrawRect(rRenderContext, tools::Rectangle(rUL, aSize)); + DrawRect(rRenderContext, tools::Rectangle(Point(aBL.X(), aBL.Y() - RECT_SIZE_PIX), aSize)); + DrawRect(rRenderContext, tools::Rectangle(Point(rBR.X() - RECT_SIZE_PIX, rBR.Y() - RECT_SIZE_PIX), aSize)); + DrawRect(rRenderContext, tools::Rectangle(Point(aUR.X() - RECT_SIZE_PIX, aUR.Y()), aSize)); + DrawRect(rRenderContext, tools::Rectangle(Point(nMiddleX - RECT_SIZE_PIX / 2, rUL.Y()), aSize)); + DrawRect(rRenderContext, tools::Rectangle(Point(nMiddleX - RECT_SIZE_PIX / 2, rBR.Y() - RECT_SIZE_PIX), aSize)); + DrawRect(rRenderContext, tools::Rectangle(Point(rUL.X(), nMiddleY - RECT_SIZE_PIX / 2), aSize)); + DrawRect(rRenderContext, tools::Rectangle(Point(rBR.X() - RECT_SIZE_PIX, nMiddleY - RECT_SIZE_PIX / 2), aSize)); } } @@ -77,13 +102,11 @@ private: BitmapEx maPreviewBitmapEx; tools::Rectangle maPreviewRect; - Point maLastUL, maLastBR; Point maTopLeft, maBottomRight; Point maMinTopLeft, maMaxBottomRight; SaneDlg* mpParentDialog; DragDirection meDragDirection; bool mbDragEnable; - bool mbDragDrawn; bool mbIsDragging; public: @@ -92,7 +115,6 @@ public: , mpParentDialog(nullptr) , meDragDirection(TopLeft) , mbDragEnable(false) - , mbDragDrawn(false) , mbIsDragging(false) { } @@ -745,7 +767,7 @@ IMPL_LINK(SaneDlg, ModifyHdl, weld::Entry&, rEdit, void) fValue = mfMin; else if( fValue > mfMax ) fValue = mfMax; - sprintf( pBuf, "%g", fValue ); + o3tl::sprintf( pBuf, "%g", fValue ); mxNumericEdit->set_text( OUString( pBuf, strlen(pBuf), osl_getThreadTextEncoding() ) ); } mrSane.SetOptionValue( mnCurrentOption, fValue, mnCurrentElement ); @@ -757,7 +779,7 @@ IMPL_LINK(SaneDlg, ModifyHdl, weld::Entry&, rEdit, void) if( mrSane.GetOptionValue( mnCurrentOption, fValue, mnCurrentElement )) { char pBuf[256]; - sprintf( pBuf, "%g", fValue ); + o3tl::sprintf( pBuf, "%g", fValue ); OUString aValue( pBuf, strlen(pBuf), osl_getThreadTextEncoding() ); mxNumericEdit->set_text( aValue ); mxQuantumRangeBox->set_active_text( aValue ); @@ -924,7 +946,6 @@ void ScanPreview::Paint(vcl::RenderContext& rRenderContext, const tools::Rectang // check for sane values rRenderContext.DrawBitmapEx(maPreviewRect.TopLeft(), maPreviewRect.GetSize(), maPreviewBitmapEx); - mbDragDrawn = false; DrawDrag(rRenderContext); } @@ -1002,18 +1023,18 @@ void SaneDlg::EstablishQuantumRange() mfMax = mpRange[ nValues-1 ]; for( int i = 0; i < nValues; i++ ) { - sprintf( pBuf, "%g", mpRange[ i ] ); + o3tl::sprintf( pBuf, "%g", mpRange[ i ] ); mxQuantumRangeBox->append_text( OUString( pBuf, strlen(pBuf), osl_getThreadTextEncoding() ) ); } double fValue; if( mrSane.GetOptionValue( mnCurrentOption, fValue, mnCurrentElement ) ) { - sprintf( pBuf, "%g", fValue ); + o3tl::sprintf( pBuf, "%g", fValue ); mxQuantumRangeBox->set_active_text( OUString( pBuf, strlen(pBuf), osl_getThreadTextEncoding() ) ); } mxQuantumRangeBox->show(); - OUString aText( mrSane.GetOptionName( mnCurrentOption ) + " " ); - aText += mrSane.GetOptionUnitName( mnCurrentOption ); + OUString aText = mrSane.GetOptionName( mnCurrentOption ) + " " + + mrSane.GetOptionUnitName( mnCurrentOption ); mxOptionDescTxt->set_label(aText); mxOptionDescTxt->show(); } @@ -1029,16 +1050,16 @@ void SaneDlg::EstablishNumericOption() return; char pBuf[256]; - OUString aText( mrSane.GetOptionName( mnCurrentOption ) + " " ); - aText += mrSane.GetOptionUnitName( mnCurrentOption ); + OUString aText = mrSane.GetOptionName( mnCurrentOption ) + " " + + mrSane.GetOptionUnitName( mnCurrentOption ); if( mfMin != mfMax ) { - sprintf( pBuf, " < %g ; %g >", mfMin, mfMax ); + o3tl::sprintf( pBuf, " < %g ; %g >", mfMin, mfMax ); aText += OUString( pBuf, strlen(pBuf), osl_getThreadTextEncoding() ); } mxOptionDescTxt->set_label( aText ); mxOptionDescTxt->show(); - sprintf( pBuf, "%g", fValue ); + o3tl::sprintf( pBuf, "%g", fValue ); mxNumericEdit->set_text( OUString( pBuf, strlen(pBuf), osl_getThreadTextEncoding() ) ); mxNumericEdit->show(); } @@ -1052,46 +1073,46 @@ void SaneDlg::EstablishButtonOption() bool ScanPreview::MouseMove(const MouseEvent& rMEvt) { - if( mbIsDragging ) + if( !mbIsDragging ) + return false; + + Point aMousePos = rMEvt.GetPosPixel(); + // move into valid area + Point aLogicPos = GetLogicPos( aMousePos ); + aMousePos = GetPixelPos( aLogicPos ); + switch( meDragDirection ) { - Point aMousePos = rMEvt.GetPosPixel(); - // move into valid area - Point aLogicPos = GetLogicPos( aMousePos ); - aMousePos = GetPixelPos( aLogicPos ); - switch( meDragDirection ) - { - case TopLeft: maTopLeft = aMousePos; break; - case Top: maTopLeft.setY( aMousePos.Y() ); break; - case TopRight: - maTopLeft.setY( aMousePos.Y() ); - maBottomRight.setX( aMousePos.X() ); - break; - case Right: maBottomRight.setX( aMousePos.X() ); break; - case BottomRight: maBottomRight = aMousePos; break; - case Bottom: maBottomRight.setY( aMousePos.Y() ); break; - case BottomLeft: - maTopLeft.setX( aMousePos.X() ); - maBottomRight.setY( aMousePos.Y() ); - break; - case Left: maTopLeft.setX( aMousePos.X() ); break; - default: break; - } - int nSwap; - if( maTopLeft.X() > maBottomRight.X() ) - { - nSwap = maTopLeft.X(); - maTopLeft.setX( maBottomRight.X() ); - maBottomRight.setX( nSwap ); - } - if( maTopLeft.Y() > maBottomRight.Y() ) - { - nSwap = maTopLeft.Y(); - maTopLeft.setY( maBottomRight.Y() ); - maBottomRight.setY( nSwap ); - } - Invalidate(); - mpParentDialog->UpdateScanArea(false); + case TopLeft: maTopLeft = aMousePos; break; + case Top: maTopLeft.setY( aMousePos.Y() ); break; + case TopRight: + maTopLeft.setY( aMousePos.Y() ); + maBottomRight.setX( aMousePos.X() ); + break; + case Right: maBottomRight.setX( aMousePos.X() ); break; + case BottomRight: maBottomRight = aMousePos; break; + case Bottom: maBottomRight.setY( aMousePos.Y() ); break; + case BottomLeft: + maTopLeft.setX( aMousePos.X() ); + maBottomRight.setY( aMousePos.Y() ); + break; + case Left: maTopLeft.setX( aMousePos.X() ); break; + default: break; + } + int nSwap; + if( maTopLeft.X() > maBottomRight.X() ) + { + nSwap = maTopLeft.X(); + maTopLeft.setX( maBottomRight.X() ); + maBottomRight.setX( nSwap ); } + if( maTopLeft.Y() > maBottomRight.Y() ) + { + nSwap = maTopLeft.Y(); + maTopLeft.setY( maBottomRight.Y() ); + maBottomRight.setY( nSwap ); + } + Invalidate(); + mpParentDialog->UpdateScanArea(false); return false; } @@ -1185,19 +1206,10 @@ void ScanPreview::DrawDrag(vcl::RenderContext& rRenderContext) if (!mbDragEnable) return; - RasterOp eROP = rRenderContext.GetRasterOp(); - rRenderContext.SetRasterOp(RasterOp::Invert); rRenderContext.SetMapMode(MapMode(MapUnit::MapPixel)); - if (mbDragDrawn) - DrawRectangles(rRenderContext, maLastUL, maLastBR); - - maLastUL = maTopLeft; - maLastBR = maBottomRight; DrawRectangles(rRenderContext, maTopLeft, maBottomRight); - mbDragDrawn = true; - rRenderContext.SetRasterOp(eROP); rRenderContext.SetMapMode(MapMode(MapUnit::MapAppFont)); } @@ -1271,8 +1283,8 @@ bool SaneDlg::LoadState() if( ! aConfig.HasGroup( "SANE" ) ) return false; - aConfig.SetGroup( "SANE" ); - OString aString = aConfig.ReadKey( "SO_LastSaneDevice" ); + aConfig.SetGroup( "SANE"_ostr ); + OString aString = aConfig.ReadKey( "SO_LastSaneDevice"_ostr ); for( i = 0; i < Sane::CountDevices() && aString != OUStringToOString(Sane::GetName(i), osl_getThreadTextEncoding()); i++ ) ; if( i == Sane::CountDevices() ) return false; @@ -1344,8 +1356,8 @@ void SaneDlg::SaveState() Config aConfig( aFileName ); aConfig.DeleteGroup( "SANE" ); - aConfig.SetGroup( "SANE" ); - aConfig.WriteKey( "SO_LastSANEDevice", + aConfig.SetGroup( "SANE"_ostr ); + aConfig.WriteKey( "SO_LastSANEDevice"_ostr, OUStringToOString(mxDeviceBox->get_active_text(), RTL_TEXTENCODING_UTF8) ); static char const* pSaveOptions[] = { @@ -1398,7 +1410,7 @@ void SaneDlg::SaveState() break; if( n > 0 ) aString.append(':'); - sprintf( buf, "%lg", fValue ); + o3tl::sprintf( buf, "%lg", fValue ); aString.append(buf); } if( n >= mrSane.GetOptionElements( nOption ) ) diff --git a/extensions/source/scanner/scanunx.cxx b/extensions/source/scanner/scanunx.cxx index 44787d46d0e6..0db920c4c951 100644 --- a/extensions/source/scanner/scanunx.cxx +++ b/extensions/source/scanner/scanunx.cxx @@ -22,6 +22,7 @@ #include <o3tl/safeint.hxx> #include <osl/thread.hxx> #include <sal/log.hxx> +#include <utility> #include <vcl/svapp.hxx> #include <memory> @@ -129,7 +130,7 @@ public: virtual void SAL_CALL run() override; virtual void SAL_CALL onTerminated() override { delete this; } public: - ScannerThread( const std::shared_ptr<SaneHolder>& pHolder, + ScannerThread( std::shared_ptr<SaneHolder> pHolder, const Reference< css::lang::XEventListener >& listener, ScannerManager* pManager ); virtual ~ScannerThread() override; @@ -137,10 +138,10 @@ public: } -ScannerThread::ScannerThread(const std::shared_ptr<SaneHolder>& pHolder, +ScannerThread::ScannerThread(std::shared_ptr<SaneHolder> pHolder, const Reference< css::lang::XEventListener >& listener, ScannerManager* pManager) - : m_pHolder( pHolder ), m_xListener( listener ), m_pManager( pManager ) + : m_pHolder(std::move( pHolder )), m_xListener( listener ), m_pManager( pManager ) { SAL_INFO("extensions.scanner", "ScannerThread"); } @@ -224,9 +225,7 @@ Sequence< ScannerContext > ScannerManager::getAvailableScanners() if( Sane::IsSane() ) { - Sequence< ScannerContext > aRet(1); - aRet[0].ScannerName = "SANE"; - aRet[0].InternalData = 0; + Sequence< ScannerContext > aRet{ { /* ScannerName */ "SANE", /* InternalData */ 0 } }; return aRet; } diff --git a/extensions/source/scanner/scanwin.cxx b/extensions/source/scanner/scanwin.cxx index 109f2944a3b5..198b092846cd 100644 --- a/extensions/source/scanner/scanwin.cxx +++ b/extensions/source/scanner/scanwin.cxx @@ -253,9 +253,10 @@ void Twain::ShimListenerThread::execute() ThrowLastError("DuplicateHandle"); // we will not need our copy as soon as shim has its own inherited one ScopedHANDLE hScopedDup(hDup); - DWORD nDup = static_cast<DWORD>(reinterpret_cast<sal_uIntPtr>(hDup)); - if (reinterpret_cast<HANDLE>(nDup) != hDup) - throw std::exception("HANDLE does not fit to 32 bit - cannot pass to shim!"); + sal_uIntPtr nDup = reinterpret_cast<sal_uIntPtr>(hDup); + if constexpr (sizeof(sal_uIntPtr) > 4) + if (nDup > 0xFFFFFFFF) + throw std::exception("HANDLE does not fit to 32 bit - cannot pass to shim!"); // Send this thread handle as the first parameter sCmdLine = "\"" + sCmdLine + "\" " + OUString::number(nDup); diff --git a/extensions/source/scanner/twain32shim.cxx b/extensions/source/scanner/twain32shim.cxx index 0a34fa13ce7e..6e0be8149471 100644 --- a/extensions/source/scanner/twain32shim.cxx +++ b/extensions/source/scanner/twain32shim.cxx @@ -28,17 +28,16 @@ */ #include "twain32shim.hxx" +#include <systools/win32/comtools.hxx> #include <tools/helpers.hxx> #include <twain/twain.h> +#include <o3tl/unit_conversion.hxx> #define WM_TWAIN_FALLBACK (WM_SHIM_INTERNAL + 0) namespace { -TW_INT32 FixToInt32(const TW_FIX32& rFix) -{ - return static_cast<TW_INT32>(floor(rFix.Whole + rFix.Frac / 65536. + 0.5)); -} +double FixToDouble(const TW_FIX32& rFix) { return rFix.Whole + rFix.Frac / 65536.; } const wchar_t sTwainWndClass[] = L"TwainClass"; @@ -169,26 +168,21 @@ HANDLE GetProcOfThread(HANDLE hThread) } ImpTwain::ImpTwain(HANDLE hParentThread) - : m_nParentThreadId(GetThreadId(hParentThread)) + : m_aAppId{ /* Id */ 0, + { /* Version.MajorNum */ 1, + /* Version.MinorNum */ 0, + /* Version.Language */ TWLG_USA, + /* Version.Country */ TWCY_USA, + /* Version.Info */ "8.0" }, + /* ProtocolMajor */ TWON_PROTOCOLMAJOR, + /* ProtocolMinor */ TWON_PROTOCOLMINOR, + /* SupportedGroups */ DG_IMAGE | DG_CONTROL, + /* Manufacturer */ "Sun Microsystems", + /* ProductFamily */ "Office", + /* ProductName */ "Office" } + , m_nParentThreadId(GetThreadId(hParentThread)) , m_hProc(GetProcOfThread(hParentThread)) { - m_aAppId.Id = 0; - m_aAppId.Version.MajorNum = 1; - m_aAppId.Version.MinorNum = 0; - m_aAppId.Version.Language = TWLG_USA; - m_aAppId.Version.Country = TWCY_USA; - m_aAppId.ProtocolMajor = TWON_PROTOCOLMAJOR; - m_aAppId.ProtocolMinor = TWON_PROTOCOLMINOR; - m_aAppId.SupportedGroups = DG_IMAGE | DG_CONTROL; - strncpy(m_aAppId.Version.Info, "8.0", 32); - m_aAppId.Version.Info[32] = m_aAppId.Version.Info[33] = 0; - strncpy(m_aAppId.Manufacturer, "Sun Microsystems", 32); - m_aAppId.Manufacturer[32] = m_aAppId.Manufacturer[33] = 0; - strncpy(m_aAppId.ProductFamily, "Office", 32); - m_aAppId.ProductFamily[32] = m_aAppId.ProductFamily[33] = 0; - strncpy(m_aAppId.ProductName, "Office", 32); - m_aAppId.ProductName[32] = m_aAppId.ProductName[33] = 0; - WNDCLASSW aWc = { 0, &WndProc, 0, sizeof(WNDCLASSW), GetModuleHandleW(nullptr), nullptr, nullptr, nullptr, nullptr, sTwainWndClass }; if (!RegisterClassW(&aWc)) @@ -258,11 +252,10 @@ void ImpTwain::ImplOpenSourceManager() if (!m_hMod) { // Windows directory might not be in DLL search path sometimes, so try the full path - PWSTR sPath; + sal::systools::CoTaskMemAllocated<wchar_t> sPath; if (SUCCEEDED(SHGetKnownFolderPath(FOLDERID_Windows, 0, nullptr, &sPath))) { - std::wstring sPathAndFile = sPath; - CoTaskMemFree(sPath); + std::wstring sPathAndFile(sPath); sPathAndFile += L"\\TWAIN_32.DLL"; m_hMod = LoadLibraryW(sPathAndFile.c_str()); } @@ -387,17 +380,15 @@ void ImpTwain::ImplXfer() { TW_IMAGEINFO aInfo; HANDLE hDIB = nullptr; - TW_INT32 nWidth, nHeight, nXRes, nYRes; + double nXRes, nYRes; if (m_pDSM(&m_aAppId, &m_aSrcId, DG_IMAGE, DAT_IMAGEINFO, MSG_GET, &aInfo) == TWRC_SUCCESS) { - nWidth = aInfo.ImageWidth; - nHeight = aInfo.ImageLength; - nXRes = FixToInt32(aInfo.XResolution); - nYRes = FixToInt32(aInfo.YResolution); + nXRes = FixToDouble(aInfo.XResolution); + nYRes = FixToDouble(aInfo.YResolution); } else - nWidth = nHeight = nXRes = nYRes = -1; + nXRes = nYRes = -1; switch (m_pDSM(&m_aAppId, &m_aSrcId, DG_IMAGE, DAT_IMAGENATIVEXFER, MSG_GET, &hDIB)) { @@ -417,14 +408,15 @@ void ImpTwain::ImplXfer() { if (LPVOID pBmpMem = GlobalLock(hGlob)) { - if ((nXRes != -1) && (nYRes != -1) && (nWidth != -1) && (nHeight != -1)) + if ((nXRes > 0) && (nYRes > 0)) { // set resolution of bitmap BITMAPINFOHEADER* pBIH = static_cast<BITMAPINFOHEADER*>(pBmpMem); - static const double fFactor = 100.0 / 2.54; - pBIH->biXPelsPerMeter = FRound(fFactor * nXRes); - pBIH->biYPelsPerMeter = FRound(fFactor * nYRes); + const auto[m, d] + = getConversionMulDiv(o3tl::Length::in, o3tl::Length::m); + pBIH->biXPelsPerMeter = std::round(o3tl::convert(nXRes, d, m)); + pBIH->biYPelsPerMeter = std::round(o3tl::convert(nYRes, d, m)); } HANDLE hMap = CreateFileMappingW(INVALID_HANDLE_VALUE, nullptr, diff --git a/extensions/source/update/check/actionlistener.hxx b/extensions/source/update/check/actionlistener.hxx index 8fdfd1565da6..63c5ac1cb019 100644 --- a/extensions/source/update/check/actionlistener.hxx +++ b/extensions/source/update/check/actionlistener.hxx @@ -27,7 +27,6 @@ class IActionListener : public virtual salhelper::SimpleReferenceObject virtual void cancel() = 0; virtual void download() = 0; - virtual void install() = 0; virtual void pause() = 0; virtual void resume() = 0; virtual void closeAfterFailure() = 0; diff --git a/extensions/source/update/check/download.cxx b/extensions/source/update/check/download.cxx index 905d16e99a7f..f96d6ecd495e 100644 --- a/extensions/source/update/check/download.cxx +++ b/extensions/source/update/check/download.cxx @@ -23,6 +23,8 @@ #include <curl/curl.h> +#include <systools/curlinit.hxx> + #include <o3tl/string_view.hxx> #include <osl/diagnose.h> #include <osl/file.h> @@ -60,8 +62,8 @@ static void openFile( OutData& out ) char * effective_url; curl_easy_getinfo(out.curl, CURLINFO_EFFECTIVE_URL, &effective_url); - double fDownloadSize; - curl_easy_getinfo(out.curl, CURLINFO_CONTENT_LENGTH_DOWNLOAD, &fDownloadSize); + curl_off_t nDownloadSize; + curl_easy_getinfo(out.curl, CURLINFO_CONTENT_LENGTH_DOWNLOAD_T, &nDownloadSize); OString aURL(effective_url); @@ -94,7 +96,7 @@ static void openFile( OutData& out ) } while( osl_File_E_EXIST == rc ); if( osl_File_E_None == rc ) - out.Handler->downloadStarted(out.File, static_cast<sal_Int64>(fDownloadSize)); + out.Handler->downloadStarted(out.File, static_cast<sal_Int64>(nDownloadSize)); } } @@ -140,7 +142,7 @@ write_function( void *ptr, size_t size, size_t nmemb, void *stream ) static int -progress_callback( void *clientp, double dltotal, double dlnow, SAL_UNUSED_PARAMETER double, SAL_UNUSED_PARAMETER double ) +progress_callback( void *clientp, curl_off_t dltotal, curl_off_t dlnow, SAL_UNUSED_PARAMETER curl_off_t, SAL_UNUSED_PARAMETER curl_off_t) { OutData *out = static_cast < OutData * > (clientp); @@ -148,7 +150,7 @@ progress_callback( void *clientp, double dltotal, double dlnow, SAL_UNUSED_PARAM if (out && !out->StopCondition.check()) { - double fPercent = 0; + float fPercent = 0; if ( dltotal + out->Offset ) fPercent = (dlnow + out->Offset) * 100 / (dltotal + out->Offset); if( fPercent < 0 ) @@ -178,8 +180,7 @@ Download::getProxyForURL(std::u16string_view rURL, OString& rHost, sal_Int32& rP aProperty.Name = "nodepath"; aProperty.Value <<= OUString("org.openoffice.Inet/Settings"); - uno::Sequence< uno::Any > aArgumentList( 1 ); - aArgumentList[0] <<= aProperty; + uno::Sequence< uno::Any > aArgumentList{ uno::Any(aProperty) }; uno::Reference< container::XNameAccess > xNameAccess( xConfigProvider->createInstanceWithArguments( @@ -202,11 +203,6 @@ Download::getProxyForURL(std::u16string_view rURL, OString& rHost, sal_Int32& rP rHost = getStringValue(xNameAccess, "ooInetHTTPSProxyName"); rPort = getInt32Value(xNameAccess, "ooInetHTTPSProxyPort"); } - else if( o3tl::starts_with(rURL, u"ftp:") ) - { - rHost = getStringValue(xNameAccess, "ooInetFTPProxyName"); - rPort = getInt32Value(xNameAccess, "ooInetFTPProxyPort"); - } } } @@ -223,6 +219,8 @@ static bool curl_run(std::u16string_view rURL, OutData& out, const OString& aPro if( nullptr != pCURL ) { + ::InitCurl_easy(pCURL); + out.curl = pCURL; OString aURL(OUStringToOString(rURL, RTL_TEXTENCODING_UTF8)); @@ -233,8 +231,12 @@ static bool curl_run(std::u16string_view rURL, OutData& out, const OString& aPro // enable redirection (void)curl_easy_setopt(pCURL, CURLOPT_FOLLOWLOCATION, 1); - // only allow redirect to http:// and https:// - (void)curl_easy_setopt(pCURL, CURLOPT_REDIR_PROTOCOLS, CURLPROTO_HTTP | CURLPROTO_HTTPS); + // only allow redirect to https:// +#if (LIBCURL_VERSION_MAJOR > 7) || (LIBCURL_VERSION_MAJOR == 7 && LIBCURL_VERSION_MINOR >= 85) + (void)curl_easy_setopt(pCURL, CURLOPT_REDIR_PROTOCOLS_STR, "https"); +#else + (void)curl_easy_setopt(pCURL, CURLOPT_REDIR_PROTOCOLS, CURLPROTO_HTTPS); +#endif // write function (void)curl_easy_setopt(pCURL, CURLOPT_WRITEDATA, &out); @@ -242,7 +244,7 @@ static bool curl_run(std::u16string_view rURL, OutData& out, const OString& aPro // progress handler - Condition::check unfortunately is not defined const (void)curl_easy_setopt(pCURL, CURLOPT_NOPROGRESS, 0); - (void)curl_easy_setopt(pCURL, CURLOPT_PROGRESSFUNCTION, &progress_callback); + (void)curl_easy_setopt(pCURL, CURLOPT_XFERINFOFUNCTION, &progress_callback); (void)curl_easy_setopt(pCURL, CURLOPT_PROGRESSDATA, &out); // proxy @@ -275,9 +277,9 @@ static bool curl_run(std::u16string_view rURL, OutData& out, const OString& aPro { // this sometimes happens, when a user throws away his user data, but has already // completed the download of an update. - double fDownloadSize; - curl_easy_getinfo( pCURL, CURLINFO_CONTENT_LENGTH_DOWNLOAD, &fDownloadSize ); - if ( -1 == fDownloadSize ) + curl_off_t nDownloadSize; + curl_easy_getinfo( pCURL, CURLINFO_CONTENT_LENGTH_DOWNLOAD_T, &nDownloadSize ); + if ( -1 == nDownloadSize ) { out.Handler->downloadFinished(out.File); ret = true; @@ -291,7 +293,7 @@ static bool curl_run(std::u16string_view rURL, OutData& out, const OString& aPro // Only report errors when not stopped else { - OString aMessage("Unknown error"); + OString aMessage("Unknown error"_ostr); const char * error_message = curl_easy_strerror(cc); if( nullptr != error_message ) diff --git a/extensions/source/update/check/updatecheck.cxx b/extensions/source/update/check/updatecheck.cxx index b9b64a4dfb9c..66409b32f8b3 100644 --- a/extensions/source/update/check/updatecheck.cxx +++ b/extensions/source/update/check/updatecheck.cxx @@ -42,7 +42,7 @@ #include <osl/file.hxx> #include <sal/macros.h> #include <sal/log.hxx> -#include <tools/diagnose_ex.h> +#include <comphelper/diagnose_ex.hxx> #ifdef _WIN32 #include <o3tl/safeCoInitUninit.hxx> @@ -55,7 +55,6 @@ namespace beans = com::sun::star::beans ; namespace deployment = com::sun::star::deployment ; -namespace frame = com::sun::star::frame ; namespace lang = com::sun::star::lang ; namespace c3s = com::sun::star::system ; namespace task = com::sun::star::task ; @@ -65,7 +64,7 @@ constexpr OUStringLiteral PROPERTY_TITLE = u"BubbleHeading"; constexpr OUStringLiteral PROPERTY_TEXT = u"BubbleText"; constexpr OUStringLiteral PROPERTY_SHOW_BUBBLE = u"BubbleVisible"; constexpr OUStringLiteral PROPERTY_CLICK_HDL = u"MenuClickHDL"; -constexpr OUStringLiteral PROPERTY_SHOW_MENUICON = u"MenuIconVisible"; +constexpr OUString PROPERTY_SHOW_MENUICON = u"MenuIconVisible"_ustr; // Returns the URL of the release note for the given position OUString getReleaseNote(const UpdateInfo& rInfo, sal_uInt8 pos, bool autoDownloadEnabled) @@ -96,16 +95,6 @@ OUString getBuildId() } -#if (defined LINUX || defined __sun) -OUString getBaseInstallation() -{ - OUString aPathVal("$BRAND_BASE_DIR"); - rtl::Bootstrap::expandMacros(aPathVal); - return aPathVal; -} -#endif - - bool isObsoleteUpdateInfo(std::u16string_view rBuildId) { return rBuildId != getBuildId() && !rBuildId.empty(); @@ -206,7 +195,7 @@ uno::Reference< beans::XPropertySet > createMenuBarUI( xServiceManager->createInstanceWithContext( "com.sun.star.setup.UpdateCheckUI", xContext ), uno::UNO_QUERY_THROW); - xMenuBarUI->setPropertyValue( PROPERTY_CLICK_HDL, uno::makeAny( xJob ) ); + xMenuBarUI->setPropertyValue( PROPERTY_CLICK_HDL, uno::Any( xJob ) ); return xMenuBarUI; } @@ -325,22 +314,6 @@ private: }; -class ShutdownThread : public osl::Thread -{ -public: - explicit ShutdownThread(const uno::Reference<uno::XComponentContext>& xContext); - - virtual void SAL_CALL run() override; - virtual void SAL_CALL onTerminated() override; - -protected: - virtual ~ShutdownThread() override; - -private: - osl::Condition m_aCondition; - const uno::Reference<uno::XComponentContext> m_xContext; -}; - UpdateCheckThread::UpdateCheckThread( osl::Condition& rCondition, const uno::Reference<uno::XComponentContext>& xContext, @@ -542,7 +515,7 @@ UpdateCheckThread::run() // Increase next by 15, 60, .. minutes static const sal_Int32 nRetryInterval[] = { 900, 3600, 14400, 86400 }; - if( n < SAL_N_ELEMENTS(nRetryInterval) ) + if( n < std::size(nRetryInterval) ) ++n; tv.Seconds = nRetryInterval[n-1]; @@ -650,15 +623,14 @@ DownloadThread::run() if( ! m_aDownload.start(m_aURL, aLocalFile, aDownloadDest ) ) { // retry every 15s unless the dialog is not visible - TimeValue tv; - tv.Seconds = 15; + TimeValue tv(15, 0); if( ! UpdateCheck::get()->isDialogShowing() ) { // Increase next by 1, 5, 15, 60, .. minutes static const sal_Int16 nRetryInterval[] = { 60, 300, 900, 3600 }; - if( n < SAL_N_ELEMENTS(nRetryInterval) ) + if( n < std::size(nRetryInterval) ) ++n; tv.Seconds = nRetryInterval[n-1]; @@ -700,45 +672,6 @@ void SAL_CALL DownloadThread::onTerminated() } -ShutdownThread::ShutdownThread( const uno::Reference<uno::XComponentContext>& xContext) : - m_xContext( xContext ) -{ - create(); -} - - -ShutdownThread::~ShutdownThread() -{ -} - - -void SAL_CALL -ShutdownThread::run() -{ - osl_setThreadName("ShutdownThread"); - - TimeValue tv = { 0, 250 }; - - m_aCondition.wait(&tv); - - // Tell QuickStarter not to veto .. - uno::Reference< css::beans::XFastPropertySet > xQuickStarter = css::office::Quickstart::createDefault(m_xContext); - - xQuickStarter->setFastPropertyValue(0, uno::makeAny(false)); - - // Shutdown the office - uno::Reference< frame::XDesktop2 > xDesktop = frame::Desktop::create(m_xContext); - - xDesktop->terminate(); -} - - -void SAL_CALL ShutdownThread::onTerminated() -{ - delete this; -} - - } // anonymous namespace UpdateCheck::UpdateCheck() @@ -909,50 +842,6 @@ UpdateCheck::download() void -UpdateCheck::install() -{ - std::scoped_lock aGuard(m_aMutex); - - const uno::Reference< c3s::XSystemShellExecute > xShellExecute = c3s::SystemShellExecute::create( m_xContext ); - - try { - // Construct install command ?? - - // Store release note for position 3 and 4 - OUString aURL(getReleaseNote(m_aUpdateInfo, 3)); - storeReleaseNote(1, aURL); - - aURL = getReleaseNote(m_aUpdateInfo, 4); - storeReleaseNote(2, aURL); - - OUString aInstallImage(m_aImageName); - osl::FileBase::getSystemPathFromFileURL(aInstallImage, aInstallImage); - - sal_Int32 nFlags; -#if (defined LINUX || defined __sun) - nFlags = 42; - OUString aParameter = getBaseInstallation(); - if( !aParameter.isEmpty() ) - osl::FileBase::getSystemPathFromFileURL(aParameter, aParameter); - - aParameter += " &"; -#else - nFlags = c3s::SystemShellExecuteFlags::DEFAULTS; - OUString const aParameter; -#endif - - rtl::Reference< UpdateCheckConfig > rModel = UpdateCheckConfig::get( m_xContext ); - rModel->clearLocalFileName(); - - xShellExecute->execute(aInstallImage, aParameter, nFlags); - new ShutdownThread( m_xContext ); - } catch(const uno::Exception&) { - m_aUpdateHandler->setErrorMessage( m_aUpdateHandler->getDefaultInstErrMsg() ); - } -} - - -void UpdateCheck::pause() { std::unique_lock aGuard(m_aMutex); @@ -1390,18 +1279,18 @@ void UpdateCheck::handleMenuBarUI( const rtl::Reference< UpdateHandler >& rUpdat { if( UPDATESTATE_NO_UPDATE_AVAIL == eState ) { - xMenuBarUI->setPropertyValue( PROPERTY_SHOW_MENUICON, uno::makeAny(false) ); + xMenuBarUI->setPropertyValue( PROPERTY_SHOW_MENUICON, uno::Any(false) ); } else { - xMenuBarUI->setPropertyValue( PROPERTY_TITLE, uno::makeAny(rUpdateHandler->getBubbleTitle(eState)) ); - xMenuBarUI->setPropertyValue( PROPERTY_TEXT, uno::makeAny(rUpdateHandler->getBubbleText(eState)) ); + xMenuBarUI->setPropertyValue( PROPERTY_TITLE, uno::Any(rUpdateHandler->getBubbleTitle(eState)) ); + xMenuBarUI->setPropertyValue( PROPERTY_TEXT, uno::Any(rUpdateHandler->getBubbleText(eState)) ); if( ! suppressBubble && ( ! rUpdateHandler->isVisible() || rUpdateHandler->isMinimized() ) ) - xMenuBarUI->setPropertyValue( PROPERTY_SHOW_BUBBLE, uno::makeAny( true ) ); + xMenuBarUI->setPropertyValue( PROPERTY_SHOW_BUBBLE, uno::Any( true ) ); if( UPDATESTATE_CHECKING != eState ) - xMenuBarUI->setPropertyValue( PROPERTY_SHOW_MENUICON, uno::makeAny(true) ); + xMenuBarUI->setPropertyValue( PROPERTY_SHOW_MENUICON, uno::Any(true) ); } } } @@ -1517,7 +1406,7 @@ UpdateCheck::storeReleaseNote(sal_Int8 nNum, const OUString &rURL) rc = aFile.open( osl_File_OpenFlag_Write | osl_File_OpenFlag_Create ); if ( rc != osl::FileBase::E_None ) return false; - OString aLineBuf("[InternetShortcut]\r\n"); + OString aLineBuf("[InternetShortcut]\r\n"_ostr); sal_uInt64 nWritten = 0; OUString aURL( rURL ); diff --git a/extensions/source/update/check/updatecheck.hxx b/extensions/source/update/check/updatecheck.hxx index 546616f574dd..7af355bc41ea 100644 --- a/extensions/source/update/check/updatecheck.hxx +++ b/extensions/source/update/check/updatecheck.hxx @@ -117,7 +117,6 @@ public: // IActionListener void cancel() override; void download() override; - void install() override; void pause() override; void resume() override; void closeAfterFailure() override; diff --git a/extensions/source/update/check/updatecheckconfig.cxx b/extensions/source/update/check/updatecheckconfig.cxx index 3c5f163b7226..52deb59528fb 100644 --- a/extensions/source/update/check/updatecheckconfig.cxx +++ b/extensions/source/update/check/updatecheckconfig.cxx @@ -75,10 +75,6 @@ const char * const aUpdateEntryProperties[] = { const sal_uInt32 nUpdateEntryProperties = SAL_N_ELEMENTS(aUpdateEntryProperties); -NamedValueByNameAccess::~NamedValueByNameAccess() -{ -} - css::uno::Any NamedValueByNameAccess::getValue(const char * pName) { const sal_Int32 nLen = m_rValues.getLength(); @@ -143,14 +139,14 @@ UpdateCheckROModel::getUpdateEntry(UpdateInfo& rInfo) const bool isDirectDownload = false; m_aNameAccess.getValue(IS_DIRECT_DOWNLOAD) >>= isDirectDownload; - rInfo.Sources.push_back( DownloadSource( isDirectDownload, getStringValue(DOWNLOAD_URL) ) ); + rInfo.Sources.emplace_back(isDirectDownload, getStringValue(DOWNLOAD_URL)); for(sal_Int32 n=1; n < 6; ++n ) { OUString aUStr = getStringValue( OString(OString::Concat(RELEASE_NOTE) + OString::number(n)).getStr()); if( !aUStr.isEmpty() ) - rInfo.ReleaseNotes.push_back(ReleaseNote(static_cast<sal_Int8>(n), aUStr)); + rInfo.ReleaseNotes.emplace_back(static_cast<sal_Int8>(n), aUStr); } } @@ -187,13 +183,13 @@ OUString UpdateCheckConfig::getAllUsersDirectory() OUString aRet; #ifdef _WIN32 - WCHAR szPath[MAX_PATH]; - - if (TRUE == SHGetSpecialFolderPathW(nullptr, szPath, CSIDL_COMMON_DOCUMENTS, true)) + PWSTR szPath = nullptr; + if (SUCCEEDED(SHGetKnownFolderPath(FOLDERID_PublicDocuments, KF_FLAG_CREATE, nullptr, &szPath))) { aRet = o3tl::toU(szPath); osl::FileBase::getFileURLFromSystemPath( aRet, aRet ); } + CoTaskMemFree(szPath); #else osl::FileBase::getTempDirURL(aRet); #endif @@ -226,8 +222,7 @@ UpdateCheckConfig::get( aProperty.Name = "nodepath"; aProperty.Value <<= OUString("org.openoffice.Office.Jobs/Jobs/UpdateCheck/Arguments"); - uno::Sequence< uno::Any > aArgumentList( 1 ); - aArgumentList[0] <<= aProperty; + uno::Sequence< uno::Any > aArgumentList{ uno::Any(aProperty) }; uno::Reference< container::XNameContainer > xContainer( xConfigProvider->createInstanceWithArguments( @@ -235,11 +230,11 @@ UpdateCheckConfig::get( uno::UNO_QUERY_THROW ); aProperty.Value <<= OUString("/org.openoffice.Office.ExtensionManager/ExtensionUpdateData/IgnoredUpdates"); - aArgumentList[0] <<= aProperty; + aArgumentList = { uno::Any(aProperty) }; uno::Reference< container::XNameContainer > xIgnoredExt( xConfigProvider->createInstanceWithArguments( "com.sun.star.configuration.ConfigurationUpdateAccess", aArgumentList ), uno::UNO_QUERY_THROW ); aProperty.Value <<= OUString("/org.openoffice.Office.ExtensionManager/ExtensionUpdateData/AvailableUpdates"); - aArgumentList[0] <<= aProperty; + aArgumentList = { uno::Any(aProperty) }; uno::Reference< container::XNameContainer > xUpdateAvail( xConfigProvider->createInstanceWithArguments( "com.sun.star.configuration.ConfigurationUpdateAccess", aArgumentList ), uno::UNO_QUERY_THROW ); return new UpdateCheckConfig( xContainer, xUpdateAvail, xIgnoredExt, rListener ); @@ -321,7 +316,7 @@ UpdateCheckConfig::storeLocalFileName(const OUString& rLocalFileName, sal_Int64 { const sal_uInt8 nItems = 2; const OUString aNameList[nItems] = { OUString(LOCAL_FILE), OUString(DOWNLOAD_SIZE) }; - const uno::Any aValueList[nItems] = { uno::makeAny(rLocalFileName), uno::makeAny(nFileSize) }; + const uno::Any aValueList[nItems] = { uno::Any(rLocalFileName), uno::Any(nFileSize) }; for( sal_uInt8 i=0; i < nItems; ++i ) { @@ -352,7 +347,7 @@ UpdateCheckConfig::clearLocalFileName() void UpdateCheckConfig::storeDownloadPaused(bool paused) { - replaceByName(DOWNLOAD_PAUSED , uno::makeAny(paused)); + replaceByName(DOWNLOAD_PAUSED , uno::Any(paused)); commitChanges(); } @@ -364,7 +359,7 @@ UpdateCheckConfig::updateLastChecked() sal_Int64 lastCheck = systime.Seconds; - replaceByName(LAST_CHECK, uno::makeAny(lastCheck)); + replaceByName(LAST_CHECK, uno::Any(lastCheck)); } void @@ -375,17 +370,17 @@ UpdateCheckConfig::storeUpdateFound( const UpdateInfo& rInfo, const OUString& aC uno::Any aValues[nUpdateEntryProperties] = { - uno::makeAny(rInfo.Version), - uno::makeAny(rInfo.BuildId), - uno::makeAny(rInfo.Description), - uno::makeAny(rInfo.Sources[0].URL), - uno::makeAny(rInfo.Sources[0].IsDirect), - uno::makeAny(getReleaseNote(rInfo, 1, autoDownloadEnabled) ), - uno::makeAny(getReleaseNote(rInfo, 2, autoDownloadEnabled) ), - uno::makeAny(getReleaseNote(rInfo, 3, autoDownloadEnabled) ), - uno::makeAny(getReleaseNote(rInfo, 4, autoDownloadEnabled) ), - uno::makeAny(getReleaseNote(rInfo, 5, autoDownloadEnabled) ), - uno::makeAny(aCurrentBuild) + uno::Any(rInfo.Version), + uno::Any(rInfo.BuildId), + uno::Any(rInfo.Description), + uno::Any(rInfo.Sources[0].URL), + uno::Any(rInfo.Sources[0].IsDirect), + uno::Any(getReleaseNote(rInfo, 1, autoDownloadEnabled) ), + uno::Any(getReleaseNote(rInfo, 2, autoDownloadEnabled) ), + uno::Any(getReleaseNote(rInfo, 3, autoDownloadEnabled) ), + uno::Any(getReleaseNote(rInfo, 4, autoDownloadEnabled) ), + uno::Any(getReleaseNote(rInfo, 5, autoDownloadEnabled) ), + uno::Any(aCurrentBuild) }; OUString aName; @@ -417,7 +412,7 @@ UpdateCheckConfig::clearUpdateFound() } catch(const lang::WrappedTargetException& ) { // Can not remove value, probably in share layer OSL_ASSERT(false); - m_xContainer->replaceByName(aName, uno::makeAny(OUString())); + m_xContainer->replaceByName(aName, uno::Any(OUString())); } } diff --git a/extensions/source/update/check/updatecheckconfig.hxx b/extensions/source/update/check/updatecheckconfig.hxx index 75e65e6e8be0..a9836c624822 100644 --- a/extensions/source/update/check/updatecheckconfig.hxx +++ b/extensions/source/update/check/updatecheckconfig.hxx @@ -40,8 +40,6 @@ public: const css::uno::Sequence< css::beans::NamedValue >& rValues) : m_rValues(rValues) {} ; - ~NamedValueByNameAccess(); - css::uno::Any getValue(const char * pName); }; diff --git a/extensions/source/update/check/updatecheckjob.cxx b/extensions/source/update/check/updatecheckjob.cxx index 82d2f7439ba2..b79c438108ee 100644 --- a/extensions/source/update/check/updatecheckjob.cxx +++ b/extensions/source/update/check/updatecheckjob.cxx @@ -30,7 +30,7 @@ #include <cppuhelper/implbase.hxx> #include <cppuhelper/supportsservice.hxx> -#include <tools/diagnose_ex.h> +#include <comphelper/diagnose_ex.hxx> #include <com/sun/star/frame/Desktop.hpp> #include <com/sun/star/frame/XTerminateListener.hpp> @@ -97,6 +97,8 @@ public: private: uno::Reference<uno::XComponentContext> m_xContext; + + std::mutex m_mutex; uno::Reference< frame::XDesktop2 > m_xDesktop; std::unique_ptr< InitUpdateCheckJobThread > m_pInitThread; @@ -205,10 +207,13 @@ UpdateCheckJob::execute(const uno::Sequence<beans::NamedValue>& namedValues) OUString aEventName = getValue< OUString > (aEnvironment, "EventName"); - m_pInitThread.reset( - new InitUpdateCheckJobThread( - m_xContext, aConfig, - aEventName != "onFirstVisibleTask")); + auto thread = std::make_unique<InitUpdateCheckJobThread >( + m_xContext, aConfig, + aEventName != "onFirstVisibleTask"); + { + std::scoped_lock l(m_mutex); + m_pInitThread = std::move(thread); + } return uno::Any(); } @@ -274,13 +279,18 @@ UpdateCheckJob::supportsService( OUString const & serviceName ) // XEventListener void SAL_CALL UpdateCheckJob::disposing( lang::EventObject const & rEvt ) { - bool shutDown = ( rEvt.Source == m_xDesktop ); + css::uno::Reference<css::frame::XDesktop2> desktop; + { + std::scoped_lock l(m_mutex); + if ( rEvt.Source == m_xDesktop ) { + std::swap(m_xDesktop, desktop); + } + } - if ( shutDown && m_xDesktop.is() ) + if ( desktop.is() ) { terminateAndJoinThread(); - m_xDesktop->removeTerminateListener( this ); - m_xDesktop.clear(); + desktop->removeTerminateListener( this ); } } @@ -292,11 +302,15 @@ void SAL_CALL UpdateCheckJob::queryTermination( lang::EventObject const & ) void UpdateCheckJob::terminateAndJoinThread() { - if (m_pInitThread != nullptr) + std::unique_ptr<InitUpdateCheckJobThread> thread; + { + std::scoped_lock l(m_mutex); + std::swap(m_pInitThread, thread); + } + if (thread != nullptr) { - m_pInitThread->setTerminating(); - m_pInitThread->join(); - m_pInitThread.reset(); + thread->setTerminating(); + thread->join(); } } diff --git a/extensions/source/update/check/updatehdl.cxx b/extensions/source/update/check/updatehdl.cxx index 16b94d6c9db0..a5c6429aee69 100644 --- a/extensions/source/update/check/updatehdl.cxx +++ b/extensions/source/update/check/updatehdl.cxx @@ -17,6 +17,9 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ +#include <sal/config.h> + +#include <cstddef> #include "updatehdl.hxx" #include <helpids.h> @@ -59,22 +62,22 @@ #include <strings.hrc> #include <unotools/resmgr.hxx> #include <tools/urlobj.hxx> -#include <tools/diagnose_ex.h> +#include <comphelper/diagnose_ex.hxx> -constexpr OUStringLiteral COMMAND_CLOSE = u"close"; +constexpr OUString COMMAND_CLOSE = u"close"_ustr; -constexpr OUStringLiteral CTRL_THROBBER = u"throbber"; -constexpr OUStringLiteral CTRL_PROGRESS = u"progress"; +constexpr OUString CTRL_THROBBER = u"throbber"_ustr; +constexpr OUString CTRL_PROGRESS = u"progress"_ustr; -constexpr OUStringLiteral TEXT_STATUS = u"text_status"; -constexpr OUStringLiteral TEXT_PERCENT = u"text_percent"; -constexpr OUStringLiteral TEXT_DESCRIPTION = u"text_description"; +constexpr OUString TEXT_STATUS = u"text_status"_ustr; +constexpr OUString TEXT_PERCENT = u"text_percent"_ustr; +constexpr OUString TEXT_DESCRIPTION = u"text_description"_ustr; constexpr OUStringLiteral FIXED_LINE_MODEL = u"com.sun.star.awt.UnoControlFixedLineModel"; -constexpr OUStringLiteral FIXED_TEXT_MODEL = u"com.sun.star.awt.UnoControlFixedTextModel"; -constexpr OUStringLiteral EDIT_FIELD_MODEL = u"com.sun.star.awt.UnoControlEditModel"; -constexpr OUStringLiteral BUTTON_MODEL = u"com.sun.star.awt.UnoControlButtonModel"; -constexpr OUStringLiteral GROUP_BOX_MODEL = u"com.sun.star.awt.UnoControlGroupBoxModel"; +constexpr OUString FIXED_TEXT_MODEL = u"com.sun.star.awt.UnoControlFixedTextModel"_ustr; +constexpr OUString EDIT_FIELD_MODEL = u"com.sun.star.awt.UnoControlEditModel"_ustr; +constexpr OUString BUTTON_MODEL = u"com.sun.star.awt.UnoControlButtonModel"_ustr; +constexpr OUString GROUP_BOX_MODEL = u"com.sun.star.awt.UnoControlGroupBoxModel"_ustr; using namespace com::sun::star; @@ -142,7 +145,7 @@ void UpdateHandler::setDownloadBtnLabel( bool bAppendDots ) aLabel += "..."; setControlProperty( msButtonIDs[DOWNLOAD_BUTTON], "Label", uno::Any( aLabel ) ); - setControlProperty( msButtonIDs[DOWNLOAD_BUTTON], "HelpURL", uno::makeAny<OUString>( INET_HID_SCHEME HID_CHECK_FOR_UPD_DOWNLOAD2 ) ); + setControlProperty( msButtonIDs[DOWNLOAD_BUTTON], "HelpURL", uno::Any(OUString( INET_HID_SCHEME + HID_CHECK_FOR_UPD_DOWNLOAD2 )) ); mbDownloadBtnHasDots = bAppendDots; } @@ -240,13 +243,13 @@ void UpdateHandler::setErrorMessage( const OUString& rErrorMsg ) } -void UpdateHandler::setDownloadFile( const OUString& rFilePath ) +void UpdateHandler::setDownloadFile( std::u16string_view rFilePath ) { - sal_Int32 nLast = rFilePath.lastIndexOf( '/' ); - if ( nLast != -1 ) + std::size_t nLast = rFilePath.rfind( '/' ); + if ( nLast != std::u16string_view::npos ) { - msDownloadFile = rFilePath.copy( nLast+1 ); - const OUString aDownloadURL = rFilePath.copy( 0, nLast ); + msDownloadFile = rFilePath.substr( nLast+1 ); + const OUString aDownloadURL(rFilePath.substr( 0, nLast )); osl::FileBase::getSystemPathFromFileURL( aDownloadURL, msDownloadPath ); } } @@ -284,15 +287,6 @@ OUString UpdateHandler::getBubbleTitle( UpdateState eState ) } -OUString UpdateHandler::getDefaultInstErrMsg() -{ - osl::MutexGuard aGuard( maMutex ); - - loadStrings(); - - return substVariables( msInstallError ); -} - // XActionListener void SAL_CALL UpdateHandler::disposing( const lang::EventObject& rEvt ) @@ -347,10 +341,6 @@ void SAL_CALL UpdateHandler::actionPerformed( awt::ActionEvent const & rEvent ) case DOWNLOAD_BUTTON: mxActionListener->download(); break; - case INSTALL_BUTTON: - if ( showWarning( msInstallMessage ) ) - mxActionListener->install(); - break; case PAUSE_BUTTON: mxActionListener->pause(); break; @@ -570,10 +560,8 @@ void UpdateHandler::updateState( UpdateState eState ) break; case UPDATESTATE_DOWNLOAD_AVAIL: showControls( 0 ); - enableControls( (1<<CLOSE_BUTTON) + (1<<INSTALL_BUTTON) ); setControlProperty( TEXT_STATUS, "Text", uno::Any( substVariables(msReady2Install) ) ); setControlProperty( TEXT_DESCRIPTION, "Text", uno::Any( substVariables(msDownloadDescr) ) ); - focusControl( INSTALL_BUTTON ); break; case UPDATESTATE_AUTO_START: case UPDATESTATES_COUNT: @@ -624,8 +612,6 @@ void UpdateHandler::loadStrings() msDownloading = loadString( loc, RID_UPDATE_STR_DOWNLOADING ); msReady2Install = loadString( loc, RID_UPDATE_STR_READY_INSTALL ); msCancelMessage = loadString( loc, RID_UPDATE_STR_CANCEL_DOWNLOAD ); - msInstallMessage = loadString( loc, RID_UPDATE_STR_BEGIN_INSTALL ); - msInstallError = loadString( loc, RID_UPDATE_STR_INSTALL_ERROR ); msOverwriteWarning = loadString( loc, RID_UPDATE_STR_OVERWRITE_WARNING ); msPercent = loadString( loc, RID_UPDATE_STR_PERCENT ); msReloadWarning = loadString( loc, RID_UPDATE_STR_RELOAD_WARNING ); @@ -637,7 +623,6 @@ void UpdateHandler::loadStrings() msClose = loadString( loc, RID_UPDATE_BTN_CLOSE ); msDownload = loadString( loc, RID_UPDATE_BTN_DOWNLOAD ); - msInstall = loadString( loc, RID_UPDATE_BTN_INSTALL ); msPauseBtn = loadString( loc, RID_UPDATE_BTN_PAUSE ); msResumeBtn = loadString( loc, RID_UPDATE_BTN_RESUME ); msCancelBtn = loadString( loc, RID_UPDATE_BTN_CANCEL ); @@ -782,8 +767,7 @@ void UpdateHandler::setFullVersion( OUString& rString ) aProperty.Name = "nodepath"; aProperty.Value <<= OUString("org.openoffice.Setup/Product"); - uno::Sequence< uno::Any > aArgumentList( 1 ); - aArgumentList[0] <<= aProperty; + uno::Sequence< uno::Any > aArgumentList{ uno::Any(aProperty) }; uno::Reference< uno::XInterface > xConfigAccess = xConfigurationProvider->createInstanceWithArguments( "com.sun.star.configuration.ConfigurationAccess", aArgumentList ); @@ -881,7 +865,7 @@ bool UpdateHandler::showWarning( const OUString &rWarningText, { uno::Sequence< uno::Reference< awt::XWindow > > xChildren = xMsgBoxCtrls->getWindows(); - for ( uno::Reference< awt::XWindow > const & child : std::as_const(xChildren) ) + for (uno::Reference<awt::XWindow> const& child : xChildren) { uno::Reference< awt::XVclWindowPeer > xMsgBoxCtrl( child, uno::UNO_QUERY ); if ( xMsgBoxCtrl.is() ) @@ -1033,7 +1017,7 @@ void UpdateHandler::createDialog() xPropSet->setPropertyValue( "PositionY", uno::Any(sal_Int32( 100 )) ); xPropSet->setPropertyValue( "Width", uno::Any(sal_Int32( DIALOG_WIDTH )) ); xPropSet->setPropertyValue( "Height", uno::Any(sal_Int32( DIALOG_HEIGHT )) ); - xPropSet->setPropertyValue( "HelpURL", uno::makeAny<OUString>( INET_HID_SCHEME HID_CHECK_FOR_UPD_DLG ) ); + xPropSet->setPropertyValue( "HelpURL", uno::Any(OUString( INET_HID_SCHEME + HID_CHECK_FOR_UPD_DLG )) ); } { // Label (fixed text) <status> uno::Sequence< beans::NamedValue > aProps { { "Label", uno::Any( msStatusFL ) } }; @@ -1058,7 +1042,7 @@ void UpdateHandler::createDialog() { "MultiLine", uno::Any( true ) }, { "ReadOnly", uno::Any( true ) }, { "AutoVScroll", uno::Any( true ) }, - { "HelpURL", uno::makeAny<OUString>( INET_HID_SCHEME HID_CHECK_FOR_UPD_STATUS ) } + { "HelpURL", uno::Any(OUString( INET_HID_SCHEME + HID_CHECK_FOR_UPD_STATUS )) } }; insertControlModel( xControlModel, EDIT_FIELD_MODEL, TEXT_STATUS, @@ -1091,7 +1075,7 @@ void UpdateHandler::createDialog() { "Enabled", uno::Any( true ) }, { "PushButtonType", uno::Any( sal_Int16(awt::PushButtonType_STANDARD) ) }, { "Label", uno::Any( msPauseBtn ) }, - { "HelpURL", uno::makeAny<OUString>( INET_HID_SCHEME HID_CHECK_FOR_UPD_PAUSE ) } + { "HelpURL", uno::Any(OUString( INET_HID_SCHEME + HID_CHECK_FOR_UPD_PAUSE )) } }; insertControlModel ( xControlModel, BUTTON_MODEL, msButtonIDs[PAUSE_BUTTON], @@ -1105,7 +1089,7 @@ void UpdateHandler::createDialog() { "Enabled", uno::Any( true ) }, { "PushButtonType", uno::Any( sal_Int16(awt::PushButtonType_STANDARD) ) }, { "Label", uno::Any( msResumeBtn ) }, - { "HelpURL", uno::makeAny<OUString>( INET_HID_SCHEME HID_CHECK_FOR_UPD_RESUME ) } + { "HelpURL", uno::Any(OUString( INET_HID_SCHEME + HID_CHECK_FOR_UPD_RESUME )) } }; insertControlModel ( xControlModel, BUTTON_MODEL, msButtonIDs[RESUME_BUTTON], @@ -1122,7 +1106,7 @@ void UpdateHandler::createDialog() { "Enabled", uno::Any( true ) }, { "PushButtonType", uno::Any( sal_Int16(awt::PushButtonType_STANDARD) ) }, { "Label", uno::Any( msCancelBtn ) }, - { "HelpURL", uno::makeAny<OUString>( INET_HID_SCHEME HID_CHECK_FOR_UPD_CANCEL ) } + { "HelpURL", uno::Any(OUString( INET_HID_SCHEME + HID_CHECK_FOR_UPD_CANCEL )) } }; insertControlModel ( xControlModel, BUTTON_MODEL, msButtonIDs[CANCEL_BUTTON], @@ -1155,7 +1139,7 @@ void UpdateHandler::createDialog() { "MultiLine", uno::Any( true ) }, { "ReadOnly", uno::Any( true ) }, { "AutoVScroll", uno::Any( true ) }, - { "HelpURL", uno::makeAny<OUString>( INET_HID_SCHEME HID_CHECK_FOR_UPD_DESCRIPTION ) } + { "HelpURL", uno::Any(OUString( INET_HID_SCHEME + HID_CHECK_FOR_UPD_DESCRIPTION )) } }; insertControlModel( xControlModel, EDIT_FIELD_MODEL, TEXT_DESCRIPTION, @@ -1184,27 +1168,13 @@ void UpdateHandler::createDialog() // setProperty( aProps, 2, "PushButtonType", uno::Any( sal_Int16(awt::PushButtonType_CANCEL) ) ); // [property] string Label // only if PushButtonType_STANDARD { "Label", uno::Any( msClose ) }, - { "HelpURL", uno::makeAny<OUString>( INET_HID_SCHEME HID_CHECK_FOR_UPD_CLOSE ) } + { "HelpURL", uno::Any(OUString( INET_HID_SCHEME + HID_CHECK_FOR_UPD_CLOSE )) } }; insertControlModel ( xControlModel, BUTTON_MODEL, msButtonIDs[ CLOSE_BUTTON ], awt::Rectangle( CLOSE_BTN_X, BUTTON_Y_POS, BUTTON_WIDTH, BUTTON_HEIGHT ), aProps ); } - { // install button - uno::Sequence< beans::NamedValue > aProps - { - { "DefaultButton", uno::Any( false ) }, - { "Enabled", uno::Any( true ) }, - { "PushButtonType", uno::Any( sal_Int16(awt::PushButtonType_STANDARD) ) }, - { "Label", uno::Any( msInstall ) }, - { "HelpURL", uno::makeAny<OUString>( INET_HID_SCHEME HID_CHECK_FOR_UPD_INSTALL ) } - }; - - insertControlModel ( xControlModel, BUTTON_MODEL, msButtonIDs[INSTALL_BUTTON], - awt::Rectangle( INSTALL_BTN_X, BUTTON_Y_POS, BUTTON_WIDTH, BUTTON_HEIGHT ), - aProps ); - } { // download button uno::Sequence< beans::NamedValue > aProps { @@ -1212,7 +1182,7 @@ void UpdateHandler::createDialog() { "Enabled", uno::Any( true ) }, { "PushButtonType", uno::Any( sal_Int16(awt::PushButtonType_STANDARD) ) }, { "Label", uno::Any( msDownload ) }, - { "HelpURL", uno::makeAny<OUString>( INET_HID_SCHEME HID_CHECK_FOR_UPD_DOWNLOAD ) } + { "HelpURL", uno::Any(OUString( INET_HID_SCHEME + HID_CHECK_FOR_UPD_DOWNLOAD )) } }; insertControlModel ( xControlModel, BUTTON_MODEL, msButtonIDs[DOWNLOAD_BUTTON], diff --git a/extensions/source/update/check/updatehdl.hxx b/extensions/source/update/check/updatehdl.hxx index 6597176468bd..aa4e16fc765b 100644 --- a/extensions/source/update/check/updatehdl.hxx +++ b/extensions/source/update/check/updatehdl.hxx @@ -46,7 +46,6 @@ enum DialogControls CANCEL_BUTTON = 0, PAUSE_BUTTON, RESUME_BUTTON, - INSTALL_BUTTON, DOWNLOAD_BUTTON, CLOSE_BUTTON, HELP_BUTTON, @@ -111,8 +110,6 @@ private: OUString msDownloading; // RID_UPDATE_STR_DOWNLOADING OUString msReady2Install; // RID_UPDATE_STR_READY_INSTALL OUString msCancelMessage; // RID_UPDATE_STR_CANCEL_DOWNLOAD - OUString msInstallMessage; // RID_UPDATE_STR_BEGIN_INSTALL - OUString msInstallError; // RID_UPDATE_STR_INSTALL_ERROR OUString msOverwriteWarning; // RID_UPDATE_STR_OVERWRITE_WARNING OUString msPercent; // RID_UPDATE_STR_PERCENT OUString msReloadWarning; // RID_UPDATE_STR_OVERWRITE_WARNING @@ -122,7 +119,6 @@ private: OUString msDescription; // RID_UPDATE_FT_DESCRIPTION OUString msClose; // RID_UPDATE_BTN_CLOSE OUString msDownload; // RID_UPDATE_BTN_DOWNLOAD - OUString msInstall; // RID_UPDATE_BTN_INSTALL OUString msPauseBtn; // RID_UPDATE_BTN_PAUSE OUString msResumeBtn; // RID_UPDATE_BTN_RESUME OUString msCancelBtn; // RID_UPDATE_BTN_CANCEL @@ -166,14 +162,13 @@ public: void setProgress( sal_Int32 nPercent ); void setNextVersion( const OUString &rNextVersion ) { msNextVersion = rNextVersion; } void setDownloadPath( const OUString &rPath ) { msDownloadPath = rPath; } - void setDownloadFile( const OUString &rPath ); + void setDownloadFile( std::u16string_view rPath ); void setErrorMessage( const OUString &rErrorMsg ); void setDescription( const OUString &rDescription ){ msDescriptionMsg = rDescription; } void setState( UpdateState eState ); OUString getBubbleText( UpdateState eState ); OUString getBubbleTitle( UpdateState eState ); - OUString getDefaultInstErrMsg(); bool showWarning( const OUString &rWarning ) const; bool showWarning( const OUString &rWarning, const OUString& rBtnText_1, const OUString& rBtnText_2 ) const; bool showOverwriteWarning( std::u16string_view rFileName ) const; diff --git a/extensions/source/update/check/updateprotocol.cxx b/extensions/source/update/check/updateprotocol.cxx index a2da6a82c716..2fb6be85286a 100644 --- a/extensions/source/update/check/updateprotocol.cxx +++ b/extensions/source/update/check/updateprotocol.cxx @@ -61,8 +61,7 @@ getBootstrapData( if( !aValue.isEmpty() ) { - rRepositoryList.realloc(1); - rRepositoryList[0] = aValue; + rRepositoryList = { aValue }; } return true; @@ -164,7 +163,7 @@ checkForUpdates( OUString aType = xParent->getAttribute("type"); bool bIsDirect = !aType.equalsIgnoreAsciiCase("text/html"); - o_rUpdateInfo.Sources.push_back( DownloadSource(bIsDirect, xNode2->getNodeValue()) ); + o_rUpdateInfo.Sources.emplace_back(bIsDirect, xNode2->getNodeValue()); } } diff --git a/extensions/source/update/feed/updatefeed.cxx b/extensions/source/update/feed/updatefeed.cxx index 142bd301cffa..556955b7123c 100644 --- a/extensions/source/update/feed/updatefeed.cxx +++ b/extensions/source/update/feed/updatefeed.cxx @@ -53,6 +53,7 @@ #include <sal/log.hxx> #include <osl/diagnose.h> #include <osl/conditn.hxx> +#include <utility> #include <vcl/svapp.hxx> namespace beans = com::sun::star::beans ; @@ -69,7 +70,7 @@ namespace xml = com::sun::star::xml ; namespace { -#ifdef DEBUG +#if OSL_DEBUG_LEVEL >= 2 class InputStreamWrapper : public ::cppu::WeakImplHelper< io::XInputStream > { @@ -159,10 +160,10 @@ public: virtual sal_Bool SAL_CALL supportsService(OUString const & serviceName) override; virtual uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override; - UpdateInformationProvider(const uno::Reference<uno::XComponentContext>& xContext, - const uno::Reference< ucb::XUniversalContentBroker >& xUniversalContentBroker, - const uno::Reference< xml::dom::XDocumentBuilder >& xDocumentBuilder, - const uno::Reference< xml::xpath::XXPathAPI >& xXPathAPI); + UpdateInformationProvider(uno::Reference<uno::XComponentContext> xContext, + uno::Reference< ucb::XUniversalContentBroker > xUniversalContentBroker, + uno::Reference< xml::dom::XDocumentBuilder > xDocumentBuilder, + uno::Reference< xml::xpath::XXPathAPI > xXPathAPI); protected: @@ -199,8 +200,8 @@ class UpdateInformationEnumeration : public ::cppu::WeakImplHelper< container::X { public: UpdateInformationEnumeration(const uno::Reference< xml::dom::XNodeList >& xNodeList, - const rtl::Reference< UpdateInformationProvider >& xUpdateInformationProvider) : - m_xUpdateInformationProvider(xUpdateInformationProvider), + rtl::Reference< UpdateInformationProvider > xUpdateInformationProvider) : + m_xUpdateInformationProvider(std::move(xUpdateInformationProvider)), m_xNodeList(xNodeList), m_nNodes(xNodeList.is() ? xNodeList->getLength() : 0), m_nCount(0) @@ -236,7 +237,7 @@ public: if( xContentNode.is() ) aEntry.UpdateDocument = m_xUpdateInformationProvider->getDocumentRoot(xContentNode); - return uno::makeAny(aEntry); + return uno::Any(aEntry); } catch( ucb::CommandAbortedException const &) { @@ -279,7 +280,7 @@ public: throw container::NoSuchElementException(OUString::number(m_nCount), *this); ++m_nCount; - return uno::makeAny(m_aEntry); + return uno::Any(m_aEntry); }; private: @@ -288,22 +289,23 @@ private: }; UpdateInformationProvider::UpdateInformationProvider( - const uno::Reference<uno::XComponentContext>& xContext, - const uno::Reference< ucb::XUniversalContentBroker >& xUniversalContentBroker, - const uno::Reference< xml::dom::XDocumentBuilder >& xDocumentBuilder, - const uno::Reference< xml::xpath::XXPathAPI >& xXPathAPI) - : m_xContext(xContext) - , m_xUniversalContentBroker(xUniversalContentBroker) - , m_xDocumentBuilder(xDocumentBuilder) - , m_xXPathAPI(xXPathAPI) + uno::Reference<uno::XComponentContext> xContext, + uno::Reference< ucb::XUniversalContentBroker > xUniversalContentBroker, + uno::Reference< xml::dom::XDocumentBuilder > xDocumentBuilder, + uno::Reference< xml::xpath::XXPathAPI > xXPathAPI) + : m_xContext(std::move(xContext)) + , m_xUniversalContentBroker(std::move(xUniversalContentBroker)) + , m_xDocumentBuilder(std::move(xDocumentBuilder)) + , m_xXPathAPI(std::move(xXPathAPI)) , m_aRequestHeaderList(2) , m_nCommandId(0) { uno::Reference< lang::XMultiServiceFactory > xConfigurationProvider( css::configuration::theDefaultProvider::get(m_xContext)); - m_aRequestHeaderList[0].First = "Accept-Language"; - m_aRequestHeaderList[0].Second = getConfigurationItem( xConfigurationProvider, "org.openoffice.Setup/L10N", "ooLocale" ); + auto pRequestHeaderList = m_aRequestHeaderList.getArray(); + pRequestHeaderList[0].First = "Accept-Language"; + pRequestHeaderList[0].Second = getConfigurationItem( xConfigurationProvider, "org.openoffice.Setup/L10N", "ooLocale" ); } bool @@ -363,7 +365,9 @@ OUString UpdateInformationProvider::getUserAgent(bool bExtended) aUserAgent = aUserAgent.replaceAll("<PRODUCT>", product); aUserAgent = aUserAgent.replaceAll("<OPTIONAL_OS_HW_DATA>", aExtended); SAL_INFO("extensions.update", "UpdateUserAgent: " << aUserAgent); - + // if you want to debug online updates from a dev version, then uncommenting this (adjust for platform) + // might be helpful + // return "LibreOffice 7.3.5.2 (184fe81b8c8c30d8b5082578aee2fed2ea847c01; Linux; X86_64; )"; return aUserAgent; } @@ -385,8 +389,9 @@ uno::Sequence< beans::StringPair > SAL_CALL UpdateInformationProvider::getUserRe aPair.realloc(1); else { - aPair[1].First = "User-Agent"; - aPair[1].Second = aUserAgent; + auto pPair = aPair.getArray(); + pPair[1].First = "User-Agent"; + pPair[1].Second = aUserAgent; } return aPair; @@ -403,9 +408,7 @@ UpdateInformationProvider::getConfigurationItemAny(uno::Reference<lang::XMultiSe aProperty.Name = "nodepath"; aProperty.Value <<= node; - uno::Sequence< uno::Any > aArgumentList( 1 ); - aArgumentList[0] <<= aProperty; - + uno::Sequence< uno::Any > aArgumentList{ uno::Any(aProperty) }; uno::Reference< container::XNameAccess > xNameAccess( configurationProvider->createInstanceWithArguments( "com.sun.star.configuration.ConfigurationAccess", @@ -446,15 +449,13 @@ UpdateInformationProvider::load(const OUString& rURL) uno::Reference< ucb::XCommandProcessor > xCommandProcessor(m_xUniversalContentBroker->queryContent(xId), uno::UNO_QUERY_THROW); rtl::Reference< ActiveDataSink > aSink(new ActiveDataSink()); - // Disable KeepAlive in webdav - don't want millions of office - // instances phone home & clog up servers - uno::Sequence< beans::NamedValue > aProps { { "KeepAlive", uno::makeAny(false) } }; - ucb::OpenCommandArgument3 aOpenArgument; aOpenArgument.Mode = ucb::OpenMode::DOCUMENT; aOpenArgument.Priority = 32768; aOpenArgument.Sink = *aSink; - aOpenArgument.OpeningFlags = aProps; + // Disable KeepAlive in webdav - don't want millions of office + // instances phone home & clog up servers + aOpenArgument.OpeningFlags = { { "KeepAlive", uno::Any(false) } }; ucb::Command aCommand; aCommand.Name = "open"; diff --git a/extensions/source/update/ui/updatecheckui.cxx b/extensions/source/update/ui/updatecheckui.cxx index fbed068c3b4d..492cb92669ab 100644 --- a/extensions/source/update/ui/updatecheckui.cxx +++ b/extensions/source/update/ui/updatecheckui.cxx @@ -29,23 +29,22 @@ #include <com/sun/star/graphic/XGraphicProvider.hpp> #include <com/sun/star/task/XJob.hpp> #include <comphelper/processfactory.hxx> +#include <comphelper/propertyvalue.hxx> #include <unotools/resmgr.hxx> #include <vcl/image.hxx> #include <vcl/menubarupdateicon.hxx> -#include <vcl/settings.hxx> #include <vcl/svapp.hxx> #include <vcl/weld.hxx> #include <sfx2/strings.hrc> -#include <rtl/ustrbuf.hxx> #include <bitmaps.hlst> -constexpr OUStringLiteral PROPERTY_TITLE = u"BubbleHeading"; -constexpr OUStringLiteral PROPERTY_TEXT = u"BubbleText"; -constexpr OUStringLiteral PROPERTY_IMAGE = u"BubbleImageURL"; -constexpr OUStringLiteral PROPERTY_SHOW_BUBBLE = u"BubbleVisible"; -constexpr OUStringLiteral PROPERTY_CLICK_HDL = u"MenuClickHDL"; -constexpr OUStringLiteral PROPERTY_SHOW_MENUICON = u"MenuIconVisible"; +constexpr OUString PROPERTY_TITLE = u"BubbleHeading"_ustr; +constexpr OUString PROPERTY_TEXT = u"BubbleText"_ustr; +constexpr OUString PROPERTY_IMAGE = u"BubbleImageURL"_ustr; +constexpr OUString PROPERTY_SHOW_BUBBLE = u"BubbleVisible"_ustr; +constexpr OUString PROPERTY_CLICK_HDL = u"MenuClickHDL"_ustr; +constexpr OUString PROPERTY_SHOW_MENUICON = u"MenuIconVisible"_ustr; using namespace ::com::sun::star; @@ -140,10 +139,8 @@ Image UpdateCheckUI::GetBubbleImage( OUString const &rURL ) try { uno::Reference< graphic::XGraphicProvider > xGraphProvider(graphic::GraphicProvider::create(xContext)); - uno::Sequence< beans::PropertyValue > aMediaProps( 1 ); - aMediaProps[0].Name = "URL"; - aMediaProps[0].Value <<= rURL; - + uno::Sequence< beans::PropertyValue > aMediaProps{ comphelper::makePropertyValue("URL", + rURL) }; uno::Reference< graphic::XGraphic > xGraphic = xGraphProvider->queryGraphic( aMediaProps ); if ( xGraphic.is() ) { @@ -166,9 +163,7 @@ void SAL_CALL UpdateCheckUI::documentEventOccured(const document::DocumentEvent& SolarMutexGuard aGuard; if( rEvent.EventName == "OnPrepareViewClosing" ) - { - maBubbleManager.RemoveBubbleWindow(true); - } + maBubbleManager.RemoveBubbleWindow(); } void SAL_CALL UpdateCheckUI::disposing(const lang::EventObject&) diff --git a/extensions/test/ole/AxTestComponents/Basic.cpp b/extensions/test/ole/AxTestComponents/Basic.cpp index 8aad56e8af52..6195aba0a6f0 100644 --- a/extensions/test/ole/AxTestComponents/Basic.cpp +++ b/extensions/test/ole/AxTestComponents/Basic.cpp @@ -116,34 +116,26 @@ STDMETHODIMP CBasic::inObject(IDispatch *val) STDMETHODIMP CBasic::inoutBool(VARIANT_BOOL* val) { - VARIANT_BOOL aBool = *val; - *val = m_bool; - m_bool = aBool; + std::swap(*val, m_bool); return S_OK; } STDMETHODIMP CBasic::inoutByte(unsigned char* val) { - unsigned char aByte = *val; - *val = m_byte; - m_byte = aByte; + std::swap(*val, m_byte); return S_OK; } STDMETHODIMP CBasic::inoutShort(short *val) { - short aShort = *val; - *val = m_short; - m_short = aShort; + std::swap(*val, m_short); return S_OK; } STDMETHODIMP CBasic::inoutLong(long *val) { - long aLong = *val; - *val = m_long; - m_long = aLong; + std::swap(*val, m_long); return S_OK; } @@ -159,17 +151,13 @@ STDMETHODIMP CBasic::inoutString(BSTR *val) STDMETHODIMP CBasic::inoutFloat(float *val) { - float aFloat = *val; - *val = m_float; - m_float = aFloat; + std::swap(*val, m_float); return S_OK; } STDMETHODIMP CBasic::inoutDouble(double *val) { - double aDouble = *val; - *val = m_double; - m_double = aDouble; + std::swap(*val, m_double); return S_OK; } @@ -1033,9 +1021,7 @@ STDMETHODIMP CBasic::outCurrency(CY* val) STDMETHODIMP CBasic::inoutCurrency(CY* val) { - CY tmp = *val; - *val = m_cy; - m_cy = tmp; + std::swap(*val, m_cy); return S_OK; } @@ -1053,9 +1039,7 @@ STDMETHODIMP CBasic::outDate(DATE* val) STDMETHODIMP CBasic::inoutDate(DATE* val) { - DATE tmp = *val; - *val = m_date; - m_date = tmp; + std::swap(*val, m_date); return S_OK; } @@ -1098,10 +1082,7 @@ STDMETHODIMP CBasic::outDecimal(DECIMAL* val) STDMETHODIMP CBasic::inoutDecimal(DECIMAL* val) { - DECIMAL tmp; - tmp = * val; - * val = m_decimal; - m_decimal = tmp; + std::swap(*val, m_decimal); return S_OK; } @@ -1131,9 +1112,7 @@ STDMETHODIMP CBasic::outScode(SCODE* val) STDMETHODIMP CBasic::inoutSCode(SCODE* val) { - SCODE tmp = *val; - * val = m_scode; - m_scode = tmp; + std::swap(*val, m_scode); return S_OK; } @@ -1302,9 +1281,7 @@ STDMETHODIMP CBasic::prpMultiArg2GetValues(VARIANT* val1, VARIANT* valProperty) STDMETHODIMP CBasic::get_prpMultiArg3(LONG* val1, LONG* pVal) { - long aLong = *val1; - *val1 = m_long; - m_long = aLong; + std::swap(*val1, m_long); * pVal = m_long2; return S_OK; @@ -1312,9 +1289,7 @@ STDMETHODIMP CBasic::get_prpMultiArg3(LONG* val1, LONG* pVal) STDMETHODIMP CBasic::put_prpMultiArg3(LONG* val1, LONG newVal) { - long aLong = *val1; - *val1 = m_long; - m_long = aLong; + std::swap(*val1, m_long); m_long2 = newVal; return S_OK; diff --git a/extensions/test/ole/VisualBasic/Module1.vb b/extensions/test/ole/VisualBasic/Module1.vb index 63b8bbdeb17f..56b83beb3cea 100644 --- a/extensions/test/ole/VisualBasic/Module1.vb +++ b/extensions/test/ole/VisualBasic/Module1.vb @@ -477,14 +477,14 @@ Public Sub Main() objOleTest2.AttrAny2 = "VBString "
'testinout_methodXInterfaces substitutes the argument with the object set in in_methodXInterface
- objOleTest.AttrAny2 = "VBString this string was written in the UNO component to the inout pararmeter"
+ objOleTest.AttrAny2 = "VBString this string was written in the UNO component to the inout parameter"
objOleTest.in_methodXInterface(objOleTest)
objOleTest.testinout_methodXInterface2(objOleTest2)
Dim tmpVar As Object
tmpVar = System.DBNull.Value
tmpVar = objOleTest2.AttrAny2
Debug.Print("in: Uno out: the same object // " & CStr(tmpVar))
- If tmpVar <> "VBString this string was written in the UNO component to the inout pararmeter" Then
+ If tmpVar <> "VBString this string was written in the UNO component to the inout parameter" Then
MsgBox("error")
End If
diff --git a/extensions/test/ole/cpnt/cpnt.cxx b/extensions/test/ole/cpnt/cpnt.cxx index 3369e03d644b..ec7bac088b59 100644 --- a/extensions/test/ole/cpnt/cpnt.cxx +++ b/extensions/test/ole/cpnt/cpnt.cxx @@ -25,7 +25,7 @@ #include <stdio.h> #include <com/sun/star/lang/XMultiServiceFactory.hpp> #include <com/sun/star/registry/XRegistryKey.hpp> -#include <tools/diagnose_ex.h> +#include <comphelper/diagnose_ex.hxx> #include <uno/environment.h> #include <comphelper/processfactory.hxx> #include <cppuhelper/factory.hxx> @@ -390,88 +390,88 @@ extern "C" SAL_DLLPUBLIC_EXPORT void * SAL_CALL component_getFactory( Sequence<sal_Int8> SAL_CALL OComponent::methodByte(const Sequence< sal_Int8 >& aSeq) throw( RuntimeException ) { sal_Int8 _x; - for( sal_Int16 i= 0; i < aSeq.getLength(); i++){ - _x= aSeq.getConstArray()[i]; + for( const auto& i : aSeq.getConstArray() ){ + _x= i; } return aSeq; } Sequence<float> SAL_CALL OComponent::methodFloat(const Sequence< float>& aSeq) throw( RuntimeException ) { float _x; - for( sal_Int16 i= 0; i < aSeq.getLength(); i++){ - _x= aSeq.getConstArray()[i]; + for( const auto& i : aSeq.getConstArray() ){ + _x= i; } return aSeq; } Sequence<double> SAL_CALL OComponent::methodDouble(const Sequence< double >& aSeq) throw( RuntimeException) { double _x; - for( sal_Int16 i= 0; i < aSeq.getLength(); i++){ - _x= aSeq.getConstArray()[i]; + for( const auto& i : aSeq.getConstArray() ){ + _x= i; } return aSeq; } Sequence< sal_Bool > SAL_CALL OComponent::methodBool(const Sequence< sal_Bool >& aSeq) throw( RuntimeException) { sal_Bool _x; - for( sal_Int16 i= 0; i < aSeq.getLength(); i++){ - _x= aSeq.getConstArray()[i]; + for( const auto& i : aSeq.getConstArray() ){ + _x= i; } return aSeq; } Sequence< sal_Int16 > SAL_CALL OComponent::methodShort(const Sequence< sal_Int16 >& aSeq) throw( RuntimeException ) { sal_Int16 _x; - for( sal_Int16 i= 0; i < aSeq.getLength(); i++){ - _x= aSeq.getConstArray()[i]; + for( const auto& i : aSeq.getConstArray() ){ + _x= i; } return aSeq; } Sequence< sal_uInt16 > SAL_CALL OComponent::methodUShort(const Sequence< sal_uInt16 >& aSeq) throw( RuntimeException ) { sal_uInt16 _x; - for( sal_Int16 i= 0; i < aSeq.getLength(); i++){ - _x= aSeq.getConstArray()[i]; + for( const auto& i : aSeq.getConstArray() ){ + _x= i; } return aSeq; } Sequence< sal_Int32 > SAL_CALL OComponent::methodLong(const Sequence< sal_Int32 >& aSeq) throw( RuntimeException) { sal_Int32 _x; - for( sal_Int16 i= 0; i < aSeq.getLength(); i++) { - _x= aSeq.getConstArray()[i]; + for( const auto& i : aSeq.getConstArray() ){ + _x= i; } return aSeq; } Sequence< sal_uInt32 > SAL_CALL OComponent::methodULong(const Sequence< sal_uInt32 >& aSeq) throw( RuntimeException) { sal_uInt32 _x; - for( sal_Int16 i= 0; i < aSeq.getLength(); i++){ - _x= aSeq.getConstArray()[i]; + for( const auto& i : aSeq.getConstArray() ){ + _x= i; } return aSeq; } Sequence< OUString > SAL_CALL OComponent::methodString(const Sequence< OUString >& aSeq) throw( RuntimeException) { OUString _x; - for( sal_Int16 i= 0; i < aSeq.getLength(); i++) { - _x= aSeq.getConstArray()[i]; + for( const auto& i : aSeq.getConstArray() ){ + _x= i; } return aSeq; } Sequence< sal_Unicode > SAL_CALL OComponent::methodChar(const Sequence< sal_Unicode >& aSeq) throw( RuntimeException) { sal_Unicode _x; - for( sal_Int16 i= 0; i < aSeq.getLength(); i++){ - _x= aSeq.getConstArray()[i]; + for( const auto& i : aSeq.getConstArray() ){ + _x= i; } return aSeq; } Sequence< Any > SAL_CALL OComponent::methodAny(const Sequence< Any >& aSeq) throw( RuntimeException) { Any _x; - for( sal_Int16 i= 0; i < aSeq.getLength(); i++){ - _x= aSeq.getConstArray()[i]; + for( const auto& i : aSeq.getConstArray() ){ + _x= i; TypeClass _t= _x.getValueTypeClass(); if( _t== TypeClass_STRING) OUString s(* (rtl_uString**)_x.getValue()); @@ -483,8 +483,8 @@ Sequence< Any > SAL_CALL OComponent::methodAny(const Sequence< Any >& aSeq) thro Sequence< Type > SAL_CALL OComponent::methodType(const Sequence< Type >& aSeq) throw( RuntimeException ) { Type _x; - for( sal_Int16 i= 0; i < aSeq.getLength(); i++){ - _x= aSeq.getConstArray()[i]; + for( const auto& i : aSeq.getConstArray() ){ + _x= i; } return aSeq; } @@ -1076,93 +1076,61 @@ void SAL_CALL OComponent::in_methodAll( // INOUT ----------------------------------------------------------------------------------- void SAL_CALL OComponent::testinout_methodByte(sal_Int8& rOut) throw( RuntimeException ) { - sal_Int8 tmp = rOut; - rOut = m_int8; - m_int8 = tmp; + std::swap( m_int8, rOut ); } void SAL_CALL OComponent::testinout_methodFloat(float& rOut) throw( RuntimeException ) { - float tmp = rOut; - rOut = m_float; - m_float = tmp; + std::swap( m_float, rOut ); } - void SAL_CALL OComponent::testinout_methodDouble(double& rOut) throw( RuntimeException ) { - double tmp = rOut; - rOut = m_double; - m_double = tmp; + std::swap( m_double, rOut ); } void SAL_CALL OComponent::testinout_methodBool(sal_Bool& rOut) throw( RuntimeException ) { - sal_Bool tmp = rOut; - rOut = m_bool; - m_bool = tmp; + std::swap( m_bool, rOut ); } void SAL_CALL OComponent::testinout_methodShort(sal_Int16& rOut) throw( RuntimeException ) { - sal_Int16 tmp= rOut; - rOut = m_int16; - m_int16 = tmp; + std::swap( m_int16, rOut ); } void SAL_CALL OComponent::testinout_methodUShort(sal_uInt16& rOut) throw( RuntimeException ) { - sal_uInt16 tmp = rOut; - rOut = m_uint16; - m_uint16 = tmp; + std::swap( m_uint16, rOut ); } void SAL_CALL OComponent::testinout_methodLong(sal_Int32& rOut) throw( RuntimeException ) { - sal_Int32 tmp = rOut; - rOut = m_int32; - m_int32 = tmp; + std::swap( m_int32, rOut ); } void SAL_CALL OComponent::testinout_methodULong(sal_uInt32& rOut) throw( RuntimeException ) { - sal_uInt32 tmp = rOut; - rOut = m_uint32; - m_uint32 = tmp; + std::swap( m_uint32, rOut ); } void SAL_CALL OComponent::testinout_methodHyper(sal_Int64& rOut) throw( RuntimeException ) { - sal_Int64 tmp = rOut; - rOut = m_int64; - m_int64 = tmp; + std::swap( m_int64, rOut ); } - void SAL_CALL OComponent::testinout_methodUHyper(sal_uInt64& rOut) throw( RuntimeException ) { - sal_uInt64 tmp = rOut; - rOut = m_uint64; - m_uint64 = tmp; + std::swap( m_uint64, rOut ); } - void SAL_CALL OComponent::testinout_methodString(OUString& rOut) throw( RuntimeException ) { - OUString tmp = rOut; - rOut = m_string; - m_string = tmp; + std::swap( m_string, rOut ); } void SAL_CALL OComponent::testinout_methodChar(sal_Unicode& rOut) throw( RuntimeException) { - sal_Unicode tmp = rOut; - rOut = m_char; - m_char = tmp; + std::swap( m_char, rOut ); } void SAL_CALL OComponent::testinout_methodAny(Any& rOut) throw( RuntimeException) { - Any tmp = rOut; - rOut = m_any; - m_any = tmp; + std::swap( m_any, rOut ); } void SAL_CALL OComponent::testinout_methodType(Type& rOut) throw( RuntimeException) { - Type tmp = rOut; - rOut = m_type; - m_type = tmp; + std::swap( m_type, rOut ); } - void SAL_CALL OComponent::testinout_methodSequence(Sequence< sal_Int32 >& rOut) throw( RuntimeException) { diff --git a/extensions/test/ole/idl/oletest.idl b/extensions/test/ole/idl/oletest.idl index b23f20b21a65..a004fc84b3b6 100644 --- a/extensions/test/ole/idl/oletest.idl +++ b/extensions/test/ole/idl/oletest.idl @@ -17,11 +17,6 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#include <com/sun/star/uno/XInterface.idl> -#include <com/sun/star/script/XInvocation.idl> -#include <com/sun/star/beans/XPropertySet.idl> -#include <com/sun/star/lang/XEventListener.idl> - module oletest { diff --git a/extensions/uiconfig/sabpilot/ui/datasourcepage.ui b/extensions/uiconfig/sabpilot/ui/datasourcepage.ui index 942653057d24..3a5ef24196e6 100644 --- a/extensions/uiconfig/sabpilot/ui/datasourcepage.ui +++ b/extensions/uiconfig/sabpilot/ui/datasourcepage.ui @@ -131,7 +131,7 @@ Now, just enter the name under which you want to register the data source in %PR <property name="draw_indicator">True</property> <child internal-child="accessible"> <object class="AtkObject" id="available-atkobject"> - <property name="AtkObject::accessible-description" translatable="yes" context="datasourcepage|extended_tip|available">Registers the newly created database file in %PRODUCTNAME. The database will then be listed in the Data sources pane (Ctrl+Shift+F4). If this check box is cleared, the database will be available only by opening the database file.</property> + <property name="AtkObject::accessible-description" translatable="yes" context="datasourcepage|extended_tip|available">Registers the newly created database file in the office suite. The database will then be listed in the Data sources pane (Ctrl+Shift+F4). If this check box is cleared, the database will be available only by opening the database file.</property> </object> </child> </object> diff --git a/extensions/uiconfig/sabpilot/ui/selecttablepage.ui b/extensions/uiconfig/sabpilot/ui/selecttablepage.ui index 0ef0e0f8ef11..55fbb5e9c6c5 100644 --- a/extensions/uiconfig/sabpilot/ui/selecttablepage.ui +++ b/extensions/uiconfig/sabpilot/ui/selecttablepage.ui @@ -74,7 +74,7 @@ Please select the one you mainly want to work with:</property> </child> <child internal-child="accessible"> <object class="AtkObject" id="table-atkobject"> - <property name="AtkObject::accessible-description" translatable="yes" context="selecttablepage|extended_tip|table">Specifies the table that is to serve as the address book for the %PRODUCTNAME templates.</property> + <property name="AtkObject::accessible-description" translatable="yes" context="selecttablepage|extended_tip|table">Specifies the table that is to serve as the address book for the office suite templates.</property> </object> </child> </object> @@ -87,7 +87,7 @@ Please select the one you mainly want to work with:</property> </child> <child internal-child="accessible"> <object class="AtkObject" id="SelectTablePage-atkobject"> - <property name="AtkObject::accessible-description" translatable="yes" context="selecttablepage|extended_tip|SelectTablePage">Specifies a table from the Seamonkey / Netscape address book source that is used as the address book in %PRODUCTNAME.</property> + <property name="AtkObject::accessible-description" translatable="yes" context="selecttablepage|extended_tip|SelectTablePage">Specifies a table from the Seamonkey / Netscape address book source that is used as the address book in the office suite.</property> </object> </child> </object> diff --git a/extensions/uiconfig/sabpilot/ui/selecttypepage.ui b/extensions/uiconfig/sabpilot/ui/selecttypepage.ui index 02be4d34b3f8..5627482afac8 100644 --- a/extensions/uiconfig/sabpilot/ui/selecttypepage.ui +++ b/extensions/uiconfig/sabpilot/ui/selecttypepage.ui @@ -139,7 +139,7 @@ This wizard helps you create the data source.</property> </child> <child> <object class="GtkRadioButton" id="macosx"> - <property name="label" translatable="yes" context="selecttypepage|macosx">Mac OS X address book</property> + <property name="label" translatable="yes" context="selecttypepage|macosx">macOS address book</property> <property name="visible">True</property> <property name="can-focus">True</property> <property name="receives-default">False</property> @@ -168,7 +168,7 @@ This wizard helps you create the data source.</property> <property name="group">evolution</property> <child internal-child="accessible"> <object class="AtkObject" id="other-atkobject"> - <property name="AtkObject::accessible-description" translatable="yes" context="selecttypepage|extended_tip|other">Select this option if you want to register another data source as address book in %PRODUCTNAME.</property> + <property name="AtkObject::accessible-description" translatable="yes" context="selecttypepage|extended_tip|other">Select this option if you want to register another data source as address book in the office suite.</property> </object> </child> </object> @@ -204,7 +204,7 @@ This wizard helps you create the data source.</property> </child> <child internal-child="accessible"> <object class="AtkObject" id="SelectTypePage-atkobject"> - <property name="AtkObject::accessible-description" translatable="yes" context="selecttypepage|extended_tip|SelectTypePage">This wizard registers an existing address book as a data source in %PRODUCTNAME.</property> + <property name="AtkObject::accessible-description" translatable="yes" context="selecttypepage|extended_tip|SelectTypePage">This wizard registers an existing address book as a data source in the office suite.</property> </object> </child> </object> diff --git a/extensions/uiconfig/sbibliography/menubar/menubar.xml b/extensions/uiconfig/sbibliography/menubar/menubar.xml index 3604c1b760a1..9b449072ac32 100644 --- a/extensions/uiconfig/sbibliography/menubar/menubar.xml +++ b/extensions/uiconfig/sbibliography/menubar/menubar.xml @@ -39,10 +39,9 @@ <menu:menuseparator/> <menu:menuitem menu:id=".uno:MacroSignature"/> <menu:menuitem menu:id=".uno:MacroOrganizer?TabId:short=1"/> - <menu:menuseparator/> - <menu:menuitem menu:id=".uno:OpenXMLFilterSettings"/> </menu:menupopup> </menu:menu> + <menu:menuitem menu:id=".uno:OpenXMLFilterSettings"/> <menu:menuitem menu:id="service:com.sun.star.deployment.ui.PackageManagerDialog" menu:style="text"/> <menu:menuitem menu:id=".uno:ConfigureDialog" menu:style="text"/> <menu:menuitem menu:id=".uno:OptionsTreeDialog"/> diff --git a/extensions/uiconfig/sbibliography/ui/toolbar.ui b/extensions/uiconfig/sbibliography/ui/toolbar.ui index bdd87be9ec03..81e60b5fbf84 100644 --- a/extensions/uiconfig/sbibliography/ui/toolbar.ui +++ b/extensions/uiconfig/sbibliography/ui/toolbar.ui @@ -4,12 +4,11 @@ <requires lib="gtk+" version="3.20"/> <object class="GtkToolbar" id="toolbar"> <property name="visible">True</property> - <property name="can_focus">False</property> + <property name="can_focus">True</property> <property name="show_arrow">False</property> <child> <object class="GtkToolButton" id="TBC_SOURCE"> <property name="visible">True</property> - <property name="can_focus">False</property> <property name="action_name">.uno:Bib/source</property> <property name="use_underline">True</property> </object> @@ -21,7 +20,6 @@ <child> <object class="GtkToolButton" id="TBC_BT_CHANGESOURCE"> <property name="visible">True</property> - <property name="can_focus">False</property> <property name="action_name">.uno:Bib/sdbsource</property> <property name="label" translatable="yes" context="toolbar|TBC_BT_CHANGESOURCE">Data Source</property> <property name="use_underline">True</property> @@ -44,7 +42,6 @@ <child> <object class="GtkToolButton" id="TBC_QUERY"> <property name="visible">True</property> - <property name="can_focus">False</property> <property name="action_name">.uno:Bib/query</property> <property name="use_underline">True</property> </object> @@ -66,7 +63,6 @@ <child> <object class="GtkMenuToolButton" id="TBC_BT_AUTOFILTER"> <property name="visible">True</property> - <property name="can_focus">False</property> <property name="action_name">.uno:Bib/autoFilter</property> <property name="label" translatable="yes" context="toolbar|TBC_BT_AUTOFILTER">AutoFilter</property> <property name="use_underline">True</property> @@ -79,7 +75,6 @@ <child> <object class="GtkToolButton" id="TBC_BT_FILTERCRIT"> <property name="visible">True</property> - <property name="can_focus">False</property> <property name="action_name">.uno:Bib/standardFilter</property> <property name="label" translatable="yes" context="toolbar|TBC_BT_FILTERCRIT">Standard Filter</property> <property name="use_underline">True</property> @@ -92,7 +87,6 @@ <child> <object class="GtkToolButton" id="TBC_BT_REMOVEFILTER"> <property name="visible">True</property> - <property name="can_focus">False</property> <property name="action_name">.uno:Bib/removeFilter</property> <property name="label" translatable="yes" context="toolbar|TBC_BT_REMOVEFILTER">Reset Filter</property> <property name="use_underline">True</property> @@ -105,7 +99,6 @@ <child> <object class="GtkToolButton" id="TBC_BT_COL_ASSIGN"> <property name="visible">True</property> - <property name="can_focus">False</property> <property name="action_name">.uno:Bib/Mapping</property> <property name="label" translatable="yes" context="toolbar|TBC_BT_COL_ASSIGN">Column Arrangement</property> <property name="use_underline">True</property> diff --git a/extensions/uiconfig/spropctrlr/ui/formattedcontrol.ui b/extensions/uiconfig/spropctrlr/ui/formattedcontrol.ui index 657542e7c23f..be3bd8857d52 100644 --- a/extensions/uiconfig/spropctrlr/ui/formattedcontrol.ui +++ b/extensions/uiconfig/spropctrlr/ui/formattedcontrol.ui @@ -13,7 +13,6 @@ <property name="can_focus">True</property> <property name="hexpand">True</property> <property name="activates_default">True</property> - <property name="caps_lock_warning">False</property> <property name="adjustment">adjustmentForwardBackward</property> <property name="truncate-multiline">True</property> <property name="digits">2</property> diff --git a/extensions/uiconfig/spropctrlr/ui/formattedsample.ui b/extensions/uiconfig/spropctrlr/ui/formattedsample.ui index 63ee0ea6bc68..60fb76e8397e 100644 --- a/extensions/uiconfig/spropctrlr/ui/formattedsample.ui +++ b/extensions/uiconfig/spropctrlr/ui/formattedsample.ui @@ -31,7 +31,6 @@ <property name="no_show_all">True</property> <property name="hexpand">True</property> <property name="activates_default">True</property> - <property name="caps_lock_warning">False</property> <property name="adjustment">adjustmentForwardBackward</property> <property name="truncate-multiline">True</property> <property name="digits">2</property> diff --git a/extensions/uiconfig/spropctrlr/ui/labelselectiondialog.ui b/extensions/uiconfig/spropctrlr/ui/labelselectiondialog.ui index cf4073db11a5..4a7c53da1bec 100644 --- a/extensions/uiconfig/spropctrlr/ui/labelselectiondialog.ui +++ b/extensions/uiconfig/spropctrlr/ui/labelselectiondialog.ui @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> -<!-- Generated with glade 3.22.1 --> +<!-- Generated with glade 3.40.0 --> <interface domain="pcr"> <requires lib="gtk+" version="3.20"/> <object class="GtkTreeStore" id="liststore1"> @@ -13,34 +13,31 @@ </columns> </object> <object class="GtkDialog" id="LabelSelectionDialog"> - <property name="can_focus">False</property> - <property name="border_width">6</property> + <property name="can-focus">False</property> + <property name="border-width">6</property> <property name="title" translatable="yes" context="labelselectiondialog|LabelSelectionDialog">Label Field Selection</property> <property name="modal">True</property> - <property name="default_width">0</property> - <property name="type_hint">dialog</property> - <child> - <placeholder/> - </child> + <property name="default-width">0</property> + <property name="type-hint">dialog</property> <child internal-child="vbox"> <object class="GtkBox" id="dialog-vbox1"> - <property name="can_focus">False</property> + <property name="can-focus">False</property> <property name="hexpand">True</property> <property name="vexpand">True</property> <property name="orientation">vertical</property> <property name="spacing">6</property> <child internal-child="action_area"> <object class="GtkButtonBox" id="dialog-action_area1"> - <property name="can_focus">False</property> - <property name="layout_style">end</property> + <property name="can-focus">False</property> + <property name="layout-style">end</property> <child> <object class="GtkButton" id="ok"> <property name="label" translatable="yes" context="stock">_OK</property> <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="can_default">True</property> - <property name="has_default">True</property> - <property name="receives_default">True</property> + <property name="can-focus">True</property> + <property name="can-default">True</property> + <property name="has-default">True</property> + <property name="receives-default">True</property> <property name="use-underline">True</property> </object> <packing> @@ -53,8 +50,8 @@ <object class="GtkButton" id="cancel"> <property name="label" translatable="yes" context="stock">_Cancel</property> <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="receives_default">True</property> + <property name="can-focus">True</property> + <property name="receives-default">True</property> <property name="use-underline">True</property> </object> <packing> @@ -67,8 +64,8 @@ <object class="GtkButton" id="help"> <property name="label" translatable="yes" context="stock">_Help</property> <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="receives_default">True</property> + <property name="can-focus">True</property> + <property name="receives-default">True</property> <property name="use-underline">True</property> </object> <packing> @@ -82,14 +79,14 @@ <packing> <property name="expand">False</property> <property name="fill">True</property> - <property name="pack_type">end</property> + <property name="pack-type">end</property> <property name="position">0</property> </packing> </child> <child> <object class="GtkBox" id="box1"> <property name="visible">True</property> - <property name="can_focus">False</property> + <property name="can-focus">False</property> <property name="hexpand">True</property> <property name="vexpand">True</property> <property name="orientation">vertical</property> @@ -97,14 +94,14 @@ <child> <object class="GtkLabel" id="label"> <property name="visible">True</property> - <property name="can_focus">False</property> + <property name="can-focus">False</property> <property name="halign">start</property> <property name="label" translatable="yes" context="labelselectiondialog|label">These are control fields that can be used as label fields for the $controlclass$ $controlname$.</property> - <property name="use_underline">True</property> + <property name="use-underline">True</property> <property name="wrap">True</property> - <property name="mnemonic_widget">control</property> - <property name="width_chars">60</property> - <property name="max_width_chars">60</property> + <property name="mnemonic-widget">control</property> + <property name="width-chars">60</property> + <property name="max-width-chars">60</property> <property name="xalign">0</property> <property name="yalign">0</property> </object> @@ -117,21 +114,20 @@ <child> <object class="GtkScrolledWindow"> <property name="visible">True</property> - <property name="can_focus">False</property> + <property name="can-focus">False</property> <property name="hexpand">True</property> <property name="vexpand">True</property> - <property name="shadow_type">in</property> + <property name="shadow-type">in</property> <child> <object class="GtkTreeView" id="control"> <property name="visible">True</property> - <property name="can_focus">True</property> + <property name="can-focus">True</property> <property name="hexpand">True</property> <property name="vexpand">True</property> <property name="model">liststore1</property> - <property name="headers_visible">False</property> - <property name="search_column">1</property> - <property name="show_expanders">True</property> - <property name="enable_tree_lines">True</property> + <property name="headers-visible">False</property> + <property name="search-column">1</property> + <property name="enable-tree-lines">True</property> <child internal-child="selection"> <object class="GtkTreeSelection" id="Macro Library List-selection1"/> </child> @@ -165,10 +161,15 @@ <object class="GtkCheckButton" id="noassignment"> <property name="label" translatable="yes" context="labelselectiondialog|noassignment">_No assignment</property> <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="receives_default">False</property> - <property name="use_underline">True</property> - <property name="draw_indicator">True</property> + <property name="can-focus">True</property> + <property name="receives-default">False</property> + <property name="use-underline">True</property> + <property name="draw-indicator">True</property> + <child internal-child="accessible"> + <object class="AtkObject" id="noassignment-atkobject"> + <property name="AtkObject::accessible-description" translatable="yes" context="labelselectiondialog|extended_tip|noassignment">Check the “No assignment” box to remove the link between a control and the assigned label field.</property> + </object> + </child> </object> <packing> <property name="expand">False</property> @@ -190,5 +191,10 @@ <action-widget response="-6">cancel</action-widget> <action-widget response="-11">help</action-widget> </action-widgets> + <child internal-child="accessible"> + <object class="AtkObject" id="LabelSelectionDialog-atkobject"> + <property name="AtkObject::accessible-description" translatable="yes" context="labelselectiondialog|extended_tip|LabelSelectionDialog">Specifies the source for the label of the control.</property> + </object> + </child> </object> </interface> diff --git a/extensions/uiconfig/spropctrlr/ui/multiline.ui b/extensions/uiconfig/spropctrlr/ui/multiline.ui index a17e7bb7d609..d9570489a972 100644 --- a/extensions/uiconfig/spropctrlr/ui/multiline.ui +++ b/extensions/uiconfig/spropctrlr/ui/multiline.ui @@ -5,6 +5,7 @@ <object class="GtkPopover" id="popover"> <property name="can_focus">False</property> <property name="no_show_all">True</property> + <property name="constrain-to">none</property> <child> <object class="GtkBox" id="container"> <property name="visible">True</property> |