mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-06 00:10:59 +00:00
Use forceLTR instead of inset codes in order to determine whether an inset
should be surrounded by external \L{} in bidi text. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@21458 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
31617cf92a
commit
7bf4f48a4a
@ -723,14 +723,10 @@ void Paragraph::Private::latexInset(Buffer const & buf,
|
|||||||
bool close = false;
|
bool close = false;
|
||||||
odocstream::pos_type const len = os.tellp();
|
odocstream::pos_type const len = os.tellp();
|
||||||
|
|
||||||
if ((inset->lyxCode() == GRAPHICS_CODE
|
if (inset->forceLTR()
|
||||||
|| inset->lyxCode() == MATH_CODE
|
&& running_font.isRightToLeft()
|
||||||
|| inset->lyxCode() == HYPERLINK_CODE
|
// ERT is an exception, it should be output with no decorations at all
|
||||||
|| (inset->asInsetCollapsable()
|
&& inset->lyxCode() != ERT_CODE) {
|
||||||
&& inset->asInsetCollapsable()->forceLTR()
|
|
||||||
// ERT is an exception, since it doesn't go to output
|
|
||||||
&& inset->lyxCode() != ERT_CODE))
|
|
||||||
&& running_font.isRightToLeft()) {
|
|
||||||
if (running_font.language()->lang() == "farsi")
|
if (running_font.language()->lang() == "farsi")
|
||||||
os << "\\beginL{}";
|
os << "\\beginL{}";
|
||||||
else
|
else
|
||||||
|
@ -164,6 +164,8 @@ public:
|
|||||||
virtual bool isFreeSpacing() const { return false; }
|
virtual bool isFreeSpacing() const { return false; }
|
||||||
///
|
///
|
||||||
virtual bool allowEmpty() 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?
|
/// is this an inset that can be moved into?
|
||||||
/// FIXME: merge with editable()
|
/// FIXME: merge with editable()
|
||||||
|
@ -147,7 +147,7 @@ public:
|
|||||||
virtual bool isFreeSpacing() const { return layout_->freespacing; }
|
virtual bool isFreeSpacing() const { return layout_->freespacing; }
|
||||||
/// Don't eliminate empty paragraphs
|
/// Don't eliminate empty paragraphs
|
||||||
virtual bool allowEmpty() const { return layout_->keepempty; }
|
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; }
|
virtual bool forceLTR() const { return layout_->forceltr; }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
@ -82,6 +82,8 @@ public:
|
|||||||
void registerEmbeddedFiles(Buffer const &, EmbeddedFiles &) const;
|
void registerEmbeddedFiles(Buffer const &, EmbeddedFiles &) const;
|
||||||
///
|
///
|
||||||
void updateEmbeddedFile(Buffer const &, EmbeddedFile const &);
|
void updateEmbeddedFile(Buffer const &, EmbeddedFile const &);
|
||||||
|
/// Force inset into LTR environment if surroundings are RTL?
|
||||||
|
virtual bool forceLTR() const { return true; }
|
||||||
protected:
|
protected:
|
||||||
InsetGraphics(InsetGraphics const &);
|
InsetGraphics(InsetGraphics const &);
|
||||||
///
|
///
|
||||||
|
@ -56,6 +56,8 @@ public:
|
|||||||
///
|
///
|
||||||
static bool isCompatibleCommand(std::string const & s)
|
static bool isCompatibleCommand(std::string const & s)
|
||||||
{ return s == "href"; }
|
{ return s == "href"; }
|
||||||
|
/// Force inset into LTR environment if surroundings are RTL?
|
||||||
|
virtual bool forceLTR() const { return true; }
|
||||||
private:
|
private:
|
||||||
virtual Inset * clone() const {
|
virtual Inset * clone() const {
|
||||||
return new InsetHyperlink(params());
|
return new InsetHyperlink(params());
|
||||||
|
@ -121,6 +121,9 @@ public:
|
|||||||
///
|
///
|
||||||
static int displayMargin() { return 12; }
|
static int displayMargin() { return 12; }
|
||||||
|
|
||||||
|
/// Force inset into LTR environment if surroundings are RTL?
|
||||||
|
virtual bool forceLTR() const { return true; }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
InsetMathHull(InsetMathHull const &);
|
InsetMathHull(InsetMathHull const &);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user