On Sun, Nov 21, 2010 at 12:21:08AM +1100, Mattias Johnsson wrote:
Hello all,
I've been trying to fix a bug in the search and replace code, and
after a bit of hacking have discovered that in findattr.cxx there's a
function
int CmpAttr( const SfxPoolItem& rItem1, const SfxPoolItem& rItem2 )
{
...
return rItem1 == rItem2;
}
In the bugged case this returns true, and in the correctly functioning
case it returns false. I'm trying to figure out exactly how rItem1 and
rItem2 differ in the correct case to help me find out what's wrong in
the bugged case.
If I'm understanding things correctly, and I may not be, since the
search and replace code is quite convoluted, in this case these
SfxPoolItems are lists of attributes that one can search and replace
for; in this case I'm searching for a specific font size and replacing
it with another.
The overloaded comparison operator is defined as
int SfxPoolItem::operator==( const SfxPoolItem& rCmp ) const
{
DBG_CHKTHIS(SfxPoolItem, 0);
return rCmp.Type() == Type();
}
but for the life of me I can't find out where the Type() method is defined.
Does anyone have any pointers?
The SfxPoolItem::operator== is virtual, so you may actually need to look
at the definition in some derived class.
set print object on
p rItem1
p rItem2
in gdb in the CmpAttr func will tell you the real classes of the items.
Or, alternatively, you can step into the operator.
D.
Context
Privacy Policy |
Impressum (Legal Info) |
Copyright information: Unless otherwise specified, all text and images
on this website are licensed under the
Creative Commons Attribution-Share Alike 3.0 License.
This does not include the source code of LibreOffice, which is
licensed under the Mozilla Public License (
MPLv2).
"LibreOffice" and "The Document Foundation" are
registered trademarks of their corresponding registered owners or are
in actual use as trademarks in one or more countries. Their respective
logos and icons are also subject to international copyright laws. Use
thereof is explained in our
trademark policy.