Highlighted

Get the cell count

Explorer ,
Jun 08, 2020

Copy link to clipboard

Copied

Hi,

I have used this code to get the table length but in this I can't able to get the value while running the code it shows an error like

error C2065: 'tableModel': undeclared identifier

left of '->begin' must point to class/struct/union/generic type
InterfacePtr<ITableTextContainer> tableTextContainer(tableModel, UseDefaultIID());

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

InterfacePtr<IComposeScanner> composeScanner(textModel, UseDefaultIID());

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

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

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

while (iterTable != end) {

GridAddress gridAddress = *iterTable;

GridSpan gridSpan = tableModel->GetCellSpan(gridAddress);

GridArea gridArea(gridAddress, gridSpan);

const GridID gridID = tableModel->GetGridID(gridAddress);

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

if (textStoryThread == nil) {

iterTable++;

continue;

}

TextIndex threadStart = 0;

int32 threadLength = -1;

threadStart = textStoryThread->GetTextStart(&threadLength);

int32 cellStrLength = threadLength - 1;

PMString cellStr;

if (cellStrLength > 0) {

WideString tempCopy;

composeScanner->CopyText(threadStart, cellStrLength, &tempCopy);

cellStr = PMString(tempCopy);

 

for ( i = 0; i < cellStrLength; i++) {

UTF32TextChar uniChar = cellStr.GetWChar(i);

if (uniChar == kTextChar_ZeroSpaceNoBreak) {

cellStr.Remove(i);

cellStrLength--;

i--;

}

}

}

//cellStrlength = cellStr.WCharLength();

PMString infoStr;

 

infoStr.Append(", textLength:");

infoStr.AppendNumber(cellStrLength);

 

CAlert::InformationAlert(infoStr);

iterTable++;

}

Please guide me.

Nithu

Topics

Bug, How to, SDK

Views

103

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

Get the cell count

Explorer ,
Jun 08, 2020

Copy link to clipboard

Copied

Hi,

I have used this code to get the table length but in this I can't able to get the value while running the code it shows an error like

error C2065: 'tableModel': undeclared identifier

left of '->begin' must point to class/struct/union/generic type
InterfacePtr<ITableTextContainer> tableTextContainer(tableModel, UseDefaultIID());

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

InterfacePtr<IComposeScanner> composeScanner(textModel, UseDefaultIID());

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

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

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

while (iterTable != end) {

GridAddress gridAddress = *iterTable;

GridSpan gridSpan = tableModel->GetCellSpan(gridAddress);

GridArea gridArea(gridAddress, gridSpan);

const GridID gridID = tableModel->GetGridID(gridAddress);

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

if (textStoryThread == nil) {

iterTable++;

continue;

}

TextIndex threadStart = 0;

int32 threadLength = -1;

threadStart = textStoryThread->GetTextStart(&threadLength);

int32 cellStrLength = threadLength - 1;

PMString cellStr;

if (cellStrLength > 0) {

WideString tempCopy;

composeScanner->CopyText(threadStart, cellStrLength, &tempCopy);

cellStr = PMString(tempCopy);

 

for ( i = 0; i < cellStrLength; i++) {

UTF32TextChar uniChar = cellStr.GetWChar(i);

if (uniChar == kTextChar_ZeroSpaceNoBreak) {

cellStr.Remove(i);

cellStrLength--;

i--;

}

}

}

//cellStrlength = cellStr.WCharLength();

PMString infoStr;

 

infoStr.Append(", textLength:");

infoStr.AppendNumber(cellStrLength);

 

CAlert::InformationAlert(infoStr);

iterTable++;

}

Please guide me.

Nithu

Topics

Bug, How to, SDK

Views

104

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

Have something to add?

Join the conversation