1. mst
  2. ooo340

Commits

obo  committed 09f8583

CWS-TOOLING: integrate CWS impress174
2009-08-27 18:21:38 +0200 af r275502 : #i73289# Fixed detection of the cases when the layout menu is be disabled.
2009-08-24 17:45:50 +0200 sj r275326 : #i103360# only setting filltype if there is also a correct fill element
2009-08-24 16:11:06 +0200 cl r275322 : #i73871# only remove replaced objects from mark list if replaced by SdrEditView::ReplaceObjectAtView(). see issue for reason
2009-08-24 15:03:33 +0200 cl r275319 : fixed merge error
2009-08-20 12:45:29 +0200 sj r275174 : CWS-TOOLING: rebase CWS impress174 to trunk@275001 (milestone: DEV300:m55)
2009-08-19 15:54:47 +0200 sj r275153 : #158486# text of flipped shapes is not flipped in word
2009-08-17 17:30:16 +0200 sj r275063 : #158486# also correcting text bound for additional text rotation
2009-08-05 11:09:32 +0200 sj r274643 : #i102797# adapted customshape coloring (fixed fontwork)
2009-08-04 14:17:36 +0200 sj r274620 : #i99501# pdf export: fixed export of rotated graphics
2009-07-30 16:15:44 +0200 sj r274494 : #158653# binary ppt import: fixed table border lines
2009-07-27 18:28:02 +0200 sj r274376 : added shape text clipping for customshapes
2009-07-20 18:09:14 +0200 sj r274154 : #i101918# fixed gallery preview (now taking the correct mapmode)
2009-07-13 18:00:58 +0200 cl r273948 : #i103238# clear hard set attributes only if new style set is manually applied
2009-07-13 17:58:07 +0200 cl r273947 : #i73289# do not expand a toolpanel when it gets enabled
2009-07-08 12:39:49 +0200 sj r273827 : #i101566# applied patch from cmc to solve font width inconsistencies
2009-07-08 12:11:13 +0200 sj r273826 : #i87727# added PDFDialog service
2009-07-06 17:22:40 +0200 sj r273755 : #i103360# fixed a merge problem, no more looping when loading transparence gradients on background page
2009-07-03 14:42:07 +0200 sj r273701 : #102797# added patch from thb (Adapted customshape coloring)
2009-07-03 14:09:44 +0200 sj r273696 : #102797# removed warning
2009-07-03 14:01:47 +0200 sj r273695 : #102797# added patch from thb (Adapted customshape coloring)
2009-07-03 13:13:39 +0200 sj r273688 : #102797# added patch from thb (Adapted customshape coloring)
2009-07-03 11:25:30 +0200 sj r273684 : #i103278# fixed import of lines
2009-07-01 16:23:47 +0200 cl r273599 : #i96820# correctly call setChanged on model if table is modified
2009-07-01 14:43:09 +0200 cl r273588 : #i8770# Patch: fix missing type provider for pdf export dialog
2009-07-01 14:40:28 +0200 cl r273586 : #i73871# activate picture bar after converting shape to bitmap
2009-07-01 14:39:05 +0200 cl r273584 : #i73871# activate picture bar after converting shape to bitmap
2009-07-01 14:04:53 +0200 cl r273578 : #i73289# PATCH: Disable layout pane on the masterslide

  • Participants
  • Parent commits 08b6839
  • Branches default

Comments (0)

Files changed (41)

File basegfx/inc/basegfx/color/bcolortools.hxx

View file
  • Ignore whitespace
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ * 
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: bcolor.hxx,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org.  If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef _BGFX_COLOR_BCOLORTOOLS_HXX
+#define _BGFX_COLOR_BCOLORTOOLS_HXX
+
+#include <sal/types.h>
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace basegfx
+{
+    class BColor;
+
+    namespace tools
+    {
+        /// Transform from RGB to HSL
+        BColor rgb2hsl(const BColor& rRGBColor);
+        /// Transform from HSL to RGB
+        BColor hsl2rgb(const BColor& rHSLColor);
+
+        /// Transform from RGB to HSV
+        BColor rgb2hsv(const BColor& rRGBColor);
+        /// Transform from HSV to RGB
+        BColor hsv2rgb(const BColor& rHSVColor);
+
+        /// Transform from R'G'B' to YIQ (NTSC color model - Y is used in monochrome mode)
+        BColor rgb2yiq(const BColor& rRGBColor);
+        /// Transform from YIQ to R'G'B' (NTSC color model - Y is used in monochrome mode)
+        BColor yiq2rgb(const BColor& rYIQColor);
+
+        /// Transform from R'G'B' to Y'PbPr (the [0,1]x[-.5,.5]x[-.5,.5] equivalent of Y'CbCr (which is scaled into 8bit))
+        BColor rgb2ypbpr(const BColor& rRGBColor);
+        /// Transform from Y'PbPr (the [0,1]x[-.5,.5]x[-.5,.5] equivalent of Y'CbCr (which is scaled into 8bit)) into R'G'B'
+        BColor ypbpr2rgb(const BColor& rYPbPrColor);
+
+        /// Transform from CIE XYZ into Rec. 709 RGB (D65 white point)
+        BColor ciexyz2rgb( const BColor& rXYZColor );
+        /// Transform from Rec. 709 RGB (D65 white point) into CIE XYZ
+        BColor rgb2ciexyz( const BColor& rRGBColor );
+
+	}
+} // end of namespace basegfx
+
+#endif /* _BGFX_COLOR_BCOLORTOOLS_HXX */
+
+//////////////////////////////////////////////////////////////////////////////
+// eof

File basegfx/prj/d.lst

View file
  • Ignore whitespace
 
 mkdir: %_DEST%\inc%_EXT%\basegfx\color
 ..\inc\basegfx\color\bcolor.hxx %_DEST%\inc%_EXT%\basegfx\color\bcolor.hxx
+..\inc\basegfx\color\bcolortools.hxx %_DEST%\inc%_EXT%\basegfx\color\bcolortools.hxx
 ..\inc\basegfx\color\bcolormodifier.hxx %_DEST%\inc%_EXT%\basegfx\color\bcolormodifier.hxx
 
 mkdir: %_DEST%\inc%_EXT%\basegfx\pixel

File basegfx/source/color/bcolortools.cxx

