summaryrefslogtreecommitdiff
path: root/connectivity/source/drivers/evoab2
diff options
context:
space:
mode:
Diffstat (limited to 'connectivity/source/drivers/evoab2')
-rw-r--r--connectivity/source/drivers/evoab2/NResultSet.cxx70
-rw-r--r--connectivity/source/drivers/evoab2/NStatement.cxx41
-rw-r--r--connectivity/source/drivers/evoab2/NStatement.hxx4
3 files changed, 59 insertions, 56 deletions
diff --git a/connectivity/source/drivers/evoab2/NResultSet.cxx b/connectivity/source/drivers/evoab2/NResultSet.cxx
index 7fc072f6c6d1..077bf1690b91 100644
--- a/connectivity/source/drivers/evoab2/NResultSet.cxx
+++ b/connectivity/source/drivers/evoab2/NResultSet.cxx
@@ -368,6 +368,18 @@ OString OEvoabVersionHelper::getUserName( EBook *pBook )
return aName;
}
+namespace {
+
+bool isBookBackend( EBookClient *pBook, const char *backendname)
+{
+ if (!pBook)
+ return false;
+ ESource *pSource = e_client_get_source ((EClient *) pBook);
+ return isSourceBackend(pSource, backendname);
+}
+
+}
+
class OEvoabVersion36Helper : public OEvoabVersionHelper
{
private:
@@ -416,14 +428,6 @@ public:
return pBook;
}
- bool isBookBackend( EBookClient *pBook, const char *backendname)
- {
- if (!pBook)
- return false;
- ESource *pSource = e_client_get_source ((EClient *) pBook);
- return isSourceBackend(pSource, backendname);
- }
-
virtual bool isLDAP( EBook *pBook ) SAL_OVERRIDE
{
return isBookBackend(pBook, "ldap");
@@ -490,37 +494,41 @@ protected:
}
};
-class OEvoabVersion35Helper : public OEvoabVersionHelper
-{
-private:
- GList *m_pContacts;
+namespace {
- ESource * findSource( const char *id )
- {
- ESourceList *pSourceList = NULL;
+ESource * findSource( const char *id )
+{
+ ESourceList *pSourceList = NULL;
- g_return_val_if_fail (id != NULL, NULL);
+ g_return_val_if_fail (id != NULL, NULL);
- if (!e_book_get_addressbooks (&pSourceList, NULL))
- pSourceList = NULL;
+ if (!e_book_get_addressbooks (&pSourceList, NULL))
+ pSourceList = NULL;
- for ( GSList *g = e_source_list_peek_groups (pSourceList); g; g = g->next)
+ for ( GSList *g = e_source_list_peek_groups (pSourceList); g; g = g->next)
+ {
+ for (GSList *s = e_source_group_peek_sources (E_SOURCE_GROUP (g->data)); s; s = s->next)
{
- for (GSList *s = e_source_group_peek_sources (E_SOURCE_GROUP (g->data)); s; s = s->next)
- {
- ESource *pSource = E_SOURCE (s->data);
- if (!strcmp (e_source_peek_name (pSource), id))
- return pSource;
- }
+ ESource *pSource = E_SOURCE (s->data);
+ if (!strcmp (e_source_peek_name (pSource), id))
+ return pSource;
}
- return NULL;
}
+ return NULL;
+}
- bool isAuthRequired( EBook *pBook )
- {
- return e_source_get_property( e_book_get_source( pBook ),
- "auth" ) != NULL;
- }
+bool isAuthRequired( EBook *pBook )
+{
+ return e_source_get_property( e_book_get_source( pBook ),
+ "auth" ) != NULL;
+}
+
+}
+
+class OEvoabVersion35Helper : public OEvoabVersionHelper
+{
+private:
+ GList *m_pContacts;
public:
OEvoabVersion35Helper()
diff --git a/connectivity/source/drivers/evoab2/NStatement.cxx b/connectivity/source/drivers/evoab2/NStatement.cxx
index c82418890572..f8cb606d62b9 100644
--- a/connectivity/source/drivers/evoab2/NStatement.cxx
+++ b/connectivity/source/drivers/evoab2/NStatement.cxx
@@ -49,6 +49,26 @@ using namespace com::sun::star::container;
using namespace com::sun::star::io;
using namespace com::sun::star::util;
+namespace {
+
+EBookQuery * createTrue()
+{ // Not the world's most efficient unconditional true but ...
+ return e_book_query_from_string("(exists \"full_name\")");
+}
+
+EBookQuery * createTest( const OUString &aColumnName,
+ EBookQueryTest eTest,
+ const OUString &aMatch )
+{
+ OString sMatch = OUStringToOString( aMatch, RTL_TEXTENCODING_UTF8 );
+ OString sColumnName = OUStringToOString( aColumnName, RTL_TEXTENCODING_UTF8 );
+
+ return e_book_query_field_test( e_contact_field_id( sColumnName.getStr() ),
+ eTest, sMatch.getStr() );
+}
+
+}
+
OCommonStatement::OCommonStatement(OEvoabConnection* _pConnection)
: OCommonStatement_IBase(m_aMutex)
, ::comphelper::OPropertyContainer(OCommonStatement_IBase::rBHelper)
@@ -152,27 +172,6 @@ void SAL_CALL OCommonStatement::close( ) throw(SQLException, RuntimeException,
dispose();
}
-
-EBookQuery *
-OCommonStatement::createTrue()
-{ // Not the world's most efficient unconditional true but ...
- return e_book_query_from_string("(exists \"full_name\")");
-}
-
-EBookQuery *
-OCommonStatement::createTest( const OUString &aColumnName,
- EBookQueryTest eTest,
- const OUString &aMatch )
-{
- OString sMatch = OUStringToOString( aMatch, RTL_TEXTENCODING_UTF8 );
- OString sColumnName = OUStringToOString( aColumnName, RTL_TEXTENCODING_UTF8 );
-
- return e_book_query_field_test( e_contact_field_id( sColumnName.getStr() ),
- eTest, sMatch.getStr() );
-}
-
-
-
OUString OCommonStatement::impl_getColumnRefColumnName_throw( const OSQLParseNode& _rColumnRef )
{
ENSURE_OR_THROW( SQL_ISRULE( &_rColumnRef, column_ref ), "internal error: only column_refs supported as LHS" );
diff --git a/connectivity/source/drivers/evoab2/NStatement.hxx b/connectivity/source/drivers/evoab2/NStatement.hxx
index 7d92717d5a48..9634ae8f8c1b 100644
--- a/connectivity/source/drivers/evoab2/NStatement.hxx
+++ b/connectivity/source/drivers/evoab2/NStatement.hxx
@@ -180,10 +180,6 @@ namespace connectivity
EBookQuery *whereAnalysis( const OSQLParseNode* parseTree );
void orderByAnalysis( const OSQLParseNode* _pOrderByClause, SortDescriptor& _out_rSort );
OUString getTableName();
- EBookQuery *createTrue();
- EBookQuery *createTest( const OUString &aColumnName,
- EBookQueryTest eTest,
- const OUString &aMatch );
public: