LibreOffice Module sc (master) 1
Public Types | Public Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
ScRangeName Class Reference

#include <rangenam.hxx>

Public Types

typedef ::std::map< SCTAB, const ScRangeName * > TabNameCopyMap
 Map that stores non-managed pointers to ScRangeName instances. More...
 
typedef DataType::const_iterator const_iterator
 
typedef DataType::iterator iterator
 

Public Member Functions

 ScRangeName ()
 
SC_DLLPUBLIC ScRangeName (const ScRangeName &r)
 
SC_DLLPUBLIC const ScRangeDatafindByRange (const ScRange &rRange) const
 
SC_DLLPUBLIC ScRangeDatafindByUpperName (const OUString &rName)
 
SC_DLLPUBLIC const ScRangeDatafindByUpperName (const OUString &rName) const
 
SC_DLLPUBLIC ScRangeDatafindByIndex (sal_uInt16 i) const
 
void UpdateReference (sc::RefUpdateContext &rCxt, SCTAB nLocalTab=-1)
 
void UpdateInsertTab (sc::RefUpdateInsertTabContext &rCxt, SCTAB nLocalTab=-1)
 
void UpdateDeleteTab (sc::RefUpdateDeleteTabContext &rCxt, SCTAB nLocalTab=-1)
 
void UpdateMoveTab (sc::RefUpdateMoveTabContext &rCxt, SCTAB nLocalTab=-1)
 
void UpdateTranspose (const ScRange &rSource, const ScAddress &rDest)
 
void UpdateGrow (const ScRange &rArea, SCCOL nGrowX, SCROW nGrowY)
 
void CompileUnresolvedXML (sc::CompileFormulaContext &rCxt)
 Compile those names that couldn't be resolved during loading and inserting because they may have referred a name that was inserted later. More...
 
void CopyUsedNames (const SCTAB nLocalTab, const SCTAB nOldTab, const SCTAB nNewTab, const ScDocument &rOldDoc, ScDocument &rNewDoc, const bool bGlobalNamesToLocal) const
 Copy names while copying a sheet if they reference the sheet to be copied. More...
 
SC_DLLPUBLIC const_iterator begin () const
 
SC_DLLPUBLIC const_iterator end () const
 
SC_DLLPUBLIC size_t size () const
 
SC_DLLPUBLIC size_t index_size () const
 
bool empty () const
 
SC_DLLPUBLIC bool insert (ScRangeData *p, bool bReuseFreeIndex=true)
 Insert object into set. More...
 
void erase (const ScRangeData &r)
 
void erase (const OUString &rName)
 
void erase (const_iterator itr)
 Erase by iterator position. More...
 
void clear ()
 
bool operator== (const ScRangeName &r) const
 
bool hasPossibleAddressConflict () const
 

Private Types

typedef std::vector< ScRangeData * > IndexDataType
 
typedef ::std::map< OUString, std::unique_ptr< ScRangeData > > DataType
 

Private Member Functions

void checkHasPossibleAddressConflict () const
 

Private Attributes

DataType m_Data
 
IndexDataType maIndexToData
 
bool mHasPossibleAddressConflict: 1
 
bool mHasPossibleAddressConflictDirty: 1
 

Detailed Description

Definition at line 185 of file rangenam.hxx.

Member Typedef Documentation

◆ const_iterator

typedef DataType::const_iterator ScRangeName::const_iterator

Definition at line 203 of file rangenam.hxx.

◆ DataType

typedef ::std::map<OUString, std::unique_ptr<ScRangeData> > ScRangeName::DataType
private

Definition at line 189 of file rangenam.hxx.

◆ IndexDataType

typedef std::vector<ScRangeData*> ScRangeName::IndexDataType
private

Definition at line 188 of file rangenam.hxx.

◆ iterator

typedef DataType::iterator ScRangeName::iterator

Definition at line 204 of file rangenam.hxx.

◆ TabNameCopyMap

Map that stores non-managed pointers to ScRangeName instances.

Definition at line 201 of file rangenam.hxx.

Constructor & Destructor Documentation

