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
f32075fd
Kaydet (Commit)
f32075fd
authored
Eyl 03, 2018
tarafından
Michael Stahl
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
sw_redlinehide_2: remove a pointless level of indentation
Change-Id: I82893951b6e227ab1ed6423e08a0370561482cd8
üst
905541a6
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
67 additions
and
70 deletions
+67
-70
DocumentContentOperationsManager.cxx
sw/source/core/doc/DocumentContentOperationsManager.cxx
+67
-70
No files found.
sw/source/core/doc/DocumentContentOperationsManager.cxx
Dosyayı görüntüle @
f32075fd
...
...
@@ -3572,96 +3572,93 @@ DocumentContentOperationsManager::~DocumentContentOperationsManager()
bool
DocumentContentOperationsManager
::
DeleteAndJoinWithRedlineImpl
(
SwPaM
&
rPam
,
const
bool
)
{
OSL_ENSURE
(
m_rDoc
.
getIDocumentRedlineAccess
().
IsRedlineOn
(),
"DeleteAndJoinWithRedline: redline off"
);
assert
(
m_rDoc
.
getIDocumentRedlineAccess
().
IsRedlineOn
()
);
{
SwUndoRedlineDelete
*
pUndo
=
nullptr
;
RedlineFlags
eOld
=
m_rDoc
.
getIDocumentRedlineAccess
().
GetRedlineFlags
();
m_rDoc
.
GetDocumentRedlineManager
().
checkRedlining
(
eOld
);
SwUndoRedlineDelete
*
pUndo
=
nullptr
;
RedlineFlags
eOld
=
m_rDoc
.
getIDocumentRedlineAccess
().
GetRedlineFlags
();
m_rDoc
.
GetDocumentRedlineManager
().
checkRedlining
(
eOld
);
auto
&
rDMA
(
*
m_rDoc
.
getIDocumentMarkAccess
());
std
::
vector
<
std
::
unique_ptr
<
SwUndo
>>
MarkUndos
;
for
(
auto
iter
=
rDMA
.
getAnnotationMarksBegin
();
iter
!=
rDMA
.
getAnnotationMarksEnd
();
)
auto
&
rDMA
(
*
m_rDoc
.
getIDocumentMarkAccess
());
std
::
vector
<
std
::
unique_ptr
<
SwUndo
>>
MarkUndos
;
for
(
auto
iter
=
rDMA
.
getAnnotationMarksBegin
();
iter
!=
rDMA
.
getAnnotationMarksEnd
();
)
{
// tdf#111524 remove annotation marks that have their field
// characters deleted
SwPosition
const
&
rEndPos
((
**
iter
).
GetMarkEnd
());
if
(
*
rPam
.
Start
()
<
rEndPos
&&
rEndPos
<=
*
rPam
.
End
())
{
// tdf#111524 remove annotation marks that have their field
// characters deleted
SwPosition
const
&
rEndPos
((
**
iter
).
GetMarkEnd
());
if
(
*
rPam
.
Start
()
<
rEndPos
&&
rEndPos
<=
*
rPam
.
End
())
if
(
m_rDoc
.
GetIDocumentUndoRedo
().
DoesUndo
())
{
if
(
m_rDoc
.
GetIDocumentUndoRedo
().
DoesUndo
())
{
MarkUndos
.
emplace_back
(
o3tl
::
make_unique
<
SwUndoDeleteBookmark
>
(
**
iter
));
}
// iter is into annotation mark vector so must be dereferenced!
rDMA
.
deleteMark
(
&**
iter
);
// this invalidates iter, have to start over...
iter
=
rDMA
.
getAnnotationMarksBegin
();
MarkUndos
.
emplace_back
(
o3tl
::
make_unique
<
SwUndoDeleteBookmark
>
(
**
iter
));
}
else
{
// marks are sorted by start
if
(
*
rPam
.
End
()
<
(
**
iter
).
GetMarkStart
())
{
break
;
}
++
iter
;
// iter is into annotation mark vector so must be dereferenced!
rDMA
.
deleteMark
(
&**
iter
);
// this invalidates iter, have to start over...
iter
=
rDMA
.
getAnnotationMarksBegin
();
}
else
{
// marks are sorted by start
if
(
*
rPam
.
End
()
<
(
**
iter
).
GetMarkStart
())
{
break
;
}
++
iter
;
}
}
// tdf#119019 accept tracked paragraph formatting to do not hide new deletions
if
(
*
rPam
.
GetPoint
()
!=
*
rPam
.
GetMark
()
)
m_rDoc
.
getIDocumentRedlineAccess
().
AcceptRedlineParagraphFormatting
(
rPam
);
// tdf#119019 accept tracked paragraph formatting to do not hide new deletions
if
(
*
rPam
.
GetPoint
()
!=
*
rPam
.
GetMark
()
)
m_rDoc
.
getIDocumentRedlineAccess
().
AcceptRedlineParagraphFormatting
(
rPam
);
if
(
m_rDoc
.
GetIDocumentUndoRedo
().
DoesUndo
())
if
(
m_rDoc
.
GetIDocumentUndoRedo
().
DoesUndo
())
{
/* please don't translate -- for cultural reasons this comment is protected
until the redline implementation is finally fixed some day */
//JP 06.01.98: MUSS noch optimiert werden!!!
m_rDoc
.
getIDocumentRedlineAccess
().
SetRedlineFlags
(
RedlineFlags
::
On
|
RedlineFlags
::
ShowInsert
|
RedlineFlags
::
ShowDelete
);
pUndo
=
new
SwUndoRedlineDelete
(
rPam
,
SwUndoId
::
DELETE
);
const
SwRewriter
aRewriter
=
pUndo
->
GetRewriter
();
m_rDoc
.
GetIDocumentUndoRedo
().
StartUndo
(
SwUndoId
::
DELETE
,
&
aRewriter
);
for
(
auto
&
it
:
MarkUndos
)
{
/* please don't translate -- for cultural reasons this comment is protected
until the redline implementation is finally fixed some day */
//JP 06.01.98: MUSS noch optimiert werden!!!
m_rDoc
.
getIDocumentRedlineAccess
().
SetRedlineFlags
(
RedlineFlags
::
On
|
RedlineFlags
::
ShowInsert
|
RedlineFlags
::
ShowDelete
);
pUndo
=
new
SwUndoRedlineDelete
(
rPam
,
SwUndoId
::
DELETE
);
const
SwRewriter
aRewriter
=
pUndo
->
GetRewriter
();
m_rDoc
.
GetIDocumentUndoRedo
().
StartUndo
(
SwUndoId
::
DELETE
,
&
aRewriter
);
for
(
auto
&
it
:
MarkUndos
)
{
m_rDoc
.
GetIDocumentUndoRedo
().
AppendUndo
(
it
.
release
());
}
m_rDoc
.
GetIDocumentUndoRedo
().
AppendUndo
(
pUndo
);
m_rDoc
.
GetIDocumentUndoRedo
().
AppendUndo
(
it
.
release
());
}
m_rDoc
.
GetIDocumentUndoRedo
().
AppendUndo
(
pUndo
);
}
if
(
*
rPam
.
GetPoint
()
!=
*
rPam
.
GetMark
()
)
m_rDoc
.
getIDocumentRedlineAccess
().
AppendRedline
(
new
SwRangeRedline
(
nsRedlineType_t
::
REDLINE_DELETE
,
rPam
),
true
);
m_rDoc
.
getIDocumentState
().
SetModified
();
if
(
*
rPam
.
GetPoint
()
!=
*
rPam
.
GetMark
()
)
m_rDoc
.
getIDocumentRedlineAccess
().
AppendRedline
(
new
SwRangeRedline
(
nsRedlineType_t
::
REDLINE_DELETE
,
rPam
),
true
);
m_rDoc
.
getIDocumentState
().
SetModified
();
if
(
pUndo
)
if
(
pUndo
)
{
m_rDoc
.
GetIDocumentUndoRedo
().
EndUndo
(
SwUndoId
::
EMPTY
,
nullptr
);
// ??? why the hell is the AppendUndo not below the
// CanGrouping, so this hideous cleanup wouldn't be necessary?
// bah, this is redlining, probably changing this would break it...
if
(
m_rDoc
.
GetIDocumentUndoRedo
().
DoesGroupUndo
())
{
m_rDoc
.
GetIDocumentUndoRedo
().
EndUndo
(
SwUndoId
::
EMPTY
,
nullptr
);
// ??? why the hell is the AppendUndo not below the
// CanGrouping, so this hideous cleanup wouldn't be necessary?
// bah, this is redlining, probably changing this would break it...
if
(
m_rDoc
.
GetIDocumentUndoRedo
().
DoesGroupUndo
()
)
SwUndo
*
const
pLastUndo
(
m_rDoc
.
GetUndoManager
().
GetLastUndo
()
);
SwUndoRedlineDelete
*
const
pUndoRedlineDel
(
dynamic_cast
<
SwUndoRedlineDelete
*>
(
pLastUndo
)
);
if
(
pUndoRedlineDel
)
{
SwUndo
*
const
pLastUndo
(
m_rDoc
.
GetUndoManager
().
GetLastUndo
()
);
SwUndoRedlineDelete
*
const
pUndoRedlineDel
(
dynamic_cast
<
SwUndoRedlineDelete
*
>
(
pLastUndo
)
);
if
(
pUndoRedlineDel
)
bool
const
bMerged
=
pUndoRedlineDel
->
CanGrouping
(
*
pUndo
);
if
(
bMerged
)
{
bool
const
bMerged
=
pUndoRedlineDel
->
CanGrouping
(
*
pUndo
);
if
(
bMerged
)
{
::
sw
::
UndoGuard
const
undoGuard
(
m_rDoc
.
GetIDocumentUndoRedo
()
);
SwUndo
const
*
const
pDeleted
=
m_rDoc
.
GetUndoManager
().
RemoveLastUndo
();
OSL_ENSURE
(
pDeleted
==
pUndo
,
"DeleteAndJoinWithRedlineImpl: "
"undo removed is not undo inserted?"
);
delete
pDeleted
;
}
::
sw
::
UndoGuard
const
undoGuard
(
m_rDoc
.
GetIDocumentUndoRedo
()
);
SwUndo
const
*
const
pDeleted
=
m_rDoc
.
GetUndoManager
().
RemoveLastUndo
();
OSL_ENSURE
(
pDeleted
==
pUndo
,
"DeleteAndJoinWithRedlineImpl: "
"undo removed is not undo inserted?"
);
delete
pDeleted
;
}
}
//JP 06.01.98: MUSS noch optimiert werden!!!
m_rDoc
.
getIDocumentRedlineAccess
().
SetRedlineFlags
(
eOld
);
}
return
true
;
//JP 06.01.98: MUSS noch optimiert werden!!!
m_rDoc
.
getIDocumentRedlineAccess
().
SetRedlineFlags
(
eOld
);
}
return
true
;
}
bool
DocumentContentOperationsManager
::
DeleteAndJoinImpl
(
SwPaM
&
rPam
,
...
...
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