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
bf586deb
Kaydet (Commit)
bf586deb
authored
Şub 21, 2015
tarafından
Matteo Casalin
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Simplify
Change-Id: Iabfbe854f97b92127f1118b0982be39c4d0a2b8b
üst
007edeb7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
25 deletions
+20
-25
docnum.cxx
sw/source/core/doc/docnum.cxx
+20
-25
No files found.
sw/source/core/doc/docnum.cxx
Dosyayı görüntüle @
bf586deb
...
...
@@ -566,9 +566,9 @@ static SwTxtNode* lcl_FindOutlineName( const SwOutlineNodes& rOutlNds, const OUS
bool
bExact
)
{
SwTxtNode
*
pSavedNode
=
nullptr
;
for
(
SwOutlineNodes
::
size_type
n
=
0
;
n
<
rOutlNds
.
size
();
++
n
)
for
(
auto
pOutlNd
:
rOutlNds
)
{
SwTxtNode
*
pTxtNd
=
rOutlNds
[
n
]
->
GetTxtNode
();
SwTxtNode
*
pTxtNd
=
pOutlNd
->
GetTxtNode
();
const
OUString
sTxt
(
pTxtNd
->
GetExpandTxt
()
);
if
(
sTxt
.
startsWith
(
rName
))
{
...
...
@@ -601,22 +601,25 @@ static SwTxtNode* lcl_FindOutlineNum( const SwOutlineNodes& rOutlNds, OUString&
sal_uInt16
nLevelVal
[
MAXLEVEL
];
// numbers of all levels
memset
(
nLevelVal
,
0
,
MAXLEVEL
*
sizeof
(
nLevelVal
[
0
]
));
sal_uInt8
nLevel
=
0
;
int
nLevel
=
0
;
OUString
sName
(
rName
);
while
(
-
1
!=
nPos
)
{
sal_uInt16
nVal
=
0
;
sal_Unicode
c
;
for
(
sal_Int32
n
=
0
;
n
<
sNum
.
getLength
();
++
n
)
if
(
'0'
<=
(
c
=
sNum
[
n
])
&&
c
<=
'9'
)
{
const
sal_Unicode
c
{
sNum
[
n
]};
if
(
'0'
<=
c
&&
c
<=
'9'
)
{
nVal
*=
10
;
nVal
+=
c
-
'0'
;
nVal
*=
10
;
nVal
+=
c
-
'0'
;
}
else
if
(
nLevel
)
break
;
// "almost" valid number
else
return
nullptr
;
// invalid number!
}
if
(
MAXLEVEL
>
nLevel
)
nLevelVal
[
nLevel
++
]
=
nVal
;
...
...
@@ -626,7 +629,7 @@ static SwTxtNode* lcl_FindOutlineNum( const SwOutlineNodes& rOutlNds, OUString&
sNum
=
sName
.
getToken
(
0
,
'.'
,
nPos
);
// #i4533# without this check all parts delimited by a dot are treated as outline numbers
if
(
!
comphelper
::
string
::
isdigitAsciiString
(
sNum
))
nPos
=
-
1
;
break
;
}
rName
=
sName
;
// that's the follow-up text
...
...
@@ -637,32 +640,26 @@ static SwTxtNode* lcl_FindOutlineNum( const SwOutlineNodes& rOutlNds, OUString&
if
(
rOutlNds
.
empty
()
)
return
nullptr
;
SwTxtNode
*
pNd
;
nPos
=
0
;
// search in the existing outline nodes for the required outline num array
for
(
;
nPos
<
(
sal_Int32
)
rOutlNds
.
size
();
++
nPo
s
)
for
(
auto
pOutlNd
:
rOutlNd
s
)
{
pNd
=
rOutlNds
[
nPos
]
->
GetTxtNode
();
const
int
nLvl
=
pNd
->
GetAttrOutlineLevel
()
-
1
;
if
(
nLvl
==
nLevel
-
1
)
SwTxtNode
*
pNd
=
pOutlNd
->
GetTxtNode
();
if
(
pNd
->
GetAttrOutlineLevel
()
==
nLevel
)
{
// #i51089#, #i68289#
// Assure, that text node has the correct numbering level. Otherwise,
// its number vector will not fit to the searched level.
if
(
pNd
->
GetNum
()
&&
pNd
->
GetActualListLevel
()
==
(
nLevel
-
1
)
)
if
(
pNd
->
GetNum
()
&&
pNd
->
GetActualListLevel
()
==
nLevel
-
1
)
{
const
SwNodeNum
&
rNdNum
=
*
(
pNd
->
GetNum
());
SwNumberTree
::
tNumberVector
aLevelVal
=
rNdNum
.
GetNumberVector
();
// now compare with the one searched for
bool
bEqual
=
true
;
for
(
sal_uInt8
n
=
0
;
(
n
<
nLevel
)
&&
bEqual
;
++
n
)
{
bEqual
=
aLevelVal
[
n
]
==
nLevelVal
[
n
];
}
if
(
bEqual
)
for
(
int
n
=
0
;
n
<
nLevel
;
++
n
)
{
break
;
if
(
aLevelVal
[
n
]
==
nLevelVal
[
n
]
)
{
return
pNd
;
}
}
}
else
...
...
@@ -676,10 +673,8 @@ static SwTxtNode* lcl_FindOutlineNum( const SwOutlineNodes& rOutlNds, OUString&
}
}
}
if
(
nPos
>=
(
sal_Int32
)
rOutlNds
.
size
()
)
return
nullptr
;
return
rOutlNds
[
nPos
]
->
GetTxtNode
()
;
return
nullptr
;
}
// Add this bullet point:
...
...
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