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
df1a10da
Kaydet (Commit)
df1a10da
authored
Ara 21, 2017
tarafından
Matteo Casalin
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Directly access own data members, remove unused methods
Change-Id: Id86d66738da2f6e4b86d4a4ee8da54940c751787
üst
13153921
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
20 deletions
+18
-20
svddrag.hxx
include/svx/svddrag.hxx
+3
-5
svddrag.cxx
svx/source/svdraw/svddrag.cxx
+15
-15
No files found.
include/svx/svddrag.hxx
Dosyayı görüntüle @
df1a10da
...
...
@@ -77,6 +77,8 @@ class SVX_DLLPUBLIC SdrDragStat final
void
Clear
();
sal_Int32
GetPrevPos
()
const
{
return
mvPnts
.
size
()
-
(
mvPnts
.
size
()
>
1
?
2
:
1
);
}
public
:
SdrDragStat
()
{
Reset
();
}
~
SdrDragStat
();
...
...
@@ -88,14 +90,10 @@ public:
const
Point
&
GetPoint
(
sal_Int32
nNum
)
const
{
return
mvPnts
[
nNum
];
}
sal_Int32
GetPointCount
()
const
{
return
mvPnts
.
size
();
}
const
Point
&
GetStart
()
const
{
return
mvPnts
[
0
];
}
void
SetStart
(
const
Point
&
pt
)
{
mvPnts
[
0
]
=
pt
;
}
const
Point
&
GetPrev
()
const
{
return
mvPnts
[
GetPointCount
()
-
(
GetPointCount
()
>=
2
?
2
:
1
)];
}
void
SetPrev
(
const
Point
&
pt
)
{
mvPnts
[
GetPointCount
()
-
(
GetPointCount
()
>=
2
?
2
:
1
)]
=
pt
;
}
const
Point
&
GetPrev
()
const
{
return
mvPnts
[
GetPrevPos
()];
}
const
Point
&
GetPos0
()
const
{
return
aPos0
;
}
const
Point
&
GetNow
()
const
{
return
mvPnts
.
back
();
}
void
SetNow
(
Point
const
&
pt
)
{
mvPnts
.
back
()
=
pt
;
}
const
Point
&
GetRealNow
()
const
{
return
aRealNow
;
}
void
SetRealNow
(
Point
const
&
pt
)
{
aRealNow
=
pt
;
}
const
Point
&
GetRef1
()
const
{
return
aRef1
;
}
void
SetRef1
(
const
Point
&
pt
)
{
aRef1
=
pt
;
}
const
Point
&
GetRef2
()
const
{
return
aRef2
;
}
...
...
svx/source/svdraw/svddrag.cxx
Dosyayı görüntüle @
df1a10da
...
...
@@ -58,30 +58,30 @@ void SdrDragStat::Reset()
void
SdrDragStat
::
Reset
(
const
Point
&
rPnt
)
{
Reset
();
SetStart
(
rPnt
)
;
mvPnts
[
0
]
=
rPnt
;
aPos0
=
rPnt
;
SetRealNow
(
rPnt
)
;
aRealNow
=
rPnt
;
}
void
SdrDragStat
::
NextMove
(
const
Point
&
rPnt
)
{
aPos0
=
GetNow
();
SetRealNow
(
rPnt
)
;
SetNow
(
GetRealNow
())
;
aPos0
=
mvPnts
.
back
();
aRealNow
=
rPnt
;
mvPnts
.
back
()
=
rPnt
;
}
void
SdrDragStat
::
NextPoint
()
{
Point
aPnt
(
GetNow
());
mvPnts
.
emplace_back
(
GetRealNow
()
);
SetPrev
(
aPnt
)
;
Point
aPnt
(
mvPnts
.
back
());
mvPnts
.
emplace_back
(
aRealNow
);
mvPnts
[
GetPrevPos
()]
=
aPnt
;
}
void
SdrDragStat
::
PrevPoint
()
{
if
(
mvPnts
.
size
()
>
=
2
)
{
// one has to remain at all times
if
(
mvPnts
.
size
()
>
1
)
{
// one has to remain at all times
mvPnts
.
erase
(
mvPnts
.
begin
()
+
mvPnts
.
size
()
-
2
);
SetNow
(
GetRealNow
()
)
;
mvPnts
.
back
()
=
aRealNow
;
}
}
...
...
@@ -98,7 +98,7 @@ bool SdrDragStat::CheckMinMoved(const Point& rPnt)
Fraction
SdrDragStat
::
GetXFact
()
const
{
long
nMul
=
GetNow
().
X
()
-
aRef1
.
X
();
long
nMul
=
mvPnts
.
back
().
X
()
-
aRef1
.
X
();
long
nDiv
=
GetPrev
().
X
()
-
aRef1
.
X
();
if
(
nDiv
==
0
)
nDiv
=
1
;
if
(
bHorFixed
)
{
nMul
=
1
;
nDiv
=
1
;
}
...
...
@@ -107,7 +107,7 @@ Fraction SdrDragStat::GetXFact() const
Fraction
SdrDragStat
::
GetYFact
()
const
{
long
nMul
=
GetNow
().
Y
()
-
aRef1
.
Y
();
long
nMul
=
mvPnts
.
back
().
Y
()
-
aRef1
.
Y
();
long
nDiv
=
GetPrev
().
Y
()
-
aRef1
.
Y
();
if
(
nDiv
==
0
)
nDiv
=
1
;
if
(
bVerFixed
)
{
nMul
=
1
;
nDiv
=
1
;
}
...
...
@@ -116,9 +116,9 @@ Fraction SdrDragStat::GetYFact() const
void
SdrDragStat
::
TakeCreateRect
(
tools
::
Rectangle
&
rRect
)
const
{
rRect
=
tools
::
Rectangle
(
GetStart
(),
GetNow
());
if
(
GetPointCount
()
>=
2
)
{
Point
aBtmRgt
(
GetPoint
(
1
)
);
rRect
=
tools
::
Rectangle
(
mvPnts
[
0
],
mvPnts
.
back
());
if
(
mvPnts
.
size
()
>
1
)
{
Point
aBtmRgt
(
mvPnts
[
1
]
);
rRect
.
Right
()
=
aBtmRgt
.
X
();
rRect
.
Bottom
()
=
aBtmRgt
.
Y
();
}
...
...
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