[Libreoffice-commits] .: 3 commits - starmath/inc starmath/source vcl/unx

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Wed Nov 21 06:23:45 PST 2012


 starmath/inc/parse.hxx           |    2 
 starmath/source/cursor.cxx       |   16 +++---
 starmath/source/mathmlimport.cxx |   19 +++-----
 starmath/source/node.cxx         |    6 +-
 starmath/source/parse.cxx        |   92 +++++++++++++++++++--------------------
 starmath/source/view.cxx         |    2 
 vcl/unx/kde4/KDESalGraphics.cxx  |    7 ++
 7 files changed, 73 insertions(+), 71 deletions(-)

New commits:
commit d5e8be8bab87b91710d3cec9039d2feff78b50ba
Author: Ivan Timofeev <timofeev.i.s at gmail.com>
Date:   Wed Nov 21 18:13:18 2012 +0400

    KDESalGraphics: fix CTRL_LISTNODE drawing in expanded state
    
    Change-Id: Ia70f1b3e2afb459bf91748f9e4ba0a0cbde74260

diff --git a/vcl/unx/kde4/KDESalGraphics.cxx b/vcl/unx/kde4/KDESalGraphics.cxx
index b6d26b4..fdbbbbd 100644
--- a/vcl/unx/kde4/KDESalGraphics.cxx
+++ b/vcl/unx/kde4/KDESalGraphics.cxx
@@ -457,7 +457,7 @@ sal_Bool KDESalGraphics::drawNativeControl( ControlType type, ControlPart part,
         QStyleOption option;
         option.state = QStyle::State_Item | QStyle::State_Children;
 
-        if (nControlState & CTRL_STATE_PRESSED)
+        if (value.getTristateVal() == BUTTONVALUE_ON)
             option.state |= QStyle::State_Open;
 
         draw( QStyle::PE_IndicatorBranch, &option, m_image,
commit dd2a12d5199c36950b1480a9aab96e07dc4afcd2
Author: Ivan Timofeev <timofeev.i.s at gmail.com>
Date:   Wed Nov 21 11:46:25 2012 +0400

    KDESalGraphics: transparent background for some widgets, fdo#55952
    
    Change-Id: Iea8537b0d69efaa7323c739c614272f6525435dd

diff --git a/vcl/unx/kde4/KDESalGraphics.cxx b/vcl/unx/kde4/KDESalGraphics.cxx
index e67de52..b6d26b4 100644
--- a/vcl/unx/kde4/KDESalGraphics.cxx
+++ b/vcl/unx/kde4/KDESalGraphics.cxx
@@ -288,6 +288,7 @@ sal_Bool KDESalGraphics::drawNativeControl( ControlType type, ControlPart part,
 
     if (type == CTRL_PUSHBUTTON)
     {
+        m_image->fill( Qt::transparent );
         QStyleOptionButton option;
         draw( QStyle::CE_PushButton, &option, m_image,
               vclStateValue2StateFlag(nControlState, value) );
@@ -377,6 +378,7 @@ sal_Bool KDESalGraphics::drawNativeControl( ControlType type, ControlPart part,
     }
     else if ( (type == CTRL_TOOLBAR) && (part == PART_BUTTON) )
     {
+        m_image->fill( Qt::transparent );
         QStyleOptionToolButton option;
 
         option.arrowType = Qt::NoArrow;
@@ -451,6 +453,7 @@ sal_Bool KDESalGraphics::drawNativeControl( ControlType type, ControlPart part,
     }
     else if (type == CTRL_LISTNODE)
     {
+        m_image->fill( Qt::transparent );
         QStyleOption option;
         option.state = QStyle::State_Item | QStyle::State_Children;
 
@@ -462,6 +465,7 @@ sal_Bool KDESalGraphics::drawNativeControl( ControlType type, ControlPart part,
     }
     else if (type == CTRL_CHECKBOX)
     {
+        m_image->fill( Qt::transparent );
         QStyleOptionButton option;
         draw( QStyle::CE_CheckBox, &option, m_image,
                vclStateValue2StateFlag(nControlState, value) );
@@ -528,6 +532,7 @@ sal_Bool KDESalGraphics::drawNativeControl( ControlType type, ControlPart part,
     }
     else if (type == CTRL_RADIOBUTTON)
     {
+        m_image->fill( Qt::transparent );
         QStyleOptionButton option;
         draw( QStyle::CE_RadioButton, &option, m_image,
               vclStateValue2StateFlag(nControlState, value) );
commit 45ccace028a4ad40fdbaffad050741db583259c9
Author: Ivan Timofeev <timofeev.i.s at gmail.com>
Date:   Tue Nov 20 23:20:20 2012 +0400

    String -> OUString
    
    Change-Id: I23e0181c1aefc9efbac81216a18cdd7042a7679e

diff --git a/starmath/inc/parse.hxx b/starmath/inc/parse.hxx
index e3a8d23..d5affc7 100644
--- a/starmath/inc/parse.hxx
+++ b/starmath/inc/parse.hxx
@@ -111,7 +111,7 @@ enum SmTokenType
 struct SmToken
 {
 
-    String          aText;      // token text
+    OUString        aText;      // token text
     SmTokenType     eType;      // token info
     sal_Unicode cMathChar;
 
diff --git a/starmath/source/cursor.cxx b/starmath/source/cursor.cxx
index 8ba0529..4c91b8a 100644
--- a/starmath/source/cursor.cxx
+++ b/starmath/source/cursor.cxx
@@ -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:
diff --git a/starmath/source/mathmlimport.cxx b/starmath/source/mathmlimport.cxx
index b63eab5..6bc1b93 100644
--- a/starmath/source/mathmlimport.cxx
+++ b/starmath/source/mathmlimport.cxx
@@ -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);
diff --git a/starmath/source/node.cxx b/starmath/source/node.cxx
index 47adc29..6710666 100644
--- a/starmath/source/node.cxx
+++ b/starmath/source/node.cxx
@@ -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();
diff --git a/starmath/source/parse.cxx b/starmath/source/parse.cxx
index 6fcf817..f783c71 100644
--- a/starmath/source/parse.cxx
+++ b/starmath/source/parse.cxx
@@ -88,7 +88,7 @@ SmToken::SmToken(SmTokenType eTokenType,
                  sal_uInt16 nTokenLevel) {
     eType = eTokenType;
     cMathChar = cMath;
-    aText.AssignAscii(pText);
+    aText = OUString::createFromAscii(pText);
     nGroup = nTokenGroup;
     nLevel = nTokenLevel;
     nCol = nRow = 0;
@@ -491,7 +491,7 @@ void SmParser::NextToken()
         m_aCurToken.cMathChar = '\0';
         m_aCurToken.nGroup       = 0;
         m_aCurToken.nLevel       = 0;
-        m_aCurToken.aText.Erase();
+        m_aCurToken.aText = "";
     }
     else if ((aRes.TokenType & (KParseType::ASC_NUMBER | KParseType::UNI_NUMBER))
              || (bNumStart && (aRes.TokenType & KParseType::IDENTNAME)))
@@ -534,7 +534,7 @@ void SmParser::NextToken()
             m_aCurToken.cMathChar  = pEntry->cMathChar;
             m_aCurToken.nGroup     = pEntry->nGroup;
             m_aCurToken.nLevel     = pEntry->nLevel;
-            m_aCurToken.aText.AssignAscii( pEntry->pIdent );
+            m_aCurToken.aText      = OUString::createFromAscii( pEntry->pIdent );
         }
         else
         {
@@ -558,7 +558,7 @@ void SmParser::NextToken()
         m_aCurToken.cMathChar = '\0';
         m_aCurToken.nGroup       = TGPOWER;
         m_aCurToken.nLevel       = 0;
-        m_aCurToken.aText.AssignAscii( "_" );
+        m_aCurToken.aText = "_";
 
         aRes.EndPos = nRealStart + 1;
     }
@@ -581,7 +581,7 @@ void SmParser::NextToken()
                             m_aCurToken.cMathChar = MS_LL;
                             m_aCurToken.nGroup       = TGRELATION;
                             m_aCurToken.nLevel       = 0;
-                            m_aCurToken.aText.AssignAscii( "<<" );
+                            m_aCurToken.aText = "<<";
 
                             rnEndPos = nRealStart + 2;
                         }
@@ -592,7 +592,7 @@ void SmParser::NextToken()
                             m_aCurToken.cMathChar = MS_LE;
                             m_aCurToken.nGroup       = TGRELATION;
                             m_aCurToken.nLevel       = 0;
-                            m_aCurToken.aText.AssignAscii( "<=" );
+                            m_aCurToken.aText = "<=";
 
                             rnEndPos = nRealStart + 2;
                         }
@@ -603,7 +603,7 @@ void SmParser::NextToken()
                             m_aCurToken.cMathChar = MS_NEQ;
                             m_aCurToken.nGroup       = TGRELATION;
                             m_aCurToken.nLevel       = 0;
-                            m_aCurToken.aText.AssignAscii( "<>" );
+                            m_aCurToken.aText = "<>";
 
                             rnEndPos = nRealStart + 2;
                         }
@@ -614,7 +614,7 @@ void SmParser::NextToken()
                             m_aCurToken.cMathChar = MS_PLACE;
                             m_aCurToken.nGroup       = 0;
                             m_aCurToken.nLevel       = 5;
-                            m_aCurToken.aText.AssignAscii( "<?>" );
+                            m_aCurToken.aText = "<?>";
 
                             rnEndPos = nRealStart + 3;
                         }
@@ -624,7 +624,7 @@ void SmParser::NextToken()
                             m_aCurToken.cMathChar = MS_LT;
                             m_aCurToken.nGroup       = TGRELATION;
                             m_aCurToken.nLevel       = 0;
-                            m_aCurToken.aText.AssignAscii( "<" );
+                            m_aCurToken.aText = "<";
                         }
                     }
                     break;
@@ -637,7 +637,7 @@ void SmParser::NextToken()
                             m_aCurToken.cMathChar = MS_GE;
                             m_aCurToken.nGroup       = TGRELATION;
                             m_aCurToken.nLevel       = 0;
-                            m_aCurToken.aText.AssignAscii( ">=" );
+                            m_aCurToken.aText = ">=";
 
                             rnEndPos = nRealStart + 2;
                         }
