Kaydet (Commit) 45ccace0 authored tarafından Ivan Timofeev's avatar Ivan Timofeev

String -> OUString

Change-Id: I23e0181c1aefc9efbac81216a18cdd7042a7679e
üst 7119a76d
......@@ -111,7 +111,7 @@ enum SmTokenType
struct SmToken
{
String aText; // token text
OUString aText; // token text
SmTokenType eType; // token info
sal_Unicode cMathChar;
......
......@@ -1022,7 +1022,7 @@ void SmCursor::InsertElement(SmFormulaElement element){
{
SmToken token;
token.nGroup = TGBLANK;
token.aText.AssignAscii("~");
token.aText = "~";
pNewNode = new SmBlankNode(token);
}break;
case FactorialElement:
......@@ -1037,7 +1037,7 @@ void SmCursor::InsertElement(SmFormulaElement element){
token.cMathChar = MS_PLUS;
token.nGroup = TGUNOPER | TGSUM;
token.nLevel = 5;
token.aText.AssignAscii("+");
token.aText = "+";
pNewNode = new SmMathSymbolNode(token);
}break;
case MinusElement:
......@@ -1047,7 +1047,7 @@ void SmCursor::InsertElement(SmFormulaElement element){
token.cMathChar = MS_MINUS;
token.nGroup = TGUNOPER | TGSUM;
token.nLevel = 5;
token.aText.AssignAscii("-");
token.aText = "-";
pNewNode = new SmMathSymbolNode(token);
}break;
case CDotElement:
......@@ -1056,7 +1056,7 @@ void SmCursor::InsertElement(SmFormulaElement element){
token.eType = TCDOT;
token.cMathChar = MS_CDOT;
token.nGroup = TGPRODUCT;
token.aText.AssignAscii("cdot");
token.aText = "cdot";
pNewNode = new SmMathSymbolNode(token);
}break;
case EqualElement:
......@@ -1065,7 +1065,7 @@ void SmCursor::InsertElement(SmFormulaElement element){
token.eType = TASSIGN;
token.cMathChar = MS_ASSIGN;
token.nGroup = TGRELATION;
token.aText.AssignAscii("=");
token.aText = "=";
pNewNode = new SmMathSymbolNode(token);
}break;
case LessThanElement:
......@@ -1074,7 +1074,7 @@ void SmCursor::InsertElement(SmFormulaElement element){
token.eType = TLT;
token.cMathChar = MS_LT;
token.nGroup = TGRELATION;
token.aText.AssignAscii("<");
token.aText = "<";
pNewNode = new SmMathSymbolNode(token);
}break;
case GreaterThanElement:
......@@ -1083,7 +1083,7 @@ void SmCursor::InsertElement(SmFormulaElement element){
token.eType = TGT;
token.cMathChar = MS_GT;
token.nGroup = TGRELATION;
token.aText.AssignAscii(">");
token.aText = ">";
pNewNode = new SmMathSymbolNode(token);
}break;
case PercentElement:
......@@ -1092,7 +1092,7 @@ void SmCursor::InsertElement(SmFormulaElement element){
token.eType = TTEXT;
token.cMathChar = MS_PERCENT;
token.nGroup = 0;
token.aText.AssignAscii("\"%\"");
token.aText = "\"%\"";
pNewNode = new SmMathSymbolNode(token);
}break;
default:
......
......@@ -1032,7 +1032,7 @@ void SmXMLFencedContext_Impl::EndElement()
SmToken aToken;
aToken.cMathChar = '\0';
aToken.nGroup = 0;
aToken.aText = ',';
aToken.aText = ",";
aToken.eType = TLEFT;
aToken.nLevel = 5;
......@@ -1049,7 +1049,7 @@ void SmXMLFencedContext_Impl::EndElement()
SmNodeStack &rNodeStack = GetSmImport().GetNodeStack();
aToken.cMathChar = '\0';
aToken.aText = ',';
aToken.aText = ",";
aToken.eType = TIDENT;
sal_uLong i = rNodeStack.size() - nElementCount;
......@@ -1252,10 +1252,7 @@ void SmXMLStringContext_Impl::TCharacters(const OUString &rChars)
Obviously this isn't fully done here.
*/
aToken.aText.Erase();
aToken.aText += '\"';
aToken.aText += String(rChars);
aToken.aText += '\"';
aToken.aText = "\"" + rChars + "\"";
}
void SmXMLStringContext_Impl::EndElement()
......@@ -1295,8 +1292,8 @@ void SmXMLIdentifierContext_Impl::EndElement()
SmTextNode *pNode = 0;
//we will handle identifier italic/normal here instead of with a standalone
//font node
if (((aStyleHelper.nIsItalic == -1) && (aToken.aText.Len() > 1))
|| ((aStyleHelper.nIsItalic == 0) && (aToken.aText.Len() == 1)))
if (((aStyleHelper.nIsItalic == -1) && (aToken.aText.getLength() > 1))
|| ((aStyleHelper.nIsItalic == 0) && (aToken.aText.getLength() == 1)))
{
pNode = new SmTextNode(aToken,FNT_FUNCTION);
pNode->GetFont().SetItalic(ITALIC_NONE);
......@@ -1712,7 +1709,7 @@ void SmXMLNoneContext_Impl::EndElement(void)
SmToken aToken;
aToken.cMathChar = '\0';
aToken.nGroup = 0;
aToken.aText.Erase();
aToken.aText = "";
aToken.nLevel = 5;
aToken.eType = TIDENT;
GetSmImport().GetNodeStack().push(
......@@ -2491,11 +2488,11 @@ void SmXMLMultiScriptsContext_Impl::ProcessSubSupPairs(bool bIsPrescript)
SmNode *pScriptNode = lcl_popOrZero(aReverseStack);
if (pScriptNode && ((pScriptNode->GetToken().eType != TIDENT) ||
(pScriptNode->GetToken().aText.Len())))
(!pScriptNode->GetToken().aText.isEmpty())))
aSubNodes[eSub+1] = pScriptNode;
pScriptNode = lcl_popOrZero(aReverseStack);
if (pScriptNode && ((pScriptNode->GetToken().eType != TIDENT) ||
(pScriptNode->GetToken().aText.Len())))
(!pScriptNode->GetToken().aText.isEmpty())))
aSubNodes[eSup+1] = pScriptNode;
pNode->SetSubNodes(aSubNodes);
......
......@@ -462,7 +462,7 @@ const SmNode * SmNode::FindTokenAt(sal_uInt16 nRow, sal_uInt16 nCol) const
{
if ( IsVisible()
&& nRow == GetToken().nRow
&& nCol >= GetToken().nCol && nCol < GetToken().nCol + GetToken().aText.Len())
&& nCol >= GetToken().nCol && nCol < GetToken().nCol + GetToken().aText.getLength())
return this;
else
{
......@@ -2367,7 +2367,7 @@ void SmTextNode::Prepare(const SmFormat &rFormat, const SmDocShell &rDocShell)
// special handling for ':' where it is a token on it's own and is likely
// to be used for mathematical notations. (E.g. a:b = 2:3)
// In that case it should not be displayed in italic.
if (GetToken().aText.Len() == 1 && GetToken().aText.GetChar(0) == ':')
if (GetToken().aText.getLength() == 1 && GetToken().aText[0] == ':')
Attributes() &= ~ATTR_ITALIC;
};
......@@ -2894,7 +2894,7 @@ void SmSpecialNode::Prepare(const SmFormat &rFormat, const SmDocShell &rDocShell
const SmSym *pSym;
SmModule *pp = SM_MOD();
String aName( GetToken().aText.Copy(1) );
OUString aName(GetToken().aText.copy(1));
if (NULL != (pSym = pp->GetSymbolManager().GetSymbolByName( aName )))
{
sal_UCS4 cChar = pSym->GetCharacter();
......
This diff is collapsed.
......@@ -187,7 +187,7 @@ void SmGraphicWindow::MouseButtonDown(const MouseEvent& rMEvt)
ESelection aSel (aToken.nRow - 1, aToken.nCol - 1);
if (rMEvt.GetClicks() != 1 || aToken.eType == TPLACE)
aSel.nEndPos = aSel.nEndPos + sal::static_int_cast< sal_uInt16 >(aToken.aText.Len());
aSel.nEndPos = aSel.nEndPos + sal::static_int_cast< sal_uInt16 >(aToken.aText.getLength());
pEdit->SetSelection(aSel);
SetCursor(pNode);
......
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