24#include <config_folders.h>
26#include <rtl/ustring.hxx>
27#include <rtl/bootstrap.hxx>
28#include <osl/process.h>
37 bool loadPng( std::u16string_view rPath,
BitmapEx &rBitmap)
40 SvFileStream aStrm( aObj.PathToFileName(), StreamMode::STD_READ );
41 if ( !aStrm.GetError() ) {
43 rBitmap = aReader.read();
49 bool tryLoadPng( std::u16string_view rBaseDir, std::u16string_view rName,
BitmapEx& rBitmap )
51 return loadPng( rtl::Concat2View(OUString::Concat(rBaseDir) +
"/" LIBO_ETC_FOLDER + rName), rBitmap);
59 OUString aBaseDir(
"$BRAND_BASE_DIR");
60 rtl::Bootstrap::expandMacros( aBaseDir );
61 OUString aBaseName(OUStringChar(
'/') +
pName);
62 OUString aPng(
".png" );
64 rtl_Locale *pLoc =
nullptr;
65 osl_getProcessLocale (&pLoc);
69 for (
const OUString & aFallback : aFallbacks)
71 if (tryLoadPng( aBaseDir, Concat2View(aBaseName +
"-" + aFallback + aPng), rBitmap))
75 return tryLoadPng( aBaseDir, Concat2View(aBaseName + aPng), rBitmap);
static bool LoadBrandBitmap(std::u16string_view pName, BitmapEx &rBitmap)
Load a localized branding PNG file as a bitmap.
::std::vector< OUString > getFallbackStrings(bool bIncludeFullBcp47) const