@@ -648,7 +648,7 @@ void SmParser::NextToken()
                             m_aCurToken.cMathChar = MS_GG;
                             m_aCurToken.nGroup       = TGRELATION;
                             m_aCurToken.nLevel       = 0;
-                            m_aCurToken.aText.AssignAscii( ">>" );
+                            m_aCurToken.aText = ">>";
 
                             rnEndPos = nRealStart + 2;
                         }
@@ -658,7 +658,7 @@ void SmParser::NextToken()
                             m_aCurToken.cMathChar = MS_GT;
                             m_aCurToken.nGroup       = TGRELATION;
                             m_aCurToken.nLevel       = 0;
-                            m_aCurToken.aText.AssignAscii( ">" );
+                            m_aCurToken.aText = ">";
                         }
                     }
                     break;
@@ -734,7 +734,7 @@ void SmParser::NextToken()
                         m_aCurToken.cMathChar = MS_LBRACKET;
                         m_aCurToken.nGroup       = TGLBRACES;
                         m_aCurToken.nLevel       = 5;
-                        m_aCurToken.aText.AssignAscii( "[" );
+                        m_aCurToken.aText = "[";
                     }
                     break;
                 case '\\':
@@ -743,7 +743,7 @@ void SmParser::NextToken()
                         m_aCurToken.cMathChar = '\0';
                         m_aCurToken.nGroup       = 0;
                         m_aCurToken.nLevel       = 5;
