[ooo-build-commit] .: patches/dev300

Kohei Yoshida kohei at kemper.freedesktop.org
Tue Oct 5 12:43:51 PDT 2010


 patches/dev300/apply                           |    6 
 patches/dev300/dde-reconnect-on-load-cui.diff  |   13 
 patches/dev300/dde-reconnect-on-load-sc.diff   |   93 ----
 patches/dev300/dde-reconnect-on-load-sfx2.diff |  478 -------------------------
 patches/dev300/dde-reconnect-on-load-sw.diff   |   38 -
 5 files changed, 628 deletions(-)

New commits:
commit 21d9fe760340e38a5e62b6966c3f89ca6042e140
Author: Kohei Yoshida <kyoshida at novell.com>
Date:   Tue Oct 5 15:43:18 2010 -0400

    Removed dde-reconnect-on-load-*.diff; moved to git.

diff --git a/patches/dev300/apply b/patches/dev300/apply
index 2443e38..f86518a 100644
--- a/patches/dev300/apply
+++ b/patches/dev300/apply
@@ -2659,12 +2659,6 @@ calc-formula-db-function-fix.diff, n#594332, n#595713, kohei
 # Opening an xml file with xls extension
 sc-xml-with-xls-ext.diff, n#527738, muthusuba
 
-# Re-connect DDE linkage upon loading of source files.
-dde-reconnect-on-load-sc.diff,   n#618846, n#618864, kohei
-dde-reconnect-on-load-sw.diff,   n#618846, n#618864, kohei
-dde-reconnect-on-load-sfx2.diff, n#618846, n#618864, kohei
-dde-reconnect-on-load-cui.diff,  n#618846, n#618864, kohei
-
 # Properly display data field names in the data field options dialog.
 calc-dp-sort-fix.diff, n#629920, kohei
 