◆ ScRangeName() [1/2]

ScRangeName::ScRangeName ( )

Definition at line 669 of file rangenam.cxx.

◆ ScRangeName() [2/2]

ScRangeName::ScRangeName ( const ScRangeName r)

Definition at line 675 of file rangenam.cxx.

References m_Data, maIndexToData, and nPos.

Member Function Documentation

◆ begin()

SC_DLLPUBLIC const_iterator ScRangeName::begin ( ) const
inline

Definition at line 245 of file rangenam.hxx.

References m_Data.

Referenced by ScCellShell::ExecuteDataPilotDialog(), and ScAreaNameIterator::ScAreaNameIterator().

◆ checkHasPossibleAddressConflict()

void ScRangeName::checkHasPossibleAddressConflict ( ) const
private

◆ clear()

void ScRangeName::clear ( )

◆ CompileUnresolvedXML()

void ScRangeName::CompileUnresolvedXML ( sc::CompileFormulaContext rCxt)

Compile those names that couldn't be resolved during loading and inserting because they may have referred a name that was inserted later.

Definition at line 778 of file rangenam.cxx.

References m_Data.

◆ CopyUsedNames()

void ScRangeName::CopyUsedNames ( const SCTAB  nLocalTab,
const SCTAB  nOldTab,
const SCTAB  nNewTab,
const ScDocument rOldDoc,
ScDocument rNewDoc,
const bool  bGlobalNamesToLocal 
) const

Copy names while copying a sheet if they reference the sheet to be copied.

Assumes that new sheet was already inserted, global names have been updated/adjusted, but sheet-local names on nOldTab are not, as is the case in ScDocument::CopyTab()

Parameters
nLocalTab-1 when operating on global names, else sheet/tab of sheet-local name scope. The already adjusted tab on which to find the name.
nOldTabThe original unadjusted tab position.
nNewTabThe new tab position.

Definition at line 786 of file rangenam.cxx.

References ScDocument::CopyAdjustRangeName(), m_Data, nIndex, and ScAddress::SetTab().

Referenced by ScDocument::CopyTab(), and ScDocument::TransferTab().

◆ empty()

bool ScRangeName::empty ( ) const
inline

◆ end()

SC_DLLPUBLIC const_iterator ScRangeName::end ( ) const
inline

Definition at line 246 of file rangenam.hxx.

References m_Data.

Referenced by ScCellShell::ExecuteDataPilotDialog(), and ScAreaNameIterator::ScAreaNameIterator().

◆ erase() [1/3]

void ScRangeName::erase ( const OUString &  rName)

Definition at line 851 of file rangenam.cxx.

References erase(), and m_Data.

◆ erase() [2/3]

void ScRangeName::erase ( const ScRangeData r)

◆ erase() [3/3]

void ScRangeName::erase ( const_iterator  itr)

Erase by iterator position.

Note that this method doesn't check for iterator's validity. The caller must make sure that the iterator is valid.

Definition at line 858 of file rangenam.cxx.

References m_Data, maIndexToData, mHasPossibleAddressConflict, mHasPossibleAddressConflictDirty, and nIndex.

◆ findByIndex()

ScRangeData * ScRangeName::findByIndex ( sal_uInt16  i) const

◆ findByRange()

const ScRangeData * ScRangeName::findByRange ( const ScRange rRange) const

Definition at line 697 of file rangenam.cxx.

References m_Data.

Referenced by ScDocument::GetRangeAtBlock(), and XclExpWebQueryBuffer::XclExpWebQueryBuffer().

◆ findByUpperName() [1/2]

ScRangeData * ScRangeName::findByUpperName ( const OUString &  rName)

◆ findByUpperName() [2/2]

const ScRangeData * ScRangeName::findByUpperName ( const OUString &  rName) const

Definition at line 710 of file rangenam.cxx.

References m_Data.

◆ hasPossibleAddressConflict()

bool ScRangeName::hasPossibleAddressConflict ( ) const
inline

◆ index_size()

SC_DLLPUBLIC size_t ScRangeName::index_size ( ) const
inline

Definition at line 248 of file rangenam.hxx.

