basic/source/comp/scanner.cxx | 2 +- desktop/source/lib/init.cxx | 26 ++++++++++++++++++++++++++ editeng/source/editeng/eerdll.cxx | 12 +++++++----- sc/qa/unit/data/xls/forcepoint-pivot-1.xls |binary sc/source/filter/excel/xipivot.cxx | 8 ++++---- sc/source/ui/view/output2.cxx | 13 +++++++++++-- svtools/source/misc/embedhlp.cxx | 12 +++++++++++- sw/source/core/doc/DocumentTimerManager.cxx | 26 +++++++++++++++++++++++--- sw/source/core/inc/DocumentTimerManager.hxx | 6 ++++++ sw/source/uibase/misc/swruler.cxx | 3 +++ 10 files changed, 92 insertions(+), 16 deletions(-)
New commits: commit 4a35ac3122705577807df831af51dee92beebf2b Author: Jan Holesovsky <ke...@collabora.com> Date: Thu Jun 28 16:12:30 2018 +0200 lok: Don't even try to paint the ruler via LibreOfficeKit. But we need to have it behind the scenes, otherwise the Online's ruler does not get notifications. Change-Id: I72bef28cb15c462572b511449d538b067f7cb141 Reviewed-on: https://gerrit.libreoffice.org/56598 Reviewed-by: Andras Timar <andras.ti...@collabora.com> Tested-by: Andras Timar <andras.ti...@collabora.com> (cherry picked from commit ee6e6bd5b853aa68c9721f53b5892384e7403eec) diff --git a/sw/source/uibase/misc/swruler.cxx b/sw/source/uibase/misc/swruler.cxx index 7eabce4b9109..74ddc6a14724 100644 --- a/sw/source/uibase/misc/swruler.cxx +++ b/sw/source/uibase/misc/swruler.cxx @@ -96,6 +96,9 @@ void SwCommentRuler::dispose() void SwCommentRuler::Paint(vcl::RenderContext& rRenderContext, const Rectangle& rRect) { + if (comphelper::LibreOfficeKit::isActive()) + return; // no need to waste time on startup + SvxRuler::Paint(rRenderContext, rRect); // Don't draw if there is not any note commit 159d3b1b7286d8e037b6637ed107bb811e93f276 Author: Ashod Nakashian <ashod.nakash...@collabora.co.uk> Date: Thu Jun 28 01:02:49 2018 -0400 sw lok: delay processing idle jobs to let LOK finish initialization When loading document, LOK needs to setup the client view, register callbacks, get document size and type, etc. All of these need to take SolarMutex, which is taken by the idle jobs immediately after loading, blocking LOK from finishing initialization and rendering the first tiles for the user. This gives the user the impression that the document is loading for far longer than it actually is, due to lack of interactivity (or indeed any activity on the screen besides the spinning wheel). By delaying the idle jobs, we allow time for LOK to finish initialization and render the first tiles before the idle jobs kick in and hog SolarMutex. Change-Id: Ic6f437bfd6f43dfed2aaa1a9d3510d43f5ec30ae Reviewed-on: https://gerrit.libreoffice.org/56572 Reviewed-by: Jan Holesovsky <ke...@collabora.com> Tested-by: Jan Holesovsky <ke...@collabora.com> (cherry picked from commit 1056640a6e1fd044cb61f5bf5ee85dfec3cbeb7c) diff --git a/sw/source/core/doc/DocumentTimerManager.cxx b/sw/source/core/doc/DocumentTimerManager.cxx index 4a0176b2811d..ce4af8b3353c 100644 --- a/sw/source/core/doc/DocumentTimerManager.cxx +++ b/sw/source/core/doc/DocumentTimerManager.cxx @@ -33,6 +33,7 @@ #include <docsh.hxx> #include <docfld.hxx> #include <fldbas.hxx> +#include <comphelper/lok.hxx> namespace sw { @@ -45,6 +46,10 @@ DocumentTimerManager::DocumentTimerManager( SwDoc& i_rSwdoc ) : m_rDoc( i_rSwdoc maIdle.SetPriority( SchedulerPriority::LOWEST ); maIdle.SetIdleHdl( LINK( this, DocumentTimerManager, DoIdleJobs) ); maIdle.SetDebugName( "sw::DocumentTimerManager maIdle" ); + + maFireIdleJobsTimer.SetTimeoutHdl(LINK(this, DocumentTimerManager, FireIdleJobsTimeout)); + maFireIdleJobsTimer.SetTimeout(1000); // Enough time for LOK to render the first tiles. + maFireIdleJobsTimer.SetDebugName("sw::DocumentTimerManager maFireIdleJobsTimer"); } void DocumentTimerManager::StartIdling() @@ -75,9 +80,24 @@ void DocumentTimerManager::UnblockIdling() void DocumentTimerManager::StartBackgroundJobs() { - // Trigger DoIdleJobs(), asynchronously. - if (!maIdle.IsActive()) //fdo#73165 if the timer is already running don't restart from 0 - maIdle.Start(); + if (comphelper::LibreOfficeKit::isActive()) + { + /// Reset the timer to fire after the last StartBackgroundJobs. + maFireIdleJobsTimer.Start(); + StopIdling(); + } + else + { + // Trigger DoIdleJobs(), asynchronously. + if (!maIdle.IsActive()) //fdo#73165 if the timer is already running don't restart from 0 + maIdle.Start(); + } +} + +IMPL_LINK( DocumentTimerManager, FireIdleJobsTimeout, Timer *, pTimer, void ) +{ + (void)pTimer; + StartIdling(); } IMPL_LINK( DocumentTimerManager, DoIdleJobs, Idle*, pIdle, void ) diff --git a/sw/source/core/inc/DocumentTimerManager.hxx b/sw/source/core/inc/DocumentTimerManager.hxx index b8575192eba3..d744392b79f2 100644 --- a/sw/source/core/inc/DocumentTimerManager.hxx +++ b/sw/source/core/inc/DocumentTimerManager.hxx @@ -23,6 +23,7 @@ #include <IDocumentTimerAccess.hxx> #include <vcl/idle.hxx> +#include <vcl/timer.hxx> #include <sal/types.h> #include <tools/link.hxx> @@ -50,6 +51,10 @@ public: // Our own 'IdleTimer' calls the following method DECL_LINK( DoIdleJobs, Idle *, void ); + /// Delay starting idle jobs to allow for post-load activity. + /// Used by LOK only. + DECL_LINK( FireIdleJobsTimeout, Timer *, void ); + virtual ~DocumentTimerManager() override; private: @@ -62,6 +67,7 @@ private: bool mbStartIdleTimer; //< idle timer mode start/stop sal_Int32 mIdleBlockCount; Idle maIdle; + Timer maFireIdleJobsTimer; }; } commit 8f6941ad22671946035fe47ca0b19a2a0a53d9fc Author: Aron Budea <aron.bu...@collabora.com> Date: Fri Jul 6 15:32:49 2018 +0200 desktop: move dictionary preload before font init spell-checker is initialized during font init since e7f65920b12517b31f0c5cbfd0dcb8df96d20ba4 Change-Id: Ia5b5223aa8cc00d0e80451142ae18a7046ad00d4 Reviewed-on: https://gerrit.libreoffice.org/57064 Reviewed-by: Ashod Nakashian <ashnak...@gmail.com> Tested-by: Ashod Nakashian <ashnak...@gmail.com> (cherry picked from commit bd88f41d53881fd1a3ad42268cd76d598bdd7838) diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index 691d599c25fd..72b441709be5 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -3758,6 +3758,8 @@ static int lo_initialize(LibreOfficeKit* pThis, const char* pAppPath, const char // 3) InitVCL() aService->initialize({css::uno::makeAny<OUString>("preload")}); + preloadData(); + // Initialize fonts. css::uno::Sequence< css::lang::Locale > aLocales; css::uno::Reference<css::linguistic2::XLinguServiceManager2> xLangSrv = css::linguistic2::LinguServiceManager::create(xContext); @@ -3782,8 +3784,6 @@ static int lo_initialize(LibreOfficeKit* pThis, const char* pAppPath, const char OutputDevice::GetDefaultFont(DefaultFontType::CTL_SPREADSHEET, nLang, GetDefaultFontFlags::OnlyOne); } - preloadData(); - // Release Solar Mutex, lo_startmain thread should acquire it. Application::ReleaseSolarMutex(); } commit eebc0da85b922080bd1462baf1ac82ed80bba7eb Author: Ashod Nakashian <ashod.nakash...@collabora.co.uk> Date: Thu Jun 28 01:07:32 2018 -0400 desktop: initialize fonts in pre-init Change-Id: I5a3acc41196c7e0672514fa2dae00e5fc0f76a1f Reviewed-on: https://gerrit.libreoffice.org/56573 Reviewed-by: Jan Holesovsky <ke...@collabora.com> Tested-by: Jan Holesovsky <ke...@collabora.com> (cherry picked from commit e7f65920b12517b31f0c5cbfd0dcb8df96d20ba4) diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index f550958ab4f1..691d599c25fd 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -59,6 +59,7 @@ #include <com/sun/star/linguistic2/LinguServiceManager.hpp> #include <com/sun/star/linguistic2/XSpellChecker.hpp> +#include <com/sun/star/i18n/ScriptType.hpp> #include <editeng/fontitem.hxx> #include <editeng/flstitem.hxx> @@ -101,6 +102,7 @@ #include <sfx2/sfxbasemodel.hxx> #include <svl/undo.hxx> #include <unotools/datetime.hxx> +#include <i18nlangtag/mslangid.hxx> #include <i18nlangtag/languagetag.hxx> #include <app.hxx> @@ -3756,6 +3758,30 @@ static int lo_initialize(LibreOfficeKit* pThis, const char* pAppPath, const char // 3) InitVCL() aService->initialize({css::uno::makeAny<OUString>("preload")}); + // Initialize fonts. + css::uno::Sequence< css::lang::Locale > aLocales; + css::uno::Reference<css::linguistic2::XLinguServiceManager2> xLangSrv = css::linguistic2::LinguServiceManager::create(xContext); + if (xLangSrv.is()) + { + css::uno::Reference<css::linguistic2::XSpellChecker> xSpell(xLangSrv->getSpellChecker(), css::uno::UNO_QUERY); + css::uno::Reference<css::linguistic2::XSupportedLocales> xLocales(xSpell, css::uno::UNO_QUERY); + if (xLocales.is()) + aLocales = xLocales->getLocales(); + } + + for (const auto& aLocale : aLocales) + { + //TODO: Add more types and cache more aggessively. For now this initializes the fontcache. + using namespace ::com::sun::star::i18n::ScriptType; + LanguageType nLang; + nLang = MsLangId::resolveSystemLanguageByScriptType(LanguageTag::convertToLanguageType(aLocale, false), LATIN); + OutputDevice::GetDefaultFont(DefaultFontType::LATIN_SPREADSHEET, nLang, GetDefaultFontFlags::OnlyOne); + nLang = MsLangId::resolveSystemLanguageByScriptType(LanguageTag::convertToLanguageType(aLocale, false), ASIAN); + OutputDevice::GetDefaultFont(DefaultFontType::CJK_SPREADSHEET, nLang, GetDefaultFontFlags::OnlyOne); + nLang = MsLangId::resolveSystemLanguageByScriptType(LanguageTag::convertToLanguageType(aLocale, false), COMPLEX); + OutputDevice::GetDefaultFont(DefaultFontType::CTL_SPREADSHEET, nLang, GetDefaultFontFlags::OnlyOne); + } + preloadData(); // Release Solar Mutex, lo_startmain thread should acquire it. commit 0e05840f37cb785ceb76a038e13d3fcb3cc3e0fb Author: Caolán McNamara <caol...@redhat.com> Date: Tue May 29 13:12:12 2018 +0100 forcepoint#43 endless update ole2 preview recursion Change-Id: I7a6a52d2ea63f840a8a1800fdf7039b1e7b24cdc Reviewed-on: https://gerrit.libreoffice.org/55004 Tested-by: Jenkins <c...@libreoffice.org> Reviewed-by: Christian Lohmaier <lohmaier+libreoff...@googlemail.com> (cherry picked from commit 1663a364c80fde2ac8396dd2fbcbee4240231271) (cherry picked from commit 3ca78fd4d5c710c9f6baff2b975969d9d2ff41db) (cherry picked from commit ac981fce182a6e7c0393fa128e2243c062746191) diff --git a/svtools/source/misc/embedhlp.cxx b/svtools/source/misc/embedhlp.cxx index 564b5a096479..9c432a02af8c 100644 --- a/svtools/source/misc/embedhlp.cxx +++ b/svtools/source/misc/embedhlp.cxx @@ -235,6 +235,7 @@ struct EmbeddedObjectRef_Impl sal_Int64 nViewAspect; bool bIsLocked:1; bool bNeedUpdate:1; + bool bUpdating:1; // #i104867# sal_uInt32 mnGraphicVersion; @@ -247,6 +248,7 @@ struct EmbeddedObjectRef_Impl nViewAspect(embed::Aspects::MSOLE_CONTENT), bIsLocked(false), bNeedUpdate(false), + bUpdating(false), mnGraphicVersion(0), aDefaultSizeForChart_In_100TH_MM(awt::Size(8000,7000)) {} @@ -261,6 +263,7 @@ struct EmbeddedObjectRef_Impl nViewAspect(r.nViewAspect), bIsLocked(r.bIsLocked), bNeedUpdate(r.bNeedUpdate), + bUpdating(r.bUpdating), mnGraphicVersion(0), aDefaultSizeForChart_In_100TH_MM(r.aDefaultSizeForChart_In_100TH_MM) { @@ -832,7 +835,14 @@ bool EmbeddedObjectRef::IsGLChart(const css::uno::Reference < css::embed::XEmbed void EmbeddedObjectRef::UpdateReplacement() { - GetReplacement( true ); + if (mpImpl->bUpdating) + { + SAL_WARN("svtools.misc", "UpdateReplacement called while UpdateReplacement already underway"); + return; + } + mpImpl->bUpdating = true; + GetReplacement(true); + mpImpl->bUpdating = false; } void EmbeddedObjectRef::UpdateReplacementOnDemand() commit 06957647636ab67c49ce74727a3f93ccc1adf4d4 Author: Caolán McNamara <caol...@redhat.com> Date: Mon May 28 21:51:01 2018 +0100 forcepoint#42 check available str length Change-Id: Ie476968ddaa4c3e5475ae9aa6133e7aba38d5975 Reviewed-on: https://gerrit.libreoffice.org/54978 Tested-by: Jenkins <c...@libreoffice.org> Reviewed-by: Christian Lohmaier <lohmaier+libreoff...@googlemail.com> (cherry picked from commit 15ea1cda0b3c37ff944ad9a239b7ed453e8b0591) (cherry picked from commit dbd8adf30c810558924929647fc5caea718e9635) (cherry picked from commit 9d00f5034eef7867d8973a9d7b124e531bfccd7d) diff --git a/basic/source/comp/scanner.cxx b/basic/source/comp/scanner.cxx index e3a622b81f45..adb2d0e7af72 100644 --- a/basic/source/comp/scanner.cxx +++ b/basic/source/comp/scanner.cxx @@ -542,7 +542,7 @@ bool SbiScanner::NextSym() case '>': if( *pLine == '=' ) n = 2; break; case ':': if( *pLine == '=' ) n = 2; break; } - aSym = aLine.copy( nCol, n ); + aSym = aLine.copy(nCol, std::min(n, aLine.getLength() - nCol)); pLine += n-1; nCol = nCol + n; } commit abc7be8b196e0b8a5b80a2b0d706dedf3b2f9b4f Author: Caolán McNamara <caol...@redhat.com> Date: Mon May 28 21:22:56 2018 +0100 forcepoint#40 null deref presumably since commit 0098bee792c3e208ea4f6ef1c676958d3f4cd207 Date: Thu Sep 21 06:48:09 2017 +0200 tdf#112501: Pivot table: popupbuttons are placed on wrong cells Change-Id: I5413c0ba06fca25cb22256a20ef9640767dd9e50 Reviewed-on: https://gerrit.libreoffice.org/54970 Tested-by: Jenkins <c...@libreoffice.org> Reviewed-by: Christian Lohmaier <lohmaier+libreoff...@googlemail.com> (cherry picked from commit 69c5be9b26cf1a45e220d69f65b1bb0fa2aedaf6) (cherry picked from commit 47f090e2e4ba84684cdd1c0684cb1b9f2baa600f) (cherry picked from commit 3547cd460263f710d2f49fbb8bf00808c012629e) diff --git a/sc/qa/unit/data/xls/forcepoint-pivot-1.xls b/sc/qa/unit/data/xls/forcepoint-pivot-1.xls new file mode 100644 index 000000000000..12919922666b Binary files /dev/null and b/sc/qa/unit/data/xls/forcepoint-pivot-1.xls differ diff --git a/sc/source/filter/excel/xipivot.cxx b/sc/source/filter/excel/xipivot.cxx index abeeba02afdf..b8fd741a6cfe 100644 --- a/sc/source/filter/excel/xipivot.cxx +++ b/sc/source/filter/excel/xipivot.cxx @@ -1569,13 +1569,13 @@ void XclImpPivotTable::ApplyMergeFlags(const ScRange& rOutRange, const ScDPSaveD itr = aFieldBtns.begin(); itrEnd = aFieldBtns.end(); vector<const ScDPSaveDimension*>::const_iterator itDim = aFieldDims.begin(); - for (; itr != itrEnd; ++itr, ++itDim) + for (; itr != itrEnd; ++itr) { ScMF nMFlag = ScMF::Button; - const ScDPSaveDimension* pDim = *itDim; - if (pDim->HasInvisibleMember()) + const ScDPSaveDimension* pDim = itDim != aFieldDims.end() ? *itDim++ : nullptr; + if (pDim && pDim->HasInvisibleMember()) nMFlag |= ScMF::HiddenMember; - if (!pDim->IsDataLayout()) + if (!pDim || !pDim->IsDataLayout()) nMFlag |= ScMF::ButtonPopup; rDoc.ApplyFlagsTab(itr->Col(), itr->Row(), itr->Col(), itr->Row(), itr->Tab(), nMFlag); } commit d5336b61bf83db96a7f13556dc261a4ce05dc8c1 Author: Marco Cecchetti <marco.cecche...@collabora.com> Date: Thu Jun 14 12:32:48 2018 +0200 tdf#105720: lok: sc: currency symbol is displayed in the preceding cell Now in online the currency symbol is placed exactly as in the desktop case. Essentially there was a mapping issue. Change-Id: I6175cfeab3d8bc3a757c8522aa9c7a7e49c4bf2b Reviewed-on: https://gerrit.libreoffice.org/55806 Reviewed-by: Jan Holesovsky <ke...@collabora.com> Tested-by: Jan Holesovsky <ke...@collabora.com> (cherry picked from commit b1d003af24447a60d1e372caded54e30501b9fd6) diff --git a/sc/source/ui/view/output2.cxx b/sc/source/ui/view/output2.cxx index ce51ee47bf0f..61d5211ec5bf 100644 --- a/sc/source/ui/view/output2.cxx +++ b/sc/source/ui/view/output2.cxx @@ -66,6 +66,7 @@ #include <com/sun/star/i18n/DirectionProperty.hpp> #include <comphelper/string.hxx> +#include <comphelper/lok.hxx> #include <memory> #include <vector> @@ -565,13 +566,21 @@ void ScDrawStringsVars::RepeatToFill( long nColWidth ) if ( nRepeatPos == -1 || nRepeatPos > aString.getLength() ) return; + const bool bIsTiledRendering = comphelper::LibreOfficeKit::isActive(); + long nCharWidth = pOutput->pFmtDevice->GetTextWidth(OUString(nRepeatChar)); - if ( nCharWidth < 1) return; + + if ( nCharWidth < 1 || (bIsTiledRendering && nCharWidth < TWIPS_PER_PIXEL)) return; + if (bPixelToLogic) nColWidth = pOutput->mpRefDevice->PixelToLogic(Size(nColWidth,0)).Width(); + // Are there restrictions on the cell type we should filter out here ? - long nSpaceToFill = ( nColWidth - aTextSize.Width() ); + long nTextWidth = aTextSize.Width(); + if ( bIsTiledRendering ) + nTextWidth = pOutput->mpRefDevice->PixelToLogic(Size(nTextWidth,0)).Width(); + long nSpaceToFill = ( nColWidth - nTextWidth ); if ( nSpaceToFill <= nCharWidth ) return; commit 0ef3557b7fe4bbf1d23f4d3eaf1e7837d0018293 Author: Aron Budea <aron.bu...@collabora.com> Date: Wed Jun 6 16:50:20 2018 +0200 lokdialog: Allow switching language of editengine ResMgr Change-Id: I48603cdff916c242dc20fe16fdaffaa9effa6f74 Reviewed-on: https://gerrit.libreoffice.org/55386 Reviewed-by: Jan Holesovsky <ke...@collabora.com> Tested-by: Jan Holesovsky <ke...@collabora.com> (cherry picked from commit 03e81df3441a8175770edd522f592f243b5f9082) diff --git a/editeng/source/editeng/eerdll.cxx b/editeng/source/editeng/eerdll.cxx index b9aa26dcc9f4..95758ef7f1e4 100644 --- a/editeng/source/editeng/eerdll.cxx +++ b/editeng/source/editeng/eerdll.cxx @@ -20,6 +20,7 @@ #include <vcl/wrkwin.hxx> #include <vcl/dialog.hxx> +#include <vcl/lazydelete.hxx> #include <vcl/msgbox.hxx> #include <vcl/svapp.hxx> #include <vcl/settings.hxx> @@ -216,13 +217,14 @@ EditDLL::~EditDLL() delete pGlobalData; } -static ResMgr* pResMgr=nullptr; - ResMgr* EditDLL::GetResMgr() { - if (!pResMgr) - pResMgr = ResMgr::CreateResMgr("editeng", Application::GetSettings().GetUILanguageTag()); - return pResMgr; + static vcl::DeleteOnDeinit<ResMgr> pResourceManager(nullptr); + const LanguageTag& rLocale = Application::GetSettings().GetUILanguageTag(); + if (!pResourceManager.get() || pResourceManager.get()->GetLocale() != rLocale) + pResourceManager.reset(ResMgr::CreateResMgr("editeng", Application::GetSettings().GetUILanguageTag())); + OSL_ASSERT(pResourceManager.get()); + return pResourceManager.get(); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits