[Libreoffice-commits] .: 5 commits - basebmp/inc basebmp/source basebmp/test basegfx/inc basegfx/Package_inc.mk basegfx/source basegfx/test vcl/headless vcl/inc vcl/unx

Thorsten Behrens thorsten at kemper.freedesktop.org
Wed Nov 2 15:58:50 PDT 2011


 basebmp/inc/basebmp/bitmapdevice.hxx        |  102 ++++---
 basebmp/inc/basebmp/clippedlinerenderer.hxx |    4 
 basebmp/inc/basebmp/polypolygonrenderer.hxx |    4 
 basebmp/inc/basebmp/tools.hxx               |   10 
 basebmp/source/bitmapdevice.cxx             |  377 +++++++++++++---------------
 basebmp/test/bmpdemo.cxx                    |    4 
 basebmp/test/bmpmasktest.cxx                |   10 
 basebmp/test/bmptest.cxx                    |   22 -
 basebmp/test/cliptest.cxx                   |    8 
 basebmp/test/masktest.cxx                   |    4 
 basebmp/test/polytest.cxx                   |    4 
 basegfx/Package_inc.mk                      |    1 
 basegfx/inc/basegfx/range/b1drange.hxx      |   54 ++--
 basegfx/inc/basegfx/range/b1ibox.hxx        |   52 ++-
 basegfx/inc/basegfx/range/b1irange.hxx      |   58 +++-
 basegfx/inc/basegfx/range/b2drange.hxx      |   62 +++-
 basegfx/inc/basegfx/range/b2ibox.hxx        |   74 ++++-
 basegfx/inc/basegfx/range/b2irange.hxx      |   70 ++++-
 basegfx/inc/basegfx/range/b3drange.hxx      |   26 -
 basegfx/inc/basegfx/range/b3ibox.hxx        |    6 
 basegfx/inc/basegfx/range/b3irange.hxx      |   21 -
 basegfx/inc/basegfx/range/basicbox.hxx      |   18 -
 basegfx/inc/basegfx/range/basicrange.hxx    |   13 
 basegfx/inc/basegfx/range/rangeexpander.hxx |   86 ------
 basegfx/inc/basegfx/tools/canvastools.hxx   |   14 +
 basegfx/source/tools/canvastools.cxx        |    9 
 basegfx/test/basegfx2d.cxx                  |  114 +++++++-
 vcl/headless/svpbmp.cxx                     |    4 
 vcl/headless/svpgdi.cxx                     |   70 ++---
 vcl/headless/svptext.cxx                    |    6 
 vcl/inc/headless/svpgdi.hxx                 |    2 
 vcl/inc/unx/gtk/gtkframe.hxx                |    4 
 vcl/unx/gtk/window/gtkframe.cxx             |   23 +
 33 files changed, 759 insertions(+), 577 deletions(-)

New commits:
commit 1e297aef53ec79e2905cb9ca57d649b82bc3938d
Author: Thorsten Behrens <tbehrens at suse.com>
Date:   Wed Nov 2 23:36:36 2011 +0100

    Move BitmapDevice to use B2IBox instead of B2IRange.
    
    Semantically, B2IBox represents a pixel rect much better than
    B2IRange - replaced all occurences in and around the software
    renderer, and client code.

diff --git a/basebmp/inc/basebmp/bitmapdevice.hxx b/basebmp/inc/basebmp/bitmapdevice.hxx
index 99bb1b6..1e6d73b 100644
--- a/basebmp/inc/basebmp/bitmapdevice.hxx
+++ b/basebmp/inc/basebmp/bitmapdevice.hxx
@@ -45,7 +45,7 @@ namespace basegfx
     class B2IPoint;
     class B2DPoint;
     class B2IVector;
-    class B2IRange;
+    class B2IBox;
     class B2DPolygon;
     class B2DPolyPolygon;
 }
@@ -66,7 +66,7 @@ struct ImplBitmapDevice;
 struct IBitmapDeviceDamageTracker
 {
     /// gets called when said region is clobbered
-    virtual void damaged(const basegfx::B2IRange& rDamageRect) const = 0;
+    virtual void damaged(const basegfx::B2IBox& rDamageRect) const = 0;
 };
 
 /** Definition of BitmapDevice interface
@@ -82,7 +82,7 @@ struct IBitmapDeviceDamageTracker
     is accepted, but potentially slow.
  */
 class BASEBMP_DLLPUBLIC BitmapDevice : public boost::enable_shared_from_this<BitmapDevice>,
