Insert new table row and auto font selection

  • Seems like if I insert a new row after an existing row and start typing into the new row, it takes on the font, size and style of the first char in the row above it.

    I don't like that, and neither do my customers. They all want it to use the default font they chose. This is because many times they added a large bullet or checkbox of a different size than the prevailing font, or simply added bold or italics to the first word, and therefore more often than not, the new row being inserted is not necesarily the same as the previous row.

    Is there a way to intercept this auto-font selection on a new row, or turn it off so that it will default to the default font?

  • Thanks.. I'll give that a try. It seems however that the logic for a new table row doesn't look for the nearest text to set the attribute, but rather the first text in the previous row (not the ending text of that previous row)... clearly not the nearest text in this case.

    It would be nice to have an option such that if I am currently entering text in a certain font style etc and simply click the "insert row" button on the toolbar, it should retain my current settings automatically, not revert to something the user is not expecting.

    just my 2 cents.

  • Simply commenting out one line of code in your WPCTRMemo.pas unit does exactly what I want.

    in function TWPCustomRtfEdit.InsertRow, I commented out the GetCharAttr line:

    Code
    TextCursor.active_posinpar := 0;
        ActiveParagraph := par.ColFirst;
        //TextCursor.GetCharAttr;
        Result := TRUE;
        DelayedReformat;
      end else Result := FALSE;

    Now it keeps the current attributes after clicking the "Insert row" toolbar button. This seems to work perfectly in all scenarios I tried... so much so, I can't imagine doing it any other way, IMHO. :)