~bibledit/bibledit/ubuntu-cloud-beta

« back to all changes in this revision

Viewing changes to styles/css.cpp

  • Committer: Teus Benschop
  • Date: 2022-10-14 16:03:26 UTC
  • Revision ID: teusjannette@gmail.com-20221014160326-42ybrpft4bblpruk
new upstream version

Show diffs side-by-side

added added

removed removed

Lines of Context:
29
29
#include <quill/logic.h>
30
30
 
31
31
 
32
 
Styles_Css::Styles_Css (void * webserver_request, string stylesheet)
 
32
Styles_Css::Styles_Css (void * webserver_request, const string & stylesheet)
33
33
{
34
34
  m_webserver_request = webserver_request;
35
35
  m_stylesheet = stylesheet;
156
156
      }
157
157
      break;
158
158
    }
 
159
    case StyleTypePicture:
 
160
    {
 
161
      add (style, true, false);
 
162
      break;
 
163
    }
159
164
    default: break;
160
165
  }
161
166
}
169
174
{
170
175
  Database_Styles_Item * style = static_cast<Database_Styles_Item *> (database_styles_item);
171
176
 
172
 
  string class_ = style->marker;
 
177
  string class_ {style->marker};
173
178
 
174
179
  // The name of the class as used in a Quill-based editor.
175
 
  string quill_class = ", .";
 
180
  string quill_class {", ."};
176
181
  if (paragraph) {
177
182
    quill_class.append (quill_logic_class_prefix_block ());
178
183
  } else {
186
191
  // Font size.
187
192
  // Since it is html and not pdf for paper, a font size of 12pt is considered to be equal to 100%.
188
193
  if (paragraph) {
189
 
    float points = style->fontsize;
190
 
    float percents = points * 100 / 12;
 
194
    float points {style->fontsize};
 
195
    float percents {points * 100 / 12};
191
196
    int fontsize = convert_to_int (percents);
192
197
    if (fontsize != 100) {
193
198
      m_code.push_back ("font-size: " + convert_to_string (fontsize) + "%;");