[ooo-build-commit] .: sc/source

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


 sc/source/core/data/documen8.cxx  |    2 ++
 sc/source/core/tool/interpr2.cxx  |    1 +
 sc/source/ui/docshell/docsh6.cxx  |    9 +++++++++
 sc/source/ui/docshell/servobj.cxx |    8 ++++++--
 sc/source/ui/inc/docsh.hxx        |    1 +
 5 files changed, 19 insertions(+), 2 deletions(-)

New commits:
commit 3ee0958e2350988b115729fae361563244fb750d
Author: Kohei Yoshida <kyoshida at novell.com>
Date:   Tue Oct 5 15:42:37 2010 -0400

    Ported dde-reconnect-on-load-*.diff from ooo-build.
    
    Improve reliability of DDE connections between documents opened in LO.
    With this change, LO tries to reconnect to a DDE server document upon
    opening if that server document is being listened to by one of the
    open documents.
    
    Also, the old implementation would load a DDE server document
    invisible, and would never close it when the user updates the link.
    This had the consequence that when the user tries to open this
    document while it's loaded hidden, it causes some weird focus issues,
    and closing it and opening it again would disconnect the DDE
    connection.  The new implementation closes the server document
    immediately after the DDE link update is complete.
    
    This change also fixes a bug in Calc where DDE link updates to cells
    would fail when the formula syntax is set to something other than Calc
    A1.

diff --git a/sc/source/core/data/documen8.cxx b/sc/source/core/data/documen8.cxx
index bc2bf8c..778d1d1 100644
--- a/sc/source/core/data/documen8.cxx
+++ b/sc/source/core/data/documen8.cxx
@@ -1089,6 +1089,7 @@ void ScDocument::UpdateDdeLinks()
             if (pBase->ISA(ScDdeLink))
                 ((ScDdeLink*)pBase)->TryUpdate();       // bei DDE-Links TryUpdate statt Update
         }
+        pLinkManager->CloseCachedComps();
     }
 }
 
@@ -1118,6 +1119,7 @@ BOOL ScDocument::UpdateDdeLink( const String& rAppl, const String& rTopic, const
                 }
             }
         }
+        pLinkManager->CloseCachedComps();
     }
     return bFound;
 }
diff --git a/sc/source/core/tool/interpr2.cxx b/sc/source/core/tool/interpr2.cxx
index 09b6408..b560f93 100644
--- a/sc/source/core/tool/interpr2.cxx
+++ b/sc/source/core/tool/interpr2.cxx
@@ -2218,6 +2218,7 @@ void ScInterpreter::ScDde()
             PushNA();
 
         pDok->DisableIdle( bOldDis );
+        pLinkMgr->CloseCachedComps();
     }
 }
 
diff --git a/sc/source/ui/docshell/docsh6.cxx b/sc/source/ui/docshell/docsh6.cxx
index 3dc6d5a..b282d4f 100644
--- a/sc/source/ui/docshell/docsh6.cxx
+++ b/sc/source/ui/docshell/docsh6.cxx
@@ -386,6 +386,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 a/sc/source/ui/docshell/servobj.cxx b/sc/source/ui/docshell/servobj.cxx
index 1d69e26..4790d68 100644
--- a/sc/source/ui/docshell/servobj.cxx
+++ b/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 a/sc/source/ui/inc/docsh.hxx b/sc/source/ui/inc/docsh.hxx
index b04d55e..e021e9a 100644
--- a/sc/source/ui/inc/docsh.hxx
+++ b/sc/source/ui/inc/docsh.hxx
@@ -320,6 +320,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)
 


More information about the ooo-build-commit mailing list