diff options
author | Tor Lillqvist <tml@collabora.com> | 2016-02-09 14:14:22 +0200 |
---|---|---|
committer | Tor Lillqvist <tml@collabora.com> | 2016-02-09 16:49:00 +0000 |
commit | 882d27fce20ee0537f785a619be1dd065ea6bbca (patch) | |
tree | 419ea0ed4e633b66698f15adc6f48a289ac5401b /framework | |
parent | 5b0f53f8f215062a131ec0498a72fb7619e5156d (diff) |
tdf#97435: Avoid persistent window state crack when headless
Change-Id: Icab7dea3cf63f3932b7759acec339b498a8ac9c5
Reviewed-on: https://gerrit.libreoffice.org/22233
Reviewed-by: Tor Lillqvist <tml@collabora.com>
Tested-by: Tor Lillqvist <tml@collabora.com>
Diffstat (limited to 'framework')
-rw-r--r-- | framework/source/helper/persistentwindowstate.cxx | 4 | ||||
-rw-r--r-- | framework/source/loadenv/loadenv.cxx | 6 |
2 files changed, 9 insertions, 1 deletions
diff --git a/framework/source/helper/persistentwindowstate.cxx b/framework/source/helper/persistentwindowstate.cxx index 12bf95d89a78..5cfd0435394d 100644 --- a/framework/source/helper/persistentwindowstate.cxx +++ b/framework/source/helper/persistentwindowstate.cxx @@ -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) 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::frame::XFrame > xFrame; bool bRestoreWindowState; diff --git a/framework/source/loadenv/loadenv.cxx b/framework/source/loadenv/loadenv.cxx index 323926a57973..5f2f95a2ba48 100644 --- a/framework/source/loadenv/loadenv.cxx +++ b/framework/source/loadenv/loadenv.cxx @@ -1724,7 +1724,11 @@ void LoadEnv::impl_applyPersistentWindowState(const css::uno::Reference< css::aw // and apply it on the window. // Do nothing, if no configuration entry exists! 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()) { // SOLAR SAFE -> |