This is the CSS:
.tableDUTY {
margin-bottom: 2mm;
}
.cellDutyLabel {
border-right-style: none;
}
.textDutyLabel {
font-size: 10pt;
font-weight: normal;
}
.cellDutyName {
font-size: 10pt;
font-weight: normal;
}
.cellDutyHeading {
padding-left: 1mm;
}
.textDutyHeading {
padding: 1mm;
color: #fff;
background-color: #FD00FF;
width: 90mm;
font-size: 12pt;
font-weight: 700;
text-transform: uppercase;
vertical-align: middle;
}
I know that I can rework all the text and do something like:
m_strCSS.Empty();
m_strCSS += L".tableDUTY {\r\n";
m_strCSS += L"\tmargin-bottom: 2mm;\r\n";
m_strCSS += L"}\r\n";
// etc.
But is there no way that I can just paste my CSS as-is into my CPP file and assign to the CString
variable? I don't mind going through a more modern string type, like std::string
, as long as I end up with a CString
.
Ultimately, the CString
is mapped to a CEdit
control, so that it displays the multiline CSS text.
I also know I could use a lambda, like:
m_strCSS.Empty();
auto AddLine = [this](CString strLine)
{
m_strCSS += strLine + L"\r\n";
};
AddLine(L".tableDUTY {");
AddLine(L"\tmargin-bottom: 2mm;");
AddLine(L"}");
But anything to take the whole block of CSS in one go?