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
b5dc7296
Kaydet (Commit)
b5dc7296
authored
Şub 06, 2012
tarafından
Michael Stahl
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
sw: undobj.cxx: deploy some asserts
üst
13424b43
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
18 deletions
+17
-18
undobj.cxx
sw/source/core/undo/undobj.cxx
+17
-18
No files found.
sw/source/core/undo/undobj.cxx
Dosyayı görüntüle @
b5dc7296
...
@@ -235,19 +235,19 @@ private:
...
@@ -235,19 +235,19 @@ private:
void
SwUndo
::
Undo
()
void
SwUndo
::
Undo
()
{
{
OSL_ENSURE
(
false
,
"SwUndo::Undo(): ERROR: must call Undo(context) instead"
);
assert
(
false
);
// SwUndo::Undo(): ERROR: must call UndoWithContext instead
}
}
void
SwUndo
::
Redo
()
void
SwUndo
::
Redo
()
{
{
OSL_ENSURE
(
false
,
"SwUndo::Redo(): ERROR: must call Redo(context) instead"
);
assert
(
false
);
// SwUndo::Redo(): ERROR: must call RedoWithContext instead
}
}
void
SwUndo
::
UndoWithContext
(
SfxUndoContext
&
rContext
)
void
SwUndo
::
UndoWithContext
(
SfxUndoContext
&
rContext
)
{
{
::
sw
::
UndoRedoContext
*
const
pContext
(
::
sw
::
UndoRedoContext
*
const
pContext
(
dynamic_cast
<
::
sw
::
UndoRedoContext
*
>
(
&
rContext
));
dynamic_cast
<
::
sw
::
UndoRedoContext
*
>
(
&
rContext
));
OSL_ASSERT
(
pContext
);
assert
(
pContext
);
if
(
!
pContext
)
{
return
;
}
if
(
!
pContext
)
{
return
;
}
UndoRedoRedlineGuard
const
g
(
*
pContext
,
*
this
);
UndoRedoRedlineGuard
const
g
(
*
pContext
,
*
this
);
UndoImpl
(
*
pContext
);
UndoImpl
(
*
pContext
);
...
@@ -257,7 +257,7 @@ void SwUndo::RedoWithContext(SfxUndoContext & rContext)
...
@@ -257,7 +257,7 @@ void SwUndo::RedoWithContext(SfxUndoContext & rContext)
{
{
::
sw
::
UndoRedoContext
*
const
pContext
(
::
sw
::
UndoRedoContext
*
const
pContext
(
dynamic_cast
<
::
sw
::
UndoRedoContext
*
>
(
&
rContext
));
dynamic_cast
<
::
sw
::
UndoRedoContext
*
>
(
&
rContext
));
OSL_ASSERT
(
pContext
);
assert
(
pContext
);
if
(
!
pContext
)
{
return
;
}
if
(
!
pContext
)
{
return
;
}
UndoRedoRedlineGuard
const
g
(
*
pContext
,
*
this
);
UndoRedoRedlineGuard
const
g
(
*
pContext
,
*
this
);
RedoImpl
(
*
pContext
);
RedoImpl
(
*
pContext
);
...
@@ -267,7 +267,7 @@ void SwUndo::Repeat(SfxRepeatTarget & rContext)
...
@@ -267,7 +267,7 @@ void SwUndo::Repeat(SfxRepeatTarget & rContext)
{
{
::
sw
::
RepeatContext
*
const
pRepeatContext
(
::
sw
::
RepeatContext
*
const
pRepeatContext
(
dynamic_cast
<
::
sw
::
RepeatContext
*
>
(
&
rContext
));
dynamic_cast
<
::
sw
::
RepeatContext
*
>
(
&
rContext
));
OSL_ASSERT
(
pRepeatContext
);
assert
(
pRepeatContext
);
if
(
!
pRepeatContext
)
{
return
;
}
if
(
!
pRepeatContext
)
{
return
;
}
RepeatImpl
(
*
pRepeatContext
);
RepeatImpl
(
*
pRepeatContext
);
}
}
...
@@ -276,7 +276,7 @@ sal_Bool SwUndo::CanRepeat(SfxRepeatTarget & rContext) const
...
@@ -276,7 +276,7 @@ sal_Bool SwUndo::CanRepeat(SfxRepeatTarget & rContext) const
{
{
::
sw
::
RepeatContext
*
const
pRepeatContext
(
::
sw
::
RepeatContext
*
const
pRepeatContext
(
dynamic_cast
<
::
sw
::
RepeatContext
*
>
(
&
rContext
));
dynamic_cast
<
::
sw
::
RepeatContext
*
>
(
&
rContext
));
OSL_ASSERT
(
pRepeatContext
);
assert
(
pRepeatContext
);
if
(
!
pRepeatContext
)
{
return
false
;
}
if
(
!
pRepeatContext
)
{
return
false
;
}
return
CanRepeatImpl
(
*
pRepeatContext
);
return
CanRepeatImpl
(
*
pRepeatContext
);
}
}
...
@@ -595,7 +595,7 @@ void SwUndoSaveCntnt::DelCntntIndex( const SwPosition& rMark,
...
@@ -595,7 +595,7 @@ void SwUndoSaveCntnt::DelCntntIndex( const SwPosition& rMark,
pHistory
=
new
SwHistory
;
pHistory
=
new
SwHistory
;
SwTxtAttr
*
const
pFtnHnt
=
SwTxtAttr
*
const
pFtnHnt
=
pTxtNd
->
GetTxtAttrForCharAt
(
nFtnSttIdx
);
pTxtNd
->
GetTxtAttrForCharAt
(
nFtnSttIdx
);
OSL_ENSURE
(
pFtnHnt
,
"kein FtnAttribut"
);
assert
(
pFtnHnt
);
SwIndex
aIdx
(
pTxtNd
,
nFtnSttIdx
);
SwIndex
aIdx
(
pTxtNd
,
nFtnSttIdx
);
pHistory
->
Add
(
pFtnHnt
,
pTxtNd
->
GetIndex
(),
false
);
pHistory
->
Add
(
pFtnHnt
,
pTxtNd
->
GetIndex
(),
false
);
pTxtNd
->
EraseText
(
aIdx
,
1
);
pTxtNd
->
EraseText
(
aIdx
,
1
);
...
@@ -619,7 +619,7 @@ void SwUndoSaveCntnt::DelCntntIndex( const SwPosition& rMark,
...
@@ -619,7 +619,7 @@ void SwUndoSaveCntnt::DelCntntIndex( const SwPosition& rMark,
pHistory
=
new
SwHistory
;
pHistory
=
new
SwHistory
;
SwTxtAttr
*
const
pFtnHnt
=
SwTxtAttr
*
const
pFtnHnt
=
pTxtNd
->
GetTxtAttrForCharAt
(
nFtnSttIdx
);
pTxtNd
->
GetTxtAttrForCharAt
(
nFtnSttIdx
);
OSL_ENSURE
(
pFtnHnt
,
"kein FtnAttribut"
);
assert
(
pFtnHnt
);
SwIndex
aIdx
(
pTxtNd
,
nFtnSttIdx
);
SwIndex
aIdx
(
pTxtNd
,
nFtnSttIdx
);
pHistory
->
Add
(
pFtnHnt
,
pTxtNd
->
GetIndex
(),
false
);
pHistory
->
Add
(
pFtnHnt
,
pTxtNd
->
GetIndex
(),
false
);
pTxtNd
->
EraseText
(
aIdx
,
1
);
pTxtNd
->
EraseText
(
aIdx
,
1
);
...
@@ -659,7 +659,7 @@ void SwUndoSaveCntnt::DelCntntIndex( const SwPosition& rMark,
...
@@ -659,7 +659,7 @@ void SwUndoSaveCntnt::DelCntntIndex( const SwPosition& rMark,
pAPos
->
nNode
.
GetNode
().
GetTxtNode
();
pAPos
->
nNode
.
GetNode
().
GetTxtNode
();
SwTxtAttr
*
const
pFlyHnt
=
pTxtNd
->
GetTxtAttrForCharAt
(
SwTxtAttr
*
const
pFlyHnt
=
pTxtNd
->
GetTxtAttrForCharAt
(
pAPos
->
nContent
.
GetIndex
());
pAPos
->
nContent
.
GetIndex
());
OSL_ENSURE
(
pFlyHnt
,
"kein FlyAttribut"
);
assert
(
pFlyHnt
);
pHistory
->
Add
(
pFlyHnt
,
0
,
false
);
pHistory
->
Add
(
pFlyHnt
,
0
,
false
);
// n wieder zurueck, damit nicht ein Format uebesprungen wird !
// n wieder zurueck, damit nicht ein Format uebesprungen wird !
n
=
n
>=
rSpzArr
.
Count
()
?
rSpzArr
.
Count
()
:
n
+
1
;
n
=
n
>=
rSpzArr
.
Count
()
?
rSpzArr
.
Count
()
:
n
+
1
;
...
@@ -980,8 +980,8 @@ SwRedlineSaveData::SwRedlineSaveData( SwComparePosition eCmpPos,
...
@@ -980,8 +980,8 @@ SwRedlineSaveData::SwRedlineSaveData( SwComparePosition eCmpPos,
:
SwUndRng
(
rRedl
),
:
SwUndRng
(
rRedl
),
SwRedlineData
(
rRedl
.
GetRedlineData
(),
bCopyNext
)
SwRedlineData
(
rRedl
.
GetRedlineData
(),
bCopyNext
)
{
{
OSL_ENSURE
(
POS_OUTSIDE
==
eCmpPos
||
assert
(
POS_OUTSIDE
==
eCmpPos
||
!
rRedl
.
GetContentIdx
()
,
"Redline mit Content"
);
!
rRedl
.
GetContentIdx
()
);
// "Redline with Content"
switch
(
eCmpPos
)
switch
(
eCmpPos
)
{
{
...
@@ -1014,7 +1014,7 @@ SwRedlineSaveData::SwRedlineSaveData( SwComparePosition eCmpPos,
...
@@ -1014,7 +1014,7 @@ SwRedlineSaveData::SwRedlineSaveData( SwComparePosition eCmpPos,
break
;
break
;
default
:
default
:
OSL_ENSURE
(
!
this
,
"keine gueltigen Daten!"
);
assert
(
false
);
}
}
#if OSL_DEBUG_LEVEL > 0
#if OSL_DEBUG_LEVEL > 0
...
@@ -1052,8 +1052,7 @@ void SwRedlineSaveData::RedlineToDoc( SwPaM& rPam )
...
@@ -1052,8 +1052,7 @@ void SwRedlineSaveData::RedlineToDoc( SwPaM& rPam )
rDoc
.
GetDocShell
()
->
Broadcast
(
SwRedlineHint
(
pRedl
,
SWREDLINE_INSERTED
));
rDoc
.
GetDocShell
()
->
Broadcast
(
SwRedlineHint
(
pRedl
,
SWREDLINE_INSERTED
));
//
//
bool
const
bSuccess
=
rDoc
.
AppendRedline
(
pRedl
,
true
);
bool
const
bSuccess
=
rDoc
.
AppendRedline
(
pRedl
,
true
);
OSL_ENSURE
(
bSuccess
,
assert
(
bSuccess
);
// SwRedlineSaveData::RedlineToDoc: insert redline failed
"SwRedlineSaveData::RedlineToDoc: insert redline failed"
);
(
void
)
bSuccess
;
// unused in non-debug
(
void
)
bSuccess
;
// unused in non-debug
rDoc
.
SetRedlineMode_intern
(
eOld
);
rDoc
.
SetRedlineMode_intern
(
eOld
);
}
}
...
@@ -1131,9 +1130,9 @@ void SwUndo::SetSaveData( SwDoc& rDoc, const SwRedlineSaveDatas& rSData )
...
@@ -1131,9 +1130,9 @@ void SwUndo::SetSaveData( SwDoc& rDoc, const SwRedlineSaveDatas& rSData )
#if OSL_DEBUG_LEVEL > 0
#if OSL_DEBUG_LEVEL > 0
// check redline count against count saved in RedlineSaveData object
// check redline count against count saved in RedlineSaveData object
OSL_ENSURE
(
(
rSData
.
Count
()
==
0
)
||
assert
(
(
rSData
.
Count
()
==
0
)
||
(
rSData
[
0
]
->
nRedlineCount
==
rDoc
.
GetRedlineTbl
().
Count
()),
(
rSData
[
0
]
->
nRedlineCount
==
rDoc
.
GetRedlineTbl
().
Count
()));
"redline count not restored properly"
);
// "redline count not restored properly"
#endif
#endif
rDoc
.
SetRedlineMode_intern
(
eOld
);
rDoc
.
SetRedlineMode_intern
(
eOld
);
...
@@ -1188,7 +1187,7 @@ sal_Bool SwUndo::CanRedlineGroup( SwRedlineSaveDatas& rCurr,
...
@@ -1188,7 +1187,7 @@ sal_Bool SwUndo::CanRedlineGroup( SwRedlineSaveDatas& rCurr,
// #111827#
// #111827#
String
ShortenString
(
const
String
&
rStr
,
xub_StrLen
nLength
,
const
String
&
rFillStr
)
String
ShortenString
(
const
String
&
rStr
,
xub_StrLen
nLength
,
const
String
&
rFillStr
)
{
{
OSL_ENSURE
(
nLength
-
rFillStr
.
Len
()
>=
2
,
"improper arguments"
);
assert
(
nLength
-
rFillStr
.
Len
()
>=
2
);
String
aResult
;
String
aResult
;
...
...
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