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

#include <rangenam.hxx>

Collaboration diagram for ScRangeData:
[legend]

Public Types

enum  Type {
  Type::Name = 0x0000,
  Type::Database = 0x0001,
  Type::Criteria = 0x0002,
  Type::PrintArea = 0x0004,
  Type::ColHeader = 0x0008,
  Type::RowHeader = 0x0010,
  Type::AbsArea = 0x0020,
  Type::RefArea = 0x0040,
  Type::AbsPos = 0x0080
}
 
enum  IsNameValidType {
  NAME_VALID,
  NAME_INVALID_CELL_REF,
  NAME_INVALID_BAD_STRING
}
 

Public Member Functions

SC_DLLPUBLIC ScRangeData (ScDocument *pDoc, const OUString &rName, const OUString &rSymbol, const ScAddress &rAdr=ScAddress(), Type nType=Type::Name, const formula::FormulaGrammar::Grammar eGrammar=formula::FormulaGrammar::GRAM_DEFAULT)
 
SC_DLLPUBLIC ScRangeData (ScDocument *pDoc, const OUString &rName, const ScTokenArray &rArr, const ScAddress &rAdr=ScAddress(), Type nType=Type::Name)
 
SC_DLLPUBLIC ScRangeData (ScDocument *pDoc, const OUString &rName, const ScAddress &rTarget)
 
 ScRangeData (const ScRangeData &rScRangeData, ScDocument *pDocument=nullptr, const ScAddress *pPos=nullptr)
 
SC_DLLPUBLIC ~ScRangeData ()
 
bool operator== (const ScRangeData &rData) const
 
void GetName (OUString &rName) const
 
const OUString & GetName () const
 
const OUString & GetUpperName () const
 
const ScAddressGetPos () const
 
void SetIndex (sal_uInt16 nInd)
 
sal_uInt16 GetIndex () const
 
void SetNewName (const OUString &rNewName)
 Does not change the name, but sets maNewName for formula update after dialog. More...
 
ScTokenArrayGetCode ()
 
SC_DLLPUBLIC void SetCode (const ScTokenArray &)
 
const ScTokenArrayGetCode () const
 
SC_DLLPUBLIC FormulaError GetErrCode () const
 
bool HasReferences () const
 
void AddType (Type nType)
 
Type GetType () const
 
bool HasType (Type nType) const
 
sal_uInt32 GetUnoType () const
 
SC_DLLPUBLIC void GetSymbol (OUString &rSymbol, const formula::FormulaGrammar::Grammar eGrammar=formula::FormulaGrammar::GRAM_DEFAULT) const
 
SC_DLLPUBLIC void GetSymbol (OUString &rSymbol, const ScAddress &rPos, const formula::FormulaGrammar::Grammar eGrammar=formula::FormulaGrammar::GRAM_DEFAULT) const
 
void UpdateSymbol (OUStringBuffer &rBuffer, const ScAddress &)
 
void UpdateReference (sc::RefUpdateContext &rCxt, SCTAB nLocalTab)
 
bool IsModified () const
 
SC_DLLPUBLIC void GuessPosition ()
 
void UpdateTranspose (const ScRange &rSource, const ScAddress &rDest)
 
void UpdateGrow (const ScRange &rArea, SCCOL nGrowX, SCROW nGrowY)
 
SC_DLLPUBLIC bool IsReference (ScRange &rRef) const
 
bool IsReference (ScRange &rRef, const ScAddress &rPos) const
 
SC_DLLPUBLIC bool IsValidReference (ScRange &rRef) const
 
bool IsRangeAtBlock (const ScRange &) const
 
void UpdateInsertTab (sc::RefUpdateInsertTabContext &rCxt, SCTAB nLocalTab)
 
void UpdateDeleteTab (sc::RefUpdateDeleteTabContext &rCxt, SCTAB nLocalTab)
 
void UpdateMoveTab (sc::RefUpdateMoveTabContext &rCxt, SCTAB nLocalTab)
 
void ValidateTabRefs ()
 
void CompileUnresolvedXML (sc::CompileFormulaContext &rCxt)
 

Static Public Member Functions

static void MakeValidName (const ScDocument *pDoc, OUString &rName)
 
static SC_DLLPUBLIC IsNameValidType IsNameValid (const OUString &rName, const ScDocument *pDoc)
 

Private Member Functions

void CompileRangeData (const OUString &rSymbol, bool bSetError)
 
