aknlayoutcompiler/src/Layout.cpp
changeset 1 b700e12870ca
parent 0 f58d6ec98e88
equal deleted inserted replaced
0:f58d6ec98e88 1:b700e12870ca
   107 
   107 
   108 
   108 
   109 //  TLayoutLine
   109 //  TLayoutLine
   110 
   110 
   111 TLayoutLine::TLayoutLine( TLayoutTable* aTable, int aId )
   111 TLayoutLine::TLayoutLine( TLayoutTable* aTable, int aId )
   112 :	iTable(aTable), 
   112 :	iId(aId), 
   113 	iId(aId), 
   113 	iTable(aTable), 
   114 	iIsUnique(true), 
   114 	iIsUnique(true), 
   115 	iIsMirroredHorizontally(false),
   115 	iIsMirroredHorizontally(false),
   116 	iIsMergedIdentical(false)
   116 	iIsMergedIdentical(false)
   117 	{}
   117 	{}
   118 
   118 
   307 //
   307 //
   308 
   308 
   309 
   309 
   310 
   310 
   311 TLayoutTable::TLayoutTable(TLayout* aTables)
   311 TLayoutTable::TLayoutTable(TLayout* aTables)
   312 : iTables(aTables), iType(EUnknownTable), iParent(0), iFirstLineGlobalIndex(-1), iAppend(false), iNoSubTables(false)
   312 : iType(EUnknownTable), iTables(aTables), iParent(0), iFirstLineGlobalIndex(-1), iAppend(false), iNoSubTables(false)
   313 	{
   313 	{
   314 	}
   314 	}
   315 
   315 
   316 TLayoutTable::TLayoutTable(TLayout* aTables, const TLayoutTable& aOther)
   316 TLayoutTable::TLayoutTable(TLayout* aTables, const TLayoutTable& aOther)
   317 : iTables(aTables), iType(aOther.iType), iParent(0), 
   317 : iColumnNames(aOther.iColumnNames), iType(aOther.iType),
   318   iFirstLineGlobalIndex(aOther.iFirstLineGlobalIndex), 
   318   iTables(aTables), iName(aOther.iName), iParent(0),
   319   iAppend(aOther.iAppend), iColumnNames(aOther.iColumnNames), iName(aOther.iName),
   319   iParentName(aOther.iParentName), iFirstLineGlobalIndex(aOther.iFirstLineGlobalIndex),
   320   iParentName(aOther.iParentName), iNoSubTables(aOther.iNoSubTables)
   320   iAppend(aOther.iAppend), iNoSubTables(aOther.iNoSubTables)
   321 	{
   321 	{
   322 	for (const_iterator it = aOther.begin(); it != aOther.end(); ++it)
   322 	for (const_iterator it = aOther.begin(); it != aOther.end(); ++it)
   323 		push_back(new TLayoutLine(this, **it));
   323 		push_back(new TLayoutLine(this, **it));
   324 	}
   324 	}
   325 
   325 
   384 					(*pLine)->iTable = this;
   384 					(*pLine)->iTable = this;
   385 				break;
   385 				break;
   386 				}
   386 				}
   387 			case TLayout::KMergeModeUnion:
   387 			case TLayout::KMergeModeUnion:
   388 				{
   388 				{
   389 				int index = 0;
   389 				unsigned int index = 0;
   390 				for (; pNew != aTable.end(); ++pNew)
   390 				for (; pNew != aTable.end(); ++pNew)
   391 					{
   391 					{
   392 					bool found = false;
   392 					bool found = false;
   393 					for (iterator pLine = begin()+index; pLine != end(); ++pLine)
   393 					for (iterator pLine = begin()+index; pLine != end(); ++pLine)
   394 						{
   394 						{
   409 							{
   409 							{
   410 							throw GeneralErr(Name() + " can't union merge unnamed line");
   410 							throw GeneralErr(Name() + " can't union merge unnamed line");
   411 							}
   411 							}
   412 						push_back(*pNew);
   412 						push_back(*pNew);
   413 						(*pNew)->iTable = this;
   413 						(*pNew)->iTable = this;
   414 						if ((*pNew)->iId != size())
   414 						if ( static_cast<unsigned int>( (*pNew)->iId ) != size())
   415 							iNoSubTables = true;
   415 							iNoSubTables = true;
   416 						(*pNew)->iId = size();
   416 						(*pNew)->iId = size();
   417 						}
   417 						}
   418 					if (index+1 < size())
   418 					if (index+1 < size())
   419 						index++;
   419 						index++;