[Libreoffice-commits] core.git: Branch 'libreoffice-4-2-6' - 3 commits - comphelper/source configure.ac include/comphelper sfx2/source svtools/source

Christian Lohmaier lohmaier+LibreOffice at googlemail.com
Fri Aug 22 07:25:35 PDT 2014


 comphelper/source/container/embeddedobjectcontainer.cxx |   36 ++++++--
 configure.ac                                            |    2 
 include/comphelper/embeddedobjectcontainer.hxx          |    3 
 sfx2/source/appl/impldde.cxx                            |   72 ++--------------
 sfx2/source/appl/linkmgr2.cxx                           |   12 ++
 svtools/source/misc/embedhlp.cxx                        |   29 ++++--
 6 files changed, 74 insertions(+), 80 deletions(-)

New commits:
commit 2da39d30b52820783c4dde33fe53d8614b4b7869
Author: Christian Lohmaier <lohmaier+LibreOffice at googlemail.com>
Date:   Fri Aug 22 16:24:51 2014 +0200

    bump product version to 4.2.6.3.0+
    
    Change-Id: I6e3127ba77eb9e10fcdcfbb87aa9c07fa275566c

diff --git a/configure.ac b/configure.ac
index bccb62d..440d889 100644
--- a/configure.ac
+++ b/configure.ac
@@ -9,7 +9,7 @@ dnl in order to create a configure script.
 # several non-alphanumeric characters, those are split off and used only for the
 # ABOUTBOXPRODUCTVERSIONSUFFIX in openoffice.lst. Why that is necessary, no idea.
 
-AC_INIT([LibreOffice],[4.2.6.2.0+],[],[],[http://documentfoundation.org/])
+AC_INIT([LibreOffice],[4.2.6.3.0+],[],[],[http://documentfoundation.org/])
 
 AC_PREREQ([2.59])
 
commit b92da9e9f3125ef186a29a9644c4197c25c1a521
Author: Herbert Dürr <hdu at apache.org>
Date:   Mon Jul 14 07:17:59 2014 +0000

    Related: #i125226# expect DDE servers to be already up
    
    "soffice" is always up anyway and other DDE apps should be started manually
    
    (cherry picked from commit e0bfdb26cef87c8d3b3435293116a33cf99c11f0)
    
    Conflicts:
    	sfx2/source/appl/impldde.cxx
    
    (cherry picked from commit f4a8d7cd10cda57143b22519e16cdf8d5f19e759)
    
    Conflicts:
    	sfx2/source/appl/impldde.cxx
    
    Change-Id: I52ebb26528952a4abf33ac95cb67c598f08b2790
    Reviewed-on: https://gerrit.libreoffice.org/10297
    Reviewed-by: David Tardon <dtardon at redhat.com>
    Tested-by: David Tardon <dtardon at redhat.com>
    (cherry picked from commit 1e7502f3c8b8d751dd851c3f146debf2678781ec)

diff --git a/sfx2/source/appl/impldde.cxx b/sfx2/source/appl/impldde.cxx
index b0b79a21..92b1c7e 100644
--- a/sfx2/source/appl/impldde.cxx
+++ b/sfx2/source/appl/impldde.cxx
@@ -198,9 +198,6 @@ sal_Bool SvDDEObject::GetData( ::com::sun::star::uno::Any & rData /*out param*/,
 
 sal_Bool SvDDEObject::Connect( SvBaseLink * pSvLink )
 {
-#if defined(WNT)
-    static sal_Bool bInWinExec = sal_False;
-#endif
     sal_uInt16 nLinkType = pSvLink->GetUpdateMode();
     if( pConnection )           // Connection is already made
     {
@@ -227,69 +224,22 @@ sal_Bool SvDDEObject::Connect( SvBaseLink * pSvLink )
     pConnection = new DdeConnection( sServer, sTopic );
     if( pConnection->GetError() )
     {
-       // Is it possible to address the system-Topic?
-       // then the server is up, it just does not know the topic!
-        if( sTopic.equalsIgnoreAsciiCase( "SYSTEM" ) )
+        // check if the DDE server knows the "SYSTEM" topic
+        bool bSysTopic = false;
+        if (!sTopic.equalsIgnoreAsciiCase("SYSTEM"))
         {
-            sal_Bool bSysTopic;
-            {
-                DdeConnection aTmp(sServer, OUString("SYSTEM"));
-                bSysTopic = !aTmp.GetError();
-            }
-
-            if( bSysTopic )
-            {
-                nError = DDELINK_ERROR_DATA;
-                return sal_False;
-            }
-            // otherwise in  Win/WinNT, start the Application directly
+            DdeConnection aTmp(sServer, OUString("SYSTEM"));
+            bSysTopic = !aTmp.GetError();
         }
 
-#if defined(WNT)
-        // check the suitability of starting the DDE server
-        const SvtSecurityOptions aSecOpts;
-        bool bForbidden = (aSecOpts.GetMacroSecurityLevel() == eNEVER_EXECUTE);
-        bForbidden |= (comphelper::string::indexOfAny(sServer, L":./%\\") != -1);
-        static const char* aBadServers[] = { "cmd", "rundll32" };
-        for (size_t i = 0; i < sizeof(aBadServers)/sizeof(*aBadServers); ++i)
-            bForbidden |= sServer.equalsAscii(aBadServers[i]);
-
-        // try to start the DDE server if it is not there already
-        bForbidden |= (bInWinExec != false);
-        if( !bForbidden )
+        if( bSysTopic )
         {
-            OStringBuffer aCmdLine(OUStringToOString(sServer, RTL_TEXTENCODING_ASCII_US));
-            aCmdLine.append(".exe ");
-            aCmdLine.append(OUStringToOString(sTopic, RTL_TEXTENCODING_ASCII_US));
-
-            if( WinExec( aCmdLine.getStr(), SW_SHOWMINIMIZED ) < 32 ) // TODO: use CreateProcess() instead
-                nError = DDELINK_ERROR_APP;
-            else
-            {
-                sal_uInt16 i;
-                for( i=0; i<5; i++ )
-                {
-                    bInWinExec = sal_True;
-                    Application::Reschedule();
-                    bInWinExec = sal_False;
-
-                    delete pConnection;
-                    pConnection = new DdeConnection( sServer, sTopic );
-                    if( !pConnection->GetError() )
-                        break;
-                }
-
-                if( i == 5 )
-                {
-                    nError = DDELINK_ERROR_APP;
-                }
-            }
-        }
-        else
-#endif  // WNT
-        {
-            nError = DDELINK_ERROR_APP;
+            // if the system topic works then the server is up but just doesn't know the original topic
+            nError = DDELINK_ERROR_DATA;
+            return false;
         }
+
+        nError = DDELINK_ERROR_APP;
     }
 
     if( LINKUPDATE_ALWAYS == nLinkType && !pLink && !pConnection->GetError() )
commit 8b78c7a2b25ee81104226fa7ed46798f9ebe091f
Author: Armin Le Grand <alg at apache.org>
Date:   Thu Aug 7 09:59:26 2014 +0000

    Resolves: #i125386# secured user request and changed some bools to bitfield
    
    (cherry picked from commit 5e3cbe056c19bea5018dbf1fd4b2bc8f8b030ff3)
    
    Conflicts:
    	comphelper/inc/comphelper/embeddedobjectcontainer.hxx
    	comphelper/source/container/embeddedobjectcontainer.cxx
    	sfx2/source/appl/linkmgr2.cxx
    	svtools/source/misc/embedhlp.cxx
    
    (cherry picked from commit d005acae3aa315921f2c331612131626c470bd22)
    
    Conflicts:
    	include/comphelper/embeddedobjectcontainer.hxx
    
    Change-Id: I7e9b20a87ca6afe8cb91c577860a6c6b72368ee9
    Reviewed-on: https://gerrit.libreoffice.org/10882
    Reviewed-by: David Tardon <dtardon at redhat.com>
    Tested-by: David Tardon <dtardon at redhat.com>
    (cherry picked from commit 070f5923eac7a93b64d2f168d91a3983b80a22c0)

diff --git a/comphelper/source/container/embeddedobjectcontainer.cxx b/comphelper/source/container/embeddedobjectcontainer.cxx
index 2d7df99..5b5a3e7 100644
--- a/comphelper/source/container/embeddedobjectcontainer.cxx
+++ b/comphelper/source/container/embeddedobjectcontainer.cxx
@@ -85,7 +85,10 @@ struct EmbedImpl
     uno::WeakReference < uno::XInterface > m_xModel;
     //EmbeddedObjectContainerNameMap maTempObjectContainer;
     //uno::Reference < embed::XStorage > mxTempStorage;
-    bool bOwnsStorage;
+
+    /// bitfield
+    bool mbOwnsStorage : 1;
+    bool mbUserAllowsLinkUpdate : 1;
 
     const uno::Reference < embed::XStorage >& GetReplacements();
 };
@@ -116,7 +119,8 @@ EmbeddedObjectContainer::EmbeddedObjectContainer()
 {
     pImpl = new EmbedImpl;
     pImpl->mxStorage = ::comphelper::OStorageHelper::GetTemporaryStorage();
-    pImpl->bOwnsStorage = true;
+    pImpl->mbOwnsStorage = true;
+    pImpl->mbUserAllowsLinkUpdate = true;
     pImpl->mpTempObjectContainer = 0;
 }
 
@@ -124,7 +128,8 @@ EmbeddedObjectContainer::EmbeddedObjectContainer( const uno::Reference < embed::
 {
     pImpl = new EmbedImpl;
     pImpl->mxStorage = rStor;
-    pImpl->bOwnsStorage = false;
+    pImpl->mbOwnsStorage = false;
+    pImpl->mbUserAllowsLinkUpdate = true;
     pImpl->mpTempObjectContainer = 0;
 }
 
@@ -132,7 +137,8 @@ EmbeddedObjectContainer::EmbeddedObjectContainer( const uno::Reference < embed::
 {
     pImpl = new EmbedImpl;
     pImpl->mxStorage = rStor;
-    pImpl->bOwnsStorage = false;
+    pImpl->mbOwnsStorage = false;
+    pImpl->mbUserAllowsLinkUpdate = true;
     pImpl->mpTempObjectContainer = 0;
     pImpl->m_xModel = xModel;
 }
@@ -141,11 +147,11 @@ void EmbeddedObjectContainer::SwitchPersistence( const uno::Reference < embed::X
 {
     ReleaseImageSubStorage();
 
-    if ( pImpl->bOwnsStorage )
+    if ( pImpl->mbOwnsStorage )
         pImpl->mxStorage->dispose();
 
     pImpl->mxStorage = rStor;
-    pImpl->bOwnsStorage = false;
+    pImpl->mbOwnsStorage = false;
 }
 
 sal_Bool EmbeddedObjectContainer::CommitImageSubStorage()
@@ -201,7 +207,7 @@ EmbeddedObjectContainer::~EmbeddedObjectContainer()
 {
     ReleaseImageSubStorage();
 
-    if ( pImpl->bOwnsStorage )
+    if ( pImpl->mbOwnsStorage )
         pImpl->mxStorage->dispose();
 
     delete pImpl->mpTempObjectContainer;
@@ -1367,7 +1373,7 @@ sal_Bool EmbeddedObjectContainer::StoreAsChildren(sal_Bool _bOasisFormat,sal_Boo
                     xStream = GetGraphicStream( xObj, &aMediaType );
                 }
 
-                if ( !xStream.is() )
+                if ( !xStream.is() && getUserAllowsLinkUpdate() )
                 {
                     // the image must be regenerated
                     // TODO/LATER: another aspect could be used
@@ -1656,6 +1662,20 @@ sal_Bool EmbeddedObjectContainer::SetPersistentEntries(const uno::Reference< emb
     }
     return bError;
 }
+
+bool EmbeddedObjectContainer::getUserAllowsLinkUpdate() const
+{
+    return pImpl->mbUserAllowsLinkUpdate;
+}
+
+void EmbeddedObjectContainer::setUserAllowsLinkUpdate(bool bNew)
+{
+    if(pImpl->mbUserAllowsLinkUpdate != bNew)
+    {
+        pImpl->mbUserAllowsLinkUpdate = bNew;
+    }
+}
+
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/comphelper/embeddedobjectcontainer.hxx b/include/comphelper/embeddedobjectcontainer.hxx
index 7ce0566..443fd40 100644
--- a/include/comphelper/embeddedobjectcontainer.hxx
+++ b/include/comphelper/embeddedobjectcontainer.hxx
@@ -173,6 +173,9 @@ public:
     * \return <FALSE/> if no error occurred, otherwise <TRUE/>.
     */
     sal_Bool             SetPersistentEntries(const com::sun::star::uno::Reference< com::sun::star::embed::XStorage >& _xStorage,bool _bClearModifedFlag = true);
+
+    bool getUserAllowsLinkUpdate() const;
+    void setUserAllowsLinkUpdate(bool bNew);
 };
 
 }
diff --git a/sfx2/source/appl/linkmgr2.cxx b/sfx2/source/appl/linkmgr2.cxx
index e1e4606..878479f 100644
--- a/sfx2/source/appl/linkmgr2.cxx
+++ b/sfx2/source/appl/linkmgr2.cxx
@@ -328,7 +328,17 @@ void LinkManager::UpdateAllLinks(
         {
             int nRet = QueryBox( pParentWin, WB_YES_NO | WB_DEF_YES, SfxResId( STR_QUERY_UPDATE_LINKS ).toString() ).Execute();
             if( RET_YES != nRet )
-                return ;         // nothing should be updated
+            {
+                SfxObjectShell* pShell = pLink->GetLinkManager()->GetPersist();
+
+                if(pShell)
+                {
+                    comphelper::EmbeddedObjectContainer& rEmbeddedObjectContainer = pShell->getEmbeddedObjectContainer();
+                    rEmbeddedObjectContainer.setUserAllowsLinkUpdate(false);
+                }
+
+                return ;        // nothing should be updated
+            }
             bAskUpdate = false;  // once is enough
         }
 
diff --git a/svtools/source/misc/embedhlp.cxx b/svtools/source/misc/embedhlp.cxx
index fb5f3f2..3aa1f12 100644
--- a/svtools/source/misc/embedhlp.cxx
+++ b/svtools/source/misc/embedhlp.cxx
@@ -601,19 +601,30 @@ SvStream* EmbeddedObjectRef::GetGraphicStream( bool bUpdate ) const
     if ( !xStream.is() )
     {
         SAL_INFO( "svtools.misc", "getting stream from object" );
-        // update wanted or no stream in container storage available
-        xStream = GetGraphicReplacementStream(mpImpl->nViewAspect, mpImpl->mxObj, &mpImpl->aMediaType);
+        bool bUserAllowsLinkUpdate(true);
+        const comphelper::EmbeddedObjectContainer* pContainer = GetContainer();
 
-        if ( xStream.is() )
+        if(pContainer)
         {
-            if ( mpImpl->pContainer )
-                mpImpl->pContainer->InsertGraphicStream( xStream, mpImpl->aPersistName, mpImpl->aMediaType );
+            bUserAllowsLinkUpdate = pContainer->getUserAllowsLinkUpdate();
+        }
 
-            SvStream* pResult = ::utl::UcbStreamHelper::CreateStream( xStream );
-            if ( pResult && bUpdate )
-                mpImpl->bNeedUpdate = false;
+        if(bUserAllowsLinkUpdate)
+        {
+            // update wanted or no stream in container storage available
+            xStream = GetGraphicReplacementStream(mpImpl->nViewAspect, mpImpl->mxObj, &mpImpl->aMediaType);
 
-            return pResult;
+            if(xStream.is())
+            {
+                if (mpImpl->pContainer)
+                    mpImpl->pContainer->InsertGraphicStream(xStream,mpImpl->aPersistName,mpImpl->aMediaType);
+
+                SvStream* pResult = ::utl::UcbStreamHelper::CreateStream( xStream );
+                if (pResult && bUpdate)
+                    mpImpl->bNeedUpdate = false;
+
+                return pResult;
+            }
         }
     }
 


More information about the Libreoffice-commits mailing list