#101191#change 'use' to 'ref'

This commit is contained in:
Karl Hong 2002-07-13 00:09:14 +00:00
parent cea8baec35
commit 65ee7ef836
3 changed files with 41 additions and 42 deletions

View file

@ -2,9 +2,9 @@
*
* $RCSfile: LocaleNode.cxx,v $
*
* $Revision: 1.2 $
* $Revision: 1.3 $
*
* last change: $Author: khong $ $Date: 2002-07-11 17:24:35 $
* last change: $Author: khong $ $Date: 2002-07-13 01:09:13 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@ -268,9 +268,9 @@ void LCInfoNode::generateCode (const OFileWriter &of) {
}
void LCCTYPENode::generateCode (const OFileWriter &of) {
::rtl::OUString useLocale = getAttr() -> getValueByName("use");
::rtl::OUString useLocale = getAttr() -> getValueByName("ref");
if (useLocale.getLength() > 0) {
of.writeUseFunction("getLocaleItem_", useLocale);
of.writeRefFunction("getLocaleItem_", useLocale);
return;
}
::rtl::OUString str = getAttr() -> getValueByName("unoid");
@ -335,11 +335,11 @@ void LCCTYPENode::generateCode (const OFileWriter &of) {
}
void LCFormatNode::generateCode (const OFileWriter &of) {
of.writeParameter("currencyFrom", getAttr() -> getValueByName("from"));
of.writeParameter("currencyTo", getAttr() -> getValueByName("to"));
::rtl::OUString useLocale = getAttr() -> getValueByName("use");
of.writeParameter("replaceFrom", getAttr() -> getValueByName("replaceFrom"));
of.writeParameter("replaceTo", getAttr() -> getValueByName("replaceTo"));
::rtl::OUString useLocale = getAttr() -> getValueByName("ref");
if (useLocale.getLength() > 0) {
of.writeUseFunction("getAllFormats_", useLocale, "currencyFrom", "currencyTo");
of.writeRefFunction("getAllFormats_", useLocale, "replaceTo");
return;
}
sal_Int32 formatCount = 0;
@ -419,14 +419,14 @@ void LCFormatNode::generateCode (const OFileWriter &of) {
}
of.writeAsciiString("};\n\n");
of.writeFunction("getAllFormats_", "FormatElementsCount", "FormatElementsArray", "currencyFrom", "currencyTo");
of.writeFunction("getAllFormats_", "FormatElementsCount", "FormatElementsArray", "replaceFrom", "replaceTo");
}
void LCCollationNode::generateCode (const OFileWriter &of) {
::rtl::OUString useLocale = getAttr() -> getValueByName("use");
::rtl::OUString useLocale = getAttr() -> getValueByName("ref");
if (useLocale.getLength() > 0) {
of.writeUseFunction("getCollatorImplementation_", useLocale);
of.writeUseFunction("getCollationOptions_", useLocale);
of.writeRefFunction("getCollatorImplementation_", useLocale);
of.writeRefFunction("getCollationOptions_", useLocale);
return;
}
sal_Int16 nbOfCollations = 0;
@ -488,9 +488,9 @@ void LCCollationNode::generateCode (const OFileWriter &of) {
void LCSearchNode::generateCode (const OFileWriter &of)
{
::rtl::OUString useLocale = getAttr() -> getValueByName("use");
::rtl::OUString useLocale = getAttr() -> getValueByName("ref");
if (useLocale.getLength() > 0) {
of.writeUseFunction("getSearchOptions_", useLocale);
of.writeRefFunction("getSearchOptions_", useLocale);
return;
}
@ -522,9 +522,9 @@ void LCSearchNode::generateCode (const OFileWriter &of)
}
void LCCalendarNode::generateCode (const OFileWriter &of) {
::rtl::OUString useLocale = getAttr() -> getValueByName("use");
::rtl::OUString useLocale = getAttr() -> getValueByName("ref");
if (useLocale.getLength() > 0) {
of.writeUseFunction("getAllCalendars_", useLocale);
of.writeRefFunction("getAllCalendars_", useLocale);
return;
}
sal_Int16 nbOfCalendars = getNumberOfChildren();
@ -658,9 +658,9 @@ void LCCalendarNode::generateCode (const OFileWriter &of) {
}
void LCCurrencyNode :: generateCode (const OFileWriter &of) {
::rtl::OUString useLocale = getAttr() -> getValueByName("use");
::rtl::OUString useLocale = getAttr() -> getValueByName("ref");
if (useLocale.getLength() > 0) {
of.writeUseFunction("getAllCurrencies_", useLocale);
of.writeRefFunction("getAllCurrencies_", useLocale);
return;
}
sal_Int16 nbOfCurrencies = 0;
@ -717,9 +717,9 @@ void LCCurrencyNode :: generateCode (const OFileWriter &of) {
}
void LCTransliterationNode::generateCode (const OFileWriter &of) {
::rtl::OUString useLocale = getAttr() -> getValueByName("use");
::rtl::OUString useLocale = getAttr() -> getValueByName("ref");
if (useLocale.getLength() > 0) {
of.writeUseFunction("getTransliterations_", useLocale);
of.writeRefFunction("getTransliterations_", useLocale);
return;
}
sal_Int16 nbOfModules = 0;
@ -744,10 +744,10 @@ void LCTransliterationNode::generateCode (const OFileWriter &of) {
}
void LCMiscNode::generateCode (const OFileWriter &of) {
::rtl::OUString useLocale = getAttr() -> getValueByName("use");
::rtl::OUString useLocale = getAttr() -> getValueByName("ref");
if (useLocale.getLength() > 0) {
of.writeUseFunction("getForbiddenCharacters_", useLocale);
of.writeUseFunction("getReservedWords_", useLocale);
of.writeRefFunction("getForbiddenCharacters_", useLocale);
of.writeRefFunction("getReservedWords_", useLocale);
return;
}
LocaleNode * reserveNode = findNode("ReservedWords");
@ -790,9 +790,9 @@ void LCNumberingLevelNode::generateCode (const OFileWriter &of)
{
of.writeAsciiString("// ---> ContinuousNumbering\n");
#if SUPD > 618
::rtl::OUString useLocale = getAttr() -> getValueByName("use");
::rtl::OUString useLocale = getAttr() -> getValueByName("ref");
if (useLocale.getLength() > 0) {
of.writeUseFunction2("getContinuousNumberingLevels_", useLocale);
of.writeRefFunction2("getContinuousNumberingLevels_", useLocale);
return;
}
@ -861,9 +861,9 @@ void LCOutlineNumberingLevelNode::generateCode (const OFileWriter &of)
{
of.writeAsciiString("// ---> OutlineNumbering\n");
#if SUPD > 618
::rtl::OUString useLocale = getAttr() -> getValueByName("use");
::rtl::OUString useLocale = getAttr() -> getValueByName("ref");
if (useLocale.getLength() > 0) {
of.writeUseFunction3("getOutlineNumberingLevels_", useLocale);
of.writeRefFunction3("getOutlineNumberingLevels_", useLocale);
return;
}

View file

@ -2,9 +2,9 @@
*
* $RCSfile: LocaleNode.hxx,v $
*
* $Revision: 1.2 $
* $Revision: 1.3 $
*
* last change: $Author: khong $ $Date: 2002-07-11 17:24:36 $
* last change: $Author: khong $ $Date: 2002-07-13 01:09:14 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@ -100,13 +100,13 @@ OFileWriter(const char *pcFile, const char *locale );
virtual void writeAsciiString(const char *str)const ;
virtual void writeInt(sal_Int16 nb) const;
virtual void writeFunction(const char *func, const char *count, const char *array) const;
virtual void writeUseFunction(const char *func, const ::rtl::OUString& useLocale) const;
virtual void writeRefFunction(const char *func, const ::rtl::OUString& useLocale) const;
virtual void writeFunction(const char *func, const char *count, const char *array, const char *from, const char *to) const;
virtual void writeUseFunction(const char *func, const ::rtl::OUString& useLocale, const char *from, const char *to) const;
virtual void writeRefFunction(const char *func, const ::rtl::OUString& useLocale, const char *to) const;
virtual void writeFunction2(const char *func, const char *style, const char* attr, const char *array) const;
virtual void writeUseFunction2(const char *func, const ::rtl::OUString& useLocale) const;
virtual void writeRefFunction2(const char *func, const ::rtl::OUString& useLocale) const;
virtual void writeFunction3(const char *func, const char *style, const char* levels, const char* attr, const char *array) const;
virtual void writeUseFunction3(const char *func, const ::rtl::OUString& useLocale) const;
virtual void writeRefFunction3(const char *func, const ::rtl::OUString& useLocale) const;
virtual void writeIntParameter(const sal_Char* pAsciiStr, const sal_Int16 count, sal_Int16 val) const;
virtual void writeDefaultParameter(const sal_Char* pAsciiStr, const ::rtl::OUString& str, sal_Int16 count) const;
virtual void writeDefaultParameter(const sal_Char* pAsciiStr, const ::rtl::OUString& str) const;

View file

@ -2,9 +2,9 @@
*
* $RCSfile: filewriter.cxx,v $
*
* $Revision: 1.2 $
* $Revision: 1.3 $
*
* last change: $Author: khong $ $Date: 2002-07-11 17:24:37 $
* last change: $Author: khong $ $Date: 2002-07-13 01:09:12 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@ -101,7 +101,7 @@ void OFileWriter::writeFunction(const char *func, const char *count, const char
fprintf(m_f, "\treturn (sal_Unicode**)%s;\n}\n", array);
}
void OFileWriter::writeUseFunction(const char *func, const ::rtl::OUString& useLocale) const
void OFileWriter::writeRefFunction(const char *func, const ::rtl::OUString& useLocale) const
{
const char* locale = OUStringToOString(useLocale, RTL_TEXTENCODING_ASCII_US).getStr();
fprintf(m_f, "extern sal_Unicode ** SAL_CALL %s%s(sal_Int16& count);\n", func, locale);
@ -118,15 +118,14 @@ void OFileWriter::writeFunction(const char *func, const char *count, const char
fprintf(m_f, "\treturn (sal_Unicode**)%s;\n}\n", array);
}
void OFileWriter::writeUseFunction(const char *func, const ::rtl::OUString& useLocale, const char *from, const char *to) const
void OFileWriter::writeRefFunction(const char *func, const ::rtl::OUString& useLocale, const char *to) const
{
const char* locale = OUStringToOString(useLocale, RTL_TEXTENCODING_ASCII_US).getStr();
fprintf(m_f, "extern sal_Unicode ** SAL_CALL %s%s(sal_Int16& count, const sal_Unicode*& from, const sal_Unicode*& to);\n", func, locale);
fprintf(m_f, "sal_Unicode ** SAL_CALL %s%s(sal_Int16& count, const sal_Unicode*& from, const sal_Unicode*& to)\n{\n", func, theLocale);
fprintf(m_f, "\tfrom = %s;\n", from);
fprintf(m_f, "\tto = %s;\n", to);
fprintf(m_f, "\tconst sal_Unicode* str;\n");
fprintf(m_f, "\treturn %s%s(count, str, str);\n}\n", func, locale);
fprintf(m_f, "\tconst sal_Unicode* tmp;\n");
fprintf(m_f, "\treturn %s%s(count, from, tmp);\n}\n", func, locale);
}
void OFileWriter::writeFunction2(const char *func, const char *style, const char* attr, const char *array) const
@ -137,7 +136,7 @@ void OFileWriter::writeFunction2(const char *func, const char *style, const char
fprintf(m_f, "\treturn %s;\n}\n", array);
}
void OFileWriter::writeUseFunction2(const char *func, const ::rtl::OUString& useLocale) const
void OFileWriter::writeRefFunction2(const char *func, const ::rtl::OUString& useLocale) const
{
const char* locale = OUStringToOString(useLocale, RTL_TEXTENCODING_ASCII_US).getStr();
fprintf(m_f, "extern const sal_Unicode *** SAL_CALL %s%s(sal_Int16& nStyles, sal_Int16& nAttributes);\n", func, locale);
@ -154,7 +153,7 @@ void OFileWriter::writeFunction3(const char *func, const char *style, const char
fprintf(m_f, "\treturn %s;\n}\n", array);
}
void OFileWriter::writeUseFunction3(const char *func, const ::rtl::OUString& useLocale) const
void OFileWriter::writeRefFunction3(const char *func, const ::rtl::OUString& useLocale) const
{
const char* locale = OUStringToOString(useLocale, RTL_TEXTENCODING_ASCII_US).getStr();
fprintf(m_f, "extern const sal_Unicode **** SAL_CALL %s%s(sal_Int16& nStyles, sal_Int16& nLevels, sal_Int16& nAttributes);\n", func, locale);