View file
  • Ignore whitespace
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ * 
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: bcolor.cxx,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org.  If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+// MARKER(update_precomp.py): autogen include statement, do not remove
+#include "precompiled_basegfx.hxx"
+
+#include <basegfx/numeric/ftools.hxx>
+#include <basegfx/color/bcolor.hxx>
+#include <basegfx/color/bcolortools.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace basegfx { namespace tools
+{
+    BColor rgb2hsl(const BColor& rRGBColor)
+    {
+        const double r=rRGBColor.getRed(), g=rRGBColor.getGreen(), b=rRGBColor.getBlue();
+        const double minVal = ::std::min( ::std::min( r, g ), b );
+        const double maxVal = ::std::max( ::std::max( r, g ), b );
+        const double d = maxVal - minVal;
+
+        double h=0, s=0, l=0;
+
+        l = (maxVal + minVal) / 2.0;
+    
+        if( ::basegfx::fTools::equalZero(d) )
+        {
+            s = h = 0; // hue undefined (achromatic case)
+        }
+        else
+        {
+            s = l > 0.5 ? d/(2.0-maxVal-minVal) :
+                d/(maxVal + minVal);
+
+            if( r == maxVal )
+                h = (g - b)/d;
+            else if( g == maxVal )
+                h = 2.0 + (b - r)/d;
+            else
+                h = 4.0 + (r - h)/d;
+
+            h *= 60.0;
+
+            if( h < 0.0 )
+                h += 360.0;
+        }
+
+        return BColor(h,s,l);
+    }
+
+    static inline double hsl2rgbHelper( double nValue1, double nValue2, double nHue )
+    {
+        // clamp hue to [0,360]
+        nHue = fmod( nHue, 360.0 );
+
+        // cope with wrap-arounds
+        if( nHue < 0.0 )
+            nHue += 360.0;
+
+        if( nHue < 60.0 )
+            return nValue1 + (nValue2 - nValue1)*nHue/60.0;
+        else if( nHue < 180.0 )
+            return nValue2;
+        else if( nHue < 240.0 )
+            return nValue1 + (nValue2 - nValue1)*(240.0 - nHue)/60.0;
+        else 
+            return nValue1;
+    }
+
+    BColor hsl2rgb(const BColor& rHSLColor)
+    {
+        const double h=rHSLColor.getRed(), s=rHSLColor.getGreen(), l=rHSLColor.getBlue();
+
+        if( fTools::equalZero(s) )
+            return BColor(l, l, l ); // achromatic case
+
+        const double nVal1( l <= 0.5 ? l*(1.0 + s) : l + s - l*s );
+        const double nVal2( 2.0*l - nVal1 );
+
+        return BColor(
+            hsl2rgbHelper(nVal2,
+                          nVal1, 
+                          h + 120.0),
+            hsl2rgbHelper(nVal2, 
+                          nVal1,
+                          h),
+            hsl2rgbHelper(nVal2,
+                          nVal1,
+                          h - 120.0) );
+    }
+    
+    BColor rgb2hsv(const BColor& rRGBColor)
+    {
+        const double r=rRGBColor.getRed(), g=rRGBColor.getGreen(), b=rRGBColor.getBlue();
+        const double maxVal = std::max(std::max(r,g),b);
+        const double minVal = std::min(std::min(r,g),b);
+        const double delta = maxVal-minVal;
+
+        double h=0, s=0, v=0;
+
+        v = maxVal;
+        if( fTools::equalZero(v) )
+            s = 0;
+        else
+            s = delta / v;
+
+        if( !fTools::equalZero(s) )
+        {
+            if( maxVal == r )
+            {
+                h = (g - b) / delta;
+            }
+            else if( maxVal == g )
+            {
+                h = 2.0 + (b - r) / delta;
+            }
+            else
+            {
+                h = 4.0 + (r - g) / delta;
+            }
+
+            h *= 60.0;
+
+            if( h < 0 )
+                h += 360;
+        }
+
+        return BColor(h,s,v);
+    }
+
+    BColor hsv2rgb(const BColor& rHSVColor)
+    {
+        double h=rHSVColor.getRed();
+        const double s=rHSVColor.getGreen(), v=rHSVColor.getBlue();
+
+        if( fTools::equalZero(s) )
+        {
+            // achromatic case: no hue.
+            return BColor(v,v,v);
+        }
+        else
+        {
+            if( fTools::equal(h,360) )
+                h = 0; // 360 degrees is equivalent to 0 degrees
+
+            h /= 60.0;
+			const sal_Int32 intval = static_cast< sal_Int32 >( h );
+            const double f = h - intval;
+            const double p = v*(1.0-s);
+            const double q = v*(1.0-(s*f));
+            const double t = v*(1.0-(s*(1.0-f)));
+
+            /* which hue area? */
+            switch( intval )
+            {
+                case 0:
+                    return BColor(v,t,p);
+
+                case 1:
+                    return BColor(q,v,p);
+
+                case 2:
+                    return BColor(p,v,t);
+
+                case 3:
+                    return BColor(p,q,v);
+
+                case 4:
+                    return BColor(t,p,v);
+
+                case 5:
+                    return BColor(v,p,q);
+
+                default:
+                    // hue overflow
+                    return BColor();
+            }
+        }
+    }
+
+    BColor rgb2yiq(const BColor& rRGBColor)
+    {
+        // from Foley, van Dam, Computer Graphics
+        const double r=rRGBColor.getRed(), g=rRGBColor.getGreen(), b=rRGBColor.getBlue();
+        return BColor(
+            0.299*r + 0.587*g + 0.114*b,
+            0.596*r - 0.274*g - 0.322*b,
+            0.211*r - 0.522*g + 0.311*b);
+    }
+
+    BColor yiq2rgb(const BColor& rYIQColor)
+    {
+        // from Foley, van Dam, Computer Graphics
+        const double y=rYIQColor.getRed(), i=rYIQColor.getGreen(), q=rYIQColor.getBlue();
+        return BColor(
+            y + 0.956*i + 0.623*q,
+            y - 0.272*i - 0.648*q,
+            y - 1.105*i + 1.705*q );
+    }
+
+    BColor ciexyz2rgb( const BColor& rXYZColor )
+    {
+        // from Poynton color faq, and SMPTE RP 177-1993, Derivation
+        // of Basic Television Color Equations
+        const double x=rXYZColor.getRed(), y=rXYZColor.getGreen(), z=rXYZColor.getBlue();
+        return BColor(
+            3.240479*x - 1.53715*y  - 0.498535*z,
+            -0.969256*x + 1.875991*y + 0.041556*z,
+            0.055648*x - 0.204043*y + 1.057311*z );
+    }
+
+    BColor rgb2ciexyz( const BColor& rRGBColor )
+    {
+        // from Poynton color faq, and SMPTE RP 177-1993, Derivation
+        // of Basic Television Color Equations
+        const double r=rRGBColor.getRed(), g=rRGBColor.getGreen(), b=rRGBColor.getBlue();
+        return BColor(
+            0.412453*r + 0.35758*g  + 0.180423*b,
+            0.212671*r + 0.71516*g  + 0.072169*b,
+            0.019334*r + 0.119193*g + 0.950227*b);
+    }
+
+    BColor rgb2ypbpr(const BColor& rRGBColor)
+    {
+        const double r=rRGBColor.getRed(), g=rRGBColor.getGreen(), b=rRGBColor.getBlue();
+        return BColor(
+             0.299*r    + 0.587*g    + 0.114*b,
+            -0.168736*r - 0.331264*g + 0.5*b,
+             0.5*r      - 0.418688*g - 0.081312*b);
+    }
+
+    BColor ypbpr2rgb(const BColor& rYPbPrColor)
+    {
+        const double y=rYPbPrColor.getRed(), pb=rYPbPrColor.getGreen(), pr=rYPbPrColor.getBlue();
+        return BColor(
+            1.*y +       0.*pb +    1.402*pr,
+            1.*y - 0.344136*pb - 0.714136*pr,
+            1.*y +    1.772*pb +       0.*pr);
+    }
+
+} } // end of namespace basegfx
+
+//////////////////////////////////////////////////////////////////////////////
+// eof

File basegfx/source/color/makefile.mk

View file
  • Ignore whitespace
 
 SLOFILES= \
 				$(SLO)$/bcolor.obj			\
+				$(SLO)$/bcolortools.obj		\
 				$(SLO)$/bcolormodifier.obj
 
 # --- Targets ----------------------------------

File basegfx/test/basegfx2d.cxx

View file
  • Ignore whitespace
 #include <basegfx/polygon/b2dpolypolygontools.hxx>
 #include <basegfx/range/b2dmultirange.hxx>
 #include <basegfx/numeric/ftools.hxx>
+#include <basegfx/color/bcolor.hxx>
+#include <basegfx/color/bcolortools.hxx>
 
 #include <basegfx/tools/debugplotter.hxx>
 
     CPPUNIT_TEST_SUITE_END();
 }; // class b2dvector
 
