git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74910
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
wxRichTextAction* action = NULL;
wxRichTextObject* clone = NULL;
wxRichTextAction* action = NULL;
wxRichTextObject* clone = NULL;
+ // The object on which to set properties will usually be 'obj', but use objToSet if it's valid.
+ // This is necessary e.g. on setting a wxRichTextCell's properties, when obj will be the parent table
+ if (objToSet == NULL)
+ objToSet = &obj;
+
if (rtc->SuppressingUndo())
if (rtc->SuppressingUndo())
- obj.SetProperties(properties);
+ objToSet->SetProperties(properties);
else
{
clone = obj.Clone();
else
{
clone = obj.Clone();
- if (objToSet)
- {
- // Necessary e.g. if when setting a wxRichTextCell's properties, when obj will be the parent table
- objToSet->SetProperties(properties);
- }
- else
- {
- obj.SetProperties(properties);
- }
+ objToSet->SetProperties(properties);
// The 'true' parameter in the next line says "Ignore first time"; otherwise the objects are prematurely switched
action = new wxRichTextAction(NULL, _("Change Properties"), wxRICHTEXT_CHANGE_OBJECT, buffer, obj.GetParentContainer(), rtc, true);
// The 'true' parameter in the next line says "Ignore first time"; otherwise the objects are prematurely switched
action = new wxRichTextAction(NULL, _("Change Properties"), wxRICHTEXT_CHANGE_OBJECT, buffer, obj.GetParentContainer(), rtc, true);