🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: adobe.indesign.sdk
Article #548

Re: How to get IAttributeStrand for each Cell in Table

#548
From: Farzana Arethwala
Date: Mon, 29 Dec 2008 14:37
49 lines
2854 bytes
Hi,

Thanks for the prompt reply. By the way I forgot to mention that we are using the same in CS3.
We tried as you have mentioned in your mail. But we did not find any way to achieve the ITextStoryThread from ICellConent. We tried all possible ways but we always get the Text Frame TextModel.
We have used following code to get TextModel for each cell. We get correct startindex and endindex for each cell and also get the valid TextModel Interface. But when we try to find out its length then it returns the whole TextModel length.
Thus when we try to apply different attributes for each cell then it applies to whole table.
E.g. When we try to apply 12 font size for 1st cell then it also applies to remaining cells. So we think we are not able to find out correct TextModel for each cell.

Below is our snippet of code on what we tried.

ITableModel::const_iterator iterTable(tableModel->begin());
ITableModel::const_iterator end(tableModel->end());

while(iterTable != end)
{
GridAddress gridAddress = *iterTable;
GridID gridid= tableModel->GetGridID(gridAddress);

InterfacePtr<ITableTextContainer> tableTextContainer(tableModel, UseDefaultIID());
   if(tableTextContainer != nil)
   {
       InterfacePtr<ITextModel> textModel(tableTextContainer->QueryTextModel());
       if(textModel != nil)
       {
          InterfacePtr<ITextStoryThreadDict> textStoryThreadDict(tableModel, UseDefaultIID());
          if (textStoryThreadDict != nil)
          {
              InterfacePtr<ITextStoryThread> textStoryThread(textStoryThreadDict->QueryThread(gridid));
              if (textStoryThread != nil)
              {
                 InterfacePtr<ITextModel> iTextModel(textStoryThread->QueryTextModel());
                 if (iTextModel != nil)
                 {
                      TextIndex startIndx;
                      TextIndex endIndx;
                      startIndx=textStoryThread->GetTextStart(&endIndx);
                 }
                 else
                     CAlert::ErrorAlert("iTextModel == nil");
             }
          }
       }
   }

++iterTable;
 }

Regards,
Farzana.
Technical Details
Message-ID: <59b75beb.1@webcrossing.la2eafNXanI>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!npeer01.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!newshub.sdsu.edu!webcrossing
References: <59b75beb.-1@webcrossing.la2eafNXanI>

Show Full Headers
Complete Article Headers
X-Google-Thread: f63e9,c7ebe509552beb06
X-Google-Attributes: gidf63e9,domainid0,public,usenet
X-Google-Language: ENGLISH,ASCII-7-bit
From: "Farzana Arethwala" <farzana@sansuisoftware.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!npeer01.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!newshub.sdsu.edu!webcrossing
Newsgroups: adobe.indesign.sdk
Subject: Re: How to get IAttributeStrand for each Cell in Table
Message-ID: <59b75beb.1@webcrossing.la2eafNXanI>
Date: Mon, 29 Dec 2008 06:37:36 -0800
References: <59b75beb.-1@webcrossing.la2eafNXanI>
Lines: 64
MIME-Version: 1.0
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit