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
2902cdc1
Kaydet (Commit)
2902cdc1
authored
Şub 28, 2015
tarafından
Matteo Casalin
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Use more proper integer types and range-for loops
Change-Id: I6c1b6697e984dd39b70dace8568eda41b346e685
üst
f6a42d64
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
27 deletions
+23
-27
docsort.cxx
sw/source/core/doc/docsort.cxx
+22
-26
number.cxx
sw/source/core/doc/number.cxx
+1
-1
No files found.
sw/source/core/doc/docsort.cxx
Dosyayı görüntüle @
2902cdc1
...
@@ -295,9 +295,8 @@ bool SwDoc::SortText(const SwPaM& rPaM, const SwSortOptions& rOpt)
...
@@ -295,9 +295,8 @@ bool SwDoc::SortText(const SwPaM& rPaM, const SwSortOptions& rOpt)
const
SwPosition
*
pStart
=
rPaM
.
Start
(),
*
pEnd
=
rPaM
.
End
();
const
SwPosition
*
pStart
=
rPaM
.
Start
(),
*
pEnd
=
rPaM
.
End
();
// Set index to the Selection's start
// Set index to the Selection's start
for
(
sal_uInt16
n
=
0
;
n
<
GetSpzFrmFmts
()
->
size
();
++
n
)
for
(
const
auto
*
pFmt
:
*
GetSpzFrmFmts
()
)
{
{
const
SwFrmFmt
*
const
pFmt
=
(
*
GetSpzFrmFmts
())[
n
];
SwFmtAnchor
const
*
const
pAnchor
=
&
pFmt
->
GetAnchor
();
SwFmtAnchor
const
*
const
pAnchor
=
&
pFmt
->
GetAnchor
();
SwPosition
const
*
const
pAPos
=
pAnchor
->
GetCntntAnchor
();
SwPosition
const
*
const
pAPos
=
pAnchor
->
GetCntntAnchor
();
...
@@ -496,7 +495,7 @@ bool SwDoc::SortTbl(const SwSelBoxes& rBoxes, const SwSortOptions& rOpt)
...
@@ -496,7 +495,7 @@ bool SwDoc::SortTbl(const SwSelBoxes& rBoxes, const SwSortOptions& rOpt)
if
(
!
getIDocumentRedlineAccess
().
IsIgnoreRedline
()
&&
!
getIDocumentRedlineAccess
().
GetRedlineTbl
().
empty
()
)
if
(
!
getIDocumentRedlineAccess
().
IsIgnoreRedline
()
&&
!
getIDocumentRedlineAccess
().
GetRedlineTbl
().
empty
()
)
getIDocumentRedlineAccess
().
DeleteRedline
(
*
pTblNd
,
true
,
USHRT_MAX
);
getIDocumentRedlineAccess
().
DeleteRedline
(
*
pTblNd
,
true
,
USHRT_MAX
);
sal_uInt16
nStart
=
0
;
_FndLines
::
size_type
nStart
=
0
;
if
(
pTblNd
->
GetTable
().
GetRowsToRepeat
()
>
0
&&
rOpt
.
eDirection
==
SRT_ROWS
)
if
(
pTblNd
->
GetTable
().
GetRowsToRepeat
()
>
0
&&
rOpt
.
eDirection
==
SRT_ROWS
)
{
{
// Uppermost selected Cell
// Uppermost selected Cell
...
@@ -561,9 +560,7 @@ bool SwDoc::SortTbl(const SwSelBoxes& rBoxes, const SwSortOptions& rOpt)
...
@@ -561,9 +560,7 @@ bool SwDoc::SortTbl(const SwSelBoxes& rBoxes, const SwSortOptions& rOpt)
SwSortBoxElements
aSortList
;
SwSortBoxElements
aSortList
;
// When sorting, do not include the first row if the HeaderLine is repeated
// When sorting, do not include the first row if the HeaderLine is repeated
sal_uInt16
i
;
for
(
sal_uInt16
i
=
static_cast
<
sal_uInt16
>
(
nStart
);
i
<
nCount
;
++
i
)
for
(
i
=
nStart
;
i
<
nCount
;
++
i
)
{
{
SwSortBoxElement
*
pEle
=
new
SwSortBoxElement
(
i
);
SwSortBoxElement
*
pEle
=
new
SwSortBoxElement
(
i
);
aSortList
.
insert
(
pEle
);
aSortList
.
insert
(
pEle
);
...
@@ -571,7 +568,7 @@ bool SwDoc::SortTbl(const SwSelBoxes& rBoxes, const SwSortOptions& rOpt)
...
@@ -571,7 +568,7 @@ bool SwDoc::SortTbl(const SwSelBoxes& rBoxes, const SwSortOptions& rOpt)
// Move after Sorting
// Move after Sorting
SwMovedBoxes
aMovedList
;
SwMovedBoxes
aMovedList
;
i
=
0
;
sal_uInt16
i
=
0
;
for
(
SwSortBoxElements
::
const_iterator
it
=
aSortList
.
begin
();
for
(
SwSortBoxElements
::
const_iterator
it
=
aSortList
.
begin
();
it
!=
aSortList
.
end
();
++
i
,
++
it
)
it
!=
aSortList
.
end
();
++
i
,
++
it
)
{
{
...
@@ -781,9 +778,9 @@ FlatFndBox::~FlatFndBox()
...
@@ -781,9 +778,9 @@ FlatFndBox::~FlatFndBox()
bool
FlatFndBox
::
CheckLineSymmetry
(
const
_FndBox
&
rBox
)
bool
FlatFndBox
::
CheckLineSymmetry
(
const
_FndBox
&
rBox
)
{
{
const
_FndLines
&
rLines
=
rBox
.
GetLines
();
const
_FndLines
&
rLines
=
rBox
.
GetLines
();
sal_uInt16
nBoxes
(
0
)
;
_FndBoxes
::
size_type
nBoxes
{
0
}
;
for
(
sal_uInt16
i
=
0
;
i
<
rLines
.
size
();
++
i
)
for
(
_FndLines
::
size_type
i
=
0
;
i
<
rLines
.
size
();
++
i
)
{
{
const
_FndLine
*
pLn
=
&
rLines
[
i
];
const
_FndLine
*
pLn
=
&
rLines
[
i
];
const
_FndBoxes
&
rBoxes
=
pLn
->
GetBoxes
();
const
_FndBoxes
&
rBoxes
=
pLn
->
GetBoxes
();
...
@@ -803,9 +800,9 @@ bool FlatFndBox::CheckLineSymmetry(const _FndBox& rBox)
...
@@ -803,9 +800,9 @@ bool FlatFndBox::CheckLineSymmetry(const _FndBox& rBox)
bool
FlatFndBox
::
CheckBoxSymmetry
(
const
_FndLine
&
rLn
)
bool
FlatFndBox
::
CheckBoxSymmetry
(
const
_FndLine
&
rLn
)
{
{
const
_FndBoxes
&
rBoxes
=
rLn
.
GetBoxes
();
const
_FndBoxes
&
rBoxes
=
rLn
.
GetBoxes
();
sal_uInt16
nLines
(
0
)
;
_FndLines
::
size_type
nLines
{
0
}
;
for
(
sal_uInt16
i
=
0
;
i
<
rBoxes
.
size
();
++
i
)
for
(
_FndBoxes
::
size_type
i
=
0
;
i
<
rBoxes
.
size
();
++
i
)
{
{
_FndBox
const
*
const
pBox
=
&
rBoxes
[
i
];
_FndBox
const
*
const
pBox
=
&
rBoxes
[
i
];
const
_FndLines
&
rLines
=
pBox
->
GetLines
();
const
_FndLines
&
rLines
=
pBox
->
GetLines
();
...
@@ -830,15 +827,14 @@ sal_uInt16 FlatFndBox::GetColCount(const _FndBox& rBox)
...
@@ -830,15 +827,14 @@ sal_uInt16 FlatFndBox::GetColCount(const _FndBox& rBox)
return
1
;
return
1
;
sal_uInt16
nSum
=
0
;
sal_uInt16
nSum
=
0
;
for
(
sal_uInt16
i
=
0
;
i
<
rLines
.
size
();
++
i
)
for
(
const
auto
&
rLine
:
rLines
)
{
{
// The Boxes of a Line
// The Boxes of a Line
sal_uInt16
nCount
=
0
;
sal_uInt16
nCount
=
0
;
const
_FndBoxes
&
rBoxes
=
rLine
s
[
i
]
.
GetBoxes
();
const
_FndBoxes
&
rBoxes
=
rLine
.
GetBoxes
();
for
(
sal_uInt16
j
=
0
;
j
<
rBoxes
.
size
();
++
j
)
for
(
const
auto
&
rB
:
rBoxes
)
// Iterate recursively over the Lines
// Iterate recursively over the Lines
nCount
+=
(
rBoxes
[
j
].
GetLines
().
size
())
nCount
+=
rB
.
GetLines
().
empty
()
?
1
:
GetColCount
(
rB
);
?
GetColCount
(
rBoxes
[
j
])
:
1
;
if
(
nSum
<
nCount
)
if
(
nSum
<
nCount
)
nSum
=
nCount
;
nSum
=
nCount
;
...
@@ -854,14 +850,14 @@ sal_uInt16 FlatFndBox::GetRowCount(const _FndBox& rBox)
...
@@ -854,14 +850,14 @@ sal_uInt16 FlatFndBox::GetRowCount(const _FndBox& rBox)
return
1
;
return
1
;
sal_uInt16
nLines
=
0
;
sal_uInt16
nLines
=
0
;
for
(
sal_uInt16
i
=
0
;
i
<
rLines
.
size
();
++
i
)
for
(
const
auto
&
rLine
:
rLines
)
{
// The Boxes of a Line
{
// The Boxes of a Line
const
_FndBoxes
&
rBoxes
=
rLine
s
[
i
]
.
GetBoxes
();
const
_FndBoxes
&
rBoxes
=
rLine
.
GetBoxes
();
sal_uInt16
nLn
=
1
;
sal_uInt16
nLn
=
1
;
for
(
sal_uInt16
j
=
0
;
j
<
rBoxes
.
size
();
++
j
)
for
(
const
auto
&
rB
:
rBoxes
)
if
(
rB
oxes
[
j
]
.
GetLines
().
size
())
if
(
rB
.
GetLines
().
size
())
// Iterate recursively over the Lines
// Iterate recursively over the Lines
nLn
=
std
::
max
(
GetRowCount
(
rB
oxes
[
j
]
),
nLn
);
nLn
=
std
::
max
(
GetRowCount
(
rB
),
nLn
);
nLines
=
nLines
+
nLn
;
nLines
=
nLines
+
nLn
;
}
}
...
@@ -876,17 +872,17 @@ void FlatFndBox::FillFlat(const _FndBox& rBox, bool bLastBox)
...
@@ -876,17 +872,17 @@ void FlatFndBox::FillFlat(const _FndBox& rBox, bool bLastBox)
// Iterate over Lines
// Iterate over Lines
sal_uInt16
nOldRow
=
nRow
;
sal_uInt16
nOldRow
=
nRow
;
for
(
sal_uInt16
i
=
0
;
i
<
rLines
.
size
();
++
i
)
for
(
const
auto
&
rLine
:
rLines
)
{
{
// The Boxes of a Line
// The Boxes of a Line
const
_FndBoxes
&
rBoxes
=
rLine
s
[
i
]
.
GetBoxes
();
const
_FndBoxes
&
rBoxes
=
rLine
.
GetBoxes
();
sal_uInt16
nOldCol
=
nCol
;
sal_uInt16
nOldCol
=
nCol
;
for
(
sal_uInt16
j
=
0
;
j
<
rBoxes
.
size
();
++
j
)
for
(
_FndBoxes
::
size_type
j
=
0
;
j
<
rBoxes
.
size
();
++
j
)
{
{
// Check the Box if it's an atomic one
// Check the Box if it's an atomic one
const
_FndBox
*
const
pBox
=
&
rBoxes
[
j
];
const
_FndBox
*
const
pBox
=
&
rBoxes
[
j
];
if
(
!
pBox
->
GetLines
().
size
()
)
if
(
pBox
->
GetLines
().
empty
()
)
{
{
// save it
// save it
sal_uInt16
nOff
=
nRow
*
nCols
+
nCol
;
sal_uInt16
nOff
=
nRow
*
nCols
+
nCol
;
...
@@ -916,7 +912,7 @@ void FlatFndBox::FillFlat(const _FndBox& rBox, bool bLastBox)
...
@@ -916,7 +912,7 @@ void FlatFndBox::FillFlat(const _FndBox& rBox, bool bLastBox)
else
else
{
{
// Iterate recursively over the Lines of a Box
// Iterate recursively over the Lines of a Box
FillFlat
(
*
pBox
,
(
j
==
rBoxes
.
size
()
-
1
)
);
FillFlat
(
*
pBox
,
(
j
+
1
==
rBoxes
.
size
()
)
);
}
}
nCol
++
;
nCol
++
;
}
}
...
...
sw/source/core/doc/number.cxx
Dosyayı görüntüle @
2902cdc1
...
@@ -341,7 +341,7 @@ void SwNumFmt::UpdateNumNodes( SwDoc* pDoc )
...
@@ -341,7 +341,7 @@ void SwNumFmt::UpdateNumNodes( SwDoc* pDoc )
{
{
bool
bDocIsModified
=
pDoc
->
getIDocumentState
().
IsModified
();
bool
bDocIsModified
=
pDoc
->
getIDocumentState
().
IsModified
();
bool
bFnd
=
false
;
bool
bFnd
=
false
;
for
(
sal_uInt16
n
=
pDoc
->
GetNumRuleTbl
().
size
();
!
bFnd
&&
n
;
)
for
(
SwNumRuleTbl
::
size_type
n
=
pDoc
->
GetNumRuleTbl
().
size
();
!
bFnd
&&
n
;
)
{
{
const
SwNumRule
*
pRule
=
pDoc
->
GetNumRuleTbl
()[
--
n
];
const
SwNumRule
*
pRule
=
pDoc
->
GetNumRuleTbl
()[
--
n
];
for
(
sal_uInt8
i
=
0
;
i
<
MAXLEVEL
;
++
i
)
for
(
sal_uInt8
i
=
0
;
i
<
MAXLEVEL
;
++
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