[Libreoffice-commits] core.git: include/basegfx sax/inc shell/inc shell/source stoc/source

Michael Stahl mstahl at redhat.com
Fri Jul 3 08:00:53 PDT 2015


 include/basegfx/color/bcolor.hxx                          |   31 ++++++
 include/basegfx/matrix/b2dhommatrixtools.hxx              |    1 
 include/basegfx/pixel/bpixel.hxx                          |    5 +
 include/basegfx/range/b1drange.hxx                        |   22 ++++
 include/basegfx/range/b2ibox.hxx                          |   57 ++++++++++++
 include/basegfx/range/b2irange.hxx                        |   50 ++++++++++
 include/basegfx/range/b3drange.hxx                        |   65 ++++++++++++++
 include/basegfx/tuple/b2i64tuple.hxx                      |   14 +++
 include/basegfx/tuple/b3ituple.hxx                        |   18 +++
 include/basegfx/vector/b3dvector.hxx                      |   26 +++++
 sax/inc/xml2utf.hxx                                       |    4 
 shell/inc/internal/i_xml_parser_event_handler.hxx         |    7 +
 shell/source/unix/sysshell/recently_used_file_handler.cxx |    7 +
 stoc/source/corereflection/base.hxx                       |    6 +
 stoc/source/javavm/javavm.hxx                             |    3 
 15 files changed, 316 insertions(+)

New commits:
commit a6f5770b4aaaa6506a22eae0d641ad48f9b6d239
Author: Michael Stahl <mstahl at redhat.com>
Date:   Fri Jul 3 16:53:45 2015 +0200

    Revert "loplugin:unusedmethods sax,shell,stoc,basegfx"
    
    The basegfx changes appear to break Windows builds.
    
    This reverts commit 3b32c5898ff4e744d3f18b00421b433500426d74.

diff --git a/include/basegfx/color/bcolor.hxx b/include/basegfx/color/bcolor.hxx
index 4358e05..2bdd420 100644
--- a/include/basegfx/color/bcolor.hxx
+++ b/include/basegfx/color/bcolor.hxx
@@ -131,6 +131,15 @@ namespace basegfx
             return *this;
         }
 
+        // blend to another color using luminance
+        void blend(const BColor& rColor)
+        {
+            const double fLuminance(luminance());
+            mfX = rColor.getRed() * fLuminance;
+            mfY = rColor.getGreen() * fLuminance;
+            mfZ = rColor.getBlue() * fLuminance;
+        }
+
         // luminance
         double luminance() const
         {
@@ -155,6 +164,16 @@ namespace basegfx
             return sqrt(fDistR * fDistR + fDistG * fDistG + fDistB * fDistB);
         }
 
+        double getMinimumDistance(const BColor& rColor) const
+        {
+            const double fDistR(getDistanceRed(rColor));
+            const double fDistG(getDistanceGreen(rColor));
+            const double fDistB(getDistanceBlue(rColor));
+
+            double fRetval(fDistR < fDistG ? fDistR : fDistG);
+            return (fRetval < fDistB ? fRetval : fDistB);
+        }
+
         double getMaximumDistance(const BColor& rColor) const
         {
             const double fDistR(getDistanceRed(rColor));
@@ -187,6 +206,18 @@ namespace basegfx
             return static_cast<const BColor&>( ::basegfx::B3DTuple::getEmptyTuple() );
         }
 
+        com::sun::star::uno::Sequence< double > colorToDoubleSequence(const com::sun::star::uno::Reference< com::sun::star::rendering::XGraphicDevice >& /*xGraphicDevice*/) const
+        {
+            com::sun::star::uno::Sequence< double > aRet(4);
+            double* pRet = aRet.getArray();
+
+            pRet[0] = mfX;
+            pRet[1] = mfY;
+            pRet[2] = mfZ;
+            pRet[3] = 1.0;
+
+            return aRet;
+        }
     };
 } // end of namespace basegfx
 
