#include "insets/InsetBibitem.h"
#include "insets/InsetLabel.h"
-// needed only for inTableCell()
-#include "insets/InsetText.h"
#include "support/convert.h"
#include "support/debug.h"
bool Paragraph::forceEmptyLayout() const
{
Inset const * const inset = inInset();
- return inset && inInset()->forceEmptyLayout();
+ if (!inset)
+ return true;
+ return inset->forceEmptyLayout();
}
bool Paragraph::allowParagraphCustomization() const
{
- return inInset() && inInset()->allowParagraphCustomization(0);
-}
-
-
-namespace {
- // This is a hack based upon one in InsetText::neverIndent().
- // When we have a real InsetTableCell, then we won't need this
- // method, because InsetTableCell will return the right values,
- // viz: InsetTableCell::useEmptyLayout() should return true, but
- // InsetTableCell::forceEmptyLayout() should still return false.
- //
- // The #include "insets/InsetText.h" can also be removed then.
- bool inTableCell(Inset const * inset)
- {
- InsetText const * txt = inset->asInsetText();
- if (!txt)
- return false;
- return txt->isTableCell();
- }
+ Inset const * const inset = inInset();
+ if (!inset)
+ return true;
+ return inset->allowParagraphCustomization();
}
bool Paragraph::useEmptyLayout() const
{
Inset const * const inset = inInset();
- return inset &&
- (inTableCell(inset) || inInset()->useEmptyLayout());
+ if (!inset)
+ return false;
+ return inset->useEmptyLayout();
}
char_type Paragraph::transformChar(char_type c, pos_type pos) const
{
- if (!Encodings::is_arabic(c))
+ if (!Encodings::isArabicChar(c))
return c;
char_type prev_char = ' ';
for (pos_type i = pos - 1; i >= 0; --i) {
char_type const par_char = d->text_[i];
- if (!Encodings::isComposeChar_arabic(par_char)) {
+ if (!Encodings::isArabicComposeChar(par_char)) {
prev_char = par_char;
break;
}
for (pos_type i = pos + 1, end = size(); i < end; ++i) {
char_type const par_char = d->text_[i];
- if (!Encodings::isComposeChar_arabic(par_char)) {
+ if (!Encodings::isArabicComposeChar(par_char)) {
next_char = par_char;
break;
}
}
- if (Encodings::is_arabic(next_char)) {
- if (Encodings::is_arabic(prev_char) &&
- !Encodings::is_arabic_special(prev_char))
+ if (Encodings::isArabicChar(next_char)) {
+ if (Encodings::isArabicChar(prev_char) &&
+ !Encodings::isArabicSpecialChar(prev_char))
return Encodings::transformChar(c, Encodings::FORM_MEDIAL);
else
return Encodings::transformChar(c, Encodings::FORM_INITIAL);
} else {
- if (Encodings::is_arabic(prev_char) &&
- !Encodings::is_arabic_special(prev_char))
+ if (Encodings::isArabicChar(prev_char) &&
+ !Encodings::isArabicSpecialChar(prev_char))
return Encodings::transformChar(c, Encodings::FORM_FINAL);
else
return Encodings::transformChar(c, Encodings::FORM_ISOLATED);