diff options
Diffstat (limited to 'sc/source/core/tool/ddelink.cxx')
-rw-r--r-- | sc/source/core/tool/ddelink.cxx | 84 |
1 files changed, 42 insertions, 42 deletions
diff --git a/sc/source/core/tool/ddelink.cxx b/sc/source/core/tool/ddelink.cxx index 00b97d430f0c..56ac77fa2c7c 100644 --- a/sc/source/core/tool/ddelink.cxx +++ b/sc/source/core/tool/ddelink.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -49,7 +49,7 @@ TYPEINIT2(ScDdeLink,::sfx2::SvBaseLink,SfxBroadcaster); -#define DDE_TXT_ENCODING gsl_getSystemTextEncoding() +#define DDE_TXT_ENCODING gsl_getSystemTextEncoding() BOOL ScDdeLink::bIsInUpdate = FALSE; @@ -77,13 +77,13 @@ __EXPORT ScDdeLink::~ScDdeLink() ScDdeLink::ScDdeLink( ScDocument* pD, const ScDdeLink& rOther ) : ::sfx2::SvBaseLink(sfx2::LINKUPDATE_ALWAYS,FORMAT_STRING), - pDoc ( pD ), - aAppl ( rOther.aAppl ), - aTopic ( rOther.aTopic ), - aItem ( rOther.aItem ), - nMode ( rOther.nMode ), + pDoc ( pD ), + aAppl ( rOther.aAppl ), + aTopic ( rOther.aTopic ), + aItem ( rOther.aItem ), + nMode ( rOther.nMode ), bNeedUpdate( FALSE ), - pResult ( NULL ) + pResult ( NULL ) { if (rOther.pResult) pResult = rOther.pResult->Clone(); @@ -107,7 +107,7 @@ ScDdeLink::ScDdeLink( ScDocument* pD, SvStream& rStream, ScMultipleReadHeader& r if ( bHasValue ) pResult = new ScMatrix( rStream ); - if (rHdr.BytesLeft()) // neu in 388b und der 364w (RealTime-Client) Version + if (rHdr.BytesLeft()) // neu in 388b und der 364w (RealTime-Client) Version rStream >> nMode; else nMode = SC_DDE_DEFAULT; @@ -129,11 +129,11 @@ void ScDdeLink::Store( SvStream& rStream, ScMultipleWriteHeader& rHdr ) const if (bHasValue) pResult->Store( rStream ); - if( rStream.GetVersion() > SOFFICE_FILEFORMAT_40 ) // nicht bei 4.0 Export - rStream << nMode; // seit 388b + if( rStream.GetVersion() > SOFFICE_FILEFORMAT_40 ) // nicht bei 4.0 Export + rStream << nMode; // seit 388b - // Links mit Mode != SC_DDE_DEFAULT werden bei 4.0 Export komplett weggelassen - // (aus ScDocument::SaveDdeLinks) + // Links mit Mode != SC_DDE_DEFAULT werden bei 4.0 Export komplett weggelassen + // (aus ScDocument::SaveDdeLinks) rHdr.EndEntry(); } @@ -141,7 +141,7 @@ void ScDdeLink::Store( SvStream& rStream, ScMultipleWriteHeader& rHdr ) const void __EXPORT ScDdeLink::DataChanged( const String& rMimeType, const ::com::sun::star::uno::Any & rValue ) { - // wir koennen nur Strings... + // wir koennen nur Strings... if ( FORMAT_STRING != SotExchange::GetFormatIdFromMimeType( rMimeType )) return; @@ -149,14 +149,14 @@ void __EXPORT ScDdeLink::DataChanged( const String& rMimeType, ScByteSequenceToString::GetString( aLinkStr, rValue, DDE_TXT_ENCODING ); aLinkStr.ConvertLineEnd(LINEEND_LF); - // wenn String mit Zeilenende aufhoert, streichen: + // wenn String mit Zeilenende aufhoert, streichen: xub_StrLen nLen = aLinkStr.Len(); if (nLen && aLinkStr.GetChar(nLen-1) == '\n') aLinkStr.Erase(nLen-1); String aLine; - SCSIZE nCols = 1; // Leerstring -> eine leere Zelle + SCSIZE nCols = 1; // Leerstring -> eine leere Zelle SCSIZE nRows = 1; if (aLinkStr.Len()) { @@ -166,25 +166,25 @@ void __EXPORT ScDdeLink::DataChanged( const String& rMimeType, nCols = static_cast<SCSIZE>(aLine.GetTokenCount( '\t' )); } - if (!nRows || !nCols) // keine Daten + if (!nRows || !nCols) // keine Daten { pResult.Clear(); } - else // Daten aufteilen + else // Daten aufteilen { - // Matrix immer neu anlegen, damit bIsString nicht durcheinanderkommt + // Matrix immer neu anlegen, damit bIsString nicht durcheinanderkommt pResult = new ScMatrix( nCols, nRows ); SvNumberFormatter* pFormatter = pDoc->GetFormatTable(); - // nMode bestimmt, wie der Text interpretiert wird (#44455#/#49783#): - // SC_DDE_DEFAULT - Zahlformat aus Zellvorlage "Standard" - // SC_DDE_ENGLISH - Standard-Zahlformat fuer English/US - // SC_DDE_TEXT - ohne NumberFormatter direkt als String + // nMode bestimmt, wie der Text interpretiert wird (#44455#/#49783#): + // SC_DDE_DEFAULT - Zahlformat aus Zellvorlage "Standard" + // SC_DDE_ENGLISH - Standard-Zahlformat fuer English/US + // SC_DDE_TEXT - ohne NumberFormatter direkt als String ULONG nStdFormat = 0; if ( nMode == SC_DDE_DEFAULT ) { - ScPatternAttr* pDefPattern = pDoc->GetDefPattern(); // enthaelt Standard-Vorlage + ScPatternAttr* pDefPattern = pDoc->GetDefPattern(); // enthaelt Standard-Vorlage if ( pDefPattern ) nStdFormat = pDefPattern->GetNumberFormat( pFormatter ); } @@ -208,22 +208,22 @@ void __EXPORT ScDdeLink::DataChanged( const String& rMimeType, } } - // Es hat sich was getan... + // Es hat sich was getan... if (HasListeners()) { Broadcast( ScHint( SC_HINT_DATACHANGED, ScAddress(), NULL ) ); - pDoc->TrackFormulas(); // muss sofort passieren + pDoc->TrackFormulas(); // muss sofort passieren pDoc->StartTrackTimer(); - // StartTrackTimer ruft asynchron TrackFormulas, Broadcast(FID_DATACHANGED), - // ResetChanged, SetModified und Invalidate(SID_SAVEDOC/SID_DOC_MODIFIED) - // TrackFormulas zusaetzlich nochmal sofort, damit nicht z.B. durch IdleCalc - // eine Formel berechnet wird, die noch im FormulaTrack steht (#61676#) + // StartTrackTimer ruft asynchron TrackFormulas, Broadcast(FID_DATACHANGED), + // ResetChanged, SetModified und Invalidate(SID_SAVEDOC/SID_DOC_MODIFIED) + // TrackFormulas zusaetzlich nochmal sofort, damit nicht z.B. durch IdleCalc + // eine Formel berechnet wird, die noch im FormulaTrack steht (#61676#) - // notify Uno objects (for XRefreshListener) - // must be after TrackFormulas - //! do this asynchronously? + // notify Uno objects (for XRefreshListener) + // must be after TrackFormulas + //! do this asynchronously? ScLinkRefreshedHint aHint; aHint.SetDdeLink( aAppl, aTopic, aItem, nMode ); pDoc->BroadcastUno( aHint ); @@ -234,8 +234,8 @@ void ScDdeLink::ResetValue() { pResult.Clear(); - // Es hat sich was getan... - // Tracking, FID_DATACHANGED etc. passiert von aussen + // Es hat sich was getan... + // Tracking, FID_DATACHANGED etc. passiert von aussen if (HasListeners()) Broadcast( ScHint( SC_HINT_DATACHANGED, ScAddress(), NULL ) ); @@ -244,16 +244,16 @@ void ScDdeLink::ResetValue() void __EXPORT ScDdeLink::ListenersGone() { BOOL bWas = bIsInUpdate; - bIsInUpdate = TRUE; // Remove() kann Reschedule ausloesen??!? + bIsInUpdate = TRUE; // Remove() kann Reschedule ausloesen??!? - ScDocument* pStackDoc = pDoc; // member pDoc can't be used after removing the link + ScDocument* pStackDoc = pDoc; // member pDoc can't be used after removing the link sfx2::LinkManager* pLinkMgr = pDoc->GetLinkManager(); - pLinkMgr->Remove( this); // deletes this + pLinkMgr->Remove( this); // deletes this - if ( !pLinkMgr->GetLinks().Count() ) // letzten geloescht ? + if ( !pLinkMgr->GetLinks().Count() ) // letzten geloescht ? { - SfxBindings* pBindings = pStackDoc->GetViewBindings(); // don't use member pDoc! + SfxBindings* pBindings = pStackDoc->GetViewBindings(); // don't use member pDoc! if (pBindings) pBindings->Invalidate( SID_LINKS ); } @@ -264,11 +264,11 @@ void __EXPORT ScDdeLink::ListenersGone() void ScDdeLink::TryUpdate() { if (bIsInUpdate) - bNeedUpdate = TRUE; // kann jetzt nicht ausgefuehrt werden + bNeedUpdate = TRUE; // kann jetzt nicht ausgefuehrt werden else { bIsInUpdate = TRUE; - //Application::Reschedule(); //! OS/2-Simulation + //Application::Reschedule(); //! OS/2-Simulation pDoc->IncInDdeLinkUpdate(); Update(); pDoc->DecInDdeLinkUpdate(); |