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
b880be3c
Kaydet (Commit)
b880be3c
authored
Tem 23, 2014
tarafından
Bjoern Michaelsen
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
reformat/reorg docbm.cxx
Change-Id: I73035e39c30056811d6518c5473c5793d0e5c943
üst
3df855e6
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
82 additions
and
84 deletions
+82
-84
docbm.cxx
sw/source/core/doc/docbm.cxx
+82
-84
No files found.
sw/source/core/doc/docbm.cxx
Dosyayı görüntüle @
b880be3c
...
...
@@ -1126,45 +1126,6 @@ namespace sw { namespace mark
namespace
{
class
_SwSaveTypeCountContent
{
bool
bCharBound
;
sal_uInt16
nCount
;
sal_Int32
nContent
;
public
:
_SwSaveTypeCountContent
()
{
bCharBound
=
false
;
nCount
=
0
;
nContent
=
0
;
}
_SwSaveTypeCountContent
(
const
std
::
vector
<
sal_uLong
>
&
rArr
,
sal_uInt16
&
rPos
)
{
bCharBound
=
static_cast
<
bool
>
(
rArr
[
rPos
++
]);
nCount
=
static_cast
<
sal_uInt16
>
(
rArr
[
rPos
++
]);
nContent
=
static_cast
<
sal_Int32
>
(
rArr
[
rPos
++
]);
}
void
Add
(
std
::
vector
<
sal_uLong
>
&
rArr
)
{
rArr
.
push_back
(
bCharBound
);
rArr
.
push_back
(
nCount
);
rArr
.
push_back
(
nContent
);
}
void
SetCharBound
(
bool
bCB
)
{
bCharBound
=
bCB
;
}
bool
IsCharBound
()
const
{
return
bCharBound
;
}
void
SetCount
(
sal_uInt16
n
)
{
nCount
=
n
;
}
sal_uInt16
GetCount
()
const
{
return
nCount
;
}
sal_uInt16
DecCount
()
{
return
--
nCount
;
}
void
SetContent
(
sal_Int32
n
)
{
nContent
=
n
;
}
sal_Int32
GetContent
()
const
{
return
nContent
;
}
#if OSL_DEBUG_LEVEL > 0
void
Dump
()
{
SAL_INFO
(
"sw.core"
,
"Count: "
<<
GetCount
()
<<
"
\t
Type: "
<<
IsCharBound
()
<<
"
\t
Content: "
<<
GetContent
());
}
#endif
};
// #i59534: If a paragraph will be splitted we have to restore some redline positions
// This help function checks a position compared with a node and an content index
...
...
@@ -1197,18 +1158,6 @@ namespace
{
return
rPos
.
nNode
>
rNdIdx
||
(
pIdx
&&
rPos
.
nNode
==
rNdIdx
&&
rPos
.
nContent
>
pIdx
->
GetIndex
()
);
}
#if 0
static void DumpSaves(std::vector<sal_uLong> &rSaveArr)
{
sal_uInt16 n = 0;
while( n < rSaveArr.size() )
{
_SwSaveTypeCountContent aSave( rSaveArr, n );
aSave.Dump();
}
}
#endif
}
// IDocumentMarkAccess for SwDoc
...
...
@@ -1419,12 +1368,71 @@ void _DelBookmarks(
}
void
_SaveCntntIdx
(
SwDoc
*
pDoc
,
namespace
{
struct
MarkEntry
{
long
int
m_nIdx
;
bool
m_bOther
;
sal_Int32
m_nCntnt
;
#if 0
void Dump()
{
SAL_INFO("sw.core", "Index: " << m_nIdx << "\tOther: " << m_bOther << "\tContent: " << m_nCntnt);
}
#endif
};
struct
PaMEntry
{
SwPaM
*
m_pPaM
;
bool
m_isMark
;
sal_Int32
m_nCntnt
;
};
class
_SwSaveTypeCountContent
{
bool
bCharBound
;
sal_uInt16
nCount
;
sal_Int32
nContent
;
public
:
_SwSaveTypeCountContent
()
{
bCharBound
=
false
;
nCount
=
0
;
nContent
=
0
;
}
_SwSaveTypeCountContent
(
const
std
::
vector
<
sal_uLong
>
&
rArr
,
sal_uInt16
&
rPos
)
{
bCharBound
=
static_cast
<
bool
>
(
rArr
[
rPos
++
]);
nCount
=
static_cast
<
sal_uInt16
>
(
rArr
[
rPos
++
]);
nContent
=
static_cast
<
sal_Int32
>
(
rArr
[
rPos
++
]);
}
void
Add
(
std
::
vector
<
sal_uLong
>
&
rArr
)
{
rArr
.
push_back
(
bCharBound
);
rArr
.
push_back
(
nCount
);
rArr
.
push_back
(
nContent
);
}
void
SetCharBound
(
bool
bCB
)
{
bCharBound
=
bCB
;
}
bool
IsCharBound
()
const
{
return
bCharBound
;
}
void
SetCount
(
sal_uInt16
n
)
{
nCount
=
n
;
}
sal_uInt16
GetCount
()
const
{
return
nCount
;
}
sal_uInt16
DecCount
()
{
return
--
nCount
;
}
void
SetContent
(
sal_Int32
n
)
{
nContent
=
n
;
}
sal_Int32
GetContent
()
const
{
return
nContent
;
}
#if OSL_DEBUG_LEVEL > 0
void
Dump
()
{
SAL_INFO
(
"sw.core"
,
"Count: "
<<
GetCount
()
<<
"
\t
Type: "
<<
IsCharBound
()
<<
"
\t
Content: "
<<
GetContent
());
}
#endif
};
void
_SaveCntntIdx
(
SwDoc
*
pDoc
,
sal_uLong
nNode
,
sal_Int32
nCntnt
,
std
::
vector
<
sal_uLong
>
&
rSaveArr
,
sal_uInt8
nSaveFly
)
{
{
// 1. Bookmarks
_SwSaveTypeCountContent
aSave
;
// 4. Paragraph anchored objects
...
...
@@ -1434,11 +1442,11 @@ void _SaveCntntIdx(SwDoc* pDoc,
{
SwFrm
*
pFrm
=
pNode
->
getLayoutFrm
(
pDoc
->
GetCurrentLayout
()
);
#if OSL_DEBUG_LEVEL > 1
#if OSL_DEBUG_LEVEL > 1
static
bool
bViaDoc
=
false
;
if
(
bViaDoc
)
pFrm
=
NULL
;
#endif
#endif
if
(
pFrm
)
// Do we have a layout? Then it's a bit cheaper ...
{
if
(
pFrm
->
GetDrawObjs
()
)
...
...
@@ -1518,14 +1526,14 @@ void _SaveCntntIdx(SwDoc* pDoc,
}
}
}
}
}
void
_RestoreCntntIdx
(
SwDoc
*
pDoc
,
void
_RestoreCntntIdx
(
SwDoc
*
pDoc
,
std
::
vector
<
sal_uLong
>
&
rSaveArr
,
sal_uLong
nNode
,
sal_Int32
nOffset
,
bool
bAuto
)
{
{
SwCntntNode
*
pCNd
=
pDoc
->
GetNodes
()[
nNode
]
->
GetCntntNode
();
SwFrmFmts
*
pSpz
=
pDoc
->
GetSpzFrmFmts
();
sal_uInt16
n
=
0
;
...
...
@@ -1563,21 +1571,21 @@ void _RestoreCntntIdx(SwDoc* pDoc,
}
if
(
pPos
)
{
#if OSL_DEBUG_LEVEL > 0
#if OSL_DEBUG_LEVEL > 0
aSave
.
Dump
();
#endif
#endif
SAL_INFO
(
"sw.core"
,
"setting "
<<
pPos
<<
" for Index "
<<
aSave
.
GetCount
()
<<
" on Node "
<<
nNode
<<
" from "
<<
pPos
->
nContent
.
GetIndex
()
<<
" to "
<<
(
aSave
.
GetContent
()
+
nOffset
));
pPos
->
nNode
=
*
pCNd
;
pPos
->
nContent
.
Assign
(
pCNd
,
aSave
.
GetContent
()
+
nOffset
);
}
}
}
}
void
_RestoreCntntIdx
(
std
::
vector
<
sal_uLong
>
&
rSaveArr
,
void
_RestoreCntntIdx
(
std
::
vector
<
sal_uLong
>
&
rSaveArr
,
const
SwNode
&
rNd
,
sal_Int32
nLen
,
sal_Int32
nChkLen
)
{
{
const
SwDoc
*
pDoc
=
rNd
.
GetDoc
();
const
SwFrmFmts
*
pSpz
=
pDoc
->
GetSpzFrmFmts
();
SwCntntNode
*
pCNd
=
(
SwCntntNode
*
)
rNd
.
GetCntntNode
();
...
...
@@ -1622,28 +1630,7 @@ void _RestoreCntntIdx(std::vector<sal_uLong> &rSaveArr,
rSaveArr
.
erase
(
rSaveArr
.
begin
()
+
n
,
rSaveArr
.
begin
()
+
n
+
2
);
}
}
}
namespace
{
struct
MarkEntry
{
long
int
m_nIdx
;
bool
m_bOther
;
sal_Int32
m_nCntnt
;
#if 0
void Dump()
{
SAL_INFO("sw.core", "Index: " << m_nIdx << "\tOther: " << m_bOther << "\tContent: " << m_nCntnt);
}
#endif
};
struct
PaMEntry
{
SwPaM
*
m_pPaM
;
bool
m_isMark
;
sal_Int32
m_nCntnt
;
};
struct
OffsetUpdater
{
const
SwCntntNode
*
m_pNewCntntNode
;
...
...
@@ -1774,12 +1761,22 @@ namespace
rPaMEntries
.
push_back
(
aEntry
);
}
}
#if 0
static void DumpEntries(std::vector<MarkEntry>* pEntries)
{
BOOST_FOREACH(MarkEntry& aEntry, *pEntries)
aEntry.Dump();
}
static void DumpSaves(std::vector<sal_uLong> &rSaveArr)
{
sal_uInt16 n = 0;
while( n < rSaveArr.size() )
{
_SwSaveTypeCountContent aSave( rSaveArr, n );
aSave.Dump();
}
}
#endif
}
...
...
@@ -1967,6 +1964,7 @@ void CntntIdxStoreImpl::RestoreShellCrsrs(SwDoc* /* pDoc */, updater_t& rUpdater
rUpdater
(
aEntry
.
m_pPaM
->
GetBound
(
aEntry
.
m_isMark
),
aEntry
.
m_nCntnt
);
}
}
namespace
sw
{
namespace
mark
{
boost
::
shared_ptr
<
CntntIdxStore
>
CntntIdxStore
::
Create
()
{
...
...
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