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
19e29442
Kaydet (Commit)
19e29442
authored
Ara 05, 2001
tarafından
Kai Sommerfeld
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
#95600# - XRow implementation now uses Type Converter service if needed.
üst
25877506
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
101 additions
and
17 deletions
+101
-17
cached.xml
ucb/source/cacher/cached.xml
+5
-0
cachedcontentresultset.cxx
ucb/source/cacher/cachedcontentresultset.cxx
+62
-6
cachedcontentresultset.hxx
ucb/source/cacher/cachedcontentresultset.hxx
+30
-7
cacheddynamicresultset.cxx
ucb/source/cacher/cacheddynamicresultset.cxx
+4
-4
No files found.
ucb/source/cacher/cached.xml
Dosyayı görüntüle @
19e29442
...
...
@@ -26,6 +26,10 @@
<supported-service>
com.sun.star.ucb.CachedContentResultSetFactory
</supported-service>
<service-dependency>
com.sun.star.script.Converter
</service-dependency>
</component-description>
<component-description>
<author>
...
...
@@ -115,6 +119,7 @@
<type>
com.sun.star.lang.XSingleServiceFactory
</type>
<type>
com.sun.star.lang.XTypeProvider
</type>
<type>
com.sun.star.registry.XRegistryKey
</type>
<type>
com.sun.star.script.XTypeConverter
</type>
<type>
com.sun.star.sdbc.FetchDirection
</type>
<type>
com.sun.star.sdbc.ResultSetType
</type>
<type>
com.sun.star.sdbc.XCloseable
</type>
...
...
ucb/source/cacher/cachedcontentresultset.cxx
Dosyayı görüntüle @
19e29442
...
...
@@ -2,9 +2,9 @@
*
* $RCSfile: cachedcontentresultset.cxx,v $
*
* $Revision: 1.
6
$
* $Revision: 1.
7
$
*
* last change: $Author: kso $ $Date: 2001-
04-05 09:50:1
3 $
* last change: $Author: kso $ $Date: 2001-
12-05 13:03:4
3 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
...
...
@@ -77,6 +77,10 @@
#include <com/sun/star/beans/PropertyAttribute.hpp>
#endif
#ifndef _COM_SUN_STAR_SCRIPT_XTYPECONVERTER_HPP_
#include <com/sun/star/script/XTypeConverter.hpp>
#endif
#ifndef _COM_SUN_STAR_SDBC_RESULTSETTYPE_HPP_
#include <com/sun/star/sdbc/ResultSetType.hpp>
#endif
...
...
@@ -91,6 +95,7 @@
using
namespace
com
::
sun
::
star
::
beans
;
using
namespace
com
::
sun
::
star
::
lang
;
using
namespace
com
::
sun
::
star
::
script
;
using
namespace
com
::
sun
::
star
::
sdbc
;
using
namespace
com
::
sun
::
star
::
ucb
;
using
namespace
com
::
sun
::
star
::
uno
;
...
...
@@ -142,9 +147,32 @@ if( !m_aCache.hasRow( nRow ) ) \
} \
} \
const Any& rValue = m_aCache.getAny( nRow, columnIndex );\
Type aRet
;
\
Type aRet
= Type();
\
m_bLastReadWasFromCache = sal_True; \
m_bLastCachedReadWasNull = !( rValue >>= aRet ); \
/* Last chance. Try type converter service... */
\
if ( m_bLastCachedReadWasNull && rValue.hasValue() ) \
{ \
Reference< XTypeConverter > xConverter \
= getTypeConverter(); \
if ( xConverter.is() ) \
{ \
try \
{ \
Any aConvAny = xConverter->convertTo( \
rValue, \
getCppuType( static_cast< \
const Type * >( 0 ) ) ); \
m_bLastCachedReadWasNull = !( aConvAny >>= aRet ); \
} \
catch ( IllegalArgumentException ) \
{ \
} \
catch ( CannotConvertException ) \
{ \
} \
} \
} \
return aRet;
//--------------------------------------------------------------------------
...
...
@@ -681,11 +709,14 @@ sal_Int32 SAL_CALL CCRS_PropertySetInfo
//--------------------------------------------------------------------------
//--------------------------------------------------------------------------
CachedContentResultSet
::
CachedContentResultSet
(
Reference
<
XResultSet
>
xOrigin
,
Reference
<
XContentIdentifierMapping
>
CachedContentResultSet
::
CachedContentResultSet
(
const
Reference
<
XMultiServiceFactory
>
&
xSMgr
,
const
Reference
<
XResultSet
>
&
xOrigin
,
const
Reference
<
XContentIdentifierMapping
>
&
xContentIdentifierMapping
)
:
ContentResultSetWrapper
(
xOrigin
)
,
m_xSMgr
(
xSMgr
)
,
m_xFetchProvider
(
NULL
)
,
m_xFetchProviderForContentAccess
(
NULL
)
,
m_xContentIdentifierMapping
(
xContentIdentifierMapping
)
...
...
@@ -710,6 +741,8 @@ CachedContentResultSet::CachedContentResultSet( Reference< XResultSet > xOrigin
,
m_aCacheContentIdentifierString
(
m_xContentIdentifierMapping
)
,
m_aCacheContentIdentifier
(
m_xContentIdentifierMapping
)
,
m_aCacheContent
(
m_xContentIdentifierMapping
)
,
m_xTypeConverter
(
NULL
)
,
m_bTriedToGetTypeConverter
(
sal_False
)
{
m_xFetchProvider
=
Reference
<
XFetchProvider
>
(
m_xResultSetOrigin
,
UNO_QUERY
);
OSL_ENSURE
(
m_xFetchProvider
.
is
(),
"interface XFetchProvider is required"
);
...
...
@@ -2176,6 +2209,29 @@ Reference< XArray > SAL_CALL CachedContentResultSet
XROW_GETXXX
(
getArray
,
Reference
<
XArray
>
);
}
//-----------------------------------------------------------------
// Type Converter Support
//-----------------------------------------------------------------
const
Reference
<
XTypeConverter
>&
CachedContentResultSet
::
getTypeConverter
()
{
osl
::
Guard
<
osl
::
Mutex
>
aGuard
(
m_aMutex
);
if
(
!
m_bTriedToGetTypeConverter
&&
!
m_xTypeConverter
.
is
()
)
{
m_bTriedToGetTypeConverter
=
sal_True
;
m_xTypeConverter
=
Reference
<
XTypeConverter
>
(
m_xSMgr
->
createInstance
(
OUString
::
createFromAscii
(
"com.sun.star.script.Converter"
)
),
UNO_QUERY
);
OSL_ENSURE
(
m_xTypeConverter
.
is
(),
"PropertyValueSet::getTypeConverter() - "
"Service 'com.sun.star.script.Converter' n/a!"
);
}
return
m_xTypeConverter
;
}
//--------------------------------------------------------------------------
//--------------------------------------------------------------------------
...
...
@@ -2239,7 +2295,7 @@ Reference< XResultSet > SAL_CALL CachedContentResultSetFactory
throw
(
com
::
sun
::
star
::
uno
::
RuntimeException
)
{
Reference
<
XResultSet
>
xRet
;
xRet
=
new
CachedContentResultSet
(
xSource
,
xMapping
);
xRet
=
new
CachedContentResultSet
(
m_xSMgr
,
xSource
,
xMapping
);
return
xRet
;
}
ucb/source/cacher/cachedcontentresultset.hxx
Dosyayı görüntüle @
19e29442
...
...
@@ -2,9 +2,9 @@
*
* $RCSfile: cachedcontentresultset.hxx,v $
*
* $Revision: 1.
2
$
* $Revision: 1.
3
$
*
* last change: $Author: kso $ $Date: 200
0-10-31 10:37:35
$
* last change: $Author: kso $ $Date: 200
1-12-05 13:03:43
$
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
...
...
@@ -99,6 +99,10 @@
//=========================================================================
namespace
com
{
namespace
sun
{
namespace
star
{
namespace
script
{
class
XTypeConverter
;
}
}
}
}
class
CCRS_PropertySetInfo
;
class
CachedContentResultSet
:
public
ContentResultSetWrapper
...
...
@@ -174,6 +178,9 @@ class CachedContentResultSet
//-----------------------------------------------------------------
//members
com
::
sun
::
star
::
uno
::
Reference
<
com
::
sun
::
star
::
lang
::
XMultiServiceFactory
>
m_xSMgr
;
//different Interfaces from Origin:
com
::
sun
::
star
::
uno
::
Reference
<
com
::
sun
::
star
::
ucb
::
XFetchProvider
>
m_xFetchProvider
;
//XFetchProvider-interface from m_xOrigin
...
...
@@ -249,11 +256,15 @@ private:
impl_changeIsRowCountFinal
(
sal_Bool
bOld
,
sal_Bool
bNew
);
public
:
CachedContentResultSet
(
com
::
sun
::
star
::
uno
::
Reference
<
com
::
sun
::
star
::
sdbc
::
XResultSet
>
xOrigin
,
com
::
sun
::
star
::
uno
::
Reference
<
com
::
sun
::
star
::
ucb
::
XContentIdentifierMapping
>
xContentIdentifierMapping
);
CachedContentResultSet
(
const
com
::
sun
::
star
::
uno
::
Reference
<
com
::
sun
::
star
::
lang
::
XMultiServiceFactory
>
&
xSMgr
,
const
com
::
sun
::
star
::
uno
::
Reference
<
com
::
sun
::
star
::
sdbc
::
XResultSet
>
&
xOrigin
,
const
com
::
sun
::
star
::
uno
::
Reference
<
com
::
sun
::
star
::
ucb
::
XContentIdentifierMapping
>
&
xContentIdentifierMapping
);
virtual
~
CachedContentResultSet
();
...
...
@@ -509,6 +520,18 @@ public:
getArray
(
sal_Int32
columnIndex
)
throw
(
com
::
sun
::
star
::
sdbc
::
SQLException
,
com
::
sun
::
star
::
uno
::
RuntimeException
);
//-----------------------------------------------------------------
// Type Converter support
//-----------------------------------------------------------------
private
:
sal_Bool
m_bTriedToGetTypeConverter
;
com
::
sun
::
star
::
uno
::
Reference
<
com
::
sun
::
star
::
script
::
XTypeConverter
>
m_xTypeConverter
;
const
com
::
sun
::
star
::
uno
::
Reference
<
com
::
sun
::
star
::
script
::
XTypeConverter
>&
getTypeConverter
();
};
//=========================================================================
...
...
ucb/source/cacher/cacheddynamicresultset.cxx
Dosyayı görüntüle @
19e29442
...
...
@@ -2,9 +2,9 @@
*
* $RCSfile: cacheddynamicresultset.cxx,v $
*
* $Revision: 1.
3
$
* $Revision: 1.
4
$
*
* last change: $Author: kso $ $Date: 2001-
04-05 09:50:1
3 $
* last change: $Author: kso $ $Date: 2001-
12-05 13:03:4
3 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
...
...
@@ -102,7 +102,7 @@ void SAL_CALL CachedDynamicResultSet
OSL_ENSURE
(
m_xSourceResultOne
.
is
(),
"need source resultset"
);
Reference
<
XResultSet
>
xCache
(
new
CachedContentResultSet
(
m_xSourceResultOne
,
m_xContentIdentifierMapping
)
);
new
CachedContentResultSet
(
m_xS
Mgr
,
m_xS
ourceResultOne
,
m_xContentIdentifierMapping
)
);
osl
::
Guard
<
osl
::
Mutex
>
aGuard
(
m_aMutex
);
m_xMyResultOne
=
xCache
;
...
...
@@ -116,7 +116,7 @@ void SAL_CALL CachedDynamicResultSet
OSL_ENSURE
(
m_xSourceResultTwo
.
is
(),
"need source resultset"
);
Reference
<
XResultSet
>
xCache
(
new
CachedContentResultSet
(
m_xSourceResultTwo
,
m_xContentIdentifierMapping
)
);
new
CachedContentResultSet
(
m_xS
Mgr
,
m_xS
ourceResultTwo
,
m_xContentIdentifierMapping
)
);
osl
::
Guard
<
osl
::
Mutex
>
aGuard
(
m_aMutex
);
m_xMyResultTwo
=
xCache
;
...
...
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