diff --git a/include/basegfx/matrix/b2dhommatrixtools.hxx b/include/basegfx/matrix/b2dhommatrixtools.hxx
index 41a17ec..b2aef89 100644
--- a/include/basegfx/matrix/b2dhommatrixtools.hxx
+++ b/include/basegfx/matrix/b2dhommatrixtools.hxx
@@ -218,6 +218,7 @@ namespace basegfx
             const B2DVector& getScale() const { const_cast< B2DHomMatrixBufferedOnDemandDecompose* >(this)->impCheckDecompose(); return maScale; }
             const B2DVector& getTranslate() const { const_cast< B2DHomMatrixBufferedOnDemandDecompose* >(this)->impCheckDecompose(); return maTranslate; }
             double getRotate() const { const_cast< B2DHomMatrixBufferedOnDemandDecompose* >(this)->impCheckDecompose(); return mfRotate; }
+            double getShearX() const { const_cast< B2DHomMatrixBufferedOnDemandDecompose* >(this)->impCheckDecompose(); return mfShearX; }
         };
     } // end of namespace tools
 
diff --git a/include/basegfx/pixel/bpixel.hxx b/include/basegfx/pixel/bpixel.hxx
index fda6a79..cf5c7a3 100644
--- a/include/basegfx/pixel/bpixel.hxx
+++ b/include/basegfx/pixel/bpixel.hxx
@@ -95,16 +95,21 @@ namespace basegfx
         sal_uInt8 getGreen() const { return maPixelUnion.maRGBO.mnG; }
         sal_uInt8 getBlue() const { return maPixelUnion.maRGBO.mnB; }
         sal_uInt8 getOpacity() const { return maPixelUnion.maRGBO.mnO; }
+        sal_uInt32 getRedGreenBlueOpacity() const { return maPixelUnion.maCombinedRGBO.mnValue; }
 
         // data access write
         void setRed(sal_uInt8 nNew) { maPixelUnion.maRGBO.mnR = nNew; }
         void setGreen(sal_uInt8 nNew) { maPixelUnion.maRGBO.mnG = nNew; }
         void setBlue(sal_uInt8 nNew) { maPixelUnion.maRGBO.mnB = nNew; }
         void setOpacity(sal_uInt8 nNew) { maPixelUnion.maRGBO.mnO = nNew; }
+        void setRedGreenBlueOpacity(sal_uInt32 nRedGreenBlueOpacity) { maPixelUnion.maCombinedRGBO.mnValue = nRedGreenBlueOpacity; }
+        void setRedGreenBlue(sal_uInt8 nR, sal_uInt8 nG, sal_uInt8 nB) { maPixelUnion.maRGBO.mnR = nR; maPixelUnion.maRGBO.mnG = nG; maPixelUnion.maRGBO.mnB = nB; }
 
         // comparators
         bool isInvisible() const { return (0 == maPixelUnion.maRGBO.mnO); }
         bool isVisible() const { return (0 != maPixelUnion.maRGBO.mnO); }
+        bool isEmpty() const { return isInvisible(); }
+        bool isUsed() const { return isVisible(); }
 
         bool operator==( const BPixel& rPixel ) const
         {
diff --git a/include/basegfx/range/b1drange.hxx b/include/basegfx/range/b1drange.hxx
index c1e35b1..1d8fe92 100644
--- a/include/basegfx/range/b1drange.hxx
+++ b/include/basegfx/range/b1drange.hxx
@@ -71,6 +71,12 @@ namespace basegfx
             return maRange.isEmpty();
         }
 
+        /// reset the object to empty state again, clearing all values
+        void reset()
+        {
+            maRange.reset();
+        }
+
         bool operator==( const B1DRange& rRange ) const
         {
             return (maRange == rRange.maRange);
@@ -81,6 +87,11 @@ namespace basegfx
             return (maRange != rRange.maRange);
         }
 
+        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
         {
@@ -111,6 +122,12 @@ namespace basegfx
             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
         {
@@ -141,6 +158,11 @@ namespace basegfx
             maRange.intersect(rRange.maRange);
         }
 
+        /// grow set by fValue on both sides
+        void grow(double fValue)
+        {
+            maRange.grow(fValue);
+        }
     };
 
 } // end of namespace basegfx
