Last Comment Bug 720982 - Duplicated code: nsHTMLEditor::CreateBRImpl / nsPlaintextEditor::CreateBRImpl
: Duplicated code: nsHTMLEditor::CreateBRImpl / nsPlaintextEditor::CreateBRImpl
Status: RESOLVED FIXED
:
Product: Core
Classification: Components
Component: Editor (show other bugs)
: Trunk
: All All
: -- normal (vote)
: mozilla13
Assigned To: :Ms2ger (⌚ UTC+1/+2)
:
: Makoto Kato [:m_kato]
Mentors:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-01-25 04:12 PST by :Ms2ger (⌚ UTC+1/+2)
Modified: 2012-02-01 05:42 PST (History)
1 user (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
Patch v1 (4.23 KB, patch)
2012-01-25 04:12 PST, :Ms2ger (⌚ UTC+1/+2)
ehsan: review+
Details | Diff | Splinter Review
Diff (1.77 KB, patch)
2012-01-25 04:13 PST, :Ms2ger (⌚ UTC+1/+2)
no flags Details | Diff | Splinter Review
Part b: InsertBR (1.85 KB, patch)
2012-01-25 04:19 PST, :Ms2ger (⌚ UTC+1/+2)
ehsan: review+
Details | Diff | Splinter Review
Diff b (1.46 KB, patch)
2012-01-25 04:20 PST, :Ms2ger (⌚ UTC+1/+2)
no flags Details | Diff | Splinter Review

Description :Ms2ger (⌚ UTC+1/+2) 2012-01-25 04:12:51 PST
Created attachment 591411 [details] [diff] [review]
Patch v1

As in 2001: bug 68747.
Comment 1 :Ms2ger (⌚ UTC+1/+2) 2012-01-25 04:13:39 PST
Created attachment 591412 [details] [diff] [review]
Diff

Difference between the implementations.
Comment 2 :Ms2ger (⌚ UTC+1/+2) 2012-01-25 04:19:40 PST
Created attachment 591413 [details] [diff] [review]
Part b: InsertBR

Two for the price of one
Comment 3 :Ms2ger (⌚ UTC+1/+2) 2012-01-25 04:20:10 PST
Created attachment 591414 [details] [diff] [review]
Diff b
Comment 4 :Ehsan Akhgari 2012-01-27 09:31:52 PST
Comment on attachment 591411 [details] [diff] [review]
Patch v1

Review of attachment 591411 [details] [diff] [review]:
-----------------------------------------------------------------

r=me with the below.

::: editor/libeditor/html/nsHTMLEditor.cpp
@@ +1386,5 @@
>                                           nsCOMPtr<nsIDOMNode> *outBRNode, 
>                                           EDirection aSelect)
>  {
> +  return nsPlaintextEditor::CreateBRImpl(aInOutParent, aInOutOffset, outBRNode,
> +                                         aSelect);

Why not just remove this function altogether?  :-)
Comment 5 :Ehsan Akhgari 2012-01-27 09:32:27 PST
Comment on attachment 591413 [details] [diff] [review]
Part b: InsertBR

Review of attachment 591413 [details] [diff] [review]:
-----------------------------------------------------------------

::: editor/libeditor/html/nsHTMLEditor.cpp
@@ +1399,5 @@
>  }
>  
>  NS_IMETHODIMP nsHTMLEditor::InsertBR(nsCOMPtr<nsIDOMNode> *outBRNode)
>  {
> +  return nsPlaintextEditor::InsertBR(outBRNode);

Again, please just remove this method!

Note You need to log in before you can comment on or make changes to this bug.