Kaydet (Commit) b39a6449 authored tarafından Caolán McNamara's avatar Caolán McNamara

Resolves: tdf#90384 queue_resize needs to Invalidate the optimal cache size

but the PanelLayout didn't

Change-Id: I38a8975f1488fa2a2ffe91b66745e1a1c6c48a28
üst 2355a345
...@@ -1192,9 +1192,11 @@ protected: ...@@ -1192,9 +1192,11 @@ protected:
* the preferred widget size. * the preferred widget size.
* *
* Use get_preferred_size to retrieve this value * Use get_preferred_size to retrieve this value
* mediated via height and width requests * cached and mediated via height and width requests
*/ */
virtual Size GetOptimalSize() const; virtual Size GetOptimalSize() const;
/// clear OptimalSize cache
void InvalidateSizeCache();
private: private:
SAL_DLLPRIVATE bool ImplIsAccessibleCandidate() const; SAL_DLLPRIVATE bool ImplIsAccessibleCandidate() const;
......
...@@ -51,6 +51,7 @@ void PanelLayout::queue_resize(StateChangedType /*eReason*/) ...@@ -51,6 +51,7 @@ void PanelLayout::queue_resize(StateChangedType /*eReason*/)
return; return;
if (!isLayoutEnabled(this)) if (!isLayoutEnabled(this))
return; return;
InvalidateSizeCache();
m_aPanelLayoutIdle.Start(); m_aPanelLayoutIdle.Start();
} }
......
...@@ -1114,9 +1114,7 @@ void DockingWindow::queue_resize(StateChangedType /*eReason*/) ...@@ -1114,9 +1114,7 @@ void DockingWindow::queue_resize(StateChangedType /*eReason*/)
return; return;
if (!isLayoutEnabled()) if (!isLayoutEnabled())
return; return;
WindowImpl *pWindowImpl = mpWindowImpl->mpBorderWindow ? mpWindowImpl->mpBorderWindow->mpWindowImpl : mpWindowImpl; InvalidateSizeCache();
pWindowImpl->mnOptimalWidthCache = -1;
pWindowImpl->mnOptimalHeightCache = -1;
maLayoutIdle.Start(); maLayoutIdle.Start();
} }
......
...@@ -997,9 +997,7 @@ void SystemWindow::queue_resize(StateChangedType /*eReason*/) ...@@ -997,9 +997,7 @@ void SystemWindow::queue_resize(StateChangedType /*eReason*/)
return; return;
if (!isLayoutEnabled()) if (!isLayoutEnabled())
return; return;
WindowImpl *pWindowImpl = mpWindowImpl->mpBorderWindow ? mpWindowImpl->mpBorderWindow->mpWindowImpl : mpWindowImpl; InvalidateSizeCache();
pWindowImpl->mnOptimalWidthCache = -1;
pWindowImpl->mnOptimalHeightCache = -1;
maLayoutIdle.Start(); maLayoutIdle.Start();
} }
......
...@@ -1427,16 +1427,23 @@ namespace ...@@ -1427,16 +1427,23 @@ namespace
} }
} }
void Window::InvalidateSizeCache()
{
WindowImpl *pWindowImpl = mpWindowImpl->mpBorderWindow ? mpWindowImpl->mpBorderWindow->mpWindowImpl : mpWindowImpl;
pWindowImpl->mnOptimalWidthCache = -1;
pWindowImpl->mnOptimalHeightCache = -1;
}
void Window::queue_resize(StateChangedType eReason) void Window::queue_resize(StateChangedType eReason)
{ {
bool bSomeoneCares = queue_ungrouped_resize(this); bool bSomeoneCares = queue_ungrouped_resize(this);
WindowImpl *pWindowImpl = mpWindowImpl->mpBorderWindow ? mpWindowImpl->mpBorderWindow->mpWindowImpl : mpWindowImpl;
if (eReason != StateChangedType::VISIBLE) if (eReason != StateChangedType::VISIBLE)
{ {
pWindowImpl->mnOptimalWidthCache = -1; InvalidateSizeCache();
pWindowImpl->mnOptimalHeightCache = -1;
} }
WindowImpl *pWindowImpl = mpWindowImpl->mpBorderWindow ? mpWindowImpl->mpBorderWindow->mpWindowImpl : mpWindowImpl;
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<vcl::Window*> &rWindows = pWindowImpl->m_xSizeGroup->get_widgets(); std::set<vcl::Window*> &rWindows = pWindowImpl->m_xSizeGroup->get_widgets();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment