From: Fridrich S. <str...@us...> - 2005-08-18 20:59:45
|
Update of /cvsroot/libwpd/libwpd2/src/lib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7353/src/lib Modified Files: Tag: fs_refactoring1 WP6HLContentListener.cpp WPXHLListener.cpp WPXHLListener.h Log Message: Getting list positions right (Fridrich) + Making valgrind happy (Cyrille Moureaux) Index: WP6HLContentListener.cpp =================================================================== RCS file: /cvsroot/libwpd/libwpd2/src/lib/WP6HLContentListener.cpp,v retrieving revision 1.78.2.13 retrieving revision 1.78.2.14 diff -C2 -d -r1.78.2.13 -r1.78.2.14 *** WP6HLContentListener.cpp 13 Aug 2005 22:13:20 -0000 1.78.2.13 --- WP6HLContentListener.cpp 18 Aug 2005 13:37:35 -0000 1.78.2.14 *************** *** 227,232 **** --- 227,235 ---- m_tableList(tableList), m_currentTable(NULL), + m_nextTableIndice(nextTableIndice), + m_currentOutlineHash(0), + m_oldListLevel(0), m_putativeListElementHasParagraphNumber(false), m_putativeListElementHasDisplayReferenceNumber(false), *************** *** 961,964 **** --- 964,969 ---- case WP6_STYLE_GROUP_PARASTYLE_BEGIN_ON_PART1: WPD_DEBUG_MSG(("WordPerfect: Handling para style begin 1 (ON)\n")); + // Maybe the following 3 ifs are not necessary since it should be everything done already, but it is not harming. + // Nevertheless, on a later point of time they might disappear. if (m_ps->m_isParagraphOpened) _closeParagraph(); *************** *** 974,977 **** --- 979,983 ---- case WP6_STYLE_GROUP_PARASTYLE_BEGIN_ON_PART2: WPD_DEBUG_MSG(("WordPerfect: Handling a para style begin 2 (ON)\n")); + m_ps->m_listBeginPosition = m_ps->m_paragraphMarginLeft + m_ps->m_paragraphTextIndent; break; case WP6_STYLE_GROUP_PARASTYLE_END_ON: *************** *** 1313,1316 **** --- 1319,1323 ---- _openSection(); WP6OutlineDefinition *outlineDefinition; + if (m_outlineDefineHash.empty() || (m_outlineDefineHash.find(outlineHash) == m_outlineDefineHash.end())) { *************** *** 1346,1350 **** propList.insert("text:start-value", number); propList.insert("text:min-label-width", m_ps->m_paragraphMarginLeft + m_ps->m_paragraphTextIndent - m_ps->m_listReferencePosition); ! propList.insert("text:space-before", 0.0f); m_listenerImpl->defineOrderedListLevel(propList); --- 1353,1357 ---- propList.insert("text:start-value", number); propList.insert("text:min-label-width", m_ps->m_paragraphMarginLeft + m_ps->m_paragraphTextIndent - m_ps->m_listReferencePosition); ! propList.insert("text:space-before", m_ps->m_listReferencePosition - m_ps->m_listBeginPosition); m_listenerImpl->defineOrderedListLevel(propList); *************** *** 1354,1358 **** propList.insert("text:bullet-char", m_parseState->m_textBeforeDisplayReference); propList.insert("text:min-label-width", m_ps->m_paragraphMarginLeft + m_ps->m_paragraphTextIndent - m_ps->m_listReferencePosition); ! propList.insert("text:space-before", 0.0f); m_listenerImpl->defineUnorderedListLevel(propList); --- 1361,1365 ---- propList.insert("text:bullet-char", m_parseState->m_textBeforeDisplayReference); propList.insert("text:min-label-width", m_ps->m_paragraphMarginLeft + m_ps->m_paragraphTextIndent - m_ps->m_listReferencePosition); ! propList.insert("text:space-before", m_ps->m_listReferencePosition - m_ps->m_listBeginPosition); m_listenerImpl->defineUnorderedListLevel(propList); Index: WPXHLListener.cpp =================================================================== RCS file: /cvsroot/libwpd/libwpd2/src/lib/WPXHLListener.cpp,v retrieving revision 1.61.2.10 retrieving revision 1.61.2.11 diff -C2 -d -r1.61.2.10 -r1.61.2.11 *** WPXHLListener.cpp 12 Aug 2005 12:28:57 -0000 1.61.2.10 --- WPXHLListener.cpp 18 Aug 2005 13:37:35 -0000 1.61.2.11 *************** *** 97,100 **** --- 97,101 ---- m_listReferencePosition(0.0f), + m_listBeginPosition(0.0f), m_paragraphTextIndent(0.0f), *************** *** 217,220 **** --- 218,222 ---- m_ps->m_rightMarginByPageMarginChange += m_ps->m_pageMarginRight; m_ps->m_listReferencePosition += m_ps->m_pageMarginLeft; + m_ps->m_listBeginPosition += m_ps->m_pageMarginLeft; if ( !m_pageList || *************** *** 258,261 **** --- 260,264 ---- m_ps->m_rightMarginByPageMarginChange -= m_ps->m_pageMarginRight; m_ps->m_listReferencePosition -= m_ps->m_pageMarginLeft; + m_ps->m_listBeginPosition -= m_ps->m_pageMarginLeft; m_ps->m_paragraphMarginLeft = m_ps->m_leftMarginByPageMarginChange + m_ps->m_leftMarginByParagraphMarginChange *************** *** 385,388 **** --- 388,392 ---- m_ps->m_tempParagraphJustification = 0; m_ps->m_listReferencePosition = m_ps->m_paragraphMarginLeft + m_ps->m_paragraphTextIndent; + m_ps->m_listBeginPosition = m_ps->m_paragraphMarginLeft + m_ps->m_paragraphTextIndent; } *************** *** 426,430 **** if (isListElement) { ! propList.insert("fo:margin-left", (m_ps->m_listReferencePosition - m_ps->m_paragraphTextIndent)); propList.insert("fo:text-indent", m_ps->m_paragraphTextIndent); } --- 430,434 ---- if (isListElement) { ! propList.insert("fo:margin-left", (m_ps->m_listBeginPosition - m_ps->m_paragraphTextIndent)); propList.insert("fo:text-indent", m_ps->m_paragraphTextIndent); } Index: WPXHLListener.h =================================================================== RCS file: /cvsroot/libwpd/libwpd2/src/lib/WPXHLListener.h,v retrieving revision 1.61.2.6 retrieving revision 1.61.2.7 diff -C2 -d -r1.61.2.6 -r1.61.2.7 *** WPXHLListener.h 10 Aug 2005 10:21:19 -0000 1.61.2.6 --- WPXHLListener.h 18 Aug 2005 13:37:35 -0000 1.61.2.7 *************** *** 130,134 **** float m_rightMarginByTabs; // only part of the margin that is reset at the end of a paragraph ! float m_listReferencePosition; // position from the page left margin of the list number/bullet float m_paragraphTextIndent; // resulting first line indent that is one of the paragraph properties --- 130,135 ---- float m_rightMarginByTabs; // only part of the margin that is reset at the end of a paragraph ! float m_listReferencePosition; // position from the left page margin of the list number/bullet ! float m_listBeginPosition; // position from the left page margin of the beginning of the list float m_paragraphTextIndent; // resulting first line indent that is one of the paragraph properties |