-                     private boost::noncopyable
+                                       private boost::noncopyable
 {
 public:
     /** Query size of device in pixel
@@ -362,8 +362,8 @@ public:
         Draw mode to use when changing pixel values
      */
     void drawBitmap( const BitmapDeviceSharedPtr& rSrcBitmap,
-                     const basegfx::B2IRange&     rSrcRect,
-                     const basegfx::B2IRange&     rDstRect,
+                     const basegfx::B2IBox&       rSrcRect,
+                     const basegfx::B2IBox&       rDstRect,
                      DrawMode                     drawMode );
 
     /** Draw another bitmap into this device
@@ -395,8 +395,8 @@ public:
         pixel is 1 will not be modified.
      */
     void drawBitmap( const BitmapDeviceSharedPtr& rSrcBitmap,
-                     const basegfx::B2IRange&     rSrcRect,
-                     const basegfx::B2IRange&     rDstRect,
+                     const basegfx::B2IBox&       rSrcRect,
+                     const basegfx::B2IBox&       rDstRect,
                      DrawMode                     drawMode,
                      const BitmapDeviceSharedPtr& rClip );
 
@@ -429,7 +429,7 @@ public:
      */
     void drawMaskedColor( Color                        aSrcColor,
                           const BitmapDeviceSharedPtr& rAlphaMask,
-                          const basegfx::B2IRange&     rSrcRect,
+                          const basegfx::B2IBox&       rSrcRect,
                           const basegfx::B2IPoint&     rDstPoint );
 
     /** Draw a color with an alpha-modulation bitmap into this device
@@ -465,7 +465,7 @@ public:
      */
     void drawMaskedColor( Color                        aSrcColor,
                           const BitmapDeviceSharedPtr& rAlphaMask,
-                          const basegfx::B2IRange&     rSrcRect,
+                          const basegfx::B2IBox&       rSrcRect,
                           const basegfx::B2IPoint&     rDstPoint,
                           const BitmapDeviceSharedPtr& rClip );
 
@@ -506,8 +506,8 @@ public:
      */
     void drawMaskedBitmap( const BitmapDeviceSharedPtr& rSrcBitmap,
                            const BitmapDeviceSharedPtr& rMask,
-                           const basegfx::B2IRange&     rSrcRect,
-                           const basegfx::B2IRange&     rDstRect,
+                           const basegfx::B2IBox&       rSrcRect,
+                           const basegfx::B2IBox&       rDstRect,
                            DrawMode                     drawMode );
 
     /** Draw another bitmap through a mask into this device
@@ -551,18 +551,18 @@ public:
      */
     void drawMaskedBitmap( const BitmapDeviceSharedPtr& rSrcBitmap,
                            const BitmapDeviceSharedPtr& rMask,
-                           const basegfx::B2IRange&     rSrcRect,
-                           const basegfx::B2IRange&     rDstRect,
+                           const basegfx::B2IBox&       rSrcRect,
+                           const basegfx::B2IBox&       rDstRect,
                            DrawMode                     drawMode,
                            const BitmapDeviceSharedPtr& rClip );
 
 protected:
-    BitmapDevice( const basegfx::B2IRange&                   rBounds,
-                  sal_Int32                                  nScanlineFormat,
-                  sal_Int32                                  nScanlineStride,
-                  sal_uInt8*                                 pFirstScanline,
-                  const RawMemorySharedArray&                rMem,
-                  const PaletteMemorySharedVector&           rPalette );
+    BitmapDevice( const basegfx::B2IBox&           rBounds,
+                  sal_Int32                        nScanlineFormat,
+                  sal_Int32                        nScanlineStride,
+                  sal_uInt8*                       pFirstScanline,
+                  const RawMemorySharedArray&      rMem,
+                  const PaletteMemorySharedVector& rPalette );
 
     virtual ~BitmapDevice();
 
@@ -571,8 +571,8 @@ private:
     virtual bool isCompatibleClipMask( const BitmapDeviceSharedPtr& bmp ) const = 0;
     virtual bool isCompatibleAlphaMask( const BitmapDeviceSharedPtr& bmp ) const = 0;
 
-    virtual void clear_i( Color                     fillColor,
-                          const basegfx::B2IRange&  rBounds ) = 0;
+    virtual void clear_i( Color                  fillColor,
+                          const basegfx::B2IBox& rBounds ) = 0;
 
     virtual void setPixel_i( const basegfx::B2IPoint& rPt,
                              Color                    lineColor,
@@ -588,22 +588,22 @@ private:
 
     virtual void drawLine_i( const basegfx::B2IPoint& rPt1,
                              const basegfx::B2IPoint& rPt2,
-                             const basegfx::B2IRange& rBounds,
+                             const basegfx::B2IBox&   rBounds,
                              Color                    lineColor,
                              DrawMode                 drawMode ) = 0;
     virtual void drawLine_i( const basegfx::B2IPoint&     rPt1,
                              const basegfx::B2IPoint&     rPt2,
-                             const basegfx::B2IRange&     rBounds,
+                             const basegfx::B2IBox&       rBounds,
                              Color                        lineColor,
                              DrawMode                     drawMode,
                              const BitmapDeviceSharedPtr& rClip ) = 0;
 
     virtual void drawPolygon_i( const basegfx::B2DPolygon& rPoly,
-                                const basegfx::B2IRange&   rBounds,
+                                const basegfx::B2IBox&     rBounds,
                                 Color                      lineColor,
                                 DrawMode                   drawMode ) = 0;
     virtual void drawPolygon_i( const basegfx::B2DPolygon&   rPoly,
-                                const basegfx::B2IRange&     rBounds,
+                                const basegfx::B2IBox&       rBounds,
                                 Color                        lineColor,
                                 DrawMode                     drawMode,
                                 const BitmapDeviceSharedPtr& rClip ) = 0;
@@ -611,45 +611,45 @@ private:
     virtual void fillPolyPolygon_i( const basegfx::B2DPolyPolygon& rPoly,
                                     Color                          fillColor,
                                     DrawMode                       drawMode,
-                                    const basegfx::B2IRange&       rBounds ) = 0;
+                                    const basegfx::B2IBox&         rBounds ) = 0;
     virtual void fillPolyPolygon_i( const basegfx::B2DPolyPolygon& rPoly,
                                     Color                          fillColor,
                                     DrawMode                       drawMode,
-                                    const basegfx::B2IRange&       rBounds,
+                                    const basegfx::B2IBox&         rBounds,
                                     const BitmapDeviceSharedPtr&   rClip ) = 0;
 
     // must work with *this == rSrcBitmap!
     virtual void drawBitmap_i( const BitmapDeviceSharedPtr& rSrcBitmap,
-                               const basegfx::B2IRange&     rSrcRect,
-                               const basegfx::B2IRange&     rDstRect,
+                               const basegfx::B2IBox&       rSrcRect,
+                               const basegfx::B2IBox&       rDstRect,
                                DrawMode                     drawMode ) = 0;
     virtual void drawBitmap_i( const BitmapDeviceSharedPtr& rSrcBitmap,
-                               const basegfx::B2IRange&     rSrcRect,
-                               const basegfx::B2IRange&     rDstRect,
+                               const basegfx::B2IBox&       rSrcRect,
+                               const basegfx::B2IBox&       rDstRect,
                                DrawMode                     drawMode,
                                const BitmapDeviceSharedPtr& rClip ) = 0;
 
     // must work with *this == rSrcBitmap!
     virtual void drawMaskedColor_i( Color                        rSrcColor,
                                     const BitmapDeviceSharedPtr& rAlphaMask,
-                                    const basegfx::B2IRange&     rSrcRect,
+                                    const basegfx::B2IBox&       rSrcRect,
                                     const basegfx::B2IPoint&     rDstPoint ) = 0;
     virtual void drawMaskedColor_i( Color                        rSrcColor,
                                     const BitmapDeviceSharedPtr& rAlphaMask,
-                                    const basegfx::B2IRange&     rSrcRect,
+                                    const basegfx::B2IBox&       rSrcRect,
                                     const basegfx::B2IPoint&     rDstPoint,
                                     const BitmapDeviceSharedPtr& rClip ) = 0;
 
     // must work with *this == rSrcBitmap!
     virtual void drawMaskedBitmap_i( const BitmapDeviceSharedPtr& rSrcBitmap,
                                      const BitmapDeviceSharedPtr& rMask,
-                                     const basegfx::B2IRange&     rSrcRect,
-                                     const basegfx::B2IRange&     rDstRect,
+                                     const basegfx::B2IBox&       rSrcRect,
+                                     const basegfx::B2IBox&       rDstRect,
                                      DrawMode                     drawMode ) = 0;
     virtual void drawMaskedBitmap_i( const BitmapDeviceSharedPtr& rSrcBitmap,
                                      const BitmapDeviceSharedPtr& rMask,
-                                     const basegfx::B2IRange&     rSrcRect,
-                                     const basegfx::B2IRange&     rDstRect,
+                                     const basegfx::B2IBox&       rSrcRect,
+                                     const basegfx::B2IBox&       rDstRect,
                                      DrawMode                     drawMode,
                                      const BitmapDeviceSharedPtr& rClip ) = 0;
 
@@ -700,8 +700,8 @@ BASEBMP_DLLPUBLIC BitmapDeviceSharedPtr createBitmapDevice( const basegfx::B2IVe
     area. Useful to implement rectangular clips (usually faster than
     setting up a 1bpp clip mask).
  */
-BASEBMP_DLLPUBLIC BitmapDeviceSharedPtr subsetBitmapDevice( const BitmapDeviceSharedPtr&     rProto,
-                                          const basegfx::B2IRange&         rSubset );
+BASEBMP_DLLPUBLIC BitmapDeviceSharedPtr subsetBitmapDevice( const BitmapDeviceSharedPtr& rProto,
+                                                            const basegfx::B2IBox&       rSubset );
 
 /** Factory method to clone a BitmapDevice from a given prototype.
 
diff --git a/basebmp/inc/basebmp/clippedlinerenderer.hxx b/basebmp/inc/basebmp/clippedlinerenderer.hxx
index e023581..2fbf2f7 100644
--- a/basebmp/inc/basebmp/clippedlinerenderer.hxx
+++ b/basebmp/inc/basebmp/clippedlinerenderer.hxx
@@ -31,7 +31,7 @@
 
 #include <basegfx/tools/rectcliptools.hxx>
 #include <basegfx/point/b2ipoint.hxx>
-#include <basegfx/range/b2irange.hxx>
+#include <basegfx/range/b2ibox.hxx>
 
 #include <vigra/diff2d.hxx>
 #include <vigra/iteratortraits.hxx>
@@ -200,7 +200,7 @@ inline bool prepareClip( sal_Int32  a1,
 template< class Iterator, class Accessor >
 void renderClippedLine( basegfx::B2IPoint             aPt1,
                         basegfx::B2IPoint             aPt2,
-                        const basegfx::B2IRange&      rClipRect,
+                        const basegfx::B2IBox&      rClipRect,
                         typename Accessor::value_type color,
                         Iterator                      begin,
                         Accessor                      acc,
diff --git a/basebmp/inc/basebmp/polypolygonrenderer.hxx b/basebmp/inc/basebmp/polypolygonrenderer.hxx
index 6a7c391..37b568e 100644
--- a/basebmp/inc/basebmp/polypolygonrenderer.hxx
+++ b/basebmp/inc/basebmp/polypolygonrenderer.hxx
@@ -31,7 +31,7 @@
 
 #include <basegfx/point/b2dpoint.hxx>
 #include <basegfx/range/b2drange.hxx>
-#include <basegfx/range/b2irange.hxx>
+#include <basegfx/range/b2ibox.hxx>
 #include <basegfx/polygon/b2dpolypolygon.hxx>
 #include <basegfx/polygon/b2dpolypolygontools.hxx>
 #include <basegfx/polygon/b2dpolypolygonfillrule.hxx>
@@ -147,7 +147,7 @@ namespace basebmp
     void renderClippedPolyPolygon( DestIterator                   begin,
                                    DestAccessor                   ad,
                                    T                              fillColor,
-                                   const basegfx::B2IRange&       rClipRect,
+                                   const basegfx::B2IBox&       rClipRect,
                                    basegfx::B2DPolyPolygon const& rPoly,
                                    basegfx::FillRule              eFillRule )
     {
diff --git a/basebmp/inc/basebmp/tools.hxx b/basebmp/inc/basebmp/tools.hxx
index 0b5fcb8..403041d 100644
--- a/basebmp/inc/basebmp/tools.hxx
+++ b/basebmp/inc/basebmp/tools.hxx
@@ -29,24 +29,24 @@
 #ifndef INCLUDED_BASEBMP_TOOLS_HXX
 #define INCLUDED_BASEBMP_TOOLS_HXX
 
-#include <basegfx/range/b2irange.hxx>
+#include <basegfx/range/b2ibox.hxx>
 #include <basegfx/point/b2ipoint.hxx>
 #include <vigra/tuple.hxx>
 #include <vigra/diff2d.hxx>
 
 namespace basebmp
 {
-    inline vigra::Diff2D topLeft( const basegfx::B2IRange& rRange )
+    inline vigra::Diff2D topLeft( const basegfx::B2IBox& rRange )
     { return vigra::Diff2D(rRange.getMinX(),rRange.getMinY()); }
 
-    inline vigra::Diff2D bottomRight( const basegfx::B2IRange& rRange )
+    inline vigra::Diff2D bottomRight( const basegfx::B2IBox& rRange )
     { return vigra::Diff2D(rRange.getMaxX(),rRange.getMaxY()); }
 
     template< class Iterator, class Accessor >
     inline vigra::triple<Iterator,Iterator,Accessor>
     destIterRange(Iterator const&          begin,
                   Accessor const&          accessor,
-                  const basegfx::B2IRange& rRange)
+                  const basegfx::B2IBox& rRange)
     {
         return vigra::triple<Iterator,Iterator,Accessor>(
             begin + topLeft(rRange),
@@ -58,7 +58,7 @@ namespace basebmp
     inline vigra::triple<Iterator,Iterator,Accessor>
     srcIterRange(Iterator const&          begin,
                  Accessor const&          accessor,
-                 const basegfx::B2IRange& rRange)
+                 const basegfx::B2IBox& rRange)
     {
         return vigra::triple<Iterator,Iterator,Accessor>(
             begin + topLeft(rRange),
diff --git a/basebmp/source/bitmapdevice.cxx b/basebmp/source/bitmapdevice.cxx
index 0482983..5ac1550 100644
--- a/basebmp/source/bitmapdevice.cxx
+++ b/basebmp/source/bitmapdevice.cxx
@@ -26,10 +26,6 @@
  *
  ************************************************************************/
 
-// FIXME: in vigra
-#if defined(__SUNPRO_CC) && (__SUNPRO_CC > 0x580)
-#include <math.h> // needed for fabs, hypot
-#endif
 #include "basebmp/bitmapdevice.hxx"
 
 #include "basebmp/compositeiterator.hxx"
@@ -64,6 +60,8 @@
 #include <osl/diagnose.h>
 
 #include <basegfx/tools/tools.hxx>
+#include <basegfx/tools/canvastools.hxx>
+#include <basegfx/range/b2ibox.hxx>
 #include <basegfx/range/b2irange.hxx>
 #include <basegfx/range/b2drange.hxx>
 #include <basegfx/polygon/b2dpolygon.hxx>
@@ -292,7 +290,7 @@ namespace
 
         // -------------------------------------------------------
 
-        BitmapRenderer( const basegfx::B2IRange&                   rBounds,
+        BitmapRenderer( const basegfx::B2IBox&                     rBounds,
                         sal_Int32                                  nScanlineFormat,
                         sal_Int32                                  nScanlineStride,
                         sal_uInt8*                                 pFirstScanline,
@@ -325,19 +323,19 @@ namespace
 
     private:
 
-        void damaged( const basegfx::B2IRange& rDamageRect ) const
+        void damaged( const basegfx::B2IBox& rDamageRect ) const
         {
             if( mpDamage )
                 mpDamage->damaged( rDamageRect );
         }
 
         void damagedPointSize( const basegfx::B2IPoint& rPoint,
-                               const basegfx::B2IRange& rSize ) const
+                               const basegfx::B2IBox&   rSize ) const
         {
             if( mpDamage ) {
                 basegfx::B2IPoint aLower( rPoint.getX() + rSize.getWidth(),
                                           rPoint.getY() + rSize.getHeight() );
-                damaged( basegfx::B2IRange( rPoint, aLower ) );
+                damaged( basegfx::B2IBox( rPoint, aLower ) );
             }
         }
 
@@ -347,7 +345,7 @@ namespace
                 return;
             basegfx::B2IPoint aEnd( rDamagePoint.getX() + 1,
                                     rDamagePoint.getY() + 1 );
-            damaged( basegfx::B2IRange( rDamagePoint, aEnd ) );
+            damaged( basegfx::B2IBox( rDamagePoint, aEnd ) );
         }
 
         boost::shared_ptr<BitmapRenderer> getCompatibleBitmap( const BitmapDeviceSharedPtr& bmp ) const
@@ -394,8 +392,8 @@ namespace
             return getCompatibleAlphaMask( bmp ).get() != NULL;
         }
 
-        virtual void clear_i( Color                     fillColor,
-                              const basegfx::B2IRange&  rBounds )
+        virtual void clear_i( Color                   fillColor,
+                              const basegfx::B2IBox&  rBounds )
         {
             fillImage(destIterRange(maBegin,
                                     maRawAccessor,
@@ -465,7 +463,7 @@ namespace
         template< typename Iterator, typename Col, typename RawAcc >
         void implRenderLine2( const basegfx::B2IPoint& rPt1,
                               const basegfx::B2IPoint& rPt2,
-                              const basegfx::B2IRange& rBounds,
+                              const basegfx::B2IBox&   rBounds,
                               Col                      col,
                               const Iterator&          begin,
                               const RawAcc&            rawAcc )
@@ -478,13 +476,13 @@ namespace
                                rawAcc );
             // TODO(P2): perhaps this needs pushing up the stack a bit
             // to make more complex polygons more efficient ...
-            damaged( basegfx::B2IRange( rPt1, rPt2 ) );
+            damaged( basegfx::B2IBox( rPt1, rPt2 ) );
         }
 
         template< typename Iterator, typename Accessor, typename RawAcc >
         void implRenderLine( const basegfx::B2IPoint& rPt1,
                              const basegfx::B2IPoint& rPt2,
-                             const basegfx::B2IRange& rBounds,
+                             const basegfx::B2IBox&   rBounds,
                              Color                    col,
                              const Iterator&          begin,
                              const Accessor&          acc,
@@ -500,7 +498,7 @@ namespace
         template< typename Iterator, typename RawAcc, typename XorAcc >
         void implDrawLine( const basegfx::B2IPoint& rPt1,
                            const basegfx::B2IPoint& rPt2,
-                           const basegfx::B2IRange& rBounds,
+                           const basegfx::B2IBox&   rBounds,
                            Color                    col,
                            const Iterator&          begin,
                            const RawAcc&            rawAcc,
@@ -517,7 +515,7 @@ namespace
 
         virtual void drawLine_i(const basegfx::B2IPoint& rPt1,
                                 const basegfx::B2IPoint& rPt2,
-                                const basegfx::B2IRange& rBounds,
+                                const basegfx::B2IBox&   rBounds,
                                 Color                    lineColor,
                                 DrawMode                 drawMode )
         {
@@ -537,7 +535,7 @@ namespace
 
         virtual void drawLine_i(const basegfx::B2IPoint&     rPt1,
                                 const basegfx::B2IPoint&     rPt2,
-                                const basegfx::B2IRange&     rBounds,
+                                const basegfx::B2IBox&       rBounds,
                                 Color                        lineColor,
                                 DrawMode                     drawMode,
                                 const BitmapDeviceSharedPtr& rClip )
@@ -550,7 +548,7 @@ namespace
 
         template< typename Iterator, typename RawAcc >
         void implDrawPolygon( const basegfx::B2DPolygon& rPoly,
-                              const basegfx::B2IRange&   rBounds,
+                              const basegfx::B2IBox&     rBounds,
                               Color                      col,
                               const Iterator&            begin,
                               const RawAcc&              acc )
@@ -581,7 +579,7 @@ namespace
         }
 
         virtual void drawPolygon_i(const basegfx::B2DPolygon& rPoly,
-                                   const basegfx::B2IRange&   rBounds,
+                                   const basegfx::B2IBox&     rBounds,
                                    Color                      lineColor,
                                    DrawMode                   drawMode )
         {
@@ -596,7 +594,7 @@ namespace
         }
 
         virtual void drawPolygon_i(const basegfx::B2DPolygon&   rPoly,
-                                   const basegfx::B2IRange&     rBounds,
+                                   const basegfx::B2IBox&       rBounds,
                                    Color                        lineColor,
                                    DrawMode                     drawMode,
                                    const BitmapDeviceSharedPtr& rClip )
@@ -616,7 +614,7 @@ namespace
                                   Color                          col,
                                   const Iterator&                begin,
                                   const RawAcc&                  acc,
-                                  const basegfx::B2IRange&       rBounds )
+                                  const basegfx::B2IBox&         rBounds )
         {
             basegfx::B2DPolyPolygon aPoly( rPoly );
             if( rPoly.areControlPointsUsed() )
@@ -633,14 +631,14 @@ namespace
             if( mpDamage )
             {
                 basegfx::B2DRange const aPolyBounds( basegfx::tools::getRange(aPoly) );
-                damaged( basegfx::fround( aPolyBounds ) );
+                damaged( basegfx::unotools::b2ISurroundingBoxFromB2DRange( aPolyBounds ) );
             }
         }
 
         virtual void fillPolyPolygon_i(const basegfx::B2DPolyPolygon& rPoly,
                                        Color                          fillColor,
                                        DrawMode                       drawMode,
-                                       const basegfx::B2IRange&       rBounds )
+                                       const basegfx::B2IBox&         rBounds )
         {
             if( drawMode == DrawMode_XOR )
                 implFillPolyPolygon( rPoly, fillColor,
@@ -657,7 +655,7 @@ namespace
         virtual void fillPolyPolygon_i(const basegfx::B2DPolyPolygon& rPoly,
                                        Color                          fillColor,
                                        DrawMode                       drawMode,
-                                       const basegfx::B2IRange&       rBounds,
+                                       const basegfx::B2IBox&         rBounds,
                                        const BitmapDeviceSharedPtr&   rClip )
         {
             if( drawMode == DrawMode_XOR )
@@ -674,8 +672,8 @@ namespace
 
         template< typename Iterator, typename RawAcc >
         void implDrawBitmap(const BitmapDeviceSharedPtr& rSrcBitmap,
-                            const basegfx::B2IRange&     rSrcRect,
-                            const basegfx::B2IRange&     rDstRect,
+                            const basegfx::B2IBox&       rSrcRect,
+                            const basegfx::B2IBox&       rDstRect,
                             const Iterator&              begin,
                             const RawAcc&                acc)
         {
@@ -695,8 +693,8 @@ namespace
 
         template< typename Iterator, typename Acc >
         void implDrawBitmapGeneric(const BitmapDeviceSharedPtr& rSrcBitmap,
-                                   const basegfx::B2IRange&     rSrcRect,
-                                   const basegfx::B2IRange&     rDstRect,
+                                   const basegfx::B2IBox&       rSrcRect,
+                                   const basegfx::B2IBox&       rDstRect,
                                    const Iterator&              begin,
                                    const Acc&                   acc)
         {
@@ -713,8 +711,8 @@ namespace
         }
 
         virtual void drawBitmap_i(const BitmapDeviceSharedPtr& rSrcBitmap,
-                                  const basegfx::B2IRange&     rSrcRect,
-                                  const basegfx::B2IRange&     rDstRect,
+                                  const basegfx::B2IBox&       rSrcRect,
+                                  const basegfx::B2IBox&       rDstRect,
                                   DrawMode                     drawMode )
         {
             if( isCompatibleBitmap( rSrcBitmap ) )
@@ -743,8 +741,8 @@ namespace
         }
 
         virtual void drawBitmap_i(const BitmapDeviceSharedPtr& rSrcBitmap,
-                                  const basegfx::B2IRange&     rSrcRect,
-                                  const basegfx::B2IRange&     rDstRect,
+                                  const basegfx::B2IBox&       rSrcRect,
+                                  const basegfx::B2IBox&       rDstRect,
                                   DrawMode                     drawMode,
                                   const BitmapDeviceSharedPtr& rClip )
         {
@@ -775,7 +773,7 @@ namespace
 
         virtual void drawMaskedColor_i(Color                        aSrcColor,
                                        const BitmapDeviceSharedPtr& rAlphaMask,
-                                       const basegfx::B2IRange&     rSrcRect,
+                                       const basegfx::B2IBox&       rSrcRect,
                                        const basegfx::B2IPoint&     rDstPoint )
         {
             boost::shared_ptr<mask_bitmap_type>      pMask( getCompatibleClipMask(rAlphaMask) );
@@ -824,7 +822,7 @@ namespace
 
         virtual void drawMaskedColor_i(Color                        aSrcColor,
                                        const BitmapDeviceSharedPtr& rAlphaMask,
-                                       const basegfx::B2IRange&     rSrcRect,
+                                       const basegfx::B2IBox&       rSrcRect,
                                        const basegfx::B2IPoint&     rDstPoint,
                                        const BitmapDeviceSharedPtr& rClip )
         {
@@ -888,8 +886,8 @@ namespace
         template< typename Iterator, typename Acc >
         void implDrawMaskedBitmap(const BitmapDeviceSharedPtr& rSrcBitmap,
                                   const BitmapDeviceSharedPtr& rMask,
-                                  const basegfx::B2IRange&     rSrcRect,
-                                  const basegfx::B2IRange&     rDstRect,
+                                  const basegfx::B2IBox&       rSrcRect,
+                                  const basegfx::B2IBox&       rDstRect,
                                   const Iterator&              begin,
                                   const Acc&                   acc)
         {
@@ -919,8 +917,8 @@ namespace
         template< typename Iterator, typename Acc >
         void implDrawMaskedBitmapGeneric(const BitmapDeviceSharedPtr& rSrcBitmap,
                                          const BitmapDeviceSharedPtr& rMask,
-                                         const basegfx::B2IRange&     rSrcRect,
-                                         const basegfx::B2IRange&     rDstRect,
+                                         const basegfx::B2IBox&       rSrcRect,
+                                         const basegfx::B2IBox&       rDstRect,
                                          const Iterator&              begin,
                                          const Acc&                   acc)
         {
@@ -952,8 +950,8 @@ namespace
 
         virtual void drawMaskedBitmap_i(const BitmapDeviceSharedPtr& rSrcBitmap,
                                         const BitmapDeviceSharedPtr& rMask,
-                                        const basegfx::B2IRange&     rSrcRect,
-                                        const basegfx::B2IRange&     rDstRect,
+                                        const basegfx::B2IBox&       rSrcRect,
+                                        const basegfx::B2IBox&       rDstRect,
                                         DrawMode                     drawMode )
         {
             if( isCompatibleClipMask(rMask) &&
@@ -988,8 +986,8 @@ namespace
 
         virtual void drawMaskedBitmap_i(const BitmapDeviceSharedPtr& rSrcBitmap,
                                         const BitmapDeviceSharedPtr& rMask,
-                                        const basegfx::B2IRange&     rSrcRect,
-                                        const basegfx::B2IRange&     rDstRect,
+                                        const basegfx::B2IBox&       rSrcRect,
+                                        const basegfx::B2IBox&       rDstRect,
                                         DrawMode                     drawMode,
                                         const BitmapDeviceSharedPtr& rClip )
         {
@@ -1052,7 +1050,7 @@ struct ImplBitmapDevice
         area under the excluding-bottommost-and-rightmost-pixels fill
         rule)
      */
-    basegfx::B2IRange         maBounds;
+    basegfx::B2IBox           maBounds;
 
     /** Bounds of the device.
 
@@ -1064,7 +1062,7 @@ struct ImplBitmapDevice
         The member is used to clip line stroking against the device
         bounds.
      */
-    basegfx::B2IRange         maLineClipRect;
+    basegfx::B2IBox           maLineClipRect;
 
     /// Scanline format, as provided at the constructor
     sal_Int32                 mnScanlineFormat;
@@ -1093,7 +1091,7 @@ struct ImplBitmapDevice
 };
 
 
-BitmapDevice::BitmapDevice( const basegfx::B2IRange&         rBounds,
+BitmapDevice::BitmapDevice( const basegfx::B2IBox&           rBounds,
                             sal_Int32                        nScanlineFormat,
                             sal_Int32                        nScanlineStride,
                             sal_uInt8*                       pFirstScanline,
@@ -1104,10 +1102,7 @@ BitmapDevice::BitmapDevice( const basegfx::B2IRange&         rBounds,
     mpImpl->mpMem = rMem;
     mpImpl->mpPalette = rPalette;
     mpImpl->maBounds = rBounds;
-    mpImpl->maLineClipRect = basegfx::B2IRange( rBounds.getMinX(),
-                                                rBounds.getMinY(),
-                                                rBounds.getMaxX()-1,
-                                                rBounds.getMaxY()-1 );
+    mpImpl->maLineClipRect = rBounds;
     mpImpl->mnScanlineFormat = nScanlineFormat;
     mpImpl->mnScanlineStride = nScanlineStride;
     mpImpl->mpFirstScanline  = pFirstScanline;
@@ -1315,17 +1310,17 @@ void BitmapDevice::fillPolyPolygon( const basegfx::B2DPolyPolygon& rPoly,
 namespace
 {
     void assertImagePoint( const basegfx::B2IPoint& rPt,
-                           const basegfx::B2IRange& rPermittedRange )
+                           const basegfx::B2IBox&   rPermittedRange )
     {
         (void)rPt; (void)rPermittedRange;
         OSL_ASSERT( rPermittedRange.isInside(rPt) );
     }
 
-    void assertImageRange( const basegfx::B2IRange& rRange,
-                           const basegfx::B2IRange& rPermittedRange )
+    void assertImageRange( const basegfx::B2IBox& rRange,
+                           const basegfx::B2IBox& rPermittedRange )
     {
 #if OSL_DEBUG_LEVEL > 0
-        basegfx::B2IRange aRange( rRange );
+        basegfx::B2IBox aRange( rRange );
         aRange.intersect( rPermittedRange );
 
         OSL_ASSERT( aRange == rRange );
@@ -1336,15 +1331,15 @@ namespace
 
     // TODO(Q3): Move canvas/canvastools.hxx clipBlit() down
     // to basegfx, and use here!
-    bool clipAreaImpl( ::basegfx::B2IRange&       io_rSourceArea,
-                       ::basegfx::B2IPoint&       io_rDestPoint,
-                       const ::basegfx::B2IRange& rSourceBounds,
-                       const ::basegfx::B2IRange& rDestBounds )
+    bool clipAreaImpl( ::basegfx::B2IBox&       io_rSourceArea,
+                       ::basegfx::B2IPoint&     io_rDestPoint,
+                       const ::basegfx::B2IBox& rSourceBounds,
+                       const ::basegfx::B2IBox& rDestBounds )
     {
         const ::basegfx::B2IPoint aSourceTopLeft(
             io_rSourceArea.getMinimum() );
 
-        ::basegfx::B2IRange aLocalSourceArea( io_rSourceArea );
+        ::basegfx::B2IBox aLocalSourceArea( io_rSourceArea );
 
         // clip source area (which must be inside rSourceBounds)
         aLocalSourceArea.intersect( rSourceBounds );
@@ -1359,8 +1354,8 @@ namespace
         const ::basegfx::B2IVector aLowerRightOffset(
             aLocalSourceArea.getMaximum()-aSourceTopLeft );
 
-        ::basegfx::B2IRange aLocalDestArea( io_rDestPoint + aUpperLeftOffset,
-                                            io_rDestPoint + aLowerRightOffset );
+        ::basegfx::B2IBox aLocalDestArea( io_rDestPoint + aUpperLeftOffset,
+                                          io_rDestPoint + aLowerRightOffset );
 
         // clip dest area (which must be inside rDestBounds)
         aLocalDestArea.intersect( rDestBounds );
@@ -1375,8 +1370,8 @@ namespace
         const ::basegfx::B2IVector aDestLowerRightOffset(
             aLocalDestArea.getMaximum()-io_rDestPoint );
 
-        io_rSourceArea = ::basegfx::B2IRange( aSourceTopLeft + aDestUpperLeftOffset,
-                                              aSourceTopLeft + aDestLowerRightOffset );
+        io_rSourceArea = ::basegfx::B2IBox( aSourceTopLeft + aDestUpperLeftOffset,
+                                            aSourceTopLeft + aDestLowerRightOffset );
         io_rDestPoint  = aLocalDestArea.getMinimum();
 
         return true;
@@ -1384,10 +1379,10 @@ namespace
 
     // TODO(Q3): Move canvas/canvastools.hxx clipBlit() down
     // to basegfx, and use here!
-    bool clipAreaImpl( ::basegfx::B2IRange&       io_rDestArea,
-                       ::basegfx::B2IRange&       io_rSourceArea,
-                       const ::basegfx::B2IRange& rDestBounds,
-                       const ::basegfx::B2IRange& rSourceBounds )
+    bool clipAreaImpl( ::basegfx::B2IBox&       io_rDestArea,
+                       ::basegfx::B2IBox&       io_rSourceArea,
+                       const ::basegfx::B2IBox& rDestBounds,
+                       const ::basegfx::B2IBox& rSourceBounds )
     {
         // extract inherent scale
         const double nScaleX( io_rDestArea.getWidth() / (double)io_rSourceArea.getWidth() );
@@ -1399,7 +1394,7 @@ namespace
         const ::basegfx::B2IPoint aSourceTopLeft(
             io_rSourceArea.getMinimum() );
 
-        ::basegfx::B2IRange aLocalSourceArea( io_rSourceArea );
+        ::basegfx::B2IBox aLocalSourceArea( io_rSourceArea );
 
         // clip source area (which must be inside rSourceBounds)
         aLocalSourceArea.intersect( rSourceBounds );
@@ -1414,10 +1409,10 @@ namespace
         const ::basegfx::B2IVector aLowerRightOffset(
             aLocalSourceArea.getMaximum()-aSourceTopLeft );
 
-        ::basegfx::B2IRange aLocalDestArea( basegfx::fround(aDestTopLeft.getX() + nScaleX*aUpperLeftOffset.getX()),
-                                            basegfx::fround(aDestTopLeft.getY() + nScaleY*aUpperLeftOffset.getY()),
-                                            basegfx::fround(aDestTopLeft.getX() + nScaleX*aLowerRightOffset.getX()),
-                                            basegfx::fround(aDestTopLeft.getY() + nScaleY*aLowerRightOffset.getY()) );
+        ::basegfx::B2IBox aLocalDestArea( basegfx::fround(aDestTopLeft.getX() + nScaleX*aUpperLeftOffset.getX()),
+                                          basegfx::fround(aDestTopLeft.getY() + nScaleY*aUpperLeftOffset.getY()),
+                                          basegfx::fround(aDestTopLeft.getX() + nScaleX*aLowerRightOffset.getX()),
+                                          basegfx::fround(aDestTopLeft.getY() + nScaleY*aLowerRightOffset.getY()) );
 
         // clip dest area (which must be inside rDestBounds)
         aLocalDestArea.intersect( rDestBounds );
@@ -1432,10 +1427,10 @@ namespace
         const ::basegfx::B2IVector aDestLowerRightOffset(
             aLocalDestArea.getMaximum()-aDestTopLeft );
 
-        io_rSourceArea = ::basegfx::B2IRange( basegfx::fround(aSourceTopLeft.getX() + aDestUpperLeftOffset.getX()/nScaleX),
-                                              basegfx::fround(aSourceTopLeft.getY() + aDestUpperLeftOffset.getY()/nScaleY),
-                                              basegfx::fround(aSourceTopLeft.getX() + aDestLowerRightOffset.getX()/nScaleX),
-                                              basegfx::fround(aSourceTopLeft.getY() + aDestLowerRightOffset.getY()/nScaleY) );
+        io_rSourceArea = ::basegfx::B2IBox( basegfx::fround(aSourceTopLeft.getX() + aDestUpperLeftOffset.getX()/nScaleX),
+                                            basegfx::fround(aSourceTopLeft.getY() + aDestUpperLeftOffset.getY()/nScaleY),
+                                            basegfx::fround(aSourceTopLeft.getX() + aDestLowerRightOffset.getX()/nScaleX),
+                                            basegfx::fround(aSourceTopLeft.getY() + aDestLowerRightOffset.getY()/nScaleY) );
         io_rDestArea   = aLocalDestArea;
 
         // final source area clip (chopping round-offs)
@@ -1450,14 +1445,14 @@ namespace
 }
 
 void BitmapDevice::drawBitmap( const BitmapDeviceSharedPtr& rSrcBitmap,
-                               const basegfx::B2IRange&     rSrcRect,
-                               const basegfx::B2IRange&     rDstRect,
+                               const basegfx::B2IBox&       rSrcRect,
+                               const basegfx::B2IBox&       rDstRect,
                                DrawMode                     drawMode )
 {
     const basegfx::B2IVector& rSrcSize( rSrcBitmap->getSize() );
-    const basegfx::B2IRange   aSrcBounds( 0,0,rSrcSize.getX(),rSrcSize.getY() );
-    basegfx::B2IRange         aSrcRange( rSrcRect );
-    basegfx::B2IRange         aDestRange( rDstRect );
+    const basegfx::B2IBox     aSrcBounds( 0,0,rSrcSize.getX(),rSrcSize.getY() );
+    basegfx::B2IBox           aSrcRange( rSrcRect );
+    basegfx::B2IBox           aDestRange( rDstRect );
 
     if( clipAreaImpl( aDestRange,
                       aSrcRange,
@@ -1472,8 +1467,8 @@ void BitmapDevice::drawBitmap( const BitmapDeviceSharedPtr& rSrcBitmap,
 }
 
 void BitmapDevice::drawBitmap( const BitmapDeviceSharedPtr& rSrcBitmap,
-                               const basegfx::B2IRange&     rSrcRect,
-                               const basegfx::B2IRange&     rDstRect,
+                               const basegfx::B2IBox&       rSrcRect,
+                               const basegfx::B2IBox&       rDstRect,
                                DrawMode                     drawMode,
                                const BitmapDeviceSharedPtr& rClip )
 {
@@ -1484,9 +1479,9 @@ void BitmapDevice::drawBitmap( const BitmapDeviceSharedPtr& rSrcBitmap,
     }
 
     const basegfx::B2IVector& rSrcSize( rSrcBitmap->getSize() );
-    const basegfx::B2IRange   aSrcBounds( 0,0,rSrcSize.getX(),rSrcSize.getY() );
-    basegfx::B2IRange         aSrcRange( rSrcRect );
-    basegfx::B2IRange         aDestRange( rDstRect );
+    const basegfx::B2IBox     aSrcBounds( 0,0,rSrcSize.getX(),rSrcSize.getY() );
+    basegfx::B2IBox           aSrcRange( rSrcRect );
+    basegfx::B2IBox           aDestRange( rDstRect );
 
     if( clipAreaImpl( aDestRange,
                       aSrcRange,
@@ -1510,12 +1505,12 @@ void BitmapDevice::drawBitmap( const BitmapDeviceSharedPtr& rSrcBitmap,
 
 void BitmapDevice::drawMaskedColor( Color                        aSrcColor,
                                     const BitmapDeviceSharedPtr& rAlphaMask,
-                                    const basegfx::B2IRange&     rSrcRect,
+                                    const basegfx::B2IBox&       rSrcRect,
                                     const basegfx::B2IPoint&     rDstPoint )
 {
     const basegfx::B2IVector& rSrcSize( rAlphaMask->getSize() );
-    const basegfx::B2IRange   aSrcBounds( 0,0,rSrcSize.getX(),rSrcSize.getY() );
-    basegfx::B2IRange         aSrcRange( rSrcRect );
+    const basegfx::B2IBox     aSrcBounds( 0,0,rSrcSize.getX(),rSrcSize.getY() );
+    basegfx::B2IBox           aSrcRange( rSrcRect );
     basegfx::B2IPoint         aDestPoint( rDstPoint );
 
     if( clipAreaImpl( aSrcRange,
@@ -1537,8 +1532,8 @@ void BitmapDevice::drawMaskedColor( Color                        aSrcColor,
                 cloneBitmapDevice( aSize,
                                    shared_from_this()) );
             basegfx::B2ITuple aGcc3WorkaroundTemporary;
-            const basegfx::B2IRange aAlphaRange( aGcc3WorkaroundTemporary,
-                                                 aSize );
+            const basegfx::B2IBox aAlphaRange( aGcc3WorkaroundTemporary,
+                                               aSize );
             pAlphaCopy->drawBitmap(rAlphaMask,
                                    aSrcRange,
                                    aAlphaRange,
@@ -1554,7 +1549,7 @@ void BitmapDevice::drawMaskedColor( Color                        aSrcColor,
 
 void BitmapDevice::drawMaskedColor( Color                        aSrcColor,
                                     const BitmapDeviceSharedPtr& rAlphaMask,
-                                    const basegfx::B2IRange&     rSrcRect,
+                                    const basegfx::B2IBox&       rSrcRect,
                                     const basegfx::B2IPoint&     rDstPoint,
                                     const BitmapDeviceSharedPtr& rClip )
 {
@@ -1565,8 +1560,8 @@ void BitmapDevice::drawMaskedColor( Color                        aSrcColor,
     }
 
     const basegfx::B2IVector& rSrcSize( rAlphaMask->getSize() );
-    const basegfx::B2IRange   aSrcBounds( 0,0,rSrcSize.getX(),rSrcSize.getY() );
-    basegfx::B2IRange         aSrcRange( rSrcRect );
+    const basegfx::B2IBox     aSrcBounds( 0,0,rSrcSize.getX(),rSrcSize.getY() );
+    basegfx::B2IBox           aSrcRange( rSrcRect );
     basegfx::B2IPoint         aDestPoint( rDstPoint );
 
     if( clipAreaImpl( aSrcRange,
@@ -1590,8 +1585,8 @@ void BitmapDevice::drawMaskedColor( Color                        aSrcColor,
                     cloneBitmapDevice( aSize,
                                        shared_from_this()) );
                 basegfx::B2ITuple aGcc3WorkaroundTemporary;
-                const basegfx::B2IRange aAlphaRange( aGcc3WorkaroundTemporary,
-                                                     aSize );
+                const basegfx::B2IBox aAlphaRange( aGcc3WorkaroundTemporary,
+                                                   aSize );
                 pAlphaCopy->drawBitmap(rAlphaMask,
                                        aSrcRange,
                                        aAlphaRange,
@@ -1613,16 +1608,16 @@ void BitmapDevice::drawMaskedColor( Color                        aSrcColor,
 
 void BitmapDevice::drawMaskedBitmap( const BitmapDeviceSharedPtr& rSrcBitmap,
                                      const BitmapDeviceSharedPtr& rMask,
-                                     const basegfx::B2IRange&     rSrcRect,
-                                     const basegfx::B2IRange&     rDstRect,
+                                     const basegfx::B2IBox&       rSrcRect,
+                                     const basegfx::B2IBox&       rDstRect,
                                      DrawMode                     drawMode )
 {
     OSL_ASSERT( rMask->getSize() == rSrcBitmap->getSize() );
 
     const basegfx::B2IVector& rSrcSize( rSrcBitmap->getSize() );
-    const basegfx::B2IRange   aSrcBounds( 0,0,rSrcSize.getX(),rSrcSize.getY() );
-    basegfx::B2IRange         aSrcRange( rSrcRect );
-    basegfx::B2IRange         aDestRange( rDstRect );
+    const basegfx::B2IBox     aSrcBounds( 0,0,rSrcSize.getX(),rSrcSize.getY() );
+    basegfx::B2IBox           aSrcRange( rSrcRect );
+    basegfx::B2IBox           aDestRange( rDstRect );
 
     if( clipAreaImpl( aDestRange,
                       aSrcRange,
@@ -1638,8 +1633,8 @@ void BitmapDevice::drawMaskedBitmap( const BitmapDeviceSharedPtr& rSrcBitmap,
 
 void BitmapDevice::drawMaskedBitmap( const BitmapDeviceSharedPtr& rSrcBitmap,
                                      const BitmapDeviceSharedPtr& rMask,
-                                     const basegfx::B2IRange&     rSrcRect,
-                                     const basegfx::B2IRange&     rDstRect,
+                                     const basegfx::B2IBox&       rSrcRect,
+                                     const basegfx::B2IBox&       rDstRect,
                                      DrawMode                     drawMode,
                                      const BitmapDeviceSharedPtr& rClip )
 {
@@ -1652,9 +1647,9 @@ void BitmapDevice::drawMaskedBitmap( const BitmapDeviceSharedPtr& rSrcBitmap,
     OSL_ASSERT( rMask->getSize() == rSrcBitmap->getSize() );
 
     const basegfx::B2IVector& rSrcSize( rSrcBitmap->getSize() );
-    const basegfx::B2IRange   aSrcBounds( 0,0,rSrcSize.getX(),rSrcSize.getY() );
-    basegfx::B2IRange         aSrcRange( rSrcRect );
-    basegfx::B2IRange         aDestRange( rDstRect );
+    const basegfx::B2IBox     aSrcBounds( 0,0,rSrcSize.getX(),rSrcSize.getY() );
+    basegfx::B2IBox           aSrcRange( rSrcRect );
+    basegfx::B2IBox           aDestRange( rDstRect );
 
     if( clipAreaImpl( aDestRange,
                       aSrcRange,
@@ -1703,7 +1698,7 @@ struct StdMasks
 /// Produces a specialized renderer for the given pixel format
 template< class FormatTraits, class MaskTraits >
 BitmapDeviceSharedPtr createRenderer(
-    const basegfx::B2IRange&                                     rBounds,
+    const basegfx::B2IBox&                                       rBounds,
     sal_Int32                                                    nScanlineFormat,
     sal_Int32                                                    nScanlineStride,
     sal_uInt8*                                                   pFirstScanline,
@@ -1717,7 +1712,7 @@ BitmapDeviceSharedPtr createRenderer(
 
 template< class FormatTraits, class MaskTraits, class Accessor >
 BitmapDeviceSharedPtr createRenderer(
-    const basegfx::B2IRange&                                     rBounds,
+    const basegfx::B2IBox&                                       rBounds,
     sal_Int32                                                    nScanlineFormat,
     sal_Int32                                                    nScanlineStride,
     sal_uInt8*                                                   pFirstScanline,
@@ -1774,7 +1769,7 @@ PaletteMemorySharedVector createStandardPalette(
 
 template< class FormatTraits, class MaskTraits >
 BitmapDeviceSharedPtr createRenderer(
-    const basegfx::B2IRange&                   rBounds,
+    const basegfx::B2IBox&                     rBounds,
     sal_Int32                                  nScanlineFormat,
     sal_Int32                                  nScanlineStride,
     sal_uInt8*                                 pFirstScanline,
@@ -1798,7 +1793,7 @@ BitmapDeviceSharedPtr createRenderer(
 
 template< class FormatTraits, class MaskTraits >
 BitmapDeviceSharedPtr createRenderer(
-    const basegfx::B2IRange&                   rBounds,
+    const basegfx::B2IBox&                     rBounds,
     sal_Int32                                  nScanlineFormat,
     sal_Int32                                  nScanlineStride,
     sal_uInt8*                                 pFirstScanline,
@@ -1860,7 +1855,7 @@ BitmapDeviceSharedPtr createBitmapDeviceImpl( const basegfx::B2IVector&
                                               sal_Int32                                  nScanlineFormat,
                                               boost::shared_array< sal_uInt8 >           pMem,
                                               PaletteMemorySharedVector                  pPal,
-                                              const basegfx::B2IRange*                   pSubset,
+                                              const basegfx::B2IBox*                     pSubset,
                                               const IBitmapDeviceDamageTrackerSharedPtr& rDamage )
 {
     if( nScanlineFormat <= Format::NONE ||
@@ -1917,7 +1912,7 @@ BitmapDeviceSharedPtr createBitmapDeviceImpl( const basegfx::B2IVector&
         pMem.get() + nMemSize + nScanlineStride : pMem.get();
 
     // shrink render area to given subset, if given
-    basegfx::B2IRange aBounds(0,0,rSize.getX(),rSize.getY());
+    basegfx::B2IBox aBounds(0,0,rSize.getX(),rSize.getY());
     if( pSubset )
         aBounds.intersect( *pSubset );
 
@@ -2074,8 +2069,8 @@ BitmapDeviceSharedPtr createBitmapDevice( const basegfx::B2IVector&        rSize
                                    IBitmapDeviceDamageTrackerSharedPtr() );
 }
 
-BitmapDeviceSharedPtr subsetBitmapDevice( const BitmapDeviceSharedPtr&     rProto,
-                                          const basegfx::B2IRange&         rSubset )
+BitmapDeviceSharedPtr subsetBitmapDevice( const BitmapDeviceSharedPtr& rProto,
+                                          const basegfx::B2IBox&       rSubset )
 {
     return createBitmapDeviceImpl( rProto->getSize(),
                                    rProto->isTopDown(),
@@ -2086,8 +2081,8 @@ BitmapDeviceSharedPtr subsetBitmapDevice( const BitmapDeviceSharedPtr&     rProt
                                    rProto->getDamageTracker() );
 }
 
-BitmapDeviceSharedPtr cloneBitmapDevice( const basegfx::B2IVector&        rSize,
-                                         const BitmapDeviceSharedPtr&     rProto )
+BitmapDeviceSharedPtr cloneBitmapDevice( const basegfx::B2IVector&    rSize,
+                                         const BitmapDeviceSharedPtr& rProto )
 {
     return createBitmapDeviceImpl( rSize,
                                    rProto->isTopDown(),
diff --git a/basebmp/test/bmpdemo.cxx b/basebmp/test/bmpdemo.cxx
index b3e7096..4f53c3c 100644
--- a/basebmp/test/bmpdemo.cxx
+++ b/basebmp/test/bmpdemo.cxx
@@ -56,7 +56,7 @@
 #include <basegfx/polygon/b2dpolygontools.hxx>
 #include <basegfx/polygon/b2dpolygon.hxx>
 #include <basegfx/numeric/ftools.hxx>
-#include <basegfx/range/b2irange.hxx>
+#include <basegfx/range/b2ibox.hxx>
 #include <basegfx/vector/b2isize.hxx>
 #include <basegfx/vector/b2enums.hxx>
 #include <basegfx/point/b2ipoint.hxx>
@@ -1109,7 +1109,7 @@ void TestWindow::Paint( const Rectangle& /*rRect*/ )
 
         basebmp::BitmapDeviceSharedPtr pSubsetDevice =
             basebmp::subsetBitmapDevice( pDevice,
-                                         basegfx::B2IRange(3,3,7,7) );
+                                         basegfx::B2IBox(3,3,7,7) );
 
         const basegfx::B2IPoint aPt1(0,0);
         const basegfx::B2IPoint aPt2(1,9);
diff --git a/basebmp/test/bmpmasktest.cxx b/basebmp/test/bmpmasktest.cxx
index 755128b..e44aaed 100644
--- a/basebmp/test/bmpmasktest.cxx
+++ b/basebmp/test/bmpmasktest.cxx
@@ -36,7 +36,7 @@
 #include "cppunit/extensions/HelperMacros.h"
 
 #include <basegfx/vector/b2isize.hxx>
-#include <basegfx/range/b2irange.hxx>
+#include <basegfx/range/b2ibox.hxx>
 #include <basegfx/point/b2ipoint.hxx>
 #include <basegfx/polygon/b2dpolygon.hxx>
 #include <basegfx/polygon/b2dpolygontools.hxx>
@@ -67,8 +67,8 @@ private:
         rDevice->clear(Color(0));
         const Color aCol(0xFFFFFFFF);
 
-        const basegfx::B2IRange aSourceRect(0,0,10,10);
-        const basegfx::B2IRange aDestAll(0,0,10,10);
+        const basegfx::B2IBox aSourceRect(0,0,10,10);
+        const basegfx::B2IBox aDestAll(0,0,10,10);
 
         rDevice->drawMaskedBitmap(
             rBmp,
@@ -86,8 +86,8 @@ private:
         rDevice->clear(Color(0));
         const Color aCol(0xFFFFFFFF);
 
-        const basegfx::B2IRange aSourceRect(0,0,10,10);
-        const basegfx::B2IRange aDestLeftTop(0,0,6,6);
+        const basegfx::B2IBox aSourceRect(0,0,10,10);
+        const basegfx::B2IBox aDestLeftTop(0,0,6,6);
 
         rDevice->drawMaskedBitmap(
             rBmp,
diff --git a/basebmp/test/bmptest.cxx b/basebmp/test/bmptest.cxx
index 6a42c61..6510923 100644
--- a/basebmp/test/bmptest.cxx
+++ b/basebmp/test/bmptest.cxx
@@ -36,7 +36,7 @@
 #include "cppunit/extensions/HelperMacros.h"
 
 #include <basegfx/vector/b2isize.hxx>
-#include <basegfx/range/b2irange.hxx>
+#include <basegfx/range/b2ibox.hxx>
 #include <basegfx/point/b2ipoint.hxx>
 #include <basegfx/polygon/b2dpolygon.hxx>
 #include <basegfx/polygon/b2dpolygontools.hxx>
@@ -66,11 +66,11 @@ private:
         rDevice->clear(Color(0));
         const Color aCol(0xFFFFFFFF);
 
-        const basegfx::B2IRange aSourceRect(0,0,10,10);
-        const basegfx::B2IRange aDestLeftTop(0,0,4,4);
-        const basegfx::B2IRange aDestRightTop(6,0,10,4);
-        const basegfx::B2IRange aDestLeftBottom(0,6,4,10);
-        const basegfx::B2IRange aDestRightBottom(6,6,10,10);
+        const basegfx::B2IBox aSourceRect(0,0,10,10);
+        const basegfx::B2IBox aDestLeftTop(0,0,4,4);
+        const basegfx::B2IBox aDestRightTop(6,0,10,4);
+        const basegfx::B2IBox aDestLeftBottom(0,6,4,10);
+        const basegfx::B2IBox aDestRightBottom(6,6,10,10);
 
         rDevice->drawBitmap(
             rBmp,
@@ -111,11 +111,11 @@ private:
         rDevice->clear(Color(0));
         const Color aCol(0xFFFFFFFF);
 
-        const basegfx::B2IRange aSourceRect(0,0,10,10);
-        const basegfx::B2IRange aDestLeftTop(-2,-2,2,2);
-        const basegfx::B2IRange aDestRightTop(8,-2,12,2);
-        const basegfx::B2IRange aDestLeftBottom(-2,8,2,12);
-        const basegfx::B2IRange aDestRightBottom(8,8,12,12);
+        const basegfx::B2IBox aSourceRect(0,0,10,10);
+        const basegfx::B2IBox aDestLeftTop(-2,-2,2,2);
+        const basegfx::B2IBox aDestRightTop(8,-2,12,2);
+        const basegfx::B2IBox aDestLeftBottom(-2,8,2,12);
+        const basegfx::B2IBox aDestRightBottom(8,8,12,12);
 
         rDevice->drawBitmap(
             rBmp,
diff --git a/basebmp/test/cliptest.cxx b/basebmp/test/cliptest.cxx
index 08812a9..dd5ff85 100644
--- a/basebmp/test/cliptest.cxx
+++ b/basebmp/test/cliptest.cxx
@@ -38,7 +38,7 @@
 #include <basegfx/vector/b2isize.hxx>
 #include <basegfx/point/b2ipoint.hxx>
 #include <basegfx/range/b2drange.hxx>
-#include <basegfx/range/b2irange.hxx>
+#include <basegfx/range/b2ibox.hxx>
 #include <basegfx/polygon/b2dpolygon.hxx>
 #include <basegfx/polygon/b2dpolygontools.hxx>
 #include <basegfx/polygon/b2dpolypolygon.hxx>
@@ -155,8 +155,8 @@ private:
 
         rDevice->clear(aCol1);
         rDevice->drawBitmap(pBmp,
-                            basegfx::B2IRange(0,0,3,3),
-                            basegfx::B2IRange(-1,-1,4,4),
+                            basegfx::B2IBox(0,0,3,3),
+                            basegfx::B2IBox(-1,-1,4,4),
                             DrawMode_PAINT,
                             mpClipMask);
 
@@ -183,7 +183,7 @@ private:
             aCol,
             basebmp::DrawMode_PAINT );
 
-        const basegfx::B2IRange aSourceRect(0,0,10,10);
+        const basegfx::B2IBox aSourceRect(0,0,10,10);
         const basegfx::B2IPoint aDestLeftTop(0,0);
         const Color aCol2(0xF0F0F0F0);
         rDevice->drawMaskedColor(
diff --git a/basebmp/test/masktest.cxx b/basebmp/test/masktest.cxx
index 3847d60..8918a7a 100644
--- a/basebmp/test/masktest.cxx
+++ b/basebmp/test/masktest.cxx
@@ -36,7 +36,7 @@
 #include "cppunit/extensions/HelperMacros.h"
 
 #include <basegfx/vector/b2isize.hxx>
-#include <basegfx/range/b2irange.hxx>
+#include <basegfx/range/b2ibox.hxx>
 #include <basegfx/point/b2ipoint.hxx>
 #include <basegfx/polygon/b2dpolygon.hxx>
 #include <basegfx/polygon/b2dpolygontools.hxx>
@@ -65,7 +65,7 @@ private:
         const Color aCol(0);
         const Color aCol2(0xF0F0F0F0);
 
-        const basegfx::B2IRange aSourceRect(0,0,10,10);
+        const basegfx::B2IBox aSourceRect(0,0,10,10);
         const basegfx::B2IPoint aDestLeftTop(0,0);
         const basegfx::B2IPoint aDestRightTop(5,0);
         const basegfx::B2IPoint aDestLeftBottom(0,5);
diff --git a/basebmp/test/polytest.cxx b/basebmp/test/polytest.cxx
index 0be253e..177557c 100644
--- a/basebmp/test/polytest.cxx
+++ b/basebmp/test/polytest.cxx
@@ -36,7 +36,7 @@
 #include "cppunit/extensions/HelperMacros.h"
 
 #include <basegfx/vector/b2isize.hxx>
-#include <basegfx/range/b2irange.hxx>
+#include <basegfx/range/b2ibox.hxx>
 #include <basegfx/point/b2ipoint.hxx>
 #include <basegfx/matrix/b2dhommatrix.hxx>
 #include <basegfx/polygon/b2dpolygon.hxx>
@@ -191,7 +191,7 @@ private:
 
         BitmapDeviceSharedPtr pClippedDevice(
             subsetBitmapDevice( rDevice,
-                                basegfx::B2IRange(3,3,5,8) ));
+                                basegfx::B2IBox(3,3,5,8) ));
 
         rDevice->clear(aBgCol);
         pClippedDevice->fillPolyPolygon(
diff --git a/basegfx/inc/basegfx/tools/canvastools.hxx b/basegfx/inc/basegfx/tools/canvastools.hxx
index d16539f..5884563 100644
--- a/basegfx/inc/basegfx/tools/canvastools.hxx
+++ b/basegfx/inc/basegfx/tools/canvastools.hxx
@@ -70,6 +70,7 @@ namespace basegfx
     class B2DPoint;
     class B2DRange;
     class B3DRange;
+    class B2IBox;
     class B2IVector;
     class B2IPoint;
     class B2IRange;
@@ -206,6 +207,19 @@ namespace basegfx
          */
         BASEGFX_DLLPUBLIC ::basegfx::B2IRange   b2ISurroundingRangeFromB2DRange( const ::basegfx::B2DRange& rRange );
 
+        /** Return smalltest integer box, which completely contains
+            given floating point range.
+
+            @param rRange
+            Input range. Values must be within the representable
+            bounds of sal_Int32
+
+            @return the closest integer box, which completely contains
+            rRange. Note that this box will contain all pixel affected
+            by a polygon fill operation over the input range.
+         */
+        BASEGFX_DLLPUBLIC ::basegfx::B2IBox     b2ISurroundingBoxFromB2DRange( const ::basegfx::B2DRange& rRange );
+
         /** Return smalltest B2DRange with integer values, which
             completely contains given floating point range.
 
diff --git a/basegfx/source/tools/canvastools.cxx b/basegfx/source/tools/canvastools.cxx
index d29d579..896f561 100644
--- a/basegfx/source/tools/canvastools.cxx
+++ b/basegfx/source/tools/canvastools.cxx
@@ -55,6 +55,7 @@
 #include <basegfx/vector/b2isize.hxx>
 #include <basegfx/point/b2ipoint.hxx>
 #include <basegfx/range/b2irectangle.hxx>
+#include <basegfx/range/b2ibox.hxx>
 #include <basegfx/polygon/b2dpolygon.hxx>
 #include <basegfx/polygon/b2dpolypolygon.hxx>
 #include <basegfx/tools/canvastools.hxx>
@@ -597,6 +598,14 @@ namespace basegfx
                                         rRect.Y + rRect.Height );
         }
 
+        ::basegfx::B2IBox b2ISurroundingBoxFromB2DRange( const ::basegfx::B2DRange& rRange )
+        {
+            return ::basegfx::B2IBox( static_cast<sal_Int32>( floor(rRange.getMinX()) ),
+                                      static_cast<sal_Int32>( floor(rRange.getMinY()) ),
+                                      static_cast<sal_Int32>( ceil(rRange.getMaxX()) ),
+                                      static_cast<sal_Int32>( ceil(rRange.getMaxY()) ) );
+        }
+
         ::basegfx::B2IRange b2ISurroundingRangeFromB2DRange( const ::basegfx::B2DRange& rRange )
         {
             return ::basegfx::B2IRange( static_cast<sal_Int32>( floor(rRange.getMinX()) ),
diff --git a/vcl/headless/svpbmp.cxx b/vcl/headless/svpbmp.cxx
index f385682..d27b765 100644
--- a/vcl/headless/svpbmp.cxx
+++ b/vcl/headless/svpbmp.cxx
@@ -29,7 +29,7 @@
 #include "headless/svpbmp.hxx"
 
 #include <basegfx/vector/b2ivector.hxx>
-#include <basegfx/range/b2irange.hxx>
+#include <basegfx/range/b2ibox.hxx>
 #include <basebmp/scanlineformats.hxx>
 #include <basebmp/color.hxx>
 
@@ -96,7 +96,7 @@ bool SvpSalBitmap::Create( const SalBitmap& rSalBmp )
     {
         B2IVector aSize = rSrcBmp->getSize();
         m_aBitmap = cloneBitmapDevice( aSize, rSrcBmp );
-        B2IRange aRect( 0, 0, aSize.getX(), aSize.getY() );
+        B2IBox aRect( 0, 0, aSize.getX(), aSize.getY() );
         m_aBitmap->drawBitmap( rSrcBmp, aRect, aRect, DrawMode_PAINT );
     }
     else
diff --git a/vcl/headless/svpgdi.cxx b/vcl/headless/svpgdi.cxx
index 2a086b3..decd04d 100644
--- a/vcl/headless/svpgdi.cxx
+++ b/vcl/headless/svpgdi.cxx
@@ -31,7 +31,7 @@
 
 #include <vcl/sysdata.hxx>
 #include <basegfx/range/b2drange.hxx>
-#include <basegfx/range/b2irange.hxx>
+#include <basegfx/range/b2ibox.hxx>
 #include <basegfx/polygon/b2dpolypolygon.hxx>
 #include <basegfx/polygon/b2dpolygon.hxx>
 #include <basegfx/polygon/b2dpolygontools.hxx>
@@ -199,7 +199,7 @@ SvpSalGraphics::ClipUndoHandle::~ClipUndoHandle()
 // will avoid setting up the clip bitmap. Similarly if the
 // range doesn't appear at all we return true to avoid
 // rendering
-bool SvpSalGraphics::isClippedSetup( const basegfx::B2IRange &aRange, SvpSalGraphics::ClipUndoHandle &rUndo )
+bool SvpSalGraphics::isClippedSetup( const basegfx::B2IBox &aRange, SvpSalGraphics::ClipUndoHandle &rUndo )
 {
     if( m_bClipSetup )
         return false;
@@ -244,10 +244,10 @@ bool SvpSalGraphics::isClippedSetup( const basegfx::B2IRange &aRange, SvpSalGrap
 //    fprintf (stderr, " operation only overlaps with a single clip zone\n" );
         rUndo.m_aDevice = m_aDevice;
         m_aDevice = basebmp::subsetBitmapDevice( m_aOrigDevice,
-                                                 basegfx::B2IRange (aHitRect.Left(),
-                                                                    aHitRect.Top(),
-                                                                    aHitRect.Right(),
-                                                                    aHitRect.Bottom()) );
+                                                 basegfx::B2IBox (aHitRect.Left(),
+                                                                  aHitRect.Top(),
+                                                                  aHitRect.Right(),
+                                                                  aHitRect.Bottom()) );
         return false;
     }
 //    fprintf (stderr, "URK: complex & slow clipping case\n" );
@@ -281,7 +281,7 @@ bool SvpSalGraphics::setClipRegion( const Region& i_rClip )
         m_aClipMap.reset();
         Rectangle aBoundRect( i_rClip.GetBoundRect() );
         m_aDevice = basebmp::subsetBitmapDevice( m_aOrigDevice,
-                                                 basegfx::B2IRange(aBoundRect.Left(),aBoundRect.Top(),aBoundRect.Right(),aBoundRect.Bottom()) );
+                                                 basegfx::B2IBox(aBoundRect.Left(),aBoundRect.Top(),aBoundRect.Right(),aBoundRect.Bottom()) );
         m_bClipSetup = true;
     }
     else
@@ -531,8 +531,8 @@ void SvpSalGraphics::copyArea( long nDestX,
                                       long nSrcHeight,
                                       sal_uInt16 /*nFlags*/ )
 {
-    B2IRange aSrcRect( nSrcX, nSrcY, nSrcX+nSrcWidth, nSrcY+nSrcHeight );
-    B2IRange aDestRect( nDestX, nDestY, nDestX+nSrcWidth, nDestY+nSrcHeight );
+    B2IBox aSrcRect( nSrcX, nSrcY, nSrcX+nSrcWidth, nSrcY+nSrcHeight );
+    B2IBox aDestRect( nDestX, nDestY, nDestX+nSrcWidth, nDestY+nSrcHeight );
     // fprintf( stderr, "copyArea %ld pixels - clip region %d\n",
     //         (long)(nSrcWidth * nSrcHeight), m_aClipMap.get() != NULL );
     SvpSalGraphics::ClipUndoHandle aUndo( this );
@@ -546,12 +546,12 @@ void SvpSalGraphics::copyBits( const SalTwoRect* pPosAry,
 {
     SvpSalGraphics* pSrc = pSrcGraphics ?
         static_cast<SvpSalGraphics*>(pSrcGraphics) : this;
-    B2IRange aSrcRect( pPosAry->mnSrcX, pPosAry->mnSrcY,
-                       pPosAry->mnSrcX+pPosAry->mnSrcWidth,
-                       pPosAry->mnSrcY+pPosAry->mnSrcHeight );
-    B2IRange aDestRect( pPosAry->mnDestX, pPosAry->mnDestY,
-                        pPosAry->mnDestX+pPosAry->mnDestWidth,
-                        pPosAry->mnDestY+pPosAry->mnDestHeight );
+    B2IBox aSrcRect( pPosAry->mnSrcX, pPosAry->mnSrcY,
+                     pPosAry->mnSrcX+pPosAry->mnSrcWidth,
+                     pPosAry->mnSrcY+pPosAry->mnSrcHeight );
+    B2IBox aDestRect( pPosAry->mnDestX, pPosAry->mnDestY,
+                      pPosAry->mnDestX+pPosAry->mnDestWidth,
+                      pPosAry->mnDestY+pPosAry->mnDestHeight );
 
     SvpSalGraphics::ClipUndoHandle aUndo( this );
     if( !isClippedSetup( aDestRect, aUndo ) )
@@ -563,12 +563,12 @@ void SvpSalGraphics::drawBitmap( const SalTwoRect* pPosAry,
                                  const SalBitmap& rSalBitmap )
 {
     const SvpSalBitmap& rSrc = static_cast<const SvpSalBitmap&>(rSalBitmap);
-    B2IRange aSrcRect( pPosAry->mnSrcX, pPosAry->mnSrcY,
-                       pPosAry->mnSrcX+pPosAry->mnSrcWidth,
-                       pPosAry->mnSrcY+pPosAry->mnSrcHeight );
-    B2IRange aDestRect( pPosAry->mnDestX, pPosAry->mnDestY,
-                        pPosAry->mnDestX+pPosAry->mnDestWidth,
-                        pPosAry->mnDestY+pPosAry->mnDestHeight );
+    B2IBox aSrcRect( pPosAry->mnSrcX, pPosAry->mnSrcY,
+                     pPosAry->mnSrcX+pPosAry->mnSrcWidth,
+                     pPosAry->mnSrcY+pPosAry->mnSrcHeight );
+    B2IBox aDestRect( pPosAry->mnDestX, pPosAry->mnDestY,
+                      pPosAry->mnDestX+pPosAry->mnDestWidth,
+                      pPosAry->mnDestY+pPosAry->mnDestHeight );
 
     SvpSalGraphics::ClipUndoHandle aUndo( this );
     if( !isClippedSetup( aDestRect, aUndo ) )
@@ -589,12 +589,12 @@ void SvpSalGraphics::drawBitmap( const SalTwoRect* pPosAry,
 {
     const SvpSalBitmap& rSrc = static_cast<const SvpSalBitmap&>(rSalBitmap);
     const SvpSalBitmap& rSrcTrans = static_cast<const SvpSalBitmap&>(rTransparentBitmap);
-    B2IRange aSrcRect( pPosAry->mnSrcX, pPosAry->mnSrcY,
-                       pPosAry->mnSrcX+pPosAry->mnSrcWidth,
-                       pPosAry->mnSrcY+pPosAry->mnSrcHeight );
-    B2IRange aDestRect( pPosAry->mnDestX, pPosAry->mnDestY,
-                        pPosAry->mnDestX+pPosAry->mnDestWidth,
-                        pPosAry->mnDestY+pPosAry->mnDestHeight );
+    B2IBox aSrcRect( pPosAry->mnSrcX, pPosAry->mnSrcY,
+                     pPosAry->mnSrcX+pPosAry->mnSrcWidth,
+                     pPosAry->mnSrcY+pPosAry->mnSrcHeight );
+    B2IBox aDestRect( pPosAry->mnDestX, pPosAry->mnDestY,
+                      pPosAry->mnDestX+pPosAry->mnDestWidth,
+                      pPosAry->mnDestY+pPosAry->mnDestHeight );
     SvpSalGraphics::ClipUndoHandle aUndo( this );
     if( !isClippedSetup( aDestRect, aUndo ) )
         m_aDevice->drawMaskedBitmap( rSrc.getBitmap(), rSrcTrans.getBitmap(),
@@ -607,9 +607,9 @@ void SvpSalGraphics::drawMask( const SalTwoRect* pPosAry,
                                SalColor nMaskColor )
 {
     const SvpSalBitmap& rSrc = static_cast<const SvpSalBitmap&>(rSalBitmap);
-    B2IRange aSrcRect( pPosAry->mnSrcX, pPosAry->mnSrcY,
-                       pPosAry->mnSrcX+pPosAry->mnSrcWidth,
-                       pPosAry->mnSrcY+pPosAry->mnSrcHeight );
+    B2IBox aSrcRect( pPosAry->mnSrcX, pPosAry->mnSrcY,
+                     pPosAry->mnSrcX+pPosAry->mnSrcWidth,
+                     pPosAry->mnSrcY+pPosAry->mnSrcHeight );
     B2IPoint aDestPoint( pPosAry->mnDestX, pPosAry->mnDestY );
 
     // BitmapDevice::drawMaskedColor works with 0==transparent,
@@ -624,8 +624,8 @@ void SvpSalGraphics::drawMask( const SalTwoRect* pPosAry,
     aCopy->drawMaskedColor( aFgColor, rSrc.getBitmap(), aSrcRect, B2IPoint() );
 
     basebmp::Color aColor( nMaskColor );
-    B2IRange aSrcRect2( 0, 0, pPosAry->mnSrcWidth, pPosAry->mnSrcHeight );
-    const B2IRange aClipRect( aDestPoint, B2ITuple( aSrcRect.getWidth(), aSrcRect.getHeight() ) );
+    B2IBox aSrcRect2( 0, 0, pPosAry->mnSrcWidth, pPosAry->mnSrcHeight );
+    const B2IBox aClipRect( aDestPoint, B2ITuple( aSrcRect.getWidth(), aSrcRect.getHeight() ) );
 
     SvpSalGraphics::ClipUndoHandle aUndo( this );
     if( !isClippedSetup( aClipRect, aUndo ) )
@@ -638,8 +638,8 @@ SalBitmap* SvpSalGraphics::getBitmap( long nX, long nY, long nWidth, long nHeigh
     BitmapDeviceSharedPtr aCopy =
         cloneBitmapDevice( B2IVector( nWidth, nHeight ),
                            m_aDevice );
-    B2IRange aSrcRect( nX, nY, nX+nWidth, nY+nHeight );
-    B2IRange aDestRect( 0, 0, nWidth, nHeight );
+    B2IBox aSrcRect( nX, nY, nX+nWidth, nY+nHeight );
+    B2IBox aDestRect( 0, 0, nWidth, nHeight );
 
     SvpSalGraphics::ClipUndoHandle aUndo( this );
     if( !isClippedSetup( aDestRect, aUndo ) )
@@ -661,7 +661,7 @@ void SvpSalGraphics::invert( long nX, long nY, long nWidth, long nHeight, SalInv
     // FIXME: handle SAL_INVERT_50 and SAL_INVERT_TRACKFRAME
     B2DPolygon aRect = tools::createPolygonFromRect( B2DRectangle( nX, nY, nX+nWidth, nY+nHeight ) );
     B2DPolyPolygon aPolyPoly( aRect );
-    B2IRange aDestRange( nX, nY, nX + nWidth, nY + nHeight );
+    B2IBox aDestRange( nX, nY, nX + nWidth, nY + nHeight );
 
     SvpSalGraphics::ClipUndoHandle aUndo( this );
     if( !isClippedSetup( aDestRange, aUndo ) )
diff --git a/vcl/headless/svptext.cxx b/vcl/headless/svptext.cxx
index 866a49f..ff649a1 100644
--- a/vcl/headless/svptext.cxx
+++ b/vcl/headless/svptext.cxx
@@ -27,7 +27,7 @@
  ************************************************************************/
 
 #include <basegfx/range/b2drange.hxx>
-#include <basegfx/range/b2irange.hxx>
+#include <basegfx/range/b2ibox.hxx>
 #include <basegfx/polygon/b2dpolypolygon.hxx>
 
 #include <basebmp/scanlineformats.hxx>
@@ -532,8 +532,8 @@ void SvpSalGraphics::DrawServerFontLayout( const ServerFontLayout& rSalLayout )
             continue;
 
         // blend text color into target using the glyph's mask
-        const B2IRange aSrcRect( B2ITuple(0,0), aAlphaMask->getSize() );
-        const B2IRange aClipRect( aDstPoint, aAlphaMask->getSize() );
+        const B2IBox aSrcRect( B2ITuple(0,0), aAlphaMask->getSize() );
+        const B2IBox aClipRect( aDstPoint, aAlphaMask->getSize() );
 
         SvpSalGraphics::ClipUndoHandle aUndo( this );
         if( !isClippedSetup( aClipRect, aUndo ) )
diff --git a/vcl/inc/headless/svpgdi.hxx b/vcl/inc/headless/svpgdi.hxx
index b08edba..31ae253 100644
--- a/vcl/inc/headless/svpgdi.hxx
+++ b/vcl/inc/headless/svpgdi.hxx
@@ -66,7 +66,7 @@ private:
         ClipUndoHandle( SvpSalGraphics *pGfx ) : m_rGfx( *pGfx ) {}
         ~ClipUndoHandle();
     };
-    bool isClippedSetup( const basegfx::B2IRange &aRange, ClipUndoHandle &rUndo );
+    bool isClippedSetup( const basegfx::B2IBox &aRange, ClipUndoHandle &rUndo );
     void ensureClip();
 
 protected:
diff --git a/vcl/inc/unx/gtk/gtkframe.hxx b/vcl/inc/unx/gtk/gtkframe.hxx
index 43f420d..696e08e 100644
--- a/vcl/inc/unx/gtk/gtkframe.hxx
+++ b/vcl/inc/unx/gtk/gtkframe.hxx
@@ -432,7 +432,7 @@ public:
 
     static GtkSalFrame         *getFromWindow( GtkWindow *pWindow );
 
-    virtual void damaged (const basegfx::B2IRange& rDamageRect);
+    virtual void damaged (const basegfx::B2IBox& rDamageRect);
 };
 
 #define OOO_TYPE_FIXED ooo_fixed_get_type()
diff --git a/vcl/unx/gtk/window/gtkframe.cxx b/vcl/unx/gtk/window/gtkframe.cxx
index cb780e9..667b097 100644
--- a/vcl/unx/gtk/window/gtkframe.cxx
+++ b/vcl/unx/gtk/window/gtkframe.cxx
@@ -56,7 +56,7 @@
 #include <svids.hrc>
 #include <sal/macros.h>
 
-#include <basegfx/range/b2irange.hxx>
+#include <basegfx/range/b2ibox.hxx>
 #include <basegfx/vector/b2ivector.hxx>
 
 #include <algorithm>
@@ -352,7 +352,7 @@ struct DamageTracker : public basebmp::IBitmapDeviceDamageTracker
 {
     DamageTracker(GtkSalFrame& rFrame) : m_rFrame(rFrame)
     {}
-    virtual void damaged(const basegfx::B2IRange& rDamageRect) const
+    virtual void damaged(const basegfx::B2IBox& rDamageRect) const
     {
         m_rFrame.damaged(rDamageRect);
     }
@@ -3014,7 +3014,7 @@ void GtkSalFrame::popIgnoreDamage()
 #endif
 }
 
-void GtkSalFrame::damaged (const basegfx::B2IRange& rDamageRect)
+void GtkSalFrame::damaged (const basegfx::B2IBox& rDamageRect)
 {
 #if !GTK_CHECK_VERSION(3,0,0)
     (void)rDamageRect;
commit aeee94cb587082430f3a277a24ae459829f6d384
Author: Thorsten Behrens <tbehrens at suse.com>
Date:   Wed Nov 2 21:43:22 2011 +0100

    Cleanup basegfx - docs, visibility, pointless methods.
    
    Added docs to the range/* classes, removed methods the compiler can
    generate for us, removed unused header, and cleaned up visibility
    markup (inlines don't really need to be exported).

diff --git a/basegfx/Package_inc.mk b/basegfx/Package_inc.mk
index 2ecc260..1263c50 100644
--- a/basegfx/Package_inc.mk
+++ b/basegfx/Package_inc.mk
@@ -52,7 +52,6 @@ $(eval $(call gb_Package_add_file,basegfx_inc,inc/basegfx/range/basicbox.hxx,bas
 $(eval $(call gb_Package_add_file,basegfx_inc,inc/basegfx/range/b2dconnectedranges.hxx,basegfx/range/b2dconnectedranges.hxx))
 $(eval $(call gb_Package_add_file,basegfx_inc,inc/basegfx/range/b3drange.hxx,basegfx/range/b3drange.hxx))
 $(eval $(call gb_Package_add_file,basegfx_inc,inc/basegfx/range/b2drange.hxx,basegfx/range/b2drange.hxx))
-$(eval $(call gb_Package_add_file,basegfx_inc,inc/basegfx/range/rangeexpander.hxx,basegfx/range/rangeexpander.hxx))
 $(eval $(call gb_Package_add_file,basegfx_inc,inc/basegfx/range/b2irange.hxx,basegfx/range/b2irange.hxx))
 $(eval $(call gb_Package_add_file,basegfx_inc,inc/basegfx/range/b1ibox.hxx,basegfx/range/b1ibox.hxx))
 $(eval $(call gb_Package_add_file,basegfx_inc,inc/basegfx/range/b2dpolyrange.hxx,basegfx/range/b2dpolyrange.hxx))
diff --git a/basegfx/inc/basegfx/range/b1drange.hxx b/basegfx/inc/basegfx/range/b1drange.hxx
index 83bca95..cac1efb 100644
--- a/basegfx/inc/basegfx/range/b1drange.hxx
+++ b/basegfx/inc/basegfx/range/b1drange.hxx
@@ -37,38 +37,53 @@ namespace basegfx
 {
     class B1IRange;
 
-    class BASEGFX_DLLPUBLIC B1DRange
+    /** A one-dimensional interval over doubles
+
+        This is a set of real numbers, bounded by a lower and an upper
+        value. All inbetween values are included in the set (see also
+        http://en.wikipedia.org/wiki/Interval_%28mathematics%29).
+
+        The set is closed, i.e. the upper and the lower bound are
+        included (if you're used to the notation - we're talking about
+        [a,b] here, compared to half-open [a,b) or open intervals
+        (a,b)).
+
+        That means, isInside(val) will return true also for values of
+        val=a or val=b.
+     */
+    class B1DRange
     {
         ::basegfx::BasicRange< double, DoubleTraits >   maRange;
 
     public:
-        B1DRange()
-        {
-        }
+        B1DRange() {}
 
+        /// Create degenerate interval consisting of a single double number
         explicit B1DRange(double fStartValue)
         :   maRange(fStartValue)
         {
         }
 
+        /// Create proper interval between the two given double values
         B1DRange(double fStartValue1, double fStartValue2)
         :   maRange(fStartValue1)
         {
             expand(fStartValue2);
         }
 
-        B1DRange(const B1DRange& rRange)
-        :   maRange(rRange.maRange)
-        {
-        }
+        BASEGFX_DLLPUBLIC explicit B1DRange( const B1IRange& rRange );
 
-        explicit B1DRange( const B1IRange& rRange );
+        /** Check if the interval set is empty
 
+            @return false, if no value is in this set - having a
+            single value included will already return true.
+         */
         bool isEmpty() const
         {
             return maRange.isEmpty();
         }
 
+        /// reset the object to empty state again, clearing all values
         void reset()
         {
             maRange.reset();
@@ -84,72 +99,78 @@ namespace basegfx
             return (maRange != rRange.maRange);
         }
 
-        B1DRange& operator=(const B1DRange& rRange)
-        {
-            maRange = rRange.maRange;
-            return *this;
-        }
-
         bool equal(const B1DRange& rRange) const
         {
             return (maRange.equal(rRange.maRange));
         }
 
+        /// get lower bound of the set. returns arbitrary values for empty sets.
         double getMinimum() const
         {
             return maRange.getMinimum();
         }
 
+        /// get upper bound of the set. returns arbitrary values for empty sets.
         double getMaximum() const
         {
             return maRange.getMaximum();
         }
 
+        /// return difference between upper and lower value. returns 0 for empty sets.
         double getRange() const
         {
             return maRange.getRange();
         }
 
+        /// return middle of upper and lower value. returns 0 for empty sets.
         double getCenter() const
         {
             return maRange.getCenter();
         }
 
+        /// yields true if value is contained in set
         bool isInside(double fValue) const
         {
             return maRange.isInside(fValue);
         }
 
+        /// yields true if rRange is inside, or equal to set
         bool isInside(const B1DRange& rRange) const
         {
             return maRange.isInside(rRange.maRange);
         }
 
+        /// yields true if rRange at least partly inside set
         bool overlaps(const B1DRange& rRange) const
         {
             return maRange.overlaps(rRange.maRange);
         }
 
+        /// yields true if overlaps(rRange) does, and the overlap is larger than infinitesimal
         bool overlapsMore(const B1DRange& rRange) const
         {
             return maRange.overlapsMore(rRange.maRange);
         }
 
+        /// add fValue to the set, expanding as necessary
         void expand(double fValue)
         {
             maRange.expand(fValue);
         }
 
+        /// add rRange to the set, expanding as necessary
         void expand(const B1DRange& rRange)
         {
             maRange.expand(rRange.maRange);
         }
 
+        /// calc set intersection
         void intersect(const B1DRange& rRange)
         {
             maRange.intersect(rRange.maRange);
         }
 
+        /// grow set by fValue on both sides
         void grow(double fValue)
         {
             maRange.grow(fValue);
@@ -160,7 +181,8 @@ namespace basegfx
 
         @return the nearest integer for this range
     */
-    B1IRange fround(const B1DRange& rRange);
+    BASEGFX_DLLPUBLIC B1IRange fround(const B1DRange& rRange);
+
 } // end of namespace basegfx
 
 
diff --git a/basegfx/inc/basegfx/range/b1ibox.hxx b/basegfx/inc/basegfx/range/b1ibox.hxx
index f40c763..5bfe9f7 100644
--- a/basegfx/inc/basegfx/range/b1ibox.hxx
+++ b/basegfx/inc/basegfx/range/b1ibox.hxx
@@ -35,36 +35,56 @@
 
 namespace basegfx
 {
-    class BASEGFX_DLLPUBLIC B1IBox
+    /** A one-dimensional interval over integers
+
+        This is most easily depicted as a set of integers, bounded by
+        a lower and an upper value - but excluding the upper
+        value. All inbetween values are included in the set (see also
+        http://en.wikipedia.org/wiki/Interval_%28mathematics%29).
+
+        The set is half-open, i.e. the lower bound is included, the
+        upper bound not (if you're used to the notation - we're
+        talking about [a,b) here, compared to closed [a,b] or fully
+        open intervals (a,b)).
+
+        If you don't need a half-open interval, check B1IRange.
+
+        That means, isInside(val) will return true also for values of
+        val=a, but not for val=b.
+
+        @see B1IRange
+     */
+    class B1IBox
     {
         ::basegfx::BasicBox maRange;
 
     public:
-        B1IBox()
-        {
-        }
+        B1IBox() {}
 
+        /// Create degenerate interval that's still empty
         explicit B1IBox(sal_Int32 nStartValue)
         :   maRange(nStartValue)
         {
         }
 
+        /// Create proper interval between the two given values
         B1IBox(sal_Int32 nStartValue1, sal_Int32 nStartValue2)
         :   maRange(nStartValue1)
         {
             expand(nStartValue2);
         }
 
-        B1IBox(const B1IBox& rBox)
-        :   maRange(rBox.maRange)
-        {
-        }
+        /** Check if the interval set is empty
 
+            @return false, if no value is in this set - having a
+            single value included will still return false.
+         */
         bool isEmpty() const
         {
             return maRange.isEmpty();
         }
 
+        /// reset the object to empty state again, clearing all values
         void reset()
         {
             maRange.reset();
@@ -80,61 +100,67 @@ namespace basegfx
             return (maRange != rBox.maRange);
         }
 
-        void operator=(const B1IBox& rBox)
-        {
-            maRange = rBox.maRange;
-        }
-
+        /// get lower bound of the set. returns arbitrary values for empty sets.
         sal_Int32 getMinimum() const
         {
             return maRange.getMinimum();
         }
 
+        /// get upper bound of the set. returns arbitrary values for empty sets.
         sal_Int32 getMaximum() const
         {
             return maRange.getMaximum();
         }
 
+        /// return difference between upper and lower value. returns 0 for empty sets.
         Int32Traits::DifferenceType getRange() const
         {
             return maRange.getRange();
         }
 
+        /// return middle of upper and lower value. returns 0 for empty sets.
         double getCenter() const
         {
             return maRange.getCenter();
         }
 
+        /// yields true if value is contained in set
         bool isInside(sal_Int32 nValue) const
         {
             return maRange.isInside(nValue);
         }
 
+        /// yields true if rRange is inside, or equal to set
         bool isInside(const B1IBox& rBox) const
         {
             return maRange.isInside(rBox.maRange);
         }
 
+        /// yields true if rRange at least partly inside set
         bool overlaps(const B1IBox& rBox) const
         {
             return maRange.overlaps(rBox.maRange);
         }
 
+        /// add nValue to the set, expanding as necessary
         void expand(sal_Int32 nValue)
         {
             maRange.expand(nValue);
         }
 
+        /// add rBox to the set, expanding as necessary
         void expand(const B1IBox& rBox)
         {
             maRange.expand(rBox.maRange);
         }
 
+        /// calc set intersection
         void intersect(const B1IBox& rBox)
         {
             maRange.intersect(rBox.maRange);
         }
 
+        /// grow set by nValue on both sides
         void grow(sal_Int32 nValue)
         {
             maRange.grow(nValue);
diff --git a/basegfx/inc/basegfx/range/b1irange.hxx b/basegfx/inc/basegfx/range/b1irange.hxx
index 81e19ef..6d03335 100644
--- a/basegfx/inc/basegfx/range/b1irange.hxx
+++ b/basegfx/inc/basegfx/range/b1irange.hxx
@@ -35,36 +35,55 @@
 
 namespace basegfx
 {
-    class BASEGFX_DLLPUBLIC B1IRange
+    /** A one-dimensional interval over integers
+
+        This is a set of real numbers, bounded by a lower and an upper
+        value. All inbetween values are included in the set (see also
+        http://en.wikipedia.org/wiki/Interval_%28mathematics%29).
+
+        Probably you rather want B1IBox for integers.
+
+        The set is closed, i.e. the upper and the lower bound are
+        included (if you're used to the notation - we're talking about
+        [a,b] here, compared to half-open [a,b) or open intervals
+        (a,b)).
+
+        That means, isInside(val) will return true also for values of
+        val=a or val=b.
+
+        @see B1IBox
+     */
+    class B1IRange
     {
         ::basegfx::BasicRange< sal_Int32, Int32Traits > maRange;
 
     public:
-        B1IRange()
-        {
-        }
+        B1IRange() {}
 
+        /// Create degenerate interval consisting of a single double number
         explicit B1IRange(sal_Int32 nStartValue)
         :   maRange(nStartValue)
         {
         }
 
+        /// Create proper interval between the two given values
         B1IRange(sal_Int32 nStartValue1, sal_Int32 nStartValue2)
         :   maRange(nStartValue1)
         {
             expand(nStartValue2);
         }
 
-        B1IRange(const B1IRange& rRange)
-        :   maRange(rRange.maRange)
-        {
-        }
+        /** Check if the interval set is empty
 
+            @return false, if no value is in this set - having a
+            single value included will already return true.
+         */
         bool isEmpty() const
         {
             return maRange.isEmpty();
         }
 
+        /// reset the object to empty state again, clearing all values
         void reset()
         {
             maRange.reset();
@@ -80,67 +99,73 @@ namespace basegfx
             return (maRange != rRange.maRange);
         }
 
-        B1IRange& operator=(const B1IRange& rRange)
-        {
-            maRange = rRange.maRange;
-            return *this;
-        }
-
+        /// get lower bound of the set. returns arbitrary values for empty sets.
         sal_Int32 getMinimum() const
         {
             return maRange.getMinimum();
         }
 
+        /// get upper bound of the set. returns arbitrary values for empty sets.
         sal_Int32 getMaximum() const
         {
             return maRange.getMaximum();
         }
 
+        /// return difference between upper and lower value. returns 0 for empty sets.
         Int32Traits::DifferenceType getRange() const
         {
             return maRange.getRange();
         }
 
+        /// return middle of upper and lower value. returns 0 for empty sets.
         double getCenter() const
         {
             return maRange.getCenter();
         }
 
+        /// yields true if value is contained in set
         bool isInside(sal_Int32 nValue) const
         {
             return maRange.isInside(nValue);
         }
 
+        /// yields true if rRange is inside, or equal to set
         bool isInside(const B1IRange& rRange) const
         {
             return maRange.isInside(rRange.maRange);
         }
 
+        /// yields true if rRange at least partly inside set
         bool overlaps(const B1IRange& rRange) const
         {
             return maRange.overlaps(rRange.maRange);
         }
 
+        /// yields true if overlaps(rRange) does, and the overlap is larger than infinitesimal
         bool overlapsMore(const B1IRange& rRange) const
         {
             return maRange.overlapsMore(rRange.maRange);
         }
 
+        /// add nValue to the set, expanding as necessary
         void expand(sal_Int32 nValue)
         {
             maRange.expand(nValue);
         }
 
+        /// add rRange to the set, expanding as necessary
         void expand(const B1IRange& rRange)
         {
             maRange.expand(rRange.maRange);
         }
 
+        /// calc set intersection
         void intersect(const B1IRange& rRange)
         {
             maRange.intersect(rRange.maRange);
         }
 
+        /// grow set by nValue on both sides
         void grow(sal_Int32 nValue)
         {
             maRange.grow(nValue);
diff --git a/basegfx/inc/basegfx/range/b2drange.hxx b/basegfx/inc/basegfx/range/b2drange.hxx
index 0631f5e..b8a51ae 100644
--- a/basegfx/inc/basegfx/range/b2drange.hxx
+++ b/basegfx/inc/basegfx/range/b2drange.hxx
@@ -43,22 +43,38 @@ namespace basegfx
     class B2IRange;
     class B2DHomMatrix;
 
+    /** A two-dimensional interval over doubles
+
+        This is a set of real numbers, bounded by a lower and an upper
+        pair. All inbetween values are included in the set (see also
+        http://en.wikipedia.org/wiki/Interval_%28mathematics%29).
+
+        The set is closed, i.e. the upper and the lower bound are
+        included (if you're used to the notation - we're talking about
+        [a,b] here, compared to half-open [a,b) or open intervals
+        (a,b)).
+
+        That means, isInside(val) will return true also for values of
+        val=a or val=b.
+
+        @see B1DRange
+     */
     class B2DRange
     {
     public:
         typedef double          ValueType;
         typedef DoubleTraits    TraitsType;
 
-        B2DRange()
-        {
-        }
+        B2DRange() {}
 
+        /// Create degenerate interval consisting of a single point
         explicit B2DRange(const B2DTuple& rTuple)
         :   maRangeX(rTuple.getX()),
             maRangeY(rTuple.getY())
         {
         }
 
+        /// Create proper interval between the two given double pairs
         B2DRange(double x1,
                  double y1,
                  double x2,
@@ -70,6 +86,7 @@ namespace basegfx
             maRangeY.expand(y2);
         }
 
+        /// Create proper interval between the two given points
         B2DRange(const B2DTuple& rTuple1,
                  const B2DTuple& rTuple2)
         :   maRangeX(rTuple1.getX()),
@@ -78,14 +95,13 @@ namespace basegfx
             expand( rTuple2 );
         }
 
-        B2DRange(const B2DRange& rRange)
-        :   maRangeX(rRange.maRangeX),
-            maRangeY(rRange.maRangeY)
-        {
-        }
-
         BASEGFX_DLLPUBLIC explicit B2DRange(const B2IRange& rRange);
 
+        /** Check if the interval set is empty
+
+            @return false, if no value is in this set - having a
+            single point included will already return true.
+         */
         bool isEmpty() const
         {
             return (
@@ -94,6 +110,7 @@ namespace basegfx
                 );
         }
 
+        /// reset the object to empty state again, clearing all values
         void reset()
         {
             maRangeX.reset();
@@ -112,49 +129,49 @@ namespace basegfx
                 || maRangeY != rRange.maRangeY);
         }
 
-        B2DRange& operator=(const B2DRange& rRange)
-        {
-            maRangeX = rRange.maRangeX;
-            maRangeY = rRange.maRangeY;
-            return *this;
-        }
-
         bool equal(const B2DRange& rRange) const
         {
             return (maRangeX.equal(rRange.maRangeX)
                     && maRangeY.equal(rRange.maRangeY));
         }
 
+        /// get lower bound of the set. returns arbitrary values for empty sets.
         double getMinX() const
         {
             return maRangeX.getMinimum();
         }
 
+        /// get lower bound of the set. returns arbitrary values for empty sets.
         double getMinY() const
         {
             return maRangeY.getMinimum();
         }
 
+        /// get upper bound of the set. returns arbitrary values for empty sets.
         double getMaxX() const
         {
             return maRangeX.getMaximum();
         }
 
+        /// get upper bound of the set. returns arbitrary values for empty sets.
         double getMaxY() const
         {
             return maRangeY.getMaximum();
         }
 
+        /// return difference between upper and lower X value. returns 0 for empty sets.
         double getWidth() const
         {
             return maRangeX.getRange();
         }
 
+        /// return difference between upper and lower Y value. returns 0 for empty sets.
         double getHeight() const
         {
             return maRangeY.getRange();
         }
 
+        /// get lower bound of the set. returns arbitrary values for empty sets.
         B2DPoint getMinimum() const
         {
             return B2DPoint(
@@ -163,6 +180,7 @@ namespace basegfx
                 );
         }
 
+        /// get upper bound of the set. returns arbitrary values for empty sets.
         B2DPoint getMaximum() const
         {
             return B2DPoint(
@@ -171,6 +189,7 @@ namespace basegfx
                 );
         }
 
+        /// return difference between upper and lower point. returns (0,0) for empty sets.
         B2DVector getRange() const
         {
             return B2DVector(
@@ -179,6 +198,7 @@ namespace basegfx
                 );
         }
 
+        /// return center point of set. returns (0,0) for empty sets.
         B2DPoint getCenter() const
         {
             return B2DPoint(
@@ -187,16 +207,19 @@ namespace basegfx
                 );
         }
 
+        /// return center X value of set. returns 0 for empty sets.
         double getCenterX() const
         {
             return maRangeX.getCenter();
         }
 
+        /// return center Y value of set. returns 0 for empty sets.
         double getCenterY() const
         {
             return maRangeY.getCenter();
         }
 
+        /// yields true if given point is contained in set
         bool isInside(const B2DTuple& rTuple) const
         {
             return (
@@ -205,6 +228,7 @@ namespace basegfx
                 );
         }
 
+        /// yields true if rRange is inside, or equal to set
         bool isInside(const B2DRange& rRange) const
         {
             return (
@@ -213,6 +237,7 @@ namespace basegfx
                 );
         }
 
+        /// yields true if rRange at least partly inside set
         bool overlaps(const B2DRange& rRange) const
         {
             return (
@@ -221,6 +246,7 @@ namespace basegfx
                 );
         }
 
+        /// yields true if overlaps(rRange) does, and the overlap is larger than infinitesimal
         bool overlapsMore(const B2DRange& rRange) const
         {
             return (
@@ -229,24 +255,28 @@ namespace basegfx
                 );
         }
 
+        /// add point to the set, expanding as necessary
         void expand(const B2DTuple& rTuple)
         {
             maRangeX.expand(rTuple.getX());
             maRangeY.expand(rTuple.getY());
         }
 
+        /// add rRange to the set, expanding as necessary
         void expand(const B2DRange& rRange)
         {
             maRangeX.expand(rRange.maRangeX);
             maRangeY.expand(rRange.maRangeY);
         }
 
+        /// calc set intersection
         void intersect(const B2DRange& rRange)
         {
             maRangeX.intersect(rRange.maRangeX);
             maRangeY.intersect(rRange.maRangeY);
         }
 
+        /// grow set by fValue on all sides
         void grow(double fValue)
         {
             maRangeX.grow(fValue);
diff --git a/basegfx/inc/basegfx/range/b2ibox.hxx b/basegfx/inc/basegfx/range/b2ibox.hxx
index 0a12301..dd23b70 100644
--- a/basegfx/inc/basegfx/range/b2ibox.hxx
+++ b/basegfx/inc/basegfx/range/b2ibox.hxx
@@ -40,22 +40,48 @@
 
 namespace basegfx
 {
-    class BASEGFX_DLLPUBLIC B2IBox
+    /** A two-dimensional interval over integers
+
+        This is most easily depicted as a set of integers, bounded by
+        a lower and an upper value - but excluding the upper
+        value. All inbetween values are included in the set (see also
+        http://en.wikipedia.org/wiki/Interval_%28mathematics%29).
+
+        The set is half-open, i.e. the lower bound is included, the
+        upper bound not (if you're used to the notation - we're
+        talking about [a,b) here, compared to closed [a,b] or fully
+        open intervals (a,b)).
+
+        If you don't need a half-open interval, check B2IRange.
+
+        That means, isInside(val) will return true also for values of
+        val=a, but not for val=b.
+
+        Alternatively, consider this a rectangle, where the rightmost
+        pixel column and the bottommost pixel row are excluded - this
+        is much like polygon filling. As a result, filling a given
+        rectangle with basebmp::BitmapDevice::fillPolyPolygon(), will
+        affect exactly the same set of pixel as isInside() would
+        return true for.
+
+        @see B2IRange
+     */
+    class B2IBox
     {
     public:
         typedef sal_Int32       ValueType;
         typedef Int32Traits     TraitsType;
 
-        B2IBox()
-        {
-        }
+        B2IBox() {}
 
+        /// Create degenerate interval that's still empty
         explicit B2IBox(const B2ITuple& rTuple)
         :   maRangeX(rTuple.getX()),
             maRangeY(rTuple.getY())
         {
         }
 
+        /// Create proper interval between the two given points
         B2IBox(sal_Int32 x1,
                sal_Int32 y1,
                sal_Int32 x2,
@@ -67,6 +93,7 @@ namespace basegfx
             maRangeY.expand(y2);
         }
 
+        /// Create proper interval between the two given points
         B2IBox(const B2ITuple& rTuple1,
                const B2ITuple& rTuple2) :
             maRangeX(rTuple1.getX()),
@@ -75,17 +102,17 @@ namespace basegfx
             expand( rTuple2 );
         }
 
-        B2IBox(const B2IBox& rBox) :
-            maRangeX(rBox.maRangeX),
-            maRangeY(rBox.maRangeY)
-        {
-        }
+        /** Check if the interval set is empty
 
+            @return false, if no value is in this set - having a
+            single value included will still return false.
+         */
         bool isEmpty() const
         {
             return maRangeX.isEmpty() || maRangeY.isEmpty();
         }
 
+        /// reset the object to empty state again, clearing all values
         void reset()
         {
             maRangeX.reset();
@@ -104,42 +131,43 @@ namespace basegfx
                 || maRangeY != rBox.maRangeY);
         }
 
-        void operator=(const B2IBox& rBox)
-        {
-            maRangeX = rBox.maRangeX;

... etc. - the rest is truncated


More information about the Libreoffice-commits mailing list