diff -Naur --exclude=CVS abi/src/text/fmt/xp/fv_View.cpp abi-new/src/text/fmt/xp/fv_View.cpp --- abi/src/text/fmt/xp/fv_View.cpp Wed Mar 8 12:18:25 2000 +++ abi-new/src/text/fmt/xp/fv_View.cpp Mon Mar 13 08:46:25 2000 @@ -1863,6 +1863,10 @@ void FV_View::cmdCharDelete(UT_Bool bForward, UT_uint32 count) { + const XML_Char * properties[] = { "font-family", NULL, 0}; + const XML_Char ** props_in = NULL; + const XML_Char * currentfont; + if (!isSelectionEmpty()) { _deleteSelection(); @@ -1877,10 +1881,23 @@ } else { - _eraseInsertionPoint(); + /* + Code to deal with font boundary problem. +TODO: This should really be fixed by someone who understands how this code + works! In the meantime save current font to be restored after character is +deleted. +Blame Martin Sevior (msevior@physics.unimelb.edu.au) if this screws up +something + */ + getCharFormat(&props_in); + currentfont = UT_getAttribute("font-family",props_in); + properties[1] = currentfont; + _eraseInsertionPoint(); UT_uint32 amt = count; UT_uint32 posCur = getPoint(); + UT_uint32 nposCur = getPoint(); + UT_Bool fontFlag = UT_FALSE; if (!bForward) { @@ -1892,6 +1909,14 @@ } posCur = getPoint(); + /* + Code to deal with change of font boundaries: + */ + if((posCur == nposCur) && (posCur > 0)) + { + fontFlag = UT_TRUE; + posCur--; + } } else { @@ -1911,9 +1936,14 @@ if (amt > 0) { m_pDoc->deleteSpan(posCur, posCur+amt); - } + if(fontFlag) + { + setCharFormat(properties); + } + } _generalUpdate(); + free(props_in); if (!_ensureThatInsertionPointIsOnScreen()) {