dba33f: merge with m76-branch

This commit is contained in:
Frank Schoenheit [fs] 2010-04-16 13:55:24 +02:00
commit a5c79e695f
87 changed files with 2342 additions and 905 deletions

View File

@ -33,6 +33,7 @@
#include <vos/ref.hxx>
#include <com/sun/star/sdbc/XResultSetMetaData.hpp>
#include <com/sun/star/sdbc/XDatabaseMetaData.hpp>
#include <com/sun/star/container/XNameAccess.hpp>
#include <comphelper/proparrhlp.hxx>
namespace connectivity
@ -49,6 +50,7 @@ namespace connectivity
{
::rtl::OUString m_aRealName;
::rtl::OUString m_aTableName;
::rtl::OUString m_sLabel;
sal_Bool m_bFunction;
sal_Bool m_bDbasePrecisionChanged;
sal_Bool m_bAggregateFunction;
@ -64,6 +66,7 @@ namespace connectivity
OParseColumn(const ::rtl::OUString& _Name,
const ::rtl::OUString& _TypeName,
const ::rtl::OUString& _DefaultValue,
const ::rtl::OUString& _Description,
sal_Int32 _IsNullable,
sal_Int32 _Precision,
sal_Int32 _Scale,
@ -75,15 +78,17 @@ namespace connectivity
virtual void construct();
void setRealName(const ::rtl::OUString& _rName) { m_aRealName = _rName; }
void setLabel(const ::rtl::OUString& i_sLabel) { m_sLabel = i_sLabel; }
void setTableName(const ::rtl::OUString& _rName) { m_aTableName = _rName; }
void setFunction(sal_Bool _bFunction) { m_bFunction = _bFunction; }
void setAggregateFunction(sal_Bool _bFunction) { m_bAggregateFunction = _bFunction; }
void setIsSearchable( sal_Bool _bIsSearchable ) { m_bIsSearchable = _bIsSearchable; }
void setDbasePrecisionChanged(sal_Bool _bDbasePrecisionChanged) { m_bDbasePrecisionChanged = _bDbasePrecisionChanged; }
::rtl::OUString getRealName() const { return m_aRealName; }
::rtl::OUString getTableName() const { return m_aTableName; }
sal_Bool getFunction() const { return m_bFunction; }
::rtl::OUString getRealName() const { return m_aRealName; }
::rtl::OUString getLabel() const { return m_sLabel; }
::rtl::OUString getTableName() const { return m_aTableName; }
sal_Bool getFunction() const { return m_bFunction; }
sal_Bool getDbasePrecisionChanged() const { return m_bDbasePrecisionChanged; }
public:
@ -92,16 +97,20 @@ namespace connectivity
static ::vos::ORef< OSQLColumns >
createColumnsForResultSet(
const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSetMetaData >& _rxResMetaData,
const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XDatabaseMetaData >& _rxDBMetaData
const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XDatabaseMetaData >& _rxDBMetaData,
const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess>& i_xQueryColumns
);
/** creates a single OParseColumn, as described by a result set meta data instance
DECLARE_STL_USTRINGACCESS_MAP(int,StringMap);
/** creates a single OParseColumn, as described by a result set meta data instance.
The column names are unique.
*/
static OParseColumn*
createColumnForResultSet(
const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSetMetaData >& _rxResMetaData,
const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XDatabaseMetaData >& _rxDBMetaData,
sal_Int32 _nColumnPos
sal_Int32 _nColumnPos,
StringMap& _rColumns
);
private:
@ -125,17 +134,6 @@ namespace connectivity
virtual ~OOrderColumn();
public:
OOrderColumn(const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet>& _xColumn,sal_Bool _bCase,sal_Bool _bAscending);
OOrderColumn(const ::rtl::OUString& _Name,
const ::rtl::OUString& _TypeName,
const ::rtl::OUString& _DefaultValue,
sal_Int32 _IsNullable,
sal_Int32 _Precision,
sal_Int32 _Scale,
sal_Int32 _Type,
sal_Bool _IsAutoIncrement,
sal_Bool _IsCurrency,
sal_Bool _bCase
,sal_Bool _bAscending);
virtual void construct();

View File

@ -0,0 +1,54 @@
/*************************************************************************
*
* 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: dbtools.hxx,v $
* $Revision: 1.37 $
*
* 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 _CONNECTIVITY_SQLSTATEMENTHELPER_HXX_
#define _CONNECTIVITY_SQLSTATEMENTHELPER_HXX_
#include "connectivity/dbtoolsdllapi.hxx"
#include <com/sun/star/beans/XPropertySet.hpp>
namespace rtl
{
class OUStringBuffer;
}
//.........................................................................
namespace dbtools
{
class OOO_DLLPUBLIC_DBTOOLS ISQLStatementHelper
{
public:
virtual void addComment(const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& descriptor,::rtl::OUStringBuffer& _rOut) = 0;
};
//.........................................................................
} // namespace dbtools
//.........................................................................
#endif // _CONNECTIVITY_SQLSTATEMENTHELPER_HXX_

View File

@ -45,6 +45,7 @@ namespace connectivity
{
::rtl::OUString sName;
::rtl::OUString aField6;
::rtl::OUString sField12; // REMARKS
::rtl::OUString sField13;
sal_Int32 nField5
, nField7
@ -60,10 +61,12 @@ namespace connectivity
, sal_Int32 _nField7
, sal_Int32 _nField9
, sal_Int32 _nField11
, const ::rtl::OUString& _sField12
, const ::rtl::OUString& _sField13
,OrdinalPosition _nPosition )
:sName( _rName )
,aField6(_aField6)
,sField12(_sField12)
,sField13(_sField13)
,nField5(_nField5)
,nField7(_nField7)

View File

@ -87,6 +87,7 @@ namespace rtl
//.........................................................................
namespace dbtools
{
class ISQLStatementHelper;
typedef ::utl::SharedUNOComponent< ::com::sun::star::sdbc::XConnection > SharedConnection;
enum EComposeRule
@ -225,6 +226,15 @@ namespace dbtools
const ::rtl::OUString& _rName
);
/** returns the primary key columns of the table
*/
OOO_DLLPUBLIC_DBTOOLS ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess> getPrimaryKeyColumns_throw(
const ::com::sun::star::uno::Any& i_aTable
);
OOO_DLLPUBLIC_DBTOOLS ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess> getPrimaryKeyColumns_throw(
const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& i_xTable
);
/** get fields for a result set given by a "command descriptor"
<p>A command descriptor here means:
@ -661,6 +671,7 @@ namespace dbtools
OOO_DLLPUBLIC_DBTOOLS
::rtl::OUString createStandardCreateStatement( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& descriptor,
const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection>& _xConnection,
ISQLStatementHelper* _pHelper,
const ::rtl::OUString& _sCreatePattern = ::rtl::OUString());
/** creates the standard sql statement for the key part of a create table statement.
@ -674,32 +685,39 @@ namespace dbtools
const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection>& _xConnection);
/** creates the standard sql statement for the column part of a create table statement.
@param _pHelper
Allow to add special SQL constructs.
@param descriptor
The descriptor of the column.
@param _xConnection
The connection.
@param _bAddScale
The scale will also be added when the value is 0.
@param _pHelper
Allow to add special SQL constructs.
*/
OOO_DLLPUBLIC_DBTOOLS
::rtl::OUString createStandardColumnPart( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& descriptor,
const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection>& _xConnection,
const ::rtl::OUString& _sCreatePattern = ::rtl::OUString());
::rtl::OUString createStandardColumnPart( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& descriptor
,const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection>& _xConnection
,ISQLStatementHelper* _pHelper = NULL
,const ::rtl::OUString& _sCreatePattern = ::rtl::OUString());
/** creates a SQL CREATE TABLE statement
@param descriptor
The descriptor of the new table.
@param _xConnection
The connection.
@param _bAddScale
The scale will also be added when the value is 0.
@param _pHelper
Allow to add special SQL constructs.
@param _sCreatePattern
@return
The CREATE TABLE statement.
*/
OOO_DLLPUBLIC_DBTOOLS
::rtl::OUString createSqlCreateTableStatement( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& descriptor,
const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection>& _xConnection,
const ::rtl::OUString& _sCreatePattern = ::rtl::OUString());
::rtl::OUString createSqlCreateTableStatement( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& descriptor
,const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection>& _xConnection
,ISQLStatementHelper* _pHelper = NULL
,const ::rtl::OUString& _sCreatePattern = ::rtl::OUString());
/** creates a SDBC column with the help of getColumns.
@param _xTable

View File

@ -84,6 +84,7 @@ namespace connectivity
OColumn( const ::rtl::OUString& _Name,
const ::rtl::OUString& _TypeName,
const ::rtl::OUString& _DefaultValue,
const ::rtl::OUString& _Description,
sal_Int32 _IsNullable,
sal_Int32 _Precision,
sal_Int32 _Scale,

View File

@ -40,6 +40,7 @@
#include <map>
#include <memory>
#include <vector>
namespace connectivity
{
@ -47,6 +48,8 @@ namespace connectivity
class OSQLParseNode;
class OSQLParser;
typedef ::std::pair<const OSQLParseNode*,const OSQLParseNode* > TNodePair;
enum OSQLStatementType {
SQL_STATEMENT_UNKNOWN,
SQL_STATEMENT_SELECT,
@ -279,6 +282,10 @@ namespace connectivity
// tries to find the correct type of the function
sal_Int32 getFunctionReturnType(const OSQLParseNode* _pNode );
// returns a lis of all joined columns
::std::vector< TNodePair >& getJoinConditions() const;
private:
/** traverses the list of table names, and filles _rTables
*/
@ -351,6 +358,7 @@ namespace connectivity
{
m_aErrors = ::com::sun::star::sdbc::SQLException();
}
void impl_fillJoinConditions(const OSQLParseNode* i_pJoinCondition);
};
}

View File

@ -226,6 +226,11 @@ namespace connectivity
concatenation,
char_factor,
bit_value_fct,
comparison_predicate_part_2,
parenthesized_boolean_value_expression,
character_string_type,
other_like_predicate_part_2,
between_predicate_part_2,
rule_count, // letzter_wert
UNKNOWN_RULE // ID indicating that a node is no rule with a matching Rule-enum value (see getKnownRuleID)
};

View File

@ -285,7 +285,7 @@ public class CRMDatabase
m_database.getDataSource().createQuery( "parseable", "SELECT * FROM \"customers\"" );
m_database.getDataSource().createQuery( "parseable native", "SELECT * FROM INFORMATION_SCHEMA.SYSTEM_VIEWS", false );
m_database.getDataSource().createQuery( "unparseable",
"SELECT CAST( \"ID\" AS VARCHAR(3) ) AS \"ID_VARCHAR\" FROM \"products\"", false );
"SELECT {fn DAYOFMONTH ('2001-01-01')} AS \"ID_VARCHAR\" FROM \"products\"", false );
validateUnparseable();
}

View File