void InitCode ()
 

Private Attributes

OUString aName
 
OUString aUpperName
 
OUString maNewName
 used for formulas after changing names in the dialog More...
 
std::unique_ptr< ScTokenArraypCode
 
ScAddress aPos
 
Type eType
 
ScDocumentpDoc
 
formula::FormulaGrammar::Grammar eTempGrammar
 
sal_uInt16 nIndex
 
bool bModified
 

Detailed Description

Definition at line 46 of file rangenam.hxx.

Member Enumeration Documentation

Enumerator
NAME_VALID 
NAME_INVALID_CELL_REF 
NAME_INVALID_BAD_STRING 

Definition at line 62 of file rangenam.hxx.

enum ScRangeData::Type
strong
Enumerator
Name 
Database 
Criteria 
PrintArea 
ColHeader 
RowHeader 
AbsArea 
RefArea 
AbsPos 

Definition at line 49 of file rangenam.hxx.

Constructor & Destructor Documentation

ScRangeData::ScRangeData ( ScDocument pDoc,
const OUString &  rName,
const OUString &  rSymbol,
const ScAddress rAdr = ScAddress(),
Type  nType = Type::Name,
const formula::FormulaGrammar::Grammar  eGrammar = formula::FormulaGrammar::GRAM_DEFAULT 
)
ScRangeData::ScRangeData ( ScDocument pDoc,
const OUString &  rName,
const ScTokenArray rArr,
const ScAddress rAdr = ScAddress(),
Type  nType = Type::Name 
)

Definition at line 82 of file rangenam.cxx.

References aName, eType, InitCode(), nIndex, and pCode.

ScRangeData::ScRangeData ( ScDocument pDoc,
const OUString &  rName,
const ScAddress rTarget 
)
ScRangeData::ScRangeData ( const ScRangeData rScRangeData,
ScDocument pDocument = nullptr,
const ScAddress pPos = nullptr 
)

Definition at line 125 of file rangenam.cxx.

References aName, Clone(), eType, nIndex, and pCode.

ScRangeData::~ScRangeData ( )

Definition at line 139 of file rangenam.cxx.

Member Function Documentation

void ScRangeData::AddType ( Type  nType)
inline

Definition at line 172 of file rangenam.hxx.

References nType.

Referenced by ScNameDefDlg::AddPushed().

void ScRangeData::CompileRangeData ( const OUString &  rSymbol,
bool  bSetError 
)
private
void ScRangeData::CompileUnresolvedXML ( sc::CompileFormulaContext rCxt)
ScTokenArray* ScRangeData::GetCode ( )
inline
const ScTokenArray* ScRangeData::GetCode ( ) const
inline

Definition at line 122 of file rangenam.hxx.

References pCode.

FormulaError ScRangeData::GetErrCode ( ) const

Definition at line 499 of file rangenam.cxx.

References pCode.

Referenced by ScNameDefDlg::AddPushed(), and ScCompiler::HandleRange().

sal_uInt16 ScRangeData::GetIndex ( ) const
inline
void ScRangeData::GetName ( OUString &  rName) const
inline
const OUString& ScRangeData::GetName ( ) const
inline

Definition at line 112 of file rangenam.hxx.

References maNewName.

const ScAddress& ScRangeData::GetPos ( ) const
inline
void ScRangeData::GetSymbol ( OUString &  rSymbol,
const formula::FormulaGrammar::Grammar  eGrammar = formula::FormulaGrammar::GRAM_DEFAULT 
) const
void ScRangeData::GetSymbol ( OUString &  rSymbol,
const ScAddress rPos,
const formula::FormulaGrammar::Grammar  eGrammar = formula::FormulaGrammar::GRAM_DEFAULT 
) const
Type ScRangeData::GetType ( ) const
inline

Definition at line 126 of file rangenam.hxx.

References eType.

Referenced by ScNamedRangeObj::Modify_Impl().

sal_uInt32 ScRangeData::GetUnoType ( ) const

Definition at line 509 of file rangenam.cxx.

References ColHeader, COLUMN_HEADER, Criteria, HasType(), PrintArea, ROW_HEADER, and RowHeader.

const OUString& ScRangeData::GetUpperName ( ) const
inline
void ScRangeData::GuessPosition ( )
bool ScRangeData::HasReferences ( ) const

Definition at line 504 of file rangenam.cxx.

References pCode.

Referenced by ScCompiler::HandleRange(), and ScFormulaCell::ScFormulaCell().

