summaryrefslogtreecommitdiff
path: root/sd
diff options
context:
space:
mode:
authorCaolán McNamara <caolan.mcnamara@collabora.com>2024-10-24 14:53:20 +0100
committerCaolán McNamara <caolan.mcnamara@collabora.com>2024-10-25 09:23:06 +0200
commitdfa9af835c19a441a0d0aee58920bfad9e1cbe01 (patch)
treee7a4a341b2032e7fb17a98cdb423b596f08c316c /sd
parentf0c49bd1554885ed601ae9a9507a5689b2cc7914 (diff)
Related: tdf#159860 inform if there is > 100 master slides
which is atypical and easy to not notice when it happens Change-Id: I16546b0e841771c746cd33fefd7ec15e2877b08d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175559 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Diffstat (limited to 'sd')
-rw-r--r--sd/inc/strings.hrc4
-rw-r--r--sd/source/ui/docshell/docshel4.cxx14
2 files changed, 17 insertions, 1 deletions
diff --git a/sd/inc/strings.hrc b/sd/inc/strings.hrc
index 3ff7cac89795..e8a6fe8683e1 100644
--- a/sd/inc/strings.hrc
+++ b/sd/inc/strings.hrc
@@ -469,4 +469,8 @@
#define STR_INSERT_TABLESTYLE NC_("STR_INSERT_TABLESTYLE", "Add a new design")
#define STR_REMOVE_TABLESTYLE NC_("STR_REMOVE_TABLESTYLE", "The selected style is in use in this document.\nIf you will delete this style, tables using it will revert to the default style.\nDo you still wish to delete this style?\n")
+// To translators: %n is replaced by a large number, 100 at the time of introduction
+#define STR_MANY_MASTER_PAGES NC_("STR_MANY_MASTER_PAGES", "%n Master Slides")
+#define STR_MANY_MASTER_PAGES_DETAIL NC_("STR_MANY_MASTER_PAGES_DETAIL", "Large amounts of Master Slides degrade loading performance")
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sd/source/ui/docshell/docshel4.cxx b/sd/source/ui/docshell/docshel4.cxx
index 8980bc2a0148..c71706e3caab 100644
--- a/sd/source/ui/docshell/docshel4.cxx
+++ b/sd/source/ui/docshell/docshel4.cxx
@@ -38,6 +38,7 @@
#include <sfx2/docfile.hxx>
#include <sfx2/docfilt.hxx>
#include <sfx2/dispatch.hxx>
+#include <sfx2/infobar.hxx>
#include <svx/svdotext.hxx>
#include <sfx2/printer.hxx>
#include <svtools/ctrltool.hxx>
@@ -296,8 +297,10 @@ bool DrawDocShell::Load( SfxMedium& rMedium )
if( bRet )
{
+ SdDrawDocument* pDoc = GetDoc();
+
// for legacy markup in OOoXML filter, convert the animations now
- EffectMigration::DocumentLoaded(*GetDoc());
+ EffectMigration::DocumentLoaded(*pDoc);
UpdateTablePointers();
// If we're an embedded OLE object, use tight bounds
@@ -317,6 +320,15 @@ bool DrawDocShell::Load( SfxMedium& rMedium )
const INetURLObject aUrl;
SfxObjectShell::SetAutoLoad( aUrl, 0, false );
+
+ const sal_uInt16 nMasterPages = pDoc->GetMasterSdPageCount(PageKind::Standard);
+ if (nMasterPages > 100)
+ {
+ const LocaleDataWrapper& rLocaleData = Application::GetSettings().GetLocaleDataWrapper();
+ OUString sMasterPages = rLocaleData.getNum(nMasterPages, 0, true, false);
+ AppendInfoBarWhenReady(u"toomanymasterpages"_ustr, SdResId(STR_MANY_MASTER_PAGES).replaceFirst("%n", sMasterPages),
+ SdResId(STR_MANY_MASTER_PAGES_DETAIL), InfobarType::INFO);
+ }
}
else
{