diff options
author | Release Engineers <releng@openoffice.org> | 2008-11-28 11:39:37 +0000 |
---|---|---|
committer | Release Engineers <releng@openoffice.org> | 2008-11-28 11:39:37 +0000 |
commit | fdfcf146a787e6c9823e1c9d40b7c4a5a3f13001 (patch) | |
tree | 5e0c2d9f88b8b57120cc4ccd209e8b9ffdfc3e69 /dbaccess/source/ui/control/sqledit.cxx | |
parent | 4d10b95ff4d6fb3eea2d43a1c966abfaed12e1c5 (diff) |
CWS-TOOLING: integrate CWS sqlsyntaxhighlighting
2008-11-20 17:23:29 +0100 mod r264074 : new colors by UX
2008-11-17 17:37:19 +0100 mod r263732 : revert manual fix for icu
2008-11-17 15:03:39 +0100 mod r263725 : manual fix for icu
2008-11-17 11:26:39 +0100 mod r263709 : manual fix for icu
2008-11-16 18:19:16 +0100 mod r263702 : `fix
2008-11-12 22:11:50 +0100 mod r263619 : CWS-TOOLING: rebase CWS sqlsyntaxhighlighting to trunk@263288 (milestone: DEV300:m35)
2008-11-12 11:04:33 +0100 mod r263578 : minor cleanup
2008-11-12 11:03:02 +0100 mod r263577 : seperate MulitLineEditSyntaxHighlighter into new file
2008-11-06 15:13:27 +0100 fs r263391 : merged from trunk
2008-11-06 15:09:20 +0100 fs r263390 : merged from trunk
2008-11-06 15:07:06 +0100 fs r263388 : reverted the change c262599. This seems to be a merge from trunk, but without properly setting svn:mergeinfo, thus it results in conflicts when doing a real 'svn merge'.
2008-11-06 15:03:19 +0100 fs r263387 : merged rev. 262769
2008-11-03 17:58:19 +0100 mod r263297 : little fixes
2008-11-03 17:56:49 +0100 mod r263296 : little fixes
2008-11-03 17:12:41 +0100 mod r263295 : new entry SQL comment for Tools-Appearance
2008-11-03 17:12:13 +0100 mod r263294 : different tokenizer based on language
2008-11-03 17:11:40 +0100 mod r263293 : new entry for Tools-Appearance: SQL Comment
2008-11-03 17:11:14 +0100 mod r263292 : get notification about color changes for sql view
2008-10-29 00:01:40 +0100 mod r262768 : string listbox
2008-10-28 23:57:45 +0100 mod r262767 : string listbox
2008-10-22 18:38:07 +0200 mod r262614 : source alignment fix
2008-10-22 18:37:23 +0200 mod r262613 : '' as string as well
2008-10-22 18:36:45 +0200 mod r262612 : get syntax highlighting in tools-sql...
2008-10-22 14:11:12 +0200 mod r262605 : formatting fix
2008-10-22 13:30:42 +0200 mod r262599 : additional entries for Tools-Options-Appearance
2008-10-19 22:53:50 +0200 mod r262302 : migration from cvs to svn
2008-10-19 22:37:45 +0200 mod r262301 : migration from cvs to svn
2008-10-19 22:36:04 +0200 mod r262300 : migration from cvs to svn
Diffstat (limited to 'dbaccess/source/ui/control/sqledit.cxx')
-rw-r--r-- | dbaccess/source/ui/control/sqledit.cxx | 62 |
1 files changed, 40 insertions, 22 deletions
diff --git a/dbaccess/source/ui/control/sqledit.cxx b/dbaccess/source/ui/control/sqledit.cxx index c18ebba91..5e90b75c5 100644 --- a/dbaccess/source/ui/control/sqledit.cxx +++ b/dbaccess/source/ui/control/sqledit.cxx @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: sqledit.cxx,v $ - * $Revision: 1.12 $ + * $Revision: 1.12.16.3 $ * * This file is part of OpenOffice.org. * @@ -30,31 +30,18 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_dbaccess.hxx" -#ifndef DBAUI_SQLEDIT_HXX #include "sqledit.hxx" -#endif -#ifndef DBAUI_QUERYVIEW_TEXT_HXX #include "QueryTextView.hxx" -#endif -#ifndef DBAUI_QUERYCONTAINERWINDOW_HXX #include "querycontainerwindow.hxx" -#endif -#ifndef _TOOLS_DEBUG_HXX #include <tools/debug.hxx> -#endif #include "dbaccess_helpid.hrc" -#ifndef DBACCESS_UI_BROWSER_ID_HXX #include "browserids.hxx" -#endif -#ifndef DBAUI_QUERYCONTROLLER_HXX #include "querycontroller.hxx" -#endif -#ifndef DBAUI_UNDOSQLEDIT_HXX #include "undosqledit.hxx" -#endif -#ifndef DBAUI_QUERYDESIGNVIEW_HXX #include "QueryDesignView.hxx" -#endif + +#include <svtools/smplhint.hxx> + ////////////////////////////////////////////////////////////////////////// // OSqlEdit //------------------------------------------------------------------------------ @@ -62,7 +49,7 @@ using namespace dbaui; DBG_NAME(OSqlEdit) OSqlEdit::OSqlEdit( OQueryTextView* pParent, WinBits nWinStyle ) : - MultiLineEdit( pParent, nWinStyle ) + MultiLineEditSyntaxHighlight( pParent, nWinStyle ) ,m_pView(pParent) ,m_bAccelAction( sal_False ) ,m_bStopTimer(sal_False ) @@ -77,6 +64,11 @@ OSqlEdit::OSqlEdit( OQueryTextView* pParent, WinBits nWinStyle ) : m_timerInvalidate.SetTimeout(200); m_timerInvalidate.SetTimeoutHdl(LINK(this, OSqlEdit, OnInvalidateTimer)); m_timerInvalidate.Start(); + + ImplSetFont(); + // listen for change of Font Setting + StartListening(m_SourceViewConfig); + StartListening(m_ColorConfig); } //------------------------------------------------------------------------------ @@ -85,6 +77,8 @@ OSqlEdit::~OSqlEdit() DBG_DTOR(OSqlEdit,NULL); if (m_timerUndoActionCreation.IsActive()) m_timerUndoActionCreation.Stop(); + EndListening(m_SourceViewConfig); + EndListening(m_ColorConfig); } //------------------------------------------------------------------------------ void OSqlEdit::KeyInput( const KeyEvent& rKEvt ) @@ -98,7 +92,7 @@ void OSqlEdit::KeyInput( const KeyEvent& rKEvt ) if( (aKeyFunc==KEYFUNC_CUT)||(aKeyFunc==KEYFUNC_COPY)||(aKeyFunc==KEYFUNC_PASTE) ) m_bAccelAction = sal_True; - MultiLineEdit::KeyInput( rKEvt ); + MultiLineEditSyntaxHighlight::KeyInput( rKEvt ); if( m_bAccelAction ) m_bAccelAction = sal_False; @@ -121,7 +115,7 @@ void OSqlEdit::GetFocus() { DBG_CHKTHIS(OSqlEdit,NULL); m_strOrigText =GetText(); - MultiLineEdit::GetFocus(); + MultiLineEditSyntaxHighlight::GetFocus(); } //------------------------------------------------------------------------------ @@ -181,9 +175,9 @@ void OSqlEdit::SetText(const String& rNewText) LINK(this, OSqlEdit, OnUndoActionTimer).Call(NULL); } - MultiLineEdit::SetText(rNewText); + MultiLineEditSyntaxHighlight::SetText(rNewText); m_strOrigText =rNewText; -} +} // ----------------------------------------------------------------------------- void OSqlEdit::stopTimer() { @@ -199,4 +193,28 @@ void OSqlEdit::startTimer() m_timerInvalidate.Start(); } +void OSqlEdit::Notify( SfxBroadcaster& rBC, const SfxHint& /*rHint*/ ) +{ + if (&rBC == &m_SourceViewConfig) + ImplSetFont(); + else if (&rBC == &m_ColorConfig) + MultiLineEditSyntaxHighlight::UpdateData(); +} + +void OSqlEdit::ImplSetFont() +{ + AllSettings aSettings = GetSettings(); + StyleSettings aStyleSettings = aSettings.GetStyleSettings(); + String sFontName = m_SourceViewConfig.GetFontName(); + if ( !sFontName.Len() ) + { + Font aTmpFont( OutputDevice::GetDefaultFont( DEFAULTFONT_FIXED, Application::GetSettings().GetUILanguage(), 0 , this ) ); + sFontName = aTmpFont.GetName(); + } + Size aFontSize( 0, m_SourceViewConfig.GetFontHeight() ); + Font aFont( sFontName, aFontSize ); + aStyleSettings.SetFieldFont(aFont); + aSettings.SetStyleSettings(aStyleSettings); + SetSettings(aSettings); +} //============================================================================== |