diff --git a/common.pri b/common.pri index 9242c6d..cd8a85a 100644 --- a/common.pri +++ b/common.pri @@ -134,7 +134,7 @@ RCC_DIR = $${ARCH_DIR}/$${BUILD_TYPE}/rcc LIMEREPORT_VERSION_MAJOR = 1 LIMEREPORT_VERSION_MINOR = 5 -LIMEREPORT_VERSION_RELEASE = 63 +LIMEREPORT_VERSION_RELEASE = 64 LIMEREPORT_VERSION = '$${LIMEREPORT_VERSION_MAJOR}.$${LIMEREPORT_VERSION_MINOR}.$${LIMEREPORT_VERSION_RELEASE}' DEFINES *= LIMEREPORT_VERSION_STR=\\\"$${LIMEREPORT_VERSION}\\\" diff --git a/limereport/lrbanddesignintf.h b/limereport/lrbanddesignintf.h index 02e70dc..6c33d08 100644 --- a/limereport/lrbanddesignintf.h +++ b/limereport/lrbanddesignintf.h @@ -253,6 +253,7 @@ public: bool startFromNewPage() const; void setStartFromNewPage(bool startFromNewPage); bool canContainChildren() const{ return true;} + bool canAcceptPaste() const{ return true;} bool printAlways() const; void setPrintAlways(bool printAlways); bool repeatOnEachRow() const; diff --git a/limereport/lrbasedesignintf.h b/limereport/lrbasedesignintf.h index 07d4ed8..00fc807 100644 --- a/limereport/lrbasedesignintf.h +++ b/limereport/lrbasedesignintf.h @@ -297,6 +297,7 @@ public: void setBorderColor(const QColor &borderColor); void setItemVisible(const bool& value); virtual bool canContainChildren() const { return false;} + virtual bool canAcceptPaste() const{ return false;} ReportSettings* reportSettings() const; void setReportSettings(ReportSettings *reportSettings); void setZValueProperty(qreal value); @@ -311,6 +312,15 @@ public: virtual void setWatermark(bool watermark); void updateSelectionMarker(); void turnOnSelectionMarker(bool value); + bool fillTransparentInDesignMode() const; + void setFillTransparentInDesignMode(bool fillTransparentInDesignMode); + void emitPosChanged(QPointF oldPos, QPointF newPos); + void emitObjectNamePropertyChanged(const QString& oldName, const QString& newName); + bool isGeometryLocked() const; + void setGeometryLocked(bool itemLocked); + bool isChangingPos() const; + void setIsChangingPos(bool isChangingPos); + Q_INVOKABLE QString setItemWidth(qreal width); Q_INVOKABLE QString setItemHeight(qreal height); Q_INVOKABLE qreal getItemWidth(); @@ -322,18 +332,6 @@ public: Q_INVOKABLE QString setItemPosX(qreal xValue); Q_INVOKABLE QString setItemPosY(qreal yValue); - bool fillTransparentInDesignMode() const; - void setFillTransparentInDesignMode(bool fillTransparentInDesignMode); - - void emitPosChanged(QPointF oldPos, QPointF newPos); - void emitObjectNamePropertyChanged(const QString& oldName, const QString& newName); - - bool isGeometryLocked() const; - void setGeometryLocked(bool itemLocked); - - bool isChangingPos() const; - void setIsChangingPos(bool isChangingPos); - protected: //ICollectionContainer @@ -404,6 +402,7 @@ private: void moveSelectedItems(QPointF delta); Qt::CursorShape getPossibleCursor(int cursorFlags); void updatePossibleDirectionFlags(); + private: QPointF m_startPos; int m_resizeHandleSize; diff --git a/limereport/lrpagedesignintf.cpp b/limereport/lrpagedesignintf.cpp index b767128..71aa0fe 100644 --- a/limereport/lrpagedesignintf.cpp +++ b/limereport/lrpagedesignintf.cpp @@ -132,23 +132,6 @@ void PageDesignIntf::updatePageRect() emit sceneRectChanged(sceneRect()); } -//PageDesignIntf::Orientation PageDesignIntf::getOrientation() -//{ -// return m_orientation; -//} - -//void PageDesignIntf::setPageSize(PageDesignIntf::PageSize sizeType, QSizeF sizeValue) -//{ -// m_pageSize = sizeType; -// m_pageSizeValue = sizeValue; -// updatePageRect(); -//} - -//PageDesignIntf::PageSize PageDesignIntf::pageSize() const -//{ -// return m_pageSize; -//} - void PageDesignIntf::keyPressEvent(QKeyEvent *event) { if (event->modifiers() == Qt::NoModifier || @@ -1342,9 +1325,9 @@ void PageDesignIntf::copy() } BaseDesignIntf* PageDesignIntf::findDestObject(BaseDesignIntf* item){ - if (item && item->canContainChildren()) return item; + if (item && item->canAcceptPaste()) return item; BaseDesignIntf * curItem = item; - while (curItem && !curItem->canContainChildren()){ + while (curItem && !curItem->canAcceptPaste()){ curItem = dynamic_cast(curItem->parentItem()); } return curItem; @@ -2110,6 +2093,9 @@ bool PasteCommand::insertItem(ItemsReaderIntf::Ptr reader) if (page()->reportItemsByName(item->objectName()).size()>1){ item->setObjectName(objectName); } + foreach(QObject* child, item->children()){ + changeName(page(), child); + }; m_itemNames.push_back(item->objectName()); } return true; @@ -2117,6 +2103,14 @@ bool PasteCommand::insertItem(ItemsReaderIntf::Ptr reader) return false; } +void PasteCommand::changeName(PageDesignIntf *page, QObject* item) +{ + item->setObjectName(page->genObjectName(*item)); + foreach(QObject* child, item->children()){ + changeName(page, child); + }; +} + CommandIf::Ptr CutCommand::create(PageDesignIntf *page) { CutCommand *command = new CutCommand(); diff --git a/limereport/lrpagedesignintf.h b/limereport/lrpagedesignintf.h index 1256c7a..6e38063 100644 --- a/limereport/lrpagedesignintf.h +++ b/limereport/lrpagedesignintf.h @@ -266,7 +266,7 @@ namespace LimeReport { void bandDeleted(QObject* band); void slotPageItemLoaded(QObject *); void slotSelectionChanged(); - void slotAnimationStoped(QObject *animation); + void slotAnimationStoped(QObject *animation); private: template BaseDesignIntf* internalAddBand(T bandType); @@ -430,6 +430,7 @@ namespace LimeReport { void setItemsXML(const QString& itemsXML); void setParent(BaseDesignIntf* parent){m_parentItemName = parent->objectName();} bool insertItem(ItemsReaderIntf::Ptr reader); + void changeName(PageDesignIntf* page, QObject *item); private: QString m_itemsXML; QString m_parentItemName; diff --git a/limereport/lrpageitemdesignintf.h b/limereport/lrpageitemdesignintf.h index d5918c3..19ea35a 100644 --- a/limereport/lrpageitemdesignintf.h +++ b/limereport/lrpageitemdesignintf.h @@ -144,6 +144,7 @@ public: bool oldPrintMode() const; void setOldPrintMode(bool oldPrintMode); bool canContainChildren() const{ return true;} + bool canAcceptPaste() const{ return true;} bool resetPageNumber() const; void setResetPageNumber(bool resetPageNumber); void updateSubItemsSize(RenderPass pass, DataSourceManager *dataManager);