-                        m_aCurToken.aText.AssignAscii( "\\" );
+                        m_aCurToken.aText = "\\";
                     }
                     break;
                 case ']':
@@ -752,7 +752,7 @@ void SmParser::NextToken()
                         m_aCurToken.cMathChar = MS_RBRACKET;
                         m_aCurToken.nGroup       = TGRBRACES;
                         m_aCurToken.nLevel       = 0;
-                        m_aCurToken.aText.AssignAscii( "]" );
+                        m_aCurToken.aText = "]";
                     }
                     break;
                 case '^':
@@ -761,7 +761,7 @@ void SmParser::NextToken()
                         m_aCurToken.cMathChar = '\0';
                         m_aCurToken.nGroup       = TGPOWER;
                         m_aCurToken.nLevel       = 0;
-                        m_aCurToken.aText.AssignAscii( "^" );
+                        m_aCurToken.aText = "^";
                     }
                     break;
                 case '`':
@@ -770,7 +770,7 @@ void SmParser::NextToken()
                         m_aCurToken.cMathChar = '\0';
                         m_aCurToken.nGroup       = TGBLANK;
                         m_aCurToken.nLevel       = 5;
-                        m_aCurToken.aText.AssignAscii( "`" );
+                        m_aCurToken.aText = "`";
                     }
                     break;
                 case '{':
