Kaydet (Commit) 176ac1e6 authored tarafından Stephan Bergmann's avatar Stephan Bergmann

Remove unnecessary SyntaxHighlighter::Tokenizer statefulness

...which reveals that SyntaxHighlighter::notifyChange does nothing, so remove it.

Change-Id: I49834af29081ee703d9e62e182e3c1f8ce7e212e
üst c99267b3
...@@ -1189,8 +1189,6 @@ void EditorWindow::ImpDoHighlight( sal_uLong nLine ) ...@@ -1189,8 +1189,6 @@ void EditorWindow::ImpDoHighlight( sal_uLong nLine )
if ( bDoSyntaxHighlight ) if ( bDoSyntaxHighlight )
{ {
OUString aLine( pEditEngine->GetText( nLine ) ); OUString aLine( pEditEngine->GetText( nLine ) );
aHighlighter.notifyChange( &aLine, 1 );
bool const bWasModified = pEditEngine->IsModified(); bool const bWasModified = pEditEngine->IsModified();
pEditEngine->RemoveAttribs( nLine, true ); pEditEngine->RemoveAttribs( nLine, true );
std::vector<HighlightPortion> aPortions; std::vector<HighlightPortion> aPortions;
...@@ -1326,12 +1324,6 @@ void EditorWindow::ParagraphInsertedDeleted( sal_uLong nPara, bool bInserted ) ...@@ -1326,12 +1324,6 @@ void EditorWindow::ParagraphInsertedDeleted( sal_uLong nPara, bool bInserted )
GetOutputSizePixel().Height() - 2 * DWBORDER); GetOutputSizePixel().Height() - 2 * DWBORDER);
rModulWindow.GetLineNumberWindow().SetPosSizePixel(Point(DWBORDER + 19, DWBORDER), aLnSz); rModulWindow.GetLineNumberWindow().SetPosSizePixel(Point(DWBORDER + 19, DWBORDER), aLnSz);
rModulWindow.GetLineNumberWindow().Invalidate(); rModulWindow.GetLineNumberWindow().Invalidate();
if ( bDoSyntaxHighlight )
{
OUString aDummy;
aHighlighter.notifyChange( &aDummy, 1 );
}
} }
} }
......
...@@ -149,7 +149,6 @@ void BasicCodeTagger::tagParagraph( xmlNodePtr paragraph ) ...@@ -149,7 +149,6 @@ void BasicCodeTagger::tagParagraph( xmlNodePtr paragraph )
OUString strLine( reinterpret_cast<const sal_Char*>(codeSnippet), OUString strLine( reinterpret_cast<const sal_Char*>(codeSnippet),
strlen(reinterpret_cast<const char*>(codeSnippet)), strlen(reinterpret_cast<const char*>(codeSnippet)),
RTL_TEXTENCODING_UTF8 ); RTL_TEXTENCODING_UTF8 );
m_Highlighter.notifyChange ( &strLine, 1 );
std::vector<HighlightPortion> portions; std::vector<HighlightPortion> portions;
m_Highlighter.getHighlightPortions( strLine, portions ); m_Highlighter.getHighlightPortions( strLine, portions );
for (std::vector<HighlightPortion>::iterator i(portions.begin()); for (std::vector<HighlightPortion>::iterator i(portions.begin());
......
...@@ -66,11 +66,6 @@ enum HighlighterLanguage ...@@ -66,11 +66,6 @@ enum HighlighterLanguage
HIGHLIGHT_SQL HIGHLIGHT_SQL
}; };
//*** SyntaxHighlighter Class ***
// Concept: the Highlighter will be notified of all changes in the source
// (notifyChange) and returns the caller the range of lines, which based on the
// changes, need to be highlighted again. For this the Highlighter marks all
// lines internally whether or not C comments begin or end.
class COMPHELPER_DLLPUBLIC SyntaxHighlighter: private boost::noncopyable class COMPHELPER_DLLPUBLIC SyntaxHighlighter: private boost::noncopyable
{ {
class Tokenizer; class Tokenizer;
...@@ -82,8 +77,6 @@ public: ...@@ -82,8 +77,6 @@ public:
SyntaxHighlighter(HighlighterLanguage language); SyntaxHighlighter(HighlighterLanguage language);
~SyntaxHighlighter(); ~SyntaxHighlighter();
void notifyChange(const OUString* pChangedLines, sal_uInt32 nArrayLength);
void getHighlightPortions( const OUString& rLine, void getHighlightPortions( const OUString& rLine,
std::vector<HighlightPortion>& pPortions ); std::vector<HighlightPortion>& pPortions );
......
...@@ -170,8 +170,6 @@ void MultiLineEditSyntaxHighlight::UpdateData() ...@@ -170,8 +170,6 @@ void MultiLineEditSyntaxHighlight::UpdateData()
for (unsigned int nLine=0; nLine < GetTextEngine()->GetParagraphCount(); nLine++) for (unsigned int nLine=0; nLine < GetTextEngine()->GetParagraphCount(); nLine++)
{ {
OUString aLine( GetTextEngine()->GetText( nLine ) ); OUString aLine( GetTextEngine()->GetText( nLine ) );
aHighlighter.notifyChange( &aLine, 1 );
GetTextEngine()->RemoveAttribs( nLine, sal_True ); GetTextEngine()->RemoveAttribs( nLine, sal_True );
std::vector<HighlightPortion> aPortions; std::vector<HighlightPortion> aPortions;
aHighlighter.getHighlightPortions( aLine, aPortions ); aHighlighter.getHighlightPortions( aLine, aPortions );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment