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
7dda48d5
Kaydet (Commit)
7dda48d5
authored
Tem 01, 2014
tarafından
Caolán McNamara
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Related: fdo#80633 cache optimal size
Change-Id: Ic2c3aefebd3061d294f339c6d262a3c3e381fbe4
üst
8f7f2dc7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
55 additions
and
28 deletions
+55
-28
window.hxx
include/vcl/window.hxx
+27
-11
SidebarPanelBase.cxx
sfx2/source/sidebar/SidebarPanelBase.cxx
+2
-2
vclxwindow.cxx
toolkit/source/awt/vclxwindow.cxx
+1
-1
window.h
vcl/inc/window.h
+2
-0
tabdlg.cxx
vcl/source/window/tabdlg.cxx
+2
-2
window.cxx
vcl/source/window/window.cxx
+2
-0
window2.cxx
vcl/source/window/window2.cxx
+19
-12
No files found.
include/vcl/window.hxx
Dosyayı görüntüle @
7dda48d5
...
@@ -1127,6 +1127,19 @@ protected:
...
@@ -1127,6 +1127,19 @@ protected:
virtual
sal_uInt16
getDefaultAccessibleRole
()
const
;
virtual
sal_uInt16
getDefaultAccessibleRole
()
const
;
virtual
OUString
getDefaultAccessibleName
()
const
;
virtual
OUString
getDefaultAccessibleName
()
const
;
/*
* Advisory Sizing - what is a good size for this widget
*
* Retrieves the preferred size of a widget ignoring
* "width-request" and "height-request" properties.
*
* Implement this in sub-classes to tell layout
* the preferred widget size.
*
* Use get_preferred_size to retrieve this value
* mediated via height and width requests
*/
virtual
Size
GetOptimalSize
()
const
;
private
:
private
:
SAL_DLLPRIVATE
bool
ImplIsAccessibleCandidate
()
const
;
SAL_DLLPRIVATE
bool
ImplIsAccessibleCandidate
()
const
;
...
@@ -1137,6 +1150,20 @@ private:
...
@@ -1137,6 +1150,20 @@ private:
SAL_DLLPRIVATE
void
ImplRevokeAccessibleNativeFrame
();
SAL_DLLPRIVATE
void
ImplRevokeAccessibleNativeFrame
();
///@}
///@}
/*
* Retrieves the preferred size of a widget taking
* into account the "width-request" and "height-request" properties.
*
* Overrides the result of GetOptimalSize to honor the
* width-request and height-request properties.
*
* So the same as get_ungrouped_preferred_size except
* it ignores groups. A building block of get_preferred_size
* that access the size cache
*
* @see get_preferred_size
*/
Size
get_ungrouped_preferred_size
()
const
;
public
:
public
:
/// request XCanvas render interface for this window
/// request XCanvas render interface for this window
::
com
::
sun
::
star
::
uno
::
Reference
<
::
com
::
sun
::
star
::
rendering
::
XCanvas
>
::
com
::
sun
::
star
::
uno
::
Reference
<
::
com
::
sun
::
star
::
rendering
::
XCanvas
>
...
@@ -1167,17 +1194,6 @@ public:
...
@@ -1167,17 +1194,6 @@ public:
virtual
::
com
::
sun
::
star
::
uno
::
Reference
<
::
com
::
sun
::
star
::
datatransfer
::
clipboard
::
XClipboard
>
GetClipboard
();
virtual
::
com
::
sun
::
star
::
uno
::
Reference
<
::
com
::
sun
::
star
::
datatransfer
::
clipboard
::
XClipboard
>
GetClipboard
();
virtual
::
com
::
sun
::
star
::
uno
::
Reference
<
::
com
::
sun
::
star
::
datatransfer
::
clipboard
::
XClipboard
>
GetPrimarySelection
();
virtual
::
com
::
sun
::
star
::
uno
::
Reference
<
::
com
::
sun
::
star
::
datatransfer
::
clipboard
::
XClipboard
>
GetPrimarySelection
();
/*
* Advisory Sizing - what is a good size for this widget
*
* Retrieves the preferred size of a widget ignoring
* "width-request" and "height-request" properties.
*
* Implement this in sub-classes to tell layout
* the preferred widget size.
*/
virtual
Size
GetOptimalSize
()
const
;
/*
/*
* Widgets call this to inform their owner container that the widget wants
* Widgets call this to inform their owner container that the widget wants
* to renegotiate its size. Should be called when a widget has a new size
* to renegotiate its size. Should be called when a widget has a new size
...
...
sfx2/source/sidebar/SidebarPanelBase.cxx
Dosyayı görüntüle @
7dda48d5
...
@@ -218,7 +218,7 @@ ui::LayoutSize SAL_CALL SidebarPanelBase::getHeightForWidth (const sal_Int32 nWi
...
@@ -218,7 +218,7 @@ ui::LayoutSize SAL_CALL SidebarPanelBase::getHeightForWidth (const sal_Int32 nWi
if
(
isLayoutEnabled
(
mpControl
))
if
(
isLayoutEnabled
(
mpControl
))
{
{
// widget layout-based sidebar
// widget layout-based sidebar
Size
aSize
(
mpControl
->
GetOptimalS
ize
());
Size
aSize
(
mpControl
->
get_preferred_s
ize
());
return
ui
::
LayoutSize
(
aSize
.
Height
(),
aSize
.
Height
(),
aSize
.
Height
());
return
ui
::
LayoutSize
(
aSize
.
Height
(),
aSize
.
Height
(),
aSize
.
Height
());
}
}
else
if
(
pLayoutableWindow
!=
NULL
)
else
if
(
pLayoutableWindow
!=
NULL
)
...
@@ -238,7 +238,7 @@ sal_Int32 SAL_CALL SidebarPanelBase::getMinimalWidth () throw(cssu::RuntimeExcep
...
@@ -238,7 +238,7 @@ sal_Int32 SAL_CALL SidebarPanelBase::getMinimalWidth () throw(cssu::RuntimeExcep
if
(
isLayoutEnabled
(
mpControl
))
if
(
isLayoutEnabled
(
mpControl
))
{
{
// widget layout-based sidebar
// widget layout-based sidebar
Size
aSize
(
mpControl
->
GetOptimalS
ize
());
Size
aSize
(
mpControl
->
get_preferred_s
ize
());
return
aSize
.
Width
();
return
aSize
.
Width
();
}
}
return
0
;
return
0
;
...
...
toolkit/source/awt/vclxwindow.cxx
Dosyayı görüntüle @
7dda48d5
...
@@ -2167,7 +2167,7 @@ void VCLXWindow::setProperty( const OUString& PropertyName, const ::com::sun::st
...
@@ -2167,7 +2167,7 @@ void VCLXWindow::setProperty( const OUString& PropertyName, const ::com::sun::st
case
WINDOW_SCROLLBARBOX
:
case
WINDOW_SCROLLBARBOX
:
return
VCLXScrollBar
::
implGetMinimumSize
(
GetWindow
()
);
return
VCLXScrollBar
::
implGetMinimumSize
(
GetWindow
()
);
default
:
default
:
aSz
=
GetWindow
()
->
GetOptimalS
ize
();
aSz
=
GetWindow
()
->
get_preferred_s
ize
();
}
}
}
}
...
...
vcl/inc/window.h
Dosyayı görüntüle @
7dda48d5
...
@@ -242,6 +242,8 @@ public:
...
@@ -242,6 +242,8 @@ public:
sal_Int32
mnBottomBorder
;
sal_Int32
mnBottomBorder
;
sal_Int32
mnWidthRequest
;
sal_Int32
mnWidthRequest
;
sal_Int32
mnHeightRequest
;
sal_Int32
mnHeightRequest
;
sal_Int32
mnOptimalWidthCache
;
sal_Int32
mnOptimalHeightCache
;
long
mnX
;
long
mnX
;
long
mnY
;
long
mnY
;
long
mnAbsScreenX
;
long
mnAbsScreenX
;
...
...
vcl/source/window/tabdlg.cxx
Dosyayı görüntüle @
7dda48d5
...
@@ -50,7 +50,7 @@ void TabDialog::ImplPosControls()
...
@@ -50,7 +50,7 @@ void TabDialog::ImplPosControls()
pTabControl
=
pChild
;
pTabControl
=
pChild
;
else
if
(
pTabControl
)
else
if
(
pTabControl
)
{
{
Size
aOptimalSize
(
pChild
->
GetOptimalS
ize
());
Size
aOptimalSize
(
pChild
->
get_preferred_s
ize
());
long
nTxtWidth
=
aOptimalSize
.
Width
();
long
nTxtWidth
=
aOptimalSize
.
Width
();
if
(
nTxtWidth
>
aCtrlSize
.
Width
()
)
if
(
nTxtWidth
>
aCtrlSize
.
Width
()
)
aCtrlSize
.
Width
()
=
nTxtWidth
;
aCtrlSize
.
Width
()
=
nTxtWidth
;
...
@@ -80,7 +80,7 @@ void TabDialog::ImplPosControls()
...
@@ -80,7 +80,7 @@ void TabDialog::ImplPosControls()
Point
aTabOffset
(
IMPL_DIALOG_OFFSET
,
IMPL_DIALOG_OFFSET
+
nOffY
);
Point
aTabOffset
(
IMPL_DIALOG_OFFSET
,
IMPL_DIALOG_OFFSET
+
nOffY
);
if
(
isContainerWindow
(
*
pTabControl
))
if
(
isContainerWindow
(
*
pTabControl
))
pTabControl
->
SetSizePixel
(
pTabControl
->
GetOptimalS
ize
());
pTabControl
->
SetSizePixel
(
pTabControl
->
get_preferred_s
ize
());
Size
aTabSize
=
pTabControl
->
GetSizePixel
();
Size
aTabSize
=
pTabControl
->
GetSizePixel
();
...
...
vcl/source/window/window.cxx
Dosyayı görüntüle @
7dda48d5
...
@@ -608,6 +608,8 @@ WindowImpl::WindowImpl( WindowType nType )
...
@@ -608,6 +608,8 @@ WindowImpl::WindowImpl( WindowType nType )
mnBottomBorder
=
0
;
// bottom border
mnBottomBorder
=
0
;
// bottom border
mnWidthRequest
=
-
1
;
// width request
mnWidthRequest
=
-
1
;
// width request
mnHeightRequest
=
-
1
;
// height request
mnHeightRequest
=
-
1
;
// height request
mnOptimalWidthCache
=
-
1
;
// optimal width cache
mnOptimalHeightCache
=
-
1
;
// optimal height cache
mnX
=
0
;
// X-Position to Parent
mnX
=
0
;
// X-Position to Parent
mnY
=
0
;
// Y-Position to Parent
mnY
=
0
;
// Y-Position to Parent
mnAbsScreenX
=
0
;
// absolute X-position on screen, used for RTL window positioning
mnAbsScreenX
=
0
;
// absolute X-position on screen, used for RTL window positioning
...
...
vcl/source/window/window2.cxx
Dosyayı görüntüle @
7dda48d5
...
@@ -1428,6 +1428,8 @@ void Window::queue_resize()
...
@@ -1428,6 +1428,8 @@ void Window::queue_resize()
bool
bSomeoneCares
=
queue_ungrouped_resize
(
this
);
bool
bSomeoneCares
=
queue_ungrouped_resize
(
this
);
WindowImpl
*
pWindowImpl
=
mpWindowImpl
->
mpBorderWindow
?
mpWindowImpl
->
mpBorderWindow
->
mpWindowImpl
:
mpWindowImpl
;
WindowImpl
*
pWindowImpl
=
mpWindowImpl
->
mpBorderWindow
?
mpWindowImpl
->
mpBorderWindow
->
mpWindowImpl
:
mpWindowImpl
;
pWindowImpl
->
mnOptimalWidthCache
=
-
1
;
pWindowImpl
->
mnOptimalHeightCache
=
-
1
;
if
(
pWindowImpl
->
m_xSizeGroup
&&
pWindowImpl
->
m_xSizeGroup
->
get_mode
()
!=
VCL_SIZE_GROUP_NONE
)
if
(
pWindowImpl
->
m_xSizeGroup
&&
pWindowImpl
->
m_xSizeGroup
->
get_mode
()
!=
VCL_SIZE_GROUP_NONE
)
{
{
std
::
set
<
Window
*>
&
rWindows
=
pWindowImpl
->
m_xSizeGroup
->
get_widgets
();
std
::
set
<
Window
*>
&
rWindows
=
pWindowImpl
->
m_xSizeGroup
->
get_widgets
();
...
@@ -1689,26 +1691,31 @@ void Window::set_width_request(sal_Int32 nWidthRequest)
...
@@ -1689,26 +1691,31 @@ void Window::set_width_request(sal_Int32 nWidthRequest)
}
}
}
}
namespace
Size
Window
::
get_ungrouped_preferred_size
()
const
{
{
Size
get_ungrouped_preferred_size
(
const
Window
&
rWindow
)
Size
aRet
(
get_width_request
(),
get_height_request
());
if
(
aRet
.
Width
()
==
-
1
||
aRet
.
Height
()
==
-
1
)
{
{
Size
aRet
(
rWindow
.
get_width_request
(),
rWindow
.
get_height_request
());
//cache gets blown away by queue_resize
if
(
aRet
.
Width
()
==
-
1
||
aRet
.
Height
()
==
-
1
)
WindowImpl
*
pWindowImpl
=
mpWindowImpl
->
mpBorderWindow
?
mpWindowImpl
->
mpBorderWindow
->
mpWindowImpl
:
mpWindowImpl
;
if
(
pWindowImpl
->
mnOptimalWidthCache
==
-
1
||
pWindowImpl
->
mnOptimalHeightCache
==
-
1
)
{
{
Size
aOptimal
=
rWindow
.
GetOptimalSize
();
Size
aOptimal
(
GetOptimalSize
());
if
(
aRet
.
Width
()
==
-
1
)
pWindowImpl
->
mnOptimalWidthCache
=
aOptimal
.
Width
();
aRet
.
Width
()
=
aOptimal
.
Width
();
pWindowImpl
->
mnOptimalHeightCache
=
aOptimal
.
Height
();
if
(
aRet
.
Height
()
==
-
1
)
aRet
.
Height
()
=
aOptimal
.
Height
();
}
}
return
aRet
;
if
(
aRet
.
Width
()
==
-
1
)
aRet
.
Width
()
=
pWindowImpl
->
mnOptimalWidthCache
;
if
(
aRet
.
Height
()
==
-
1
)
aRet
.
Height
()
=
pWindowImpl
->
mnOptimalHeightCache
;
}
}
return
aRet
;
}
}
Size
Window
::
get_preferred_size
()
const
Size
Window
::
get_preferred_size
()
const
{
{
Size
aRet
(
get_ungrouped_preferred_size
(
*
this
));
Size
aRet
(
get_ungrouped_preferred_size
());
WindowImpl
*
pWindowImpl
=
mpWindowImpl
->
mpBorderWindow
?
mpWindowImpl
->
mpBorderWindow
->
mpWindowImpl
:
mpWindowImpl
;
WindowImpl
*
pWindowImpl
=
mpWindowImpl
->
mpBorderWindow
?
mpWindowImpl
->
mpBorderWindow
->
mpWindowImpl
:
mpWindowImpl
;
if
(
pWindowImpl
->
m_xSizeGroup
)
if
(
pWindowImpl
->
m_xSizeGroup
)
...
@@ -1726,7 +1733,7 @@ Size Window::get_preferred_size() const
...
@@ -1726,7 +1733,7 @@ Size Window::get_preferred_size() const
continue
;
continue
;
if
(
bIgnoreInHidden
&&
!
pOther
->
IsVisible
())
if
(
bIgnoreInHidden
&&
!
pOther
->
IsVisible
())
continue
;
continue
;
Size
aOtherSize
=
get_ungrouped_preferred_size
(
*
pOther
);
Size
aOtherSize
=
pOther
->
get_ungrouped_preferred_size
(
);
if
(
eMode
==
VCL_SIZE_GROUP_BOTH
||
eMode
==
VCL_SIZE_GROUP_HORIZONTAL
)
if
(
eMode
==
VCL_SIZE_GROUP_BOTH
||
eMode
==
VCL_SIZE_GROUP_HORIZONTAL
)
aRet
.
Width
()
=
std
::
max
(
aRet
.
Width
(),
aOtherSize
.
Width
());
aRet
.
Width
()
=
std
::
max
(
aRet
.
Width
(),
aOtherSize
.
Width
());
if
(
eMode
==
VCL_SIZE_GROUP_BOTH
||
eMode
==
VCL_SIZE_GROUP_VERTICAL
)
if
(
eMode
==
VCL_SIZE_GROUP_BOTH
||
eMode
==
VCL_SIZE_GROUP_VERTICAL
)
...
...
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