From 562d55989ad93b2886ae437bf45eb0e7cf796891 Mon Sep 17 00:00:00 2001 From: Abdelrazak Younes Date: Sun, 15 Oct 2006 22:32:56 +0000 Subject: [PATCH] MacOSX compile fix: The class Point conflicted with a struct defined in MacTypes.h. * coordcache.[Ch]: put everything in the LyX namespace. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15340 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/BufferView.C | 2 ++ src/BufferView.h | 6 +++--- src/bufferview_funcs.C | 3 +++ src/bufferview_funcs.h | 7 +++++-- src/coordcache.C | 4 ++++ src/coordcache.h | 4 ++++ src/cursor.C | 2 ++ src/cursor.h | 1 - src/insets/insettabular.C | 1 + src/mathed/InsetMathNest.C | 3 +++ src/rowpainter.C | 3 ++- src/text2.C | 1 + 12 files changed, 30 insertions(+), 7 deletions(-) diff --git a/src/BufferView.C b/src/BufferView.C index b566000067..e5e1678da8 100644 --- a/src/BufferView.C +++ b/src/BufferView.C @@ -78,8 +78,10 @@ #include +using lyx::CoordCache; using lyx::docstring; using lyx::pos_type; +using lyx::Point; using lyx::support::addPath; using lyx::support::bformat; diff --git a/src/BufferView.h b/src/BufferView.h index 53fcf3a696..c0761ff009 100644 --- a/src/BufferView.h +++ b/src/BufferView.h @@ -201,11 +201,11 @@ public: void updateMetrics(bool singlepar = false); /// - CoordCache & coordCache() { + lyx::CoordCache & coordCache() { return coord_cache_; } /// - CoordCache const & coordCache() const { + lyx::CoordCache const & coordCache() const { return coord_cache_; } /// get this view's keyboard map handler @@ -247,7 +247,7 @@ private: /// ViewMetricsInfo metrics_info_; - CoordCache coord_cache_; + lyx::CoordCache coord_cache_; /// Buffer * buffer_; diff --git a/src/bufferview_funcs.C b/src/bufferview_funcs.C index b5cdfd0d48..1f0ff23106 100644 --- a/src/bufferview_funcs.C +++ b/src/bufferview_funcs.C @@ -40,6 +40,9 @@ #include +using lyx::Point; +using lyx::CoordCache; + using lyx::support::bformat; using std::istringstream; diff --git a/src/bufferview_funcs.h b/src/bufferview_funcs.h index aaa2400af1..66931166c4 100644 --- a/src/bufferview_funcs.h +++ b/src/bufferview_funcs.h @@ -21,7 +21,10 @@ class BufferView; class DocIterator; class InsetBase_code; class LyXFont; + +namespace lyx { class Point; +} namespace bv_funcs { @@ -37,7 +40,7 @@ bool string2font(std::string const & data, LyXFont & font, bool & toggle); */ std::string const freefont2string(); -Point getPos(BufferView & bv, DocIterator const & dit, bool boundary); +lyx::Point getPos(BufferView & bv, DocIterator const & dit, bool boundary); enum CurStatus { CUR_INSIDE, @@ -49,7 +52,7 @@ enum CurStatus { CurStatus status(BufferView const * bv, DocIterator const & dit); -Point coordOffset(DocIterator const & dit, bool boundary); +lyx::Point coordOffset(DocIterator const & dit, bool boundary); /// Moves cursor to the next inset with one of the given codes. void gotoInset(BufferView * bv, std::vector const & codes, diff --git a/src/coordcache.C b/src/coordcache.C index 262aaa7d8a..f3647189fb 100644 --- a/src/coordcache.C +++ b/src/coordcache.C @@ -19,6 +19,8 @@ #include +namespace lyx { + // just a helper to be able to set a breakpoint void lyxbreaker(void const * data, const char * hint, int size) { @@ -46,3 +48,5 @@ Point CoordCache::get(LyXText const * text, lyx::pit_type pit) BOOST_ASSERT(posit != it->second.end()); return posit->second; } + +} // namespace lyx diff --git a/src/coordcache.h b/src/coordcache.h index 70ec9c1f0b..851ce4f378 100644 --- a/src/coordcache.h +++ b/src/coordcache.h @@ -25,6 +25,8 @@ class Paragraph; #include +namespace lyx { + void lyxbreaker(void const * data, const char * hint, int size); class Point { @@ -153,4 +155,6 @@ private: SliceCache slices1_; }; +} // namespace lyx + #endif diff --git a/src/cursor.C b/src/cursor.C index 6920dd6e5d..cae408cdaf 100644 --- a/src/cursor.C +++ b/src/cursor.C @@ -51,8 +51,10 @@ #include using lyx::char_type; +using lyx::CoordCache; using lyx::docstring; using lyx::pit_type; +using lyx::Point; using std::string; using std::vector; diff --git a/src/cursor.h b/src/cursor.h index e934700244..19da827ab6 100644 --- a/src/cursor.h +++ b/src/cursor.h @@ -22,7 +22,6 @@ class Buffer; class BufferView; class FuncStatus; class FuncRequest; -class Point; class LyXFont; // these should go diff --git a/src/insets/insettabular.C b/src/insets/insettabular.C index 61a327774f..0ac3d57731 100644 --- a/src/insets/insettabular.C +++ b/src/insets/insettabular.C @@ -47,6 +47,7 @@ #include using lyx::docstring; +using lyx::Point; using lyx::cap::dirtyTabularStack; using lyx::cap::tabularStackDirty; diff --git a/src/mathed/InsetMathNest.C b/src/mathed/InsetMathNest.C index 25569afe88..3ccd2e1a37 100644 --- a/src/mathed/InsetMathNest.C +++ b/src/mathed/InsetMathNest.C @@ -60,7 +60,10 @@ #include +using lyx::CoordCache; using lyx::docstring; +using lyx::Point; + using lyx::cap::copySelection; using lyx::cap::grabAndEraseSelection; using lyx::cap::cutSelection; diff --git a/src/rowpainter.C b/src/rowpainter.C index 8b7a8e2b9f..102c154a20 100644 --- a/src/rowpainter.C +++ b/src/rowpainter.C @@ -48,8 +48,9 @@ using lyx::frontend::NullPainter; using lyx::frontend::FontMetrics; using lyx::char_type; -using lyx::pos_type; using lyx::pit_type; +using lyx::pos_type; +using lyx::Point; using std::endl; using std::max; diff --git a/src/text2.C b/src/text2.C index bc8257fc0a..c916e07a61 100644 --- a/src/text2.C +++ b/src/text2.C @@ -62,6 +62,7 @@ #include +using lyx::CoordCache; using lyx::docstring; using lyx::pit_type; using lyx::pos_type;