Kaydet (Commit) f2c90bcc authored tarafından Release Engineers's avatar Release Engineers

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
üst a434aa04
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite * OpenOffice.org - a multi-platform office productivity suite
* *
* $RCSfile: sqledit.cxx,v $ * $RCSfile: sqledit.cxx,v $
* $Revision: 1.12 $ * $Revision: 1.12.16.3 $
* *
* This file is part of OpenOffice.org. * This file is part of OpenOffice.org.
* *
...@@ -30,31 +30,18 @@ ...@@ -30,31 +30,18 @@
// MARKER(update_precomp.py): autogen include statement, do not remove // MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_dbaccess.hxx" #include "precompiled_dbaccess.hxx"
#ifndef DBAUI_SQLEDIT_HXX
#include "sqledit.hxx" #include "sqledit.hxx"
#endif
#ifndef DBAUI_QUERYVIEW_TEXT_HXX
#include "QueryTextView.hxx" #include "QueryTextView.hxx"
#endif
#ifndef DBAUI_QUERYCONTAINERWINDOW_HXX
#include "querycontainerwindow.hxx" #include "querycontainerwindow.hxx"
#endif
#ifndef _TOOLS_DEBUG_HXX
#include <tools/debug.hxx> #include <tools/debug.hxx>
#endif
#include "dbaccess_helpid.hrc" #include "dbaccess_helpid.hrc"
#ifndef DBACCESS_UI_BROWSER_ID_HXX
#include "browserids.hxx" #include "browserids.hxx"
#endif
#ifndef DBAUI_QUERYCONTROLLER_HXX
#include "querycontroller.hxx" #include "querycontroller.hxx"
#endif
#ifndef DBAUI_UNDOSQLEDIT_HXX
#include "undosqledit.hxx" #include "undosqledit.hxx"
#endif
#ifndef DBAUI_QUERYDESIGNVIEW_HXX
#include "QueryDesignView.hxx" #include "QueryDesignView.hxx"
#endif
#include <svtools/smplhint.hxx>
////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////
// OSqlEdit // OSqlEdit
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
...@@ -62,7 +49,7 @@ using namespace dbaui; ...@@ -62,7 +49,7 @@ using namespace dbaui;
DBG_NAME(OSqlEdit) DBG_NAME(OSqlEdit)
OSqlEdit::OSqlEdit( OQueryTextView* pParent, WinBits nWinStyle ) : OSqlEdit::OSqlEdit( OQueryTextView* pParent, WinBits nWinStyle ) :
MultiLineEdit( pParent, nWinStyle ) MultiLineEditSyntaxHighlight( pParent, nWinStyle )
,m_pView(pParent) ,m_pView(pParent)
,m_bAccelAction( sal_False ) ,m_bAccelAction( sal_False )
,m_bStopTimer(sal_False ) ,m_bStopTimer(sal_False )
...@@ -77,6 +64,11 @@ OSqlEdit::OSqlEdit( OQueryTextView* pParent, WinBits nWinStyle ) : ...@@ -77,6 +64,11 @@ OSqlEdit::OSqlEdit( OQueryTextView* pParent, WinBits nWinStyle ) :
m_timerInvalidate.SetTimeout(200); m_timerInvalidate.SetTimeout(200);
m_timerInvalidate.SetTimeoutHdl(LINK(this, OSqlEdit, OnInvalidateTimer)); m_timerInvalidate.SetTimeoutHdl(LINK(this, OSqlEdit, OnInvalidateTimer));
m_timerInvalidate.Start(); m_timerInvalidate.Start();
ImplSetFont();
// listen for change of Font Setting
StartListening(m_SourceViewConfig);
StartListening(m_ColorConfig);
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
...@@ -85,6 +77,8 @@ OSqlEdit::~OSqlEdit() ...@@ -85,6 +77,8 @@ OSqlEdit::~OSqlEdit()
DBG_DTOR(OSqlEdit,NULL); DBG_DTOR(OSqlEdit,NULL);
if (m_timerUndoActionCreation.IsActive()) if (m_timerUndoActionCreation.IsActive())
m_timerUndoActionCreation.Stop(); m_timerUndoActionCreation.Stop();
EndListening(m_SourceViewConfig);
EndListening(m_ColorConfig);
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
void OSqlEdit::KeyInput( const KeyEvent& rKEvt ) void OSqlEdit::KeyInput( const KeyEvent& rKEvt )
...@@ -98,7 +92,7 @@ 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) ) if( (aKeyFunc==KEYFUNC_CUT)||(aKeyFunc==KEYFUNC_COPY)||(aKeyFunc==KEYFUNC_PASTE) )
m_bAccelAction = sal_True; m_bAccelAction = sal_True;
MultiLineEdit::KeyInput( rKEvt ); MultiLineEditSyntaxHighlight::KeyInput( rKEvt );
if( m_bAccelAction ) if( m_bAccelAction )
m_bAccelAction = sal_False; m_bAccelAction = sal_False;
...@@ -121,7 +115,7 @@ void OSqlEdit::GetFocus() ...@@ -121,7 +115,7 @@ void OSqlEdit::GetFocus()
{ {
DBG_CHKTHIS(OSqlEdit,NULL); DBG_CHKTHIS(OSqlEdit,NULL);
m_strOrigText =GetText(); m_strOrigText =GetText();
MultiLineEdit::GetFocus(); MultiLineEditSyntaxHighlight::GetFocus();
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
...@@ -181,7 +175,7 @@ void OSqlEdit::SetText(const String& rNewText) ...@@ -181,7 +175,7 @@ void OSqlEdit::SetText(const String& rNewText)
LINK(this, OSqlEdit, OnUndoActionTimer).Call(NULL); LINK(this, OSqlEdit, OnUndoActionTimer).Call(NULL);
} }
MultiLineEdit::SetText(rNewText); MultiLineEditSyntaxHighlight::SetText(rNewText);
m_strOrigText =rNewText; m_strOrigText =rNewText;
} }
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
...@@ -199,4 +193,28 @@ void OSqlEdit::startTimer() ...@@ -199,4 +193,28 @@ void OSqlEdit::startTimer()
m_timerInvalidate.Start(); 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);
}
//============================================================================== //==============================================================================
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
#include <vcl/dialog.hxx> #include <vcl/dialog.hxx>
#endif #endif
#ifndef _SVEDIT_HXX #ifndef _SVEDIT_HXX
#include <svtools/svmedit.hxx> #include <svtools/editsyntaxhighlighter.hxx>
#endif #endif
#ifndef _SV_FIXED_HXX #ifndef _SV_FIXED_HXX
#include <vcl/fixed.hxx> #include <vcl/fixed.hxx>
...@@ -82,7 +82,7 @@ namespace dbaui ...@@ -82,7 +82,7 @@ namespace dbaui
FixedLine m_aFrame; FixedLine m_aFrame;
FixedText m_aSQLLabel; FixedText m_aSQLLabel;
MultiLineEdit m_aSQL; MultiLineEditSyntaxHighlight m_aSQL;
PushButton m_aExecute; PushButton m_aExecute;
FixedText m_aHistoryLabel; FixedText m_aHistoryLabel;
ListBox* m_pSQLHistory; ListBox* m_pSQLHistory;
......
/************************************************************************* /*************************************************************************
* *
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* Copyright 2008 by Sun Microsystems, Inc. * Copyright 2008 by Sun Microsystems, Inc.
* *
* OpenOffice.org - a multi-platform office productivity suite * OpenOffice.org - a multi-platform office productivity suite
* *
* $RCSfile: sqledit.hxx,v $ * $RCSfile: sqledit.hxx,v $
* $Revision: 1.5 $ * $Revision: 1.5.60.2 $
* *
* This file is part of OpenOffice.org. * This file is part of OpenOffice.org.
* *
* OpenOffice.org is free software: you can redistribute it and/or modify * OpenOffice.org is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License version 3 * it under the terms of the GNU Lesser General Public License version 3
* only, as published by the Free Software Foundation. * only, as published by the Free Software Foundation.
* *
* OpenOffice.org is distributed in the hope that it will be useful, * OpenOffice.org is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License version 3 for more details * GNU Lesser General Public License version 3 for more details
* (a copy is included in the LICENSE file that accompanied this code). * (a copy is included in the LICENSE file that accompanied this code).
* *
* You should have received a copy of the GNU Lesser General Public License * You should have received a copy of the GNU Lesser General Public License
* version 3 along with OpenOffice.org. If not, see * version 3 along with OpenOffice.org. If not, see
* <http://www.openoffice.org/license.html> * <http://www.openoffice.org/license.html>
* for a copy of the LGPLv3 License. * for a copy of the LGPLv3 License.
* *
************************************************************************/ ************************************************************************/
#ifndef DBAUI_SQLEDIT_HXX #ifndef DBAUI_SQLEDIT_HXX
#define DBAUI_SQLEDIT_HXX #define DBAUI_SQLEDIT_HXX
#ifndef _SVEDIT_HXX #include <svtools/editsyntaxhighlighter.hxx>
#include <svtools/svmedit.hxx> #include <svtools/lstner.hxx>
#endif #include <svtools/colorcfg.hxx>
#include <svtools/sourceviewconfig.hxx>
namespace dbaui
{ namespace dbaui
class OQueryTextView; {
class OSqlEdit : public MultiLineEdit class OQueryTextView;
{ class OSqlEdit : public MultiLineEditSyntaxHighlight, SfxListener
private: {
Timer m_timerInvalidate; private:
Timer m_timerUndoActionCreation; Timer m_timerInvalidate;
Link m_lnkTextModifyHdl; Timer m_timerUndoActionCreation;
String m_strOrigText; // wird beim Undo wiederhergestellt Link m_lnkTextModifyHdl;
OQueryTextView* m_pView; String m_strOrigText; // wird beim Undo wiederhergestellt
BOOL m_bAccelAction; // Wird bei Cut, Copy, Paste gesetzt OQueryTextView* m_pView;
BOOL m_bStopTimer; BOOL m_bAccelAction; // Wird bei Cut, Copy, Paste gesetzt
BOOL m_bStopTimer;
DECL_LINK(OnUndoActionTimer, void*); svt::SourceViewConfig m_SourceViewConfig;
DECL_LINK(OnInvalidateTimer, void*); svtools::ColorConfig m_ColorConfig;
protected: DECL_LINK(OnUndoActionTimer, void*);
virtual void KeyInput( const KeyEvent& rKEvt ); DECL_LINK(OnInvalidateTimer, void*);
virtual void GetFocus();
private:
DECL_LINK(ModifyHdl, void*); void ImplSetFont();
public: protected:
OSqlEdit( OQueryTextView* pParent, WinBits nWinStyle = WB_LEFT | WB_VSCROLL |WB_BORDER); virtual void KeyInput( const KeyEvent& rKEvt );
virtual ~OSqlEdit(); virtual void GetFocus();
// Edit overridables DECL_LINK(ModifyHdl, void*);
virtual void SetText(const String& rNewText);
using MultiLineEdit::SetText; public:
OSqlEdit( OQueryTextView* pParent, WinBits nWinStyle = WB_LEFT | WB_VSCROLL |WB_BORDER);
// own functionality virtual ~OSqlEdit();
BOOL IsInAccelAct();
// Edit overridables
void SetTextModifyHdl(const Link& lnk) { m_lnkTextModifyHdl = lnk; } virtual void SetText(const String& rNewText);
// bitte nicht SetModifyHdl benutzen, den brauche ich selber, der hier wird von dem damit gesetzten Handler using MultiLineEditSyntaxHighlight::SetText;
// gerufen
// der Link bekommt einen Pointer-to-string, der nach dem Link nicht mehr gueltig ist // own functionality
BOOL IsInAccelAct();
void stopTimer();
void startTimer(); void SetTextModifyHdl(const Link& lnk) { m_lnkTextModifyHdl = lnk; }
}; // bitte nicht SetModifyHdl benutzen, den brauche ich selber, der hier wird von dem damit gesetzten Handler
} // gerufen
// der Link bekommt einen Pointer-to-string, der nach dem Link nicht mehr gueltig ist
#endif // DBAUI_SQLEDIT_HXX
void stopTimer();
void startTimer();
virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint );
using MultiLineEditSyntaxHighlight::Notify;
};
}
#endif // DBAUI_SQLEDIT_HXX
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<description xmlns="http://openoffice.org/extensions/description/2006" <description xmlns="http://openoffice.org/extensions/description/2006"
xmlns:d="http://openoffice.org/extensions/description/2006" xmlns:d="http://openoffice.org/extensions/description/2006"
xmlns:xlink="http://www.w3.org/1999/xlink"> xmlns:xlink="http://www.w3.org/1999/xlink">
<display-name> <display-name>
<name lang="en-US">Sun™ Report Builder</name> <name lang="en-US">Sun™ Report Builder</name>
<!-- <name lang="en-US">Sun(TM) Report Builder</name> --> <!-- <name lang="en-US">Sun(TM) Report Builder</name> -->
</display-name> </display-name>
<registration> <registration>
<simple-license accept-by="admin" default-license-id="en-US" > <simple-license accept-by="admin" default-license-id="en-US" >
<license-text xlink:href="licensefile" lang="isocode" license-id="lic-isocode"/> <license-text xlink:href="licensefile" lang="isocode" license-id="lic-isocode"/>
</simple-license> </simple-license>
</registration> </registration>
<version value="1.0.6"/> <version value="1.0.6"/>
<identifier value="com.sun.reportdesigner"/> <identifier value="com.sun.reportdesigner"/>
<dependencies> <dependencies>
<OpenOffice.org-minimal-version value="3.0" d:name="OpenOffice.org 3.0"/> <OpenOffice.org-minimal-version value="3.0" d:name="OpenOffice.org 3.0"/>
</dependencies> </dependencies>
<publisher> <publisher>
<name xlink:href="http://www.sun.com/staroffice" lang="en">Sun Microsystems, Inc.</name> <name xlink:href="http://www.sun.com/staroffice" lang="en">Sun Microsystems, Inc.</name>
</publisher> </publisher>
</description> </description>
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