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
0b3fbf82
Kaydet (Commit)
0b3fbf82
authored
Kas 12, 2015
tarafından
Andrzej Hunt
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
sw lok: filter out defalt styles to avoid duplicates
Change-Id: Iff84c2f16844a507d30f30c1fd4b23d807ded466
üst
6e6ae980
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
4 deletions
+14
-4
init.cxx
desktop/source/lib/init.cxx
+14
-4
No files found.
desktop/source/lib/init.cxx
Dosyayı görüntüle @
0b3fbf82
...
@@ -1263,7 +1263,10 @@ static char* getStyles(LibreOfficeKitDocument* pThis, const char* pCommand)
...
@@ -1263,7 +1263,10 @@ static char* getStyles(LibreOfficeKitDocument* pThis, const char* pCommand)
"Heading 3"
"Heading 3"
};
};
// static const std::vector<OUString> aList = { "aaaa", "bbb" };
// We need to keep a list of the default style names
// in order to filter these out later when processing
// the full list of styles.
std
::
set
<
OUString
>
aDefaultStyleNames
;
boost
::
property_tree
::
ptree
aValues
;
boost
::
property_tree
::
ptree
aValues
;
for
(
sal_Int32
nStyleFam
=
0
;
nStyleFam
<
aStyleFamilies
.
getLength
();
++
nStyleFam
)
for
(
sal_Int32
nStyleFam
=
0
;
nStyleFam
<
aStyleFamilies
.
getLength
();
++
nStyleFam
)
...
@@ -1286,6 +1289,8 @@ static char* getStyles(LibreOfficeKitDocument* pThis, const char* pCommand)
...
@@ -1286,6 +1289,8 @@ static char* getStyles(LibreOfficeKitDocument* pThis, const char* pCommand)
xStyle
->
getPropertyValue
(
"DisplayName"
)
>>=
sName
;
xStyle
->
getPropertyValue
(
"DisplayName"
)
>>=
sName
;
if
(
!
sName
.
isEmpty
()
)
if
(
!
sName
.
isEmpty
()
)
{
{
aDefaultStyleNames
.
insert
(
sName
);
boost
::
property_tree
::
ptree
aChild
;
boost
::
property_tree
::
ptree
aChild
;
aChild
.
put
(
""
,
sName
.
toUtf8
());
aChild
.
put
(
""
,
sName
.
toUtf8
());
aChildren
.
push_back
(
std
::
make_pair
(
""
,
aChild
));
aChildren
.
push_back
(
std
::
make_pair
(
""
,
aChild
));
...
@@ -1296,9 +1301,14 @@ static char* getStyles(LibreOfficeKitDocument* pThis, const char* pCommand)
...
@@ -1296,9 +1301,14 @@ static char* getStyles(LibreOfficeKitDocument* pThis, const char* pCommand)
uno
::
Sequence
<
OUString
>
aStyles
=
xStyleFamily
->
getElementNames
();
uno
::
Sequence
<
OUString
>
aStyles
=
xStyleFamily
->
getElementNames
();
for
(
OUString
aStyle
:
aStyles
)
for
(
OUString
aStyle
:
aStyles
)
{
{
boost
::
property_tree
::
ptree
aChild
;
// Filter out the default styles - they are already at the top
aChild
.
put
(
""
,
aStyles
[
nInd
]);
// of the list
aChildren
.
push_back
(
std
::
make_pair
(
""
,
aChild
));
if
(
aDefaultStyleNames
.
find
(
aStyle
)
==
aDefaultStyleNames
.
end
())
{
boost
::
property_tree
::
ptree
aChild
;
aChild
.
put
(
""
,
aStyle
);
aChildren
.
push_back
(
std
::
make_pair
(
""
,
aChild
));
}
}
}
aValues
.
add_child
(
sStyleFam
.
toUtf8
().
getStr
(),
aChildren
);
aValues
.
add_child
(
sStyleFam
.
toUtf8
().
getStr
(),
aChildren
);
}
}
...
...
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