#include <boost/assert.hpp>
-namespace lyx {
+using namespace std;
-using std::string;
+namespace lyx {
/** The four LaTeX itemize environment default bullets
Bullet::Bullet(int f, int c, int s)
: font(f), character(c), size(s), user_text(0)
{
- if (f < MIN || f >= FONTMAX) {
+ if (f < MIN || f >= FONTMAX)
font = MIN;
- }
- if (c < MIN || c >= CHARMAX) {
+ if (c < MIN || c >= CHARMAX)
character = MIN;
- }
- if (s < MIN || s >= SIZEMAX) {
+ if (s < MIN || s >= SIZEMAX)
size = MIN;
- }
generateText();
testInvariant();
}
void Bullet::setCharacter(int c)
{
- if (c < MIN || c >= CHARMAX) {
+ if (c < MIN || c >= CHARMAX)
character = MIN;
- } else {
+ else
character = c;
- }
user_text = 0;
testInvariant();
}
void Bullet::setFont(int f)
{
- if (f < MIN || f >= FONTMAX) {
+ if (f < MIN || f >= FONTMAX)
font = MIN;
- } else {
+ else
font = f;
- }
user_text = 0;
testInvariant();
}
void Bullet::setSize(int s)
{
- if (s < MIN || s >= SIZEMAX) {
+ if (s < MIN || s >= SIZEMAX)
size = MIN;
- } else {
+ else
size = s;
- }
user_text = 0;
testInvariant();
}
docstring const & Bullet::getText() const
{
- if (user_text == 0) {
+ if (user_text == 0)
generateText();
- }
return text;
}
if (b1.user_text && b2.user_text) {
/* both have valid text */
- if (b1.text == b2.text) {
+ if (b1.text == b2.text)
result = true;
- }
- } else if (((b1.character == b2.character) &&
- (b1.font == b2.font)) &&
- (b1.size == b2.size)) {
+ } else if (b1.character == b2.character && b1.font == b2.font &&
+ b1.size == b2.size) {
result = true;
}
return result;
if ((font >= 0) && (character >= 0)) {
text = bulletEntry(font, character);
- if (size >= 0) {
+ if (size >= 0)
text = bulletSize(size) + text;
- }
user_text = -1;
// text is now defined and doesn't need to be recalculated
// unless font/character or text is modified