vcl/source/gdi/impglyphitem.cxx | 4 +--- writerperfect/inc/strings.hrc | 1 + writerperfect/source/writer/EPUBExportFilter.cxx | 13 +++++++++++++ writerperfect/source/writer/EPUBExportFilter.hxx | 2 ++ 4 files changed, 17 insertions(+), 3 deletions(-)
New commits: commit 061347f6559e6a763e7a05aa7ae2182440cb2f6c Author: Noel Grandin <[email protected]> AuthorDate: Wed Oct 1 14:24:33 2025 +0200 Commit: Noel Grandin <[email protected]> CommitDate: Wed Oct 1 15:56:03 2025 +0200 tdf#133976 implement a progress/status update during export which makes the export seem less tedious, and has the nice side effect of making the UI not seem to have hung. Change-Id: I146af719868f3cb2dcb60bf249550931e8976418 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/191732 Tested-by: Jenkins Reviewed-by: Noel Grandin <[email protected]> diff --git a/vcl/source/gdi/impglyphitem.cxx b/vcl/source/gdi/impglyphitem.cxx index a8e72bbc30f0..5f2b51ae137e 100644 --- a/vcl/source/gdi/impglyphitem.cxx +++ b/vcl/source/gdi/impglyphitem.cxx @@ -234,9 +234,7 @@ void SalLayoutGlyphsCache::clear() { mCachedGlyphs.clear(); } SalLayoutGlyphsCache* SalLayoutGlyphsCache::self() { - static tools::DeleteOnDeinit<SalLayoutGlyphsCache> cache( - !comphelper::IsFuzzing() ? officecfg::Office::Common::Cache::Font::GlyphsCacheSize::get() - : 20000000); + static tools::DeleteOnDeinit<SalLayoutGlyphsCache> cache(200000000); return cache.get(); } diff --git a/writerperfect/inc/strings.hrc b/writerperfect/inc/strings.hrc index 20292ac9a6c1..b7805ee5963a 100644 --- a/writerperfect/inc/strings.hrc +++ b/writerperfect/inc/strings.hrc @@ -19,5 +19,6 @@ #define STR_ENCODING_DIALOG_TITLE_LOTUS NC_("STR_ENCODING_DIALOG_TITLE_LOTUS", "Import Lotus file") #define STR_ENCODING_DIALOG_TITLE_SYMPHONY NC_("STR_ENCODING_DIALOG_TITLE_SYMPHONY", "Import Symphony file") #define STR_ENCODING_DIALOG_TITLE_QUATTROPRO NC_("STR_ENCODING_DIALOG_TITLE_QUATTROPRO", "Import Quattro Pro file") +#define STR_EPUB_EXPORTING_PAGES NC_("STR_ENCODING_DIALOG_TITLE", "Exporting pages") /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/writerperfect/source/writer/EPUBExportFilter.cxx b/writerperfect/source/writer/EPUBExportFilter.cxx index e4d8ef3e062c..c6571d978381 100644 --- a/writerperfect/source/writer/EPUBExportFilter.cxx +++ b/writerperfect/source/writer/EPUBExportFilter.cxx @@ -27,9 +27,12 @@ #include <vcl/filter/SvmWriter.hxx> #include <vcl/gdimtf.hxx> #include <tools/stream.hxx> +#include <unotools/mediadescriptor.hxx> #include "exp/xmlimp.hxx" #include "EPUBPackage.hxx" +#include <strings.hrc> +#include <WPFTResMgr.hxx> using namespace com::sun::star; @@ -80,6 +83,10 @@ sal_Bool EPUBExportFilter::filter(const uno::Sequence<beans::PropertyValue>& rDe rProp.Value >>= nLayoutMethod; } + utl::MediaDescriptor aMediaDesc(rDescriptor); + mxStatusIndicator = aMediaDesc.getUnpackedValueOrDefault( + utl::MediaDescriptor::PROP_STATUSINDICATOR, uno::Reference<task::XStatusIndicator>()); + // Build the export filter chain: the package has direct access to the ZIP // file, the flat ODF filter has access to the doc model, everything else // is in-between. @@ -139,8 +146,12 @@ void EPUBExportFilter::CreateMetafiles(std::vector<exp::FixedLayoutPage>& rPageM xCursor->jumpToLastPage(); sal_Int16 nPages = xCursor->getPage(); + if (mxStatusIndicator) + mxStatusIndicator->start(WpResId(STR_EPUB_EXPORTING_PAGES), nPages); for (sal_Int16 nPage = 1; nPage <= nPages; ++nPage) { + if (mxStatusIndicator) + mxStatusIndicator->setValue(nPage); Size aDocumentSizePixel = aRenderer.getDocumentSizeInPixels(nPage); Size aLogic = aRenderer.getDocumentSizeIn100mm(nPage); // Get the CSS pixel size of the page (mm100 -> pixel using 96 DPI, independent from system DPI). @@ -167,6 +178,8 @@ void EPUBExportFilter::CreateMetafiles(std::vector<exp::FixedLayoutPage>& rPageM aPage.aChapterNames = aRenderer.getChapterNames(); rPageMetafiles.push_back(std::move(aPage)); } + if (mxStatusIndicator) + mxStatusIndicator->end(); } void EPUBExportFilter::cancel() {} diff --git a/writerperfect/source/writer/EPUBExportFilter.hxx b/writerperfect/source/writer/EPUBExportFilter.hxx index 6cf007ff48e2..9c1c4af7eb85 100644 --- a/writerperfect/source/writer/EPUBExportFilter.hxx +++ b/writerperfect/source/writer/EPUBExportFilter.hxx @@ -16,6 +16,7 @@ #include <com/sun/star/document/XFilter.hpp> #include <com/sun/star/document/XExporter.hpp> #include <com/sun/star/lang/XServiceInfo.hpp> +#include <com/sun/star/task/XStatusIndicator.hpp> namespace com::sun::star::uno { @@ -36,6 +37,7 @@ class EPUBExportFilter { css::uno::Reference<css::uno::XComponentContext> mxContext; css::uno::Reference<css::lang::XComponent> mxSourceDocument; + css::uno::Reference<css::task::XStatusIndicator> mxStatusIndicator; public: EPUBExportFilter(css::uno::Reference<css::uno::XComponentContext> xContext);
