Fixed some data transfer bugs

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@75047 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Julian Smart
2013-10-18 19:27:06 +00:00
parent dcc9f9c1e4
commit 736a9ccdfa
3 changed files with 15 additions and 19 deletions

View File

@@ -85,11 +85,11 @@ public:
virtual void FillStyleComboBox(wxComboBox* styleComboBox); virtual void FillStyleComboBox(wxComboBox* styleComboBox);
/// Set the border controls /// Set the border controls
static void SetBorderValue(wxTextAttrBorder& border, /* wxTextAttrBorder& borderToReset, */ wxTextCtrl* widthValueCtrl, wxComboBox* widthUnitsCtrl, wxCheckBox* checkBox, static void SetBorderValue(wxTextAttrBorder& border, wxTextCtrl* widthValueCtrl, wxComboBox* widthUnitsCtrl, wxCheckBox* checkBox,
wxComboBox* styleCtrl, wxRichTextColourSwatchCtrl* colourCtrl, const wxArrayInt& borderStyles); wxComboBox* styleCtrl, wxRichTextColourSwatchCtrl* colourCtrl, const wxArrayInt& borderStyles);
/// Get data from the border controls /// Get data from the border controls
static void GetBorderValue(wxTextAttrBorder& border, /* wxTextAttrBorder& borderToReset, */ wxTextCtrl* widthValueCtrl, wxComboBox* widthUnitsCtrl, wxCheckBox* checkBox, static void GetBorderValue(wxTextAttrBorder& border, wxTextCtrl* widthValueCtrl, wxComboBox* widthUnitsCtrl, wxCheckBox* checkBox,
wxComboBox* styleCtrl, wxRichTextColourSwatchCtrl* colourCtrl, const wxArrayInt& borderStyles); wxComboBox* styleCtrl, wxRichTextColourSwatchCtrl* colourCtrl, const wxArrayInt& borderStyles);
////@begin wxRichTextBordersPage event handler declarations ////@begin wxRichTextBordersPage event handler declarations

View File

