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
0df18265
Kaydet (Commit)
0df18265
authored
Agu 02, 2012
tarafından
Noel Grandin
Kaydeden (comit)
Michael Stahl
Agu 02, 2012
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
STL'ify DECLARE_CONTAINER_SORT_DEL(XMLFontAutoStylePool_Impl)
Change-Id: Ic02f143a0e0f01a6cbc88c47d20e0c27dca17a74
üst
d0f5ff78
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
37 additions
and
34 deletions
+37
-34
XMLFontAutoStylePool.cxx
xmloff/source/style/XMLFontAutoStylePool.cxx
+37
-34
No files found.
xmloff/source/style/XMLFontAutoStylePool.cxx
Dosyayı görüntüle @
0df18265
...
@@ -26,7 +26,7 @@
...
@@ -26,7 +26,7 @@
*
*
************************************************************************/
************************************************************************/
#include <
svl/cntnrsrt
.hxx>
#include <
o3tl/sorted_vector
.hxx>
#include <tools/fontenum.hxx>
#include <tools/fontenum.hxx>
#include "xmloff/xmlnmspe.hxx"
#include "xmloff/xmlnmspe.hxx"
#include <xmloff/xmltoken.hxx>
#include <xmloff/xmltoken.hxx>
...
@@ -106,37 +106,40 @@ inline XMLFontAutoStylePoolEntry_Impl::XMLFontAutoStylePoolEntry_Impl(
...
@@ -106,37 +106,40 @@ inline XMLFontAutoStylePoolEntry_Impl::XMLFontAutoStylePoolEntry_Impl(
eEnc
(
eE
)
eEnc
(
eE
)
{
{
}
}
int
XMLFontAutoStylePoolEntryCmp_Impl
(
const
XMLFontAutoStylePoolEntry_Impl
&
r1
,
struct
XMLFontAutoStylePoolEntryCmp_Impl
{
const
XMLFontAutoStylePoolEntry_Impl
&
r2
)
bool
operator
()(
{
XMLFontAutoStylePoolEntry_Impl
*
const
&
r1
,
sal_Int8
nEnc1
(
r1
.
GetEncoding
()
!=
RTL_TEXTENCODING_SYMBOL
);
XMLFontAutoStylePoolEntry_Impl
*
const
&
r2
)
const
sal_Int8
nEnc2
(
r2
.
GetEncoding
()
!=
RTL_TEXTENCODING_SYMBOL
);
if
(
nEnc1
!=
nEnc2
)
return
nEnc1
-
nEnc2
;
else
if
(
r1
.
GetPitch
()
!=
r2
.
GetPitch
()
)
return
(
int
)
r1
.
GetPitch
()
-
(
int
)
r2
.
GetPitch
();
else
if
(
r1
.
GetFamily
()
!=
r2
.
GetFamily
()
)
return
(
int
)
r1
.
GetFamily
()
-
(
int
)
r2
.
GetFamily
();
else
{
{
sal_Int32
nCmp
=
r1
.
GetFamilyName
().
compareTo
(
r2
.
GetFamilyName
()
);
sal_Int8
nEnc1
(
r1
->
GetEncoding
()
!=
RTL_TEXTENCODING_SYMBOL
);
if
(
0
==
nCmp
)
sal_Int8
nEnc2
(
r2
->
GetEncoding
()
!=
RTL_TEXTENCODING_SYMBOL
);
return
(
int
)
r1
.
GetStyleName
().
compareTo
(
r2
.
GetStyleName
()
);
if
(
nEnc1
!=
nEnc2
)
return
nEnc1
<
nEnc2
;
else
if
(
r1
->
GetPitch
()
!=
r2
->
GetPitch
()
)
return
r1
->
GetPitch
()
<
r2
->
GetPitch
();
else
if
(
r1
->
GetFamily
()
!=
r2
->
GetFamily
()
)
return
r1
->
GetFamily
()
<
r2
->
GetFamily
();
else
else
return
(
int
)
nCmp
;
{
sal_Int32
nCmp
=
r1
->
GetFamilyName
().
compareTo
(
r2
->
GetFamilyName
()
);
if
(
0
==
nCmp
)
return
r1
->
GetStyleName
().
compareTo
(
r2
->
GetStyleName
()
)
<
0
;
else
return
nCmp
<
0
;
}
}
}
}
}
;
DECLARE_CONTAINER_SORT_DEL
(
XMLFontAutoStylePool_Impl
,
class
XMLFontAutoStylePool_Impl
:
public
o3tl
::
sorted_vector
<
XMLFontAutoStylePoolEntry_Impl
*
,
XMLFontAutoStylePoolEntryCmp_Impl
>
XMLFontAutoStylePoolEntry_Impl
)
{
IMPL_CONTAINER_SORT
(
XMLFontAutoStylePool_Impl
,
public
:
XMLFontAutoStylePoolEntry_Impl
,
~
XMLFontAutoStylePool_Impl
()
{
DeleteAndDestroyAll
();
}
XMLFontAutoStylePoolEntryCmp_Impl
)
};
XMLFontAutoStylePool
::
XMLFontAutoStylePool
(
SvXMLExport
&
rExp
)
:
XMLFontAutoStylePool
::
XMLFontAutoStylePool
(
SvXMLExport
&
rExp
)
:
rExport
(
rExp
),
rExport
(
rExp
),
pPool
(
new
XMLFontAutoStylePool_Impl
(
5
,
5
)
)
pPool
(
new
XMLFontAutoStylePool_Impl
)
{
{
}
}
...
@@ -155,10 +158,10 @@ OUString XMLFontAutoStylePool::Add(
...
@@ -155,10 +158,10 @@ OUString XMLFontAutoStylePool::Add(
OUString
sPoolName
;
OUString
sPoolName
;
XMLFontAutoStylePoolEntry_Impl
aTmp
(
rFamilyName
,
rStyleName
,
nFamily
,
XMLFontAutoStylePoolEntry_Impl
aTmp
(
rFamilyName
,
rStyleName
,
nFamily
,
nPitch
,
eEnc
);
nPitch
,
eEnc
);
sal_uLong
nPos
;
XMLFontAutoStylePool_Impl
::
const_iterator
it
=
pPool
->
find
(
&
aTmp
)
;
if
(
pPool
->
Seek_Entry
(
&
aTmp
,
&
nPos
)
)
if
(
it
!=
pPool
->
end
(
)
)
{
{
sPoolName
=
pPool
->
GetObject
(
nPos
)
->
GetName
();
sPoolName
=
(
*
it
)
->
GetName
();
}
}
else
else
{
{
...
@@ -192,7 +195,7 @@ OUString XMLFontAutoStylePool::Add(
...
@@ -192,7 +195,7 @@ OUString XMLFontAutoStylePool::Add(
XMLFontAutoStylePoolEntry_Impl
*
pEntry
=
XMLFontAutoStylePoolEntry_Impl
*
pEntry
=
new
XMLFontAutoStylePoolEntry_Impl
(
sName
,
rFamilyName
,
rStyleName
,
new
XMLFontAutoStylePoolEntry_Impl
(
sName
,
rFamilyName
,
rStyleName
,
nFamily
,
nPitch
,
eEnc
);
nFamily
,
nPitch
,
eEnc
);
pPool
->
I
nsert
(
pEntry
);
pPool
->
i
nsert
(
pEntry
);
m_aNames
.
insert
(
sName
);
m_aNames
.
insert
(
sName
);
}
}
...
@@ -209,10 +212,10 @@ OUString XMLFontAutoStylePool::Add(
...
@@ -209,10 +212,10 @@ OUString XMLFontAutoStylePool::Add(
OUString
sName
;
OUString
sName
;
XMLFontAutoStylePoolEntry_Impl
aTmp
(
rFamilyName
,
rStyleName
,
nFamily
,
XMLFontAutoStylePoolEntry_Impl
aTmp
(
rFamilyName
,
rStyleName
,
nFamily
,
nPitch
,
eEnc
);
nPitch
,
eEnc
);
sal_uLong
nPos
;
XMLFontAutoStylePool_Impl
::
const_iterator
it
=
pPool
->
find
(
&
aTmp
)
;
if
(
pPool
->
Seek_Entry
(
&
aTmp
,
&
nPos
)
)
if
(
it
!=
pPool
->
end
(
)
)
{
{
sName
=
pPool
->
GetObject
(
nPos
)
->
GetName
();
sName
=
(
*
it
)
->
GetName
();
}
}
return
sName
;
return
sName
;
...
@@ -232,10 +235,10 @@ void XMLFontAutoStylePool::exportXML()
...
@@ -232,10 +235,10 @@ void XMLFontAutoStylePool::exportXML()
XMLFontEncodingPropHdl
aEncHdl
;
XMLFontEncodingPropHdl
aEncHdl
;
const
SvXMLUnitConverter
&
rUnitConv
=
GetExport
().
GetMM100UnitConverter
();
const
SvXMLUnitConverter
&
rUnitConv
=
GetExport
().
GetMM100UnitConverter
();
sal_uInt32
nCount
=
pPool
->
Count
();
sal_uInt32
nCount
=
pPool
->
size
();
for
(
sal_uInt32
i
=
0
;
i
<
nCount
;
i
++
)
for
(
sal_uInt32
i
=
0
;
i
<
nCount
;
i
++
)
{
{
const
XMLFontAutoStylePoolEntry_Impl
*
pEntry
=
pPool
->
GetObject
(
i
)
;
const
XMLFontAutoStylePoolEntry_Impl
*
pEntry
=
(
*
pPool
)[
i
]
;
GetExport
().
AddAttribute
(
XML_NAMESPACE_STYLE
,
GetExport
().
AddAttribute
(
XML_NAMESPACE_STYLE
,
XML_NAME
,
pEntry
->
GetName
()
);
XML_NAME
,
pEntry
->
GetName
()
);
...
...
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