Commit c8b72599 authored by Martin Pfeiffer's avatar Martin Pfeiffer
Browse files

better naming - delete unused methods

svn path=/trunk/koffice/; revision=547333
parent 71e9a679
......@@ -33,8 +33,9 @@ using namespace std;
int BasicElement::evilDestructionCount = 0;
BasicElement::BasicElement( BasicElement* p )
: parent( p ), m_baseline( 0 ), elementType( 0 )
: m_baseline( 0 ), elementType( 0 )
{
m_parentElement = p;
m_boundingRect = QRectF( 0, 0, 0, 0 );
evilDestructionCount++;
}
......@@ -44,32 +45,16 @@ BasicElement::~BasicElement()
evilDestructionCount--;
}
BasicElement::BasicElement( const BasicElement& other )
: parent( 0 ),
m_baseline( other.m_baseline ),
elementType( other.elementType )
{
m_boundingRect = QRectF( other.getX(), other.getY(), other.getWidth(), other.getHeight() );
evilDestructionCount++;
}
bool BasicElement::readOnly( const BasicElement* /*child*/ ) const
{
return parent->readOnly( this );
return m_parentElement->readOnly( this );
}
FormulaElement* BasicElement::formula()
{
//if ( parent != 0 ) {
return parent->formula();
//}
//return 0;
return m_parentElement->formula();
}
/**
* Returns the element the point is in.
*/
......@@ -93,7 +78,7 @@ LuPixelPoint BasicElement::widgetPos()
{
luPixel x = 0;
luPixel y = 0;
for (BasicElement* element = this; element != 0; element = element->parent) {
for (BasicElement* element = this; element != 0; element = element->getParent()) {
x += element->getX();
y += element->getY();
}
......@@ -102,7 +87,7 @@ LuPixelPoint BasicElement::widgetPos()
/**
* Sets the cursor inside this element to its start position.
* Sets the cursor inside this element to its start position
* For most elements that is the main child.
*/
void BasicElement::goInside(FormulaCursor* cursor)
......
......@@ -77,18 +77,14 @@ class KOFORMULA_EXPORT BasicElement // exported for unit tests
public:
/*
* Each element might contain children. Each child needs
* its own unique number. It is not guaranteed, however,
* that the number stays the same all the time.
* (The SequenceElement's children are simply counted.)
* The standard constructor
* @param parent pointer to the BasicElement's parent
*/
BasicElement( BasicElement* parent = 0 );
BasicElement(BasicElement* parent = 0);
/// The standard destructor
virtual ~BasicElement();
// deep copy
BasicElement( const BasicElement& );
virtual BasicElement* clone() = 0;
/**
......@@ -110,7 +106,7 @@ public:
/**
* Provide fast access to the rootElement for each child.
*/
virtual const FormulaElement* formula() const { return parent->formula(); }
virtual const FormulaElement* formula() const { return m_parentElement->formula(); }
/**
* @returns the character that represents this element. Used for
......@@ -332,9 +328,9 @@ public:
// basic support
const BasicElement* getParent() const { return parent; }
BasicElement* getParent() { return parent; }
void setParent(BasicElement* p) { parent = p; }
const BasicElement* getParent() const { return m_parentElement; }
BasicElement* getParent() { return m_parentElement; }
void setParent(BasicElement* p) { m_parentElement = p; }
double getX() const;
double getY() const;
......@@ -438,7 +434,7 @@ protected:
private:
/// The element's parent element - might not be null except of FormulaElement
BasicElement* parent;
BasicElement* m_parentElement;
/// The boundingRect storing the element's width, height, x and y
QRectF m_boundingRect;
......
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