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
a102d822
Kaydet (Commit)
a102d822
authored
Eki 02, 2013
tarafından
Lionel Elie Mamane
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
janitorial: more const, comments
Change-Id: I5366840ab67fdf89575e890a0d97602b8e78f71a
üst
2b06c5b3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
6 deletions
+13
-6
KeySet.cxx
dbaccess/source/core/api/KeySet.cxx
+13
-6
No files found.
dbaccess/source/core/api/KeySet.cxx
Dosyayı görüntüle @
a102d822
...
@@ -487,8 +487,7 @@ Sequence< sal_Int32 > SAL_CALL OKeySet::deleteRows( const Sequence< Any >& rows
...
@@ -487,8 +487,7 @@ Sequence< sal_Int32 > SAL_CALL OKeySet::deleteRows( const Sequence< Any >& rows
static
OUString
aOr
(
" OR "
);
static
OUString
aOr
(
" OR "
);
static
OUString
aEqual
(
" = ?"
);
static
OUString
aEqual
(
" = ?"
);
// use keys and indexes for exact postioning
// use keys for exact positioning
// first the keys
Reference
<
XNameAccess
>
xKeyColumns
=
getKeyColumns
();
Reference
<
XNameAccess
>
xKeyColumns
=
getKeyColumns
();
OUStringBuffer
aCondition
(
"( "
);
OUStringBuffer
aCondition
(
"( "
);
...
@@ -500,11 +499,14 @@ Sequence< sal_Int32 > SAL_CALL OKeySet::deleteRows( const Sequence< Any >& rows
...
@@ -500,11 +499,14 @@ Sequence< sal_Int32 > SAL_CALL OKeySet::deleteRows( const Sequence< Any >& rows
aCondition
.
append
(
::
dbtools
::
quoteName
(
aQuote
,
aIter
->
second
.
sRealName
)
+
aEqual
+
aAnd
);
aCondition
.
append
(
::
dbtools
::
quoteName
(
aQuote
,
aIter
->
second
.
sRealName
)
+
aEqual
+
aAnd
);
}
}
aCondition
.
setLength
(
aCondition
.
getLength
()
-
aAnd
.
getLength
());
aCondition
.
setLength
(
aCondition
.
getLength
()
-
aAnd
.
getLength
());
// sCon is (parenthesised) the condition to locate ONE row
// e.g. ( colName1 = ? AND colName2 = ? AND colName3 = ? )
const
OUString
sCon
(
aCondition
.
makeStringAndClear
()
);
const
OUString
sCon
(
aCondition
.
makeStringAndClear
()
);
const
Any
*
pBegin
=
rows
.
getConstArray
();
// since we need to delete all rows in "rows",
const
Any
*
pEnd
=
pBegin
+
rows
.
getLength
();
// we need to OR as many row locators.
const
Any
*
pBegin
=
rows
.
getConstArray
();
const
Any
*
const
pEnd
=
pBegin
+
rows
.
getLength
();
for
(;
pBegin
!=
pEnd
;
++
pBegin
)
for
(;
pBegin
!=
pEnd
;
++
pBegin
)
{
{
aSql
.
append
(
sCon
+
aOr
);
aSql
.
append
(
sCon
+
aOr
);
...
@@ -516,11 +518,17 @@ Sequence< sal_Int32 > SAL_CALL OKeySet::deleteRows( const Sequence< Any >& rows
...
@@ -516,11 +518,17 @@ Sequence< sal_Int32 > SAL_CALL OKeySet::deleteRows( const Sequence< Any >& rows
Reference
<
XPreparedStatement
>
xPrep
(
m_xConnection
->
prepareStatement
(
aSql
.
makeStringAndClear
()));
Reference
<
XPreparedStatement
>
xPrep
(
m_xConnection
->
prepareStatement
(
aSql
.
makeStringAndClear
()));
Reference
<
XParameters
>
xParameter
(
xPrep
,
UNO_QUERY
);
Reference
<
XParameters
>
xParameter
(
xPrep
,
UNO_QUERY
);
// now, fill in the parameters in the row locators
pBegin
=
rows
.
getConstArray
();
pBegin
=
rows
.
getConstArray
();
sal_Int32
i
=
1
;
sal_Int32
i
=
1
;
for
(;
pBegin
!=
pEnd
;
++
pBegin
)
for
(;
pBegin
!=
pEnd
;
++
pBegin
)
{
{
m_aKeyIter
=
m_aKeyMap
.
find
(
::
comphelper
::
getINT32
(
*
pBegin
));
m_aKeyIter
=
m_aKeyMap
.
find
(
::
comphelper
::
getINT32
(
*
pBegin
));
// LEM FIXME: what happens if m_aKeyIter == m_aKeyMap.end() ?
// the whole operation fails because there are unfilled parameters
// the remaining rows *are* deleted?
// check what happens vs what is supposed to happen
// (cf documentation of ::com::sun::star::sdbcx::XDeleteRows)
if
(
m_aKeyIter
!=
m_aKeyMap
.
end
())
if
(
m_aKeyIter
!=
m_aKeyMap
.
end
())
{
{
connectivity
::
ORowVector
<
ORowSetValue
>::
Vector
::
iterator
aKeyIter
=
m_aKeyIter
->
second
.
first
->
get
().
begin
();
connectivity
::
ORowVector
<
ORowSetValue
>::
Vector
::
iterator
aKeyIter
=
m_aKeyIter
->
second
.
first
->
get
().
begin
();
...
@@ -539,7 +547,6 @@ Sequence< sal_Int32 > SAL_CALL OKeySet::deleteRows( const Sequence< Any >& rows
...
@@ -539,7 +547,6 @@ Sequence< sal_Int32 > SAL_CALL OKeySet::deleteRows( const Sequence< Any >& rows
if
(
bOk
)
if
(
bOk
)
{
{
pBegin
=
rows
.
getConstArray
();
pBegin
=
rows
.
getConstArray
();
pEnd
=
pBegin
+
rows
.
getLength
();
for
(;
pBegin
!=
pEnd
;
++
pBegin
)
for
(;
pBegin
!=
pEnd
;
++
pBegin
)
{
{
...
...
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