[Libreoffice-commits] core.git: starmath/inc starmath/source
Takeshi Abe
tabe at fixedpoint.jp
Fri Dec 2 02:35:12 UTC 2016
starmath/inc/node.hxx | 24 ++++++++++++------------
starmath/source/node.cxx | 36 ++++++++++++++++++------------------
2 files changed, 30 insertions(+), 30 deletions(-)
New commits:
commit 7d1be94484fa99bbfbaa0261cc243778a70b298e
Author: Takeshi Abe <tabe at fixedpoint.jp>
Date: Thu Dec 1 18:55:58 2016 +0900
starmath: Prefix members of SmTextNode
Change-Id: Ic2509e7ee4040fec8173861f319bce61804837cf
Reviewed-on: https://gerrit.libreoffice.org/31468
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Takeshi Abe <tabe at fixedpoint.jp>
diff --git a/starmath/inc/node.hxx b/starmath/inc/node.hxx
index 52532c9..e3067b7 100644
--- a/starmath/inc/node.hxx
+++ b/starmath/inc/node.hxx
@@ -376,16 +376,16 @@ public:
*/
class SmTextNode : public SmVisibleNode
{
- OUString aText;
- sal_uInt16 nFontDesc;
+ OUString maText;
+ sal_uInt16 mnFontDesc;
/** Index within text where the selection starts
* @remarks Only valid if SmNode::IsSelected() is true
*/
- sal_Int32 nSelectionStart;
+ sal_Int32 mnSelectionStart;
/** Index within text where the selection ends
* @remarks Only valid if SmNode::IsSelected() is true
*/
- sal_Int32 nSelectionEnd;
+ sal_Int32 mnSelectionEnd;
protected:
SmTextNode(SmNodeType eNodeType, const SmToken &rNodeToken, sal_uInt16 nFontDescP );
@@ -393,12 +393,12 @@ protected:
public:
SmTextNode(const SmToken &rNodeToken, sal_uInt16 nFontDescP );
- sal_uInt16 GetFontDesc() const { return nFontDesc; }
- void SetText(const OUString &rText) { aText = rText; }
- const OUString & GetText() const { return aText; }
+ sal_uInt16 GetFontDesc() const { return mnFontDesc; }
+ void SetText(const OUString &rText) { maText = rText; }
+ const OUString & GetText() const { return maText; }
/** Change the text of this node, including the underlying token */
void ChangeText(const OUString &rText) {
- aText = rText;
+ maText = rText;
SmToken token = GetToken();
token.aText = rText;
SetToken(token); //TODO: Merge this with AdjustFontDesc for better performance
@@ -409,15 +409,15 @@ public:
/** Index within GetText() where the selection starts
* @remarks Only valid of SmNode::IsSelected() is true
*/
- sal_Int32 GetSelectionStart() const {return nSelectionStart;}
+ sal_Int32 GetSelectionStart() const {return mnSelectionStart;}
/** Index within GetText() where the selection end
* @remarks Only valid of SmNode::IsSelected() is true
*/
- sal_Int32 GetSelectionEnd() const {return nSelectionEnd;}
+ sal_Int32 GetSelectionEnd() const {return mnSelectionEnd;}
/** Set the index within GetText() where the selection starts */
- void SetSelectionStart(sal_Int32 index) {nSelectionStart = index;}
+ void SetSelectionStart(sal_Int32 index) {mnSelectionStart = index;}
/** Set the index within GetText() where the selection end */
- void SetSelectionEnd(sal_Int32 index) {nSelectionEnd = index;}
+ void SetSelectionEnd(sal_Int32 index) {mnSelectionEnd = index;}
virtual void Prepare(const SmFormat &rFormat, const SmDocShell &rDocShell) override;
virtual void Arrange(OutputDevice &rDev, const SmFormat &rFormat) override;
diff --git a/starmath/source/node.cxx b/starmath/source/node.cxx
index 4ca990f..023f523 100644
--- a/starmath/source/node.cxx
+++ b/starmath/source/node.cxx
@@ -2037,17 +2037,17 @@ void SmRectangleNode::Arrange(OutputDevice &rDev, const SmFormat &/*rFormat*/)
SmTextNode::SmTextNode( SmNodeType eNodeType, const SmToken &rNodeToken, sal_uInt16 nFontDescP )
: SmVisibleNode(eNodeType, rNodeToken)
- , nFontDesc(nFontDescP)
- , nSelectionStart(0)
- , nSelectionEnd(0)
+ , mnFontDesc(nFontDescP)
+ , mnSelectionStart(0)
+ , mnSelectionEnd(0)
{
}
SmTextNode::SmTextNode( const SmToken &rNodeToken, sal_uInt16 nFontDescP )
: SmVisibleNode(NTEXT, rNodeToken)
- , nFontDesc(nFontDescP)
- , nSelectionStart(0)
- , nSelectionEnd(0)
+ , mnFontDesc(nFontDescP)
+ , mnSelectionStart(0)
+ , mnSelectionEnd(0)
{
}
@@ -2061,7 +2061,7 @@ void SmTextNode::Prepare(const SmFormat &rFormat, const SmDocShell &rDocShell)
if (TTEXT == GetToken().eType)
SetRectHorAlign( RectHorAlign::Left );
- aText = GetToken().aText;
+ maText = GetToken().aText;
GetFont() = rFormat.GetFont(GetFontDesc());
if (IsItalic( GetFont() ))
@@ -2088,7 +2088,7 @@ void SmTextNode::Arrange(OutputDevice &rDev, const SmFormat &rFormat)
SmTmpDevice aTmpDev (rDev, true);
aTmpDev.SetFont(GetFont());
- SmRect::operator = (SmRect(aTmpDev, &rFormat, aText, GetFont().GetBorderWidth()));
+ SmRect::operator = (SmRect(aTmpDev, &rFormat, maText, GetFont().GetBorderWidth()));
}
void SmTextNode::CreateTextFromNode(OUString &rText)
@@ -2140,31 +2140,31 @@ void SmTextNode::CreateTextFromNode(OUString &rText)
void SmTextNode::GetAccessibleText( OUStringBuffer &rText ) const
{
- rText.append(aText);
+ rText.append(maText);
}
void SmTextNode::AdjustFontDesc()
{
if (GetToken().eType == TTEXT)
- nFontDesc = FNT_TEXT;
+ mnFontDesc = FNT_TEXT;
else if(GetToken().eType == TFUNC)
- nFontDesc = FNT_FUNCTION;
+ mnFontDesc = FNT_FUNCTION;
else {
SmTokenType nTok;
- const SmTokenTableEntry *pEntry = SmParser::GetTokenTableEntry( aText );
+ const SmTokenTableEntry *pEntry = SmParser::GetTokenTableEntry( maText );
if (pEntry && pEntry->nGroup == TG::Function) {
nTok = pEntry->eType;
- nFontDesc = FNT_FUNCTION;
+ mnFontDesc = FNT_FUNCTION;
} else {
- sal_Unicode firstChar = aText[0];
+ sal_Unicode firstChar = maText[0];
if( ('0' <= firstChar && firstChar <= '9') || firstChar == '.' || firstChar == ',') {
- nFontDesc = FNT_NUMBER;
+ mnFontDesc = FNT_NUMBER;
nTok = TNUMBER;
- } else if (aText.getLength() > 1) {
- nFontDesc = FNT_VARIABLE;
+ } else if (maText.getLength() > 1) {
+ mnFontDesc = FNT_VARIABLE;
nTok = TIDENT;
} else {
- nFontDesc = FNT_VARIABLE;
+ mnFontDesc = FNT_VARIABLE;
nTok = TCHARACTER;
}
}
More information about the Libreoffice-commits
mailing list