OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 1999 Antti Koivisto (koivisto@kde.org) | 2 * Copyright (C) 1999 Antti Koivisto (koivisto@kde.org) |
3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights
reserved. | 3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights
reserved. |
4 * | 4 * |
5 * This library is free software; you can redistribute it and/or | 5 * This library is free software; you can redistribute it and/or |
6 * modify it under the terms of the GNU Library General Public | 6 * modify it under the terms of the GNU Library General Public |
7 * License as published by the Free Software Foundation; either | 7 * License as published by the Free Software Foundation; either |
8 * version 2 of the License, or (at your option) any later version. | 8 * version 2 of the License, or (at your option) any later version. |
9 * | 9 * |
10 * This library is distributed in the hope that it will be useful, | 10 * This library is distributed in the hope that it will be useful, |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 | 62 |
63 bool operator==(const ContentData& a, const ContentData& b) | 63 bool operator==(const ContentData& a, const ContentData& b) |
64 { | 64 { |
65 if (a.type() != b.type()) | 65 if (a.type() != b.type()) |
66 return false; | 66 return false; |
67 | 67 |
68 switch (a.type()) { | 68 switch (a.type()) { |
69 case CONTENT_NONE: | 69 case CONTENT_NONE: |
70 return true; | 70 return true; |
71 case CONTENT_OBJECT: | 71 case CONTENT_OBJECT: |
72 return static_cast<const ImageContentData*>(&a)->image() == static_cast<
const ImageContentData*>(&b)->image(); | 72 return *static_cast<const ImageContentData*>(&a)->image() == *static_cas
t<const ImageContentData*>(&b)->image(); |
73 case CONTENT_TEXT: | 73 case CONTENT_TEXT: |
74 return static_cast<const TextContentData*>(&a)->text() == static_cast<co
nst TextContentData*>(&b)->text(); | 74 return static_cast<const TextContentData*>(&a)->text() == static_cast<co
nst TextContentData*>(&b)->text(); |
75 case CONTENT_COUNTER: | 75 case CONTENT_COUNTER: |
76 return static_cast<const CounterContentData*>(&a)->counter() == static_c
ast<const CounterContentData*>(&b)->counter(); | 76 return *static_cast<const CounterContentData*>(&a)->counter() == *static
_cast<const CounterContentData*>(&b)->counter(); |
77 case CONTENT_QUOTE: | 77 case CONTENT_QUOTE: |
78 return static_cast<const QuoteContentData*>(&a)->quote() == static_cast<
const QuoteContentData*>(&b)->quote(); | 78 return static_cast<const QuoteContentData*>(&a)->quote() == static_cast<
const QuoteContentData*>(&b)->quote(); |
79 } | 79 } |
80 ASSERT_NOT_REACHED(); | 80 ASSERT_NOT_REACHED(); |
81 return false; | 81 return false; |
82 } | 82 } |
83 | 83 |
84 bool operator!=(const ContentData& a, const ContentData& b) | 84 bool operator!=(const ContentData& a, const ContentData& b) |
85 { | 85 { |
86 return !(a == b); | 86 return !(a == b); |
87 } | 87 } |
88 | 88 |
89 } // namespace WebCore | 89 } // namespace WebCore |
OLD | NEW |