+class bcolor : public CppUnit::TestFixture
+{
+    BColor maWhite;
+    BColor maBlack;
+    BColor maRed;
+    BColor maGreen;
+    BColor maBlue;
+    BColor maYellow;
+    BColor maMagenta;
+    BColor maCyan;
+
+public:
+    bcolor() :
+        maWhite(1,1,1),
+        maBlack(0,0,0),
+        maRed(1,0,0),
+        maGreen(0,1,0),
+        maBlue(0,0,1),
+        maYellow(1,1,0),
+        maMagenta(1,0,1),
+        maCyan(0,1,1)
+    {}
+
+
+    // initialise your test code values here.
+    void setUp()
+    {
+    }
+
+    void tearDown()
+    {
+    }
+
+    // insert your test code here.
+    void hslTest()
+    {
+        CPPUNIT_ASSERT_MESSAGE("white", 
+                               tools::rgb2hsl(maWhite) == BColor(0,0,1));
+        CPPUNIT_ASSERT_MESSAGE("black", 
+                               tools::rgb2hsl(maBlack) == BColor(0,0,0));
+        CPPUNIT_ASSERT_MESSAGE("red", 
+                               tools::rgb2hsl(maRed) == BColor(0,1,0.5));
+        CPPUNIT_ASSERT_MESSAGE("green", 
+                               tools::rgb2hsl(maGreen) == BColor(120,1,0.5));
+        CPPUNIT_ASSERT_MESSAGE("blue", 
+                               tools::rgb2hsl(maBlue) == BColor(240,1,0.5));
+        CPPUNIT_ASSERT_MESSAGE("yellow", 
+                               tools::rgb2hsl(maYellow) == BColor(60,1,0.5));
+        CPPUNIT_ASSERT_MESSAGE("magenta", 
+                               tools::rgb2hsl(maMagenta) == BColor(300,1,0.5));
+        CPPUNIT_ASSERT_MESSAGE("cyan", 
+                               tools::rgb2hsl(maCyan) == BColor(180,1,0.5));
+
+        CPPUNIT_ASSERT_MESSAGE("roundtrip white", 
+                               tools::hsl2rgb(tools::rgb2hsl(maWhite)) == maWhite);
+        CPPUNIT_ASSERT_MESSAGE("roundtrip black", 
+                               tools::hsl2rgb(tools::rgb2hsl(maBlack)) == maBlack);
+        CPPUNIT_ASSERT_MESSAGE("roundtrip red", 
+                               tools::hsl2rgb(tools::rgb2hsl(maRed)) == maRed);
+        CPPUNIT_ASSERT_MESSAGE("roundtrip green", 
+                               tools::hsl2rgb(tools::rgb2hsl(maGreen)) == maGreen);
+        CPPUNIT_ASSERT_MESSAGE("roundtrip blue", 
+                               tools::hsl2rgb(tools::rgb2hsl(maBlue)) == maBlue);
+        CPPUNIT_ASSERT_MESSAGE("roundtrip yellow", 
+                               tools::hsl2rgb(tools::rgb2hsl(maYellow)) == maYellow);
+        CPPUNIT_ASSERT_MESSAGE("roundtrip magenta", 
+                               tools::hsl2rgb(tools::rgb2hsl(maMagenta)) == maMagenta);
+        CPPUNIT_ASSERT_MESSAGE("roundtrip cyan", 
+                               tools::hsl2rgb(tools::rgb2hsl(maCyan)) == maCyan);
+
+        CPPUNIT_ASSERT_MESSAGE("grey10", 
+                               tools::rgb2hsl(maWhite*.1) == BColor(0,0,.1));
+        CPPUNIT_ASSERT_MESSAGE("grey90", 
+                               tools::rgb2hsl(maWhite*.9) == BColor(0,0,.9));
+        CPPUNIT_ASSERT_MESSAGE("red/2", 
+                               tools::rgb2hsl(maRed*.5) == BColor(0,1,0.25));
+        CPPUNIT_ASSERT_MESSAGE("green/2", 
+                               tools::rgb2hsl(maGreen*.5) == BColor(120,1,0.25));
+        CPPUNIT_ASSERT_MESSAGE("blue/2", 
+                               tools::rgb2hsl(maBlue*.5) == BColor(240,1,0.25));
+        CPPUNIT_ASSERT_MESSAGE("yellow/2", 
+                               tools::rgb2hsl(maYellow*.5) == BColor(60,1,0.25));
+        CPPUNIT_ASSERT_MESSAGE("magenta/2", 
+                               tools::rgb2hsl(maMagenta*.5) == BColor(300,1,0.25));
+        CPPUNIT_ASSERT_MESSAGE("cyan/2", 
+                               tools::rgb2hsl(maCyan*.5) == BColor(180,1,0.25));
+
+        CPPUNIT_ASSERT_MESSAGE("pastel", 
+                               tools::rgb2hsl(BColor(.75,.25,.25)) == BColor(0,.5,.5));
+    }
+
+    // insert your test code here.
+    void hsvTest()
+    {
+        CPPUNIT_ASSERT_MESSAGE("white", 
+                               tools::rgb2hsv(maWhite) == BColor(0,0,1));
+        CPPUNIT_ASSERT_MESSAGE("black", 
+                               tools::rgb2hsv(maBlack) == BColor(0,0,0));
+        CPPUNIT_ASSERT_MESSAGE("red", 
+                               tools::rgb2hsv(maRed) == BColor(0,1,1));
+        CPPUNIT_ASSERT_MESSAGE("green", 
+                               tools::rgb2hsv(maGreen) == BColor(120,1,1));
+        CPPUNIT_ASSERT_MESSAGE("blue", 
+                               tools::rgb2hsv(maBlue) == BColor(240,1,1));
+        CPPUNIT_ASSERT_MESSAGE("yellow", 
+                               tools::rgb2hsv(maYellow) == BColor(60,1,1));
+        CPPUNIT_ASSERT_MESSAGE("magenta", 
+                               tools::rgb2hsv(maMagenta) == BColor(300,1,1));
+        CPPUNIT_ASSERT_MESSAGE("cyan", 
+                               tools::rgb2hsv(maCyan) == BColor(180,1,1));
+
+        CPPUNIT_ASSERT_MESSAGE("roundtrip white", 
+                               tools::hsv2rgb(tools::rgb2hsv(maWhite)) == maWhite);
+        CPPUNIT_ASSERT_MESSAGE("roundtrip black", 
+                               tools::hsv2rgb(tools::rgb2hsv(maBlack)) == maBlack);
+        CPPUNIT_ASSERT_MESSAGE("roundtrip red", 
+                               tools::hsv2rgb(tools::rgb2hsv(maRed)) == maRed);
+        CPPUNIT_ASSERT_MESSAGE("roundtrip green", 
+                               tools::hsv2rgb(tools::rgb2hsv(maGreen)) == maGreen);
+        CPPUNIT_ASSERT_MESSAGE("roundtrip blue", 
+                               tools::hsv2rgb(tools::rgb2hsv(maBlue)) == maBlue);
+        CPPUNIT_ASSERT_MESSAGE("roundtrip yellow", 
+                               tools::hsv2rgb(tools::rgb2hsv(maYellow)) == maYellow);
+        CPPUNIT_ASSERT_MESSAGE("roundtrip magenta", 
+                               tools::hsv2rgb(tools::rgb2hsv(maMagenta)) == maMagenta);
+        CPPUNIT_ASSERT_MESSAGE("roundtrip cyan", 
+                               tools::hsv2rgb(tools::rgb2hsv(maCyan)) == maCyan);
+
+        CPPUNIT_ASSERT_MESSAGE("grey10", 
+                               tools::rgb2hsv(maWhite*.1) == BColor(0,0,.1));
+        CPPUNIT_ASSERT_MESSAGE("grey90", 
+                               tools::rgb2hsv(maWhite*.9) == BColor(0,0,.9));
+        CPPUNIT_ASSERT_MESSAGE("red/2", 
+                               tools::rgb2hsv(maRed*.5) == BColor(0,1,0.5));
+        CPPUNIT_ASSERT_MESSAGE("green/2", 
+                               tools::rgb2hsv(maGreen*.5) == BColor(120,1,0.5));
+        CPPUNIT_ASSERT_MESSAGE("blue/2", 
+                               tools::rgb2hsv(maBlue*.5) == BColor(240,1,0.5));
+        CPPUNIT_ASSERT_MESSAGE("yellow/2", 
+                               tools::rgb2hsv(maYellow*.5) == BColor(60,1,0.5));
+        CPPUNIT_ASSERT_MESSAGE("magenta/2", 
+                               tools::rgb2hsv(maMagenta*.5) == BColor(300,1,0.5));
+        CPPUNIT_ASSERT_MESSAGE("cyan/2", 
+                               tools::rgb2hsv(maCyan*.5) == BColor(180,1,0.5));
+
+        CPPUNIT_ASSERT_MESSAGE("pastel", 
+                               tools::rgb2hsv(BColor(.5,.25,.25)) == BColor(0,.5,.5));
+    }
+
+    void ciexyzTest()
+    {
+        tools::rgb2ciexyz(maWhite);
+        tools::rgb2ciexyz(maBlack);
+        tools::rgb2ciexyz(maRed);
+        tools::rgb2ciexyz(maGreen);
+        tools::rgb2ciexyz(maBlue);
+        tools::rgb2ciexyz(maYellow);
+        tools::rgb2ciexyz(maMagenta);
+        tools::rgb2ciexyz(maCyan);
+    }
+
+    // Change the following lines only, if you add, remove or rename 
+    // member functions of the current class, 
+    // because these macros are need by auto register mechanism.
+
+    CPPUNIT_TEST_SUITE(bcolor);
+    CPPUNIT_TEST(hslTest);
+    CPPUNIT_TEST(hsvTest);
+    CPPUNIT_TEST(ciexyzTest);
+    CPPUNIT_TEST_SUITE_END();
+}; // class b2dvector
+
 // -----------------------------------------------------------------------------
 //CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(basegfx2d::b2dmultirange, "basegfx2d");
 CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(basegfx2d::b2dsvgdimpex, "basegfx2d");
 CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(basegfx2d::b2drange, "basegfx2d");
 CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(basegfx2d::b2dtuple, "basegfx2d");
 CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(basegfx2d::b2dvector, "basegfx2d");
+CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(basegfx2d::bcolor, "basegfx2d");
 } // namespace basegfx2d
 
 

File basegfx/test/makefile.mk

View file
  • Ignore whitespace
 	$(SLB)$/range.lib	\
 	$(SLB)$/tuple.lib	\
 	$(SLB)$/tools.lib	\
+	$(SLB)$/color.lib	\
 	$(SLB)$/vector.lib
 
 SHL1TARGET= basegfx_tests

File drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx

View file
  • Ignore whitespace
 						{
 							const GraphicAttr& rAttr = rGraphicPrimitive.getGraphicAttr();
 
-							if(!rAttr.IsSpecialDrawMode() && !rAttr.IsMirrored() && !rAttr.IsRotated() && !rAttr.IsAdjusted())
+							if(!rAttr.IsSpecialDrawMode() && !rAttr.IsAdjusted())
 							{
 								const basegfx::B2DHomMatrix& rTransform = rGraphicPrimitive.getTransform();
 								double fRotate, fShearX;
 								rTransform.decompose(aScale, aTranslate, fRotate, fShearX);
 
-								if(aScale.getX() > 0.0 && aScale.getY() > 0.0)
+								if( basegfx::fTools::equalZero( fRotate ) && ( aScale.getX() > 0.0 ) && ( aScale.getY() > 0.0 ) )
 								{
 									bUsingPDFExtOutDevData = true;
 									mpPDFExtOutDevData->BeginGroup();

File filter/source/pdf/pdfdialog.cxx

View file
  • Ignore whitespace
 // - PDFDialog -
 // -------------
 
-PDFDialog::PDFDialog( const Reference< XMultiServiceFactory > &rxMSF ) :
-    OGenericUnoDialog( rxMSF )
+PDFDialog::PDFDialog( const Reference< XMultiServiceFactory > &rxMSF )
+: PDFDialog_Base( rxMSF )
 {
 	ByteString aResMgrName( "pdffilter" );
 
 
 // -----------------------------------------------------------------------------
 
-Any SAL_CALL PDFDialog::queryInterface( const Type& rType ) 
-    throw (RuntimeException)
-{
-    Any aReturn = OGenericUnoDialog::queryInterface( rType );
-
-	if( !aReturn.hasValue() )
-		aReturn = ::cppu::queryInterface( rType, 
-                                          static_cast< XPropertyAccess* >( this ),
-                                          static_cast< XExporter* >( this ) );
-
-	return aReturn;
-}
-
-// -----------------------------------------------------------------------------
-
-void SAL_CALL PDFDialog::acquire() 
-    throw ()
-{
-    OWeakObject::acquire();
-}
-
-// -----------------------------------------------------------------------------
-
-void SAL_CALL PDFDialog::release() 
-    throw ()
-{
-    OWeakObject::release();
-}
-
-// -----------------------------------------------------------------------------
-
 Sequence< sal_Int8 > SAL_CALL PDFDialog::getImplementationId() 
     throw(RuntimeException)
 {

File filter/source/pdf/pdfdialog.hxx

View file
  • Ignore whitespace
 #include "pdffilter.hxx"
 #include <svtools/genericunodialog.hxx>
 
+#include <cppuhelper/implbase2.hxx>
+
 // -------------
 // - PDFDialog -
 // -------------
 class Window;
 class ResMgr;
 
-class PDFDialog : public ::svt::OGenericUnoDialog,
-    			  public ::comphelper::OPropertyArrayUsageHelper< PDFDialog >,
-                  public XPropertyAccess,
-                  public XExporter
+typedef ::svt::OGenericUnoDialog             PDFDialog_DialogBase;
+typedef ::cppu::ImplInheritanceHelper2  <
+                                             PDFDialog_DialogBase,
+                                             XPropertyAccess,
+                                             XExporter
+                                        >    PDFDialog_Base;
+
+class PDFDialog : public PDFDialog_Base,
+                  public ::comphelper::OPropertyArrayUsageHelper< PDFDialog >
 {
 private:
 
     Reference< XComponent >     mxSrcDoc;
 
 protected:
-
-    // XInterface
-	virtual Any SAL_CALL queryInterface( const Type& aType ) throw (RuntimeException);
-	virtual void SAL_CALL acquire() throw ();
-	virtual void SAL_CALL release() throw ();
-
 	// OGenericUnoDialog
     virtual Sequence< sal_Int8 > SAL_CALL getImplementationId() throw(RuntimeException);
     virtual OUString SAL_CALL getImplementationName() throw (RuntimeException);

File offapi/com/sun/star/document/PDFDialog.idl

View file
  • Ignore whitespace
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ * 
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile:$
+ * $Revision:$
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org.  If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#ifndef __com_sun_star_document_PDFDialog_idl__ 
+#define __com_sun_star_document_PDFDialog_idl__ 
+ 
+#ifndef __com_sun_star_ui_dialogs_FilterOptionsDialog_idl__
+#include <com/sun/star/ui/dialogs/FilterOptionsDialog.idl> 
+#endif 
+ 
+//============================================================================= 
+ 
+module com {  module sun {  module star {  module document {  
+ 
+//============================================================================= 
+ 
+/** This service is for a PDFDialog
+ */
+service PDFDialog
+{ 
+	service com::sun::star::ui::dialogs::FilterOptionsDialog; 
+
+	//-------------------------------------------------------------------------
+	/** PDFDialog options can be set as sequence of
+		com.sun.star.beans.PropertyValue at the FilterData property of the
+		MediaDescriptor. The PropertyValues which are supported within the
+		sequence are described in the registry at Office.Common/Filter/PDF/Export
+
+		The source of this registry can be found in following file:
+		"officecfg/registry/schema/org/openoffice/Office/Common.xcs"
+	*/
+
+	//-------------------------------------------------------------------------
+}; 
+ 
+//============================================================================= 
+ 
+}; }; }; };  
+ 
+#endif 
+

File offapi/com/sun/star/document/makefile.mk

View file
  • Ignore whitespace
 	OfficeDocument.idl\
 	OleEmbeddedServerRegistration.idl\
 	OwnLockOnDocumentRequest.idl\
+	PDFDialog.idl\
 	PrinterIndependentLayout.idl\
 	RedlineDisplayType.idl \
 	Settings.idl\
 	XLinkTargetSupplier.idl\
 	XMimeTypeInfo.idl\
 	XOOXMLDocumentPropertiesImporter.idl\
-        XRedlinesSupplier.idl \
+	XRedlinesSupplier.idl \
 	XScriptInvocationContext.idl\
 	XStandaloneDocumentInfo.idl\
 	XStorageBasedDocument.idl\

File oox/source/drawingml/fillpropertiesgroupcontext.cxx

View file
  • Ignore whitespace
         ContextHandler& rParent, sal_Int32 nElement,
         const Reference< XFastAttributeList >& rxAttribs, FillProperties& rFillProps )
 {
-    rFillProps.moFillType = getToken( nElement );
     switch( nElement )
     {
-        case A_TOKEN( noFill ):     return 0;
-        case A_TOKEN( solidFill ):  return new SolidFillContext( rParent, rxAttribs, rFillProps );
-        case A_TOKEN( gradFill ):   return new GradientFillContext( rParent, rxAttribs, rFillProps.maGradientProps );
-        case A_TOKEN( pattFill ):   return new PatternFillContext( rParent, rxAttribs, rFillProps.maPatternProps );
-        case A_TOKEN( blipFill ):   return new BlipFillContext( rParent, rxAttribs, rFillProps.maBlipProps );
-        case A_TOKEN( grpFill ):    return 0;   // TODO
+		case A_TOKEN( noFill ):			{ rFillProps.moFillType = getToken( nElement ); return 0; };
+		case A_TOKEN( solidFill ):		{ rFillProps.moFillType = getToken( nElement ); return new SolidFillContext( rParent, rxAttribs, rFillProps ); };
+		case A_TOKEN( gradFill ):		{ rFillProps.moFillType = getToken( nElement ); return new GradientFillContext( rParent, rxAttribs, rFillProps.maGradientProps ); };
+		case A_TOKEN( pattFill ):		{ rFillProps.moFillType = getToken( nElement ); return new PatternFillContext( rParent, rxAttribs, rFillProps.maPatternProps ); };
+		case A_TOKEN( blipFill ):		{ rFillProps.moFillType = getToken( nElement ); return new BlipFillContext( rParent, rxAttribs, rFillProps.maBlipProps ); };
+		case A_TOKEN( grpFill ):		{ rFillProps.moFillType = getToken( nElement ); return 0; };	// TODO 
     }
     return 0;
 }

File sd/source/ui/inc/EventMultiplexer.hxx

View file
  • Ignore whitespace
     */
     static const EventId EID_PANE_MANAGER_DYING     = 0x00000100;
 
-    /** The edit mode of the ViewShell in the center pane has been modified.
+    /** Edit mode was (or is being) switched to normal mode.  Find
+        EID_EDIT_MODE_MASTER below.
     */
-    static const EventId EID_EDIT_MODE              = 0x00000200;
+    static const EventId EID_EDIT_MODE_NORMAL       = 0x00000200;
 
     /** One or more pages have been inserted into or deleted from the model.
     */
     */
     static const EventId EID_CONFIGURATION_UPDATED  = 0x00040000;
 
+    /** Edit mode was (or is being) switched to master mode.
+    */
+    static const EventId EID_EDIT_MODE_MASTER       = 0x00080000;
+
     const ViewShellBase& mrBase;
     EventId meEventId;
     const void* mpUserData;

File sd/source/ui/inc/taskpane/TitleBar.hxx

View file
  • Ignore whitespace
     virtual void Paint (const Rectangle& rBoundingBox);
     virtual bool Expand (bool bFlag = true);
     virtual bool IsExpanded (void) const;
+    virtual void SetEnabledState(bool bFlag);
 
     void SetFocus (bool bFlag);
 

File sd/source/ui/inc/taskpane/TitledControl.hxx

View file
  • Ignore whitespace
     */
     virtual bool IsExpandable (void) const;
 
+    virtual void SetEnabledState(bool bFlag);
+
     /** Ownership of the given data remains with the caller.  The data
         is thus not destroyed when the destructor of this class is
         called.

File sd/source/ui/toolpanel/LayoutMenu.cxx

View file
  • Ignore whitespace
 #include <vcl/image.hxx>
 #include <svtools/languageoptions.hxx>
 #include <sfx2/app.hxx>
+#include "taskpane/TitledControl.hxx"
 #include <sfx2/dispatch.hxx>
 #include <sfx2/request.hxx>
 #include <comphelper/processfactory.hxx>
         | ::sd::tools::EventMultiplexerEvent::EID_SLIDE_SORTER_SELECTION
         | ::sd::tools::EventMultiplexerEvent::EID_MAIN_VIEW_ADDED
         | ::sd::tools::EventMultiplexerEvent::EID_MAIN_VIEW_REMOVED
-        | ::sd::tools::EventMultiplexerEvent::EID_CONFIGURATION_UPDATED);
+        | ::sd::tools::EventMultiplexerEvent::EID_CONFIGURATION_UPDATED
+        | ::sd::tools::EventMultiplexerEvent::EID_EDIT_MODE_NORMAL
+        | ::sd::tools::EventMultiplexerEvent::EID_EDIT_MODE_MASTER);
 
     SetSmartHelpId(SmartId(HID_SD_TASK_PANE_PREVIEW_LAYOUTS));
     SetAccessibleName(SdResId(STR_TASKPANEL_LAYOUT_MENU_TITLE));
 
 
 
+void LayoutMenu::UpdateEnabledState (const MasterMode eMode)
+{
+    bool bIsEnabled (false);
+
+    ::boost::shared_ptr<ViewShell> pMainViewShell (mrBase.GetMainViewShell());
+    if (pMainViewShell)
+    {
+        switch (pMainViewShell->GetShellType())
+        {
+            case ViewShell::ST_NONE:
+            case ViewShell::ST_OUTLINE:
+            case ViewShell::ST_PRESENTATION:
+            case ViewShell::ST_TASK_PANE:
+                // The complete task pane is disabled for these values or
+                // not even visible.  Disabling the LayoutMenu would be
+                // logical but unnecessary.  The main disadvantage is that
+                // after re-enabling it (typically) another panel is
+                // expanded.
+                bIsEnabled = true;
+                break;
+                
+            case ViewShell::ST_DRAW:
+            case ViewShell::ST_IMPRESS:
+            {
+                switch (eMode)
+                {
+                    case MM_UNKNOWN:
+                    {
+                        ::boost::shared_ptr<DrawViewShell> pDrawViewShell (
+                            ::boost::dynamic_pointer_cast<DrawViewShell>(pMainViewShell));
+                        if (pDrawViewShell)
+                            bIsEnabled = pDrawViewShell->GetEditMode() != EM_MASTERPAGE;
+                        break;
+                    }
+                    case MM_NORMAL:
+                        bIsEnabled = true;
+                        break;
+
+                    case MM_MASTER:
+                        bIsEnabled = false;
+                        break;
+                }
+                break;
+            }
+
+            case ViewShell::ST_HANDOUT:
+            case ViewShell::ST_NOTES:
+            case ViewShell::ST_SLIDE_SORTER:
+            default:
+                bIsEnabled = true;
+                break;
+        }
+
+        TreeNode* pParentNode = GetParentNode();
+        if (pParentNode != NULL)
+        {
+            TitledControl* pGrandParentNode
+                = dynamic_cast<TitledControl*>(pParentNode->GetParentNode());
+            if (pGrandParentNode != NULL)
+                pGrandParentNode->SetEnabledState(bIsEnabled);
+        }
+
+    }
+}
+
+
+
+
 ::Window* LayoutMenu::GetWindow (void)
 {
     return this;
         // Find the entry of the menu for to the layout.
         USHORT nItemCount (GetItemCount());
         for (USHORT nId=1; nId<=nItemCount; nId++)
+        {
             if (*static_cast<AutoLayout*>(GetItemData(nId)) == aLayout)
             {
                 SelectItem(nId);
                 bItemSelected = true;
                 break;
             }
+        }
     }
     while (false);
 
 
         case ::sd::tools::EventMultiplexerEvent::EID_MAIN_VIEW_ADDED:
             mbIsMainViewChangePending = true;
+            UpdateEnabledState(MM_UNKNOWN);
             break;
 
         case ::sd::tools::EventMultiplexerEvent::EID_MAIN_VIEW_REMOVED:
             }
             break;
 
+        case ::sd::tools::EventMultiplexerEvent::EID_EDIT_MODE_NORMAL:
+            UpdateEnabledState(MM_NORMAL);
+            break;
+
+        case ::sd::tools::EventMultiplexerEvent::EID_EDIT_MODE_MASTER:
+            UpdateEnabledState(MM_MASTER);
+            break;
+
         default:
             /* Ignored */
             break;

File sd/source/ui/toolpanel/LayoutMenu.hxx

View file
  • Ignore whitespace
     void Execute (SfxRequest& rRequest);
     void GetState (SfxItemSet& rItemSet);
 
+    /** The LayoutMenu does not support some main views.  In this case the
+        LayoutMenu is disabled.  This state is updated in this method.
+        @param eMode
+            On some occasions the edit mode is being switched when this
+            method is called can not (yet) be reliably detected.  Luckily,
+            in these cases the new value is provided by some broadcaster.
+            On other occasions the edit mode is not modified and is also not
+            provided.  Therefore the Unknown value.
+    */
+    enum MasterMode { MM_NORMAL, MM_MASTER, MM_UNKNOWN };
+    void UpdateEnabledState (const MasterMode eMode);
+
     /** Call this method when the set of displayed layouts is not up-to-date
         anymore.  It will re-assemple this set according to the current
         settings.

File sd/source/ui/toolpanel/TitleBar.cxx

View file
  • Ignore whitespace
 }
 
 
+void TitleBar::SetEnabledState(bool bFlag)
+{
+    if(bFlag)
+	    Enable();
+    else
+	    Disable();
+    Invalidate ();
+}
 
 
 void TitleBar::SetFocus (bool bFlag)
 
 USHORT TitleBar::GetTextStyle (void)
 {
-    return TEXT_DRAW_LEFT 
-        | TEXT_DRAW_TOP
-        | TEXT_DRAW_MULTILINE 
-        | TEXT_DRAW_WORDBREAK;
+ 	if(IsEnabled())
+ 	{
+ 		return TEXT_DRAW_LEFT 
+ 			| TEXT_DRAW_TOP
+ 			| TEXT_DRAW_MULTILINE 
+ 			| TEXT_DRAW_WORDBREAK;
+ 	}
+ 	else
+ 	{
+ 		return TEXT_DRAW_DISABLE;
+ 	}
 }
 
 
 
-
 void TitleBar::PaintBackground (const Rectangle& rTitleBarBox)
 {
     // Fill a slightly rounded rectangle.

File sd/source/ui/toolpanel/TitledControl.cxx

View file
  • Ignore whitespace
 {
     bool bExpansionStateChanged (false);
 
-    if (IsExpandable())
+    if (IsExpandable() && IsEnabled())
     {
         if (GetTitleBar()->IsExpanded() != bExpanded)
             bExpansionStateChanged |= GetTitleBar()->Expand (bExpanded);
         return false;
 }
 
+void TitledControl::SetEnabledState(bool bFlag) 
+{
+    if (!bFlag)
+    {
+	    GetParentNode()->GetControlContainer().SetExpansionState (
+		    this,
+		    ControlContainer::ES_COLLAPSE);
+	    Disable();
+    }
+    else 
+    {
+/*    
+	    GetParentNode()->GetControlContainer().SetExpansionState (
+		    this,
+		    ControlContainer::ES_EXPAND);
+*/		   
+	    Enable();
+    }
+
+    GetTitleBar()->SetEnabledState(bFlag);
+}
 
 
 
         switch (pWindowEvent->GetId())
         {
             case VCLEVENT_WINDOW_MOUSEBUTTONUP:
-                (*mpClickHandler)(*this);
+                if (IsEnabled())
+                    (*mpClickHandler)(*this);
                 break;
         }
     }

File sd/source/ui/toolpanel/controls/CurrentMasterPagesSelector.cxx

View file
  • Ignore whitespace
     Link aLink (LINK(this,CurrentMasterPagesSelector,EventMultiplexerListener));
     rBase.GetEventMultiplexer()->AddEventListener(aLink,
         sd::tools::EventMultiplexerEvent::EID_CURRENT_PAGE
-        | sd::tools::EventMultiplexerEvent::EID_EDIT_MODE
+        | sd::tools::EventMultiplexerEvent::EID_EDIT_MODE_NORMAL
+        | sd::tools::EventMultiplexerEvent::EID_EDIT_MODE_MASTER
         | sd::tools::EventMultiplexerEvent::EID_PAGE_ORDER
         | sd::tools::EventMultiplexerEvent::EID_SHAPE_CHANGED
         | sd::tools::EventMultiplexerEvent::EID_SHAPE_INSERTED
         switch (pEvent->meEventId)
         {
             case sd::tools::EventMultiplexerEvent::EID_CURRENT_PAGE:
-            case sd::tools::EventMultiplexerEvent::EID_EDIT_MODE:
+            case sd::tools::EventMultiplexerEvent::EID_EDIT_MODE_NORMAL:
+            case sd::tools::EventMultiplexerEvent::EID_EDIT_MODE_MASTER:
             case sd::tools::EventMultiplexerEvent::EID_SLIDE_SORTER_SELECTION:
                 UpdateSelection();
                 break;

File sd/source/ui/tools/EventMultiplexer.cxx

View file
  • Ignore whitespace
     }
     else if (rEvent.PropertyName.equals(msEditModePropertyName))
     {
-        CallListeners(EventMultiplexerEvent::EID_EDIT_MODE);
+        bool bIsMasterPageMode (false);
+        rEvent.NewValue >>= bIsMasterPageMode;
+        if (bIsMasterPageMode)
+            CallListeners(EventMultiplexerEvent::EID_EDIT_MODE_MASTER);
+        else
+            CallListeners(EventMultiplexerEvent::EID_EDIT_MODE_NORMAL);
     }
 }
 
 
 void EventMultiplexer::Implementation::CallListeners (EventMultiplexerEvent& rEvent)
 {
-    ListenerList::const_iterator iListener (maListeners.begin());
-    ListenerList::const_iterator iListenerEnd (maListeners.end());
+    ListenerList aCopyListeners( maListeners );
+    ListenerList::iterator iListener (aCopyListeners.begin());
+    ListenerList::const_iterator iListenerEnd (aCopyListeners.end());
     for (; iListener!=iListenerEnd; ++iListener)
     {
         if ((iListener->second && rEvent.meEventId) != 0)

File sd/source/ui/unoidl/unopback.cxx

View file
  • Ignore whitespace
 							setPropertyValue( aPropertyName, *pAny );
 					}
 			    }
-					else
-						setPropertyValue( aIt->sName, *pAny );
+				++aIt;
 			}
-				++aIt;
 		}
 	}
 

File sd/source/ui/view/GraphicObjectBar.cxx

View file
  • Ignore whitespace
 					aStr.Append( String( SdResId( STR_UNDO_GRAFFILTER ) ) );
 					mpView->BegUndo( aStr );
 					pFilteredObj->SetGraphicObject( aFilterObj );
-					mpView->ReplaceObjectAtView( pObj, *pPageView, pFilteredObj );
-					mpView->EndUndo();
+					::sd::View* const pView = mpView;
+					pView->ReplaceObjectAtView( pObj, *pPageView, pFilteredObj );
+					pView->EndUndo();
+					return;
 				}
 			}
 		}

File svtools/source/filter.vcl/wmf/wmfwr.cxx

View file
  • Ignore whitespace
 	BYTE nPitchFamily;
 
 	WriteRecordHeader(0x00000000,W_META_CREATEFONTINDIRECT);
-
-    if ( !rFont.GetSize().Width() )
-    {
-        VirtualDevice aDev;
-        FontMetric aMetric( aDev.GetFontMetric( rFont ) );
-        WriteHeightWidth(Size(aMetric.GetWidth(),-rFont.GetSize().Height()));
-    }
-    else
-        WriteHeightWidth(Size(rFont.GetSize().Width(),-rFont.GetSize().Height()));
-
+	WriteHeightWidth(Size(rFont.GetSize().Width(),-rFont.GetSize().Height()));
 	*pWMF << (short)rFont.GetOrientation() << (short)rFont.GetOrientation();
 
 	switch (rFont.GetWeight()) {

File svx/inc/svx/sdr/primitive2d/sdrcustomshapeprimitive2d.hxx

View file
  • Ignore whitespace
             // defines if SdrTextWordWrapItem was set at SdrObjCustomShape which means
             // that the text needs to be block formatted
             unsigned                                    mbWordWrap : 1;
+			// #SJ# Allow text clipping against TextBox in special cases (used for SC)
+			unsigned                                    mbForceTextClipToTextRange : 1;
 
 		protected:
 			// local decomposition.
 				const attribute::SdrShadowTextAttribute& rSdrSTAttribute,
 				const Primitive2DSequence& rSubPrimitives,
 				const basegfx::B2DHomMatrix& rTextBox,
-                bool bWordWrap);
+                bool bWordWrap,
+				bool bForceTextClipToTextRange);
 
 			// data access
 			const attribute::SdrShadowTextAttribute& getSdrSTAttribute() const { return maSdrSTAttribute; }
 			const Primitive2DSequence& getSubPrimitives() const { return maSubPrimitives; }
 			const basegfx::B2DHomMatrix& getTextBox() const { return maTextBox; }
             bool getWordWrap() const { return mbWordWrap; }
