mirror of
https://github.com/python-LimeReport/LimeReport.git
synced 2024-12-25 13:04:38 +03:00
Merge pull request #70 from asmaloney/fix-shadows
Fixes some shadowed vars & avoids string copies using const refs
This commit is contained in:
commit
a5231058ec
@ -390,8 +390,8 @@ void HorizontalLayout::slotOnChildDestroy(QObject* child)
|
|||||||
BaseDesignIntf* HorizontalLayout::findNext(BaseDesignIntf* item){
|
BaseDesignIntf* HorizontalLayout::findNext(BaseDesignIntf* item){
|
||||||
if (m_children.count()<childItems().size()-1){
|
if (m_children.count()<childItems().size()-1){
|
||||||
m_children.clear();
|
m_children.clear();
|
||||||
foreach (BaseDesignIntf* item, childBaseItems()) {
|
foreach (BaseDesignIntf* childItem, childBaseItems()) {
|
||||||
m_children.append(item);
|
m_children.append(childItem);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
qSort(m_children.begin(),m_children.end(),lessThen);
|
qSort(m_children.begin(),m_children.end(),lessThen);
|
||||||
@ -404,8 +404,8 @@ BaseDesignIntf* HorizontalLayout::findNext(BaseDesignIntf* item){
|
|||||||
BaseDesignIntf* HorizontalLayout::findPrior(BaseDesignIntf* item){
|
BaseDesignIntf* HorizontalLayout::findPrior(BaseDesignIntf* item){
|
||||||
if (m_children.count()<childItems().size()-1){
|
if (m_children.count()<childItems().size()-1){
|
||||||
m_children.clear();
|
m_children.clear();
|
||||||
foreach (BaseDesignIntf* item, childBaseItems()) {
|
foreach (BaseDesignIntf* childItem, childBaseItems()) {
|
||||||
m_children.append(item);
|
m_children.append(childItem);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
qSort(m_children.begin(),m_children.end(),lessThen);
|
qSort(m_children.begin(),m_children.end(),lessThen);
|
||||||
|
@ -63,7 +63,7 @@ QString HtmlContext::parseTag(QVector<Tag *> &storage, QString text, int &curPos
|
|||||||
tagName.remove('>');
|
tagName.remove('>');
|
||||||
|
|
||||||
while (buff.contains(rx)){
|
while (buff.contains(rx)){
|
||||||
int pos=rx.indexIn(buff);
|
pos=rx.indexIn(buff);
|
||||||
buff=buff.right(buff.length()-pos);
|
buff=buff.right(buff.length()-pos);
|
||||||
curPos+=pos;
|
curPos+=pos;
|
||||||
if (extractWord(rx.cap(0),1).compare(extractWord(tagName,1),Qt::CaseInsensitive)==0){
|
if (extractWord(rx.cap(0),1).compare(extractWord(tagName,1),Qt::CaseInsensitive)==0){
|
||||||
|
@ -124,8 +124,8 @@ void TextItemEditor::initUI()
|
|||||||
ui->twData->setModel(dm->datasourcesModel());
|
ui->twData->setModel(dm->datasourcesModel());
|
||||||
ui->twScriptEngine->setModel(se.model());
|
ui->twScriptEngine->setModel(se.model());
|
||||||
|
|
||||||
foreach(QString dsName,dm->dataSourceNames()){
|
foreach(const QString &dsName,dm->dataSourceNames()){
|
||||||
foreach(QString field, dm->fieldNames(dsName)){
|
foreach(const QString &field, dm->fieldNames(dsName)){
|
||||||
dataWords<<dsName+"."+field;
|
dataWords<<dsName+"."+field;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -704,7 +704,6 @@ int CallbackDatasource::columnCount(){
|
|||||||
int currIndex = 0;
|
int currIndex = 0;
|
||||||
do {
|
do {
|
||||||
QVariant columnName;
|
QVariant columnName;
|
||||||
CallbackInfo info;
|
|
||||||
info.dataType = CallbackInfo::ColumnHeaderData;
|
info.dataType = CallbackInfo::ColumnHeaderData;
|
||||||
info.index = currIndex;
|
info.index = currIndex;
|
||||||
emit getCallbackData(info,columnName);
|
emit getCallbackData(info,columnName);
|
||||||
|
@ -1729,8 +1729,8 @@ CommandIf::Ptr DeleteLayoutCommand::create(PageDesignIntf *page, LayoutDesignInt
|
|||||||
DeleteLayoutCommand* command = new DeleteLayoutCommand();
|
DeleteLayoutCommand* command = new DeleteLayoutCommand();
|
||||||
command->setPage(page);
|
command->setPage(page);
|
||||||
command->setItem(item);
|
command->setItem(item);
|
||||||
foreach (BaseDesignIntf* item, item->childBaseItems()){
|
foreach (BaseDesignIntf* childItem, item->childBaseItems()){
|
||||||
command->m_childItems.append(item->objectName());
|
command->m_childItems.append(childItem->objectName());
|
||||||
}
|
}
|
||||||
return CommandIf::Ptr(command);
|
return CommandIf::Ptr(command);
|
||||||
}
|
}
|
||||||
|
@ -335,7 +335,7 @@ void ReportRender::extractGroupsFunction(BandDesignIntf *band)
|
|||||||
foreach(BaseDesignIntf* item,band->childBaseItems()){
|
foreach(BaseDesignIntf* item,band->childBaseItems()){
|
||||||
ContentItemDesignIntf* contentItem = dynamic_cast<ContentItemDesignIntf*>(item);
|
ContentItemDesignIntf* contentItem = dynamic_cast<ContentItemDesignIntf*>(item);
|
||||||
if (contentItem&&(contentItem->content().contains(QRegExp("\\$S\\s*\\{.*\\}")))){
|
if (contentItem&&(contentItem->content().contains(QRegExp("\\$S\\s*\\{.*\\}")))){
|
||||||
foreach(QString functionName, m_datasources->groupFunctionNames()){
|
foreach(const QString &functionName, m_datasources->groupFunctionNames()){
|
||||||
QRegExp rx(QString(Const::GROUP_FUNCTION_RX).arg(functionName));
|
QRegExp rx(QString(Const::GROUP_FUNCTION_RX).arg(functionName));
|
||||||
QRegExp rxName(QString(Const::GROUP_FUNCTION_NAME_RX).arg(functionName));
|
QRegExp rxName(QString(Const::GROUP_FUNCTION_NAME_RX).arg(functionName));
|
||||||
if (rx.indexIn(contentItem->content())>=0){
|
if (rx.indexIn(contentItem->content())>=0){
|
||||||
@ -373,7 +373,7 @@ void ReportRender::replaceGroupsFunction(BandDesignIntf *band)
|
|||||||
ContentItemDesignIntf* contentItem = dynamic_cast<ContentItemDesignIntf*>(item);
|
ContentItemDesignIntf* contentItem = dynamic_cast<ContentItemDesignIntf*>(item);
|
||||||
if (contentItem){
|
if (contentItem){
|
||||||
QString content = contentItem->content();
|
QString content = contentItem->content();
|
||||||
foreach(QString functionName, m_datasources->groupFunctionNames()){
|
foreach(const QString &functionName, m_datasources->groupFunctionNames()){
|
||||||
QRegExp rx(QString(Const::GROUP_FUNCTION_RX).arg(functionName));
|
QRegExp rx(QString(Const::GROUP_FUNCTION_RX).arg(functionName));
|
||||||
if (rx.indexIn(content)>=0){
|
if (rx.indexIn(content)>=0){
|
||||||
int pos = 0;
|
int pos = 0;
|
||||||
|
@ -106,7 +106,6 @@ bool XMLReader::readItem(QObject *item)
|
|||||||
|
|
||||||
void XMLReader::readItemFromNode(QObject* item,QDomElement *node)
|
void XMLReader::readItemFromNode(QObject* item,QDomElement *node)
|
||||||
{
|
{
|
||||||
|
|
||||||
ObjectLoadingStateIntf* lf = dynamic_cast<ObjectLoadingStateIntf*>(item);
|
ObjectLoadingStateIntf* lf = dynamic_cast<ObjectLoadingStateIntf*>(item);
|
||||||
if(lf) lf->objectLoadStarted();
|
if(lf) lf->objectLoadStarted();
|
||||||
for (int i=0;i<node->childNodes().count();i++){
|
for (int i=0;i<node->childNodes().count();i++){
|
||||||
@ -123,8 +122,8 @@ void XMLReader::readItemFromNode(QObject* item,QDomElement *node)
|
|||||||
|
|
||||||
BaseDesignIntf* baseObj = dynamic_cast<BaseDesignIntf*>(item);
|
BaseDesignIntf* baseObj = dynamic_cast<BaseDesignIntf*>(item);
|
||||||
if(baseObj) {
|
if(baseObj) {
|
||||||
foreach(QGraphicsItem* item,baseObj->childItems()){
|
foreach(QGraphicsItem* childItem,baseObj->childItems()){
|
||||||
BaseDesignIntf* baseItem = dynamic_cast<BaseDesignIntf*>(item);
|
BaseDesignIntf* baseItem = dynamic_cast<BaseDesignIntf*>(childItem);
|
||||||
if (baseItem) baseItem->parentObjectLoadFinished();
|
if (baseItem) baseItem->parentObjectLoadFinished();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user