Skip to content

Commit

Permalink
Merge branch 'release/v5.2.4' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
pmeems committed Jul 31, 2020
2 parents 4e22091 + 34b78e9 commit 25dc51e
Show file tree
Hide file tree
Showing 12 changed files with 41 additions and 41 deletions.
22 changes: 11 additions & 11 deletions src/COM classes/Labels.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -323,18 +323,18 @@ STDMETHODIMP CLabels::put_Category(long Index, ILabelCategory* newVal)
//***********************************************************************/
//* AddLabel()
//***********************************************************************/
STDMETHODIMP CLabels::AddLabel(BSTR Text, double x, double y, double offsetX, double offsetY, double Rotation, long Category)
STDMETHODIMP CLabels::AddLabel(BSTR Text, double x, double y, double Rotation, long Category, double offsetX, double offsetY)
{
AFX_MANAGE_STATE(AfxGetStaticModuleState())
VARIANT_BOOL vbretval;
this->InsertLabel(_labels.size(), Text, x, y, offsetX, offsetY, Rotation, Category, &vbretval);
this->InsertLabel(_labels.size(), Text, x, y, Rotation, Category, offsetX, offsetY, &vbretval);
return S_OK;
}

//***********************************************************************/
//* InsertLabel()
//***********************************************************************/
STDMETHODIMP CLabels::InsertLabel(long Index, BSTR Text, double x, double y, double offsetX, double offsetY, double Rotation, long Category, VARIANT_BOOL* retVal)
STDMETHODIMP CLabels::InsertLabel(long Index, BSTR Text, double x, double y, double Rotation, long Category, double offsetX, double offsetY, VARIANT_BOOL* retVal)
{
AFX_MANAGE_STATE(AfxGetStaticModuleState())
if(Index < 0 || Index > (long)_labels.size())
Expand All @@ -343,7 +343,7 @@ STDMETHODIMP CLabels::InsertLabel(long Index, BSTR Text, double x, double y, dou
*retVal = VARIANT_FALSE;
}

CLabelInfo* lbl = CreateNewLabel(Text, x, y, offsetX, offsetY, Rotation, Category);
CLabelInfo* lbl = CreateNewLabel(Text, x, y, Rotation, Category, offsetX, offsetY);

std::vector<CLabelInfo*>* parts = new std::vector<CLabelInfo*>;
parts->push_back(lbl);
Expand All @@ -363,7 +363,7 @@ STDMETHODIMP CLabels::InsertLabel(long Index, BSTR Text, double x, double y, dou
//***********************************************************************/
/* CreateNewLabel()
//***********************************************************************/
CLabelInfo* CLabels::CreateNewLabel(const BSTR &Text, double x, double y, double offsetX, double offsetY, double Rotation, long Category)
CLabelInfo* CLabels::CreateNewLabel(const BSTR &Text, double x, double y, double Rotation, long Category, double offsetX, double offsetY)
{
// TODO this really is just a constructor for label info => need to move this here ...
CLabelInfo *lbl = new CLabelInfo();
Expand Down Expand Up @@ -406,7 +406,7 @@ STDMETHODIMP CLabels::RemoveLabel(long Index, VARIANT_BOOL* vbretval)
///***********************************************************************/
///* AddPart()
///***********************************************************************/
STDMETHODIMP CLabels::AddPart(long Index, BSTR Text, double x, double y, double offsetX, double offsetY, double Rotation, long Category)
STDMETHODIMP CLabels::AddPart(long Index, BSTR Text, double x, double y, double Rotation, long Category, double offsetX, double offsetY)
{
AFX_MANAGE_STATE(AfxGetStaticModuleState())
if(Index < 0 || Index > (int)_labels.size())
Expand All @@ -417,14 +417,14 @@ STDMETHODIMP CLabels::AddPart(long Index, BSTR Text, double x, double y, double
std::vector<CLabelInfo*>* parts = _labels[Index];

VARIANT_BOOL vbretval;
InsertPart(Index, parts->size(), Text, x, y, offsetX, offsetY, Rotation, Category, &vbretval);
InsertPart(Index, parts->size(), Text, x, y, Rotation, Category, offsetX, offsetY, &vbretval);
return S_OK;
};

///***********************************************************************/
///* AddPart()
///***********************************************************************/
STDMETHODIMP CLabels::InsertPart(long Index, long Part, BSTR Text, double x, double y, double offsetX, double offsetY, double Rotation, long Category, VARIANT_BOOL* retVal)
STDMETHODIMP CLabels::InsertPart(long Index, long Part, BSTR Text, double x, double y, double Rotation, long Category, double offsetX, double offsetY, VARIANT_BOOL* retVal)
{
AFX_MANAGE_STATE(AfxGetStaticModuleState())
if(Index < 0 || Index >=(int)_labels.size())
Expand All @@ -434,7 +434,7 @@ STDMETHODIMP CLabels::InsertPart(long Index, long Part, BSTR Text, double x, dou
}
std::vector<CLabelInfo*>* parts = _labels[Index];

CLabelInfo* lbl = CreateNewLabel(Text, x, y, offsetX, offsetY, Rotation, Category);
CLabelInfo* lbl = CreateNewLabel(Text, x, y, Rotation, Category, offsetX, offsetY);

if (Part == parts->size())
{
Expand Down Expand Up @@ -2153,7 +2153,7 @@ bool CLabels::DeserializeLabelData(CPLXMLNode* node, bool loadRotation, bool loa
angle = 0.0;
}

this->AddLabel(bstr, x, y, offsetX, offsetY, angle);
this->AddLabel(bstr, x, y, angle, -1, offsetX, offsetY);
node = node->psNext;
}

Expand Down Expand Up @@ -2693,7 +2693,7 @@ bool CLabels::HasRotation()
// *************************************************************
void CLabels::AddEmptyLabel()
{
AddLabel(m_globalSettings.emptyBstr, 0.0, 0.0, 0.0, 0.0, 0.0);
AddLabel(m_globalSettings.emptyBstr, 0.0, 0.0, 0.0, 0, 0.0, 0.0);
if (_labels.size() == 0) return;
CLabelInfo* lbl = (*_labels[_labels.size() - 1])[0];
if (lbl) {
Expand Down
10 changes: 5 additions & 5 deletions src/COM classes/Labels.h
Original file line number Diff line number Diff line change
Expand Up @@ -135,12 +135,12 @@ class ATL_NO_VTABLE CLabels :
STDMETHOD(get_ErrorMsg)(/*[in]*/ long ErrorCode, /*[out, retval]*/ BSTR *pVal);
STDMETHOD(get_LastErrorCode)(/*[out, retval]*/ long *pVal);

STDMETHOD(AddLabel)(BSTR Text, double x, double y, double offsetX, double offsetY, double Rotation, long Category = -1);
STDMETHOD(InsertLabel)(long Index, BSTR Text, double x, double y, double offsetX, double offsetY, double Rotation, long Category, VARIANT_BOOL* retVal);
STDMETHOD(AddLabel)(BSTR Text, double x, double y, double Rotation, long Category = -1, double offsetX = 0, double offsetY = 0);
STDMETHOD(InsertLabel)(long Index, BSTR Text, double x, double y, double Rotation, long Category, double offsetX, double offsetY, VARIANT_BOOL* retVal);
STDMETHOD(RemoveLabel)(long Index, VARIANT_BOOL* vbretval);

STDMETHOD(AddPart)(long Index, BSTR Text, double x, double y, double offsetX, double offsetY, double Rotation, long Category = -1);
STDMETHOD(InsertPart)(long Index, long Part, BSTR Text, double x, double y, double offsetX, double offsetY, double Rotation, long Category, VARIANT_BOOL* retVal);
STDMETHOD(AddPart)(long Index, BSTR Text, double x, double y, double Rotation, long Category = -1, double offsetX = 0, double offsetY = 0);
STDMETHOD(InsertPart)(long Index, long Part, BSTR Text, double x, double y, double Rotation, long Category, double offsetX, double offsetY, VARIANT_BOOL* retVal);
STDMETHOD(RemovePart)(long Index, long Part, VARIANT_BOOL* vbretval);

STDMETHOD(AddCategory)(BSTR Name, ILabelCategory** retVal);
Expand Down Expand Up @@ -460,7 +460,7 @@ class ATL_NO_VTABLE CLabels :
bool GetMinMaxCategoryValue(double& globalMax, double& globalMin);
void SetCategoryForLabel(long labelIndex, long categoryIndex);
void UpdateLabelOffsetsFromShapefile(long labelIndex, long categoryIndex);
CLabelInfo* CreateNewLabel(const BSTR &Text, double x, double y, double offsetX, double offsetY, double Rotation, long Category);
CLabelInfo* CreateNewLabel(const BSTR &Text, double x, double y, double Rotation, long Category, double offsetX, double offsetY);

public:
void ClearLabelFrames();
Expand Down
2 changes: 1 addition & 1 deletion src/COM classes/Shapefile_Edit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,7 @@ void CShapefile::RegisterNewShape(IShape* Shape, long ShapeIndex)

// it doesn't make sense to recalculate expression as DBF cells are empty all the same
CComBSTR bstrText("");
_labels->InsertLabel(ShapeIndex, bstrText, x, y, offsetX, offsetY, rotation, -1, &vbretval);
_labels->InsertLabel(ShapeIndex, bstrText, x, y, rotation, -1, offsetX, offsetY, &vbretval);
}

if (chartsExist)
Expand Down
10 changes: 5 additions & 5 deletions src/COM classes/Shapefile_LabelsCharts.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -123,14 +123,14 @@ STDMETHODIMP CShapefile::GenerateLabels(long FieldIndex, tkLabelPositioning Meth

if( numParts == 1)
{
ShapeHelper::AddLabelToShape(shp, _labels, text, offsetX, offsetY, Method, orientation);
ShapeHelper::AddLabelToShape(shp, _labels, text, Method, orientation, offsetX, offsetY);
continue;
}
else if (numParts == 0)
{
if (shpType == SHP_POINT || shpType == SHP_MULTIPOINT)
{
ShapeHelper::AddLabelToShape(shp, _labels, text, offsetX, offsetY, Method, orientation);
ShapeHelper::AddLabelToShape(shp, _labels, text, Method, orientation, offsetX, offsetY);
continue;
}
}
Expand All @@ -153,14 +153,14 @@ STDMETHODIMP CShapefile::GenerateLabels(long FieldIndex, tkLabelPositioning Meth

if (partCount == 0)
{
ShapeHelper::AddLabelToShape(shpPart, _labels, text, offsetX, offsetY, Method, orientation);
ShapeHelper::AddLabelToShape(shpPart, _labels, text, Method, orientation, offsetX, offsetY);
partCount++;
}
else
{
double x = 0.0, y = 0.0;
ShapeHelper::Cast(shpPart)->get_LabelPosition(Method, x, y, rotation, orientation);
_labels->AddPart(i, text, x, y, offsetX, offsetY, rotation);
_labels->AddPart(i, text, x, y, rotation, -1, offsetX, offsetY);
}
}

Expand All @@ -177,7 +177,7 @@ STDMETHODIMP CShapefile::GenerateLabels(long FieldIndex, tkLabelPositioning Meth
shp->get_PartAsShape(maxPart, &shpPart);
if (shpPart)
{
ShapeHelper::AddLabelToShape(shpPart, _labels, text, offsetX, offsetY, Method, orientation);
ShapeHelper::AddLabelToShape(shpPart, _labels, text, Method, orientation, offsetX, offsetY);
continue;
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/ComHelpers/ShapeHelper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -382,12 +382,12 @@ int ShapeHelper::GetLargestPart(IShape* shp)
// *************************************************************
// AddLabel()
// *************************************************************
void ShapeHelper::AddLabelToShape(IShape* shp, ILabels* labels, BSTR text, double offsetX, double offsetY, tkLabelPositioning method, tkLineLabelOrientation orientation)
void ShapeHelper::AddLabelToShape(IShape* shp, ILabels* labels, BSTR text, tkLabelPositioning method, tkLineLabelOrientation orientation, double offsetX, double offsetY)
{
if (!shp || !labels) return;
double x, y, rotation = 0.0;
((CShape*)shp)->get_LabelPosition(method, x, y, rotation, orientation);
labels->AddLabel(text, x, y, offsetX, offsetY, rotation);
labels->AddLabel(text, x, y, rotation, -1, offsetX, offsetY);
}

// *************************************************************
Expand Down
2 changes: 1 addition & 1 deletion src/ComHelpers/ShapeHelper.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class ShapeHelper
static CShape* Cast(CComPtr<IShape>& shp);
static long GetNumParts(IShape* shp);
static int GetLargestPart(IShape* shp);
static void AddLabelToShape(IShape* shp, ILabels* labels, BSTR text, double offsetX, double offsetY, tkLabelPositioning method, tkLineLabelOrientation orientation);
static void AddLabelToShape(IShape* shp, ILabels* labels, BSTR text, tkLabelPositioning method, tkLineLabelOrientation orientation, double offsetX, double offsetY);
static IShape* CenterAsShape(IShape* shp);
static int GetContentLength(IShape* shp);
};
Expand Down
6 changes: 3 additions & 3 deletions src/Control/Map_DrawingLayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -526,7 +526,7 @@ LONG CMapView::DrawLabelEx(LONG drawHandle, LPCTSTR text, DOUBLE x, DOUBLE y, DO
if (_allDrawLists[drawHandle]->m_labels)
{
CComBSTR bstr(text);
_allDrawLists[drawHandle]->m_labels->AddLabel(bstr, x, y, 0, 0, rotation);
_allDrawLists[drawHandle]->m_labels->AddLabel(bstr, x, y, rotation);
OnDrawingLayersChanged();
return drawHandle;
}
Expand All @@ -545,7 +545,7 @@ void CMapView::AddDrawingLabel(long drawHandle, LPCTSTR Text, OLE_COLOR Color, d
{
if (_allDrawLists[drawHandle]->m_labels) {
CComBSTR bstr(Text);
_allDrawLists[drawHandle]->m_labels->AddLabel(bstr, x, y, 0, 0);
_allDrawLists[drawHandle]->m_labels->AddLabel(bstr, x, y);
}
OnDrawingLayersChanged();
}
Expand All @@ -562,7 +562,7 @@ void CMapView::AddDrawingLabelEx(long drawHandle, LPCTSTR Text, OLE_COLOR Color,
{
if (_allDrawLists[drawHandle]->m_labels) {
CComBSTR bstr(Text);
_allDrawLists[drawHandle]->m_labels->AddLabel(bstr, x, y, 0, 0, Rotation);
_allDrawLists[drawHandle]->m_labels->AddLabel(bstr, x, y, Rotation);
}
OnDrawingLayersChanged();
}
Expand Down
4 changes: 2 additions & 2 deletions src/Control/Map_Labels.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -413,7 +413,7 @@ void CMapView::AddLabel(long LayerHandle, LPCTSTR Text, OLE_COLOR Color, double
if (labels)
{
CComBSTR s(Text);
labels->AddLabel(s, x, y, 0, 0);
labels->AddLabel(s, x, y);
}
}

Expand All @@ -426,7 +426,7 @@ void CMapView::AddLabelEx(long LayerHandle, LPCTSTR Text, OLE_COLOR Color, doubl
if (labels)
{
CComBSTR s(Text);
labels->AddLabel(s, x, y, Rotation, 0, 0);
labels->AddLabel(s, x, y, Rotation);
}
}

Expand Down
4 changes: 2 additions & 2 deletions src/InnoSetup/MapWinGIS-only.iss
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!

#define MyAppName "MapWinGIS"
#define MyAppVersion "5.2.3"
#define MyAppVersion "5.2.4"
#define MyAppPublisher "MapWindow Open Source GIS Community"
#define MyAppURL "http://www.mapwindow.org"
#define SetupLocation "D:\dev\MapWindow\MapWinGIS\git\src\InnoSetup"
#define BinLocation "D:\dev\MapWindow\MapWinGIS\git\src\bin"
#define x64BitVersion
;; #define x64BitVersion
;; #define VsVersion = "2015"
#define VsVersion = "2017"

Expand Down
8 changes: 4 additions & 4 deletions src/MapWinGIS.idl
Original file line number Diff line number Diff line change
Expand Up @@ -5041,12 +5041,12 @@ interface ILabels : IDispatch{
[propput, id(6), helpstring("property Category")] HRESULT Category([in]long Index, [in]ILabelCategory* newVal);

// methods
[id(7), helpstring("method AddLabel")] HRESULT AddLabel([in]BSTR Text, [in]double x, [in]double y, [in, defaultvalue(0)]double offsetX, [in, defaultvalue(0)]double offsetY, [in, defaultvalue(0)]double Rotation, [in, defaultvalue(-1)]long Category);
[id(8), helpstring("method InsertLabel")] HRESULT InsertLabel([in]long Index, [in]BSTR Text, [in]double x, [in]double y, [in, defaultvalue(0)]double offsetX, [in, defaultvalue(0)]double offsetY, [in, defaultvalue(0)]double Rotation, [in, defaultvalue(-1)]long Category, [out, retval ]VARIANT_BOOL* retval);
[id(7), helpstring("method AddLabel")] HRESULT AddLabel([in]BSTR Text, [in]double x, [in]double y, [in, defaultvalue(0)]double Rotation, [in, defaultvalue(-1)]long Category, [in, defaultvalue(0)]double offsetX, [in, defaultvalue(0)]double offsetY);
[id(8), helpstring("method InsertLabel")] HRESULT InsertLabel([in]long Index, [in]BSTR Text, [in]double x, [in]double y, [in, defaultvalue(0)]double Rotation, [in, defaultvalue(-1)]long Category, [in, defaultvalue(0)]double offsetX, [in, defaultvalue(0)]double offsetY, [out, retval ]VARIANT_BOOL* retval);
[id(9), helpstring("method RemoveLabel")] HRESULT RemoveLabel([in]long Index, [out, retval ]VARIANT_BOOL* retval);

[id(10), helpstring("method AddPart")] HRESULT AddPart([in] long Index,[in]BSTR Text, [in]double x, [in]double y, [in, defaultvalue(0)]double offsetX, [in, defaultvalue(0)]double offsetY, [in, defaultvalue(0)]double Rotation, [in, defaultvalue(-1)]long Category);
[id(11), helpstring("method InsertPart")] HRESULT InsertPart([in] long Index, [in] long Part, [in]BSTR Text, [in]double x, [in]double y, [in, defaultvalue(0)]double offsetX, [in, defaultvalue(0)]double offsetY, [in, defaultvalue(0)]double Rotation, [in, defaultvalue(-1)]long Category, [out, retval ]VARIANT_BOOL* retval);
[id(10), helpstring("method AddPart")] HRESULT AddPart([in] long Index,[in]BSTR Text, [in]double x, [in]double y, [in, defaultvalue(0)]double Rotation, [in, defaultvalue(-1)]long Category, [in, defaultvalue(0)]double offsetX, [in, defaultvalue(0)]double offsetY);
[id(11), helpstring("method InsertPart")] HRESULT InsertPart([in] long Index, [in] long Part, [in]BSTR Text, [in]double x, [in]double y, [in, defaultvalue(0)]double Rotation, [in, defaultvalue(-1)]long Category, [in, defaultvalue(0)]double offsetX, [in, defaultvalue(0)]double offsetY, [out, retval ]VARIANT_BOOL* retval);
[id(12), helpstring("method RemovePart")] HRESULT RemovePart([in]long Index, [in]long Part, [out, retval ]VARIANT_BOOL* vbretval);

[id(13), helpstring("method AddCategory")] HRESULT AddCategory([in]BSTR Name, [out, retval]ILabelCategory** retVal);
Expand Down
8 changes: 4 additions & 4 deletions src/MapWinGIS.rc
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,8 @@ END
//

VS_VERSION_INFO VERSIONINFO
FILEVERSION 5,2,3,0
PRODUCTVERSION 5,2,3,0
FILEVERSION 5,2,4,0
PRODUCTVERSION 5,2,4,0
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
Expand All @@ -131,13 +131,13 @@ BEGIN
VALUE "Comments", "This control includes a mapping component and objects for reading and writing shapefiles and various triangulated irregular network and grid files. It also has extensive label and chart options and includes projection routines."
VALUE "CompanyName", "MapWindow OSS Team - www.mapwindow.org"
VALUE "FileDescription", "MapWinGIS ActiveX Control"
VALUE "FileVersion", "5.2.3.0"
VALUE "FileVersion", "5.2.4.0"
VALUE "InternalName", "MapWinGIS ActiveX Control"
VALUE "LegalCopyright", "Copyright (C) 2004-2020 MapWindow OSS Team"
VALUE "LegalTrademarks", "MapWindow GIS is a trademark of Daniel P. Ames, 2005-2020"
VALUE "OriginalFilename", "MapWinGIS.ocx"
VALUE "ProductName", "MapWinGIS ActiveX Control"
VALUE "ProductVersion", "5.2.3.0"
VALUE "ProductVersion", "5.2.4.0"
END
END
BLOCK "VarFileInfo"
Expand Down
2 changes: 1 addition & 1 deletion src/Ogr/Ogr2Shape.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -489,7 +489,7 @@ void Ogr2Shape::CopyValues(OGRFeatureDefn* poFields, OGRFeature* poFeature, ISha
CComPtr<ILabels> labels = NULL;
sf->get_Labels(&labels);

labels->AddLabel(bstr, x, y, offsetX, offsetY, rotation);
labels->AddLabel(bstr, x, y, rotation, -1, offsetX, offsetY);
}
}

Expand Down

0 comments on commit 25dc51e

Please sign in to comment.