The Origin Forum
File Exchange
Try Origin for Free
The Origin Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ | Send File to Tech support
Username:
Password:
Save Password
Forgot your Password? | Admin Options

 All Forums
 Origin Forum for Programming
 Forum for Origin C
 Worksheet::DeleteCol() Bug
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

additive

Germany
109 Posts

Posted - 06/20/2010 :  10:12:09 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Ver. 8.1 and Service Release 2
Operating System: Windows XP

Hello,
can you reproduce this unexpected behavior?
Deleting a worksheet column does only delete its content, while keeping width of all columns as before. I would expect that the width attribute is deleted as well. Thus, column width shift all over the worksheet.



void DemoDeleteColBug()
{
	Worksheet wks;
	wks.Create();
	wks.AddCol();
	wks.Columns(1).SetWidth(3);
	
	int iColIndex = 0;
	wks.DeleteCol(iColIndex,WKSDELETECOL_LEAVE_OPER_RANGES );	
	
}


additive

Germany
109 Posts

Posted - 06/20/2010 :  10:15:16 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Second argument of DeleteCol() is not required.



void DemoDeleteColBug()
{
	Worksheet wks;
	wks.Create();
	wks.AddCol();
	wks.Columns(1).SetWidth(3);
	
	int iColIndex = 0;
	wks.DeleteCol(iColIndex);	
	
}

Go to Top of Page

Penn

China
644 Posts

Posted - 06/21/2010 :  01:41:53 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi,

It is not a bug. The bit WKSDELETECOL_LEAVE_OPER_RANGES does not work like the way you did. It is useful for those columns with Recalculate mode.

For example, there are two columns with row numbers in the active worksheet, and then smooth them by selecting menu Analysis> Signal Processing> Smooth. In the open dialog, set Recalculate to "Auto" and Output to "(<new>,<new>)", click the OK button and get two result columns with locks in the active worksheet. The following function is used to delete the fourth column and keep the lock on the third column.

void DemoDeleteColBug()
{
	//Worksheet wks;
	//wks.Create();
	//wks.AddCol();
	//wks.Columns(1).SetWidth(3);
	
	Worksheet wks = Project.ActiveLayer();
	
	int iColIndex = 3;
	wks.DeleteCol(iColIndex,WKSDELETECOL_LEAVE_OPER_RANGES );		
}

We have updated the document.

Penn
Go to Top of Page

additive

Germany
109 Posts

Posted - 06/24/2010 :  05:01:29 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Penn,
excuse me for the imprecise description.
As I tried to explain with my second post, the problem has nothing to do with the WKSDELETECOL_LEAVE_OPER_RANGES option; which I just tried to figure out if it could help.

Please regard the following example:
1. Create a worksheet containing two columns, A and B.
2. Set column width of column B to 3.
3. Delete column A using wks.DeleteCol(0);

Now, column B remains, but has lost its original column width of 3. It has the width of column A.
Go to Top of Page

Penn

China
644 Posts

Posted - 06/24/2010 :  11:26:49 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi,

Yes, it is a bug. Thank your for reporting this. We will try to fix it. For now, you can delete the column you want to delete, and then set width of the column. For example:

void test_del_col()
{
	Worksheet wks;
	wks.Create("Origin");
	Column colB(wks, 1);
	colB.SetWidth(3.0);
	double dWidth = colB.GetWidth();
	wks.DeleteCol(0);
	colB.SetWidth(dWidth);
}


Penn
Go to Top of Page

additive

Germany
109 Posts

Posted - 07/06/2010 :  5:27:20 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Penn,

i've found another bug concerning column width.
Setting column width requires the worksheet to be displayed in the active folder.
When another folder is active and SetWidth() is applied to a worksheet in an inactive folder, SetWidth() does not show any effect.

Changing the active folder several times during runtime would be a bad workaround because it results in a flickering screen which is annoying for the user.


/ Michael
Go to Top of Page

Penn

China
644 Posts

Posted - 07/07/2010 :  01:09:58 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi,

Yes, it is a bug, and we will try to fix it in our future version. Thank you for reporting this. By the way, the bug you reported before has been fixed in our in-house build.

Penn
Go to Top of Page

MicrosoftCRM

1 Posts

Posted - 07/28/2010 :  06:17:58 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
I was running into the same thing.

Thanks for your post.

[url=http://www.rbdata.com] Microsoft CRM [/url]
[url=http://www.rbdata.com/goldmine-software.htm] GoldMine Software [/url]
[url=http://www.rbdata.com/microsoft-crm-4-0.htm] MS CRM [/url]
Go to Top of Page
  Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000