diff options
author | nyamatongwe <devnull@localhost> | 2012-03-31 11:42:21 +1100 |
---|---|---|
committer | nyamatongwe <devnull@localhost> | 2012-03-31 11:42:21 +1100 |
commit | 355e7421dda5c833cffb7c7c8dd0604a794dbef1 (patch) | |
tree | 74e307f727b3efc3d6b1a33c329350ea572dbca4 | |
parent | acc61f4347f532c157aeb99a79ea9d725a149114 (diff) | |
download | scintilla-mirror-355e7421dda5c833cffb7c7c8dd0604a794dbef1.tar.gz |
Bug #3512961. Word wrap indentation for print using positions calculated for
display instead of printer.
-rw-r--r-- | src/Editor.cxx | 21 | ||||
-rw-r--r-- | src/Editor.h | 1 |
2 files changed, 11 insertions, 11 deletions
diff --git a/src/Editor.cxx b/src/Editor.cxx index 9ae4fb59a..b287384d4 100644 --- a/src/Editor.cxx +++ b/src/Editor.cxx @@ -213,7 +213,6 @@ Editor::Editor() { wrapVisualFlagsLocation = 0; wrapVisualStartIndent = 0; wrapIndentMode = SC_WRAPINDENT_FIXED; - wrapAddIndent = 0; convertPastes = true; @@ -297,15 +296,6 @@ void Editor::RefreshStyleData() { if (surface) { vs.Refresh(*surface); } - if (wrapIndentMode == SC_WRAPINDENT_INDENT) { - wrapAddIndent = pdoc->IndentSize() * vs.spaceWidth; - } else if (wrapIndentMode == SC_WRAPINDENT_SAME) { - wrapAddIndent = 0; - } else { //SC_WRAPINDENT_FIXED - wrapAddIndent = wrapVisualStartIndent * vs.aveCharWidth; - if ((wrapVisualFlags & SC_WRAPVISUALFLAG_START) && (wrapAddIndent <= 0)) - wrapAddIndent = vs.aveCharWidth; // must indent to show start visual - } SetScrollBars(); SetRectangularRange(); } @@ -2318,6 +2308,17 @@ void Editor::LayoutLine(int line, Surface *surface, ViewStyle &vstyle, LineLayou width = 20; } if ((ll->validity == LineLayout::llPositions) || (ll->widthLine != width)) { + XYPOSITION wrapAddIndent = 0; // This will be added to initial indent of line + if (wrapIndentMode == SC_WRAPINDENT_INDENT) { + wrapAddIndent = pdoc->IndentSize() * vstyle.spaceWidth; + } else if (wrapIndentMode == SC_WRAPINDENT_SAME) { + wrapAddIndent = 0; + } else { //SC_WRAPINDENT_FIXED + wrapAddIndent = wrapVisualStartIndent * vstyle.aveCharWidth; + if ((wrapVisualFlags & SC_WRAPVISUALFLAG_START) && (wrapAddIndent <= 0)) + wrapAddIndent = vstyle.aveCharWidth; // must indent to show start visual + } + ll->widthLine = width; if (width == LineLayout::wrapWidthInfinite) { ll->lines = 1; diff --git a/src/Editor.h b/src/Editor.h index 0923f4051..b407789a1 100644 --- a/src/Editor.h +++ b/src/Editor.h @@ -264,7 +264,6 @@ protected: // ScintillaBase subclass needs access to much of Editor int wrapVisualFlags; int wrapVisualFlagsLocation; int wrapVisualStartIndent; - XYPOSITION wrapAddIndent; // This will be added to initial indent of line int wrapIndentMode; // SC_WRAPINDENT_FIXED, _SAME, _INDENT bool convertPastes; |