0
0
mirror of https://github.com/fralx/LimeReport.git synced 2025-09-30 19:19:56 +03:00

allowHTMLInFields property has been added

This commit is contained in:
Arin Alexander
2016-04-13 13:38:07 +03:00
parent 166b18be49
commit 166a0ac688
2 changed files with 24 additions and 3 deletions

View File

@@ -55,7 +55,9 @@ bool registred = LimeReport::DesignElementsFactory::instance().registerCreator(x
namespace LimeReport{
TextItem::TextItem(QObject *owner, QGraphicsItem *parent)
: ContentItemDesignIntf(xmlTag,owner,parent), m_angle(Angle0), m_trimValue(true), m_allowHTML(false){
: ContentItemDesignIntf(xmlTag,owner,parent), m_angle(Angle0), m_trimValue(true), m_allowHTML(false),
m_allowHTMLInFields(false)
{
m_text = new QTextDocument();
Init();
}
@@ -280,6 +282,20 @@ void TextItem::initText()
m_textSize=m_text->size();
}
bool TextItem::allowHTMLInFields() const
{
return m_allowHTMLInFields;
}
void TextItem::setAllowHTMLInFields(bool allowHTMLInFields)
{
if (m_allowHTMLInFields != allowHTMLInFields){
m_allowHTMLInFields = allowHTMLInFields;
notify("allowHTMLInFields",!m_allowHTMLInFields,allowHTMLInFields);
update();
}
}
bool TextItem::allowHTML() const
{
return m_allowHTML;
@@ -347,7 +363,7 @@ void TextItem::setAlignment(Qt::Alignment value)
void TextItem::expandContent(DataSourceManager* dataManager, RenderPass pass)
{
QString context=content();
ExpandType expandType = allowHTML()?ReplaceHTMLSymbols:NoEscapeSymbols;
ExpandType expandType = (allowHTML() && !allowHTMLInFields())?ReplaceHTMLSymbols:NoEscapeSymbols;
switch(pass){
case FirstPass:
context=expandUserVariables(context, pass, expandType, dataManager);