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
 Format after paste tripped by initialiser list
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

alex.korban
Junior Member

17 Posts

Posted - Aug 30 2007 :  10:59:26 PM  Show Profile  Reply with Quote
Hi

I noticed that if I copy and paste a class definition which has a constructor with an initialiser list, the formatting gets lost.

Example:
class Test : public A
{
  Test() : 
    A()
  {
  }

  void Func()
  {
  }
};


After copying and pasting:

class Test : public A
{
  Test() : 
A()
{
}

void Func()
{
}
};


Also, if I add the keyword public:
class Test : public A
{
public:
  Test() : 
    A()
  {}

  void Func()
  {
  }
};


then after a copy-paste the formatting is broken in a different way:
class Test : public A
{
public:
  Test() :
      A()
      {}

      void Func()
      {
      }
};


This only occurs when the colon is on the same line with the constructor name, and the initialiser list itself is on the next line, but this happens to be the way I often write initialiser lists.

I'm using build 1559.

Thanks
Alex.

Edited by - alex.korban on Aug 30 2007 11:25:19 PM

feline
Whole Tomato Software

United Kingdom
19022 Posts

Posted - Aug 31 2007 :  07:33:03 AM  Show Profile  Reply with Quote
This is actually a problem with the IDE, at least in VS2005. VA asks the IDE to format the code, rather than trying to format it its self.

Try selecting the code and triggering IDE formatting, CTRL-K + CTRL-F in VS2005 to see the effect in action.

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