diff --git a/src/LyXFunc.cpp b/src/LyXFunc.cpp index 7ef1eaf6c5..c0c3eb0b15 100644 --- a/src/LyXFunc.cpp +++ b/src/LyXFunc.cpp @@ -1410,7 +1410,7 @@ void LyXFunc::dispatch(FuncRequest const & cmd) if (argument.empty() || !lyx_view_->buffer()) break; //view()->cursor().recordUndoFullDocument(); let inset-apply do that job - InsetGraphics::unifyGraphicsGroups(*lyx_view_->buffer(), argument); + graphics::unifyGraphicsGroups(*lyx_view_->buffer(), argument); lyx_view_->buffer()->markDirty(); updateFlags = Update::Force | Update::FitCursor; break; diff --git a/src/Text3.cpp b/src/Text3.cpp index 17b8d474db..e787e08d07 100644 --- a/src/Text3.cpp +++ b/src/Text3.cpp @@ -893,14 +893,14 @@ void Text::dispatch(Cursor & cur, FuncRequest & cmd) } case LFUN_SET_GRAPHICS_GROUP: { - InsetGraphics * ins = InsetGraphics::getCurrentGraphicsInset(cur); + InsetGraphics * ins = graphics::getCurrentGraphicsInset(cur); if (!ins) break; cur.recordUndoFullDocument(); string id = to_utf8(cmd.argument()); - string grp = InsetGraphics::getGroupParams(bv->buffer(), id); + string grp = graphics::getGroupParams(bv->buffer(), id); InsetGraphicsParams tmp, inspar = ins->getParams(); if (id.empty()) @@ -2183,7 +2183,7 @@ bool Text::getStatus(Cursor & cur, FuncRequest const & cmd, break; case LFUN_SET_GRAPHICS_GROUP: { - InsetGraphics * ins = InsetGraphics::getCurrentGraphicsInset(cur); + InsetGraphics * ins = graphics::getCurrentGraphicsInset(cur); if (!ins) enable = false; else diff --git a/src/frontends/qt4/Menus.cpp b/src/frontends/qt4/Menus.cpp index f72582dc41..928559999f 100644 --- a/src/frontends/qt4/Menus.cpp +++ b/src/frontends/qt4/Menus.cpp @@ -640,7 +640,7 @@ void MenuDefinition::expandGraphicsGroups(BufferView const * bv) if (!bv) return; set grp; - InsetGraphics::getGraphicsGroups(bv->buffer(), grp); + graphics::getGraphicsGroups(bv->buffer(), grp); if (grp.empty()) return; diff --git a/src/insets/InsetGraphics.cpp b/src/insets/InsetGraphics.cpp index d2ac809aa5..640124a860 100644 --- a/src/insets/InsetGraphics.cpp +++ b/src/insets/InsetGraphics.cpp @@ -949,8 +949,9 @@ string InsetGraphics::params2string(InsetGraphicsParams const & params, return data.str(); } +namespace graphics { -void InsetGraphics::getGraphicsGroups(Buffer const & b, std::set & ids) +void getGraphicsGroups(Buffer const & b, std::set & ids) { Inset & inset = b.inset(); InsetIterator it = inset_iterator_begin(inset); @@ -965,7 +966,7 @@ void InsetGraphics::getGraphicsGroups(Buffer const & b, std::set & ids) } -string InsetGraphics::getGroupParams(Buffer const & b, std::string const & groupId) +string getGroupParams(Buffer const & b, std::string const & groupId) { if (groupId.empty()) return string(); @@ -979,14 +980,14 @@ string InsetGraphics::getGroupParams(Buffer const & b, std::string const & group if (inspar.groupId == groupId) { InsetGraphicsParams tmp = inspar; tmp.filename.erase(); - return params2string(tmp, b); + return InsetGraphics::params2string(tmp, b); } } return string(); } -void InsetGraphics::unifyGraphicsGroups(Buffer const & b, std::string const & argument) +void unifyGraphicsGroups(Buffer const & b, std::string const & argument) { InsetGraphicsParams params; InsetGraphics::string2params(argument, b, params); @@ -1008,7 +1009,7 @@ void InsetGraphics::unifyGraphicsGroups(Buffer const & b, std::string const & ar } -InsetGraphics * InsetGraphics::getCurrentGraphicsInset(Cursor const & cur) +InsetGraphics * getCurrentGraphicsInset(Cursor const & cur) { Inset * instmp = &cur.inset(); if (instmp->lyxCode() != GRAPHICS_CODE) @@ -1019,4 +1020,6 @@ InsetGraphics * InsetGraphics::getCurrentGraphicsInset(Cursor const & cur) return static_cast(instmp); } +} // namespace graphics + } // namespace lyx diff --git a/src/insets/InsetGraphics.h b/src/insets/InsetGraphics.h index bfb4784aed..d2ab83f32b 100644 --- a/src/insets/InsetGraphics.h +++ b/src/insets/InsetGraphics.h @@ -48,16 +48,6 @@ public: /// static std::string params2string(InsetGraphicsParams const &, Buffer const &); - /// Saves the list of currently used groups in the document. - static void getGraphicsGroups(Buffer const &, std::set &); - /// Returns parameters of a given graphics group (except filename). - static std::string getGroupParams(Buffer const &, - std::string const &); - /** Synchronize all Graphics insets of the group. - Both groupId and params are taken from argument. - */ - static void unifyGraphicsGroups(Buffer const &, std::string const &); - static InsetGraphics * getCurrentGraphicsInset(Cursor const &); /** Set the inset parameters, used by the GUIndependent dialog. Return true of new params are different from what was so far. @@ -133,6 +123,22 @@ private: boost::scoped_ptr const graphic_; }; +namespace graphics { + + /// Saves the list of currently used groups in the document. + void getGraphicsGroups(Buffer const &, std::set &); + + /// Returns parameters of a given graphics group (except filename). + std::string getGroupParams(Buffer const &, std::string const &); + + /** Synchronize all Graphics insets of the group. + Both groupId and params are taken from argument. + */ + void unifyGraphicsGroups(Buffer const &, std::string const &); + InsetGraphics * getCurrentGraphicsInset(Cursor const &); + +} + } // namespace lyx #endif // INSET_GRAPHICS_H