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
f7071325
Kaydet (Commit)
f7071325
authored
Ock 15, 2013
tarafından
Caolán McNamara
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
teach ValueSet to calc an optimal size
Change-Id: Ibb0eb8caf61a8310850f6b9889cdb1304c5be5e4
üst
356f6c5d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
36 additions
and
2 deletions
+36
-2
valueset.hxx
svtools/inc/svtools/valueset.hxx
+2
-1
valueset.cxx
svtools/source/control/valueset.cxx
+34
-1
No files found.
svtools/inc/svtools/valueset.hxx
Dosyayı görüntüle @
f7071325
...
...
@@ -301,6 +301,7 @@ public:
virtual
void
GetFocus
();
virtual
void
LoseFocus
();
virtual
void
Resize
();
virtual
Size
GetOptimalSize
()
const
;
virtual
void
RequestHelp
(
const
HelpEvent
&
rHEvt
);
virtual
void
StateChanged
(
StateChangedType
nStateChange
);
virtual
void
DataChanged
(
const
DataChangedEvent
&
rDCEvt
);
...
...
@@ -373,7 +374,7 @@ public:
Size
CalcWindowSizePixel
(
const
Size
&
rItemSize
,
sal_uInt16
nCalcCols
=
0
,
sal_uInt16
nCalcLines
=
0
);
sal_uInt16
nCalcLines
=
0
)
const
;
Size
CalcItemSizePixel
(
const
Size
&
rSize
,
bool
bOut
=
true
)
const
;
long
GetScrollWidth
()
const
;
...
...
svtools/source/control/valueset.cxx
Dosyayı görüntüle @
f7071325
...
...
@@ -1702,6 +1702,8 @@ void ValueSet::ImplInsertItem( ValueSetItem *const pItem, const size_t nPos )
mItemList
.
push_back
(
pItem
);
}
queue_resize
();
mbFormat
=
true
;
if
(
IsReallyVisible
()
&&
IsUpdateMode
()
)
Invalidate
();
...
...
@@ -1754,6 +1756,8 @@ void ValueSet::RemoveItem( sal_uInt16 nItemId )
mbNoSelection
=
true
;
}
queue_resize
();
mbFormat
=
true
;
if
(
IsReallyVisible
()
&&
IsUpdateMode
()
)
Invalidate
();
...
...
@@ -1841,6 +1845,7 @@ void ValueSet::SetColCount( sal_uInt16 nNewCols )
{
mnUserCols
=
nNewCols
;
mbFormat
=
true
;
queue_resize
();
if
(
IsReallyVisible
()
&&
IsUpdateMode
()
)
Invalidate
();
}
...
...
@@ -1854,6 +1859,7 @@ void ValueSet::SetLineCount( sal_uInt16 nNewLines )
{
mnUserVisLines
=
nNewLines
;
mbFormat
=
true
;
queue_resize
();
if
(
IsReallyVisible
()
&&
IsUpdateMode
()
)
Invalidate
();
}
...
...
@@ -1867,6 +1873,7 @@ void ValueSet::SetItemWidth( long nNewItemWidth )
{
mnUserItemWidth
=
nNewItemWidth
;
mbFormat
=
true
;
queue_resize
();
if
(
IsReallyVisible
()
&&
IsUpdateMode
()
)
Invalidate
();
}
...
...
@@ -1880,6 +1887,7 @@ void ValueSet::SetItemHeight( long nNewItemHeight )
{
mnUserItemHeight
=
nNewItemHeight
;
mbFormat
=
true
;
queue_resize
();
if
(
IsReallyVisible
()
&&
IsUpdateMode
()
)
Invalidate
();
}
...
...
@@ -2199,6 +2207,7 @@ void ValueSet::SetExtraSpacing( sal_uInt16 nNewSpacing )
mnSpacing
=
nNewSpacing
;
mbFormat
=
true
;
queue_resize
();
if
(
IsReallyVisible
()
&&
IsUpdateMode
()
)
Invalidate
();
}
...
...
@@ -2271,7 +2280,7 @@ bool ValueSet::StartDrag( const CommandEvent& rCEvt, Region& rRegion )
// -----------------------------------------------------------------------
Size
ValueSet
::
CalcWindowSizePixel
(
const
Size
&
rItemSize
,
sal_uInt16
nDesireCols
,
sal_uInt16
nDesireLines
)
sal_uInt16
nDesireLines
)
const
{
size_t
nCalcCols
=
nDesireCols
;
size_t
nCalcLines
=
nDesireLines
;
...
...
@@ -2397,4 +2406,28 @@ void ValueSet::SetHighlightHdl( const Link& rLink )
maHighlightHdl
=
rLink
;
}
Size
ValueSet
::
GetOptimalSize
()
const
{
Size
aLargestItemSize
;
for
(
size_t
i
=
0
,
n
=
mItemList
.
size
();
i
<
n
;
++
i
)
{
const
ValueSetItem
*
pItem
=
mItemList
[
i
];
if
(
!
pItem
->
mbVisible
)
continue
;
if
(
pItem
->
meType
!=
VALUESETITEM_IMAGE
)
{
//handle determining an optimal size for this case
continue
;
}
Size
aImageSize
=
pItem
->
maImage
.
GetSizePixel
();
aLargestItemSize
.
Width
()
=
std
::
max
(
aLargestItemSize
.
Width
(),
aImageSize
.
Width
());
aLargestItemSize
.
Height
()
=
std
::
max
(
aLargestItemSize
.
Height
(),
aImageSize
.
Height
());
}
return
CalcWindowSizePixel
(
aLargestItemSize
);
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
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