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
a2c467a5
Kaydet (Commit)
a2c467a5
authored
Haz 02, 2015
tarafından
Bjoern Michaelsen
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
use UnoCursorPointer in SwNavigationMgr
Change-Id: I7c7431edd79cf4527f97c7dc0695d49174b61e2c
üst
683bac5b
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
22 deletions
+21
-22
unocrsr.hxx
sw/inc/unocrsr.hxx
+14
-0
navmgr.hxx
sw/source/uibase/inc/navmgr.hxx
+5
-8
navmgr.cxx
sw/source/uibase/wrtsh/navmgr.cxx
+2
-14
No files found.
sw/inc/unocrsr.hxx
Dosyayı görüntüle @
a2c467a5
...
...
@@ -115,6 +115,13 @@ namespace sw
{
m_pCursor
->
Add
(
this
);
}
UnoCursorPointer
(
const
UnoCursorPointer
&
pOther
)
:
SwClient
(
nullptr
)
,
m_pCursor
(
pOther
.
m_pCursor
)
{
if
(
m_pCursor
)
m_pCursor
->
Add
(
this
);
}
virtual
~
UnoCursorPointer
()
SAL_OVERRIDE
{
if
(
m_pCursor
)
...
...
@@ -132,6 +139,13 @@ namespace sw
{
return
*
m_pCursor
.
get
();
}
SwUnoCrsr
*
operator
->
()
const
{
return
m_pCursor
.
get
();
}
UnoCursorPointer
&
operator
=
(
UnoCursorPointer
aOther
)
{
if
(
aOther
.
m_pCursor
)
aOther
.
m_pCursor
->
Add
(
this
);
m_pCursor
=
aOther
.
m_pCursor
;
return
*
this
;
}
explicit
operator
bool
()
const
{
return
static_cast
<
bool
>
(
m_pCursor
);
}
void
reset
(
std
::
shared_ptr
<
SwUnoCrsr
>
pNew
)
...
...
sw/source/uibase/inc/navmgr.hxx
Dosyayı görüntüle @
a2c467a5
...
...
@@ -15,12 +15,13 @@
#include "swtypes.hxx"
#include "calbck.hxx"
#include "unocrsr.hxx"
#include "vcl/svapp.hxx"
class
SwWrtShell
;
struct
SwPosition
;
class
SwUnoCrsr
;
class
SwNavigationMgr
:
SwClient
class
SwNavigationMgr
{
private
:
/*
...
...
@@ -32,7 +33,7 @@ private:
* (e.g. click a link, or double click an entry from the navigator).
* Every use of the back/forward buttons results in moving the stack pointer within the navigation history
*/
typedef
::
std
::
vector
<
s
td
::
shared_ptr
<
SwUnoCrsr
>
>
Stack_t
;
typedef
::
std
::
vector
<
s
w
::
UnoCursorPointer
>
Stack_t
;
Stack_t
m_entries
;
Stack_t
::
size_type
m_nCurrent
;
/* Current position within the navigation history */
SwWrtShell
&
m_rMyShell
;
/* The active shell within which the navigation occurs */
...
...
@@ -44,11 +45,8 @@ public:
SwNavigationMgr
(
SwWrtShell
&
rShell
);
virtual
~
SwNavigationMgr
()
{
for
(
auto
pEntry
:
m_entries
)
{
if
(
pEntry
&&
GetRegisteredIn
()
==
pEntry
.
get
())
pEntry
->
Remove
(
this
);
}
SolarMutexGuard
g
;
m_entries
.
clear
();
}
/* Can we go back in the history ? */
bool
backEnabled
()
;
...
...
@@ -60,7 +58,6 @@ public:
void
goForward
()
;
/* The method that adds the position pPos to the navigation history */
bool
addEntry
(
const
SwPosition
&
rPos
);
void
SwClientNotify
(
const
SwModify
&
rModify
,
const
SfxHint
&
rHint
)
SAL_OVERRIDE
;
};
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
sw/source/uibase/wrtsh/navmgr.cxx
Dosyayı görüntüle @
a2c467a5
...
...
@@ -162,17 +162,15 @@ bool SwNavigationMgr::addEntry(const SwPosition& rPos) {
if
(
*
m_entries
.
back
()
->
GetPoint
()
!=
rPos
)
{
s
td
::
shared_ptr
<
SwUnoCrsr
>
pCursor
(
m_rMyShell
.
GetDoc
()
->
CreateUnoCrsr
(
rPos
));
s
w
::
UnoCursorPointer
pCursor
(
m_rMyShell
.
GetDoc
()
->
CreateUnoCrsr
(
rPos
));
m_entries
.
push_back
(
pCursor
);
pCursor
->
Add
(
this
);
}
bRet
=
true
;
}
else
{
if
(
(
!
m_entries
.
empty
()
&&
*
m_entries
.
back
()
->
GetPoint
()
!=
rPos
)
||
m_entries
.
empty
()
)
{
auto
pCursor
(
m_rMyShell
.
GetDoc
()
->
CreateUnoCrsr
(
rPos
));
sw
::
UnoCursorPointer
pCursor
(
m_rMyShell
.
GetDoc
()
->
CreateUnoCrsr
(
rPos
));
m_entries
.
push_back
(
pCursor
);
pCursor
->
Add
(
this
);
bRet
=
true
;
}
if
(
m_entries
.
size
()
>
1
&&
*
m_entries
.
back
()
->
GetPoint
()
==
rPos
)
...
...
@@ -216,14 +214,4 @@ bool SwNavigationMgr::addEntry(const SwPosition& rPos) {
return
bRet
;
}
void
SwNavigationMgr
::
SwClientNotify
(
const
SwModify
&
rModify
,
const
SfxHint
&
rHint
)
{
if
(
typeid
(
rHint
)
==
typeid
(
sw
::
DocDisposingHint
))
{
m_entries
.
clear
();
}
else
SwClient
::
SwClientNotify
(
rModify
,
rHint
);
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
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