diff options
author | Oliver Specht <os@openoffice.org> | 2007-04-25 10:35:48 +0000 |
---|---|---|
committer | Oliver Specht <os@openoffice.org> | 2007-04-25 10:35:48 +0000 |
commit | e822690be3edb606c200095b4da719d402dc64e9 (patch) | |
tree | 519dd89b063d8e2dc9d4693806a8c54b6494a0ca /writerfilter/source/dmapper/DomainMapperTableHandler.cxx | |
parent | 636b05815f40ecc5fac695c1675873488227a578 (diff) |
table attributes started
Diffstat (limited to 'writerfilter/source/dmapper/DomainMapperTableHandler.cxx')
-rw-r--r-- | writerfilter/source/dmapper/DomainMapperTableHandler.cxx | 76 |
1 files changed, 53 insertions, 23 deletions
diff --git a/writerfilter/source/dmapper/DomainMapperTableHandler.cxx b/writerfilter/source/dmapper/DomainMapperTableHandler.cxx index edb59358c86b..ffbc953a248c 100644 --- a/writerfilter/source/dmapper/DomainMapperTableHandler.cxx +++ b/writerfilter/source/dmapper/DomainMapperTableHandler.cxx @@ -4,9 +4,9 @@ * * $RCSfile: DomainMapperTableHandler.cxx,v $ * - * $Revision: 1.3 $ + * $Revision: 1.4 $ * - * last change: $Author: os $ $Date: 2006-11-02 12:37:24 $ + * last change: $Author: os $ $Date: 2007-04-25 11:30:51 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -48,19 +48,37 @@ static void lcl_printHandle(const Handle_t rHandle) clog << aOStr.getStr() << endl; } +static void lcl_printProperties( PropertyMapPtr pProps ) +{ + if( pProps.get() ) + { + clog << "<properties>"; + PropertyMap::const_iterator aMapIter = pProps->begin(); + PropertyMap::const_iterator aEndIter = pProps->end(); + for( ; aMapIter != aEndIter; ++aMapIter ) + { + rtl::OUString aOUStr = aMapIter->first; + rtl::OString aOStr(aOUStr.getStr(), aOUStr.getLength(), RTL_TEXTENCODING_ASCII_US ); + clog << aOStr.getStr() << '-'; + } + clog << endl; + } +} #endif void DomainMapperTableHandler::startTable(unsigned int nRows, unsigned int /*nDepth*/, - PropertyMapPtr /*pProps*/) + PropertyMapPtr pProps) { - m_pHandleSeq3 = HandleSequence3Pointer_t(new HandleSequence3_t(nRows)); - m_nHandle3Index = 0; + m_aTableProperties = pProps; + m_pTableSeq = TableSequencePointer_t(new TableSequence_t(nRows)); + m_nTableIndex = 0; #ifdef DEBUG char sBuffer[256]; snprintf(sBuffer, sizeof(sBuffer), "%d", nRows); clog << "<table rows=\"" << sBuffer << "\">" << endl; + lcl_printProperties( pProps ); #endif } @@ -69,16 +87,16 @@ void DomainMapperTableHandler::endTable() #ifdef DEBUG clog << "</table>" << endl; #endif + CellPropertyValuesSeq_t aCellProperties; + RowPropertyValuesSeq_t aRowProperties; + TablePropertyValues_t aTableProperties; - PropertyValuesSeq2_t aCellProperties; - PropertyValuesSeq_t aRowProperties; - PropertyValues_t aTableProperties; - - if (m_pHandleSeq3->getLength() > 0) + if (m_pTableSeq->getLength() > 0) { try { - m_xText->convertToTable(*m_pHandleSeq3, aCellProperties, + m_xText->convertToTable(*m_pTableSeq, + aCellProperties, aRowProperties, aTableProperties); } @@ -92,23 +110,27 @@ void DomainMapperTableHandler::endTable() } void DomainMapperTableHandler::startRow(unsigned int nCells, - PropertyMapPtr /*pProps*/) + PropertyMapPtr pProps) { + m_aRowProperties.push_back( pProps ); + m_aCellProperties.push_back( PropertyMapVector1() ); + +#ifdef DEBUG char sBuffer[256]; snprintf(sBuffer, sizeof(sBuffer), "%d", nCells); -#ifdef DEBUG clog << "<table.row cells=\"" << sBuffer << "\">" << endl; + lcl_printProperties( pProps ); #endif - m_pHandleSeq2 = HandleSequence2Pointer_t(new HandleSequence2_t(nCells)); - m_nHandle2Index = 0; + m_pRowSeq = RowSequencePointer_t(new RowSequence_t(nCells)); + m_nRowIndex = 0; } void DomainMapperTableHandler::endRow() { - (*m_pHandleSeq3)[m_nHandle3Index] = *m_pHandleSeq2; - ++m_nHandle3Index; + (*m_pTableSeq)[m_nTableIndex] = *m_pRowSeq; + ++m_nTableIndex; #ifdef DEBUG clog << "</table.row>" << endl; @@ -116,16 +138,24 @@ void DomainMapperTableHandler::endRow() } void DomainMapperTableHandler::startCell(const Handle_t & start, - PropertyMapPtr /*pProps*/) + PropertyMapPtr pProps ) { + sal_uInt32 nRow = m_aRowProperties.size(); + m_aCellProperties[nRow - 1].push_back( pProps ); + #ifdef DEBUG clog << "<table.cell>"; lcl_printHandle(start); + lcl_printProperties( pProps ); clog << ","; #endif - m_pHandleSeq = HandleSequencePointer_t(new HandleSequence_t(2)); - (*m_pHandleSeq)[0] = start->getStart(); + //add a new 'row' of properties +// if( m_pCellProperties.size() <= sal::static_int_cast< sal_uInt32, sal_Int32>(m_nRowIndex) ) +// m_pCellProperties.push_back( RowProperties_t() ); +// m_pCellProperties[m_nRowIndex].push_back( pProps ); + m_pCellSeq = CellSequencePointer_t(new CellSequence_t(2)); + (*m_pCellSeq)[0] = start->getStart(); } void DomainMapperTableHandler::endCell(const Handle_t & end) @@ -135,9 +165,9 @@ void DomainMapperTableHandler::endCell(const Handle_t & end) clog << "</table.cell>" << endl; #endif - (*m_pHandleSeq)[1] = end->getEnd(); - (*m_pHandleSeq2)[m_nHandle2Index] = *m_pHandleSeq; - ++m_nHandle2Index; + (*m_pCellSeq)[1] = end->getEnd(); + (*m_pRowSeq)[m_nRowIndex] = *m_pCellSeq; + ++m_nRowIndex; } } |