diff --git a/patches/dev300/dde-reconnect-on-load-cui.diff b/patches/dev300/dde-reconnect-on-load-cui.diff
deleted file mode 100644
index 2507465..0000000
--- a/patches/dev300/dde-reconnect-on-load-cui.diff
+++ /dev/null
@@ -1,13 +0,0 @@
-diff --git cui/source/dialogs/linkdlg.cxx cui/source/dialogs/linkdlg.cxx
-index 965aefe..a689d85 100644
---- cui/source/dialogs/linkdlg.cxx
-+++ cui/source/dialogs/linkdlg.cxx
-@@ -330,6 +330,8 @@ IMPL_LINK( SvBaseLinksDlg, UpdateNowClickHdl, PushButton *, EMPTYARG )
-             rListBox.Select( pE );
-             rListBox.MakeVisible( pE );
-         }
-+
-+        pNewMgr->CloseCachedComps();
-     }
-     return 0;
- }
diff --git a/patches/dev300/dde-reconnect-on-load-sc.diff b/patches/dev300/dde-reconnect-on-load-sc.diff
deleted file mode 100644
index 40e018f..0000000
--- a/patches/dev300/dde-reconnect-on-load-sc.diff
+++ /dev/null
@@ -1,93 +0,0 @@
-diff --git sc/source/core/data/documen8.cxx sc/source/core/data/documen8.cxx
-index 1daa520..b210025 100644
---- sc/source/core/data/documen8.cxx
-+++ sc/source/core/data/documen8.cxx
-@@ -1097,6 +1097,7 @@ void ScDocument::UpdateDdeLinks()
-             if (pBase->ISA(ScDdeLink))
-                 ((ScDdeLink*)pBase)->TryUpdate();       // bei DDE-Links TryUpdate statt Update
-         }
-+        pLinkManager->CloseCachedComps();
-     }
- }
- 
-@@ -1126,6 +1127,7 @@ BOOL ScDocument::UpdateDdeLink( const String& rAppl, const String& rTopic, const
-                 }
-             }
-         }
-+        pLinkManager->CloseCachedComps();
-     }
-     return bFound;
- }
-diff --git sc/source/core/tool/interpr2.cxx sc/source/core/tool/interpr2.cxx
-index 09b6408..b560f93 100644
---- sc/source/core/tool/interpr2.cxx
-+++ sc/source/core/tool/interpr2.cxx
-@@ -2218,6 +2218,7 @@ void ScInterpreter::ScDde()
-             PushNA();
- 
-         pDok->DisableIdle( bOldDis );
-+        pLinkMgr->CloseCachedComps();
-     }
- }
- 
-diff --git sc/source/ui/docshell/docsh6.cxx sc/source/ui/docshell/docsh6.cxx
-index bb7b82f..8d9a9f0 100644
---- sc/source/ui/docshell/docsh6.cxx
-+++ sc/source/ui/docshell/docsh6.cxx
-@@ -393,6 +393,15 @@ BOOL __EXPORT ScDocShell::Insert( SfxObjectShell &rSource,
-     return bRet;
- }
- 
-+void ScDocShell::ReconnectDdeLink(SfxObjectShell& rServer)
-+{
-+    ::sfx2::LinkManager* pLinkManager = aDocument.GetLinkManager();
-+    if (!pLinkManager)
-+        return;
-+
-+    pLinkManager->ReconnectDdeLink(rServer);
-+}
-+
- void ScDocShell::UpdateLinks()
- {
-     sfx2::LinkManager* pLinkManager = aDocument.GetLinkManager();
-diff --git sc/source/ui/docshell/servobj.cxx sc/source/ui/docshell/servobj.cxx
-index 1d69e26..4790d68 100644
---- sc/source/ui/docshell/servobj.cxx
-+++ sc/source/ui/docshell/servobj.cxx
-@@ -41,6 +41,8 @@
- #include "rangenam.hxx"
- #include "sc.hrc"				// SC_HINT_AREAS_CHANGED
- 
-+using namespace formula;
-+
- // -----------------------------------------------------------------------
- 
- BOOL lcl_FillRangeFromName( ScRange& rRange, ScDocShell* pDocSh, const String& rName )
-@@ -97,11 +99,13 @@ ScServerObject::ScServerObject( ScDocShell* pShell, const String& rItem ) :
-         SCTAB nTab = pDocSh->GetCurTab();
-         aRange.aStart.SetTab( nTab );
- 
--        if ( aRange.Parse( rItem, pDoc ) & SCA_VALID )
-+        // For DDE link, we always must parse references using OOO A1 convention.
-+
-+        if ( aRange.Parse( rItem, pDoc, FormulaGrammar::CONV_OOO ) & SCA_VALID )
-         {
-             // area reference
-         }
--        else if ( aRange.aStart.Parse( rItem, pDoc, pDoc->GetAddressConvention() ) & SCA_VALID )
-+        else if ( aRange.aStart.Parse( rItem, pDoc, FormulaGrammar::CONV_OOO ) & SCA_VALID )
-         {
-             // cell reference
-             aRange.aEnd = aRange.aStart;
-diff --git sc/source/ui/inc/docsh.hxx sc/source/ui/inc/docsh.hxx
-index d9d3629..7df6e9f 100755
---- sc/source/ui/inc/docsh.hxx
-+++ sc/source/ui/inc/docsh.hxx
-@@ -324,6 +324,7 @@ public:
-     ScDBData*       GetOldAutoDBRange();    // has to be deleted by caller!
-     void            CancelAutoDBRange();    // called when dialog is cancelled
- 
-+    virtual void    ReconnectDdeLink(SfxObjectShell& rServer);
-     void			UpdateLinks();			// Link-Eintraege aktuallisieren
-     BOOL			ReloadTabLinks();		// Links ausfuehren (Inhalt aktualisieren)
- 
diff --git a/patches/dev300/dde-reconnect-on-load-sfx2.diff b/patches/dev300/dde-reconnect-on-load-sfx2.diff
deleted file mode 100644
index f37559e..0000000
--- a/patches/dev300/dde-reconnect-on-load-sfx2.diff
+++ /dev/null
@@ -1,478 +0,0 @@
-diff --git sfx2/inc/sfx2/linkmgr.hxx sfx2/inc/sfx2/linkmgr.hxx
-index 6ff4e26..8bdcad9 100644
---- sfx2/inc/sfx2/linkmgr.hxx
-+++ sfx2/inc/sfx2/linkmgr.hxx
-@@ -33,10 +33,18 @@
- #include <tools/string.hxx>
- #include <svl/svarray.hxx>
- 
-+#include <vector>
-+
- class SfxObjectShell;
- class Graphic;
- class Size;
- 
-+namespace com { namespace sun { namespace star {
-+    namespace lang {
-+        class XComponent;
-+    }
-+}}}
-+
- namespace sfx2
- {
-     // Damit der Link ueber den Status der zu ladenen Grafik informierten werden
-@@ -55,6 +63,10 @@ SV_DECL_PTRARR( SvLinkSources, SvLinkSourcePtr, 1, 1 )
- 
- class SFX2_DLLPUBLIC LinkManager
- {
-+    typedef ::std::vector< ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent > >
-+        CompVector;
-+    CompVector maCachedComps;
-+
-     SvBaseLinks		aLinkTbl;
-     SvLinkSources aServerTbl;
- 
-@@ -74,6 +86,16 @@ public:
-                 LinkManager( SfxObjectShell * pCacheCont );
-                 ~LinkManager();
- 
-+    /**
-+     * Insert a component loaded during link update, which needs to be closed 
-+     * when the update is complete. 
-+     * 
-+     * @param xComp component loaded during link update.
-+     */
-+    void        InsertCachedComp(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent >& xComp);
-+
-+    void        CloseCachedComps();
-+
-     SfxObjectShell*    GetPersist() const              { return pPersist; }
-     void        SetPersist( SfxObjectShell * p )   { pPersist = p; }
- 
-@@ -100,6 +122,17 @@ public:
-             // falls am Link schon alles eingestellt ist !
-     BOOL InsertFileLink( sfx2::SvBaseLink& );
- 
-+    void ReconnectDdeLink(SfxObjectShell& rServer);
-+
-+    /**
-+     * Reconnect the server document shell to a DDE link object.
-+     * 
-+     * @param rPath path to the server document
-+     * @param rServer server document shell instance
-+     * @param rLink link object of the client document
-+     */
-+    void LinkServerShell(const ::rtl::OUString& rPath, SfxObjectShell& rServer, ::sfx2::SvBaseLink& rLink) const;
-+
-                 // erfrage die Strings fuer den Dialog
-     BOOL GetDisplayNames( const SvBaseLink *,
-                                     String* pType,
-diff --git sfx2/inc/sfx2/objsh.hxx sfx2/inc/sfx2/objsh.hxx
-index 5215f94..7337da9 100755
---- sfx2/inc/sfx2/objsh.hxx
-+++ sfx2/inc/sfx2/objsh.hxx
-@@ -127,6 +127,9 @@ namespace com { namespace sun { namespace star {
-     namespace document {
-         class XDocumentProperties;
-     }
-+    namespace lang {
-+        class XComponent;
-+    }
- } } }
- 
- typedef sal_uInt32 SfxObjectShellFlags;
-@@ -522,6 +525,9 @@ public:
-                                             const String& rMimeType,
-                                 const ::com::sun::star::uno::Any & rValue );
-     virtual ::sfx2::SvLinkSource* 		DdeCreateLinkSource( const String& rItem );
-+    virtual void                ReconnectDdeLink(SfxObjectShell& rServer);
-+
-+    static void                 ReconnectDdeLinks(SfxObjectShell& rServer);
- 
-     // Contents
-     virtual SfxStyleSheetBasePool*	GetStyleSheetPool();
-@@ -629,6 +635,9 @@ public:
-     static SfxObjectShell*		CreateObject( const String& rServiceName, SfxObjectCreateMode = SFX_CREATE_MODE_STANDARD );
-     static SfxObjectShell*		CreateObjectByFactoryName( const String& rURL, SfxObjectCreateMode = SFX_CREATE_MODE_STANDARD );
-     static SfxObjectShell*      CreateAndLoadObject( const SfxItemSet& rSet, SfxFrame* pFrame=0 );
-+    static ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent >
-+                                CreateAndLoadComponent( const SfxItemSet& rSet, SfxFrame* pFrame = NULL );
-+    static SfxObjectShell*      GetShellFromComponent( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent >& xComp );
-     static String				GetServiceNameFromFactory( const String& rFact );
-     BOOL						IsInPlaceActive();
-     BOOL						IsUIActive();
-diff --git sfx2/inc/sfx2/sfxsids.hrc sfx2/inc/sfx2/sfxsids.hrc
-index bf1cebb..a2f8d88 100644
---- sfx2/inc/sfx2/sfxsids.hrc
-+++ sfx2/inc/sfx2/sfxsids.hrc
-@@ -367,6 +367,7 @@
- #define SID_OPENCOPY                        (SID_SFX_START + 674)
- #define SID_SOURCEVIEW                      (SID_SFX_START + 675)
- #define SID_DOC_STARTPRESENTATION           (SID_SFX_START + 695)
-+#define SID_DDE_RECONNECT_ONLOAD            (SID_SFX_START + 696)
- 
- #define SID_PLUGFRAMEARG                    (SID_SFX_START + 666)
- #define SID_NEWWINDOWFOREDIT                (SID_SFX_START + 667)
-diff --git sfx2/source/appl/appdde.cxx sfx2/source/appl/appdde.cxx
-index 789de8b..6134d9d 100644
---- sfx2/source/appl/appdde.cxx
-+++ sfx2/source/appl/appdde.cxx
-@@ -365,6 +365,23 @@ long SfxObjectShell::DdeSetData
-     return 0;
- }
- 
-+void SfxObjectShell::ReconnectDdeLink(SfxObjectShell& /*rServer*/)
-+{
-+}
-+
-+void SfxObjectShell::ReconnectDdeLinks(SfxObjectShell& rServer)
-+{
-+    TypeId aType = TYPE(SfxObjectShell);
-+    SfxObjectShell* p = GetFirst(&aType, false);
-+    while (p)
-+    {
-+        if (&rServer != p)
-+            p->ReconnectDdeLink(rServer);
-+
-+        p = GetNext(*p, &aType, false);
-+    }
-+}
-+
- //========================================================================
- 
- long SfxViewFrame::DdeExecute
-diff --git sfx2/source/appl/appuno.cxx sfx2/source/appl/appuno.cxx
-index 091ffb8..bffd379 100755
---- sfx2/source/appl/appuno.cxx
-+++ sfx2/source/appl/appuno.cxx
-@@ -151,6 +151,7 @@ static char const sOpenNewView[] = "OpenNewView";
- static char const sViewId[] = "ViewId";
- static char const sPluginMode[] = "PluginMode";
- static char const sReadOnly[] = "ReadOnly";
-+static char const sDdeReconnect[] = "DDEReconnect";
- static char const sStartPresentation[] = "StartPresentation";
- static char const sFrameName[] = "FrameName";
- static char const sMediaType[] = "MediaType";
-@@ -610,6 +611,14 @@ void TransformParameters( sal_uInt16 nSlotId, const ::com::sun::star::uno::Seque
-                     if (bOK)
-                         rSet.Put( SfxBoolItem( SID_DOC_READONLY, bVal ) );
-                 }
-+                else if ( aName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(sDdeReconnect)) )
-+                {
-+                    sal_Bool bVal = sal_True;
-+                    sal_Bool bOK = (rProp.Value >>= bVal);
-+                    DBG_ASSERT( bOK, "invalid type for DDEReconnect" );
-+                    if (bOK)
-+                        rSet.Put( SfxBoolItem( SID_DDE_RECONNECT_ONLOAD, bVal ) );
-+                }
-                 else if ( aName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(sStartPresentation)) )
-                 {
-                     sal_Bool bVal = sal_False;
-@@ -1009,6 +1018,8 @@ void TransformItems( sal_uInt16 nSlotId, const SfxItemSet& rSet, ::com::sun::sta
-                 nAdditional++;
-             if ( rSet.GetItemState( SID_DOC_READONLY ) == SFX_ITEM_SET )
-                 nAdditional++;
-+            if ( rSet.GetItemState( SID_DDE_RECONNECT_ONLOAD ) == SFX_ITEM_SET )
-+                nAdditional++;
-             if ( rSet.GetItemState( SID_DOC_STARTPRESENTATION ) == SFX_ITEM_SET )
-                 nAdditional++;
-             if ( rSet.GetItemState( SID_SELECTION ) == SFX_ITEM_SET )
-@@ -1425,6 +1436,11 @@ void TransformItems( sal_uInt16 nSlotId, const SfxItemSet& rSet, ::com::sun::sta
-                 pValue[nActProp].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(sReadOnly));
-                 pValue[nActProp++].Value <<= ( ((SfxBoolItem*)pItem)->GetValue() );
-             }
-+            if ( rSet.GetItemState( SID_DDE_RECONNECT_ONLOAD, sal_False, &pItem ) == SFX_ITEM_SET )
-+            {
-+                pValue[nActProp].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(sDdeReconnect));
-+                pValue[nActProp++].Value <<= ( ((SfxBoolItem*)pItem)->GetValue() );
-+            }
-             if ( rSet.GetItemState( SID_DOC_STARTPRESENTATION, sal_False, &pItem ) == SFX_ITEM_SET )
-             {
-                 pValue[nActProp].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(sStartPresentation));
-diff --git sfx2/source/appl/linkmgr2.cxx sfx2/source/appl/linkmgr2.cxx
-index 7653637..9011c39 100644
---- sfx2/source/appl/linkmgr2.cxx
-+++ sfx2/source/appl/linkmgr2.cxx
-@@ -55,6 +55,16 @@
- #define _SVSTDARR_STRINGSDTOR
- #include <svl/svstdarr.hxx>
- 
-+#include <com/sun/star/lang/XComponent.hpp>
-+#include <com/sun/star/util/XCloseable.hpp>
-+
-+using ::com::sun::star::uno::UNO_QUERY;
-+using ::com::sun::star::uno::Reference;
-+using ::com::sun::star::lang::XComponent;
-+using ::com::sun::star::util::XCloseable;
-+using ::rtl::OUString;
-+using ::rtl::OUStringBuffer;
-+
- namespace sfx2
- {
- 
-@@ -89,6 +99,24 @@ LinkManager::~LinkManager()
-     }
- }
- 
-+void LinkManager::InsertCachedComp(const Reference<XComponent>& xComp)
-+{
-+    maCachedComps.push_back(xComp);
-+}
-+
-+void LinkManager::CloseCachedComps()
-+{
-+    CompVector::iterator itr = maCachedComps.begin(), itrEnd = maCachedComps.end();
-+    for (; itr != itrEnd; ++itr)
-+    {
-+        Reference<XCloseable> xCloseable(*itr, UNO_QUERY);
-+        if (!xCloseable.is())
-+            continue;
-+
-+        xCloseable->close(true);
-+    }
-+    maCachedComps.clear();
-+}
- 
- /************************************************************************
- |*    LinkManager::Remove()
-@@ -329,6 +357,7 @@ void LinkManager::UpdateAllLinks(
- 
-         pLink->Update();
-     }
-+    CloseCachedComps();
- }
- 
- /************************************************************************
-@@ -387,6 +416,56 @@ void MakeLnkName( String& rName, const String* pType, const String& rFile,
-         ((rName += cTokenSeperator ) += *pFilter).EraseLeadingChars().EraseTrailingChars();
- }
- 
-+void LinkManager::ReconnectDdeLink(SfxObjectShell& rServer)
-+{
-+    SfxMedium* pMed = rServer.GetMedium();
-+    if (!pMed)
-+        return;
-+
-+    const ::sfx2::SvBaseLinks& rLinks = GetLinks();
-+    sal_uInt16 n = rLinks.Count();
-+
-+    for (sal_uInt16 i = 0; i < n; ++i)
-+    {
-+        ::sfx2::SvBaseLink* p = *rLinks[i];
-+        String aType, aFile, aLink, aFilter;
-+        if (!GetDisplayNames(p, &aType, &aFile, &aLink, &aFilter))
-+            continue;
-+
-+        if (!aType.EqualsAscii("soffice"))
-+            // DDE connections between OOo apps are always named 'soffice'.
-+            continue;
-+
-+        String aTmp;
-+        OUString aURL = aFile;
-+        if (utl::LocalFileHelper::ConvertPhysicalNameToURL(aFile, aTmp))
-+            aURL = aTmp;
-+
-+        if (!aURL.equalsIgnoreAsciiCase(pMed->GetName()))
-+            // This DDE link is not associated with this server shell...  Skip it.
-+            continue;
-+
-+        if (!aLink.Len())
-+            continue;
-+
-+        LinkServerShell(aLink, rServer, *p);
-+    }
-+}
-+
-+void LinkManager::LinkServerShell(const OUString& rPath, SfxObjectShell& rServer, ::sfx2::SvBaseLink& rLink) const
-+{
-+    ::sfx2::SvLinkSource* pSrvSrc = rServer.DdeCreateLinkSource(rPath);
-+    if (pSrvSrc)
-+    {
-+        ::com::sun::star::datatransfer::DataFlavor aFl;
-+        SotExchange::GetFormatDataFlavor(rLink.GetContentType(), aFl);
-+        rLink.SetObj(pSrvSrc);
-+        pSrvSrc->AddDataAdvise(
-+            &rLink, aFl.MimeType,
-+            sfx2::LINKUPDATE_ONCALL == rLink.GetUpdateMode() ? ADVISEMODE_ONLYONCE : 0);
-+    }
-+}
-+
- BOOL LinkManager::InsertFileLink( sfx2::SvBaseLink& rLink,
-                                     USHORT nFileType,
-                                     const String& rFileNm,
-@@ -511,9 +590,8 @@ BOOL SvxInternalLink::Connect( sfx2::SvBaseLink* pLink )
-     SfxObjectShell* pFndShell = 0;
-     USHORT nUpdateMode = com::sun::star::document::UpdateDocMode::NO_UPDATE;
-     String sTopic, sItem, sReferer;
--    if( pLink->GetLinkManager() &&
--        pLink->GetLinkManager()->GetDisplayNames( pLink, 0, &sTopic, &sItem )
--        && sTopic.Len() )
-+    LinkManager* pLinkMgr = pLink->GetLinkManager();
-+    if (pLinkMgr && pLinkMgr->GetDisplayNames(pLink, 0, &sTopic, &sItem) && sTopic.Len())
-     {
-         // erstmal nur ueber die DocumentShells laufen und die mit dem
-         // Namen heraussuchen:
-@@ -528,7 +606,7 @@ BOOL SvxInternalLink::Connect( sfx2::SvBaseLink* pLink )
-         TypeId aType( TYPE(SfxObjectShell) );
- 
-         BOOL bFirst = TRUE;
--        SfxObjectShell* pShell = pLink->GetLinkManager()->GetPersist();
-+        SfxObjectShell* pShell = pLinkMgr->GetPersist();
-         if( pShell && pShell->GetMedium() )
-         {
-             sReferer = pShell->GetMedium()->GetBaseURL();
-@@ -578,7 +656,23 @@ BOOL SvxInternalLink::Connect( sfx2::SvBaseLink* pLink )
-     if( !sTopic.Len() )
-         return FALSE;
- 
--    if( !pFndShell )
-+    if (pFndShell)
-+    {
-+        sfx2::SvLinkSource* pNewSrc = pFndShell->DdeCreateLinkSource( sItem );
-+        if( pNewSrc )
-+        {
-+            ::com::sun::star::datatransfer::DataFlavor aFl;
-+            SotExchange::GetFormatDataFlavor( pLink->GetContentType(), aFl );
-+
-+            pLink->SetObj( pNewSrc );
-+            pNewSrc->AddDataAdvise( pLink, aFl.MimeType,
-+                                sfx2::LINKUPDATE_ONCALL == pLink->GetUpdateMode()
-+                                    ? ADVISEMODE_ONLYONCE
-+                                    : 0 );
-+            return true;
-+        }
-+    }
-+    else
-     {
-         // dann versuche die Datei zu laden:
-         INetURLObject aURL( sTopic );
-@@ -593,7 +687,11 @@ BOOL SvxInternalLink::Connect( sfx2::SvBaseLink* pLink )
-             SfxStringItem aTarget( SID_TARGETNAME, String::CreateFromAscii("_blank") );
-             SfxStringItem aReferer( SID_REFERER, sReferer );
-             SfxUInt16Item aUpdate( SID_UPDATEDOCMODE, nUpdateMode );
--            SfxBoolItem aReadOnly(SID_DOC_READONLY, TRUE);
-+            SfxBoolItem aReadOnly(SID_DOC_READONLY, false);
-+
-+            // Disable automatic re-connection to avoid this link instance 
-+            // being destroyed at re-connection.
-+            SfxBoolItem aDdeConnect(SID_DDE_RECONNECT_ONLOAD, false);
- 
-             // #i14200# (DDE-link crashes wordprocessor)
-             SfxAllItemSet aArgs( SFX_APP()->GetPool() );
-@@ -604,29 +702,19 @@ BOOL SvxInternalLink::Connect( sfx2::SvBaseLink* pLink )
-             aArgs.Put(aName);
-             aArgs.Put(aUpdate);
-             aArgs.Put(aReadOnly);
--            pFndShell = SfxObjectShell::CreateAndLoadObject( aArgs );
-+            aArgs.Put(aDdeConnect);
-+            Reference<XComponent> xComp = SfxObjectShell::CreateAndLoadComponent(aArgs);
-+            pFndShell = SfxObjectShell::GetShellFromComponent(xComp);
-+            if (xComp.is() && pFndShell)
-+            {
-+                pLinkMgr->InsertCachedComp(xComp);
-+                pLinkMgr->LinkServerShell(sItem, *pFndShell, *pLink);
-+                return true;
-+            }
-         }
-     }
- 
--    BOOL bRet = FALSE;
--    if( pFndShell )
--    {
--        sfx2::SvLinkSource* pNewSrc = pFndShell->DdeCreateLinkSource( sItem );
--        if( pNewSrc )
--        {
--            bRet = TRUE;
--
--            ::com::sun::star::datatransfer::DataFlavor aFl;
--            SotExchange::GetFormatDataFlavor( pLink->GetContentType(), aFl );
--
--            pLink->SetObj( pNewSrc );
--            pNewSrc->AddDataAdvise( pLink, aFl.MimeType,
--                                sfx2::LINKUPDATE_ONCALL == pLink->GetUpdateMode()
--                                    ? ADVISEMODE_ONLYONCE
--                                    : 0 );
--        }
--    }
--    return bRet;
-+    return false;
- }
- 
- 
-diff --git sfx2/source/doc/objstor.cxx sfx2/source/doc/objstor.cxx
-index 474b4a0..7f3349d 100644
---- sfx2/source/doc/objstor.cxx
-+++ sfx2/source/doc/objstor.cxx
-@@ -974,6 +974,16 @@ sal_Bool SfxObjectShell::DoLoad( SfxMedium *pMed )
-             }
-         }
- 
-+        const SfxBoolItem* pDdeReconnectItem = static_cast<const SfxBoolItem*>(
-+            SfxRequest::GetItem(pMedium->GetItemSet(), SID_DDE_RECONNECT_ONLOAD, false, TYPE(SfxBoolItem)));
-+
-+        bool bReconnectDde = true; // by default, we try to auto-connect DDE connections.
-+        if (pDdeReconnectItem)
-+            bReconnectDde = pDdeReconnectItem->GetValue();
-+
-+        if (bReconnectDde)
-+            ReconnectDdeLinks(*this);
-+
- #if 0
-         if ( pMedium->HasStorage_Impl() )
-         {
-diff --git sfx2/source/doc/objxtor.cxx sfx2/source/doc/objxtor.cxx
-index 20d40e0..53af620 100755
---- sfx2/source/doc/objxtor.cxx
-+++ sfx2/source/doc/objxtor.cxx
-@@ -1079,6 +1079,12 @@ SfxObjectShell* SfxObjectShell::CreateObject( const String& rServiceName, SfxObj
- 
- SfxObjectShell* SfxObjectShell::CreateAndLoadObject( const SfxItemSet& rSet, SfxFrame* pFrame )
- {
-+    Reference<lang::XComponent> xComp = CreateAndLoadComponent(rSet, pFrame);
-+    return GetShellFromComponent(xComp);
-+}
-+
-+Reference<lang::XComponent> SfxObjectShell::CreateAndLoadComponent( const SfxItemSet& rSet, SfxFrame* pFrame )
-+{
-     uno::Sequence < beans::PropertyValue > aProps;
-     TransformItems( SID_OPENDOC, rSet, aProps );
-     SFX_ITEMSET_ARG(&rSet, pFileNameItem, SfxStringItem, SID_FILE_NAME, FALSE);
-@@ -1099,20 +1105,31 @@ SfxObjectShell* SfxObjectShell::CreateAndLoadObject( const SfxItemSet& rSet, Sfx
-         xLoader = uno::Reference < frame::XComponentLoader >( comphelper::getProcessServiceFactory()->createInstance(
-             ::rtl::OUString::createFromAscii("com.sun.star.frame.Desktop") ), uno::UNO_QUERY );
- 
--    uno::Reference < lang::XUnoTunnel > xObj;
-+    Reference <lang::XComponent> xComp;
-     try
-     {
--        xObj = uno::Reference< lang::XUnoTunnel >( xLoader->loadComponentFromURL( aURL, aTarget, 0, aProps ), uno::UNO_QUERY );
-+        xComp = xLoader->loadComponentFromURL(aURL, aTarget, 0, aProps);
-     }
-     catch( uno::Exception& )
-     {}
- 
--    if ( xObj.is() )
-+    return xComp;
-+}
-+
-+SfxObjectShell* SfxObjectShell::GetShellFromComponent( const Reference<lang::XComponent>& xComp )
-+{
-+    try
-+    {
-+        Reference<lang::XUnoTunnel> xTunnel(xComp, UNO_QUERY_THROW);
-+        Sequence <sal_Int8> aSeq( SvGlobalName( SFX_GLOBAL_CLASSID ).GetByteSequence() );
-+        sal_Int64 nHandle = xTunnel->getSomething( aSeq );
-+        if (!nHandle)
-+            return NULL;
-+
-+        return reinterpret_cast< SfxObjectShell* >(sal::static_int_cast< sal_IntPtr >(  nHandle ));
-+    }
-+    catch (const Exception&)
-     {
--        ::com::sun::star::uno::Sequence < sal_Int8 > aSeq( SvGlobalName( SFX_GLOBAL_CLASSID ).GetByteSequence() );
--        sal_Int64 nHandle = xObj->getSomething( aSeq );
--        if ( nHandle )
--            return reinterpret_cast< SfxObjectShell* >(sal::static_int_cast< sal_IntPtr >(  nHandle ));
-     }
- 
-     return NULL;
diff --git a/patches/dev300/dde-reconnect-on-load-sw.diff b/patches/dev300/dde-reconnect-on-load-sw.diff
deleted file mode 100644
index 8ada332..0000000
--- a/patches/dev300/dde-reconnect-on-load-sw.diff
+++ /dev/null
@@ -1,38 +0,0 @@
-diff --git sw/inc/docsh.hxx sw/inc/docsh.hxx
-index 6c2fd87..7a47dc2 100644
---- sw/inc/docsh.hxx
-+++ sw/inc/docsh.hxx
-@@ -238,6 +238,8 @@ public:
-     virtual long DdeSetData( const String& rItem, const String& rMimeType,
-                                 const ::com::sun::star::uno::Any & rValue );
-     virtual ::sfx2::SvLinkSource* DdeCreateLinkSource( const String& rItem );
-+    virtual void ReconnectDdeLink(SfxObjectShell& rServer);
-+
-     virtual void FillClass( SvGlobalName * pClassName,
-                                    sal_uInt32 * pClipFormat,
-                                    String * pAppName,
-diff --git sw/source/ui/app/docsh2.cxx sw/source/ui/app/docsh2.cxx
-index aa59379..3022ba2 100644
---- sw/source/ui/app/docsh2.cxx
-+++ sw/source/ui/app/docsh2.cxx
-@@ -64,6 +64,7 @@
- #include <editeng/svxacorr.hxx>
- #include <editeng/langitem.hxx>
- #include <svx/fmshell.hxx>
-+#include <sfx2/linkmgr.hxx>
- 
- #include <svtools/htmlcfg.hxx>
- #include <svx/ofaitem.hxx>
-@@ -1564,6 +1565,12 @@ long SwDocShell::DdeSetData( const String& rItem, const String& rMimeType,
-     return pDoc->CreateLinkSource( rItem );
- }
- 
-+void SwDocShell::ReconnectDdeLink(SfxObjectShell& rServer)
-+{
-+    ::sfx2::LinkManager& rLinkManager = pDoc->GetLinkManager();
-+    rLinkManager.ReconnectDdeLink(rServer);
-+}
-+
- /*--------------------------------------------------------------------
-     Beschreibung:
-  --------------------------------------------------------------------*/


More information about the ooo-build-commit mailing list