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
b4fae029
Kaydet (Commit)
b4fae029
authored
Haz 27, 2012
tarafından
Ivan Timofeev
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
FloatingSizeMode is always FSMODE_AUTO, remove it
Change-Id: I0468ff6deaf701ed3d155db1ff3f0f0c204e1199
üst
044eae11
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
43 additions
and
51 deletions
+43
-51
toolbox.hxx
vcl/inc/vcl/toolbox.hxx
+1
-4
toolbox.cxx
vcl/source/window/toolbox.cxx
+42
-47
No files found.
vcl/inc/vcl/toolbox.hxx
Dosyayı görüntüle @
b4fae029
...
...
@@ -155,9 +155,6 @@ enum ToolBoxItemType { TOOLBOXITEM_DONTKNOW, TOOLBOXITEM_BUTTON,
// dontcare will let the toolbox decide about its size
enum
ToolBoxButtonSize
{
TOOLBOX_BUTTONSIZE_DONTCARE
,
TOOLBOX_BUTTONSIZE_SMALL
,
TOOLBOX_BUTTONSIZE_LARGE
};
// used for internal sizing calculations
enum
FloatingSizeMode
{
FSMODE_AUTO
,
FSMODE_FAVOURWIDTH
,
FSMODE_FAVOURHEIGHT
};
// TBX_LAYOUT_NORMAL - traditional layout, items are centered in the toolbar
// TBX_LAYOUT_LOCKVERT - special mode (currently used for calc input/formula
// bar) where item's vertical position is locked, e.g.
...
...
@@ -287,7 +284,7 @@ private:
SAL_DLLPRIVATE
sal_Bool
ImplIsFloatingMode
()
const
;
SAL_DLLPRIVATE
sal_Bool
ImplIsInPopupMode
()
const
;
SAL_DLLPRIVATE
const
XubString
&
ImplGetHelpText
(
sal_uInt16
nItemId
)
const
;
SAL_DLLPRIVATE
Size
ImplGetOptimalFloatingSize
(
FloatingSizeMode
eMode
);
SAL_DLLPRIVATE
Size
ImplGetOptimalFloatingSize
();
SAL_DLLPRIVATE
sal_Bool
ImplHasExternalMenubutton
();
SAL_DLLPRIVATE
void
ImplDrawFloatwinBorder
(
ImplToolItem
*
pItem
);
...
...
vcl/source/window/toolbox.cxx
Dosyayı görüntüle @
b4fae029
...
...
@@ -2156,7 +2156,7 @@ sal_uInt16 ToolBox::ImplCalcBreaks( long nWidth, long* pMaxLineWidth, sal_Bool b
// -----------------------------------------------------------------------
Size
ToolBox
::
ImplGetOptimalFloatingSize
(
FloatingSizeMode
eMode
)
Size
ToolBox
::
ImplGetOptimalFloatingSize
()
{
if
(
!
ImplIsFloatingMode
()
)
return
Size
();
...
...
@@ -2166,60 +2166,55 @@ Size ToolBox::ImplGetOptimalFloatingSize( FloatingSizeMode eMode )
Size
aSize2
(
aCurrentSize
);
// try to preserve current height
if
(
eMode
==
FSMODE_AUTO
||
eMode
==
FSMODE_FAVOURHEIGHT
)
{
// calc number of floating lines for current window height
sal_uInt16
nFloatLinesHeight
=
ImplCalcLines
(
this
,
mnDY
);
// calc window size according to this number
aSize1
=
ImplCalcFloatSize
(
this
,
nFloatLinesHeight
);
if
(
eMode
==
FSMODE_FAVOURHEIGHT
||
aCurrentSize
==
aSize1
)
return
aSize1
;
}
// calc number of floating lines for current window height
sal_uInt16
nFloatLinesHeight
=
ImplCalcLines
(
this
,
mnDY
);
// calc window size according to this number
aSize1
=
ImplCalcFloatSize
(
this
,
nFloatLinesHeight
);
if
(
eMode
==
FSMODE_AUTO
||
eMode
==
FSMODE_FAVOURWIDTH
)
{
// try to preserve current width
long
nLineHeight
=
(
mnWinHeight
>
mnMaxItemHeight
)
?
mnWinHeight
:
mnMaxItemHeight
;
int
nBorderX
=
2
*
TB_BORDER_OFFSET1
+
mnLeftBorder
+
mnRightBorder
;
int
nBorderY
=
2
*
TB_BORDER_OFFSET2
+
mnTopBorder
+
mnBottomBorder
;
Size
aSz
(
aCurrentSize
);
long
maxX
;
sal_uInt16
nLines
=
ImplCalcBreaks
(
aSz
.
Width
()
-
nBorderX
,
&
maxX
,
mbHorz
);
if
(
aCurrentSize
==
aSize1
)
return
aSize1
;
sal_uInt16
manyLines
=
1000
;
Size
aMinimalFloatSize
=
ImplCalcFloatSize
(
this
,
manyLines
);
// try to preserve current width
aSz
.
Height
()
=
nBorderY
+
nLineHeight
*
nLines
;
// line space when more than one line
if
(
mnWinStyle
&
WB_LINESPACING
)
aSz
.
Height
()
+=
(
nLines
-
1
)
*
TB_LINESPACING
;
long
nLineHeight
=
(
mnWinHeight
>
mnMaxItemHeight
)
?
mnWinHeight
:
mnMaxItemHeight
;
int
nBorderX
=
2
*
TB_BORDER_OFFSET1
+
mnLeftBorder
+
mnRightBorder
;
int
nBorderY
=
2
*
TB_BORDER_OFFSET2
+
mnTopBorder
+
mnBottomBorder
;
Size
aSz
(
aCurrentSize
);
long
maxX
;
sal_uInt16
nLines
=
ImplCalcBreaks
(
aSz
.
Width
()
-
nBorderX
,
&
maxX
,
mbHorz
);
aSz
.
Width
()
=
nBorderX
+
maxX
;
sal_uInt16
manyLines
=
1000
;
Size
aMinimalFloatSize
=
ImplCalcFloatSize
(
this
,
manyLines
);
// avoid clipping of any items
if
(
aSz
.
Width
()
<
aMinimalFloatSize
.
Width
()
)
aSize2
=
ImplCalcFloatSize
(
this
,
nLines
);
else
aSize2
=
aSz
;
aSz
.
Height
()
=
nBorderY
+
nLineHeight
*
nLines
;
// line space when more than one line
if
(
mnWinStyle
&
WB_LINESPACING
)
aSz
.
Height
()
+=
(
nLines
-
1
)
*
TB_LINESPACING
;
if
(
eMode
==
FSMODE_FAVOURWIDTH
||
aCurrentSize
==
aSize2
)
return
aSize2
;
else
{
// set the size with the smallest delta as the current size
long
dx1
=
abs
(
mnDX
-
aSize1
.
Width
()
);
long
dy1
=
abs
(
mnDY
-
aSize1
.
Height
()
);
aSz
.
Width
()
=
nBorderX
+
maxX
;
long
dx2
=
abs
(
mnDX
-
aSize2
.
Width
()
);
long
dy2
=
abs
(
mnDY
-
aSize2
.
Height
()
);
// avoid clipping of any items
if
(
aSz
.
Width
()
<
aMinimalFloatSize
.
Width
()
)
aSize2
=
ImplCalcFloatSize
(
this
,
nLines
);
else
aSize2
=
aSz
;
if
(
aCurrentSize
==
aSize2
)
return
aSize2
;
// set the size with the smallest delta as the current size
long
dx1
=
abs
(
mnDX
-
aSize1
.
Width
()
);
long
dy1
=
abs
(
mnDY
-
aSize1
.
Height
()
);
long
dx2
=
abs
(
mnDX
-
aSize2
.
Width
()
);
long
dy2
=
abs
(
mnDY
-
aSize2
.
Height
()
);
if
(
dx1
*
dy1
<
dx2
*
dy2
)
aCurrentSize
=
aSize1
;
else
aCurrentSize
=
aSize2
;
if
(
dx1
*
dy1
<
dx2
*
dy2
)
aCurrentSize
=
aSize1
;
else
aCurrentSize
=
aSize2
;
}
}
return
aCurrentSize
;
}
...
...
@@ -2304,7 +2299,7 @@ void ToolBox::ImplFormat( sal_Bool bResize )
if
(
bResize
)
mnFloatLines
=
ImplCalcLines
(
this
,
mnDY
);
else
SetOutputSizePixel
(
ImplGetOptimalFloatingSize
(
FSMODE_AUTO
)
);
SetOutputSizePixel
(
ImplGetOptimalFloatingSize
()
);
}
// Horizontal
...
...
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