diff options
-rw-r--r-- | sc/inc/document.hxx | 13 | ||||
-rw-r--r-- | sc/inc/linkuno.hxx | 4 | ||||
-rw-r--r-- | sc/source/core/data/documen8.cxx | 35 | ||||
-rw-r--r-- | sc/source/core/tool/interpr2.cxx | 14 | ||||
-rw-r--r-- | sc/source/filter/excel/xelink.cxx | 2 | ||||
-rw-r--r-- | sc/source/filter/excel/xestyle.cxx | 2 | ||||
-rw-r--r-- | sc/source/filter/xml/XMLDDELinksContext.cxx | 13 | ||||
-rw-r--r-- | sc/source/ui/docshell/docsh6.cxx | 14 | ||||
-rw-r--r-- | sc/source/ui/unoobj/linkuno.cxx | 68 |
9 files changed, 84 insertions, 81 deletions
diff --git a/sc/inc/document.hxx b/sc/inc/document.hxx index 427ab2c0af67..d7d63f713a20 100644 --- a/sc/inc/document.hxx +++ b/sc/inc/document.hxx @@ -668,13 +668,14 @@ public: void DisconnectDdeLinks(); // for StarOne Api: - sal_uInt16 GetDdeLinkCount() const; + size_t GetDdeLinkCount() const; bool UpdateDdeLink( const OUString& rAppl, const OUString& rTopic, const OUString& rItem ); /** Tries to find a DDE link with the specified connection data. @param rnDdePos (out-param) Returns the index of the DDE link (does not include other links from link manager). @return true = DDE link found, rnDdePos valid. */ - SC_DLLPUBLIC bool FindDdeLink( const OUString& rAppl, const OUString& rTopic, const OUString& rItem, sal_uInt8 nMode, sal_uInt16& rnDdePos ); + SC_DLLPUBLIC bool FindDdeLink( const OUString& rAppl, const OUString& rTopic, + const OUString& rItem, sal_uInt8 nMode, size_t& rnDdePos ); /** Returns the connection data of the specified DDE link. @param nDdePos Index of the DDE link (does not include other links from link manager). @@ -682,16 +683,16 @@ public: @param rTopic (out-param) The DDE topic. @param rItem (out-param) The DDE item. @return true = DDE link found, out-parameters valid. */ - bool GetDdeLinkData( sal_uInt16 nDdePos, OUString& rAppl, OUString& rTopic, OUString& rItem ) const; + bool GetDdeLinkData( size_t nDdePos, OUString& rAppl, OUString& rTopic, OUString& rItem ) const; /** Returns the link mode of the specified DDE link. @param nDdePos Index of the DDE link (does not include other links from link manager). @param rnMode (out-param) The link mode of the specified DDE link. @return true = DDE link found, rnMode valid. */ - bool GetDdeLinkMode( sal_uInt16 nDdePos, sal_uInt8& rnMode ) const; + bool GetDdeLinkMode( size_t nDdePos, sal_uInt8& rnMode ) const; /** Returns the result matrix of the specified DDE link. @param nDdePos Index of the DDE link (does not include other links from link manager). @return The result matrix, if the DDE link has been found, 0 otherwise. */ - SC_DLLPUBLIC const ScMatrix* GetDdeLinkResultMatrix( sal_uInt16 nDdePos ) const; + SC_DLLPUBLIC const ScMatrix* GetDdeLinkResultMatrix( sal_uInt16 size_t ) const; /** Tries to find a DDE link or creates a new, if not extant. @param pResults If not 0, sets the matrix as as DDE link result matrix (also for existing links). @@ -701,7 +702,7 @@ public: @param nDdePos Index of the DDE link (does not include other links from link manager). @param pResults The array containing all results of the DDE link (intrusive-ref-counted, do not delete). @return true = DDE link found and matrix set. */ - bool SetDdeLinkResultMatrix( sal_uInt16 nDdePos, ScMatrixRef pResults ); + bool SetDdeLinkResultMatrix( size_t nDdePos, ScMatrixRef pResults ); SfxBindings* GetViewBindings(); diff --git a/sc/inc/linkuno.hxx b/sc/inc/linkuno.hxx index 61c0bc355683..318a390c0f7f 100644 --- a/sc/inc/linkuno.hxx +++ b/sc/inc/linkuno.hxx @@ -219,7 +219,7 @@ class ScAreaLinkObj : public cppu::WeakImplHelper4< private: SfxItemPropertySet aPropSet; ScDocShell* pDocShell; - sal_uInt16 nPos; + size_t nPos; XRefreshListenerArr_Impl aRefreshListeners; void Modify_Impl( const OUString* pNewFile, const OUString* pNewFilter, @@ -229,7 +229,7 @@ private: void Refreshed_Impl(); public: - ScAreaLinkObj(ScDocShell* pDocSh, sal_uInt16 nP); + ScAreaLinkObj(ScDocShell* pDocSh, size_t nP); virtual ~ScAreaLinkObj(); virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ); diff --git a/sc/source/core/data/documen8.cxx b/sc/source/core/data/documen8.cxx index 5c1949987c50..d090ad02b355 100644 --- a/sc/source/core/data/documen8.cxx +++ b/sc/source/core/data/documen8.cxx @@ -1257,8 +1257,8 @@ void ScDocument::CopyDdeLinks( ScDocument* pDestDoc ) const else if (GetLinkManager()) // Links direkt kopieren { const ::sfx2::SvBaseLinks& rLinks = pLinkManager->GetLinks(); - sal_uInt16 nCount = rLinks.size(); - for (sal_uInt16 i=0; i<nCount; i++) + size_t nCount = rLinks.size(); + for (size_t i=0; i<nCount; i++) { ::sfx2::SvBaseLink* pBase = *rLinks[i]; if (pBase->ISA(ScDdeLink)) @@ -1272,14 +1272,14 @@ void ScDocument::CopyDdeLinks( ScDocument* pDestDoc ) const } } -sal_uInt16 ScDocument::GetDdeLinkCount() const +size_t ScDocument::GetDdeLinkCount() const { - sal_uInt16 nDdeCount = 0; + size_t nDdeCount = 0; if (GetLinkManager()) { const ::sfx2::SvBaseLinks& rLinks = pLinkManager->GetLinks(); - sal_uInt16 nCount = rLinks.size(); - for (sal_uInt16 i=0; i<nCount; i++) + size_t nCount = rLinks.size(); + for (size_t i=0; i<nCount; i++) if ((*rLinks[i])->ISA(ScDdeLink)) ++nDdeCount; } @@ -1297,14 +1297,14 @@ namespace { ScDdeLink* lclGetDdeLink( const sfx2::LinkManager* pLinkManager, const OUString& rAppl, const OUString& rTopic, const OUString& rItem, sal_uInt8 nMode, - sal_uInt16* pnDdePos = NULL ) + size_t* pnDdePos = NULL ) { if( pLinkManager ) { const ::sfx2::SvBaseLinks& rLinks = pLinkManager->GetLinks(); - sal_uInt16 nCount = rLinks.size(); + size_t nCount = rLinks.size(); if( pnDdePos ) *pnDdePos = 0; - for( sal_uInt16 nIndex = 0; nIndex < nCount; ++nIndex ) + for( size_t nIndex = 0; nIndex < nCount; ++nIndex ) { ::sfx2::SvBaseLink* pLink = *rLinks[ nIndex ]; if( ScDdeLink* pDdeLink = PTR_CAST( ScDdeLink, pLink ) ) @@ -1324,14 +1324,14 @@ ScDdeLink* lclGetDdeLink( /** Returns a pointer to the specified DDE link. @param nDdePos Index of the DDE link (does not include other links from link manager). @return The DDE link, if it exists, otherwise 0. */ -ScDdeLink* lclGetDdeLink( const sfx2::LinkManager* pLinkManager, sal_uInt16 nDdePos ) +ScDdeLink* lclGetDdeLink( const sfx2::LinkManager* pLinkManager, size_t nDdePos ) { if( pLinkManager ) { const ::sfx2::SvBaseLinks& rLinks = pLinkManager->GetLinks(); - sal_uInt16 nCount = rLinks.size(); - sal_uInt16 nDdeIndex = 0; // counts only the DDE links - for( sal_uInt16 nIndex = 0; nIndex < nCount; ++nIndex ) + size_t nCount = rLinks.size(); + size_t nDdeIndex = 0; // counts only the DDE links + for( size_t nIndex = 0; nIndex < nCount; ++nIndex ) { ::sfx2::SvBaseLink* pLink = *rLinks[ nIndex ]; if( ScDdeLink* pDdeLink = PTR_CAST( ScDdeLink, pLink ) ) @@ -1349,12 +1349,13 @@ ScDdeLink* lclGetDdeLink( const sfx2::LinkManager* pLinkManager, sal_uInt16 nDde // ---------------------------------------------------------------------------- -bool ScDocument::FindDdeLink( const OUString& rAppl, const OUString& rTopic, const OUString& rItem, sal_uInt8 nMode, sal_uInt16& rnDdePos ) +bool ScDocument::FindDdeLink( const OUString& rAppl, const OUString& rTopic, const OUString& rItem, + sal_uInt8 nMode, size_t& rnDdePos ) { return lclGetDdeLink( GetLinkManager(), rAppl, rTopic, rItem, nMode, &rnDdePos ) != NULL; } -bool ScDocument::GetDdeLinkData( sal_uInt16 nDdePos, OUString& rAppl, OUString& rTopic, OUString& rItem ) const +bool ScDocument::GetDdeLinkData( size_t nDdePos, OUString& rAppl, OUString& rTopic, OUString& rItem ) const { if( const ScDdeLink* pDdeLink = lclGetDdeLink( GetLinkManager(), nDdePos ) ) { @@ -1366,7 +1367,7 @@ bool ScDocument::GetDdeLinkData( sal_uInt16 nDdePos, OUString& rAppl, OUString& return false; } -bool ScDocument::GetDdeLinkMode( sal_uInt16 nDdePos, sal_uInt8& rnMode ) const +bool ScDocument::GetDdeLinkMode( size_t nDdePos, sal_uInt8& rnMode ) const { if( const ScDdeLink* pDdeLink = lclGetDdeLink( GetLinkManager(), nDdePos ) ) { @@ -1408,7 +1409,7 @@ bool ScDocument::CreateDdeLink( const OUString& rAppl, const OUString& rTopic, c return false; } -bool ScDocument::SetDdeLinkResultMatrix( sal_uInt16 nDdePos, ScMatrixRef pResults ) +bool ScDocument::SetDdeLinkResultMatrix( size_t nDdePos, ScMatrixRef pResults ) { if( ScDdeLink* pDdeLink = lclGetDdeLink( GetLinkManager(), nDdePos ) ) { diff --git a/sc/source/core/tool/interpr2.cxx b/sc/source/core/tool/interpr2.cxx index 4e0cde4fc896..f4afd4e9754e 100644 --- a/sc/source/core/tool/interpr2.cxx +++ b/sc/source/core/tool/interpr2.cxx @@ -2223,15 +2223,15 @@ void ScInterpreter::ScStyle() } static ScDdeLink* lcl_GetDdeLink( sfx2::LinkManager* pLinkMgr, - const String& rA, const String& rT, const String& rI, sal_uInt8 nM ) + const OUString& rA, const OUString& rT, const OUString& rI, sal_uInt8 nM ) { - sal_uInt16 nCount = pLinkMgr->GetLinks().size(); - for (sal_uInt16 i=0; i<nCount; i++ ) + size_t nCount = pLinkMgr->GetLinks().size(); + for (size_t i=0; i<nCount; i++ ) { ::sfx2::SvBaseLink* pBase = *pLinkMgr->GetLinks()[i]; if (pBase->ISA(ScDdeLink)) { - ScDdeLink* pLink = (ScDdeLink*)pBase; + ScDdeLink* pLink = static_cast<ScDdeLink*>(pBase); if ( pLink->GetAppl() == rA && pLink->GetTopic() == rT && pLink->GetItem() == rI && @@ -2255,9 +2255,9 @@ void ScInterpreter::ScDde() sal_uInt8 nMode = SC_DDE_DEFAULT; if (nParamCount == 4) nMode = (sal_uInt8) ::rtl::math::approxFloor(GetDouble()); - String aItem = GetString(); - String aTopic = GetString(); - String aAppl = GetString(); + const OUString& aItem = GetString(); + const OUString& aTopic = GetString(); + const OUString& aAppl = GetString(); if (nMode > SC_DDE_TEXT) nMode = SC_DDE_DEFAULT; diff --git a/sc/source/filter/excel/xelink.cxx b/sc/source/filter/excel/xelink.cxx index 5b6e37ab8115..6ba061220580 100644 --- a/sc/source/filter/excel/xelink.cxx +++ b/sc/source/filter/excel/xelink.cxx @@ -1052,7 +1052,7 @@ sal_uInt16 XclExpExtNameBuffer::InsertDde( sal_uInt16 nIndex = GetIndex( rItem ); if( nIndex == 0 ) { - sal_uInt16 nPos; + size_t nPos; if( GetDoc().FindDdeLink( rApplic, rTopic, rItem, SC_DDE_IGNOREMODE, nPos ) ) { // create the leading 'StdDocumentName' EXTERNNAME record diff --git a/sc/source/filter/excel/xestyle.cxx b/sc/source/filter/excel/xestyle.cxx index 0623ae549779..c5cb5a30ea4c 100644 --- a/sc/source/filter/excel/xestyle.cxx +++ b/sc/source/filter/excel/xestyle.cxx @@ -1552,7 +1552,7 @@ void lclGetBorderLine( rnXclLine = EXC_LINE_NONE; if( pLine ) { - sal_uInt16 nOuterWidth = pLine->GetOutWidth(); + sal_uInt16 nOuterWidth = pLine->GetWidth(); sal_uInt16 nDistance = pLine->GetDistance(); if( nDistance > 0 ) rnXclLine = EXC_LINE_DOUBLE; diff --git a/sc/source/filter/xml/XMLDDELinksContext.cxx b/sc/source/filter/xml/XMLDDELinksContext.cxx index 184de3b502c1..4f6d51fb568c 100644 --- a/sc/source/filter/xml/XMLDDELinksContext.cxx +++ b/sc/source/filter/xml/XMLDDELinksContext.cxx @@ -116,16 +116,15 @@ void ScXMLDDELinkContext::CreateDDELink() !sTopic.isEmpty() && !sItem.isEmpty()) { - String sAppl(sApplication); - String sTop(sTopic); - String sIt(sItem); - GetScImport().GetDocument()->CreateDdeLink(sAppl, sTop, sIt, nMode, ScMatrixRef()); - sal_uInt16 nPos; - if(GetScImport().GetDocument()->FindDdeLink(sAppl, sTop, sIt, nMode, nPos)) + GetScImport().GetDocument()->CreateDdeLink(sApplication, sTopic, sItem, nMode, ScMatrixRef()); + size_t nPos; + if(GetScImport().GetDocument()->FindDdeLink(sApplication, sTopic, sItem, nMode, nPos)) nPosition = nPos; else + { nPosition = -1; - OSL_ENSURE(nPosition > -1, "DDE Link not inserted"); + SAL_WARN("sc" , "DDE Link not inserted"); + } } } diff --git a/sc/source/ui/docshell/docsh6.cxx b/sc/source/ui/docshell/docsh6.cxx index 283fe42e48ad..ecfed5d828e3 100644 --- a/sc/source/ui/docshell/docsh6.cxx +++ b/sc/source/ui/docshell/docsh6.cxx @@ -370,14 +370,14 @@ void ScDocShell::UpdateLinks() // nicht mehr benutzte Links raus - sal_uInt16 nCount = pLinkManager->GetLinks().size(); - for (sal_uInt16 k=nCount; k>0; ) + size_t nCount = pLinkManager->GetLinks().size(); + for (size_t k=nCount; k>0; ) { --k; ::sfx2::SvBaseLink* pBase = *pLinkManager->GetLinks()[k]; if (pBase->ISA(ScTableLink)) { - ScTableLink* pTabLink = (ScTableLink*)pBase; + ScTableLink* pTabLink = static_cast<ScTableLink*>(pBase); if (pTabLink->IsUsed()) aNames.insert(pTabLink->GetFileName()); else // nicht mehr benutzt -> loeschen @@ -434,14 +434,14 @@ sal_Bool ScDocShell::ReloadTabLinks() { sfx2::LinkManager* pLinkManager = aDocument.GetLinkManager(); - sal_Bool bAny = false; - sal_uInt16 nCount = pLinkManager->GetLinks().size(); - for (sal_uInt16 i=0; i<nCount; i++ ) + bool bAny = false; + size_t nCount = pLinkManager->GetLinks().size(); + for (size_t i=0; i<nCount; i++ ) { ::sfx2::SvBaseLink* pBase = *pLinkManager->GetLinks()[i]; if (pBase->ISA(ScTableLink)) { - ScTableLink* pTabLink = (ScTableLink*)pBase; + ScTableLink* pTabLink = static_cast<ScTableLink*>(pBase); // pTabLink->SetAddUndo(sal_False); //! Undo's zusammenfassen // Painting only after Update() makes no sense: diff --git a/sc/source/ui/unoobj/linkuno.cxx b/sc/source/ui/unoobj/linkuno.cxx index 3cff46ba8287..897d4aa18b60 100644 --- a/sc/source/ui/unoobj/linkuno.cxx +++ b/sc/source/ui/unoobj/linkuno.cxx @@ -112,8 +112,8 @@ ScTableLink* ScSheetLinkObj::GetLink_Impl() const if (pDocShell) { sfx2::LinkManager* pLinkManager = pDocShell->GetDocument()->GetLinkManager(); - sal_uInt16 nCount = pLinkManager->GetLinks().size(); - for (sal_uInt16 i=0; i<nCount; i++) + size_t nCount = pLinkManager->GetLinks().size(); + for (size_t i=0; i<nCount; i++) { ::sfx2::SvBaseLink* pBase = *pLinkManager->GetLinks()[i]; if (pBase->ISA(ScTableLink)) @@ -170,8 +170,8 @@ void SAL_CALL ScSheetLinkObj::removeRefreshListener( throw(uno::RuntimeException) { SolarMutexGuard aGuard; - sal_uInt16 nCount = aRefreshListeners.size(); - for ( sal_uInt16 n=nCount; n--; ) + size_t nCount = aRefreshListeners.size(); + for ( size_t n=nCount; n--; ) { uno::Reference<util::XRefreshListener>& rObj = aRefreshListeners[n]; if ( rObj == xListener ) @@ -188,7 +188,7 @@ void ScSheetLinkObj::Refreshed_Impl() { lang::EventObject aEvent; aEvent.Source.set((cppu::OWeakObject*)this); - for ( sal_uInt16 n=0; n<aRefreshListeners.size(); n++ ) + for ( size_t n=0; n<aRefreshListeners.size(); n++ ) aRefreshListeners[n]->refreshed( aEvent ); } @@ -565,7 +565,7 @@ uno::Sequence<OUString> SAL_CALL ScSheetLinksObj::getElementNames() throw(uno::R sal_Int32 nLinkCount = getCount(); uno::Sequence<OUString> aSeq(nLinkCount); OUString* pAry = aSeq.getArray(); - sal_uInt16 nPos = 0; + size_t nPos = 0; for (SCTAB nTab = 0; nTab < nTabCount; ++nTab) { if (!pDoc->IsLinked(nTab)) @@ -575,26 +575,26 @@ uno::Sequence<OUString> SAL_CALL ScSheetLinksObj::getElementNames() throw(uno::R if (aNames.insert(aLinkDoc).second) pAry[nPos++] = aLinkDoc; } - OSL_ENSURE( nPos==nLinkCount, "verzaehlt" ); + OSL_ENSURE( nPos==static_cast<size_t>(nLinkCount), "verzaehlt" ); return aSeq; } //------------------------------------------------------------------------ -static ScAreaLink* lcl_GetAreaLink( ScDocShell* pDocShell, sal_uInt16 nPos ) +static ScAreaLink* lcl_GetAreaLink( ScDocShell* pDocShell, size_t nPos ) { if (pDocShell) { sfx2::LinkManager* pLinkManager = pDocShell->GetDocument()->GetLinkManager(); - sal_uInt16 nTotalCount = pLinkManager->GetLinks().size(); - sal_uInt16 nAreaCount = 0; - for (sal_uInt16 i=0; i<nTotalCount; i++) + size_t nTotalCount = pLinkManager->GetLinks().size(); + size_t nAreaCount = 0; + for (size_t i=0; i<nTotalCount; i++) { ::sfx2::SvBaseLink* pBase = *pLinkManager->GetLinks()[i]; if (pBase->ISA(ScAreaLink)) { if ( nAreaCount == nPos ) - return (ScAreaLink*)pBase; + return static_cast<ScAreaLink*>(pBase); ++nAreaCount; } } @@ -602,7 +602,7 @@ static ScAreaLink* lcl_GetAreaLink( ScDocShell* pDocShell, sal_uInt16 nPos ) return NULL; // nicht gefunden } -ScAreaLinkObj::ScAreaLinkObj(ScDocShell* pDocSh, sal_uInt16 nP) : +ScAreaLinkObj::ScAreaLinkObj(ScDocShell* pDocSh, size_t nP) : aPropSet( lcl_GetSheetLinkMap() ), pDocShell( pDocSh ), nPos( nP ) @@ -720,8 +720,8 @@ void SAL_CALL ScAreaLinkObj::removeRefreshListener( throw(uno::RuntimeException) { SolarMutexGuard aGuard; - sal_uInt16 nCount = aRefreshListeners.size(); - for ( sal_uInt16 n=nCount; n--; ) + size_t nCount = aRefreshListeners.size(); + for ( size_t n=nCount; n--; ) { uno::Reference<util::XRefreshListener>& rObj = aRefreshListeners[n]; if ( rObj == xListener ) @@ -731,6 +731,9 @@ void SAL_CALL ScAreaLinkObj::removeRefreshListener( release(); // release ref for listeners break; } + + if(n == 0) + break; } } @@ -738,7 +741,7 @@ void ScAreaLinkObj::Refreshed_Impl() { lang::EventObject aEvent; aEvent.Source.set((cppu::OWeakObject*)this); - for ( sal_uInt16 n=0; n<aRefreshListeners.size(); n++ ) + for ( size_t n=0; n<aRefreshListeners.size(); n++ ) aRefreshListeners[n]->refreshed( aEvent ); } @@ -945,7 +948,7 @@ void ScAreaLinksObj::Notify( SfxBroadcaster&, const SfxHint& rHint ) ScAreaLinkObj* ScAreaLinksObj::GetObjectByIndex_Impl(sal_Int32 nIndex) { if ( pDocShell && nIndex >= 0 && nIndex < getCount() ) - return new ScAreaLinkObj( pDocShell, (sal_uInt16)nIndex ); + return new ScAreaLinkObj( pDocShell, (size_t)nIndex ); return NULL; // nicht gefunden } @@ -976,7 +979,7 @@ void SAL_CALL ScAreaLinksObj::insertAtPosition( const table::CellAddress& aDestP void SAL_CALL ScAreaLinksObj::removeByIndex( sal_Int32 nIndex ) throw(uno::RuntimeException) { SolarMutexGuard aGuard; - ScAreaLink* pLink = lcl_GetAreaLink(pDocShell, (sal_uInt16)nIndex); + ScAreaLink* pLink = lcl_GetAreaLink(pDocShell, (size_t)nIndex); if (pLink) { //! SetAddUndo oder so @@ -1004,8 +1007,8 @@ sal_Int32 SAL_CALL ScAreaLinksObj::getCount() throw(uno::RuntimeException) if (pDocShell) { sfx2::LinkManager* pLinkManager = pDocShell->GetDocument()->GetLinkManager(); - sal_uInt16 nTotalCount = pLinkManager->GetLinks().size(); - for (sal_uInt16 i=0; i<nTotalCount; i++) + size_t nTotalCount = pLinkManager->GetLinks().size(); + for (size_t i=0; i<nTotalCount; i++) { ::sfx2::SvBaseLink* pBase = *pLinkManager->GetLinks()[i]; if (pBase->ISA(ScAreaLink)) @@ -1161,8 +1164,8 @@ void SAL_CALL ScDDELinkObj::removeRefreshListener( throw(uno::RuntimeException) { SolarMutexGuard aGuard; - sal_uInt16 nCount = aRefreshListeners.size(); - for ( sal_uInt16 n=nCount; n--; ) + size_t nCount = aRefreshListeners.size(); + for ( size_t n=nCount; n--; ) { uno::Reference<util::XRefreshListener>& rObj = aRefreshListeners[n]; if ( rObj == xListener ) @@ -1189,7 +1192,7 @@ uno::Sequence< uno::Sequence< uno::Any > > ScDDELinkObj::getResults( ) ScDocument* pDoc = pDocShell->GetDocument(); if ( pDoc ) { - sal_uInt16 nPos = 0; + size_t nPos = 0; if ( pDoc->FindDdeLink( aAppl, aTopic, aItem, SC_DDE_IGNOREMODE, nPos ) ) { const ScMatrix* pMatrix = pDoc->GetDdeLinkResultMatrix( nPos ); @@ -1227,7 +1230,7 @@ void ScDDELinkObj::setResults( const uno::Sequence< uno::Sequence< uno::Any > >& ScDocument* pDoc = pDocShell->GetDocument(); if ( pDoc ) { - sal_uInt16 nPos = 0; + size_t nPos = 0; if ( pDoc->FindDdeLink( aAppl, aTopic, aItem, SC_DDE_IGNOREMODE, nPos ) ) { uno::Any aAny; @@ -1250,7 +1253,7 @@ void ScDDELinkObj::Refreshed_Impl() { lang::EventObject aEvent; aEvent.Source.set((cppu::OWeakObject*)this); - for ( sal_uInt16 n=0; n<aRefreshListeners.size(); n++ ) + for ( size_t n=0; n<aRefreshListeners.size(); n++ ) aRefreshListeners[n]->refreshed( aEvent ); } @@ -1286,8 +1289,7 @@ ScDDELinkObj* ScDDELinksObj::GetObjectByIndex_Impl(sal_Int32 nIndex) if (pDocShell) { OUString aAppl, aTopic, aItem; - if ( nIndex <= USHRT_MAX && - pDocShell->GetDocument()->GetDdeLinkData( (sal_uInt16)nIndex, aAppl, aTopic, aItem ) ) + if ( pDocShell->GetDocument()->GetDdeLinkData( (size_t)nIndex, aAppl, aTopic, aItem ) ) return new ScDDELinkObj( pDocShell, aAppl, aTopic, aItem ); } return NULL; @@ -1301,8 +1303,8 @@ ScDDELinkObj* ScDDELinksObj::GetObjectByName_Impl(const OUString& aName) OUString aAppl, aTopic, aItem; ScDocument* pDoc = pDocShell->GetDocument(); - sal_uInt16 nCount = pDoc->GetDdeLinkCount(); - for (sal_uInt16 i=0; i<nCount; i++) + size_t nCount = pDoc->GetDdeLinkCount(); + for (size_t i=0; i<nCount; i++) { pDoc->GetDdeLinkData( i, aAppl, aTopic, aItem ); if ( lcl_BuildDDEName(aAppl, aTopic, aItem) == aNamStr ) @@ -1376,11 +1378,11 @@ uno::Sequence<OUString> SAL_CALL ScDDELinksObj::getElementNames() throw(uno::Run OUString aAppl, aTopic, aItem; ScDocument* pDoc = pDocShell->GetDocument(); - sal_uInt16 nCount = pDoc->GetDdeLinkCount(); + size_t nCount = pDoc->GetDdeLinkCount(); uno::Sequence<OUString> aSeq(nCount); OUString* pAry = aSeq.getArray(); - for (sal_uInt16 i=0; i<nCount; i++) + for (size_t i=0; i<nCount; i++) { pDoc->GetDdeLinkData( i, aAppl, aTopic, aItem ); pAry[i] = lcl_BuildDDEName(aAppl, aTopic, aItem); @@ -1400,8 +1402,8 @@ sal_Bool SAL_CALL ScDDELinksObj::hasByName( const OUString& aName ) OUString aAppl, aTopic, aItem; ScDocument* pDoc = pDocShell->GetDocument(); - sal_uInt16 nCount = pDoc->GetDdeLinkCount(); - for (sal_uInt16 i=0; i<nCount; i++) + size_t nCount = pDoc->GetDdeLinkCount(); + for (size_t i=0; i<nCount; i++) { pDoc->GetDdeLinkData( i, aAppl, aTopic, aItem ); if ( lcl_BuildDDEName(aAppl, aTopic, aItem) == aNamStr ) |