[PATCH 19/24] [RichEdit]: small optimisation in ME_GetSelectionInsertStyle

Eric Pouech eric.pouech at orange.fr
Tue Jan 1 15:05:16 CST 2008




A+
---

 dlls/riched20/caret.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/dlls/riched20/caret.c b/dlls/riched20/caret.c
index 2ca076d..2337107 100644
--- a/dlls/riched20/caret.c
+++ b/dlls/riched20/caret.c
@@ -1244,11 +1244,11 @@ ME_Style *ME_GetSelectionInsertStyle(ME_TextEditor *editor)
 {
   ME_Style *style;
   int from, to;
-  ME_Cursor c;
-  
+
   ME_GetSelection(editor, &from, &to);
-  ME_CursorFromCharOfs(editor, from, &c);
   if (from != to) {
+    ME_Cursor c;
+    ME_CursorFromCharOfs(editor, from, &c);
     style = c.pRun->member.run.style;
     ME_AddRefStyle(style); /* ME_GetInsertStyle has already done that */
   }





More information about the wine-patches mailing list