Thread View: adobe.indesign.sdk
2 messages
2 total messages
Started by Rick_Schachter
Thu, 02 Apr 2009 16:47
CS4 Crashes when attempting to change color of characters in story
Author: Rick_Schachter
Date: Thu, 02 Apr 2009 16:47
Date: Thu, 02 Apr 2009 16:47
42 lines
2138 bytes
2138 bytes
Below is a function that we have been using since forever. It changes the color of a specified number of characters in a story starting at a specific position in the textmodel.
The crash happens when processing the command (immediately after "11" is displayed).
classID is kTextAttrColorBoss.
Any help would be greatly appreciated.
ErrorCode ApplyTextAttributes(ITextModel * pTextModel, int32 position, int32 length, UID swatchUID, ClassID classID)
{
ErrorCode rc = kFailure;
do
{
InterfacePtr<ITextAttrUID> textAttrUID_Color(::CreateObject2<ITextAttrUID>(classID));
if (textAttrUID_Color == nil)
{
// ASSERT_FAIL("TSCore::CreateCharStyle: color invalid");
// CAlert::ErrorAlert("textAttrUID obj is nuil");
break;
}
if (swatchUID == kInvalidUID)
{
ASSERT_FAIL("TSCore::CreateCharStyle: ResolveRGBColorSwatch failed");
// CAlert::ErrorAlert("Invalid color UID");
break;
}
// Set our color attribute and store it:
textAttrUID_Color->SetUIDData(swatchUID);
InterfacePtr<ICommand> pApplyTextAttrCmd ( Utils<ITextAttrUtils>()->BuildApplyTextAttrCmd(pTextModel, position, length, textAttrUID_Color, kCharAttrStrandBoss) );
//pApplyTextAttrCmd->SetUndoability(ICommand::kUndoNotRequired);
CAlert::WarningAlert("11");
rc = CmdUtils::ProcessCommand(pApplyTextAttrCmd);
CAlert::WarningAlert("12");
if (rc != kSuccess)
CAlert::WarningAlert("Error on ApplyTextAttrCmd");
}while(false);
return rc;
}
Re: CS4 Crashes when attempting to change color of characters in story
Author: Rick_Schachter
Date: Fri, 03 Apr 2009 14:15
Date: Fri, 03 Apr 2009 14:15
3 lines
730 bytes
730 bytes
It turns out that this same code runs fine on the Mac, it's only crashing in Windows. Please, can anybody help!!!
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads