From e16300cb6e6fe7c8e2d587a68d8bcf471937516d Mon Sep 17 00:00:00 2001 From: Bartosz Kosiorek Date: Tue, 5 Oct 2010 21:34:41 +0200 Subject: svarray: #i112395#: SvShorts --- sc/source/ui/docshell/docfunc.cxx | 2 +- sc/source/ui/docshell/docsh5.cxx | 8 ++--- sc/source/ui/undo/undotab.cxx | 65 +++++++++++++++++---------------------- sc/source/ui/view/tabvwshf.cxx | 4 +-- sc/source/ui/view/viewfun2.cxx | 26 ++++++++-------- 5 files changed, 48 insertions(+), 57 deletions(-) diff --git a/sc/source/ui/docshell/docfunc.cxx b/sc/source/ui/docshell/docfunc.cxx index 27b8eef7bbd6..5861fe14ff13 100644 --- a/sc/source/ui/docshell/docfunc.cxx +++ b/sc/source/ui/docshell/docfunc.cxx @@ -2807,7 +2807,7 @@ BOOL ScDocFunc::DeleteTable( SCTAB nTab, BOOL bRecord, BOOL /* bApi */ ) if (bRecord) { SvShorts theTabs; - theTabs.Insert(nTab,theTabs.Count()); + theTabs.push_back(nTab); rDocShell.GetUndoManager()->AddUndoAction( new ScUndoDeleteTab( &rDocShell, theTabs, pUndoDoc, pUndoData )); } diff --git a/sc/source/ui/docshell/docsh5.cxx b/sc/source/ui/docshell/docsh5.cxx index 84979e3dbcdf..013511ab0acb 100644 --- a/sc/source/ui/docshell/docsh5.cxx +++ b/sc/source/ui/docshell/docsh5.cxx @@ -891,8 +891,8 @@ BOOL ScDocShell::MoveTable( SCTAB nSrcTab, SCTAB nDestTab, BOOL bCopy, BOOL bRec { SvShorts aSrcList; SvShorts aDestList; - aSrcList.Insert(nSrcTab,0); - aDestList.Insert(nDestTab,0); + aSrcList.push_front(nSrcTab); + aDestList.push_front(nDestTab); GetUndoManager()->AddUndoAction( new ScUndoCopyTab( this, aSrcList, aDestList ) ); } @@ -950,8 +950,8 @@ BOOL ScDocShell::MoveTable( SCTAB nSrcTab, SCTAB nDestTab, BOOL bCopy, BOOL bRec { SvShorts aSrcList; SvShorts aDestList; - aSrcList.Insert(nSrcTab,0); - aDestList.Insert(nDestTab,0); + aSrcList.push_front(nSrcTab); + aDestList.push_front(nDestTab); GetUndoManager()->AddUndoAction( new ScUndoMoveTab( this, aSrcList, aDestList ) ); } diff --git a/sc/source/ui/undo/undotab.cxx b/sc/source/ui/undo/undotab.cxx index 2d8340ad030b..85b4af8db8b3 100644 --- a/sc/source/ui/undo/undotab.cxx +++ b/sc/source/ui/undo/undotab.cxx @@ -264,11 +264,11 @@ void ScUndoInsertTables::Undo() SvShorts TheTabs; for(int i=0;iCount();i++) { - TheTabs.Insert( sal::static_int_cast(nTab+i), TheTabs.Count() ); + TheTabs.push_back( sal::static_int_cast(nTab+i) ); } pViewShell->DeleteTables( TheTabs, FALSE ); - TheTabs.Remove(0,TheTabs.Count()); + TheTabs.clear(); bDrawIsInUndo = FALSE; pDocShell->SetInUndo( FALSE ); //! EndUndo @@ -322,15 +322,14 @@ ScUndoDeleteTab::ScUndoDeleteTab( ScDocShell* pNewDocShell,const SvShorts &aTab, ScDocument* pUndoDocument, ScRefUndoData* pRefData ) : ScMoveUndo( pNewDocShell, pUndoDocument, pRefData, SC_UNDO_REFLAST ) { - for(int i=0;i(i)],theTabs.Count()); + theTabs=aTab; SetChangeTrack(); } ScUndoDeleteTab::~ScUndoDeleteTab() { - theTabs.Remove(0,theTabs.Count()); + theTabs.clear(); } String ScUndoDeleteTab::GetComment() const @@ -347,7 +346,7 @@ void ScUndoDeleteTab::SetChangeTrack() nStartChangeAction = pChangeTrack->GetActionMax() + 1; nEndChangeAction = 0; ScRange aRange( 0, 0, 0, MAXCOL, MAXROW, 0 ); - for ( int i = 0; i < theTabs.Count(); i++ ) + for ( size_t i = 0; i < theTabs.size(); i++ ) { aRange.aStart.SetTab( theTabs[sal::static_int_cast(i)] ); aRange.aEnd.SetTab( theTabs[sal::static_int_cast(i)] ); @@ -370,13 +369,13 @@ SCTAB lcl_GetVisibleTabBefore( ScDocument& rDoc, SCTAB nTab ) void ScUndoDeleteTab::Undo() { BeginUndo(); - int i=0; + size_t i=0; ScDocument* pDoc = pDocShell->GetDocument(); BOOL bLink = FALSE; String aName; - for(i=0;i(i)]; pRefUndoDoc->GetName( nTab, aName ); @@ -434,7 +433,7 @@ void ScUndoDeleteTab::Undo() if ( pChangeTrack ) pChangeTrack->Undo( nStartChangeAction, nEndChangeAction ); - for(i=0;iBroadcast( ScTablesHint( SC_TAB_INSERTED, theTabs[sal::static_int_cast(i)]) ); } @@ -448,7 +447,7 @@ void ScUndoDeleteTab::Undo() // nicht ShowTable wegen SetTabNo(..., TRUE): ScTabViewShell* pViewShell = ScTabViewShell::GetActiveViewShell(); if (pViewShell) - pViewShell->SetTabNo( lcl_GetVisibleTabBefore( *pDoc, theTabs[0] ), TRUE ); + pViewShell->SetTabNo( lcl_GetVisibleTabBefore( *pDoc, theTabs.front() ), TRUE ); // EndUndo(); } @@ -456,7 +455,7 @@ void ScUndoDeleteTab::Undo() void ScUndoDeleteTab::Redo() { ScTabViewShell* pViewShell = ScTabViewShell::GetActiveViewShell(); - pViewShell->SetTabNo( lcl_GetVisibleTabBefore( *pDocShell->GetDocument(), theTabs[0] ) ); + pViewShell->SetTabNo( lcl_GetVisibleTabBefore( *pDocShell->GetDocument(), theTabs.front() ) ); RedoSdrUndoAction( pDrawUndo ); // Draw Redo first @@ -560,18 +559,14 @@ ScUndoMoveTab::ScUndoMoveTab( ScDocShell* pNewDocShell, const SvShorts &aNewTab) : ScSimpleUndo( pNewDocShell ) { - int i; - for(i=0;i(i)],theOldTabs.Count()); - - for(i=0;i(i)],theNewTabs.Count()); + theOldTabs=aOldTab; + theNewTabs=aNewTab; } ScUndoMoveTab::~ScUndoMoveTab() { - theNewTabs.Remove(0,theNewTabs.Count()); - theOldTabs.Remove(0,theOldTabs.Count()); + theNewTabs.clear(); + theOldTabs.clear(); } String ScUndoMoveTab::GetComment() const @@ -586,11 +581,11 @@ void ScUndoMoveTab::DoChange( BOOL bUndo ) const if (bUndo) // UnDo { - for(int i=theNewTabs.Count()-1;i>=0;i--) + for(size_t i=theNewTabs.size()-1;i>=0;i--) { SCTAB nDestTab = theNewTabs[sal::static_int_cast(i)]; SCTAB nOldTab = theOldTabs[sal::static_int_cast(i)]; - if (nDestTab > MAXTAB) // angehaengt ? + if (nDestTab > MAXTAB) // append ? nDestTab = pDoc->GetTableCount() - 1; pDoc->MoveTab( nDestTab, nOldTab ); @@ -600,12 +595,12 @@ void ScUndoMoveTab::DoChange( BOOL bUndo ) const } else { - for(int i=0;i(i)]; SCTAB nNewTab = theNewTabs[sal::static_int_cast(i)]; SCTAB nOldTab = theOldTabs[sal::static_int_cast(i)]; - if (nDestTab > MAXTAB) // angehaengt ? + if (nDestTab > MAXTAB) // append ? nDestTab = pDoc->GetTableCount() - 1; pDoc->MoveTab( nOldTab, nNewTab ); @@ -633,7 +628,7 @@ void ScUndoMoveTab::Redo() void ScUndoMoveTab::Repeat(SfxRepeatTarget& /* rTarget */) { - // kein Repeat ! ? ! + // No Repeat ! ? ! } BOOL ScUndoMoveTab::CanRepeat(SfxRepeatTarget& /* rTarget */) const @@ -644,7 +639,7 @@ BOOL ScUndoMoveTab::CanRepeat(SfxRepeatTarget& /* rTarget */) const //---------------------------------------------------------------------------------- // -// Tabelle kopieren +// Copy table // ScUndoCopyTab::ScUndoCopyTab( ScDocShell* pNewDocShell, @@ -655,12 +650,8 @@ ScUndoCopyTab::ScUndoCopyTab( ScDocShell* pNewDocShell, { pDrawUndo = GetSdrUndoAction( pDocShell->GetDocument() ); - int i; - for(i=0;i(i)],theOldTabs.Count()); - - for(i=0;i(i)],theNewTabs.Count()); + theOldTabs=aOldTab; + theNewTabs=aNewTab; } ScUndoCopyTab::~ScUndoCopyTab() @@ -678,7 +669,7 @@ void ScUndoCopyTab::DoChange() const ScTabViewShell* pViewShell = ScTabViewShell::GetActiveViewShell(); if (pViewShell) - pViewShell->SetTabNo(theOldTabs[0],TRUE); + pViewShell->SetTabNo(theOldTabs.front(),TRUE); SFX_APP()->Broadcast( SfxSimpleHint( SC_HINT_TABLES_CHANGED ) ); // Navigator @@ -693,8 +684,8 @@ void ScUndoCopyTab::Undo() DoSdrUndoAction( pDrawUndo, pDoc ); // before the sheets are deleted - int i; - for(i=theNewTabs.Count()-1;i>=0;i--) + size_t i; + for(i=theNewTabs.size()-1;i>=0;i--) { SCTAB nDestTab = theNewTabs[sal::static_int_cast(i)]; if (nDestTab > MAXTAB) // append? @@ -708,7 +699,7 @@ void ScUndoCopyTab::Undo() // ScTablesHint broadcasts after all sheets have been deleted, // so sheets and draw pages are in sync! - for(i=theNewTabs.Count()-1;i>=0;i--) + for(i=theNewTabs.size()-1;i>=0;i--) { SCTAB nDestTab = theNewTabs[sal::static_int_cast(i)]; if (nDestTab > MAXTAB) // append? @@ -726,12 +717,12 @@ void ScUndoCopyTab::Redo() ScTabViewShell* pViewShell = ScTabViewShell::GetActiveViewShell(); SCTAB nDestTab = 0; - for(int i=0;i(i)]; SCTAB nNewTab = theNewTabs[sal::static_int_cast(i)]; SCTAB nOldTab = theOldTabs[sal::static_int_cast(i)]; - if (nDestTab > MAXTAB) // angehaengt ? + if (nDestTab > MAXTAB) // append ? nDestTab = pDoc->GetTableCount() - 1; bDrawIsInUndo = TRUE; diff --git a/sc/source/ui/view/tabvwshf.cxx b/sc/source/ui/view/tabvwshf.cxx index 20a10f149a3a..529e8a99cfb4 100644 --- a/sc/source/ui/view/tabvwshf.cxx +++ b/sc/source/ui/view/tabvwshf.cxx @@ -649,7 +649,7 @@ void ScTabViewShell::ExecuteTable( SfxRequest& rReq ) { if(rMark.GetTableSelect(i) &&!pDoc->IsTabProtected(i)) { - TheTabs.Insert(i,TheTabs.Count()); + TheTabs.push_back(i); bTabFlag=TRUE; if(nNewTab==i) nNewTab++; } @@ -659,7 +659,7 @@ void ScTabViewShell::ExecuteTable( SfxRequest& rReq ) pViewData->SetTabNo(nNewTab); DeleteTables(TheTabs); - TheTabs.Remove(0,TheTabs.Count()); + TheTabs.clear(); rReq.Done(); } } diff --git a/sc/source/ui/view/viewfun2.cxx b/sc/source/ui/view/viewfun2.cxx index 34fbbfdad5b5..22ab8a85dcaa 100644 --- a/sc/source/ui/view/viewfun2.cxx +++ b/sc/source/ui/view/viewfun2.cxx @@ -2150,7 +2150,7 @@ BOOL ScViewFunc::DeleteTables(const SvShorts &TheTabs, BOOL bRecord ) ScDocShell* pDocSh = GetViewData()->GetDocShell(); ScDocument* pDoc = pDocSh->GetDocument(); BOOL bVbaEnabled = pDoc ? pDoc->IsInVBAMode() : FALSE; - SCTAB nNewTab = TheTabs[0]; + SCTAB nNewTab = TheTabs.front(); int i; WaitObject aWait( GetFrameWin() ); if (bRecord && !pDoc->IsUndoEnabled()) @@ -2171,7 +2171,7 @@ BOOL ScViewFunc::DeleteTables(const SvShorts &TheTabs, BOOL bRecord ) // pUndoDoc->InitUndo( pDoc, 0, nCount-1 ); // incl. Ref. String aOldName; - for(i=0;i(i)]; if (i==0) @@ -2221,7 +2221,7 @@ BOOL ScViewFunc::DeleteTables(const SvShorts &TheTabs, BOOL bRecord ) BOOL bDelDone = FALSE; - for(i=TheTabs.Count()-1;i>=0;i--) + for(i=TheTabs.size()-1;i>=0;i--) { String sCodeName; BOOL bHasCodeName = pDoc->GetCodeName( TheTabs[sal::static_int_cast(i)], sCodeName ); @@ -2585,13 +2585,13 @@ void ScViewFunc::MoveTable( USHORT nDestDocNo, SCTAB nDestTab, BOOL bCopy ) { String aTabName; pDoc->GetName( i, aTabName); - TheTabs.Insert(i,TheTabs.Count()); + TheTabs.push_back(i); for(SCTAB j=i+1;jIsVisible(j))&&(pDoc->IsScenario(j))) { pDoc->GetName( j, aTabName); - TheTabs.Insert(j,TheTabs.Count()); + TheTabs.push_back(j); i=j; } else break; @@ -2611,7 +2611,7 @@ void ScViewFunc::MoveTable( USHORT nDestDocNo, SCTAB nDestTab, BOOL bCopy ) if(nDestTab==SC_TAB_APPEND) nDestTab=pDestDoc->GetTableCount(); SCTAB nDestTab1=nDestTab; - for( USHORT j=0; jGetName( TheTabs[j], aName ); @@ -2625,7 +2625,7 @@ void ScViewFunc::MoveTable( USHORT nDestDocNo, SCTAB nDestTab, BOOL bCopy ) if ( nErrVal > 0 ) { nDestTab1 = nDestTab; - for(USHORT i=0;iTransferTab( pDoc, TheTabs[i], nDestTab1, FALSE ); // no insert @@ -2663,7 +2663,7 @@ void ScViewFunc::MoveTable( USHORT nDestDocNo, SCTAB nDestTab, BOOL bCopy ) pDestDoc->GetName(nDestTab, sName); pDestShell->GetUndoManager()->AddUndoAction( new ScUndoImportTab( pDestShell, nDestTab, - static_cast(TheTabs.Count()), FALSE)); + static_cast(TheTabs.size()), FALSE)); } else @@ -2716,7 +2716,7 @@ void ScViewFunc::MoveTable( USHORT nDestDocNo, SCTAB nDestTab, BOOL bCopy ) if ( pDestDoc->IsChartListenerCollectionNeedsUpdate() ) pDestDoc->UpdateChartListenerCollection(); - pDestDoc->DeleteTab(static_cast(TheTabs.Count())); // alte erste Tabelle + pDestDoc->DeleteTab(static_cast(TheTabs.size())); // first old table //? pDestDoc->SelectTable(0, TRUE); // neue erste Tabelle selektieren if (pDestViewSh) pDestViewSh->TabChanged(); // Pages auf dem Drawing-Layer @@ -2732,12 +2732,12 @@ void ScViewFunc::MoveTable( USHORT nDestDocNo, SCTAB nDestTab, BOOL bCopy ) pDestShell->PostPaintGridAll(); } - TheTabs.Remove(0,TheTabs.Count()); + TheTabs.clear(); pDestShell->SetDocumentModified(); SFX_APP()->Broadcast( SfxSimpleHint( SC_HINT_TABLES_CHANGED ) ); } - else // innerhalb des Dokuments + else // within the documents { ScMarkData& rMark = GetViewData()->GetMarkData(); @@ -2806,7 +2806,7 @@ void ScViewFunc::MoveTable( USHORT nDestDocNo, SCTAB nDestTab, BOOL bCopy ) pDoc->SetVisible(nDestTab1,bVisible ); } - TheTabs.Insert(nMovTab,TheTabs.Count()); + TheTabs.push_back(nMovTab); if(!bCopy) { @@ -2816,7 +2816,7 @@ void ScViewFunc::MoveTable( USHORT nDestDocNo, SCTAB nDestTab, BOOL bCopy ) } } - TheDestTabs.Insert(nDestTab1,TheDestTabs.Count()); + TheDestTabs.push_back(nDestTab1); delete pString; } -- cgit From 70af5b80168c0d41e53afe8062e27b94e7c40db7 Mon Sep 17 00:00:00 2001 From: Bartosz Kosiorek Date: Mon, 18 Oct 2010 22:00:21 +0200 Subject: svarray: #i112395# #i84159# increase max number of pools to 2^32 --- sc/source/core/data/docpool.cxx | 6 +++--- sc/source/core/data/documen9.cxx | 10 +++++----- sc/source/core/data/document.cxx | 24 ++++++++++++------------ sc/source/core/data/fillinfo.cxx | 6 +++--- sc/source/filter/xml/xmlexprt.cxx | 6 +++--- sc/source/filter/xml/xmlfonte.cxx | 12 ++++++------ sc/source/ui/unoobj/defltuno.cxx | 2 +- 7 files changed, 33 insertions(+), 33 deletions(-) diff --git a/sc/source/core/data/docpool.cxx b/sc/source/core/data/docpool.cxx index cd763cfc0787..bfc9b1dc3ebc 100644 --- a/sc/source/core/data/docpool.cxx +++ b/sc/source/core/data/docpool.cxx @@ -642,10 +642,10 @@ void ScDocumentPool::CheckRef( const SfxPoolItem& rItem ) // static void ScDocumentPool::StyleDeleted( ScStyleSheet* pStyle ) { - USHORT nCount = GetItemCount(ATTR_PATTERN); - for (USHORT i=0; iGetStyleSheet() == pStyle ) pPattern->StyleToName(); } diff --git a/sc/source/core/data/documen9.cxx b/sc/source/core/data/documen9.cxx index abef7d53c2af..37b3c830bb30 100644 --- a/sc/source/core/data/documen9.cxx +++ b/sc/source/core/data/documen9.cxx @@ -694,14 +694,14 @@ void ScDocument::UpdateFontCharSet() CharSet eSysSet = gsl_getSystemTextEncoding(); if ( eSrcSet != eSysSet || bUpdateOld ) { - USHORT nCount,i; + sal_uInt32 nCount,i; SvxFontItem* pItem; ScDocumentPool* pPool = xPoolHelper->GetDocPool(); - nCount = pPool->GetItemCount(ATTR_FONT); + nCount = pPool->GetItemCount2(ATTR_FONT); for (i=0; iGetItem(ATTR_FONT, i); + pItem = (SvxFontItem*)pPool->GetItem2(ATTR_FONT, i); if ( pItem && ( pItem->GetCharSet() == eSrcSet || ( bUpdateOld && pItem->GetCharSet() != RTL_TEXTENCODING_SYMBOL ) ) ) pItem->GetCharSet() = eSysSet; @@ -710,10 +710,10 @@ void ScDocument::UpdateFontCharSet() if ( pDrawLayer ) { SfxItemPool& rDrawPool = pDrawLayer->GetItemPool(); - nCount = rDrawPool.GetItemCount(EE_CHAR_FONTINFO); + nCount = rDrawPool.GetItemCount2(EE_CHAR_FONTINFO); for (i=0; iGetCharSet() == eSrcSet || ( bUpdateOld && pItem->GetCharSet() != RTL_TEXTENCODING_SYMBOL ) ) ) pItem->GetCharSet() = eSysSet; diff --git a/sc/source/core/data/document.cxx b/sc/source/core/data/document.cxx index bef4cbf87396..aeec6c8dbb00 100644 --- a/sc/source/core/data/document.cxx +++ b/sc/source/core/data/document.cxx @@ -4164,10 +4164,10 @@ bool ScDocument::HasAttrib( SCCOL nCol1, SCROW nRow1, SCTAB nTab1, ScDocumentPool* pPool = xPoolHelper->GetDocPool(); BOOL bAnyItem = FALSE; - USHORT nRotCount = pPool->GetItemCount( ATTR_ROTATE_VALUE ); - for (USHORT nItem=0; nItemGetItemCount2( ATTR_ROTATE_VALUE ); + for (sal_uInt32 nItem=0; nItemGetItem( ATTR_ROTATE_VALUE, nItem ); + const SfxPoolItem* pItem = pPool->GetItem2( ATTR_ROTATE_VALUE, nItem ); if ( pItem ) { // 90 or 270 degrees is former SvxOrientationItem - only look for other values @@ -4192,10 +4192,10 @@ bool ScDocument::HasAttrib( SCCOL nCol1, SCROW nRow1, SCTAB nTab1, ScDocumentPool* pPool = xPoolHelper->GetDocPool(); BOOL bHasRtl = FALSE; - USHORT nDirCount = pPool->GetItemCount( ATTR_WRITINGDIR ); - for (USHORT nItem=0; nItemGetItemCount2( ATTR_WRITINGDIR ); + for (sal_uInt32 nItem=0; nItemGetItem( ATTR_WRITINGDIR, nItem ); + const SfxPoolItem* pItem = pPool->GetItem2( ATTR_WRITINGDIR, nItem ); if ( pItem && ((const SvxFrameDirectionItem*)pItem)->GetValue() == FRMDIR_HORI_RIGHT_TOP ) { bHasRtl = TRUE; @@ -4906,11 +4906,11 @@ void ScDocument::UpdStlShtPtrsFrmNms() ScDocumentPool* pPool = xPoolHelper->GetDocPool(); - USHORT nCount = pPool->GetItemCount(ATTR_PATTERN); + sal_uInt32 nCount = pPool->GetItemCount2(ATTR_PATTERN); ScPatternAttr* pPattern; - for (USHORT i=0; iGetItem(ATTR_PATTERN, i); + pPattern = (ScPatternAttr*)pPool->GetItem2(ATTR_PATTERN, i); if (pPattern) pPattern->UpdateStyleSheet(); } @@ -4924,11 +4924,11 @@ void ScDocument::StylesToNames() ScDocumentPool* pPool = xPoolHelper->GetDocPool(); - USHORT nCount = pPool->GetItemCount(ATTR_PATTERN); + sal_uInt32 nCount = pPool->GetItemCount2(ATTR_PATTERN); ScPatternAttr* pPattern; - for (USHORT i=0; iGetItem(ATTR_PATTERN, i); + pPattern = (ScPatternAttr*)pPool->GetItem2(ATTR_PATTERN, i); if (pPattern) pPattern->StyleToName(); } diff --git a/sc/source/core/data/fillinfo.cxx b/sc/source/core/data/fillinfo.cxx index 8418cb3c3a25..528129167ccd 100644 --- a/sc/source/core/data/fillinfo.cxx +++ b/sc/source/core/data/fillinfo.cxx @@ -268,9 +268,9 @@ void ScDocument::FillInfo( ScTableInfo& rTabInfo, SCCOL nX1, SCROW nY1, SCCOL nX // Attribut im Dokument ueberhaupt verwendet? BOOL bAnyItem = FALSE; - USHORT nRotCount = pPool->GetItemCount( ATTR_ROTATE_VALUE ); - for (USHORT nItem=0; nItemGetItem( ATTR_ROTATE_VALUE, nItem )) + sal_uInt32 nRotCount = pPool->GetItemCount2( ATTR_ROTATE_VALUE ); + for (sal_uInt32 nItem=0; nItemGetItem2( ATTR_ROTATE_VALUE, nItem )) { bAnyItem = TRUE; break; diff --git a/sc/source/filter/xml/xmlexprt.cxx b/sc/source/filter/xml/xmlexprt.cxx index 0563f6430063..43a0020b70cf 100644 --- a/sc/source/filter/xml/xmlexprt.cxx +++ b/sc/source/filter/xml/xmlexprt.cxx @@ -4390,10 +4390,10 @@ XMLNumberFormatAttributesExportHelper* ScXMLExport::GetNumberFormatAttributesExp void ScXMLExport::CollectUserDefinedNamespaces(const SfxItemPool* pPool, sal_uInt16 nAttrib) { const SfxPoolItem* pItem; - sal_uInt16 nItems(pPool->GetItemCount( nAttrib )); - for( sal_uInt16 i = 0; i < nItems; ++i ) + sal_uInt32 nItems(pPool->GetItemCount2( nAttrib )); + for( sal_uInt32 i = 0; i < nItems; ++i ) { - if( 0 != (pItem = pPool->GetItem( nAttrib, i ) ) ) + if( 0 != (pItem = pPool->GetItem2( nAttrib, i ) ) ) { const SvXMLAttrContainerItem *pUnknown((const SvXMLAttrContainerItem *)pItem); if( (pUnknown->GetAttrCount() > 0) ) diff --git a/sc/source/filter/xml/xmlfonte.cxx b/sc/source/filter/xml/xmlfonte.cxx index 5cbb2604581f..50fe06e9629c 100644 --- a/sc/source/filter/xml/xmlfonte.cxx +++ b/sc/source/filter/xml/xmlfonte.cxx @@ -70,10 +70,10 @@ void ScXMLFontAutoStylePool_Impl::AddFontItems(sal_uInt16* pWhichIds, sal_uInt8 sal::static_int_cast(pFont->GetPitch()), pFont->GetCharSet() ); } - sal_uInt16 nItems(pItemPool->GetItemCount( nWhichId )); - for( sal_uInt16 j = 0; j < nItems; ++j ) + sal_uInt32 nItems(pItemPool->GetItemCount2( nWhichId )); + for( sal_uInt32 j = 0; j < nItems; ++j ) { - if( 0 != (pItem = pItemPool->GetItem( nWhichId, j ) ) ) + if( 0 != (pItem = pItemPool->GetItem2( nWhichId, j ) ) ) { const SvxFontItem *pFont((const SvxFontItem *)pItem); Add( pFont->GetFamilyName(), pFont->GetStyleName(), @@ -113,11 +113,11 @@ ScXMLFontAutoStylePool_Impl::ScXMLFontAutoStylePool_Impl( for (sal_uInt8 j = 0; j < 4; ++j) { sal_uInt16 nPageWhichId(aPageWhichIds[j]); - sal_uInt16 nPageHFItems(rPagePool.GetItemCount(nPageWhichId)); + sal_uInt32 nPageHFItems(rPagePool.GetItemCount2(nPageWhichId)); const ScPageHFItem* pPageItem; - for (sal_uInt16 k = 0; k < nPageHFItems; ++k) + for (sal_uInt32 k = 0; k < nPageHFItems; ++k) { - if (0 != (pPageItem = static_cast(rPagePool.GetItem(nPageWhichId, k)))) + if (0 != (pPageItem = static_cast(rPagePool.GetItem2(nPageWhichId, k)))) { const EditTextObject* pLeftArea(pPageItem->GetLeftArea()); if (pLeftArea) diff --git a/sc/source/ui/unoobj/defltuno.cxx b/sc/source/ui/unoobj/defltuno.cxx index f3f76685e5cb..2cc997fd2d9a 100644 --- a/sc/source/ui/unoobj/defltuno.cxx +++ b/sc/source/ui/unoobj/defltuno.cxx @@ -377,7 +377,7 @@ uno::Any SAL_CALL ScDocDefaultsObj::getPropertyDefault( const rtl::OUString& aPr if (pEntry->nWID) { ScDocumentPool* pPool = pDocShell->GetDocument()->GetPool(); - const SfxPoolItem* pItem = pPool->GetItem( pEntry->nWID, SFX_ITEMS_STATICDEFAULT ); + const SfxPoolItem* pItem = pPool->GetItem2( pEntry->nWID, SFX_ITEMS_STATICDEFAULT ); if (pItem) pItem->QueryValue( aRet, pEntry->nMemberId ); } -- cgit From f7442ff60ad8ee01cfdf0e5cebed4f50d2ca0a79 Mon Sep 17 00:00:00 2001 From: Bartosz Kosiorek Date: Tue, 19 Oct 2010 20:40:04 +0200 Subject: svarray: #i112395#: #i84159# new const: SFX_ITEMS_DEFAULT --- sc/source/ui/unoobj/defltuno.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sc/source/ui/unoobj/defltuno.cxx b/sc/source/ui/unoobj/defltuno.cxx index 2cc997fd2d9a..c0faf59fa51b 100644 --- a/sc/source/ui/unoobj/defltuno.cxx +++ b/sc/source/ui/unoobj/defltuno.cxx @@ -377,7 +377,7 @@ uno::Any SAL_CALL ScDocDefaultsObj::getPropertyDefault( const rtl::OUString& aPr if (pEntry->nWID) { ScDocumentPool* pPool = pDocShell->GetDocument()->GetPool(); - const SfxPoolItem* pItem = pPool->GetItem2( pEntry->nWID, SFX_ITEMS_STATICDEFAULT ); + const SfxPoolItem* pItem = pPool->GetItem2( pEntry->nWID, SFX_ITEMS_DEFAULT ); if (pItem) pItem->QueryValue( aRet, pEntry->nMemberId ); } -- cgit From 853eb9487eae742be2f739bfda656c1310f3cbee Mon Sep 17 00:00:00 2001 From: Bartosz Kosiorek Date: Thu, 21 Oct 2010 23:25:11 +0200 Subject: svarray: #i112395#: fix GetItem->GetItem2 --- sc/source/core/data/docpool.cxx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sc/source/core/data/docpool.cxx b/sc/source/core/data/docpool.cxx index f341aa4b52fe..d0756d25487f 100644 --- a/sc/source/core/data/docpool.cxx +++ b/sc/source/core/data/docpool.cxx @@ -658,10 +658,10 @@ void ScDocumentPool::CellStyleCreated( const String& rName ) // Calling StyleSheetChanged isn't enough because the pool may still contain items // for undo or clipboard content. - sal_uInt16 nCount = GetItemCount(ATTR_PATTERN); - for (sal_uInt16 i=0; iGetStyleSheet() == NULL ) { const String* pStyleName = pPattern->GetStyleName(); -- cgit From 84eb8aac649b06a37dc209e3f94c0ff5e53a0717 Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Sat, 23 Oct 2010 15:48:00 +0200 Subject: svarray: #i112395#: fix warnings, enable exceptions, etc. --- sc/source/core/data/docpool.cxx | 4 +++- sc/source/ui/docshell/makefile.mk | 1 + sc/source/ui/undo/undotab.cxx | 27 +++++++++++++-------------- sc/source/ui/view/viewfun2.cxx | 13 ++++++------- 4 files changed, 23 insertions(+), 22 deletions(-) diff --git a/sc/source/core/data/docpool.cxx b/sc/source/core/data/docpool.cxx index d0756d25487f..2bb5922242cb 100644 --- a/sc/source/core/data/docpool.cxx +++ b/sc/source/core/data/docpool.cxx @@ -661,7 +661,9 @@ void ScDocumentPool::CellStyleCreated( const String& rName ) sal_uInt32 nCount = GetItemCount2(ATTR_PATTERN); for (sal_uInt32 i=0; i( + static_cast(GetItem2(ATTR_PATTERN, i))); if ( pPattern && pPattern->GetStyleSheet() == NULL ) { const String* pStyleName = pPattern->GetStyleName(); diff --git a/sc/source/ui/docshell/makefile.mk b/sc/source/ui/docshell/makefile.mk index 99a7495b6b49..af45c63c2cdf 100644 --- a/sc/source/ui/docshell/makefile.mk +++ b/sc/source/ui/docshell/makefile.mk @@ -98,6 +98,7 @@ EXCEPTIONSFILES= \ $(SLO)$/docsh.obj \ $(SLO)$/docsh3.obj \ $(SLO)$/docsh4.obj \ + $(SLO)$/docsh5.obj \ $(SLO)$/docsh8.obj \ $(SLO)$/externalrefmgr.obj \ $(SLO)$/dbdocimp.obj \ diff --git a/sc/source/ui/undo/undotab.cxx b/sc/source/ui/undo/undotab.cxx index 2200234187e1..d9acc34bf28c 100644 --- a/sc/source/ui/undo/undotab.cxx +++ b/sc/source/ui/undo/undotab.cxx @@ -569,10 +569,10 @@ void ScUndoMoveTab::DoChange( BOOL bUndo ) const if (bUndo) // UnDo { - for(size_t i=theNewTabs.size()-1;i>=0;i--) + for (size_t i = theNewTabs.size(); i > 0; i--) { - SCTAB nDestTab = theNewTabs[sal::static_int_cast(i)]; - SCTAB nOldTab = theOldTabs[sal::static_int_cast(i)]; + SCTAB nDestTab = theNewTabs[i - 1]; + SCTAB nOldTab = theOldTabs[i - 1]; if (nDestTab > MAXTAB) // append ? nDestTab = pDoc->GetTableCount() - 1; @@ -585,9 +585,9 @@ void ScUndoMoveTab::DoChange( BOOL bUndo ) const { for(size_t i=0;i(i)]; - SCTAB nNewTab = theNewTabs[sal::static_int_cast(i)]; - SCTAB nOldTab = theOldTabs[sal::static_int_cast(i)]; + SCTAB nDestTab = theNewTabs[i]; + SCTAB nNewTab = theNewTabs[i]; + SCTAB nOldTab = theOldTabs[i]; if (nDestTab > MAXTAB) // append ? nDestTab = pDoc->GetTableCount() - 1; @@ -672,10 +672,9 @@ void ScUndoCopyTab::Undo() DoSdrUndoAction( pDrawUndo, pDoc ); // before the sheets are deleted - size_t i; - for(i=theNewTabs.size()-1;i>=0;i--) + for (size_t i = theNewTabs.size(); i > 0; i--) { - SCTAB nDestTab = theNewTabs[sal::static_int_cast(i)]; + SCTAB nDestTab = theNewTabs[i - 1]; if (nDestTab > MAXTAB) // append? nDestTab = pDoc->GetTableCount() - 1; @@ -687,9 +686,9 @@ void ScUndoCopyTab::Undo() // ScTablesHint broadcasts after all sheets have been deleted, // so sheets and draw pages are in sync! - for(i=theNewTabs.size()-1;i>=0;i--) + for (size_t i = theNewTabs.size(); i > 0; i--) { - SCTAB nDestTab = theNewTabs[sal::static_int_cast(i)]; + SCTAB nDestTab = theNewTabs[i - 1]; if (nDestTab > MAXTAB) // append? nDestTab = pDoc->GetTableCount() - 1; @@ -707,9 +706,9 @@ void ScUndoCopyTab::Redo() SCTAB nDestTab = 0; for(size_t i=0;i(i)]; - SCTAB nNewTab = theNewTabs[sal::static_int_cast(i)]; - SCTAB nOldTab = theOldTabs[sal::static_int_cast(i)]; + nDestTab = theNewTabs[i]; + SCTAB nNewTab = theNewTabs[i]; + SCTAB nOldTab = theOldTabs[i]; if (nDestTab > MAXTAB) // append ? nDestTab = pDoc->GetTableCount() - 1; diff --git a/sc/source/ui/view/viewfun2.cxx b/sc/source/ui/view/viewfun2.cxx index ee17a6cb4876..e73eabff4237 100644 --- a/sc/source/ui/view/viewfun2.cxx +++ b/sc/source/ui/view/viewfun2.cxx @@ -2149,7 +2149,6 @@ BOOL ScViewFunc::DeleteTables(const SvShorts &TheTabs, BOOL bRecord ) ScDocument* pDoc = pDocSh->GetDocument(); BOOL bVbaEnabled = pDoc ? pDoc->IsInVBAMode() : FALSE; SCTAB nNewTab = TheTabs.front(); - int i; WaitObject aWait( GetFrameWin() ); if (bRecord && !pDoc->IsUndoEnabled()) bRecord = FALSE; @@ -2169,9 +2168,9 @@ BOOL ScViewFunc::DeleteTables(const SvShorts &TheTabs, BOOL bRecord ) // pUndoDoc->InitUndo( pDoc, 0, nCount-1 ); // incl. Ref. String aOldName; - for(i=0;i(i)]; + SCTAB nTab = TheTabs[i]; if (i==0) pUndoDoc->InitUndo( pDoc, nTab,nTab, TRUE,TRUE ); // incl. Spalten/Zeilenflags else @@ -2219,11 +2218,11 @@ BOOL ScViewFunc::DeleteTables(const SvShorts &TheTabs, BOOL bRecord ) BOOL bDelDone = FALSE; - for(i=TheTabs.size()-1;i>=0;i--) + for (size_t i = TheTabs.size(); i > 0; i--) { String sCodeName; - BOOL bHasCodeName = pDoc->GetCodeName( TheTabs[sal::static_int_cast(i)], sCodeName ); - if (pDoc->DeleteTab( TheTabs[sal::static_int_cast(i)], pUndoDoc )) + BOOL bHasCodeName = pDoc->GetCodeName( TheTabs[i-1], sCodeName ); + if (pDoc->DeleteTab( TheTabs[i-1], pUndoDoc )) { bDelDone = TRUE; if( bVbaEnabled ) @@ -2233,7 +2232,7 @@ BOOL ScViewFunc::DeleteTables(const SvShorts &TheTabs, BOOL bRecord ) VBA_DeleteModule( *pDocSh, sCodeName ); } } - pDocSh->Broadcast( ScTablesHint( SC_TAB_DELETED, TheTabs[sal::static_int_cast(i)] ) ); + pDocSh->Broadcast( ScTablesHint( SC_TAB_DELETED, TheTabs[i-1] ) ); } } if (bRecord) -- cgit