Skip to content

Commit

Permalink
Minor fixes to local toc logic after feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
Dimitri van Heesch committed Jul 23, 2018
1 parent 30f7d06 commit b6c724e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions src/marshal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -740,15 +740,15 @@ LocalToc unmarshalLocalToc(StorageIntf *s)
int htmlLevel = unmarshalInt(s);
int latexLevel = unmarshalInt(s);
int xmlLevel = unmarshalInt(s);
if ((mask & LocalToc::Html)!=0)
if ((mask & (1<<LocalToc::Html))!=0)
{
result.enableHtml(htmlLevel);
}
if ((mask & LocalToc::Latex)!=0)
if ((mask & (1<<LocalToc::Latex))!=0)
{
result.enableLatex(latexLevel);
}
if ((mask & LocalToc::Xml)!=0)
if ((mask & (1<<LocalToc::Xml))!=0)
{
result.enableXml(xmlLevel);
}
Expand Down
8 changes: 4 additions & 4 deletions src/types.h
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ class LocalToc
public:
enum Type {
None = 0, // initial value
Html = 0, // index / also to be used as (1 << Definition::Html)
Html = 0, // index / also to be used as bit position in mask (1 << Html)
Latex = 1, // ...
Xml = 2, // ...
numTocTypes = 3 // number of enum values
Expand All @@ -249,9 +249,9 @@ class LocalToc
}

// getters
bool isHtmlEnabled() const { return (m_mask & Html)!=0; }
bool isLatexEnabled() const { return (m_mask & Latex)!=0; }
bool isXmlEnabled() const { return (m_mask & Xml)!=0; }
bool isHtmlEnabled() const { return (m_mask & (1<<Html))!=0; }
bool isLatexEnabled() const { return (m_mask & (1<<Latex))!=0; }
bool isXmlEnabled() const { return (m_mask & (1<<Xml))!=0; }
bool nothingEnabled() const { return m_mask == None; }
int htmlLevel() const { return m_level[Html]; }
int latexLevel() const { return m_level[Latex]; }
Expand Down

0 comments on commit b6c724e

Please sign in to comment.