DecIndent not working

  • I am using the code

    Code
    Editor.CurrAttr.IncIndent

    to indent a bulleted item. And this works great. However when I call

    Code
    Editor.CurrAttr.DecIndent

    The Numbered part moves back where it started but the content does not.

    Is there a more correct way to manipulate the indents than this way or is this a bug?


    Example ( _ = spaces )

    Before:

    Zitat

    1. Apple

    After Indent +:

    Zitat

    _____1. Apple

    After Indent -:

    Zitat

    1._____ Apple

    Einmal editiert, zuletzt von timk5020 (15. Juni 2011 um 15:09)

    • Offizieller Beitrag

    Hi,

    It seems so only the indentleft AND the indentfirst is change in your case. I cannot reproduces that her. IncIndent/DecIndent works differently depending on the text, in regular text and bullets it just changes indentleft, with outlines it also increments the outline level.

    The amount it indents depends on the tabstops.
    The indentfirst is changed if otherwise the text would go past the left margin.

    Julian

  • My workaround.

    In the code where I decrease the indent I did this

    Code
    OldIndent := Editor.CurrAttr.IndentLeft;
        Editor.CurrAttr.DecOutlineLevel;
        Editor.CurrAttr.DecIndent;
        if ((Editor.CurrAttr.IndentLeft = OldIndent) and (OldIndent = 720)) or
           ((Editor.CurrAttr.IndentLeft = 720) and (OldIndent = 0)) then
          begin
            Editor.CurrAttr.IndentLeft := 0;
            Editor.CurrAttr.IndentFirst := 0;
          end;

    720 is the indent where it is all the way to the left.

    Now even though when its there I had to check to make sure that if it was attempted to be decreased again that we didn't let it reset to a position where the text of the bullet was a tabs width indented to the right as in the second step of my first post.

    I don't know if this will help determine what I was doing wrong or help someone else out in the future but I hope so.