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
5c379de9
Kaydet (Commit)
5c379de9
authored
May 11, 2012
tarafından
Gábor Stefanik
Kaydeden (comit)
Andras Timar
May 12, 2012
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
fdo#46223: Fix Presenter Console help screen layout
Change-Id: I18d2fda46d3a6427b1691c1ff7838097bb25d0ec
üst
f9411845
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
51 additions
and
15 deletions
+51
-15
PresenterHelpView.cxx
sdext/source/presenter/PresenterHelpView.cxx
+51
-15
No files found.
sdext/source/presenter/PresenterHelpView.cxx
Dosyayı görüntüle @
5c379de9
...
@@ -385,10 +385,6 @@ void PresenterHelpView::CheckFontSize (void)
...
@@ -385,10 +385,6 @@ void PresenterHelpView::CheckFontSize (void)
if
(
mpFont
.
get
()
==
NULL
)
if
(
mpFont
.
get
()
==
NULL
)
return
;
return
;
const
awt
::
Rectangle
aWindowBox
(
mxWindow
->
getPosSize
());
if
(
aWindowBox
.
Width
<=
0
||
aWindowBox
.
Height
<=
0
)
return
;
sal_Int32
nBestSize
(
6
);
sal_Int32
nBestSize
(
6
);
// Scaling down and then reformatting can cause the text to be too large
// Scaling down and then reformatting can cause the text to be too large
...
@@ -396,7 +392,7 @@ void PresenterHelpView::CheckFontSize (void)
...
@@ -396,7 +392,7 @@ void PresenterHelpView::CheckFontSize (void)
// small enough. Restrict the number of loops.
// small enough. Restrict the number of loops.
for
(
int
nLoopCount
=
0
;
nLoopCount
<
5
;
++
nLoopCount
)
for
(
int
nLoopCount
=
0
;
nLoopCount
<
5
;
++
nLoopCount
)
{
{
double
nY
(
gnVerticalBorder
);
double
nY
(
0.0
);
TextContainer
::
iterator
iBlock
(
mpTextContainer
->
begin
());
TextContainer
::
iterator
iBlock
(
mpTextContainer
->
begin
());
TextContainer
::
const_iterator
iBlockEnd
(
mpTextContainer
->
end
());
TextContainer
::
const_iterator
iBlockEnd
(
mpTextContainer
->
end
());
for
(
;
iBlock
!=
iBlockEnd
;
++
iBlock
)
for
(
;
iBlock
!=
iBlockEnd
;
++
iBlock
)
...
@@ -404,7 +400,7 @@ void PresenterHelpView::CheckFontSize (void)
...
@@ -404,7 +400,7 @@ void PresenterHelpView::CheckFontSize (void)
(
*
iBlock
)
->
maLeft
.
GetHeight
(),
(
*
iBlock
)
->
maLeft
.
GetHeight
(),
(
*
iBlock
)
->
maRight
.
GetHeight
());
(
*
iBlock
)
->
maRight
.
GetHeight
());
const
double
nHeightDifference
(
nY
-
(
aWindowBox
.
Height
-
gnVerticalBorder
));
const
double
nHeightDifference
(
nY
-
(
mnSeparatorY
-
gnVerticalBorder
));
if
(
nHeightDifference
<=
0
&&
nHeightDifference
>
-
50
)
if
(
nHeightDifference
<=
0
&&
nHeightDifference
>
-
50
)
{
{
// We have found a good font size that is large and leaves not
// We have found a good font size that is large and leaves not
...
@@ -412,16 +408,14 @@ void PresenterHelpView::CheckFontSize (void)
...
@@ -412,16 +408,14 @@ void PresenterHelpView::CheckFontSize (void)
return
;
return
;
}
}
// Font is too large. Make it smaller.
// Use a simple linear transformation to calculate initial guess of
// Use a simple linear transformation to calculate initial guess of
// a size that lets all help text be shown inside the window.
// a size that lets all help text be shown inside the window.
const
double
nScale
(
double
(
aWindowBox
.
Height
-
gnVerticalBorder
)
/
nY
);
const
double
nScale
(
double
(
mnSeparatorY
-
gnVerticalBorder
)
/
nY
);
if
(
nScale
>
0.95
&&
nScale
<
1.05
)
if
(
nScale
>
1.0
&&
nScale
<
1.05
)
break
;
break
;
sal_Int32
nFontSizeGuess
(
::
std
::
max
(
sal_Int32
(
1
),
sal_Int32
(
mpFont
->
mnSize
*
nScale
)
));
sal_Int32
nFontSizeGuess
(
sal_Int32
(
mpFont
->
mnSize
*
nScale
));
if
(
nHeightDifference
<
0
&&
mpFont
->
mnSize
>
nBestSize
)
if
(
nHeightDifference
<
=
0
&&
mpFont
->
mnSize
>
nBestSize
)
nBestSize
=
mpFont
->
mnSize
;
nBestSize
=
mpFont
->
mnSize
;
mpFont
->
mnSize
=
nFontSizeGuess
;
mpFont
->
mnSize
=
nFontSizeGuess
;
mpFont
->
mxFont
=
NULL
;
mpFont
->
mxFont
=
NULL
;
...
@@ -673,12 +667,53 @@ void LineDescriptorList::FormatText (
...
@@ -673,12 +667,53 @@ void LineDescriptorList::FormatText (
vector
<
OUString
>::
const_iterator
iPart
(
rTextParts
.
begin
());
vector
<
OUString
>::
const_iterator
iPart
(
rTextParts
.
begin
());
vector
<
OUString
>::
const_iterator
iEnd
(
rTextParts
.
end
());
vector
<
OUString
>::
const_iterator
iEnd
(
rTextParts
.
end
());
for
(
;
iPart
!=
iEnd
;
++
iPart
)
while
(
iPart
!=
iEnd
)
{
{
if
(
aLineDescriptor
.
IsEmpty
())
if
(
aLineDescriptor
.
IsEmpty
())
{
{
// Avoid empty lines.
// Avoid empty lines.
aLineDescriptor
.
AddPart
(
*
iPart
,
rxFont
);
if
(
PresenterCanvasHelper
::
GetTextSize
(
rxFont
,
*
iPart
).
Width
>
nMaximalWidth
)
{
const
sal_Char
cSpace
(
' '
);
sal_Int32
nIndex
(
0
);
sal_Int32
nStart
(
0
);
sal_Int32
nLength
(
iPart
->
getLength
());
while
(
nIndex
<
nLength
)
{
sal_Int32
nSpaceIndex
(
iPart
->
indexOf
(
cSpace
,
nIndex
));
while
(
nSpaceIndex
>=
0
&&
PresenterCanvasHelper
::
GetTextSize
(
rxFont
,
iPart
->
copy
(
nStart
,
nSpaceIndex
-
nStart
)).
Width
<=
nMaximalWidth
)
{
nIndex
=
nSpaceIndex
;
nSpaceIndex
=
iPart
->
indexOf
(
cSpace
,
nIndex
+
1
);
}
if
(
nSpaceIndex
<
0
&&
PresenterCanvasHelper
::
GetTextSize
(
rxFont
,
iPart
->
copy
(
nStart
,
nLength
-
nStart
)).
Width
<=
nMaximalWidth
)
{
nIndex
=
nLength
;
}
if
(
nIndex
==
nStart
)
{
nIndex
=
nLength
;
}
aLineDescriptor
.
AddPart
(
iPart
->
copy
(
nStart
,
nIndex
-
nStart
),
rxFont
);
if
(
nIndex
!=
nLength
)
{
mpLineDescriptors
->
push_back
(
aLineDescriptor
);
aLineDescriptor
=
LineDescriptor
();
}
nStart
=
nIndex
;
}
}
else
{
aLineDescriptor
.
AddPart
(
*
iPart
,
rxFont
);
}
}
}
else
if
(
PresenterCanvasHelper
::
GetTextSize
(
else
if
(
PresenterCanvasHelper
::
GetTextSize
(
rxFont
,
aLineDescriptor
.
msLine
+
A2S
(
", "
)
+*
iPart
).
Width
>
nMaximalWidth
)
rxFont
,
aLineDescriptor
.
msLine
+
A2S
(
", "
)
+*
iPart
).
Width
>
nMaximalWidth
)
...
@@ -686,12 +721,13 @@ void LineDescriptorList::FormatText (
...
@@ -686,12 +721,13 @@ void LineDescriptorList::FormatText (
aLineDescriptor
.
AddPart
(
A2S
(
","
),
rxFont
);
aLineDescriptor
.
AddPart
(
A2S
(
","
),
rxFont
);
mpLineDescriptors
->
push_back
(
aLineDescriptor
);
mpLineDescriptors
->
push_back
(
aLineDescriptor
);
aLineDescriptor
=
LineDescriptor
();
aLineDescriptor
=
LineDescriptor
();
aLineDescriptor
.
AddPart
(
*
iPart
,
rxFont
)
;
continue
;
}
}
else
else
{
{
aLineDescriptor
.
AddPart
(
A2S
(
", "
)
+*
iPart
,
rxFont
);
aLineDescriptor
.
AddPart
(
A2S
(
", "
)
+*
iPart
,
rxFont
);
}
}
++
iPart
;
}
}
if
(
!
aLineDescriptor
.
IsEmpty
())
if
(
!
aLineDescriptor
.
IsEmpty
())
{
{
...
...
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