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
f2e52807
Kaydet (Commit)
f2e52807
authored
May 16, 2012
tarafından
Noel Grandin
Kaydeden (comit)
Michael Stahl
May 24, 2012
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Convert SV_DECL_PTRARR(SwSections) to std::vector
Change-Id: Ie41c43dc0cb5b64240122e76df20ff1a57f8532a
üst
84a0fb09
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
32 additions
and
45 deletions
+32
-45
section.hxx
sw/inc/section.hxx
+2
-1
section.cxx
sw/source/core/docnode/section.cxx
+25
-39
unoidx.cxx
sw/source/core/unocore/unoidx.cxx
+1
-1
unosect.cxx
sw/source/core/unocore/unosect.cxx
+4
-4
No files found.
sw/inc/section.hxx
Dosyayı görüntüle @
f2e52807
...
...
@@ -41,6 +41,7 @@
#include <sfx2/Metadatable.hxx>
#include <frmfmt.hxx>
#include <vector>
namespace
com
{
namespace
sun
{
namespace
star
{
...
...
@@ -59,7 +60,7 @@ class SwTOXBase;
SV_DECL_REF
(
SwServerObject
)
#endif
SV_DECL_PTRARR
(
SwSections
,
SwSection
*
,
0
)
typedef
std
::
vector
<
SwSection
*>
SwSections
;
enum
SectionType
{
CONTENT_SECTION
,
TOX_HEADER_SECTION
,
...
...
sw/source/core/docnode/section.cxx
Dosyayı görüntüle @
f2e52807
...
...
@@ -66,6 +66,7 @@
#include <unosection.hxx>
#include <switerator.hxx>
#include <svl/smplhint.hxx>
#include <algorithm>
using
namespace
::
com
::
sun
::
star
;
...
...
@@ -104,7 +105,6 @@ TYPEINIT1(SwSection,SwClient );
typedef
SwSection
*
SwSectionPtr
;
SV_IMPL_PTRARR
(
SwSections
,
SwSection
*
)
SV_IMPL_PTRARR
(
SwSectionFmts
,
SwSectionFmt
*
)
...
...
@@ -902,30 +902,24 @@ sal_Bool SwSectionFmt::GetInfo( SfxPoolItem& rInfo ) const
return
SwModify
::
GetInfo
(
rInfo
);
}
extern
"C"
{
int
SAL_CALL
lcl_SectionCmpPos
(
const
void
*
pFirst
,
const
void
*
pSecond
)
{
const
SwSectionFmt
*
pFSectFmt
=
(
*
(
SwSectionPtr
*
)
pFirst
)
->
GetFmt
();
const
SwSectionFmt
*
pSSectFmt
=
(
*
(
SwSectionPtr
*
)
pSecond
)
->
GetFmt
();
OSL_ENSURE
(
pFSectFmt
&&
pSSectFmt
&&
pFSectFmt
->
GetCntnt
(
sal_False
).
GetCntntIdx
()
&&
pSSectFmt
->
GetCntnt
(
sal_False
).
GetCntntIdx
(),
"ungueltige Sections"
);
return
(
int
)((
long
)
pFSectFmt
->
GetCntnt
(
sal_False
).
GetCntntIdx
()
->
GetIndex
())
-
pSSectFmt
->
GetCntnt
(
sal_False
).
GetCntntIdx
()
->
GetIndex
();
}
static
bool
lcl_SectionCmpPos
(
const
SwSection
*
pFirst
,
const
SwSection
*
pSecond
)
{
const
SwSectionFmt
*
pFSectFmt
=
pFirst
->
GetFmt
();
const
SwSectionFmt
*
pSSectFmt
=
pSecond
->
GetFmt
();
OSL_ENSURE
(
pFSectFmt
&&
pSSectFmt
&&
pFSectFmt
->
GetCntnt
(
sal_False
).
GetCntntIdx
()
&&
pSSectFmt
->
GetCntnt
(
sal_False
).
GetCntntIdx
(),
"ungueltige Sections"
);
return
pFSectFmt
->
GetCntnt
(
sal_False
).
GetCntntIdx
()
->
GetIndex
()
<
pSSectFmt
->
GetCntnt
(
sal_False
).
GetCntntIdx
()
->
GetIndex
();
}
int
SAL_CALL
lcl_SectionCmpNm
(
const
void
*
pFirst
,
const
void
*
pSecond
)
{
const
SwSectionPtr
pFSect
=
*
(
SwSectionPtr
*
)
pFirst
;
const
SwSectionPtr
pSSect
=
*
(
SwSectionPtr
*
)
pSecond
;
OSL_ENSURE
(
pFSect
&&
pSSect
,
"ungueltige Sections"
);
StringCompare
const
eCmp
=
pFSect
->
GetSectionName
().
CompareTo
(
pSSect
->
GetSectionName
()
);
return
eCmp
==
COMPARE_EQUAL
?
0
:
eCmp
==
COMPARE_LESS
?
1
:
-
1
;
}
static
bool
lcl_SectionCmpNm
(
const
SwSection
*
pFSect
,
const
SwSection
*
pSSect
)
{
OSL_ENSURE
(
pFSect
&&
pSSect
,
"ungueltige Sections"
);
StringCompare
const
eCmp
=
pFSect
->
GetSectionName
().
CompareTo
(
pSSect
->
GetSectionName
()
);
return
eCmp
==
COMPARE_LESS
;
}
// alle Sections, die von dieser abgeleitet sind
...
...
@@ -933,7 +927,7 @@ sal_uInt16 SwSectionFmt::GetChildSections( SwSections& rArr,
SectionSort
eSort
,
sal_Bool
bAllSections
)
const
{
rArr
.
Remove
(
0
,
rArr
.
Count
()
);
rArr
.
clear
(
);
if
(
GetDepends
()
)
{
...
...
@@ -944,33 +938,25 @@ sal_uInt16 SwSectionFmt::GetChildSections( SwSections& rArr,
(
0
!=
(
pIdx
=
pLast
->
GetCntnt
(
sal_False
).
GetCntntIdx
())
&&
&
pIdx
->
GetNodes
()
==
&
GetDoc
()
->
GetNodes
()
))
{
const
SwSection
*
Dummy
=
pLast
->
GetSection
();
rArr
.
C40_INSERT
(
SwSection
,
Dummy
,
rArr
.
Count
()
);
SwSection
*
pDummy
=
pLast
->
GetSection
();
rArr
.
push_back
(
pDummy
);
}
// noch eine Sortierung erwuenscht ?
if
(
1
<
rArr
.
Count
()
)
if
(
1
<
rArr
.
size
()
)
switch
(
eSort
)
{
case
SORTSECT_NAME
:
qsort
(
(
void
*
)
rArr
.
GetData
(),
rArr
.
Count
(),
sizeof
(
SwSectionPtr
),
lcl_SectionCmpNm
);
std
::
sort
(
rArr
.
begin
(),
rArr
.
end
(),
lcl_SectionCmpNm
);
break
;
case
SORTSECT_POS
:
qsort
(
(
void
*
)
rArr
.
GetData
(),
rArr
.
Count
(),
sizeof
(
SwSectionPtr
),
lcl_SectionCmpPos
);
std
::
sort
(
rArr
.
begin
(),
rArr
.
end
(),
lcl_SectionCmpPos
);
break
;
case
SORTSECT_NOT
:
break
;
}
}
return
rArr
.
Count
();
return
rArr
.
size
();
}
// erfrage, ob sich die Section im Nodes-Array oder UndoNodes-Array
...
...
sw/source/core/unocore/unoidx.cxx
Dosyayı görüntüle @
f2e52807
...
...
@@ -930,7 +930,7 @@ throw (beans::UnknownPropertyException, lang::WrappedTargetException,
SwSections
aSectArr
;
pSectionFmt
->
GetChildSections
(
aSectArr
,
SORTSECT_NOT
,
sal_False
);
for
(
sal_uInt16
i
=
0
;
i
<
aSectArr
.
Count
();
i
++
)
for
(
sal_uInt16
i
=
0
;
i
<
aSectArr
.
size
();
i
++
)
{
SwSection
*
pSect
=
aSectArr
[
i
];
if
(
pSect
->
GetType
()
==
TOX_HEADER_SECTION
)
...
...
sw/source/core/unocore/unosect.cxx
Dosyayı görüntüle @
f2e52807
...
...
@@ -255,11 +255,11 @@ SwXTextSection::getChildSections() throw (uno::RuntimeException)
SwSections
aChildren
;
rSectionFmt
.
GetChildSections
(
aChildren
,
SORTSECT_NOT
,
sal_False
);
uno
::
Sequence
<
uno
::
Reference
<
text
::
XTextSection
>
>
aSeq
(
aChildren
.
Count
());
uno
::
Sequence
<
uno
::
Reference
<
text
::
XTextSection
>
>
aSeq
(
aChildren
.
size
());
uno
::
Reference
<
text
::
XTextSection
>
*
pArray
=
aSeq
.
getArray
();
for
(
sal_uInt16
i
=
0
;
i
<
aChildren
.
Count
();
i
++
)
for
(
sal_uInt16
i
=
0
;
i
<
aChildren
.
size
();
i
++
)
{
SwSectionFmt
*
const
pChild
=
aChildren
.
GetObject
(
i
)
->
GetFmt
();
SwSectionFmt
*
const
pChild
=
aChildren
[
i
]
->
GetFmt
();
pArray
[
i
]
=
CreateXTextSection
(
pChild
);
}
return
aSeq
;
...
...
@@ -325,7 +325,7 @@ throw (lang::IllegalArgumentException, uno::RuntimeException)
GetChildSections
(
aSectionsArr
);
// and search for current header section
const
sal_uInt16
nCount
=
aSectionsArr
.
Count
();
const
sal_uInt16
nCount
=
aSectionsArr
.
size
();
sal_Bool
bHeaderPresent
=
sal_False
;
for
(
sal_uInt16
i
=
0
;
i
<
nCount
;
i
++
)
{
...
...
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