@@ -779,7 +779,7 @@ void SmParser::NextToken()
                         m_aCurToken.cMathChar = MS_LBRACE;
                         m_aCurToken.nGroup       = 0;
                         m_aCurToken.nLevel       = 5;
-                        m_aCurToken.aText.AssignAscii( "{" );
+                        m_aCurToken.aText = "{";
                     }
                     break;
                 case '|':
@@ -788,7 +788,7 @@ void SmParser::NextToken()
                         m_aCurToken.cMathChar = MS_OR;
                         m_aCurToken.nGroup       = TGSUM;
                         m_aCurToken.nLevel       = 0;
-                        m_aCurToken.aText.AssignAscii( "|" );
+                        m_aCurToken.aText = "|";
                     }
                     break;
                 case '}':
@@ -797,7 +797,7 @@ void SmParser::NextToken()
                         m_aCurToken.cMathChar = MS_RBRACE;
                         m_aCurToken.nGroup       = 0;
                         m_aCurToken.nLevel       = 0;
-                        m_aCurToken.aText.AssignAscii( "}" );
+                        m_aCurToken.aText = "}";
                     }
                     break;
                 case '~':
@@ -806,7 +806,7 @@ void SmParser::NextToken()
                         m_aCurToken.cMathChar = '\0';
                         m_aCurToken.nGroup       = TGBLANK;
                         m_aCurToken.nLevel       = 5;
-                        m_aCurToken.aText.AssignAscii( "~" );
+                        m_aCurToken.aText = "~";
                     }
                     break;
                 case '#':
@@ -818,7 +818,7 @@ void SmParser::NextToken()
                             m_aCurToken.cMathChar = '\0';
                             m_aCurToken.nGroup       = 0;
                             m_aCurToken.nLevel       = 0;
-                            m_aCurToken.aText.AssignAscii( "##" );
+                            m_aCurToken.aText = "##";
 
                             rnEndPos = nRealStart + 2;
                         }
@@ -828,7 +828,7 @@ void SmParser::NextToken()
                             m_aCurToken.cMathChar = '\0';
                             m_aCurToken.nGroup       = 0;
                             m_aCurToken.nLevel       = 0;
-                            m_aCurToken.aText.AssignAscii( "#" );
+                            m_aCurToken.aText = "#";
                         }
                     }
                     break;
