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
f9632ab0
Kaydet (Commit)
f9632ab0
authored
Şub 23, 2015
tarafından
Bjoern Michaelsen
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
use init lists for property sequences
Change-Id: I8b3b2b839c37b584e1a4036e49af7ff2737ea7f6
üst
caebcd5d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
45 additions
and
5 deletions
+45
-5
dbtools.cxx
connectivity/source/commontools/dbtools.cxx
+5
-5
propertysequence.hxx
include/comphelper/propertysequence.hxx
+40
-0
No files found.
connectivity/source/commontools/dbtools.cxx
Dosyayı görüntüle @
f9632ab0
...
...
@@ -68,6 +68,7 @@
#include <comphelper/interaction.hxx>
#include <comphelper/processfactory.hxx>
#include <comphelper/property.hxx>
#include <comphelper/propertysequence.hxx>
#include <connectivity/conncleanup.hxx>
#include <connectivity/dbconversion.hxx>
#include <connectivity/dbexception.hxx>
...
...
@@ -410,11 +411,10 @@ SharedConnection lcl_connectRowSet(const Reference< XRowSet>& _rxRowSet, const R
xRowSetProps
->
getPropertyValue
(
OMetaConnection
::
getPropMap
().
getNameByIndex
(
PROPERTY_ID_PASSWORD
))
>>=
sPwd
;
if
(
!
sUser
.
isEmpty
())
{
// use user and pwd together with the url
Sequence
<
PropertyValue
>
aInfo
(
2
);
aInfo
.
getArray
()[
0
].
Name
=
"user"
;
aInfo
.
getArray
()[
0
].
Value
<<=
sUser
;
aInfo
.
getArray
()[
1
].
Name
=
"password"
;
aInfo
.
getArray
()[
1
].
Value
<<=
sPwd
;
auto
aInfo
(
::
comphelper
::
InitPropertySequence
({
{
"user"
,
makeAny
(
sUser
)
},
{
"password"
,
makeAny
(
sPwd
)
}
}));
xPureConnection
=
xDriverManager
->
getConnectionWithInfo
(
sURL
,
aInfo
);
}
else
...
...
include/comphelper/propertysequence.hxx
0 → 100644
Dosyayı görüntüle @
f9632ab0
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
#ifndef INCLUDED_COMPHELPER_PROPERTYSEQUENCE_HXX
#define INCLUDED_COMPHELPER_PROPERTYSEQUENCE_HXX
#include <utility>
#include <initializer_list>
#include <com/sun/star/uno/Any.hxx>
#include <com/sun/star/uno/Sequence.hxx>
#include <com/sun/star/beans/PropertyValue.hpp>
namespace
comphelper
{
::
com
::
sun
::
star
::
uno
::
Sequence
<
::
com
::
sun
::
star
::
beans
::
PropertyValue
>
InitPropertySequence
(
::
std
::
initializer_list
<
::
std
::
pair
<
OUString
,
::
com
::
sun
::
star
::
uno
::
Any
>
>
vInit
)
{
::
com
::
sun
::
star
::
uno
::
Sequence
<
::
com
::
sun
::
star
::
beans
::
PropertyValue
>
vResult
{
static_cast
<
sal_Int32
>
(
vInit
.
size
())};
size_t
nCount
{
0
};
for
(
auto
aEntry
:
vInit
)
{
vResult
[
nCount
].
Name
=
std
::
move
(
aEntry
.
first
);
vResult
[
nCount
].
Value
=
std
::
move
(
aEntry
.
second
);
++
nCount
;
}
return
std
::
move
(
vResult
);
}
}
// namespace comphelper
#endif // INCLUDED_COMPHELPER_PROPERTYSEQUENCE_HXX
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
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