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
d4a12421
Kaydet (Commit)
d4a12421
authored
Nis 29, 2015
tarafından
Miklos Vajna
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
desktop: pJSON may be 0 in jsonToPropertyValues()
Change-Id: I1ed9a4e1f1ecabf48ed3edb7cf6623261e2f4570
üst
2d69d539
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
17 deletions
+20
-17
init.cxx
desktop/source/lib/init.cxx
+20
-17
No files found.
desktop/source/lib/init.cxx
Dosyayı görüntüle @
d4a12421
...
...
@@ -706,25 +706,28 @@ static void doc_postKeyEvent(LibreOfficeKitDocument* pThis, int nType, int nChar
static
void
jsonToPropertyValues
(
const
char
*
pJSON
,
uno
::
Sequence
<
beans
::
PropertyValue
>&
rPropertyValues
)
{
boost
::
property_tree
::
ptree
aTree
;
std
::
stringstream
aStream
(
pJSON
);
boost
::
property_tree
::
read_json
(
aStream
,
aTree
);
std
::
vector
<
beans
::
PropertyValue
>
aArguments
;
for
(
const
std
::
pair
<
std
::
string
,
boost
::
property_tree
::
ptree
>&
rPair
:
aTree
)
if
(
pJSON
)
{
const
std
::
string
&
rType
=
rPair
.
second
.
get
<
std
::
string
>
(
"type"
);
const
std
::
string
&
rValue
=
rPair
.
second
.
get
<
std
::
string
>
(
"value"
);
beans
::
PropertyValue
aValue
;
aValue
.
Name
=
OUString
::
fromUtf8
(
rPair
.
first
.
c_str
());
if
(
rType
==
"string"
)
aValue
.
Value
<<=
OUString
::
fromUtf8
(
rValue
.
c_str
());
else
if
(
rType
==
"boolean"
)
aValue
.
Value
<<=
OString
(
rValue
.
c_str
()).
toBoolean
();
else
SAL_WARN
(
"desktop.lib"
,
"jsonToPropertyValues: unhandled type '"
<<
rType
<<
"'"
);
aArguments
.
push_back
(
aValue
);
boost
::
property_tree
::
ptree
aTree
;
std
::
stringstream
aStream
(
pJSON
);
boost
::
property_tree
::
read_json
(
aStream
,
aTree
);
for
(
const
std
::
pair
<
std
::
string
,
boost
::
property_tree
::
ptree
>&
rPair
:
aTree
)
{
const
std
::
string
&
rType
=
rPair
.
second
.
get
<
std
::
string
>
(
"type"
);
const
std
::
string
&
rValue
=
rPair
.
second
.
get
<
std
::
string
>
(
"value"
);
beans
::
PropertyValue
aValue
;
aValue
.
Name
=
OUString
::
fromUtf8
(
rPair
.
first
.
c_str
());
if
(
rType
==
"string"
)
aValue
.
Value
<<=
OUString
::
fromUtf8
(
rValue
.
c_str
());
else
if
(
rType
==
"boolean"
)
aValue
.
Value
<<=
OString
(
rValue
.
c_str
()).
toBoolean
();
else
SAL_WARN
(
"desktop.lib"
,
"jsonToPropertyValues: unhandled type '"
<<
rType
<<
"'"
);
aArguments
.
push_back
(
aValue
);
}
}
rPropertyValues
=
comphelper
::
containerToSequence
(
aArguments
);
}
...
...
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