diff options
author | Caolán McNamara <caolanm@redhat.com> | 2017-05-18 21:14:00 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2017-05-19 15:40:40 +0200 |
commit | 2155e04d6343638ca9815d394cbc4f78c2b17c3a (patch) | |
tree | 0378142f6ce9edb63074291aed45527568e7b254 /include | |
parent | cee02e81cd3b55fb46eacf5db5713e8bf4363bcd (diff) |
make string translation loading more uniform
change various ResId classes that use conversion operator to OUString to
functions that return a OUString
drop various defines
drop unnecessary toString calls
Change-Id: Ibeccdf2b91a46a2ed5b4b74e6024e301a023bc92
Reviewed-on: https://gerrit.libreoffice.org/37817
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/editeng/eerdll.hxx | 2 | ||||
-rw-r--r-- | include/sfx2/sfxresid.hxx | 9 | ||||
-rw-r--r-- | include/svtools/svtresid.hxx | 10 | ||||
-rw-r--r-- | include/svx/dialmgr.hxx | 8 | ||||
-rw-r--r-- | include/svx/galmisc.hxx | 15 |
5 files changed, 27 insertions, 17 deletions
diff --git a/include/editeng/eerdll.hxx b/include/editeng/eerdll.hxx index 05ad3d64dce7..4af426358849 100644 --- a/include/editeng/eerdll.hxx +++ b/include/editeng/eerdll.hxx @@ -35,7 +35,7 @@ class EDITENG_DLLPUBLIC EditResId: public ResId public: EditResId( sal_uInt16 nId ); static OUString GetString(sal_uInt16 nId) - { return EditResId(nId).toString(); } + { return EditResId(nId); } }; class EditDLL diff --git a/include/sfx2/sfxresid.hxx b/include/sfx2/sfxresid.hxx index f66fc8014a2f..945d79939cdb 100644 --- a/include/sfx2/sfxresid.hxx +++ b/include/sfx2/sfxresid.hxx @@ -22,15 +22,16 @@ #include <sfx2/dllapi.h> #include <tools/resid.hxx> -class SFX2_DLLPUBLIC SfxResId: public ResId +struct SFX2_DLLPUBLIC SfxResMgr { -public: - SfxResId( sal_uInt16 nId ); static ResMgr* GetResMgr(); static void DeleteResMgr(); }; -#define SFX2_RESSTR(x) SfxResId(x).toString() +inline OUString SfxResId(sal_uInt16 nId) +{ + return ResId(nId, *SfxResMgr::GetResMgr()); +} #endif diff --git a/include/svtools/svtresid.hxx b/include/svtools/svtresid.hxx index f238b298c2c0..374406b1e455 100644 --- a/include/svtools/svtresid.hxx +++ b/include/svtools/svtresid.hxx @@ -24,14 +24,16 @@ #include <tools/resid.hxx> #include <com/sun/star/lang/Locale.hpp> -class SVT_DLLPUBLIC SvtResId: public ResId +struct SVT_DLLPUBLIC SvtResMgr { -public: - SvtResId(sal_uInt16 nId); + static ResMgr* GetResMgr(); static void DeleteResMgr(); }; -#define SVT_RESSTR(i) SvtResId(i).toString() +inline OUString SvtResId(sal_uInt16 nId) +{ + return ResId(nId, *SvtResMgr::GetResMgr()); +} #endif // INCLUDED_SVTOOLS_SVTRESID_HXX diff --git a/include/svx/dialmgr.hxx b/include/svx/dialmgr.hxx index 0aadfbdc6d60..54951aaee993 100644 --- a/include/svx/dialmgr.hxx +++ b/include/svx/dialmgr.hxx @@ -24,15 +24,17 @@ // forward --------------------------------------------------------------- -class ResMgr; struct SVX_DLLPUBLIC DialogsResMgr { static ResMgr* GetResMgr(); }; #define DIALOG_MGR() (*DialogsResMgr::GetResMgr()) -#define SVX_RES(i) ResId(i,DIALOG_MGR()) -#define SVX_RESSTR(i) SVX_RES(i).toString() + +inline OUString SvxResId(sal_uInt16 nId) +{ + return ResId(nId, DIALOG_MGR()); +} #endif diff --git a/include/svx/galmisc.hxx b/include/svx/galmisc.hxx index 3fb3929b154d..ce89ab0ec5de 100644 --- a/include/svx/galmisc.hxx +++ b/include/svx/galmisc.hxx @@ -31,6 +31,7 @@ #include <svx/svxdllapi.h> #include <tools/date.hxx> #include <tools/time.hxx> +#include <tools/resid.hxx> class GalleryTheme; class SotStorageStream; @@ -62,8 +63,15 @@ enum class SgaObjKind #define ID_IMAPINFO 2 -#define GAL_RES(nId) ResId(nId, *GetGalleryResMgr()) -#define GAL_RESSTR(nId) GAL_RES(nId).toString() +class ResMgr; + +SVX_DLLPUBLIC ResMgr* GetGalleryResMgr(); + +inline OUString GalResId(sal_uInt16 nId) +{ + return ResId(nId, *GetGalleryResMgr()); +} + #define STREAMBUF_SIZE 16384L enum class GalleryGraphicImportRet @@ -77,15 +85,12 @@ enum class GalleryGraphicImportRet #define GALLERY_BG_COLOR Application::GetSettings().GetStyleSettings().GetWindowColor() #define GALLERY_DLG_COLOR Application::GetSettings().GetStyleSettings().GetDialogColor() -class ResMgr; class SvStream; class Graphic; class FmFormModel; class ImageMap; class Gallery; -SVX_DLLPUBLIC ResMgr* - GetGalleryResMgr(); GalleryGraphicImportRet GalleryGraphicImport( const INetURLObject& rURL, Graphic& rGraphic, OUString& rFilterName, bool bShowProgress = false ); bool GallerySvDrawImport( SvStream& rIStm, SdrModel& rModel ); bool CreateIMapGraphic( const FmFormModel& rModel, Graphic& rGraphic, ImageMap& rImageMap ); |