Kaydet (Commit) 27dda313 authored tarafından Albert Thuswaldner's avatar Albert Thuswaldner Kaydeden (comit) Michael Meeks

Removed duplicate set/get methods for initial tab count

üst f888af0c
......@@ -46,10 +46,6 @@ public:
void SetDefaults();
// Set or get the initial tab count for new spreadsheet, it is used by VBA API currently.
void SetTabCountInNewSpreadsheet( SCTAB nCount ) { nTabCountInNewSpreadsheet = nCount; }
SCTAB GetTabCountInNewSpreadsheet() const { return nTabCountInNewSpreadsheet; }
void SetAppMetric( FieldUnit eUnit ) { eMetric = eUnit; }
FieldUnit GetAppMetric() const { return eMetric; }
void SetZoom( sal_uInt16 nNew ) { nZoom = nNew; }
......@@ -94,7 +90,6 @@ public:
const ScAppOptions& operator= ( const ScAppOptions& rOpt );
private:
SCTAB nTabCountInNewSpreadsheet;
FieldUnit eMetric;
sal_uInt16 nLRUFuncCount;
sal_uInt16* pLRUList;
......
......@@ -182,7 +182,7 @@ public:
const ScViewOptions& GetViewOptions ();
SC_DLLPUBLIC const ScDocOptions& GetDocOptions ();
SC_DLLPUBLIC const ScAppOptions& GetAppOptions ();
const ScDefaultsOptions& GetDefaultsOptions ();
SC_DLLPUBLIC const ScDefaultsOptions& GetDefaultsOptions ();
const ScFormulaOptions& GetFormulaOptions ();
const ScInputOptions& GetInputOptions ();
SC_DLLPUBLIC const ScPrintOptions& GetPrintOptions ();
......
......@@ -78,9 +78,6 @@ ScAppOptions::~ScAppOptions()
void ScAppOptions::SetDefaults()
{
// Set default tab count for new spreadsheet.
nTabCountInNewSpreadsheet = 0;
if ( ScOptionsUtil::IsMetricSystem() )
eMetric = FUNIT_CM; // default for countries with metric system
else
......@@ -118,7 +115,6 @@ void ScAppOptions::SetDefaults()
const ScAppOptions& ScAppOptions::operator=( const ScAppOptions& rCpy )
{
nTabCountInNewSpreadsheet = rCpy.nTabCountInNewSpreadsheet;
eMetric = rCpy.eMetric;
eZoomType = rCpy.eZoomType;
bSynchronizeZoom = rCpy.bSynchronizeZoom;
......
......@@ -79,7 +79,7 @@
#include "global.hxx"
#include "scmod.hxx"
#include "docoptio.hxx"
#include "appoptio.hxx"
#include "defaultsoptions.hxx"
#include <osl/file.hxx>
#include <rtl/instance.hxx>
......@@ -939,8 +939,8 @@ ScVbaApplication::setEnableCancelKey(sal_Int32 /*lEnableCancelKey*/) throw (uno:
sal_Int32 SAL_CALL ScVbaApplication::getSheetsInNewWorkbook() throw (uno::RuntimeException)
{
const ScAppOptions& rAppOpt = SC_MOD()->GetAppOptions();
return rAppOpt.GetTabCountInNewSpreadsheet();
const ScDefaultsOptions& rOpt = SC_MOD()->GetDefaultsOptions();
return rOpt.GetInitTabCount();
}
void SAL_CALL ScVbaApplication::setSheetsInNewWorkbook( sal_Int32 SheetsInNewWorkbook ) throw (script::BasicErrorException, uno::RuntimeException)
......@@ -952,8 +952,8 @@ void SAL_CALL ScVbaApplication::setSheetsInNewWorkbook( sal_Int32 SheetsInNewWor
}
else
{
ScAppOptions& rAppOpt = const_cast< ScAppOptions& >(SC_MOD()->GetAppOptions());
rAppOpt.SetTabCountInNewSpreadsheet( SheetsInNewWorkbook );
ScDefaultsOptions& rOpt = const_cast< ScDefaultsOptions& >(SC_MOD()->GetDefaultsOptions());
rOpt.SetInitTabCount( SheetsInNewWorkbook );
}
}
......
......@@ -1605,19 +1605,10 @@ void ScTabViewShell::Construct( sal_uInt8 nForceDesignMode )
// append additional sheets (not for OLE object)
if ( pDocSh->GetCreateMode() != SFX_CREATE_MODE_EMBEDDED )
{
// Get the customized initial tab count...
// ... from option dialog.
// Get the customized initial tab count
const ScDefaultsOptions& rOpt = SC_MOD()->GetDefaultsOptions();
SCTAB nInitTabCount = rOpt.GetInitTabCount();
// ... by VBA API.
const ScAppOptions& rAppOpt = SC_MOD()->GetAppOptions();
SCTAB nNewTabCount = rAppOpt.GetTabCountInNewSpreadsheet();
if ( nNewTabCount >= 1 && nNewTabCount <= MAXTAB )
{
nInitTabCount = nNewTabCount;
}
for (SCTAB i=1; i<nInitTabCount; i++)
pDoc->MakeTable(i,false);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment