Revision e5cdd82...

Go back to digest for 8th January 2012

Bug Fixes in KDE Base

Raphael Kubo da Costa committed changes in [kde-baseapps] konq-plugins/domtreeviewer/domtreecommands.cpp:

domtreeviewer: Fix build with clang.

DOM::Node does not originally have operator<(DOM::Node, DOM::Node)
implemented in khtml, so domtreecommands.cpp implemented it. However, it did
so in the `domtreeviewer' namespace.

When ManipulationCommand::addChangedNode() is called, it calls
ChangedNodeSet::insert(), which is actually QMap<DOM::Node, bool>::insert(),
which calls qMapLessThanKey(), which finally calls operator<().

Since QMap is not part of the `domtreeviewer' namespace, when
qMapLessThanKey() calls operator<(), it never looks for an implementation in
the `domtreeviewer' namespace. Argument-dependend name lookup makes the
compiler look for an implementation in the namespace of the function
arguments (DOM, in this case), so we need to move our implementation there.

For some reason, the code built fine with gcc.

Thanks to Nicolás Alvarez for the initial discussion, and [1] for the ugly
details.

[1] http://www.gotw.ca/publications/mill08.htm

(cherry picked from commit c3e23ca29959ae2aab154c5a8d40b823c1923e85)

File Changes

Modified 1 files
  • konq-plugins/domtreeviewer/domtreecommands.cpp
1 files changed in total