bool ScRangeData::HasType ( Type  nType) const
inline
void ScRangeData::InitCode ( )
private
bool ScRangeData::IsModified ( ) const
inline

Definition at line 138 of file rangenam.hxx.

References bModified.

Referenced by ScFormulaCell::UpdateGrow(), and ScFormulaCell::UpdateTranspose().

ScRangeData::IsNameValidType ScRangeData::IsNameValid ( const OUString &  rName,
const ScDocument pDoc 
)
static
bool ScRangeData::IsRangeAtBlock ( const ScRange rBlock) const

Definition at line 360 of file rangenam.cxx.

References IsReference().

bool ScRangeData::IsReference ( ScRange rRef) const
bool ScRangeData::IsReference ( ScRange rRef,
const ScAddress rPos 
) const

Definition at line 377 of file rangenam.cxx.

References AbsArea, AbsPos, eType, pCode, and RefArea.

bool ScRangeData::IsValidReference ( ScRange rRef) const
void ScRangeData::MakeValidName ( const ScDocument pDoc,
OUString &  rName 
)
static
bool ScRangeData::operator== ( const ScRangeData rData) const

Definition at line 340 of file rangenam.cxx.

References aName, eType, i, nIndex, and rData.

void ScRangeData::SetCode ( const ScTokenArray rArr)

Definition at line 605 of file rangenam.cxx.

References InitCode(), and pCode.

Referenced by oox::xls::DefinedName::convertFormula(), and ScVbaName::setContent().

void ScRangeData::SetIndex ( sal_uInt16  nInd)
inline
void ScRangeData::SetNewName ( const OUString &  rNewName)
inline

Does not change the name, but sets maNewName for formula update after dialog.

Definition at line 119 of file rangenam.hxx.

Referenced by ScDocument::PreprocessAllRangeNamesUpdate().

void ScRangeData::UpdateDeleteTab ( sc::RefUpdateDeleteTabContext rCxt,
SCTAB  nLocalTab 
)
void ScRangeData::UpdateGrow ( const ScRange rArea,
SCCOL  nGrowX,
SCROW  nGrowY 
)
void ScRangeData::UpdateInsertTab ( sc::RefUpdateInsertTabContext rCxt,
SCTAB  nLocalTab 
)
void ScRangeData::UpdateMoveTab ( sc::RefUpdateMoveTabContext rCxt,
SCTAB  nLocalTab 
)
void ScRangeData::UpdateReference ( sc::RefUpdateContext rCxt,
SCTAB  nLocalTab 
)
Parameters
nLocalTabsheet index where this name belongs, or -1 for global name.

Definition at line 268 of file rangenam.cxx.

References aPos, bModified, sc::RefUpdateContext::maUpdatedNames, sc::RefUpdateResult::mbReferenceModified, nIndex, pCode, and sc::UpdatedRangeNames::setUpdatedName().

void ScRangeData::UpdateSymbol ( OUStringBuffer &  rBuffer,
const ScAddress rPos 
)

Definition at line 260 of file rangenam.cxx.

References formula::FormulaGrammar::GRAM_DEFAULT, pCode, and pDoc.

Referenced by ScDocFunc::InsertNameList().

void ScRangeData::UpdateTranspose ( const ScRange rSource,
const ScAddress rDest 
)
void ScRangeData::ValidateTabRefs ( )

Member Data Documentation

OUString ScRangeData::aName
private

Definition at line 70 of file rangenam.hxx.

ScAddress ScRangeData::aPos
private
OUString ScRangeData::aUpperName
private

Definition at line 71 of file rangenam.hxx.

Referenced by GetUpperName().

bool ScRangeData::bModified
private

Definition at line 80 of file rangenam.hxx.

Referenced by IsModified(), UpdateGrow(), UpdateReference(), and UpdateTranspose().

formula::FormulaGrammar::Grammar ScRangeData::eTempGrammar
private

Definition at line 78 of file rangenam.hxx.

Referenced by CompileRangeData(), and CompileUnresolvedXML().

Type ScRangeData::eType
private
OUString ScRangeData::maNewName
private

used for formulas after changing names in the dialog

Definition at line 72 of file rangenam.hxx.

Referenced by GetName().

sal_uInt16 ScRangeData::nIndex
private
std::unique_ptr<ScTokenArray> ScRangeData::pCode
private
ScDocument* ScRangeData::pDoc
private

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