summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorMathias Bauer <mba@openoffice.org>2010-11-26 15:27:38 +0100
committerMathias Bauer <mba@openoffice.org>2010-11-26 15:27:38 +0100
commit47a5eabfa7035ef46f2f2bb0427ce98d7570b666 (patch)
tree451560ce2714d3a006f5b95c61ccc4d2b5911a29 /sc
parent349e865d6ca3430cb4517980df2941765e7cc3ae (diff)
parentdbb4b0ecb6454f358417adc1e0f6e71b16b6dd2d (diff)
CWS gnumake2: resync to m94
Diffstat (limited to 'sc')
-rw-r--r--sc/source/core/data/docpool.cxx14
-rw-r--r--sc/source/core/data/documen4.cxx7
-rw-r--r--sc/source/core/data/documen9.cxx10
-rw-r--r--sc/source/core/data/document.cxx24
-rw-r--r--[-rwxr-xr-x]sc/source/core/data/dptablecache.cxx14
-rw-r--r--sc/source/core/data/fillinfo.cxx6
-rw-r--r--sc/source/filter/excel/xiname.cxx6
-rw-r--r--sc/source/filter/inc/xiname.hxx4
-rw-r--r--sc/source/filter/xml/xmlexprt.cxx6
-rw-r--r--sc/source/filter/xml/xmlfonte.cxx12
-rw-r--r--sc/source/ui/docshell/docfunc.cxx2
-rw-r--r--sc/source/ui/docshell/docsh5.cxx8
-rw-r--r--sc/source/ui/docshell/makefile.mk1
-rw-r--r--sc/source/ui/miscdlgs/acredlin.cxx2
-rw-r--r--sc/source/ui/miscdlgs/conflictsdlg.cxx6
-rw-r--r--sc/source/ui/miscdlgs/solveroptions.cxx2
-rw-r--r--sc/source/ui/navipi/content.cxx6
-rw-r--r--sc/source/ui/undo/undotab.cxx84
-rw-r--r--sc/source/ui/unoobj/defltuno.cxx2
-rw-r--r--sc/source/ui/unoobj/docuno.cxx28
-rw-r--r--sc/source/ui/view/drawvie4.cxx2
-rw-r--r--sc/source/ui/view/drawview.cxx2
-rw-r--r--[-rwxr-xr-x]sc/source/ui/view/gridwin3.cxx2
-rw-r--r--sc/source/ui/view/output2.cxx13
-rw-r--r--sc/source/ui/view/pfuncache.cxx2
-rw-r--r--sc/source/ui/view/tabvwshf.cxx4
-rw-r--r--sc/source/ui/view/viewfun2.cxx35
27 files changed, 171 insertions, 133 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/documen4.cxx b/sc/source/core/data/documen4.cxx
index cbd55fd5f..d2cbca2c4 100644
--- a/sc/source/core/data/documen4.cxx
+++ b/sc/source/core/data/documen4.cxx
@@ -505,7 +505,7 @@ double ScDocument::RoundValueAsShown( double fVal, ULONG nFormat )
&& nType != NUMBERFORMAT_TIME && nType != NUMBERFORMAT_DATETIME )
{
short nPrecision;
- if ( nFormat )
+ if ((nFormat % SV_COUNTRY_LANGUAGE_OFFSET) != 0)
{
nPrecision = (short)GetFormatTable()->GetFormatPrecision( nFormat );
switch ( nType )
@@ -524,7 +524,12 @@ double ScDocument::RoundValueAsShown( double fVal, ULONG nFormat )
}
}
else
+ {
nPrecision = (short)GetDocOptions().GetStdPrecision();
+ // #i115512# no rounding for automatic decimals
+ if (nPrecision == static_cast<short>(SvNumberFormatter::UNLIMITED_PRECISION))
+ return fVal;
+ }
double fRound = ::rtl::math::round( fVal, nPrecision );
if ( ::rtl::math::approxEqual( fVal, fRound ) )
return fVal; // durch Rundung hoechstens Fehler
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/dptablecache.cxx b/sc/source/core/data/dptablecache.cxx
index f350e8649..4f445e899 100755..100644
--- a/sc/source/core/data/dptablecache.cxx
+++ b/sc/source/core/data/dptablecache.cxx
@@ -201,8 +201,11 @@ ScDPItemData::ScDPItemData( ScDocument* pDoc, SCROW nRow, USHORT nCol, USHORT nD
ScBaseCell* pCell = pDoc->GetCell( aPos );
if ( pCell && pCell->GetCellType() == CELLTYPE_FORMULA && ((ScFormulaCell*)pCell)->GetErrCode() )
+ {
SetString ( aDocStr ); //[SODC_19347] add liyi
//bErr = TRUE; //[SODC_19347] del liyi
+ mbFlag |= MK_ERR;
+ }
else if ( pDoc->HasValueData( nCol, nRow, nDocTab ) )
{
double fVal = pDoc->GetValue(ScAddress(nCol, nRow, nDocTab));
@@ -672,8 +675,15 @@ bool ScDPTableDataCache::ValidQuery( SCROW nRow, const ScQueryParam &rParam, BOO
{
ScQueryEntry& rEntry = rParam.GetEntry(i);
// we can only handle one single direct query
- SCROW nId = GetItemDataId( (SCCOL)rEntry.nField, nRow, FALSE );
- const ScDPItemData* pCellData = GetItemDataById( (SCCOL)rEntry.nField, nId);
+ // #i115431# nField in QueryParam is the sheet column, not the field within the source range
+ SCCOL nQueryCol = (SCCOL)rEntry.nField;
+ if ( nQueryCol < rParam.nCol1 )
+ nQueryCol = rParam.nCol1;
+ if ( nQueryCol > rParam.nCol2 )
+ nQueryCol = rParam.nCol2;
+ SCCOL nSourceField = nQueryCol - rParam.nCol1;
+ SCROW nId = GetItemDataId( nSourceField, nRow, FALSE );
+ const ScDPItemData* pCellData = GetItemDataById( nSourceField, nId );
BOOL bOk = FALSE;
BOOL bTestEqual = FALSE;
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/excel/xiname.cxx b/sc/source/filter/excel/xiname.cxx
index 5596d26f5..9cef1f96d 100644
--- a/sc/source/filter/excel/xiname.cxx
+++ b/sc/source/filter/excel/xiname.cxx
@@ -45,6 +45,7 @@ XclImpName::XclImpName( XclImpStream& rStrm, sal_uInt16 nXclNameIdx ) :
mpScData( 0 ),
mcBuiltIn( EXC_BUILTIN_UNKNOWN ),
mnScTab( SCTAB_MAX ),
+ mbFunction( false ),
mbVBName( false )
{
ExcelToSc& rFmlaConv = GetOldFmlaConverter();
@@ -93,7 +94,8 @@ XclImpName::XclImpName( XclImpStream& rStrm, sal_uInt16 nXclNameIdx ) :
// 2) *** convert sheet index and name *** --------------------------------
- // Visual Basic procedure
+ // functions and VBA
+ mbFunction = ::get_flag( nFlags, EXC_NAME_FUNC );
mbVBName = ::get_flag( nFlags, EXC_NAME_VB );
// get built-in name, or convert characters invalid in Calc
@@ -210,7 +212,7 @@ XclImpName::XclImpName( XclImpStream& rStrm, sal_uInt16 nXclNameIdx ) :
// 4) *** create a defined name in the Calc document *** ------------------
// #163146# do not ignore hidden names (may be regular names created by VBA scripts)
- if( pTokArr /*&& (bBuiltIn || !::get_flag( nFlags, EXC_NAME_HIDDEN ))*/ && !mbVBName )
+ if( pTokArr /*&& (bBuiltIn || !::get_flag( nFlags, EXC_NAME_HIDDEN ))*/ && !mbFunction && !mbVBName )
{
// create the Calc name data
ScRangeData* pData = new ScRangeData( GetDocPtr(), maScName, *pTokArr, ScAddress(), nNameType );
diff --git a/sc/source/filter/inc/xiname.hxx b/sc/source/filter/inc/xiname.hxx
index 174b46c69..d6e2f28d5 100644
--- a/sc/source/filter/inc/xiname.hxx
+++ b/sc/source/filter/inc/xiname.hxx
@@ -50,6 +50,7 @@ public:
inline SCTAB GetScTab() const { return mnScTab; }
inline const ScRangeData* GetScRangeData() const { return mpScData; }
inline bool IsGlobal() const { return mnScTab == SCTAB_MAX; }
+ inline bool IsFunction() const { return mbFunction; }
inline bool IsVBName() const { return mbVBName; }
private:
@@ -58,7 +59,8 @@ private:
const ScRangeData* mpScData; /// Pointer to Calc defined name (no ownership).
sal_Unicode mcBuiltIn; /// Excel built-in name index.
SCTAB mnScTab; /// Calc sheet index of local names.
- bool mbVBName; /// true = Visual Basic procedure.
+ bool mbFunction; /// true = Name refers to a function (add-in or VBA).
+ bool mbVBName; /// true = Visual Basic procedure or function.
};
// ----------------------------------------------------------------------------
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/miscdlgs/acredlin.cxx b/sc/source/ui/miscdlgs/acredlin.cxx
index efeab20cf..cd09a35d3 100644
--- a/sc/source/ui/miscdlgs/acredlin.cxx
+++ b/sc/source/ui/miscdlgs/acredlin.cxx
@@ -179,7 +179,7 @@ ScAcceptChgDlg::ScAcceptChgDlg( SfxBindings* pB, SfxChildWindow* pCW, Window* pP
pTPView->SetRejectAllClickHdl( LINK( this, ScAcceptChgDlg,RejectAllHandle));
pTPView->SetAcceptAllClickHdl( LINK(this, ScAcceptChgDlg, AcceptAllHandle));
pTheView->SetCalcView();
- pTheView->SetWindowBits(WB_HASLINES|WB_CLIPCHILDREN|WB_HASBUTTONS|WB_HASBUTTONSATROOT|WB_HSCROLL);
+ pTheView->SetStyle(pTheView->GetStyle()|WB_HASLINES|WB_CLIPCHILDREN|WB_HASBUTTONS|WB_HASBUTTONSATROOT|WB_HSCROLL);
pTheView->SetExpandingHdl( LINK(this, ScAcceptChgDlg, ExpandingHandle));
pTheView->SetSelectHdl( LINK(this, ScAcceptChgDlg, SelectHandle));
pTheView->SetDeselectHdl( LINK(this, ScAcceptChgDlg, SelectHandle));
diff --git a/sc/source/ui/miscdlgs/conflictsdlg.cxx b/sc/source/ui/miscdlgs/conflictsdlg.cxx
index 161c6476b..776ddb62d 100644
--- a/sc/source/ui/miscdlgs/conflictsdlg.cxx
+++ b/sc/source/ui/miscdlgs/conflictsdlg.cxx
@@ -36,7 +36,7 @@
#include "conflictsdlg.hrc"
#include "scresid.hxx"
#include "viewdata.hxx"
-#include "tabview.hxx"
+#include "dbfunc.hxx"
//=============================================================================
@@ -514,7 +514,7 @@ ScConflictsDlg::ScConflictsDlg( Window* pParent, ScViewData* pViewData, ScDocume
aHeader += maStrTitleDate;
maLbConflicts.InsertHeaderEntry( aHeader, HEADERBAR_APPEND, HIB_LEFT | HIB_LEFTIMAGE | HIB_VCENTER );
- maLbConflicts.SetWindowBits( WB_HASLINES | WB_CLIPCHILDREN | WB_HASBUTTONS | WB_HASBUTTONSATROOT | WB_HSCROLL );
+ maLbConflicts.SetStyle( maLbConflicts.GetStyle() | WB_HASLINES | WB_CLIPCHILDREN | WB_HASBUTTONS | WB_HASBUTTONSATROOT | WB_HSCROLL );
maLbConflicts.SetSelectionMode( MULTIPLE_SELECTION );
maLbConflicts.SetHighlightRange();
@@ -660,7 +660,7 @@ IMPL_LINK( ScConflictsDlg, UpdateSelectionHdl, Timer*, EMPTYARG )
return 0;
}
- ScTabView* pTabView = reinterpret_cast< ScTabView* >( mpViewData->GetView() );
+ ScTabView* pTabView = mpViewData->GetView();
pTabView->DoneBlockMode();
BOOL bContMark = FALSE;
SvLBoxEntry* pEntry = maLbConflicts.FirstSelected();
diff --git a/sc/source/ui/miscdlgs/solveroptions.cxx b/sc/source/ui/miscdlgs/solveroptions.cxx
index bd3b54c7f..2f5244329 100644
--- a/sc/source/ui/miscdlgs/solveroptions.cxx
+++ b/sc/source/ui/miscdlgs/solveroptions.cxx
@@ -145,7 +145,7 @@ ScSolverOptionsDialog::ScSolverOptionsDialog( Window* pParent,
maBtnEdit.SetClickHdl( LINK( this, ScSolverOptionsDialog, ButtonHdl ) );
- maLbSettings.SetWindowBits( WB_CLIPCHILDREN|WB_FORCE_MAKEVISIBLE );
+ maLbSettings.SetStyle( maLbSettings.GetStyle()|WB_CLIPCHILDREN|WB_FORCE_MAKEVISIBLE );
maLbSettings.SetHelpId( HID_SC_SOLVEROPTIONS_LB );
maLbSettings.SetHighlightRange();
diff --git a/sc/source/ui/navipi/content.cxx b/sc/source/ui/navipi/content.cxx
index 5d2ecffba..6d31c0856 100644
--- a/sc/source/ui/navipi/content.cxx
+++ b/sc/source/ui/navipi/content.cxx
@@ -145,6 +145,8 @@ ScContentTree::ScContentTree( Window* pParent, const ResId& rResId ) :
SetNodeDefaultImages();
SetDoubleClickHdl( LINK( this, ScContentTree, ContentDoubleClickHdl ) );
+
+ SetStyle( GetStyle() | WB_QUICK_SEARCH );
}
ScContentTree::~ScContentTree()
@@ -1327,11 +1329,11 @@ BOOL ScContentTree::LoadFile( const String& rUrl )
void ScContentTree::InitWindowBits( BOOL bButtons )
{
- WinBits nFlags = WB_CLIPCHILDREN|WB_HSCROLL;
+ WinBits nFlags = GetStyle()|WB_CLIPCHILDREN|WB_HSCROLL;
if (bButtons)
nFlags |= WB_HASBUTTONS|WB_HASBUTTONSATROOT;
- SetWindowBits( nFlags );
+ SetStyle( nFlags );
}
void ScContentTree::SetRootType( USHORT nNew )
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/unoobj/docuno.cxx b/sc/source/ui/unoobj/docuno.cxx
index ccf3ddf14..5d8e320f2 100644
--- a/sc/source/ui/unoobj/docuno.cxx
+++ b/sc/source/ui/unoobj/docuno.cxx
@@ -815,6 +815,16 @@ BOOL ScModelObj::FillRenderMarkData( const uno::Any& aSelection,
rMark.MarkFromRangeList( rRanges, FALSE );
rMark.MarkToSimple();
+ if ( rMark.IsMultiMarked() )
+ {
+ // #i115266# copy behavior of old printing:
+ // treat multiple selection like a single selection with the enclosing range
+ ScRange aMultiMarkArea;
+ rMark.GetMultiMarkArea( aMultiMarkArea );
+ rMark.ResetMark();
+ rMark.SetMarkArea( aMultiMarkArea );
+ }
+
if ( rMark.IsMarked() && !rMark.IsMultiMarked() )
{
// a sheet object is treated like an empty selection: print the used area of the sheet
@@ -974,15 +984,17 @@ uno::Sequence<beans::PropertyValue> SAL_CALL ScModelObj::getRenderer( sal_Int32
ScMarkData aMark;
ScPrintSelectionStatus aStatus;
String aPagesStr;
- if ( !FillRenderMarkData( aSelection, rOptions, aMark, aStatus, aPagesStr ) )
- throw lang::IllegalArgumentException();
-
- if ( !pPrintFuncCache || !pPrintFuncCache->IsSameSelection( aStatus ) )
+ // #i115266# if FillRenderMarkData fails, keep nTotalPages at 0, but still handle getRenderer(0) below
+ long nTotalPages = 0;
+ if ( FillRenderMarkData( aSelection, rOptions, aMark, aStatus, aPagesStr ) )
{
- delete pPrintFuncCache;
- pPrintFuncCache = new ScPrintFuncCache( pDocShell, aMark, aStatus );
+ if ( !pPrintFuncCache || !pPrintFuncCache->IsSameSelection( aStatus ) )
+ {
+ delete pPrintFuncCache;
+ pPrintFuncCache = new ScPrintFuncCache( pDocShell, aMark, aStatus );
+ }
+ nTotalPages = pPrintFuncCache->GetPageCount();
}
- long nTotalPages = pPrintFuncCache->GetPageCount();
sal_Int32 nRenderer = lcl_GetRendererNum( nSelRenderer, aPagesStr, nTotalPages );
if ( nRenderer >= nTotalPages )
{
@@ -1263,6 +1275,8 @@ void SAL_CALL ScModelObj::render( sal_Int32 nSelRenderer, const uno::Any& aSelec
rBookmarks.clear();
}
+ if ( pDrawView )
+ pDrawView->HideSdrPage();
delete pDrawView;
}
diff --git a/sc/source/ui/view/drawvie4.cxx b/sc/source/ui/view/drawvie4.cxx
index 0d0f0a0df..3d47dcae7 100644
--- a/sc/source/ui/view/drawvie4.cxx
+++ b/sc/source/ui/view/drawvie4.cxx
@@ -282,7 +282,7 @@ void ScDrawView::CalcNormScale( Fraction& rFractX, Fraction& rFractY ) const
pDoc->GetTableArea( nTab, nEndCol, nEndRow );
if (nEndCol<20)
nEndCol = 20;
- if (nEndRow<1000)
+ if (nEndRow<20)
nEndRow = 1000;
Fraction aZoom(1,1);
diff --git a/sc/source/ui/view/drawview.cxx b/sc/source/ui/view/drawview.cxx
index 921f25694..25643609c 100644
--- a/sc/source/ui/view/drawview.cxx
+++ b/sc/source/ui/view/drawview.cxx
@@ -376,7 +376,7 @@ void ScDrawView::RecalcScale()
pDoc->GetTableArea( nTab, nEndCol, nEndRow );
if (nEndCol<20)
nEndCol = 20;
- if (nEndRow<1000)
+ if (nEndRow<20)
nEndRow = 1000;
ScDrawUtil::CalcScale( pDoc, nTab, 0,0, nEndCol,nEndRow, pDev,aZoomX,aZoomY,nPPTX,nPPTY,
diff --git a/sc/source/ui/view/gridwin3.cxx b/sc/source/ui/view/gridwin3.cxx
index 9ba9ee6a4..3be14273a 100755..100644
--- a/sc/source/ui/view/gridwin3.cxx
+++ b/sc/source/ui/view/gridwin3.cxx
@@ -265,7 +265,7 @@ MapMode ScGridWindow::GetDrawMapMode( BOOL bForce )
SCROW nEndRow = 0;
pDoc->GetTableArea( nTab, nEndCol, nEndRow );
if (nEndCol<20) nEndCol = 20;
- if (nEndRow<1000) nEndRow = 1000;
+ if (nEndRow<20) nEndRow = 1000;
ScDrawUtil::CalcScale( pDoc, nTab, 0,0, nEndCol,nEndRow, this,
pViewData->GetZoomX(),pViewData->GetZoomY(),
pViewData->GetPPTX(),pViewData->GetPPTY(),
diff --git a/sc/source/ui/view/output2.cxx b/sc/source/ui/view/output2.cxx
index e26056ba8..aff5a5abe 100644
--- a/sc/source/ui/view/output2.cxx
+++ b/sc/source/ui/view/output2.cxx
@@ -529,9 +529,18 @@ void ScDrawStringsVars::SetTextToWidthOrHash( ScBaseCell* pCell, long nWidth )
// must be a value or formula cell.
return;
- if (eType == CELLTYPE_FORMULA && !static_cast<ScFormulaCell*>(pCell)->IsValue())
+ if (eType == CELLTYPE_FORMULA)
+ {
+ ScFormulaCell* pFCell = static_cast<ScFormulaCell*>(pCell);
+ if (pFCell->GetErrCode() != 0)
+ {
+ SetHashText(); // If the error string doesn't fit, always use "###"
+ return;
+ }
// If it's formula, the result must be a value.
- return;
+ if (!pFCell->IsValue())
+ return;
+ }
ULONG nFormat = GetValueFormat();
if ((nFormat % SV_COUNTRY_LANGUAGE_OFFSET) != 0)
diff --git a/sc/source/ui/view/pfuncache.cxx b/sc/source/ui/view/pfuncache.cxx
index a15d607e6..4db10a23e 100644
--- a/sc/source/ui/view/pfuncache.cxx
+++ b/sc/source/ui/view/pfuncache.cxx
@@ -72,6 +72,8 @@ ScPrintFuncCache::ScPrintFuncCache( ScDocShell* pD, const ScMarkData& rMark,
long nThisTab = 0;
if ( rMark.GetTableSelect( nTab ) )
{
+ pDoc->InvalidatePageBreaks( nTab ); // user print area (selection) may be different
+
ScPrintFunc aFunc( pDocSh, pPrinter, nTab, nAttrPage, 0, pSelRange, &aSelection.GetOptions() );
nThisTab = aFunc.GetTotalPages();
nFirstAttr[nTab] = aFunc.GetFirstPageNo(); // from page style or previous sheet
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;
}