@@ -838,7 +838,7 @@ void SmParser::NextToken()
                         m_aCurToken.cMathChar = MS_AND;
                         m_aCurToken.nGroup       = TGPRODUCT;
                         m_aCurToken.nLevel       = 0;
-                        m_aCurToken.aText.AssignAscii( "&" );
+                        m_aCurToken.aText = "&";
                     }
                     break;
                 case '(':
@@ -847,7 +847,7 @@ void SmParser::NextToken()
                         m_aCurToken.cMathChar = MS_LPARENT;
                         m_aCurToken.nGroup       = TGLBRACES;
                         m_aCurToken.nLevel       = 5;     //! 0 to continue expression
-                        m_aCurToken.aText.AssignAscii( "(" );
+                        m_aCurToken.aText = "(";
                     }
                     break;
                 case ')':
@@ -856,7 +856,7 @@ void SmParser::NextToken()
                         m_aCurToken.cMathChar = MS_RPARENT;
                         m_aCurToken.nGroup       = TGRBRACES;
                         m_aCurToken.nLevel       = 0;     //! 0 to terminate expression
-                        m_aCurToken.aText.AssignAscii( ")" );
+                        m_aCurToken.aText = ")";
                     }
                     break;
                 case '*':
@@ -865,7 +865,7 @@ void SmParser::NextToken()
                         m_aCurToken.cMathChar = MS_MULTIPLY;
                         m_aCurToken.nGroup       = TGPRODUCT;
                         m_aCurToken.nLevel       = 0;
-                        m_aCurToken.aText.AssignAscii( "*" );
+                        m_aCurToken.aText = "*";
                     }
                     break;
                 case '+':
@@ -877,7 +877,7 @@ void SmParser::NextToken()
                             m_aCurToken.cMathChar = MS_PLUSMINUS;
                             m_aCurToken.nGroup       = TGUNOPER | TGSUM;
                             m_aCurToken.nLevel       = 5;
-                            m_aCurToken.aText.AssignAscii( "+-" );
+                            m_aCurToken.aText = "+-";
 
                             rnEndPos = nRealStart + 2;
                         }
@@ -887,7 +887,7 @@ void SmParser::NextToken()
                             m_aCurToken.cMathChar = MS_PLUS;
                             m_aCurToken.nGroup       = TGUNOPER | TGSUM;
                             m_aCurToken.nLevel       = 5;
-                            m_aCurToken.aText.AssignAscii( "+" );
+                            m_aCurToken.aText = "+";
                         }
                     }
                     break;
@@ -900,7 +900,7 @@ void SmParser::NextToken()
                             m_aCurToken.cMathChar = MS_MINUSPLUS;
                             m_aCurToken.nGroup       = TGUNOPER | TGSUM;
                             m_aCurToken.nLevel       = 5;
-                            m_aCurToken.aText.AssignAscii( "-+" );
+                            m_aCurToken.aText = "-+";
 
                             rnEndPos = nRealStart + 2;
                         }
@@ -910,7 +910,7 @@ void SmParser::NextToken()
                             m_aCurToken.cMathChar = MS_MINUS;
                             m_aCurToken.nGroup       = TGUNOPER | TGSUM;
                             m_aCurToken.nLevel       = 5;
-                            m_aCurToken.aText.AssignAscii( "-" );
+                            m_aCurToken.aText = "-";
                         }
                     }
                     break;
@@ -943,7 +943,7 @@ void SmParser::NextToken()
                         m_aCurToken.cMathChar = MS_SLASH;
                         m_aCurToken.nGroup       = TGPRODUCT;
                         m_aCurToken.nLevel       = 0;
-                        m_aCurToken.aText.AssignAscii( "/" );
+                        m_aCurToken.aText = "/";
                     }
                     break;
                 case '=':
@@ -952,7 +952,7 @@ void SmParser::NextToken()
                         m_aCurToken.cMathChar = MS_ASSIGN;
                         m_aCurToken.nGroup       = TGRELATION;
                         m_aCurToken.nLevel       = 0;
-                        m_aCurToken.aText.AssignAscii( "=" );
+                        m_aCurToken.aText = "=";
                     }
                     break;
                 default:
@@ -1036,7 +1036,7 @@ void SmParser::Align()
                 if (TokenInGroup(TGDISCARDED) || pSNode)
                 {
                     m_nBufferIndex = GetTokenIndex();
-                    m_aBufferString.Erase(m_nBufferIndex, m_aCurToken.aText.Len());
+                    m_aBufferString.Erase(m_nBufferIndex, m_aCurToken.aText.getLength());
                 }
                 else
                     pSNode = new SmAlignNode(m_aCurToken);
@@ -1673,7 +1673,7 @@ void SmParser::Oper()
                         break;
                 }
                 if( pLim )
-                    m_aCurToken.aText.AssignAscii( pLim );
+                    m_aCurToken.aText = OUString::createFromAscii(pLim);
                 pNode = new SmTextNode(m_aCurToken, FNT_TEXT);
             }
             break;
@@ -2314,31 +2314,31 @@ void SmParser::Matrix()
 void SmParser::Special()
 {
     bool bReplace = false;
-    String &rName = m_aCurToken.aText;
-    String aNewName;
+    OUString &rName = m_aCurToken.aText;
+    OUString aNewName;
 
     if (CONVERT_NONE == GetConversion())
     {
         // conversion of symbol names for 6.0 (XML) file format
         // (name change on import / export.
         // UI uses localized names XML file format does not.)
-        if( rName.Len() && rName.GetChar( 0 ) == sal_Unicode( '%' ) )
+        if (!rName.isEmpty() && rName[0] == '%')
         {
             if (IsImportSymbolNames())
             {
                 const SmLocalizedSymbolData &rLSD = SM_MOD()->GetLocSymbolData();
-                aNewName = rLSD.GetUiSymbolName( rName.Copy( 1 ) );
+                aNewName = rLSD.GetUiSymbolName(rName.copy(1));
                 bReplace = true;
             }
             else if (IsExportSymbolNames())
             {
                 const SmLocalizedSymbolData &rLSD = SM_MOD()->GetLocSymbolData();
-                aNewName = rLSD.GetExportSymbolName( rName.Copy( 1 ) );
+                aNewName = rLSD.GetExportSymbolName(rName.copy(1));
                 bReplace = true;
             }
         }
-        if( aNewName.Len() )
-            aNewName.Insert( '%', 0 );
+        if (!aNewName.isEmpty())
+            aNewName = "%" + aNewName;
     }
     else    // 5.0 <-> 6.0 formula text (symbol name) conversion
     {
@@ -2375,15 +2375,15 @@ void SmParser::Special()
         // conversion not necessary
     }
 
-    if (bReplace  &&  aNewName.Len()  &&  rName != aNewName)
+    if (bReplace && !aNewName.isEmpty() && rName != aNewName)
     {
-        Replace( GetTokenIndex(), rName.Len(), aNewName );
+        Replace(GetTokenIndex(), rName.getLength(), aNewName);
         rName = aNewName;
     }
 
     // add symbol name to list of used symbols
-    const String aSymbolName( m_aCurToken.aText.Copy( 1 ) );
-    if (aSymbolName.Len() > 0 )
+    const OUString aSymbolName(m_aCurToken.aText.copy(1));
+    if (!aSymbolName.isEmpty())
         AddToUsedSymbols( aSymbolName );
 
     m_aNodeStack.push(new SmSpecialNode(m_aCurToken));
diff --git a/starmath/source/view.cxx b/starmath/source/view.cxx
index 58e031a..2c12b3c 100644
--- a/starmath/source/view.cxx
+++ b/starmath/source/view.cxx
@@ -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);


More information about the Libreoffice-commits mailing list