From 0cd7db14f03a5f4c37438551337fcf4f8d2d9dd8 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Fri, 25 May 2012 09:48:16 +0000 Subject: [PATCH 1/1] Fully implement wxStyledTextCtrl::PositionToXY(). Fill in the column parameter too now. Closes #14332. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71557 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- docs/changes.txt | 1 + include/wx/stc/stc.h | 11 +++++------ src/stc/stc.h.in | 11 +++++------ 3 files changed, 11 insertions(+), 12 deletions(-) diff --git a/docs/changes.txt b/docs/changes.txt index 2fb3acad3b..b4bf4a9290 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -550,6 +550,7 @@ All (GUI): - Added support for fields and virtual attributes to wxRichTextCtrl. - Added custom text and dimension scaling to wxRichTextCtrl. - Added pixel font size capability to wxTextAttr and wxRichTextCtrl. +- Fully implement wxStyledTextCtrl::PositionToXY() (troelsk). GTK: diff --git a/include/wx/stc/stc.h b/include/wx/stc/stc.h index 0ac137cae1..7956d13f8e 100644 --- a/include/wx/stc/stc.h +++ b/include/wx/stc/stc.h @@ -4200,16 +4200,15 @@ public: virtual bool PositionToXY(long pos, long *x, long *y) const { + long l = LineFromPosition(pos); + if ( l == -1 ) + return false; + if ( x ) - *x = -1; // TODO + *x = pos - PositionFromLine(l); if ( y ) - { - long l = LineFromPosition(pos); - if ( l == -1 ) - return false; *y = l; - } return true; } diff --git a/src/stc/stc.h.in b/src/stc/stc.h.in index ff6a136ab9..ab4ddab4ba 100644 --- a/src/stc/stc.h.in +++ b/src/stc/stc.h.in @@ -398,16 +398,15 @@ public: virtual bool PositionToXY(long pos, long *x, long *y) const { + long l = LineFromPosition(pos); + if ( l == -1 ) + return false; + if ( x ) - *x = -1; // TODO + *x = pos - PositionFromLine(l); if ( y ) - { - long l = LineFromPosition(pos); - if ( l == -1 ) - return false; *y = l; - } return true; } -- 2.45.2