Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
core
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
LibreOffice
core
Commits
ece4466e
Kaydet (Commit)
ece4466e
authored
May 08, 2015
tarafından
Stephan Bergmann
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
loplugin:staticmethods
Change-Id: Ic93e560641f1ec1c5fc316ed126617c6d99ab5b5
üst
1394e454
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
138 additions
and
144 deletions
+138
-144
NResultSet.cxx
connectivity/source/drivers/evoab2/NResultSet.cxx
+39
-31
NStatement.cxx
connectivity/source/drivers/evoab2/NStatement.cxx
+20
-21
NStatement.hxx
connectivity/source/drivers/evoab2/NStatement.hxx
+0
-4
KDriver.cxx
connectivity/source/drivers/kab/KDriver.cxx
+79
-72
KDriver.hxx
connectivity/source/drivers/kab/KDriver.hxx
+0
-16
No files found.
connectivity/source/drivers/evoab2/NResultSet.cxx
Dosyayı görüntüle @
ece4466e
...
...
@@ -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
()
...
...
connectivity/source/drivers/evoab2/NStatement.cxx
Dosyayı görüntüle @
ece4466e
...
...
@@ -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"
);
...
...
connectivity/source/drivers/evoab2/NStatement.hxx
Dosyayı görüntüle @
ece4466e
...
...
@@ -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
:
...
...
connectivity/source/drivers/kab/KDriver.cxx
Dosyayı görüntüle @
ece4466e
...
...
@@ -56,6 +56,82 @@ using namespace com::sun::star::sdb;
using
namespace
com
::
sun
::
star
::
frame
;
using
namespace
connectivity
::
kab
;
namespace
{
/** throws a generic SQL exception with SQLState S1000 and error code 0
*/
void
throwGenericSQLException
(
const
OUString
&
_rMessage
)
{
SQLException
aError
;
aError
.
Message
=
_rMessage
;
aError
.
SQLState
=
"S1000"
;
aError
.
ErrorCode
=
0
;
throw
aError
;
}
/** throws an SQLException saying than no KDE installation was found
*/
void
throwNoKdeException
()
{
::
connectivity
::
SharedResources
aResources
;
const
OUString
sError
(
aResources
.
getResourceString
(
STR_NO_KDE_INST
)
);
throwGenericSQLException
(
sError
);
}
/** throws an SQLException saying that the found KDE version is too old
*/
void
throwKdeTooOldException
()
{
::
connectivity
::
SharedResources
aResources
;
const
OUString
sError
(
aResources
.
getResourceStringWithSubstitution
(
STR_KDE_VERSION_TOO_OLD
,
"$major$"
,
OUString
::
number
(
MIN_KDE_VERSION_MAJOR
),
"$minor$"
,
OUString
::
number
(
MIN_KDE_VERSION_MINOR
)
)
);
throwGenericSQLException
(
sError
);
}
/** throws an SQLException saying that the found KDE version is too new
*/
void
throwKdeTooNewException
()
{
::
connectivity
::
SharedResources
aResources
;
SQLException
aError
;
aError
.
Message
=
aResources
.
getResourceStringWithSubstitution
(
STR_KDE_VERSION_TOO_NEW
,
"$major$"
,
OUString
::
number
(
MIN_KDE_VERSION_MAJOR
),
"$minor$"
,
OUString
::
number
(
MIN_KDE_VERSION_MINOR
)
);
aError
.
SQLState
=
"S1000"
;
aError
.
ErrorCode
=
0
;
SQLContext
aDetails
;
OUStringBuffer
aMessage
;
aMessage
.
append
(
aResources
.
getResourceString
(
STR_KDE_VERSION_TOO_NEW_WORK_AROUND
)
);
aMessage
.
appendAscii
(
"Sub disableKDEMaxVersionCheck
\n
"
);
aMessage
.
appendAscii
(
" BasicLibraries.LoadLibrary(
\"
Tools
\"
)
\n
"
);
aMessage
.
appendAscii
(
" Dim configNode as Object
\n
"
);
aMessage
.
appendAscii
(
" configNode = GetRegistryKeyContent(
\"
"
);
aMessage
.
append
(
KabDriver
::
impl_getConfigurationSettingsPath
()
);
aMessage
.
appendAscii
(
"
\"
, true )
\n
"
);
aMessage
.
appendAscii
(
" configNode.DisableKDEMaximumVersionCheck = TRUE
\n
"
);
aMessage
.
appendAscii
(
" configNode.commitChanges
\n
"
);
aMessage
.
appendAscii
(
"End Sub
\n
"
);
aDetails
.
Message
=
aMessage
.
makeStringAndClear
();
aError
.
NextException
<<=
aDetails
;
throw
aError
;
}
}
// = KabImplModule
...
...
@@ -172,16 +248,16 @@ void KabImplModule::impl_unloadModule()
void
KabImplModule
::
init
()
{
if
(
!
impl_loadModule
()
)
impl_
throwNoKdeException
();
throwNoKdeException
();
// if we're not running on a supported version, throw
KabImplModule
::
KDEVersionType
eKDEVersion
=
matchKDEVersion
();
if
(
eKDEVersion
==
eTooOld
)
impl_
throwKdeTooOldException
();
throwKdeTooOldException
();
if
(
(
eKDEVersion
==
eToNew
)
&&
!
impl_doAllowNewKDEVersion
()
)
impl_
throwKdeTooNewException
();
throwKdeTooNewException
();
if
(
!
m_bAttemptedInitialize
)
{
...
...
@@ -221,75 +297,6 @@ bool KabImplModule::impl_doAllowNewKDEVersion()
}
void
KabImplModule
::
impl_throwNoKdeException
()
{
::
connectivity
::
SharedResources
aResources
;
const
OUString
sError
(
aResources
.
getResourceString
(
STR_NO_KDE_INST
)
);
impl_throwGenericSQLException
(
sError
);
}
void
KabImplModule
::
impl_throwKdeTooOldException
()
{
::
connectivity
::
SharedResources
aResources
;
const
OUString
sError
(
aResources
.
getResourceStringWithSubstitution
(
STR_KDE_VERSION_TOO_OLD
,
"$major$"
,
OUString
::
number
(
MIN_KDE_VERSION_MAJOR
),
"$minor$"
,
OUString
::
number
(
MIN_KDE_VERSION_MINOR
)
)
);
impl_throwGenericSQLException
(
sError
);
}
void
KabImplModule
::
impl_throwGenericSQLException
(
const
OUString
&
_rMessage
)
{
SQLException
aError
;
aError
.
Message
=
_rMessage
;
aError
.
SQLState
=
"S1000"
;
aError
.
ErrorCode
=
0
;
throw
aError
;
}
void
KabImplModule
::
impl_throwKdeTooNewException
()
{
::
connectivity
::
SharedResources
aResources
;
SQLException
aError
;
aError
.
Message
=
aResources
.
getResourceStringWithSubstitution
(
STR_KDE_VERSION_TOO_NEW
,
"$major$"
,
OUString
::
number
(
MIN_KDE_VERSION_MAJOR
),
"$minor$"
,
OUString
::
number
(
MIN_KDE_VERSION_MINOR
)
);
aError
.
SQLState
=
"S1000"
;
aError
.
ErrorCode
=
0
;
SQLContext
aDetails
;
OUStringBuffer
aMessage
;
aMessage
.
append
(
aResources
.
getResourceString
(
STR_KDE_VERSION_TOO_NEW_WORK_AROUND
)
);
aMessage
.
appendAscii
(
"Sub disableKDEMaxVersionCheck
\n
"
);
aMessage
.
appendAscii
(
" BasicLibraries.LoadLibrary(
\"
Tools
\"
)
\n
"
);
aMessage
.
appendAscii
(
" Dim configNode as Object
\n
"
);
aMessage
.
appendAscii
(
" configNode = GetRegistryKeyContent(
\"
"
);
aMessage
.
append
(
KabDriver
::
impl_getConfigurationSettingsPath
()
);
aMessage
.
appendAscii
(
"
\"
, true )
\n
"
);
aMessage
.
appendAscii
(
" configNode.DisableKDEMaximumVersionCheck = TRUE
\n
"
);
aMessage
.
appendAscii
(
" configNode.commitChanges
\n
"
);
aMessage
.
appendAscii
(
"End Sub
\n
"
);
aDetails
.
Message
=
aMessage
.
makeStringAndClear
();
aError
.
NextException
<<=
aDetails
;
throw
aError
;
}
css
::
uno
::
Reference
<
css
::
sdbc
::
XConnection
>
KabImplModule
::
createConnection
(
KabDriver
*
driver
)
const
{
...
...
connectivity/source/drivers/kab/KDriver.hxx
Dosyayı görüntüle @
ece4466e
...
...
@@ -122,22 +122,6 @@ namespace connectivity
*/
void
impl_unloadModule
();
/** throws an SQLException saying than no KDE installation was found
*/
void
impl_throwNoKdeException
();
/** throws an SQLException saying that the found KDE version is too old
*/
void
impl_throwKdeTooOldException
();
/** throws an SQLException saying that the found KDE version is too new
*/
void
impl_throwKdeTooNewException
();
/** throws a generic SQL exception with SQLState S1000 and error code 0
*/
void
impl_throwGenericSQLException
(
const
OUString
&
_rMessage
);
/** determines whether it's allowed to run on a too-new (not confirmed to work) version
*/
bool
impl_doAllowNewKDEVersion
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment