summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTor Lillqvist <tml@collabora.com>2016-02-09 14:14:22 +0200
committerTor Lillqvist <tml@collabora.com>2016-02-10 11:50:54 +0200
commit9ffa0477c32843106da546adf58b2e2ddb565045 (patch)
tree03b5e6f1130a4d72a6beb76cf825359d74e7a418
parentc5526f986d79130bad36fa6d9ffd25331114403c (diff)
tdf#97435: Avoid persistent window state crack when used from LibreOfficeKit
Change-Id: Icab7dea3cf63f3932b7759acec339b498a8ac9c5 Reviewed-on: https://gerrit.libreoffice.org/22233 Reviewed-by: Tor Lillqvist <tml@collabora.com> Tested-by: Tor Lillqvist <tml@collabora.com>
-rw-r--r--framework/source/helper/persistentwindowstate.cxx5
-rw-r--r--framework/source/loadenv/loadenv.cxx7
2 files changed, 11 insertions, 1 deletions
diff --git a/framework/source/helper/persistentwindowstate.cxx b/framework/source/helper/persistentwindowstate.cxx
index ea253438079f..8853e0a4f265 100644
--- a/framework/source/helper/persistentwindowstate.cxx
+++ b/framework/source/helper/persistentwindowstate.cxx
@@ -28,6 +28,7 @@
#include <com/sun/star/lang/IllegalArgumentException.hpp>
#include <com/sun/star/frame/ModuleManager.hpp>
+#include <comphelper/lok.hxx>
#include <comphelper/processfactory.hxx>
#include <comphelper/configurationhelper.hxx>
#include <vcl/window.hxx>
@@ -81,6 +82,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 being used through LibreOfficeKit
+ if( comphelper::LibreOfficeKit::isActive() )
+ 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 42619711ad5a..8717bd006b0d 100644
--- a/framework/source/loadenv/loadenv.cxx
+++ b/framework/source/loadenv/loadenv.cxx
@@ -27,6 +27,7 @@
#include <protocols.h>
#include <services.h>
#include <comphelper/interaction.hxx>
+#include <comphelper/lok.hxx>
#include <framework/interaction.hxx>
#include <comphelper/processfactory.hxx>
#include <comphelper/configuration.hxx>
@@ -1744,7 +1745,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_WINDOWATTRIBUTES) >>= sWindowState;
+
+ // Don't look for persistent window attributes when used through LibreOfficeKit
+ if( !comphelper::LibreOfficeKit::isActive() )
+ comphelper::ConfigurationHelper::readRelativeKey(xModuleCfg, sModule, OFFICEFACTORY_PROPNAME_WINDOWATTRIBUTES) >>= sWindowState;
+
if (!sWindowState.isEmpty())
{
// SOLAR SAFE ->