summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorkamalpreetgrewal <grewalkamal005@gmail.com>2016-08-18 19:59:46 +0000
committerkamalpreetgrewal <grewalkamal005@gmail.com>2016-08-18 19:59:46 +0000
commit3569a1ae56e8bf0e433b8e1773b6802cbdc041c2 (patch)
tree7ac43feb9e0be025233b166cef1a1c108ca67d3b /src
parentPass tests while adding & removing objects from class selectors (diff)
parentAdd back icon (this time as a copy) (diff)
downloadinkscape-3569a1ae56e8bf0e433b8e1773b6802cbdc041c2.tar.gz
inkscape-3569a1ae56e8bf0e433b8e1773b6802cbdc041c2.zip
Merge changes from trunk
(bzr r14949.1.69)
Diffstat (limited to 'src')
-rw-r--r--src/display/guideline.cpp2
-rw-r--r--src/extension/dbus/document-interface.cpp2
-rw-r--r--src/extension/internal/odf.cpp5
-rw-r--r--src/io/gzipstream.cpp8
-rw-r--r--src/sp-ellipse.cpp12
-rw-r--r--src/sp-lpe-item.cpp2
-rw-r--r--src/svg/svg-affine.cpp4
7 files changed, 11 insertions, 24 deletions
diff --git a/src/display/guideline.cpp b/src/display/guideline.cpp
index 126fcf87c..f66b65e1a 100644
--- a/src/display/guideline.cpp
+++ b/src/display/guideline.cpp
@@ -48,7 +48,7 @@ static void sp_guideline_init(SPGuideLine *gl)
gl->locked = false;
gl->normal_to_line = Geom::Point(0,1);
- gl->angle = 3.14159265358979323846/2;
+ gl->angle = M_PI_2;
gl->point_on_line = Geom::Point(0,0);
gl->sensitive = 0;
diff --git a/src/extension/dbus/document-interface.cpp b/src/extension/dbus/document-interface.cpp
index 5a8fb0918..667830997 100644
--- a/src/extension/dbus/document-interface.cpp
+++ b/src/extension/dbus/document-interface.cpp
@@ -405,7 +405,7 @@ document_interface_polygon (DocumentInterface *doc_interface, int cx, int cy,
int radius, int rotation, int sides,
GError **error)
{
- gdouble rot = ((rotation / 180.0) * 3.14159265) - ( 3.14159265 / 2.0);
+ gdouble rot = ((rotation / 180.0) * M_PI) - M_PI_2;
Inkscape::XML::Node *newNode = dbus_create_node(doc_interface->target.getDocument(), "svg:path");
newNode->setAttribute("inkscape:flatsided", "true");
newNode->setAttribute("sodipodi:type", "star");
diff --git a/src/extension/internal/odf.cpp b/src/extension/internal/odf.cpp
index 6904eb2fd..f885ef5e5 100644
--- a/src/extension/internal/odf.cpp
+++ b/src/extension/internal/odf.cpp
@@ -873,11 +873,8 @@ int SingularValueDecomposition::rank()
-#define pi 3.14159
//#define pxToCm 0.0275
#define pxToCm 0.03
-#define piToRad 0.0174532925
-#define docHeightCm 22.86
//########################################################################
@@ -1565,7 +1562,7 @@ bool OdfOutput::processGradient(SPItem *item,
output += buf;
//TODO: apply maths, to define begin of gradient, taking gradient begin and end, as well as object boundary into account
double angle = (gi.y2-gi.y1);
- angle = (angle != 0.) ? (atan((gi.x2-gi.x1)/(gi.y2-gi.y1))* 180. / pi) : 90;
+ angle = (angle != 0.) ? (atan((gi.x2-gi.x1)/(gi.y2-gi.y1))* 180. / M_PI) : 90;
angle = (angle < 0)?(180+angle):angle;
angle = angle * 10; //why do we need this: precision?????????????
output += Glib::ustring::compose(" draw:start-intensity=\"%1\" draw:end-intensity=\"%2\" draw:angle=\"%3\"/>\n",
diff --git a/src/io/gzipstream.cpp b/src/io/gzipstream.cpp
index 380c42411..330191ecd 100644
--- a/src/io/gzipstream.cpp
+++ b/src/io/gzipstream.cpp
@@ -171,12 +171,12 @@ bool GzipInputStream::load()
}
srcLen = inputBuf.size();
- srcBuf = new Byte [srcLen];
+ srcBuf = new (std::nothrow) Byte [srcLen];
if (!srcBuf) {
return false;
}
- outputBuf = new unsigned char [OUT_SIZE];
+ outputBuf = new (std::nothrow) unsigned char [OUT_SIZE];
if ( !outputBuf ) {
delete[] srcBuf;
srcBuf = NULL;
@@ -386,14 +386,14 @@ void GzipOutputStream::flush()
}
uLong srclen = inputBuf.size();
- Bytef *srcbuf = new Bytef [srclen];
+ Bytef *srcbuf = new (std::nothrow) Bytef [srclen];
if (!srcbuf)
{
return;
}
uLong destlen = srclen;
- Bytef *destbuf = new Bytef [(destlen + (srclen/100) + 13)];
+ Bytef *destbuf = new (std::nothrow) Bytef [(destlen + (srclen/100) + 13)];
if (!destbuf)
{
delete[] srcbuf;
diff --git a/src/sp-ellipse.cpp b/src/sp-ellipse.cpp
index 995f880c2..0d60aa5d8 100644
--- a/src/sp-ellipse.cpp
+++ b/src/sp-ellipse.cpp
@@ -33,16 +33,10 @@
#include "svg/path-string.h"
-#ifndef M_PI
-#define M_PI 3.14159265358979323846
-#endif
-
-#define SP_2PI (2 * M_PI)
-
SPGenericEllipse::SPGenericEllipse()
: SPShape()
, start(0)
- , end(SP_2PI)
+ , end(M_2_PI)
, type(SP_GENERIC_ELLIPSE_UNDEFINED)
, _closed(true)
{
@@ -533,7 +527,7 @@ void SPGenericEllipse::snappoints(std::vector<Inkscape::SnapCandidatePoint> &p,
// Snap to the 4 quadrant points of the ellipse, but only if the arc
// spans far enough to include them
if (snapprefs->isTargetSnappable(Inkscape::SNAPTARGET_ELLIPSE_QUADRANT_POINT)) {
- for (double angle = 0; angle < SP_2PI; angle += M_PI_2) {
+ for (double angle = 0; angle < M_2_PI; angle += M_PI_2) {
if (Geom::AngleInterval(this->start, this->end, true).contains(angle)) {
Geom::Point pt = this->getPointAtAngle(angle) * i2dt;
p.push_back(Inkscape::SnapCandidatePoint(pt, Inkscape::SNAPSOURCE_ELLIPSE_QUADRANT_POINT, Inkscape::SNAPTARGET_ELLIPSE_QUADRANT_POINT));
@@ -668,7 +662,7 @@ bool SPGenericEllipse::_isSlice() const
{
Geom::AngleInterval a(this->start, this->end, true);
- return !(Geom::are_near(a.extent(), 0) || Geom::are_near(a.extent(), SP_2PI));
+ return !(Geom::are_near(a.extent(), 0) || Geom::are_near(a.extent(), M_2_PI));
}
/*
diff --git a/src/sp-lpe-item.cpp b/src/sp-lpe-item.cpp
index 44dc684c9..85df070b8 100644
--- a/src/sp-lpe-item.cpp
+++ b/src/sp-lpe-item.cpp
@@ -703,7 +703,7 @@ SPLPEItem::apply_to_clip_or_mask(SPItem *clip_mask, SPItem *item)
// LPE was unsuccesfull. Read the old 'd'-attribute.
if (gchar const * value = repr->attribute("d")) {
Geom::PathVector pv = sp_svg_read_pathv(value);
- SPCurve *oldcurve = new SPCurve(pv);
+ SPCurve *oldcurve = new (std::nothrow) SPCurve(pv);
if (oldcurve) {
SP_SHAPE(clip_mask)->setCurve(oldcurve, TRUE);
oldcurve->unref();
diff --git a/src/svg/svg-affine.cpp b/src/svg/svg-affine.cpp
index 21635c79b..76d89579d 100644
--- a/src/svg/svg-affine.cpp
+++ b/src/svg/svg-affine.cpp
@@ -24,10 +24,6 @@
#include "svg.h"
#include "preferences.h"
-#ifndef M_PI
-# define M_PI 3.14159265358979323846
-#endif
-
bool
sp_svg_transform_read(gchar const *str, Geom::Affine *transform)
{