make PDF build with VS2008

This commit is contained in:
Günter Obiltschnig
2018-03-07 10:14:49 +01:00
parent 4f562c0e6b
commit 4a6a1a980b
52 changed files with 1025 additions and 769 deletions

View File

@@ -9,18 +9,31 @@ namespace Poco {
namespace PDF {
AttributedString::AttributedString()
AttributedString::AttributedString():
_align(ALIGN_LEFT),
_style(STYLE_PLAIN),
_fontName("Helvetica"),
_fontSize(10)
{
}
AttributedString::AttributedString(const char* content): _content(content)
AttributedString::AttributedString(const char* content):
_content(content),
_align(ALIGN_LEFT),
_style(STYLE_PLAIN),
_fontName("Helvetica"),
_fontSize(10)
{
}
AttributedString::AttributedString(const std::string& content, Alignment align, int style):
_content(content), _align(align), _style(static_cast<Style>(style))
_content(content),
_align(align),
_style(static_cast<Style>(style)),
_fontName("Helvetica"),
_fontSize(10)
{
}

View File

@@ -10,14 +10,24 @@ namespace PDF {
Cell::Cell(const AttributedString& content, const std::string& name, FontMapPtr pFontMap):
_content(content), _name(name)
_content(content),
_name(name),
_outline(OUTLINE_NONE),
_lineWidth(1.0f),
_encoding("UTF-8"),
_trueType(true)
{
setFonts(pFontMap);
}
Cell::Cell(const AttributedString& content, FontMapPtr pFontMap, const std::string& encoding, bool trueType):
_content(content), _encoding(encoding), _trueType(trueType)
_content(content),
_outline(OUTLINE_NONE),
_lineWidth(1.0f),
_encoding(encoding),
_trueType(trueType)
{
setFonts(pFontMap);
}

View File

@@ -67,12 +67,14 @@ void Table::draw(Page& page, float x, float y, float width, float height)
int rows = _cells.size();
int cols = _cells[0].size();
int r = 0;
for (auto& row : _cells)
for (Cells::iterator it = _cells.begin(); it != _cells.end(); ++it)
{
TableRow& row(*it);
float h = height / rows;
int c = 0;
for (auto& cell : row)
for (TableRow::iterator itr = row.begin(); itr != row.end(); ++itr)
{
Cell& cell(*itr);
float w = width / cols;
cell.draw(page, x + (w * c), y - (h * r), w, h);
++c;

View File

@@ -277,7 +277,8 @@ public:
_pPage = new Page(_pDocument->addPage(parsePageSize(_size), parseOrientation(orientation)));
_pPage->setLineWidth(0.2f);
_pPage->setRGBStroke({ 0, 0, 0 });
RGBColor black = {0, 0, 0};
_pPage->setRGBStroke(black);
_boxes.push_back(Box(0, 0, _pPage->getWidth(), _pPage->getHeight()));
float margin = _styles.getFloat("margin", 0);