diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2022-09-04 08:50:45 +0300 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2022-09-04 10:41:33 +0200 |
commit | f0fbf30a9c9dab41fce10f3ad4bfc83434122c70 (patch) | |
tree | 8bfb027b8678baac52880b23e0554565ce5f54c4 /framework | |
parent | 25436ac4de0e08c41463fe0239f2614453d3057f (diff) |
Some refactor
Change-Id: I5b87f9298bfeec70848654eacf5086803c19080a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139354
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'framework')
-rw-r--r-- | framework/source/loadenv/loadenv.cxx | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/framework/source/loadenv/loadenv.cxx b/framework/source/loadenv/loadenv.cxx index 76116ad98ed7..f8d0176b6276 100644 --- a/framework/source/loadenv/loadenv.cxx +++ b/framework/source/loadenv/loadenv.cxx @@ -1691,19 +1691,19 @@ void LoadEnv::impl_makeFrameWindowVisible(const css::uno::Reference< css::awt::X if ( !pWindow ) return; - bool const preview( m_lMediaDescriptor.getUnpackedValueOrDefault( - utl::MediaDescriptor::PROP_PREVIEW, false) ); - - bool bForceFrontAndFocus(false); - if ( !preview ) + if (!bForceToFront) { - bForceFrontAndFocus = officecfg::Office::Common::View::NewDocumentHandling::ForceFocusAndToFront::get(); + bool const preview(m_lMediaDescriptor.getUnpackedValueOrDefault( + utl::MediaDescriptor::PROP_PREVIEW, false)); + bForceToFront + = !preview + && officecfg::Office::Common::View::NewDocumentHandling::ForceFocusAndToFront::get(); } - if( pWindow->IsVisible() && (bForceFrontAndFocus || bForceToFront) ) + if (pWindow->IsVisible() && bForceToFront) pWindow->ToTop( ToTopFlags::RestoreWhenMin | ToTopFlags::ForegroundTask ); else - pWindow->Show(true, (bForceFrontAndFocus || bForceToFront) ? ShowFlags::ForegroundTask : ShowFlags::NONE ); + pWindow->Show(true, bForceToFront ? ShowFlags::ForegroundTask : ShowFlags::NONE); } void LoadEnv::impl_applyPersistentWindowState(const css::uno::Reference< css::awt::XWindow >& xWindow) |