Merge branch 'master' into stable

This commit is contained in:
gambas 2018-05-17 00:38:57 +02:00
commit 96be03b3c6
8 changed files with 56 additions and 26 deletions

View File

@ -1371,6 +1371,8 @@ Public Sub InitEditorWithBreakpoints(hEditor As FEditor)
Dim I As Integer Dim I As Integer
Dim sPrefix As String Dim sPrefix As String
If Project.IsFake() Then Return
sPrefix = hEditor.Name & "." sPrefix = hEditor.Name & "."
While I < $aBreakpoint.Count While I < $aBreakpoint.Count
sBreakpoint = $aBreakpoint[I] sBreakpoint = $aBreakpoint[I]

View File

@ -1041,6 +1041,7 @@ Public Function CanSetBreakpoint(iLine As Integer) As Boolean
Dim sLine As String Dim sLine As String
Dim iPos As Integer Dim iPos As Integer
If Project.IsFake() Then Return
If iLine < 0 Or If iLine >= $hEditor.Count Then Return If iLine < 0 Or If iLine >= $hEditor.Count Then Return
'$hEditor[iLine].Refresh '$hEditor[iLine].Refresh
@ -1082,6 +1083,7 @@ Public Sub CheckBreakpoints()
Dim iLine As Integer Dim iLine As Integer
If Project.IsFake() Then Return
For Each iLine In $hEditor.Breakpoints For Each iLine In $hEditor.Breakpoints
If Not CanSetBreakpoint(iLine) Then SetBreakpoint(iLine, False, False) If Not CanSetBreakpoint(iLine) Then SetBreakpoint(iLine, False, False)
Next Next
@ -3350,6 +3352,7 @@ End
Public Sub mnuBreakpoint_Click() Public Sub mnuBreakpoint_Click()
If Not CanSetBreakpoint($hEditor.Line) Then Return
Design.SetBreakpoint(Me.Name & "." & CStr($hEditor.Line), Not HasBreakpoint($hEditor.Line)) Design.SetBreakpoint(Me.Name & "." & CStr($hEditor.Line), Not HasBreakpoint($hEditor.Line))
End End

View File

@ -146,6 +146,7 @@ Public Sub tvwProject_Activate()
Dim sMime As String Dim sMime As String
Dim hProgList As DesktopFile[] Dim hProgList As DesktopFile[]
Dim hProcess As Process Dim hProcess As Process
Dim sKeyClass As String
sKey = tvwProject.Key sKey = tvwProject.Key
@ -153,8 +154,9 @@ Public Sub tvwProject_Activate()
tvwProject[sKey].Expanded = True tvwProject[sKey].Expanded = True
If CanEdit(sKey) Then If CanEdit(sKey) Then
If $bCtrl Then If $bCtrl Then
If File.Ext(sKey) <> "module" Then If Project.IsSourcePath(sKey) And If File.Ext(sKey) <> "module" Then
sKey = File.SetExt(sKey, "class") sKeyClass = File.SetExt(sKey, "class")
If Project.IsSourcePath(sKeyClass) Then sKey = sKeyClass
Endif Endif
Endif Endif
Project.OpenFile(sKey,,, True) Project.OpenFile(sKey,,, True)

View File

@ -442,6 +442,7 @@ Public Sub Install(Optional bJustDownload As Boolean) As String
If LCase(Vendor) <> "example" And If Tags.Exist("example", gb.IgnoreCase) Then If LCase(Vendor) <> "example" And If Tags.Exist("example", gb.IgnoreCase) Then
Try Mkdir File.SetName(sSrcDir, "example") Try Mkdir File.SetName(sSrcDir, "example")
Try Kill File.SetName(sSrcDir, "example") &/ sName
Link ".." &/ File.Name(sSrcDir) &/ sName To File.SetName(sSrcDir, "example") &/ sName Link ".." &/ File.Name(sSrcDir) &/ sName To File.SetName(sSrcDir, "example") &/ sName
Endif Endif

View File

@ -31,6 +31,8 @@ if test "$have_poppler" = "yes"; then
AC_DEFINE_UNQUOTED(POPPLER_VERSION_0_20, $((1-$?)), Poppler version >= 0.20) AC_DEFINE_UNQUOTED(POPPLER_VERSION_0_20, $((1-$?)), Poppler version >= 0.20)
pkg-config --atleast-version=0.58.0 poppler pkg-config --atleast-version=0.58.0 poppler
AC_DEFINE_UNQUOTED(POPPLER_VERSION_0_58, $((1-$?)), Poppler version >= 0.58) AC_DEFINE_UNQUOTED(POPPLER_VERSION_0_58, $((1-$?)), Poppler version >= 0.58)
pkg-config --atleast-version=0.64.0 poppler
AC_DEFINE_UNQUOTED(POPPLER_VERSION_0_64, $((1-$?)), Poppler version >= 0.64)
fi fi
AC_OUTPUT( \ AC_OUTPUT( \

View File

@ -99,7 +99,7 @@ END_PROPERTY
****************************************************************************/ ****************************************************************************/
static void return_unicode_string(Unicode *unicode, int len) static void return_unicode_string(const Unicode *unicode, int len)
{ {
static UnicodeMap *uMap = NULL; static UnicodeMap *uMap = NULL;
@ -128,7 +128,7 @@ static void aux_return_string_info(void *_object, const char *key)
{ {
Object obj; Object obj;
Object dst; Object dst;
GooString *goo_value; const_GooString *goo_value;
Dict *info_dict; Dict *info_dict;
char *tmpstr; char *tmpstr;
@ -170,7 +170,7 @@ static void aux_return_date_info(void *_object, const char *key)
GB_DATE ret; GB_DATE ret;
Object obj; Object obj;
Object dst; Object dst;
GooString *goo; const_GooString *goo;
Dict *info_dict; Dict *info_dict;
char *datestr=NULL,*tofree=NULL; char *datestr=NULL,*tofree=NULL;
int nnum; int nnum;
@ -221,7 +221,7 @@ static void aux_return_date_info(void *_object, const char *key)
#endif #endif
} }
static LinkDest *get_dest(LinkAction *act) static const_LinkDest *get_dest(const_LinkAction *act)
{ {
if (!act) if (!act)
return 0; return 0;
@ -234,12 +234,12 @@ static LinkDest *get_dest(LinkAction *act)
} }
} }
static uint32_t aux_get_page_from_action(void *_object, LinkAction *act) static uint32_t aux_get_page_from_action(void *_object, const_LinkAction *act)
{ {
Ref pref; Ref pref;
LinkDest *dest = get_dest(act); const_LinkDest *dest = get_dest(act);
#if POPPLER_VERSION_0_6 #if POPPLER_VERSION_0_6
GooString *name; const_GooString *name;
#else #else
UGooString *name; UGooString *name;
#endif #endif
@ -252,8 +252,15 @@ static uint32_t aux_get_page_from_action(void *_object, LinkAction *act)
if (act->getKind () == actionGoTo) if (act->getKind () == actionGoTo)
{ {
name = ((LinkGoTo*)act)->getNamedDest(); name = ((LinkGoTo*)act)->getNamedDest();
if (name) if (name) {
#if POPPLER_VERSION_0_64
dest = THIS->doc->findDest(name); dest = THIS->doc->findDest(name);
#elif POPPLER_VERSION_0_6
dest = THIS->doc->findDest((GooString *) name);
#else
dest = THIS->doc->findDest((UGooString *) name);
#endif
}
} }
} }
@ -270,9 +277,9 @@ static uint32_t aux_get_page_from_action(void *_object, LinkAction *act)
} }
static void aux_get_dimensions_from_action(LinkAction *act, CPDFRECT *rect) static void aux_get_dimensions_from_action(const_LinkAction *act, CPDFRECT *rect)
{ {
LinkDest *dest = get_dest(act); const_LinkDest *dest = get_dest(act);
if (!dest) if (!dest)
return; return;
@ -282,20 +289,20 @@ static void aux_get_dimensions_from_action(LinkAction *act, CPDFRECT *rect)
rect->h = dest->getBottom() - rect->y; rect->h = dest->getBottom() - rect->y;
} }
static double aux_get_zoom_from_action(LinkAction *act) static double aux_get_zoom_from_action(const_LinkAction *act)
{ {
LinkDest *dest = get_dest(act); const_LinkDest *dest = get_dest(act);
if (dest) if (dest)
return dest->getZoom(); return dest->getZoom();
else else
return 1; return 1;
} }
static char* aux_get_target_from_action(LinkAction *act) static char* aux_get_target_from_action(const_LinkAction *act)
{ {
char *vl=NULL; char *vl=NULL;
char *uni=NULL; char *uni=NULL;
GooString *tmp=NULL; const_GooString *tmp=NULL;
switch (act->getKind()) switch (act->getKind())
{ {

View File

@ -32,6 +32,18 @@
#include <goo/GooList.h> #include <goo/GooList.h>
#include <stdint.h> #include <stdint.h>
#if POPPLER_VERSION_0_64
#define const_LinkAction const LinkAction
#define const_LinkDest const LinkDest
#define const_GooList const GooList
#define const_GooString const GooString
#else
#define const_LinkAction LinkAction
#define const_LinkDest LinkDest
#define const_GooList GooList
#define const_GooString GooString
#endif
#ifndef __CPDFDOCUMENT_C #ifndef __CPDFDOCUMENT_C
extern GB_DESC PdfRectDesc[]; extern GB_DESC PdfRectDesc[];
@ -79,18 +91,19 @@ typedef
SplashOutputDev *dev; SplashOutputDev *dev;
Page *page; Page *page;
uint currpage; uint currpage;
void **pindex; // Parent of current index entries
GooList *index; // Current entries
uint currindex; // Current entry
uint *oldindex; // Parent entry
Links *links; // Page bookmarks void **pindex; // Parent of current index entries
uint lcurrent; // Current bookmark const_GooList *index; // Current entries
uint currindex; // Current entry
uint *oldindex; // Parent entry
CPDFFIND *Found; // Found text elements Links *links; // Page bookmarks
uint lcurrent; // Current bookmark
LinkAction *action; // Current link action CPDFFIND *Found; // Found text elements
const_LinkAction *action; // Current link action
double scale; double scale;
int rotation; int rotation;

View File

@ -340,7 +340,7 @@ void XMLNode_addGBChildrenByAttributeValue(Node *node, const char *attrName, con
for(Node *tNode = node->firstChild; tNode != 0; tNode = tNode->nextNode) for(Node *tNode = node->firstChild; tNode != 0; tNode = tNode->nextNode)
{ {
if(tNode->type != Node::ElementNode) continue; if(tNode->type != Node::ElementNode) continue;
Attribute *attr = XMLElement_GetAttribute((Element*)node, attrName, lenAttrName); Attribute *attr = XMLElement_GetAttribute((Element*)tNode, attrName, lenAttrName);
if(attr) if(attr)
{ {
if(GB_MatchString(attr->attrValue, attr->lenAttrValue, attrValue, lenAttrValue, mode)) if(GB_MatchString(attr->attrValue, attr->lenAttrValue, attrValue, lenAttrValue, mode))