🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: adobe.indesign.sdk
Article #134

InDesign CS4 Win/Mac UID Allocation

#134
From: John_Darnell
Date: Wed, 04 Mar 2009 21:37
33 lines
1946 bytes
Hello all:

I inherited this code from a programmer who is no longer with the company:

URI URIPath;
URIUTILS -> IDFileToURI(path, URIPath);
// Set the IImportResourceCmdData Interface's data:
InterfacePtr<IImportResourceCmdData> importFileCmdData(importAndLoadPlaceGunCmd, IID_IIMPORTRESOURCECMDDATA);

importFileCmdData -> Set(db, URIPath, (K2::UIFlags)0, kTrue, kFalse);
ErrorCode status = CmdUtils::ProcessCommand(importAndLoadPlaceGunCmd);
const UIDList* imageList = importAndLoadPlaceGunCmd -> GetItemList();
if (!imageList || imageList -> Length() == 0)
   break;

UIDRef imageFrame = imageList -> GetRef(0);
InterfacePtr<IHierarchy> imageFrameHierarchy(imageFrame, UseDefaultIID());

UIDRef newImage(db, imageFrameHierarchy -> GetChildUID(0));

imageFrameHierarchy -> Remove(imageFrameHierarchy -> GetChildUID(0));

This code places an image on the page at preset coordinates (that part is not shown). The code works. The only problem I am having with this is the final statement. It causes the following notification to appear when the document is closed (determined through a careful and tedious process of trial and error):

Document has XX UIDs that are allocated but not used.

The "XX" invariably corresponds to the number of images placed through this code.

Can anyone help me figure out where the code is duplicating UIDs?

TIA!

John
Technical Details
Message-ID: <59b81dd6.-1@webcrossing.la2eafNXanI>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news.glorb.com!news2.glorb.com!newshub.sdsu.edu!webcrossing

Show Full Headers
Complete Article Headers
X-Google-Thread: f63e9,35c1e92820c0eb49,start
X-Google-Attributes: gidf63e9,domainid0,public,usenet
X-Google-Language: ENGLISH,ASCII-7-bit
From: John_Darnell@adobeforums.com
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news.glorb.com!news2.glorb.com!newshub.sdsu.edu!webcrossing
Newsgroups: adobe.indesign.sdk
Subject: InDesign CS4 Win/Mac UID Allocation
Message-ID: <59b81dd6.-1@webcrossing.la2eafNXanI>
Date: Wed, 4 Mar 2009 13:37:57 -0800
Lines: 41
MIME-Version: 1.0
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit