diff options
author | Ivan Timofeev <timofeev.i.s@gmail.com> | 2012-10-01 20:46:34 +0400 |
---|---|---|
committer | Ivan Timofeev <timofeev.i.s@gmail.com> | 2012-10-01 20:59:50 +0400 |
commit | fa614231733800f4a961b77e36c86f8840d12251 (patch) | |
tree | bdf3877711bb11bd9326e67b0f1640f93cea2ba0 /starmath | |
parent | fdo#50163 move definition of PLATFORMID into configure.in (diff) | |
download | core-fa614231733800f4a961b77e36c86f8840d12251.tar.gz core-fa614231733800f4a961b77e36c86f8840d12251.zip |
String -> OUString
Change-Id: Ie5e800df0c7663e6bb62a2019cf2fd8b0c1ae772
Diffstat (limited to 'starmath')
-rw-r--r-- | starmath/inc/caret.hxx | 2 | ||||
-rw-r--r-- | starmath/inc/node.hxx | 20 | ||||
-rw-r--r-- | starmath/source/cursor.cxx | 34 | ||||
-rw-r--r-- | starmath/source/mathmlexport.cxx | 16 | ||||
-rw-r--r-- | starmath/source/mathtype.cxx | 22 | ||||
-rw-r--r-- | starmath/source/node.cxx | 20 | ||||
-rw-r--r-- | starmath/source/ooxmlexport.cxx | 12 | ||||
-rw-r--r-- | starmath/source/rtfexport.cxx | 10 | ||||
-rw-r--r-- | starmath/source/visitors.cxx | 16 | ||||
-rw-r--r-- | starmath/source/wordexportbase.cxx | 2 |
10 files changed, 77 insertions, 77 deletions
diff --git a/starmath/inc/caret.hxx b/starmath/inc/caret.hxx index b97e00305e36..c38685d1a326 100644 --- a/starmath/inc/caret.hxx +++ b/starmath/inc/caret.hxx @@ -64,7 +64,7 @@ struct SmCaretPos{ */ static SmCaretPos GetPosAfter(SmNode* pNode) { if(pNode && pNode->GetType() == NTEXT) - return SmCaretPos(pNode, ((SmTextNode*)pNode)->GetText().Len()); + return SmCaretPos(pNode, ((SmTextNode*)pNode)->GetText().getLength()); return SmCaretPos(pNode, 1); } }; diff --git a/starmath/inc/node.hxx b/starmath/inc/node.hxx index 78167251c563..45c96696d433 100644 --- a/starmath/inc/node.hxx +++ b/starmath/inc/node.hxx @@ -443,16 +443,16 @@ public: */ class SmTextNode : public SmVisibleNode { - XubString aText; + OUString aText; sal_uInt16 nFontDesc; /** Index within text where the selection starts * @remarks Only valid if SmNode::IsSelected() is true */ - xub_StrLen nSelectionStart; + sal_Int32 nSelectionStart; /** Index within text where the selection ends * @remarks Only valid if SmNode::IsSelected() is true */ - xub_StrLen nSelectionEnd; + sal_Int32 nSelectionEnd; protected: SmTextNode(SmNodeType eNodeType, const SmToken &rNodeToken, sal_uInt16 nFontDescP ); @@ -461,10 +461,10 @@ public: SmTextNode(const SmToken &rNodeToken, sal_uInt16 nFontDescP ); sal_uInt16 GetFontDesc() const { return nFontDesc; } - void SetText(const XubString &rText) { aText = rText; } - const XubString & GetText() const { return aText; } + void SetText(const OUString &rText) { aText = rText; } + const OUString & GetText() const { return aText; } /** Change the text of this node, including the underlying token */ - void ChangeText(const XubString &rText) { + void ChangeText(const OUString &rText) { aText = rText; SmToken token = GetToken(); token.aText = rText; @@ -476,15 +476,15 @@ public: /** Index within GetText() where the selection starts * @remarks Only valid of SmNode::IsSelected() is true */ - xub_StrLen GetSelectionStart() const {return nSelectionStart;} + sal_Int32 GetSelectionStart() const {return nSelectionStart;} /** Index within GetText() where the selection end * @remarks Only valid of SmNode::IsSelected() is true */ - xub_StrLen GetSelectionEnd() const {return nSelectionEnd;} + sal_Int32 GetSelectionEnd() const {return nSelectionEnd;} /** Set the index within GetText() where the selection starts */ - void SetSelectionStart(xub_StrLen index) {nSelectionStart = index;} + void SetSelectionStart(sal_Int32 index) {nSelectionStart = index;} /** Set the index within GetText() where the selection end */ - void SetSelectionEnd(xub_StrLen index) {nSelectionEnd = index;} + void SetSelectionEnd(sal_Int32 index) {nSelectionEnd = index;} virtual void Prepare(const SmFormat &rFormat, const SmDocShell &rDocShell); virtual void Arrange(const OutputDevice &rDev, const SmFormat &rFormat); diff --git a/starmath/source/cursor.cxx b/starmath/source/cursor.cxx index de674f491b77..c3514ad6e873 100644 --- a/starmath/source/cursor.cxx +++ b/starmath/source/cursor.cxx @@ -338,7 +338,7 @@ void SmCursor::InsertNodes(SmNodeList* pNewNodes){ if(newIt == pNewNodes->begin()) patchIt = insIt; if((*newIt)->GetType() == NTEXT) - PosAfterInsert = SmCaretPos(*newIt, ((SmTextNode*)*newIt)->GetText().Len()); + PosAfterInsert = SmCaretPos(*newIt, ((SmTextNode*)*newIt)->GetText().getLength()); else PosAfterInsert = SmCaretPos(*newIt, 1); } @@ -362,12 +362,12 @@ SmNodeList::iterator SmCursor::FindPositionInLineList(SmNodeList* pLineList, SmC //Split textnode if needed if(aCaretPos.Index > 0){ SmTextNode* pText = (SmTextNode*)aCaretPos.pSelectedNode; - XubString str1 = pText->GetText().Copy(0, aCaretPos.Index); - XubString str2 = pText->GetText().Copy(aCaretPos.Index); + OUString str1 = pText->GetText().copy(0, aCaretPos.Index); + OUString str2 = pText->GetText().copy(aCaretPos.Index); pText->ChangeText(str1); ++it; //Insert str2 as new text node - if(str2.Len() > 0){ + if(!str2.isEmpty()){ SmTextNode* pNewText = new SmTextNode(pText->GetToken(), pText->GetFontDesc()); pNewText->ChangeText(str2); it = pLineList->insert(it, pNewText); @@ -405,8 +405,8 @@ SmCaretPos SmCursor::PatchLineList(SmNodeList* pLineList, SmNodeList::iterator a next->GetToken().eType == TNUMBER) ){ SmTextNode *pText = (SmTextNode*)prev, *pOldN = (SmTextNode*)next; - SmCaretPos retval(pText, pText->GetText().Len()); - String newText; + SmCaretPos retval(pText, pText->GetText().getLength()); + OUString newText; newText += pText->GetText(); newText += pOldN->GetText(); pText->ChangeText(newText); @@ -426,14 +426,14 @@ SmCaretPos SmCursor::PatchLineList(SmNodeList* pLineList, SmNodeList::iterator a if(aIter == pLineList->begin()) return SmCaretPos(); if((*aIter)->GetType() == NTEXT) - return SmCaretPos(*aIter, ((SmTextNode*)*aIter)->GetText().Len()); + return SmCaretPos(*aIter, ((SmTextNode*)*aIter)->GetText().getLength()); return SmCaretPos(*aIter, 1); } if(prev && next && next->GetType() == NPLACE && !SmNodeListParser::IsOperator(prev->GetToken())){ aIter = pLineList->erase(aIter); delete next; if(prev->GetType() == NTEXT) - return SmCaretPos(prev, ((SmTextNode*)prev)->GetText().Len()); + return SmCaretPos(prev, ((SmTextNode*)prev)->GetText().getLength()); return SmCaretPos(prev, 1); } @@ -441,7 +441,7 @@ SmCaretPos SmCursor::PatchLineList(SmNodeList* pLineList, SmNodeList::iterator a if(!prev) //return an invalid to indicate we're in front of line return SmCaretPos(); if(prev->GetType() == NTEXT) - return SmCaretPos(prev, ((SmTextNode*)prev)->GetText().Len()); + return SmCaretPos(prev, ((SmTextNode*)prev)->GetText().getLength()); return SmCaretPos(prev, 1); } @@ -454,19 +454,19 @@ SmNodeList::iterator SmCursor::TakeSelectedNodesFromList(SmNodeList *pLineList, //Split text nodes if((*it)->GetType() == NTEXT) { SmTextNode* pText = (SmTextNode*)*it; - String aText = pText->GetText(); + OUString aText = pText->GetText(); //Start and lengths of the segments, 2 is the selected segment int start2 = pText->GetSelectionStart(), start3 = pText->GetSelectionEnd(), len1 = start2 - 0, len2 = start3 - start2, - len3 = aText.Len() - start3; + len3 = aText.getLength() - start3; SmToken aToken = pText->GetToken(); sal_uInt16 eFontDesc = pText->GetFontDesc(); //If we need make segment 1 if(len1 > 0) { int start1 = 0; - String str = aText.Copy(start1, len1); + OUString str = aText.copy(start1, len1); pText->ChangeText(str); ++it; } else {//Remove it if not needed @@ -477,14 +477,14 @@ SmNodeList::iterator SmCursor::TakeSelectedNodesFromList(SmNodeList *pLineList, retval = it; //if we need make segment 3 if(len3 > 0) { - String str = aText.Copy(start3, len3); + OUString str = aText.copy(start3, len3); SmTextNode* pSeg3 = new SmTextNode(aToken, eFontDesc); pSeg3->ChangeText(str); retval = pLineList->insert(it, pSeg3); } //If we need to save the selected text if(pSelectedNodes && len2 > 0) { - String str = aText.Copy(start2, len2); + String str = aText.copy(start2, len2); SmTextNode* pSeg2 = new SmTextNode(aToken, eFontDesc); pSeg2->ChangeText(str); pSelectedNodes->push_back(pSeg2); @@ -1203,7 +1203,7 @@ void SmCursor::Copy(){ SmTextNode *pClone = new SmTextNode( pText->GetToken(), pText->GetFontDesc() ); int start = pText->GetSelectionStart(), length = pText->GetSelectionEnd() - pText->GetSelectionStart(); - pClone->ChangeText(pText->GetText().Copy(start, length)); + pClone->ChangeText(pText->GetText().copy(start, length)); pClone->SetScaleMode(pText->GetScaleMode()); pList->push_front(pClone); } else { @@ -1323,7 +1323,7 @@ SmNodeList* SmCursor::CloneLineToList(SmStructureNode* pLine, bool bOnlyIfSelect SmTextNode *pClone = new SmTextNode( it->GetToken(), pText->GetFontDesc() ); int start = pText->GetSelectionStart(), length = pText->GetSelectionEnd() - pText->GetSelectionStart(); - pClone->ChangeText(pText->GetText().Copy(start, length)); + pClone->ChangeText(pText->GetText().copy(start, length)); pClone->SetScaleMode(pText->GetScaleMode()); pList->push_back(pClone); } else @@ -1490,7 +1490,7 @@ bool SmCursor::IsAtTailOfBracket(SmBracketType eBracketType, SmBraceNode** ppBra if (pNode->GetType() == NTEXT) { SmTextNode* pTextNode = static_cast<SmTextNode*>(pNode); - if (pos.Index < pTextNode->GetText().Len()) { + if (pos.Index < pTextNode->GetText().getLength()) { // The cursor is on a text node and at the middle of it. return false; } diff --git a/starmath/source/mathmlexport.cxx b/starmath/source/mathmlexport.cxx index 20a3e74bcb0c..2c083680d8a0 100644 --- a/starmath/source/mathmlexport.cxx +++ b/starmath/source/mathmlexport.cxx @@ -824,7 +824,7 @@ void SmXMLExport::ExportMath(const SmNode *pNode, int /*nLevel*/) const SmMathSymbolNode *pTemp = static_cast<const SmMathSymbolNode *>(pNode); SvXMLElementExport aMath(*this, XML_NAMESPACE_MATH, XML_MO, sal_True, sal_False); sal_Unicode nArse[2]; - nArse[0] = pTemp->GetText().GetChar(0); + nArse[0] = pTemp->GetText()[0]; sal_Unicode cTmp = ConvertMathToMathML( nArse[0] ); if (cTmp != 0) nArse[0] = cTmp; @@ -845,9 +845,9 @@ void SmXMLExport::ExportText(const SmNode *pNode, int /*nLevel*/) //Note that we change the fontstyle to italic for strings that //are italic and longer than a single character. sal_Bool bIsItalic = IsItalic( pTemp->GetFont() ); - if ((pTemp->GetText().Len() > 1) && bIsItalic) + if ((pTemp->GetText().getLength() > 1) && bIsItalic) AddAttribute(XML_NAMESPACE_MATH, XML_MATHVARIANT, XML_ITALIC); - else if ((pTemp->GetText().Len() == 1) && !bIsItalic) + else if ((pTemp->GetText().getLength() == 1) && !bIsItalic) AddAttribute(XML_NAMESPACE_MATH, XML_MATHVARIANT, XML_NORMAL); pText = new SvXMLElementExport(*this, XML_NAMESPACE_MATH, XML_MI,sal_True,sal_False); break; @@ -859,7 +859,7 @@ void SmXMLExport::ExportText(const SmNode *pNode, int /*nLevel*/) pText = new SvXMLElementExport(*this, XML_NAMESPACE_MATH, XML_MTEXT,sal_True,sal_False); break; } - GetDocHandler()->characters(OUString(pTemp->GetText().GetBuffer())); + GetDocHandler()->characters(pTemp->GetText()); delete pText; } @@ -1030,11 +1030,11 @@ void SmXMLExport::ExportBrace(const SmNode *pNode, int nLevel) sal_Unicode nArse[2]; nArse[1] = 0; nArse[0] = static_cast< - const SmMathSymbolNode* >(pLeft)->GetText().GetChar(0); + const SmMathSymbolNode* >(pLeft)->GetText()[0]; OSL_ENSURE(nArse[0] != 0xffff,"Non existent symbol"); AddAttribute(XML_NAMESPACE_MATH, XML_OPEN,nArse); nArse[0] = static_cast< - const SmMathSymbolNode* >(pRight)->GetText().GetChar(0); + const SmMathSymbolNode* >(pRight)->GetText()[0]; OSL_ENSURE(nArse[0] != 0xffff,"Non existent symbol"); AddAttribute(XML_NAMESPACE_MATH, XML_CLOSE,nArse); pFences = new SvXMLElementExport(*this, XML_NAMESPACE_MATH, XML_MFENCED, @@ -1406,8 +1406,8 @@ void SmXMLExport::ExportNodes(const SmNode *pNode, int nLevel) { sal_Unicode cTmp = 0; const SmTextNode *pTemp = static_cast< const SmTextNode * >(pNode); - if (pTemp->GetText().Len() > 0) - cTmp = ConvertMathToMathML( pTemp->GetText().GetChar(0) ); + if (!pTemp->GetText().isEmpty()) + cTmp = ConvertMathToMathML( pTemp->GetText()[0] ); if (cTmp == 0) { // no conversion to MathML implemented -> export it as text diff --git a/starmath/source/mathtype.cxx b/starmath/source/mathtype.cxx index 1fb812baf268..69aeabe2ce77 100644 --- a/starmath/source/mathtype.cxx +++ b/starmath/source/mathtype.cxx @@ -1995,7 +1995,7 @@ sal_uInt8 MathType::HandleNodes(SmNode *pNode,int nLevel) SmTextNode *pText=(SmTextNode *)pNode; //if the token str and the result text are the same then this //is to be seen as text, else assume its a mathchar - if (pText->GetText() == pText->GetToken().aText) + if (pText->GetText() == OUString(pText->GetToken().aText)) HandleText(pText,nLevel); else HandleMath(pText,nLevel); @@ -3078,16 +3078,16 @@ void MathType::HandleMath(SmNode *pNode, int /*nLevel*/) return; } SmMathSymbolNode *pTemp=(SmMathSymbolNode *)pNode; - for(xub_StrLen i=0;i<pTemp->GetText().Len();i++) + for(sal_Int32 i=0;i<pTemp->GetText().getLength();i++) { - sal_Unicode nArse = SmTextNode::ConvertSymbolToUnicode(pTemp->GetText().GetChar(i)); + sal_Unicode nArse = SmTextNode::ConvertSymbolToUnicode(pTemp->GetText()[i]); if ((nArse == 0x2224) || (nArse == 0x2288) || (nArse == 0x2285) || (nArse == 0x2289)) { *pS << sal_uInt8(CHAR|0x20); } else if ((nPendingAttributes) && - (i == ((pTemp->GetText().Len()+1)/2)-1)) + (i == ((pTemp->GetText().getLength()+1)/2)-1)) { *pS << sal_uInt8(0x22); } @@ -3209,7 +3209,7 @@ void MathType::HandleAttributes(SmNode *pNode,int nLevel) case TOVERLINE: //If the next node is not text //or text with more than one char if ((pIsText->GetToken().eType != TTEXT) || - (pIsText->GetText().Len() > 1)) + (pIsText->GetText().getLength() > 1)) nOldPending = StartTemplate(0x11); break; default: @@ -3229,7 +3229,7 @@ void MathType::HandleAttributes(SmNode *pNode,int nLevel) break; case TOVERLINE: if ((pIsText->GetToken().eType != TTEXT) || - (pIsText->GetText().Len() > 1)) + (pIsText->GetText().getLength() > 1)) EndTemplate(nOldPending); break; default: @@ -3276,7 +3276,7 @@ void MathType::HandleAttributes(SmNode *pNode,int nLevel) break; case TOVERLINE: if ((pIsText->GetToken().eType == TTEXT) && - (pIsText->GetText().Len() == 1)) + (pIsText->GetText().getLength() == 1)) *pS << sal_uInt8(17); break; case TBREVE: @@ -3302,10 +3302,10 @@ void MathType::HandleAttributes(SmNode *pNode,int nLevel) void MathType::HandleText(SmNode *pNode, int /*nLevel*/) { SmTextNode *pTemp=(SmTextNode *)pNode; - for(xub_StrLen i=0;i<pTemp->GetText().Len();i++) + for(sal_Int32 i=0;i<pTemp->GetText().getLength();i++) { if ((nPendingAttributes) && - (i == ((pTemp->GetText().Len()+1)/2)-1)) + (i == ((pTemp->GetText().getLength()+1)/2)-1)) { *pS << sal_uInt8(0x22); //char, with attributes right //after the character @@ -3319,7 +3319,7 @@ void MathType::HandleText(SmNode *pNode, int /*nLevel*/) else if (pNode->GetFont().GetWeight() == WEIGHT_BOLD) nFace = 0x7; *pS << sal_uInt8(nFace+128); //typeface - sal_uInt16 nChar = pTemp->GetText().GetChar(i); + sal_uInt16 nChar = pTemp->GetText()[i]; *pS << SmTextNode::ConvertSymbolToUnicode(nChar); //Mathtype can only have these sort of character @@ -3335,7 +3335,7 @@ void MathType::HandleText(SmNode *pNode, int /*nLevel*/) //entities which cannot occur in mathtype e.g. a Summation //symbol so these attributes may be lost if ((nPendingAttributes) && - (i == ((pTemp->GetText().Len()+1)/2)-1)) + (i == ((pTemp->GetText().getLength()+1)/2)-1)) { *pS << sal_uInt8(EMBEL); while (nPendingAttributes) diff --git a/starmath/source/node.cxx b/starmath/source/node.cxx index e8bd3b4f5213..eb2883bde514 100644 --- a/starmath/source/node.cxx +++ b/starmath/source/node.cxx @@ -2458,11 +2458,11 @@ void SmTextNode::AdjustFontDesc() nTok = pEntry->eType; nFontDesc = FNT_FUNCTION; } else { - sal_Unicode firstChar = aText.GetChar(0); + sal_Unicode firstChar = aText[0]; if( ('0' <= firstChar && firstChar <= '9') || firstChar == '.' || firstChar == ',') { nFontDesc = FNT_NUMBER; nTok = TNUMBER; - } else if (aText.Len() > 1) { + } else if (aText.getLength() > 1) { nFontDesc = FNT_VARIABLE; nTok = TIDENT; } else { @@ -2734,9 +2734,9 @@ void SmMathSymbolNode::Prepare(const SmFormat &rFormat, const SmDocShell &rDocSh void SmMathSymbolNode::Arrange(const OutputDevice &rDev, const SmFormat &rFormat) { - const XubString &rText = GetText(); + const OUString &rText = GetText(); - if (rText.Len() == 0 || rText.GetChar(0) == xub_Unicode('\0')) + if (rText.isEmpty() || rText[0] == '\0') { SmRect::operator = (SmRect()); return; } @@ -2902,7 +2902,7 @@ void SmSpecialNode::Prepare(const SmFormat &rFormat, const SmDocShell &rDocShell if (NULL != (pSym = pp->GetSymbolManager().GetSymbolByName( aName ))) { sal_UCS4 cChar = pSym->GetCharacter(); - String aTmp( OUString( &cChar, 1 ) ); + OUString aTmp( &cChar, 1 ); SetText( aTmp ); GetFont() = pSym->GetFace(); } @@ -2928,7 +2928,7 @@ void SmSpecialNode::Prepare(const SmFormat &rFormat, const SmDocShell &rDocShell if (bIsFromGreekSymbolSet) { - OSL_ENSURE( GetText().Len() == 1, "a symbol should only consist of 1 char!" ); + OSL_ENSURE( GetText().getLength() == 1, "a symbol should only consist of 1 char!" ); bool bItalic = false; sal_Int16 nStyle = rFormat.GetGreekCharStyle(); OSL_ENSURE( nStyle >= 0 && nStyle <= 2, "unexpected value for GreekCharStyle" ); @@ -2936,12 +2936,12 @@ void SmSpecialNode::Prepare(const SmFormat &rFormat, const SmDocShell &rDocShell bItalic = true; else if (nStyle == 2) { - String aTmp( GetText() ); - if (aTmp.Len() > 0) + const OUString& rTmp(GetText()); + if (rTmp.isEmpty()) { const sal_Unicode cUppercaseAlpha = 0x0391; const sal_Unicode cUppercaseOmega = 0x03A9; - sal_Unicode cChar = aTmp.GetBuffer()[0]; + sal_Unicode cChar = rTmp[0]; // uppercase letters should be straight and lowercase letters italic bItalic = !(cUppercaseAlpha <= cChar && cChar <= cUppercaseOmega); } @@ -3023,7 +3023,7 @@ void SmErrorNode::Arrange(const OutputDevice &rDev, const SmFormat &rFormat) SmTmpDevice aTmpDev ((OutputDevice &) rDev, true); aTmpDev.SetFont(GetFont()); - const XubString &rText = GetText(); + const OUString &rText = GetText(); SmRect::operator = (SmRect(aTmpDev, &rFormat, rText, GetFont().GetBorderWidth())); } diff --git a/starmath/source/ooxmlexport.cxx b/starmath/source/ooxmlexport.cxx index f9b716237461..a918cb295265 100644 --- a/starmath/source/ooxmlexport.cxx +++ b/starmath/source/ooxmlexport.cxx @@ -85,11 +85,11 @@ void SmOoxmlExport::HandleText( const SmNode* pNode, int /*nLevel*/) m_pSerializer->startElementNS( XML_m, XML_t, FSNS( XML_xml, XML_space ), "preserve", FSEND ); SmTextNode* pTemp=(SmTextNode* )pNode; SAL_INFO( "starmath.ooxml", "Text:" << OUStringToOString( pTemp->GetText(), RTL_TEXTENCODING_UTF8 ).getStr()); - for(xub_StrLen i=0;i<pTemp->GetText().Len();i++) + for(sal_Int32 i=0;i<pTemp->GetText().getLength();i++) { #if 0 if ((nPendingAttributes) && - (i == ((pTemp->GetText().Len()+1)/2)-1)) + (i == ((pTemp->GetText().getLength()+1)/2)-1)) { *pS << sal_uInt8(0x22); //char, with attributes right //after the character @@ -104,7 +104,7 @@ void SmOoxmlExport::HandleText( const SmNode* pNode, int /*nLevel*/) nFace = 0x7; *pS << sal_uInt8(nFace+128); //typeface #endif - sal_uInt16 nChar = pTemp->GetText().GetChar(i); + sal_uInt16 nChar = pTemp->GetText()[i]; m_pSerializer->writeEscaped( OUString( SmTextNode::ConvertSymbolToUnicode(nChar))); #if 0 @@ -121,7 +121,7 @@ void SmOoxmlExport::HandleText( const SmNode* pNode, int /*nLevel*/) //entities which cannot occur in mathtype e.g. a Summation //symbol so these attributes may be lost if ((nPendingAttributes) && - (i == ((pTemp->GetText().Len()+1)/2)-1)) + (i == ((pTemp->GetText().getLength()+1)/2)-1)) { *pS << sal_uInt8(EMBEL); while (nPendingAttributes) @@ -250,8 +250,8 @@ static OString mathSymbolToString( const SmNode* node ) { assert( node->GetType() == NMATH ); const SmTextNode* txtnode = static_cast< const SmTextNode* >( node ); - assert( txtnode->GetText().Len() == 1 ); - sal_Unicode chr = SmTextNode::ConvertSymbolToUnicode( txtnode->GetText().GetChar( 0 )); + assert( txtnode->GetText().getLength() == 1 ); + sal_Unicode chr = SmTextNode::ConvertSymbolToUnicode( txtnode->GetText()[0] ); return OUStringToOString( OUString( chr ), RTL_TEXTENCODING_UTF8 ); } diff --git a/starmath/source/rtfexport.cxx b/starmath/source/rtfexport.cxx index 7e37ac39de76..5d9695f71cdc 100644 --- a/starmath/source/rtfexport.cxx +++ b/starmath/source/rtfexport.cxx @@ -73,9 +73,9 @@ void SmRtfExport::HandleText(const SmNode* pNode, int /*nLevel*/) SmTextNode* pTemp=(SmTextNode* )pNode; SAL_INFO("starmath.rtf", "Text: " << pTemp->GetText()); - for (xub_StrLen i = 0; i < pTemp->GetText().Len(); i++) + for (sal_Int32 i = 0; i < pTemp->GetText().getLength(); i++) { - sal_uInt16 nChar = pTemp->GetText().GetChar(i); + sal_uInt16 nChar = pTemp->GetText()[i]; OUString aValue(SmTextNode::ConvertSymbolToUnicode(nChar)); m_pBuffer->append(msfilter::rtfutil::OutString(aValue, m_nEncoding)); } @@ -197,10 +197,10 @@ OString mathSymbolToString(const SmNode* node, rtl_TextEncoding nEncoding) { assert(node->GetType() == NMATH); const SmTextNode* txtnode = static_cast<const SmTextNode*>(node); - if (txtnode->GetText().Len() == 0) + if (txtnode->GetText().isEmpty()) return OString(); - assert(txtnode->GetText().Len() == 1); - sal_Unicode chr = SmTextNode::ConvertSymbolToUnicode(txtnode->GetText().GetChar(0)); + assert(txtnode->GetText().getLength() == 1); + sal_Unicode chr = SmTextNode::ConvertSymbolToUnicode(txtnode->GetText()[0]); OUString aValue(chr); return msfilter::rtfutil::OutString(aValue, nEncoding); } diff --git a/starmath/source/visitors.cxx b/starmath/source/visitors.cxx index f1b835a462ee..dc930ecc65ea 100644 --- a/starmath/source/visitors.cxx +++ b/starmath/source/visitors.cxx @@ -742,7 +742,7 @@ void SmDrawingVisitor::Visit( SmRectangleNode* pNode ) void SmDrawingVisitor::DrawTextNode( SmTextNode* pNode ) { - if ( pNode->IsPhantom( ) || pNode->GetText( ).Len( ) == 0 || pNode->GetText( ).GetChar( 0 ) == xub_Unicode( '\0' ) ) + if ( pNode->IsPhantom() || pNode->GetText().isEmpty() || pNode->GetText()[0] == '\0' ) return; SmTmpDevice2 aTmpDev ( ( OutputDevice & ) rDev, false ); @@ -936,15 +936,15 @@ void SmSetSelectionVisitor::Visit( SmTextNode* pNode ) { IsSelecting = false; } else if( !IsSelecting && i1 != -1 ) { start = i1; - end = pNode->GetText( ).Len( ); + end = pNode->GetText().getLength(); IsSelecting = true; } else if( !IsSelecting && i2 != -1 ) { start = i2; - end = pNode->GetText( ).Len( ); + end = pNode->GetText().getLength(); IsSelecting = true; } else if( IsSelecting ) { start = 0; - end = pNode->GetText( ).Len( ); + end = pNode->GetText().getLength(); } else { pNode->SetSelected( false ); start = 0; @@ -1329,9 +1329,9 @@ void SmCaretPosGraphBuildingVisitor::Visit( SmMatrixNode* pNode ) */ void SmCaretPosGraphBuildingVisitor::Visit( SmTextNode* pNode ) { - OSL_ENSURE( pNode->GetText( ).Len( ) > 0, "Empty SmTextNode is bad" ); + OSL_ENSURE( !pNode->GetText().isEmpty(), "Empty SmTextNode is bad" ); - int size = pNode->GetText( ).Len( ); + int size = pNode->GetText().getLength(); for( int i = 1; i <= size; i++ ){ SmCaretPosGraphEntry* pRight = pRightMost; pRightMost = pGraph->Add( SmCaretPos( pNode, i ), pRight ); @@ -2302,10 +2302,10 @@ void SmNodeToTextVisitor::Visit( SmFontNode* pNode ) default: break; } - Append( String( ::rtl::math::doubleToUString( + Append( ::rtl::math::doubleToUString( static_cast<double>( pNode->GetSizeParameter( ) ), rtl_math_StringFormat_Automatic, - rtl_math_DecimalPlaces_Max, '.', sal_True ) ) ); + rtl_math_DecimalPlaces_Max, '.', sal_True ) ); Append( " " ); } break; diff --git a/starmath/source/wordexportbase.cxx b/starmath/source/wordexportbase.cxx index 3181697edf9f..1e720b4b6f1c 100644 --- a/starmath/source/wordexportbase.cxx +++ b/starmath/source/wordexportbase.cxx @@ -77,7 +77,7 @@ void SmWordExportBase::HandleNode( const SmNode* pNode, int nLevel ) const SmTextNode* pText= static_cast< const SmTextNode* >( pNode ); //if the token str and the result text are the same then this //is to be seen as text, else assume its a mathchar - if (pText->GetText() == pText->GetToken().aText) + if (pText->GetText() == OUString(pText->GetToken().aText)) HandleText(pText,nLevel); else HandleMath(pText,nLevel); |