diff options
author | Caolán McNamara <caolanm@redhat.com> | 2018-05-18 13:20:07 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2018-05-21 21:40:03 +0200 |
commit | 52eb2804bb4403e74483ee49bfcb4539065d7143 (patch) | |
tree | 772c2adba0f2049e3a7b981e7a918148749ccb22 /vcl | |
parent | 2632adfbc2a664ab99de7e24d6fcd6841a10b6f1 (diff) |
weld ScSortDlg, ScTabPageSortOptions and ScTabPageSortFields
Change-Id: I103e5e3670f8c95c1f480ce0c36e08c3de74e900
Reviewed-on: https://gerrit.libreoffice.org/54541
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/source/app/salvtables.cxx | 34 | ||||
-rw-r--r-- | vcl/source/control/combobox.cxx | 11 | ||||
-rw-r--r-- | vcl/source/window/layout.cxx | 8 | ||||
-rw-r--r-- | vcl/unx/gtk3/gtk3gtkinst.cxx | 12 |
4 files changed, 61 insertions, 4 deletions
diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx index 89a03c187d7e..154e1adb420f 100644 --- a/vcl/source/app/salvtables.cxx +++ b/vcl/source/app/salvtables.cxx @@ -714,6 +714,8 @@ class SalInstanceScrolledWindow : public SalInstanceContainer, public virtual we { private: VclPtr<VclScrolledWindow> m_xScrolledWindow; + Link<ScrollBar*,void> m_aOrigVScrollHdl; + bool m_bUserManagedScrolling; DECL_LINK(VscrollHdl, ScrollBar*, void); @@ -721,8 +723,10 @@ public: SalInstanceScrolledWindow(VclScrolledWindow* pScrolledWindow, bool bTakeOwnership) : SalInstanceContainer(pScrolledWindow, bTakeOwnership) , m_xScrolledWindow(pScrolledWindow) + , m_bUserManagedScrolling(false) { ScrollBar& rVertScrollBar = m_xScrolledWindow->getVertScrollBar(); + m_aOrigVScrollHdl = rVertScrollBar.GetScrollHdl(); rVertScrollBar.SetScrollHdl(LINK(this, SalInstanceScrolledWindow, VscrollHdl)); } @@ -749,23 +753,40 @@ public: { ScrollBar& rVertScrollBar = m_xScrolledWindow->getVertScrollBar(); rVertScrollBar.SetThumbPos(value); + if (!m_bUserManagedScrolling) + m_aOrigVScrollHdl.Call(&rVertScrollBar); + } + + virtual int vadjustment_get_upper() const override + { + ScrollBar& rVertScrollBar = m_xScrolledWindow->getVertScrollBar(); + return rVertScrollBar.GetRangeMax(); + } + + virtual void vadjustment_set_upper(int upper) override + { + ScrollBar& rVertScrollBar = m_xScrolledWindow->getVertScrollBar(); + rVertScrollBar.SetRangeMax(upper); } virtual void set_user_managed_scrolling() override { + m_bUserManagedScrolling = true; m_xScrolledWindow->setUserManagedScrolling(true); } virtual ~SalInstanceScrolledWindow() override { ScrollBar& rVertScrollBar = m_xScrolledWindow->getVertScrollBar(); - rVertScrollBar.SetScrollHdl(Link<ScrollBar*, void>()); + rVertScrollBar.SetScrollHdl(m_aOrigVScrollHdl); } }; IMPL_LINK_NOARG(SalInstanceScrolledWindow, VscrollHdl, ScrollBar*, void) { signal_vadjustment_changed(); + if (!m_bUserManagedScrolling) + m_aOrigVScrollHdl.Call(&m_xScrolledWindow->getVertScrollBar()); } class SalInstanceNotebook : public SalInstanceContainer, public virtual weld::Notebook @@ -2143,7 +2164,14 @@ public: virtual weld::Frame* weld_frame(const OString &id, bool bTakeOwnership) override { VclFrame* pFrame = m_xBuilder->get<VclFrame>(id); - return pFrame ? new SalInstanceFrame(pFrame, bTakeOwnership) : nullptr; + weld::Frame* pRet = pFrame ? new SalInstanceFrame(pFrame, false) : nullptr; + if (bTakeOwnership && pFrame) + { + assert(!m_aOwnedToplevel && "only one toplevel per .ui allowed"); + m_aOwnedToplevel.set(pFrame); + m_xBuilder->drop_ownership(pFrame); + } + return pRet; } virtual weld::ScrolledWindow* weld_scrolled_window(const OString &id, bool bTakeOwnership) override @@ -2274,6 +2302,8 @@ public: { if (VclBuilderContainer* pOwnedToplevel = dynamic_cast<VclBuilderContainer*>(m_aOwnedToplevel.get())) pOwnedToplevel->m_pUIBuilder = std::move(m_xBuilder); + else + m_xBuilder.reset(); m_aOwnedToplevel.disposeAndClear(); } }; diff --git a/vcl/source/control/combobox.cxx b/vcl/source/control/combobox.cxx index d54c628df8a3..4508d34022fc 100644 --- a/vcl/source/control/combobox.cxx +++ b/vcl/source/control/combobox.cxx @@ -917,6 +917,8 @@ void ComboBox::RemoveEntryAt(sal_Int32 const nPos) void ComboBox::Clear() { + if (!m_pImpl->m_pImplLB) + return; m_pImpl->m_pImplLB->Clear(); CallEventListeners( VclEventId::ComboboxItemRemoved, reinterpret_cast<void*>(-1) ); } @@ -955,6 +957,8 @@ OUString ComboBox::GetEntry( sal_Int32 nPos ) const sal_Int32 ComboBox::GetEntryCount() const { + if (!m_pImpl->m_pImplLB) + return 0; return m_pImpl->m_pImplLB->GetEntryList()->GetEntryCount() - m_pImpl->m_pImplLB->GetEntryList()->GetMRUCount(); } @@ -987,7 +991,12 @@ void ComboBox::SetDoubleClickHdl(const Link<ComboBox&,void>& rLink) { m_pImpl->m const Link<ComboBox&,void>& ComboBox::GetDoubleClickHdl() const { return m_pImpl->m_DoubleClickHdl; } -void ComboBox::SetEntryActivateHdl(const Link<Edit&,void>& rLink) { m_pImpl->m_pSubEdit->SetActivateHdl(rLink); } +void ComboBox::SetEntryActivateHdl(const Link<Edit&,void>& rLink) +{ + if (!m_pImpl->m_pSubEdit) + return; + m_pImpl->m_pSubEdit->SetActivateHdl(rLink); +} long ComboBox::CalcWindowSizePixel(sal_uInt16 nLines) const { diff --git a/vcl/source/window/layout.cxx b/vcl/source/window/layout.cxx index 8f8e82975b25..9d9e05325ddf 100644 --- a/vcl/source/window/layout.cxx +++ b/vcl/source/window/layout.cxx @@ -2041,7 +2041,13 @@ void VclViewport::setAllocation(const Size &rAllocation) Size aReq(getLayoutRequisition(*pChild)); aReq.setWidth( std::max(aReq.Width(), rAllocation.Width()) ); aReq.setHeight( std::max(aReq.Height(), rAllocation.Height()) ); - setLayoutAllocation(*pChild, Point(0, 0), aReq); + Point aKeepPos(pChild->GetPosPixel()); + if (m_bInitialAllocation) + { + aKeepPos = Point(0, 0); + m_bInitialAllocation = false; + } + setLayoutAllocation(*pChild, aKeepPos, aReq); } } diff --git a/vcl/unx/gtk3/gtk3gtkinst.cxx b/vcl/unx/gtk3/gtk3gtkinst.cxx index b882d68a6798..e558ccd37ceb 100644 --- a/vcl/unx/gtk3/gtk3gtkinst.cxx +++ b/vcl/unx/gtk3/gtk3gtkinst.cxx @@ -2314,6 +2314,18 @@ public: enable_notify_events(); } + virtual int vadjustment_get_upper() const override + { + return gtk_adjustment_get_upper(m_pVAdjustment); + } + + virtual void vadjustment_set_upper(int upper) override + { + disable_notify_events(); + gtk_adjustment_set_upper(m_pVAdjustment, upper); + enable_notify_events(); + } + virtual void set_user_managed_scrolling() override { disable_notify_events(); |