diff options
author | Eike Rathke <er@openoffice.org> | 2001-04-18 11:34:53 +0000 |
---|---|---|
committer | Eike Rathke <er@openoffice.org> | 2001-04-18 11:34:53 +0000 |
commit | 945c2e5d0efa0183f778d438824baf34013aea23 (patch) | |
tree | 1c89f35e3e02f5d4dfd807c0c5186df91b545528 /sc | |
parent | 08558e289cbfeb2ccf1e576f5bd8ccbcee3b8762 (diff) |
ScTableLink with refresh delay
Diffstat (limited to 'sc')
-rw-r--r-- | sc/inc/document.hxx | 7 | ||||
-rw-r--r-- | sc/inc/linkuno.hxx | 7 | ||||
-rw-r--r-- | sc/inc/table.hxx | 10 | ||||
-rw-r--r-- | sc/inc/tablink.hxx | 13 | ||||
-rw-r--r-- | sc/source/core/data/documen3.cxx | 27 | ||||
-rw-r--r-- | sc/source/core/data/table1.cxx | 7 | ||||
-rw-r--r-- | sc/source/filter/xml/XMLTableSourceContext.cxx | 13 | ||||
-rw-r--r-- | sc/source/ui/docshell/docfunc.cxx | 7 | ||||
-rw-r--r-- | sc/source/ui/docshell/docsh6.cxx | 10 | ||||
-rw-r--r-- | sc/source/ui/docshell/tablink.cxx | 28 | ||||
-rw-r--r-- | sc/source/ui/inc/undotab.hxx | 5 |
11 files changed, 88 insertions, 46 deletions
diff --git a/sc/inc/document.hxx b/sc/inc/document.hxx index 0b37cc6a668a..2754e2c8efa5 100644 --- a/sc/inc/document.hxx +++ b/sc/inc/document.hxx @@ -2,9 +2,9 @@ * * $RCSfile: document.hxx,v $ * - * $Revision: 1.32 $ + * $Revision: 1.33 $ * - * last change: $Author: nn $ $Date: 2001-04-06 14:29:40 $ + * last change: $Author: er $ $Date: 2001-04-18 12:34:53 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -618,9 +618,10 @@ public: const String& GetLinkFlt( USHORT nTab ) const; const String& GetLinkOpt( USHORT nTab ) const; const String& GetLinkTab( USHORT nTab ) const; + ULONG GetLinkRefreshDelay( USHORT nTab ) const; void SetLink( USHORT nTab, BYTE nMode, const String& rDoc, const String& rFilter, const String& rOptions, - const String& rTabName ); + const String& rTabName, ULONG nRefreshDelay ); BOOL HasLink( const String& rDoc, const String& rFilter, const String& rOptions ) const; BOOL LinkEmptyTab( USHORT& nTab, const String& aDocTab, diff --git a/sc/inc/linkuno.hxx b/sc/inc/linkuno.hxx index b71c7099b8a9..c81ea5e204ff 100644 --- a/sc/inc/linkuno.hxx +++ b/sc/inc/linkuno.hxx @@ -2,9 +2,9 @@ * * $RCSfile: linkuno.hxx,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: dr $ $Date: 2001-04-05 10:44:23 $ + * last change: $Author: er $ $Date: 2001-04-18 12:34:53 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -134,6 +134,7 @@ private: ScTableLink* GetLink_Impl() const; void Refreshed_Impl(); + void ModifyRefreshDelay_Impl( sal_Int32 nRefresh ); public: ScSheetLinkObj(ScDocShell* pDocSh, const String& rName); @@ -203,6 +204,8 @@ public: void setFilter(const ::rtl::OUString& Filter); ::rtl::OUString getFilterOptions(void) const; void setFilterOptions(const ::rtl::OUString& FilterOptions); + sal_Int32 getRefreshDelay(void) const; + void setRefreshDelay(sal_Int32 nRefreshDelay); // XServiceInfo virtual ::rtl::OUString SAL_CALL getImplementationName() diff --git a/sc/inc/table.hxx b/sc/inc/table.hxx index 414da5990abf..888eff76f88d 100644 --- a/sc/inc/table.hxx +++ b/sc/inc/table.hxx @@ -2,9 +2,9 @@ * * $RCSfile: table.hxx,v $ * - * $Revision: 1.9 $ + * $Revision: 1.10 $ * - * last change: $Author: nn $ $Date: 2001-03-23 09:48:27 $ + * last change: $Author: er $ $Date: 2001-04-18 12:34:53 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -127,6 +127,7 @@ private: String aLinkFlt; String aLinkOpt; String aLinkTab; + ULONG nLinkRefreshDelay; BYTE nLinkMode; // Seitenformatvorlage @@ -232,9 +233,10 @@ public: const String& GetLinkFlt() const { return aLinkFlt; } const String& GetLinkOpt() const { return aLinkOpt; } const String& GetLinkTab() const { return aLinkTab; } + ULONG GetLinkRefreshDelay() const { return nLinkRefreshDelay; } - void SetLink( BYTE nMode, const String& rDoc, const String& rFlt, const String& rOpt, - const String& rTab ); + void SetLink( BYTE nMode, const String& rDoc, const String& rFlt, + const String& rOpt, const String& rTab, ULONG nRefreshDelay ); void GetName( String& rName ) const; void SetName( const String& rNewName ); diff --git a/sc/inc/tablink.hxx b/sc/inc/tablink.hxx index b5a579585635..a9d7d17c7dbc 100644 --- a/sc/inc/tablink.hxx +++ b/sc/inc/tablink.hxx @@ -2,9 +2,9 @@ * * $RCSfile: tablink.hxx,v $ * - * $Revision: 1.3 $ + * $Revision: 1.4 $ * - * last change: $Author: jp $ $Date: 2001-03-08 20:45:14 $ + * last change: $Author: er $ $Date: 2001-04-18 12:34:53 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -81,6 +81,7 @@ private: String aFileName; String aFilterName; String aOptions; + ULONG nRefreshDelay; // refresh delay in seconds; 0 = off BOOL bInCreate; BOOL bAddUndo; BOOL bDoPaint; @@ -88,9 +89,9 @@ private: public: TYPEINFO(); ScTableLink( ScDocShell* pDocSh, const String& rFile, - const String& rFilter, const String& rOpt); + const String& rFilter, const String& rOpt, ULONG nRefresh ); ScTableLink( SfxObjectShell* pShell, const String& rFile, - const String& rFilter, const String& rOpt); + const String& rFilter, const String& rOpt, ULONG nRefresh ); virtual ~ScTableLink(); virtual void Closed(); virtual void DataChanged( const String& rMimeType, @@ -99,14 +100,16 @@ public: virtual BOOL Edit(Window* pParent); BOOL Refresh(const String& rNewFile, const String& rNewFilter, - const String* pNewOptions = NULL); + const String* pNewOptions /* = NULL */, ULONG nNewRefresh ); void SetInCreate(BOOL bSet) { bInCreate = bSet; } void SetAddUndo(BOOL bSet) { bAddUndo = bSet; } void SetPaint(BOOL bSet) { bDoPaint = bSet; } + void SetRefreshDelay(ULONG nRefresh) { nRefreshDelay = nRefresh; } const String& GetFileName() const { return aFileName; } const String& GetFilterName() const { return aFilterName; } const String& GetOptions() const { return aOptions; } + ULONG GetRefreshDelay() const { return nRefreshDelay; } BOOL IsUsed() const; }; diff --git a/sc/source/core/data/documen3.cxx b/sc/source/core/data/documen3.cxx index 802eaa6b0210..a3af51e95a28 100644 --- a/sc/source/core/data/documen3.cxx +++ b/sc/source/core/data/documen3.cxx @@ -2,9 +2,9 @@ * * $RCSfile: documen3.cxx,v $ * - * $Revision: 1.13 $ + * $Revision: 1.14 $ * - * last change: $Author: nn $ $Date: 2001-03-05 19:43:02 $ + * last change: $Author: er $ $Date: 2001-04-18 12:33:50 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -435,12 +435,19 @@ const String& ScDocument::GetLinkTab( USHORT nTab ) const return EMPTY_STRING; } +ULONG ScDocument::GetLinkRefreshDelay( USHORT nTab ) const +{ + if (nTab<=MAXTAB && pTab[nTab]) + return pTab[nTab]->GetLinkRefreshDelay(); + return 0; +} + void ScDocument::SetLink( USHORT nTab, BYTE nMode, const String& rDoc, const String& rFilter, const String& rOptions, - const String& rTabName ) + const String& rTabName, ULONG nRefreshDelay ) { if (nTab<=MAXTAB && pTab[nTab]) - pTab[nTab]->SetLink( nMode, rDoc, rFilter, rOptions, rTabName ); + pTab[nTab]->SetLink( nMode, rDoc, rFilter, rOptions, rTabName, nRefreshDelay ); } BOOL ScDocument::HasLink( const String& rDoc, @@ -477,11 +484,13 @@ BOOL ScDocument::LinkEmptyTab( USHORT& rTab, const String& aDocTab, } rTab = GetTableCount() - 1; + ULONG nRefreshDelay = 0; + BOOL bWasThere = HasLink( aFileName, aFilterName, aOptions ); - SetLink( rTab, SC_LINK_VALUE, aFileName, aFilterName, aOptions, aTabName ); + SetLink( rTab, SC_LINK_VALUE, aFileName, aFilterName, aOptions, aTabName, nRefreshDelay ); if ( !bWasThere ) // Link pro Quelldokument nur einmal eintragen { - ScTableLink* pLink = new ScTableLink( pShell, aFileName, aFilterName, aOptions ); + ScTableLink* pLink = new ScTableLink( pShell, aFileName, aFilterName, aOptions, nRefreshDelay ); pLink->SetInCreate( TRUE ); pLinkManager->InsertFileLink( *pLink, OBJECT_CLIENT_FILE, aFileName, &aFilterName ); @@ -527,11 +536,13 @@ BOOL ScDocument::LinkExternalTab( USHORT& rTab, const String& aDocTab, else return FALSE; + ULONG nRefreshDelay = 0; + BOOL bWasThere = HasLink( aFileName, aFilterName, aOptions ); - SetLink( rTab, SC_LINK_VALUE, aFileName, aFilterName, aOptions, aTabName ); + SetLink( rTab, SC_LINK_VALUE, aFileName, aFilterName, aOptions, aTabName, nRefreshDelay ); if ( !bWasThere ) // Link pro Quelldokument nur einmal eintragen { - ScTableLink* pLink = new ScTableLink( pShell, aFileName, aFilterName, aOptions ); + ScTableLink* pLink = new ScTableLink( pShell, aFileName, aFilterName, aOptions, nRefreshDelay ); pLink->SetInCreate( TRUE ); pLinkManager->InsertFileLink( *pLink, OBJECT_CLIENT_FILE, aFileName, &aFilterName ); diff --git a/sc/source/core/data/table1.cxx b/sc/source/core/data/table1.cxx index 14b10d4a9c15..a469cacf0bda 100644 --- a/sc/source/core/data/table1.cxx +++ b/sc/source/core/data/table1.cxx @@ -2,9 +2,9 @@ * * $RCSfile: table1.cxx,v $ * - * $Revision: 1.4 $ + * $Revision: 1.5 $ * - * last change: $Author: er $ $Date: 2001-03-14 15:57:39 $ + * last change: $Author: er $ $Date: 2001-04-18 12:33:50 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -277,13 +277,14 @@ void ScTable::SetScenario( BOOL bFlag ) void ScTable::SetLink( BYTE nMode, const String& rDoc, const String& rFlt, const String& rOpt, - const String& rTab ) + const String& rTab, ULONG nRefreshDelay ) { nLinkMode = nMode; aLinkDoc = rDoc; // Datei aLinkFlt = rFlt; // Filter aLinkOpt = rOpt; // Filter-Optionen aLinkTab = rTab; // Tabellenname in Quelldatei + nLinkRefreshDelay = nRefreshDelay; // refresh delay in seconds, 0==off } USHORT ScTable::GetOptimalColWidth( USHORT nCol, OutputDevice* pDev, diff --git a/sc/source/filter/xml/XMLTableSourceContext.cxx b/sc/source/filter/xml/XMLTableSourceContext.cxx index f6f0364202e5..ce76a4237623 100644 --- a/sc/source/filter/xml/XMLTableSourceContext.cxx +++ b/sc/source/filter/xml/XMLTableSourceContext.cxx @@ -2,9 +2,9 @@ * * $RCSfile: XMLTableSourceContext.cxx,v $ * - * $Revision: 1.3 $ + * $Revision: 1.4 $ * - * last change: $Author: nn $ $Date: 2001-03-16 14:16:30 $ + * last change: $Author: er $ $Date: 2001-04-18 12:31:39 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -180,7 +180,14 @@ void ScXMLTableSourceContext::EndElement() else if ( nMode == sheet::SheetLinkMode_VALUE ) nLinkMode = SC_LINK_VALUE; - pDoc->SetLink( GetScImport().GetTables().GetCurrentSheet(), nLinkMode, aFileString, aFilterString, aOptString, aSheetString ); +//!!!!!!! +//! TODO: (erAck 17.04.01) store and load refresh delay +//!!!!!!! + ULONG nLinkRefreshDelay = 0; + + pDoc->SetLink( GetScImport().GetTables().GetCurrentSheet(), + nLinkMode, aFileString, aFilterString, aOptString, + aSheetString, nLinkRefreshDelay ); } } } diff --git a/sc/source/ui/docshell/docfunc.cxx b/sc/source/ui/docshell/docfunc.cxx index 89456e337221..8841340e23f1 100644 --- a/sc/source/ui/docshell/docfunc.cxx +++ b/sc/source/ui/docshell/docfunc.cxx @@ -2,9 +2,9 @@ * * $RCSfile: docfunc.cxx,v $ * - * $Revision: 1.14 $ + * $Revision: 1.15 $ * - * last change: $Author: dr $ $Date: 2001-04-05 10:48:47 $ + * last change: $Author: er $ $Date: 2001-04-18 12:30:51 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -1980,7 +1980,8 @@ BOOL ScDocFunc::DeleteTable( USHORT nTab, BOOL bRecord, BOOL bApi ) if (bWasLinked) pUndoDoc->SetLink( nTab, pDoc->GetLinkMode(nTab), pDoc->GetLinkDoc(nTab), pDoc->GetLinkFlt(nTab), pDoc->GetLinkOpt(nTab), - pDoc->GetLinkTab(nTab) ); + pDoc->GetLinkTab(nTab), + pDoc->GetLinkRefreshDelay(nTab) ); if ( pDoc->IsScenario(nTab) ) { diff --git a/sc/source/ui/docshell/docsh6.cxx b/sc/source/ui/docshell/docsh6.cxx index a69fc60cf3de..0accbfe6edd6 100644 --- a/sc/source/ui/docshell/docsh6.cxx +++ b/sc/source/ui/docshell/docsh6.cxx @@ -2,9 +2,9 @@ * * $RCSfile: docsh6.cxx,v $ * - * $Revision: 1.4 $ + * $Revision: 1.5 $ * - * last change: $Author: jp $ $Date: 2001-03-08 20:49:42 $ + * last change: $Author: er $ $Date: 2001-04-18 12:30:51 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -515,12 +515,16 @@ void ScDocShell::UpdateLinks() String aDocName = aDocument.GetLinkDoc(i); String aFltName = aDocument.GetLinkFlt(i); String aOptions = aDocument.GetLinkOpt(i); + ULONG nRefresh = aDocument.GetLinkRefreshDelay(i); BOOL bThere = FALSE; for (USHORT j=0; j<i && !bThere; j++) // im Dokument mehrfach? if (aDocument.IsLinked(j) && aDocument.GetLinkDoc(j) == aDocName && aDocument.GetLinkFlt(j) == aFltName && aDocument.GetLinkOpt(j) == aOptions) + // Ignore refresh delay in compare, it should be the + // same for identical links and we don't want dupes + // if it ain't. bThere = TRUE; if (!bThere) // schon als Filter eingetragen? @@ -534,7 +538,7 @@ void ScDocShell::UpdateLinks() } if (!bThere) { - ScTableLink* pLink = new ScTableLink( this, aDocName, aFltName, aOptions ); + ScTableLink* pLink = new ScTableLink( this, aDocName, aFltName, aOptions, nRefresh ); pLink->SetInCreate( TRUE ); pLinkManager->InsertFileLink( *pLink, OBJECT_CLIENT_FILE, aDocName, &aFltName ); pLink->Update(); diff --git a/sc/source/ui/docshell/tablink.cxx b/sc/source/ui/docshell/tablink.cxx index 03cbb46110d4..8a0671054017 100644 --- a/sc/source/ui/docshell/tablink.cxx +++ b/sc/source/ui/docshell/tablink.cxx @@ -2,9 +2,9 @@ * * $RCSfile: tablink.cxx,v $ * - * $Revision: 1.6 $ + * $Revision: 1.7 $ * - * last change: $Author: er $ $Date: 2001-03-14 16:18:20 $ + * last change: $Author: er $ $Date: 2001-04-18 12:30:51 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -100,12 +100,14 @@ TYPEINIT1(ScTableLink, ::so3::SvBaseLink); //------------------------------------------------------------------------ ScTableLink::ScTableLink(ScDocShell* pDocSh, const String& rFile, - const String& rFilter, const String& rOpt): + const String& rFilter, const String& rOpt, + ULONG nRefresh ): ::so3::SvBaseLink(LINKUPDATE_ONCALL,FORMAT_FILE), pDocShell(pDocSh), aFileName(rFile), aFilterName(rFilter), aOptions(rOpt), + nRefreshDelay(nRefresh), bInCreate( FALSE ), bAddUndo( TRUE ), bDoPaint( TRUE ) @@ -113,12 +115,14 @@ ScTableLink::ScTableLink(ScDocShell* pDocSh, const String& rFile, } ScTableLink::ScTableLink(SfxObjectShell* pShell, const String& rFile, - const String& rFilter, const String& rOpt): + const String& rFilter, const String& rOpt, + ULONG nRefresh ): ::so3::SvBaseLink(LINKUPDATE_ONCALL,FORMAT_FILE), pDocShell((ScDocShell*)pShell), aFileName(rFile), aFilterName(rFilter), aOptions(rOpt), + nRefreshDelay(nRefresh), bInCreate( FALSE ), bAddUndo( TRUE ), bDoPaint( TRUE ) @@ -134,7 +138,7 @@ __EXPORT ScTableLink::~ScTableLink() USHORT nCount = pDoc->GetTableCount(); for (USHORT nTab=0; nTab<nCount; nTab++) if (pDoc->IsLinked(nTab) && pDoc->GetLinkDoc(nTab)==aFileName) - pDoc->SetLink( nTab, SC_LINK_NONE, aEmpty, aEmpty, aEmpty, aEmpty ); + pDoc->SetLink( nTab, SC_LINK_NONE, aEmpty, aEmpty, aEmpty, aEmpty, 0 ); } BOOL __EXPORT ScTableLink::Edit(Window* pParent) @@ -168,7 +172,7 @@ void __EXPORT ScTableLink::DataChanged( const String&, ScDocumentLoader::RemoveAppPrefix( aFilter ); if (!bInCreate) - Refresh(aFile,aFilter); // nicht doppelt laden! + Refresh( aFile, aFilter, NULL, nRefreshDelay ); // don't load twice } } @@ -197,7 +201,7 @@ BOOL ScTableLink::IsUsed() const } BOOL ScTableLink::Refresh(const String& rNewFile, const String& rNewFilter, - const String* pNewOptions) + const String* pNewOptions, ULONG nNewRefresh ) { // Dokument laden @@ -277,7 +281,8 @@ BOOL ScTableLink::Refresh(const String& rNewFile, const String& rNewFilter, ScRange aRange(0,0,nTab,MAXCOL,MAXROW,nTab); pDoc->CopyToDocument(aRange, IDF_ALL, FALSE, pUndoDoc); pUndoDoc->TransferDrawPage( pDoc, nTab, nTab ); - pUndoDoc->SetLink( nTab, nMode, aFileName, aFilterName, aOptions, aTabName ); + pUndoDoc->SetLink( nTab, nMode, aFileName, aFilterName, + aOptions, aTabName, nRefreshDelay ); } // Tabellenname einer ExtDocRef anpassen @@ -319,8 +324,11 @@ BOOL ScTableLink::Refresh(const String& rNewFile, const String& rNewFilter, bNotFound = TRUE; } - if ( bNewUrlName || rNewFilter != aFilterName || aNewOpt != aOptions || pNewOptions ) - pDoc->SetLink( nTab, nMode, aNewUrl, rNewFilter, aNewOpt, aTabName ); + if ( bNewUrlName || rNewFilter != aFilterName || + aNewOpt != aOptions || pNewOptions || + nNewRefresh != nRefreshDelay ) + pDoc->SetLink( nTab, nMode, aNewUrl, rNewFilter, aNewOpt, + aTabName, nNewRefresh ); } } diff --git a/sc/source/ui/inc/undotab.hxx b/sc/source/ui/inc/undotab.hxx index e7e4a4561b4c..b9a1895b20ac 100644 --- a/sc/source/ui/inc/undotab.hxx +++ b/sc/source/ui/inc/undotab.hxx @@ -2,9 +2,9 @@ * * $RCSfile: undotab.hxx,v $ * - * $Revision: 1.3 $ + * $Revision: 1.4 $ * - * last change: $Author: sab $ $Date: 2001-02-23 06:59:50 $ + * last change: $Author: er $ $Date: 2001-04-18 12:29:45 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -333,6 +333,7 @@ private: String aDocName; String aFltName; String aOptions; + ULONG nRefreshDelay; USHORT nCount; USHORT* pTabs; BYTE* pModes; |