Kaydet (Commit) 4068562f authored tarafından Noel Grandin's avatar Noel Grandin

convert String to OUString in lotuswordpro module

Change-Id: I4af6a11084f3337df1f6278b28fd0fd9d94d6a6a
üst 2e767575
......@@ -74,7 +74,7 @@ LwpCurrencyPool LwpNumericFormat::m_aCurrencyInfo;
* @param
* @return
*/
String LwpCurrencyPool::GetCurrencySymbol(sal_uInt16 nFormat)
OUString LwpCurrencyPool::GetCurrencySymbol(sal_uInt16 nFormat)
{
return m_aCurrencyInfo[nFormat].sSymbol;
}
......@@ -291,27 +291,27 @@ LwpNumericFormat::GetDecimalPlaces(void)
* @param
* @return
*/
void LwpNumericFormat::GetCurrencyStr(LwpNumericFormatSubset aNumber, String& aPrefix, String& aSuffix, sal_Bool bNegtive)
void LwpNumericFormat::GetCurrencyStr(LwpNumericFormatSubset aNumber, OUString& aPrefix, OUString& aSuffix, sal_Bool bNegtive)
{
aPrefix = aNumber.GetPrefix();
aSuffix = aNumber.GetSuffix();
//Make the default prefix and suffix
String aSymbol = m_aCurrencyInfo.GetCurrencySymbol(cFormat);
OUString aSymbol = m_aCurrencyInfo.GetCurrencySymbol(cFormat);
sal_Bool bPost = m_aCurrencyInfo.IsSymbolPost(cFormat);
sal_Bool bShowSpace = m_aCurrencyInfo.IsShowSpace(cFormat);
if ( aNumber.IsDefaultPrefix())
{
if (bNegtive)
{
aPrefix = OUString("(");
aPrefix = "(";
}
if (!bPost)
{
aPrefix += aSymbol;
if (bShowSpace)
{
aPrefix += OUString(" ");
aPrefix += " ";
}
}
}
......@@ -322,14 +322,14 @@ void LwpNumericFormat::GetCurrencyStr(LwpNumericFormatSubset aNumber, String& aP
aSuffix = aSymbol;
if (bShowSpace)
{
aSuffix.Insert(OUString(" "),0);
aSuffix = " " + aSuffix;
}
}
if (bNegtive)
{
aSuffix += OUString(")");
aSuffix += ")";
}
}
}
......@@ -384,7 +384,7 @@ void LwpNumericFormat::SetNumberType(XFNumberStyle* pStyle)
XFStyle* LwpNumericFormat::Convert()
{
XFNumberStyle* pStyle = new XFNumberStyle;
String aPrefix, aSuffix,aNegPrefix,aNegSuffix;
OUString aPrefix, aSuffix,aNegPrefix,aNegSuffix;
LwpColor aColor, aNegativeColor;
if (IsCurrencyFormat(cFormat))
......@@ -419,13 +419,13 @@ XFStyle* LwpNumericFormat::Convert()
}
if (FMT_COMMA==cFormat)
{
if (cNegative.IsDefaultPrefix() && aNegPrefix.Len() == 0)
if (cNegative.IsDefaultPrefix() && aNegPrefix.isEmpty())
{
aNegPrefix = OUString("(");
aNegPrefix = "(";
}
if (cNegative.IsDefaultSuffix() && aNegSuffix.Len() == 0)
if (cNegative.IsDefaultSuffix() && aNegSuffix.isEmpty())
{
aNegSuffix = OUString(")");
aNegSuffix = ")";
}
}
......
......@@ -76,8 +76,8 @@ public:
LwpNumericFormatSubset();
~LwpNumericFormatSubset();
void QuickRead(LwpObjectStream* pStrm);
String GetPrefix(){ return cPrefix.str();}
String GetSuffix(){ return cSuffix.str();}
OUString GetPrefix(){ return cPrefix.str();}
OUString GetSuffix(){ return cSuffix.str();}
sal_Bool IsBlack(){ return (cColor.GetBlue()==0 && cColor.GetGreen()==0 && cColor.GetRed()==0);}
sal_Bool IsDefaultPrefix(){ return !(cSubFlags&SF_OVER_PREFIX); }
sal_Bool IsDefaultSuffix(){ return !(cSubFlags&SF_OVER_SUFFIX); }
......@@ -99,10 +99,10 @@ protected:
struct LwpCurrencyInfo
{
String sSymbol;
OUString sSymbol;
sal_Bool bPost;
sal_Bool bShowSpace;
LwpCurrencyInfo(String sSym)
LwpCurrencyInfo(OUString sSym)
{
sSymbol = sSym;
bPost = sal_False;
......@@ -113,7 +113,7 @@ struct LwpCurrencyInfo
bPost = sal_False;
bShowSpace = sal_False;
}
LwpCurrencyInfo(String sSym,sal_Bool bPost_, sal_Bool bShowSpace_)
LwpCurrencyInfo(OUString sSym,sal_Bool bPost_, sal_Bool bShowSpace_)
{
sSymbol = sSym;
bPost = bPost_;
......@@ -184,7 +184,7 @@ class LwpCurrencyPool
{
public:
LwpCurrencyPool(){InitCurrencySymbol();}
String GetCurrencySymbol(sal_uInt16 nFormat);
OUString GetCurrencySymbol(sal_uInt16 nFormat);
sal_Bool IsShowSpace(sal_uInt16 nFormat);
sal_Bool IsSymbolPost(sal_uInt16 nFormat);
......@@ -198,9 +198,9 @@ private:
m_aCurrencyInfo[nC++]=LwpCurrencyInfo(OUString("oS"),sal_True, sal_True);//FMT_AUSTRIANSCHILLING = 3,
m_aCurrencyInfo[nC++]=LwpCurrencyInfo(OUString("BF"),sal_True, sal_True);//FMT_BELGIANFRANC = 4,
m_aCurrencyInfo[nC++]=LwpCurrencyInfo(OUString("R$"),sal_False, sal_True);//FMT_BRAZILIANCRUZEIRO = 5,
m_aCurrencyInfo[nC++]=LwpCurrencyInfo(String("\357\277\241",RTL_TEXTENCODING_UTF8)); //FMT_BRITISHPOUND = 6,
m_aCurrencyInfo[nC++]=LwpCurrencyInfo(OUString("\357\277\241", 1, RTL_TEXTENCODING_UTF8)); //FMT_BRITISHPOUND = 6,
m_aCurrencyInfo[nC++]=LwpCurrencyInfo(OUString("C$")); //FMT_CANADIANDOLLAR = 7,
m_aCurrencyInfo[nC++]=LwpCurrencyInfo(String("PRC\357\277\245",RTL_TEXTENCODING_UTF8),sal_False,sal_True); //FMT_CHINESEYUAN = 8,
m_aCurrencyInfo[nC++]=LwpCurrencyInfo(OUString("PRC\357\277\245", 1, RTL_TEXTENCODING_UTF8),sal_False,sal_True); //FMT_CHINESEYUAN = 8,
m_aCurrencyInfo[nC++]=LwpCurrencyInfo(OUString("Kc"),sal_True, sal_True);//FMT_CZECHKORUNA = 9,
m_aCurrencyInfo[nC++]=LwpCurrencyInfo(OUString("Dkr"),sal_False, sal_True);//FMT_DANISHKRONE = 10,
m_aCurrencyInfo[nC++]=LwpCurrencyInfo(OUString("ECU"),sal_True, sal_True);//FMT_ECU = 11,
......@@ -212,9 +212,9 @@ private:
m_aCurrencyInfo[nC++]=LwpCurrencyInfo(OUString("Ft"),sal_True, sal_True);//FMT_HUNGARIANFORINT = 17,
m_aCurrencyInfo[nC++]=LwpCurrencyInfo(OUString("Rs"),sal_False, sal_True);//FMT_INDIANRUPEE = 18,
m_aCurrencyInfo[nC++]=LwpCurrencyInfo(OUString("Rp"),sal_False, sal_True);//FMT_INDONESIANRUPIAH = 19,
m_aCurrencyInfo[nC++]=LwpCurrencyInfo(String("IR\357\277\241",RTL_TEXTENCODING_UTF8)); //FMT_IRISHPUNT = 20,
m_aCurrencyInfo[nC++]=LwpCurrencyInfo(OUString("IR\357\277\241",3, RTL_TEXTENCODING_UTF8)); //FMT_IRISHPUNT = 20,
m_aCurrencyInfo[nC++]=LwpCurrencyInfo(OUString("L."),sal_False, sal_True);//FMT_ITALIANLIRA = 21,
m_aCurrencyInfo[nC++]=LwpCurrencyInfo(String("\357\277\245",RTL_TEXTENCODING_UTF8)); //FMT_JAPANESEYEN = 22,
m_aCurrencyInfo[nC++]=LwpCurrencyInfo(OUString("\357\277\245", 1, RTL_TEXTENCODING_UTF8)); //FMT_JAPANESEYEN = 22,
m_aCurrencyInfo[nC++]=LwpCurrencyInfo(OUString("LF"),sal_True, sal_True);//FMT_LUXEMBOURGFRANC = 23,
m_aCurrencyInfo[nC++]=LwpCurrencyInfo(OUString("Rm"),sal_False, sal_True);//FMT_MALAYSIANRINGGIT = 24,
m_aCurrencyInfo[nC++]=LwpCurrencyInfo(OUString("Mex$")); //FMT_MEXICANPESO = 25,
......@@ -238,7 +238,7 @@ private:
m_aCurrencyInfo[nC++]=LwpCurrencyInfo(OUString("$")); //FMT_USDOLLAR = 43,
m_aCurrencyInfo[nC++]=LwpCurrencyInfo(OUString("OTH"),sal_False, sal_True);//FMT_OTHERCURRENCY = 44,
m_aCurrencyInfo[FMT_EURO]=LwpCurrencyInfo(String("\342\202\254",RTL_TEXTENCODING_UTF8)); //FMT_EURO = 52
m_aCurrencyInfo[FMT_EURO]=LwpCurrencyInfo(OUString("\342\202\254", 1, RTL_TEXTENCODING_UTF8)); //FMT_EURO = 52
}
};
......@@ -277,7 +277,7 @@ private:
static sal_uInt16 GetDefaultDecimalPlaces(sal_uInt16 Format);
static LwpCurrencyPool m_aCurrencyInfo;
void GetCurrencyStr(LwpNumericFormatSubset aNumber, String& aPrefix, String& aSuffix, sal_Bool bNegtive=sal_False);
void GetCurrencyStr(LwpNumericFormatSubset aNumber, OUString& aPrefix, OUString& aSuffix, sal_Bool bNegtive=sal_False);
void SetNumberType(XFNumberStyle* pStyle);
OUString reencode(OUString sCode);
};
......
......@@ -313,7 +313,7 @@ public:
~LwpRowSpecifier(){}
void QuickRead(LwpObjectStream *pStrm);
String ToString(sal_uInt16 nFormulaRow);
OUString ToString(sal_uInt16 nFormulaRow);
sal_uInt16 RowID(sal_uInt16 FormulaRow);
sal_uInt16 &Row(void);
......@@ -415,7 +415,7 @@ public:
void QuickRead(LwpObjectStream *pStrm);
sal_uInt8 Column(){return cColumn;}
String ToString(sal_uInt8 nFormulaCol);
OUString ToString(sal_uInt8 nFormulaCol);
sal_uInt8 ColumnID(sal_uInt8 FormulaColumn);
void SetAbsolute(void);
......
......@@ -127,10 +127,10 @@ sal_Bool LwpFormulaInfo::ReadText()
boost::scoped_array<char> pBuf(new char[nStrLen+1]);
m_pObjStrm->QuickRead( pBuf.get(), nStrLen );
*(pBuf.get()+nStrLen)='\0';
String aText;
aText += OUString("\"");
aText.Append(String(pBuf.get(),nStrLen,osl_getThreadTextEncoding()));
aText += OUString("\"");
OUString aText;
aText += "\"";
aText += OUString(pBuf.get(), nStrLen, osl_getThreadTextEncoding());
aText += "\"";
m_aStack.push_back(new LwpFormulaText(aText));
return sal_True;
......@@ -396,9 +396,9 @@ void LwpFormulaInfo::Read()
* @param
* @return sal_Bool.
*/
String LwpFormulaInfo::Convert(LwpTableLayout* pCellsMap)
OUString LwpFormulaInfo::Convert(LwpTableLayout* pCellsMap)
{
String aFormula;
OUString aFormula;
if (m_bSupported)
{
if(1==m_aStack.size())
......@@ -423,9 +423,9 @@ String LwpFormulaInfo::Convert(LwpTableLayout* pCellsMap)
*/
void LwpFormulaInfo::Convert(XFCell * pCell,LwpTableLayout* pCellsMap)
{
String aFormula;
OUString aFormula;
aFormula = Convert(pCellsMap);
if (aFormula.Len())
if (!aFormula.isEmpty())
{
pCell->SetFormula(aFormula);
}
......@@ -458,7 +458,7 @@ OUString LwpFormulaConst::ToString(LwpTableLayout* /*pCellsMap*/)
* @param
* @return
*/
LwpFormulaText::LwpFormulaText( String aText)
LwpFormulaText::LwpFormulaText( OUString aText)
{
m_aText = aText;
}
......@@ -575,7 +575,7 @@ void LwpFormulaFunc::AddArg(LwpFormulaArg* pArg)
* @param
* @return String.
*/
String LwpFormulaFunc::ToArgString(LwpTableLayout* pCellsMap)
OUString LwpFormulaFunc::ToArgString(LwpTableLayout* pCellsMap)
{
OUStringBuffer aFormula;
aFormula.append(static_cast<sal_Unicode>('('));
......@@ -657,14 +657,14 @@ OUString LwpFormulaOp::ToString(LwpTableLayout* pCellsMap)
*/
OUString LwpFormulaUnaryOp::ToString(LwpTableLayout* pCellsMap)
{
String aFormula;
OUString aFormula;
if (1==m_aArgs.size())
{
String aFuncName = LwpFormulaTools::GetName(m_nTokenType);
aFormula.Append(aFuncName);
OUString aFuncName = LwpFormulaTools::GetName(m_nTokenType);
aFormula += aFuncName;
vector<LwpFormulaArg*>::iterator aItr = m_aArgs.begin();
aFormula.Append( (*aItr)->ToArgString(pCellsMap) );
aFormula += (*aItr)->ToArgString(pCellsMap);
}
else
{
......@@ -679,70 +679,70 @@ OUString LwpFormulaUnaryOp::ToString(LwpTableLayout* pCellsMap)
* @param
* @return String.
*/
String LwpFormulaTools::GetName(sal_uInt16 nTokenType)
OUString LwpFormulaTools::GetName(sal_uInt16 nTokenType)
{
String aName;
OUString aName;
switch(nTokenType)
{
case TK_SUM:
aName = OUString("SUM");
aName = "SUM";
break;
case TK_IF:
aName = OUString("IF");//Not supported by SODC
aName = "IF";//Not supported by SODC
break;
case TK_COUNT:
aName = OUString("COUNT");//Not supported by SODC
aName = "COUNT";//Not supported by SODC
break;
case TK_MINIMUM:
aName = OUString("MIN");
aName = "MIN";
break;
case TK_MAXIMUM:
aName = OUString("MAX");
aName = "MAX";
break;
case TK_AVERAGE:
aName = OUString("MEAN");
aName = "MEAN";
break;
case TK_ADD:
aName = OUString("+");
aName = "+";
break;
case TK_SUBTRACT:
aName = OUString("-");
aName = "-";
break;
case TK_MULTIPLY:
aName = OUString("*");
aName = "*";
break;
case TK_DIVIDE:
aName = OUString("/");
aName = "/";
break;
case TK_UNARY_MINUS:
aName = OUString("-");
aName = "-";
break;
case TK_LESS:
aName = OUString("L");
aName = "L";
break;
case TK_LESS_OR_EQUAL:
aName = OUString("LEQ");
aName = "LEQ";
break;
case TK_GREATER:
aName = OUString("G");
aName = "G";
break;
case TK_GREATER_OR_EQUAL:
aName = OUString("GEQ");
aName = "GEQ";
break;
case TK_EQUAL:
aName = OUString("EQ");
aName = "EQ";
break;
case TK_NOT_EQUAL:
aName = OUString("NEQ");
aName = "NEQ";
break;
case TK_NOT:
aName = OUString("NOT");
aName = "NOT";
break;
case TK_AND:
aName = OUString("AND");
aName = "AND";
break;
case TK_OR:
aName = OUString("OR");
aName = "OR";
break;
default:
assert(false);
......@@ -758,9 +758,9 @@ String LwpFormulaTools::GetName(sal_uInt16 nTokenType)
* @param
* @return String.
*/
String LwpFormulaTools::GetCellAddr(sal_Int16 nRow, sal_Int16 nCol, LwpTableLayout* pCellsMap)
OUString LwpFormulaTools::GetCellAddr(sal_Int16 nRow, sal_Int16 nCol, LwpTableLayout* pCellsMap)
{
String aCellAddr;
OUString aCellAddr;
XFCell* pCell = pCellsMap->GetCellsMap(nRow,(sal_uInt8)nCol);
if (pCell)
{
......
......@@ -111,14 +111,14 @@ class LwpFormulaArg
public:
virtual ~LwpFormulaArg() = 0;
virtual OUString ToString(LwpTableLayout* pCellsMap)=0;
virtual String ToArgString(LwpTableLayout* pCellsMap){ return ToString(pCellsMap);}
virtual OUString ToArgString(LwpTableLayout* pCellsMap){ return ToString(pCellsMap);}
};
class LwpFormulaTools
{
public:
static String GetName(sal_uInt16 nTokenType);
static String GetCellAddr(sal_Int16 nRow, sal_Int16 nCol, LwpTableLayout* pCellsMap);
static OUString GetName(sal_uInt16 nTokenType);
static OUString GetCellAddr(sal_Int16 nRow, sal_Int16 nCol, LwpTableLayout* pCellsMap);
};
class LwpFormulaConst:public LwpFormulaArg
......@@ -133,10 +133,10 @@ private:
class LwpFormulaText:public LwpFormulaArg
{
public:
LwpFormulaText( String aText);
LwpFormulaText( OUString aText);
virtual OUString ToString(LwpTableLayout* /*pCellsMap*/){return m_aText;}
private:
String m_aText;
OUString m_aText;
};
class LwpFormulaCellAddr:public LwpFormulaArg
......@@ -175,7 +175,7 @@ public:
void AddArg(LwpFormulaArg* pArg);
virtual OUString ToString(LwpTableLayout* pCellsMap);
String ToArgString(LwpTableLayout* pCellsMap);
OUString ToArgString(LwpTableLayout* pCellsMap);
protected:
vector<LwpFormulaArg*> m_aArgs;
......@@ -204,7 +204,7 @@ public:
~LwpFormulaInfo();
sal_Bool IsFormula(){return sal_True;}
void SetRow(sal_uInt16 nRow){ m_nFormulaRow = nRow;}
String Convert(LwpTableLayout* pCellsMap);
OUString Convert(LwpTableLayout* pCellsMap);
void Convert(XFCell * pCell, LwpTableLayout* pCellsMap);
protected:
void Read();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment