diff options
author | Vladimir Glazunov <vg@openoffice.org> | 2010-11-01 16:40:46 +0100 |
---|---|---|
committer | Vladimir Glazunov <vg@openoffice.org> | 2010-11-01 16:40:46 +0100 |
commit | 55fcd95353d1d2bedd3327fc0dbc56a7e6a672a3 (patch) | |
tree | b18d3e92d85079ecc0e4425ea117a51aee1f7add /sc | |
parent | 3896b952601af7a69b125c8bde34c2a4b015546f (diff) | |
parent | 0dbd1857b582da37acf4031ca7be3918764e8fa3 (diff) |
CWS-TOOLING: integrate CWS svarrayooo/DEV300_m92
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/core/data/docpool.cxx | 14 | ||||
-rw-r--r-- | sc/source/core/data/documen9.cxx | 10 | ||||
-rw-r--r-- | sc/source/core/data/document.cxx | 24 | ||||
-rw-r--r-- | sc/source/core/data/fillinfo.cxx | 6 | ||||
-rw-r--r-- | sc/source/filter/xml/xmlexprt.cxx | 6 | ||||
-rw-r--r-- | sc/source/filter/xml/xmlfonte.cxx | 12 | ||||
-rw-r--r-- | sc/source/ui/docshell/docfunc.cxx | 2 | ||||
-rw-r--r-- | sc/source/ui/docshell/docsh5.cxx | 8 | ||||
-rw-r--r-- | sc/source/ui/docshell/makefile.mk | 1 | ||||
-rw-r--r-- | sc/source/ui/undo/undotab.cxx | 84 | ||||
-rw-r--r-- | sc/source/ui/unoobj/defltuno.cxx | 2 | ||||
-rw-r--r-- | sc/source/ui/view/tabvwshf.cxx | 4 | ||||
-rw-r--r-- | sc/source/ui/view/viewfun2.cxx | 35 |
13 files changed, 100 insertions, 108 deletions
diff --git a/sc/source/core/data/docpool.cxx b/sc/source/core/data/docpool.cxx index b9078a530..b1724eabe 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; i<nCount; i++) + sal_uInt32 nCount = GetItemCount2(ATTR_PATTERN); + for (sal_uInt32 i=0; i<nCount; i++) { - ScPatternAttr* pPattern = (ScPatternAttr*)GetItem(ATTR_PATTERN, i); + ScPatternAttr* pPattern = (ScPatternAttr*)GetItem2(ATTR_PATTERN, i); if ( pPattern && pPattern->GetStyleSheet() == pStyle ) pPattern->StyleToName(); } @@ -658,10 +658,12 @@ 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; i<nCount; i++) + sal_uInt32 nCount = GetItemCount2(ATTR_PATTERN); + for (sal_uInt32 i=0; i<nCount; i++) { - ScPatternAttr* pPattern = (ScPatternAttr*)GetItem(ATTR_PATTERN, i); + ScPatternAttr *const pPattern = + const_cast<ScPatternAttr*>( + static_cast<ScPatternAttr const*>(GetItem2(ATTR_PATTERN, i))); if ( pPattern && pPattern->GetStyleSheet() == NULL ) { const String* pStyleName = pPattern->GetStyleName(); diff --git a/sc/source/core/data/documen9.cxx b/sc/source/core/data/documen9.cxx index 92b5fb7d0..337c971b8 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; i<nCount; i++) { - pItem = (SvxFontItem*)pPool->GetItem(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; i<nCount; i++) { - pItem = (SvxFontItem*)rDrawPool.GetItem(EE_CHAR_FONTINFO, i); + pItem = (SvxFontItem*)rDrawPool.GetItem2(EE_CHAR_FONTINFO, i); if ( pItem && ( pItem->GetCharSet() == 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 b7ecc9462..76952fb3e 100644 --- a/sc/source/core/data/document.cxx +++ b/sc/source/core/data/document.cxx @@ -4197,10 +4197,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; nItem<nRotCount; nItem++) + sal_uInt32 nRotCount = pPool->GetItemCount2( ATTR_ROTATE_VALUE ); + for (sal_uInt32 nItem=0; nItem<nRotCount; nItem++) { - const SfxPoolItem* pItem = pPool->GetItem( 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 @@ -4225,10 +4225,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; nItem<nDirCount; nItem++) + sal_uInt32 nDirCount = pPool->GetItemCount2( ATTR_WRITINGDIR ); + for (sal_uInt32 nItem=0; nItem<nDirCount; nItem++) { - const SfxPoolItem* pItem = pPool->GetItem( ATTR_WRITINGDIR, nItem ); + const SfxPoolItem* pItem = pPool->GetItem2( ATTR_WRITINGDIR, nItem ); if ( pItem && ((const SvxFrameDirectionItem*)pItem)->GetValue() == FRMDIR_HORI_RIGHT_TOP ) { bHasRtl = TRUE; @@ -4939,11 +4939,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; i<nCount; i++) + for (sal_uInt32 i=0; i<nCount; i++) { - pPattern = (ScPatternAttr*)pPool->GetItem(ATTR_PATTERN, i); + pPattern = (ScPatternAttr*)pPool->GetItem2(ATTR_PATTERN, i); if (pPattern) pPattern->UpdateStyleSheet(); } @@ -4957,11 +4957,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; i<nCount; i++) + for (sal_uInt32 i=0; i<nCount; i++) { - pPattern = (ScPatternAttr*)pPool->GetItem(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 280b77773..463011eca 100644 --- a/sc/source/core/data/fillinfo.cxx +++ b/sc/source/core/data/fillinfo.cxx @@ -272,9 +272,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; nItem<nRotCount; nItem++) - if (pPool->GetItem( ATTR_ROTATE_VALUE, nItem )) + sal_uInt32 nRotCount = pPool->GetItemCount2( ATTR_ROTATE_VALUE ); + for (sal_uInt32 nItem=0; nItem<nRotCount; nItem++) + if (pPool->GetItem2( ATTR_ROTATE_VALUE, nItem )) { bAnyItem = TRUE; break; diff --git a/sc/source/filter/xml/xmlexprt.cxx b/sc/source/filter/xml/xmlexprt.cxx index 91f5ff45c..43b196146 100644 --- a/sc/source/filter/xml/xmlexprt.cxx +++ b/sc/source/filter/xml/xmlexprt.cxx @@ -4389,10 +4389,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 b082cd74e..e22e20a0b 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<sal_Int16>(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<const ScPageHFItem*>(rPagePool.GetItem(nPageWhichId, k)))) + if (0 != (pPageItem = static_cast<const ScPageHFItem*>(rPagePool.GetItem2(nPageWhichId, k)))) { const EditTextObject* pLeftArea(pPageItem->GetLeftArea()); if (pLeftArea) diff --git a/sc/source/ui/docshell/docfunc.cxx b/sc/source/ui/docshell/docfunc.cxx index f6058b2ae..35d68e4b3 100644 --- a/sc/source/ui/docshell/docfunc.cxx +++ b/sc/source/ui/docshell/docfunc.cxx @@ -2806,7 +2806,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 aa3ca3e66..ac2a4132b 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/docshell/makefile.mk b/sc/source/ui/docshell/makefile.mk index 99a7495b6..af45c63c2 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 1b4f94521..595be642a 100644 --- a/sc/source/ui/undo/undotab.cxx +++ b/sc/source/ui/undo/undotab.cxx @@ -252,11 +252,11 @@ void ScUndoInsertTables::Undo() SvShorts TheTabs; for(int i=0;i<pNameList->Count();i++) { - TheTabs.Insert( sal::static_int_cast<short>(nTab+i), TheTabs.Count() ); + TheTabs.push_back( sal::static_int_cast<short>(nTab+i) ); } pViewShell->DeleteTables( TheTabs, FALSE ); - TheTabs.Remove(0,TheTabs.Count()); + TheTabs.clear(); bDrawIsInUndo = FALSE; pDocShell->SetInUndo( FALSE ); //! EndUndo @@ -310,15 +310,14 @@ ScUndoDeleteTab::ScUndoDeleteTab( ScDocShell* pNewDocShell,const SvShorts &aTab, ScDocument* pUndoDocument, ScRefUndoData* pRefData ) : ScMoveUndo( pNewDocShell, pUndoDocument, pRefData, SC_UNDO_REFLAST ) { - for(int i=0;i<aTab.Count();i++) - theTabs.Insert(aTab[sal::static_int_cast<USHORT>(i)],theTabs.Count()); + theTabs=aTab; SetChangeTrack(); } ScUndoDeleteTab::~ScUndoDeleteTab() { - theTabs.Remove(0,theTabs.Count()); + theTabs.clear(); } String ScUndoDeleteTab::GetComment() const @@ -335,7 +334,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<USHORT>(i)] ); aRange.aEnd.SetTab( theTabs[sal::static_int_cast<USHORT>(i)] ); @@ -358,13 +357,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<theTabs.Count();i++) + for(i=0;i<theTabs.size();i++) { SCTAB nTab = theTabs[sal::static_int_cast<USHORT>(i)]; pRefUndoDoc->GetName( nTab, aName ); @@ -422,7 +421,7 @@ void ScUndoDeleteTab::Undo() if ( pChangeTrack ) pChangeTrack->Undo( nStartChangeAction, nEndChangeAction ); - for(i=0;i<theTabs.Count();i++) + for(i=0;i<theTabs.size();i++) { pDocShell->Broadcast( ScTablesHint( SC_TAB_INSERTED, theTabs[sal::static_int_cast<USHORT>(i)]) ); } @@ -436,7 +435,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(); } @@ -444,7 +443,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 @@ -548,18 +547,14 @@ ScUndoMoveTab::ScUndoMoveTab( ScDocShell* pNewDocShell, const SvShorts &aNewTab) : ScSimpleUndo( pNewDocShell ) { - int i; - for(i=0;i<aOldTab.Count();i++) - theOldTabs.Insert(aOldTab[sal::static_int_cast<USHORT>(i)],theOldTabs.Count()); - - for(i=0;i<aNewTab.Count();i++) - theNewTabs.Insert(aNewTab[sal::static_int_cast<USHORT>(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 @@ -574,11 +569,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(); i > 0; i--) { - SCTAB nDestTab = theNewTabs[sal::static_int_cast<USHORT>(i)]; - SCTAB nOldTab = theOldTabs[sal::static_int_cast<USHORT>(i)]; - if (nDestTab > MAXTAB) // angehaengt ? + SCTAB nDestTab = theNewTabs[i - 1]; + SCTAB nOldTab = theOldTabs[i - 1]; + if (nDestTab > MAXTAB) // append ? nDestTab = pDoc->GetTableCount() - 1; pDoc->MoveTab( nDestTab, nOldTab ); @@ -588,12 +583,12 @@ void ScUndoMoveTab::DoChange( BOOL bUndo ) const } else { - for(int i=0;i<theNewTabs.Count();i++) + for(size_t i=0;i<theNewTabs.size();i++) { - SCTAB nDestTab = theNewTabs[sal::static_int_cast<USHORT>(i)]; - SCTAB nNewTab = theNewTabs[sal::static_int_cast<USHORT>(i)]; - SCTAB nOldTab = theOldTabs[sal::static_int_cast<USHORT>(i)]; - if (nDestTab > MAXTAB) // angehaengt ? + SCTAB nDestTab = theNewTabs[i]; + SCTAB nNewTab = theNewTabs[i]; + SCTAB nOldTab = theOldTabs[i]; + if (nDestTab > MAXTAB) // append ? nDestTab = pDoc->GetTableCount() - 1; pDoc->MoveTab( nOldTab, nNewTab ); @@ -621,7 +616,7 @@ void ScUndoMoveTab::Redo() void ScUndoMoveTab::Repeat(SfxRepeatTarget& /* rTarget */) { - // kein Repeat ! ? ! + // No Repeat ! ? ! } BOOL ScUndoMoveTab::CanRepeat(SfxRepeatTarget& /* rTarget */) const @@ -632,7 +627,7 @@ BOOL ScUndoMoveTab::CanRepeat(SfxRepeatTarget& /* rTarget */) const //---------------------------------------------------------------------------------- // -// Tabelle kopieren +// Copy table // ScUndoCopyTab::ScUndoCopyTab( ScDocShell* pNewDocShell, @@ -643,12 +638,8 @@ ScUndoCopyTab::ScUndoCopyTab( ScDocShell* pNewDocShell, { pDrawUndo = GetSdrUndoAction( pDocShell->GetDocument() ); - int i; - for(i=0;i<aOldTab.Count();i++) - theOldTabs.Insert(aOldTab[sal::static_int_cast<USHORT>(i)],theOldTabs.Count()); - - for(i=0;i<aNewTab.Count();i++) - theNewTabs.Insert(aNewTab[sal::static_int_cast<USHORT>(i)],theNewTabs.Count()); + theOldTabs=aOldTab; + theNewTabs=aNewTab; } ScUndoCopyTab::~ScUndoCopyTab() @@ -666,7 +657,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 @@ -681,10 +672,9 @@ void ScUndoCopyTab::Undo() DoSdrUndoAction( pDrawUndo, pDoc ); // before the sheets are deleted - int i; - for(i=theNewTabs.Count()-1;i>=0;i--) + for (size_t i = theNewTabs.size(); i > 0; i--) { - SCTAB nDestTab = theNewTabs[sal::static_int_cast<USHORT>(i)]; + SCTAB nDestTab = theNewTabs[i - 1]; if (nDestTab > MAXTAB) // append? nDestTab = pDoc->GetTableCount() - 1; @@ -696,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.Count()-1;i>=0;i--) + for (size_t i = theNewTabs.size(); i > 0; i--) { - SCTAB nDestTab = theNewTabs[sal::static_int_cast<USHORT>(i)]; + SCTAB nDestTab = theNewTabs[i - 1]; if (nDestTab > MAXTAB) // append? nDestTab = pDoc->GetTableCount() - 1; @@ -714,12 +704,12 @@ void ScUndoCopyTab::Redo() ScTabViewShell* pViewShell = ScTabViewShell::GetActiveViewShell(); SCTAB nDestTab = 0; - for(int i=0;i<theNewTabs.Count();i++) + for(size_t i=0;i<theNewTabs.size();i++) { - nDestTab = theNewTabs[sal::static_int_cast<USHORT>(i)]; - SCTAB nNewTab = theNewTabs[sal::static_int_cast<USHORT>(i)]; - SCTAB nOldTab = theOldTabs[sal::static_int_cast<USHORT>(i)]; - if (nDestTab > MAXTAB) // angehaengt ? + nDestTab = theNewTabs[i]; + SCTAB nNewTab = theNewTabs[i]; + SCTAB nOldTab = theOldTabs[i]; + if (nDestTab > MAXTAB) // append ? nDestTab = pDoc->GetTableCount() - 1; bDrawIsInUndo = TRUE; diff --git a/sc/source/ui/unoobj/defltuno.cxx b/sc/source/ui/unoobj/defltuno.cxx index f74e8b903..c174db80f 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_DEFAULT ); if (pItem) pItem->QueryValue( aRet, pEntry->nMemberId ); } diff --git a/sc/source/ui/view/tabvwshf.cxx b/sc/source/ui/view/tabvwshf.cxx index 7db04583f..e7116c83b 100644 --- a/sc/source/ui/view/tabvwshf.cxx +++ b/sc/source/ui/view/tabvwshf.cxx @@ -648,7 +648,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++; } @@ -658,7 +658,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 89cabba14..20577811b 100644 --- a/sc/source/ui/view/viewfun2.cxx +++ b/sc/source/ui/view/viewfun2.cxx @@ -2148,8 +2148,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]; - int i; + SCTAB nNewTab = TheTabs.front(); 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<TheTabs.Count();i++) + for (size_t i = 0; i < TheTabs.size(); i++) { - SCTAB nTab = TheTabs[sal::static_int_cast<USHORT>(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.Count()-1;i>=0;i--) + for (size_t i = TheTabs.size(); i > 0; i--) { String sCodeName; - BOOL bHasCodeName = pDoc->GetCodeName( TheTabs[sal::static_int_cast<USHORT>(i)], sCodeName ); - if (pDoc->DeleteTab( TheTabs[sal::static_int_cast<USHORT>(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<USHORT>(i)] ) ); + pDocSh->Broadcast( ScTablesHint( SC_TAB_DELETED, TheTabs[i-1] ) ); } } if (bRecord) @@ -2583,13 +2582,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;j<nTabCount;j++) { if((!pDoc->IsVisible(j))&&(pDoc->IsScenario(j))) { pDoc->GetName( j, aTabName); - TheTabs.Insert(j,TheTabs.Count()); + TheTabs.push_back(j); i=j; } else break; @@ -2609,7 +2608,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; j<TheTabs.Count(); j++, nDestTab1++ ) + for( size_t j=0; j<TheTabs.size(); j++, nDestTab1++ ) { // #63304# insert sheets first and update all references String aName; pDoc->GetName( TheTabs[j], aName ); @@ -2623,7 +2622,7 @@ void ScViewFunc::MoveTable( USHORT nDestDocNo, SCTAB nDestTab, BOOL bCopy ) if ( nErrVal > 0 ) { nDestTab1 = nDestTab; - for(USHORT i=0;i<TheTabs.Count();i++) + for(size_t i=0;i<TheTabs.size();i++) { nErrVal = pDestDoc->TransferTab( pDoc, TheTabs[i], nDestTab1, FALSE ); // no insert @@ -2661,7 +2660,7 @@ void ScViewFunc::MoveTable( USHORT nDestDocNo, SCTAB nDestTab, BOOL bCopy ) pDestDoc->GetName(nDestTab, sName); pDestShell->GetUndoManager()->AddUndoAction( new ScUndoImportTab( pDestShell, nDestTab, - static_cast<SCTAB>(TheTabs.Count()), FALSE)); + static_cast<SCTAB>(TheTabs.size()), FALSE)); } else @@ -2714,7 +2713,7 @@ void ScViewFunc::MoveTable( USHORT nDestDocNo, SCTAB nDestTab, BOOL bCopy ) if ( pDestDoc->IsChartListenerCollectionNeedsUpdate() ) pDestDoc->UpdateChartListenerCollection(); - pDestDoc->DeleteTab(static_cast<SCTAB>(TheTabs.Count())); // alte erste Tabelle + pDestDoc->DeleteTab(static_cast<SCTAB>(TheTabs.size())); // first old table //? pDestDoc->SelectTable(0, TRUE); // neue erste Tabelle selektieren if (pDestViewSh) pDestViewSh->TabChanged(); // Pages auf dem Drawing-Layer @@ -2730,12 +2729,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(); @@ -2804,7 +2803,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) { @@ -2814,7 +2813,7 @@ void ScViewFunc::MoveTable( USHORT nDestDocNo, SCTAB nDestTab, BOOL bCopy ) } } - TheDestTabs.Insert(nDestTab1,TheDestTabs.Count()); + TheDestTabs.push_back(nDestTab1); delete pString; } |