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
b1c56d12
Kaydet (Commit)
b1c56d12
authored
Kas 28, 2011
tarafından
Michael Stahl
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
SwFmtAchor: bit of style cleanup
üst
c66b52b0
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
33 deletions
+31
-33
fmtanchr.hxx
sw/inc/fmtanchr.hxx
+5
-2
atrfrm.cxx
sw/source/core/layout/atrfrm.cxx
+26
-31
No files found.
sw/inc/fmtanchr.hxx
Dosyayı görüntüle @
b1c56d12
...
...
@@ -34,6 +34,9 @@
#include <format.hxx>
#include <svl/poolitem.hxx>
#include <boost/scoped_ptr.hpp>
struct
SwPosition
;
class
IntlWrapper
;
#define IVER_FMTANCHOR_LONGIDX ((sal_uInt16)1)
...
...
@@ -41,7 +44,7 @@ class IntlWrapper;
// FlyAnchors
class
SW_DLLPUBLIC
SwFmtAnchor
:
public
SfxPoolItem
{
SwPosition
*
pCntntAnchor
;
// 0 for page-bound frames.
::
boost
::
scoped_ptr
<
SwPosition
>
m_pCntntAnchor
;
// 0 for page-bound frames.
// Index for paragraph-bound frames.
// Position for character-bound frames.
RndStdIds
nAnchorId
;
...
...
@@ -72,7 +75,7 @@ public:
RndStdIds
GetAnchorId
()
const
{
return
nAnchorId
;
}
sal_uInt16
GetPageNum
()
const
{
return
nPageNum
;
}
const
SwPosition
*
GetCntntAnchor
()
const
{
return
pCntntAnchor
;
}
const
SwPosition
*
GetCntntAnchor
()
const
{
return
m_pCntntAnchor
.
get
()
;
}
// #i28701#
sal_uInt32
GetOrder
()
const
;
...
...
sw/source/core/layout/atrfrm.cxx
Dosyayı görüntüle @
b1c56d12
...
...
@@ -1476,7 +1476,6 @@ bool SwFmtHoriOrient::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
SwFmtAnchor
::
SwFmtAnchor
(
RndStdIds
nRnd
,
sal_uInt16
nPage
)
:
SfxPoolItem
(
RES_ANCHOR
),
pCntntAnchor
(
0
),
nAnchorId
(
nRnd
),
nPageNum
(
nPage
),
// OD 2004-05-05 #i28701# - get always new increased order number
...
...
@@ -1484,30 +1483,28 @@ SwFmtAnchor::SwFmtAnchor( RndStdIds nRnd, sal_uInt16 nPage )
{}
SwFmtAnchor
::
SwFmtAnchor
(
const
SwFmtAnchor
&
rCpy
)
:
SfxPoolItem
(
RES_ANCHOR
),
nAnchorId
(
rCpy
.
GetAnchorId
()
),
nPageNum
(
rCpy
.
GetPageNum
()
),
:
SfxPoolItem
(
RES_ANCHOR
)
,
m_pCntntAnchor
(
(
rCpy
.
GetCntntAnchor
())
?
new
SwPosition
(
*
rCpy
.
GetCntntAnchor
()
)
:
0
)
,
nAnchorId
(
rCpy
.
GetAnchorId
()
)
,
nPageNum
(
rCpy
.
GetPageNum
()
)
// OD 2004-05-05 #i28701# - get always new increased order number
mnOrder
(
++
mnOrderCounter
)
,
mnOrder
(
++
mnOrderCounter
)
{
pCntntAnchor
=
rCpy
.
GetCntntAnchor
()
?
new
SwPosition
(
*
rCpy
.
GetCntntAnchor
()
)
:
0
;
}
SwFmtAnchor
::~
SwFmtAnchor
()
SwFmtAnchor
::~
SwFmtAnchor
()
{
delete
pCntntAnchor
;
}
void
SwFmtAnchor
::
SetAnchor
(
const
SwPosition
*
pPos
)
{
delete
pCntntAnchor
;
pCntntAnchor
=
pPos
?
new
SwPosition
(
*
pPos
)
:
0
;
//AM Absatz gebundene Flys sollten nie in den Absatz hineinzeigen.
if
(
pCntntAnchor
&&
m_pCntntAnchor
.
reset
(
(
pPos
)
?
new
SwPosition
(
*
pPos
)
:
0
);
// Flys anchored AT paragraph should not point into the paragraph content
if
(
m_pCntntAnchor
&&
((
FLY_AT_PARA
==
nAnchorId
)
||
(
FLY_AT_FLY
==
nAnchorId
)))
{
pCntntAnchor
->
nContent
.
Assign
(
0
,
0
);
m_
pCntntAnchor
->
nContent
.
Assign
(
0
,
0
);
}
}
...
...
@@ -1518,24 +1515,24 @@ SwFmtAnchor& SwFmtAnchor::operator=(const SwFmtAnchor& rAnchor)
// OD 2004-05-05 #i28701# - get always new increased order number
mnOrder
=
++
mnOrderCounter
;
delete
pCntntAnchor
;
pCntntAnchor
=
rAnchor
.
pCntntAnchor
?
new
SwPosition
(
*
(
rAnchor
.
pCntntAnchor
))
:
0
;
m_pCntntAnchor
.
reset
(
(
rAnchor
.
GetCntntAnchor
())
?
new
SwPosition
(
*
(
rAnchor
.
GetCntntAnchor
()))
:
0
)
;
return
*
this
;
}
int
SwFmtAnchor
::
operator
==
(
const
SfxPoolItem
&
rAttr
)
const
{
OSL_ENSURE
(
SfxPoolItem
::
operator
==
(
rAttr
),
"keine gleichen Attribute"
);
SwFmtAnchor
const
&
rFmtAnchor
(
static_cast
<
SwFmtAnchor
const
&>
(
rAttr
));
// OD 2004-05-05 #i28701# - Note: <mnOrder> hasn't to be considered.
return
(
nAnchorId
==
((
SwFmtAnchor
&
)
rAttr
).
GetAnchorId
()
&&
nPageNum
==
((
SwFmtAnchor
&
)
rAttr
).
GetPageNum
()
&&
//Anker vergleichen. Entweder zeigen beide auf das gleiche
//Attribut bzw. sind 0 oder die SwPosition* sind beide
//gueltig und die SwPositions sind gleich.
(
pCntntAnchor
==
((
SwFmtAnchor
&
)
rAttr
).
GetCntntAnchor
()
||
(
pCntntAnchor
&&
((
SwFmtAnchor
&
)
rAttr
).
GetCntntAnchor
()
&&
*
pCntntAnchor
==
*
((
SwFmtAnchor
&
)
rAttr
).
GetCntntAnchor
())));
return
(
nAnchorId
==
rFmtAnchor
.
GetAnchorId
()
&&
nPageNum
==
rFmtAnchor
.
GetPageNum
()
&&
// compare anchor: either both do not point into a textnode or
// both do (valid m_pCntntAnchor) and the positions are equal
((
m_pCntntAnchor
.
get
()
==
rFmtAnchor
.
m_pCntntAnchor
.
get
())
||
(
m_pCntntAnchor
&&
rFmtAnchor
.
GetCntntAnchor
()
&&
(
*
m_pCntntAnchor
==
*
rFmtAnchor
.
GetCntntAnchor
()))));
}
SfxPoolItem
*
SwFmtAnchor
::
Clone
(
SfxItemPool
*
)
const
...
...
@@ -1587,9 +1584,9 @@ bool SwFmtAnchor::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const
break
;
case
MID_ANCHOR_ANCHORFRAME
:
{
if
(
pCntntAnchor
&&
FLY_AT_FLY
==
nAnchorId
)
if
(
m_
pCntntAnchor
&&
FLY_AT_FLY
==
nAnchorId
)
{
SwFrmFmt
*
pFmt
=
pCntntAnchor
->
nNode
.
GetNode
().
GetFlyFmt
();
SwFrmFmt
*
pFmt
=
m_
pCntntAnchor
->
nNode
.
GetNode
().
GetFlyFmt
();
if
(
pFmt
)
{
uno
::
Reference
<
container
::
XNamed
>
xNamed
=
SwXFrames
::
GetObject
(
*
pFmt
,
FLYCNTTYPE_FRM
);
...
...
@@ -1628,8 +1625,7 @@ bool SwFmtAnchor::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
// If the anchor type is page and a valid page number
// has been set, the content position isn't required
// any longer.
delete
pCntntAnchor
;
pCntntAnchor
=
0
;
m_pCntntAnchor
.
reset
();
}
break
;
case
text
:
:
TextContentAnchorType_AT_FRAME
:
...
...
@@ -1659,8 +1655,7 @@ bool SwFmtAnchor::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
// confuse the layout (frmtool.cxx). However, if the
// anchor type is not page, any content position will
// be kept.
delete
pCntntAnchor
;
pCntntAnchor
=
0
;
m_pCntntAnchor
.
reset
();
}
}
else
...
...
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