Module: appdb
Branch: master
Commit: d91eef59cf1f5c967d4e6896be229867674519c2
URL: http://source.winehq.org/git/appdb.git/?a=commit;h=d91eef59cf1f5c967d4e6896…
Author: Alexander Nicolaysen Sørnes <alexsornes(a)gmail.com>
Date: Sat Jan 11 17:45:18 2014 +0100
comment: Declare static functions as such
---
include/comment.php | 24 ++++++++++++------------
1 file changed, 12 insertions(+), 12 deletions(-)
diff --git a/include/comment.php b/include/comment.php
index 3532e2c..a364d76 100644
--- a/include/comment.php
+++ b/include/comment.php
@@ -197,7 +197,7 @@ class Comment {
return false;
}
- function get_comment_count_for_versionid($iVersionId)
+ public static function get_comment_count_for_versionid($iVersionId)
{
$sQuery = "SELECT count(*) as cnt from appComments where versionId = '?'";
$hResult = query_parameters($sQuery, $iVersionId);
@@ -226,7 +226,7 @@ class Comment {
/**
* Displays the body of one comment.
*/
- function view_comment_body($iCommentId)
+ public static function view_comment_body($iCommentId)
{
$hResult = Comment::grab_comment($iCommentId);
@@ -240,7 +240,7 @@ class Comment {
/**
* display a single comment (in $oRow)
*/
- function view_app_comment($oRow, $bShowAppName = false)
+ public static function view_app_comment($oRow, $bShowAppName = false)
{
$oComment = new comment(null, $oRow);
$oComment->output_comment($bShowAppName);
@@ -411,7 +411,7 @@ class Comment {
/**
* grab single comment for commentId
*/
- function grab_comment($iCommentId)
+ public static function grab_comment($iCommentId)
{
$iCommentId = query_escape_string($iCommentId);
@@ -433,7 +433,7 @@ class Comment {
* grab comments for appId / versionId
* if parentId is not -1 only comments for that thread are returned
*/
- function grab_comments($iVersionId, $iParentId = null)
+ public static function grab_comments($iVersionId, $iParentId = null)
{
/* TODO: remove the logging when we figure out where the */
/* invalid $iVersionId is coming */
@@ -475,7 +475,7 @@ class Comment {
* display nested comments
* handle is a db result set
*/
- function do_display_comments_nested($hResult)
+ public static function do_display_comments_nested($hResult)
{
while($oRow = query_fetch_object($hResult))
{
@@ -490,7 +490,7 @@ class Comment {
}
}
- function display_comments_nested($versionId, $threadId)
+ public static function display_comments_nested($versionId, $threadId)
{
$hResult = Comment::grab_comments($versionId, $threadId);
Comment::do_display_comments_nested($hResult);
@@ -499,7 +499,7 @@ class Comment {
/**
* Generates the link to show the comment.
*/
- function comment_link($oRow)
+ public static function comment_link($oRow)
{
$sLink = "commentview.php?iAppId={$oRow->appId}&iVersionId=".
"{$oRow->versionId}&iThreadId={$oRow->parentId}";
@@ -519,7 +519,7 @@ class Comment {
* display threaded comments
* handle is a db result set
*/
- function do_display_comments_threaded($hResult, $is_main)
+ public static function do_display_comments_threaded($hResult, $is_main)
{
if (!$is_main)
echo "<ul>\n";
@@ -676,7 +676,7 @@ class Comment {
return $aObjects;
}
- function display_comments_threaded($versionId, $threadId = 0)
+ public static function display_comments_threaded($versionId, $threadId = 0)
{
$hResult = Comment::grab_comments($versionId, $threadId);
@@ -686,7 +686,7 @@ class Comment {
/**
* display flat comments
*/
- function display_comments_flat($versionId)
+ public static function display_comments_flat($versionId)
{
$hResult = Comment::grab_comments($versionId);
if ($hResult)
@@ -698,7 +698,7 @@ class Comment {
}
}
- function view_app_comments($versionId, $threadId = 0)
+ public static function view_app_comments($versionId, $threadId = 0)
{
global $aClean;
Module: wine
Branch: stable
Commit: 333365369674b7f1f8d00be4d0c6686c235100a0
URL: http://source.winehq.org/git/wine.git/?a=commit;h=333365369674b7f1f8d00be4d…
Author: Huw Davies <huw(a)codeweavers.com>
Date: Tue Dec 10 11:19:08 2013 +0000
riched20: Ensure the cursors are correctly ordered in the case of a zero (logical) length selection bridging two runs.
(cherry picked from commit b0f177b61913b9fac1cf8952582d77576705bad1)
---
dlls/riched20/caret.c | 14 +++++++++++++-
1 file changed, 13 insertions(+), 1 deletion(-)
diff --git a/dlls/riched20/caret.c b/dlls/riched20/caret.c
index fd7034d..4b1fea5 100644
--- a/dlls/riched20/caret.c
+++ b/dlls/riched20/caret.c
@@ -56,7 +56,19 @@ int ME_GetSelectionOfs(ME_TextEditor *editor, int *from, int *to)
int ME_GetSelection(ME_TextEditor *editor, ME_Cursor **from, ME_Cursor **to)
{
- if (ME_GetCursorOfs(&editor->pCursors[0]) < ME_GetCursorOfs(&editor->pCursors[1]))
+ int from_ofs = ME_GetCursorOfs( &editor->pCursors[0] );
+ int to_ofs = ME_GetCursorOfs( &editor->pCursors[1] );
+ BOOL swap = (from_ofs > to_ofs);
+
+ if (from_ofs == to_ofs)
+ {
+ /* If cursor[0] is at the beginning of a run and cursor[1] at the end
+ of the prev run then we need to swap. */
+ if (editor->pCursors[0].nOffset < editor->pCursors[1].nOffset)
+ swap = TRUE;
+ }
+
+ if (!swap)
{
*from = &editor->pCursors[0];
*to = &editor->pCursors[1];