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
6fb6b45c
Kaydet (Commit)
6fb6b45c
authored
May 12, 2015
tarafından
Tomaž Vajngerl
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Add expand (contract) to Rectangle as it is often used.
Change-Id: I98e2738a1f79a1157c18b6003f70955e071f1654
üst
c7f056ac
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
0 deletions
+25
-0
gen.hxx
include/tools/gen.hxx
+25
-0
No files found.
include/tools/gen.hxx
Dosyayı görüntüle @
6fb6b45c
...
...
@@ -443,6 +443,15 @@ public:
/// Returns the string representation of the rectangle, format is "x, y, width, height".
rtl
::
OString
toString
()
const
;
/**
* Expands the rectangle in all directions by the input value.
*/
inline
void
expand
(
long
nExpandBy
);
/**
* Contracts the rectangle in all directions by the input value.
*/
inline
void
contract
(
long
nContractBy
);
private
:
long
nLeft
;
long
nTop
;
...
...
@@ -689,6 +698,22 @@ inline Rectangle operator - ( const Rectangle& rRect, const Point& rPt )
return
aRect
;
}
inline
void
Rectangle
::
expand
(
long
nExpandBy
)
{
nLeft
-=
nExpandBy
;
nTop
-=
nExpandBy
;
nRight
+=
nExpandBy
;
nBottom
+=
nExpandBy
;
}
inline
void
Rectangle
::
contract
(
long
nContractBy
)
{
nLeft
+=
nContractBy
;
nTop
+=
nContractBy
;
nRight
-=
nContractBy
;
nBottom
-=
nContractBy
;
}
template
<
typename
charT
,
typename
traits
>
inline
std
::
basic_ostream
<
charT
,
traits
>
&
operator
<<
(
std
::
basic_ostream
<
charT
,
traits
>
&
stream
,
const
Rectangle
&
rectangle
)
...
...
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