diff options
Diffstat (limited to 'svtools/source')
-rw-r--r-- | svtools/source/edit/editsyntaxhighlighter.cxx | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/svtools/source/edit/editsyntaxhighlighter.cxx b/svtools/source/edit/editsyntaxhighlighter.cxx index f189cec85609..532fc67503f9 100644 --- a/svtools/source/edit/editsyntaxhighlighter.cxx +++ b/svtools/source/edit/editsyntaxhighlighter.cxx @@ -33,8 +33,6 @@ MultiLineEditSyntaxHighlight::MultiLineEditSyntaxHighlight( vcl::Window* pParent EnableUpdateData(300); } -VCL_BUILDER_FACTORY(MultiLineEditSyntaxHighlight) - void MultiLineEditSyntaxHighlight::SetText(const OUString& rNewText) { MultiLineEdit::SetText(rNewText); @@ -117,22 +115,22 @@ bool MultiLineEditSyntaxHighlight::PreNotify( NotifyEvent& rNEvt ) return MultiLineEdit::PreNotify(rNEvt); } -Color MultiLineEditSyntaxHighlight::GetColorValue(TokenType aToken) +Color MultiLineEditSyntaxHighlight::GetSyntaxHighlightColor(const svtools::ColorConfig& rColorConfig, HighlighterLanguage eLanguage, TokenType aToken) { Color aColor; - switch (aHighlighter.GetLanguage()) + switch (eLanguage) { case HighlighterLanguage::SQL: { switch (aToken) { - case TokenType::Identifier: aColor = m_aColorConfig.GetColorValue(svtools::SQLIDENTIFIER).nColor; break; - case TokenType::Number: aColor = m_aColorConfig.GetColorValue(svtools::SQLNUMBER).nColor; break; - case TokenType::String: aColor = m_aColorConfig.GetColorValue(svtools::SQLSTRING).nColor; break; - case TokenType::Operator: aColor = m_aColorConfig.GetColorValue(svtools::SQLOPERATOR).nColor; break; - case TokenType::Keywords: aColor = m_aColorConfig.GetColorValue(svtools::SQLKEYWORD).nColor; break; - case TokenType::Parameter: aColor = m_aColorConfig.GetColorValue(svtools::SQLPARAMETER).nColor; break; - case TokenType::Comment: aColor = m_aColorConfig.GetColorValue(svtools::SQLCOMMENT).nColor; break; + case TokenType::Identifier: aColor = rColorConfig.GetColorValue(svtools::SQLIDENTIFIER).nColor; break; + case TokenType::Number: aColor = rColorConfig.GetColorValue(svtools::SQLNUMBER).nColor; break; + case TokenType::String: aColor = rColorConfig.GetColorValue(svtools::SQLSTRING).nColor; break; + case TokenType::Operator: aColor = rColorConfig.GetColorValue(svtools::SQLOPERATOR).nColor; break; + case TokenType::Keywords: aColor = rColorConfig.GetColorValue(svtools::SQLKEYWORD).nColor; break; + case TokenType::Parameter: aColor = rColorConfig.GetColorValue(svtools::SQLPARAMETER).nColor; break; + case TokenType::Comment: aColor = rColorConfig.GetColorValue(svtools::SQLCOMMENT).nColor; break; default: aColor = Color(0,0,0); } break; @@ -158,6 +156,11 @@ Color MultiLineEditSyntaxHighlight::GetColorValue(TokenType aToken) return aColor; } +Color MultiLineEditSyntaxHighlight::GetColorValue(TokenType aToken) +{ + return GetSyntaxHighlightColor(m_aColorConfig, aHighlighter.GetLanguage(), aToken); +} + void MultiLineEditSyntaxHighlight::UpdateData() { // syntax highlighting |