FCLT#58797 Versie 4.19 Voorkom crash op empty.w2d die geen plotsections heeft

svn path=/Slnkdwf/trunk/; revision=43761
This commit is contained in:
Jos Groot Lipman
2019-08-13 11:56:46 +00:00
parent cbcf706d4c
commit 46299ba898
4 changed files with 18 additions and 27 deletions

View File

@@ -1,6 +1,6 @@
// Zorg dat versies alfabetisch altijd op elkaar volgen!
#define SLNK_MAJOR_VERSION 4
#define SLNK_MINOR_VERSION 18
#define SLNK_MINOR_VERSION 19
#define SLNK_BUILD_VERSION 0
// Define resource strings

View File

@@ -191,15 +191,18 @@ HRESULT CWhipFile::ProcessContouren()
m_W2DFile.close(); // closing Input file.
double ClipWidth, ClipHeight;
m_iEPlotSection->get_PaperClipWidth(&ClipWidth);
m_iEPlotSection->get_PaperClipHeight(&ClipHeight);
if (ClipWidth > 0 && ClipHeight > 0)
if (m_iEPlotSection) // is er niet bij empty.w2d
{
double dwfDx = m_view.view().m_max.m_x - m_view.view().m_min.m_x;
double dwfDy = m_view.view().m_max.m_y - m_view.view().m_min.m_y;
m_vdpi = myRound(max(dwfDx / ClipWidth, dwfDy / ClipHeight));
myDoTRACE("\nGuessing vector dpi: %d", m_vdpi);
double ClipWidth, ClipHeight;
m_iEPlotSection->get_PaperClipWidth(&ClipWidth);
m_iEPlotSection->get_PaperClipHeight(&ClipHeight);
if (ClipWidth > 0 && ClipHeight > 0)
{
double dwfDx = m_view.view().m_max.m_x - m_view.view().m_min.m_x;
double dwfDy = m_view.view().m_max.m_y - m_view.view().m_min.m_y;
m_vdpi = myRound(max(dwfDx / ClipWidth, dwfDy / ClipHeight));
myDoTRACE("\nGuessing vector dpi: %d", m_vdpi);
}
}
}
else

View File

@@ -132,24 +132,8 @@ bool myWT_File::SaveAsAscii(const CString &destpath, EPlot_Progress_Action progr
case WT_Object::Origin_ID:
break; // Mag niet met ASCII
default:
switch(current_object()->object_type())
{
case WT_Object::Drawable:
current_object()->serialize(my_output_file);
break;
case WT_Object::Attribute:
{ const WT_Attribute *obj = (WT_Attribute *)current_object();
// myTRACE("Attribute '%s'\n", my_plan_file.file_stats()->descriptions());
// Hoewel een Attibute gaat hij toch niet via desired_rendition
//Omdat we weten dat we net uit uit een DWF komen kunnen we best wel rechtstreeks serializen
//Let wel: desired_rendition is dan niet meer te vertrouwen. Zie @@@
obj->serialize(my_output_file);
}
break;
default:
myTRACE("Skipping '%s'\n", file_stats()->descriptions());
break;
}
current_object()->serialize(my_output_file);
continue;
}
}

View File

@@ -1,3 +1,7 @@
V4.19 12-08-2019
- Geen null-pointer exception bij bepalen vectordpi empty.w2d (die
geen plotsection heeft)
V4.18 11-08-2019
- Geen afrondfouten/oveflow bij Centroid berekening als zowel x en y rond INT_MAX
- vectordpi functie toegevoegd