summaryrefslogtreecommitdiff
path: root/vcl/source/window/window2.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'vcl/source/window/window2.cxx')
-rw-r--r--vcl/source/window/window2.cxx36
1 files changed, 33 insertions, 3 deletions
diff --git a/vcl/source/window/window2.cxx b/vcl/source/window/window2.cxx
index 5bd02d99b531..4c0b3309cc10 100644
--- a/vcl/source/window/window2.cxx
+++ b/vcl/source/window/window2.cxx
@@ -2037,6 +2037,26 @@ bool Window::set_property(const rtl::OString &rKey, const rtl::OString &rValue)
set_margin_top(rValue.toInt32());
else if (rKey.equalsL(RTL_CONSTASCII_STRINGPARAM("margin-bottom")))
set_margin_bottom(rValue.toInt32());
+ else if (rKey.equalsL(RTL_CONSTASCII_STRINGPARAM("hscrollbar-policy")))
+ {
+ WinBits nBits = GetStyle();
+ nBits &= ~(WB_AUTOHSCROLL|WB_HSCROLL);
+ if (rValue == "always")
+ nBits |= WB_HSCROLL;
+ else if (rValue == "automatic")
+ nBits |= WB_AUTOHSCROLL;
+ SetStyle(nBits);
+ }
+ else if (rKey.equalsL(RTL_CONSTASCII_STRINGPARAM("vscrollbar-policy")))
+ {
+ WinBits nBits = GetStyle();
+ nBits &= ~(WB_AUTOVSCROLL|WB_VSCROLL);
+ if (rValue == "always")
+ nBits |= WB_VSCROLL;
+ else if (rValue == "automatic")
+ nBits |= WB_AUTOVSCROLL;
+ SetStyle(nBits);
+ }
else
{
SAL_INFO("vcl.layout", "unhandled property: " << rKey.getStr());
@@ -2073,9 +2093,7 @@ void Window::set_width_request(sal_Int32 nWidthRequest)
Size Window::get_preferred_size() const
{
- WindowImpl *pWindowImpl = mpWindowImpl->mpBorderWindow ? mpWindowImpl->mpBorderWindow->mpWindowImpl : mpWindowImpl;
-
- Size aRet(pWindowImpl->mnWidthRequest, pWindowImpl->mnHeightRequest);
+ Size aRet(get_width_request(), get_height_request());
if (aRet.Width() == -1 || aRet.Height() == -1)
{
Size aOptimal = GetOptimalSize(WINDOWSIZE_PREFERRED);
@@ -2291,4 +2309,16 @@ sal_Int32 Window::get_margin_bottom() const
return pWindowImpl->mnMarginBottom;
}
+sal_Int32 Window::get_height_request() const
+{
+ WindowImpl *pWindowImpl = mpWindowImpl->mpBorderWindow ? mpWindowImpl->mpBorderWindow->mpWindowImpl : mpWindowImpl;
+ return pWindowImpl->mnHeightRequest;
+}
+
+sal_Int32 Window::get_width_request() const
+{
+ WindowImpl *pWindowImpl = mpWindowImpl->mpBorderWindow ? mpWindowImpl->mpBorderWindow->mpWindowImpl : mpWindowImpl;
+ return pWindowImpl->mnWidthRequest;
+}
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */