return by ref from SdrGlobalData

return values are never nullptr

Change-Id: Id84fc6c8c63cdb34bdd8c07d8ff5b45f1bff2e48
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147873
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
This commit is contained in:
Noel Grandin 2023-02-27 10:46:39 +02:00
parent da68460e03
commit c46582de06
3 changed files with 6 additions and 8 deletions

View file

@ -186,12 +186,10 @@ public:
aUserMakeObjHdl;
OLEObjCache aOLEObjCache;
const SvtSysLocale* GetSysLocale() { return &maSysLocale; } // follows always locale settings
const LocaleDataWrapper* GetLocaleData(); // follows always SysLocale
public:
SdrGlobalData();
const SvtSysLocale& GetSysLocale() { return maSysLocale; } // follows always locale settings
const LocaleDataWrapper& GetLocaleData(); // follows always SysLocale
OLEObjCache& GetOLEObjCache() { return aOLEObjCache; }
};

View file

@ -1418,12 +1418,12 @@ private:
// Collect some frequently used data.
if (mpOptions->IsDate())
{
aInfo.msTimeDate += GetSdrGlobalData().GetLocaleData()->getDate( Date( Date::SYSTEM ) );
aInfo.msTimeDate += GetSdrGlobalData().GetLocaleData().getDate( Date( Date::SYSTEM ) );
aInfo.msTimeDate += " ";
}
if (mpOptions->IsTime())
aInfo.msTimeDate += GetSdrGlobalData().GetLocaleData()->getTime( ::tools::Time( ::tools::Time::SYSTEM ), false );
aInfo.msTimeDate += GetSdrGlobalData().GetLocaleData().getTime( ::tools::Time( ::tools::Time::SYSTEM ), false );
// Draw and Notes should usually use specified paper size when printing
if (!mpOptions->IsPrinterPreferred(mrBase.GetDocShell()->GetDocumentType()))

View file

@ -68,9 +68,9 @@ SdrGlobalData::SdrGlobalData()
}
}
const LocaleDataWrapper* SdrGlobalData::GetLocaleData()
const LocaleDataWrapper& SdrGlobalData::GetLocaleData()
{
return &GetSysLocale()->GetLocaleData();
return GetSysLocale().GetLocaleData();
}
namespace {