diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2013-10-28 11:38:36 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2013-10-28 13:48:13 +0100 |
commit | f5e8be8bb1681f0e2494337bc769b33332ef3fff (patch) | |
tree | 87c8d679befb417b7691233c5d46d15b951ff61d /comphelper | |
parent | 8a201be240b6d408d15166be7ffc576b9e123634 (diff) |
Remove unused SimpleTokenizer_Impl::nLine/nCol
...which are never read; remove thereby unused parameters from functions.
Change-Id: I644d2dc1b2d13ae2f932d04243521eef97e67e3e
Diffstat (limited to 'comphelper')
-rw-r--r-- | comphelper/qa/unit/syntaxhighlighttest.cxx | 12 | ||||
-rw-r--r-- | comphelper/source/misc/syntaxhighlight.cxx | 28 |
2 files changed, 13 insertions, 27 deletions
diff --git a/comphelper/qa/unit/syntaxhighlighttest.cxx b/comphelper/qa/unit/syntaxhighlighttest.cxx index 294db3e76fc0..af834a638de0 100644 --- a/comphelper/qa/unit/syntaxhighlighttest.cxx +++ b/comphelper/qa/unit/syntaxhighlighttest.cxx @@ -42,7 +42,7 @@ void SyntaxHighlightTest::testBasicString() { h.initialize(HIGHLIGHT_BASIC); OUString s("\"foo\""); std::vector<HighlightPortion> ps; - h.getHighlightPortions(0, s, ps); + h.getHighlightPortions(s, ps); CPPUNIT_ASSERT_EQUAL( static_cast<std::vector<HighlightPortion>::size_type>(1), ps.size()); CPPUNIT_ASSERT_EQUAL(0, ps[0].nBegin); @@ -55,7 +55,7 @@ void SyntaxHighlightTest::testBasicComment() { h.initialize(HIGHLIGHT_BASIC); OUString s("' foo"); std::vector<HighlightPortion> ps; - h.getHighlightPortions(0, s, ps); + h.getHighlightPortions(s, ps); CPPUNIT_ASSERT_EQUAL( static_cast<std::vector<HighlightPortion>::size_type>(1), ps.size()); CPPUNIT_ASSERT_EQUAL(0, ps[0].nBegin); @@ -68,7 +68,7 @@ void SyntaxHighlightTest::testBasicCommentNewline() { h.initialize(HIGHLIGHT_BASIC); OUString s("' foo\n"); std::vector<HighlightPortion> ps; - h.getHighlightPortions(0, s, ps); + h.getHighlightPortions(s, ps); CPPUNIT_ASSERT_EQUAL( static_cast<std::vector<HighlightPortion>::size_type>(2), ps.size()); CPPUNIT_ASSERT_EQUAL(0, ps[0].nBegin); @@ -84,7 +84,7 @@ void SyntaxHighlightTest::testBasicEmptyComment() { h.initialize(HIGHLIGHT_BASIC); OUString s("'"); std::vector<HighlightPortion> ps; - h.getHighlightPortions(0, s, ps); + h.getHighlightPortions(s, ps); CPPUNIT_ASSERT_EQUAL( static_cast<std::vector<HighlightPortion>::size_type>(1), ps.size()); CPPUNIT_ASSERT_EQUAL(0, ps[0].nBegin); @@ -97,7 +97,7 @@ void SyntaxHighlightTest::testBasicEmptyCommentNewline() { h.initialize(HIGHLIGHT_BASIC); OUString s("'\n"); std::vector<HighlightPortion> ps; - h.getHighlightPortions(0, s, ps); + h.getHighlightPortions(s, ps); CPPUNIT_ASSERT_EQUAL( static_cast<std::vector<HighlightPortion>::size_type>(2), ps.size()); CPPUNIT_ASSERT_EQUAL(0, ps[0].nBegin); @@ -116,7 +116,7 @@ void SyntaxHighlightTest::testBasic() aHighlighter.initialize( HIGHLIGHT_BASIC ); std::vector<HighlightPortion> aPortions; - aHighlighter.getHighlightPortions( 0, aBasicString, aPortions ); + aHighlighter.getHighlightPortions( aBasicString, aPortions ); sal_Int32 prevEnd = 0; for(std::vector<HighlightPortion>::const_iterator itr = diff --git a/comphelper/source/misc/syntaxhighlight.cxx b/comphelper/source/misc/syntaxhighlight.cxx index ca3207d73387..fd8ee2665c41 100644 --- a/comphelper/source/misc/syntaxhighlight.cxx +++ b/comphelper/source/misc/syntaxhighlight.cxx @@ -529,10 +529,6 @@ sal_Bool SimpleTokenizer_Impl::getNextToken( /*out*/TokenTypes& reType, if( cNext != c && testCharFlags( cNext, CHAR_EOL ) == sal_True ) getChar(); - // Set position data at the line start - nCol = 0; - nLine++; - reType = TT_EOL; } @@ -635,15 +631,11 @@ SimpleTokenizer_Impl* getSimpleTokenizer( void ) return pSimpleTokenizer; } -sal_uInt16 SimpleTokenizer_Impl::parseLine( sal_uInt32 nParseLine, const OUString* aSource ) +sal_uInt16 SimpleTokenizer_Impl::parseLine( const OUString* aSource ) { // Set the position to the beginning of the source string mpStringBegin = mpActualPos = aSource->getStr(); - // Initialize row and column - nLine = nParseLine; - nCol = 0L; - // Variables for the out parameter TokenTypes eType; const sal_Unicode* pStartPos; @@ -657,16 +649,12 @@ sal_uInt16 SimpleTokenizer_Impl::parseLine( sal_uInt32 nParseLine, const OUStrin return nTokenCount; } -void SimpleTokenizer_Impl::getHighlightPortions( sal_uInt32 nParseLine, const OUString& rLine, +void SimpleTokenizer_Impl::getHighlightPortions( const OUString& rLine, /*out*/std::vector<HighlightPortion>& portions ) { // Set the position to the beginning of the source string mpStringBegin = mpActualPos = rLine.getStr(); - // Initialize row and column - nLine = nParseLine; - nCol = 0L; - // Variables for the out parameter TokenTypes eType; const sal_Unicode* pStartPos; @@ -716,19 +704,17 @@ void SyntaxHighlighter::initialize( HighlighterLanguage eLanguage_ ) } } -void SyntaxHighlighter::notifyChange( sal_uInt32 nLine, sal_Int32 nLineCountDifference, - const OUString* pChangedLines, sal_uInt32 nArrayLength) +void SyntaxHighlighter::notifyChange( + const OUString* pChangedLines, sal_uInt32 nArrayLength) { - (void)nLineCountDifference; - for( sal_uInt32 i=0 ; i < nArrayLength ; i++ ) - m_pSimpleTokenizer->parseLine(nLine+i, &pChangedLines[i]); + m_pSimpleTokenizer->parseLine(&pChangedLines[i]); } -void SyntaxHighlighter::getHighlightPortions( sal_uInt32 nLine, const OUString& rLine, +void SyntaxHighlighter::getHighlightPortions( const OUString& rLine, /*out*/std::vector<HighlightPortion>& portions ) { - m_pSimpleTokenizer->getHighlightPortions( nLine, rLine, portions ); + m_pSimpleTokenizer->getHighlightPortions( rLine, portions ); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |