diff options
author | Caolán McNamara <caolanm@redhat.com> | 2019-09-15 20:18:38 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2019-09-17 10:04:38 +0200 |
commit | 573562e72a5fd85b75006fbc8869c73903a6e504 (patch) | |
tree | 866cfff40b7974ab4a9541214a93c104c10f593b /svtools | |
parent | a944d4c2aacafdac78eabd7fb0f8909a66d935eb (diff) |
weld DirectSQLDialog
Change-Id: I8f97068bb38a1fb888d60251f8f25506044c8451
Reviewed-on: https://gerrit.libreoffice.org/78970
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'svtools')
-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 |