@ -126,9 +126,27 @@ using namespace ::com::sun::star::beans;
case DataType::TIMESTAMP:
{
DateTime aDateTime;
bool bOk = false;
if (_rVal.getValueType().getTypeClass() == ::com::sun::star::uno::TypeClass_DOUBLE)
{
double nValue = 0.0;
_rVal >>= nValue;
aDateTime = DBTypeConversion::toDateTime(nValue);
bOk = true;
}
else if (_rVal.getValueType().getTypeClass() == ::com::sun::star::uno::TypeClass_STRING)
{
::rtl::OUString sValue;
_rVal >>= sValue;
aDateTime = DBTypeConversion::toDateTime(sValue);
bOk = true;
}
else
bOk = _rVal >>= aDateTime;
OSL_VERIFY_RES( bOk, "DBTypeConversion::toSQLString: _rVal is not datetime!");
// check if this is really a timestamp or only a date
if ( _rVal >>= aDateTime )
if ( bOk )
{
if (bQuote)
aRet.appendAscii("{TS '");
@ -142,7 +160,24 @@ using namespace ::com::sun::star::beans;
case DataType::DATE:
{
Date aDate;
OSL_VERIFY_RES( _rVal >>= aDate, "DBTypeConversion::toSQLString: _rVal is not date!");
bool bOk = false;
if (_rVal.getValueType().getTypeClass() == ::com::sun::star::uno::TypeClass_DOUBLE)
{
double nValue = 0.0;
_rVal >>= nValue;
aDate = DBTypeConversion::toDate(nValue);
bOk = true;
}
else if (_rVal.getValueType().getTypeClass() == ::com::sun::star::uno::TypeClass_STRING)
{
::rtl::OUString sValue;
_rVal >>= sValue;
aDate = DBTypeConversion::toDate(sValue);
bOk = true;
}
else
bOk = _rVal >>= aDate;
OSL_VERIFY_RES( bOk, "DBTypeConversion::toSQLString: _rVal is not date!");
if (bQuote)
aRet.appendAscii("{D '");
aRet.append(DBTypeConversion::toDateString(aDate));
@ -152,7 +187,24 @@ using namespace ::com::sun::star::beans;
case DataType::TIME:
{
Time aTime;
OSL_VERIFY_RES( _rVal >>= aTime,"DBTypeConversion::toSQLString: _rVal is not time!");
bool bOk = false;
if (_rVal.getValueType().getTypeClass() == ::com::sun::star::uno::TypeClass_DOUBLE)
{
double nValue = 0.0;
_rVal >>= nValue;
aTime = DBTypeConversion::toTime(nValue);
bOk = true;
}
else if (_rVal.getValueType().getTypeClass() == ::com::sun::star::uno::TypeClass_STRING)
{
::rtl::OUString sValue;
_rVal >>= sValue;
aTime = DBTypeConversion::toTime(sValue);
bOk = true;
}
else
bOk = _rVal >>= aTime;
OSL_VERIFY_RES( bOk,"DBTypeConversion::toSQLString: _rVal is not time!");
if (bQuote)
aRet.appendAscii("{T '");
aRet.append(DBTypeConversion::toTimeString(aTime));

View File

@ -136,26 +136,26 @@ DriversConfig::DriversConfig(const uno::Reference< lang::XMultiServiceFactory >&
}
// -----------------------------------------------------------------------------
DriversConfig::~DriversConfig()
{
}
DriversConfig::~DriversConfig()
{
}
// -----------------------------------------------------------------------------
DriversConfig::DriversConfig( const DriversConfig& _rhs )
{
*this = _rhs;
}
DriversConfig::DriversConfig( const DriversConfig& _rhs )
{
*this = _rhs;
}
// -----------------------------------------------------------------------------
DriversConfig& DriversConfig::operator=( const DriversConfig& _rhs )
{
if ( this != &_rhs )
{
m_aNode = _rhs.m_aNode;
}
return *this;
}
DriversConfig& DriversConfig::operator=( const DriversConfig& _rhs )
{
if ( this != &_rhs )
{
m_aNode = _rhs.m_aNode;
}
return *this;
}
// -----------------------------------------------------------------------------
::rtl::OUString DriversConfig::getDriverFactoryName(const ::rtl::OUString& _sURL) const
{

View File

@ -121,29 +121,7 @@ sdbcx::ObjectType OColumnsHelper::createObject(const ::rtl::OUString& _rName)
if ( pColDesc )
{
Reference<XPropertySet> xPr = m_pTable;
Reference<XKeysSupplier> xKeysSup(xPr,UNO_QUERY);
Reference<XNameAccess> xPrimaryKeyColumns;
if ( xKeysSup.is() )
{
const Reference<XIndexAccess> xKeys = xKeysSup->getKeys();
if ( xKeys.is() )
{
::dbtools::OPropertyMap& rPropMap = OMetaConnection::getPropMap();
const sal_Int32 nKeyCount = xKeys->getCount();
for(sal_Int32 nKeyIter = 0; nKeyIter < nKeyCount;++nKeyIter)
{
const Reference<XPropertySet> xKey(xKeys->getByIndex(nKeyIter),UNO_QUERY_THROW);
sal_Int32 nType = 0;
xKey->getPropertyValue(rPropMap.getNameByIndex(PROPERTY_ID_TYPE)) >>= nType;
if ( nType == KeyType::PRIMARY )
{
const Reference<XColumnsSupplier> xColS(xKey,UNO_QUERY_THROW);
xPrimaryKeyColumns = xColS->getColumns();
break;
}
} // for(sal_Int32 nKeyIter = 0; nKeyIter < nKeyCount;++)
}
}
const Reference<XNameAccess> xPrimaryKeyColumns = getPrimaryKeyColumns_throw(xPr);
sal_Int32 nField11 = pColDesc->nField11;
if ( nField11 != ColumnValue::NO_NULLS && xPrimaryKeyColumns.is() && xPrimaryKeyColumns->hasByName(_rName) )
{
@ -152,6 +130,7 @@ sdbcx::ObjectType OColumnsHelper::createObject(const ::rtl::OUString& _rName)
connectivity::sdbcx::OColumn* pRet = new connectivity::sdbcx::OColumn(_rName,
pColDesc->aField6,
pColDesc->sField13,
pColDesc->sField12,
nField11,
pColDesc->nField7,
pColDesc->nField9,
@ -207,7 +186,7 @@ sdbcx::ObjectType OColumnsHelper::appendObject( const ::rtl::OUString& _rForName
aSql += ::dbtools::composeTableName( xMetaData, m_pTable, ::dbtools::eInTableDefinitions, false, false, true );
aSql += ::rtl::OUString::createFromAscii(" ADD ");
aSql += ::dbtools::createStandardColumnPart(descriptor,m_pTable->getConnection(),m_pTable->getTypeCreatePattern());
aSql += ::dbtools::createStandardColumnPart(descriptor,m_pTable->getConnection(),NULL,m_pTable->getTypeCreatePattern());
Reference< XStatement > xStmt = m_pTable->getConnection()->createStatement( );
if ( xStmt.is() )

View File

@ -210,9 +210,10 @@ namespace
sal_Int32 nField7 = xRow->getInt(7)
, nField9 = xRow->getInt(9)
, nField11= xRow->getInt(11);
::rtl::OUString sField13 = xRow->getString(13);
::rtl::OUString sField12 = xRow->getString(12)
,sField13 = xRow->getString(13);
nOrdinalPosition = xRow->getInt( 17 ); // ORDINAL_POSITION
_out_rColumns.push_back( ColumnDesc( sName,nField5,aField6,nField7,nField9,nField11,sField13, nOrdinalPosition ) );
_out_rColumns.push_back( ColumnDesc( sName,nField5,aField6,nField7,nField9,nField11,sField12,sField13, nOrdinalPosition ) );
}
}

View File

@ -60,8 +60,10 @@
#include <com/sun/star/sdbc/XRow.hpp>
#include <com/sun/star/sdbc/XRowSet.hpp>
#include <com/sun/star/sdbc/XRowUpdate.hpp>
#include <com/sun/star/sdbcx/KeyType.hpp>
#include <com/sun/star/sdbcx/Privilege.hpp>
#include <com/sun/star/sdbcx/XColumnsSupplier.hpp>
#include <com/sun/star/sdbcx/XKeysSupplier.hpp>
#include <com/sun/star/sdbcx/XTablesSupplier.hpp>
#include <com/sun/star/task/XInteractionHandler.hpp>
#include <com/sun/star/task/XInteractionRequest.hpp>
@ -528,6 +530,46 @@ Reference< XNameAccess> getTableFields(const Reference< XConnection>& _rxConn,co
Reference< XComponent > xDummy;
return getFieldsByCommandDescriptor( _rxConn, CommandType::TABLE, _rName, xDummy );
}
//------------------------------------------------------------------------------
Reference< XNameAccess> getPrimaryKeyColumns_throw(const Any& i_aTable)
{
const Reference< XPropertySet > xTable(i_aTable,UNO_QUERY_THROW);
return getPrimaryKeyColumns_throw(xTable);
}
//------------------------------------------------------------------------------
Reference< XNameAccess> getPrimaryKeyColumns_throw(const Reference< XPropertySet >& i_xTable)
{
Reference<XNameAccess> xKeyColumns;
const Reference<XKeysSupplier> xKeySup(i_xTable,UNO_QUERY);
if ( xKeySup.is() )
{
const Reference<XIndexAccess> xKeys = xKeySup->getKeys();
if ( xKeys.is() )
{
::dbtools::OPropertyMap& rPropMap = OMetaConnection::getPropMap();
const ::rtl::OUString sPropName = rPropMap.getNameByIndex(PROPERTY_ID_TYPE);
Reference<XPropertySet> xProp;
const sal_Int32 nCount = xKeys->getCount();
for(sal_Int32 i = 0;i< nCount;++i)
{
xProp.set(xKeys->getByIndex(i),UNO_QUERY_THROW);
if ( xProp.is() )
{
sal_Int32 nKeyType = 0;
xProp->getPropertyValue(sPropName) >>= nKeyType;
if(KeyType::PRIMARY == nKeyType)
{
const Reference<XColumnsSupplier> xKeyColsSup(xProp,UNO_QUERY_THROW);
xKeyColumns = xKeyColsSup->getColumns();
break;
}
}
}
}
}
return xKeyColumns;
}
//------------------------------------------------------------------------------
namespace
@ -2051,7 +2093,7 @@ namespace connectivity
void release(oslInterlockedCount& _refCount,
::cppu::OBroadcastHelper& rBHelper,
::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _xInterface,
Reference< XInterface >& _xInterface,
::com::sun::star::lang::XComponent* _pObject)
{
if (osl_decrementInterlockedCount( &_refCount ) == 0)
@ -2061,7 +2103,7 @@ void release(oslInterlockedCount& _refCount,
if (!rBHelper.bDisposed && !rBHelper.bInDispose)
{
// remember the parent
::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > xParent;
Reference< XInterface > xParent;
{
::osl::MutexGuard aGuard( rBHelper.rMutex );
xParent = _xInterface;

View File

@ -30,11 +30,10 @@
#include "connectivity/dbtools.hxx"
#include "connectivity/dbconversion.hxx"
#include "connectivity/dbcharset.hxx"
#include "connectivity/SQLStatementHelper.hxx"
#include <unotools/confignode.hxx>
#include "resource/sharedresources.hxx"
#ifndef CONNECTIVITY_RESOURCE_COMMON_HRC
#include "resource/common_res.hrc"
#endif
#include <com/sun/star/sdbc/XConnection.hpp>
#include <com/sun/star/sdbc/ColumnValue.hpp>
#include <com/sun/star/sdbc/DataType.hpp>
@ -71,7 +70,7 @@ namespace dbtools
using namespace connectivity;
using namespace comphelper;
::rtl::OUString createStandardColumnPart(const Reference< XPropertySet >& xColProp,const Reference< XConnection>& _xConnection,const ::rtl::OUString& _sCreatePattern)
::rtl::OUString createStandardColumnPart(const Reference< XPropertySet >& xColProp,const Reference< XConnection>& _xConnection,ISQLStatementHelper* _pHelper,const ::rtl::OUString& _sCreatePattern)
{
Reference<XDatabaseMetaData> xMetaData = _xConnection->getMetaData();
@ -186,11 +185,14 @@ namespace dbtools
aSql.append(sAutoIncrementValue);
}
if ( _pHelper )
_pHelper->addComment(xColProp,aSql);
return aSql.makeStringAndClear();
}
// -----------------------------------------------------------------------------
::rtl::OUString createStandardCreateStatement(const Reference< XPropertySet >& descriptor,const Reference< XConnection>& _xConnection,const ::rtl::OUString& _sCreatePattern)
::rtl::OUString createStandardCreateStatement(const Reference< XPropertySet >& descriptor,const Reference< XConnection>& _xConnection,ISQLStatementHelper* _pHelper,const ::rtl::OUString& _sCreatePattern)
{
::rtl::OUStringBuffer aSql = ::rtl::OUString::createFromAscii("CREATE TABLE ");
::rtl::OUString sCatalog,sSchema,sTable,sComposedName;
@ -223,7 +225,7 @@ namespace dbtools
{
if ( (xColumns->getByIndex(i) >>= xColProp) && xColProp.is() )
{
aSql.append(createStandardColumnPart(xColProp,_xConnection,_sCreatePattern));
aSql.append(createStandardColumnPart(xColProp,_xConnection,_pHelper,_sCreatePattern));
aSql.appendAscii(",");
}
}
@ -364,9 +366,10 @@ namespace
// -----------------------------------------------------------------------------
::rtl::OUString createSqlCreateTableStatement( const Reference< XPropertySet >& descriptor,
const Reference< XConnection>& _xConnection,
ISQLStatementHelper* _pHelper,
const ::rtl::OUString& _sCreatePattern)
{
::rtl::OUString aSql = ::dbtools::createStandardCreateStatement(descriptor,_xConnection,_sCreatePattern);
::rtl::OUString aSql = ::dbtools::createStandardCreateStatement(descriptor,_xConnection,_pHelper,_sCreatePattern);
const ::rtl::OUString sKeyStmt = ::dbtools::createStandardKeyStatement(descriptor,_xConnection);
if ( sKeyStmt.getLength() )
aSql += sKeyStmt;
@ -411,7 +414,8 @@ namespace
sal_Int32 nField7 = xRow->getInt(7)
, nField9 = xRow->getInt(9)
, nField11= xRow->getInt(11);
::rtl::OUString sField13 = xRow->getString(13);
::rtl::OUString sField12 = xRow->getString(12),
sField13 = xRow->getString(13);
::comphelper::disposeComponent(xRow);
sal_Bool bAutoIncrement = _bIsAutoIncrement
@ -471,6 +475,7 @@ namespace
connectivity::sdbcx::OColumn* pRet = new connectivity::sdbcx::OColumn(_rName,
aField6,
sField13,
sField12,
nField11,
nField7,
nField9,
@ -526,28 +531,7 @@ Reference<XPropertySet> createSDBCXColumn(const Reference<XPropertySet>& _xTable
_xTable->getPropertyValue(rPropMap.getNameByIndex(PROPERTY_ID_SCHEMANAME)) >>= aSchema;
_xTable->getPropertyValue(rPropMap.getNameByIndex(PROPERTY_ID_NAME)) >>= aTable;
Reference<XKeysSupplier> xKeysSup(_xTable,UNO_QUERY);
Reference<XNameAccess> xPrimaryKeyColumns;
if ( xKeysSup.is() )
{
const Reference<XIndexAccess> xKeys = xKeysSup->getKeys();
if ( xKeys.is() )
{
const sal_Int32 nKeyCount = xKeys->getCount();
for(sal_Int32 nKeyIter = 0; nKeyIter < nKeyCount;++nKeyIter)
{
const Reference<XPropertySet> xKey(xKeys->getByIndex(nKeyIter),UNO_QUERY_THROW);
sal_Int32 nType = 0;
xKey->getPropertyValue(rPropMap.getNameByIndex(PROPERTY_ID_TYPE)) >>= nType;
if ( nType == KeyType::PRIMARY )
{
const Reference<XColumnsSupplier> xColS(xKey,UNO_QUERY_THROW);
xPrimaryKeyColumns = xColS->getColumns();
break;
}
} // for(sal_Int32 nKeyIter = 0; nKeyIter < nKeyCount;++)
}
}
Reference<XNameAccess> xPrimaryKeyColumns = getPrimaryKeyColumns_throw(_xTable);
xProp = lcl_createSDBCXColumn(xPrimaryKeyColumns,_xConnection,aCatalog, aSchema, aTable, _rName,_rName,_bCase,_bQueryForInfo,_bIsAutoIncrement,_bIsCurrency,_nDataType);
if ( !xProp.is() )
@ -555,7 +539,7 @@ Reference<XPropertySet> createSDBCXColumn(const Reference<XPropertySet>& _xTable
xProp = lcl_createSDBCXColumn(xPrimaryKeyColumns,_xConnection,aCatalog, aSchema, aTable, ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("%")),_rName,_bCase,_bQueryForInfo,_bIsAutoIncrement,_bIsCurrency,_nDataType);
if ( !xProp.is() )
xProp = new connectivity::sdbcx::OColumn(_rName,
::rtl::OUString(),::rtl::OUString(),
::rtl::OUString(),::rtl::OUString(),::rtl::OUString(),
ColumnValue::NULLABLE_UNKNOWN,
0,
0,
@ -665,19 +649,9 @@ Reference< XTablesSupplier> getDataDefinitionByURLAndConnection(
Reference< XDataDefinitionSupplier > xSupp( xManager->getDriverByURL( _rsUrl ), UNO_QUERY );
if ( xSupp.is() )
{
xTablesSup = xSupp->getDataDefinitionByConnection( _xConnection );
// if we don't get the catalog from the original driver we have to try them all.
if ( !xTablesSup.is() )
{ // !TODO: Why?
Reference< XEnumerationAccess> xEnumAccess( xManager, UNO_QUERY_THROW );
Reference< XEnumeration > xEnum( xEnumAccess->createEnumeration(), UNO_QUERY_THROW );
while ( xEnum.is() && xEnum->hasMoreElements() && !xTablesSup.is() )
{
xEnum->nextElement() >>= xSupp;
if ( xSupp.is() )
xTablesSup = xSupp->getDataDefinitionByConnection( _xConnection );
}
OSL_ENSURE(xTablesSup.is(),"No table supplier!");
}
}
catch( const Exception& )

View File

@ -93,6 +93,7 @@ namespace dbtools
const sal_Char* getPROPERTY_ID_FIELDTYPE() { return "FieldType"; }
const sal_Char* getPROPERTY_ID_VALUE() { return "Value"; }
const sal_Char* getPROPERTY_ID_ACTIVE_CONNECTION() { return "ActiveConnection"; }
const sal_Char* getPROPERTY_ID_LABEL() { return "Label"; }
//============================================================
//= error messages
@ -180,6 +181,7 @@ namespace dbtools
case PROPERTY_ID_HAVINGCLAUSE: { rtl_uString_newFromAscii(&pStr,getPROPERTY_ID_HAVINGCLAUSE() ); break; }
case PROPERTY_ID_ISSIGNED: { rtl_uString_newFromAscii(&pStr,getPROPERTY_ID_ISSIGNED() ); break; }
case PROPERTY_ID_ISSEARCHABLE: { rtl_uString_newFromAscii(&pStr,getPROPERTY_ID_ISSEARCHABLE() ); break; }
case PROPERTY_ID_LABEL: { rtl_uString_newFromAscii(&pStr,getPROPERTY_ID_LABEL() ); break; }
case PROPERTY_ID_APPLYFILTER: { rtl_uString_newFromAscii(&pStr,getPROPERTY_ID_APPLYFILTER() ); break; }
case PROPERTY_ID_FILTER: { rtl_uString_newFromAscii(&pStr,getPROPERTY_ID_FILTER() ); break; }
case PROPERTY_ID_MASTERFIELDS: { rtl_uString_newFromAscii(&pStr,getPROPERTY_ID_MASTERFIELDS() ); break; }

View File

@ -96,6 +96,7 @@ sdbcx::ObjectType OColumns::createObject(const ::rtl::OUString& _rName)
xRet = new OColumn(_rName,
sTypeName,
xRow->getString(13),
xRow->getString(12),
xRow->getInt(11),
nPrec,
xRow->getInt(9),

View File

@ -65,6 +65,11 @@
<value></value>
</prop>
</node>
<node oor:name="AddIndexAppendix" oor:op="replace">
<prop oor:name="Value" oor:type="xs:boolean">
<value>true</value>
</prop>
</node>
</node>
<node oor:name="Features">
<node oor:name="UseSQL92NamingConstraints" oor:op="replace">

View File

@ -65,7 +65,7 @@ void WpADOColumn::Create()
}
// -------------------------------------------------------------------------
OAdoColumn::OAdoColumn(sal_Bool _bCase,OConnection* _pConnection,_ADOColumn* _pColumn)
: connectivity::sdbcx::OColumn(::rtl::OUString(),::rtl::OUString(),::rtl::OUString(),0,0,0,0,sal_False,sal_False,sal_False,_bCase)
: connectivity::sdbcx::OColumn(::rtl::OUString(),::rtl::OUString(),::rtl::OUString(),::rtl::OUString(),0,0,0,0,sal_False,sal_False,sal_False,_bCase)
,m_pConnection(_pConnection)
{
construct();
@ -183,12 +183,13 @@ void OAdoColumn::setFastPropertyValue_NoBroadcast(sal_Int32 nHandle,const Any& r
OTools::putValue( m_aColumn.get_Properties(), ::rtl::OUString::createFromAscii( "Autoincrement" ), getBOOL( rValue ) );
break;
case PROPERTY_ID_IM001:
case PROPERTY_ID_DESCRIPTION:
pAdoPropertyName = "Default";
pAdoPropertyName = "Description";
break;
case PROPERTY_ID_DEFAULTVALUE:
pAdoPropertyName = "Description";
pAdoPropertyName = "Default";
break;
}

View File

@ -134,6 +134,11 @@
<value>UserPassword</value>
</prop>
</node>
<node oor:name="SupportsColumnDescription" oor:op="replace">
<prop oor:name="Value" oor:type="xs:boolean">
<value>true</value>
</prop>
</node>
</node>
</node>
<node oor:name="sdbc:ado:access:PROVIDER=Microsoft.Jet.OLEDB.4.0;DATA SOURCE=*" oor:op="replace">
@ -228,6 +233,11 @@
<value>mdb</value>
</prop>
</node>
<node oor:name="SupportsColumnDescription" oor:op="replace">
<prop oor:name="Value" oor:type="xs:boolean">
<value>true</value>
</prop>
</node>
</node>
</node>
<node oor:name="sdbc:ado:access:Provider=Microsoft.ACE.OLEDB.12.0;DATA SOURCE=*" oor:op="replace">

View File

@ -525,7 +525,7 @@ void OCalcTable::fillColumns()
aFind = connectivity::find(m_aColumns->get().begin(),m_aColumns->get().end(),aAlias,aCase);
}
sdbcx::OColumn* pColumn = new sdbcx::OColumn( aAlias, aTypeName, ::rtl::OUString(),
sdbcx::OColumn* pColumn = new sdbcx::OColumn( aAlias, aTypeName, ::rtl::OUString(),::rtl::OUString(),
ColumnValue::NULLABLE, nPrecision, nDecimals,
eType, sal_False, sal_False, bCurrency,
bStoresMixedCaseQuotedIdentifiers);

View File

@ -449,6 +449,7 @@ OSL_TRACE("column type: %c",aDBFColumn.db_typ);
Reference< XPropertySet> xCol = new sdbcx::OColumn(aColumnName,
aTypeName,
::rtl::OUString(),
::rtl::OUString(),
ColumnValue::NULLABLE,
nPrecision,
aDBFColumn.db_dez,

View File

@ -50,6 +50,11 @@
<value>false</value>
</prop>
</node>
<node oor:name="AddIndexAppendix" oor:op="replace">
<prop oor:name="Value" oor:type="xs:boolean">
<value>false</value>
</prop>
</node>
</node>
<node oor:name="Features">
<node oor:name="UseSQL92NamingConstraints" oor:op="replace">

View File

@ -66,6 +66,7 @@ sdbcx::ObjectType OEvoabColumns::createObject(const ::rtl::OUString& _rName)
_rName,
xRow->getString(6),
xRow->getString(13),
xRow->getString(12),
xRow->getInt(11),
xRow->getInt(7),
xRow->getInt(9),

View File

@ -381,15 +381,16 @@ EBookQuery *OCommonStatement::whereAnalysis( const OSQLParseNode* parseTree )
// SQL like
else if( SQL_ISRULE( parseTree, like_predicate ) )
{
ENSURE_OR_THROW( parseTree->count() >= 4, "unexpected like_predicate structure" );
ENSURE_OR_THROW( parseTree->count() == 2, "unexpected like_predicate structure" );
const OSQLParseNode* pPart2 = parseTree->getChild(1);
if( ! SQL_ISRULE( parseTree->getChild( 0 ), column_ref) )
m_pConnection->throwGenericSQLException(STR_QUERY_INVALID_LIKE_COLUMN,*this);
::rtl::OUString aColumnName( impl_getColumnRefColumnName_throw( *parseTree->getChild( 0 ) ) );
OSQLParseNode *pAtom = parseTree->getChild( parseTree->count() - 2 ); // Match String
bool bNotLike = parseTree->count() == 5;
OSQLParseNode *pAtom = pPart2->getChild( pPart2->count() - 2 ); // Match String
bool bNotLike = pPart2->getChild(0)->isToken();
if( !( pAtom->getNodeType() == SQL_NODE_STRING ||
pAtom->getNodeType() == SQL_NODE_NAME ||

View File

@ -64,6 +64,7 @@ sdbcx::ObjectType OColumns::createObject(const ::rtl::OUString& _rName)
sdbcx::OColumn* pRet = new sdbcx::OColumn(_rName,
xRow->getString(6),
xRow->getString(13),
xRow->getString(12),
xRow->getInt(11),
xRow->getInt(7),
xRow->getInt(9),

View File

@ -509,6 +509,7 @@ UINT32 OPreparedStatement::AddParameter(OSQLParseNode * pParameter, const Refere
}
Reference<XPropertySet> xParaColumn = new connectivity::parse::OParseColumn(sParameterName
,::rtl::OUString()
,::rtl::OUString()
,::rtl::OUString()
,nNullable

View File

@ -288,17 +288,14 @@ OOperand* OPredicateCompiler::execute_COMPARE(OSQLParseNode* pPredicateNode) th
//------------------------------------------------------------------
OOperand* OPredicateCompiler::execute_LIKE(OSQLParseNode* pPredicateNode) throw(SQLException, RuntimeException)
{
DBG_ASSERT(pPredicateNode->count() >= 4,"OFILECursor: Fehler im Parse Tree");
DBG_ASSERT(pPredicateNode->count() == 2,"OFILECursor: Fehler im Parse Tree");
const OSQLParseNode* pPart2 = pPredicateNode->getChild(1);
sal_Int32 ePredicateType;
sal_Unicode cEscape = L'\0';
if (pPredicateNode->count() == 5)
ePredicateType = SQLFilterOperator::NOT_LIKE;
else
ePredicateType = SQLFilterOperator::LIKE;
const bool bNotLike = pPart2->getChild(0)->isToken();
OSQLParseNode* pAtom = pPredicateNode->getChild(pPredicateNode->count()-2);
OSQLParseNode* pOptEscape = pPredicateNode->getChild(pPredicateNode->count()-1);
OSQLParseNode* pAtom = pPart2->getChild(pPredicateNode->count()-2);
OSQLParseNode* pOptEscape = pPart2->getChild(pPredicateNode->count()-1);
if (!(pAtom->getNodeType() == SQL_NODE_STRING || SQL_ISRULE(pAtom,parameter)))
{
@ -322,9 +319,9 @@ OOperand* OPredicateCompiler::execute_LIKE(OSQLParseNode* pPredicateNode) throw(
execute(pPredicateNode->getChild(0));
execute(pAtom);
OBoolOperator* pOperator = (ePredicateType == SQLFilterOperator::LIKE)
? new OOp_LIKE(cEscape)
: new OOp_NOTLIKE(cEscape);
OBoolOperator* pOperator = bNotLike
? new OOp_NOTLIKE(cEscape)
: new OOp_LIKE(cEscape);
m_aCodeList.push_back(pOperator);
return NULL;
@ -332,11 +329,12 @@ OOperand* OPredicateCompiler::execute_LIKE(OSQLParseNode* pPredicateNode) throw(
//------------------------------------------------------------------
OOperand* OPredicateCompiler::execute_BETWEEN(OSQLParseNode* pPredicateNode) throw(SQLException, RuntimeException)
{
DBG_ASSERT(pPredicateNode->count() == 6,"OFILECursor: Fehler im Parse Tree");
DBG_ASSERT(pPredicateNode->count() == 2,"OFILECursor: Fehler im Parse Tree");
OSQLParseNode* pColumn = pPredicateNode->getChild(0);
OSQLParseNode* p1stValue = pPredicateNode->getChild(3);
OSQLParseNode* p2ndtValue = pPredicateNode->getChild(5);
const OSQLParseNode* pPart2 = pPredicateNode->getChild(1);
OSQLParseNode* p1stValue = pPart2->getChild(3);
OSQLParseNode* p2ndtValue = pPart2->getChild(5);
if (
!(p1stValue->getNodeType() == SQL_NODE_STRING || SQL_ISRULE(p1stValue,parameter))
@ -346,7 +344,7 @@ OOperand* OPredicateCompiler::execute_BETWEEN(OSQLParseNode* pPredicateNode) thr
m_pAnalyzer->getConnection()->throwGenericSQLException(STR_QUERY_INVALID_BETWEEN,NULL);
}
sal_Bool bNot = SQL_ISTOKEN(pPredicateNode->getChild(1),NOT);
sal_Bool bNot = SQL_ISTOKEN(pPart2->getChild(0),NOT);
OOperand* pColumnOp = execute(pColumn);
OOperand* pOb1 = execute(p1stValue);
@ -411,11 +409,12 @@ OOperand* OPredicateCompiler::execute_BETWEEN(OSQLParseNode* pPredicateNode) thr
//------------------------------------------------------------------
OOperand* OPredicateCompiler::execute_ISNULL(OSQLParseNode* pPredicateNode) throw(SQLException, RuntimeException)
{
DBG_ASSERT(pPredicateNode->count() >= 3,"OFILECursor: Fehler im Parse Tree");
DBG_ASSERT(SQL_ISTOKEN(pPredicateNode->getChild(1),IS),"OFILECursor: Fehler im Parse Tree");
DBG_ASSERT(pPredicateNode->count() == 2,"OFILECursor: Fehler im Parse Tree");
const OSQLParseNode* pPart2 = pPredicateNode->getChild(1);
DBG_ASSERT(SQL_ISTOKEN(pPart2->getChild(0),IS),"OFILECursor: Fehler im Parse Tree");
sal_Int32 ePredicateType;
if (SQL_ISTOKEN(pPredicateNode->getChild(2),NOT))
if (SQL_ISTOKEN(pPart2->getChild(1),NOT))
ePredicateType = SQLFilterOperator::NOT_SQLNULL;
else
ePredicateType = SQLFilterOperator::SQLNULL;
@ -635,7 +634,6 @@ OOperand* OPredicateCompiler::executeFunction(OSQLParseNode* pPredicateNode)
switch ( nTokenId )
{
case SQL_TOKEN_CHAR_LENGTH:
case SQL_TOKEN_CHARACTER_LENGTH:
case SQL_TOKEN_LENGTH:
case SQL_TOKEN_OCTET_LENGTH:
case SQL_TOKEN_ASCII:
@ -677,7 +675,6 @@ OOperand* OPredicateCompiler::executeFunction(OSQLParseNode* pPredicateNode)
switch( nTokenId )
{
case SQL_TOKEN_CHAR_LENGTH:
case SQL_TOKEN_CHARACTER_LENGTH:
case SQL_TOKEN_LENGTH:
case SQL_TOKEN_OCTET_LENGTH:
pOperator = new OOp_CharLength();

View File

@ -304,7 +304,7 @@ void OFlatTable::fillColumns(const ::com::sun::star::lang::Locale& _aLocale)
aFind = connectivity::find(m_aColumns->get().begin(),m_aColumns->get().end(),aAlias,aCase);
}
sdbcx::OColumn* pColumn = new sdbcx::OColumn(aAlias,aTypeName,::rtl::OUString(),
sdbcx::OColumn* pColumn = new sdbcx::OColumn(aAlias,aTypeName,::rtl::OUString(),::rtl::OUString(),
ColumnValue::NULLABLE,
nPrecision,
nScale,

View File

@ -50,6 +50,11 @@
<value>true</value>
</prop>
</node>
<node oor:name="AddIndexAppendix" oor:op="replace">
<prop oor:name="Value" oor:type="xs:boolean">
<value>false</value>
</prop>
</node>
</node>
<node oor:name="MetaData">
<node oor:name="SupportsTableCreation" oor:op="replace">

View File

@ -189,6 +189,11 @@
<value>oracle.jdbc.driver.OracleDriver</value>
</prop>
</node>
<node oor:name="AddIndexAppendix" oor:op="replace">
<prop oor:name="Value" oor:type="xs:boolean">
<value>false</value>
</prop>
</node>
</node>
<node oor:name="Features">
<node oor:name="IgnoreCurrency" oor:op="replace">

View File

@ -66,6 +66,7 @@ sdbcx::ObjectType KabColumns::createObject(const ::rtl::OUString& _rName)
_rName,
xRow->getString(6),
xRow->getString(13),
xRow->getString(12),
xRow->getInt(11),
xRow->getInt(7),
xRow->getInt(9),

View File

@ -185,12 +185,13 @@ KabCondition *KabCommonStatement::analyseWhereClause(const OSQLParseNode *pParse
}
}
}
else if (pParseNode->count() == 4)
else if (SQL_ISRULE(pParseNode, test_for_null) || SQL_ISRULE(pParseNode, like_predicate))
{
const OSQLParseNode *pLeft = pParseNode->getChild(0),
*pMiddleLeft = pParseNode->getChild(1),
*pMiddleRight = pParseNode->getChild(2),
*pRight = pParseNode->getChild(3);
const OSQLParseNode *pLeft = pParseNode->getChild(0);
const OSQLParseNode* pPart2 = pParseNode->getChild(1);
const OSQLParseNode *pMiddleLeft = pPart2->getChild(0),
*pMiddleRight = pPart2->getChild(1),
*pRight = pPart2->getChild(2);
if (SQL_ISRULE(pParseNode, test_for_null))
{

View File

@ -66,6 +66,7 @@ sdbcx::ObjectType MacabColumns::createObject(const ::rtl::OUString& _rName)
_rName,
xRow->getString(6),
xRow->getString(13),
xRow->getString(12),
xRow->getInt(11),
xRow->getInt(7),
xRow->getInt(9),

View File

@ -188,12 +188,13 @@ MacabCondition *MacabCommonStatement::analyseWhereClause(const OSQLParseNode *pP
}
}
}
else if (pParseNode->count() == 4)
else if (SQL_ISRULE(pParseNode, test_for_null) || SQL_ISRULE(pParseNode, like_predicate))
{
const OSQLParseNode *pLeft = pParseNode->getChild(0),
*pMiddleLeft = pParseNode->getChild(1),
*pMiddleRight = pParseNode->getChild(2),
*pRight = pParseNode->getChild(3);
const OSQLParseNode *pLeft = pParseNode->getChild(0);
const OSQLParseNode* pPart2 = pParseNode->getChild(1);
const OSQLParseNode *pMiddleLeft = pPart2->getChild(0),
*pMiddleRight = pPart2->getChild(1),
*pRight = pPart2->getChild(2);
if (SQL_ISRULE(pParseNode, test_for_null))
{

View File

@ -74,6 +74,7 @@ sdbcx::ObjectType OColumns::createObject(const ::rtl::OUString& _rName)
OColumn* pRet = new OColumn(_rName,
sTypeName,
xRow->getString(13),
xRow->getString(12),
xRow->getInt(11),
nPrec,
xRow->getInt(9),

View File

@ -448,6 +448,7 @@ sal_uInt32 OPreparedStatement::AddParameter(OSQLParseNode * pParameter, const Re
}
Reference<XPropertySet> xParaColumn = new connectivity::sdbcx::OColumn(sParameterName
,::rtl::OUString()
,::rtl::OUString()
,::rtl::OUString()
,nNullable

View File

@ -882,7 +882,7 @@ void OResultSet::analyseWhereClause( const OSQLParseNode* parseT
}
else if (SQL_ISRULE(parseTree,like_predicate))
{
OSL_ENSURE(parseTree->count() >= 4, "Error parsing LIKE predicate");
OSL_ENSURE(parseTree->count() == 2, "Error parsing LIKE predicate");
OSL_TRACE("analyseSQL : Got LIKE rule\n");
@ -895,9 +895,11 @@ void OResultSet::analyseWhereClause( const OSQLParseNode* parseT
OSQLParseNode *pColumn;
OSQLParseNode *pAtom;
OSQLParseNode *pOptEscape;
const OSQLParseNode* pPart2 = parseTree->getChild(1);
pColumn = parseTree->getChild(0); // Match Item
pAtom = parseTree->getChild(parseTree->count()-2); // Match String
pOptEscape = parseTree->getChild(parseTree->count()-1); // Opt Escape Rule
pAtom = pPart2->getChild(parseTree->count()-2); // Match String
pOptEscape = pPart2->getChild(parseTree->count()-1); // Opt Escape Rule
const bool bNot = SQL_ISTOKEN(pPart2->getChild(0), NOT);
if (!(pAtom->getNodeType() == SQL_NODE_STRING ||
pAtom->getNodeType() == SQL_NODE_NAME ||
@ -945,7 +947,7 @@ void OResultSet::analyseWhereClause( const OSQLParseNode* parseT
matchString.indexOf ( MATCHCHAR ) == -1 )
{
// Simple string , eg. "to match"
if ( parseTree->count() == 5 )
if ( bNot )
op = MQueryOp::DoesNotContain;
else
op = MQueryOp::Contains;
@ -961,12 +963,12 @@ void OResultSet::analyseWhereClause( const OSQLParseNode* parseT
matchString = matchString.replaceAt( 0, 1, rtl::OUString() );
matchString = matchString.replaceAt( matchString.getLength() -1 , 1, rtl::OUString() );
if ( parseTree->count() == 5 )
if (bNot)
op = MQueryOp::DoesNotContain;
else
op = MQueryOp::Contains;
}
else if ( parseTree->count() == 5 )
else if ( bNot )
{
// We currently can't handle a 'NOT LIKE' when there are '%' or
// '_' dispersed throughout
@ -1020,15 +1022,16 @@ void OResultSet::analyseWhereClause( const OSQLParseNode* parseT
}
else if (SQL_ISRULE(parseTree,test_for_null))
{
OSL_ENSURE(parseTree->count() >= 3,"Error in ParseTree");
OSL_ENSURE(SQL_ISTOKEN(parseTree->getChild(1),IS),"Error in ParseTree");
OSL_ENSURE(parseTree->count() == 2,"Error in ParseTree");
const OSQLParseNode* pPart2 = parseTree->getChild(1);
OSL_ENSURE(SQL_ISTOKEN(pPart2->getChild(0),IS),"Error in ParseTree");
if (!SQL_ISRULE(parseTree->getChild(0),column_ref))
{
m_pStatement->getOwnConnection()->throwSQLException( STR_QUERY_INVALID_IS_NULL_COLUMN, *this );
}
if (SQL_ISTOKEN(parseTree->getChild(2),NOT))
if (SQL_ISTOKEN(pPart2->getChild(1),NOT))
{
op = MQueryOp::Exists;
}

View File

@ -220,12 +220,16 @@ void SAL_CALL OMySQLTable::alterColumnByName( const ::rtl::OUString& colName, co
xProp->getPropertyValue(rProp.getNameByIndex(PROPERTY_ID_ISAUTOINCREMENT)) >>= bOldAutoIncrement;
descriptor->getPropertyValue(rProp.getNameByIndex(PROPERTY_ID_ISAUTOINCREMENT)) >>= bAutoIncrement;
bool bColumnNameChanged = false;
::rtl::OUString sOldDesc,sNewDesc;
xProp->getPropertyValue(rProp.getNameByIndex(PROPERTY_ID_DESCRIPTION)) >>= sOldDesc;
descriptor->getPropertyValue(rProp.getNameByIndex(PROPERTY_ID_DESCRIPTION)) >>= sNewDesc;
if ( nOldType != nNewType
|| nOldPrec != nNewPrec
|| nOldScale != nNewScale
|| nNewNullable != nOldNullable
|| bOldAutoIncrement != bAutoIncrement )
|| bOldAutoIncrement != bAutoIncrement
|| sOldDesc != sNewDesc )
{
// special handling because they change dthe type names to distinguish
// if a column should be an auto_incmrement one
@ -281,7 +285,7 @@ void SAL_CALL OMySQLTable::alterColumnByName( const ::rtl::OUString& colName, co
const ::rtl::OUString sQuote = getMetaData()->getIdentifierQuoteString( );
sSql += ::dbtools::quoteName(sQuote,colName);
sSql += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" "));
sSql += OTables::adjustSQL(::dbtools::createStandardColumnPart(descriptor,getConnection(),getTypeCreatePattern()));
sSql += OTables::adjustSQL(::dbtools::createStandardColumnPart(descriptor,getConnection(),static_cast<OTables*>(m_pTables),getTypeCreatePattern()));
executeStatement(sSql);
}
m_pColumns->refresh();
@ -310,7 +314,7 @@ void OMySQLTable::alterColumnType(sal_Int32 nNewType,const ::rtl::OUString& _rCo
::comphelper::copyProperties(_xDescriptor,xProp);
xProp->setPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_TYPE),makeAny(nNewType));
sSql += OTables::adjustSQL(::dbtools::createStandardColumnPart(xProp,getConnection(),getTypeCreatePattern()));
sSql += OTables::adjustSQL(::dbtools::createStandardColumnPart(xProp,getConnection(),static_cast<OTables*>(m_pTables),getTypeCreatePattern()));
executeStatement(sSql);
}
// -----------------------------------------------------------------------------

View File

@ -204,7 +204,7 @@ void OTables::createTable( const Reference< XPropertySet >& descriptor )
{
const Reference< XConnection > xConnection = static_cast<OMySQLCatalog&>(m_rParent).getConnection();
static const ::rtl::OUString s_sCreatePattern(RTL_CONSTASCII_USTRINGPARAM("(M,D)"));
const ::rtl::OUString aSql = adjustSQL(::dbtools::createSqlCreateTableStatement(descriptor,xConnection,s_sCreatePattern));
const ::rtl::OUString aSql = adjustSQL(::dbtools::createSqlCreateTableStatement(descriptor,xConnection,this,s_sCreatePattern));
Reference< XStatement > xStmt = xConnection->createStatement( );
if ( xStmt.is() )
{
@ -230,4 +230,14 @@ void OTables::appendNew(const ::rtl::OUString& _rsNewTable)
return ::dbtools::composeTableName( m_xMetaData, _xObject, ::dbtools::eInDataManipulation, false, false, false );
}
// -----------------------------------------------------------------------------
void OTables::addComment(const Reference< XPropertySet >& descriptor,::rtl::OUStringBuffer& _rOut)
{
::rtl::OUString sDesc;
descriptor->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_DESCRIPTION)) >>= sDesc;
if ( sDesc.getLength() )
{
_rOut.appendAscii(" COMMENT '");
_rOut.append(sDesc);
_rOut.appendAscii("'");
}
}

View File

@ -45,6 +45,11 @@
<value>com.mysql.jdbc.Driver</value>
</prop>
</node>
<node oor:name="AddIndexAppendix" oor:op="replace">
<prop oor:name="Value" oor:type="xs:boolean">
<value>true</value>
</prop>
</node>
</node>
<node oor:name="Features">
<node oor:name="UseKeywordAsBeforeAlias" oor:op="replace">
@ -94,6 +99,11 @@
<value>UserPassword</value>
</prop>
</node>
<node oor:name="SupportsColumnDescription" oor:op="replace">
<prop oor:name="Value" oor:type="xs:boolean">
<value>true</value>
</prop>
</node>
</node>
</node>
<node oor:name="sdbc:mysql:odbc:*" oor:op="replace">
@ -109,6 +119,11 @@
<value></value>
</prop>
</node>
<node oor:name="AddIndexAppendix" oor:op="replace">
<prop oor:name="Value" oor:type="xs:boolean">
<value>true</value>
</prop>
</node>
</node>
<node oor:name="Features">
<node oor:name="UseKeywordAsBeforeAlias" oor:op="replace">
@ -183,6 +198,11 @@
<value></value>
</prop>
</node>
<node oor:name="AddIndexAppendix" oor:op="replace">
<prop oor:name="Value" oor:type="xs:boolean">
<value>true</value>
</prop>
</node>
</node>
<node oor:name="Features">
<node oor:name="UseKeywordAsBeforeAlias" oor:op="replace">
@ -227,6 +247,11 @@
<value>UserPassword</value>
</prop>
</node>
<node oor:name="SupportsColumnDescription" oor:op="replace">
<prop oor:name="Value" oor:type="xs:boolean">
<value>true</value>
</prop>
</node>
</node>
</node>
</node>

View File

@ -97,7 +97,7 @@ ODatabaseMetaDataResultSet::~ODatabaseMetaDataResultSet()
osl_incrementInterlockedCount( &m_refCount );
dispose();
}
delete m_pRowStatusArray;
delete [] m_pRowStatusArray;
}
// -------------------------------------------------------------------------
void ODatabaseMetaDataResultSet::disposing(void)

View File

@ -162,7 +162,7 @@ OResultSet::OResultSet(SQLHANDLE _pStatementHandle ,OStatement_Base* pStmt) :
// -------------------------------------------------------------------------
OResultSet::~OResultSet()
{
delete m_pRowStatusArray;
delete [] m_pRowStatusArray;
delete m_pSkipDeletedSet;
}
// -----------------------------------------------------------------------------

View File

@ -391,6 +391,7 @@ void OTools::bindValue( OConnection* _pConnection,
case SQL_TIMESTAMP:
*pLen = sizeof(TIMESTAMP_STRUCT);
*((TIMESTAMP_STRUCT*)_pData) = *(TIMESTAMP_STRUCT*)_pValue;
break;
}
}
catch ( ... )

View File

@ -28,12 +28,14 @@
#define CONNECTIVITY_MYSQL_TABLES_HXX
#include "connectivity/sdbcx/VCollection.hxx"
#include "connectivity/SQLStatementHelper.hxx"
#include <com/sun/star/sdbc/XDatabaseMetaData.hpp>
namespace connectivity
{
namespace mysql
{
class OTables : public sdbcx::OCollection
class OTables : public sdbcx::OCollection,
public ::dbtools::ISQLStatementHelper
{
::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XDatabaseMetaData > m_xMetaData;
@ -76,6 +78,9 @@ namespace connectivity
@param _sSql in/out
*/
static ::rtl::OUString adjustSQL(const ::rtl::OUString& _sSql);
// ISQLStatementHelper
virtual void addComment(const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& descriptor,::rtl::OUStringBuffer& _rOut);
};
}
}

View File

@ -133,7 +133,7 @@ pProperties[nPos++] = ::com::sun::star::beans::Property(::connectivity::OMetaCon
#define PROPERTY_ID_INVALID_INDEX 41
#define PROPERTY_ID_HY010 43
// FREE
#define PROPERTY_ID_LABEL 44
#define PROPERTY_ID_DELIMITER 45
#define PROPERTY_ID_FORMATKEY 46
#define PROPERTY_ID_LOCALE 47

View File

@ -42,12 +42,14 @@ using namespace connectivity::parse;
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::sdbc;
using namespace ::com::sun::star::beans;
using namespace ::com::sun::star::container;
// -------------------------------------------------------------------------
OParseColumn::OParseColumn(const Reference<XPropertySet>& _xColumn,sal_Bool _bCase)
: connectivity::sdbcx::OColumn( getString(_xColumn->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_NAME)))
, getString(_xColumn->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_TYPENAME)))
, getString(_xColumn->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_DEFAULTVALUE)))
, getString(_xColumn->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_DESCRIPTION)))
, getINT32(_xColumn->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_ISNULLABLE)))
, getINT32(_xColumn->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_PRECISION)))
, getINT32(_xColumn->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_SCALE)))
@ -69,6 +71,7 @@ OParseColumn::OParseColumn(const Reference<XPropertySet>& _xColumn,sal_Bool
OParseColumn::OParseColumn( const ::rtl::OUString& _Name,
const ::rtl::OUString& _TypeName,
const ::rtl::OUString& _DefaultValue,
const ::rtl::OUString& _Description,
sal_Int32 _IsNullable,
sal_Int32 _Precision,
sal_Int32 _Scale,
@ -79,6 +82,7 @@ OParseColumn::OParseColumn( const ::rtl::OUString& _Name,
) : connectivity::sdbcx::OColumn(_Name,
_TypeName,
_DefaultValue,
_Description,
_IsNullable,
_Precision,
_Scale,
@ -97,25 +101,52 @@ OParseColumn::OParseColumn( const ::rtl::OUString& _Name,
// -------------------------------------------------------------------------
::vos::ORef< OSQLColumns > OParseColumn::createColumnsForResultSet( const Reference< XResultSetMetaData >& _rxResMetaData,
const Reference< XDatabaseMetaData >& _rxDBMetaData )
const Reference< XDatabaseMetaData >& _rxDBMetaData,const Reference< XNameAccess>& i_xQueryColumns )
{
sal_Int32 nColumnCount = _rxResMetaData->getColumnCount();
::vos::ORef< OSQLColumns > aReturn( new OSQLColumns ); aReturn->get().reserve( nColumnCount );
StringMap aColumnMap;
for ( sal_Int32 i = 1; i <= nColumnCount; ++i )
aReturn->get().push_back( createColumnForResultSet( _rxResMetaData, _rxDBMetaData, i ) );
{
OParseColumn* pColumn = createColumnForResultSet( _rxResMetaData, _rxDBMetaData, i,aColumnMap );
aReturn->get().push_back( pColumn );
if ( i_xQueryColumns.is() && i_xQueryColumns->hasByName(pColumn->getRealName()) )
{
Reference<XPropertySet> xColumn(i_xQueryColumns->getByName(pColumn->getRealName()),UNO_QUERY_THROW);
::rtl::OUString sLabel;
xColumn->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_LABEL)) >>= sLabel;
if ( sLabel.getLength() )
pColumn->setLabel(sLabel);
}
}
return aReturn;
}
// -------------------------------------------------------------------------
OParseColumn* OParseColumn::createColumnForResultSet( const Reference< XResultSetMetaData >& _rxResMetaData,
const Reference< XDatabaseMetaData >& _rxDBMetaData, sal_Int32 _nColumnPos )
const Reference< XDatabaseMetaData >& _rxDBMetaData, sal_Int32 _nColumnPos,StringMap& _rColumns )
{
::rtl::OUString sLabel = _rxResMetaData->getColumnLabel( _nColumnPos );
// retrieve the name of the column
// check for duplicate entries
if(_rColumns.find(sLabel) != _rColumns.end())
{
::rtl::OUString sAlias(sLabel);
sal_Int32 searchIndex=1;
while(_rColumns.find(sAlias) != _rColumns.end())
{
(sAlias = sLabel) += ::rtl::OUString::valueOf(searchIndex++);
}
sLabel = sAlias;
}
_rColumns.insert(StringMap::value_type(sLabel,0));
OParseColumn* pColumn = new OParseColumn(
_rxResMetaData->getColumnLabel( _nColumnPos ),
sLabel,
_rxResMetaData->getColumnTypeName( _nColumnPos ),
::rtl::OUString(),
::rtl::OUString(),
_rxResMetaData->isNullable( _nColumnPos ),
_rxResMetaData->getPrecision( _nColumnPos ),
_rxResMetaData->getScale( _nColumnPos ),
@ -133,6 +164,7 @@ OParseColumn* OParseColumn::createColumnForResultSet( const Reference< XResultSe
) );
pColumn->setIsSearchable( _rxResMetaData->isSearchable( _nColumnPos ) );
pColumn->setRealName(_rxResMetaData->getColumnName( _nColumnPos ));
pColumn->setLabel(sLabel);
return pColumn;
}
@ -149,7 +181,7 @@ void OParseColumn::construct()
registerProperty(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_REALNAME), PROPERTY_ID_REALNAME, 0, &m_aRealName, ::getCppuType(reinterpret_cast< ::rtl::OUString*>(NULL)));
registerProperty(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_DBASEPRECISIONCHANGED), PROPERTY_ID_DBASEPRECISIONCHANGED, 0, &m_bDbasePrecisionChanged, ::getCppuType(reinterpret_cast<sal_Bool*>(NULL)));
registerProperty(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_ISSEARCHABLE), PROPERTY_ID_ISSEARCHABLE, 0, &m_bIsSearchable, ::getCppuType(reinterpret_cast< sal_Bool*>(NULL)));
registerProperty(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_LABEL), PROPERTY_ID_LABEL, 0, &m_sLabel, ::getCppuType(reinterpret_cast< ::rtl::OUString*>(NULL)));
}
// -----------------------------------------------------------------------------
::cppu::IPropertyArrayHelper* OParseColumn::createArrayHelper() const
@ -169,6 +201,7 @@ OOrderColumn::OOrderColumn( const Reference<XPropertySet>& _xColumn
: connectivity::sdbcx::OColumn( getString(_xColumn->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_NAME)))
, getString(_xColumn->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_TYPENAME)))
, getString(_xColumn->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_DEFAULTVALUE)))
, getString(_xColumn->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_DESCRIPTION)))
, getINT32(_xColumn->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_ISNULLABLE)))
, getINT32(_xColumn->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_PRECISION)))
, getINT32(_xColumn->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_SCALE)))
@ -183,33 +216,6 @@ OOrderColumn::OOrderColumn( const Reference<XPropertySet>& _xColumn
construct();
}
// -------------------------------------------------------------------------
OOrderColumn::OOrderColumn( const ::rtl::OUString& _Name,
const ::rtl::OUString& _TypeName,
const ::rtl::OUString& _DefaultValue,
sal_Int32 _IsNullable,
sal_Int32 _Precision,
sal_Int32 _Scale,
sal_Int32 _Type,
sal_Bool _IsAutoIncrement,
sal_Bool _IsCurrency,
sal_Bool _bCase
,sal_Bool _bAscending
) : connectivity::sdbcx::OColumn(_Name,
_TypeName,
_DefaultValue,
_IsNullable,
_Precision,
_Scale,
_Type,
_IsAutoIncrement,
sal_False,
_IsCurrency,
_bCase)
, m_bAscending(_bAscending)
{
construct();
}
// -------------------------------------------------------------------------
OOrderColumn::~OOrderColumn()
{
}

File diff suppressed because it is too large Load Diff

View File

@ -86,15 +86,11 @@ OSQLScanner* xxx_pGLOBAL_SQLSCAN = NULL;
SQLyylval.pParseNode = new OSQLInternalNode(text, token);
#define SQL_NEW_KEYWORD(token) \
SQLyylval.pParseNode = new OSQLInternalNode(aEmptyString, SQL_NODE_KEYWORD, (token));
SQLyylval.pParseNode = new OSQLInternalNode(aEmptyString, SQL_NODE_KEYWORD, (token)); return token;
#define SQL_NEW_NAME SQL_NEW_NODE(::rtl::OUString(SQLyytext,strlen(SQLyytext),RTL_TEXTENCODING_UTF8), SQL_NODE_NAME)
#define SQL_NEW_INTNUM SQL_NEW_NODE(::rtl::OUString(SQLyytext,strlen(SQLyytext),RTL_TEXTENCODING_UTF8), SQL_NODE_INTNUM)
#define SQL_NEW_APPROXNUM SQL_NEW_NODE(::rtl::OUString(SQLyytext,strlen(SQLyytext),RTL_TEXTENCODING_UTF8), SQL_NODE_APPROXNUM)
#define SQL_NEW_STRING SQL_NEW_NODE(::rtl::OUString(SQLyytext,strlen(SQLyytext),RTL_TEXTENCODING_UTF8), SQL_NODE_STRING)
#define SQL_NEW_COMPARISON SQL_NEW_NODE(::rtl::OUString(SQLyytext,strlen(SQLyytext),RTL_TEXTENCODING_UTF8), SQL_NODE_COMPARISON)
#define SQL_NEW_AMMSC SQL_NEW_NODE(::rtl::OUString(SQLyytext,strlen(SQLyytext),RTL_TEXTENCODING_UTF8), SQL_NODE_AMMSC)
#define SQL_NEW_DATE SQL_NEW_NODE(::rtl::OUString(SQLyytext,strlen(SQLyytext),RTL_TEXTENCODING_UTF8), SQL_NODE_ACCESS_DATE)
#define SQL_NEW_INTNUM SQL_NEW_NODE(::rtl::OUString(SQLyytext,strlen(SQLyytext),RTL_TEXTENCODING_UTF8), SQL_NODE_INTNUM); return SQL_TOKEN_INTNUM;
#define SQL_NEW_APPROXNUM SQL_NEW_NODE(::rtl::OUString(SQLyytext,strlen(SQLyytext),RTL_TEXTENCODING_UTF8), SQL_NODE_APPROXNUM); return SQL_TOKEN_APPROXNUM;
#define SQL_NEW_DATE SQL_NEW_NODE(::rtl::OUString(SQLyytext,strlen(SQLyytext),RTL_TEXTENCODING_UTF8), SQL_NODE_ACCESS_DATE); return SQL_TOKEN_ACCESS_DATE;
#define YY_INPUT(buf,result,max_size) \
{ \
@ -122,231 +118,280 @@ OSQLScanner* xxx_pGLOBAL_SQLSCAN = NULL;
%option never-interactive
%%
[Aa][Bb][Ss] {SQL_NEW_KEYWORD(SQL_TOKEN_ABS); return SQL_TOKEN_ABS; }
[Aa][Cc][Oo][Ss] {SQL_NEW_KEYWORD(SQL_TOKEN_ACOS); return SQL_TOKEN_ACOS; }
[Aa][Ll][Ll] {SQL_NEW_KEYWORD(SQL_TOKEN_ALL); return SQL_TOKEN_ALL; }
[Aa][Ll][Tt][Ee][Rr] {SQL_NEW_KEYWORD(SQL_TOKEN_ALTER); return SQL_TOKEN_ALTER; }
[Aa][Nn][Dd] {SQL_NEW_KEYWORD(SQL_TOKEN_AND); return SQL_TOKEN_AND; }
[Aa][Nn][Yy] {SQL_NEW_KEYWORD(SQL_TOKEN_ANY); return SQL_TOKEN_ANY; }
[Aa][Ss] {SQL_NEW_KEYWORD(SQL_TOKEN_AS); return SQL_TOKEN_AS; }
[Aa][Ss][Cc] {SQL_NEW_KEYWORD(SQL_TOKEN_ASC); return SQL_TOKEN_ASC; }
[Aa][Ss][Cc][Ii][Ii] {SQL_NEW_KEYWORD(SQL_TOKEN_ASCII); return SQL_TOKEN_ASCII; }
[Aa][Ss][Ii][Nn] {SQL_NEW_KEYWORD(SQL_TOKEN_ASIN); return SQL_TOKEN_ASIN; }
[Aa][Tt] {SQL_NEW_KEYWORD(SQL_TOKEN_AT); return SQL_TOKEN_AT; }
[Aa][Tt][Aa][Nn] {SQL_NEW_KEYWORD(SQL_TOKEN_ATAN); return SQL_TOKEN_ATAN; }
[Aa][Tt][Aa][Nn]2 {SQL_NEW_KEYWORD(SQL_TOKEN_ATAN2); return SQL_TOKEN_ATAN2; }
[Aa][Uu][Tt][Hh][Oo][Rr][Ii][Zz][Aa][Tt][Ii][Oo][Nn] {SQL_NEW_KEYWORD(SQL_TOKEN_AUTHORIZATION); return SQL_TOKEN_AUTHORIZATION; }
[Aa][Vv][Gg] {SQL_NEW_KEYWORD(SQL_TOKEN_AVG); return SQL_TOKEN_AVG; }
ABS {SQL_NEW_KEYWORD(SQL_TOKEN_ABS); }
ACOS {SQL_NEW_KEYWORD(SQL_TOKEN_ACOS); }
AFTER {SQL_NEW_KEYWORD(SQL_TOKEN_AFTER); }
ALL {SQL_NEW_KEYWORD(SQL_TOKEN_ALL); }
ALTER {SQL_NEW_KEYWORD(SQL_TOKEN_ALTER); }
AND {SQL_NEW_KEYWORD(SQL_TOKEN_AND); }
ANY {SQL_NEW_KEYWORD(SQL_TOKEN_ANY); }
ARRAY_AGG {SQL_NEW_KEYWORD(SQL_TOKEN_ARRAY_AGG); }
AS {SQL_NEW_KEYWORD(SQL_TOKEN_AS); }
ASC {SQL_NEW_KEYWORD(SQL_TOKEN_ASC); }
ASCII {SQL_NEW_KEYWORD(SQL_TOKEN_ASCII); }
ASIN {SQL_NEW_KEYWORD(SQL_TOKEN_ASIN); }
AT {SQL_NEW_KEYWORD(SQL_TOKEN_AT); }
ATAN {SQL_NEW_KEYWORD(SQL_TOKEN_ATAN); }
ATAN2 {SQL_NEW_KEYWORD(SQL_TOKEN_ATAN2); }
ATOMIC {SQL_NEW_KEYWORD(SQL_TOKEN_ATOMIC); }
AUTHORIZATION {SQL_NEW_KEYWORD(SQL_TOKEN_AUTHORIZATION); }
AVG {SQL_NEW_KEYWORD(SQL_TOKEN_AVG); }
[Bb][Ee][Tt][Ww][Ee][Ee][Nn] {SQL_NEW_KEYWORD(SQL_TOKEN_BETWEEN); return SQL_TOKEN_BETWEEN; }
[Bb][Ii][Tt] {SQL_NEW_KEYWORD(SQL_TOKEN_BIT); return SQL_TOKEN_BIT; }
[Bb][Ii][Tt]_[Ll][Ee][Nn][Gg][Tt][Hh] {SQL_NEW_KEYWORD(SQL_TOKEN_BIT_LENGTH); return SQL_TOKEN_BIT_LENGTH; }
[Bb][Oo][Tt][Hh] {SQL_NEW_KEYWORD(SQL_TOKEN_BOTH); return SQL_TOKEN_BOTH; }
[Bb][Yy] {SQL_NEW_KEYWORD(SQL_TOKEN_BY); return SQL_TOKEN_BY; }
BEFORE {SQL_NEW_KEYWORD(SQL_TOKEN_BEFORE); }
BEGIN {SQL_NEW_KEYWORD(SQL_TOKEN_BEGIN); }
BETWEEN {SQL_NEW_KEYWORD(SQL_TOKEN_BETWEEN); }
BIGINT {SQL_NEW_KEYWORD(SQL_TOKEN_BIGINT); }
BINARY {SQL_NEW_KEYWORD(SQL_TOKEN_BINARY); }
BIT {SQL_NEW_KEYWORD(SQL_TOKEN_BIT); }
BIT_LENGTH {SQL_NEW_KEYWORD(SQL_TOKEN_BIT_LENGTH); }
BLOB {SQL_NEW_KEYWORD(SQL_TOKEN_BLOB); }
BOTH {SQL_NEW_KEYWORD(SQL_TOKEN_BOTH); }
BY {SQL_NEW_KEYWORD(SQL_TOKEN_BY); }
[Cc][Aa][Ll][Ll] {SQL_NEW_KEYWORD(SQL_TOKEN_CALL); return SQL_TOKEN_CALL; }
[Cc][Aa][Ss][Tt] {SQL_NEW_KEYWORD(SQL_TOKEN_CAST); return SQL_TOKEN_CAST; }
[Cc][Hh][Aa][Rr] {SQL_NEW_KEYWORD(SQL_TOKEN_CHAR); return SQL_TOKEN_CHAR; }
[Cc][Hh][Aa][Rr][Aa][Cc][Tt][Ee][Rr] {SQL_NEW_KEYWORD(SQL_TOKEN_CHARACTER); return SQL_TOKEN_CHARACTER; }
[Cc][Hh][Aa][Rr]([Aa][Cc][Tt][Ee][Rr])?_[Ll][Ee][Nn][Gg][Tt][Hh] {SQL_NEW_KEYWORD(SQL_TOKEN_CHAR_LENGTH); return SQL_TOKEN_CHAR_LENGTH; }
[Cc][Hh][Ee][Cc][Kk] {SQL_NEW_KEYWORD(SQL_TOKEN_CHECK); return SQL_TOKEN_CHECK; }
[Cc][Ee][Ii][Ll][Ii][Nn][Gg] {SQL_NEW_KEYWORD(SQL_TOKEN_CEILING); return SQL_TOKEN_CEILING; }
[Cc][Oo][Ll][Ll][Aa][Tt][Ee] {SQL_NEW_KEYWORD(SQL_TOKEN_COLLATE); return SQL_TOKEN_COLLATE; }
COLLECT {SQL_NEW_KEYWORD(SQL_TOKEN_COLLECT); return SQL_TOKEN_COLLECT; }
[Cc][Oo][Mm][Mm][Ii][Tt] {SQL_NEW_KEYWORD(SQL_TOKEN_COMMIT); return SQL_TOKEN_COMMIT; }
[Cc][Oo][Nn][Cc][Aa][Tt] {SQL_NEW_KEYWORD(SQL_TOKEN_CONCAT); return SQL_TOKEN_CONCAT; }
[Cc][Oo][Nn][Tt][Ii][Nn][Uu][Ee] {SQL_NEW_KEYWORD(SQL_TOKEN_CONTINUE); return SQL_TOKEN_CONTINUE; }
[Cc][Oo][Nn][Vv][Ee][Rr][Tt] {SQL_NEW_KEYWORD(SQL_TOKEN_CONVERT); return SQL_TOKEN_CONVERT; }
[Cc][Oo][Ss] {SQL_NEW_KEYWORD(SQL_TOKEN_COS); return SQL_TOKEN_COS; }
[Cc][Oo][Tt] {SQL_NEW_KEYWORD(SQL_TOKEN_COT); return SQL_TOKEN_COT; }
[Cc][Oo][Uu][Nn][Tt] {SQL_NEW_KEYWORD(SQL_TOKEN_COUNT); return SQL_TOKEN_COUNT; }
[Cc][Rr][Ee][Aa][Tt][Ee] {SQL_NEW_KEYWORD(SQL_TOKEN_CREATE); return SQL_TOKEN_CREATE; }
[Cc][Rr][Oo][Ss][Ss] {SQL_NEW_KEYWORD(SQL_TOKEN_CROSS); return SQL_TOKEN_CROSS; }
[Cc][Uu][Rr][Rr][Ee][Nn][Tt] {SQL_NEW_KEYWORD(SQL_TOKEN_CURRENT); return SQL_TOKEN_CURRENT; }
[Cc][Uu][Rr][Rr][Ee][Nn][Tt]_[Dd][Aa][Tt][Ee] {SQL_NEW_KEYWORD(SQL_TOKEN_CURRENT_DATE); return SQL_TOKEN_CURRENT_DATE; }
[Cc][Uu][Rr][Dd][Aa][Tt][Ee] {SQL_NEW_KEYWORD(SQL_TOKEN_CURDATE); return SQL_TOKEN_CURDATE; }
[Cc][Uu][Rr][Rr][Ee][Nn][Tt]_[Tt][Ii][Mm][Ee] {SQL_NEW_KEYWORD(SQL_TOKEN_CURRENT_TIME); return SQL_TOKEN_CURRENT_TIME; }
[Cc][Uu][Rr][Tt][Ii][Mm][Ee] {SQL_NEW_KEYWORD(SQL_TOKEN_CURTIME); return SQL_TOKEN_CURTIME; }
[Cc][Uu][Rr][Rr][Ee][Nn][Tt]_[Tt][Ii][Mm][Ee][Ss][Tt][Aa][Mm][Pp] {SQL_NEW_KEYWORD(SQL_TOKEN_CURRENT_TIMESTAMP); return SQL_TOKEN_CURRENT_TIMESTAMP; }
[Cc][Uu][Rr][Ss][Oo][Rr] {SQL_NEW_KEYWORD(SQL_TOKEN_CURSOR); return SQL_TOKEN_CURSOR; }
CALL {SQL_NEW_KEYWORD(SQL_TOKEN_CALL); }
CASE {SQL_NEW_KEYWORD(SQL_TOKEN_CASE); }
CAST {SQL_NEW_KEYWORD(SQL_TOKEN_CAST); }
CEILING {SQL_NEW_KEYWORD(SQL_TOKEN_CEILING); }
CHAR {SQL_NEW_KEYWORD(SQL_TOKEN_CHAR); }
CHARACTER {SQL_NEW_KEYWORD(SQL_TOKEN_CHARACTER); }
CHAR(ACTER)?_LENGTH {SQL_NEW_KEYWORD(SQL_TOKEN_CHAR_LENGTH); }
CHECK {SQL_NEW_KEYWORD(SQL_TOKEN_CHECK); }
CLOB {SQL_NEW_KEYWORD(SQL_TOKEN_CLOB); }
COALESCE {SQL_NEW_KEYWORD(SQL_TOKEN_COALESCE); }
COLLATE {SQL_NEW_KEYWORD(SQL_TOKEN_COLLATE); }
COLLECT {SQL_NEW_KEYWORD(SQL_TOKEN_COLLECT); }
COMMIT {SQL_NEW_KEYWORD(SQL_TOKEN_COMMIT); }
CONCAT {SQL_NEW_KEYWORD(SQL_TOKEN_CONCAT); }
CONTINUE {SQL_NEW_KEYWORD(SQL_TOKEN_CONTINUE); }
CONVERT {SQL_NEW_KEYWORD(SQL_TOKEN_CONVERT); }
COS {SQL_NEW_KEYWORD(SQL_TOKEN_COS); }
COT {SQL_NEW_KEYWORD(SQL_TOKEN_COT); }
COUNT {SQL_NEW_KEYWORD(SQL_TOKEN_COUNT); }
CREATE {SQL_NEW_KEYWORD(SQL_TOKEN_CREATE); }
CROSS {SQL_NEW_KEYWORD(SQL_TOKEN_CROSS); }
CUME_RANK {SQL_NEW_KEYWORD(SQL_TOKEN_CUME_DIST); }
CURRENT {SQL_NEW_KEYWORD(SQL_TOKEN_CURRENT); }
CURRENT_DATE {SQL_NEW_KEYWORD(SQL_TOKEN_CURRENT_DATE); }
CURRENT_CATALOG {SQL_NEW_KEYWORD(SQL_TOKEN_CURRENT_CATALOG); }
CURRENT_DEFAULT_TRANSFORM_GROUP {SQL_NEW_KEYWORD(SQL_TOKEN_CURRENT_DEFAULT_TRANSFORM_GROUP); }
CURRENT_PATH {SQL_NEW_KEYWORD(SQL_TOKEN_CURRENT_PATH); }
CURRENT_ROLE {SQL_NEW_KEYWORD(SQL_TOKEN_CURRENT_ROLE); }
CURRENT_SCHEMA {SQL_NEW_KEYWORD(SQL_TOKEN_CURRENT_SCHEMA); }
CURRENT_USER {SQL_NEW_KEYWORD(SQL_TOKEN_CURRENT_USER); }
CURDATE {SQL_NEW_KEYWORD(SQL_TOKEN_CURDATE); }
CURRENT_TIME {SQL_NEW_KEYWORD(SQL_TOKEN_CURRENT_TIME); }
CURTIME {SQL_NEW_KEYWORD(SQL_TOKEN_CURTIME); }
CURRENT_TIMESTAMP {SQL_NEW_KEYWORD(SQL_TOKEN_CURRENT_TIMESTAMP); }
CURSOR {SQL_NEW_KEYWORD(SQL_TOKEN_CURSOR); }
[Dd] {SQL_NEW_KEYWORD(SQL_TOKEN_D); return SQL_TOKEN_D; }
[Dd][Aa][Tt][Ee] {SQL_NEW_KEYWORD(SQL_TOKEN_DATE); return SQL_TOKEN_DATE; }
[Dd][Aa][Tt][Ee][Dd][Ii][Ff][Ff] {SQL_NEW_KEYWORD(SQL_TOKEN_DATEDIFF); return SQL_TOKEN_DATEDIFF; }
[Dd][Aa][Tt][Ee][Vv][Aa][Ll][Uu][Ee] {SQL_NEW_KEYWORD(SQL_TOKEN_DATEVALUE); return SQL_TOKEN_DATEVALUE; }
[Dd][Aa][Yy] {SQL_NEW_KEYWORD(SQL_TOKEN_DAY); return SQL_TOKEN_DAY; }
[Dd][Aa][Yy][Nn][Aa][Mm][Ee] {SQL_NEW_KEYWORD(SQL_TOKEN_DAYNAME); return SQL_TOKEN_DAYNAME; }
[Dd][Aa][Yy][Oo][Ff][Mm][Oo][Nn][Tt][Hh] {SQL_NEW_KEYWORD(SQL_TOKEN_DAYOFMONTH); return SQL_TOKEN_DAYOFMONTH; }
[Dd][Aa][Yy][Oo][Ff][Ww][Ee][Ee][Kk] {SQL_NEW_KEYWORD(SQL_TOKEN_DAYOFWEEK); return SQL_TOKEN_DAYOFWEEK; }
[Dd][Aa][Yy][Oo][Ff][Yy][Ee][Aa][Rr] {SQL_NEW_KEYWORD(SQL_TOKEN_DAYOFYEAR); return SQL_TOKEN_DAYOFYEAR; }
[Dd][Ee][Cc] {SQL_NEW_KEYWORD(SQL_TOKEN_DEC); return SQL_TOKEN_DEC; }
[Dd][Ee][Cc][Ii][Mm][Aa][Ll] {SQL_NEW_KEYWORD(SQL_TOKEN_DECIMAL); return SQL_TOKEN_DECIMAL; }
[Dd][Ee][Cc][Ll][Aa][Rr][Ee] {SQL_NEW_KEYWORD(SQL_TOKEN_DECLARE); return SQL_TOKEN_DECLARE; }
[Dd][Ee][Ff][Aa][Uu][Ll][Tt] {SQL_NEW_KEYWORD(SQL_TOKEN_DEFAULT); return SQL_TOKEN_DEFAULT; }
[Dd][Ee][Gg][Rr][Ee][Ee][Ss] {SQL_NEW_KEYWORD(SQL_TOKEN_DEGREES); return SQL_TOKEN_DEGREES; }
[Dd][Ee][Ll][Ee][Tt][Ee] {SQL_NEW_KEYWORD(SQL_TOKEN_DELETE); return SQL_TOKEN_DELETE; }
[Dd][Ee][Ss][Cc] {SQL_NEW_KEYWORD(SQL_TOKEN_DESC); return SQL_TOKEN_DESC; }
[Dd][Ii][Ff][Ff][Ee][Rr][Ee][Nn][Cc][Ee] {SQL_NEW_KEYWORD(SQL_TOKEN_DIFFERENCE); return SQL_TOKEN_DIFFERENCE; }
[Dd][Ii][Ss][Tt][Ii][Nn][Cc][Tt] {SQL_NEW_KEYWORD(SQL_TOKEN_DISTINCT); return SQL_TOKEN_DISTINCT; }
[Dd][Oo][Uu][Bb][Ll][Ee] {SQL_NEW_KEYWORD(SQL_TOKEN_DOUBLE); return SQL_TOKEN_DOUBLE; }
[Dd][Rr][Oo][Pp] {SQL_NEW_KEYWORD(SQL_TOKEN_DROP); return SQL_TOKEN_DROP; }
D {SQL_NEW_KEYWORD(SQL_TOKEN_D); }
DATE {SQL_NEW_KEYWORD(SQL_TOKEN_DATE); }
DATEDIFF {SQL_NEW_KEYWORD(SQL_TOKEN_DATEDIFF); }
DATEVALUE {SQL_NEW_KEYWORD(SQL_TOKEN_DATEVALUE); }
DAY {SQL_NEW_KEYWORD(SQL_TOKEN_DAY); }
DAYNAME {SQL_NEW_KEYWORD(SQL_TOKEN_DAYNAME); }
DAYOFMONTH {SQL_NEW_KEYWORD(SQL_TOKEN_DAYOFMONTH); }
DAYOFWEEK {SQL_NEW_KEYWORD(SQL_TOKEN_DAYOFWEEK); }
DAYOFYEAR {SQL_NEW_KEYWORD(SQL_TOKEN_DAYOFYEAR); }
DEC {SQL_NEW_KEYWORD(SQL_TOKEN_DEC); }
DECIMAL {SQL_NEW_KEYWORD(SQL_TOKEN_DECIMAL); }
DECLARE {SQL_NEW_KEYWORD(SQL_TOKEN_DECLARE); }
DEFAULT {SQL_NEW_KEYWORD(SQL_TOKEN_DEFAULT); }
DEGREES {SQL_NEW_KEYWORD(SQL_TOKEN_DEGREES); }
DELETE {SQL_NEW_KEYWORD(SQL_TOKEN_DELETE); }
DENSE_RANK {SQL_NEW_KEYWORD(SQL_TOKEN_DENSE_RANK); }
DESC {SQL_NEW_KEYWORD(SQL_TOKEN_DESC); }
DIFFERENCE {SQL_NEW_KEYWORD(SQL_TOKEN_DIFFERENCE); }
DISTINCT {SQL_NEW_KEYWORD(SQL_TOKEN_DISTINCT); }
DOUBLE {SQL_NEW_KEYWORD(SQL_TOKEN_DOUBLE); }
DROP {SQL_NEW_KEYWORD(SQL_TOKEN_DROP); }
EVERY {SQL_NEW_KEYWORD(SQL_TOKEN_EVERY); return SQL_TOKEN_EVERY; }
[Ee][Ss][Cc][Aa][Pp][Ee] {SQL_NEW_KEYWORD(SQL_TOKEN_ESCAPE); return SQL_TOKEN_ESCAPE; }
[Ee][Xx][Cc][Ee][Pp][Tt] {SQL_NEW_KEYWORD(SQL_TOKEN_EXCEPT); return SQL_TOKEN_EXCEPT; }
[Ee][Xx][Ii][Ss][Tt][Ss] {SQL_NEW_KEYWORD(SQL_TOKEN_EXISTS); return SQL_TOKEN_EXISTS; }
[Ee][Xx][Pp] {SQL_NEW_KEYWORD(SQL_TOKEN_EXP); return SQL_TOKEN_EXP; }
[Ee][Xx][Tt][Rr][Aa][Cc][Tt] {SQL_NEW_KEYWORD(SQL_TOKEN_EXTRACT); return SQL_TOKEN_EXTRACT; }
EACH {SQL_NEW_KEYWORD(SQL_TOKEN_EACH); }
ELSE {SQL_NEW_KEYWORD(SQL_TOKEN_ELSE); }
END {SQL_NEW_KEYWORD(SQL_TOKEN_END); }
EVERY {SQL_NEW_KEYWORD(SQL_TOKEN_EVERY); }
ESCAPE {SQL_NEW_KEYWORD(SQL_TOKEN_ESCAPE); }
EXCEPT {SQL_NEW_KEYWORD(SQL_TOKEN_EXCEPT); }
EXISTS {SQL_NEW_KEYWORD(SQL_TOKEN_EXISTS); }
EXP {SQL_NEW_KEYWORD(SQL_TOKEN_EXP); }
EXTRACT {SQL_NEW_KEYWORD(SQL_TOKEN_EXTRACT); }
[Ff][Aa][Ll][Ss][Ee] {SQL_NEW_KEYWORD(SQL_TOKEN_FALSE); return SQL_TOKEN_FALSE; }
[Ff][Ee][Tt][Cc][Hh] {SQL_NEW_KEYWORD(SQL_TOKEN_FETCH); return SQL_TOKEN_FETCH; }
[Ff][Ll][Oo][Aa][Tt] {SQL_NEW_KEYWORD(SQL_TOKEN_FLOAT); return SQL_TOKEN_FLOAT; }
[Ff][Ll][Oo][Oo][Rr] {SQL_NEW_KEYWORD(SQL_TOKEN_FLOOR); return SQL_TOKEN_FLOOR; }
[Ff][Nn] {SQL_NEW_KEYWORD(SQL_TOKEN_FN); return SQL_TOKEN_FN; }
[Ff][Oo][Rr] {SQL_NEW_KEYWORD(SQL_TOKEN_FOR); return SQL_TOKEN_FOR; }
[Ff][Oo][Rr][Ee][Ii][Gg][Nn] {SQL_NEW_KEYWORD(SQL_TOKEN_FOREIGN); return SQL_TOKEN_FOREIGN; }
[Ff][Oo][Uu][Nn][Dd] {SQL_NEW_KEYWORD(SQL_TOKEN_FOUND); return SQL_TOKEN_FOUND; }
[Ff][Rr][Oo][Mm] {SQL_NEW_KEYWORD(SQL_TOKEN_FROM); return SQL_TOKEN_FROM; }
[Ff][Uu][Ll][Ll] {SQL_NEW_KEYWORD(SQL_TOKEN_FULL); return SQL_TOKEN_FULL; }
FUSION {SQL_NEW_KEYWORD(SQL_TOKEN_FUSION); return SQL_TOKEN_FUSION; }
FALSE {SQL_NEW_KEYWORD(SQL_TOKEN_FALSE); }
FETCH {SQL_NEW_KEYWORD(SQL_TOKEN_FETCH); }
FLOAT {SQL_NEW_KEYWORD(SQL_TOKEN_FLOAT); }
FLOOR {SQL_NEW_KEYWORD(SQL_TOKEN_FLOOR); }
FN {SQL_NEW_KEYWORD(SQL_TOKEN_FN); }
FOR {SQL_NEW_KEYWORD(SQL_TOKEN_FOR); }
FOREIGN {SQL_NEW_KEYWORD(SQL_TOKEN_FOREIGN); }
FOUND {SQL_NEW_KEYWORD(SQL_TOKEN_FOUND); }
FROM {SQL_NEW_KEYWORD(SQL_TOKEN_FROM); }
FULL {SQL_NEW_KEYWORD(SQL_TOKEN_FULL); }
FUSION {SQL_NEW_KEYWORD(SQL_TOKEN_FUSION); }
[Gg][Rr][Aa][Nn][Tt] {SQL_NEW_KEYWORD(SQL_TOKEN_GRANT); return SQL_TOKEN_GRANT; }
[Gg][Rr][Oo][Uu][Pp] {SQL_NEW_KEYWORD(SQL_TOKEN_GROUP); return SQL_TOKEN_GROUP; }
GRANT {SQL_NEW_KEYWORD(SQL_TOKEN_GRANT); }
GROUP {SQL_NEW_KEYWORD(SQL_TOKEN_GROUP); }
[Hh][Aa][Vv][Ii][Nn][Gg] {SQL_NEW_KEYWORD(SQL_TOKEN_HAVING); return SQL_TOKEN_HAVING; }
[Hh][Oo][Uu][Rr] {SQL_NEW_KEYWORD(SQL_TOKEN_HOUR); return SQL_TOKEN_HOUR; }
HAVING {SQL_NEW_KEYWORD(SQL_TOKEN_HAVING); }
HOUR {SQL_NEW_KEYWORD(SQL_TOKEN_HOUR); }
[Ii][Nn] {SQL_NEW_KEYWORD(SQL_TOKEN_IN); return SQL_TOKEN_IN; }
[Ii][Nn][Nn][Ee][Rr] {SQL_NEW_KEYWORD(SQL_TOKEN_INNER); return SQL_TOKEN_INNER; }
[Ii][Nn][Ss][Ee][Rr][Tt] {SQL_NEW_KEYWORD(SQL_TOKEN_INSERT); return SQL_TOKEN_INSERT; }
[Ii][Nn][Tt]([Ee][Gg][Ee][Rr])? {SQL_NEW_KEYWORD(SQL_TOKEN_INTEGER); return SQL_TOKEN_INTEGER; }
[Ii][Nn][Tt][Ee][Rr][Ss][Ee][Cc][Tt] {SQL_NEW_KEYWORD(SQL_TOKEN_INTERSECT); return SQL_TOKEN_INTERSECT; }
INTERSECTION {SQL_NEW_KEYWORD(SQL_TOKEN_INTERSECTION); return SQL_TOKEN_INTERSECTION; }
[Ii][Nn][Tt][Oo] {SQL_NEW_KEYWORD(SQL_TOKEN_INTO); return SQL_TOKEN_INTO; }
[Ii][Ss] {SQL_NEW_KEYWORD(SQL_TOKEN_IS); return SQL_TOKEN_IS; }
IN {SQL_NEW_KEYWORD(SQL_TOKEN_IN); }
INNER {SQL_NEW_KEYWORD(SQL_TOKEN_INNER); }
INSERT {SQL_NEW_KEYWORD(SQL_TOKEN_INSERT); }
INSTEAD {SQL_NEW_KEYWORD(SQL_TOKEN_INSTEAD); }
INT(EGER)? {SQL_NEW_KEYWORD(SQL_TOKEN_INTEGER); }
INTERSECT {SQL_NEW_KEYWORD(SQL_TOKEN_INTERSECT); }
INTERVAL {SQL_NEW_KEYWORD(SQL_TOKEN_INTERVAL); }
INTERSECTION {SQL_NEW_KEYWORD(SQL_TOKEN_INTERSECTION); }
INTO {SQL_NEW_KEYWORD(SQL_TOKEN_INTO); }
IS {SQL_NEW_KEYWORD(SQL_TOKEN_IS); }
[Jj][Oo][Ii][Nn] {SQL_NEW_KEYWORD(SQL_TOKEN_JOIN); return SQL_TOKEN_JOIN; }
JOIN {SQL_NEW_KEYWORD(SQL_TOKEN_JOIN); }
[Kk][Ee][Yy] {SQL_NEW_KEYWORD(SQL_TOKEN_KEY); return SQL_TOKEN_KEY; }
KEY {SQL_NEW_KEYWORD(SQL_TOKEN_KEY); }
[Ll][Cc][Aa][Ss][Ee] {SQL_NEW_KEYWORD(SQL_TOKEN_LCASE); return SQL_TOKEN_LCASE; }
[Ll][Ee][Aa][Dd][Ii][Nn][Gg] {SQL_NEW_KEYWORD(SQL_TOKEN_LEADING); return SQL_TOKEN_LEADING; }
[Ll][Ee][Ff][Tt] {SQL_NEW_KEYWORD(SQL_TOKEN_LEFT); return SQL_TOKEN_LEFT; }
[Ll][Ee][Nn][Gg][Tt][Hh] {SQL_NEW_KEYWORD(SQL_TOKEN_LENGTH); return SQL_TOKEN_LENGTH; }
[Ll][Ii][Kk][Ee] {SQL_NEW_KEYWORD(SQL_TOKEN_LIKE); return SQL_TOKEN_LIKE; }
[Ll][Nn] {SQL_NEW_KEYWORD(SQL_TOKEN_LN); return SQL_TOKEN_LN; }
[Ll][Oo][Cc][Aa][Ll] {SQL_NEW_KEYWORD(SQL_TOKEN_LOCAL); return SQL_TOKEN_LOCAL; }
[Ll][Oo][Cc][Aa][Tt][Ee] {SQL_NEW_KEYWORD(SQL_TOKEN_LOCATE); return SQL_TOKEN_LOCATE; }
[Ll][Oo][Gg] {SQL_NEW_KEYWORD(SQL_TOKEN_LOG); return SQL_TOKEN_LOG; }
[Ll][Oo][Gg][Ff] {SQL_NEW_KEYWORD(SQL_TOKEN_LOGF); return SQL_TOKEN_LOGF; }
[Ll][Oo][Gg]10 {SQL_NEW_KEYWORD(SQL_TOKEN_LOG10); return SQL_TOKEN_LOG10; }
[Ll][Oo][Ww][Ee][Rr] {SQL_NEW_KEYWORD(SQL_TOKEN_LOWER); return SQL_TOKEN_LOWER; }
[Ll][Tt][Rr][Ii][Mm] {SQL_NEW_KEYWORD(SQL_TOKEN_LTRIM); return SQL_TOKEN_LTRIM; }
LARGE {SQL_NEW_KEYWORD(SQL_TOKEN_LARGE); }
LCASE {SQL_NEW_KEYWORD(SQL_TOKEN_LCASE); }
LEADING {SQL_NEW_KEYWORD(SQL_TOKEN_LEADING); }
LEFT {SQL_NEW_KEYWORD(SQL_TOKEN_LEFT); }
LENGTH {SQL_NEW_KEYWORD(SQL_TOKEN_LENGTH); }
LIKE {SQL_NEW_KEYWORD(SQL_TOKEN_LIKE); }
LN {SQL_NEW_KEYWORD(SQL_TOKEN_LN); }
LOCAL {SQL_NEW_KEYWORD(SQL_TOKEN_LOCAL); }
LOCATE {SQL_NEW_KEYWORD(SQL_TOKEN_LOCATE); }
LOG {SQL_NEW_KEYWORD(SQL_TOKEN_LOG); }
LOGF {SQL_NEW_KEYWORD(SQL_TOKEN_LOGF); }
LOG10 {SQL_NEW_KEYWORD(SQL_TOKEN_LOG10); }
LOWER {SQL_NEW_KEYWORD(SQL_TOKEN_LOWER); }
LTRIM {SQL_NEW_KEYWORD(SQL_TOKEN_LTRIM); }
[Mm][Aa][Xx] {SQL_NEW_KEYWORD(SQL_TOKEN_MAX); return SQL_TOKEN_MAX; }
[Mm][Ii][Nn] {SQL_NEW_KEYWORD(SQL_TOKEN_MIN); return SQL_TOKEN_MIN; }
[Mm][Ii][Nn][Uu][Tt][Ee] {SQL_NEW_KEYWORD(SQL_TOKEN_MINUTE); return SQL_TOKEN_MINUTE; }
[Mm][Oo][Dd] {SQL_NEW_KEYWORD(SQL_TOKEN_MOD); return SQL_TOKEN_MOD; }
[Mm][Oo][Nn][Tt][Hh] {SQL_NEW_KEYWORD(SQL_TOKEN_MONTH); return SQL_TOKEN_MONTH; }
[Mm][Oo][Nn][Tt][Hh][Nn][Aa][Mm][Ee] {SQL_NEW_KEYWORD(SQL_TOKEN_MONTHNAME); return SQL_TOKEN_MONTHNAME; }
MAX {SQL_NEW_KEYWORD(SQL_TOKEN_MAX); }
MIN {SQL_NEW_KEYWORD(SQL_TOKEN_MIN); }
MINUTE {SQL_NEW_KEYWORD(SQL_TOKEN_MINUTE); }
MOD {SQL_NEW_KEYWORD(SQL_TOKEN_MOD); }
MONTH {SQL_NEW_KEYWORD(SQL_TOKEN_MONTH); }
MONTHNAME {SQL_NEW_KEYWORD(SQL_TOKEN_MONTHNAME); }
[Nn][Aa][Tt][Uu][Rr][Aa][LL] {SQL_NEW_KEYWORD(SQL_TOKEN_NATURAL); return SQL_TOKEN_NATURAL; }
[Nn][Cc][Hh][Aa][Rr] {SQL_NEW_KEYWORD(SQL_TOKEN_NCHAR); return SQL_TOKEN_NCHAR; }
[Nn][Oo][Tt] {SQL_NEW_KEYWORD(SQL_TOKEN_NOT); return SQL_TOKEN_NOT; }
[Nn][Oo][Ww] {SQL_NEW_KEYWORD(SQL_TOKEN_NOW); return SQL_TOKEN_NOW; }
[Nn][Uu][Ll][Ll] {SQL_NEW_KEYWORD(SQL_TOKEN_NULL); return SQL_TOKEN_NULL; }
[Nn][Uu][Mm][Ee][Rr][Ii][Cc] {SQL_NEW_KEYWORD(SQL_TOKEN_NUMERIC); return SQL_TOKEN_NUMERIC; }
NATIONAL {SQL_NEW_KEYWORD(SQL_TOKEN_NATIONAL); }
NATURAL {SQL_NEW_KEYWORD(SQL_TOKEN_NATURAL); }
NCHAR {SQL_NEW_KEYWORD(SQL_TOKEN_NCHAR); }
NCLOB {SQL_NEW_KEYWORD(SQL_TOKEN_NCLOB); }
NEW {SQL_NEW_KEYWORD(SQL_TOKEN_NEW); }
NOT {SQL_NEW_KEYWORD(SQL_TOKEN_NOT); }
NOW {SQL_NEW_KEYWORD(SQL_TOKEN_NOW); }
NULL {SQL_NEW_KEYWORD(SQL_TOKEN_NULL); }
NULLIF {SQL_NEW_KEYWORD(SQL_TOKEN_NULLIF); }
NUMERIC {SQL_NEW_KEYWORD(SQL_TOKEN_NUMERIC); }
[Oo][Cc][Tt][Ee][Tt]_[Ll][Ee][Nn][Gg][Tt][Hh] {SQL_NEW_KEYWORD(SQL_TOKEN_OCTET_LENGTH); return SQL_TOKEN_OCTET_LENGTH; }
[Oo][Ff] {SQL_NEW_KEYWORD(SQL_TOKEN_OF); return SQL_TOKEN_OF; }
[Oo][Jj] {SQL_NEW_KEYWORD(SQL_TOKEN_OJ); return SQL_TOKEN_OJ; }
[Oo][Nn] {SQL_NEW_KEYWORD(SQL_TOKEN_ON); return SQL_TOKEN_ON; }
[Oo][Pp][Tt][Ii][Oo][Nn] {SQL_NEW_KEYWORD(SQL_TOKEN_OPTION); return SQL_TOKEN_OPTION; }
[Oo][Rr] {SQL_NEW_KEYWORD(SQL_TOKEN_OR); return SQL_TOKEN_OR; }
[Oo][Rr][Dd][Ee][Rr] {SQL_NEW_KEYWORD(SQL_TOKEN_ORDER); return SQL_TOKEN_ORDER; }
[Oo][Uu][Tt][Ee][Rr] {SQL_NEW_KEYWORD(SQL_TOKEN_OUTER); return SQL_TOKEN_OUTER; }
OBJECT {SQL_NEW_KEYWORD(SQL_TOKEN_OBJECT); }
OCTET_LENGTH {SQL_NEW_KEYWORD(SQL_TOKEN_OCTET_LENGTH); }
OF {SQL_NEW_KEYWORD(SQL_TOKEN_OF); }
OJ {SQL_NEW_KEYWORD(SQL_TOKEN_OJ); }
OLD {SQL_NEW_KEYWORD(SQL_TOKEN_OLD); }
ON {SQL_NEW_KEYWORD(SQL_TOKEN_ON); }
OPTION {SQL_NEW_KEYWORD(SQL_TOKEN_OPTION); }
OR {SQL_NEW_KEYWORD(SQL_TOKEN_OR); }
ORDER {SQL_NEW_KEYWORD(SQL_TOKEN_ORDER); }
OUTER {SQL_NEW_KEYWORD(SQL_TOKEN_OUTER); }
[Pp][Ii] {SQL_NEW_KEYWORD(SQL_TOKEN_PI); return SQL_TOKEN_PI; }
[Pp][Oo][Ss][Ii][Tt][Ii][Oo][Nn] {SQL_NEW_KEYWORD(SQL_TOKEN_POSITION); return SQL_TOKEN_POSITION; }
[Pp][Oo][Ww][Ee][Rr] {SQL_NEW_KEYWORD(SQL_TOKEN_POWER); return SQL_TOKEN_POWER; }
[Pp][Rr][Ee][Cc][Ii][Ss][Ii][Oo][Nn] {SQL_NEW_KEYWORD(SQL_TOKEN_PRECISION); return SQL_TOKEN_PRECISION; }
[Pp][Rr][Ii][Mm][Aa][Rr][Yy] {SQL_NEW_KEYWORD(SQL_TOKEN_PRIMARY); return SQL_TOKEN_PRIMARY; }
[Pp][Rr][Ii][Vv][Ii][Ll][Ee][Gg][Ee][Ss] {SQL_NEW_KEYWORD(SQL_TOKEN_PRIVILEGES); return SQL_TOKEN_PRIVILEGES; }
[Pp][Rr][Oo][Cc][Ee][Dd][Uu][Rr][Ee] {SQL_NEW_KEYWORD(SQL_TOKEN_PROCEDURE); return SQL_TOKEN_PROCEDURE; }
[Pp][Uu][Bb][Ll][Ii][Cc] {SQL_NEW_KEYWORD(SQL_TOKEN_PUBLIC); return SQL_TOKEN_PUBLIC; }
PERCENT_RANK {SQL_NEW_KEYWORD(SQL_TOKEN_PERCENT_RANK); }
PERCENTILE_CONT {SQL_NEW_KEYWORD(SQL_TOKEN_PERCENTILE_CONT); }
PERCENTILE_DISC {SQL_NEW_KEYWORD(SQL_TOKEN_PERCENTILE_DISC); }
PI {SQL_NEW_KEYWORD(SQL_TOKEN_PI); }
POSITION {SQL_NEW_KEYWORD(SQL_TOKEN_POSITION); }
POWER {SQL_NEW_KEYWORD(SQL_TOKEN_POWER); }
PRECISION {SQL_NEW_KEYWORD(SQL_TOKEN_PRECISION); }
PRIMARY {SQL_NEW_KEYWORD(SQL_TOKEN_PRIMARY); }
PRIVILEGES {SQL_NEW_KEYWORD(SQL_TOKEN_PRIVILEGES); }
PROCEDURE {SQL_NEW_KEYWORD(SQL_TOKEN_PROCEDURE); }
PUBLIC {SQL_NEW_KEYWORD(SQL_TOKEN_PUBLIC); }
[Qq][Uu][Aa][Rr][Tt][Ee][Rr] {SQL_NEW_KEYWORD(SQL_TOKEN_QUARTER); return SQL_TOKEN_QUARTER; }
QUARTER {SQL_NEW_KEYWORD(SQL_TOKEN_QUARTER); }
[Rr][Aa][Dd][Ii][Aa][Nn][Ss] {SQL_NEW_KEYWORD(SQL_TOKEN_RADIANS); return SQL_TOKEN_RADIANS; }
[Rr][Aa][Nn][Dd] {SQL_NEW_KEYWORD(SQL_TOKEN_RAND); return SQL_TOKEN_RAND; }
[Rr][Ee][Aa][Ll] {SQL_NEW_KEYWORD(SQL_TOKEN_REAL); return SQL_TOKEN_REAL; }
[Rr][Ee][Ff][Ee][Rr][Ee][Nn][Cc][Ee][Ss] {SQL_NEW_KEYWORD(SQL_TOKEN_REFERENCES); return SQL_TOKEN_REFERENCES; }
[Rr][Ee][Pp][Ee][Aa][Tt] {SQL_NEW_KEYWORD(SQL_TOKEN_REPEAT); return SQL_TOKEN_REPEAT; }
[Rr][Ee][Pp][Ll][Aa][Cc][Ee] {SQL_NEW_KEYWORD(SQL_TOKEN_REPLACE); return SQL_TOKEN_REPLACE; }
[Rr][Oo][Ll][Ll][Bb][Aa][Cc][Kk] {SQL_NEW_KEYWORD(SQL_TOKEN_ROLLBACK); return SQL_TOKEN_ROLLBACK; }
[Rr][Oo][Uu][Nn][Dd] {SQL_NEW_KEYWORD(SQL_TOKEN_ROUND); return SQL_TOKEN_ROUND; }
[Rr][Oo][Uu][Nn][Dd][Mm][Aa][Gg][Ii][Cc] {SQL_NEW_KEYWORD(SQL_TOKEN_ROUNDMAGIC); return SQL_TOKEN_ROUNDMAGIC; }
[Rr][Ii][Gg][Hh][Tt] {SQL_NEW_KEYWORD(SQL_TOKEN_RIGHT); return SQL_TOKEN_RIGHT; }
[Rr][Tt][Rr][Ii][Mm] {SQL_NEW_KEYWORD(SQL_TOKEN_RTRIM); return SQL_TOKEN_RTRIM; }
RADIANS {SQL_NEW_KEYWORD(SQL_TOKEN_RADIANS); }
RAND {SQL_NEW_KEYWORD(SQL_TOKEN_RAND); }
RANK {SQL_NEW_KEYWORD(SQL_TOKEN_RANK); }
REAL {SQL_NEW_KEYWORD(SQL_TOKEN_REAL); }
REFERENCES {SQL_NEW_KEYWORD(SQL_TOKEN_REFERENCES); }
REFERENCING {SQL_NEW_KEYWORD(SQL_TOKEN_REFERENCING); }
REPEAT {SQL_NEW_KEYWORD(SQL_TOKEN_REPEAT); }
REPLACE {SQL_NEW_KEYWORD(SQL_TOKEN_REPLACE); }
ROLLBACK {SQL_NEW_KEYWORD(SQL_TOKEN_ROLLBACK); }
ROUND {SQL_NEW_KEYWORD(SQL_TOKEN_ROUND); }
ROUNDMAGIC {SQL_NEW_KEYWORD(SQL_TOKEN_ROUNDMAGIC); }
ROW {SQL_NEW_KEYWORD(SQL_TOKEN_ROW); }
RIGHT {SQL_NEW_KEYWORD(SQL_TOKEN_RIGHT); }
RTRIM {SQL_NEW_KEYWORD(SQL_TOKEN_RTRIM); }
[Ss][Cc][Hh][Ee][Mm][Aa] {SQL_NEW_KEYWORD(SQL_TOKEN_SCHEMA); return SQL_TOKEN_SCHEMA; }
[Ss][Ee][Cc][Oo][Nn][Dd] {SQL_NEW_KEYWORD(SQL_TOKEN_SECOND); return SQL_TOKEN_SECOND; }
[Ss][Ee][Ll][Ee][Cc][Tt] {SQL_NEW_KEYWORD(SQL_TOKEN_SELECT); return SQL_TOKEN_SELECT; }
[Ss][Ee][Tt] {SQL_NEW_KEYWORD(SQL_TOKEN_SET); return SQL_TOKEN_SET; }
[Ss][Ii][Zz][Ee] {SQL_NEW_KEYWORD(SQL_TOKEN_SIZE); return SQL_TOKEN_SIZE; }
[Ss][Ii][Gg][Nn] {SQL_NEW_KEYWORD(SQL_TOKEN_SIGN); return SQL_TOKEN_SIGN; }
[Ss][Ii][Nn] {SQL_NEW_KEYWORD(SQL_TOKEN_SIN); return SQL_TOKEN_SIN; }
[Ss][Mm][Aa][Ll][Ll][Ii][Nn][Tt] {SQL_NEW_KEYWORD(SQL_TOKEN_SMALLINT); return SQL_TOKEN_SMALLINT; }
[Ss][Oo][Mm][Ee] {SQL_NEW_KEYWORD(SQL_TOKEN_SOME); return SQL_TOKEN_SOME; }
[Ss][Oo][Uu][Nn][Dd][Ee][Xx] {SQL_NEW_KEYWORD(SQL_TOKEN_SOUNDEX); return SQL_TOKEN_SOUNDEX; }
[Ss][Pp][Aa][Cc][Ee] {SQL_NEW_KEYWORD(SQL_TOKEN_SPACE); return SQL_TOKEN_SPACE; }
[Ss][Qq][Rr][Tt] {SQL_NEW_KEYWORD(SQL_TOKEN_SQRT); return SQL_TOKEN_SQRT; }
STDDEV_POP {SQL_NEW_KEYWORD(SQL_TOKEN_STDDEV_POP); return SQL_TOKEN_STDDEV_POP; }
STDDEV_SAMP {SQL_NEW_KEYWORD(SQL_TOKEN_STDDEV_SAMP); return SQL_TOKEN_STDDEV_SAMP; }
[Ss][Uu][Bb][Ss][Tt][Rr][Ii][Nn][Gg] {SQL_NEW_KEYWORD(SQL_TOKEN_SUBSTRING); return SQL_TOKEN_SUBSTRING; }
[Ss][Uu][Mm] {SQL_NEW_KEYWORD(SQL_TOKEN_SUM); return SQL_TOKEN_SUM; }
SCHEMA {SQL_NEW_KEYWORD(SQL_TOKEN_SCHEMA); }
SECOND {SQL_NEW_KEYWORD(SQL_TOKEN_SECOND); }
SELECT {SQL_NEW_KEYWORD(SQL_TOKEN_SELECT); }
SET {SQL_NEW_KEYWORD(SQL_TOKEN_SET); }
SIZE {SQL_NEW_KEYWORD(SQL_TOKEN_SIZE); }
SIGN {SQL_NEW_KEYWORD(SQL_TOKEN_SIGN); }
SIN {SQL_NEW_KEYWORD(SQL_TOKEN_SIN); }
SMALLINT {SQL_NEW_KEYWORD(SQL_TOKEN_SMALLINT); }
SOME {SQL_NEW_KEYWORD(SQL_TOKEN_SOME); }
SOUNDEX {SQL_NEW_KEYWORD(SQL_TOKEN_SOUNDEX); }
SPACE {SQL_NEW_KEYWORD(SQL_TOKEN_SPACE); }
SQRT {SQL_NEW_KEYWORD(SQL_TOKEN_SQRT); }
STDDEV_POP {SQL_NEW_KEYWORD(SQL_TOKEN_STDDEV_POP); }
STDDEV_SAMP {SQL_NEW_KEYWORD(SQL_TOKEN_STDDEV_SAMP); }
STATEMENT {SQL_NEW_KEYWORD(SQL_TOKEN_STATEMENT); }
SUBSTRING {SQL_NEW_KEYWORD(SQL_TOKEN_SUBSTRING); }
SUM {SQL_NEW_KEYWORD(SQL_TOKEN_SUM); }
SESSION_USER {SQL_NEW_KEYWORD(SQL_TOKEN_SESSION_USER); }
SYSTEM_USER {SQL_NEW_KEYWORD(SQL_TOKEN_SYSTEM_USER); }
[Tt][Aa][Bb][Ll][Ee] {SQL_NEW_KEYWORD(SQL_TOKEN_TABLE); return SQL_TOKEN_TABLE; }
[Tt][Aa][Nn] {SQL_NEW_KEYWORD(SQL_TOKEN_TAN); return SQL_TOKEN_TAN; }
[Tt][Ii][Mm][Ee] {SQL_NEW_KEYWORD(SQL_TOKEN_TIME); return SQL_TOKEN_TIME; }
[Tt][Ii][Mm][Ee][Ss][Tt][Aa][Mm][Pp] {SQL_NEW_KEYWORD(SQL_TOKEN_TIMESTAMP); return SQL_TOKEN_TIMESTAMP; }
[Tt][Ii][Mm][Ee][Ss][Tt][Aa][Mm][Pp][Aa][Dd][Dd] {SQL_NEW_KEYWORD(SQL_TOKEN_TIMESTAMPADD); return SQL_TOKEN_TIMESTAMPADD; }
[Tt][Ii][Mm][Ee][Ss][Tt][Aa][Mm][Pp][Dd][Ii][Ff][Ff] {SQL_NEW_KEYWORD(SQL_TOKEN_TIMESTAMPDIFF); return SQL_TOKEN_TIMESTAMPDIFF; }
[Tt][Ii][Mm][Ee][Vv][Aa][Ll][Uu][Ee] {SQL_NEW_KEYWORD(SQL_TOKEN_TIMEVALUE); return SQL_TOKEN_TIMEVALUE; }
[Tt][Ii][Mm][Ee][Zz][Oo][Nn][Ee]_[Hh][Oo][Uu][Rr] {SQL_NEW_KEYWORD(SQL_TOKEN_TIMEZONE_HOUR); return SQL_TOKEN_TIMEZONE_HOUR; }
[Tt][Ii][Mm][Ee][Zz][Oo][Nn][Ee]_[Mm][Ii][Nn][Uu][Tt][Ee] {SQL_NEW_KEYWORD(SQL_TOKEN_TIMEZONE_MINUTE); return SQL_TOKEN_TIMEZONE_MINUTE; }
[Tt][Oo] {SQL_NEW_KEYWORD(SQL_TOKEN_TO); return SQL_TOKEN_TO; }
[Tt][Rr][Aa][Ii][Ll][Ii][Nn][Gg] {SQL_NEW_KEYWORD(SQL_TOKEN_TRAILING); return SQL_TOKEN_TRAILING; }
[Tt][Rr][Aa][Nn][Ss][Ll][Aa][Tt][Ee] {SQL_NEW_KEYWORD(SQL_TOKEN_TRANSLATE); return SQL_TOKEN_TRANSLATE; }
[Tt][Rr][Ii][Mm] {SQL_NEW_KEYWORD(SQL_TOKEN_TRIM); return SQL_TOKEN_TRIM; }
[Tt][Rr][Uu][Ee] {SQL_NEW_KEYWORD(SQL_TOKEN_TRUE); return SQL_TOKEN_TRUE; }
[Tt][Rr][Uu][Nn][Cc][Aa][Tt][Ee] {SQL_NEW_KEYWORD(SQL_TOKEN_TRUNCATE); return SQL_TOKEN_TRUNCATE; }
[Tt][Ss] {SQL_NEW_KEYWORD(SQL_TOKEN_TS); return SQL_TOKEN_TS; }
[Tt] {SQL_NEW_KEYWORD(SQL_TOKEN_T); return SQL_TOKEN_T; }
TABLE {SQL_NEW_KEYWORD(SQL_TOKEN_TABLE); }
TAN {SQL_NEW_KEYWORD(SQL_TOKEN_TAN); }
THEN {SQL_NEW_KEYWORD(SQL_TOKEN_THEN); }
TIME {SQL_NEW_KEYWORD(SQL_TOKEN_TIME); }
TIMESTAMP {SQL_NEW_KEYWORD(SQL_TOKEN_TIMESTAMP); }
TIMESTAMPADD {SQL_NEW_KEYWORD(SQL_TOKEN_TIMESTAMPADD); }
TIMESTAMPDIFF {SQL_NEW_KEYWORD(SQL_TOKEN_TIMESTAMPDIFF); }
TIMEVALUE {SQL_NEW_KEYWORD(SQL_TOKEN_TIMEVALUE); }
TIMEZONE_HOUR {SQL_NEW_KEYWORD(SQL_TOKEN_TIMEZONE_HOUR); }
TIMEZONE_MINUTE {SQL_NEW_KEYWORD(SQL_TOKEN_TIMEZONE_MINUTE); }
TO {SQL_NEW_KEYWORD(SQL_TOKEN_TO); }
TRAILING {SQL_NEW_KEYWORD(SQL_TOKEN_TRAILING); }
TRANSLATE {SQL_NEW_KEYWORD(SQL_TOKEN_TRANSLATE); }
TRIGGER {SQL_NEW_KEYWORD(SQL_TOKEN_TRIGGER); }
TRIM {SQL_NEW_KEYWORD(SQL_TOKEN_TRIM); }
TRUE {SQL_NEW_KEYWORD(SQL_TOKEN_TRUE); }
TRUNCATE {SQL_NEW_KEYWORD(SQL_TOKEN_TRUNCATE); }
TS {SQL_NEW_KEYWORD(SQL_TOKEN_TS); }
T {SQL_NEW_KEYWORD(SQL_TOKEN_T); }
[Uu][Cc][Aa][Ss][Ee] {SQL_NEW_KEYWORD(SQL_TOKEN_UCASE); return SQL_TOKEN_UCASE; }
[Uu][Nn][Ii][Oo][Nn] {SQL_NEW_KEYWORD(SQL_TOKEN_UNION); return SQL_TOKEN_UNION; }
[Uu][Nn][Ii][Qq][Uu][Ee] {SQL_NEW_KEYWORD(SQL_TOKEN_UNIQUE); return SQL_TOKEN_UNIQUE; }
[Uu][Nn][Kk][Nn][Oo][Ww][Nn] {SQL_NEW_KEYWORD(SQL_TOKEN_UNKNOWN); return SQL_TOKEN_UNKNOWN; }
[Uu][Pp][Dd][Aa][Tt][Ee] {SQL_NEW_KEYWORD(SQL_TOKEN_UPDATE); return SQL_TOKEN_UPDATE; }
[Uu][Pp][Pp][Ee][Rr] {SQL_NEW_KEYWORD(SQL_TOKEN_UPPER); return SQL_TOKEN_UPPER; }
[Uu][Ss][Aa][Gg][Ee] {SQL_NEW_KEYWORD(SQL_TOKEN_USAGE); return SQL_TOKEN_USAGE; }
[Uu][Ss][Ee][Rr] {SQL_NEW_KEYWORD(SQL_TOKEN_USER); return SQL_TOKEN_USER; }
[Uu][Ss][Ii][Nn][Gg] {SQL_NEW_KEYWORD(SQL_TOKEN_USING); return SQL_TOKEN_USING; }
UCASE {SQL_NEW_KEYWORD(SQL_TOKEN_UCASE); }
UNION {SQL_NEW_KEYWORD(SQL_TOKEN_UNION); }
UNIQUE {SQL_NEW_KEYWORD(SQL_TOKEN_UNIQUE); }
UNKNOWN {SQL_NEW_KEYWORD(SQL_TOKEN_UNKNOWN); }
UPDATE {SQL_NEW_KEYWORD(SQL_TOKEN_UPDATE); }
UPPER {SQL_NEW_KEYWORD(SQL_TOKEN_UPPER); }
USAGE {SQL_NEW_KEYWORD(SQL_TOKEN_USAGE); }
USER {SQL_NEW_KEYWORD(SQL_TOKEN_USER); }
USING {SQL_NEW_KEYWORD(SQL_TOKEN_USING); }
VAR_POP {SQL_NEW_KEYWORD(SQL_TOKEN_VAR_POP); return SQL_TOKEN_VAR_POP; }
VAR_SAMP {SQL_NEW_KEYWORD(SQL_TOKEN_VAR_SAMP); return SQL_TOKEN_VAR_SAMP; }
[Vv][Aa][Ll][Uu][Ee][Ss] {SQL_NEW_KEYWORD(SQL_TOKEN_VALUES); return SQL_TOKEN_VALUES; }
[Vv][Ii][Ee][Ww] {SQL_NEW_KEYWORD(SQL_TOKEN_VIEW); return SQL_TOKEN_VIEW; }
VARBINARY {SQL_NEW_KEYWORD(SQL_TOKEN_VARBINARY); }
VARCHAR {SQL_NEW_KEYWORD(SQL_TOKEN_VARCHAR); }
VARYING {SQL_NEW_KEYWORD(SQL_TOKEN_VARYING); }
VAR_POP {SQL_NEW_KEYWORD(SQL_TOKEN_VAR_POP); }
VAR_SAMP {SQL_NEW_KEYWORD(SQL_TOKEN_VAR_SAMP); }
VALUE {SQL_NEW_KEYWORD(SQL_TOKEN_VALUE); }
VALUES {SQL_NEW_KEYWORD(SQL_TOKEN_VALUES); }
VIEW {SQL_NEW_KEYWORD(SQL_TOKEN_VIEW); }
[Ww][Ee][Ee][Kk] {SQL_NEW_KEYWORD(SQL_TOKEN_WEEK); return SQL_TOKEN_WEEK; }
[Ww][Hh][Ee][Rr][Ee] {SQL_NEW_KEYWORD(SQL_TOKEN_WHERE); return SQL_TOKEN_WHERE; }
[Ww][Ii][Tt][Hh] {SQL_NEW_KEYWORD(SQL_TOKEN_WITH); return SQL_TOKEN_WITH; }
[Ww][Oo][Rr][Kk] {SQL_NEW_KEYWORD(SQL_TOKEN_WORK); return SQL_TOKEN_WORK; }
WEEK {SQL_NEW_KEYWORD(SQL_TOKEN_WEEK); }
WHEN {SQL_NEW_KEYWORD(SQL_TOKEN_WHEN); }
WHERE {SQL_NEW_KEYWORD(SQL_TOKEN_WHERE); }
WITH {SQL_NEW_KEYWORD(SQL_TOKEN_WITH); }
WITHIN {SQL_NEW_KEYWORD(SQL_TOKEN_WITHIN); }
WITHOUT {SQL_NEW_KEYWORD(SQL_TOKEN_WITHOUT); }
WORK {SQL_NEW_KEYWORD(SQL_TOKEN_WORK); }
[Yy][Ee][Aa][Rr] {SQL_NEW_KEYWORD(SQL_TOKEN_YEAR); return SQL_TOKEN_YEAR; }
YEAR {SQL_NEW_KEYWORD(SQL_TOKEN_YEAR); }
[Zz][Oo][Nn][Ee] {SQL_NEW_KEYWORD(SQL_TOKEN_ZONE); return SQL_TOKEN_ZONE; }
ZONE {SQL_NEW_KEYWORD(SQL_TOKEN_ZONE); }
"<" { SQL_NEW_NODE(::rtl::OUString(SQLyytext,strlen(SQLyytext),RTL_TEXTENCODING_UTF8), SQL_NODE_LESS);return SQL_LESS;}
">" { SQL_NEW_NODE(::rtl::OUString(SQLyytext,strlen(SQLyytext),RTL_TEXTENCODING_UTF8), SQL_NODE_GREAT);return SQL_GREAT;}
@ -365,31 +410,31 @@ VAR_SAMP {SQL_NEW_KEYWORD(SQL_TOKEN_VAR_S
<SQL>([0-9]+) |
<SQL>([0-9]+"."[0-9]*) |
<SQL>("."[0-9]*) {SQL_NEW_INTNUM; return SQL_TOKEN_INTNUM;}
<SQL>("."[0-9]*) {SQL_NEW_INTNUM; }
<SQL>[0-9]+[eE][+-]?[0-9]+ |
<SQL>[0-9]+"."[0-9]*[eE][+-]?[0-9]+ |
<SQL>"."[0-9]*[eE][+-]?[0-9]+ {SQL_NEW_APPROXNUM; return SQL_TOKEN_APPROXNUM; }
<SQL>"."[0-9]*[eE][+-]?[0-9]+ {SQL_NEW_APPROXNUM; }
<PREDICATE_GER,PREDICATE_ENG,DATE>[A-Za-z\200-\277\300-\337\340-\357\360-\367\370-\373\374-\375][A-Za-z0-9_%.,*?\200-\277\300-\337\340-\357\360-\367\370-\373\374-\375]* {return gatherNamePre(SQLyytext);}
<PREDICATE_GER,PREDICATE_ENG>([0-9]+) {SQL_NEW_INTNUM; return SQL_TOKEN_INTNUM;}
<PREDICATE_ENG>([0-9]{1,3}(","[0-9]{3})+) {SQL_NEW_INTNUM; return SQL_TOKEN_INTNUM;}
<PREDICATE_GER>([0-9]{1,3}("."[0-9]{3})+) {SQL_NEW_INTNUM; return SQL_TOKEN_INTNUM;}
<PREDICATE_GER,PREDICATE_ENG>([0-9]+) {SQL_NEW_INTNUM; }
<PREDICATE_ENG>([0-9]{1,3}(","[0-9]{3})+) {SQL_NEW_INTNUM; }
<PREDICATE_GER>([0-9]{1,3}("."[0-9]{3})+) {SQL_NEW_INTNUM; }
<PREDICATE_ENG>([0-9]+"."[0-9]+) |
<PREDICATE_ENG>([0-9]{1,3}(","[0-9]{3})+"."[0-9]+) |
<PREDICATE_ENG>("."[0-9]+) {SQL_NEW_APPROXNUM; return SQL_TOKEN_APPROXNUM; }
<PREDICATE_ENG>("."[0-9]+) {SQL_NEW_APPROXNUM; }
<PREDICATE_ENG>[0-9]+[eE][+-]?[0-9]+ |
<PREDICATE_ENG>[0-9]+"."[0-9]*[eE][+-]?[0-9]+ |
<PREDICATE_ENG>"."[0-9]*[eE][+-]?[0-9]+ {SQL_NEW_APPROXNUM; return SQL_TOKEN_APPROXNUM; }
<PREDICATE_ENG>"."[0-9]*[eE][+-]?[0-9]+ {SQL_NEW_APPROXNUM; }
<PREDICATE_GER>([0-9]+","[0-9]+) |
<PREDICATE_GER>([0-9]{1,3}("."[0-9]{3})+","[0-9]+) |
<PREDICATE_GER>(","[0-9]+) {SQL_NEW_APPROXNUM; return SQL_TOKEN_APPROXNUM; }
<PREDICATE_GER>(","[0-9]+) {SQL_NEW_APPROXNUM; }
<PREDICATE_GER>[0-9]+[eE][+-]?[0-9]+ |
<PREDICATE_GER>[0-9]+","[0-9]*[eE][+-]?[0-9]+ |
<PREDICATE_GER>","[0-9]*[eE][+-]?[0-9]+ {SQL_NEW_APPROXNUM; return SQL_TOKEN_APPROXNUM; }
<PREDICATE_GER>","[0-9]*[eE][+-]?[0-9]+ {SQL_NEW_APPROXNUM; }
<PREDICATE_GER,PREDICATE_ENG>[0-9.,][A-Za-z0-9_.,%]* {return gatherNamePre(SQLyytext);}
@ -403,7 +448,7 @@ VAR_SAMP {SQL_NEW_KEYWORD(SQL_TOKEN_VAR_S
<PREDICATE_GER,PREDICATE_ENG,DATE># { return gatherString('#' ,2); }
<DATE>[0-9]{1,4}[^ ]*[0-9] |
<DATE>[0-9]{1,4}[^ ]*[0-9][ ][0-9]{1,4}[^ ]*[0-9] { SQL_NEW_DATE; return SQL_TOKEN_ACCESS_DATE;}
<DATE>[0-9]{1,4}[^ ]*[0-9][ ][0-9]{1,4}[^ ]*[0-9] { SQL_NEW_DATE; }
<STRING>["-""+""*""/"":""("")"",""."";""?""{""}"] { return SQLyytext[0]; } /* */
<STRING>"[" { return gatherString(']' ,0); }
@ -464,7 +509,7 @@ sal_Int32 gatherString( sal_Int32 delim, sal_Int32 nTyp)
{
case 0:
SQL_NEW_NODE(::rtl::OStringToOUString(sBuffer.makeStringAndClear(),RTL_TEXTENCODING_UTF8), SQL_NODE_NAME);
return SQL_TOKEN_NAME;
return SQL_TOKEN_NAME;
case 1:
SQL_NEW_NODE(::rtl::OStringToOUString(sBuffer.makeStringAndClear(),RTL_TEXTENCODING_UTF8), SQL_NODE_STRING);
return SQL_TOKEN_STRING;
@ -487,7 +532,7 @@ sal_Int32 gatherString( sal_Int32 delim, sal_Int32 nTyp)
}
}
YY_FATAL_ERROR("Unterminated name string");
return SQL_TOKEN_INVALIDSYMBOL;
return SQL_TOKEN_INVALIDSYMBOL;
}
sal_Int32 mapEnumToToken(IParseContext::InternationalKeyCode _eKeyCode )
@ -562,10 +607,10 @@ sal_Int32 gatherName(const sal_Char* text)
case IParseContext::KEY_INTERSECTION:
nToken = mapEnumToToken(eKeyCode);
SQL_NEW_KEYWORD(nToken);
return nToken;
break;
default:
SQL_NEW_NODE(::rtl::OUString(text,strlen(text),RTL_TEXTENCODING_UTF8), SQL_NODE_NAME);
return SQL_TOKEN_NAME;
return SQL_TOKEN_NAME;
}
}
/**

View File

@ -50,6 +50,10 @@
#include "diagnose_ex.h"
#include <rtl/logfile.hxx>
#define SQL_ISRULEOR2(pParseNode, e1,e2) ((pParseNode)->isRule() && (\
(pParseNode)->getRuleID() == OSQLParser::RuleID(OSQLParseNode::e1) || \
(pParseNode)->getRuleID() == OSQLParser::RuleID(OSQLParseNode::e2)))
using namespace ::comphelper;
using namespace ::connectivity;
using namespace ::connectivity::sdbcx;
@ -67,6 +71,7 @@ namespace connectivity
{
struct OSQLParseTreeIteratorImpl
{
::std::vector< TNodePair > m_aJoinConditions;
Reference< XConnection > m_xConnection;
Reference< XDatabaseMetaData > m_xDatabaseMetaData;
Reference< XNameAccess > m_xTableContainer;
@ -476,7 +481,42 @@ void OSQLParseTreeIterator::traverseOneTableName( OSQLTables& _rTables,const OSQ
if ( aTable.is() )
_rTables[ aTableRange ] = aTable;
}
//-----------------------------------------------------------------------------
void OSQLParseTreeIterator::impl_fillJoinConditions(const OSQLParseNode* i_pJoinCondition)
{
if (i_pJoinCondition->count() == 3 && // Ausdruck is geklammert
SQL_ISPUNCTUATION(i_pJoinCondition->getChild(0),"(") &&
SQL_ISPUNCTUATION(i_pJoinCondition->getChild(2),")"))
{
impl_fillJoinConditions(i_pJoinCondition->getChild(1));
}
else if (SQL_ISRULEOR2(i_pJoinCondition,search_condition,boolean_term) && // AND/OR-Verknuepfung:
i_pJoinCondition->count() == 3)
{
// nur AND Verknüpfung zulassen
if ( SQL_ISTOKEN(i_pJoinCondition->getChild(1),AND) )
{
impl_fillJoinConditions(i_pJoinCondition->getChild(0));
impl_fillJoinConditions(i_pJoinCondition->getChild(1));
}
}
else if (SQL_ISRULE(i_pJoinCondition,comparison_predicate))
{
// only the comparison of columns is allowed
OSL_ENSURE(i_pJoinCondition->count() == 3,"OQueryDesignView::InsertJoinConnection: Fehler im Parse Tree");
if (SQL_ISRULE(i_pJoinCondition->getChild(0),column_ref) &&
SQL_ISRULE(i_pJoinCondition->getChild(2),column_ref) &&
i_pJoinCondition->getChild(1)->getNodeType() == SQL_NODE_EQUAL)
{
m_pImpl->m_aJoinConditions.push_back( TNodePair(i_pJoinCondition->getChild(0),i_pJoinCondition->getChild(2)) );
}
}
}
//-----------------------------------------------------------------------------
::std::vector< TNodePair >& OSQLParseTreeIterator::getJoinConditions() const
{
return m_pImpl->m_aJoinConditions;
}
//-----------------------------------------------------------------------------
void OSQLParseTreeIterator::getQualified_join( OSQLTables& _rTables, const OSQLParseNode *pTableRef, ::rtl::OUString& aTableRange )
{
@ -491,8 +531,30 @@ void OSQLParseTreeIterator::getQualified_join( OSQLTables& _rTables, const OSQLP
traverseOneTableName( _rTables, pNode, aTableRange );
sal_uInt32 nPos = 4;
if(SQL_ISRULE(pTableRef,cross_union) || pTableRef->getChild(1)->getTokenID() != SQL_TOKEN_NATURAL)
if( SQL_ISRULE(pTableRef,cross_union) || pTableRef->getChild(1)->getTokenID() != SQL_TOKEN_NATURAL)
{
nPos = 3;
// join_condition,named_columns_join
if ( SQL_ISRULE( pTableRef, qualified_join ) )
{
const OSQLParseNode* pJoin_spec = pTableRef->getChild(4);
if ( SQL_ISRULE( pJoin_spec, join_condition ) )
{
impl_fillJoinConditions(pJoin_spec->getChild(1));
}
else
{
const OSQLParseNode* pColumnCommalist = pJoin_spec->getChild(2);
// Alle Columns in der column_commalist ...
for (sal_uInt32 i = 0; i < pColumnCommalist->count(); i++)
{
const OSQLParseNode * pCol = pColumnCommalist->getChild(i);
// add twice because the column must exists in both tables
m_pImpl->m_aJoinConditions.push_back( TNodePair(pCol,pCol) );
}
}
}
}
pNode = getTableNode(_rTables,pTableRef->getChild(nPos),aTableRange);
if ( isTableNode( pNode ) )
@ -826,17 +888,17 @@ void OSQLParseTreeIterator::traverseCreateColumns(const OSQLParseNode* pSelectNo
aColumnName = pColumnRef->getChild(0)->getTokenValue();
OSQLParseNode *pDatatype = pColumnRef->getChild(1);
if (pDatatype && SQL_ISRULE(pDatatype,data_type))
if (pDatatype && SQL_ISRULE(pDatatype,character_string_type))
{
//data type
// 0 | 1| 2 |3
//char ( 20 )
aTypeName = pDatatype->getChild(0)->getTokenValue();
if (pDatatype->count() == 4
&& SQL_ISPUNCTUATION(pDatatype->getChild(1), "(")
&& SQL_ISPUNCTUATION(pDatatype->getChild(3) , ")") )
const OSQLParseNode *pType = pDatatype->getChild(0);
aTypeName = pType->getTokenValue();
if (pDatatype->count() == 2 && (pType->getTokenID() == SQL_TOKEN_CHAR || pType->getTokenID() == SQL_TOKEN_CHARACTER ))
nType = DataType::CHAR;
const OSQLParseNode *pParams = pDatatype->getChild(pDatatype->count()-1);
if ( pParams->count() )
{
nLen = pDatatype->getChild(2)->getTokenValue().toInt32();
nLen = pParams->getChild(1)->getTokenValue().toInt32();
}
}
else if(pDatatype && pDatatype->getNodeType() == SQL_NODE_KEYWORD)
@ -846,8 +908,8 @@ void OSQLParseTreeIterator::traverseCreateColumns(const OSQLParseNode* pSelectNo
if (aTypeName.getLength())
{
//TO DO:Create a new class for create statement to handle field length
OParseColumn* pColumn = new OParseColumn(aColumnName,aTypeName,::rtl::OUString(),
//TODO:Create a new class for create statement to handle field length
OParseColumn* pColumn = new OParseColumn(aColumnName,aTypeName,::rtl::OUString(),::rtl::OUString(),
ColumnValue::NULLABLE_UNKNOWN,0,0,nType,sal_False,sal_False,isCaseSensitive());
pColumn->setFunction(sal_False);
pColumn->setRealName(aColumnName);
@ -1115,17 +1177,17 @@ void OSQLParseTreeIterator::traverseParameters(const OSQLParseNode* _pNode)
else
pOther->parseNodeToStr( sColumnName, m_pImpl->m_xConnection, NULL, sal_False, sal_False );
} // if ( SQL_ISRULE(pParent,comparison_predicate) ) // x = X
else if ( SQL_ISRULE(pParent,like_predicate) )
else if ( SQL_ISRULE(pParent,other_like_predicate_part_2) )
{
const OSQLParseNode* pOther = pParent->getChild(0);
const OSQLParseNode* pOther = pParent->getParent()->getChild(0);
if ( SQL_ISRULE( pOther, column_ref ) )
getColumnRange( pOther, sColumnName, sTableRange, aColumnAlias);
else
pOther->parseNodeToStr( sColumnName, m_pImpl->m_xConnection, NULL, sal_False, sal_False );
}
else if ( SQL_ISRULE(pParent,between_predicate) )
else if ( SQL_ISRULE(pParent,between_predicate_part_2) )
{
const OSQLParseNode* pOther = pParent->getChild(0);
const OSQLParseNode* pOther = pParent->getParent()->getChild(0);
if ( SQL_ISRULE( pOther, column_ref ) )
getColumnRange( pOther, sColumnName, sTableRange, aColumnAlias);
else
@ -1304,17 +1366,19 @@ void OSQLParseTreeIterator::traverseANDCriteria(OSQLParseNode * pSearchCondition
::rtl::OUString aValue;
pSearchCondition->getChild(2)->parseNodeToStr( aValue, m_pImpl->m_xConnection, NULL, sal_False, sal_False );
traverseOnePredicate(pSearchCondition->getChild(0),aValue,pSearchCondition->getChild(2));
impl_fillJoinConditions(pSearchCondition);
// if (! aIteratorStatus.IsSuccessful())
// return;
}
else if (SQL_ISRULE(pSearchCondition,like_predicate) /*&& SQL_ISRULE(pSearchCondition->getChild(0),column_ref)*/)
{
OSL_ENSURE(pSearchCondition->count() >= 4,"OSQLParseTreeIterator: error in parse tree!");
OSL_ENSURE(pSearchCondition->count() == 2,"OSQLParseTreeIterator: error in parse tree!");
const OSQLParseNode* pPart2 = pSearchCondition->getChild(1);
sal_Int32 nCurentPos = pSearchCondition->count()-2;
sal_Int32 nCurentPos = pPart2->count()-2;
OSQLParseNode * pNum_value_exp = pSearchCondition->getChild(nCurentPos);
OSQLParseNode * pOptEscape = pSearchCondition->getChild(nCurentPos+1);
OSQLParseNode * pNum_value_exp = pPart2->getChild(nCurentPos);
OSQLParseNode * pOptEscape = pPart2->getChild(nCurentPos+1);
OSL_ENSURE(pNum_value_exp != NULL,"OSQLParseTreeIterator: error in parse tree!");
OSL_ENSURE(pOptEscape != NULL,"OSQLParseTreeIterator: error in parse tree!");
@ -1344,12 +1408,13 @@ void OSQLParseTreeIterator::traverseANDCriteria(OSQLParseNode * pSearchCondition
}
else if (SQL_ISRULE(pSearchCondition,in_predicate))
{
OSL_ENSURE(pSearchCondition->count() == 4,"OSQLParseTreeIterator: error in parse tree!");
OSL_ENSURE(pSearchCondition->count() == 2,"OSQLParseTreeIterator: error in parse tree!");
const OSQLParseNode* pPart2 = pSearchCondition->getChild(1);
traverseORCriteria(pSearchCondition->getChild(0));
// if (! aIteratorStatus.IsSuccessful()) return;
OSQLParseNode* pChild = pSearchCondition->getChild(3);
OSQLParseNode* pChild = pPart2->getChild(2);
if ( SQL_ISRULE(pChild->getChild(0),subquery) )
{
traverseTableNames( *m_pImpl->m_pSubTables );
@ -1367,8 +1432,9 @@ void OSQLParseTreeIterator::traverseANDCriteria(OSQLParseNode * pSearchCondition
}
else if (SQL_ISRULE(pSearchCondition,test_for_null) /*&& SQL_ISRULE(pSearchCondition->getChild(0),column_ref)*/)
{
OSL_ENSURE(pSearchCondition->count() >= 3,"OSQLParseTreeIterator: error in parse tree!");
OSL_ENSURE(SQL_ISTOKEN(pSearchCondition->getChild(1),IS),"OSQLParseTreeIterator: error in parse tree!");
OSL_ENSURE(pSearchCondition->count() == 2,"OSQLParseTreeIterator: error in parse tree!");
const OSQLParseNode* pPart2 = pSearchCondition->getChild(1);
OSL_ENSURE(SQL_ISTOKEN(pPart2->getChild(0),IS),"OSQLParseTreeIterator: error in parse tree!");
::rtl::OUString aString;
traverseOnePredicate(pSearchCondition->getChild(0),aString,NULL);
@ -1427,9 +1493,17 @@ void OSQLParseTreeIterator::traverseParameter(const OSQLParseNode* _pParseNode
{// found a function as column_ref
::rtl::OUString sFunctionName;
_pColumnRef->getChild(0)->parseNodeToStr( sFunctionName, m_pImpl->m_xConnection, NULL, sal_False, sal_False );
sal_Int32 nType = ::connectivity::OSQLParser::getFunctionReturnType( sFunctionName, &m_rParser.getContext() );
const sal_uInt32 nCount = _pColumnRef->count();
sal_uInt32 i = 0;
for(; i < nCount;++i)
{
if ( _pColumnRef->getChild(i) == _pParseNode )
break;
}
sal_Int32 nType = ::connectivity::OSQLParser::getFunctionParameterType( _pColumnRef->getParent()->getChild(0)->getTokenID(), i+1);
OParseColumn* pColumn = new OParseColumn( sParameterName,
::rtl::OUString(),
::rtl::OUString(),
::rtl::OUString(),
ColumnValue::NULLABLE_UNKNOWN,
@ -1493,6 +1567,7 @@ void OSQLParseTreeIterator::traverseParameter(const OSQLParseNode* _pParseNode
::rtl::OUString aNewColName( getUniqueColumnName( sParameterName ) );
OParseColumn* pColumn = new OParseColumn(aNewColName,
::rtl::OUString(),
::rtl::OUString(),
::rtl::OUString(),
ColumnValue::NULLABLE_UNKNOWN,
@ -1637,6 +1712,7 @@ void OSQLParseTreeIterator::appendColumns(::vos::ORef<OSQLColumns>& _rColumns,co
OParseColumn* pColumn = new OParseColumn(aName
, getString(xColumn->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_TYPENAME)))
, getString(xColumn->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_DEFAULTVALUE)))
, getString(xColumn->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_DESCRIPTION)))
, getINT32(xColumn->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_ISNULLABLE)))
, getINT32(xColumn->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_PRECISION)))
, getINT32(xColumn->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_SCALE)))
@ -1714,6 +1790,7 @@ void OSQLParseTreeIterator::setSelectColumnName(::vos::ORef<OSQLColumns>& _rColu
// TODO: does this match with _nType?
// Or should be fill this from the getTypeInfo of the connection?
::rtl::OUString(),
::rtl::OUString(),
ColumnValue::NULLABLE_UNKNOWN,
0,
0,
@ -1733,7 +1810,7 @@ void OSQLParseTreeIterator::setSelectColumnName(::vos::ORef<OSQLColumns>& _rColu
{
::rtl::OUString aNewColName(getUniqueColumnName(rColumnAlias));
OParseColumn* pColumn = new OParseColumn(aNewColName,::rtl::OUString(),::rtl::OUString(),
OParseColumn* pColumn = new OParseColumn(aNewColName,::rtl::OUString(),::rtl::OUString(),::rtl::OUString(),
ColumnValue::NULLABLE_UNKNOWN,0,0,_nType,sal_False,sal_False,isCaseSensitive());
pColumn->setFunction(sal_True);
pColumn->setAggregateFunction(bAggFkt);
@ -1754,7 +1831,7 @@ void OSQLParseTreeIterator::setSelectColumnName(::vos::ORef<OSQLColumns>& _rColu
{
::rtl::OUString aNewColName(getUniqueColumnName(rColumnAlias));
OParseColumn* pColumn = new OParseColumn(aNewColName,::rtl::OUString(),::rtl::OUString(),
OParseColumn* pColumn = new OParseColumn(aNewColName,::rtl::OUString(),::rtl::OUString(),::rtl::OUString(),
ColumnValue::NULLABLE_UNKNOWN,0,0,_nType,sal_False,sal_False,isCaseSensitive());
pColumn->setFunction(sal_True);
pColumn->setAggregateFunction(bAggFkt);
@ -1791,7 +1868,7 @@ void OSQLParseTreeIterator::setSelectColumnName(::vos::ORef<OSQLColumns>& _rColu
{
::rtl::OUString aNewColName(getUniqueColumnName(rColumnAlias));
OParseColumn* pColumn = new OParseColumn(aNewColName,::rtl::OUString(),::rtl::OUString(),
OParseColumn* pColumn = new OParseColumn(aNewColName,::rtl::OUString(),::rtl::OUString(),::rtl::OUString(),
ColumnValue::NULLABLE_UNKNOWN,0,0,DataType::VARCHAR,sal_False,sal_False,isCaseSensitive());
pColumn->setFunction(sal_True);
pColumn->setAggregateFunction(bAggFkt);

View File

@ -677,7 +677,7 @@ void OSQLParseNode::impl_parseTableRangeNodeToString_throw(::rtl::OUStringBuffer
void OSQLParseNode::impl_parseLikeNodeToString_throw( ::rtl::OUStringBuffer& rString, const SQLParseNodeParameter& rParam ) const
{
RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "parse", "Ocke.Janssen@sun.com", "OSQLParseNode::impl_parseLikeNodeToString_throw" );
OSL_ENSURE(count() >= 4,"count != 5: Prepare for GPF");
OSL_ENSURE(count() == 2,"count != 2: Prepare for GPF");
const OSQLParseNode* pEscNode = NULL;
const OSQLParseNode* pParaNode = NULL;
@ -714,13 +714,14 @@ void OSQLParseNode::impl_parseLikeNodeToString_throw( ::rtl::OUStringBuffer& rSt
if (bAddName)
m_aChildren[0]->impl_parseNodeToString_throw( rString, aNewParam );
m_aChildren[1]->impl_parseNodeToString_throw( rString, aNewParam );
if(count() == 5)
m_aChildren[2]->impl_parseNodeToString_throw( rString, aNewParam );
const OSQLParseNode* pPart2 = m_aChildren[1];
pPart2->getChild(1)->impl_parseNodeToString_throw( rString, aNewParam );
if (SQL_ISTOKEN(pPart2->getChild(0), NOT))
pPart2->getChild(2)->impl_parseNodeToString_throw( rString, aNewParam );
sal_Int32 nCurentPos = m_aChildren.size()-2;
pParaNode = m_aChildren[nCurentPos];
pEscNode = m_aChildren[nCurentPos+1];
sal_Int32 nCurentPos = pPart2->count() - 2;
pParaNode = pPart2->getChild(nCurentPos);
pEscNode = pPart2->getChild(nCurentPos+1);
if (pParaNode->isToken())
{
@ -1422,7 +1423,12 @@ OSQLParser::OSQLParser(const ::com::sun::star::uno::Reference< ::com::sun::star:
{ OSQLParseNode::datetime_primary, "datetime_primary" },
{ OSQLParseNode::concatenation, "concatenation" },
{ OSQLParseNode::char_factor, "char_factor" },
{ OSQLParseNode::bit_value_fct, "bit_value_fct" }
{ OSQLParseNode::bit_value_fct, "bit_value_fct" },
{ OSQLParseNode::comparison_predicate_part_2, "comparison_predicate_part_2" },
{ OSQLParseNode::parenthesized_boolean_value_expression, "parenthesized_boolean_value_expression" },
{ OSQLParseNode::character_string_type, "character_string_type" },
{ OSQLParseNode::other_like_predicate_part_2, "other_like_predicate_part_2" },
{ OSQLParseNode::between_predicate_part_2, "between_predicate_part_2" }
};
size_t nRuleMapCount = sizeof( aRuleDescriptions ) / sizeof( aRuleDescriptions[0] );
OSL_ENSURE( nRuleMapCount == size_t( OSQLParseNode::rule_count ), "OSQLParser::OSQLParser: added a new rule? Adjust this map!" );
@ -1984,39 +1990,34 @@ void OSQLParseNode::negateSearchCondition(OSQLParseNode*& pSearchCondition,sal_B
else if(bNegate && (SQL_ISRULE(pSearchCondition,test_for_null) || SQL_ISRULE(pSearchCondition,in_predicate) ||
SQL_ISRULE(pSearchCondition,between_predicate) || SQL_ISRULE(pSearchCondition,boolean_test) ))
{
OSQLParseNode* pPart2 = pSearchCondition;
if ( !SQL_ISRULE(pSearchCondition,boolean_test) )
pPart2 = pSearchCondition->getChild(1);
sal_uInt32 nNotPos = 0;
// row_value_constructor not SQL_TOKEN_IN in_predicate_value
// row_value_constructor not SQL_TOKEN_BETWEEN row_value_constructor SQL_TOKEN_AND row_value_constructor
if ( SQL_ISRULE( pSearchCondition, in_predicate )
|| SQL_ISRULE( pSearchCondition, between_predicate )
)
if ( SQL_ISRULE( pSearchCondition, test_for_null ) )
nNotPos = 1;
// row_value_constructor SQL_TOKEN_IS not SQL_TOKEN_NULL
// boolean_primary SQL_TOKEN_IS not truth_value
else if ( SQL_ISRULE( pSearchCondition, test_for_null )
|| SQL_ISRULE( pSearchCondition, boolean_test )
)
else if ( SQL_ISRULE( pSearchCondition, boolean_test ) )
nNotPos = 2;
OSQLParseNode* pNot = pSearchCondition->getChild(nNotPos);
OSQLParseNode* pNot = pPart2->getChild(nNotPos);
OSQLParseNode* pNotNot = NULL;
if(pNot->isRule())
pNotNot = new OSQLParseNode(::rtl::OUString::createFromAscii("NOT"),SQL_NODE_KEYWORD,SQL_TOKEN_NOT);
else
pNotNot = new OSQLParseNode(::rtl::OUString(),SQL_NODE_RULE,OSQLParser::RuleID(OSQLParseNode::sql_not));
pSearchCondition->replace(pNot, pNotNot);
pPart2->replace(pNot, pNotNot);
delete pNot;
}
else if(bNegate && (SQL_ISRULE(pSearchCondition,like_predicate)))
{
OSQLParseNode* pCheckForNOT = pSearchCondition->getChild( 1 );
if ( SQL_ISTOKEN(pCheckForNOT,NOT) )
delete pSearchCondition->removeAt( 1 );
OSQLParseNode* pNot = pSearchCondition->getChild( 1 )->getChild( 0 );
OSQLParseNode* pNotNot = NULL;
if(pNot->isRule())
pNotNot = new OSQLParseNode(::rtl::OUString::createFromAscii("NOT"),SQL_NODE_KEYWORD,SQL_TOKEN_NOT);
else
{
OSQLParseNode* pNot = new OSQLParseNode( ::rtl::OUString::createFromAscii( "NOT" ), SQL_NODE_KEYWORD, SQL_TOKEN_NOT );
pSearchCondition->insert( 1, pNot );
}
pNotNot = new OSQLParseNode(::rtl::OUString(),SQL_NODE_RULE,OSQLParser::RuleID(OSQLParseNode::sql_not));
pSearchCondition->getChild( 1 )->replace(pNot, pNotNot);
delete pNot;
}
}
//-----------------------------------------------------------------------------
@ -2554,7 +2555,6 @@ sal_Int32 OSQLParser::getFunctionReturnType(const ::rtl::OUString& _sFunctionNam
else if(sFunctionName.equalsIgnoreAsciiCase(TokenIDToStr(SQL_TOKEN_BIT_LENGTH,pContext))) nType = DataType::INTEGER;
else if(sFunctionName.equalsIgnoreAsciiCase(TokenIDToStr(SQL_TOKEN_CHAR,pContext))) nType = DataType::VARCHAR;
else if(sFunctionName.equalsIgnoreAsciiCase(TokenIDToStr(SQL_TOKEN_CHAR_LENGTH,pContext))) nType = DataType::INTEGER;
else if(sFunctionName.equalsIgnoreAsciiCase(TokenIDToStr(SQL_TOKEN_CHARACTER_LENGTH,pContext))) nType = DataType::INTEGER;
else if(sFunctionName.equalsIgnoreAsciiCase(TokenIDToStr(SQL_TOKEN_CONCAT,pContext))) nType = DataType::VARCHAR;
else if(sFunctionName.equalsIgnoreAsciiCase(TokenIDToStr(SQL_TOKEN_DIFFERENCE,pContext))) nType = DataType::VARCHAR;
else if(sFunctionName.equalsIgnoreAsciiCase(TokenIDToStr(SQL_TOKEN_INSERT,pContext))) nType = DataType::VARCHAR;

View File

@ -89,6 +89,7 @@ OColumn::OColumn(sal_Bool _bCase)
OColumn::OColumn( const ::rtl::OUString& _Name,
const ::rtl::OUString& _TypeName,
const ::rtl::OUString& _DefaultValue,
const ::rtl::OUString& _Description,
sal_Int32 _IsNullable,
sal_Int32 _Precision,
sal_Int32 _Scale,
@ -100,6 +101,7 @@ OColumn::OColumn( const ::rtl::OUString& _Name,
:OColumnDescriptor_BASE(m_aMutex)
,ODescriptor(OColumnDescriptor_BASE::rBHelper,_bCase)
,m_TypeName(_TypeName)
,m_Description(_Description)
,m_DefaultValue(_DefaultValue)
,m_IsNullable(_IsNullable)
,m_Precision(_Precision)
@ -195,6 +197,7 @@ Reference< XPropertySet > SAL_CALL OColumn::createDataDescriptor( ) throw(Runti
OColumn* pNewColumn = new OColumn( m_Name,
m_TypeName,
m_DefaultValue,
m_Description,
m_IsNullable,
m_Precision,
m_Scale,
@ -203,7 +206,6 @@ Reference< XPropertySet > SAL_CALL OColumn::createDataDescriptor( ) throw(Runti
m_IsRowVersion,
m_IsCurrency,
isCaseSensitive());
pNewColumn->m_Description = m_Description;
pNewColumn->setNew(sal_True);
return pNewColumn;
}

View File

@ -85,6 +85,7 @@ OIndexColumn::OIndexColumn( sal_Bool _IsAscending,
) : OColumn(_Name,
_TypeName,
_DefaultValue,
::rtl::OUString(),
_IsNullable,
_Precision,
_Scale,

View File

@ -85,6 +85,7 @@ OKeyColumn::OKeyColumn( const ::rtl::OUString& _ReferencedColumn,
) : OColumn(_Name,
_TypeName,
_DefaultValue,
::rtl::OUString(),
_IsNullable,
_Precision,
_Scale,

View File

@ -67,14 +67,14 @@ static Reference< XInterface > SAL_CALL createInstance(
if (bVistaOrNewer)
{
fprintf(stdout, "use special (vista) system file picker ...\n");
OSL_TRACE("use special (vista) system file picker ...");
xDlg.set(
static_cast< XFilePicker2* >(
new ::fpicker::win32::vista::VistaFilePicker( rServiceManager ) ) );
}
else
{
fprintf(stdout, "use normal system file picker ...\n");
OSL_TRACE("use normal system file picker ...");
xDlg.set(
static_cast< XFilePicker2* >(
new CFilePicker( rServiceManager ) ) );

View File

@ -125,14 +125,14 @@ STDMETHODIMP VistaFilePickerEventHandler::OnFileOk(IFileDialog* /*pDialog*/)
}
//-----------------------------------------------------------------------------------------
STDMETHODIMP VistaFilePickerEventHandler::OnFolderChanging(IFileDialog* pDialog,
IShellItem* pFolder)
STDMETHODIMP VistaFilePickerEventHandler::OnFolderChanging(IFileDialog* /*pDialog*/,
IShellItem* /*pFolder*/)
{
return E_NOTIMPL;
}
//-----------------------------------------------------------------------------------------
STDMETHODIMP VistaFilePickerEventHandler::OnFolderChange(IFileDialog* pDialog)
STDMETHODIMP VistaFilePickerEventHandler::OnFolderChange(IFileDialog* /*pDialog*/)
{
impl_sendEvent(E_DIRECTORY_CHANGED, 0);
return S_OK;
@ -250,7 +250,7 @@ void lcl_updateVersionListDirectly(IFileDialog* pDialog)
}
//-----------------------------------------------------------------------------------------
STDMETHODIMP VistaFilePickerEventHandler::OnSelectionChange(IFileDialog* pDialog)
STDMETHODIMP VistaFilePickerEventHandler::OnSelectionChange(IFileDialog* /*pDialog*/)
{
impl_sendEvent(E_FILE_SELECTION_CHANGED, 0);
//lcl_updateVersionListDirectly(pDialog);
@ -258,16 +258,16 @@ STDMETHODIMP VistaFilePickerEventHandler::OnSelectionChange(IFileDialog* pDialog
}
//-----------------------------------------------------------------------------------------
STDMETHODIMP VistaFilePickerEventHandler::OnShareViolation(IFileDialog* pDialog ,
IShellItem* pItem ,
FDE_SHAREVIOLATION_RESPONSE* pResponse)
STDMETHODIMP VistaFilePickerEventHandler::OnShareViolation(IFileDialog* /*pDialog*/ ,
IShellItem* /*pItem*/ ,
FDE_SHAREVIOLATION_RESPONSE* /*pResponse*/)
{
impl_sendEvent(E_CONTROL_STATE_CHANGED, css::ui::dialogs::CommonFilePickerElementIds::LISTBOX_FILTER);
return S_OK;
}
//-----------------------------------------------------------------------------------------
STDMETHODIMP VistaFilePickerEventHandler::OnTypeChange(IFileDialog* pDialog)
STDMETHODIMP VistaFilePickerEventHandler::OnTypeChange(IFileDialog* /*pDialog*/)
{
/*
IFileDialogCustomize *iCustomize;
@ -299,32 +299,32 @@ STDMETHODIMP VistaFilePickerEventHandler::OnTypeChange(IFileDialog* pDialog)
}
//-----------------------------------------------------------------------------------------
STDMETHODIMP VistaFilePickerEventHandler::OnOverwrite(IFileDialog* pDialog ,
IShellItem* pItem ,
FDE_OVERWRITE_RESPONSE* pResponse)
STDMETHODIMP VistaFilePickerEventHandler::OnOverwrite(IFileDialog* /*pDialog*/ ,
IShellItem* /*pItem*/ ,
FDE_OVERWRITE_RESPONSE* /*pResponse*/)
{
return E_NOTIMPL;
}
//-----------------------------------------------------------------------------------------
STDMETHODIMP VistaFilePickerEventHandler::OnItemSelected(IFileDialogCustomize* pCustomize,
DWORD nIDCtl ,
DWORD nIDItem )
STDMETHODIMP VistaFilePickerEventHandler::OnItemSelected(IFileDialogCustomize* /*pCustomize*/,
DWORD nIDCtl ,
DWORD /*nIDItem*/ )
{
impl_sendEvent(E_CONTROL_STATE_CHANGED, nIDCtl);
impl_sendEvent(E_CONTROL_STATE_CHANGED, sal_Int16(nIDCtl));
return S_OK;
}
//-----------------------------------------------------------------------------------------
STDMETHODIMP VistaFilePickerEventHandler::OnButtonClicked(IFileDialogCustomize* pCustomize,
STDMETHODIMP VistaFilePickerEventHandler::OnButtonClicked(IFileDialogCustomize* /*pCustomize*/,
DWORD nIDCtl )
{
impl_sendEvent(E_CONTROL_STATE_CHANGED, nIDCtl);
impl_sendEvent(E_CONTROL_STATE_CHANGED, sal_Int16(nIDCtl));
return S_OK;
}
//-----------------------------------------------------------------------------------------
STDMETHODIMP VistaFilePickerEventHandler::OnCheckButtonToggled(IFileDialogCustomize* pCustomize,
STDMETHODIMP VistaFilePickerEventHandler::OnCheckButtonToggled(IFileDialogCustomize* /*pCustomize*/,
DWORD nIDCtl ,
BOOL bChecked )
{
@ -353,15 +353,15 @@ STDMETHODIMP VistaFilePickerEventHandler::OnCheckButtonToggled(IFileDialogCustom
if (nIDCtl == css::ui::dialogs::ExtendedFilePickerElementIds::CHECKBOX_AUTOEXTENSION)
m_pInternalNotify->onAutoExtensionChanged(bChecked);
impl_sendEvent(E_CONTROL_STATE_CHANGED, nIDCtl);
impl_sendEvent(E_CONTROL_STATE_CHANGED, sal_Int16(nIDCtl));
return S_OK;
}
//-----------------------------------------------------------------------------------------
STDMETHODIMP VistaFilePickerEventHandler::OnControlActivating(IFileDialogCustomize* pCustomize,
STDMETHODIMP VistaFilePickerEventHandler::OnControlActivating(IFileDialogCustomize* /*pCustomize*/,
DWORD nIDCtl )
{
impl_sendEvent(E_CONTROL_STATE_CHANGED, nIDCtl);
impl_sendEvent(E_CONTROL_STATE_CHANGED, sal_Int16(nIDCtl));
return S_OK;
}

View File

@ -23,6 +23,6 @@
<accel:item accel:code="KEY_F" accel:mod1="true" xlink:href=".uno:SearchDialog"/>
<accel:item accel:code="KEY_Q" accel:shift="true" accel:mod1="true" xlink:href=".uno:BasicBreak"/>
<accel:item accel:code="KEY_F4" xlink:href=".uno:ViewDataSourceBrowser"/>
<accel:item accel:code="KEY_F5" accel:mod1="true" xlink:href=".uno:GrabControlFocus"/>
<accel:item accel:code="KEY_F5" accel:mod1="true" xlink:href=".uno:ToggleControlFocus"/>
<accel:item accel:code="KEY_F7" accel:shift="true" accel:mod1="true" xlink:href=".uno:HangulHanjaConversion"/>
</accel:acceleratorlist>

View File

@ -23,6 +23,6 @@
<accel:item accel:code="KEY_F" accel:mod1="true" xlink:href=".uno:SearchDialog"/>
<accel:item accel:code="KEY_Q" accel:shift="true" accel:mod1="true" xlink:href=".uno:BasicBreak"/>
<accel:item accel:code="KEY_F4" xlink:href=".uno:ViewDataSourceBrowser"/>
<accel:item accel:code="KEY_F5" accel:mod1="true" xlink:href=".uno:GrabControlFocus"/>
<accel:item accel:code="KEY_F5" accel:mod1="true" xlink:href=".uno:ToggleControlFocus"/>
<accel:item accel:code="KEY_F7" accel:shift="true" accel:mod1="true" xlink:href=".uno:HangulHanjaConversion"/>
</accel:acceleratorlist>

View File

@ -67,7 +67,7 @@
</node>
<node oor:name="F5_MOD1" oor:op="replace">
<prop oor:name="Command"><value xml:lang="x-no-translate">I10N SHORTCUTS - NO TRANSLATE</value>
<value xml:lang="en-US">.uno:GrabControlFocus</value>
<value xml:lang="en-US">.uno:ToggleControlFocus</value>
</prop>
</node>
<node oor:name="F7_SHIFT_MOD1" oor:op="replace">
@ -212,7 +212,7 @@
</node>
<node oor:name="F5_MOD1" oor:op="replace">
<prop oor:name="Command"><value xml:lang="x-no-translate">I10N SHORTCUTS - NO TRANSLATE</value>
<value xml:lang="en-US">.uno:GrabControlFocus</value>
<value xml:lang="en-US">.uno:ToggleControlFocus</value>
</prop>
</node>
<node oor:name="F7_SHIFT_MOD1" oor:op="replace">

View File

@ -1277,7 +1277,7 @@
<value xml:lang="en-US">Can't Undo</value>
</prop>
</node>
<node oor:name=".uno:GrabControlFocus" oor:op="replace">
<node oor:name=".uno:ToggleControlFocus" oor:op="replace">
<prop oor:name="Label" oor:type="xs:string">
<value xml:lang="en-US">Control Focus</value>
</prop>

View File

@ -594,7 +594,7 @@
<value>GenericCategories</value>
</prop>
<prop oor:name="ooSetupFactoryUIName">
<value xml:lang="en-US">Base: Table Data View</value>
<value>Base: Table Data View</value>
</prop>
</node>
<node oor:name="com.sun.star.frame.Bibliography" oor:op="replace">
@ -616,7 +616,7 @@
<value >GenericCategories</value>
</prop>
<prop oor:name="ooSetupFactoryUIName">
<value xml:lang="en-US">Bibliography</value>
<value>Bibliography</value>
</prop>
</node>
<node oor:name="com.sun.star.script.BasicIDE" oor:op="replace">

View File

@ -60,6 +60,11 @@ namespace com { namespace sun { namespace star { namespace form {
}
} } } }
namespace svx
{
class ISdrObjectFilter;
}
//========================================================================
class SVX_DLLPUBLIC FmDesignModeChangedHint : public SfxHint
{
@ -146,11 +151,28 @@ public:
const OutputDevice& _rDevice,
::com::sun::star::uno::Reference< ::com::sun::star::awt::XControl >& _out_rxControl
) const;
::com::sun::star::uno::Reference< ::com::sun::star::form::runtime::XFormController > GetFormController(
const ::com::sun::star::uno::Reference< ::com::sun::star::form::XForm >& _rxForm,
const SdrView& _rView,
const OutputDevice& _rDevice
) const;
/** puts the focus into the document window, if current a form control has the focus. Otherwise, moves the focus
to the control belonging to the given SdrUnoObj.
*/
void ToggleControlFocus(
const SdrUnoObj& i_rNextCandidate,
const SdrView& i_rView,
OutputDevice& i_rDevice
) const;
::std::auto_ptr< ::svx::ISdrObjectFilter >
CreateFocusableControlFilter(
const SdrView& i_rView,
const OutputDevice& i_rDevice
) const;
sal_Bool IsDesignMode() const { return m_bDesignMode; }
void SetDesignMode( sal_Bool _bDesignMode );

View File

@ -76,6 +76,7 @@
#include <comphelper/uno3.hxx>
#include <comphelper/stl_types.hxx>
#include <cppuhelper/implbase1.hxx>
#include <svl/svstdarr.hxx>
#include <set>

View File

@ -29,6 +29,8 @@
#include <tools/list.hxx>
#include <com/sun/star/sdbc/XRowSet.hpp>
#include <com/sun/star/sdbc/XRowSetListener.hpp>
#include <com/sun/star/sdb/XRowsChangeListener.hpp>
#include <com/sun/star/beans/PropertyChangeEvent.hpp>
#include <com/sun/star/util/XNumberFormatter.hpp>
#include <com/sun/star/util/Date.hpp>
@ -247,6 +249,8 @@ private:
// For that reason we have to listen to some properties of our data source.
::comphelper::OPropertyChangeMultiplexer* m_pDataSourcePropMultiplexer;
FmXGridSourcePropListener* m_pDataSourcePropListener;
::com::sun::star::uno::Reference< ::com::sun::star::sdb::XRowsChangeListener>
m_xRowSetListener; // get notification when rows were changed
void* m_pFieldListeners;
// property listeners for field values
@ -523,15 +527,20 @@ public:
void setGridListener( FmGridListener* _pListener ) { m_pGridListener = _pListener; }
// helper class to grant access to selected methods from within the DbCellControl class
struct GrantCellControlAccess
struct GrantControlAccess
{
friend class DbCellControl;
friend class RowSetEventListener;
protected:
GrantCellControlAccess() { }
GrantControlAccess() { }
};
/// called when a controller needs to be re-initialized
void refreshController(sal_uInt16 _nColId, GrantCellControlAccess _aAccess);
void refreshController(sal_uInt16 _nColId, GrantControlAccess _aAccess);
CursorWrapper* GetSeekCursor(GrantControlAccess /*_aAccess*/) const { return m_pSeekCursor; }
const DbGridRowRef& GetSeekRow(GrantControlAccess /*_aAccess*/) const { return m_xSeekRow; }
void SetSeekPos(sal_Int32 nPos,GrantControlAccess /*_aAccess*/) {m_nSeekPos = nPos;}
/**
@return
@ -586,6 +595,7 @@ protected:
const DbGridRowRef& GetPaintRow() const { return m_xPaintRow; }
CursorWrapper* GetSeekCursor() const { return m_pSeekCursor; }
void ConnectToFields();
void DisconnectFromFields();

View File

@ -0,0 +1,58 @@
/*************************************************************************
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* Copyright 2009 by Sun Microsystems, Inc.
*
* OpenOffice.org - a multi-platform office productivity suite
*
* 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 SDROBJECTFILTER_HXX
#define SDROBJECTFILTER_HXX
#include "svx/svxdllapi.h"
/** === begin UNO includes === **/
/** === end UNO includes === **/
class SdrObject;
//........................................................................
namespace svx
{
//........................................................................
//====================================================================
//= SdrObjectFilter
//====================================================================
/** specifies a boolean predicate on the set of all SdrObjects - vulgo a filter.
*/
class SVX_DLLPUBLIC SAL_NO_VTABLE ISdrObjectFilter
{
public:
virtual bool includeObject( const SdrObject& i_rObject ) const = 0;
virtual ~ISdrObjectFilter() = 0;
};
//........................................................................
} // namespace svx
//........................................................................
#endif // SDROBJECTFILTER_HXX

View File

@ -1026,7 +1026,7 @@
#define SID_DSBROWSER_EXPLORER ( SID_SVX_START + 764 )
#define SID_FM_CREATE_FIELDCONTROL ( SID_SVX_START + 765 )
#define SID_FM_DATACCESS_DESCRIPTOR ( SID_SVX_START + 766 )
#define SID_FM_GRABCONTROLFOCUS ( SID_SVX_START + 767 )
#define SID_FM_TOGGLECONTROLFOCUS ( SID_SVX_START + 767 )
#define SID_FM_SCROLLBAR ( SID_SVX_START + 768 )
#define SID_FM_SPINBUTTON ( SID_SVX_START + 769 )
#define SID_FM_CONVERTTO_SCROLLBAR ( SID_SVX_START + 770 )

View File

@ -577,6 +577,7 @@ mkdir: %_DEST%\inc%_EXT%\svx
..\inc\svx\databaselocationinput.hxx %_DEST%\inc%_EXT%\svx\databaselocationinput.hxx
..\inc\svx\dbcharsethelper.hxx %_DEST%\inc%_EXT%\svx\dbcharsethelper.hxx
..\inc\svx\dbtoolsclient.hxx %_DEST%\inc%_EXT%\svx\dbtoolsclient.hxx
..\inc\svx\sdrobjectfilter.hxx %_DEST%\inc%_EXT%\svx\sdrobjectfilter.hxx
..\inc\svx\subtoolboxcontrol.hxx %_DEST%\inc%_EXT%\svx\subtoolboxcontrol.hxx
..\inc\svx\svdtext.hxx %_DEST%\inc%_EXT%\svx\svdtext.hxx

View File

@ -657,7 +657,7 @@ shell FmFormShell
[
ExecMethod = Execute ;
]
SID_FM_GRABCONTROLFOCUS
SID_FM_TOGGLECONTROLFOCUS
[
ExecMethod = Execute ;
]

View File

@ -11700,7 +11700,7 @@ SfxVoidItem ZoomVisArea SID_SIZE_VISAREA
]
//--------------------------------------------------------------------------
SfxVoidItem GrabControlFocus SID_FM_GRABCONTROLFOCUS
SfxVoidItem ToggleControlFocus SID_FM_TOGGLECONTROLFOCUS
()
[
/* flags: */

View File

@ -135,30 +135,19 @@ namespace svx
{
try
{
// need a query composer for this
Reference< XSQLQueryComposerFactory > xComposerFac;
_rxForm->getPropertyValue(FM_PROP_ACTIVE_CONNECTION) >>= xComposerFac;
Reference< XSQLQueryComposer > xComposer;
if (xComposerFac.is())
xComposer = xComposerFac->createQueryComposer();
Reference< XTablesSupplier > xSupTab;
_rxForm->getPropertyValue(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SingleSelectQueryComposer"))) >>= xSupTab;
if (xComposer.is())
if(xSupTab.is())
{
::rtl::OUString sActiveCommand;
_rxForm->getPropertyValue(FM_PROP_ACTIVECOMMAND) >>= sActiveCommand;
xComposer->setQuery(sActiveCommand);
Reference< XTablesSupplier > xSupTab(xComposer, UNO_QUERY);
if(xSupTab.is())
Reference< XNameAccess > xNames = xSupTab->getTables();
if (xNames.is())
{
Reference< XNameAccess > xNames = xSupTab->getTables();
if (xNames.is())
Sequence< ::rtl::OUString > aTables = xNames->getElementNames();
if (1 == aTables.getLength())
{
Sequence< ::rtl::OUString > aTables = xNames->getElementNames();
if (1 == aTables.getLength())
{
sCommand = aTables[0];
nCommandType = CommandType::TABLE;
}
sCommand = aTables[0];
nCommandType = CommandType::TABLE;
}
}
}
@ -457,34 +446,10 @@ namespace svx
String sObjectKind = (CommandType::TABLE == nObjectType) ? String('1') : String('0');
// check if the SQL-statement is modified
sal_Bool bHasFilterOrSort(sal_False);
::rtl::OUString sCompleteStatement;
try
{
::rtl::OUString sFilter, sSort;
if (::cppu::any2bool(_rxLivingForm->getPropertyValue(FM_PROP_APPLYFILTER)))
_rxLivingForm->getPropertyValue(FM_PROP_FILTER) >>= sFilter;
_rxLivingForm->getPropertyValue(FM_PROP_SORT) >>= sSort;
bHasFilterOrSort = (sFilter.getLength()>0) || (sSort.getLength()>0);
_rxLivingForm->getPropertyValue(FM_PROP_ACTIVECOMMAND) >>= sCompleteStatement;
// create a composer
Reference< XSQLQueryComposerFactory > xFactory( xConnection, UNO_QUERY );
Reference< XSQLQueryComposer > xComposer;
if (xFactory.is())
xComposer = xFactory->createQueryComposer();
// let the composer compose
if (xComposer.is())
{
xComposer->setQuery(sCompleteStatement);
xComposer->setFilter(sFilter);
xComposer->setOrder(sSort);
sCompleteStatement = xComposer->getComposedQuery();
}
// Usually, I would expect the result of the composing to be the same as the ActiveCommand property
// But this code here is pretty old, and I don't know wha the side effects are if I remove it now ...
}
catch(Exception&)
{
@ -496,7 +461,7 @@ namespace svx
,sConnectionResource
,nObjectType
,sObjectName,xConnection
,!((CommandType::QUERY == nObjectType) && !bHasFilterOrSort)
,!((CommandType::QUERY == nObjectType))
,sCompleteStatement);
}

View File

@ -210,10 +210,11 @@ void FmGridHeader::RequestHelp( const HelpEvent& rHEvt )
Reference< ::com::sun::star::container::XIndexContainer > xColumns(static_cast<FmGridControl*>(GetParent())->GetPeer()->getColumns());
try
{
Reference< ::com::sun::star::beans::XPropertySet > xColumn;
::cppu::extractInterface(xColumn, xColumns->getByIndex(nPos));
Reference< ::com::sun::star::beans::XPropertySet > xColumn(xColumns->getByIndex(nPos),UNO_QUERY);
::rtl::OUString aHelpText;
xColumn->getPropertyValue(FM_PROP_HELPTEXT) >>= aHelpText;
if ( !aHelpText.getLength() )
xColumn->getPropertyValue(FM_PROP_DESCRIPTION) >>= aHelpText;
if ( aHelpText.getLength() )
{
if ( rHEvt.GetMode() & HELPMODE_BALLOON )
@ -1737,11 +1738,12 @@ void FmGridControl::InitColumnByField(
_pColumn->SetObject( (sal_Int16)nFieldPos );
return;
}
/*
// handle readonly columns
sal_Bool bReadOnly = sal_True;
xField->getPropertyValue( FM_PROP_ISREADONLY ) >>= bReadOnly;
_pColumn->SetReadOnly( bReadOnly );
*/
}
// the control type is determined by the ColumnServiceName
@ -1999,7 +2001,11 @@ namespace
{
Reference<XPropertySet> xProp(GetPeer()->getColumns(),UNO_QUERY);
if ( xProp.is() )
{
xProp->getPropertyValue(FM_PROP_HELPTEXT) >>= sRetText;
if ( !sRetText.getLength() )
xProp->getPropertyValue(FM_PROP_DESCRIPTION) >>= sRetText;
}
}
break;
case ::svt::BBTYPE_COLUMNHEADERCELL:
@ -2008,6 +2014,13 @@ namespace
GetModelColumnPos(
sal::static_int_cast< sal_uInt16 >(_nPosition)),
FM_PROP_HELPTEXT);
if ( !sRetText.getLength() )
sRetText = getColumnPropertyFromPeer(
GetPeer(),
GetModelColumnPos(
sal::static_int_cast< sal_uInt16 >(_nPosition)),
FM_PROP_DESCRIPTION);
break;
default:
sRetText = DbGridControl::GetAccessibleObjectDescription(_eObjType,_nPosition);
@ -2029,7 +2042,7 @@ void FmGridControl::Select()
// die HandleColumn wird nicht selektiert
switch (nSelectedColumn)
{
case -1 : break; // no selection
case SAL_MAX_UINT16: break; // no selection
case 0 : nSelectedColumn = SAL_MAX_UINT16; break;
// handle col can't be seledted
default :

View File

@ -45,6 +45,8 @@
#include <com/sun/star/form/XBoundComponent.hpp>
#include <com/sun/star/script/XEventAttacherManager.hpp>
#include <com/sun/star/sdb/XSQLQueryComposerFactory.hpp>
#include <com/sun/star/sdbcx/XTablesSupplier.hpp>
#include <com/sun/star/sdbcx/XColumnsSupplier.hpp>
#include <com/sun/star/sdbc/ColumnValue.hpp>
#include <com/sun/star/sdbc/DataType.hpp>
#include <com/sun/star/sdbc/XStatement.hpp>
@ -82,6 +84,7 @@ using namespace ::svt;
using namespace ::com::sun::star;
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::sdbc;
using namespace ::com::sun::star::sdbcx;
using namespace ::com::sun::star::sdb;
using namespace ::com::sun::star::beans;
using namespace ::com::sun::star::form;
@ -551,6 +554,7 @@ TYPEINIT1( DbFilterField, DbCellControl )
//------------------------------------------------------------------------------
DbCellControl::DbCellControl( DbGridColumn& _rColumn, sal_Bool /*_bText*/ )
:OPropertyChangeListener(m_aMutex)
,m_pFieldChangeBroadcaster(NULL)
,m_bTransparent( sal_False )
,m_bAlignedController( sal_True )
,m_bAccessingValueProperty( sal_False )
@ -574,6 +578,31 @@ DbCellControl::DbCellControl( DbGridColumn& _rColumn, sal_Bool /*_bText*/ )
implDoPropertyListening( FM_PROP_STATE, sal_False );
implDoPropertyListening( FM_PROP_TEXT, sal_False );
implDoPropertyListening( FM_PROP_EFFECTIVE_VALUE, sal_False );
// be listener at the bound field as well
try
{
Reference< XPropertySet > xColModelProps( m_rColumn.getModel(), UNO_QUERY );
Reference< XPropertySetInfo > xPSI;
if ( xColModelProps.is() )
xPSI = xColModelProps->getPropertySetInfo();
if ( xPSI.is() && xPSI->hasPropertyByName( FM_PROP_BOUNDFIELD ) )
{
Reference< XPropertySet > xField;
xColModelProps->getPropertyValue( FM_PROP_BOUNDFIELD ) >>= xField;
if ( xField.is() )
{
m_pFieldChangeBroadcaster = new ::comphelper::OPropertyChangeMultiplexer(this, xField);
m_pFieldChangeBroadcaster->acquire();
m_pFieldChangeBroadcaster->addProperty( FM_PROP_ISREADONLY );
}
}
}
catch( const Exception& )
{
DBG_ERROR( "DbCellControl::doPropertyListening: caught an exception!" );
}
}
}
@ -605,17 +634,22 @@ void DbCellControl::doPropertyListening( const ::rtl::OUString& _rPropertyName )
{
implDoPropertyListening( _rPropertyName );
}
//------------------------------------------------------------------------------
void lcl_clearBroadCaster(::comphelper::OPropertyChangeMultiplexer*& _pBroadcaster)
{
if ( _pBroadcaster )
{
_pBroadcaster->dispose();
_pBroadcaster->release();
_pBroadcaster = NULL;
// no delete, this is done implicitly
}
}
//------------------------------------------------------------------------------
DbCellControl::~DbCellControl()
{
if ( m_pModelChangeBroadcaster )
{
m_pModelChangeBroadcaster->dispose();
m_pModelChangeBroadcaster->release();
m_pModelChangeBroadcaster = NULL;
// no delete, this is done implicitly
}
lcl_clearBroadCaster(m_pModelChangeBroadcaster);
lcl_clearBroadCaster(m_pFieldChangeBroadcaster);
delete m_pWindow;
delete m_pPainter;
@ -660,7 +694,14 @@ void DbCellControl::_propertyChanged(const PropertyChangeEvent& _rEvent) throw(R
}
else if ( _rEvent.PropertyName.equals( FM_PROP_READONLY ) )
{
implAdjustReadOnly( xSourceProps );
implAdjustReadOnly( xSourceProps, true);
}
else if ( _rEvent.PropertyName.equals( FM_PROP_ISREADONLY ) )
{
sal_Bool bReadOnly = sal_True;
_rEvent.NewValue >>= bReadOnly;
m_rColumn.SetReadOnly(bReadOnly);
implAdjustReadOnly( xSourceProps, false);
}
else if ( _rEvent.PropertyName.equals( FM_PROP_ENABLED ) )
{
@ -798,7 +839,7 @@ void DbCellControl::ImplInitWindow( Window& rParent, const InitWindowFacet _eIni
}
//------------------------------------------------------------------------------
void DbCellControl::implAdjustReadOnly( const Reference< XPropertySet >& _rxModel )
void DbCellControl::implAdjustReadOnly( const Reference< XPropertySet >& _rxModel,bool i_bReadOnly )
{
DBG_ASSERT( m_pWindow, "DbCellControl::implAdjustReadOnly: not to be called without window!" );
DBG_ASSERT( _rxModel.is(), "DbCellControl::implAdjustReadOnly: invalid model!" );
@ -807,9 +848,12 @@ void DbCellControl::implAdjustReadOnly( const Reference< XPropertySet >& _rxMode
Edit* pEditWindow = dynamic_cast< Edit* >( m_pWindow );
if ( pEditWindow )
{
sal_Bool bReadOnly = sal_True;
_rxModel->getPropertyValue( FM_PROP_READONLY ) >>= bReadOnly;
static_cast< Edit* >( m_pWindow )->SetReadOnly( m_rColumn.IsReadOnly() || bReadOnly );
sal_Bool bReadOnly = m_rColumn.IsReadOnly();
if ( !bReadOnly )
{
_rxModel->getPropertyValue( i_bReadOnly ? FM_PROP_READONLY : FM_PROP_ISREADONLY) >>= bReadOnly;
}
static_cast< Edit* >( m_pWindow )->SetReadOnly( bReadOnly );
}
}
}
@ -846,7 +890,7 @@ void DbCellControl::Init( Window& rParent, const Reference< XRowSet >& _rxCursor
if ( xModelPSI->hasPropertyByName( FM_PROP_READONLY ) )
{
implAdjustReadOnly( xModel );
implAdjustReadOnly( xModel,true );
}
if ( xModelPSI->hasPropertyByName( FM_PROP_ENABLED ) )
@ -1003,7 +1047,7 @@ double DbCellControl::GetValue(const Reference< ::com::sun::star::sdb::XColumn >
//------------------------------------------------------------------------------
void DbCellControl::invalidatedController()
{
m_rColumn.GetParent().refreshController(m_rColumn.GetId(), DbGridControl::GrantCellControlAccess());
m_rColumn.GetParent().refreshController(m_rColumn.GetId(), DbGridControl::GrantControlAccess());
}
/*************************************************************************/
@ -3039,43 +3083,22 @@ void DbFilterField::Update()
if (!xForm.is())
return;
Reference<XPropertySet> xFormProp(xForm,UNO_QUERY);
Reference< XTablesSupplier > xSupTab;
xFormProp->getPropertyValue(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SingleSelectQueryComposer"))) >>= xSupTab;
Reference< XConnection > xConnection(getRowSetConnection(xForm));
if (!xConnection.is())
return;
Reference< ::com::sun::star::sdb::XSQLQueryComposerFactory > xFactory(xConnection, UNO_QUERY);
if (!xFactory.is())
{
DBG_ERROR("DbFilterField::Update : used the right place to request the ::com::sun::star::sdb::XSQLQueryComposerFactory interface ?");
return;
}
Reference< ::com::sun::star::sdb::XSQLQueryComposer > xComposer = xFactory->createQueryComposer();
try
{
Reference< ::com::sun::star::beans::XPropertySet > xFormAsSet(xForm, UNO_QUERY);
::rtl::OUString sStatement;
xFormAsSet->getPropertyValue(FM_PROP_ACTIVECOMMAND) >>= sStatement;
xComposer->setQuery(sStatement);
}
catch(const Exception&)
{
::comphelper::disposeComponent(xComposer);
return;
}
Reference< ::com::sun::star::beans::XPropertySet > xComposerAsSet(xComposer, UNO_QUERY);
if (!xComposerAsSet.is())
if (!xSupTab.is())
return;
// search the field
Reference< ::com::sun::star::container::XNameAccess > xFieldNames;
Reference< ::com::sun::star::container::XNameAccess > xTablesNames;
Reference< ::com::sun::star::beans::XPropertySet > xComposerFieldAsSet;
Reference< XColumnsSupplier > xSupCol(xSupTab,UNO_QUERY);
Reference< ::com::sun::star::container::XNameAccess > xFieldNames = xSupCol->getColumns();
if (!xFieldNames->hasByName(aName))
return;
::cppu::extractInterface(xFieldNames, xComposerAsSet->getPropertyValue(FM_PROP_SELECTED_FIELDS));
::cppu::extractInterface(xTablesNames, xComposerAsSet->getPropertyValue(FM_PROP_SELECTED_TABLES));
::cppu::extractInterface(xComposerFieldAsSet, xFieldNames->getByName(aName));
Reference< ::com::sun::star::container::XNameAccess > xTablesNames = xSupTab->getTables();
Reference< ::com::sun::star::beans::XPropertySet > xComposerFieldAsSet(xFieldNames->getByName(aName),UNO_QUERY);
if (xComposerFieldAsSet.is() && ::comphelper::hasProperty(FM_PROP_TABLENAME, xComposerFieldAsSet) &&
::comphelper::hasProperty(FM_PROP_FIELDSOURCE, xComposerFieldAsSet))

View File

@ -44,6 +44,8 @@
#include <com/sun/star/sdbc/ResultSetConcurrency.hpp>
#include <com/sun/star/accessibility/XAccessible.hpp>
#include <com/sun/star/sdb/XResultSetAccess.hpp>
#include <com/sun/star/sdb/RowChangeAction.hpp>
#include <com/sun/star/sdb/XRowsChangeBroadcaster.hpp>
#include <com/sun/star/sdbc/XResultSetUpdate.hpp>
#include <com/sun/star/sdbcx/Privilege.hpp>
#include <com/sun/star/container/XChild.hpp>
@ -102,6 +104,39 @@ using namespace com::sun::star::accessibility;
| BROWSER_VLINESFULL \
| BROWSER_HEADERBAR_NEW \
class RowSetEventListener : public ::cppu::WeakImplHelper1<XRowsChangeListener>
{
DbGridControl* m_pControl;
public:
RowSetEventListener(DbGridControl* i_pControl) : m_pControl(i_pControl)
{
}
private:
// XEventListener
virtual void SAL_CALL disposing(const ::com::sun::star::lang::EventObject& /*i_aEvt*/)
{
}
virtual void SAL_CALL rowsChanged(const ::com::sun::star::sdb::RowsChangeEvent& i_aEvt)
{
if ( i_aEvt.Action == RowChangeAction::UPDATE )
{
::DbGridControl::GrantControlAccess aAccess;
CursorWrapper* pSeek = m_pControl->GetSeekCursor(aAccess);
const DbGridRowRef& rSeekRow = m_pControl->GetSeekRow(aAccess);
const Any* pIter = i_aEvt.Bookmarks.getConstArray();
const Any* pEnd = pIter + i_aEvt.Bookmarks.getLength();
for(;pIter != pEnd;++pIter)
{
pSeek->moveToBookmark(*pIter);
// get the data
rSeekRow->SetState(pSeek, sal_True);
sal_Int32 nSeekPos = pSeek->getRow() - 1;
m_pControl->SetSeekPos(nSeekPos,aAccess);
m_pControl->RowModified(nSeekPos);
}
}
}
};
//==============================================================================
class GridFieldValueListener;
@ -987,6 +1022,7 @@ DbGridControl::~DbGridControl()
m_pDataSourcePropMultiplexer = NULL;
m_pDataSourcePropListener = NULL;
}
m_xRowSetListener.clear();
delete m_pDataCursor;
delete m_pSeekCursor;
@ -1377,7 +1413,7 @@ sal_Bool DbGridControl::IsPermanentCursorEnabled() const
}
//------------------------------------------------------------------------------
void DbGridControl::refreshController(sal_uInt16 _nColId, GrantCellControlAccess /*_aAccess*/)
void DbGridControl::refreshController(sal_uInt16 _nColId, GrantControlAccess /*_aAccess*/)
{
if ((GetCurColumnId() == _nColId) && IsEditing())
{ // the controller which is currently active needs to be refreshed
@ -1412,6 +1448,7 @@ void DbGridControl::setDataSource(const Reference< XRowSet >& _xCursor, sal_uInt
m_pDataSourcePropMultiplexer = NULL;
m_pDataSourcePropListener = NULL;
}
m_xRowSetListener.clear();
// is the new cursor valid ?
// the cursor is only valid if it contains some columns
@ -1503,7 +1540,7 @@ void DbGridControl::setDataSource(const Reference< XRowSet >& _xCursor, sal_uInt
Reference< XPropertySet > xSet(_xCursor, UNO_QUERY);
if (xSet.is())
{
// feststellen welche Updatem<EFBFBD>glichkeiten bestehen
// feststellen welche Updatemoeglichkeiten bestehen
sal_Int32 nConcurrency = ResultSetConcurrency::READ_ONLY;
xSet->getPropertyValue(FM_PROP_RESULTSET_CONCURRENCY) >>= nConcurrency;
@ -1565,6 +1602,12 @@ void DbGridControl::setDataSource(const Reference< XRowSet >& _xCursor, sal_uInt
xSet->getPropertyValue(FM_PROP_ROWCOUNT) >>= nRecordCount;
m_bRecordCountFinal = ::comphelper::getBOOL(xSet->getPropertyValue(FM_PROP_ROWCOUNTFINAL));
m_xRowSetListener = new RowSetEventListener(this);
Reference< XRowsChangeBroadcaster> xChangeBroad(xSet,UNO_QUERY);
if ( xChangeBroad.is( ) )
xChangeBroad->addRowsChangeListener(m_xRowSetListener);
// insert the currently known rows
// and one row if we are able to insert rows
if (m_nOptions & OPT_INSERT)

View File

@ -78,6 +78,7 @@
#include <svx/fmglob.hxx>
#include <svl/eitem.hxx>
#include <tools/shl.hxx>
#include <tools/diagnose_ex.h>
#include <svx/svdpage.hxx>
#include <svx/fmmodel.hxx>
#include <svx/dialmgr.hxx>
@ -98,6 +99,8 @@
#include <svx/svxdlg.hxx> //CHINA001
#include <svx/dialogs.hrc> //CHINA001
#include "svx/sdrobjectfilter.hxx"
#define HANDLE_SQL_ERRORS( action, successflag, context, message ) \
try \
{ \
@ -544,7 +547,7 @@ void FmFormShell::Execute(SfxRequest &rReq)
case SID_FM_SCROLLBAR:
case SID_FM_SPINBUTTON:
{
SFX_REQUEST_ARG( rReq, pGrabFocusItem, SfxBoolItem, SID_FM_GRABCONTROLFOCUS, sal_False );
SFX_REQUEST_ARG( rReq, pGrabFocusItem, SfxBoolItem, SID_FM_TOGGLECONTROLFOCUS, sal_False );
if ( pGrabFocusItem && pGrabFocusItem->GetValue() )
{ // see below
SfxViewShell* pShell = GetViewShell();
@ -572,9 +575,9 @@ void FmFormShell::Execute(SfxRequest &rReq)
{
// #99013# if selected with control key, return focus to current view
// do this asynchron, so that the creation can be finished first
// reusing the SID_FM_GRABCONTROLFOCUS is somewhat hacky ... which it wouldn't if it would have another
// reusing the SID_FM_TOGGLECONTROLFOCUS is somewhat hacky ... which it wouldn't if it would have another
// name, so I do not really have a big problem with this ....
SfxBoolItem aGrabFocusIndicatorItem( SID_FM_GRABCONTROLFOCUS, sal_True );
SfxBoolItem aGrabFocusIndicatorItem( SID_FM_TOGGLECONTROLFOCUS, sal_True );
GetViewShell()->GetViewFrame()->GetDispatcher()->Execute( nSlot, SFX_CALLMODE_ASYNCHRON,
&aGrabFocusIndicatorItem, NULL );
}
@ -595,11 +598,27 @@ void FmFormShell::Execute(SfxRequest &rReq)
}
break;
case SID_FM_GRABCONTROLFOCUS:
case SID_FM_TOGGLECONTROLFOCUS:
{
FmFormView* pFormView = GetFormView();
if ( pFormView )
if ( !pFormView )
break;
// if we execute this ourself, then either the application does not implement an own handling for this,
// of we're on the top of the dispatcher stack, which means a control has the focus.
// In the latter case, we put the focus to the document window, otherwise, we focus the first control
const bool bHasControlFocus = GetImpl()->HasControlFocus();
if ( bHasControlFocus )
{
const OutputDevice* pDevice = GetCurrentViewDevice();
Window* pWindow = dynamic_cast< Window* >( const_cast< OutputDevice* >( pDevice ) );
if ( pWindow )
pWindow->GrabFocus();
}
else
{
pFormView->GrabFirstControlFocus( );
}
}
break;
@ -1352,6 +1371,78 @@ namespace
}
}
//------------------------------------------------------------------------
void FmFormShell::ToggleControlFocus( const SdrUnoObj& i_rUnoObject, const SdrView& i_rView, OutputDevice& i_rDevice ) const
{
try
{
// check if the focus currently is in a control
// Well, okay, do it the other way 'round: Check whether the current control of the active controller
// actually has the focus. This should be equivalent.
const bool bHasControlFocus = GetImpl()->HasControlFocus();
if ( bHasControlFocus )
{
Window* pWindow( dynamic_cast< Window* >( &i_rDevice ) );
OSL_ENSURE( pWindow, "FmFormShell::ToggleControlFocus: I need a Window, really!" );
if ( pWindow )
pWindow->GrabFocus();
}
else
{
Reference< XControl > xControl;
GetFormControl( i_rUnoObject.GetUnoControlModel(), i_rView, i_rDevice, xControl );
Reference< XWindow > xControlWindow( xControl, UNO_QUERY );
if ( xControlWindow.is() )
xControlWindow->setFocus();
}
}
catch( const Exception& )
{
DBG_UNHANDLED_EXCEPTION();
}
}
//------------------------------------------------------------------------
namespace
{
class FocusableControlsFilter : public ::svx::ISdrObjectFilter
{
public:
FocusableControlsFilter( const SdrView& i_rView, const OutputDevice& i_rDevice )
:m_rView( i_rView )
,m_rDevice( i_rDevice )
{
}
public:
virtual bool includeObject( const SdrObject& i_rObject ) const
{
const SdrUnoObj* pUnoObj = dynamic_cast< const SdrUnoObj* >( &i_rObject );
if ( !pUnoObj )
return false;
Reference< XControl > xControl = pUnoObj->GetUnoControl( m_rView, m_rDevice );
return FmXFormView::isFocusable( xControl );
}
private:
const SdrView& m_rView;
const OutputDevice& m_rDevice;
};
}
//------------------------------------------------------------------------
::std::auto_ptr< ::svx::ISdrObjectFilter > FmFormShell::CreateFocusableControlFilter( const SdrView& i_rView, const OutputDevice& i_rDevice ) const
{
::std::auto_ptr< ::svx::ISdrObjectFilter > pFilter;
if ( !i_rView.IsDesignMode() )
pFilter.reset( new FocusableControlsFilter( i_rView, i_rDevice ) );
return pFilter;
}
//------------------------------------------------------------------------
SdrUnoObj* FmFormShell::GetFormControl( const Reference< XControlModel >& _rxModel, const SdrView& _rView, const OutputDevice& _rDevice, Reference< XControl >& _out_rxControl ) const
{

View File

@ -56,6 +56,7 @@
#include "svx/svxids.hrc"
/** === begin UNO includes === **/
#include <com/sun/star/awt/XWindow2.hpp>
#include <com/sun/star/awt/XCheckBox.hpp>
#include <com/sun/star/awt/XListBox.hpp>
#include <com/sun/star/awt/XTextComponent.hpp>
@ -4156,6 +4157,31 @@ void FmXFormShell::handleMouseButtonDown( const SdrViewEvent& _rViewEvent )
}
}
//------------------------------------------------------------------------------
bool FmXFormShell::HasControlFocus() const
{
bool bHasControlFocus = false;
try
{
Reference< XFormController > xController( getActiveController() );
Reference< XControl > xCurrentControl;
if ( xController.is() )
xCurrentControl.set( xController->getCurrentControl() );
if ( xCurrentControl.is() )
{
Reference< XWindow2 > xPeerWindow( xCurrentControl->getPeer(), UNO_QUERY_THROW );
bHasControlFocus = xPeerWindow->hasFocus();
}
}
catch( const Exception& )
{
DBG_UNHANDLED_EXCEPTION();
}
return bHasControlFocus;
}
//==============================================================================
//==============================================================================
SearchableControlIterator::SearchableControlIterator(Reference< XInterface> xStartingPoint)

View File

@ -72,6 +72,8 @@
/** === end UNO includes === **/
#include <basic/sbxvar.hxx>
#include <svl/eitem.hxx>
#include <svl/stritem.hxx>
#include <comphelper/container.hxx>
#include <comphelper/extract.hxx>
#include <comphelper/processfactory.hxx>

View File

@ -823,6 +823,48 @@ void FmXFormView::AutoFocus( sal_Bool _bSync )
else
m_nAutoFocusEvent = Application::PostUserEvent(LINK(this, FmXFormView, OnAutoFocus));
}
// -----------------------------------------------------------------------------
bool FmXFormView::isFocusable( const Reference< XControl >& i_rControl )
{
if ( !i_rControl.is() )
return false;
try
{
Reference< XPropertySet > xModelProps( i_rControl->getModel(), UNO_QUERY_THROW );
// only enabled controls are allowed to participate
sal_Bool bEnabled = sal_False;
OSL_VERIFY( xModelProps->getPropertyValue( FM_PROP_ENABLED ) >>= bEnabled );
if ( !bEnabled )
return false;
// check the class id of the control model
sal_Int16 nClassId = FormComponentType::CONTROL;
OSL_VERIFY( xModelProps->getPropertyValue( FM_PROP_CLASSID ) >>= nClassId );
// controls which are not focussable
if ( ( FormComponentType::CONTROL != nClassId )
&& ( FormComponentType::IMAGEBUTTON != nClassId )
&& ( FormComponentType::GROUPBOX != nClassId )
&& ( FormComponentType::FIXEDTEXT != nClassId )
&& ( FormComponentType::HIDDENCONTROL != nClassId )
&& ( FormComponentType::IMAGECONTROL != nClassId )
&& ( FormComponentType::SCROLLBAR != nClassId )
&& ( FormComponentType::SPINBUTTON!= nClassId )
)
{
return true;
}
}
catch( const Exception& e )
{
DBG_UNHANDLED_EXCEPTION();
}
return false;
}
// -----------------------------------------------------------------------------
static Reference< XControl > lcl_firstFocussableControl( const Sequence< Reference< XControl > >& _rControls )
{
@ -833,47 +875,19 @@ static Reference< XControl > lcl_firstFocussableControl( const Sequence< Referen
const Reference< XControl >* pControlsEnd = _rControls.getConstArray() + _rControls.getLength();
for ( ; pControls != pControlsEnd; ++pControls )
{
try
if ( !pControls->is() )
continue;
if ( FmXFormView::isFocusable( *pControls ) )
{
if ( !pControls->is() )
continue;
Reference< XPropertySet > xModelProps( (*pControls)->getModel(), UNO_QUERY_THROW );
// only enabled controls are allowed to participate
sal_Bool bEnabled = sal_False;
OSL_VERIFY( xModelProps->getPropertyValue( FM_PROP_ENABLED ) >>= bEnabled );
if ( !bEnabled )
continue;
// check the class id of the control model
sal_Int16 nClassId = FormComponentType::CONTROL;
OSL_VERIFY( xModelProps->getPropertyValue( FM_PROP_CLASSID ) >>= nClassId );
// controls which are not focussable
if ( ( FormComponentType::CONTROL != nClassId )
&& ( FormComponentType::IMAGEBUTTON != nClassId )
&& ( FormComponentType::GROUPBOX != nClassId )
&& ( FormComponentType::FIXEDTEXT != nClassId )
&& ( FormComponentType::HIDDENCONTROL != nClassId )
&& ( FormComponentType::IMAGECONTROL != nClassId )
&& ( FormComponentType::SCROLLBAR != nClassId )
&& ( FormComponentType::SPINBUTTON!= nClassId )
)
{
xReturn = *pControls;
break;
}
xReturn = *pControls;
break;
}
catch( const Exception& e )
{
(void)e; // make compiler happy
}
if ( !xReturn.is() && _rControls.getLength() )
xReturn = _rControls[0];
}
if ( !xReturn.is() && _rControls.getLength() )
xReturn = _rControls[0];
return xReturn;
}
@ -1007,11 +1021,6 @@ IMPL_LINK(FmXFormView, OnAutoFocus, void*, /*EMPTYTAG*/)
return 1L;
}
// -----------------------------------------------------------------------------
namespace
{
}
// -----------------------------------------------------------------------------
void FmXFormView::onCreatedFormObject( FmFormObj& _rFormObject )
{
@ -1590,7 +1599,13 @@ bool FmXFormView::createControlLabelPair( const ::comphelper::ComponentContext&
xLabelModel.set( pLabel->GetUnoControlModel(), UNO_QUERY );
if ( xLabelModel.is() )
{
xLabelModel->setPropertyValue( FM_PROP_LABEL, makeAny( sFieldName + _rFieldPostfix ) );
::rtl::OUString sLabel;
if ( _rxField.is() && _rxField->getPropertySetInfo()->hasPropertyByName(FM_PROP_LABEL) )
_rxField->getPropertyValue(FM_PROP_LABEL) >>= sLabel;
if ( !sLabel.getLength() )
sLabel = sFieldName;
xLabelModel->setPropertyValue( FM_PROP_LABEL, makeAny( sLabel + _rFieldPostfix ) );
String sObjectLabel( SVX_RES( RID_STR_OBJECT_LABEL ) );
sObjectLabel.SearchAndReplaceAllAscii( "#object#", sFieldName );
xLabelModel->setPropertyValue( FM_PROP_NAME, makeAny( ::rtl::OUString( sObjectLabel ) ) );

View File

@ -40,6 +40,7 @@
#include <com/sun/star/form/XFormComponent.hpp>
#include <com/sun/star/form/FormComponentType.hpp>
#include <com/sun/star/awt/ScrollBarOrientation.hpp>
#include <com/sun/star/awt/MouseWheelBehavior.hpp>
#include <com/sun/star/form/XGridColumnFactory.hpp>
#include <com/sun/star/style/VerticalAlignment.hpp>
#include <com/sun/star/awt/LineEndFormat.hpp>
@ -97,6 +98,7 @@ namespace svxform
/** === end UNO using === **/
namespace FormComponentType = ::com::sun::star::form::FormComponentType;
namespace ScrollBarOrientation = ::com::sun::star::awt::ScrollBarOrientation;
namespace MouseWheelBehavior = ::com::sun::star::awt::MouseWheelBehavior;
namespace LineEndFormat = ::com::sun::star::awt::LineEndFormat;
namespace ImageScaleMode = ::com::sun::star::awt::ImageScaleMode;
namespace DataType = ::com::sun::star::sdbc::DataType;
@ -506,6 +508,12 @@ namespace svxform
_rxControlModel->setPropertyValue( FM_PROP_STRICTFORMAT, makeAny( sal_Bool( sal_True ) ) );
}
// mouse wheel: don't use it for scrolling by default (i110036)
if ( xPSI->hasPropertyByName( FM_PROP_MOUSE_WHEEL_BEHAVIOR ) )
{
_rxControlModel->setPropertyValue( FM_PROP_MOUSE_WHEEL_BEHAVIOR, makeAny( MouseWheelBehavior::SCROLL_DISABLED ) );
}
if ( xPSI->hasPropertyByName( FM_PROP_WRITING_MODE ) )
_rxControlModel->setPropertyValue( FM_PROP_WRITING_MODE, makeAny( WritingMode2::CONTEXT ) );
}

View File

@ -2232,7 +2232,7 @@ namespace svxform
{
SdrPaintWindow* pPaintWindow = pFormView->GetPaintWindow( i );
OutputDevice& rOutDev = pPaintWindow->GetOutputDevice();
if ( OUTDEV_WINDOW == rOutDev.GetOutDevType() )
if ( ( OUTDEV_WINDOW == rOutDev.GetOutDevType() ) && !aMarkRect.IsEmpty() )
{
pFormView->MakeVisible( aMarkRect, (Window&)rOutDev );
}

View File

@ -91,9 +91,46 @@ using namespace ::com::sun::star::beans;
using namespace ::com::sun::star::lang;
using namespace ::com::sun::star::form;
using namespace ::com::sun::star::container;
using namespace ::com::sun::star;
using namespace ::svxform;
using namespace ::svx;
struct ColumnInfo
{
::rtl::OUString sColumnName;
::rtl::OUString sLabel;
bool bColumn;
ColumnInfo(const ::rtl::OUString& i_sColumnName,const ::rtl::OUString& i_sLabel)
: sColumnName(i_sColumnName)
, sLabel(i_sLabel)
, bColumn(true)
{
}
ColumnInfo(const ::rtl::OUString& i_sColumnName)
: sColumnName(i_sColumnName)
, bColumn(false)
{
}
};
void lcl_addToList( SvTreeListBox& _rListBox, const uno::Reference< container::XNameAccess>& i_xColumns )
{
uno::Sequence< ::rtl::OUString > aEntries = i_xColumns->getElementNames();
const ::rtl::OUString* pEntries = aEntries.getConstArray();
sal_Int32 nEntries = aEntries.getLength();
for ( sal_Int32 i = 0; i < nEntries; ++i, ++pEntries )
{
uno::Reference< beans::XPropertySet> xColumn(i_xColumns->getByName(*pEntries),UNO_QUERY_THROW);
::rtl::OUString sLabel;
if ( xColumn->getPropertySetInfo()->hasPropertyByName(FM_PROP_LABEL) )
xColumn->getPropertyValue(FM_PROP_LABEL) >>= sLabel;
if ( sLabel.getLength() )
_rListBox.InsertEntry( sLabel,NULL,FALSE,LIST_APPEND,new ColumnInfo(*pEntries,sLabel) );
else
_rListBox.InsertEntry( *pEntries,NULL,FALSE,LIST_APPEND,new ColumnInfo(*pEntries,sLabel) );
}
}
//==================================================================
// class FmFieldWinListBox
//==================================================================
@ -149,7 +186,8 @@ void FmFieldWinListBox::StartDrag( sal_Int8 /*_nAction*/, const Point& /*_rPosPi
aDescriptor[ daConnection ] <<= pTabWin->GetConnection().getTyped();
aDescriptor[ daCommand ] <<= pTabWin->GetObjectName();
aDescriptor[ daCommandType ]<<= pTabWin->GetObjectType();
aDescriptor[ daColumnName ] <<= ::rtl::OUString( GetEntryText( pSelected ) );
ColumnInfo* pInfo = static_cast<ColumnInfo*>(pSelected->GetUserData());
aDescriptor[ daColumnName ] <<= pInfo->sColumnName;
TransferableHelper* pTransferColumn = new OColumnTransferable(
aDescriptor, CTF_FIELD_DESCRIPTOR | CTF_CONTROL_EXCHANGE | CTF_COLUMN_DESCRIPTOR
@ -238,7 +276,8 @@ sal_Bool FmFieldWin::createSelectionControls( )
aDescr[ daCommand ] <<= GetObjectName();
aDescr[ daCommandType ] <<= GetObjectType();
aDescr[ daColumnName ] <<= ::rtl::OUString( pListBox->GetEntryText( pSelected) );
ColumnInfo* pInfo = static_cast<ColumnInfo*>(pSelected->GetUserData());
aDescr[ daColumnName ] <<= pInfo->sColumnName;//::rtl::OUString( pListBox->GetEntryText( pSelected) );
// transfer this to the SFX world
SfxUnoAnyItem aDescriptorItem( SID_FM_DATACCESS_DESCRIPTOR, makeAny( aDescr.createPropertyValueSequence() ) );
@ -344,15 +383,14 @@ void FmFieldWin::UpdateContent(const ::com::sun::star::uno::Reference< ::com::su
// the place, and connectRowset should be replaced with ensureRowSetConnection
// get the fields of the object
Sequence< ::rtl::OUString> aFieldNames;
if ( m_aConnection.is() && m_aObjectName.getLength() )
aFieldNames = getFieldNamesByCommandDescriptor( m_aConnection, m_nObjectType, m_aObjectName );
// put them into the list
const ::rtl::OUString* pFieldNames = aFieldNames.getConstArray();
sal_Int32 nFieldsCount = aFieldNames.getLength();
for ( sal_Int32 i = 0; i < nFieldsCount; ++i, ++pFieldNames)
pListBox->InsertEntry( * pFieldNames);
if ( m_aConnection.is() && m_aObjectName.getLength() )
{
Reference< XComponent > xKeepFieldsAlive;
Reference< XNameAccess > xColumns = getFieldsByCommandDescriptor( m_aConnection, m_nObjectType, m_aObjectName,xKeepFieldsAlive );
if ( xColumns.is() )
lcl_addToList(*pListBox,xColumns);
}
// Prefix setzen
UniString aPrefix;

View File

@ -174,5 +174,6 @@
#define FM_PROP_INPUT_REQUIRED rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "InputRequired" ) )
#define FM_PROP_WRITING_MODE rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "WritingMode" ) )
#define FM_PROP_MOUSE_WHEEL_BEHAVIOR rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "MouseWheelBehavior" ) )
#define FM_PROP_DESCRIPTION rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Description" ) )
#endif // _SVX_FMPROP_HRC

View File

@ -477,6 +477,9 @@ public:
// if the form belongs to the controller (extern) displaying a grid, the according internal form will
// be displayed, _xForm else
// check if the current control of the active controler has the focus
bool HasControlFocus() const;
private:
DECL_LINK(OnFoundData, FmFoundRecordInformation*);
DECL_LINK(OnCanceledNotFound, FmFoundRecordInformation*);

View File

@ -240,6 +240,11 @@ public:
void onCreatedFormObject( FmFormObj& _rFormObject );
static bool
isFocusable(
const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControl >& i_rControl
);
private:
FmWinRecList::iterator findWindow( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlContainer >& _rxCC );
//void addWindow(const SdrPageViewWinRec*);

View File

@ -219,6 +219,7 @@ class DbCellControl
{
private:
::comphelper::OPropertyChangeMultiplexer* m_pModelChangeBroadcaster;
::comphelper::OPropertyChangeMultiplexer* m_pFieldChangeBroadcaster;
private:
sal_Bool m_bTransparent : 1;
@ -348,7 +349,7 @@ private:
void implDoPropertyListening( const ::rtl::OUString& _rPropertyName, sal_Bool _bWarnIfNotExistent = sal_True );
/// updates the "readonly" setting on m_pWindow, according to the respective property value in the given model
void implAdjustReadOnly( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& _rxModel );
void implAdjustReadOnly( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& _rxModel,bool i_bReadOnly );
/// updates the "enabled" setting on m_pWindow, according to the respective property value in the given model
void implAdjustEnabled( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& _rxModel );

View File

@ -299,10 +299,14 @@ namespace sdr { namespace contact {
//--------------------------------------------------------------------
void ControlHolder::invalidate() const
{
Window* pWindow = VCLUnoHelper::GetWindow( m_xControl->getPeer() );
OSL_ENSURE( pWindow, "ControlHolder::invalidate: no implementation access!" );
if ( pWindow )
pWindow->Invalidate();
Reference< XWindowPeer > xPeer( m_xControl->getPeer() );
if ( xPeer.is() )
{
Window* pWindow = VCLUnoHelper::GetWindow( xPeer );
OSL_ENSURE( pWindow, "ControlHolder::invalidate: no implementation access!" );
if ( pWindow )
pWindow->Invalidate();
}
}
//--------------------------------------------------------------------

View File

@ -121,6 +121,7 @@
#include <svx/sdrhittesthelper.hxx>
#include <svx/svdundo.hxx>
#include <basegfx/matrix/b2dhommatrixtools.hxx>
#include <svx/sdrobjectfilter.hxx>
using namespace ::com::sun::star;
@ -3266,4 +3267,11 @@ void SdrObjFactory::RemoveMakeUserDataHdl(const Link& rLink)
rLL.RemoveLink(rLink);
}
namespace svx
{
ISdrObjectFilter::~ISdrObjectFilter()
{
}
}
// eof

View File

@ -23,7 +23,7 @@
<accel:item accel:code="KEY_F" accel:mod1="true" xlink:href=".uno:SearchDialog"/>
<accel:item accel:code="KEY_Q" accel:shift="true" accel:mod1="true" xlink:href=".uno:BasicBreak"/>
<accel:item accel:code="KEY_F4" xlink:href=".uno:ViewDataSourceBrowser"/>
<accel:item accel:code="KEY_F5" accel:mod1="true" xlink:href=".uno:GrabControlFocus"/>
<accel:item accel:code="KEY_F5" accel:mod1="true" xlink:href=".uno:ToggleControlFocus"/>
<accel:item accel:code="KEY_F7" accel:shift="true" accel:mod1="true" xlink:href=".uno:HangulHanjaConversion"/>
<accel:item accel:code="KEY_F11" accel:mod2="true" xlink:href=".uno:MacroDialog"/>
</accel:acceleratorlist>

View File

@ -23,7 +23,7 @@
<accel:item accel:code="KEY_B" accel:mod1="true" xlink:href=".uno:SearchDialog"/>
<accel:item accel:code="KEY_Q" accel:shift="true" accel:mod1="true" xlink:href=".uno:BasicBreak"/>
<accel:item accel:code="KEY_F4" xlink:href=".uno:ViewDataSourceBrowser"/>
<accel:item accel:code="KEY_F5" accel:mod1="true" xlink:href=".uno:GrabControlFocus"/>
<accel:item accel:code="KEY_F5" accel:mod1="true" xlink:href=".uno:ToggleControlFocus"/>
<accel:item accel:code="KEY_F7" accel:shift="true" accel:mod1="true" xlink:href=".uno:HangulHanjaConversion"/>
<accel:item accel:code="KEY_F11" accel:mod2="true" xlink:href=".uno:MacroDialog"/>
</accel:acceleratorlist>