summaryrefslogtreecommitdiffstats
path: root/src/libnrtype
diff options
context:
space:
mode:
authorJohan B. C. Engelen <jbc.engelen@swissonline.ch>2008-08-05 22:40:31 +0000
committerjohanengelen <johanengelen@users.sourceforge.net>2008-08-05 22:40:31 +0000
commit900577c7e71534ec32dcb4e0677a509a6e517b12 (patch)
tree8d5b4c6201b0728bff338e89106d1a8c5a0b7fef /src/libnrtype
parentcodedread's patch for bug 254850 (fixes handling of description field in Obje... (diff)
downloadinkscape-900577c7e71534ec32dcb4e0677a509a6e517b12.tar.gz
inkscape-900577c7e71534ec32dcb4e0677a509a6e517b12.zip
NR::Maybe => boost::optional
(bzr r6569)
Diffstat (limited to 'src/libnrtype')
-rw-r--r--src/libnrtype/FontInstance.cpp4
-rw-r--r--src/libnrtype/Layout-TNG-OutIter.cpp2
-rw-r--r--src/libnrtype/Layout-TNG-Output.cpp2
-rw-r--r--src/libnrtype/Layout-TNG.h6
-rw-r--r--src/libnrtype/RasterFont.cpp2
-rw-r--r--src/libnrtype/font-instance.h2
6 files changed, 11 insertions, 7 deletions
diff --git a/src/libnrtype/FontInstance.cpp b/src/libnrtype/FontInstance.cpp
index 5058e8e22..4f745c0f9 100644
--- a/src/libnrtype/FontInstance.cpp
+++ b/src/libnrtype/FontInstance.cpp
@@ -613,7 +613,7 @@ bool font_instance::FontSlope(double &run, double &rise)
return true;
}
-NR::Maybe<NR::Rect> font_instance::BBox(int glyph_id)
+boost::optional<NR::Rect> font_instance::BBox(int glyph_id)
{
int no=-1;
if ( id_to_no.find(glyph_id) == id_to_no.end() ) {
@@ -627,7 +627,7 @@ NR::Maybe<NR::Rect> font_instance::BBox(int glyph_id)
no=id_to_no[glyph_id];
}
if ( no < 0 ) {
- return NR::Nothing();
+ return boost::optional<NR::Rect>();
} else {
NR::Point rmin(glyphs[no].bbox[0],glyphs[no].bbox[1]);
NR::Point rmax(glyphs[no].bbox[2],glyphs[no].bbox[3]);
diff --git a/src/libnrtype/Layout-TNG-OutIter.cpp b/src/libnrtype/Layout-TNG-OutIter.cpp
index 2471da3dd..84307c9ce 100644
--- a/src/libnrtype/Layout-TNG-OutIter.cpp
+++ b/src/libnrtype/Layout-TNG-OutIter.cpp
@@ -201,7 +201,7 @@ Layout::iterator Layout::sourceToIterator(void *source_cookie) const
return sourceToIterator(source_cookie, Glib::ustring::const_iterator(std::string::const_iterator(NULL)));
}
-NR::Maybe<NR::Rect> Layout::glyphBoundingBox(iterator const &it, double *rotation) const
+boost::optional<NR::Rect> Layout::glyphBoundingBox(iterator const &it, double *rotation) const
{
if (rotation) *rotation = _glyphs[it._glyph_index].rotation;
return _glyphs[it._glyph_index].span(this).font->BBox(_glyphs[it._glyph_index].glyph);
diff --git a/src/libnrtype/Layout-TNG-Output.cpp b/src/libnrtype/Layout-TNG-Output.cpp
index 3ad979cca..36c882d44 100644
--- a/src/libnrtype/Layout-TNG-Output.cpp
+++ b/src/libnrtype/Layout-TNG-Output.cpp
@@ -116,7 +116,7 @@ void Layout::getBoundingBox(NRRect *bounding_box, NR::Matrix const &transform, i
_getGlyphTransformMatrix(glyph_index, &glyph_matrix);
NR::Matrix total_transform = glyph_matrix;
total_transform *= transform;
- NR::Maybe<NR::Rect> glyph_rect = _glyphs[glyph_index].span(this).font->BBox(_glyphs[glyph_index].glyph);
+ boost::optional<NR::Rect> glyph_rect = _glyphs[glyph_index].span(this).font->BBox(_glyphs[glyph_index].glyph);
if (glyph_rect) {
NR::Point bmi = glyph_rect->min(), bma = glyph_rect->max();
NR::Point tlp(bmi[0],bmi[1]), trp(bma[0],bmi[1]), blp(bmi[0],bma[1]), brp(bma[0],bma[1]);
diff --git a/src/libnrtype/Layout-TNG.h b/src/libnrtype/Layout-TNG.h
index 36e7be0a5..cea97ff2a 100644
--- a/src/libnrtype/Layout-TNG.h
+++ b/src/libnrtype/Layout-TNG.h
@@ -11,6 +11,9 @@
#ifndef __LAYOUT_TNG_H__
#define __LAYOUT_TNG_H__
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
#include "libnr/nr-rect.h"
#include "libnr/nr-matrix.h"
#include "libnr/nr-matrix-ops.h"
@@ -19,6 +22,7 @@
#include <pango/pango-break.h>
#include <algorithm>
#include <vector>
+#include <boost/optional.hpp>
#ifdef HAVE_CAIRO_PDF
namespace Inkscape {
@@ -444,7 +448,7 @@ public:
/** Returns the bounding box of the given glyph, and its rotation.
The centre of rotation is the horizontal centre of the box at the
text baseline. */
- NR::Maybe<NR::Rect> glyphBoundingBox(iterator const &it, double *rotation) const;
+ boost::optional<NR::Rect> glyphBoundingBox(iterator const &it, double *rotation) const;
/** Returns the zero-based line number of the character pointed to by
\a it. */
diff --git a/src/libnrtype/RasterFont.cpp b/src/libnrtype/RasterFont.cpp
index 61ef1720b..10e653664 100644
--- a/src/libnrtype/RasterFont.cpp
+++ b/src/libnrtype/RasterFont.cpp
@@ -107,7 +107,7 @@ void raster_font::BBox(int glyph_id,NRRect *area)
{
area->x0=area->y0=area->x1=area->y1=0;
if ( daddy == NULL ) return;
- NR::Maybe<NR::Rect> res=daddy->BBox(glyph_id);
+ boost::optional<NR::Rect> res=daddy->BBox(glyph_id);
if (res) {
NR::Point bmi=res->min(),bma=res->max();
NR::Point tlp(bmi[0],bmi[1]),trp(bma[0],bmi[1]),blp(bmi[0],bma[1]),brp(bma[0],bma[1]);
diff --git a/src/libnrtype/font-instance.h b/src/libnrtype/font-instance.h
index e204f5df1..f2e3438f1 100644
--- a/src/libnrtype/font-instance.h
+++ b/src/libnrtype/font-instance.h
@@ -77,7 +77,7 @@ public:
bool FontMetrics(double &ascent, double &descent, double &leading);
bool FontSlope(double &run, double &rise);
// for generating slanted cursors for oblique fonts
- NR::Maybe<NR::Rect> BBox(int glyph_id);
+ boost::optional<NR::Rect> BBox(int glyph_id);
// creates a rasterfont for the given style
raster_font* RasterFont(NR::Matrix const &trs, double stroke_width,