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
593e4c36
Kaydet (Commit)
593e4c36
authored
Eki 20, 2011
tarafından
Daniel Di Marco
Kaydeden (comit)
Ivan Timofeev
Eki 20, 2011
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
SvUShorts -> std::vector
üst
a6347e09
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
39 additions
and
39 deletions
+39
-39
swcache.cxx
sw/source/core/bastyp/swcache.cxx
+10
-11
doctxm.cxx
sw/source/core/doc/doctxm.cxx
+24
-23
doctxm.hxx
sw/source/core/inc/doctxm.hxx
+2
-3
swcache.hxx
sw/source/core/inc/swcache.hxx
+3
-2
No files found.
sw/source/core/bastyp/swcache.cxx
Dosyayı görüntüle @
593e4c36
...
...
@@ -75,9 +75,9 @@ void SwCache::Check()
OSL_ENSURE
(
pObj
!=
pRekursive
,
"Recursion in SwCache."
);
}
OSL_ENSURE
(
bFirstFound
,
"First not Found."
);
OSL_ENSURE
(
(
nCnt
+
aFreePositions
.
Count
())
==
Count
(),
"Lost Chain."
);
OSL_ENSURE
(
(
nCnt
+
aFreePositions
.
size
())
==
Count
(),
"Lost Chain."
);
if
(
Count
()
==
nCurMax
)
OSL_ENSURE
(
(
nCurMax
-
nCnt
)
==
aFreePositions
.
Count
(),
"Lost FreePositions."
);
OSL_ENSURE
(
(
nCurMax
-
nCnt
)
==
aFreePositions
.
size
(),
"Lost FreePositions."
);
}
#endif
...
...
@@ -98,7 +98,6 @@ SwCache::SwCache( const sal_uInt16 nInitSize, const sal_uInt16 nGrowSize
#endif
)
:
SwCacheObjArr
(
(
sal_uInt8
)
nInitSize
,
(
sal_uInt8
)
nGrowSize
),
aFreePositions
(
5
,
5
),
pRealFirst
(
0
),
pFirst
(
0
),
pLast
(
0
),
...
...
@@ -227,7 +226,7 @@ void SwCache::Flush( const sal_uInt8 )
{
pTmp
=
(
SwCacheObj
*
)
pObj
;
pObj
=
pTmp
->
GetNext
();
aFreePositions
.
Insert
(
pTmp
->
GetCachePos
(),
aFreePositions
.
Count
()
);
aFreePositions
.
push_back
(
pTmp
->
GetCachePos
()
);
*
(
pData
+
pTmp
->
GetCachePos
())
=
(
void
*
)
0
;
delete
pTmp
;
INCREMENT
(
nFlushedObjects
);
...
...
@@ -379,13 +378,13 @@ void SwCache::DeleteObj( SwCacheObj *pObj )
if
(
pObj
->
GetNext
()
)
pObj
->
GetNext
()
->
SetPrev
(
pObj
->
GetPrev
()
);
aFreePositions
.
Insert
(
pObj
->
GetCachePos
(),
aFreePositions
.
Count
()
);
aFreePositions
.
push_back
(
pObj
->
GetCachePos
()
);
*
(
pData
+
pObj
->
GetCachePos
())
=
(
void
*
)
0
;
delete
pObj
;
CHECK
;
if
(
Count
()
>
nCurMax
&&
(
nCurMax
<=
(
Count
()
-
aFreePositions
.
Count
()))
)
(
nCurMax
<=
(
Count
()
-
aFreePositions
.
size
()))
)
{
//Falls moeglich wieder verkleinern, dazu muessen allerdings ausreichend
//Freie Positionen bereitstehen.
...
...
@@ -402,7 +401,7 @@ void SwCache::DeleteObj( SwCacheObj *pObj )
else
pTmpObj
->
SetCachePos
(
i
);
}
aFreePositions
.
Remove
(
0
,
aFreePositions
.
Count
()
);
aFreePositions
.
clear
(
);
}
CHECK
;
}
...
...
@@ -434,14 +433,14 @@ sal_Bool SwCache::Insert( SwCacheObj *pNew )
nPos
=
Count
();
SwCacheObjArr
::
C40_INSERT
(
SwCacheObj
,
pNew
,
nPos
);
}
else
if
(
aFreePositions
.
Count
()
)
else
if
(
!
aFreePositions
.
empty
()
)
{
//Es exitieren Platzhalter, also den letzten benutzen.
INCREMENT
(
nInsertFree
);
const
sal_uInt16
nFreePos
=
aFreePositions
.
Count
()
-
1
;
const
sal_uInt16
nFreePos
=
aFreePositions
.
size
()
-
1
;
nPos
=
aFreePositions
[
nFreePos
];
*
(
pData
+
nPos
)
=
pNew
;
aFreePositions
.
Remove
(
nFreePos
);
aFreePositions
.
erase
(
aFreePositions
.
begin
()
+
nFreePos
);
}
else
{
...
...
@@ -505,7 +504,7 @@ sal_Bool SwCache::Insert( SwCacheObj *pNew )
void
SwCache
::
SetLRUOfst
(
const
sal_uInt16
nOfst
)
{
if
(
!
pRealFirst
||
((
Count
()
-
aFreePositions
.
Count
())
<
nOfst
)
)
if
(
!
pRealFirst
||
((
Count
()
-
aFreePositions
.
size
())
<
nOfst
)
)
return
;
CHECK
;
...
...
sw/source/core/doc/doctxm.cxx
Dosyayı görüntüle @
593e4c36
...
...
@@ -1905,9 +1905,9 @@ void SwTOXBaseSection::UpdatePageNum()
for
(
sal_uInt16
nCnt
=
0
;
nCnt
<
aSortArr
.
Count
();
++
nCnt
)
{
// Schleife ueber alle SourceNodes
SvUShorts
aNums
;
//Die Seitennummern
std
::
vector
<
sal_uInt16
>
aNums
;
//Die Seitennummern
SvPtrarr
aDescs
;
//Die PageDescriptoren passend zu den Seitennummern.
SvUShorts
*
pMainNums
=
0
;
// contains page numbers of main entries
std
::
vector
<
sal_uInt16
>
*
pMainNums
=
0
;
// contains page numbers of main entries
// process run in lines
sal_uInt16
nRange
=
0
;
...
...
@@ -1961,12 +1961,12 @@ void SwTOXBaseSection::UpdatePageNum()
}
// sortiert einfuegen
for
(
i
=
0
;
i
<
aNums
.
Count
()
&&
aNums
[
i
]
<
nPage
;
++
i
)
for
(
i
=
0
;
i
<
aNums
.
size
()
&&
aNums
[
i
]
<
nPage
;
++
i
)
;
if
(
i
>=
aNums
.
Count
()
||
aNums
[
i
]
!=
nPage
)
if
(
i
>=
aNums
.
size
()
||
aNums
[
i
]
!=
nPage
)
{
aNums
.
Insert
(
nPage
,
i
);
aNums
.
insert
(
aNums
.
begin
()
+
i
,
nPage
);
aDescs
.
Insert
(
(
void
*
)
pAktPage
->
GetPageDesc
(),
i
);
}
// is it a main entry?
...
...
@@ -1974,8 +1974,8 @@ void SwTOXBaseSection::UpdatePageNum()
rTOXSource
.
bMainEntry
)
{
if
(
!
pMainNums
)
pMainNums
=
new
SvUShorts
;
pMainNums
->
Insert
(
nPage
,
pMainNums
->
Count
()
);
pMainNums
=
new
std
::
vector
<
sal_uInt16
>
;
pMainNums
->
push_back
(
nPage
);
}
}
}
...
...
@@ -1990,7 +1990,7 @@ void SwTOXBaseSection::UpdatePageNum()
aIntl
);
}
DELETEZ
(
pMainNums
);
aNums
.
Remove
(
0
,
aNums
.
Count
()
);
aNums
.
clear
(
);
}
}
// nach dem Setzen der richtigen Seitennummer, das Mapping-Array
...
...
@@ -2002,22 +2002,22 @@ void SwTOXBaseSection::UpdatePageNum()
Beschreibung: Austausch der Seitennummer-Platzhalter
--------------------------------------------------------------------*/
// search for the page no in the array of main entry page numbers
sal_Bool
lcl_HasMainEntry
(
const
SvUShorts
*
pMainEntryNums
,
sal_uInt16
nToFind
)
sal_Bool
lcl_HasMainEntry
(
const
std
::
vector
<
sal_uInt16
>
*
pMainEntryNums
,
sal_uInt16
nToFind
)
{
for
(
sal_uInt16
i
=
0
;
pMainEntryNums
&&
i
<
pMainEntryNums
->
Count
();
++
i
)
for
(
sal_uInt16
i
=
0
;
pMainEntryNums
&&
i
<
pMainEntryNums
->
size
();
++
i
)
if
(
nToFind
==
(
*
pMainEntryNums
)[
i
])
return
sal_True
;
return
sal_False
;
}
void
SwTOXBaseSection
::
_UpdatePageNum
(
SwTxtNode
*
pNd
,
const
SvUShorts
&
rNums
,
const
std
::
vector
<
sal_uInt16
>
&
rNums
,
const
SvPtrarr
&
rDescs
,
const
SvUShorts
*
pMainEntryNums
,
const
std
::
vector
<
sal_uInt16
>
*
pMainEntryNums
,
const
SwTOXInternational
&
rIntl
)
{
//collect starts end ends of main entry character style
SvUShorts
*
pCharStyleIdx
=
pMainEntryNums
?
new
SvUShorts
:
0
;
std
::
vector
<
sal_uInt16
>*
pCharStyleIdx
=
pMainEntryNums
?
new
std
::
vector
<
sal_uInt16
>
:
0
;
String
sSrchStr
(
cNumRepl
);
sSrchStr
.
AppendAscii
(
sPageDeli
)
+=
cNumRepl
;
...
...
@@ -2026,7 +2026,7 @@ void SwTOXBaseSection::_UpdatePageNum( SwTxtNode* pNd,
xub_StrLen
nEndPos
=
pNd
->
GetTxt
().
Search
(
sSrchStr
);
sal_uInt16
i
;
if
(
STRING_NOTFOUND
==
nEndPos
||
!
rNums
.
Count
()
)
if
(
STRING_NOTFOUND
==
nEndPos
||
rNums
.
empty
()
)
return
;
if
(
STRING_NOTFOUND
==
nStartPos
||
nStartPos
>
nEndPos
)
...
...
@@ -2040,7 +2040,7 @@ void SwTOXBaseSection::_UpdatePageNum( SwTxtNode* pNd,
if
(
pCharStyleIdx
&&
lcl_HasMainEntry
(
pMainEntryNums
,
nBeg
))
{
sal_uInt16
nTemp
=
0
;
pCharStyleIdx
->
Insert
(
nTemp
,
pCharStyleIdx
->
Count
()
);
pCharStyleIdx
->
push_back
(
nTemp
);
}
// Platzhalter loeschen
...
...
@@ -2062,7 +2062,7 @@ void SwTOXBaseSection::_UpdatePageNum( SwTxtNode* pNd,
}
pNd
->
EraseText
(
aPos
,
nEndPos
-
nStartPos
+
2
);
for
(
i
=
1
;
i
<
rNums
.
Count
();
++
i
)
for
(
i
=
1
;
i
<
rNums
.
size
();
++
i
)
{
SvxNumberType
aType
(
((
SwPageDesc
*
)
rDescs
[
i
])
->
GetNumType
()
);
if
(
TOX_INDEX
==
SwTOXBase
::
GetType
()
)
...
...
@@ -2100,8 +2100,9 @@ void SwTOXBaseSection::_UpdatePageNum( SwTxtNode* pNd,
aNumStr
.
AppendAscii
(
sPageDeli
);
//the change of the character style must apply after sPageDeli is appended
if
(
pCharStyleIdx
&&
bMainEntryChanges
)
pCharStyleIdx
->
Insert
(
aNumStr
.
Len
(),
pCharStyleIdx
->
Count
());
{
pCharStyleIdx
->
push_back
(
aNumStr
.
Len
());
}
aNumStr
+=
aType
.
GetNumStr
(
nBeg
);
nCount
=
0
;
}
...
...
@@ -2110,7 +2111,7 @@ void SwTOXBaseSection::_UpdatePageNum( SwTxtNode* pNd,
else
{
// Alle Nummern eintragen
aNumStr
+=
aType
.
GetNumStr
(
sal_uInt16
(
rNums
[
i
])
);
if
(
i
!=
(
rNums
.
Count
()
-
1
))
if
(
i
!=
(
rNums
.
size
()
-
1
))
aNumStr
.
AppendAscii
(
sPageDeli
);
}
}
...
...
@@ -2145,11 +2146,11 @@ void SwTOXBaseSection::_UpdatePageNum( SwTxtNode* pNd,
}
//now the main entries should get there character style
if
(
pCharStyleIdx
&&
pCharStyleIdx
->
Count
()
&&
GetMainEntryCharStyle
().
Len
())
if
(
pCharStyleIdx
&&
!
pCharStyleIdx
->
empty
()
&&
GetMainEntryCharStyle
().
Len
())
{
// eventually the last index must me appended
if
(
pCharStyleIdx
->
Count
()
&
0x01
)
pCharStyleIdx
->
Insert
(
aNumStr
.
Len
(),
pCharStyleIdx
->
Count
());
if
(
pCharStyleIdx
->
size
()
&
0x01
)
pCharStyleIdx
->
push_back
(
aNumStr
.
Len
());
//search by name
SwDoc
*
pDoc
=
pNd
->
GetDoc
();
...
...
@@ -2165,7 +2166,7 @@ void SwTOXBaseSection::_UpdatePageNum( SwTxtNode* pNd,
//find the page numbers in aNumStr and set the character style
xub_StrLen
nOffset
=
pNd
->
GetTxt
().
Len
()
-
aNumStr
.
Len
();
SwFmtCharFmt
aCharFmt
(
pCharFmt
);
for
(
sal_uInt16
j
=
0
;
j
<
pCharStyleIdx
->
Count
();
j
+=
2
)
for
(
sal_uInt16
j
=
0
;
j
<
pCharStyleIdx
->
size
();
j
+=
2
)
{
xub_StrLen
nStartIdx
=
(
*
pCharStyleIdx
)[
j
]
+
nOffset
;
xub_StrLen
nEndIdx
=
(
*
pCharStyleIdx
)[
j
+
1
]
+
nOffset
;
...
...
sw/source/core/inc/doctxm.hxx
Dosyayı görüntüle @
593e4c36
...
...
@@ -35,7 +35,6 @@
#include <section.hxx>
class
SwTOXInternational
;
class
SvUShorts
;
class
SvStringsDtor
;
class
SvPtrarr
;
class
SwPageDesc
;
...
...
@@ -83,9 +82,9 @@ class SwTOXBaseSection : public SwTOXBase, public SwSection
// Seitennummerplatzhalter gegen aktuelle Nummern austauschen
void
_UpdatePageNum
(
SwTxtNode
*
pNd
,
const
SvUShorts
&
rNums
,
const
std
::
vector
<
sal_uInt16
>
&
rNums
,
const
SvPtrarr
&
rDescs
,
const
SvUShorts
*
pMainEntryNums
,
const
std
::
vector
<
sal_uInt16
>
*
pMainEntryNums
,
const
SwTOXInternational
&
rIntl
);
// Bereich fuer Stichwort einfuegen suchen
...
...
sw/source/core/inc/swcache.hxx
Dosyayı görüntüle @
593e4c36
...
...
@@ -58,12 +58,13 @@
*
*/
#include <vector>
#if OSL_DEBUG_LEVEL > 1
#include <tools/string.hxx>
#endif
#ifndef _SVSTDARR_HXX
#define _SVSTDARR_USHORTS
#include <svl/svstdarr.hxx>
#endif
...
...
@@ -73,7 +74,7 @@ SV_DECL_PTRARR_DEL(SwCacheObjArr,SwCacheObj*,1,1)
class
SwCache
:
public
SwCacheObjArr
{
SvUShorts
aFreePositions
;
//Freie Positionen fuer das Insert wenn
std
::
vector
<
sal_uInt16
>
aFreePositions
;
//Freie Positionen fuer das Insert wenn
//die Maximalgrenze nicht erreicht ist.
//Immer wenn ein Objekt ausgetragen wird,
//so wird seine Position hier eingetragen.
...
...
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