2 Replies Latest reply on Oct 8, 2015 2:52 AM by [Jongware]

    How to check Overset in Table Cell?

    lalitpatil

      Hi all,

       

      I am trying to check whether the table cell is overset or not with the help of

       

      GridID  and tableModel but  i am not getting overset in cell. Please help me.

       

      My code :

       

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

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

      while(iterTable != end)

      {

          GridAddress grdAdd = *iterTable;

          GridID gridid=tableModel->GetGridID(grdAdd);

          if( CheckOverset(tableModel,gridid) == kTrue)

          {

              CAlert::ErrorAlert("Cell is Overset");

          }

          ++iterTable;

      }

       

      bool16 CheckOverset(InterfacePtr<ITableModel> tableModel,GridID gridid)

      {

          bool16 isOverset = kFalse;

         

          do{

              InterfacePtr<ITableTextContainer> tableTextContainer(tableModel, UseDefaultIID());

              if(tableTextContainer == nil)

                  break;

              InterfacePtr<ITextModel> textModel(tableTextContainer->QueryTextModel());

              if(textModel == nil)

                  break;

                 

              InterfacePtr<ITextStoryThreadDict> textStoryThreadDict(tableModel, UseDefaultIID());

              if (textStoryThreadDict == nil)

                  break;

                 

              InterfacePtr<ITextStoryThread> textStoryThread(textStoryThreadDict->QueryThread(gridid));

              if (textStoryThread == nil)

                  break;

                 

              InterfacePtr<ITextModel> iTextModel(textStoryThread->QueryTextModel());   

              if (iTextModel == nil)

                  break;

              const UIDRef tableRef(::GetUIDRef(tableModel));

              TextIndex threadStart, threadLength;

              iTextModel->FindStoryThread(tableRef.GetUID(), gridid, &threadStart, &threadLength);

              TextIndex iEnd = threadStart + threadLength;

       

              InterfacePtr<ITextParcelList> textParcelList(textModel->QueryTextParcelList(threadStart));

              if (!textParcelList)

                  break;

              if(textParcelList->GetIsOverset(&threadStart) == kTrue)

              {

                  isOverset = kTrue;

                 

              }   

          }while(false);

          return isOverset;

      }

       

      I am getting tableModel from another plug in.

       

       

      I Really Hope Somebody has a solution for this Issue.

      Thanks in adavance,

       

      Lallit Patil