+			bool isForceTextClipToTextRange() const { return mbForceTextClipToTextRange; }
 
 			// compare operator
 			virtual bool operator==(const BasePrimitive2D& rPrimitive) const;

File svx/source/customshapes/EnhancedCustomShape2d.cxx

View file
  • Ignore whitespace
 #include <svx/xlnedwit.hxx>
 #include <svx/xlnstcit.hxx>
 #include <svx/xlnedcit.hxx>
+#include <svx/xflgrit.hxx>
+#include <svx/xflhtit.hxx>
+#include <svx/xbtmpit.hxx>
+#include <svx/xgrad.hxx>
+#include <svx/xbitmap.hxx>
+#include <svx/xhatch.hxx>
 #include <com/sun/star/awt/Size.hpp>
 #include <com/sun/star/drawing/EnhancedCustomShapeParameterType.hpp>
 #ifndef __COM_SUN_STAR_DRAWING_ENHANCEDCUSTOMSHAPESEGMENTCOMMAND_HPP__
 #include <boost/shared_ptr.hpp>
 #endif
 #include <basegfx/numeric/ftools.hxx>
+#include <basegfx/color/bcolortools.hxx>
 #include <basegfx/polygon/b2dpolygon.hxx>
 
 // #i76201#
 	/*const sal_Int32* pDefData =*/ ApplyShapeAttributes( rGeometryItem );
 	switch( eSpType )
 	{
-		case mso_sptCan :						nColorData = 0x20200000; break;
-		case mso_sptCube :						nColorData = 0x302d0000; break;
-		case mso_sptActionButtonBlank :			nColorData = 0x502ad400; break;
-		case mso_sptActionButtonHome :			nColorData = 0x702ad4ad; break;
-		case mso_sptActionButtonHelp :			nColorData = 0x602ad4a0; break;
-		case mso_sptActionButtonInformation :	nColorData = 0x702ad4a5; break;
-		case mso_sptActionButtonBackPrevious :	nColorData = 0x602ad4a0; break;
-		case mso_sptActionButtonForwardNext :	nColorData = 0x602ad4a0; break;
-		case mso_sptActionButtonBeginning :		nColorData = 0x602ad4a0; break;
-		case mso_sptActionButtonEnd :			nColorData = 0x602ad4a0; break;
-		case mso_sptActionButtonReturn :		nColorData = 0x602ad4a0; break;
-		case mso_sptActionButtonDocument :		nColorData = 0x702ad4da; break;
-		case mso_sptActionButtonSound :			nColorData = 0x602ad4a0; break;
-		case mso_sptActionButtonMovie :			nColorData = 0x602ad4a0; break;
-		case mso_sptBevel :						nColorData = 0x502ad400; break;
-		case mso_sptFoldedCorner :				nColorData = 0x20d00000; break;
-		case mso_sptSmileyFace :				nColorData = 0x20d00000; break;
+		case mso_sptCan :						nColorData = 0x20400000; break;
+		case mso_sptCube :						nColorData = 0x302e0000; break;
+		case mso_sptActionButtonBlank :			nColorData = 0x502ce400; break;
+		case mso_sptActionButtonHome :			nColorData = 0x702ce4ce; break;
+		case mso_sptActionButtonHelp :			nColorData = 0x602ce4c0; break;
+		case mso_sptActionButtonInformation :	nColorData = 0x702ce4c5; break;
+		case mso_sptActionButtonBackPrevious :	nColorData = 0x602ce4c0; break;
+		case mso_sptActionButtonForwardNext :	nColorData = 0x602ce4c0; break;
+		case mso_sptActionButtonBeginning :		nColorData = 0x602ce4c0; break;
+		case mso_sptActionButtonEnd :			nColorData = 0x602ce4c0; break;
+		case mso_sptActionButtonReturn :		nColorData = 0x602ce4c0; break;
+		case mso_sptActionButtonDocument :		nColorData = 0x702ce4ec; break;
+		case mso_sptActionButtonSound :			nColorData = 0x602ce4c0; break;
+		case mso_sptActionButtonMovie :			nColorData = 0x602ce4c0; break;
+		case mso_sptBevel :						nColorData = 0x502ce400; break;
+		case mso_sptFoldedCorner :				nColorData = 0x20e00000; break;
+		case mso_sptSmileyFace :				nColorData = 0x20e00000; break;
         case mso_sptNil :
         {
             if( sShapeType.getLength() > 4 &&
 		case mso_sptCurvedRightArrow :
 		case mso_sptCurvedUpArrow :
 		case mso_sptCurvedDownArrow :			nColorData = 0x2d000000; break;
-		case mso_sptRibbon2 :					nColorData = 0x30dd0000; break;
-		case mso_sptRibbon :					nColorData = 0x30dd0000; break;
+		case mso_sptRibbon2 :					nColorData = 0x30ee0000; break;
+		case mso_sptRibbon :					nColorData = 0x30ee0000; break;
 
-		case mso_sptEllipseRibbon2 :			nColorData = 0x30dd0000; break;
-		case mso_sptEllipseRibbon :				nColorData = 0x30dd0000; break;
+		case mso_sptEllipseRibbon2 :			nColorData = 0x30ee0000; break;
+		case mso_sptEllipseRibbon :				nColorData = 0x30ee0000; break;
 
-		case mso_sptVerticalScroll :			nColorData = 0x30dd0000; break;
-		case mso_sptHorizontalScroll :			nColorData = 0x30dd0000; break;
+		case mso_sptVerticalScroll :			nColorData = 0x30ee0000; break;
+		case mso_sptHorizontalScroll :			nColorData = 0x30ee0000; break;
 		default:
 			break;
 	}
 // nLumDat 27-24 = nLumDatEntry 0
 // nLumDat 23-20 = nLumDatEntry 1 ...
 // each 4bit entry is to be interpreted as a 10 percent signed luminance changing
-Color EnhancedCustomShape2d::GetColorData( const Color& rFillColor, sal_uInt32 nIndex )
+sal_Int32 EnhancedCustomShape2d::GetLuminanceChange( sal_uInt32 nIndex ) const
 {
-	Color aRetColor;
+	const sal_uInt32 nCount = nColorData >> 28;
+	if ( !nCount )
+        return 0;
 
-	sal_uInt32 i, nColor, nTmp, nCount = nColorData >> 28;
+    if ( nIndex >= nCount )
+        nIndex = nCount - 1;
 
-	if ( nCount )
-	{
-		if ( nIndex >= nCount )
-			nIndex = nCount - 1;
+    const sal_Int32 nLumDat = nColorData << ( ( 1 + nIndex ) << 2 );
+    return ( nLumDat >> 28 ) * 10;
+}
 
-		sal_uInt32 nFillColor = (sal_uInt32)rFillColor.GetRed() |
-									((sal_uInt32)rFillColor.GetGreen() << 8 ) |
-										((sal_uInt32)rFillColor.GetBlue() << 16 );
+Color EnhancedCustomShape2d::GetColorData( const Color& rFillColor, sal_uInt32 nIndex ) const
+{
+    const sal_Int32 nLuminance = GetLuminanceChange(nIndex);
+    if( !nLuminance )
+        return rFillColor;
 
-		sal_Int32 nLumDat = nColorData << ( ( 1 + nIndex ) << 2 );
-		sal_Int32 nLuminance = ( nLumDat >> 28 ) * 12;
+    basegfx::BColor aHSVColor=
+        basegfx::tools::rgb2hsv(
+            basegfx::BColor(rFillColor.GetRed()/255.0,
+                            rFillColor.GetGreen()/255.0,
+                            rFillColor.GetBlue()/255.0));
+    if( nLuminance > 0 )
+    {
+        aHSVColor.setGreen(
+            aHSVColor.getGreen() * (1.0-nLuminance/100.0));
+        aHSVColor.setBlue(
+            nLuminance/100.0 + 
+            (1.0-nLuminance/100.0)*aHSVColor.getBlue());
+    }
+    else if( nLuminance < 0 )
+    {
+        aHSVColor.setBlue(
+            (1.0+nLuminance/100.0)*aHSVColor.getBlue());
+    }
 
-		nTmp = nFillColor;
-		nColor = 0;
-		for ( i = 0; i < 3; i++ )
-		{
-			sal_Int32 nC = (sal_uInt8)nTmp;
-			nTmp >>= 8;
-			nC += ( ( nLuminance * nC ) >> 8 );
-			if ( nC < 0 )
-				nC = 0;
-			else if ( nC &~ 0xff )
-				nC = 0xff;
-			nColor >>= 8;
-			nColor |= nC << 16;
-		}
-		aRetColor = Color( (sal_uInt8)nColor, (sal_uInt8)( nColor >> 8 ), (sal_uInt8)( nColor >> 16 ) );
-	}
-	return aRetColor;
+    aHSVColor = basegfx::tools::hsv2rgb(aHSVColor);
+    return Color( (sal_uInt8)static_cast< sal_Int32 >( basegfx::clamp(aHSVColor.getRed(),0.0,1.0) * 255.0 + 0.5 ), 
+                  (sal_uInt8)static_cast< sal_Int32 >( basegfx::clamp(aHSVColor.getGreen(),0.0,1.0) * 255.0 + 0.5 ),
+                  (sal_uInt8)static_cast< sal_Int32 >( basegfx::clamp(aHSVColor.getBlue(),0.0,1.0) * 255.0 + 0.5 ) );
 }
 
 Rectangle EnhancedCustomShape2d::GetTextRect() const
 
 	if(aNewB2DPolyPolygon.count())
 	{
+		if( !bLineGeometryNeededOnly )
+		{
+			// hack aNewB2DPolyPolygon to fill logic rect - this is
+			// needed to produce gradient fills that look like mso
+			aNewB2DPolygon.clear();
+			aNewB2DPolygon.append(basegfx::B2DPoint(0,0));
+			aNewB2DPolyPolygon.append(aNewB2DPolygon);
+
+			aNewB2DPolygon.clear();
+			aNewB2DPolygon.append(basegfx::B2DPoint(aLogicRect.GetWidth(),
+                                                    aLogicRect.GetHeight()));
+			aNewB2DPolyPolygon.append(aNewB2DPolygon);
+        }
 		// #i37011#
 		bool bForceCreateTwoObjects(false);
 
 	}
 }
 
+void EnhancedCustomShape2d::AdaptObjColor(SdrPathObj& rObj, const SfxItemSet& rCustomShapeSet, 
+                                          sal_uInt32& nColorIndex, sal_uInt32 nColorCount)
+{
+    if ( !rObj.IsLine() )
+    {
+        const XFillStyle eFillStyle = ((const XFillStyleItem&)rObj.GetMergedItem(XATTR_FILLSTYLE)).GetValue();
+        switch( eFillStyle )
+        {
+            default:
+            case XFILL_SOLID:
+            {
+                Color aFillColor;
+                if ( nColorCount )
+                {
+                    aFillColor = GetColorData( 
+                        ((XFillColorItem&)rCustomShapeSet.Get( XATTR_FILLCOLOR )).GetColorValue(), 
+                        std::min(nColorIndex, nColorCount-1) );
+                    rObj.SetMergedItem( XFillColorItem( String(), aFillColor ) );
+                }
+                break;
+            }
+            case XFILL_GRADIENT:
+            {
+                XGradient aXGradient(((const XFillGradientItem&)rObj.GetMergedItem(XATTR_FILLGRADIENT)).GetGradientValue());
+                if ( nColorCount )
+                {
+                    aXGradient.SetStartColor(
+                        GetColorData(
+                            aXGradient.GetStartColor(), 
+                            std::min(nColorIndex, nColorCount-1) ));
+                    aXGradient.SetEndColor(
+                        GetColorData(
+                            aXGradient.GetEndColor(), 
+                            std::min(nColorIndex, nColorCount-1) ));
+                }
+
+                rObj.SetMergedItem( XFillGradientItem( String(), aXGradient ) );
+                break;
+            }
+            case XFILL_HATCH:
+            {
+                XHatch aXHatch(((const XFillHatchItem&)rObj.GetMergedItem(XATTR_FILLHATCH)).GetHatchValue());
+                if ( nColorCount )
+                {
+                    aXHatch.SetColor(
+                        GetColorData(
+                            aXHatch.GetColor(), 
+                            std::min(nColorIndex, nColorCount-1) ));
+                }
+
+                rObj.SetMergedItem( XFillHatchItem( String(), aXHatch ) );
+                break;
+            }
+            case XFILL_BITMAP:
+            {
+                Bitmap aBitmap(((const XFillBitmapItem&)rObj.GetMergedItem(XATTR_FILLBITMAP)).GetBitmapValue().GetBitmap());
+                if ( nColorCount )
+                {
+                    aBitmap.Adjust(
+                        static_cast< short > ( GetLuminanceChange(
+                            std::min(nColorIndex, nColorCount-1))));
+                }
+
+                rObj.SetMergedItem( XFillBitmapItem( String(), aBitmap ) );
+                break;
+            }
+        }
+
+        if ( nColorIndex < nColorCount )
+            nColorIndex++;
+    }
+}
 
 SdrObject* EnhancedCustomShape2d::CreatePathObj( sal_Bool bLineGeometryNeededOnly )
 {
 	if ( vObjectList.size() )
 	{
 		const SfxItemSet& rCustomShapeSet = pCustomShapeObj->GetMergedItemSet();
-		// For primitive rendering, shadow handling is done completely based on the geometry, so i removed it here
-		// const sal_Bool	bShadow(((SdrShadowItem&)rCustomShapeSet.Get( SDRATTR_SHADOW )).GetValue());
-		Color			aBasicColor( COL_WHITE );
 		Color			aFillColor;
 		sal_uInt32		nColorCount = nColorData >> 28;
 		sal_uInt32		nColorIndex	= 0;
 
-		if ( nColorCount )
-		{
-			aBasicColor = ((XFillColorItem&)rCustomShapeSet.Get( XATTR_FILLCOLOR )).GetColorValue();
-		}
-
 		// #i37011# remove invisible objects
 		if(vObjectList.size())
 		{
 			{
 				SdrPathObj* pObj(vObjectList[i]);
 				const XLineStyle eLineStyle = ((const XLineStyleItem&)pObj->GetMergedItem(XATTR_LINESTYLE)).GetValue();
-				const XFillStyle eFillStyle = ((const XFillStyleItem&)pObj->GetMergedItem(XATTR_FILLSTYLE)).GetValue();
+                const XFillStyle eFillStyle = ((const XFillStyleItem&)pObj->GetMergedItem(XATTR_FILLSTYLE)).GetValue();
 
 				//SJ: #i40600# if bLineGeometryNeededOnly is set linystyle does not matter
 				if( !bLineGeometryNeededOnly && ( XLINE_NONE == eLineStyle ) && ( XFILL_NONE == eFillStyle ) )
 		if(1L == vObjectList.size())
 		{
 			// a single object, correct some values
-			SdrPathObj* pObj(vObjectList[0L]);
-
-// For primitive rendering, shadow handling is done completely based on the geometry, so i removed it here
-//			if(bShadow)
-//			{
-//				pObj->SetMergedItem(SdrShadowItem(sal_True));
-//			}
-
-			if(!pObj->IsLine())
-			{
-				if ( nColorIndex < nColorCount )
-				{
-					aFillColor = GetColorData( aBasicColor, nColorIndex++ );
-				}
-
-				if ( nColorCount )
-				{
-					pObj->SetMergedItem( XFillColorItem( String(), aFillColor ) );
-				}
-			}
+            AdaptObjColor(*vObjectList[0L],rCustomShapeSet,nColorIndex,nColorCount);
 		}
 		else
 		{
 				else
 				{
 					nAreaObjectCount++;
-
-					if ( nColorIndex < nColorCount )
-					{
-						aFillColor = GetColorData( aBasicColor, nColorIndex++ );
-					}
-
-					if ( nColorCount )
-					{
-						pObj->SetMergedItem( XFillColorItem( String(), aFillColor ) );
-					}
+                    AdaptObjColor(*pObj,rCustomShapeSet,nColorIndex,nColorCount);
 				}
 			}
 

File svx/source/customshapes/EnhancedCustomShape2d.hxx

View file
  • Ignore whitespace
 		sal_Int32					nRotateAngle;
 
 		sal_Bool					SetAdjustValueAsDouble( const double& rValue, const sal_Int32 nIndex );
-		Color						GetColorData( const Color& rFillColor, sal_uInt32 nIndex );
+        sal_Int32                   GetLuminanceChange( sal_uInt32 nIndex ) const;
+		Color						GetColorData( const Color& rFillColor, sal_uInt32 nIndex ) const;
+        void                        AdaptObjColor(SdrPathObj& rObj, const SfxItemSet& rCustomShapeSet, 
+                                                  sal_uInt32& nColorIndex, sal_uInt32 nColorCount);
 		sal_Bool					GetParameter( double& rParameterReturnValue,  const com::sun::star::drawing::EnhancedCustomShapeParameter&,
 													const sal_Bool bReplaceGeoWidth, const sal_Bool bReplaceGeoHeight ) const;
 		Point						GetPoint( const com::sun::star::drawing::EnhancedCustomShapeParameterPair&,

File svx/source/customshapes/EnhancedCustomShapeFontWork.cxx

View file
  • Ignore whitespace
 				break;
 			const Polygon& rOutlinePoly( aOutlines2d[ nOutline2dIdx++ ] );
 			const sal_uInt16 nPointCount = rOutlinePoly.GetSize();
-			if ( nPointCount )
+			if ( nPointCount > 1 )
 			{
 				std::vector< double > vDistances;
 				vDistances.reserve( nPointCount );
 			const Polygon& rOutlinePoly2( aOutlines2d[ nOutline2dIdx++ ] );
 			const sal_uInt16 nPointCount = rOutlinePoly.GetSize();
 			const sal_uInt16 nPointCount2 = rOutlinePoly2.GetSize();
-			if ( nPointCount && nPointCount2 )
+			if ( ( nPointCount > 1 ) && ( nPointCount2 > 1 ) )
 			{
 				std::vector< double > vDistances;
 				vDistances.reserve( nPointCount );

File svx/source/msfilter/msdffimp.cxx

View file
  • Ignore whitespace
 			XGradientStyle eGrad = XGRAD_LINEAR;
 			sal_Int32 nChgColors = 0;
 
-			if ( !nAngle )
-				nChgColors ^= 1;
-
-			if ( !nFocus )
-				nChgColors ^= 1;
-			else if ( nFocus < 0 )		// Bei negativem Focus sind die Farben zu tauschen
+			if ( nFocus < 0 )		// Bei negativem Focus sind die Farben zu tauschen
 			{
 				nFocus =- nFocus;
 				nChgColors ^= 1;
 			if( nFocus > 40 && nFocus < 60 )
 			{
 				eGrad = XGRAD_AXIAL;	// Besser gehts leider nicht
-				nChgColors ^= 1;
 			}
+
 			USHORT nFocusX = (USHORT)nFocus;
 			USHORT nFocusY = (USHORT)nFocus;
 
 				ApplyAttributes( rSt, aSet, aObjData );
 				pRet->SetMergedItemSet(aSet);
 			}
+			else if ( aObjData.eShapeType == mso_sptLine )
+			{
+				basegfx::B2DPolygon aPoly;
+				aPoly.append(basegfx::B2DPoint(aObjData.aBoundRect.Left(), aObjData.aBoundRect.Top()));
+				aPoly.append(basegfx::B2DPoint(aObjData.aBoundRect.Right(), aObjData.aBoundRect.Bottom()));
+				pRet = new SdrPathObj(OBJ_LINE, basegfx::B2DPolyPolygon(aPoly));
+				pRet->SetModel( pSdrModel );
+				ApplyAttributes( rSt, aSet, aObjData );
+				pRet->SetMergedItemSet(aSet);
+			}
 			else
 			{
 				if ( GetCustomShapeContent( aObjData.eShapeType ) || IsProperty( DFF_Prop_pVertices ) )

File svx/source/sdr/contact/viewcontactofsdrobjcustomshape.cxx

View file
  • Ignore whitespace
             // no need to correct if no extra text range
             if(aTextRange != aObjectRange)
             {
+				const double fExtraTextRotation(GetCustomShapeObj().GetExtraTextRotation());
 			    const GeoStat& rGeoStat(GetCustomShapeObj().GetGeoStat());
 
                 // only correct when rotation and/or shear is used
-                if(rGeoStat.nShearWink || rGeoStat.nDrehWink)
+                if(rGeoStat.nShearWink || rGeoStat.nDrehWink || !basegfx::fTools::equalZero(fExtraTextRotation))
 			    {
                     // text range needs to be corrected by 
                     // aObjectRange.getCenter() - aRotObjectRange.getCenter() since it's
 					    aRotMatrix.rotate((36000 - rGeoStat.nDrehWink) * F_PI18000);
 				    }
 
+					if(!basegfx::fTools::equalZero(fExtraTextRotation))
+					{
+						aRotMatrix.rotate((360.0 - fExtraTextRotation) * F_PI180);
+					}
+
                     aRotMatrix.translate(aObjectRange.getMinimum().getX(), aObjectRange.getMinimum().getY());
                     aRotObjectRange.transform(aRotMatrix);
 
 
 					// create primitive
 					const drawinglayer::primitive2d::Primitive2DReference xReference(new drawinglayer::primitive2d::SdrCustomShapePrimitive2D(
-						*pAttribute, xGroup, aTextBoxMatrix, bWordWrap));
+						*pAttribute,
+						xGroup,
+						aTextBoxMatrix,
+						bWordWrap,
+						false));		// #SJ# New parameter to force to clipped BlockText for SC
 					xRetval = drawinglayer::primitive2d::Primitive2DSequence(&xReference, 1);
 				}
 

File svx/source/sdr/primitive2d/sdrcustomshapeprimitive2d.cxx

View file
  • Ignore whitespace
 			{
 				const basegfx::B2DPolygon aUnitOutline(basegfx::tools::createPolygonFromRect(basegfx::B2DRange(0.0, 0.0, 1.0, 1.0)));
 				appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, createTextPrimitive(
-                    basegfx::B2DPolyPolygon(aUnitOutline), getTextBox(), *getSdrSTAttribute().getText(), 0, false, getWordWrap()));
+                    basegfx::B2DPolyPolygon(aUnitOutline),
+					getTextBox(),
+					*getSdrSTAttribute().getText(),
+					0,
+					isForceTextClipToTextRange(), // #SJ# use CellText mode; text upper-left
+					getWordWrap()));
 			}
 
 			// add shadow
 			const attribute::SdrShadowTextAttribute& rSdrSTAttribute,
 			const Primitive2DSequence& rSubPrimitives,
 			const basegfx::B2DHomMatrix& rTextBox,
-            bool bWordWrap)
+            bool bWordWrap,
+			bool bForceTextClipToTextRange)
 		:	BasePrimitive2D(),
 			maSdrSTAttribute(rSdrSTAttribute),
 			maSubPrimitives(rSubPrimitives),
 			maTextBox(rTextBox),
-            mbWordWrap(bWordWrap)
+            mbWordWrap(bWordWrap),
+			mbForceTextClipToTextRange(bForceTextClipToTextRange)
 		{
 		}
 
 				return (getSdrSTAttribute() == rCompare.getSdrSTAttribute()
 					&& getSubPrimitives() == rCompare.getSubPrimitives()
 					&& getTextBox() == rCompare.getTextBox()
-                    && getWordWrap() == rCompare.getWordWrap());
+                    && getWordWrap() == rCompare.getWordWrap()
+					&& isForceTextClipToTextRange() == rCompare.isForceTextClipToTextRange());
 			}
 
 			return false;