@@ -610,7 +610,7 @@ bool wxRichTextBordersPage::TransferDataFromWindow()
} }
// Set the border controls // Set the border controls
void wxRichTextBordersPage::SetBorderValue(wxTextAttrBorder& border, /* wxTextAttrBorder& borderToReset, */ wxTextCtrl* widthValueCtrl, wxComboBox* widthUnitsCtrl, wxCheckBox* checkBox, void wxRichTextBordersPage::SetBorderValue(wxTextAttrBorder& border, wxTextCtrl* widthValueCtrl, wxComboBox* widthUnitsCtrl, wxCheckBox* checkBox,
wxComboBox* styleCtrl, wxRichTextColourSwatchCtrl* colourCtrl, const wxArrayInt& borderStyles) wxComboBox* styleCtrl, wxRichTextColourSwatchCtrl* colourCtrl, const wxArrayInt& borderStyles)
{ {
if (!border.IsValid()) if (!border.IsValid())
@@ -628,7 +628,7 @@ void wxRichTextBordersPage::SetBorderValue(wxTextAttrBorder& border, /* wxTextAt
units.Add(wxTEXT_ATTR_UNITS_TENTHS_MM); units.Add(wxTEXT_ATTR_UNITS_TENTHS_MM);
units.Add(wxTEXT_ATTR_UNITS_HUNDREDTHS_POINT); units.Add(wxTEXT_ATTR_UNITS_HUNDREDTHS_POINT);
wxRichTextFormattingDialog::SetDimensionValue(border.GetWidth(), widthValueCtrl, widthUnitsCtrl, checkBox, wxRichTextFormattingDialog::SetDimensionValue(border.GetWidth(), widthValueCtrl, widthUnitsCtrl, NULL,
& units); & units);
int sel = borderStyles.Index(border.GetStyle()); int sel = borderStyles.Index(border.GetStyle());
@@ -645,7 +645,7 @@ void wxRichTextBordersPage::SetBorderValue(wxTextAttrBorder& border, /* wxTextAt
} }
// Get data from the border controls // Get data from the border controls
void wxRichTextBordersPage::GetBorderValue(wxTextAttrBorder& border, /* wxTextAttrBorder& borderToReset, */ wxTextCtrl* widthValueCtrl, wxComboBox* widthUnitsCtrl, wxCheckBox* checkBox, void wxRichTextBordersPage::GetBorderValue(wxTextAttrBorder& border, wxTextCtrl* widthValueCtrl, wxComboBox* widthUnitsCtrl, wxCheckBox* checkBox,
wxComboBox* styleCtrl, wxRichTextColourSwatchCtrl* colourCtrl, const wxArrayInt& borderStyles) wxComboBox* styleCtrl, wxRichTextColourSwatchCtrl* colourCtrl, const wxArrayInt& borderStyles)
{ {
wxArrayInt units; wxArrayInt units;
@@ -653,7 +653,7 @@ void wxRichTextBordersPage::GetBorderValue(wxTextAttrBorder& border, /* wxTextAt
units.Add(wxTEXT_ATTR_UNITS_TENTHS_MM); units.Add(wxTEXT_ATTR_UNITS_TENTHS_MM);
units.Add(wxTEXT_ATTR_UNITS_HUNDREDTHS_POINT); units.Add(wxTEXT_ATTR_UNITS_HUNDREDTHS_POINT);
wxRichTextFormattingDialog::GetDimensionValue(border.GetWidth(), widthValueCtrl, widthUnitsCtrl, checkBox, wxRichTextFormattingDialog::GetDimensionValue(border.GetWidth(), widthValueCtrl, widthUnitsCtrl, NULL,
& units); & units);
int sel = styleCtrl->GetSelection(); int sel = styleCtrl->GetSelection();
@@ -663,17 +663,14 @@ void wxRichTextBordersPage::GetBorderValue(wxTextAttrBorder& border, /* wxTextAt
{ {
// When we apply the attributes, we won't apply this one, to leave the original unchanged. // When we apply the attributes, we won't apply this one, to leave the original unchanged.
border.Reset(); border.Reset();
// borderToReset.Reset();
} }
else if (checkBox->Get3StateValue() == wxCHK_UNCHECKED) else if (checkBox->Get3StateValue() == wxCHK_UNCHECKED)
{ {
// We make a note to reset this attribute.
// borderToReset.GetWidth().MakeValid();
border.SetStyle(wxTEXT_BOX_ATTR_BORDER_NONE); border.SetStyle(wxTEXT_BOX_ATTR_BORDER_NONE);
border.GetWidth().SetValue(0);
} }
else else
{ {
// borderToReset.Reset(); // Don't reset this, in case we were going to previously.
if (sel != -1) if (sel != -1)
border.SetStyle(borderStyles[sel]); border.SetStyle(borderStyles[sel]);
} }

View File

@@ -3143,7 +3143,6 @@ bool wxRichTextParagraphLayoutBox::PositionToXY(long pos, long* x, long* y) cons
} }
/// Get the leaf object in a paragraph at this position. /// Get the leaf object in a paragraph at this position.
/// Given a line number, get the corresponding wxRichTextLine object.
wxRichTextObject* wxRichTextParagraphLayoutBox::GetLeafObjectAtPosition(long position) const wxRichTextObject* wxRichTextParagraphLayoutBox::GetLeafObjectAtPosition(long position) const
{ {
wxRichTextParagraph* para = GetParagraphAtPosition(position); wxRichTextParagraph* para = GetParagraphAtPosition(position);
@@ -12954,16 +12953,16 @@ bool wxTextBoxAttr::Apply(const wxTextBoxAttr& attr, const wxTextBoxAttr* compar
SetBoxStyleName(attr.GetBoxStyleName()); SetBoxStyleName(attr.GetBoxStyleName());
} }
m_margins.Apply(attr.m_margins, compareWith ? (& attr.m_margins) : (const wxTextAttrDimensions*) NULL); m_margins.Apply(attr.m_margins, compareWith ? (& compareWith->m_margins) : (const wxTextAttrDimensions*) NULL);
m_padding.Apply(attr.m_padding, compareWith ? (& attr.m_padding) : (const wxTextAttrDimensions*) NULL); m_padding.Apply(attr.m_padding, compareWith ? (& compareWith->m_padding) : (const wxTextAttrDimensions*) NULL);
m_position.Apply(attr.m_position, compareWith ? (& attr.m_position) : (const wxTextAttrDimensions*) NULL); m_position.Apply(attr.m_position, compareWith ? (& compareWith->m_position) : (const wxTextAttrDimensions*) NULL);
m_size.Apply(attr.m_size, compareWith ? (& attr.m_size) : (const wxTextAttrSize*) NULL); m_size.Apply(attr.m_size, compareWith ? (& compareWith->m_size) : (const wxTextAttrSize*) NULL);
m_minSize.Apply(attr.m_minSize, compareWith ? (& attr.m_minSize) : (const wxTextAttrSize*) NULL); m_minSize.Apply(attr.m_minSize, compareWith ? (& compareWith->m_minSize) : (const wxTextAttrSize*) NULL);
m_maxSize.Apply(attr.m_maxSize, compareWith ? (& attr.m_maxSize) : (const wxTextAttrSize*) NULL); m_maxSize.Apply(attr.m_maxSize, compareWith ? (& compareWith->m_maxSize) : (const wxTextAttrSize*) NULL);
m_border.Apply(attr.m_border, compareWith ? (& attr.m_border) : (const wxTextAttrBorders*) NULL); m_border.Apply(attr.m_border, compareWith ? (& compareWith->m_border) : (const wxTextAttrBorders*) NULL);
m_outline.Apply(attr.m_outline, compareWith ? (& attr.m_outline) : (const wxTextAttrBorders*) NULL); m_outline.Apply(attr.m_outline, compareWith ? (& compareWith->m_outline) : (const wxTextAttrBorders*) NULL);
return true; return true;
} }