diff --git a/include/basegfx/range/b2ibox.hxx b/include/basegfx/range/b2ibox.hxx
index b5c4d33..09ae867 100644
--- a/include/basegfx/range/b2ibox.hxx
+++ b/include/basegfx/range/b2ibox.hxx
@@ -104,6 +104,13 @@ namespace basegfx
             return maRangeX.isEmpty() || maRangeY.isEmpty();
         }
 
+        /// reset the object to empty state again, clearing all values
+        void reset()
+        {
+            maRangeX.reset();
+            maRangeY.reset();
+        }
+
         bool operator==( const B2IBox& rBox ) const
         {
             return (maRangeX == rBox.maRangeX
@@ -170,6 +177,24 @@ namespace basegfx
                 );
         }
 
+        /// return difference between upper and lower value. returns (0,0) for empty sets.
+        B2I64Tuple getRange() const
+        {
+            return B2I64Tuple(
+                maRangeX.getRange(),
+                maRangeY.getRange()
+                );
+        }
+
+        /// return center point of set. returns (0,0) for empty sets.
+        B2DPoint getCenter() const
+        {
+            return B2DPoint(
+                maRangeX.getCenter(),
+                maRangeY.getCenter()
+                );
+        }
+
         /// yields true if point is contained in set
         bool isInside(const B2ITuple& rTuple) const
         {
@@ -179,6 +204,24 @@ namespace basegfx
                 );
         }
 
+        /// yields true if rBox is inside, or equal to set
+        bool isInside(const B2IBox& rBox) const
+        {
+            return (
+                maRangeX.isInside(rBox.maRangeX)
+                && maRangeY.isInside(rBox.maRangeY)
+                );
+        }
+
+        /// yields true if rBox at least partly inside set
+        bool overlaps(const B2IBox& rBox) const
+        {
+            return (
+                maRangeX.overlaps(rBox.maRangeX)
+                && maRangeY.overlaps(rBox.maRangeY)
+                );
+        }
+
         /// add point to the set, expanding as necessary
         void expand(const B2ITuple& rTuple)
         {
@@ -186,6 +229,13 @@ namespace basegfx
             maRangeY.expand(rTuple.getY());
         }
 
+        /// add rBox to the set, expanding as necessary
+        void expand(const B2IBox& rBox)
+        {
+            maRangeX.expand(rBox.maRangeX);
+            maRangeY.expand(rBox.maRangeY);
+        }
+
         /// calc set intersection
         void intersect(const B2IBox& rBox)
         {
@@ -193,6 +243,13 @@ namespace basegfx
             maRangeY.intersect(rBox.maRangeY);
         }
 
+        /// grow set by nValue on all sides
+        void grow(sal_Int32 nValue)
+        {
+            maRangeX.grow(nValue);
+            maRangeY.grow(nValue);
+        }
+
     private:
         BasicBox        maRangeX;
         BasicBox        maRangeY;
diff --git a/include/basegfx/range/b2irange.hxx b/include/basegfx/range/b2irange.hxx
index 7a07229..65756df 100644
--- a/include/basegfx/range/b2irange.hxx
+++ b/include/basegfx/range/b2irange.hxx
@@ -178,6 +178,15 @@ namespace basegfx
                 );
         }
 
+        /// return center point of set. returns (0,0) for empty sets.
+        B2DPoint getCenter() const
+        {
+            return B2DPoint(
+                maRangeX.getCenter(),
+                maRangeY.getCenter()
+                );
+        }
+
         /// yields true if given point is contained in set
         bool isInside(const B2ITuple& rTuple) const
         {
@@ -187,6 +196,33 @@ namespace basegfx
                 );
         }
 
