WPCubed Product Support

DecIndent not working

I am using the code

Editor.CurrAttr.IncIndent

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

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:

  1. Apple

After Indent +:

_____1. Apple

After Indent -:

1._____ Apple

#1 ✎ ♥ 0
5.1k Views 2 users read 2 min
support

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

#2 ♥ 0

My workaround.

In the code where I decrease the indent I did this

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.

#3 ♥ 0
support

Did you try without DecOutlineLevel?

It seems to me this way the bullets loose there status at the beginning and the indent first is never restored.

#4 ♥ 0
This category is archived. No new posts are possible.