bool close = false;
odocstream::pos_type const len = os.tellp();
- if ((inset->lyxCode() == GRAPHICS_CODE
- || inset->lyxCode() == MATH_CODE
- || inset->lyxCode() == HYPERLINK_CODE
- || (inset->asInsetCollapsable()
- && inset->asInsetCollapsable()->forceLTR()
- // ERT is an exception, since it doesn't go to output
- && inset->lyxCode() != ERT_CODE))
- && running_font.isRightToLeft()) {
+ if (inset->forceLTR()
+ && running_font.isRightToLeft()
+ // ERT is an exception, it should be output with no decorations at all
+ && inset->lyxCode() != ERT_CODE) {
if (running_font.language()->lang() == "farsi")
os << "\\beginL{}";
else
virtual bool isFreeSpacing() const { return false; }
///
virtual bool allowEmpty() const { return false; }
+ /// Force inset into LTR environment if surroundings are RTL?
+ virtual bool forceLTR() const { return false; }
/// is this an inset that can be moved into?
/// FIXME: merge with editable()
virtual bool isFreeSpacing() const { return layout_->freespacing; }
/// Don't eliminate empty paragraphs
virtual bool allowEmpty() const { return layout_->keepempty; }
- /// Force inset into LTR environment if surroundings are RTL
+ /// Force inset into LTR environment if surroundings are RTL?
virtual bool forceLTR() const { return layout_->forceltr; }
protected:
void registerEmbeddedFiles(Buffer const &, EmbeddedFiles &) const;
///
void updateEmbeddedFile(Buffer const &, EmbeddedFile const &);
+ /// Force inset into LTR environment if surroundings are RTL?
+ virtual bool forceLTR() const { return true; }
protected:
InsetGraphics(InsetGraphics const &);
///
///
static bool isCompatibleCommand(std::string const & s)
{ return s == "href"; }
+ /// Force inset into LTR environment if surroundings are RTL?
+ virtual bool forceLTR() const { return true; }
private:
virtual Inset * clone() const {
return new InsetHyperlink(params());
///
static int displayMargin() { return 12; }
+
+ /// Force inset into LTR environment if surroundings are RTL?
+ virtual bool forceLTR() const { return true; }
protected:
InsetMathHull(InsetMathHull const &);