diff --git a/src/Mod/Drawing/App/AppDrawing.cpp b/src/Mod/Drawing/App/AppDrawing.cpp
index 332751dbde..23dc007792 100644
--- a/src/Mod/Drawing/App/AppDrawing.cpp
+++ b/src/Mod/Drawing/App/AppDrawing.cpp
@@ -12,17 +12,17 @@
#include "PreCompiled.h"
#include
-#include
#include
-
-#include "FeaturePage.h"
-#include "FeatureView.h"
-#include "FeatureViewPart.h"
-#include "FeatureViewAnnotation.h"
-#include "FeatureViewSymbol.h"
-#include "FeatureProjection.h"
-#include "FeatureViewSpreadsheet.h"
+#include
+
#include "FeatureClip.h"
+#include "FeaturePage.h"
+#include "FeatureProjection.h"
+#include "FeatureView.h"
+#include "FeatureViewAnnotation.h"
+#include "FeatureViewPart.h"
+#include "FeatureViewSpreadsheet.h"
+#include "FeatureViewSymbol.h"
#include "PageGroup.h"
diff --git a/src/Mod/Drawing/App/AppDrawingPy.cpp b/src/Mod/Drawing/App/AppDrawingPy.cpp
index 259ade9aea..8791dec1cd 100644
--- a/src/Mod/Drawing/App/AppDrawingPy.cpp
+++ b/src/Mod/Drawing/App/AppDrawingPy.cpp
@@ -21,18 +21,17 @@
***************************************************************************/
#include "PreCompiled.h"
+#ifndef _PreComp_
+# include
+#endif
-#include
-#include
-
-#include
-#include "ProjectionAlgos.h"
#include
#include
#include
-#include
-
#include
+#include
+
+#include "ProjectionAlgos.h"
using namespace std;
diff --git a/src/Mod/Drawing/App/CMakeLists.txt b/src/Mod/Drawing/App/CMakeLists.txt
index 86127d38a1..4698a00fa6 100644
--- a/src/Mod/Drawing/App/CMakeLists.txt
+++ b/src/Mod/Drawing/App/CMakeLists.txt
@@ -59,6 +59,18 @@ SOURCE_GROUP("Mod" FILES ${Drawing_SRCS})
SOURCE_GROUP("Features" FILES ${Features_SRCS})
SOURCE_GROUP("Algorithms" FILES ${DrawingAlgos_SRCS})
+SET(DrawingComplete_SRCS
+ ${Drawing_SRCS}
+ ${DrawingAlgos_SRCS}
+ ${Features_SRCS}
+)
+
+if(FREECAD_USE_PCH)
+ add_definitions(-D_PreComp_)
+ GET_MSVC_PRECOMPILED_SOURCE("PreCompiled.cpp" PCH_SRCS ${DrawingComplete_SRCS})
+ ADD_MSVC_PRECOMPILED_HEADER(Drawing PreCompiled.h PreCompiled.cpp PCH_SRCS)
+endif(FREECAD_USE_PCH)
+
add_library(Drawing SHARED ${Drawing_SRCS} ${Features_SRCS} ${DrawingAlgos_SRCS})
target_link_libraries(Drawing ${Drawing_LIBS})
diff --git a/src/Mod/Drawing/App/DrawingExport.cpp b/src/Mod/Drawing/App/DrawingExport.cpp
index 7572be417c..3c49621981 100644
--- a/src/Mod/Drawing/App/DrawingExport.cpp
+++ b/src/Mod/Drawing/App/DrawingExport.cpp
@@ -20,67 +20,44 @@
* *
***************************************************************************/
-
#include "PreCompiled.h"
-
#ifndef _PreComp_
-# include
# include
+# include
+
+# include
+# include
# include
-# include
+# include
+# include
+# include
+# include
+# include
+# include
# include
+# include
# include
+# include
+# include
+# include
+# include
+# include
+# include
+# include
+# include
+# include
+# include
+# if OCC_VERSION_HEX < 0x070600
+# include
+# endif
#endif
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-//#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#if OCC_VERSION_HEX < 0x070600
-#include
-#endif
-
-#include "DrawingExport.h"
#include
#include
+#include "DrawingExport.h"
+
+
#if OCC_VERSION_HEX >= 0x070600
using BRepAdaptor_HCurve = BRepAdaptor_Curve;
#endif
diff --git a/src/Mod/Drawing/App/DrawingExport.h b/src/Mod/Drawing/App/DrawingExport.h
index 44d578ee5c..56d0806856 100644
--- a/src/Mod/Drawing/App/DrawingExport.h
+++ b/src/Mod/Drawing/App/DrawingExport.h
@@ -20,7 +20,6 @@
* *
***************************************************************************/
-
#ifndef DRAWING_EXPORT_H
#define DRAWING_EXPORT_H
@@ -28,6 +27,7 @@
#include
#include
+
class TopoDS_Shape;
class BRepAdaptor_Curve;
diff --git a/src/Mod/Drawing/App/FeatureClip.cpp b/src/Mod/Drawing/App/FeatureClip.cpp
index 3931172c5b..f7714a6854 100644
--- a/src/Mod/Drawing/App/FeatureClip.cpp
+++ b/src/Mod/Drawing/App/FeatureClip.cpp
@@ -20,28 +20,19 @@
* *
***************************************************************************/
-
#include "PreCompiled.h"
-
#ifndef _PreComp_
+# include
# include
#endif
-
-#include
-#include
-#include
-#include
-#include
-#include
-
#include "FeatureClip.h"
#include "FeatureView.h"
+
using namespace Drawing;
using namespace std;
-
//===========================================================================
// FeaturePage
//===========================================================================
@@ -99,8 +90,8 @@ App::DocumentObjectExecReturn *FeatureClip::execute(void)
svg << "" << endl;
// get through the children and collect all the views
- const std::vector &Grp = Group.getValues();
- for (std::vector::const_iterator It= Grp.begin();It!=Grp.end();++It) {
+ const vector &Grp = Group.getValues();
+ for (vector::const_iterator It= Grp.begin();It!=Grp.end();++It) {
if ((*It)->getTypeId().isDerivedFrom(Drawing::FeatureView::getClassTypeId())) {
Drawing::FeatureView *View = static_cast(*It);
svg << View->ViewResult.getValue() << endl;
diff --git a/src/Mod/Drawing/App/FeatureClip.h b/src/Mod/Drawing/App/FeatureClip.h
index b19bb3e988..9c83d7b84f 100644
--- a/src/Mod/Drawing/App/FeatureClip.h
+++ b/src/Mod/Drawing/App/FeatureClip.h
@@ -20,15 +20,14 @@
* *
***************************************************************************/
-
#ifndef _FeatureClip_h_
#define _FeatureClip_h_
-
#include
#include
#include
+
namespace Drawing
{
diff --git a/src/Mod/Drawing/App/FeaturePage.cpp b/src/Mod/Drawing/App/FeaturePage.cpp
index 2622cb3498..5e801fe276 100644
--- a/src/Mod/Drawing/App/FeaturePage.cpp
+++ b/src/Mod/Drawing/App/FeaturePage.cpp
@@ -20,31 +20,28 @@
* *
***************************************************************************/
-
#include "PreCompiled.h"
-
#ifndef _PreComp_
# include
# include
+# include
# include
+
+# include
#endif
-
-#include
+#include
#include
#include
-#include
-#include
-#include
#include "FeaturePage.h"
-#include "FeatureView.h"
#include "FeatureClip.h"
+#include "FeatureView.h"
+
using namespace Drawing;
using namespace std;
-
//===========================================================================
// FeaturePage
//===========================================================================
diff --git a/src/Mod/Drawing/App/FeaturePage.h b/src/Mod/Drawing/App/FeaturePage.h
index a379d96052..b5c7f17b86 100644
--- a/src/Mod/Drawing/App/FeaturePage.h
+++ b/src/Mod/Drawing/App/FeaturePage.h
@@ -20,13 +20,10 @@
* *
***************************************************************************/
-
#ifndef _FeaturePage_h_
#define _FeaturePage_h_
-
#include
-#include
#include
#include
@@ -34,7 +31,6 @@
namespace Drawing
{
-
/** Base class of all View Features in the drawing module
*/
class DrawingExport FeaturePage: public App::DocumentObjectGroup
diff --git a/src/Mod/Drawing/App/FeatureProjection.cpp b/src/Mod/Drawing/App/FeatureProjection.cpp
index f118cf1ec8..6c5de821ef 100644
--- a/src/Mod/Drawing/App/FeatureProjection.cpp
+++ b/src/Mod/Drawing/App/FeatureProjection.cpp
@@ -20,36 +20,29 @@
* *
***************************************************************************/
-
#include "PreCompiled.h"
-
#ifndef _PreComp_
# include
+
# include
# include
# include
#endif
-
-#include
-#include
-#include
-#include
-
#include "FeatureProjection.h"
#include "ProjectionAlgos.h"
+
using namespace Drawing;
-
PROPERTY_SOURCE(Drawing::FeatureProjection, Part::Feature)
-
FeatureProjection::FeatureProjection()
{
static const char *group = "Projection";
ADD_PROPERTY_TYPE(Source ,(nullptr),group,App::Prop_None,"Shape to project");
- ADD_PROPERTY_TYPE(Direction ,(Base::Vector3d(0,0,1)),group,App::Prop_None,"Projection direction");
+ ADD_PROPERTY_TYPE(Direction, (Base::Vector3d(0, 0, 1)), group, App::Prop_None,
+ "Projection direction");
ADD_PROPERTY_TYPE(VCompound ,(true),group,App::Prop_None,"Projection parameter");
ADD_PROPERTY_TYPE(Rg1LineVCompound ,(true),group,App::Prop_None,"Projection parameter");
ADD_PROPERTY_TYPE(RgNLineVCompound ,(true),group,App::Prop_None,"Projection parameter");
diff --git a/src/Mod/Drawing/App/FeatureProjection.h b/src/Mod/Drawing/App/FeatureProjection.h
index 06cfb4586d..afc3645154 100644
--- a/src/Mod/Drawing/App/FeatureProjection.h
+++ b/src/Mod/Drawing/App/FeatureProjection.h
@@ -20,22 +20,18 @@
* *
***************************************************************************/
-
#ifndef DRAWING_FEATUREPROJECTION
#define DRAWING_FEATUREPROJECTION
-
#include
-#include
-#include
-#include
+#include
#include
+#include
namespace Drawing
{
-
/** Base class of all View Features in the drawing module
*/
class DrawingExport FeatureProjection : public Part::Feature
diff --git a/src/Mod/Drawing/App/FeatureView.cpp b/src/Mod/Drawing/App/FeatureView.cpp
index 4829ce4ed6..a2e691be8d 100644
--- a/src/Mod/Drawing/App/FeatureView.cpp
+++ b/src/Mod/Drawing/App/FeatureView.cpp
@@ -20,24 +20,18 @@
* *
***************************************************************************/
-
#include "PreCompiled.h"
-
#ifndef _PreComp_
# include
# include
#endif
-
-#include
-#include
#include
-#include
#include "FeatureView.h"
-using namespace Drawing;
+using namespace Drawing;
//===========================================================================
// FeatureView
@@ -46,21 +40,25 @@ using namespace Drawing;
PROPERTY_SOURCE(Drawing::FeatureView, App::DocumentObject)
-
FeatureView::FeatureView(void)
{
- static const char *group = "Drawing view";
- ADD_PROPERTY_TYPE(X ,(0),group,App::Prop_None,"X position of the view on the drawing in modelling units (mm)");
- ADD_PROPERTY_TYPE(Y ,(0),group,App::Prop_None,"Y position of the view on the drawing in modelling units (mm)");
- ADD_PROPERTY_TYPE(Scale ,(1.0),group,App::Prop_None,"Scale factor of the view");
- ADD_PROPERTY_TYPE(Rotation ,(0),group,App::Prop_None,"Rotation of the view in degrees counterclockwise");
+ static const char* group = "Drawing view";
+ ADD_PROPERTY_TYPE(X, (0), group, App::Prop_None,
+ "X position of the view on the drawing in modelling units (mm)");
+ ADD_PROPERTY_TYPE(Y, (0), group, App::Prop_None,
+ "Y position of the view on the drawing in modelling units (mm)");
+ ADD_PROPERTY_TYPE(Scale, (1.0), group, App::Prop_None, "Scale factor of the view");
+ ADD_PROPERTY_TYPE(Rotation, (0), group, App::Prop_None,
+ "Rotation of the view in degrees counterclockwise");
// The 'Visible' property is handled by the view provider exclusively. It has the 'Output' flag set to
// avoid to call the execute() method. The view provider touches the page object, instead.
- App::PropertyType propType = static_cast(App::Prop_Hidden|App::Prop_Output);
- ADD_PROPERTY_TYPE(Visible, (true),group,propType,"Control whether view is visible in page object");
+ App::PropertyType propType =
+ static_cast(App::Prop_Hidden | App::Prop_Output);
+ ADD_PROPERTY_TYPE(Visible, (true), group, propType,
+ "Control whether view is visible in page object");
App::PropertyType type = (App::PropertyType)(App::Prop_Hidden);
- ADD_PROPERTY_TYPE(ViewResult ,(nullptr),group,type,"Resulting SVG fragment of that view");
+ ADD_PROPERTY_TYPE(ViewResult, (nullptr), group, type, "Resulting SVG fragment of that view");
}
FeatureView::~FeatureView()
@@ -73,7 +71,8 @@ App::DocumentObjectExecReturn *FeatureView::recompute(void)
return App::DocumentObject::recompute();
}
catch (Standard_Failure& e) {
- App::DocumentObjectExecReturn* ret = new App::DocumentObjectExecReturn(e.GetMessageString());
+ App::DocumentObjectExecReturn* ret =
+ new App::DocumentObjectExecReturn(e.GetMessageString());
if (ret->Why.empty()) ret->Why = "Unknown OCC exception";
return ret;
}
diff --git a/src/Mod/Drawing/App/FeatureView.h b/src/Mod/Drawing/App/FeatureView.h
index 6ccd9efa3f..58179e5752 100644
--- a/src/Mod/Drawing/App/FeatureView.h
+++ b/src/Mod/Drawing/App/FeatureView.h
@@ -20,24 +20,18 @@
* *
***************************************************************************/
-
-
-
#ifndef _FeatureView_h_
#define _FeatureView_h_
-
#include
-#include
-#include
#include
+#include
#include
namespace Drawing
{
-
/** Base class of all View Features in the drawing module
*/
class DrawingExport FeatureView : public App::DocumentObject
diff --git a/src/Mod/Drawing/App/FeatureViewAnnotation.cpp b/src/Mod/Drawing/App/FeatureViewAnnotation.cpp
index b8624c28b1..ab57e25b21 100644
--- a/src/Mod/Drawing/App/FeatureViewAnnotation.cpp
+++ b/src/Mod/Drawing/App/FeatureViewAnnotation.cpp
@@ -20,24 +20,18 @@
* *
***************************************************************************/
-
#include "PreCompiled.h"
-
#ifndef _PreComp_
+# include
# include
#endif
-#include
-
-#include
-#include
-
#include "FeatureViewAnnotation.h"
+
using namespace Drawing;
using namespace std;
-
//===========================================================================
// FeatureViewAnnotation
//===========================================================================
@@ -51,7 +45,8 @@ FeatureViewAnnotation::FeatureViewAnnotation(void)
ADD_PROPERTY_TYPE(Text ,(""),vgroup,App::Prop_None,"The text to be displayed");
ADD_PROPERTY_TYPE(Font ,("Sans"),vgroup,App::Prop_None,"The name of the font to use");
- ADD_PROPERTY_TYPE(TextColor,(0.0f,0.0f,0.0f),vgroup,App::Prop_None,"The color of the text");
+ ADD_PROPERTY_TYPE(TextColor, (0.0f, 0.0f, 0.0f), vgroup, App::Prop_None,
+ "The color of the text");
}
FeatureViewAnnotation::~FeatureViewAnnotation()
@@ -60,7 +55,7 @@ FeatureViewAnnotation::~FeatureViewAnnotation()
App::DocumentObjectExecReturn *FeatureViewAnnotation::execute(void)
{
- std::stringstream result,hr,hg,hb;
+ stringstream result,hr,hg,hb;
const App::Color& c = TextColor.getValue();
hr << hex << setfill('0') << setw(2) << (int)(255.0*c.r);
hg << hex << setfill('0') << setw(2) << (int)(255.0*c.g);
@@ -74,7 +69,7 @@ App::DocumentObjectExecReturn *FeatureViewAnnotation::execute(void)
<< " fill=\"#" << hr.str() << hg.str() << hb.str() << "\">" << endl;
int index=0;
- for (std::vector::const_iterator it = Text.getValues().begin(); it != Text.getValues().end(); ++it) {
+ for (vector::const_iterator it = Text.getValues().begin(); it != Text.getValues().end(); ++it) {
result << "" << it->c_str() << "" << endl;
index++;
}
diff --git a/src/Mod/Drawing/App/FeatureViewAnnotation.h b/src/Mod/Drawing/App/FeatureViewAnnotation.h
index 9641e90d37..f5031fdfee 100644
--- a/src/Mod/Drawing/App/FeatureViewAnnotation.h
+++ b/src/Mod/Drawing/App/FeatureViewAnnotation.h
@@ -20,23 +20,19 @@
* *
***************************************************************************/
-
-
-
#ifndef _FeatureViewAnnotation_h_
#define _FeatureViewAnnotation_h_
-
#include
-#include
-#include "FeatureView.h"
#include
+#include
+
+#include "FeatureView.h"
namespace Drawing
{
-
/** Base class of all View Features in the drawing module
*/
class DrawingExport FeatureViewAnnotation : public FeatureView
diff --git a/src/Mod/Drawing/App/FeatureViewPart.cpp b/src/Mod/Drawing/App/FeatureViewPart.cpp
index 58a22e3d7f..d7ebc33871 100644
--- a/src/Mod/Drawing/App/FeatureViewPart.cpp
+++ b/src/Mod/Drawing/App/FeatureViewPart.cpp
@@ -20,56 +20,26 @@
* *
***************************************************************************/
-
#include "PreCompiled.h"
-
#ifndef _PreComp_
# include
+# include
#endif
-
-#include
-#include
-#include
-//#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-
-
-#include
-#include
#include
#include "FeatureViewPart.h"
#include "ProjectionAlgos.h"
+
using namespace Drawing;
using namespace std;
-
//===========================================================================
// FeatureViewPart
//===========================================================================
-App::PropertyFloatConstraint::Constraints FeatureViewPart::floatRange = {0.01,5.0,0.05};
+App::PropertyFloatConstraint::Constraints FeatureViewPart::floatRange = {0.01, 5.0, 0.05};
PROPERTY_SOURCE(Drawing::FeatureViewPart, Drawing::FeatureView)
diff --git a/src/Mod/Drawing/App/FeatureViewPart.h b/src/Mod/Drawing/App/FeatureViewPart.h
index 5ec6c959ab..10ecefa725 100644
--- a/src/Mod/Drawing/App/FeatureViewPart.h
+++ b/src/Mod/Drawing/App/FeatureViewPart.h
@@ -20,23 +20,19 @@
* *
***************************************************************************/
-
-
-
#ifndef _FeatureViewPart_h_
#define _FeatureViewPart_h_
-
#include
-#include
-#include "FeatureView.h"
#include
+#include
+
+#include "FeatureView.h"
namespace Drawing
{
-
/** Base class of all View Features in the drawing module
*/
class DrawingExport FeatureViewPart : public FeatureView
diff --git a/src/Mod/Drawing/App/FeatureViewSpreadsheet.cpp b/src/Mod/Drawing/App/FeatureViewSpreadsheet.cpp
index 001ddefba1..2f2456cbc8 100644
--- a/src/Mod/Drawing/App/FeatureViewSpreadsheet.cpp
+++ b/src/Mod/Drawing/App/FeatureViewSpreadsheet.cpp
@@ -20,25 +20,21 @@
* *
***************************************************************************/
-
#include "PreCompiled.h"
-
#ifndef _PreComp_
+# include
# include
#endif
-#include
-#include
-#include
-#include
-#include
#include
-#include "FeatureViewSpreadsheet.h"
+#include
#include
#include
+#include "FeatureViewSpreadsheet.h"
+
+
using namespace Drawing;
-using namespace std;
//===========================================================================
// FeatureViewSpreadsheet
@@ -98,35 +94,38 @@ App::DocumentObjectExecReturn *FeatureViewSpreadsheet::execute(void)
std::vector columns;
std::vector rows;
try {
- for (unsigned int i=0; i::const_iterator j = availcolumns.begin(); j != availcolumns.end(); ++j) {
- if ( (*j) == startcol) {
- if ( (*j) != endcol) {
+ for (std::vector::const_iterator j = availcolumns.begin();
+ j != availcolumns.end(); ++j) {
+ if ((*j) == startcol) {
+ if ((*j) != endcol) {
valid = true;
}
- } else {
+ }
+ else {
if (valid) {
- if ( (*j) == endcol) {
+ if ((*j) == endcol) {
columns.push_back((*j));
valid = false;
- } else {
+ }
+ else {
columns.push_back((*j));
}
}
}
}
- int endrow = std::atoi(scellend.substr(i,scellend.length()-1).c_str());
- for (int j=rows.back()+1; j<=endrow; ++j) {
+ int endrow = std::atoi(scellend.substr(i, scellend.length() - 1).c_str());
+ for (int j = rows.back() + 1; j <= endrow; ++j) {
rows.push_back(j);
}
}
@@ -139,12 +138,13 @@ App::DocumentObjectExecReturn *FeatureViewSpreadsheet::execute(void)
std::string ViewName = Label.getValue();
std::stringstream result,hr,hg,hb;
const App::Color& c = Color.getValue();
- hr << hex << setfill('0') << setw(2) << (int)(255.0*c.r);
- hg << hex << setfill('0') << setw(2) << (int)(255.0*c.g);
- hb << hex << setfill('0') << setw(2) << (int)(255.0*c.b);
- result << "" << endl;
+ hr << std::hex << std::setfill('0') << std::setw(2) << (int)(255.0 * c.r);
+ hg << std::hex << std::setfill('0') << std::setw(2) << (int)(255.0 * c.g);
+ hb << std::hex << std::setfill('0') << std::setw(2) << (int)(255.0 * c.b);
+ result << "" << std::endl;
// fill the cells
float rowoffset = 0.0;
@@ -154,9 +154,10 @@ App::DocumentObjectExecReturn *FeatureViewSpreadsheet::execute(void)
std::string celltext;
Spreadsheet::Sheet* sheet = static_cast(link);
std::vector skiplist;
- for (std::vector::const_iterator col = columns.begin(); col != columns.end(); ++col) {
+ for (std::vector::const_iterator col = columns.begin(); col != columns.end();
+ ++col) {
// create a group for each column
- result << " " << endl;
+ result << " " << std::endl;
for (std::vector::const_iterator row = rows.begin(); row != rows.end(); ++row) {
// get cell size
std::stringstream srow;
@@ -186,26 +187,26 @@ App::DocumentObjectExecReturn *FeatureViewSpreadsheet::execute(void)
std::string textstyle = "";
Spreadsheet::Cell* cell = sheet->getCell(address);
if (cell) {
- App::Color f,b;
+ App::Color f, b;
std::set st;
int colspan, rowspan;
if (cell->getBackground(b)) {
- std::stringstream br,bg,bb;
- br << hex << setfill('0') << setw(2) << (int)(255.0*b.r);
- bg << hex << setfill('0') << setw(2) << (int)(255.0*b.g);
- bb << hex << setfill('0') << setw(2) << (int)(255.0*b.b);
+ std::stringstream br, bg, bb;
+ br << std::hex << std::setfill('0') << std::setw(2) << (int)(255.0 * b.r);
+ bg << std::hex << std::setfill('0') << std::setw(2) << (int)(255.0 * b.g);
+ bb << std::hex << std::setfill('0') << std::setw(2) << (int)(255.0 * b.b);
bcolor = "#" + br.str() + bg.str() + bb.str();
}
if (cell->getForeground(f)) {
- std::stringstream fr,fg,fb;
- fr << hex << setfill('0') << setw(2) << (int)(255.0*f.r);
- fg << hex << setfill('0') << setw(2) << (int)(255.0*f.g);
- fb << hex << setfill('0') << setw(2) << (int)(255.0*f.b);
+ std::stringstream fr, fg, fb;
+ fr << std::hex << std::setfill('0') << std::setw(2) << (int)(255.0 * f.r);
+ fg << std::hex << std::setfill('0') << std::setw(2) << (int)(255.0 * f.g);
+ fb << std::hex << std::setfill('0') << std::setw(2) << (int)(255.0 * f.b);
fcolor = "#" + fr.str() + fg.str() + fb.str();
}
if (cell->getStyle(st)) {
for (std::set::const_iterator i = st.begin(); i != st.end(); ++i) {
- if ((*i) == "bold")
+ if ((*i) == "bold")
textstyle = textstyle + "font-weight: bold; ";
else if ((*i) == "italic")
textstyle = textstyle + "font-style: italic; ";
@@ -213,15 +214,15 @@ App::DocumentObjectExecReturn *FeatureViewSpreadsheet::execute(void)
textstyle = textstyle + "text-decoration: underline; ";
}
}
- if (cell->getSpans(rowspan,colspan)) {
- for (int i=0; igetSpans(rowspan, colspan)) {
+ for (int i = 0; i < colspan; ++i) {
+ for (int j = 0; j < rowspan; ++j) {
+ App::CellAddress nextcell(address.row() + j, address.col() + i);
if (i > 0)
cellwidth = cellwidth + sheet->getColumnWidth(nextcell.col());
if (j > 0)
cellheight = cellheight + sheet->getRowHeight(nextcell.row());
- if ( (i > 0) || (j > 0) )
+ if ((i > 0) || (j > 0))
skiplist.push_back(nextcell.toString());
}
}
@@ -230,27 +231,35 @@ App::DocumentObjectExecReturn *FeatureViewSpreadsheet::execute(void)
}
// skip cell if found in skiplist
if (std::find(skiplist.begin(), skiplist.end(), address.toString()) == skiplist.end()) {
- result << " " << endl;
+ result << " " << std::endl;
if (alignment & Spreadsheet::Cell::ALIGNMENT_LEFT)
- result << " " << celltext << "" << endl;
+ result << " " << celltext << "" << std::endl;
}
rowoffset = rowoffset + cellheight;
}
- result << " " << endl;
+ result << " " << std::endl;
rowoffset = 0.0;
coloffset = coloffset + cellwidth;
}
// close the containing group
- result << "" << endl;
+ result << "" << std::endl;
// Apply the resulting fragment
ViewResult.setValue(result.str().c_str());
diff --git a/src/Mod/Drawing/App/FeatureViewSpreadsheet.h b/src/Mod/Drawing/App/FeatureViewSpreadsheet.h
index 3f8e204cf4..673f18df26 100644
--- a/src/Mod/Drawing/App/FeatureViewSpreadsheet.h
+++ b/src/Mod/Drawing/App/FeatureViewSpreadsheet.h
@@ -20,15 +20,15 @@
* *
***************************************************************************/
-
#ifndef _FeatureViewSpreadsheet_h_
#define _FeatureViewSpreadsheet_h_
-
#include
#include
+
#include "FeatureView.h"
+
namespace Drawing
{
diff --git a/src/Mod/Drawing/App/FeatureViewSymbol.cpp b/src/Mod/Drawing/App/FeatureViewSymbol.cpp
index 9b548dced7..65dbf603ad 100644
--- a/src/Mod/Drawing/App/FeatureViewSymbol.cpp
+++ b/src/Mod/Drawing/App/FeatureViewSymbol.cpp
@@ -20,26 +20,21 @@
* *
***************************************************************************/
-
#include "PreCompiled.h"
-
#ifndef _PreComp_
+# include
+# include
# include
+
+# include
#endif
-#include
-#include
-#include
-
-#include
-#include
-
#include "FeatureViewSymbol.h"
+
using namespace Drawing;
using namespace std;
-
//===========================================================================
// FeatureViewSymbol
//===========================================================================
diff --git a/src/Mod/Drawing/App/FeatureViewSymbol.h b/src/Mod/Drawing/App/FeatureViewSymbol.h
index 44dad78cf6..9c1552e8f4 100644
--- a/src/Mod/Drawing/App/FeatureViewSymbol.h
+++ b/src/Mod/Drawing/App/FeatureViewSymbol.h
@@ -20,23 +20,19 @@
* *
***************************************************************************/
-
-
-
#ifndef _FeatureViewSymbol_h_
#define _FeatureViewSymbol_h_
-
#include
-#include
-#include "FeatureView.h"
#include
+#include
+
+#include "FeatureView.h"
namespace Drawing
{
-
/** Base class of all View Features in the drawing module
*/
class DrawingExport FeatureViewSymbol : public FeatureView
diff --git a/src/Mod/Drawing/App/PageGroup.cpp b/src/Mod/Drawing/App/PageGroup.cpp
index b3afe3c249..f36a740619 100644
--- a/src/Mod/Drawing/App/PageGroup.cpp
+++ b/src/Mod/Drawing/App/PageGroup.cpp
@@ -20,17 +20,15 @@
* *
***************************************************************************/
-
#include "PreCompiled.h"
-
#ifndef _PreComp_
# include
#endif
#include "PageGroup.h"
-using namespace Drawing;
+using namespace Drawing;
//===========================================================================
// PageGroup
diff --git a/src/Mod/Drawing/App/PageGroup.h b/src/Mod/Drawing/App/PageGroup.h
index 4f8c23aac2..3c4d9078a6 100644
--- a/src/Mod/Drawing/App/PageGroup.h
+++ b/src/Mod/Drawing/App/PageGroup.h
@@ -20,15 +20,10 @@
* *
***************************************************************************/
-
-
-
#ifndef _PageGroup_h_
#define _PageGroup_h_
-
#include
-#include
#include
#include
@@ -36,7 +31,6 @@
namespace Drawing
{
-
/** Base class of all View Features in the drawing module
*/
class DrawingExport PageGroup : public App::DocumentObjectGroup
diff --git a/src/Mod/Drawing/App/PreCompiled.h b/src/Mod/Drawing/App/PreCompiled.h
index 853f563786..897ad95b1a 100644
--- a/src/Mod/Drawing/App/PreCompiled.h
+++ b/src/Mod/Drawing/App/PreCompiled.h
@@ -20,7 +20,6 @@
* *
***************************************************************************/
-
#ifndef DRAWING_PRECOMPILED_H
#define DRAWING_PRECOMPILED_H
@@ -29,188 +28,50 @@
#ifdef _PreComp_
// standard
+#include
+#include
#include
+#include
+#include
#include
-#include
-#include
-#include
-#include