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
0b08ae6d
Kaydet (Commit)
0b08ae6d
authored
May 14, 2015
tarafından
Tomaž Vajngerl
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
refactor SvxShowText to use RenderContext
Change-Id: I7e059c36bb5a130f823a6da5feb981b0926b3294
üst
87bfdaf4
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
19 deletions
+18
-19
cuicharmap.cxx
cui/source/dialogs/cuicharmap.cxx
+18
-19
No files found.
cui/source/dialogs/cuicharmap.cxx
Dosyayı görüntüle @
0b08ae6d
...
...
@@ -182,29 +182,29 @@ SvxShowText::SvxShowText(vcl::Window* pParent, bool bCenter)
VCL_BUILDER_FACTORY
(
SvxShowText
)
void
SvxShowText
::
Paint
(
vcl
::
RenderContext
&
/*rRenderContext*/
,
const
Rectangle
&
)
void
SvxShowText
::
Paint
(
vcl
::
RenderContext
&
rRenderContext
,
const
Rectangle
&
)
{
Color
aTextCol
=
GetTextColor
();
Color
aTextCol
=
rRenderContext
.
GetTextColor
();
const
StyleSettings
&
rStyleSettings
=
Application
::
GetSettings
().
GetStyleSettings
();
const
Color
aWindowTextColor
(
rStyleSettings
.
GetDialogTextColor
()
);
SetTextColor
(
aWindowTextColor
);
const
Color
aWindowTextColor
(
rStyleSettings
.
GetDialogTextColor
()
);
rRenderContext
.
SetTextColor
(
aWindowTextColor
);
const
OUString
aText
=
GetText
();
const
Size
aSize
=
GetOutputSizePixel
();
const
Size
aSize
=
rRenderContext
.
GetOutputSizePixel
();
long
nAvailWidth
=
aSize
.
Width
();
long
nWinHeight
=
GetOutputSizePixel
().
Height
();
long
nWinHeight
=
rRenderContext
.
GetOutputSizePixel
().
Height
();
bool
bGotBoundary
=
true
;
bool
bShrankFont
=
false
;
vcl
::
Font
aOrigFont
(
GetFont
());
vcl
::
Font
aOrigFont
(
rRenderContext
.
GetFont
());
Size
aFontSize
(
aOrigFont
.
GetSize
());
Rectangle
aBoundRect
;
for
(
long
nFontHeight
=
aFontSize
.
Height
();
nFontHeight
>
0
;
nFontHeight
-=
5
)
{
if
(
!
GetTextBoundRect
(
aBoundRect
,
aText
)
||
aBoundRect
.
IsEmpty
()
)
if
(
!
rRenderContext
.
GetTextBoundRect
(
aBoundRect
,
aText
)
||
aBoundRect
.
IsEmpty
()
)
{
bGotBoundary
=
false
;
break
;
...
...
@@ -218,15 +218,15 @@ void SvxShowText::Paint(vcl::RenderContext& /*rRenderContext*/, const Rectangle&
vcl
::
Font
aFont
(
aOrigFont
);
aFontSize
.
Height
()
=
nFontHeight
;
aFont
.
SetSize
(
aFontSize
);
Control
::
SetFont
(
aFont
);
mnY
=
(
nWinHeight
-
GetTextHeight
()
)
/
2
;
rRenderContext
.
SetFont
(
aFont
);
mnY
=
(
nWinHeight
-
GetTextHeight
()
)
/
2
;
bShrankFont
=
true
;
}
Point
aPoint
(
2
,
mnY
);
Point
aPoint
(
2
,
mnY
);
// adjust position using ink boundary if possible
if
(
!
bGotBoundary
)
aPoint
.
X
()
=
(
aSize
.
Width
()
-
GetTextWidth
(
aText
))
/
2
;
if
(
!
bGotBoundary
)
aPoint
.
X
()
=
(
aSize
.
Width
()
-
rRenderContext
.
GetTextWidth
(
aText
))
/
2
;
else
{
// adjust position before it gets out of bounds
...
...
@@ -240,11 +240,10 @@ void SvxShowText::Paint(vcl::RenderContext& /*rRenderContext*/, const Rectangle&
else
if
(
nYHDelta
<=
0
)
aPoint
.
Y
()
+=
nYHDelta
-
1
;
if
(
mbCenter
)
if
(
mbCenter
)
{
// move glyph to middle of cell
aPoint
.
X
()
=
-
aBoundRect
.
Left
()
+
(
aSize
.
Width
()
-
aBoundRect
.
GetWidth
())
/
2
;
aPoint
.
X
()
=
-
aBoundRect
.
Left
()
+
(
aSize
.
Width
()
-
aBoundRect
.
GetWidth
())
/
2
;
}
else
{
...
...
@@ -258,10 +257,10 @@ void SvxShowText::Paint(vcl::RenderContext& /*rRenderContext*/, const Rectangle&
}
}
DrawText
(
aPoint
,
aText
);
SetTextColor
(
aTextCol
);
rRenderContext
.
DrawText
(
aPoint
,
aText
);
rRenderContext
.
SetTextColor
(
aTextCol
);
if
(
bShrankFont
)
Control
::
SetFont
(
aOrigFont
);
rRenderContext
.
SetFont
(
aOrigFont
);
}
...
...
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