summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAshod Nakashian <ashod.nakashian@collabora.co.uk>2019-07-27 23:35:13 -0400
committerMichael Meeks <michael.meeks@collabora.com>2019-12-16 13:50:21 +0100
commite573919cd8561a81d967c1a4566c5733dd44b7b1 (patch)
tree47128453c47a48492556f3d92a05fe7b1ec5d811
parent550c0a666e119c911b311c96f9185c11d8465dcb (diff)
LOK: spelldialog: don't create the dialog when loading new views
By default dialogs/decks are re-created when a new view is created/attached, if they are visible. For the spell checker this is unexpected, as the user doesn't expect to be doing spell checking upon loading a document, just because another user was at the time spell checking. Currently the suppression is for LOK only. This also adds support to suppress the recreation of any dialog by flagging it with the SfxChildWindowFlags::NEVERCLONE flag upon invoking RegisterChildWindow. (cherry picked from commit e3fb48fe4f84b5609730c64fdb49b1bd7ddd1f96) Change-Id: I7d71c664f1b2804910c96eeb0431164d48b5679b Reviewed-on: https://gerrit.libreoffice.org/85004 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
-rw-r--r--desktop/qa/data/2slides.odpbin10888 -> 10993 bytes
-rw-r--r--include/sfx2/childwin.hxx6
-rw-r--r--sc/source/ui/app/scdll.cxx5
-rw-r--r--sd/source/ui/app/sddll.cxx5
-rw-r--r--sfx2/source/appl/workwin.cxx3
-rw-r--r--sw/source/uibase/app/swmodule.cxx5
6 files changed, 18 insertions, 6 deletions
diff --git a/desktop/qa/data/2slides.odp b/desktop/qa/data/2slides.odp
index 8be376f5b548..0e3f8758ffc9 100644
--- a/desktop/qa/data/2slides.odp
+++ b/desktop/qa/data/2slides.odp
Binary files differ
diff --git a/include/sfx2/childwin.hxx b/include/sfx2/childwin.hxx
index 9a12bf896071..e70c779b6c3a 100644
--- a/include/sfx2/childwin.hxx
+++ b/include/sfx2/childwin.hxx
@@ -49,13 +49,13 @@ enum class SfxChildWindowFlags
TASK = 0x10, // ChildWindow inside the Task
CANTGETFOCUS = 0x20, // ChildWindow can not get focus
ALWAYSAVAILABLE = 0x40, // ChildWindow is never disabled
- NEVERHIDE = 0x80 // ChildWindow is can always made
- // visible/is visible
+ NEVERHIDE = 0x80, // ChildWindow is always visible
+ NEVERCLONE = 0x100, // ChildWindow is not recreated in new view
};
namespace o3tl
{
- template<> struct typed_flags<SfxChildWindowFlags> : is_typed_flags<SfxChildWindowFlags, 0xf5> {};
+ template<> struct typed_flags<SfxChildWindowFlags> : is_typed_flags<SfxChildWindowFlags, 0x1f5> {};
}
diff --git a/sc/source/ui/app/scdll.cxx b/sc/source/ui/app/scdll.cxx
index e6a360398341..27e5202ebde2 100644
--- a/sc/source/ui/app/scdll.cxx
+++ b/sc/source/ui/app/scdll.cxx
@@ -26,6 +26,7 @@
#include <svx/tbxcolor.hxx>
#include <comphelper/classids.hxx>
+#include <comphelper/lok.hxx>
#include <sfx2/sidebar/SidebarChildWindow.hxx>
#include <sfx2/docfilt.hxx>
#include <sfx2/fcontnr.hxx>
@@ -255,7 +256,9 @@ void ScDLL::Init()
SvxHlinkDlgWrapper ::RegisterChildWindow(false, pMod);
SvxFontWorkChildWindow ::RegisterChildWindow(false, pMod);
SvxIMapDlgChildWindow ::RegisterChildWindow(false, pMod);
- ScSpellDialogChildWindow ::RegisterChildWindow(false, pMod);
+ ScSpellDialogChildWindow::RegisterChildWindow(
+ false, pMod, comphelper::LibreOfficeKit::isActive() ? SfxChildWindowFlags::NEVERCLONE
+ : SfxChildWindowFlags::NONE);
ScValidityRefChildWin::RegisterChildWindow(false, pMod);
sc::SearchResultsDlgWrapper::RegisterChildWindow(false, pMod);
diff --git a/sd/source/ui/app/sddll.cxx b/sd/source/ui/app/sddll.cxx
index 35b7ca6f5113..c0ae2be3c2b0 100644
--- a/sd/source/ui/app/sddll.cxx
+++ b/sd/source/ui/app/sddll.cxx
@@ -93,6 +93,7 @@
#include <sfx2/charmappopup.hxx>
#include <sfx2/sidebar/SidebarChildWindow.hxx>
#include <vcl/FilterConfigItem.hxx>
+#include <comphelper/lok.hxx>
#include <o3tl/make_unique.hxx>
#include <sdabstdlg.hxx>
#include <sdfilter.hxx>
@@ -175,7 +176,9 @@ void SdDLL::RegisterControllers(SdModule* pMod)
SvxBmpMaskChildWindow::RegisterChildWindow(false, pMod);
SvxIMapDlgChildWindow::RegisterChildWindow(false, pMod);
SvxHlinkDlgWrapper::RegisterChildWindow(false, pMod);
- ::sd::SpellDialogChildWindow::RegisterChildWindow(false, pMod);
+ ::sd::SpellDialogChildWindow::RegisterChildWindow(
+ false, pMod, comphelper::LibreOfficeKit::isActive() ? SfxChildWindowFlags::NEVERCLONE
+ : SfxChildWindowFlags::NONE);
#if HAVE_FEATURE_AVMEDIA
::avmedia::MediaPlayer::RegisterChildWindow(false, pMod);
#endif
diff --git a/sfx2/source/appl/workwin.cxx b/sfx2/source/appl/workwin.cxx
index be84fde7a6e6..09d4a268397a 100644
--- a/sfx2/source/appl/workwin.cxx
+++ b/sfx2/source/appl/workwin.cxx
@@ -1289,6 +1289,9 @@ void SfxWorkWindow::UpdateChildWindows_Impl()
else
bCreate = true;
+ if (pCW->aInfo.nFlags & SfxChildWindowFlags::NEVERCLONE)
+ pCW->bCreate = bCreate = false; // Don't create and remember that we haven't created.
+
// Currently, no window here, but it is enabled; windows
// Create window and if possible theContext
if ( bCreate )
diff --git a/sw/source/uibase/app/swmodule.cxx b/sw/source/uibase/app/swmodule.cxx
index f8a76f4d49f1..942399ddb0b9 100644
--- a/sw/source/uibase/app/swmodule.cxx
+++ b/sw/source/uibase/app/swmodule.cxx
@@ -56,6 +56,7 @@
#include <com/sun/star/scanner/ScannerManager.hpp>
#include <com/sun/star/linguistic2/LanguageGuessing.hpp>
#include <ooo/vba/XSinkCaller.hpp>
+#include <comphelper/lok.hxx>
#include <comphelper/processfactory.hxx>
#include <docsh.hxx>
#include <swmodule.hxx>
@@ -357,7 +358,9 @@ void SwDLL::RegisterControls()
SwInsertAuthMarkWrapper::RegisterChildWindow( false, pMod );
SwWordCountWrapper::RegisterChildWindow( false, pMod );
SvxRubyChildWindow::RegisterChildWindow( false, pMod);
- SwSpellDialogChildWindow::RegisterChildWindow(false, pMod);
+ SwSpellDialogChildWindow::RegisterChildWindow(
+ false, pMod, comphelper::LibreOfficeKit::isActive() ? SfxChildWindowFlags::NEVERCLONE
+ : SfxChildWindowFlags::NONE);
CharmapPopup::RegisterControl(SID_CHARMAP_CONTROL, pMod );