+        /// yields true if rRange is inside, or equal to set
+        bool isInside(const B2IRange& rRange) const
+        {
+            return (
+                maRangeX.isInside(rRange.maRangeX)
+                && maRangeY.isInside(rRange.maRangeY)
+                );
+        }
+
+        /// yields true if rRange at least partly inside set
+        bool overlaps(const B2IRange& rRange) const
+        {
+            return (
+                maRangeX.overlaps(rRange.maRangeX)
+                && maRangeY.overlaps(rRange.maRangeY)
+                );
+        }
+
+        /// yields true if overlaps(rRange) does, and the overlap is larger than infinitesimal
+        bool overlapsMore(const B2IRange& rRange) const
+        {
+            return (
+                maRangeX.overlapsMore(rRange.maRangeX)
+                && maRangeY.overlapsMore(rRange.maRangeY)
+                );
+        }
+
         /// add point to the set, expanding as necessary
         void expand(const B2ITuple& rTuple)
         {
@@ -194,6 +230,13 @@ namespace basegfx
             maRangeY.expand(rTuple.getY());
         }
 
+        /// add rRange to the set, expanding as necessary
+        void expand(const B2IRange& rRange)
+        {
+            maRangeX.expand(rRange.maRangeX);
+            maRangeY.expand(rRange.maRangeY);
+        }
+
         /// calc set intersection
         void intersect(const B2IRange& rRange)
         {
@@ -201,6 +244,13 @@ namespace basegfx
             maRangeY.intersect(rRange.maRangeY);
         }
 
+        /// grow set by nValue on all sides
+        void grow(sal_Int32 nValue)
+        {
+            maRangeX.grow(nValue);
+            maRangeY.grow(nValue);
+        }
+
     private:
         typedef ::basegfx::BasicRange< ValueType, TraitsType >  MyBasicRange;
 
diff --git a/include/basegfx/range/b3drange.hxx b/include/basegfx/range/b3drange.hxx
index 351dea8..3ce6925 100644
--- a/include/basegfx/range/b3drange.hxx
+++ b/include/basegfx/range/b3drange.hxx
@@ -102,6 +102,13 @@ namespace basegfx
                 || maRangeZ != rRange.maRangeZ);
         }
 
+        bool equal(const B3DRange& rRange) const
+        {
+            return (maRangeX.equal(rRange.maRangeX)
+                    && maRangeY.equal(rRange.maRangeY)
+                    && maRangeZ.equal(rRange.maRangeZ));
+        }
+
         double getMinX() const
         {
             return maRangeX.getMinimum();
@@ -147,6 +154,24 @@ namespace basegfx
             return maRangeZ.getRange();
         }
 
+        B3DPoint getMinimum() const
+        {
+            return B3DPoint(
+                maRangeX.getMinimum(),
+                maRangeY.getMinimum(),
+                maRangeZ.getMinimum()
+                );
+        }
+
+        B3DPoint getMaximum() const
+        {
+            return B3DPoint(
+                maRangeX.getMaximum(),
+                maRangeY.getMaximum(),
+                maRangeZ.getMaximum()
+                );
+        }
+
         B3DVector getRange() const
         {
             return B3DVector(
@@ -165,6 +190,39 @@ namespace basegfx
                 );
         }
 
