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
b97fb340
Kaydet (Commit)
b97fb340
authored
May 19, 2015
tarafından
Miklos Vajna
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Add sw::DocumentDrawModelManager::Search()
Change-Id: Idcbbb9e049f0fbc5d6503b86fd506df9fb2ad3c5
üst
0549f250
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
66 additions
and
0 deletions
+66
-0
IDocumentDrawModelAccess.hxx
sw/inc/IDocumentDrawModelAccess.hxx
+5
-0
DocumentDrawModelManager.cxx
sw/source/core/doc/DocumentDrawModelManager.cxx
+59
-0
DocumentDrawModelManager.hxx
sw/source/core/inc/DocumentDrawModelManager.hxx
+2
-0
No files found.
sw/inc/IDocumentDrawModelAccess.hxx
Dosyayı görüntüle @
b97fb340
...
@@ -23,7 +23,9 @@
...
@@ -23,7 +23,9 @@
#include <svx/svdtypes.hxx>
#include <svx/svdtypes.hxx>
class
SwDrawModel
;
class
SwDrawModel
;
class
SwPaM
;
class
SdrPageView
;
class
SdrPageView
;
class
SvxSearchItem
;
class
IDocumentDrawModelAccess
class
IDocumentDrawModelAccess
{
{
...
@@ -89,6 +91,9 @@ public:
...
@@ -89,6 +91,9 @@ public:
*/
*/
virtual
SdrLayerID
GetInvisibleLayerIdByVisibleOne
(
const
SdrLayerID
&
_nVisibleLayerId
)
=
0
;
virtual
SdrLayerID
GetInvisibleLayerIdByVisibleOne
(
const
SdrLayerID
&
_nVisibleLayerId
)
=
0
;
/// Searches text in shapes anchored inside rPaM.
virtual
bool
Search
(
const
SwPaM
&
rPaM
,
const
SvxSearchItem
&
rSearchItem
)
=
0
;
protected
:
protected
:
virtual
~
IDocumentDrawModelAccess
()
{};
virtual
~
IDocumentDrawModelAccess
()
{};
...
...
sw/source/core/doc/DocumentDrawModelManager.cxx
Dosyayı görüntüle @
b97fb340
...
@@ -26,11 +26,15 @@
...
@@ -26,11 +26,15 @@
#include <IDocumentLinksAdministration.hxx>
#include <IDocumentLinksAdministration.hxx>
#include <IDocumentLayoutAccess.hxx>
#include <IDocumentLayoutAccess.hxx>
#include <docsh.hxx>
#include <docsh.hxx>
#include <wrtsh.hxx>
#include <swtypes.hxx>
#include <swtypes.hxx>
#include <ndtxt.hxx>
#include <swhints.hxx>
#include <swhints.hxx>
#include <viewsh.hxx>
#include <viewsh.hxx>
#include <view.hxx>
#include <drawdoc.hxx>
#include <drawdoc.hxx>
#include <rootfrm.hxx>
#include <rootfrm.hxx>
#include <fmtanchr.hxx>
#include <editeng/eeitem.hxx>
#include <editeng/eeitem.hxx>
#include <editeng/fhgtitem.hxx>
#include <editeng/fhgtitem.hxx>
#include <svx/svdmodel.hxx>
#include <svx/svdmodel.hxx>
...
@@ -38,7 +42,9 @@
...
@@ -38,7 +42,9 @@
#include <svx/svdoutl.hxx>
#include <svx/svdoutl.hxx>
#include <svx/svdpage.hxx>
#include <svx/svdpage.hxx>
#include <svx/svdpagv.hxx>
#include <svx/svdpagv.hxx>
#include <svx/svdotext.hxx>
#include <svl/smplhint.hxx>
#include <svl/smplhint.hxx>
#include <svl/srchitem.hxx>
#include <tools/link.hxx>
#include <tools/link.hxx>
class
SdrOutliner
;
class
SdrOutliner
;
...
@@ -364,6 +370,59 @@ SdrLayerID DocumentDrawModelManager::GetInvisibleLayerIdByVisibleOne( const SdrL
...
@@ -364,6 +370,59 @@ SdrLayerID DocumentDrawModelManager::GetInvisibleLayerIdByVisibleOne( const SdrL
return
nInvisibleLayerId
;
return
nInvisibleLayerId
;
}
}
bool
DocumentDrawModelManager
::
Search
(
const
SwPaM
&
rPaM
,
const
SvxSearchItem
&
rSearchItem
)
{
SwPosFlyFrms
aFrames
=
m_rDoc
.
GetAllFlyFmts
(
&
rPaM
,
/*bDrawAlso=*/
true
);
for
(
const
SwPosFlyFrmPtr
&
pPosFlyFrm
:
aFrames
)
{
// Filter for at-paragraph anchored draw frames.
const
SwFrmFmt
&
rFrmFmt
=
pPosFlyFrm
->
GetFmt
();
const
SwFmtAnchor
&
rAnchor
=
rFrmFmt
.
GetAnchor
();
if
(
rAnchor
.
GetAnchorId
()
!=
FLY_AT_PARA
||
rFrmFmt
.
Which
()
!=
RES_DRAWFRMFMT
)
continue
;
// Does the shape have matching text?
SdrOutliner
&
rOutliner
=
GetDrawModel
()
->
GetDrawOutliner
();
SdrObject
*
pObject
=
const_cast
<
SdrObject
*>
(
rFrmFmt
.
FindSdrObject
());
SdrTextObj
*
pTextObj
=
dynamic_cast
<
SdrTextObj
*>
(
pObject
);
if
(
!
pTextObj
)
continue
;
const
OutlinerParaObject
*
pParaObj
=
pTextObj
->
GetOutlinerParaObject
();
if
(
!
pParaObj
)
continue
;
rOutliner
.
SetText
(
*
pParaObj
);
SwDocShell
*
pDocShell
=
m_rDoc
.
GetDocShell
();
if
(
!
pDocShell
)
return
false
;
SwWrtShell
*
pWrtShell
=
pDocShell
->
GetWrtShell
();
if
(
!
pWrtShell
)
return
false
;
if
(
!
rOutliner
.
HasText
(
rSearchItem
))
continue
;
// If so, then select highlight the search result.
pWrtShell
->
SelectObj
(
Point
(),
0
,
pObject
);
SwView
*
pView
=
pDocShell
->
GetView
();
if
(
!
pView
)
return
false
;
if
(
!
pView
->
EnterShapeDrawTextMode
(
pObject
))
continue
;
SdrView
*
pSdrView
=
pWrtShell
->
GetDrawView
();
if
(
!
pSdrView
)
return
false
;
OutlinerView
*
pOutlinerView
=
pSdrView
->
GetTextEditOutlinerView
();
if
(
!
rSearchItem
.
GetBackward
())
pOutlinerView
->
SetSelection
(
ESelection
(
0
,
0
,
0
,
0
));
else
pOutlinerView
->
SetSelection
(
ESelection
(
EE_PARA_MAX_COUNT
,
EE_TEXTPOS_MAX_COUNT
,
EE_PARA_MAX_COUNT
,
EE_TEXTPOS_MAX_COUNT
));
pOutlinerView
->
StartSearchAndReplace
(
rSearchItem
);
return
true
;
}
return
false
;
}
void
DocumentDrawModelManager
::
DrawNotifyUndoHdl
()
void
DocumentDrawModelManager
::
DrawNotifyUndoHdl
()
{
{
mpDrawModel
->
SetNotifyUndoActionHdl
(
Link
<>
()
);
mpDrawModel
->
SetNotifyUndoActionHdl
(
Link
<>
()
);
...
...
sw/source/core/inc/DocumentDrawModelManager.hxx
Dosyayı görüntüle @
b97fb340
...
@@ -63,6 +63,8 @@ public:
...
@@ -63,6 +63,8 @@ public:
virtual
SdrLayerID
GetInvisibleLayerIdByVisibleOne
(
const
SdrLayerID
&
_nVisibleLayerId
)
SAL_OVERRIDE
;
virtual
SdrLayerID
GetInvisibleLayerIdByVisibleOne
(
const
SdrLayerID
&
_nVisibleLayerId
)
SAL_OVERRIDE
;
virtual
bool
Search
(
const
SwPaM
&
rPaM
,
const
SvxSearchItem
&
rSearchItem
)
SAL_OVERRIDE
;
virtual
~
DocumentDrawModelManager
()
{}
virtual
~
DocumentDrawModelManager
()
{}
private
:
private
:
...
...
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