Removed redundant code
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@43722 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -1187,7 +1187,6 @@ void MyFrame::OnIndentMore(wxCommandEvent& WXUNUSED(event))
|
|||||||
if (m_richTextCtrl->HasSelection())
|
if (m_richTextCtrl->HasSelection())
|
||||||
range = m_richTextCtrl->GetSelectionRange();
|
range = m_richTextCtrl->GetSelectionRange();
|
||||||
|
|
||||||
wxFontData fontData;
|
|
||||||
attr.SetLeftIndent(attr.GetLeftIndent() + 100);
|
attr.SetLeftIndent(attr.GetLeftIndent() + 100);
|
||||||
|
|
||||||
attr.SetFlags(wxTEXT_ATTR_LEFT_INDENT);
|
attr.SetFlags(wxTEXT_ATTR_LEFT_INDENT);
|
||||||
@@ -1206,10 +1205,9 @@ void MyFrame::OnIndentLess(wxCommandEvent& WXUNUSED(event))
|
|||||||
if (m_richTextCtrl->HasSelection())
|
if (m_richTextCtrl->HasSelection())
|
||||||
range = m_richTextCtrl->GetSelectionRange();
|
range = m_richTextCtrl->GetSelectionRange();
|
||||||
|
|
||||||
if (attr.GetLeftIndent() >= 100)
|
if (attr.GetLeftIndent() > 0)
|
||||||
{
|
{
|
||||||
wxFontData fontData;
|
attr.SetLeftIndent(wxMax(0, attr.GetLeftIndent() - 100));
|
||||||
attr.SetLeftIndent(attr.GetLeftIndent() - 100);
|
|
||||||
|
|
||||||
m_richTextCtrl->SetStyle(range, attr);
|
m_richTextCtrl->SetStyle(range, attr);
|
||||||
}
|
}
|
||||||
@@ -1227,7 +1225,6 @@ void MyFrame::OnLineSpacingHalf(wxCommandEvent& WXUNUSED(event))
|
|||||||
if (m_richTextCtrl->HasSelection())
|
if (m_richTextCtrl->HasSelection())
|
||||||
range = m_richTextCtrl->GetSelectionRange();
|
range = m_richTextCtrl->GetSelectionRange();
|
||||||
|
|
||||||
wxFontData fontData;
|
|
||||||
attr.SetFlags(wxTEXT_ATTR_LINE_SPACING);
|
attr.SetFlags(wxTEXT_ATTR_LINE_SPACING);
|
||||||
attr.SetLineSpacing(15);
|
attr.SetLineSpacing(15);
|
||||||
|
|
||||||
@@ -1246,7 +1243,6 @@ void MyFrame::OnLineSpacingDouble(wxCommandEvent& WXUNUSED(event))
|
|||||||
if (m_richTextCtrl->HasSelection())
|
if (m_richTextCtrl->HasSelection())
|
||||||
range = m_richTextCtrl->GetSelectionRange();
|
range = m_richTextCtrl->GetSelectionRange();
|
||||||
|
|
||||||
wxFontData fontData;
|
|
||||||
attr.SetFlags(wxTEXT_ATTR_LINE_SPACING);
|
attr.SetFlags(wxTEXT_ATTR_LINE_SPACING);
|
||||||
attr.SetLineSpacing(20);
|
attr.SetLineSpacing(20);
|
||||||
|
|
||||||
@@ -1265,7 +1261,6 @@ void MyFrame::OnLineSpacingSingle(wxCommandEvent& WXUNUSED(event))
|
|||||||
if (m_richTextCtrl->HasSelection())
|
if (m_richTextCtrl->HasSelection())
|
||||||
range = m_richTextCtrl->GetSelectionRange();
|
range = m_richTextCtrl->GetSelectionRange();
|
||||||
|
|
||||||
wxFontData fontData;
|
|
||||||
attr.SetFlags(wxTEXT_ATTR_LINE_SPACING);
|
attr.SetFlags(wxTEXT_ATTR_LINE_SPACING);
|
||||||
attr.SetLineSpacing(0); // Can also use 10
|
attr.SetLineSpacing(0); // Can also use 10
|
||||||
|
|
||||||
@@ -1284,7 +1279,6 @@ void MyFrame::OnParagraphSpacingMore(wxCommandEvent& WXUNUSED(event))
|
|||||||
if (m_richTextCtrl->HasSelection())
|
if (m_richTextCtrl->HasSelection())
|
||||||
range = m_richTextCtrl->GetSelectionRange();
|
range = m_richTextCtrl->GetSelectionRange();
|
||||||
|
|
||||||
wxFontData fontData;
|
|
||||||
attr.SetParagraphSpacingAfter(attr.GetParagraphSpacingAfter() + 20);
|
attr.SetParagraphSpacingAfter(attr.GetParagraphSpacingAfter() + 20);
|
||||||
|
|
||||||
attr.SetFlags(wxTEXT_ATTR_PARA_SPACING_AFTER);
|
attr.SetFlags(wxTEXT_ATTR_PARA_SPACING_AFTER);
|
||||||
@@ -1305,7 +1299,6 @@ void MyFrame::OnParagraphSpacingLess(wxCommandEvent& WXUNUSED(event))
|
|||||||
|
|
||||||
if (attr.GetParagraphSpacingAfter() >= 20)
|
if (attr.GetParagraphSpacingAfter() >= 20)
|
||||||
{
|
{
|
||||||
wxFontData fontData;
|
|
||||||
attr.SetParagraphSpacingAfter(attr.GetParagraphSpacingAfter() - 20);
|
attr.SetParagraphSpacingAfter(attr.GetParagraphSpacingAfter() - 20);
|
||||||
|
|
||||||
attr.SetFlags(wxTEXT_ATTR_PARA_SPACING_AFTER);
|
attr.SetFlags(wxTEXT_ATTR_PARA_SPACING_AFTER);
|
||||||
|
Reference in New Issue
Block a user