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
78b2bf15
Kaydet (Commit)
78b2bf15
authored
Eyl 19, 2012
tarafından
Ariel Constenla-Haile
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Ensure UNO context propagation on drivers instantiation
üst
54b984f7
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
5 deletions
+10
-5
mdrivermanager.cxx
connectivity/source/manager/mdrivermanager.cxx
+5
-3
mdrivermanager.hxx
connectivity/source/manager/mdrivermanager.hxx
+5
-2
No files found.
connectivity/source/manager/mdrivermanager.cxx
Dosyayı görüntüle @
78b2bf15
...
...
@@ -125,7 +125,8 @@ Any SAL_CALL ODriverEnumeration::nextElement( ) throw(NoSuchElementException, W
// we did not load this driver, yet
if
(
_rDescriptor
.
xComponentFactory
.
is
()
)
// we have a factory for it
const_cast
<
DriverAccess
&
>
(
_rDescriptor
).
xDriver
=
_rDescriptor
.
xDriver
.
query
(
_rDescriptor
.
xComponentFactory
->
createInstance
()
);
const_cast
<
DriverAccess
&
>
(
_rDescriptor
).
xDriver
=
_rDescriptor
.
xDriver
.
query
(
_rDescriptor
.
xComponentFactory
->
createInstanceWithContext
(
_rDescriptor
.
xUNOContext
)
);
return
_rDescriptor
;
}
};
...
...
@@ -318,7 +319,7 @@ void OSDBCDriverManager::bootstrapDrivers()
OSL_ENSURE
(
xEnumDrivers
.
is
(),
"OSDBCDriverManager::bootstrapDrivers: no enumeration for the drivers available!"
);
if
(
xEnumDrivers
.
is
())
{
Reference
<
XSingle
Service
Factory
>
xFactory
;
Reference
<
XSingle
Component
Factory
>
xFactory
;
Reference
<
XServiceInfo
>
xSI
;
while
(
xEnumDrivers
->
hasMoreElements
())
{
...
...
@@ -337,6 +338,7 @@ void OSDBCDriverManager::bootstrapDrivers()
{
// yes -> no need to load the driver immediately (load it later when needed)
aDriverDescriptor
.
sImplementationName
=
xSI
->
getImplementationName
();
aDriverDescriptor
.
xComponentFactory
=
xFactory
;
aDriverDescriptor
.
xUNOContext
=
m_aContext
.
getUNOContext
();
bValidDescriptor
=
sal_True
;
m_aEventLogger
.
log
(
LogLevel
::
CONFIG
,
...
...
@@ -347,7 +349,7 @@ void OSDBCDriverManager::bootstrapDrivers()
else
{
// no -> create the driver
Reference
<
XDriver
>
xDriver
(
xFactory
->
createInstance
(
),
UNO_QUERY
);
Reference
<
XDriver
>
xDriver
(
xFactory
->
createInstance
WithContext
(
m_aContext
.
getUNOContext
()
),
UNO_QUERY
);
OSL_ENSURE
(
xDriver
.
is
(),
"OSDBCDriverManager::bootstrapDrivers: a driver which is no driver?!"
);
if
(
xDriver
.
is
()
)
...
...
connectivity/source/manager/mdrivermanager.hxx
Dosyayı görüntüle @
78b2bf15
...
...
@@ -30,7 +30,8 @@
#include <com/sun/star/uno/XNamingService.hpp>
#include <com/sun/star/lang/XServiceInfo.hpp>
#include <com/sun/star/sdbc/XDriverAccess.hpp>
#include <com/sun/star/lang/XSingleServiceFactory.hpp>
//#include <com/sun/star/lang/XSingleServiceFactory.hpp>
#include <com/sun/star/lang/XSingleComponentFactory.hpp>
#include <cppuhelper/implbase5.hxx>
#include <comphelper/stl_types.hxx>
...
...
@@ -48,11 +49,13 @@ namespace drivermanager
typedef
::
com
::
sun
::
star
::
uno
::
Reference
<
::
com
::
sun
::
star
::
sdbc
::
XDriver
>
SdbcDriver
;
DECLARE_STL_USTRINGACCESS_MAP
(
SdbcDriver
,
DriverCollection
);
typedef
::
com
::
sun
::
star
::
uno
::
Reference
<
::
com
::
sun
::
star
::
lang
::
XSingleServiceFactory
>
DriverFactory
;
typedef
::
com
::
sun
::
star
::
uno
::
Reference
<
::
com
::
sun
::
star
::
lang
::
XSingleComponentFactory
>
DriverFactory
;
typedef
::
com
::
sun
::
star
::
uno
::
Reference
<
::
com
::
sun
::
star
::
uno
::
XComponentContext
>
UNOContext
;
struct
DriverAccess
{
::
rtl
::
OUString
sImplementationName
;
/// the implementation name of the driver
DriverFactory
xComponentFactory
;
/// the factory to create the driver component (if not already done so)
UNOContext
xUNOContext
;
/// ensure UNO context propagation
SdbcDriver
xDriver
;
/// the driver itself
};
...
...
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