Kaydet (Commit) 882d27fc authored tarafından Tor Lillqvist's avatar Tor Lillqvist

tdf#97435: Avoid persistent window state crack when headless

Change-Id: Icab7dea3cf63f3932b7759acec339b498a8ac9c5
Reviewed-on: https://gerrit.libreoffice.org/22233Reviewed-by: 's avatarTor Lillqvist <tml@collabora.com>
Tested-by: 's avatarTor Lillqvist <tml@collabora.com>
üst 5b0f53f8
...@@ -77,6 +77,10 @@ void SAL_CALL PersistentWindowState::initialize(const css::uno::Sequence< css::u ...@@ -77,6 +77,10 @@ void SAL_CALL PersistentWindowState::initialize(const css::uno::Sequence< css::u
void SAL_CALL PersistentWindowState::frameAction(const css::frame::FrameActionEvent& aEvent) void SAL_CALL PersistentWindowState::frameAction(const css::frame::FrameActionEvent& aEvent)
throw(css::uno::RuntimeException, std::exception) throw(css::uno::RuntimeException, std::exception)
{ {
// We don't want to do this stuff when in headless mode
if( Application::IsHeadlessModeEnabled() )
return;
css::uno::Reference< css::uno::XComponentContext > xContext; css::uno::Reference< css::uno::XComponentContext > xContext;
css::uno::Reference< css::frame::XFrame > xFrame; css::uno::Reference< css::frame::XFrame > xFrame;
bool bRestoreWindowState; bool bRestoreWindowState;
......
...@@ -1724,7 +1724,11 @@ void LoadEnv::impl_applyPersistentWindowState(const css::uno::Reference< css::aw ...@@ -1724,7 +1724,11 @@ void LoadEnv::impl_applyPersistentWindowState(const css::uno::Reference< css::aw
// and apply it on the window. // and apply it on the window.
// Do nothing, if no configuration entry exists! // Do nothing, if no configuration entry exists!
OUString sWindowState; OUString sWindowState;
::comphelper::ConfigurationHelper::readRelativeKey(xModuleCfg, sModule, OFFICEFACTORY_PROPNAME_ASCII_WINDOWATTRIBUTES) >>= sWindowState;
// Don't look for persistent window attributes in headless mode
if( !Application::IsHeadlessModeEnabled() )
comphelper::ConfigurationHelper::readRelativeKey(xModuleCfg, sModule, OFFICEFACTORY_PROPNAME_ASCII_WINDOWATTRIBUTES) >>= sWindowState;
if (!sWindowState.isEmpty()) if (!sWindowState.isEmpty())
{ {
// SOLAR SAFE -> // SOLAR SAFE ->
......
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