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
87514172
Kaydet (Commit)
87514172
authored
Ara 17, 2018
tarafından
Michael Stahl
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
sw_redlinehide_4b: adapt FindFormat()
Change-Id: I78cfca1cd629bf518f8294450a34ee228a360ef9
üst
1199902f
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
44 additions
and
15 deletions
+44
-15
swcrsr.hxx
sw/inc/swcrsr.hxx
+2
-1
findcoll.cxx
sw/source/core/crsr/findcoll.cxx
+13
-6
findfmt.cxx
sw/source/core/crsr/findfmt.cxx
+27
-7
pamtyp.hxx
sw/source/core/inc/pamtyp.hxx
+2
-1
No files found.
sw/inc/swcrsr.hxx
Dosyayı görüntüle @
87514172
...
@@ -123,7 +123,8 @@ public:
...
@@ -123,7 +123,8 @@ public:
SwDocPositions
nStart
,
SwDocPositions
nEnde
,
SwDocPositions
nStart
,
SwDocPositions
nEnde
,
bool
&
bCancel
,
bool
&
bCancel
,
FindRanges
,
FindRanges
,
const
SwTextFormatColl
*
pReplFormat
);
const
SwTextFormatColl
*
pReplFormat
,
SwRootFrame
const
*
const
pLayout
=
nullptr
);
sal_uLong
FindAttrs
(
const
SfxItemSet
&
rSet
,
bool
bNoCollections
,
sal_uLong
FindAttrs
(
const
SfxItemSet
&
rSet
,
bool
bNoCollections
,
SwDocPositions
nStart
,
SwDocPositions
nEnde
,
SwDocPositions
nStart
,
SwDocPositions
nEnde
,
bool
&
bCancel
,
bool
&
bCancel
,
...
...
sw/source/core/crsr/findcoll.cxx
Dosyayı görüntüle @
87514172
...
@@ -30,8 +30,13 @@
...
@@ -30,8 +30,13 @@
struct
SwFindParaFormatColl
:
public
SwFindParas
struct
SwFindParaFormatColl
:
public
SwFindParas
{
{
const
SwTextFormatColl
*
pFormatColl
,
*
pReplColl
;
const
SwTextFormatColl
*
pFormatColl
,
*
pReplColl
;
SwFindParaFormatColl
(
const
SwTextFormatColl
&
rFormatColl
,
const
SwTextFormatColl
*
pRpColl
)
SwRootFrame
const
*
m_pLayout
;
:
pFormatColl
(
&
rFormatColl
),
pReplColl
(
pRpColl
)
SwFindParaFormatColl
(
const
SwTextFormatColl
&
rFormatColl
,
const
SwTextFormatColl
*
const
pRpColl
,
SwRootFrame
const
*
const
pLayout
)
:
pFormatColl
(
&
rFormatColl
)
,
pReplColl
(
pRpColl
)
,
m_pLayout
(
pLayout
)
{}
{}
virtual
~
SwFindParaFormatColl
()
{}
virtual
~
SwFindParaFormatColl
()
{}
virtual
int
DoFind
(
SwPaM
&
,
SwMoveFnCollection
const
&
,
const
SwPaM
&
,
bool
bInReadOnly
)
override
;
virtual
int
DoFind
(
SwPaM
&
,
SwMoveFnCollection
const
&
,
const
SwPaM
&
,
bool
bInReadOnly
)
override
;
...
@@ -45,11 +50,12 @@ int SwFindParaFormatColl::DoFind(SwPaM & rCursor, SwMoveFnCollection const & fnM
...
@@ -45,11 +50,12 @@ int SwFindParaFormatColl::DoFind(SwPaM & rCursor, SwMoveFnCollection const & fnM
if
(
bInReadOnly
&&
pReplColl
)
if
(
bInReadOnly
&&
pReplColl
)
bInReadOnly
=
false
;
bInReadOnly
=
false
;
if
(
!
sw
::
FindFormatImpl
(
rCursor
,
*
pFormatColl
,
fnMove
,
rRegion
,
bInReadOnly
))
if
(
!
sw
::
FindFormatImpl
(
rCursor
,
*
pFormatColl
,
fnMove
,
rRegion
,
bInReadOnly
,
m_pLayout
))
nRet
=
FIND_NOT_FOUND
;
nRet
=
FIND_NOT_FOUND
;
else
if
(
pReplColl
)
else
if
(
pReplColl
)
{
{
rCursor
.
GetDoc
()
->
SetTextFormatColl
(
rCursor
,
const_cast
<
SwTextFormatColl
*>
(
pReplColl
));
rCursor
.
GetDoc
()
->
SetTextFormatColl
(
rCursor
,
const_cast
<
SwTextFormatColl
*>
(
pReplColl
),
true
,
false
,
m_pLayout
);
nRet
=
FIND_NO_RING
;
nRet
=
FIND_NO_RING
;
}
}
return
nRet
;
return
nRet
;
...
@@ -63,7 +69,8 @@ bool SwFindParaFormatColl::IsReplaceMode() const
...
@@ -63,7 +69,8 @@ bool SwFindParaFormatColl::IsReplaceMode() const
/// search for Format-Collections
/// search for Format-Collections
sal_uLong
SwCursor
::
FindFormat
(
const
SwTextFormatColl
&
rFormatColl
,
SwDocPositions
nStart
,
sal_uLong
SwCursor
::
FindFormat
(
const
SwTextFormatColl
&
rFormatColl
,
SwDocPositions
nStart
,
SwDocPositions
nEnd
,
bool
&
bCancel
,
SwDocPositions
nEnd
,
bool
&
bCancel
,
FindRanges
eFndRngs
,
const
SwTextFormatColl
*
pReplFormatColl
)
FindRanges
eFndRngs
,
const
SwTextFormatColl
*
pReplFormatColl
,
SwRootFrame
const
*
const
pLayout
)
{
{
// switch off OLE-notifications
// switch off OLE-notifications
SwDoc
*
pDoc
=
GetDoc
();
SwDoc
*
pDoc
=
GetDoc
();
...
@@ -83,7 +90,7 @@ sal_uLong SwCursor::FindFormat( const SwTextFormatColl& rFormatColl, SwDocPositi
...
@@ -83,7 +90,7 @@ sal_uLong SwCursor::FindFormat( const SwTextFormatColl& rFormatColl, SwDocPositi
&
aRewriter
);
&
aRewriter
);
}
}
SwFindParaFormatColl
aSwFindParaFormatColl
(
rFormatColl
,
pReplFormatColl
);
SwFindParaFormatColl
aSwFindParaFormatColl
(
rFormatColl
,
pReplFormatColl
,
pLayout
);
sal_uLong
nRet
=
FindAll
(
aSwFindParaFormatColl
,
nStart
,
nEnd
,
eFndRngs
,
bCancel
);
sal_uLong
nRet
=
FindAll
(
aSwFindParaFormatColl
,
nStart
,
nEnd
,
eFndRngs
,
bCancel
);
pDoc
->
SetOle2Link
(
aLnk
);
pDoc
->
SetOle2Link
(
aLnk
);
...
...
sw/source/core/crsr/findfmt.cxx
Dosyayı görüntüle @
87514172
...
@@ -20,13 +20,15 @@
...
@@ -20,13 +20,15 @@
#include <doc.hxx>
#include <doc.hxx>
#include <pamtyp.hxx>
#include <pamtyp.hxx>
#include <pam.hxx>
#include <pam.hxx>
#include <txtfrm.hxx>
#include <memory>
#include <memory>
namespace
sw
{
namespace
sw
{
bool
FindFormatImpl
(
SwPaM
&
rSearchPam
,
bool
FindFormatImpl
(
SwPaM
&
rSearchPam
,
const
SwFormat
&
rFormat
,
SwMoveFnCollection
const
&
fnMove
,
const
SwFormat
&
rFormat
,
SwMoveFnCollection
const
&
fnMove
,
const
SwPaM
&
rRegion
,
bool
bInReadOnly
)
const
SwPaM
&
rRegion
,
bool
bInReadOnly
,
SwRootFrame
const
*
const
pLayout
)
{
{
bool
bFound
=
false
;
bool
bFound
=
false
;
const
bool
bSrchForward
=
&
fnMove
==
&
fnMoveForward
;
const
bool
bSrchForward
=
&
fnMove
==
&
fnMoveForward
;
...
@@ -47,19 +49,37 @@ bool FindFormatImpl(SwPaM & rSearchPam,
...
@@ -47,19 +49,37 @@ bool FindFormatImpl(SwPaM & rSearchPam,
bool
bFirst
=
true
;
bool
bFirst
=
true
;
SwContentNode
*
pNode
;
SwContentNode
*
pNode
;
while
(
nullptr
!=
(
pNode
=
::
GetNode
(
*
pPam
,
bFirst
,
fnMove
,
bInReadOnly
)))
while
(
nullptr
!=
(
pNode
=
::
GetNode
(
*
pPam
,
bFirst
,
fnMove
,
bInReadOnly
,
pLayout
)))
{
{
if
(
pNode
->
GetFormatColl
()
==
&
rFormat
)
SwTextFrame
const
*
const
pFrame
(
pLayout
&&
pNode
->
IsTextNode
()
?
static_cast
<
SwTextFrame
const
*>
(
pNode
->
getLayoutFrame
(
pLayout
))
:
nullptr
);
assert
(
!
pLayout
||
!
pNode
->
IsTextNode
()
||
pFrame
);
SwContentNode
const
&
rPropsNode
(
*
(
pFrame
?
pFrame
->
GetTextNodeForParaProps
()
:
pNode
));
if
(
rPropsNode
.
GetFormatColl
()
==
&
rFormat
)
{
{
// if a FormatCollection is found then it is definitely a SwContentNode
// if a FormatCollection is found then it is definitely a SwContentNode
// FORWARD: SPoint at the end, GetMark at the beginning of the node
// FORWARD: SPoint at the end, GetMark at the beginning of the node
// BACKWARD: SPoint at the beginning, GetMark at the end of the node
// BACKWARD: SPoint at the beginning, GetMark at the end of the node
// always: incl. start and incl. end
// always: incl. start and incl. end
*
rSearchPam
.
GetPoint
()
=
*
pPam
->
GetPoint
();
if
(
pFrame
)
rSearchPam
.
SetMark
();
{
pNode
->
MakeEndIndex
(
&
rSearchPam
.
GetPoint
()
->
nContent
);
*
rSearchPam
.
GetPoint
()
=
*
pPam
->
GetPoint
();
rSearchPam
.
GetMark
()
->
nContent
=
0
;
rSearchPam
.
SetMark
();
*
rSearchPam
.
GetMark
()
=
pFrame
->
MapViewToModelPos
(
TextFrameIndex
(
bSrchForward
?
pFrame
->
GetText
().
getLength
()
:
0
));
}
else
{
*
rSearchPam
.
GetPoint
()
=
*
pPam
->
GetPoint
();
rSearchPam
.
SetMark
();
pNode
->
MakeEndIndex
(
&
rSearchPam
.
GetPoint
()
->
nContent
);
rSearchPam
.
GetMark
()
->
nContent
=
0
;
}
// if backward search, switch point and mark
// if backward search, switch point and mark
if
(
!
bSrchForward
)
if
(
!
bSrchForward
)
...
...
sw/source/core/inc/pamtyp.hxx
Dosyayı görüntüle @
87514172
...
@@ -95,7 +95,8 @@ namespace sw {
...
@@ -95,7 +95,8 @@ namespace sw {
bool
FindFormatImpl
(
SwPaM
&
rSearchPam
,
bool
FindFormatImpl
(
SwPaM
&
rSearchPam
,
const
SwFormat
&
rFormat
,
const
SwFormat
&
rFormat
,
SwMoveFnCollection
const
&
fnMove
,
SwMoveFnCollection
const
&
fnMove
,
const
SwPaM
&
rRegion
,
bool
bInReadOnly
=
false
);
const
SwPaM
&
rRegion
,
bool
bInReadOnly
,
SwRootFrame
const
*
pLayout
);
bool
FindAttrImpl
(
SwPaM
&
rSearchPam
,
bool
FindAttrImpl
(
SwPaM
&
rSearchPam
,
const
SfxPoolItem
&
rAttr
,
const
SfxPoolItem
&
rAttr
,
SwMoveFnCollection
const
&
fnMove
,
SwMoveFnCollection
const
&
fnMove
,
...
...
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