Use correct selection after editing cell properties
This commit is contained in:
@@ -9931,11 +9931,14 @@ bool wxRichTextCell::EditProperties(wxWindow* parent, wxRichTextBuffer* buffer)
|
|||||||
bool multipleCells = false;
|
bool multipleCells = false;
|
||||||
wxRichTextAttr attr;
|
wxRichTextAttr attr;
|
||||||
|
|
||||||
if (table && buffer && buffer->GetRichTextCtrl() && buffer->GetRichTextCtrl()->GetSelection().IsValid() &&
|
wxRichTextSelection sel;
|
||||||
buffer->GetRichTextCtrl()->GetSelection().GetContainer() == GetParent())
|
if (buffer->GetRichTextCtrl())
|
||||||
|
sel = buffer->GetRichTextCtrl()->GetSelection();
|
||||||
|
|
||||||
|
if (table && buffer && buffer->GetRichTextCtrl() && sel.IsValid() &&
|
||||||
|
sel.GetContainer() == GetParent())
|
||||||
{
|
{
|
||||||
wxRichTextAttr clashingAttr, absentAttr;
|
wxRichTextAttr clashingAttr, absentAttr;
|
||||||
const wxRichTextSelection& sel = buffer->GetRichTextCtrl()->GetSelection();
|
|
||||||
size_t i;
|
size_t i;
|
||||||
int selectedCellCount = 0;
|
int selectedCellCount = 0;
|
||||||
for (i = 0; i < sel.GetCount(); i++)
|
for (i = 0; i < sel.GetCount(); i++)
|
||||||
@@ -9984,7 +9987,6 @@ bool wxRichTextCell::EditProperties(wxWindow* parent, wxRichTextBuffer* buffer)
|
|||||||
{
|
{
|
||||||
if (multipleCells)
|
if (multipleCells)
|
||||||
{
|
{
|
||||||
const wxRichTextSelection& sel = buffer->GetRichTextCtrl()->GetSelection();
|
|
||||||
// Apply the style; we interpret indeterminate attributes as 'don't touch this attribute'
|
// Apply the style; we interpret indeterminate attributes as 'don't touch this attribute'
|
||||||
// since it may represent clashing attributes across multiple objects.
|
// since it may represent clashing attributes across multiple objects.
|
||||||
table->SetCellStyle(sel, attr);
|
table->SetCellStyle(sel, attr);
|
||||||
|
Reference in New Issue
Block a user