[Libreoffice-commits] core.git: desktop/source

Michael Stahl (via logerrit) logerrit at kemper.freedesktop.org
Fri Mar 27 16:39:40 UTC 2020


 desktop/source/deployment/manager/dp_extensionmanager.cxx |   27 ++++++++++++++
 1 file changed, 27 insertions(+)

New commits:
commit 319407dba6f6bb0343865d010bfd436900ad0f2f
Author:     Michael Stahl <Michael.Stahl at cib.de>
AuthorDate: Fri Mar 27 16:41:48 2020 +0100
Commit:     Michael Stahl <michael.stahl at cib.de>
CommitDate: Fri Mar 27 17:39:05 2020 +0100

    tdf#131084 Revert "Drop checking for user extensions w/ the same ID on every synchronization"
    
    This reverts commit 675295d7e18c1505835893e51a853a5b4ce37ed6.
    
    Beyond the user-installed extension problem in tdf#131084 this also
    breaks bundled dictionaries in instdir/share/extensions, which aren't
    loaded any more.  This is masked by fall-back code that loads dicts from
    /usr/share on Linux so more noticeable on Windows.
    
    Maybe it would be possible to do this only once on user profile creation
    but i don't know much about extension stuff...
    
    Rene points out that Debian packages can install bundled extensions
    after the user-profile is created so that wouldn't work either.
    
    Change-Id: I9f0071c2441a4cf967f8981ef3a3e064197b88aa
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91226
    Tested-by: Michael Stahl <michael.stahl at cib.de>
    Reviewed-by: Michael Stahl <michael.stahl at cib.de>

diff --git a/desktop/source/deployment/manager/dp_extensionmanager.cxx b/desktop/source/deployment/manager/dp_extensionmanager.cxx
index 558ebe02fdfd..708c40215fa5 100644
--- a/desktop/source/deployment/manager/dp_extensionmanager.cxx
+++ b/desktop/source/deployment/manager/dp_extensionmanager.cxx
@@ -1224,6 +1224,33 @@ sal_Bool ExtensionManager::synchronize(
         bModified |= static_cast<bool>(getBundledRepository()->synchronize(xAbortChannel, xCmdEnv));
         progressBundled.update("\n\n");
 
+        //Always determine the active extension.
+        //TODO: Is this still necessary?  (It used to be necessary for the
+        // first-start optimization:  The setup created the registration data
+        // for the bundled extensions (share/prereg/bundled) which was copied to
+        // the user installation when a user started OOo for the first time
+        // after running setup.  All bundled extensions were registered at that
+        // moment.  However, extensions with the same identifier could be in the
+        // shared or user repository, in which case the respective bundled
+        // extensions had to be revoked.)
+        try
+        {
+            const uno::Sequence<uno::Sequence<Reference<css::deployment::XPackage> > >
+                seqSeqExt = getAllExtensions(xAbortChannel, xCmdEnv);
+            for (sal_Int32 i = 0; i < seqSeqExt.getLength(); i++)
+            {
+                uno::Sequence<Reference<css::deployment::XPackage> > const & seqExt =
+                    seqSeqExt[i];
+                activateExtension(seqExt, isUserDisabled(seqExt), true,
+                                  xAbortChannel, xCmdEnv);
+            }
+        }
+        catch (...)
+        {
+            //We catch the exception, so we can write the lastmodified file
+            //so we will no repeat this every time OOo starts.
+            OSL_FAIL("Extensions Manager: synchronize");
+        }
         OUString lastSyncBundled("$BUNDLED_EXTENSIONS_USER/lastsynchronized");
         writeLastModified(lastSyncBundled, xCmdEnv, m_xContext);
         OUString lastSyncShared("$SHARED_EXTENSIONS_USER/lastsynchronized");


More information about the Libreoffice-commits mailing list