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
b866f861
Kaydet (Commit)
b866f861
authored
Agu 08, 2014
tarafından
Stephan Bergmann
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
qsort and bsearch need different kinds of callback functions
Change-Id: I4a661434c3a51169ec14336bb39a1d2ceeb139ad
üst
5631661e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
9 deletions
+12
-9
objface.cxx
sfx2/source/control/objface.cxx
+12
-9
No files found.
sfx2/source/control/objface.cxx
Dosyayı görüntüle @
b866f861
...
@@ -35,20 +35,23 @@
...
@@ -35,20 +35,23 @@
#include <sfx2/objsh.hxx>
#include <sfx2/objsh.hxx>
#include <rtl/strbuf.hxx>
#include <rtl/strbuf.hxx>
extern
"C"
extern
"C"
{
#ifdef WNT
int
_cdecl
#else
int
#endif
SfxCompareSlots_Impl
(
const
void
*
pSmaller
,
const
void
*
pBigger
)
static
int
SAL_CALL
SfxCompareSlots_qsort
(
const
void
*
pSmaller
,
const
void
*
pBigger
)
{
{
return
(
(
int
)
((
SfxSlot
*
)
pSmaller
)
->
GetSlotId
()
)
-
return
(
(
int
)
((
SfxSlot
*
)
pSmaller
)
->
GetSlotId
()
)
-
(
(
int
)
((
SfxSlot
*
)
pBigger
)
->
GetSlotId
()
);
(
(
int
)
((
SfxSlot
*
)
pBigger
)
->
GetSlotId
()
);
}
}
static
int
SAL_CALL
SfxCompareSlots_bsearch
(
const
void
*
pSmaller
,
const
void
*
pBigger
)
{
return
(
(
int
)
*
((
sal_uInt16
*
)
pSmaller
)
)
-
(
(
int
)
((
SfxSlot
*
)
pBigger
)
->
GetSlotId
()
);
}
}
struct
SfxObjectUI_Impl
struct
SfxObjectUI_Impl
{
{
...
@@ -148,7 +151,7 @@ void SfxInterface::SetSlotMap( SfxSlot& rSlotMap, sal_uInt16 nSlotCount )
...
@@ -148,7 +151,7 @@ void SfxInterface::SetSlotMap( SfxSlot& rSlotMap, sal_uInt16 nSlotCount )
if
(
!
pIter
->
pNextSlot
)
if
(
!
pIter
->
pNextSlot
)
{
{
// sort the SfxSlots by id
// sort the SfxSlots by id
qsort
(
pSlots
,
nCount
,
sizeof
(
SfxSlot
),
SfxCompareSlots_
Impl
);
qsort
(
pSlots
,
nCount
,
sizeof
(
SfxSlot
),
SfxCompareSlots_
qsort
);
// link masters and slaves
// link masters and slaves
sal_uInt16
nIter
=
1
;
sal_uInt16
nIter
=
1
;
...
@@ -311,7 +314,7 @@ const SfxSlot* SfxInterface::GetSlot( sal_uInt16 nFuncId ) const
...
@@ -311,7 +314,7 @@ const SfxSlot* SfxInterface::GetSlot( sal_uInt16 nFuncId ) const
// find the id using binary search
// find the id using binary search
void
*
p
=
bsearch
(
&
nFuncId
,
pSlots
,
nCount
,
sizeof
(
SfxSlot
),
void
*
p
=
bsearch
(
&
nFuncId
,
pSlots
,
nCount
,
sizeof
(
SfxSlot
),
SfxCompareSlots_
Impl
);
SfxCompareSlots_
bsearch
);
if
(
!
p
&&
pGenoType
)
if
(
!
p
&&
pGenoType
)
return
pGenoType
->
GetSlot
(
nFuncId
);
return
pGenoType
->
GetSlot
(
nFuncId
);
...
...
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