diff options
37 files changed, 88 insertions, 1389 deletions
diff --git a/connectivity/Library_dbtools.mk b/connectivity/Library_dbtools.mk index d0fc36c842e0..57127b74e80c 100644 --- a/connectivity/Library_dbtools.mk +++ b/connectivity/Library_dbtools.mk @@ -127,11 +127,6 @@ $(eval $(call gb_Library_add_exception_objects,dbtools,\ connectivity/source/sdbcx/VTable \ connectivity/source/sdbcx/VUser \ connectivity/source/sdbcx/VView \ - connectivity/source/simpledbt/charset_s \ - connectivity/source/simpledbt/dbtfactory \ - connectivity/source/simpledbt/parsenode_s \ - connectivity/source/simpledbt/parser_s \ - connectivity/source/simpledbt/staticdbtools_s \ )) # vim: set noet sw=4 ts=4: diff --git a/connectivity/inc/simpledbt/charset_s.hxx b/connectivity/inc/simpledbt/charset_s.hxx deleted file mode 100644 index 25aa2bfc7630..000000000000 --- a/connectivity/inc/simpledbt/charset_s.hxx +++ /dev/null @@ -1,54 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#ifndef INCLUDED_CONNECTIVITY_SOURCE_SIMPLEDBT_CHARSET_S_HXX -#define INCLUDED_CONNECTIVITY_SOURCE_SIMPLEDBT_CHARSET_S_HXX - -#include <connectivity/virtualdbtools.hxx> -#include <connectivity/dbcharset.hxx> - - -namespace connectivity -{ - - - - //= ODataAccessCharSet - - class ODataAccessCharSet : public simple::IDataAccessCharSet - { - protected: - ::dbtools::OCharsetMap m_aCharsetInfo; - - public: - ODataAccessCharSet() { } - - // IDataAccessCharSet - sal_Int32 getSupportedTextEncodings( - ::std::vector< rtl_TextEncoding >& /* [out] */ _rEncs - ) const SAL_OVERRIDE; - }; - - -} // namespace connectivity - - -#endif // INCLUDED_CONNECTIVITY_SOURCE_SIMPLEDBT_CHARSET_S_HXX - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/connectivity/inc/simpledbt/parser_s.hxx b/connectivity/inc/simpledbt/parser_s.hxx deleted file mode 100644 index 359ab25c6366..000000000000 --- a/connectivity/inc/simpledbt/parser_s.hxx +++ /dev/null @@ -1,60 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#ifndef INCLUDED_CONNECTIVITY_SOURCE_SIMPLEDBT_PARSER_S_HXX -#define INCLUDED_CONNECTIVITY_SOURCE_SIMPLEDBT_PARSER_S_HXX - -#include <connectivity/virtualdbtools.hxx> -#include <connectivity/sqlparse.hxx> - - -namespace connectivity -{ - - - - //= OSimpleSQLParser - - class OSimpleSQLParser : public simple::ISQLParser - { - protected: - OSQLParser m_aFullParser; - - public: - OSimpleSQLParser(const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext, const IParseContext* _pContext); - - // ISQLParser - virtual ::rtl::Reference< simple::ISQLParseNode > predicateTree( - OUString& rErrorMessage, - const OUString& rStatement, - const ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatter >& _rxFormatter, - const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& _rxField - ) const SAL_OVERRIDE; - - virtual const IParseContext& getContext() const SAL_OVERRIDE; - }; - - -} // namespace connectivity - - -#endif // INCLUDED_CONNECTIVITY_SOURCE_SIMPLEDBT_PARSER_S_HXX - - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/connectivity/source/commontools/dbtools.cxx b/connectivity/source/commontools/dbtools.cxx index 557e4286a1a7..4f5e3950a573 100644 --- a/connectivity/source/commontools/dbtools.cxx +++ b/connectivity/source/commontools/dbtools.cxx @@ -82,9 +82,6 @@ #include "resource/sharedresources.hxx" #include <connectivity/OSubComponent.hxx> -#include "simpledbt/parser_s.hxx" -#include "simpledbt/charset_s.hxx" - #include <algorithm> #include <iterator> #include <set> @@ -1976,18 +1973,6 @@ void getBooleanComparisonPredicate( const OUString& _rExpression, const bool _bV } } -simple::ISQLParser* createSQLParser( - const Reference< XComponentContext >& rxContext, - const IParseContext* _pContext ) -{ - return new OSimpleSQLParser(rxContext, _pContext); -} - -simple::IDataAccessCharSet* createCharsetHelper( ) -{ - return new ODataAccessCharSet; -} - } // namespace dbtools namespace connectivity diff --git a/connectivity/source/drivers/file/FResultSet.cxx b/connectivity/source/drivers/file/FResultSet.cxx index 68893053df95..3dedc867a44f 100644 --- a/connectivity/source/drivers/file/FResultSet.cxx +++ b/connectivity/source/drivers/file/FResultSet.cxx @@ -23,6 +23,7 @@ #endif #include <connectivity/sdbcx/VColumn.hxx> #include "file/FResultSet.hxx" +#include "sqlbison.hxx" #include "file/FResultSetMetaData.hxx" #include <com/sun/star/sdbc/DataType.hpp> #include <com/sun/star/sdbc/ColumnValue.hpp> diff --git a/connectivity/source/drivers/file/FStatement.cxx b/connectivity/source/drivers/file/FStatement.cxx index cf7e93475569..f3b3e5d6f6db 100644 --- a/connectivity/source/drivers/file/FStatement.cxx +++ b/connectivity/source/drivers/file/FStatement.cxx @@ -20,6 +20,7 @@ #include <osl/diagnose.h> #include "file/FStatement.hxx" #include "file/FConnection.hxx" +#include "sqlbison.hxx" #include "file/FDriver.hxx" #include "file/FResultSet.hxx" #include <comphelper/property.hxx> diff --git a/connectivity/source/drivers/file/fcode.cxx b/connectivity/source/drivers/file/fcode.cxx index 0894d95f9f8e..73a72421903d 100644 --- a/connectivity/source/drivers/file/fcode.cxx +++ b/connectivity/source/drivers/file/fcode.cxx @@ -20,6 +20,7 @@ #include "file/fcode.hxx" #include <osl/diagnose.h> #include <connectivity/sqlparse.hxx> +#include "sqlbison.hxx" #include <i18nlangtag/mslangid.hxx> #include "TConnection.hxx" #include <com/sun/star/sdb/SQLFilterOperator.hpp> diff --git a/connectivity/source/drivers/file/fcomp.cxx b/connectivity/source/drivers/file/fcomp.cxx index 8926b945f140..a2f8c65a6d88 100644 --- a/connectivity/source/drivers/file/fcomp.cxx +++ b/connectivity/source/drivers/file/fcomp.cxx @@ -34,6 +34,7 @@ #include "file/FDateFunctions.hxx" #include "file/FNumericFunctions.hxx" #include "file/FConnection.hxx" +#include "sqlbison.hxx" using namespace connectivity; using namespace connectivity::file; diff --git a/connectivity/source/drivers/macab/MacabStatement.cxx b/connectivity/source/drivers/macab/MacabStatement.cxx index e82a43eb90bc..a7ece0a27cf3 100644 --- a/connectivity/source/drivers/macab/MacabStatement.cxx +++ b/connectivity/source/drivers/macab/MacabStatement.cxx @@ -19,6 +19,7 @@ #include "MacabStatement.hxx" +#include "sqlbison.hxx" #include "MacabConnection.hxx" #include "MacabAddressBook.hxx" #include "MacabDriver.hxx" diff --git a/connectivity/source/drivers/mork/MResultSet.cxx b/connectivity/source/drivers/mork/MResultSet.cxx index 4bd102d7ad7b..5c1a1713b8fb 100644 --- a/connectivity/source/drivers/mork/MResultSet.cxx +++ b/connectivity/source/drivers/mork/MResultSet.cxx @@ -38,6 +38,7 @@ #include <vector> #include <algorithm> #include "MResultSet.hxx" +#include "sqlbison.hxx" #include "MResultSetMetaData.hxx" #include "FDatabaseMetaDataResultSet.hxx" diff --git a/connectivity/source/drivers/mork/MStatement.cxx b/connectivity/source/drivers/mork/MStatement.cxx index 423d6c528a90..01fc1fc79ba7 100644 --- a/connectivity/source/drivers/mork/MStatement.cxx +++ b/connectivity/source/drivers/mork/MStatement.cxx @@ -42,6 +42,7 @@ #include "diagnose_ex.h" #include "MDriver.hxx" #include "MStatement.hxx" +#include "sqlbison.hxx" #include "MConnection.hxx" #include "MResultSet.hxx" #include "MDatabaseMetaData.hxx" diff --git a/connectivity/source/parse/sqliterator.cxx b/connectivity/source/parse/sqliterator.cxx index dbe05776d656..cab5ca8d2ea3 100644 --- a/connectivity/source/parse/sqliterator.cxx +++ b/connectivity/source/parse/sqliterator.cxx @@ -20,6 +20,7 @@ #include <connectivity/sqliterator.hxx> #include <connectivity/sdbcx/VTable.hxx> #include <connectivity/sqlparse.hxx> +#include "sqlbison.hxx" #include <connectivity/dbtools.hxx> #include <connectivity/sqlerror.hxx> #include <com/sun/star/sdbc/ColumnValue.hpp> diff --git a/connectivity/source/simpledbt/charset_s.cxx b/connectivity/source/simpledbt/charset_s.cxx deleted file mode 100644 index 261a46a59c8f..000000000000 --- a/connectivity/source/simpledbt/charset_s.cxx +++ /dev/null @@ -1,52 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#include "simpledbt/charset_s.hxx" - - -namespace connectivity -{ - - - using namespace ::dbtools; - - - //= ODataAccessCharSet - - - sal_Int32 ODataAccessCharSet::getSupportedTextEncodings( ::std::vector< rtl_TextEncoding >& _rEncs ) const - { - _rEncs.clear(); - - OCharsetMap::const_iterator aLoop = m_aCharsetInfo.begin(); - OCharsetMap::const_iterator aLoopEnd = m_aCharsetInfo.end(); - while (aLoop != aLoopEnd) - { - _rEncs.push_back( (*aLoop).getEncoding() ); - ++aLoop; - } - - return _rEncs.size(); - } - - -} // namespace connectivity - - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/connectivity/source/simpledbt/dbtfactory.cxx b/connectivity/source/simpledbt/dbtfactory.cxx deleted file mode 100644 index 85fca69453e7..000000000000 --- a/connectivity/source/simpledbt/dbtfactory.cxx +++ /dev/null @@ -1,95 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - - -#include <connectivity/virtualdbtools.hxx> -#include <connectivity/formattedcolumnvalue.hxx> -#include "simpledbt/parser_s.hxx" -#include "simpledbt/charset_s.hxx" -#include "dbtfactory.hxx" -#include "staticdbtools_s.hxx" - -using namespace ::com::sun::star::uno; -using namespace ::com::sun::star::lang; - - -// the entry point for load-on-call usage of the DBTOOLS lib -#if HAVE_FEATURE_DESKTOP -extern "C" void* SAL_CALL createDataAccessToolsFactory() -{ - ::connectivity::ODataAccessToolsFactory* pFactory = new ::connectivity::ODataAccessToolsFactory; - pFactory->acquire(); - return pFactory; -} -#endif - -namespace connectivity -{ - - - - //= ODataAccessToolsFactory - - - ODataAccessToolsFactory::ODataAccessToolsFactory() - { - ODataAccessStaticTools* pStaticTools = new ODataAccessStaticTools; - m_xTypeConversionHelper = pStaticTools; - m_xToolsHelper = pStaticTools; - } - - - ::rtl::Reference< simple::IDataAccessTypeConversion > ODataAccessToolsFactory::getTypeConversionHelper() - { - return m_xTypeConversionHelper; - } - - - ::rtl::Reference< simple::IDataAccessCharSet > ODataAccessToolsFactory::createCharsetHelper( ) const - { - return new ODataAccessCharSet; - } - - - ::rtl::Reference< simple::IDataAccessTools > ODataAccessToolsFactory::getDataAccessTools() - { - return m_xToolsHelper; - } - - - ::std::unique_ptr< ::dbtools::FormattedColumnValue > ODataAccessToolsFactory::createFormattedColumnValue( - const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& _rxContext, - const Reference< ::com::sun::star::sdbc::XRowSet >& _rxRowSet, const Reference< ::com::sun::star::beans::XPropertySet >& _rxColumn ) - { - ::std::unique_ptr< ::dbtools::FormattedColumnValue > pValue( new ::dbtools::FormattedColumnValue( _rxContext, _rxRowSet, _rxColumn ) ); - return pValue; - } - - - ::rtl::Reference< simple::ISQLParser > ODataAccessToolsFactory::createSQLParser(const Reference< XComponentContext >& rxContext, const IParseContext* _pContext) const - { - return new OSimpleSQLParser(rxContext, _pContext); - } - - -} // namespace connectivity - - - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/connectivity/source/simpledbt/dbtfactory.hxx b/connectivity/source/simpledbt/dbtfactory.hxx deleted file mode 100644 index 7631606a4892..000000000000 --- a/connectivity/source/simpledbt/dbtfactory.hxx +++ /dev/null @@ -1,69 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#ifndef INCLUDED_CONNECTIVITY_SOURCE_SIMPLEDBT_DBTFACTORY_HXX -#define INCLUDED_CONNECTIVITY_SOURCE_SIMPLEDBT_DBTFACTORY_HXX - -#include <connectivity/virtualdbtools.hxx> - - -namespace connectivity -{ - - - - //= ODataAccessToolsFactory - - class ODataAccessToolsFactory : public simple::IDataAccessToolsFactory - { - protected: - ::rtl::Reference< simple::IDataAccessTypeConversion > m_xTypeConversionHelper; - ::rtl::Reference< simple::IDataAccessTools > m_xToolsHelper; - - public: - ODataAccessToolsFactory(); - virtual ~ODataAccessToolsFactory() {} - - // IDataAccessToolsFactory - virtual ::rtl::Reference< simple::ISQLParser > createSQLParser( - const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& _rxContext, - const IParseContext* _pContext - ) const SAL_OVERRIDE; - - virtual ::rtl::Reference< simple::IDataAccessCharSet > createCharsetHelper( ) const SAL_OVERRIDE; - - virtual ::rtl::Reference< simple::IDataAccessTypeConversion > getTypeConversionHelper() SAL_OVERRIDE; - - virtual ::rtl::Reference< simple::IDataAccessTools > getDataAccessTools() SAL_OVERRIDE; - - virtual ::std::unique_ptr< ::dbtools::FormattedColumnValue > createFormattedColumnValue( - const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& _rxContext, - const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XRowSet >& _rxRowSet, - const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& _rxColumn - ) SAL_OVERRIDE; - - }; - - -} // namespace connectivity - - -#endif // INCLUDED_CONNECTIVITY_SOURCE_SIMPLEDBT_DBTFACTORY_HXX - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/connectivity/source/simpledbt/parsenode_s.cxx b/connectivity/source/simpledbt/parsenode_s.cxx deleted file mode 100644 index 07e1402797f9..000000000000 --- a/connectivity/source/simpledbt/parsenode_s.cxx +++ /dev/null @@ -1,73 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#include <connectivity/virtualdbtools.hxx> -#include "parsenode_s.hxx" -#include <connectivity/sqlnode.hxx> - -using namespace ::com::sun::star::uno; -using namespace ::com::sun::star::util; -using namespace ::com::sun::star::beans; -using namespace ::com::sun::star::lang; -using namespace ::com::sun::star::sdbc; - - -namespace connectivity -{ - - - - //= OSimpleParseNode - - - OSimpleParseNode::OSimpleParseNode(const OSQLParseNode* _pNode, bool _bTakeOwnership) - :m_pFullNode(_pNode) - ,m_bOwner(_bTakeOwnership) - { - OSL_ENSURE(m_pFullNode, "OSimpleParseNode::OSimpleParseNode: invalid node given!"); - } - - - OSimpleParseNode::~OSimpleParseNode() - { - if (m_bOwner) - delete m_pFullNode; - } - - void OSimpleParseNode::parseNodeToStr(OUString& _rString, const Reference< XConnection >& _rxConnection,const IParseContext* _pContext) const - { - m_pFullNode->parseNodeToStr( _rString, _rxConnection, _pContext ); - } - - - void OSimpleParseNode::parseNodeToPredicateStr(OUString& _rString, const Reference< XConnection >& _rxConnection, - const Reference< XNumberFormatter >& _rxFormatter, const Reference< XPropertySet >& _rxField, - const OUString &_sPredicateTableAlias, - const Locale& _rIntl, const sal_Char _cDecSeparator,const IParseContext* _pContext) const - { - m_pFullNode->parseNodeToPredicateStr( _rString, _rxConnection, _rxFormatter, _rxField, _sPredicateTableAlias, - _rIntl, _cDecSeparator, _pContext ); - } - - -} // namespace connectivity - - - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/connectivity/source/simpledbt/parsenode_s.hxx b/connectivity/source/simpledbt/parsenode_s.hxx deleted file mode 100644 index 42e47be228c5..000000000000 --- a/connectivity/source/simpledbt/parsenode_s.hxx +++ /dev/null @@ -1,68 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#ifndef INCLUDED_CONNECTIVITY_SOURCE_SIMPLEDBT_PARSENODE_S_HXX -#define INCLUDED_CONNECTIVITY_SOURCE_SIMPLEDBT_PARSENODE_S_HXX - -#include <connectivity/virtualdbtools.hxx> - - -namespace connectivity -{ - - - class OSQLParseNode; - - //= OSimpleParseNode - - class OSimpleParseNode : public simple::ISQLParseNode - { - protected: - const OSQLParseNode* m_pFullNode; - bool m_bOwner; - - public: - OSimpleParseNode(const OSQLParseNode* _pNode, bool _bTakeOwnership = true); - virtual ~OSimpleParseNode(); - - // ISQLParseNode - virtual void parseNodeToStr(OUString& _rString, - const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >& _rxConnection, - const IParseContext* _pContext - ) const SAL_OVERRIDE; - - virtual void parseNodeToPredicateStr(OUString& _rString, - const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >& _rxConnection, - const ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatter >& _rxFormatter, - const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& _rxField, - const OUString &_sPredicateTableAlias, - const ::com::sun::star::lang::Locale& _rIntl, - const sal_Char _cDecSeparator, - const IParseContext* _pContext - ) const SAL_OVERRIDE; - }; - - -} // namespace connectivity - - -#endif // INCLUDED_CONNECTIVITY_SOURCE_SIMPLEDBT_PARSENODE_S_HXX - - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/connectivity/source/simpledbt/parser_s.cxx b/connectivity/source/simpledbt/parser_s.cxx deleted file mode 100644 index e9194af045bf..000000000000 --- a/connectivity/source/simpledbt/parser_s.cxx +++ /dev/null @@ -1,65 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#include <connectivity/virtualdbtools.hxx> -#include "simpledbt/parser_s.hxx" -#include "parsenode_s.hxx" - -using namespace ::com::sun::star::uno; -using namespace ::com::sun::star::util; -using namespace ::com::sun::star::beans; -using namespace ::com::sun::star::lang; - - -namespace connectivity -{ - - - - //= OSimpleSQLParser - - - OSimpleSQLParser::OSimpleSQLParser(const Reference< XComponentContext >& rxContext, const IParseContext* _pContext) - :m_aFullParser(rxContext, _pContext) - { - } - - - const IParseContext& OSimpleSQLParser::getContext() const - { - return m_aFullParser.getContext(); - } - - - ::rtl::Reference< simple::ISQLParseNode > OSimpleSQLParser::predicateTree(OUString& rErrorMessage, const OUString& rStatement, - const Reference< XNumberFormatter >& _rxFormatter, const Reference< XPropertySet >& _rxField) const - { - OSimpleParseNode* pReturn = NULL; - OSQLParseNode* pFullNode = const_cast<OSimpleSQLParser*>(this)->m_aFullParser.predicateTree(rErrorMessage, rStatement, _rxFormatter, _rxField); - if (pFullNode) - pReturn = new OSimpleParseNode(pFullNode, true); - return pReturn; - } - - -} // namespace connectivity - - - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/connectivity/source/simpledbt/staticdbtools_s.cxx b/connectivity/source/simpledbt/staticdbtools_s.cxx deleted file mode 100644 index fb5587f02db7..000000000000 --- a/connectivity/source/simpledbt/staticdbtools_s.cxx +++ /dev/null @@ -1,190 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#include <connectivity/virtualdbtools.hxx> -#include "staticdbtools_s.hxx" -#include <connectivity/dbconversion.hxx> -#include <connectivity/dbtools.hxx> -#include <com/sun/star/sdb/SQLContext.hpp> - - -namespace connectivity -{ - - - using namespace ::com::sun::star::util; - using namespace ::com::sun::star::uno; - using namespace ::com::sun::star::sdb; - using namespace ::com::sun::star::lang; - using namespace ::com::sun::star::sdbc; - using namespace ::com::sun::star::beans; - using namespace ::com::sun::star::container; - - - //= ODataAccessStaticTools - - - ODataAccessStaticTools::ODataAccessStaticTools() - { - } - - - Date ODataAccessStaticTools::getStandardDate() const - { - return ::dbtools::DBTypeConversion::getStandardDate(); - } - - - double ODataAccessStaticTools::getValue(const Reference< XColumn>& _rxVariant, const Date& rNullDate ) const - { - return ::dbtools::DBTypeConversion::getValue( _rxVariant, rNullDate ); - } - - - OUString ODataAccessStaticTools::getFormattedValue(const Reference< XColumn >& _rxColumn, const Reference< XNumberFormatter >& _rxFormatter, - const Date& _rNullDate, sal_Int32 _nKey, sal_Int16 _nKeyType) const - { - return ::dbtools::DBTypeConversion::getFormattedValue(_rxColumn, _rxFormatter, _rNullDate, _nKey, _nKeyType); - } - - - OUString ODataAccessStaticTools::getFormattedValue( const Reference< XPropertySet>& _rxColumn, const Reference< XNumberFormatter>& _rxFormatter, - const Locale& _rLocale, const Date& _rNullDate ) const - { - return ::dbtools::DBTypeConversion::getFormattedValue( _rxColumn, _rxFormatter, _rLocale, _rNullDate ); - } - - - Reference< XConnection> ODataAccessStaticTools::getConnection_withFeedback(const OUString& _rDataSourceName, const OUString& _rUser, - const OUString& _rPwd, const Reference< XComponentContext>& _rxContext) const - { - return ::dbtools::getConnection_withFeedback(_rDataSourceName, _rUser, _rPwd, _rxContext); - } - - - Reference< XConnection> ODataAccessStaticTools::connectRowset(const Reference< XRowSet>& _rxRowSet, const Reference< XComponentContext >& _rxContext, bool _bSetAsActiveConnection) const - { - return ::dbtools::connectRowset( _rxRowSet, _rxContext, _bSetAsActiveConnection); - } - - - Reference< XConnection> ODataAccessStaticTools::getRowSetConnection( - const Reference< XRowSet>& _rxRowSet) - const - { - return ::dbtools::getConnection(_rxRowSet); - } - - - Reference< XNumberFormatsSupplier> ODataAccessStaticTools::getNumberFormats(const Reference< XConnection>& _rxConn, bool _bAllowDefault) const - { - return ::dbtools::getNumberFormats(_rxConn, _bAllowDefault); - } - - - sal_Int32 ODataAccessStaticTools::getDefaultNumberFormat( const Reference< XPropertySet >& _rxColumn, const Reference< XNumberFormatTypes >& _rxTypes, - const Locale& _rLocale ) const - { - return ::dbtools::getDefaultNumberFormat( _rxColumn, _rxTypes, _rLocale ); - } - - - void ODataAccessStaticTools::TransferFormComponentProperties(const Reference< XPropertySet>& _rxOld, const Reference< XPropertySet>& _rxNew, const Locale& _rLocale) const - { - ::dbtools::TransferFormComponentProperties(_rxOld, _rxNew, _rLocale); - } - - - OUString ODataAccessStaticTools::quoteName(const OUString& _rQuote, const OUString& _rName) const - { - return ::dbtools::quoteName(_rQuote, _rName); - } - - - OUString ODataAccessStaticTools::composeTableNameForSelect( const Reference< XConnection >& _rxConnection, const OUString& _rCatalog, const OUString& _rSchema, const OUString& _rName ) const - { - return ::dbtools::composeTableNameForSelect( _rxConnection, _rCatalog, _rSchema, _rName ); - } - - - OUString ODataAccessStaticTools::composeTableNameForSelect( const Reference< XConnection >& _rxConnection, const Reference< XPropertySet>& _xTable ) const - { - return ::dbtools::composeTableNameForSelect( _rxConnection, _xTable ); - } - - - SQLContext ODataAccessStaticTools::prependContextInfo(SQLException& _rException, const Reference< XInterface >& _rxContext, - const OUString& _rContextDescription, const OUString& _rContextDetails) const - { - return ::dbtools::prependContextInfo(_rException, _rxContext, _rContextDescription, _rContextDetails); - } - - - Reference< XDataSource > ODataAccessStaticTools::getDataSource( const OUString& _rsRegisteredName, const Reference< XComponentContext>& _rxContext ) const - { - return ::dbtools::getDataSource( _rsRegisteredName, _rxContext ); - } - - - bool ODataAccessStaticTools::canInsert(const Reference< XPropertySet>& _rxCursorSet) const - { - return ::dbtools::canInsert( _rxCursorSet ); - } - - - bool ODataAccessStaticTools::canUpdate(const Reference< XPropertySet>& _rxCursorSet) const - { - return ::dbtools::canUpdate( _rxCursorSet ); - } - - - bool ODataAccessStaticTools::canDelete(const Reference< XPropertySet>& _rxCursorSet) const - { - return ::dbtools::canDelete( _rxCursorSet ); - } - - - Reference< XNameAccess > ODataAccessStaticTools::getFieldsByCommandDescriptor( const Reference< XConnection >& _rxConnection, - const sal_Int32 _nCommandType, const OUString& _rCommand, - Reference< XComponent >& _rxKeepFieldsAlive, ::dbtools::SQLExceptionInfo* _pErrorInfo ) - { - return ::dbtools::getFieldsByCommandDescriptor( _rxConnection, _nCommandType, _rCommand, - _rxKeepFieldsAlive, _pErrorInfo ); - } - - - Sequence< OUString > ODataAccessStaticTools::getFieldNamesByCommandDescriptor( - const Reference< XConnection >& _rxConnection, const sal_Int32 _nCommandType, - const OUString& _rCommand, ::dbtools::SQLExceptionInfo* _pErrorInfo ) - { - return ::dbtools::getFieldNamesByCommandDescriptor( _rxConnection, _nCommandType, - _rCommand, _pErrorInfo ); - } - - - bool ODataAccessStaticTools::isEmbeddedInDatabase( const Reference< XInterface >& _rxComponent, Reference< XConnection >& _rxActualConnection ) - { - return ::dbtools::isEmbeddedInDatabase( _rxComponent, _rxActualConnection ); - } - - -} // namespace connectivity - - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/connectivity/source/simpledbt/staticdbtools_s.hxx b/connectivity/source/simpledbt/staticdbtools_s.hxx deleted file mode 100644 index ce240b11312e..000000000000 --- a/connectivity/source/simpledbt/staticdbtools_s.hxx +++ /dev/null @@ -1,190 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#ifndef INCLUDED_CONNECTIVITY_SOURCE_SIMPLEDBT_STATICDBTOOLS_S_HXX -#define INCLUDED_CONNECTIVITY_SOURCE_SIMPLEDBT_STATICDBTOOLS_S_HXX - -#include <connectivity/virtualdbtools.hxx> - - -namespace connectivity -{ - - - - //= ODataAccessStaticTools - - class ODataAccessStaticTools - :public simple::IDataAccessTypeConversion - ,public simple::IDataAccessTools - { - public: - ODataAccessStaticTools(); - - // IDataAccessTypeConversion - - virtual ::com::sun::star::util::Date getStandardDate() const SAL_OVERRIDE; - - - virtual double getValue( - const ::com::sun::star::uno::Reference< ::com::sun::star::sdb::XColumn>& _rxVariant, - const ::com::sun::star::util::Date& rNullDate ) const SAL_OVERRIDE; - - - virtual OUString getFormattedValue( - const ::com::sun::star::uno::Reference< ::com::sun::star::sdb::XColumn >& _rxColumn, - const ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatter >& _rxFormatter, - const ::com::sun::star::util::Date& _rNullDate, - sal_Int32 _nKey, - sal_Int16 _nKeyType) const SAL_OVERRIDE; - - - virtual OUString getFormattedValue( - const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet>& _rxColumn, - const ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatter>& _rxFormatter, - const ::com::sun::star::lang::Locale& _rLocale, - const ::com::sun::star::util::Date& _rNullDate - ) const SAL_OVERRIDE; - - // IDataAccessTools - - virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection> getConnection_withFeedback( - const OUString& _rDataSourceName, - const OUString& _rUser, - const OUString& _rPwd, - const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext>& _rxContext - ) const SAL_OVERRIDE; - - - virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection> connectRowset( - const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XRowSet>& _rxRowSet, - const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext>& _rxContext, - bool _bSetAsActiveConnection - ) const SAL_OVERRIDE; - - - virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection> getRowSetConnection( - const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XRowSet>& _rxRowSet) - const SAL_OVERRIDE; - - - ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatsSupplier> getNumberFormats( - const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection>& _rxConn, - bool _bAllowDefault - ) const SAL_OVERRIDE; - - - virtual sal_Int32 getDefaultNumberFormat( - const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& _rxColumn, - const ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatTypes >& _rxTypes, - const ::com::sun::star::lang::Locale& _rLocale - ) const SAL_OVERRIDE; - - - virtual void TransferFormComponentProperties( - const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet>& _rxOld, - const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet>& _rxNew, - const ::com::sun::star::lang::Locale& _rLocale - ) const SAL_OVERRIDE; - - - virtual OUString quoteName( - const OUString& _rQuote, - const OUString& _rName - ) const SAL_OVERRIDE; - - - virtual OUString composeTableNameForSelect( - const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >& _rxConnection, - const OUString& _rCatalog, - const OUString& _rSchema, - const OUString& _rName - ) const SAL_OVERRIDE; - - - virtual OUString composeTableNameForSelect( - const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >& _rxConnection, - const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet>& _xTable - ) const SAL_OVERRIDE; - - - virtual ::com::sun::star::sdb::SQLContext prependContextInfo( - ::com::sun::star::sdbc::SQLException& _rException, - const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _rxContext, - const OUString& _rContextDescription, - const OUString& _rContextDetails - ) const SAL_OVERRIDE; - - - virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XDataSource > getDataSource( - const OUString& _rsRegisteredName, - const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext>& _rxContext - ) const SAL_OVERRIDE; - - - /** check if the property "Privileges" supports ::com::sun::star::sdbcx::Privilege::INSERT - @param _rxCursorSet the property set - */ - virtual bool canInsert(const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet>& _rxCursorSet) const SAL_OVERRIDE; - - - /** check if the property "Privileges" supports ::com::sun::star::sdbcx::Privilege::UPDATE - @param _rxCursorSet the property set - */ - virtual bool canUpdate(const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet>& _rxCursorSet) const SAL_OVERRIDE; - - - /** check if the property "Privileges" supports ::com::sun::star::sdbcx::Privilege::DELETE - @param _rxCursorSet the property set - */ - virtual bool canDelete(const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet>& _rxCursorSet) const SAL_OVERRIDE; - - - virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > - getFieldsByCommandDescriptor( - const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >& _rxConnection, - const sal_Int32 _nCommandType, - const OUString& _rCommand, - ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent >& _rxKeepFieldsAlive, - ::dbtools::SQLExceptionInfo* _pErrorInfo = NULL - ) SAL_OVERRIDE; - - - virtual ::com::sun::star::uno::Sequence< OUString > - getFieldNamesByCommandDescriptor( - const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >& _rxConnection, - const sal_Int32 _nCommandType, - const OUString& _rCommand, - ::dbtools::SQLExceptionInfo* _pErrorInfo = NULL - ) SAL_OVERRIDE; - - - virtual bool isEmbeddedInDatabase( - const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _rxComponent, - ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >& _rxActualConnection - ) SAL_OVERRIDE; - }; - - -} // namespace connectivity - - -#endif // INCLUDED_CONNECTIVITY_SOURCE_SIMPLEDBT_STATICDBTOOLS_S_HXX - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/core/api/RowSetCache.cxx b/dbaccess/source/core/api/RowSetCache.cxx index 4a10be4f1c2d..f4baf902a7e1 100644 --- a/dbaccess/source/core/api/RowSetCache.cxx +++ b/dbaccess/source/core/api/RowSetCache.cxx @@ -48,6 +48,7 @@ #include <connectivity/sqliterator.hxx> #include <connectivity/sqlnode.hxx> #include <connectivity/sqlparse.hxx> +#include "sqlbison.hxx" #include <tools/debug.hxx> #include <tools/diagnose_ex.h> #include <osl/diagnose.h> diff --git a/dbaccess/source/core/api/SingleSelectQueryComposer.cxx b/dbaccess/source/core/api/SingleSelectQueryComposer.cxx index 69c88a049e0c..a76bfb533c92 100644 --- a/dbaccess/source/core/api/SingleSelectQueryComposer.cxx +++ b/dbaccess/source/core/api/SingleSelectQueryComposer.cxx @@ -24,6 +24,7 @@ #include "dbastrings.hrc" #include "HelperCollections.hxx" #include "SingleSelectQueryComposer.hxx" +#include "sqlbison.hxx" #include "sdbcoretools.hxx" #include <com/sun/star/beans/PropertyAttribute.hpp> diff --git a/dbaccess/source/ui/querydesign/QueryDesignView.cxx b/dbaccess/source/ui/querydesign/QueryDesignView.cxx index d8fe0e30520b..82e40213244c 100644 --- a/dbaccess/source/ui/querydesign/QueryDesignView.cxx +++ b/dbaccess/source/ui/querydesign/QueryDesignView.cxx @@ -22,6 +22,7 @@ #include "QTableWindow.hxx" #include <vcl/toolbox.hxx> #include "querycontroller.hxx" +#include "sqlbison.hxx" #include <vcl/split.hxx> #include <svl/undo.hxx> #include <tools/diagnose_ex.h> diff --git a/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx b/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx index e11f08d7184d..c454e2d6b44a 100644 --- a/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx +++ b/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx @@ -22,6 +22,7 @@ #include <com/sun/star/sdbc/DataType.hpp> #include "QueryDesignView.hxx" #include "querycontroller.hxx" +#include "sqlbison.hxx" #include "QueryTableView.hxx" #include "browserids.hxx" #include <comphelper/extract.hxx> diff --git a/include/connectivity/dbtools.hxx b/include/connectivity/dbtools.hxx index 26bdeb708b42..77ed4fd592d1 100644 --- a/include/connectivity/dbtools.hxx +++ b/include/connectivity/dbtools.hxx @@ -74,17 +74,6 @@ namespace task { } } } -namespace connectivity -{ - class IParseContext; - namespace simple - { - class ISQLParser; - class IDataAccessCharSet; - } -} - - namespace dbtools { class ISQLStatementHelper; @@ -796,13 +785,6 @@ namespace dbtools OUStringBuffer& _out_rSQLPredicate ); - OOO_DLLPUBLIC_DBTOOLS ::connectivity::simple::ISQLParser* createSQLParser( - const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext, - const ::connectivity::IParseContext* _pContext - ); - - OOO_DLLPUBLIC_DBTOOLS ::connectivity::simple::IDataAccessCharSet* createCharsetHelper( ); - } // namespace dbtools diff --git a/include/connectivity/sqlparse.hxx b/include/connectivity/sqlparse.hxx index f2cf6bbb4860..aa59a03e3795 100644 --- a/include/connectivity/sqlparse.hxx +++ b/include/connectivity/sqlparse.hxx @@ -24,13 +24,6 @@ #include <com/sun/star/uno/Reference.h> #include <osl/mutex.hxx> #include <connectivity/sqlnode.hxx> -#if HAVE_FEATURE_DBCONNECTIVITY -#ifndef YYBISON -#ifndef FLEX_SCANNER -#include "sqlbison.hxx" -#endif -#endif -#endif #include <com/sun/star/i18n/XCharacterClassification.hpp> #include <com/sun/star/lang/XMultiServiceFactory.hpp> #include <com/sun/star/i18n/XLocaleData4.hpp> diff --git a/include/connectivity/virtualdbtools.hxx b/include/connectivity/virtualdbtools.hxx deleted file mode 100644 index 7735f519a9b2..000000000000 --- a/include/connectivity/virtualdbtools.hxx +++ /dev/null @@ -1,370 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#ifndef INCLUDED_CONNECTIVITY_VIRTUALDBTOOLS_HXX -#define INCLUDED_CONNECTIVITY_VIRTUALDBTOOLS_HXX - -#include <config_features.h> - -#include <rtl/ref.hxx> -#include <rtl/ustring.hxx> -#include <com/sun/star/uno/Reference.hxx> -#include <com/sun/star/util/Date.hpp> -#include <com/sun/star/sdbc/SQLException.hpp> -#include <com/sun/star/uno/Sequence.hxx> - -#include <vector> -#include <memory> -#include <connectivity/dbtoolsdllapi.hxx> -#include <salhelper/simplereferenceobject.hxx> - - -//= forward declarations - -namespace com { - namespace sun { - namespace star { - namespace util { - class XNumberFormatter; - class XNumberFormatTypes; - class XNumberFormatsSupplier; - } - namespace beans { - class XPropertySet; - } - namespace lang { - class XMultiServiceFactory; - class XComponent; - class WrappedTargetException; - struct Locale; - } - namespace sdbc { - class XDatabaseMetaData; - class XConnection; - class XRowSet; - class XDataSource; - } - namespace sdb { - class XColumn; - class SQLContext; - } - namespace uno { - class XComponentContext; - } - namespace container { - class XNameAccess; - } - } - } -} - -namespace dbtools { - class SQLExceptionInfo; - class FormattedColumnValue; -} - - -//= entry into this library - -/** this is the entry point for the load-on-call usage of the DBTOOLS - library. - <p>When you need one of the simple objects in this library, load the lib - and call this method. The returned pointer is a pointer to an IDataAccessToolsFactory - instance, which is acquired <em>once</em>.</p> - @return - a pointer to an object implementing the IDataAccessToolsFactory interface, - acquired exactly <em>once</em>. -*/ -#if HAVE_FEATURE_DESKTOP -extern "C" OOO_DLLPUBLIC_DBTOOLS void* SAL_CALL createDataAccessToolsFactory(); -#endif - -//= - - -namespace connectivity -{ - - - class IParseContext; - - namespace simple - { - - - typedef void* (SAL_CALL * createDataAccessToolsFactoryFunction)( ); - - - //= IDataAccessTools - - class OOO_DLLPUBLIC_DBTOOLS IDataAccessTools : public virtual salhelper::SimpleReferenceObject - { - public: - virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection> getConnection_withFeedback( - const OUString& _rDataSourceName, - const OUString& _rUser, - const OUString& _rPwd, - const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext>& _rxContext - ) const = 0; - - virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection> connectRowset( - const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XRowSet>& _rxRowSet, - const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext>& _rxContext, - bool _bSetAsActiveConnection - ) const = 0; - - virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection> getRowSetConnection( - const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XRowSet>& _rxRowSet) - const = 0; - - virtual ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatsSupplier> getNumberFormats( - const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection>& _rxConn, - bool _bAllowDefault - ) const = 0; - - virtual sal_Int32 getDefaultNumberFormat( - const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& _rxColumn, - const ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatTypes >& _rxTypes, - const ::com::sun::star::lang::Locale& _rLocale - ) const = 0; - - virtual void TransferFormComponentProperties( - const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet>& _rxOld, - const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet>& _rxNew, - const ::com::sun::star::lang::Locale& _rLocale - ) const = 0; - - virtual OUString quoteName( - const OUString& _rQuote, - const OUString& _rName - ) const = 0; - - virtual OUString composeTableNameForSelect( - const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >& _rxConnection, - const OUString& _rCatalog, - const OUString& _rSchema, - const OUString& _rName - ) const = 0; - - virtual OUString composeTableNameForSelect( - const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >& _rxConnection, - const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet>& _xTable - ) const = 0; - - virtual ::com::sun::star::sdb::SQLContext prependContextInfo( - ::com::sun::star::sdbc::SQLException& _rException, - const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _rxContext, - const OUString& _rContextDescription, - const OUString& _rContextDetails - ) const = 0; - - virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XDataSource > getDataSource( - const OUString& _rsRegisteredName, - const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext>& _rxContext - ) const = 0; - - virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > - getFieldsByCommandDescriptor( - const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >& _rxConnection, - const sal_Int32 _nCommandType, - const OUString& _rCommand, - ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent >& _rxKeepFieldsAlive, - ::dbtools::SQLExceptionInfo* _pErrorInfo = NULL - ) = 0; - - virtual ::com::sun::star::uno::Sequence< OUString > - getFieldNamesByCommandDescriptor( - const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >& _rxConnection, - const sal_Int32 _nCommandType, - const OUString& _rCommand, - ::dbtools::SQLExceptionInfo* _pErrorInfo = NULL - ) = 0; - - /** check if the property "Privileges" supports ::com::sun::star::sdbcx::Privilege::INSERT - @param _rxCursorSet the property set - */ - virtual bool canInsert(const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet>& _rxCursorSet) const = 0; - - /** check if the property "Privileges" supports ::com::sun::star::sdbcx::Privilege::UPDATE - @param _rxCursorSet the property set - */ - virtual bool canUpdate(const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet>& _rxCursorSet) const = 0; - - /** check if the property "Privileges" supports ::com::sun::star::sdbcx::Privilege::DELETE - @param _rxCursorSet the property set - */ - virtual bool canDelete(const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet>& _rxCursorSet) const = 0; - - /** determines whether the given component is part of a document which is an embedded database - document (such as a form) - */ - virtual bool isEmbeddedInDatabase( - const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _rxComponent, - ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >& _rxActualConnection - ) = 0; - - protected: - virtual ~IDataAccessTools() {} - }; - - - //= IDataAccessCharSet - - /** simple wrapper for the OCharsetMap - */ - class OOO_DLLPUBLIC_DBTOOLS IDataAccessCharSet : - public salhelper::SimpleReferenceObject - { - // to be extended if necessary .... - public: - /** enumerates all supported char sets - @return the number of charsets supported - */ - virtual sal_Int32 getSupportedTextEncodings( - ::std::vector< rtl_TextEncoding >& /* [out] */ _rEncs - ) const = 0; - - protected: - virtual ~IDataAccessCharSet() {} - }; - - - //= IDataAccessTypeConversion - - class OOO_DLLPUBLIC_DBTOOLS IDataAccessTypeConversion : - public virtual salhelper::SimpleReferenceObject - { - public: - virtual ::com::sun::star::util::Date getStandardDate() const = 0; - - virtual double getValue( - const ::com::sun::star::uno::Reference< ::com::sun::star::sdb::XColumn>& _rxVariant, - const ::com::sun::star::util::Date& rNullDate ) const = 0; - - virtual OUString getFormattedValue( - const ::com::sun::star::uno::Reference< ::com::sun::star::sdb::XColumn >& _rxColumn, - const ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatter >& _rxFormatter, - const ::com::sun::star::util::Date& _rNullDate, - sal_Int32 _nKey, - sal_Int16 _nKeyType) const = 0; - - virtual OUString getFormattedValue( - const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet>& _rxColumn, - const ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatter>& _rxFormatter, - const ::com::sun::star::lang::Locale& _rLocale, - const ::com::sun::star::util::Date& _rNullDate - ) const = 0; - - protected: - virtual ~IDataAccessTypeConversion() {} - }; - - - //= ISQLParseNode - - /** a simple version of the OSQLParseNode, with all methods being virtual - */ - class OOO_DLLPUBLIC_DBTOOLS ISQLParseNode : public salhelper::SimpleReferenceObject - { - public: - virtual void parseNodeToStr(OUString& _rString, - const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >& _rxConnection, - const IParseContext* _pContext - ) const = 0; - - virtual void parseNodeToPredicateStr(OUString& _rString, - const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >& _rxConnection, - const ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatter >& _rxFormatter, - const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& _rxField, - const OUString &_sPredicateTableAlias, - const ::com::sun::star::lang::Locale& _rIntl, - const sal_Char _cDecSeparator, - const IParseContext* _pContext - ) const = 0; - - protected: - virtual ~ISQLParseNode() {} - }; - - - //= ISQLParser - - /** a simple version of the OSQLParser, with all methods being virtual - */ - class OOO_DLLPUBLIC_DBTOOLS ISQLParser : public salhelper::SimpleReferenceObject - { - public: - virtual ::rtl::Reference< ISQLParseNode > predicateTree( - OUString& rErrorMessage, - const OUString& rStatement, - const ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatter >& _rxFormatter, - const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& _rxField - ) const = 0; - - virtual const IParseContext& getContext() const = 0; - - protected: - virtual ~ISQLParser() {} - }; - - - //= IDataAccessToolsFactory - - /** the main factory for runtime-loadable tools in the DBTOOLS library - */ - class OOO_DLLPUBLIC_DBTOOLS IDataAccessToolsFactory : - public salhelper::SimpleReferenceObject - { - public: - /// creates a simple version of the class OSQLParser - virtual ::rtl::Reference< ISQLParser > createSQLParser( - const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& _rxContext, - const IParseContext* _pContext - ) const = 0; - - /// creates a helper for charset related functionality (OCharsetMap) - virtual ::rtl::Reference< IDataAccessCharSet > createCharsetHelper( ) const = 0; - - /// creates a simple version of the DBTypeConversion helper - virtual ::rtl::Reference< IDataAccessTypeConversion > getTypeConversionHelper() = 0; - - /// creates a helper which can be used to access the static methods in dbtools.hxx - virtual ::rtl::Reference< IDataAccessTools > getDataAccessTools() = 0; - - virtual ::std::unique_ptr< ::dbtools::FormattedColumnValue > createFormattedColumnValue( - const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& _rxContext, - const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XRowSet >& _rxRowSet, - const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& _rxColumn - ) = 0; - - protected: - virtual ~IDataAccessToolsFactory() {} - }; - - - } // namespace simple - - - -} // namespace connectivity - - -#endif // INCLUDED_CONNECTIVITY_VIRTUALDBTOOLS_HXX - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/dbcharsethelper.hxx b/include/svx/dbcharsethelper.hxx index ad02bd90a37c..395d33dfcb16 100644 --- a/include/svx/dbcharsethelper.hxx +++ b/include/svx/dbcharsethelper.hxx @@ -21,30 +21,19 @@ #define INCLUDED_SVX_DBCHARSETHELPER_HXX #include <svx/svxdllapi.h> -#include <connectivity/virtualdbtools.hxx> +#include <rtl/textenc.h> -namespace svxform -{ - - - - //= ODataAccessCharsetHelper +#include <vector> - class SVX_DLLPUBLIC SAL_WARN_UNUSED ODataAccessCharsetHelper - { - protected: - mutable ::rtl::Reference< ::connectivity::simple::IDataAccessCharSet > m_xCharsetHelper; - - public: - ODataAccessCharsetHelper( ); - - inline sal_Int32 getSupportedTextEncodings( ::std::vector< rtl_TextEncoding >& _rEncs ) const - { - return m_xCharsetHelper->getSupportedTextEncodings( _rEncs ); - } - }; +namespace svxform { namespace charset_helper +{ + /** enumerates all supported charsets + @return the number of charsets supported + */ + SVX_DLLPUBLIC sal_Int32 getSupportedTextEncodings( ::std::vector< rtl_TextEncoding >& _rEncs ); +} // namespace charset_helper } // namespace svxform diff --git a/sc/source/ui/docshell/docsh8.cxx b/sc/source/ui/docshell/docsh8.cxx index 193f50498d6f..c78021f26bf5 100644 --- a/sc/source/ui/docshell/docsh8.cxx +++ b/sc/source/ui/docshell/docsh8.cxx @@ -122,9 +122,8 @@ namespace OUString aConnUrl("sdbc:dbase:"); aConnUrl += aPath; - svxform::ODataAccessCharsetHelper aHelper; ::std::vector< rtl_TextEncoding > aEncodings; - aHelper.getSupportedTextEncodings( aEncodings ); + svxform::charset_helper::getSupportedTextEncodings( aEncodings ); ::std::vector< rtl_TextEncoding >::iterator aIter = ::std::find(aEncodings.begin(),aEncodings.end(),(rtl_TextEncoding) eCharSet); if ( aIter == aEncodings.end() ) { diff --git a/svx/source/dialog/txencbox.cxx b/svx/source/dialog/txencbox.cxx index 1f453d57f5d2..f9cf52f232be 100644 --- a/svx/source/dialog/txencbox.cxx +++ b/svx/source/dialog/txencbox.cxx @@ -138,9 +138,8 @@ void SvxTextEncodingBox::FillFromDbTextEncodingMap( #else rtl_TextEncodingInfo aInfo; aInfo.StructSize = sizeof(rtl_TextEncodingInfo); - svxform::ODataAccessCharsetHelper aCSH; ::std::vector< rtl_TextEncoding > aEncs; - sal_Int32 nCount = aCSH.getSupportedTextEncodings( aEncs ); + sal_Int32 nCount = svxform::charset_helper::getSupportedTextEncodings( aEncs ); for ( sal_Int32 j=0; j<nCount; j++ ) { bool bInsert = true; diff --git a/svx/source/fmcomp/gridcell.cxx b/svx/source/fmcomp/gridcell.cxx index cbad27e1bd6f..ca3e34fc4ae0 100644 --- a/svx/source/fmcomp/gridcell.cxx +++ b/svx/source/fmcomp/gridcell.cxx @@ -65,12 +65,12 @@ #include <vcl/settings.hxx> #include <connectivity/dbtools.hxx> #include <connectivity/dbconversion.hxx> +#include <connectivity/sqlnode.hxx> #include <math.h> #include <stdio.h> using namespace ::connectivity; -using namespace ::connectivity::simple; using namespace ::svxform; using namespace ::comphelper; using namespace ::svt; @@ -2909,8 +2909,8 @@ bool DbFilterField::commitControl() OUString aErrorMsg; Reference< XNumberFormatter > xNumberFormatter(m_rColumn.GetParent().getNumberFormatter()); - ::rtl::Reference< ISQLParseNode > xParseNode = predicateTree(aErrorMsg, aNewText,xNumberFormatter, m_rColumn.GetField()); - if (xParseNode.is()) + std::shared_ptr< OSQLParseNode > pParseNode = predicateTree(aErrorMsg, aNewText,xNumberFormatter, m_rColumn.GetField()); + if (pParseNode != nullptr) { OUString aPreparedText; @@ -2920,7 +2920,7 @@ bool DbFilterField::commitControl() Reference< XInterface >(*m_rColumn.GetParent().getDataSource()), UNO_QUERY); Reference< XConnection > xConnection(getConnection(xDataSourceRowSet)); - xParseNode->parseNodeToPredicateStr(aPreparedText, + pParseNode->parseNodeToPredicateStr(aPreparedText, xConnection, xNumberFormatter, m_rColumn.GetField(), diff --git a/svx/source/form/dbcharsethelper.cxx b/svx/source/form/dbcharsethelper.cxx index 326f955e3003..aa26c27aaaac 100644 --- a/svx/source/form/dbcharsethelper.cxx +++ b/svx/source/form/dbcharsethelper.cxx @@ -20,18 +20,30 @@ #include "svx/dbcharsethelper.hxx" #include <connectivity/dbtools.hxx> +#include <connectivity/dbcharset.hxx> using namespace ::dbtools; -namespace svxform +namespace svxform { namespace charset_helper { - ODataAccessCharsetHelper::ODataAccessCharsetHelper( ) + sal_Int32 getSupportedTextEncodings( ::std::vector< rtl_TextEncoding >& _rEncs ) { - m_xCharsetHelper = createCharsetHelper(); + OCharsetMap aCharsetInfo; + _rEncs.clear(); + + OCharsetMap::const_iterator aLoop = aCharsetInfo.begin(); + OCharsetMap::const_iterator aLoopEnd = aCharsetInfo.end(); + while (aLoop != aLoopEnd) + { + _rEncs.push_back( (*aLoop).getEncoding() ); + ++aLoop; + } + + return _rEncs.size(); } - +} // namespace charset_helper } // namespace svxform diff --git a/svx/source/form/filtnav.cxx b/svx/source/form/filtnav.cxx index 45a926f4bdb0..97744603341b 100644 --- a/svx/source/form/filtnav.cxx +++ b/svx/source/form/filtnav.cxx @@ -38,6 +38,7 @@ #include <comphelper/string.hxx> #include <comphelper/uno3.hxx> #include <connectivity/dbtools.hxx> +#include <connectivity/sqlnode.hxx> #include <cppuhelper/implbase1.hxx> #include <fmservs.hxx> #include <fmshimp.hxx> @@ -66,7 +67,6 @@ // das ist die Basis, mit der beide Angaben multipliziert werden (in ms) using namespace ::svxform; -using namespace ::connectivity::simple; using namespace ::connectivity; using namespace ::dbtools; @@ -880,14 +880,14 @@ bool FmFilterModel::ValidateText(FmFilterItem* pItem, OUString& rText, OUString& // parse the given text as filter predicate OUString aErr, aTxt( rText ); - ::rtl::Reference< ISQLParseNode > xParseNode = predicateTree( aErr, aTxt, xFormatter, xField ); + std::shared_ptr< OSQLParseNode > pParseNode = predicateTree( aErr, aTxt, xFormatter, xField ); rErrorMsg = aErr; rText = aTxt; - if ( xParseNode.is() ) + if ( pParseNode != nullptr ) { OUString aPreparedText; Locale aAppLocale = Application::GetSettings().GetUILanguageTag().getLocale(); - xParseNode->parseNodeToPredicateStr( + pParseNode->parseNodeToPredicateStr( aPreparedText, xConnection, xFormatter, xField, OUString(), aAppLocale, '.', getParseContext() ); rText = aPreparedText; return true; diff --git a/svx/source/form/formcontroller.cxx b/svx/source/form/formcontroller.cxx index 90daba66ed28..ab7a51f2339e 100644 --- a/svx/source/form/formcontroller.cxx +++ b/svx/source/form/formcontroller.cxx @@ -77,6 +77,7 @@ #include <cppuhelper/typeprovider.hxx> #include <connectivity/IParseContext.hxx> #include <connectivity/dbtools.hxx> +#include <connectivity/sqlparse.hxx> #include <toolkit/controls/unocontrol.hxx> #include <toolkit/helper/vclunohelper.hxx> #include <tools/debug.hxx> @@ -93,7 +94,6 @@ using namespace ::com::sun::star; using namespace ::comphelper; using namespace ::connectivity; -using namespace ::connectivity::simple; using namespace ::dbtools; @@ -821,13 +821,13 @@ void FormController::getFastPropertyValue( Any& rValue, sal_Int32 nHandle ) cons OUString sFilterValue( condition->second ); OUString sErrorMsg, sCriteria; - const ::rtl::Reference< ISQLParseNode > xParseNode = + const std::shared_ptr< OSQLParseNode > pParseNode = predicateTree( sErrorMsg, sFilterValue, xFormatter, xField ); - OSL_ENSURE( xParseNode.is(), "FormController::getFastPropertyValue: could not parse the field value predicate!" ); - if ( xParseNode.is() ) + OSL_ENSURE( pParseNode != nullptr, "FormController::getFastPropertyValue: could not parse the field value predicate!" ); + if ( pParseNode != nullptr ) { // don't use a parse context here, we need it unlocalized - xParseNode->parseNodeToStr( sCriteria, xConnection, NULL ); + pParseNode->parseNodeToStr( sCriteria, xConnection, NULL ); if ( condition != rRow.begin() ) aRowFilter.appendAscii( " AND " ); aRowFilter.append( sCriteria ); @@ -3109,7 +3109,7 @@ void FormController::setFilter(::std::vector<FmFieldInfo>& rFieldInfos) const LocaleDataWrapper& rLocaleWrapper( Application::GetSettings().GetUILocaleDataWrapper() ); /* FIXME: casting this to sal_Char is plain wrong and of course only * works for ASCII separators, but - * xParseNode->parseNodeToPredicateStr() expects a sal_Char. Fix it + * pParseNode->parseNodeToPredicateStr() expects a sal_Char. Fix it * there. */ sal_Char cDecimalSeparator = (sal_Char)rLocaleWrapper.getNumDecimalSep()[0]; SAL_WARN_IF( (sal_Unicode)cDecimalSeparator != rLocaleWrapper.getNumDecimalSep()[0], @@ -3180,7 +3180,7 @@ void FormController::setFilter(::std::vector<FmFieldInfo>& rFieldInfos) { OUString aCompText = aRow[(*iter).xText]; aCompText += " "; - OString aVal = m_xParser->getContext().getIntlKeywordAscii(IParseContext::KEY_AND); + OString aVal = m_pParser->getContext().getIntlKeywordAscii(IParseContext::KEY_AND); aCompText += OUString(aVal.getStr(),aVal.getLength(),RTL_TEXTENCODING_ASCII_US); aCompText += " "; aCompText += ::comphelper::getString(pRefValues[j].Value); @@ -3190,11 +3190,11 @@ void FormController::setFilter(::std::vector<FmFieldInfo>& rFieldInfos) { OUString sPredicate,sErrorMsg; pRefValues[j].Value >>= sPredicate; - ::rtl::Reference< ISQLParseNode > xParseNode = predicateTree(sErrorMsg, sPredicate, xFormatter, xField); - if ( xParseNode.is() ) + std::shared_ptr< OSQLParseNode > pParseNode = predicateTree(sErrorMsg, sPredicate, xFormatter, xField); + if ( pParseNode != nullptr ) { OUString sCriteria; - xParseNode->parseNodeToPredicateStr( sCriteria + pParseNode->parseNodeToPredicateStr( sCriteria ,xConnection ,xFormatter ,xField diff --git a/svx/source/form/sqlparserclient.cxx b/svx/source/form/sqlparserclient.cxx index b374c8eaf876..bb8d7d458199 100644 --- a/svx/source/form/sqlparserclient.cxx +++ b/svx/source/form/sqlparserclient.cxx @@ -21,8 +21,10 @@ #include "svx/ParseContext.hxx" #include <connectivity/dbtools.hxx> +#include <connectivity/sqlparse.hxx> using namespace ::dbtools; +using namespace ::connectivity; namespace svxform { @@ -30,11 +32,20 @@ namespace svxform using namespace ::com::sun::star::lang; OSQLParserClient::OSQLParserClient(const Reference< XComponentContext >& rxContext) + : m_pParser(new OSQLParser(rxContext, getParseContext())) { m_xContext = rxContext; - m_xParser = createSQLParser(m_xContext, getParseContext()); } + std::shared_ptr< ::connectivity::OSQLParseNode > OSQLParserClient::predicateTree( + OUString& _rErrorMessage, + const OUString& _rStatement, + const ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatter >& _rxFormatter, + const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& _rxField + ) const + { + return std::shared_ptr< OSQLParseNode >(m_pParser->predicateTree(_rErrorMessage, _rStatement, _rxFormatter, _rxField)); + } } // namespace svxform diff --git a/svx/source/inc/gridcell.hxx b/svx/source/inc/gridcell.hxx index 8d1ddf95be69..7b57851c3fff 100644 --- a/svx/source/inc/gridcell.hxx +++ b/svx/source/inc/gridcell.hxx @@ -49,6 +49,9 @@ class DbCellControl; class Edit; class FmXGridCell; +namespace dbtools { + class FormattedColumnValue; +} class FmMutexHelper { diff --git a/svx/source/inc/sqlparserclient.hxx b/svx/source/inc/sqlparserclient.hxx index fc5152a1c523..85924e4696b0 100644 --- a/svx/source/inc/sqlparserclient.hxx +++ b/svx/source/inc/sqlparserclient.hxx @@ -21,8 +21,19 @@ #define INCLUDED_SVX_SOURCE_INC_SQLPARSERCLIENT_HXX #include "svx/ParseContext.hxx" -#include <com/sun/star/lang/XMultiServiceFactory.hpp> -#include <connectivity/virtualdbtools.hxx> + +namespace com { namespace sun { namespace star { +namespace util { + class XNumberFormatter; +} +namespace beans { + class XPropertySet; +} } } } + +namespace connectivity { + class OSQLParser; + class OSQLParseNode; +} namespace svxform { @@ -31,26 +42,20 @@ namespace svxform class SVX_DLLPUBLIC OSQLParserClient : public ::svxform::OParseContextClient { private: - ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > m_xContext; protected: - mutable ::rtl::Reference< ::connectivity::simple::ISQLParser > m_xParser; + mutable std::shared_ptr< ::connectivity::OSQLParser > m_pParser; - protected: OSQLParserClient( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext); - protected: - inline ::rtl::Reference< ::connectivity::simple::ISQLParseNode > predicateTree( + std::shared_ptr< ::connectivity::OSQLParseNode > predicateTree( OUString& _rErrorMessage, const OUString& _rStatement, const ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatter >& _rxFormatter, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& _rxField - ) const - { - return m_xParser->predicateTree(_rErrorMessage, _rStatement, _rxFormatter, _rxField); - } + ) const; }; |