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
0d4f072d
Kaydet (Commit)
0d4f072d
authored
Mar 30, 2014
tarafından
Matteo Casalin
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Constify
Change-Id: I8d215b0cea56cda55d8e991da1649fca765d149b
üst
53387dab
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
29 deletions
+23
-29
labfmt.cxx
sw/source/ui/envelp/labfmt.cxx
+23
-29
No files found.
sw/source/ui/envelp/labfmt.cxx
Dosyayı görüntüle @
0d4f072d
...
...
@@ -92,14 +92,14 @@ void SwLabPreview::Paint(const Rectangle &)
{
const
Size
aSz
(
GetOutputSizePixel
());
long
lOutWPix
=
aSz
.
Width
();
long
lOutHPix
=
aSz
.
Height
();
const
long
lOutWPix
=
aSz
.
Width
();
const
long
lOutHPix
=
aSz
.
Height
();
// Scale factor
float
fxpix
=
(
float
)(
lOutWPix
-
(
2
*
(
lLeftWidth
+
15
)))
/
(
float
)
lOutWPix
;
const
float
fxpix
=
(
float
)(
lOutWPix
-
(
2
*
(
lLeftWidth
+
15
)))
/
(
float
)
lOutWPix
;
long
lOutWPix23
=
(
long
)((
float
)
lOutWPix
*
fxpix
);
long
lOutHPix23
=
(
long
)((
float
)
lOutHPix
*
fxpix
);
const
long
lOutWPix23
=
(
long
)((
float
)
lOutWPix
*
fxpix
);
const
long
lOutHPix23
=
(
long
)((
float
)
lOutHPix
*
fxpix
);
const
StyleSettings
&
rStyleSettings
=
GetSettings
().
GetStyleSettings
();
const
Color
&
rWinColor
=
rStyleSettings
.
GetWindowColor
();
...
...
@@ -119,34 +119,28 @@ void SwLabPreview::Paint(const Rectangle &)
SetFont
(
aPaintFont
);
// size of region to be displayed
long
lDispW
=
aItem
.
lLeft
+
aItem
.
lHDist
;
long
lDispH
=
aItem
.
lUpper
+
aItem
.
lVDist
;
if
(
aItem
.
nCols
==
1
)
lDispW
+=
aItem
.
lLeft
;
else
lDispW
+=
ROUND
(
aItem
.
lHDist
/
10.0
);
if
(
aItem
.
nRows
==
1
)
lDispH
+=
aItem
.
lUpper
;
else
lDispH
+=
ROUND
(
aItem
.
lVDist
/
10.0
);
const
long
lDispW
=
aItem
.
lLeft
+
aItem
.
lHDist
+
((
aItem
.
nCols
==
1
)
?
aItem
.
lLeft
:
ROUND
(
aItem
.
lHDist
/
10.0
));
const
long
lDispH
=
aItem
.
lUpper
+
aItem
.
lVDist
+
((
aItem
.
nRows
==
1
)
?
aItem
.
lUpper
:
ROUND
(
aItem
.
lVDist
/
10.0
));
// Scale factor
float
fx
=
(
float
)
lOutWPix23
/
std
::
max
(
1L
,
lDispW
),
fy
=
(
float
)
lOutHPix23
/
std
::
max
(
1L
,
lDispH
),
f
=
fx
<
fy
?
fx
:
fy
;
const
float
fx
=
(
float
)
lOutWPix23
/
std
::
max
(
1L
,
lDispW
);
const
float
fy
=
(
float
)
lOutHPix23
/
std
::
max
(
1L
,
lDispH
);
const
float
f
=
fx
<
fy
?
fx
:
fy
;
// zero point
long
lOutlineW
=
ROUND
(
f
*
lDispW
);
long
lOutlineH
=
ROUND
(
f
*
lDispH
);
long
lX0
=
(
lOutWPix
-
lOutlineW
)
/
2
;
long
lY0
=
(
lOutHPix
-
lOutlineH
)
/
2
;
long
lX1
=
lX0
+
ROUND
(
f
*
aItem
.
lLeft
);
long
lY1
=
lY0
+
ROUND
(
f
*
aItem
.
lUpper
);
long
lX2
=
lX0
+
ROUND
(
f
*
(
aItem
.
lLeft
+
aItem
.
lWidth
));
long
lY2
=
lY0
+
ROUND
(
f
*
(
aItem
.
lUpper
+
aItem
.
lHeight
));
long
lX3
=
lX0
+
ROUND
(
f
*
(
aItem
.
lLeft
+
aItem
.
lHDist
));
long
lY3
=
lY0
+
ROUND
(
f
*
(
aItem
.
lUpper
+
aItem
.
lVDist
));
const
long
lOutlineW
=
ROUND
(
f
*
lDispW
);
const
long
lOutlineH
=
ROUND
(
f
*
lDispH
);
const
long
lX0
=
(
lOutWPix
-
lOutlineW
)
/
2
;
const
long
lY0
=
(
lOutHPix
-
lOutlineH
)
/
2
;
const
long
lX1
=
lX0
+
ROUND
(
f
*
aItem
.
lLeft
);
const
long
lY1
=
lY0
+
ROUND
(
f
*
aItem
.
lUpper
);
const
long
lX2
=
lX0
+
ROUND
(
f
*
(
aItem
.
lLeft
+
aItem
.
lWidth
));
const
long
lY2
=
lY0
+
ROUND
(
f
*
(
aItem
.
lUpper
+
aItem
.
lHeight
));
const
long
lX3
=
lX0
+
ROUND
(
f
*
(
aItem
.
lLeft
+
aItem
.
lHDist
));
const
long
lY3
=
lY0
+
ROUND
(
f
*
(
aItem
.
lUpper
+
aItem
.
lVDist
));
// draw outline (area)
DrawRect
(
Rectangle
(
Point
(
lX0
,
lY0
),
Size
(
lOutlineW
,
lOutlineH
)));
...
...
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