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

but the PanelLayout didn't

Change-Id: I38a8975f1488fa2a2ffe91b66745e1a1c6c48a28
This commit is contained in:
Caolán McNamara
2015-04-09 14:43:09 +01:00
parent 2355a34585
commit b39a6449d5
5 changed files with 16 additions and 10 deletions

View File

@@ -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;

View File

@@ -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();
} }

View File

@@ -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();
} }

View File

@@ -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();
} }

View File

@@ -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();