summaryrefslogtreecommitdiff
path: root/i18npool
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2012-11-23 19:34:09 +0100
committerStephan Bergmann <sbergman@redhat.com>2012-11-24 12:54:32 +0100
commit5234c1bf13014e1e12aab12e91754b36dac50a82 (patch)
treeb694680cc3b490876c6c1582c6dec3a719ae8f66 /i18npool
parent47ba53c3c8675b0a308f7478f0d1238922c8c438 (diff)
Move in-build liblangtag data to solver's unittest/installation/share
...let BRAND_BASE_DIR point to solver's unittest/installation during CppUnit tests, and get rid of LIBLANGTAG_SHARE special case. (Intending to add further code to CppUnit tests soon that requires a fake BRAND_BASE_DIR, so clean this up now.) Change-Id: Ia5f0f247e54952f901c37ca31eda53f9c6591458
Diffstat (limited to 'i18npool')
-rw-r--r--i18npool/source/languagetag/languagetag.cxx29
1 files changed, 12 insertions, 17 deletions
diff --git a/i18npool/source/languagetag/languagetag.cxx b/i18npool/source/languagetag/languagetag.cxx
index 7f3c15e77d3a..8ec730c292ec 100644
--- a/i18npool/source/languagetag/languagetag.cxx
+++ b/i18npool/source/languagetag/languagetag.cxx
@@ -123,24 +123,19 @@ void LiblantagDataRef::presetDataPath( const rtl::OUString& rPath )
void LiblantagDataRef::setupDataPath()
{
// maDataPath is assumed to be empty here.
- OUString aURL;
-
- if (!rtl::Bootstrap::get("BRAND_BASE_DIR", aURL) && !rtl::Bootstrap::get("LIBLANGTAG_SHARE", aURL))
- OSL_FAIL( "LiblantagDataRef: can't get BRAND_BASE_DIR");
- else
+ OUString aURL("$BRAND_BASE_DIR/share/liblangtag");
+ rtl::Bootstrap::expandMacros(aURL); //TODO: detect failure
+
+ // Check if data is in our own installation, else assume system
+ // installation.
+ OUString aData( aURL);
+ aData += "/language-subtag-registry.xml";
+ osl::DirectoryItem aDirItem;
+ if (osl::DirectoryItem::get( aData, aDirItem) == osl::DirectoryItem::E_None)
{
- // Check if data is in our own installation, else assume system
- // installation.
- aURL += "/share/liblangtag";
- OUString aData( aURL);
- aData += "/language-subtag-registry.xml";
- osl::DirectoryItem aDirItem;
- if (osl::DirectoryItem::get( aData, aDirItem) == osl::DirectoryItem::E_None)
- {
- OUString aPath;
- if (osl::FileBase::getSystemPathFromFileURL( aURL, aPath) == osl::FileBase::E_None)
- maDataPath = OUStringToOString( aPath, RTL_TEXTENCODING_UTF8);
- }
+ OUString aPath;
+ if (osl::FileBase::getSystemPathFromFileURL( aURL, aPath) == osl::FileBase::E_None)
+ maDataPath = OUStringToOString( aPath, RTL_TEXTENCODING_UTF8);
}
if (maDataPath.isEmpty())
maDataPath = "|"; // assume system