🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: adobe.indesign.sdk
Article #4289

kFitContentToFrameCmdBoss generates a crash

#4289
From: florian_kunz
Date: Fri, 25 Jun 2004 12:48
70 lines
2686 bytes
Hello everybody

I've written a function to resize an image. When I execute the command "kFitContentToFrameCmdBoss" my application hangs up.
Can anybody help me? Did I forgot somethin or is my way generally false?
I'm thankful for every help i get.

int CMyClass::Transform(UIDRef frameUIDRef, PMReal pmrWidth, PMReal pmrHeight)
{
	int rc=0;

	if(frameUIDRef != nil && frameUIDRef != UIDRef::gNull){	
		UIDList uidList(frameUIDRef);
		// create command 2 set the width of the choosen frame
		ICommand* pCommand = Utils<ITransformCmdUtils>()->CreateDefaultSetWidthCommand(
									uidList, pmrWidth, kFalse, kFalse,
									IGeometry::kResizeItemAndChildren);
		if(pCommand){
			InterfacePtr<ICommand> setWidthCmd(pCommand);

			if(setWidthCmd != nil){
				// now process cmd
				if(CmdUtils::ExecuteCommand(setWidthCmd) == kSuccess){
					// create command 2 set the height of the choosen frame
					ICommand* pCommand = Utils<ITransformCmdUtils>()->CreateDefaultSetHeightCommand(
												uidList, pmrWidth, kFalse, kFalse,
												IGeometry::kResizeItemAndChildren);
					if(pCommand){
						InterfacePtr<ICommand> setHeightCmd(pCommand);
						if(setHeightCmd != nil){
							// execute the cmd
							if(CmdUtils::ExecuteCommand(setHeightCmd) == kSuccess){
								// at least we have 2 fit the content 2 the frame
								InterfacePtr<ICommand> fitContentToFrameCmd(CmdUtils::CreateCommand(kFitContentToFrameCmdBoss));

								if(fitContentToFrameCmd != nil){

									fitContentToFrameCmd->SetItemList(UIDList(frameUIDRef));

!!! Here is the part where my application crashes !!!

									if(CmdUtils::ExecuteCommand(fitContentToFrameCmd) != kSuccess){
										rc = - 7010;
									}
								} else{
									rc = -7009;
								}
							} else{
								rc = -7008;
							}
						} else{
							rc = -7006;
						}
					} else{
						rc = -7005;
					}
				} else{
					rc = -7004;
				}
			} else{
				rc = -7003;
			}
		} else{
			rc = -7002;
		}
	} else{
		rc = -7001;
	}

	return rc;
}
Technical Details
Message-ID: <3bb4c5e6.-1@webx.la2eafNXanI>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news.glorb.com!npeer.de.kpn-eurorings.net!feed.news.schlund.de!schlund.de!newsfeed01.sul.t-online.de!t-online.de!webx

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f63e9,a06ff4a4a4939606,start
X-Google-Attributes: gidf63e9,public
From: florian_kunz@adobeforums.com
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news.glorb.com!npeer.de.kpn-eurorings.net!feed.news.schlund.de!schlund.de!newsfeed01.sul.t-online.de!t-online.de!webx
Newsgroups: adobe.indesign.sdk
Subject: kFitContentToFrameCmdBoss generates a crash
Message-ID: <3bb4c5e6.-1@webx.la2eafNXanI>
Date: Fri, 25 Jun 2004 05:48:30 -0700
Lines: 75
MIME-Version: 1.0
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit