X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2FCounters.h;h=509733f4662f8c3f6fa087ffffcaddbcc3e132e0;hb=a0b84e0ba0f8f23155f51b8647f3f6feed972c0c;hp=3384e564c694a4b688e5cc56295d39dd6fef454d;hpb=f1b8f4d059556cb73c60d84dd5002d76b2bcfefa;p=lyx.git diff --git a/src/Counters.h b/src/Counters.h index 3384e564c6..509733f466 100644 --- a/src/Counters.h +++ b/src/Counters.h @@ -57,6 +57,10 @@ public: * want the version shown in an appendix. */ docstring const & labelString(bool in_appendix) const; + /// Similar, but used for formatted references in XHTML output. + /// E.g., for a section counter it might be "section \thesection" + docstring const & prettyFormat() const { return prettyformat_; } + /// Returns a map of LaTeX-like strings to format the counter. /** For each language, the string is similar to what one gets * in LaTeX when using "\the". The \c in_appendix @@ -79,6 +83,8 @@ private: docstring labelstring_; /// The same as labelstring_, but in appendices. docstring labelstringappendix_; + /// Similar, but used for formatted references in XHTML output + docstring prettyformat_; /// Cache of the labelstring with \\the expressions expanded, /// indexed by language mutable StringMap flatlabelstring_; @@ -138,6 +144,10 @@ public: */ docstring counterLabel(docstring const & format, std::string const & lang) const; + /// returns a formatted version of the counter, using the + /// format given by Counter::prettyFormat(). + docstring prettyCounter(docstring const & cntr, + std::string const & lang) const; /// Are we in appendix? bool appendix() const { return appendix_; } /// Set the state variable indicating whether we are in appendix. @@ -157,10 +167,10 @@ public: /// We're trying to track \refstepcounter in LaTeX, more or less. /// Note that this may be empty. docstring currentCounter() const; - /// Called during update labels as we go through various paragraphs, + /// Called during updateBuffer() as we go through various paragraphs, /// to track the layouts as we go through. void setActiveLayout(Layout const & lay); - /// Also for updateLabels(). + /// Also for updateBuffer(). /// Call this when entering things like footnotes, where there is now /// no "last layout" and we want to restore the "last layout" on exit. void clearLastLayout() { layout_stack_.push_back(0); }