Re: tnkk - r31440 - abiword/branches/gsoc2012table_headers/src/text/fmt/xp

Hubert Figuière <[email protected]>
Newsgroups gmane.editors.abiword.devel
Message-ID <[email protected]>

> Modified: abiword/branches/gsoc2012table_headers/src/text/fmt/xp/fp_TableContainer.cpp
> ===================================================================
> --- abiword/branches/gsoc2012table_headers/src/text/fmt/xp/fp_TableContainer.cpp	2012-06-28 00:51:47 UTC (rev 31439)
> +++ abiword/branches/gsoc2012table_headers/src/text/fmt/xp/fp_TableContainer.cpp	2012-06-28 09:46:50 UTC (rev 31440)


> @@ -4963,6 +5038,12 @@
>  	queueResize();
>  }
>  
> +void fp_TableContainer::identifyHeaderRows(std::vector<UT_sint32> m_vecHeaderRows)

An argument that start with m_? Please don't do that. Also never pass as
copy, but as const &.

> +{
> +	m_pTableHeader = new fp_TableHeader(getSectionLayout(),this);
> +	m_pTableHeader->createLocalListOfHeaderRows(m_vecHeaderRows);
> +}
> +
>  void fp_TableContainer::queueResize(void)
>  {
>  	static_cast<fl_TableLayout *>(getSectionLayout())->setDirty();

> @@ -6708,26 +6781,19 @@
>  	   m_iHeaderHeight(0)
>  {
>  	pTabMaster = pTableContainer;
> -
> -	fl_TableLayout *pTabLayout = static_cast<fl_TableLayout *>(pTabMaster->getSectionLayout());
> -	pTabLayout->setTableContainerProperties(static_cast<fp_TableContainer *>(this));
> -	
> -	setHeaderRows();
>  }
>  
> -void fp_TableHeader::setHeaderRows()
> +void fp_TableHeader::createLocalListOfHeaderRows(std::vector<UT_sint32> & m_vHeaderRows)

Same here. And make the argument a const reference at the same time.

>  {
> -	fl_TableLayout * pTableLayout = static_cast<fl_TableLayout *>(getSectionLayout());
> -	m_vHeaderRowNumber = pTableLayout->getHeaderRowNos();
> +	m_vHeaderRowNumber = m_vHeaderRows;
>  }
>  
>  void fp_TableHeader::calculateHeaderHeight(void)
>  {
> -	const std::vector<UT_sint32> & headerRowNum =  getHeaderRowNos();
> -	if(!headerRowNum.empty())
> +	if(!m_vHeaderRowNumber.empty())
>  	{
> -		std::vector<UT_sint32>::const_iterator itr = headerRowNum.begin();
> -		for(;itr != headerRowNum.end() ; ++itr)
> +		std::vector<UT_sint32>::const_iterator itr = m_vHeaderRowNumber.begin();
> +		for(;itr != m_vHeaderRowNumber.end() ; ++itr)
>  		{
>  			UT_DEBUGMSG(("The height of %d row is %d\n",(*itr),getActualRowHeight((*itr)-1)));
>  			m_iHeaderHeight += getActualRowHeight(*itr - 1);
> 

Thanks


Hub
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.