[Libreoffice-commits] .: Branch 'feature/unlimited-number-of-sheets' - 2 commits - sc/inc sc/source
Markus Mohrhard
mmohrhard at kemper.freedesktop.org
Wed Jun 1 12:41:21 PDT 2011
sc/inc/appoptio.hxx | 6 +++---
sc/inc/sheetdata.hxx | 16 ++++++++--------
sc/source/filter/inc/scflt.hxx | 6 +++---
sc/source/filter/xml/XMLTableSourceContext.cxx | 4 ++--
sc/source/filter/xml/sheetdata.cxx | 24 ++++++++++++------------
sc/source/filter/xml/xmlcoli.cxx | 8 ++++----
sc/source/filter/xml/xmlimprt.cxx | 2 +-
sc/source/filter/xml/xmlimprt.hxx | 4 ++--
sc/source/filter/xml/xmlrowi.cxx | 8 ++++----
sc/source/filter/xml/xmlsceni.cxx | 2 +-
sc/source/filter/xml/xmlstyli.cxx | 4 ++--
sc/source/filter/xml/xmlstyli.hxx | 6 +++---
sc/source/filter/xml/xmlsubti.cxx | 20 ++++++++++----------
sc/source/filter/xml/xmlsubti.hxx | 6 +++---
sc/source/filter/xml/xmltabi.cxx | 8 ++++----
sc/source/ui/vba/vbaquerytable.cxx | 6 +++---
sc/source/ui/view/cellsh3.cxx | 2 +-
17 files changed, 66 insertions(+), 66 deletions(-)
New commits:
commit bb2a073cc9f6ca99c30e45d30211603e07b5212e
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date: Wed Jun 1 21:38:53 2011 +0200
change to SCTAB from sal_Int16 and sal_Int32 for sheet index
diff --git a/sc/inc/appoptio.hxx b/sc/inc/appoptio.hxx
index a31080c..e10b1e6 100644
--- a/sc/inc/appoptio.hxx
+++ b/sc/inc/appoptio.hxx
@@ -46,8 +46,8 @@ public:
void SetDefaults();
// Set or get the initial tab count for new spreadsheet, it is used by VBA API currently.
- void SetTabCountInNewSpreadsheet( sal_Int16 nCount ) { nTabCountInNewSpreadsheet = nCount; }
- sal_Int16 GetTabCountInNewSpreadsheet() const { return nTabCountInNewSpreadsheet; }
+ void SetTabCountInNewSpreadsheet( SCTAB nCount ) { nTabCountInNewSpreadsheet = nCount; }
+ SCTAB GetTabCountInNewSpreadsheet() const { return nTabCountInNewSpreadsheet; }
void SetAppMetric( FieldUnit eUnit ) { eMetric = eUnit; }
FieldUnit GetAppMetric() const { return eMetric; }
@@ -92,7 +92,7 @@ public:
const ScAppOptions& operator= ( const ScAppOptions& rOpt );
private:
- sal_Int16 nTabCountInNewSpreadsheet;
+ SCTAB nTabCountInNewSpreadsheet;
FieldUnit eMetric;
sal_uInt16 nLRUFuncCount;
sal_uInt16* pLRUList;
diff --git a/sc/inc/sheetdata.hxx b/sc/inc/sheetdata.hxx
index 7a17b50..a64322a 100644
--- a/sc/inc/sheetdata.hxx
+++ b/sc/inc/sheetdata.hxx
@@ -128,7 +128,7 @@ class ScSheetSaveData
std::vector<bool> maBlocked;
std::vector<ScStreamEntry> maStreamEntries;
std::vector<ScStreamEntry> maSaveEntries;
- sal_Int32 mnStartTab;
+ SCTAB mnStartTab;
sal_Int32 mnStartOffset;
ScNoteStyleEntry maPreviousNote;
@@ -149,20 +149,20 @@ public:
void AddTextStyle( const rtl::OUString& rName, const ScAddress& rCellPos, const ESelection& rSelection );
- void BlockSheet( sal_Int32 nTab );
- bool IsSheetBlocked( sal_Int32 nTab ) const;
+ void BlockSheet( SCTAB nTab );
+ bool IsSheetBlocked( SCTAB nTab ) const;
- void AddStreamPos( sal_Int32 nTab, sal_Int32 nStartOffset, sal_Int32 nEndOffset );
- void GetStreamPos( sal_Int32 nTab, sal_Int32& rStartOffset, sal_Int32& rEndOffset ) const;
- bool HasStreamPos( sal_Int32 nTab ) const;
+ void AddStreamPos( SCTAB nTab, sal_Int32 nStartOffset, sal_Int32 nEndOffset );
+ void GetStreamPos( SCTAB nTab, sal_Int32& rStartOffset, sal_Int32& rEndOffset ) const;
+ bool HasStreamPos( SCTAB nTab ) const;
- void StartStreamPos( sal_Int32 nTab, sal_Int32 nStartOffset );
+ void StartStreamPos( SCTAB nTab, sal_Int32 nStartOffset );
void EndStreamPos( sal_Int32 nEndOffset );
bool HasStartPos() const { return mnStartTab >= 0; }
void ResetSaveEntries();
- void AddSavePos( sal_Int32 nTab, sal_Int32 nStartOffset, sal_Int32 nEndOffset );
+ void AddSavePos( SCTAB nTab, sal_Int32 nStartOffset, sal_Int32 nEndOffset );
void UseSaveEntries();
void StoreInitialNamespaces( const SvXMLNamespaceMap& rNamespaces );
diff --git a/sc/source/filter/inc/scflt.hxx b/sc/source/filter/inc/scflt.hxx
index 950e70f..24459c1 100644
--- a/sc/source/filter/inc/scflt.hxx
+++ b/sc/source/filter/inc/scflt.hxx
@@ -247,7 +247,7 @@ struct Sc10BlockRect
struct Sc10DataBaseRec
{
sal_Char Name[32];
- sal_Int16 Tab;
+ SCTAB Tab;
Sc10BlockRect Block;
sal_uInt8 RowHeader;
sal_Int16 SortField0;
@@ -319,7 +319,7 @@ struct Sc10PageFormat
sal_Char PrintAreaName[32];
Sc10BlockRect PrintArea;
sal_Char PrnZoom[6]; // Pascal 6 Byte Realzahl
- sal_uInt16 FirstPageNo;
+ SCTAB FirstPageNo;
sal_Int16 RowRepeatStart;
sal_Int16 RowRepeatEnd;
sal_Int16 ColRepeatStart;
@@ -731,7 +731,7 @@ class Sc10Import
Sc10PatternCollection* pPatternCollection;
Sc10DataBaseCollection* pDataBaseCollection;
sal_uLong nError;
- sal_Int16 TabCount;
+ SCTAB TabCount;
SCTAB nShowTab;
ScViewOptions aSc30ViewOpt;
ScfStreamProgressBar* pPrgrsBar;
diff --git a/sc/source/filter/xml/XMLTableSourceContext.cxx b/sc/source/filter/xml/XMLTableSourceContext.cxx
index 08cda1f..b34da4d 100644
--- a/sc/source/filter/xml/XMLTableSourceContext.cxx
+++ b/sc/source/filter/xml/XMLTableSourceContext.cxx
@@ -118,7 +118,7 @@ void ScXMLTableSourceContext::EndElement()
if (xLinkable.is() && pDoc)
{
ScXMLImport::MutexGuard aGuard(GetScImport());
- if (pDoc->RenameTab( static_cast<SCTAB>(GetScImport().GetTables().GetCurrentSheet()),
+ if (pDoc->RenameTab( GetScImport().GetTables().GetCurrentSheet(),
GetScImport().GetTables().GetCurrentSheetName(), false, sal_True))
{
String aFileString(sLink);
@@ -136,7 +136,7 @@ void ScXMLTableSourceContext::EndElement()
else if ( nMode == sheet::SheetLinkMode_VALUE )
nLinkMode = SC_LINK_VALUE;
- pDoc->SetLink( static_cast<SCTAB>(GetScImport().GetTables().GetCurrentSheet()),
+ pDoc->SetLink( GetScImport().GetTables().GetCurrentSheet(),
nLinkMode, aFileString, aFilterString, aOptString,
aSheetString, nRefresh );
}
diff --git a/sc/source/filter/xml/sheetdata.cxx b/sc/source/filter/xml/sheetdata.cxx
index 5d36ef0..f5dd79c 100644
--- a/sc/source/filter/xml/sheetdata.cxx
+++ b/sc/source/filter/xml/sheetdata.cxx
@@ -104,31 +104,31 @@ void ScSheetSaveData::AddTextStyle( const rtl::OUString& rName, const ScAddress&
maTextStyles.push_back( ScTextStyleEntry( rName, rCellPos, rSelection ) );
}
-void ScSheetSaveData::BlockSheet( sal_Int32 nTab )
+void ScSheetSaveData::BlockSheet( SCTAB nTab )
{
- if ( nTab >= (sal_Int32)maBlocked.size() )
+ if ( nTab >= static_cast<SCTAB>(maBlocked.size()) )
maBlocked.resize( nTab + 1, false ); // fill vector with "false" entries
maBlocked[nTab] = true;
}
-bool ScSheetSaveData::IsSheetBlocked( sal_Int32 nTab ) const
+bool ScSheetSaveData::IsSheetBlocked( SCTAB nTab ) const
{
- if ( nTab < (sal_Int32)maBlocked.size() )
+ if ( nTab < static_cast<SCTAB>(maBlocked.size()) )
return maBlocked[nTab];
else
return false;
}
-void ScSheetSaveData::AddStreamPos( sal_Int32 nTab, sal_Int32 nStartOffset, sal_Int32 nEndOffset )
+void ScSheetSaveData::AddStreamPos( SCTAB nTab, sal_Int32 nStartOffset, sal_Int32 nEndOffset )
{
- if ( nTab >= (sal_Int32)maStreamEntries.size() )
+ if ( nTab >= static_cast<SCTAB>(maStreamEntries.size()) )
maStreamEntries.resize( nTab + 1 );
maStreamEntries[nTab] = ScStreamEntry( nStartOffset, nEndOffset );
}
-void ScSheetSaveData::StartStreamPos( sal_Int32 nTab, sal_Int32 nStartOffset )
+void ScSheetSaveData::StartStreamPos( SCTAB nTab, sal_Int32 nStartOffset )
{
DBG_ASSERT( mnStartTab < 0, "StartStreamPos without EndStreamPos" );
@@ -146,9 +146,9 @@ void ScSheetSaveData::EndStreamPos( sal_Int32 nEndOffset )
}
}
-void ScSheetSaveData::GetStreamPos( sal_Int32 nTab, sal_Int32& rStartOffset, sal_Int32& rEndOffset ) const
+void ScSheetSaveData::GetStreamPos( SCTAB nTab, sal_Int32& rStartOffset, sal_Int32& rEndOffset ) const
{
- if ( nTab < (sal_Int32)maStreamEntries.size() )
+ if ( nTab < static_cast<SCTAB>(maStreamEntries.size()) )
{
const ScStreamEntry& rEntry = maStreamEntries[nTab];
rStartOffset = rEntry.mnStartOffset;
@@ -158,7 +158,7 @@ void ScSheetSaveData::GetStreamPos( sal_Int32 nTab, sal_Int32& rStartOffset, sal
rStartOffset = rEndOffset = -1;
}
-bool ScSheetSaveData::HasStreamPos( sal_Int32 nTab ) const
+bool ScSheetSaveData::HasStreamPos( SCTAB nTab ) const
{
sal_Int32 nStartOffset = -1;
sal_Int32 nEndOffset = -1;
@@ -171,9 +171,9 @@ void ScSheetSaveData::ResetSaveEntries()
maSaveEntries.clear();
}
-void ScSheetSaveData::AddSavePos( sal_Int32 nTab, sal_Int32 nStartOffset, sal_Int32 nEndOffset )
+void ScSheetSaveData::AddSavePos( SCTAB nTab, sal_Int32 nStartOffset, sal_Int32 nEndOffset )
{
- if ( nTab >= (sal_Int32)maSaveEntries.size() )
+ if ( nTab >= static_cast<SCTAB>(maSaveEntries.size()) )
maSaveEntries.resize( nTab + 1 );
maSaveEntries[nTab] = ScStreamEntry( nStartOffset, nEndOffset );
diff --git a/sc/source/filter/xml/xmlcoli.cxx b/sc/source/filter/xml/xmlcoli.cxx
index 7333dfa..963673c 100644
--- a/sc/source/filter/xml/xmlcoli.cxx
+++ b/sc/source/filter/xml/xmlcoli.cxx
@@ -121,7 +121,7 @@ SvXMLImportContext *ScXMLTableColContext::CreateChildContext( sal_uInt16 nPrefix
void ScXMLTableColContext::EndElement()
{
ScXMLImport& rXMLImport = GetScImport();
- sal_Int32 nSheet = rXMLImport.GetTables().GetCurrentSheet();
+ SCTAB nSheet = rXMLImport.GetTables().GetCurrentSheet();
sal_Int32 nCurrentColumn = rXMLImport.GetTables().GetCurrentColumn();
uno::Reference<sheet::XSpreadsheet> xSheet(rXMLImport.GetTables().GetCurrentXSheet());
if(xSheet.is())
@@ -151,7 +151,7 @@ void ScXMLTableColContext::EndElement()
if ( nSheet != pStyle->GetLastSheet() )
{
ScSheetSaveData* pSheetData = ScModelObj::getImplementation(rXMLImport.GetModel())->GetSheetSaveData();
- pSheetData->AddColumnStyle( sStyleName, ScAddress( (SCCOL)nCurrentColumn, 0, (SCTAB)nSheet ) );
+ pSheetData->AddColumnStyle( sStyleName, ScAddress( (SCCOL)nCurrentColumn, 0, nSheet ) );
pStyle->SetLastSheet(nSheet);
}
}
@@ -288,7 +288,7 @@ void ScXMLTableColsContext::EndElement()
}
else if (bGroup)
{
- sal_Int32 nSheet = rXMLImport.GetTables().GetCurrentSheet();
+ SCTAB nSheet = rXMLImport.GetTables().GetCurrentSheet();
nGroupEndCol = rXMLImport.GetTables().GetCurrentColumn();
nGroupEndCol--;
if (nGroupStartCol <= nGroupEndCol)
@@ -297,7 +297,7 @@ void ScXMLTableColsContext::EndElement()
if (pDoc)
{
ScXMLImport::MutexGuard aGuard(GetScImport());
- ScOutlineTable* pOutlineTable = pDoc->GetOutlineTable(static_cast<SCTAB>(nSheet), sal_True);
+ ScOutlineTable* pOutlineTable = pDoc->GetOutlineTable(nSheet, sal_True);
ScOutlineArray* pColArray = pOutlineTable ? pOutlineTable->GetColArray() : NULL;
if (pColArray)
{
diff --git a/sc/source/filter/xml/xmlimprt.cxx b/sc/source/filter/xml/xmlimprt.cxx
index e047ef6..a1c580d 100644
--- a/sc/source/filter/xml/xmlimprt.cxx
+++ b/sc/source/filter/xml/xmlimprt.cxx
@@ -3006,7 +3006,7 @@ void ScXMLImport::ProgressBarIncrement(sal_Bool bEditCell, sal_Int32 nInc)
}
}
-sal_Int32 ScXMLImport::GetVisibleSheet()
+SCTAB ScXMLImport::GetVisibleSheet()
{
// Get the visible sheet number from model's view data (after settings were loaded),
// or 0 (default: first sheet) if no settings available.
diff --git a/sc/source/filter/xml/xmlimprt.hxx b/sc/source/filter/xml/xmlimprt.hxx
index 28862bb..cdde3be 100644
--- a/sc/source/filter/xml/xmlimprt.hxx
+++ b/sc/source/filter/xml/xmlimprt.hxx
@@ -617,7 +617,7 @@ class SolarMutexGuard;
struct tScMyCellRange
{
- sal_Int16 Sheet;
+ SCTAB Sheet;
sal_Int32 StartColumn, EndColumn;
sal_Int32 StartRow, EndRow;
};
@@ -1009,7 +1009,7 @@ public:
void SetLabelRanges();
void AddDefaultNote( const com::sun::star::table::CellAddress& aCell );
- sal_Int32 GetVisibleSheet();
+ SCTAB GetVisibleSheet();
/** Extracts the formula string, the formula grammar namespace URL, and a
grammar enum value from the passed formula attribute value.
diff --git a/sc/source/filter/xml/xmlrowi.cxx b/sc/source/filter/xml/xmlrowi.cxx
index 173aec3..8978dd7 100644
--- a/sc/source/filter/xml/xmlrowi.cxx
+++ b/sc/source/filter/xml/xmlrowi.cxx
@@ -169,7 +169,7 @@ void ScXMLTableRowContext::EndElement()
GetScImport().GetTables().AddRow();
DBG_ERRORFILE("it seems here is a nonvalid file; possible missing of table:table-cell element");
}
- sal_Int32 nSheet = rXMLImport.GetTables().GetCurrentSheet();
+ SCTAB nSheet = rXMLImport.GetTables().GetCurrentSheet();
sal_Int32 nCurrentRow(rXMLImport.GetTables().GetCurrentRow());
uno::Reference<sheet::XSpreadsheet> xSheet(rXMLImport.GetTables().GetCurrentXSheet());
if(xSheet.is())
@@ -202,7 +202,7 @@ void ScXMLTableRowContext::EndElement()
if ( nSheet != pStyle->GetLastSheet() )
{
ScSheetSaveData* pSheetData = ScModelObj::getImplementation(rXMLImport.GetModel())->GetSheetSaveData();
- pSheetData->AddRowStyle( sStyleName, ScAddress( 0, (SCROW)nFirstRow, (SCTAB)nSheet ) );
+ pSheetData->AddRowStyle( sStyleName, ScAddress( 0, (SCROW)nFirstRow, nSheet ) );
pStyle->SetLastSheet(nSheet);
}
}
@@ -343,14 +343,14 @@ void ScXMLTableRowsContext::EndElement()
else if (bGroup)
{
nGroupEndRow = rXMLImport.GetTables().GetCurrentRow();
- sal_Int32 nSheet(rXMLImport.GetTables().GetCurrentSheet());
+ SCTAB nSheet(rXMLImport.GetTables().GetCurrentSheet());
if (nGroupStartRow <= nGroupEndRow)
{
ScDocument* pDoc(GetScImport().GetDocument());
if (pDoc)
{
ScXMLImport::MutexGuard aGuard(GetScImport());
- ScOutlineTable* pOutlineTable(pDoc->GetOutlineTable(static_cast<SCTAB>(nSheet), sal_True));
+ ScOutlineTable* pOutlineTable(pDoc->GetOutlineTable(nSheet, sal_True));
ScOutlineArray* pRowArray(pOutlineTable->GetRowArray());
sal_Bool bResized;
pRowArray->Insert(static_cast<SCROW>(nGroupStartRow), static_cast<SCROW>(nGroupEndRow), bResized, !bGroupDisplay, sal_True);
diff --git a/sc/source/filter/xml/xmlsceni.cxx b/sc/source/filter/xml/xmlsceni.cxx
index d072ea1..77a4220 100644
--- a/sc/source/filter/xml/xmlsceni.cxx
+++ b/sc/source/filter/xml/xmlsceni.cxx
@@ -146,7 +146,7 @@ SvXMLImportContext *ScXMLTableScenarioContext::CreateChildContext(
void ScXMLTableScenarioContext::EndElement()
{
- SCTAB nCurrTable( sal::static_int_cast<SCTAB>( GetScImport().GetTables().GetCurrentSheet() ) );
+ SCTAB nCurrTable( GetScImport().GetTables().GetCurrentSheet() );
ScDocument* pDoc(GetScImport().GetDocument());
if (pDoc)
{
diff --git a/sc/source/filter/xml/xmlstyli.cxx b/sc/source/filter/xml/xmlstyli.cxx
index c4c31d8..2e11348 100644
--- a/sc/source/filter/xml/xmlstyli.cxx
+++ b/sc/source/filter/xml/xmlstyli.cxx
@@ -1060,14 +1060,14 @@ void ScCellTextStyleContext::FillPropertySet( const uno::Reference<beans::XPrope
if (pCellImp)
{
ScAddress aPos = pCellImp->GetCellObj().GetPosition();
- if ( static_cast<sal_Int32>(aPos.Tab()) != nLastSheet )
+ if ( aPos.Tab() != nLastSheet )
{
ESelection aSel = pCellImp->GetSelection();
ScSheetSaveData* pSheetData = ScModelObj::getImplementation(GetImport().GetModel())->GetSheetSaveData();
pSheetData->AddTextStyle( GetName(), aPos, aSel );
- nLastSheet = static_cast<sal_Int32>(aPos.Tab());
+ nLastSheet = aPos.Tab();
}
}
else if ( rXMLImport.GetTables().GetCurrentSheet() != nLastSheet )
diff --git a/sc/source/filter/xml/xmlstyli.hxx b/sc/source/filter/xml/xmlstyli.hxx
index 288bbe9..1521630 100644
--- a/sc/source/filter/xml/xmlstyli.hxx
+++ b/sc/source/filter/xml/xmlstyli.hxx
@@ -102,7 +102,7 @@ class XMLTableStyleContext : public XMLPropStyleContext
std::vector<ScXMLMapContent> aMaps;
com::sun::star::uno::Any aConditionalFormat;
sal_Int32 nNumberFormat;
- sal_Int32 nLastSheet;
+ SCTAB nLastSheet;
sal_Bool bConditionalFormatCreated;
sal_Bool bParentSet;
@@ -160,8 +160,8 @@ public:
sal_Int32 GetNumberFormat();// { return nNumberFormat; }
- sal_Int32 GetLastSheet() const { return nLastSheet; }
- void SetLastSheet(sal_Int32 nNew) { nLastSheet = nNew; }
+ SCTAB GetLastSheet() const { return nLastSheet; }
+ void SetLastSheet(SCTAB nNew) { nLastSheet = nNew; }
private:
using XMLPropStyleContext::SetStyle;
diff --git a/sc/source/filter/xml/xmlsubti.cxx b/sc/source/filter/xml/xmlsubti.cxx
index 4b1316e..02b0467 100644
--- a/sc/source/filter/xml/xmlsubti.cxx
+++ b/sc/source/filter/xml/xmlsubti.cxx
@@ -67,14 +67,14 @@ using ::std::auto_ptr;
using namespace com::sun::star;
-ScMyTableData::ScMyTableData(sal_Int32 nSheet, sal_Int32 nCol, sal_Int32 nRow)
+ScMyTableData::ScMyTableData(SCTAB nSheet, sal_Int32 nCol, sal_Int32 nRow)
: nColsPerCol(nDefaultColCount, 1),
nRealCols(nDefaultColCount + 1, 0),
nRowsPerRow(nDefaultRowCount, 1),
nRealRows(nDefaultRowCount + 1, 0),
nChangedCols()
{
- aTableCellPos.Sheet = sal::static_int_cast<sal_Int16>( nSheet );
+ aTableCellPos.Sheet = nSheet;
aTableCellPos.Column = nCol;
aTableCellPos.Row = nRow;
@@ -192,7 +192,7 @@ void ScMyTables::NewSheet(const rtl::OUString& sTableName, const rtl::OUString&
{
try
{
- xSheets->insertNewByName(sTableName, sal::static_int_cast<sal_Int16>(nCurrentSheet));
+ xSheets->insertNewByName(sTableName, nCurrentSheet);
}
catch ( uno::RuntimeException& )
{
@@ -203,7 +203,7 @@ void ScMyTables::NewSheet(const rtl::OUString& sTableName, const rtl::OUString&
String sTabName(String::CreateFromAscii("Table"));
pDoc->CreateValidTabName(sTabName);
rtl::OUString sOUTabName(sTabName);
- xSheets->insertNewByName(sOUTabName, sal::static_int_cast<sal_Int16>(nCurrentSheet));
+ xSheets->insertNewByName(sOUTabName, nCurrentSheet);
}
}
}
@@ -260,7 +260,7 @@ void ScMyTables::NewSheet(const rtl::OUString& sTableName, const rtl::OUString&
pStyle->FillPropertySet(xProperties);
ScSheetSaveData* pSheetData = ScModelObj::getImplementation(rImport.GetModel())->GetSheetSaveData();
- pSheetData->AddTableStyle( sStyleName, ScAddress( 0, 0, (SCTAB)nCurrentSheet ) );
+ pSheetData->AddTableStyle( sStyleName, ScAddress( 0, 0, nCurrentSheet ) );
}
}
}
@@ -608,7 +608,7 @@ void ScMyTables::UpdateRowHeights()
SCTAB nCount = pDoc->GetTableCount();
ScDrawLayer* pDrawLayer = pDoc->GetDrawLayer();
- SCTAB nVisible = static_cast<SCTAB>( rImport.GetVisibleSheet() );
+ SCTAB nVisible = rImport.GetVisibleSheet();
ScMarkData aUpdateSheets;
for (SCTAB nTab=0; nTab<nCount; ++nTab)
@@ -667,7 +667,7 @@ void ScMyTables::DeleteTable()
pProtect->setPasswordHash(aHash, maProtectionData.meHash1, maProtectionData.meHash2);
pProtect->setOption(ScTableProtection::SELECT_LOCKED_CELLS, maProtectionData.mbSelectProtectedCells);
pProtect->setOption(ScTableProtection::SELECT_UNLOCKED_CELLS, maProtectionData.mbSelectUnprotectedCells);
- rImport.GetDocument()->SetTabProtection(static_cast<SCTAB>(nCurrentSheet), pProtect.get());
+ rImport.GetDocument()->SetTabProtection(nCurrentSheet, pProtect.get());
}
//#95582#; find out whether it was possible to set the sheet name
@@ -679,7 +679,7 @@ void ScMyTables::DeleteTable()
rtl::OUString sCurrentName(xNamed->getName());
if (sCurrentName != sCurrentSheetName && rImport.GetDocument())
{
- rImport.GetDocument()->RenameTab( static_cast<SCTAB>(nCurrentSheet),
+ rImport.GetDocument()->RenameTab( nCurrentSheet,
sCurrentSheetName, false, sal_True);
}
}
@@ -699,7 +699,7 @@ table::CellAddress ScMyTables::GetRealCellPos()
aRealCellPos.Row = nRow;
aRealCellPos.Column = nCol;
- aRealCellPos.Sheet = sal::static_int_cast<sal_Int16>(nCurrentSheet);
+ aRealCellPos.Sheet = nCurrentSheet;
return aRealCellPos;
}
@@ -769,7 +769,7 @@ void ScMyTables::AddMatrixRange(
aRange.StartRow = nStartRow;
aRange.EndColumn = nEndColumn;
aRange.EndRow = nEndRow;
- aRange.Sheet = sal::static_int_cast<sal_Int16>(nCurrentSheet);
+ aRange.Sheet = nCurrentSheet;
ScMatrixRange aMRange(aRange, rFormula, rFormulaNmsp, eGrammar);
aMatrixRangeList.push_back(aMRange);
}
diff --git a/sc/source/filter/xml/xmlsubti.hxx b/sc/source/filter/xml/xmlsubti.hxx
index e0a8d9a..794a132 100644
--- a/sc/source/filter/xml/xmlsubti.hxx
+++ b/sc/source/filter/xml/xmlsubti.hxx
@@ -67,7 +67,7 @@ private:
sal_Int32 nSubTableSpanned;
ScMysalIntList nChangedCols;
public:
- ScMyTableData(sal_Int32 nSheet = -1, sal_Int32 nCol = -1, sal_Int32 nRow = -1);
+ ScMyTableData(SCTAB nSheet = -1, sal_Int32 nCol = -1, sal_Int32 nRow = -1);
~ScMyTableData();
com::sun::star::table::CellAddress GetCellPos() const { return aTableCellPos; }
sal_Int32 GetRow() const { return aTableCellPos.Row; }
@@ -142,7 +142,7 @@ private:
sal_Int32 nCurrentColStylePos;
sal_Int16 nCurrentDrawPage;
sal_Int16 nCurrentXShapes;
- sal_Int32 nCurrentSheet;
+ SCTAB nCurrentSheet;
sal_Bool IsMerged (const com::sun::star::uno::Reference <com::sun::star::table::XCellRange>& xCellRange,
const sal_Int32 nCol, const sal_Int32 nRow,
@@ -172,7 +172,7 @@ public:
void AddColStyle(const sal_Int32 nRepeat, const rtl::OUString& rCellStyleName);
ScXMLTabProtectionData& GetCurrentProtectionData() { return maProtectionData; }
rtl::OUString GetCurrentSheetName() const { return sCurrentSheetName; }
- sal_Int32 GetCurrentSheet() const { return nCurrentSheet; }
+ SCTAB GetCurrentSheet() const { return nCurrentSheet; }
sal_Int32 GetCurrentColumn() const { return maTables.back().GetColCount(); }
sal_Int32 GetCurrentRow() const { return maTables.back().GetRow(); }
::com::sun::star::uno::Reference< ::com::sun::star::sheet::XSpreadsheet >
diff --git a/sc/source/filter/xml/xmltabi.cxx b/sc/source/filter/xml/xmltabi.cxx
index 8c2f084..de55886 100644
--- a/sc/source/filter/xml/xmltabi.cxx
+++ b/sc/source/filter/xml/xmltabi.cxx
@@ -285,8 +285,8 @@ SvXMLImportContext *ScXMLTableContext::CreateChildContext( sal_uInt16 nPrefix,
ScDocument* pDoc = GetScImport().GetDocument();
if (pDoc)
{
- sal_Int32 nTab = GetScImport().GetTables().GetCurrentSheet();
- ScRangeName* pRN = pDoc->GetRangeName(static_cast<SCTAB>(nTab));
+ SCTAB nTab = GetScImport().GetTables().GetCurrentSheet();
+ ScRangeName* pRN = pDoc->GetRangeName(nTab);
if (pRN)
{
pContext = new ScXMLNamedExpressionsContext(
@@ -381,7 +381,7 @@ void ScXMLTableContext::EndElement()
if (!pDoc)
return;
- SCTAB nCurTab = static_cast<SCTAB>(GetScImport().GetTables().GetCurrentSheet());
+ SCTAB nCurTab = GetScImport().GetTables().GetCurrentSheet();
if (sPrintRanges.getLength())
{
Reference< sheet::XPrintAreas > xPrintAreas(
@@ -446,7 +446,7 @@ void ScXMLTableContext::EndElement()
if (!pExternalRefInfo.get() && nStartOffset >= 0 /* && nEndOffset >= 0 */)
{
ScSheetSaveData* pSheetData = ScModelObj::getImplementation(GetScImport().GetModel())->GetSheetSaveData();
- sal_Int32 nTab = GetScImport().GetTables().GetCurrentSheet();
+ SCTAB nTab = GetScImport().GetTables().GetCurrentSheet();
// pSheetData->AddStreamPos( nTab, nStartOffset, nEndOffset );
pSheetData->StartStreamPos( nTab, nStartOffset );
}
diff --git a/sc/source/ui/vba/vbaquerytable.cxx b/sc/source/ui/vba/vbaquerytable.cxx
index 159c7b7..03e734a 100644
--- a/sc/source/ui/vba/vbaquerytable.cxx
+++ b/sc/source/ui/vba/vbaquerytable.cxx
@@ -59,9 +59,9 @@ ScVbaQueryTable::Refresh( const ::com::sun::star::uno::Any& /*aBackgroundQuery*/
{
//Get parent Info
- sal_Int32 nRow = m_pParent->getRow();
- sal_Int32 nClm = m_pParent->getColumn();
- sal_Int16 nTab = m_pParent->getWorksheet()->getIndex() - 1; //The vba index begin from 1.
+ SCROW nRow = m_pParent->getRow();
+ SCCOL nClm = m_pParent->getColumn();
+ SCTAB nTab = m_pParent->getWorksheet()->getIndex() - 1; //The vba index begin from 1.
ScAddress crrRngAddr(nClm, nRow, nTab);
//Get link info
commit f4009279e0c97184a37422e42d929d51a4c13f10
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date: Wed Jun 1 21:37:42 2011 +0200
we cant't check for 2*MAXTAB anymore, this is out of bounds
diff --git a/sc/source/ui/view/cellsh3.cxx b/sc/source/ui/view/cellsh3.cxx
index 9ea2068..741b7da 100644
--- a/sc/source/ui/view/cellsh3.cxx
+++ b/sc/source/ui/view/cellsh3.cxx
@@ -458,7 +458,7 @@ void ScCellShell::Execute( SfxRequest& rReq )
bValid = !pDoc->GetTable( aName, nDummy );
++i;
}
- while ( !bValid && i <= 2*MAXTAB );
+ while ( !bValid && i <= MAXTAB + 2 );
if ( pReqArgs != NULL )
{
More information about the Libreoffice-commits
mailing list