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
d47ce6b6
Kaydet (Commit)
d47ce6b6
authored
Eki 09, 2013
tarafından
Caolán McNamara
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
CID#736509 memleaks on early exit
also CID#736508 Change-Id: If3df76d6ff797224fe4214938e50ab624c0617da
üst
4bcdaabe
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
22 deletions
+16
-22
doccomp.cxx
sw/source/core/doc/doccomp.cxx
+16
-22
No files found.
sw/source/core/doc/doccomp.cxx
Dosyayı görüntüle @
d47ce6b6
...
...
@@ -1282,43 +1282,40 @@ bool SwCompareLine::ChangesInLine( const SwCompareLine& rLine,
int
nMinLen
=
std
::
min
(
nDstLen
,
nSrcLen
);
int
nAvgLen
=
(
nDstLen
+
nSrcLen
)
/
2
;
int
*
pLcsDst
=
new
int
[
nMinLen
+
1
]
;
int
*
pLcsSrc
=
new
int
[
nMinLen
+
1
]
;
std
::
vector
<
int
>
aLcsDst
(
nMinLen
+
1
)
;
std
::
vector
<
int
>
aLcsSrc
(
nMinLen
+
1
)
;
if
(
CmpOptions
.
eCmpMode
==
SVX_CMP_BY_WORD
)
{
int
*
pTmpLcsDst
=
new
int
[
nMinLen
+
1
]
;
int
*
pTmpLcsSrc
=
new
int
[
nMinLen
+
1
]
;
std
::
vector
<
int
>
aTmpLcsDst
(
nMinLen
+
1
)
;
std
::
vector
<
int
>
aTmpLcsSrc
(
nMinLen
+
1
)
;
WordArrayComparator
aCmp
(
&
rDstNd
,
&
rSrcNd
);
LgstCommonSubseq
aSeq
(
aCmp
);
nLcsLen
=
aSeq
.
Find
(
pTmpLcsDst
,
pTmpLcsSrc
);
nLcsLen
=
aSeq
.
Find
(
&
aTmpLcsDst
[
0
],
&
aTmpLcsSrc
[
0
]
);
if
(
CmpOptions
.
nIgnoreLen
)
{
nLcsLen
=
aSeq
.
IgnoreIsolatedPieces
(
pTmpLcsDst
,
pTmpLcsSrc
,
nLcsLen
=
aSeq
.
IgnoreIsolatedPieces
(
&
aTmpLcsDst
[
0
],
&
aTmpLcsSrc
[
0
]
,
aCmp
.
GetLen1
(),
aCmp
.
GetLen2
(),
nLcsLen
,
CmpOptions
.
nIgnoreLen
);
}
nLcsLen
=
aCmp
.
GetCharSequence
(
pTmpLcsDst
,
pTmpLcsSrc
,
pLcsDst
,
pLcsSrc
,
nLcsLen
);
delete
[]
pTmpLcsDst
;
delete
[]
pTmpLcsSrc
;
nLcsLen
=
aCmp
.
GetCharSequence
(
&
aTmpLcsDst
[
0
],
&
aTmpLcsSrc
[
0
],
&
aLcsDst
[
0
],
&
aLcsSrc
[
0
],
nLcsLen
);
}
else
{
CharArrayComparator
aCmp
(
&
rDstNd
,
&
rSrcNd
);
LgstCommonSubseq
aSeq
(
aCmp
);
nLcsLen
=
aSeq
.
Find
(
pLcsDst
,
pLcsSrc
);
nLcsLen
=
aSeq
.
Find
(
&
aLcsDst
[
0
],
&
aLcsSrc
[
0
]
);
if
(
CmpOptions
.
nIgnoreLen
)
{
nLcsLen
=
aSeq
.
IgnoreIsolatedPieces
(
pLcsDst
,
pLcsSrc
,
nDstLen
,
nLcsLen
=
aSeq
.
IgnoreIsolatedPieces
(
&
aLcsDst
[
0
],
&
aLcsSrc
[
0
]
,
nDstLen
,
nSrcLen
,
nLcsLen
,
CmpOptions
.
nIgnoreLen
);
}
...
...
@@ -1329,8 +1326,8 @@ bool SwCompareLine::ChangesInLine( const SwCompareLine& rLine,
int
nCnt
=
1
;
for
(
int
i
=
0
;
i
<
nLcsLen
;
i
++
)
{
if
(
i
!=
nLcsLen
-
1
&&
pLcsDst
[
i
]
+
1
==
p
LcsDst
[
i
+
1
]
&&
pLcsSrc
[
i
]
+
1
==
p
LcsSrc
[
i
+
1
]
)
if
(
i
!=
nLcsLen
-
1
&&
aLcsDst
[
i
]
+
1
==
a
LcsDst
[
i
+
1
]
&&
aLcsSrc
[
i
]
+
1
==
a
LcsSrc
[
i
+
1
]
)
{
nCnt
++
;
}
...
...
@@ -1351,10 +1348,10 @@ bool SwCompareLine::ChangesInLine( const SwCompareLine& rLine,
int
nSkip
=
0
;
for
(
int
i
=
0
;
i
<=
nLcsLen
;
i
++
)
{
int
nDstFrom
=
i
?
(
p
LcsDst
[
i
-
1
]
+
1
)
:
0
;
int
nDstTo
=
(
i
==
nLcsLen
)
?
nDstLen
:
p
LcsDst
[
i
];
int
nSrcFrom
=
i
?
(
p
LcsSrc
[
i
-
1
]
+
1
)
:
0
;
int
nSrcTo
=
(
i
==
nLcsLen
)
?
nSrcLen
:
p
LcsSrc
[
i
];
int
nDstFrom
=
i
?
(
a
LcsDst
[
i
-
1
]
+
1
)
:
0
;
int
nDstTo
=
(
i
==
nLcsLen
)
?
nDstLen
:
a
LcsDst
[
i
];
int
nSrcFrom
=
i
?
(
a
LcsSrc
[
i
-
1
]
+
1
)
:
0
;
int
nSrcTo
=
(
i
==
nLcsLen
)
?
nSrcLen
:
a
LcsSrc
[
i
];
SwPaM
aPam
(
rDstNd
,
nDstTo
+
nSkip
);
...
...
@@ -1395,9 +1392,6 @@ bool SwCompareLine::ChangesInLine( const SwCompareLine& rLine,
}
}
delete
[]
pLcsDst
;
delete
[]
pLcsSrc
;
bRet
=
true
;
}
...
...
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