summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--dbaccess/source/ui/control/sqledit.cxx60
-rw-r--r--dbaccess/source/ui/inc/directsql.hxx4
-rw-r--r--dbaccess/source/ui/inc/sqledit.hxx175
-rw-r--r--reportdesign/util/description.xml44
4 files changed, 155 insertions, 128 deletions
diff --git a/dbaccess/source/ui/control/sqledit.cxx b/dbaccess/source/ui/control/sqledit.cxx
index 4f42023f8161..b12f30cf1916 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,7 +175,7 @@ void OSqlEdit::SetText(const String& rNewText)
LINK(this, OSqlEdit, OnUndoActionTimer).Call(NULL);
}
- MultiLineEdit::SetText(rNewText);
+ MultiLineEditSyntaxHighlight::SetText(rNewText);
m_strOrigText =rNewText;
}
// -----------------------------------------------------------------------------
@@ -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);
+}
//==============================================================================
diff --git a/dbaccess/source/ui/inc/directsql.hxx b/dbaccess/source/ui/inc/directsql.hxx
index 7ecaf397b128..a6574a26f1f9 100644
--- a/dbaccess/source/ui/inc/directsql.hxx
+++ b/dbaccess/source/ui/inc/directsql.hxx
@@ -35,7 +35,7 @@
#include <vcl/dialog.hxx>
#endif
#ifndef _SVEDIT_HXX
-#include <svtools/svmedit.hxx>
+#include <svtools/editsyntaxhighlighter.hxx>
#endif
#ifndef _SV_FIXED_HXX
#include <vcl/fixed.hxx>
@@ -82,7 +82,7 @@ namespace dbaui
FixedLine m_aFrame;
FixedText m_aSQLLabel;
- MultiLineEdit m_aSQL;
+ MultiLineEditSyntaxHighlight m_aSQL;
PushButton m_aExecute;
FixedText m_aHistoryLabel;
ListBox* m_pSQLHistory;
diff --git a/dbaccess/source/ui/inc/sqledit.hxx b/dbaccess/source/ui/inc/sqledit.hxx
index f3f08b629f4f..1de6f785f54a 100644
--- a/dbaccess/source/ui/inc/sqledit.hxx
+++ b/dbaccess/source/ui/inc/sqledit.hxx
@@ -1,83 +1,92 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: sqledit.hxx,v $
- * $Revision: 1.5 $
- *
- * This file is part of OpenOffice.org.
- *
- * 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
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (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
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef DBAUI_SQLEDIT_HXX
-#define DBAUI_SQLEDIT_HXX
-
-#ifndef _SVEDIT_HXX
-#include <svtools/svmedit.hxx>
-#endif
-
-namespace dbaui
-{
- class OQueryTextView;
- class OSqlEdit : public MultiLineEdit
- {
- private:
- Timer m_timerInvalidate;
- Timer m_timerUndoActionCreation;
- Link m_lnkTextModifyHdl;
- String m_strOrigText; // wird beim Undo wiederhergestellt
- OQueryTextView* m_pView;
- BOOL m_bAccelAction; // Wird bei Cut, Copy, Paste gesetzt
- BOOL m_bStopTimer;
-
- DECL_LINK(OnUndoActionTimer, void*);
- DECL_LINK(OnInvalidateTimer, void*);
-
- protected:
- virtual void KeyInput( const KeyEvent& rKEvt );
- virtual void GetFocus();
-
- DECL_LINK(ModifyHdl, void*);
-
- public:
- OSqlEdit( OQueryTextView* pParent, WinBits nWinStyle = WB_LEFT | WB_VSCROLL |WB_BORDER);
- virtual ~OSqlEdit();
-
- // Edit overridables
- virtual void SetText(const String& rNewText);
- using MultiLineEdit::SetText;
-
- // own functionality
- BOOL IsInAccelAct();
-
- 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
-
- void stopTimer();
- void startTimer();
- };
-}
-
-#endif // DBAUI_SQLEDIT_HXX
-
-
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: sqledit.hxx,v $
+ * $Revision: 1.5.60.2 $
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * 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
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (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
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#ifndef DBAUI_SQLEDIT_HXX
+#define DBAUI_SQLEDIT_HXX
+
+#include <svtools/editsyntaxhighlighter.hxx>
+#include <svtools/lstner.hxx>
+#include <svtools/colorcfg.hxx>
+#include <svtools/sourceviewconfig.hxx>
+
+namespace dbaui
+{
+ class OQueryTextView;
+ class OSqlEdit : public MultiLineEditSyntaxHighlight, SfxListener
+ {
+ private:
+ Timer m_timerInvalidate;
+ Timer m_timerUndoActionCreation;
+ Link m_lnkTextModifyHdl;
+ String m_strOrigText; // wird beim Undo wiederhergestellt
+ OQueryTextView* m_pView;
+ BOOL m_bAccelAction; // Wird bei Cut, Copy, Paste gesetzt
+ BOOL m_bStopTimer;
+ svt::SourceViewConfig m_SourceViewConfig;
+ svtools::ColorConfig m_ColorConfig;
+
+ DECL_LINK(OnUndoActionTimer, void*);
+ DECL_LINK(OnInvalidateTimer, void*);
+
+ private:
+ void ImplSetFont();
+
+ protected:
+ virtual void KeyInput( const KeyEvent& rKEvt );
+ virtual void GetFocus();
+
+ DECL_LINK(ModifyHdl, void*);
+
+ public:
+ OSqlEdit( OQueryTextView* pParent, WinBits nWinStyle = WB_LEFT | WB_VSCROLL |WB_BORDER);
+ virtual ~OSqlEdit();
+
+ // Edit overridables
+ virtual void SetText(const String& rNewText);
+ using MultiLineEditSyntaxHighlight::SetText;
+
+ // own functionality
+ BOOL IsInAccelAct();
+
+ 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
+
+ void stopTimer();
+ void startTimer();
+
+ virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint );
+ using MultiLineEditSyntaxHighlight::Notify;
+ };
+}
+
+#endif // DBAUI_SQLEDIT_HXX
+
+
diff --git a/reportdesign/util/description.xml b/reportdesign/util/description.xml
index 215213fbabb2..a7f78e8b6e6a 100644
--- a/reportdesign/util/description.xml
+++ b/reportdesign/util/description.xml
@@ -1,22 +1,22 @@
-<?xml version="1.0" encoding="utf-8"?>
-<description xmlns="http://openoffice.org/extensions/description/2006"
- xmlns:d="http://openoffice.org/extensions/description/2006"
- xmlns:xlink="http://www.w3.org/1999/xlink">
- <display-name>
- <name lang="en-US">Sun™ Report Builder</name>
- <!-- <name lang="en-US">Sun(TM) Report Builder</name> -->
- </display-name>
- <registration>
- <simple-license accept-by="admin" default-license-id="en-US" >
- <license-text xlink:href="licensefile" lang="isocode" license-id="lic-isocode"/>
- </simple-license>
- </registration>
- <version value="1.0.6"/>
- <identifier value="com.sun.reportdesigner"/>
- <dependencies>
- <OpenOffice.org-minimal-version value="3.0" d:name="OpenOffice.org 3.0"/>
- </dependencies>
- <publisher>
- <name xlink:href="http://www.sun.com/staroffice" lang="en">Sun Microsystems, Inc.</name>
- </publisher>
-</description>
+<?xml version="1.0" encoding="utf-8"?>
+<description xmlns="http://openoffice.org/extensions/description/2006"
+ xmlns:d="http://openoffice.org/extensions/description/2006"
+ xmlns:xlink="http://www.w3.org/1999/xlink">
+ <display-name>
+ <name lang="en-US">Sun™ Report Builder</name>
+ <!-- <name lang="en-US">Sun(TM) Report Builder</name> -->
+ </display-name>
+ <registration>
+ <simple-license accept-by="admin" default-license-id="en-US" >
+ <license-text xlink:href="licensefile" lang="isocode" license-id="lic-isocode"/>
+ </simple-license>
+ </registration>
+ <version value="1.0.6"/>
+ <identifier value="com.sun.reportdesigner"/>
+ <dependencies>
+ <OpenOffice.org-minimal-version value="3.0" d:name="OpenOffice.org 3.0"/>
+ </dependencies>
+ <publisher>
+ <name xlink:href="http://www.sun.com/staroffice" lang="en">Sun Microsystems, Inc.</name>
+ </publisher>
+</description>