Applying TabStopTable to paragraph using kTextAttrTabsBoss and ITextAttributeSuite

Explorer ,
May 16, 2021 May 16, 2021

Copy link to clipboard

Copied

Hello,

In my code I apply a variety of text and paragraph formatting, using the appropriate k*Boss and ITextAttributeSuite.

It works well in all cases except tabs.

For tabs, I create a TabStopTable, but then I cannot find the correct syntax to apply TabStopTable to the current paragraph.

For example, to set the alignment, I use:

ITextAttrAlign::ValueType alignmentType = (ITextAttrAlign::ValueType)(alignment);
InterfacePtr<IAttrReport> itextAttrAlign(SnpTextAttrHelper::CreateTextAttribute<ITextAttrAlign, ITextAttrAlign::ValueType>(kTextAttrAlignmentBoss, alignmentType));
paraAttributeBossList->ApplyAttribute(itextAttrAlign);

But, despite scouring the SDK samples, I could not find any code that shows how to call CreateTextAttribute() based on a TabStopTable.

Can anyone help ?

Very best regards,

Olivier

TOPICS
How to, SDK

Views

57

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
community guidelines

correct answers 1 Correct Answer

Explorer , May 16, 2021 May 16, 2021
Actually, in the cold light of day, I found the solution. which I am enclosing below for anyone else's reference.TabStopTable tabsTable; for (int16 tctr = 0; tctr < numNewTabs; tctr++) { TabStop iTabStop = TabStop(); // set the position and alignment of the tab // ... tabsTable.Insert(iTabStop); } InterfacePtr<IAttrReport> iTextAttrTabSettings(SnpTextAttrHelper::CreateTextAttribute<ITextAttrTabSettings, ITextAttrTabSettings::ValueType>(kTextAttrTabsBoss, tabsTable)); paraAttributeBossList...

Likes

Translate

Translate
Explorer ,
May 16, 2021 May 16, 2021

Copy link to clipboard

Copied

LATEST

Actually, in the cold light of day, I found the solution. which I am enclosing below for anyone else's reference.

TabStopTable tabsTable;

for (int16 tctr = 0; tctr < numNewTabs; tctr++)
{
	TabStop iTabStop = TabStop();
	// set the position and alignment of the tab
	// ...
	tabsTable.Insert(iTabStop);
}

InterfacePtr<IAttrReport> iTextAttrTabSettings(SnpTextAttrHelper::CreateTextAttribute<ITextAttrTabSettings, ITextAttrTabSettings::ValueType>(kTextAttrTabsBoss, tabsTable));

paraAttributeBossList->ApplyAttribute(iTextAttrTabSettings);

Hope this helps someone.

Olivier

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
community guidelines