[Libreoffice-commits] core.git: starmath/inc starmath/source
Takeshi Abe
tabe at fixedpoint.jp
Wed Feb 14 00:14:12 UTC 2018
starmath/inc/parse.hxx | 2 +-
starmath/source/parse.cxx | 10 +++-------
starmath/source/view.cxx | 2 +-
3 files changed, 5 insertions(+), 9 deletions(-)
New commits:
commit 3c913c3844acae8ee0d80ab174133bdc7677efea
Author: Takeshi Abe <tabe at fixedpoint.jp>
Date: Tue Feb 13 20:52:57 2018 +0900
starmath: Omit SmParser::GetError()'s argument
as it was always 0.
Change-Id: I59570967deb139f258e7aeaab17619f714bc7bb5
Reviewed-on: https://gerrit.libreoffice.org/49640
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Takeshi Abe <tabe at fixedpoint.jp>
diff --git a/starmath/inc/parse.hxx b/starmath/inc/parse.hxx
index 6b8e7d8cd85b..c49f0f6ff9cf 100644
--- a/starmath/inc/parse.hxx
+++ b/starmath/inc/parse.hxx
@@ -128,7 +128,7 @@ public:
void AddError(SmParseError Type, SmNode *pNode);
const SmErrorDesc* NextError();
const SmErrorDesc* PrevError();
- const SmErrorDesc* GetError(size_t i);
+ const SmErrorDesc* GetError();
static const SmTokenTableEntry* GetTokenTableEntry( const OUString &rName );
const std::set< OUString >& GetUsedSymbols() const { return m_aUsedSymbols; }
};
diff --git a/starmath/source/parse.cxx b/starmath/source/parse.cxx
index 6c5414e25d50..9bb4530eae4e 100644
--- a/starmath/source/parse.cxx
+++ b/starmath/source/parse.cxx
@@ -2418,14 +2418,10 @@ const SmErrorDesc *SmParser::PrevError()
}
-const SmErrorDesc *SmParser::GetError(size_t i)
+const SmErrorDesc *SmParser::GetError()
{
- if ( i < m_aErrDescList.size() )
- return m_aErrDescList[ i ].get();
-
- if ( static_cast<size_t>(m_nCurError) < m_aErrDescList.size() )
- return m_aErrDescList[ m_nCurError ].get();
-
+ if ( !m_aErrDescList.empty() )
+ return m_aErrDescList.front().get();
return nullptr;
}
diff --git a/starmath/source/view.cxx b/starmath/source/view.cxx
index 21e3e619a978..34cff7ebedd3 100644
--- a/starmath/source/view.cxx
+++ b/starmath/source/view.cxx
@@ -1295,7 +1295,7 @@ void SmViewShell::SetStatusText(const OUString& rText)
void SmViewShell::ShowError(const SmErrorDesc* pErrorDesc)
{
assert(GetDoc());
- if (pErrorDesc || nullptr != (pErrorDesc = GetDoc()->GetParser().GetError(0)) )
+ if (pErrorDesc || nullptr != (pErrorDesc = GetDoc()->GetParser().GetError()) )
{
SetStatusText( pErrorDesc->m_aText );
GetEditWindow()->MarkError( Point( pErrorDesc->m_pNode->GetColumn(),
More information about the Libreoffice-commits
mailing list