[ooo-build-commit] .: Branch 'ooo-build-3-2-1' - patches/dev300

Kohei Yoshida kohei at kemper.freedesktop.org
Thu Jul 8 19:23:55 PDT 2010


 patches/dev300/apply                           |   27 ++--
 patches/dev300/dde-reconnect-on-load-sc.diff   |   61 ++++++++++
 patches/dev300/dde-reconnect-on-load-sfx2.diff |   55 +++++++++
 patches/dev300/dde-reconnect-on-load-svx.diff  |  152 +++++++++++++++++++++++++
 patches/dev300/dde-reconnect-on-load-sw.diff   |   38 ++++++
 5 files changed, 322 insertions(+), 11 deletions(-)

New commits:
commit bbe8d2c4111a1d0bba912658233b13796a883fb0
Author: Kohei Yoshida <kyoshida at novell.com>
Date:   Thu Jul 8 22:18:18 2010 -0400

    Re-establish DDE linkage upon loading source documents.
    
    When opening a source document that is the server of a DDE
    linkage of another document, automatically re-establish
    linkage to allow automatic updates.  This patch also fixes
    the source document opeing read-only, and also a bug in
    reference parsing when the source document was a Calc
    document.
    
    This corresponds with n#618846 and n#618864.  Disabled in the
    default build.  To use, enable [ CalcExperimental ] section.
    
    * patches/dev300/apply:
    * patches/dev300/dde-reconnect-on-load-sc.diff:
    * patches/dev300/dde-reconnect-on-load-sfx2.diff:
    * patches/dev300/dde-reconnect-on-load-svx.diff:
    * patches/dev300/dde-reconnect-on-load-sw.diff:

diff --git a/patches/dev300/apply b/patches/dev300/apply
index 2b34a8c..ab452bd 100644
--- a/patches/dev300/apply
+++ b/patches/dev300/apply
@@ -3441,17 +3441,6 @@ oox-pptx-export-blip-luminance.diff, n#497570, rodo
 [ Experimental ]
 experimental_ooapi.diff, flr
 
-[ CalcExperimental ]
-# It's empty but please don't remove this section.
-SectionOwner => kohei
-                                                                           
-# when reading csv file, don't read multiple physical lines for one logical
-# line even if matching quotes are on separate lines.                      
-#stream-read-csv-always-single-line.diff, n#523517, kohei                   
-
-# Set file name as the sheet name when importing Excel 2.1 worksheet file.
-calc-xls-import-biff2-file-sheet-name.diff, n#612902, kohei
-
 
 [ AutoLayout ]
 impress-autolayout.diff, cocofan
@@ -4075,3 +4064,19 @@ emf+-canvas-vcl-clear.diff, rodo
 
 [ OpenGLTransitions ]
 transogl-transitions-newsflash-pptin.diff
+
+[ CalcExperimental ]
+SectionOwner => kohei
+                                                                           
+# when reading csv file, don't read multiple physical lines for one logical
+# line even if matching quotes are on separate lines.                      
+#stream-read-csv-always-single-line.diff, n#523517, kohei                   
+
+# Set file name as the sheet name when importing Excel 2.1 worksheet file.
+calc-xls-import-biff2-file-sheet-name.diff, n#612902, kohei
+
+# 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-svx.diff,  n#618846, n#618864, kohei
+dde-reconnect-on-load-sfx2.diff, n#618846, n#618864, kohei
diff --git a/patches/dev300/dde-reconnect-on-load-sc.diff b/patches/dev300/dde-reconnect-on-load-sc.diff
new file mode 100644
index 0000000..5f0844f
--- /dev/null
+++ b/patches/dev300/dde-reconnect-on-load-sc.diff
@@ -0,0 +1,61 @@
+diff --git sc/source/ui/docshell/docsh6.cxx sc/source/ui/docshell/docsh6.cxx
+index 84796f6..1fbb8c3 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)
++{
++    SvxLinkManager* pLinkManager = aDocument.GetLinkManager();
++    if (!pLinkManager)
++        return;
++
++    pLinkManager->ReconnectDdeLink(rServer);
++}
++
+ void ScDocShell::UpdateLinks()
+ {
+     SvxLinkManager* pLinkManager = aDocument.GetLinkManager();
+diff --git sc/source/ui/docshell/servobj.cxx sc/source/ui/docshell/servobj.cxx
+index 7eb2e3b..6d1b687 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 b10c3f3..ad35e38 100644
+--- sc/source/ui/inc/docsh.hxx
++++ sc/source/ui/inc/docsh.hxx
+@@ -326,6 +326,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
new file mode 100644
index 0000000..4a6d731
--- /dev/null
+++ b/patches/dev300/dde-reconnect-on-load-sfx2.diff
@@ -0,0 +1,55 @@
+diff --git sfx2/inc/sfx2/objsh.hxx sfx2/inc/sfx2/objsh.hxx
+index a1396a3..4faccea 100644
+--- sfx2/inc/sfx2/objsh.hxx
++++ sfx2/inc/sfx2/objsh.hxx
+@@ -528,6 +528,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();
+diff --git sfx2/source/appl/appdde.cxx sfx2/source/appl/appdde.cxx
+index 3cc38c9..ce4fe23 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/doc/objstor.cxx sfx2/source/doc/objstor.cxx
+index 89e1618..4f4c540 100644
+--- sfx2/source/doc/objstor.cxx
++++ sfx2/source/doc/objstor.cxx
+@@ -1011,6 +1011,8 @@ sal_Bool SfxObjectShell::DoLoad( SfxMedium *pMed )
+             }
+         }
+ 
++        ReconnectDdeLinks(*this);
++
+ #if 0
+         if ( pMedium->HasStorage_Impl() )
+         {
diff --git a/patches/dev300/dde-reconnect-on-load-svx.diff b/patches/dev300/dde-reconnect-on-load-svx.diff
new file mode 100644
index 0000000..278381e
--- /dev/null
+++ b/patches/dev300/dde-reconnect-on-load-svx.diff
@@ -0,0 +1,152 @@
+diff --git svx/inc/linkmgr.hxx svx/inc/linkmgr.hxx
+index b614aba..1b3142a 100644
+--- svx/inc/linkmgr.hxx
++++ svx/inc/linkmgr.hxx
+@@ -33,6 +33,7 @@
+ 
+ class Graphic;
+ class Size;
++class SfxObjectShell;
+ 
+ // Damit der Link ueber den Status der zu ladenen Grafik informierten werden
+ // verschickt das FileObject ein SvData, mit der FormatId
+@@ -63,6 +64,8 @@ public:
+             // falls am Link schon alles eingestellt ist !
+     BOOL InsertFileLink( sfx2::SvBaseLink& );
+ 
++    void ReconnectDdeLink(SfxObjectShell& rServer);
++
+         // erfrage die Strings fuer den Dialog
+     virtual BOOL GetDisplayNames( const sfx2::SvBaseLink*,
+                                     String* pType,
+diff --git svx/source/svxlink/linkmgr.cxx svx/source/svxlink/linkmgr.cxx
+index 0e2415f..03459c5 100644
+--- svx/source/svxlink/linkmgr.cxx
++++ svx/source/svxlink/linkmgr.cxx
+@@ -57,6 +57,9 @@
+ #include <svx/dialogs.hrc>
+ #include "unolingu.hxx"
+ 
++using ::rtl::OUString;
++using ::rtl::OUStringBuffer;
++
+ class SvxInternalLink : public sfx2::SvLinkSource
+ {
+ public:
+@@ -107,6 +110,49 @@ BOOL SvxLinkManager::InsertFileLink( sfx2::SvBaseLink& rLink,
+                                     sfx2::LINKUPDATE_ONCALL, &sCmd );
+ }
+ 
++void SvxLinkManager::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"))
++            continue;
++
++        OUStringBuffer aBuf;
++        aBuf.appendAscii("file://");
++        aBuf.append(aFile);
++        if (!aBuf.makeStringAndClear().equalsIgnoreAsciiCase(pMed->GetName()))
++            // This DDE link is not associated with this server shell...  Skip it.
++            continue;
++
++        if (!aLink.Len())
++            continue;
++
++        // Reconnect the server document shell to this DDE link object.
++        ::sfx2::SvLinkSource* pSrvSrc = rServer.DdeCreateLinkSource(aLink);
++        if (pSrvSrc)
++        {
++            ::com::sun::star::datatransfer::DataFlavor aFl;
++            SotExchange::GetFormatDataFlavor(p->GetContentType(), aFl);
++            p->SetObj(pSrvSrc);
++            pSrvSrc->AddDataAdvise(
++                p, aFl.MimeType,
++                sfx2::LINKUPDATE_ONCALL == p->GetUpdateMode() ? ADVISEMODE_ONLYONCE : 0);
++        }
++    }
++}
++
+ BOOL SvxLinkManager::InsertFileLink( sfx2::SvBaseLink& rLink )
+ {
+     if( OBJECT_CLIENT_FILE == ( OBJECT_CLIENT_FILE & rLink.GetObjType() ))
+@@ -338,7 +384,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 );
+@@ -353,7 +415,7 @@ 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);
+ 
+             // #i14200# (DDE-link crashes wordprocessor)
+             SfxAllItemSet aArgs( SFX_APP()->GetPool() );
+@@ -365,28 +427,13 @@ BOOL SvxInternalLink::Connect( sfx2::SvBaseLink* pLink )
+             aArgs.Put(aUpdate);
+             aArgs.Put(aReadOnly);
+             pFndShell = SfxObjectShell::CreateAndLoadObject( aArgs );
+-        }
+-    }
+-
+-    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 );
++            // When loading a new document, DDE links get connected during the loading.
++            return true;
+         }
+     }
+-    return bRet;
++
++    return false;
+ }
+ 
+ 
diff --git a/patches/dev300/dde-reconnect-on-load-sw.diff b/patches/dev300/dde-reconnect-on-load-sw.diff
new file mode 100644
index 0000000..a053d8b
--- /dev/null
+++ b/patches/dev300/dde-reconnect-on-load-sw.diff
@@ -0,0 +1,38 @@
+diff --git sw/inc/docsh.hxx sw/inc/docsh.hxx
+index eb116ef..f64d7ef 100644
+--- sw/inc/docsh.hxx
++++ sw/inc/docsh.hxx
+@@ -235,6 +235,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 8ff7f79..7fd0d25 100644
+--- sw/source/ui/app/docsh2.cxx
++++ sw/source/ui/app/docsh2.cxx
+@@ -75,6 +75,7 @@
+ #include <svx/svxacorr.hxx>
+ #include <svx/langitem.hxx>
+ #include <svx/fmshell.hxx>
++#include <svx/linkmgr.hxx>
+ 
+ #include <svx/htmlcfg.hxx>
+ #include <svx/ofaitem.hxx>
+@@ -1607,6 +1608,12 @@ long SwDocShell::DdeSetData( const String& rItem, const String& rMimeType,
+     return pDoc->CreateLinkSource( rItem );
+ }
+ 
++void SwDocShell::ReconnectDdeLink(SfxObjectShell& rServer)
++{
++    SvxLinkManager& rLinkManager = pDoc->GetLinkManager();
++    rLinkManager.ReconnectDdeLink(rServer);
++}
++
+ /*--------------------------------------------------------------------
+     Beschreibung:
+  --------------------------------------------------------------------*/


More information about the ooo-build-commit mailing list