summaryrefslogtreecommitdiffstats
path: root/src/3rdparty/webkit/WebCore/editing/InsertTextCommand.cpp
diff options
context:
space:
mode:
authorMichael Brasser <michael.brasser@nokia.com>2009-07-10 01:17:51 (GMT)
committerMichael Brasser <michael.brasser@nokia.com>2009-07-10 01:17:51 (GMT)
commit9c13caa3c99af01a9b4c3ff6e178e7dadb61741f (patch)
treeb69df0a23c4628359fc3740e09958980eda7478e /src/3rdparty/webkit/WebCore/editing/InsertTextCommand.cpp
parentbb1bdcab28e4c52dcea37dfaaa435045b1985eeb (diff)
parent883da42f7c75775502c818aa456c8576d8457ff8 (diff)
downloadQt-9c13caa3c99af01a9b4c3ff6e178e7dadb61741f.zip
Qt-9c13caa3c99af01a9b4c3ff6e178e7dadb61741f.tar.gz
Qt-9c13caa3c99af01a9b4c3ff6e178e7dadb61741f.tar.bz2
Merge branch 'kinetic-declarativeui' of git@scm.dev.nokia.troll.no:qt/kinetic into kinetic-declarativeui-gv
Conflicts: examples/itemviews/frozencolumn/main.cpp src/declarative/canvas/qsimplecanvas.cpp src/declarative/canvas/qsimplecanvas_p.h src/declarative/canvas/qsimplecanvasitem.h src/declarative/extra/qfxparticles.cpp src/declarative/fx/fx.pri src/declarative/fx/qfxblurfilter.h src/declarative/fx/qfxcontentwrapper.cpp src/declarative/fx/qfxflickable.cpp src/declarative/fx/qfxfocuspanel.h src/declarative/fx/qfxfocusrealm.h src/declarative/fx/qfxhighlightfilter.cpp src/declarative/fx/qfxhighlightfilter.h src/declarative/fx/qfximage.cpp src/declarative/fx/qfxitem.cpp src/declarative/fx/qfxitem.h src/declarative/fx/qfxrect.cpp src/declarative/fx/qfxreflectionfilter.h src/declarative/fx/qfxshadowfilter.cpp src/declarative/fx/qfxshadowfilter.h src/declarative/fx/qfxtext.cpp src/declarative/fx/qfxtext.h src/declarative/fx/qfxtextedit.cpp src/declarative/opengl/glbasicshaders.h src/declarative/test/qfxtestengine.cpp src/declarative/test/qfxtestengine.h src/declarative/test/qfxtestobjects.cpp src/declarative/test/qfxtestobjects.h src/declarative/test/qfxtestview.h src/declarative/util/qfxglobal.h src/declarative/util/qfxview.cpp src/gui/graphicsview/qgraphicsitem_p.h tools/qmlviewer/qmlviewer.cpp
Diffstat (limited to 'src/3rdparty/webkit/WebCore/editing/InsertTextCommand.cpp')
-rw-r--r--src/3rdparty/webkit/WebCore/editing/InsertTextCommand.cpp16
1 files changed, 4 insertions, 12 deletions
diff --git a/src/3rdparty/webkit/WebCore/editing/InsertTextCommand.cpp b/src/3rdparty/webkit/WebCore/editing/InsertTextCommand.cpp
index bf6fd19..6b0af9b 100644
--- a/src/3rdparty/webkit/WebCore/editing/InsertTextCommand.cpp
+++ b/src/3rdparty/webkit/WebCore/editing/InsertTextCommand.cpp
@@ -106,22 +106,14 @@ bool InsertTextCommand::performTrivialReplace(const String& text, bool selectIns
return true;
}
-void InsertTextCommand::input(const String& originalText, bool selectInsertedText)
+void InsertTextCommand::input(const String& text, bool selectInsertedText)
{
- String text = originalText;
ASSERT(text.find('\n') == -1);
if (endingSelection().isNone())
return;
-
- if (RenderObject* renderer = endingSelection().start().node()->renderer())
- if (renderer->style()->collapseWhiteSpace())
- // Turn all spaces into non breaking spaces, to make sure that they are treated
- // literally, and aren't collapsed after insertion. They will be rebalanced
- // (turned into a sequence of regular and non breaking spaces) below.
- text.replace(' ', noBreakSpace);
-
+
// Delete the current selection.
// FIXME: This delete operation blows away the typing style.
if (endingSelection().isRange()) {
@@ -129,7 +121,7 @@ void InsertTextCommand::input(const String& originalText, bool selectInsertedTex
return;
deleteSelection(false, true, true, false);
}
-
+
Position startPosition(endingSelection().start());
Position placeholder;
@@ -184,7 +176,7 @@ void InsertTextCommand::input(const String& originalText, bool selectInsertedTex
// The insertion may require adjusting adjacent whitespace, if it is present.
rebalanceWhitespaceAt(endPosition);
// Rebalancing on both sides isn't necessary if we've inserted a space.
- if (originalText != " ")
+ if (text != " ")
rebalanceWhitespaceAt(startPosition);
m_charactersAdded += text.length();