/*
*******************************************************************************
-* Copyright (C) 2007-2012, International Business Machines Corporation and
+* Copyright (C) 2007-2013, International Business Machines Corporation and
* others. All Rights Reserved.
*******************************************************************************
*
key=NULL;
err = U_ZERO_ERROR;
- fBundle = ures_getByKeyWithFallback(calTypeBundle, DT_DateTimeFieldsTag, NULL, &err);
+ fBundle = ures_getByKeyWithFallback(rb, DT_DateTimeFieldsTag, NULL, &err);
for (i=0; i<MAX_RESOURCE_FIELD; ++i) {
err = U_ZERO_ERROR;
patBundle = ures_getByKeyWithFallback(fBundle, Resource_Fields[i], NULL, &err);
/*
*******************************************************************************
-* Copyright (C) 2007-2012, International Business Machines Corporation and
+* Copyright (C) 2007-2013, International Business Machines Corporation and
* others. All Rights Reserved.
*******************************************************************************
*/
#include "gregoimp.h" // for CalendarData
#include "cmemory.h"
+#include "uresimp.h"
U_NAMESPACE_BEGIN
}
}
- UResourceBundle *strings = calData.getByKey3("fields", "day", "relative", status);
+ UResourceBundle *rb = ures_open(NULL, fLocale.getBaseName(), &status);
+ UResourceBundle *sb = ures_getByKeyWithFallback(rb, "fields", NULL, &status);
+ rb = ures_getByKeyWithFallback(sb, "day", rb, &status);
+ sb = ures_getByKeyWithFallback(rb, "relative", sb, &status);
+ ures_close(rb);
// set up min/max
fDayMin=-1;
fDayMax=1;
if(U_FAILURE(status)) {
fDatesLen=0;
+ ures_close(sb);
return;
}
- fDatesLen = ures_getSize(strings);
+ fDatesLen = ures_getSize(sb);
fDates = (URelativeString*) uprv_malloc(sizeof(fDates[0])*fDatesLen);
// Load in each item into the array...
UResourceBundle *subString = NULL;
- while(ures_hasNext(strings) && U_SUCCESS(status)) { // iterate over items
- subString = ures_getNextResource(strings, subString, &status);
+ while(ures_hasNext(sb) && U_SUCCESS(status)) { // iterate over items
+ subString = ures_getNextResource(sb, subString, &status);
if(U_FAILURE(status) || (subString==NULL)) break;
n++;
}
ures_close(subString);
+ ures_close(sb);
// the fDates[] array could be sorted here, for direct access.
}