LibreOffice Module sc (master)  1
Public Types | Public Member Functions | Private Types | 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 iterator begin ()
 
SC_DLLPUBLIC iterator end ()
 
SC_DLLPUBLIC size_t 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
 

Private Types

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

Private Attributes

DataType m_Data
 
IndexDataType maIndexToData
 

Detailed Description

Definition at line 184 of file rangenam.hxx.

Member Typedef Documentation

typedef DataType::const_iterator ScRangeName::const_iterator

Definition at line 196 of file rangenam.hxx.

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

Definition at line 188 of file rangenam.hxx.

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

Definition at line 187 of file rangenam.hxx.

typedef DataType::iterator ScRangeName::iterator

Definition at line 197 of file rangenam.hxx.

Map that stores non-managed pointers to ScRangeName instances.

Definition at line 194 of file rangenam.hxx.

Constructor & Destructor Documentation

ScRangeName::ScRangeName ( )

Definition at line 653 of file rangenam.cxx.

ScRangeName::ScRangeName ( const ScRangeName r)

Definition at line 655 of file rangenam.cxx.

References m_Data, maIndexToData, and nPos.

Member Function Documentation

ScRangeName::const_iterator ScRangeName::begin ( ) const

Definition at line 780 of file rangenam.cxx.

References m_Data.

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

ScRangeName::iterator ScRangeName::begin ( )

Definition at line 790 of file rangenam.cxx.

References m_Data.

void ScRangeName::clear ( )

Definition at line 874 of file rangenam.cxx.

References m_Data, and maIndexToData.

Referenced by ScDocument::TransposeClip().

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 756 of file rangenam.cxx.

References m_Data.

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 764 of file rangenam.cxx.

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

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

bool ScRangeName::empty ( ) const
ScRangeName::const_iterator ScRangeName::end ( ) const

Definition at line 785 of file rangenam.cxx.

References m_Data.

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

ScRangeName::iterator ScRangeName::end ( )

Definition at line 795 of file rangenam.cxx.

References m_Data.

void ScRangeName::erase ( const ScRangeData r)
void ScRangeName::erase ( const OUString &  rName)

Definition at line 858 of file rangenam.cxx.

References erase(), and m_Data.

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 865 of file rangenam.cxx.

References m_Data, maIndexToData, and nIndex.

ScRangeData * ScRangeName::findByIndex ( sal_uInt16  i) const
const ScRangeData * ScRangeName::findByRange ( const ScRange rRange) const

Definition at line 675 of file rangenam.cxx.

References m_Data.

Referenced by XclExpWebQueryBuffer::XclExpWebQueryBuffer().

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

Definition at line 688 of file rangenam.cxx.

References m_Data.

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

Insert object into set.

: 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 810 of file rangenam.cxx.

References aName, erase(), ScRangeData::GetIndex(), ScRangeData::GetUpperName(), m_Data, maIndexToData, nPos, and ScRangeData::SetIndex().

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

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

Definition at line 880 of file rangenam.cxx.

References m_Data.

size_t ScRangeName::size ( ) const

Definition at line 800 of file rangenam.cxx.

References m_Data.

Referenced by ScConsolidateDlg::Init().

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

Definition at line 724 of file rangenam.cxx.

References m_Data.

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

Definition at line 748 of file rangenam.cxx.

References m_Data.

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

Definition at line 716 of file rangenam.cxx.

References m_Data.

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

Definition at line 732 of file rangenam.cxx.

References m_Data.

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

Definition at line 704 of file rangenam.cxx.

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

Referenced by ScUndoDragDrop::Undo().

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

Definition at line 740 of file rangenam.cxx.

References m_Data.

Member Data Documentation

DataType ScRangeName::m_Data
private
IndexDataType ScRangeName::maIndexToData
private

Definition at line 190 of file rangenam.hxx.

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


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