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
4c6a27aa
Kaydet (Commit)
4c6a27aa
authored
Haz 18, 2014
tarafından
Lionel Elie Mamane
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Use rtl::Reference to make code clearer & exception-safe
Change-Id: I8cfdf792541b351a19e16f95d4e6f7127e3d33b2
üst
b800ba09
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
22 deletions
+14
-22
FPreparedStatement.cxx
connectivity/source/drivers/file/FPreparedStatement.cxx
+13
-21
FPreparedStatement.hxx
connectivity/source/inc/file/FPreparedStatement.hxx
+1
-1
No files found.
connectivity/source/drivers/file/FPreparedStatement.cxx
Dosyayı görüntüle @
4c6a27aa
...
@@ -99,16 +99,15 @@ void OPreparedStatement::construct(const OUString& sql) throw(SQLException, Run
...
@@ -99,16 +99,15 @@ void OPreparedStatement::construct(const OUString& sql) throw(SQLException, Run
OResultSet
::
setBoundedColumns
(
m_aEvaluateRow
,
aTemp
,
m_xParamColumns
,
xNames
,
false
,
m_xDBMetaData
,
m_aColMapping
);
OResultSet
::
setBoundedColumns
(
m_aEvaluateRow
,
aTemp
,
m_xParamColumns
,
xNames
,
false
,
m_xDBMetaData
,
m_aColMapping
);
}
}
Reference
<
X
ResultSet
>
OPreparedStatement
::
makeResultSet
()
rtl
::
Reference
<
O
ResultSet
>
OPreparedStatement
::
makeResultSet
()
{
{
closeResultSet
();
closeResultSet
();
OResultSet
*
pResultSet
=
createResultSet
();
rtl
::
Reference
<
OResultSet
>
xResultSet
(
createResultSet
());
Reference
<
XResultSet
>
xRS
(
pResultSet
);
m_xResultSet
=
xResultSet
.
get
();
initializeResultSet
(
pResultSet
);
initializeResultSet
(
xResultSet
.
get
());
initResultSet
(
pResultSet
);
initResultSet
(
xResultSet
.
get
());
m_xResultSet
=
xRS
;
return
xResultSet
;
return
xRS
;
}
}
Any
SAL_CALL
OPreparedStatement
::
queryInterface
(
const
Type
&
rType
)
throw
(
RuntimeException
,
std
::
exception
)
Any
SAL_CALL
OPreparedStatement
::
queryInterface
(
const
Type
&
rType
)
throw
(
RuntimeException
,
std
::
exception
)
...
@@ -156,13 +155,10 @@ sal_Bool SAL_CALL OPreparedStatement::execute( ) throw(SQLException, RuntimeExc
...
@@ -156,13 +155,10 @@ sal_Bool SAL_CALL OPreparedStatement::execute( ) throw(SQLException, RuntimeExc
::
osl
::
MutexGuard
aGuard
(
m_aMutex
);
::
osl
::
MutexGuard
aGuard
(
m_aMutex
);
checkDisposed
(
OStatement_BASE
::
rBHelper
.
bDisposed
);
checkDisposed
(
OStatement_BASE
::
rBHelper
.
bDisposed
);
Reference
<
XResultSet
>
xRS
(
makeResultSet
());
rtl
::
Reference
<
OResultSet
>
xRS
(
makeResultSet
());
// since we don't support the XMultipleResults interface, nobody will ever get that ResultSet...
// since we don't support the XMultipleResults interface, nobody will ever get that ResultSet...
Reference
<
XComponent
>
xComp
(
xRS
,
UNO_QUERY
);
if
(
xRS
.
is
())
assert
(
xComp
.
is
()
||
!
xRS
.
is
());
xRS
->
dispose
();
if
(
xComp
.
is
())
xComp
->
dispose
();
return
m_aSQLIterator
.
getStatementType
()
==
SQL_STATEMENT_SELECT
;
return
m_aSQLIterator
.
getStatementType
()
==
SQL_STATEMENT_SELECT
;
}
}
...
@@ -173,16 +169,12 @@ sal_Int32 SAL_CALL OPreparedStatement::executeUpdate( ) throw(SQLException, Run
...
@@ -173,16 +169,12 @@ sal_Int32 SAL_CALL OPreparedStatement::executeUpdate( ) throw(SQLException, Run
::
osl
::
MutexGuard
aGuard
(
m_aMutex
);
::
osl
::
MutexGuard
aGuard
(
m_aMutex
);
checkDisposed
(
OStatement_BASE
::
rBHelper
.
bDisposed
);
checkDisposed
(
OStatement_BASE
::
rBHelper
.
bDisposed
);
Reference
<
X
ResultSet
>
xRS
(
makeResultSet
());
rtl
::
Reference
<
O
ResultSet
>
xRS
(
makeResultSet
());
if
(
xRS
.
is
())
if
(
xRS
.
is
())
{
{
assert
(
dynamic_cast
<
OResultSet
*>
(
xRS
.
get
()));
const
sal_Int32
res
(
xRS
->
getRowCountResult
());
const
sal_Int32
res
(
static_cast
<
OResultSet
*>
(
xRS
.
get
())
->
getRowCountResult
());
// nobody will ever get that ResultSet...
// nobody will ever get that ResultSet...
Reference
<
XComponent
>
xComp
(
xRS
,
UNO_QUERY
);
xRS
->
dispose
();
assert
(
xComp
.
is
());
if
(
xComp
.
is
())
xComp
->
dispose
();
return
res
;
return
res
;
}
}
else
else
...
@@ -210,7 +202,7 @@ Reference< XResultSet > SAL_CALL OPreparedStatement::executeQuery( ) throw(SQLE
...
@@ -210,7 +202,7 @@ Reference< XResultSet > SAL_CALL OPreparedStatement::executeQuery( ) throw(SQLE
::
osl
::
MutexGuard
aGuard
(
m_aMutex
);
::
osl
::
MutexGuard
aGuard
(
m_aMutex
);
checkDisposed
(
OStatement_BASE
::
rBHelper
.
bDisposed
);
checkDisposed
(
OStatement_BASE
::
rBHelper
.
bDisposed
);
return
makeResultSet
();
return
makeResultSet
()
.
get
()
;
}
}
...
...
connectivity/source/inc/file/FPreparedStatement.hxx
Dosyayı görüntüle @
4c6a27aa
...
@@ -53,7 +53,7 @@ namespace connectivity
...
@@ -53,7 +53,7 @@ namespace connectivity
// factory method for resultset's
// factory method for resultset's
virtual
OResultSet
*
createResultSet
()
SAL_OVERRIDE
;
virtual
OResultSet
*
createResultSet
()
SAL_OVERRIDE
;
::
com
::
sun
::
star
::
uno
::
Reference
<
::
com
::
sun
::
star
::
sdbc
::
X
ResultSet
>
makeResultSet
();
::
rtl
::
Reference
<
O
ResultSet
>
makeResultSet
();
void
initResultSet
(
OResultSet
*
);
void
initResultSet
(
OResultSet
*
);
void
checkAndResizeParameters
(
sal_Int32
parameterIndex
);
void
checkAndResizeParameters
(
sal_Int32
parameterIndex
);
...
...
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