From 8e831bb602cd6c16348860554b9355bc59c67b43 Mon Sep 17 00:00:00 2001 From: Abdelrazak Younes Date: Mon, 11 Feb 2008 08:20:13 +0000 Subject: [PATCH] modify Inset::EntryDirectionType to follow style used in FontEnums.h for enums. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22936 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/Text2.cpp | 2 +- src/insets/Inset.cpp | 2 +- src/insets/Inset.h | 10 +++++----- src/insets/InsetCaption.cpp | 2 +- src/insets/InsetCaption.h | 2 +- src/insets/InsetCollapsable.cpp | 2 +- src/insets/InsetCollapsable.h | 2 +- src/insets/InsetCommand.cpp | 2 +- src/insets/InsetCommand.h | 2 +- src/insets/InsetExternal.cpp | 2 +- src/insets/InsetExternal.h | 2 +- src/insets/InsetGraphics.cpp | 2 +- src/insets/InsetGraphics.h | 2 +- src/insets/InsetTabular.cpp | 4 ++-- src/insets/InsetTabular.h | 2 +- src/insets/InsetText.cpp | 6 +++--- src/insets/InsetText.h | 2 +- src/mathed/InsetMathHull.cpp | 6 +++--- src/mathed/InsetMathHull.h | 2 +- src/mathed/InsetMathNest.cpp | 6 +++--- src/mathed/InsetMathNest.h | 2 +- src/mathed/MathMacro.cpp | 2 +- src/mathed/MathMacro.h | 2 +- src/mathed/MathMacroTemplate.cpp | 2 +- src/mathed/MathMacroTemplate.h | 2 +- 25 files changed, 36 insertions(+), 36 deletions(-) diff --git a/src/Text2.cpp b/src/Text2.cpp index d18a993132..206205ff8b 100644 --- a/src/Text2.cpp +++ b/src/Text2.cpp @@ -608,7 +608,7 @@ bool Text::checkAndActivateInsetVisual(Cursor & cur, bool movingForward, bool mo if (!inset || inset->editable() != Inset::HIGHLY_EDITABLE) return false; inset->edit(cur, movingForward, - movingLeft ? Inset::ENTER_FROM_RIGHT : Inset::ENTER_FROM_LEFT); + movingLeft ? Inset::ENTRY_DIRECTION_RIGHT : Inset::ENTRY_DIRECTION_LEFT); return true; } diff --git a/src/insets/Inset.cpp b/src/insets/Inset.cpp index 454cce474d..0cfb10cdd3 100644 --- a/src/insets/Inset.cpp +++ b/src/insets/Inset.cpp @@ -213,7 +213,7 @@ bool Inset::getStatus(Cursor &, FuncRequest const & cmd, } -void Inset::edit(Cursor &, bool, EntryDirectionType) +void Inset::edit(Cursor &, bool, EntryDirection) { LYXERR(Debug::INSETS, "edit left/right"); } diff --git a/src/insets/Inset.h b/src/insets/Inset.h index a87be006a0..4b03465e2e 100644 --- a/src/insets/Inset.h +++ b/src/insets/Inset.h @@ -66,10 +66,10 @@ namespace graphics { class PreviewLoader; } class Inset { public: /// - enum EntryDirectionType { - IGNORE_ENTRY_DIRECTION, - ENTER_FROM_RIGHT, - ENTER_FROM_LEFT, + enum EntryDirection { + ENTRY_DIRECTION_IGNORE, + ENTRY_DIRECTION_RIGHT, + ENTRY_DIRECTION_LEFT, }; /// typedef ptrdiff_t difference_type; @@ -126,7 +126,7 @@ public: /// cursor enters virtual void edit(Cursor & cur, bool front, - EntryDirectionType entry_from = IGNORE_ENTRY_DIRECTION); + EntryDirection entry_from = ENTRY_DIRECTION_IGNORE); /// cursor enters virtual Inset * editXY(Cursor & cur, int x, int y); diff --git a/src/insets/InsetCaption.cpp b/src/insets/InsetCaption.cpp index ecdc02bba1..5df5e27359 100644 --- a/src/insets/InsetCaption.cpp +++ b/src/insets/InsetCaption.cpp @@ -162,7 +162,7 @@ void InsetCaption::draw(PainterInfo & pi, int x, int y) const } -void InsetCaption::edit(Cursor & cur, bool front, EntryDirectionType entry_from) +void InsetCaption::edit(Cursor & cur, bool front, EntryDirection entry_from) { cur.push(*this); InsetText::edit(cur, front, entry_from); diff --git a/src/insets/InsetCaption.h b/src/insets/InsetCaption.h index fed32649e8..b2fbac5395 100644 --- a/src/insets/InsetCaption.h +++ b/src/insets/InsetCaption.h @@ -49,7 +49,7 @@ public: /// virtual void draw(PainterInfo & pi, int x, int y) const; /// - virtual void edit(Cursor & cur, bool front, EntryDirectionType entry_from); + virtual void edit(Cursor & cur, bool front, EntryDirection entry_from); /// virtual Inset * editXY(Cursor & cur, int x, int y); /// diff --git a/src/insets/InsetCollapsable.cpp b/src/insets/InsetCollapsable.cpp index 567d712f13..c4d16de4ec 100644 --- a/src/insets/InsetCollapsable.cpp +++ b/src/insets/InsetCollapsable.cpp @@ -466,7 +466,7 @@ docstring const InsetCollapsable::getNewLabel(docstring const & l) const } -void InsetCollapsable::edit(Cursor & cur, bool front, EntryDirectionType entry_from) +void InsetCollapsable::edit(Cursor & cur, bool front, EntryDirection entry_from) { //lyxerr << "InsetCollapsable: edit left/right" << endl; cur.push(*this); diff --git a/src/insets/InsetCollapsable.h b/src/insets/InsetCollapsable.h index cd53a9f491..26e29f7749 100644 --- a/src/insets/InsetCollapsable.h +++ b/src/insets/InsetCollapsable.h @@ -163,7 +163,7 @@ protected: virtual void doDispatch(Cursor & cur, FuncRequest & cmd); /// void edit(Cursor & cur, bool front, - EntryDirectionType entry_from = IGNORE_ENTRY_DIRECTION); + EntryDirection entry_from = ENTRY_DIRECTION_IGNORE); /// Inset * editXY(Cursor & cur, int x, int y); /// diff --git a/src/insets/InsetCommand.cpp b/src/insets/InsetCommand.cpp index 6593171920..6ade744ed9 100644 --- a/src/insets/InsetCommand.cpp +++ b/src/insets/InsetCommand.cpp @@ -160,7 +160,7 @@ bool InsetCommand::getStatus(Cursor & cur, FuncRequest const & cmd, } -void InsetCommand::edit(Cursor & cur, bool, EntryDirectionType) +void InsetCommand::edit(Cursor & cur, bool, EntryDirection) { if (!mailer_name_.empty()) InsetCommandMailer(mailer_name_, *this).showDialog(&cur.bv()); diff --git a/src/insets/InsetCommand.h b/src/insets/InsetCommand.h index c84e825dc2..7173417ec5 100644 --- a/src/insets/InsetCommand.h +++ b/src/insets/InsetCommand.h @@ -73,7 +73,7 @@ public: } /// void edit(Cursor & cur, bool front, - EntryDirectionType entry_from = IGNORE_ENTRY_DIRECTION); + EntryDirection entry_from = ENTRY_DIRECTION_IGNORE); /// RenderButton & button() const { return button_; } /// diff --git a/src/insets/InsetExternal.cpp b/src/insets/InsetExternal.cpp index db8c2c1e21..ffdc218360 100644 --- a/src/insets/InsetExternal.cpp +++ b/src/insets/InsetExternal.cpp @@ -516,7 +516,7 @@ void InsetExternal::updateEmbeddedFile(Buffer const & buf, } -void InsetExternal::edit(Cursor & cur, bool, EntryDirectionType) +void InsetExternal::edit(Cursor & cur, bool, EntryDirection) { InsetExternalMailer(*this).showDialog(&cur.bv()); } diff --git a/src/insets/InsetExternal.h b/src/insets/InsetExternal.h index 06ee643b42..d281a06519 100644 --- a/src/insets/InsetExternal.h +++ b/src/insets/InsetExternal.h @@ -145,7 +145,7 @@ public: /// void addPreview(graphics::PreviewLoader &) const; /// - void edit(Cursor & cur, bool front, EntryDirectionType entry_from); + void edit(Cursor & cur, bool front, EntryDirection entry_from); /// bool getStatus(Cursor &, FuncRequest const &, FuncStatus &) const; /// external file can be embedded diff --git a/src/insets/InsetGraphics.cpp b/src/insets/InsetGraphics.cpp index 151b76478b..f19dd90f1a 100644 --- a/src/insets/InsetGraphics.cpp +++ b/src/insets/InsetGraphics.cpp @@ -239,7 +239,7 @@ void InsetGraphics::updateEmbeddedFile(Buffer const & buf, } -void InsetGraphics::edit(Cursor & cur, bool, EntryDirectionType) +void InsetGraphics::edit(Cursor & cur, bool, EntryDirection) { InsetGraphicsMailer(*this).showDialog(&cur.bv()); } diff --git a/src/insets/InsetGraphics.h b/src/insets/InsetGraphics.h index b9c57ab1f5..4f216dccc6 100644 --- a/src/insets/InsetGraphics.h +++ b/src/insets/InsetGraphics.h @@ -73,7 +73,7 @@ public: /// void draw(PainterInfo & pi, int x, int y) const; /// - void edit(Cursor & cur, bool front, EntryDirectionType entry_from); + void edit(Cursor & cur, bool front, EntryDirection entry_from); /// void editGraphics(InsetGraphicsParams const &, Buffer const &) const; /// diff --git a/src/insets/InsetTabular.cpp b/src/insets/InsetTabular.cpp index 837c0c8cdf..0c8ef364e7 100644 --- a/src/insets/InsetTabular.cpp +++ b/src/insets/InsetTabular.cpp @@ -3151,13 +3151,13 @@ docstring const InsetTabular::editMessage() const } -void InsetTabular::edit(Cursor & cur, bool, EntryDirectionType direction) +void InsetTabular::edit(Cursor & cur, bool, EntryDirection direction) { //lyxerr << "InsetTabular::edit: " << this << endl; cur.finishUndo(); cur.selection() = false; cur.push(*this); - if (direction == ENTER_FROM_LEFT) { + if (direction == ENTRY_DIRECTION_LEFT) { if (isRightToLeft(cur)) cur.idx() = tabular.getLastCellInRow(0); else diff --git a/src/insets/InsetTabular.h b/src/insets/InsetTabular.h index c38fbc350b..677cf49e16 100644 --- a/src/insets/InsetTabular.h +++ b/src/insets/InsetTabular.h @@ -745,7 +745,7 @@ public: /// set the owning buffer void buffer(Buffer const * buf); /// lock cell with given index - void edit(Cursor & cur, bool front, EntryDirectionType entry_from); + void edit(Cursor & cur, bool front, EntryDirection entry_from); /// Inset * editXY(Cursor & cur, int x, int y); /// can we go further down on mouse click? diff --git a/src/insets/InsetText.cpp b/src/insets/InsetText.cpp index 6903ac04cc..3a8153a963 100644 --- a/src/insets/InsetText.cpp +++ b/src/insets/InsetText.cpp @@ -200,17 +200,17 @@ docstring const InsetText::editMessage() const } -void InsetText::edit(Cursor & cur, bool front, EntryDirectionType entry_from) +void InsetText::edit(Cursor & cur, bool front, EntryDirection entry_from) { pit_type const pit = front ? 0 : paragraphs().size() - 1; pos_type pos = front ? 0 : paragraphs().back().size(); // if visual information is not to be ignored, move to extreme right/left - if (entry_from != IGNORE_ENTRY_DIRECTION) { + if (entry_from != ENTRY_DIRECTION_IGNORE) { Cursor temp_cur = cur; temp_cur.pit() = pit; temp_cur.pos() = pos; - temp_cur.posVisToRowExtremity(entry_from == ENTER_FROM_LEFT); + temp_cur.posVisToRowExtremity(entry_from == ENTRY_DIRECTION_LEFT); pos = temp_cur.pos(); } diff --git a/src/insets/InsetText.h b/src/insets/InsetText.h index 9e7aa482e4..fcb776296d 100644 --- a/src/insets/InsetText.h +++ b/src/insets/InsetText.h @@ -113,7 +113,7 @@ public: void addPreview(graphics::PreviewLoader &) const; /// - void edit(Cursor & cur, bool front, EntryDirectionType entry_from); + void edit(Cursor & cur, bool front, EntryDirection entry_from); /// Inset * editXY(Cursor & cur, int x, int y); diff --git a/src/mathed/InsetMathHull.cpp b/src/mathed/InsetMathHull.cpp index c8bce467a1..976b4865cf 100644 --- a/src/mathed/InsetMathHull.cpp +++ b/src/mathed/InsetMathHull.cpp @@ -1314,11 +1314,11 @@ void InsetMathHull::handleFont2(Cursor & cur, docstring const & arg) } -void InsetMathHull::edit(Cursor & cur, bool front, EntryDirectionType entry_from) +void InsetMathHull::edit(Cursor & cur, bool front, EntryDirection entry_from) { cur.push(*this); - bool enter_front = (entry_from == Inset::ENTER_FROM_LEFT || - (entry_from == Inset::IGNORE_ENTRY_DIRECTION && front)); + bool enter_front = (entry_from == Inset::ENTRY_DIRECTION_LEFT || + (entry_from == Inset::ENTRY_DIRECTION_IGNORE && front)); enter_front ? idxFirst(cur) : idxLast(cur); // The inset formula dimension is not necessarily the same as the // one of the instant preview image, so we have to indicate to the diff --git a/src/mathed/InsetMathHull.h b/src/mathed/InsetMathHull.h index f00b6f12ac..7e67c6e52f 100644 --- a/src/mathed/InsetMathHull.h +++ b/src/mathed/InsetMathHull.h @@ -200,7 +200,7 @@ public: EDITABLE editable() const { return HIGHLY_EDITABLE; } /// void edit(Cursor & cur, bool front, - EntryDirectionType entry_from = IGNORE_ENTRY_DIRECTION); + EntryDirection entry_from = ENTRY_DIRECTION_IGNORE); /// Inset * editXY(Cursor & cur, int x, int y); /// diff --git a/src/mathed/InsetMathNest.cpp b/src/mathed/InsetMathNest.cpp index d8f6cd1dbb..d63f03f341 100644 --- a/src/mathed/InsetMathNest.cpp +++ b/src/mathed/InsetMathNest.cpp @@ -1208,11 +1208,11 @@ bool InsetMathNest::getStatus(Cursor & cur, FuncRequest const & cmd, } -void InsetMathNest::edit(Cursor & cur, bool front, EntryDirectionType entry_from) +void InsetMathNest::edit(Cursor & cur, bool front, EntryDirection entry_from) { cur.push(*this); - bool enter_front = (entry_from == Inset::ENTER_FROM_RIGHT || - (entry_from == Inset::IGNORE_ENTRY_DIRECTION && front)); + bool enter_front = (entry_from == Inset::ENTRY_DIRECTION_RIGHT || + (entry_from == Inset::ENTRY_DIRECTION_IGNORE && front)); cur.idx() = enter_front ? 0 : cur.lastidx(); cur.pos() = enter_front ? 0 : cur.lastpos(); cur.resetAnchor(); diff --git a/src/mathed/InsetMathNest.h b/src/mathed/InsetMathNest.h index a3419fa73f..0115864864 100644 --- a/src/mathed/InsetMathNest.h +++ b/src/mathed/InsetMathNest.h @@ -49,7 +49,7 @@ public: bool boundary, int & x, int & y) const; /// void edit(Cursor & cur, bool front, - EntryDirectionType entry_from = IGNORE_ENTRY_DIRECTION); + EntryDirection entry_from = ENTRY_DIRECTION_IGNORE); /// Inset * editXY(Cursor & cur, int x, int y); diff --git a/src/mathed/MathMacro.cpp b/src/mathed/MathMacro.cpp index b6dd19dac4..25902867ec 100644 --- a/src/mathed/MathMacro.cpp +++ b/src/mathed/MathMacro.cpp @@ -509,7 +509,7 @@ void MathMacro::validate(LaTeXFeatures & features) const } -void MathMacro::edit(Cursor & cur, bool front, EntryDirectionType entry_from) +void MathMacro::edit(Cursor & cur, bool front, EntryDirection entry_from) { cur.updateFlags(Update::Force); InsetMathNest::edit(cur, front, entry_from); diff --git a/src/mathed/MathMacro.h b/src/mathed/MathMacro.h index 897798115e..a4928f1cd5 100644 --- a/src/mathed/MathMacro.h +++ b/src/mathed/MathMacro.h @@ -46,7 +46,7 @@ public: void cursorPos(BufferView const & bv, CursorSlice const & sl, bool boundary, int & x, int & y) const; /// - void edit(Cursor & cur, bool front, EntryDirectionType entry_from); + void edit(Cursor & cur, bool front, EntryDirection entry_from); /// Inset * editXY(Cursor & cur, int x, int y); diff --git a/src/mathed/MathMacroTemplate.cpp b/src/mathed/MathMacroTemplate.cpp index dbd2918904..7afa717f39 100644 --- a/src/mathed/MathMacroTemplate.cpp +++ b/src/mathed/MathMacroTemplate.cpp @@ -533,7 +533,7 @@ void MathMacroTemplate::draw(PainterInfo & pi, int x, int y) const } -void MathMacroTemplate::edit(Cursor & cur, bool front, EntryDirectionType entry_from) +void MathMacroTemplate::edit(Cursor & cur, bool front, EntryDirection entry_from) { updateLook(); cur.updateFlags(Update::Force); diff --git a/src/mathed/MathMacroTemplate.h b/src/mathed/MathMacroTemplate.h index edf6cf6c0d..6f2fa1d3b7 100644 --- a/src/mathed/MathMacroTemplate.h +++ b/src/mathed/MathMacroTemplate.h @@ -38,7 +38,7 @@ public: /// EDITABLE editable() const { return HIGHLY_EDITABLE; } /// - void edit(Cursor & cur, bool front, EntryDirectionType entry_from); + void edit(Cursor & cur, bool front, EntryDirection entry_from); /// bool notifyCursorLeaves(Cursor & cur); /// -- 2.39.2