File svx/source/svdraw/svdedtv.cxx

View file
  • Ignore whitespace
 	const bool bUndo = IsUndoEnabled();
 	if( bUndo  )
 		AddUndo(GetModel()->GetSdrUndoFactory().CreateUndoReplaceObject(*pOldObj,*pNewObj));
+
+	if( IsObjMarked( pOldObj ) )
+	    MarkObj( pOldObj, &rPV, TRUE /*unmark!*/ );
+
 	pOL->ReplaceObject(pNewObj,pOldObj->GetOrdNum());
+		    
 	if( !bUndo )
 		SdrObject::Free( pOldObj );
 	

File svx/source/svdraw/svdfppt.cxx

View file
  • Ignore whitespace
 				CreateTableRows( xColumnRowRange->getRows(), aRows, pGroup->GetSnapRect().Bottom() );
 				CreateTableColumns( xColumnRowRange->getColumns(), aColumns, pGroup->GetSnapRect().Right() );
 				
+				sal_Int32 nCellCount = aRows.size() * aColumns.size();
+				sal_Int32 *pMergedCellIndexTable = new sal_Int32[ nCellCount ];
+				for ( sal_Int32 i = 0; i < nCellCount; i++ )
+					pMergedCellIndexTable[ i ] = i;
+
 				aGroupIter.Reset();
 				while( aGroupIter.IsMore() )
 				{
 							ApplyCellAttributes( pObj, xCell );
 
 							if ( ( nRowCount > 1 ) || ( nColumnCount > 1 ) )	// cell merging
+							{
 								MergeCells( xTable, nColumn, nRow, nColumnCount, nRowCount );
+								for ( sal_Int32 nRowIter = 0; nRowIter < nRowCount; nRowIter++ )
+								{
+									for ( sal_Int32 nColumnIter = 0; nColumnIter < nColumnCount; nColumnIter++ )
+									{	// now set the correct index for the merged cell
+										pMergedCellIndexTable[ ( ( nRow + nRowIter ) * aColumns.size() ) + nColumn + nColumnIter ] = nTableIndex;
+									}
+								}
+							}
 		
 							// applying text
 							OutlinerParaObject* pParaObject = pObj->GetOutlinerParaObject();
 							}
 						}
 					}
-					else