References maIndexToData.

Referenced by ScLinkedAreaDlg::UpdateSourceRanges().

◆ insert()

bool ScRangeName::insert ( ScRangeData p,
bool  bReuseFreeIndex = true 
)

Insert object into set.

@ATTENTION: The underlying ::std::map<std::unique_ptr>::insert(p) takes ownership of p and if it can't insert it deletes the object! So, if this insert here returns false the object where p pointed to is gone!

Parameters
bReuseFreeIndexIf the ScRangeData p points to has an index value of 0: If TRUE then reuse a free index slot if available. If FALSE then assign a new index slot. The Manage Names dialog uses this so that deleting and adding ranges in the same run is guaranteed to not reuse previously assigned indexes.

Definition at line 802 of file rangenam.cxx.

References aName, erase(), m_Data, maIndexToData, mHasPossibleAddressConflictDirty, nPos, and p.

Referenced by ScNameDefDlg::AddPushed(), ScOrcusNamedExpression::commit(), ScDocFunc::CreateOneName(), ScPosWnd::DoEnter(), ScPosWnd::FillRangeNames(), ScContentTree::GetAreaNames(), ScViewFunc::InsertName(), XclImpName::InsertName(), ScDocument::InsertNewRangeName(), ScHTMLImport::InsertRangeName(), ScNameDlg::NameModified(), ScUndoAddRangeData::Redo(), sc::SolverSettings::WriteConstraintPart(), sc::SolverSettings::WriteParamValue(), and ScEEImport::WriteToDocument().

◆ operator==()

bool ScRangeName::operator== ( const ScRangeName r) const

Definition at line 891 of file rangenam.cxx.

References m_Data.

◆ size()

SC_DLLPUBLIC size_t ScRangeName::size ( ) const
inline

Definition at line 247 of file rangenam.hxx.

References m_Data.

Referenced by sc::SolverSettings::DeleteAllNamedRanges(), and ScConsolidateDlg::Init().

◆ UpdateDeleteTab()

void ScRangeName::UpdateDeleteTab ( sc::RefUpdateDeleteTabContext rCxt,
SCTAB  nLocalTab = -1 
)

Definition at line 746 of file rangenam.cxx.

References m_Data.

◆ UpdateGrow()

void ScRangeName::UpdateGrow ( const ScRange rArea,
SCCOL  nGrowX,
SCROW  nGrowY 
)

Definition at line 770 of file rangenam.cxx.

References m_Data.

◆ UpdateInsertTab()

void ScRangeName::UpdateInsertTab ( sc::RefUpdateInsertTabContext rCxt,
SCTAB  nLocalTab = -1 
)

Definition at line 738 of file rangenam.cxx.

References m_Data.

◆ UpdateMoveTab()

void ScRangeName::UpdateMoveTab ( sc::RefUpdateMoveTabContext rCxt,
SCTAB  nLocalTab = -1 
)

Definition at line 754 of file rangenam.cxx.

References m_Data.

◆ UpdateReference()

void ScRangeName::UpdateReference ( sc::RefUpdateContext rCxt,
SCTAB  nLocalTab = -1 
)

Definition at line 726 of file rangenam.cxx.

References m_Data, sc::RefUpdateContext::meMode, and URM_COPY.

◆ UpdateTranspose()

void ScRangeName::UpdateTranspose ( const ScRange rSource,
const ScAddress rDest 
)

Definition at line 762 of file rangenam.cxx.

References m_Data.

Member Data Documentation

◆ m_Data

DataType ScRangeName::m_Data
private

◆ maIndexToData

IndexDataType ScRangeName::maIndexToData
private

Definition at line 191 of file rangenam.hxx.

Referenced by clear(), erase(), findByIndex(), index_size(), insert(), and ScRangeName().

◆ mHasPossibleAddressConflict

bool ScRangeName::mHasPossibleAddressConflict
mutableprivate

◆ mHasPossibleAddressConflictDirty

bool ScRangeName::mHasPossibleAddressConflictDirty
mutableprivate

The documentation for this class was generated from the following files: