Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
User name:
Password:
Save Password
Forgot your password?

 All Forums
 Visual Assist
 Technical Support
 Move to Base Class does not work
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Harald Krause
Junior Member

Austria
17 Posts

Posted - Feb 27 2025 :  09:27:29 AM  Show Profile  Reply with Quote
Even worse: It just deletes everything in the file where the base class is defined.

feline
Whole Tomato Software

United Kingdom
19148 Posts

Posted - Feb 27 2025 :  10:07:53 AM  Show Profile  Reply with Quote
Obviously very bad! Is this C++? I assume the base and child classes are in separate files.

I am not seeing any problems with this command here in some simple test cases, so could do with some help understanding your situation, and the trigger for this bug.

First things first, has Undo restored your code to how it was? This is the first thing to sort out.

Are you working with template code? A lot of macros? Is there anything "odd" about any of the classes?

zen is the art of being at one with the two'ness
Go to Top of Page

Harald Krause
Junior Member

Austria
17 Posts

Posted - Feb 27 2025 :  10:30:26 AM  Show Profile  Reply with Quote
Undo restored the code.
In this case no template was used.
Language is C++, Visual Studio 2022

However the base class is defined in the same header file as the class like this:


class Base
{

};

class UsingBaseA : public Base
{

};

class UsingBaseB : public Base
{

};

Edited by - Harald Krause on Feb 27 2025 10:54:33 AM
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
19148 Posts

Posted - Feb 27 2025 :  2:07:51 PM  Show Profile  Reply with Quote
Obviously first make sure your code is checked into source control!

If you trigger Move to base class again, do you get the problem a second time? I am wondering if, somehow, this was a random, one off problem. I have run several tests with all of the classes declared in the same header files, and no code is ever being deleted for me. So this isn't something that always happens.

Assuming the problem happens again, if you have the time, can you please try copying just the header file into a new, default C++ solution, and see if the same problem shows up there? I am trying to work out if the solution context is somehow a factor and a problem. If macros are a factor then this might make a difference.

But if you get the same problem in this simplified situation, would it be possible to get a copy of this test solution, really just this single header file, to try and reproduce the problem here? The code would only be used for testing purposes, but I realise this is still often not an option. Still, worth asking on the off chance.

If this is possible can you please send me the files via email:

[email protected]

including this thread ID or URL in the description, so we can match it up.

zen is the art of being at one with the two'ness
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
© 2023 Whole Tomato Software, LLC Go To Top Of Page
Snitz Forums 2000