+        double getCenterX() const
+        {
+            return maRangeX.getCenter();
+        }
+
+        double getCenterY() const
+        {
+            return maRangeY.getCenter();
+        }
+
+        double getCenterZ() const
+        {
+            return maRangeZ.getCenter();
+        }
+
+        bool isInside(const B3DTuple& rTuple) const
+        {
+            return (
+                maRangeX.isInside(rTuple.getX())
+                && maRangeY.isInside(rTuple.getY())
+                && maRangeZ.isInside(rTuple.getZ())
+                );
+        }
+
+        bool isInside(const B3DRange& rRange) const
+        {
+            return (
+                maRangeX.isInside(rRange.maRangeX)
+                && maRangeY.isInside(rRange.maRangeY)
+                && maRangeZ.isInside(rRange.maRangeZ)
+                );
+        }
+
         bool overlaps(const B3DRange& rRange) const
         {
             return (
@@ -188,6 +246,13 @@ namespace basegfx
             maRangeZ.expand(rRange.maRangeZ);
         }
 
+        void intersect(const B3DRange& rRange)
+        {
+            maRangeX.intersect(rRange.maRangeX);
+            maRangeY.intersect(rRange.maRangeY);
+            maRangeZ.intersect(rRange.maRangeZ);
+        }
+
         void grow(double fValue)
         {
             maRangeX.grow(fValue);
diff --git a/include/basegfx/tuple/b2i64tuple.hxx b/include/basegfx/tuple/b2i64tuple.hxx
index e4b40ac..2d0bfcf 100644
--- a/include/basegfx/tuple/b2i64tuple.hxx
+++ b/include/basegfx/tuple/b2i64tuple.hxx
@@ -91,6 +91,18 @@ namespace basegfx
             return mnY;
         }
 
+        /// Set X-Coordinate of 2D Tuple
+        void setX(sal_Int64 fX)
+        {
+            mnX = fX;
+        }
+
+        /// Set Y-Coordinate of 2D Tuple
+        void setY(sal_Int64 fY)
+        {
+            mnY = fY;
+        }
+
         /// Array-access to 2D Tuple
         const sal_Int64& operator[] (int nPos) const
         {
@@ -159,6 +171,8 @@ namespace basegfx
             return B2I64Tuple(-mnX, -mnY);
         }
 
+        bool equalZero() const { return mnX == 0 && mnY == 0; }
+
         bool operator==( const B2I64Tuple& rTup ) const
         {
             return this == &rTup || (rTup.mnX == mnX && rTup.mnY == mnY);
diff --git a/include/basegfx/tuple/b3ituple.hxx b/include/basegfx/tuple/b3ituple.hxx
index 7802101..3bd9199 100644
--- a/include/basegfx/tuple/b3ituple.hxx
+++ b/include/basegfx/tuple/b3ituple.hxx
@@ -104,6 +104,24 @@ namespace basegfx
             return mnZ;
         }
 
+        /// set X-Coordinate of 3D Tuple
+        void setX(sal_Int32 nX)
+        {
+            mnX = nX;
+        }
+
+        /// set Y-Coordinate of 3D Tuple
+        void setY(sal_Int32 nY)
+        {
+            mnY = nY;
+        }
+
+        /// set Z-Coordinate of 3D Tuple
+        void setZ(sal_Int32 nZ)
+        {
+            mnZ = nZ;
+        }
+
         /// Array-access to 3D Tuple
         const sal_Int32& operator[] (int nPos) const
         {
diff --git a/include/basegfx/vector/b3dvector.hxx b/include/basegfx/vector/b3dvector.hxx
index 1e8572e..8a8997b 100644
--- a/include/basegfx/vector/b3dvector.hxx
+++ b/include/basegfx/vector/b3dvector.hxx
@@ -126,6 +126,18 @@ namespace basegfx
             return sqrt(fLen);
         }
 
+        /** Calculate the length in the XY-Plane for this 3D Vector
+
+            @return The XY-Plane Length of the 3D Vector
+        */
+        double getXYLength() const
+        {
+            double fLen((mfX * mfX) + (mfY * mfY));
+            if((0.0 == fLen) || (1.0 == fLen))
+                return fLen;
+            return sqrt(fLen);
+        }
+
         /** Calculate the length in the XZ-Plane for this 3D Vector
 
             @return The XZ-Plane Length of the 3D Vector
@@ -182,6 +194,20 @@ namespace basegfx
         */
         B3DVector& normalize();
 
+        /** Test if this 3D Vector is normalized
+
+            @return
+            true if lenth of vector is equal to 1.0
+            false else
+        */
+        bool isNormalized() const
+        {
+            const double fOne(1.0);
+            const double fScalar(scalar(*this));
+
+            return (::basegfx::fTools::equal(fOne, fScalar));
+        }
+
         /** get a 3D Vector which is perpendicular to this and a given 3D Vector
 
             @attention This only works if this and the given 3D Vector are
diff --git a/sax/inc/xml2utf.hxx b/sax/inc/xml2utf.hxx
index bbbfd41..b9ffee3 100644
--- a/sax/inc/xml2utf.hxx
+++ b/sax/inc/xml2utf.hxx
@@ -56,6 +56,10 @@ public:
     Unicode2TextConverter( rtl_TextEncoding encoding );
     ~Unicode2TextConverter();
 
+    inline ::com::sun::star::uno::Sequence<sal_Int8> convert( const OUString &s )
+        {
+            return convert( s.getStr() , s.getLength() );
+        }
     ::com::sun::star::uno::Sequence<sal_Int8> convert( const sal_Unicode * , sal_Int32 nLength );
     bool canContinue() {  return m_bCanContinue; }
 
diff --git a/shell/inc/internal/i_xml_parser_event_handler.hxx b/shell/inc/internal/i_xml_parser_event_handler.hxx
index 48dd746..77db6321 100644
--- a/shell/inc/internal/i_xml_parser_event_handler.hxx
+++ b/shell/inc/internal/i_xml_parser_event_handler.hxx
@@ -40,6 +40,10 @@ class i_xml_parser_event_handler
 public:
     virtual ~i_xml_parser_event_handler() {};
 
+    virtual void start_document() = 0;
+
+    virtual void end_document() = 0;
+
     virtual void start_element(
         const string_t& raw_name,
         const string_t& local_name,
@@ -55,6 +59,9 @@ public:
     virtual void ignore_whitespace(
         const string_t& whitespaces) = 0;
 
+    virtual void processing_instruction(
+        const string_t& target, const string_t& data) = 0;
+
     virtual void comment(const string_t& comment) = 0;
 };
 
diff --git a/shell/source/unix/sysshell/recently_used_file_handler.cxx b/shell/source/unix/sysshell/recently_used_file_handler.cxx
index 0beba20..e66d96d 100644
--- a/shell/source/unix/sysshell/recently_used_file_handler.cxx
+++ b/shell/source/unix/sysshell/recently_used_file_handler.cxx
@@ -266,9 +266,16 @@ namespace /* private */ {
                 current_element_ += character;
         }
 
+        virtual void start_document() SAL_OVERRIDE {}
+        virtual void end_document() SAL_OVERRIDE   {}
+
         virtual void ignore_whitespace(const string_t& /*whitespaces*/) SAL_OVERRIDE
         {}
 
+        virtual void processing_instruction(
+            const string_t& /*target*/, const string_t& /*data*/) SAL_OVERRIDE
+        {}
+
         virtual void comment(const string_t& /*comment*/) SAL_OVERRIDE
         {}
     private:
diff --git a/stoc/source/corereflection/base.hxx b/stoc/source/corereflection/base.hxx
index 426c2d2..ea1b852 100644
--- a/stoc/source/corereflection/base.hxx
+++ b/stoc/source/corereflection/base.hxx
@@ -159,6 +159,10 @@ public:
         { return _pTypeDescr; }
     IdlReflectionServiceImpl *  getReflection() const
         { return _pReflection; }
+    css::uno::Reference< css::lang::XMultiServiceFactory > getSMgr() const
+        { return _pReflection->getSMgr(); }
+    css::uno::Reference< css::container::XHierarchicalNameAccess > getTDMgr() const
+        { return getReflection()->getTDMgr(); }
 
     // Ctor
     IdlClassImpl( IdlReflectionServiceImpl * pReflection,
@@ -342,6 +346,8 @@ protected:
 public:
     IdlReflectionServiceImpl *  getReflection() const
         { return _pReflection; }
+    css::uno::Reference< css::lang::XMultiServiceFactory > getSMgr() const
+        { return _pReflection->getSMgr(); }
     typelib_TypeDescription *   getTypeDescr() const
         { return _pTypeDescr; }
     typelib_TypeDescription *   getDeclTypeDescr() const
diff --git a/stoc/source/javavm/javavm.hxx b/stoc/source/javavm/javavm.hxx
index cf3e358..a8046b6 100644
--- a/stoc/source/javavm/javavm.hxx
+++ b/stoc/source/javavm/javavm.hxx
@@ -128,6 +128,9 @@ private:
 
     virtual void SAL_CALL disposing() SAL_OVERRIDE;
 
+    JavaVM * createJavaVM(JVM const & jvm, JNIEnv ** pMainThreadEnv);
+        // throws css::uno::RuntimeException
+
     void registerConfigChangesListener();
 
     void setINetSettingsInVM(bool set_reset);


More information about the Libreoffice-commits mailing list