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
b9a5d497
Kaydet (Commit)
b9a5d497
authored
Kas 23, 2018
tarafından
Michael Stahl
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
sw_redlinehide_4a: SwAutoFormat: manually skip redlines when deleting
Change-Id: I001e61305ee8416f851f834d3068bd91de8281f8
üst
56426080
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
70 additions
and
6 deletions
+70
-6
autofmt.cxx
sw/source/core/edit/autofmt.cxx
+70
-6
No files found.
sw/source/core/edit/autofmt.cxx
Dosyayı görüntüle @
b9a5d497
...
...
@@ -38,6 +38,8 @@
#include <IDocumentUndoRedo.hxx>
#include <DocumentRedlineManager.hxx>
#include <IDocumentStylePoolAccess.hxx>
#include <redline.hxx>
#include <unocrsr.hxx>
#include <docary.hxx>
#include <editsh.hxx>
#include <index.hxx>
...
...
@@ -171,6 +173,7 @@ class SwAutoFormat
static
bool
HasSelBlanks
(
SwPaM
&
rPam
);
static
bool
HasBreakAttr
(
const
SwTextNode
&
);
void
DeleteSel
(
SwPaM
&
rPam
);
void
DeleteSelImpl
(
SwPaM
&
rDelPam
,
SwPaM
&
rPamToCorrect
);
bool
DeleteJoinCurNextPara
(
const
OUString
&
rNxtPara
);
/// delete in the node start and/or end
void
DeleteLeadingTrailingBlanks
(
bool
bStart
=
true
,
bool
bEnd
=
true
);
...
...
@@ -1092,26 +1095,87 @@ void SwAutoFormat::DeleteLeadingTrailingBlanks(bool bStart, bool bEnd)
}
}
void
SwAutoFormat
::
DeleteSel
(
SwPaM
&
rDelPam
)
bool
GetRanges
(
std
::
vector
<
std
::
shared_ptr
<
SwUnoCursor
>>
&
rRanges
,
SwDoc
&
rDoc
,
SwPaM
const
&
rDelPam
)
{
if
(
m_aFlags
.
bWithRedlining
)
bool
isNoRedline
(
true
);
SwRedlineTable
::
size_type
tmp
;
IDocumentRedlineAccess
const
&
rIDRA
(
rDoc
.
getIDocumentRedlineAccess
());
if
(
!
(
rIDRA
.
GetRedlineFlags
()
&
RedlineFlags
::
ShowDelete
))
{
return
isNoRedline
;
}
rIDRA
.
GetRedline
(
*
rDelPam
.
Start
(),
&
tmp
);
SwPosition
const
*
pCurrent
(
rDelPam
.
Start
());
for
(
;
tmp
<
rIDRA
.
GetRedlineTable
().
size
();
++
tmp
)
{
SwRangeRedline
const
*
const
pRedline
(
rIDRA
.
GetRedlineTable
()[
tmp
]);
if
(
*
rDelPam
.
End
()
<=
*
pRedline
->
Start
())
{
break
;
}
if
(
*
pRedline
->
End
()
<=
*
rDelPam
.
Start
())
{
continue
;
}
if
(
pRedline
->
GetType
()
==
nsRedlineType_t
::
REDLINE_DELETE
)
{
assert
(
*
pRedline
->
Start
()
!=
*
pRedline
->
End
());
isNoRedline
=
false
;
if
(
*
pCurrent
<
*
pRedline
->
Start
())
{
rRanges
.
push_back
(
rDoc
.
CreateUnoCursor
(
*
pCurrent
));
rRanges
.
back
()
->
SetMark
();
*
rRanges
.
back
()
->
GetPoint
()
=
*
pRedline
->
Start
();
}
pCurrent
=
pRedline
->
End
();
}
}
if
(
!
isNoRedline
&&
*
pCurrent
<
*
rDelPam
.
End
())
{
rRanges
.
push_back
(
rDoc
.
CreateUnoCursor
(
*
pCurrent
));
rRanges
.
back
()
->
SetMark
();
*
rRanges
.
back
()
->
GetPoint
()
=
*
rDelPam
.
End
();
}
return
isNoRedline
;
}
void
SwAutoFormat
::
DeleteSel
(
SwPaM
&
rDelPam
)
{
std
::
vector
<
std
::
shared_ptr
<
SwUnoCursor
>>
ranges
;
// need correcting cursor
if
(
GetRanges
(
ranges
,
*
m_pDoc
,
rDelPam
))
{
DeleteSelImpl
(
rDelPam
,
rDelPam
);
}
else
{
for
(
auto
const
&
pCursor
:
ranges
)
{
DeleteSelImpl
(
*
pCursor
,
rDelPam
);
}
}
}
void
SwAutoFormat
::
DeleteSelImpl
(
SwPaM
&
rDelPam
,
SwPaM
&
rPamToCorrect
)
{
if
(
m_aFlags
.
bWithRedlining
||
&
rDelPam
!=
&
rPamToCorrect
)
{
// Add to Shell-Cursor-Ring so that DelPam will be moved as well!
SwPaM
*
pShCursor
=
m_pEditShell
->
GetCursor_
();
SwPaM
aTmp
(
*
m_pCurTextNd
,
0
,
pShCursor
);
SwPaM
*
pPrev
=
r
DelPam
.
GetPrev
();
r
DelPam
.
GetRingContainer
().
merge
(
pShCursor
->
GetRingContainer
()
);
SwPaM
*
pPrev
=
r
PamToCorrect
.
GetPrev
();
r
PamToCorrect
.
GetRingContainer
().
merge
(
pShCursor
->
GetRingContainer
()
);
m_pEditShell
->
DeleteSel
(
rDelPam
);
// and remove Pam again:
SwPaM
*
p
;
SwPaM
*
pNext
=
&
r
DelPam
;
SwPaM
*
pNext
=
&
r
PamToCorrect
;
do
{
p
=
pNext
;
pNext
=
p
->
GetNext
();
p
->
MoveTo
(
&
r
DelPam
);
p
->
MoveTo
(
&
r
PamToCorrect
);
}
while
(
p
!=
pPrev
);
m_aNdIdx
=
aTmp
.
GetPoint
()
->
nNode
;
...
...
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