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
794e54cd
Kaydet (Commit)
794e54cd
authored
Ock 04, 2018
tarafından
Michael Stahl
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
sw: convert SwFrame::mpDrawObjs to unique_ptr
Change-Id: I0713e6fb2b3f2cfc3115daafe37ae5380f3e7938
üst
67e1e2ee
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
36 additions
and
29 deletions
+36
-29
frame.hxx
sw/source/core/inc/frame.hxx
+5
-3
fly.cxx
sw/source/core/layout/fly.cxx
+26
-19
ssfrm.cxx
sw/source/core/layout/ssfrm.cxx
+5
-6
wsfrm.cxx
sw/source/core/layout/wsfrm.cxx
+0
-1
No files found.
sw/source/core/inc/frame.hxx
Dosyayı görüntüle @
794e54cd
...
@@ -32,6 +32,8 @@
...
@@ -32,6 +32,8 @@
#include <com/sun/star/style/TabStop.hpp>
#include <com/sun/star/style/TabStop.hpp>
#include <basegfx/matrix/b2dhommatrix.hxx>
#include <basegfx/matrix/b2dhommatrix.hxx>
#include <memory>
class
SwLayoutFrame
;
class
SwLayoutFrame
;
class
SwRootFrame
;
class
SwRootFrame
;
class
SwPageFrame
;
class
SwPageFrame
;
...
@@ -378,7 +380,7 @@ class SW_DLLPUBLIC SwFrame : public SwFrameAreaDefinition, public SwClient, publ
...
@@ -378,7 +380,7 @@ class SW_DLLPUBLIC SwFrame : public SwFrameAreaDefinition, public SwClient, publ
SwPageFrame
*
ImplFindPageFrame
();
SwPageFrame
*
ImplFindPageFrame
();
protected
:
protected
:
SwSortedObjs
*
mpDrawObjs
;
// draw objects, can be 0
std
::
unique_ptr
<
SwSortedObjs
>
m_pDrawObjs
;
// draw objects, can be null
SwFrameType
mnFrameType
;
//Who am I?
SwFrameType
mnFrameType
;
//Who am I?
bool
mbInDtor
:
1
;
bool
mbInDtor
:
1
;
...
@@ -524,8 +526,8 @@ public:
...
@@ -524,8 +526,8 @@ public:
// work with chain of FlyFrames
// work with chain of FlyFrames
void
AppendFly
(
SwFlyFrame
*
pNew
);
void
AppendFly
(
SwFlyFrame
*
pNew
);
void
RemoveFly
(
SwFlyFrame
*
pToRemove
);
void
RemoveFly
(
SwFlyFrame
*
pToRemove
);
const
SwSortedObjs
*
GetDrawObjs
()
const
{
return
m
pDrawObjs
;
}
const
SwSortedObjs
*
GetDrawObjs
()
const
{
return
m
_pDrawObjs
.
get
()
;
}
SwSortedObjs
*
GetDrawObjs
()
{
return
mpDrawObjs
;
}
SwSortedObjs
*
GetDrawObjs
()
{
return
m_pDrawObjs
.
get
()
;
}
// #i28701# - change purpose of method and adjust its name
// #i28701# - change purpose of method and adjust its name
void
InvalidateObjs
(
const
bool
_bNoInvaOfAsCharAnchoredObjs
=
true
);
void
InvalidateObjs
(
const
bool
_bNoInvaOfAsCharAnchoredObjs
=
true
);
...
...
sw/source/core/layout/fly.cxx
Dosyayı görüntüle @
794e54cd
...
@@ -2007,9 +2007,11 @@ void SwFlyFrame::Cut()
...
@@ -2007,9 +2007,11 @@ void SwFlyFrame::Cut()
void
SwFrame
::
AppendFly
(
SwFlyFrame
*
pNew
)
void
SwFrame
::
AppendFly
(
SwFlyFrame
*
pNew
)
{
{
if
(
!
mpDrawObjs
)
if
(
!
m_pDrawObjs
)
mpDrawObjs
=
new
SwSortedObjs
();
{
mpDrawObjs
->
Insert
(
*
pNew
);
m_pDrawObjs
.
reset
(
new
SwSortedObjs
());
}
m_pDrawObjs
->
Insert
(
*
pNew
);
pNew
->
ChgAnchorFrame
(
this
);
pNew
->
ChgAnchorFrame
(
this
);
// Register at the page
// Register at the page
...
@@ -2049,9 +2051,11 @@ void SwFrame::RemoveFly( SwFlyFrame *pToRemove )
...
@@ -2049,9 +2051,11 @@ void SwFrame::RemoveFly( SwFlyFrame *pToRemove )
}
}
}
}
mpDrawObjs
->
Remove
(
*
pToRemove
);
m_pDrawObjs
->
Remove
(
*
pToRemove
);
if
(
!
mpDrawObjs
->
size
()
)
if
(
!
m_pDrawObjs
->
size
())
DELETEZ
(
mpDrawObjs
);
{
m_pDrawObjs
.
reset
();
}
pToRemove
->
ChgAnchorFrame
(
nullptr
);
pToRemove
->
ChgAnchorFrame
(
nullptr
);
...
@@ -2061,7 +2065,7 @@ void SwFrame::RemoveFly( SwFlyFrame *pToRemove )
...
@@ -2061,7 +2065,7 @@ void SwFrame::RemoveFly( SwFlyFrame *pToRemove )
void
SwFrame
::
AppendDrawObj
(
SwAnchoredObject
&
_rNewObj
)
void
SwFrame
::
AppendDrawObj
(
SwAnchoredObject
&
_rNewObj
)
{
{
assert
(
!
m
pDrawObjs
||
m
pDrawObjs
->
is_sorted
());
assert
(
!
m
_pDrawObjs
||
m_
pDrawObjs
->
is_sorted
());
if
(
dynamic_cast
<
const
SwAnchoredDrawObject
*>
(
&
_rNewObj
)
==
nullptr
)
if
(
dynamic_cast
<
const
SwAnchoredDrawObject
*>
(
&
_rNewObj
)
==
nullptr
)
{
{
...
@@ -2072,19 +2076,21 @@ void SwFrame::AppendDrawObj( SwAnchoredObject& _rNewObj )
...
@@ -2072,19 +2076,21 @@ void SwFrame::AppendDrawObj( SwAnchoredObject& _rNewObj )
if
(
dynamic_cast
<
const
SwDrawVirtObj
*>
(
_rNewObj
.
GetDrawObj
())
==
nullptr
&&
if
(
dynamic_cast
<
const
SwDrawVirtObj
*>
(
_rNewObj
.
GetDrawObj
())
==
nullptr
&&
_rNewObj
.
GetAnchorFrame
()
&&
_rNewObj
.
GetAnchorFrame
()
!=
this
)
_rNewObj
.
GetAnchorFrame
()
&&
_rNewObj
.
GetAnchorFrame
()
!=
this
)
{
{
assert
(
!
m
pDrawObjs
||
m
pDrawObjs
->
is_sorted
());
assert
(
!
m
_pDrawObjs
||
m_
pDrawObjs
->
is_sorted
());
// perform disconnect from layout, if 'master' drawing object is appended
// perform disconnect from layout, if 'master' drawing object is appended
// to a new frame.
// to a new frame.
static_cast
<
SwDrawContact
*>
(
::
GetUserCall
(
_rNewObj
.
GetDrawObj
()
))
->
static_cast
<
SwDrawContact
*>
(
::
GetUserCall
(
_rNewObj
.
GetDrawObj
()
))
->
DisconnectFromLayout
(
false
);
DisconnectFromLayout
(
false
);
assert
(
!
m
pDrawObjs
||
m
pDrawObjs
->
is_sorted
());
assert
(
!
m
_pDrawObjs
||
m_
pDrawObjs
->
is_sorted
());
}
}
if
(
_rNewObj
.
GetAnchorFrame
()
!=
this
)
if
(
_rNewObj
.
GetAnchorFrame
()
!=
this
)
{
{
if
(
!
mpDrawObjs
)
if
(
!
m_pDrawObjs
)
mpDrawObjs
=
new
SwSortedObjs
();
{
mpDrawObjs
->
Insert
(
_rNewObj
);
m_pDrawObjs
.
reset
(
new
SwSortedObjs
());
}
m_pDrawObjs
->
Insert
(
_rNewObj
);
_rNewObj
.
ChgAnchorFrame
(
this
);
_rNewObj
.
ChgAnchorFrame
(
this
);
}
}
...
@@ -2110,7 +2116,7 @@ void SwFrame::AppendDrawObj( SwAnchoredObject& _rNewObj )
...
@@ -2110,7 +2116,7 @@ void SwFrame::AppendDrawObj( SwAnchoredObject& _rNewObj )
}
}
//The layer is part of the key used to sort the obj, so update
//The layer is part of the key used to sort the obj, so update
//its position if the layer changed.
//its position if the layer changed.
mpDrawObjs
->
Update
(
_rNewObj
);
m
_
pDrawObjs
->
Update
(
_rNewObj
);
}
}
}
}
...
@@ -2135,7 +2141,7 @@ void SwFrame::AppendDrawObj( SwAnchoredObject& _rNewObj )
...
@@ -2135,7 +2141,7 @@ void SwFrame::AppendDrawObj( SwAnchoredObject& _rNewObj )
}
}
}
}
assert
(
!
m
pDrawObjs
||
m
pDrawObjs
->
is_sorted
());
assert
(
!
m
_pDrawObjs
||
m_
pDrawObjs
->
is_sorted
());
}
}
void
SwFrame
::
RemoveDrawObj
(
SwAnchoredObject
&
_rToRemoveObj
)
void
SwFrame
::
RemoveDrawObj
(
SwAnchoredObject
&
_rToRemoveObj
)
...
@@ -2154,13 +2160,14 @@ void SwFrame::RemoveDrawObj( SwAnchoredObject& _rToRemoveObj )
...
@@ -2154,13 +2160,14 @@ void SwFrame::RemoveDrawObj( SwAnchoredObject& _rToRemoveObj )
if
(
pPage
&&
pPage
->
GetSortedObjs
()
)
if
(
pPage
&&
pPage
->
GetSortedObjs
()
)
pPage
->
RemoveDrawObjFromPage
(
_rToRemoveObj
);
pPage
->
RemoveDrawObjFromPage
(
_rToRemoveObj
);
mpDrawObjs
->
Remove
(
_rToRemoveObj
);
m_pDrawObjs
->
Remove
(
_rToRemoveObj
);
if
(
!
mpDrawObjs
->
size
()
)
if
(
!
m_pDrawObjs
->
size
())
DELETEZ
(
mpDrawObjs
);
{
m_pDrawObjs
.
reset
();
}
_rToRemoveObj
.
ChgAnchorFrame
(
nullptr
);
_rToRemoveObj
.
ChgAnchorFrame
(
nullptr
);
assert
(
!
m
pDrawObjs
||
m
pDrawObjs
->
is_sorted
());
assert
(
!
m
_pDrawObjs
||
m_
pDrawObjs
->
is_sorted
());
}
}
void
SwFrame
::
InvalidateObjs
(
const
bool
_bNoInvaOfAsCharAnchoredObjs
)
void
SwFrame
::
InvalidateObjs
(
const
bool
_bNoInvaOfAsCharAnchoredObjs
)
...
...
sw/source/core/layout/ssfrm.cxx
Dosyayı görüntüle @
794e54cd
...
@@ -338,11 +338,11 @@ void SwFrame::DestroyImpl()
...
@@ -338,11 +338,11 @@ void SwFrame::DestroyImpl()
}
}
}
}
if
(
mpDrawObjs
)
if
(
m_pDrawObjs
)
{
{
for
(
size_t
i
=
m
pDrawObjs
->
size
();
i
;
)
for
(
size_t
i
=
m_
pDrawObjs
->
size
();
i
;
)
{
{
SwAnchoredObject
*
pAnchoredObj
=
(
*
mpDrawObjs
)[
--
i
];
SwAnchoredObject
*
pAnchoredObj
=
(
*
m
_
pDrawObjs
)[
--
i
];
if
(
dynamic_cast
<
const
SwFlyFrame
*>
(
pAnchoredObj
)
!=
nullptr
)
if
(
dynamic_cast
<
const
SwFlyFrame
*>
(
pAnchoredObj
)
!=
nullptr
)
{
{
SwFrame
::
DestroyFrame
(
static_cast
<
SwFlyFrame
*>
(
pAnchoredObj
));
SwFrame
::
DestroyFrame
(
static_cast
<
SwFlyFrame
*>
(
pAnchoredObj
));
...
@@ -360,8 +360,7 @@ void SwFrame::DestroyImpl()
...
@@ -360,8 +360,7 @@ void SwFrame::DestroyImpl()
}
}
}
}
}
}
delete
mpDrawObjs
;
m_pDrawObjs
.
reset
();
mpDrawObjs
=
nullptr
;
}
}
}
}
...
@@ -371,7 +370,7 @@ SwFrame::~SwFrame()
...
@@ -371,7 +370,7 @@ SwFrame::~SwFrame()
assert
(
!
IsDeleteForbidden
());
// check that it's not deleted while deletes are forbidden
assert
(
!
IsDeleteForbidden
());
// check that it's not deleted while deletes are forbidden
#if OSL_DEBUG_LEVEL > 0
#if OSL_DEBUG_LEVEL > 0
// JP 15.10.2001: for detection of access to deleted frames
// JP 15.10.2001: for detection of access to deleted frames
mp
DrawObjs
=
reinterpret_cast
<
SwSortedObjs
*>
(
0x33333333
);
mp
Root
=
reinterpret_cast
<
SwRootFrame
*>
(
0x33333333
);
#endif
#endif
}
}
...
...
sw/source/core/layout/wsfrm.cxx
Dosyayı görüntüle @
794e54cd
...
@@ -297,7 +297,6 @@ SwFrame::SwFrame( SwModify *pMod, SwFrame* pSib )
...
@@ -297,7 +297,6 @@ SwFrame::SwFrame( SwModify *pMod, SwFrame* pSib )
mpUpper
(
nullptr
),
mpUpper
(
nullptr
),
mpNext
(
nullptr
),
mpNext
(
nullptr
),
mpPrev
(
nullptr
),
mpPrev
(
nullptr
),
mpDrawObjs
(
nullptr
),
mnFrameType
(
SwFrameType
::
None
),
mnFrameType
(
SwFrameType
::
None
),
mbInDtor
(
false
),
mbInDtor
(
false
),
mbInvalidR2L
(
true
),
mbInvalidR2L
(
true
),
...
...
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