0
0
mirror of https://github.com/fralx/LimeReport.git synced 2024-12-24 00:33:02 +03:00

Redundant item creator registration has been fixed

This commit is contained in:
Arin Alex 2024-05-08 17:25:30 +03:00
parent caf9f3867d
commit 8a09d5adcd
3 changed files with 3 additions and 3 deletions

View File

@ -3,7 +3,7 @@ project(limereport)
set(LIMEREPORT_VERSION_MAJOR 1) set(LIMEREPORT_VERSION_MAJOR 1)
set(LIMEREPORT_VERSION_MINOR 7) set(LIMEREPORT_VERSION_MINOR 7)
set(LIMEREPORT_VERSION_RELEASE 5) set(LIMEREPORT_VERSION_RELEASE 7)
option(ENABLE_ZINT "Enable libzint build for barcode support" OFF) option(ENABLE_ZINT "Enable libzint build for barcode support" OFF)
option(LIMEREPORT_STATIC "Build LimeReport as static library" OFF) option(LIMEREPORT_STATIC "Build LimeReport as static library" OFF)
@ -393,7 +393,6 @@ endif(ENABLE_ZINT)
target_compile_definitions( ${PROJECT_NAME} PRIVATE -DHAVE_QT${QT_VERSION_MAJOR} -DHAVE_REPORT_DESIGNER -DUSE_QJSENGINE -D_CRT_SECURE_NO_WARNINGS) target_compile_definitions( ${PROJECT_NAME} PRIVATE -DHAVE_QT${QT_VERSION_MAJOR} -DHAVE_REPORT_DESIGNER -DUSE_QJSENGINE -D_CRT_SECURE_NO_WARNINGS)
target_include_directories( ${PROJECT_NAME} PRIVATE target_include_directories( ${PROJECT_NAME} PRIVATE
limereport/ limereport/
limereport/base limereport/base

View File

@ -141,7 +141,7 @@ RCC_DIR = $${ARCH_DIR}/$${BUILD_TYPE}/rcc
LIMEREPORT_VERSION_MAJOR = 1 LIMEREPORT_VERSION_MAJOR = 1
LIMEREPORT_VERSION_MINOR = 7 LIMEREPORT_VERSION_MINOR = 7
LIMEREPORT_VERSION_RELEASE = 5 LIMEREPORT_VERSION_RELEASE = 7
LIMEREPORT_VERSION = '$${LIMEREPORT_VERSION_MAJOR}.$${LIMEREPORT_VERSION_MINOR}.$${LIMEREPORT_VERSION_RELEASE}' LIMEREPORT_VERSION = '$${LIMEREPORT_VERSION_MAJOR}.$${LIMEREPORT_VERSION_MINOR}.$${LIMEREPORT_VERSION_RELEASE}'
DEFINES *= LIMEREPORT_VERSION_STR=\\\"$${LIMEREPORT_VERSION}\\\" DEFINES *= LIMEREPORT_VERSION_STR=\\\"$${LIMEREPORT_VERSION}\\\"

View File

@ -54,6 +54,7 @@ private:
friend class Singleton< AttribsAbstractFactory< AbstractProduct,IdentifierType,ProductCreator,Attribs > >; friend class Singleton< AttribsAbstractFactory< AbstractProduct,IdentifierType,ProductCreator,Attribs > >;
public: public:
bool registerCreator(const IdentifierType& id, Attribs attribs, ProductCreator creator){ bool registerCreator(const IdentifierType& id, Attribs attribs, ProductCreator creator){
if (m_factoryMap.contains(id)) return true;
return (m_factoryMap.insert(id,creator).value() == creator) && return (m_factoryMap.insert(id,creator).value() == creator) &&
(m_attribsMap.insert(id,attribs).value() == attribs); (m_attribsMap.insert(id,attribs).value() == attribs);
} }