You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openoffice.apache.org by ja...@apache.org on 2013/11/19 23:39:57 UTC
svn commit: r1543609 [5/32] - in /openoffice/branches/l10n40/main: ./
accessibility/inc/accessibility/extended/
accessibility/inc/accessibility/helper/
accessibility/inc/accessibility/standard/ accessibility/source/extended/
accessibility/source/helper...
Modified: openoffice/branches/l10n40/main/drawinglayer/inc/drawinglayer/primitive2d/modifiedcolorprimitive2d.hxx
URL: http://svn.apache.org/viewvc/openoffice/branches/l10n40/main/drawinglayer/inc/drawinglayer/primitive2d/modifiedcolorprimitive2d.hxx?rev=1543609&r1=1543608&r2=1543609&view=diff
==============================================================================
--- openoffice/branches/l10n40/main/drawinglayer/inc/drawinglayer/primitive2d/modifiedcolorprimitive2d.hxx (original)
+++ openoffice/branches/l10n40/main/drawinglayer/inc/drawinglayer/primitive2d/modifiedcolorprimitive2d.hxx Tue Nov 19 22:39:40 2013
@@ -19,8 +19,6 @@
*
*************************************************************/
-
-
#ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE2D_MODIFIEDCOLORPRIMITIVE2D_HXX
#define INCLUDED_DRAWINGLAYER_PRIMITIVE2D_MODIFIEDCOLORPRIMITIVE2D_HXX
@@ -32,8 +30,8 @@
namespace drawinglayer
{
- namespace primitive2d
- {
+ namespace primitive2d
+ {
/** ModifiedColorPrimitive2D class
This primitive is a grouping primitive and allows to define
@@ -45,34 +43,34 @@ namespace drawinglayer
For the possibilities of color modifications, please refer
to the basegfx::BColorModifier definitions in basegfx. For
processing there is tooling in basegfx to build a stack of
- BColorModifiers to always be able to proccess the correct
+ BColorModifierSharedPtrs to always be able to proccess the correct
colors.
If a renderer does not handle this primitive, the content will
be visualized unchanged.
*/
- class DRAWINGLAYER_DLLPUBLIC ModifiedColorPrimitive2D : public GroupPrimitive2D
- {
- private:
+ class DRAWINGLAYER_DLLPUBLIC ModifiedColorPrimitive2D : public GroupPrimitive2D
+ {
+ private:
/// The ColorModifier to use
- basegfx::BColorModifier maColorModifier;
+ basegfx::BColorModifierSharedPtr maColorModifier;
- public:
+ public:
/// constructor
- ModifiedColorPrimitive2D(
- const Primitive2DSequence& rChildren,
- const basegfx::BColorModifier& rColorModifier);
-
- /// data read access
- const basegfx::BColorModifier& getColorModifier() const { return maColorModifier; }
-
- /// compare operator
- virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
-
- /// provide unique ID
- DeclPrimitrive2DIDBlock()
- };
- } // end of namespace primitive2d
+ ModifiedColorPrimitive2D(
+ const Primitive2DSequence& rChildren,
+ const basegfx::BColorModifierSharedPtr& rColorModifier);
+
+ /// data read access
+ const basegfx::BColorModifierSharedPtr& getColorModifier() const { return maColorModifier; }
+
+ /// compare operator
+ virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
+
+ /// provide unique ID
+ DeclPrimitrive2DIDBlock()
+ };
+ } // end of namespace primitive2d
} // end of namespace drawinglayer
//////////////////////////////////////////////////////////////////////////////
Modified: openoffice/branches/l10n40/main/drawinglayer/inc/drawinglayer/primitive3d/modifiedcolorprimitive3d.hxx
URL: http://svn.apache.org/viewvc/openoffice/branches/l10n40/main/drawinglayer/inc/drawinglayer/primitive3d/modifiedcolorprimitive3d.hxx?rev=1543609&r1=1543608&r2=1543609&view=diff
==============================================================================
--- openoffice/branches/l10n40/main/drawinglayer/inc/drawinglayer/primitive3d/modifiedcolorprimitive3d.hxx (original)
+++ openoffice/branches/l10n40/main/drawinglayer/inc/drawinglayer/primitive3d/modifiedcolorprimitive3d.hxx Tue Nov 19 22:39:40 2013
@@ -19,8 +19,6 @@
*
*************************************************************/
-
-
#ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE3D_MODIFIEDCOLORPRIMITIVE3D_HXX
#define INCLUDED_DRAWINGLAYER_PRIMITIVE3D_MODIFIEDCOLORPRIMITIVE3D_HXX
@@ -32,8 +30,8 @@
namespace drawinglayer
{
- namespace primitive3d
- {
+ namespace primitive3d
+ {
/** ModifiedColorPrimitive3D class
This primitive is a grouping primitive and allows to define
@@ -41,28 +39,28 @@ namespace drawinglayer
visualisation. Please see the ModifiedColorPrimitive2D
description for more info.
*/
- class DRAWINGLAYER_DLLPUBLIC ModifiedColorPrimitive3D : public GroupPrimitive3D
- {
- private:
+ class DRAWINGLAYER_DLLPUBLIC ModifiedColorPrimitive3D : public GroupPrimitive3D
+ {
+ private:
/// The ColorModifier to use
- basegfx::BColorModifier maColorModifier;
+ basegfx::BColorModifierSharedPtr maColorModifier;
- public:
+ public:
/// constructor
- ModifiedColorPrimitive3D(
- const Primitive3DSequence& rChildren,
- const basegfx::BColorModifier& rColorModifier);
-
- /// data read access
- const basegfx::BColorModifier& getColorModifier() const { return maColorModifier; }
-
- /// compare operator
- virtual bool operator==(const BasePrimitive3D& rPrimitive) const;
-
- /// provide unique ID
- DeclPrimitrive3DIDBlock()
- };
- } // end of namespace primitive3d
+ ModifiedColorPrimitive3D(
+ const Primitive3DSequence& rChildren,
+ const basegfx::BColorModifierSharedPtr& rColorModifier);
+
+ /// data read access
+ const basegfx::BColorModifierSharedPtr& getColorModifier() const { return maColorModifier; }
+
+ /// compare operator
+ virtual bool operator==(const BasePrimitive3D& rPrimitive) const;
+
+ /// provide unique ID
+ DeclPrimitrive3DIDBlock()
+ };
+ } // end of namespace primitive3d
} // end of namespace drawinglayer
//////////////////////////////////////////////////////////////////////////////
Modified: openoffice/branches/l10n40/main/drawinglayer/source/primitive2d/graphicprimitive2d.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/l10n40/main/drawinglayer/source/primitive2d/graphicprimitive2d.cxx?rev=1543609&r1=1543608&r2=1543609&view=diff
==============================================================================
--- openoffice/branches/l10n40/main/drawinglayer/source/primitive2d/graphicprimitive2d.cxx (original)
+++ openoffice/branches/l10n40/main/drawinglayer/source/primitive2d/graphicprimitive2d.cxx Tue Nov 19 22:39:40 2013
@@ -19,8 +19,6 @@
*
*************************************************************/
-
-
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_drawinglayer.hxx"
@@ -29,6 +27,8 @@
#include <drawinglayer/primitive2d/drawinglayer_primitivetypes2d.hxx>
#include <drawinglayer/primitive2d/maskprimitive2d.hxx>
#include <drawinglayer/primitive2d/graphicprimitivehelper2d.hxx>
+#include <drawinglayer/primitive2d/unifiedtransparenceprimitive2d.hxx>
+#include <drawinglayer/primitive2d/modifiedcolorprimitive2d.hxx>
#include <basegfx/matrix/b2dhommatrixtools.hxx>
#include <vcl/svapp.hxx>
#include <vcl/outdev.hxx>
@@ -37,140 +37,212 @@
namespace drawinglayer
{
- namespace primitive2d
- {
- Primitive2DSequence GraphicPrimitive2D::create2DDecomposition(const geometry::ViewInformation2D&
+ namespace primitive2d
+ {
+ Primitive2DSequence GraphicPrimitive2D::create2DDecomposition(const geometry::ViewInformation2D&
#ifdef USE_DEBUG_CODE_TO_TEST_METAFILE_DECOMPOSE
rViewInformation
#else
/*rViewInformation*/
#endif // USE_DEBUG_CODE_TO_TEST_METAFILE_DECOMPOSE
) const
- {
- Primitive2DSequence aRetval;
+ {
+ Primitive2DSequence aRetval;
- if(255L != getGraphicAttr().GetTransparency())
- {
- // do not apply mirroring from GraphicAttr to the Metafile by calling
- // GetTransformedGraphic, this will try to mirror the Metafile using Scale()
- // at the Metafile. This again calls Scale at the single MetaFile actions,
- // but this implementation never worked. I reworked that implementations,
- // but for security reasons i will try not to use it.
- basegfx::B2DHomMatrix aTransform(getTransform());
+ if(255L == getGraphicAttr().GetTransparency())
+ {
+ // content is invisible, done
+ return aRetval;
+ }
+
+ // do not apply mirroring from GraphicAttr to the Metafile by calling
+ // GetTransformedGraphic, this will try to mirror the Metafile using Scale()
+ // at the Metafile. This again calls Scale at the single MetaFile actions,
+ // but this implementation never worked. I reworked that implementations,
+ // but for security reasons i will try not to use it.
+ basegfx::B2DHomMatrix aTransform(getTransform());
+
+ if(getGraphicAttr().IsMirrored())
+ {
+ // content needs mirroring
+ const bool bHMirr(getGraphicAttr().GetMirrorFlags() & BMP_MIRROR_HORZ);
+ const bool bVMirr(getGraphicAttr().GetMirrorFlags() & BMP_MIRROR_VERT);
+
+ // mirror by applying negative scale to the unit primitive and
+ // applying the object transformation on it.
+ aTransform = basegfx::tools::createScaleB2DHomMatrix(
+ bHMirr ? -1.0 : 1.0,
+ bVMirr ? -1.0 : 1.0);
+ aTransform.translate(
+ bHMirr ? 1.0 : 0.0,
+ bVMirr ? 1.0 : 0.0);
+ aTransform = getTransform() * aTransform;
+ }
+
+ // Get transformed graphic. Suppress rotation and cropping, only filtering is needed
+ // here (and may be replaced later on). Cropping is handled below as mask primitive (if set).
+ // Also need to suppress mirroring, it is part of the transformation now (see above).
+ // Also move transparency handling to embedding to a UnifiedTransparencePrimitive2D; do
+ // that by remembering original transparency and applying that later if needed
+ GraphicAttr aSuppressGraphicAttr(getGraphicAttr());
+
+ aSuppressGraphicAttr.SetCrop(0, 0, 0, 0);
+ aSuppressGraphicAttr.SetRotation(0);
+ aSuppressGraphicAttr.SetMirrorFlags(0);
+ aSuppressGraphicAttr.SetTransparency(0);
+
+ const GraphicObject& rGraphicObject = getGraphicObject();
+ Graphic aTransformedGraphic(rGraphicObject.GetGraphic());
+ const bool isBitmap(GRAPHIC_BITMAP == aTransformedGraphic.GetType() && !aTransformedGraphic.getSvgData().get());
+ const bool isAdjusted(getGraphicAttr().IsAdjusted());
+ const bool isDrawMode(GRAPHICDRAWMODE_STANDARD != getGraphicAttr().GetDrawMode());
+
+ if(isBitmap && (isAdjusted || isDrawMode))
+ {
+ // the pure primitive solution with the color modifiers works well, too, but when
+ // it is a bitmap graphic the old modification currently is faster; so use it here
+ // instead of creating all as in create2DColorModifierEmbeddingsAsNeeded (see below).
+ // Still, crop, rotation, mirroring and transparency is handled by primitives already
+ // (see above).
+ // This could even be done when vector graphic, but we explicitely want to have the
+ // pure primitive solution for this; this will allow vector graphics to stay vector
+ // geraphics, independent from the color filtering stuff. This will enhance e.g.
+ // SVG and print quality while reducing data size at the same time.
+ // The other way around the old modifications when only used on already bitmap objects
+ // will not loose any quality.
+ aTransformedGraphic = rGraphicObject.GetTransformedGraphic(&aSuppressGraphicAttr);
+
+ // reset GraphicAttr after use to not apply double
+ aSuppressGraphicAttr = GraphicAttr();
+ }
+
+ // create sub-content; helper takes care of correct handling of
+ // bitmap, svg or metafile content
+ aRetval = create2DDecompositionOfGraphic(
+ aTransformedGraphic,
+ aTransform);
+
+ if(!aRetval.getLength())
+ {
+ // content is invisible, done
+ return aRetval;
+ }
+
+ if(isAdjusted || isDrawMode)
+ {
+ // embed to needed ModifiedColorPrimitive2D's if necessary. Do this for
+ // adjustments and draw mode specials
+ aRetval = create2DColorModifierEmbeddingsAsNeeded(
+ aRetval,
+ aSuppressGraphicAttr.GetDrawMode(),
+ basegfx::clamp(aSuppressGraphicAttr.GetLuminance() * 0.01, -1.0, 1.0),
+ basegfx::clamp(aSuppressGraphicAttr.GetContrast() * 0.01, -1.0, 1.0),
+ basegfx::clamp(aSuppressGraphicAttr.GetChannelR() * 0.01, -1.0, 1.0),
+ basegfx::clamp(aSuppressGraphicAttr.GetChannelG() * 0.01, -1.0, 1.0),
+ basegfx::clamp(aSuppressGraphicAttr.GetChannelB() * 0.01, -1.0, 1.0),
+ basegfx::clamp(aSuppressGraphicAttr.GetGamma(), 0.0, 10.0),
+ aSuppressGraphicAttr.IsInvert());
- if(getGraphicAttr().IsMirrored())
+ if(!aRetval.getLength())
{
- // content needs mirroring
- const bool bHMirr(getGraphicAttr().GetMirrorFlags() & BMP_MIRROR_HORZ);
- const bool bVMirr(getGraphicAttr().GetMirrorFlags() & BMP_MIRROR_VERT);
-
- // mirror by applying negative scale to the unit primitive and
- // applying the object transformation on it.
- aTransform = basegfx::tools::createScaleB2DHomMatrix(
- bHMirr ? -1.0 : 1.0,
- bVMirr ? -1.0 : 1.0);
- aTransform.translate(
- bHMirr ? 1.0 : 0.0,
- bVMirr ? 1.0 : 0.0);
- aTransform = getTransform() * aTransform;
+ // content is invisible, done
+ return aRetval;
}
+ }
- // Get transformed graphic. Suppress rotation and cropping, only filtering is needed
- // here (and may be replaced later on). Cropping is handled below as mask primitive (if set).
- // Also need to suppress mirroring, it is part of the transformation now (see above).
- GraphicAttr aSuppressGraphicAttr(getGraphicAttr());
- aSuppressGraphicAttr.SetCrop(0, 0, 0, 0);
- aSuppressGraphicAttr.SetRotation(0);
- aSuppressGraphicAttr.SetMirrorFlags(0);
-
- const GraphicObject& rGraphicObject = getGraphicObject();
- const Graphic aTransformedGraphic(rGraphicObject.GetTransformedGraphic(&aSuppressGraphicAttr));
-
- aRetval = create2DDecompositionOfGraphic(
- aTransformedGraphic,
- aTransform);
+ if(getGraphicAttr().IsTransparent())
+ {
+ // check for transparency
+ const double fTransparency(basegfx::clamp(getGraphicAttr().GetTransparency() * (1.0 / 255.0), 0.0, 1.0));
- if(aRetval.getLength())
+ if(!basegfx::fTools::equalZero(fTransparency))
{
- // check for cropping
- if(getGraphicAttr().IsCropped())
- {
- // calculate scalings between real image size and logic object size. This
- // is necessary since the crop values are relative to original bitmap size
- const basegfx::B2DVector aObjectScale(aTransform * basegfx::B2DVector(1.0, 1.0));
- const basegfx::B2DVector aCropScaleFactor(
- rGraphicObject.calculateCropScaling(
- aObjectScale.getX(),
- aObjectScale.getY(),
- getGraphicAttr().GetLeftCrop(),
- getGraphicAttr().GetTopCrop(),
- getGraphicAttr().GetRightCrop(),
- getGraphicAttr().GetBottomCrop()));
-
- // embed content in cropPrimitive
- Primitive2DReference xPrimitive(
- new CropPrimitive2D(
- aRetval,
- aTransform,
- getGraphicAttr().GetLeftCrop() * aCropScaleFactor.getX(),
- getGraphicAttr().GetTopCrop() * aCropScaleFactor.getY(),
- getGraphicAttr().GetRightCrop() * aCropScaleFactor.getX(),
- getGraphicAttr().GetBottomCrop() * aCropScaleFactor.getY()));
+ const Primitive2DReference aUnifiedTransparence(
+ new UnifiedTransparencePrimitive2D(
+ aRetval,
+ fTransparency));
- aRetval = Primitive2DSequence(&xPrimitive, 1);
- }
+ aRetval = Primitive2DSequence(&aUnifiedTransparence, 1);
}
- }
-
- return aRetval;
- }
+ }
- GraphicPrimitive2D::GraphicPrimitive2D(
- const basegfx::B2DHomMatrix& rTransform,
- const GraphicObject& rGraphicObject,
- const GraphicAttr& rGraphicAttr)
- : BufferedDecompositionPrimitive2D(),
- maTransform(rTransform),
- maGraphicObject(rGraphicObject),
- maGraphicAttr(rGraphicAttr)
- {
- }
-
- GraphicPrimitive2D::GraphicPrimitive2D(
- const basegfx::B2DHomMatrix& rTransform,
- const GraphicObject& rGraphicObject)
- : BufferedDecompositionPrimitive2D(),
- maTransform(rTransform),
- maGraphicObject(rGraphicObject),
- maGraphicAttr()
- {
- }
-
- bool GraphicPrimitive2D::operator==(const BasePrimitive2D& rPrimitive) const
- {
- if(BufferedDecompositionPrimitive2D::operator==(rPrimitive))
- {
- const GraphicPrimitive2D& rCompare = (GraphicPrimitive2D&)rPrimitive;
-
- return (getTransform() == rCompare.getTransform()
- && getGraphicObject() == rCompare.getGraphicObject()
- && getGraphicAttr() == rCompare.getGraphicAttr());
- }
-
- return false;
- }
-
- basegfx::B2DRange GraphicPrimitive2D::getB2DRange(const geometry::ViewInformation2D& /*rViewInformation*/) const
- {
- basegfx::B2DRange aRetval(0.0, 0.0, 1.0, 1.0);
- aRetval.transform(getTransform());
- return aRetval;
- }
+ if(getGraphicAttr().IsCropped())
+ {
+ // check for cropping
+ // calculate scalings between real image size and logic object size. This
+ // is necessary since the crop values are relative to original bitmap size
+ const basegfx::B2DVector aObjectScale(aTransform * basegfx::B2DVector(1.0, 1.0));
+ const basegfx::B2DVector aCropScaleFactor(
+ rGraphicObject.calculateCropScaling(
+ aObjectScale.getX(),
+ aObjectScale.getY(),
+ getGraphicAttr().GetLeftCrop(),
+ getGraphicAttr().GetTopCrop(),
+ getGraphicAttr().GetRightCrop(),
+ getGraphicAttr().GetBottomCrop()));
+
+ // embed content in cropPrimitive
+ Primitive2DReference xPrimitive(
+ new CropPrimitive2D(
+ aRetval,
+ aTransform,
+ getGraphicAttr().GetLeftCrop() * aCropScaleFactor.getX(),
+ getGraphicAttr().GetTopCrop() * aCropScaleFactor.getY(),
+ getGraphicAttr().GetRightCrop() * aCropScaleFactor.getX(),
+ getGraphicAttr().GetBottomCrop() * aCropScaleFactor.getY()));
+
+ aRetval = Primitive2DSequence(&xPrimitive, 1);
+ }
+
+ return aRetval;
+ }
+
+ GraphicPrimitive2D::GraphicPrimitive2D(
+ const basegfx::B2DHomMatrix& rTransform,
+ const GraphicObject& rGraphicObject,
+ const GraphicAttr& rGraphicAttr)
+ : BufferedDecompositionPrimitive2D(),
+ maTransform(rTransform),
+ maGraphicObject(rGraphicObject),
+ maGraphicAttr(rGraphicAttr)
+ {
+ }
+
+ GraphicPrimitive2D::GraphicPrimitive2D(
+ const basegfx::B2DHomMatrix& rTransform,
+ const GraphicObject& rGraphicObject)
+ : BufferedDecompositionPrimitive2D(),
+ maTransform(rTransform),
+ maGraphicObject(rGraphicObject),
+ maGraphicAttr()
+ {
+ }
+
+ bool GraphicPrimitive2D::operator==(const BasePrimitive2D& rPrimitive) const
+ {
+ if(BufferedDecompositionPrimitive2D::operator==(rPrimitive))
+ {
+ const GraphicPrimitive2D& rCompare = (GraphicPrimitive2D&)rPrimitive;
+
+ return (getTransform() == rCompare.getTransform()
+ && getGraphicObject() == rCompare.getGraphicObject()
+ && getGraphicAttr() == rCompare.getGraphicAttr());
+ }
+
+ return false;
+ }
+
+ basegfx::B2DRange GraphicPrimitive2D::getB2DRange(const geometry::ViewInformation2D& /*rViewInformation*/) const
+ {
+ basegfx::B2DRange aRetval(0.0, 0.0, 1.0, 1.0);
+ aRetval.transform(getTransform());
+ return aRetval;
+ }
- // provide unique ID
- ImplPrimitrive2DIDBlock(GraphicPrimitive2D, PRIMITIVE2D_ID_GRAPHICPRIMITIVE2D)
+ // provide unique ID
+ ImplPrimitrive2DIDBlock(GraphicPrimitive2D, PRIMITIVE2D_ID_GRAPHICPRIMITIVE2D)
- } // end of namespace primitive2d
+ } // end of namespace primitive2d
} // end of namespace drawinglayer
//////////////////////////////////////////////////////////////////////////////
Modified: openoffice/branches/l10n40/main/drawinglayer/source/primitive2d/graphicprimitivehelper2d.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/l10n40/main/drawinglayer/source/primitive2d/graphicprimitivehelper2d.cxx?rev=1543609&r1=1543608&r2=1543609&view=diff
==============================================================================
--- openoffice/branches/l10n40/main/drawinglayer/source/primitive2d/graphicprimitivehelper2d.cxx (original)
+++ openoffice/branches/l10n40/main/drawinglayer/source/primitive2d/graphicprimitivehelper2d.cxx Tue Nov 19 22:39:40 2013
@@ -19,8 +19,6 @@
*
*************************************************************/
-
-
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_drawinglayer.hxx"
@@ -31,8 +29,10 @@
#include <drawinglayer/primitive2d/metafileprimitive2d.hxx>
#include <drawinglayer/primitive2d/transformprimitive2d.hxx>
#include <drawinglayer/primitive2d/maskprimitive2d.hxx>
+#include <drawinglayer/primitive2d/modifiedcolorprimitive2d.hxx>
#include <basegfx/polygon/b2dpolygon.hxx>
#include <basegfx/polygon/b2dpolygontools.hxx>
+#include <basegfx/numeric/ftools.hxx>
//////////////////////////////////////////////////////////////////////////////
// helper class for animated graphics
@@ -783,4 +783,137 @@ namespace drawinglayer
} // end of namespace drawinglayer
//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace primitive2d
+ {
+ Primitive2DSequence create2DColorModifierEmbeddingsAsNeeded(
+ const Primitive2DSequence& rChildren,
+ GraphicDrawMode aGraphicDrawMode,
+ double fLuminance,
+ double fContrast,
+ double fRed,
+ double fGreen,
+ double fBlue,
+ double fGamma,
+ bool bInvert)
+ {
+ Primitive2DSequence aRetval;
+
+ if(!rChildren.getLength())
+ {
+ // no child content, done
+ return aRetval;
+ }
+
+ // set child content as retval; that is what will be used as child content in all
+ // embeddings from here
+ aRetval = rChildren;
+
+ if(GRAPHICDRAWMODE_WATERMARK == aGraphicDrawMode)
+ {
+ // this is solved by applying fixed values additionally to luminance
+ // and contrast, do it here and reset DrawMode to GRAPHICDRAWMODE_STANDARD
+ // original in svtools uses:
+ // #define WATERMARK_LUM_OFFSET 50
+ // #define WATERMARK_CON_OFFSET -70
+ fLuminance = basegfx::clamp(fLuminance + 0.5, -1.0, 1.0);
+ fContrast = basegfx::clamp(fContrast - 0.7, -1.0, 1.0);
+ aGraphicDrawMode = GRAPHICDRAWMODE_STANDARD;
+ }
+
+ // DrawMode (GRAPHICDRAWMODE_WATERMARK already handled)
+ switch(aGraphicDrawMode)
+ {
+ case GRAPHICDRAWMODE_GREYS:
+ {
+ // convert to grey
+ const Primitive2DReference aPrimitiveGrey(
+ new ModifiedColorPrimitive2D(
+ aRetval,
+ basegfx::BColorModifierSharedPtr(
+ new basegfx::BColorModifier_gray())));
+
+ aRetval = Primitive2DSequence(&aPrimitiveGrey, 1);
+ break;
+ }
+ case GRAPHICDRAWMODE_MONO:
+ {
+ // convert to mono (black/white with threshold 0.5)
+ const Primitive2DReference aPrimitiveBlackAndWhite(
+ new ModifiedColorPrimitive2D(
+ aRetval,
+ basegfx::BColorModifierSharedPtr(
+ new basegfx::BColorModifier_black_and_white(0.5))));
+
+ aRetval = Primitive2DSequence(&aPrimitiveBlackAndWhite, 1);
+ break;
+ }
+ case GRAPHICDRAWMODE_WATERMARK:
+ {
+ OSL_ENSURE(false, "OOps, GRAPHICDRAWMODE_WATERMARK should already be handled (see above)");
+ // fallthrough intended
+ }
+ default: // case GRAPHICDRAWMODE_STANDARD:
+ {
+ // nothing to do
+ break;
+ }
+ }
+
+ // mnContPercent, mnLumPercent, mnRPercent, mnGPercent, mnBPercent
+ // handled in a single call
+ if(!basegfx::fTools::equalZero(fLuminance)
+ || !basegfx::fTools::equalZero(fContrast)
+ || !basegfx::fTools::equalZero(fRed)
+ || !basegfx::fTools::equalZero(fGreen)
+ || !basegfx::fTools::equalZero(fBlue))
+ {
+ const Primitive2DReference aPrimitiveRGBLuminannceContrast(
+ new ModifiedColorPrimitive2D(
+ aRetval,
+ basegfx::BColorModifierSharedPtr(
+ new basegfx::BColorModifier_RGBLuminanceContrast(
+ fRed,
+ fGreen,
+ fBlue,
+ fLuminance,
+ fContrast))));
+
+ aRetval = Primitive2DSequence(&aPrimitiveRGBLuminannceContrast, 1);
+ }
+
+ // gamma (boolean)
+ if(!basegfx::fTools::equal(fGamma, 1.0))
+ {
+ const Primitive2DReference aPrimitiveGamma(
+ new ModifiedColorPrimitive2D(
+ aRetval,
+ basegfx::BColorModifierSharedPtr(
+ new basegfx::BColorModifier_gamma(
+ fGamma))));
+
+ aRetval = Primitive2DSequence(&aPrimitiveGamma, 1);
+ }
+
+ // invert (boolean)
+ if(bInvert)
+ {
+ const Primitive2DReference aPrimitiveInvert(
+ new ModifiedColorPrimitive2D(
+ aRetval,
+ basegfx::BColorModifierSharedPtr(
+ new basegfx::BColorModifier_invert())));
+
+ aRetval = Primitive2DSequence(&aPrimitiveInvert, 1);
+ }
+
+ return aRetval;
+ }
+
+ } // end of namespace primitive2d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
// eof
Modified: openoffice/branches/l10n40/main/drawinglayer/source/primitive2d/metafileprimitive2d.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/l10n40/main/drawinglayer/source/primitive2d/metafileprimitive2d.cxx?rev=1543609&r1=1543608&r2=1543609&view=diff
==============================================================================
--- openoffice/branches/l10n40/main/drawinglayer/source/primitive2d/metafileprimitive2d.cxx (original)
+++ openoffice/branches/l10n40/main/drawinglayer/source/primitive2d/metafileprimitive2d.cxx Tue Nov 19 22:39:40 2013
@@ -1061,16 +1061,18 @@ namespace
{
// force content to black
rTargetHolders.Current().append(
- new drawinglayer::primitive2d::ModifiedColorPrimitive2D(
- aSubContent,
- basegfx::BColorModifier(basegfx::BColor(0.0, 0.0, 0.0))));
+ new drawinglayer::primitive2d::ModifiedColorPrimitive2D(
+ aSubContent,
+ basegfx::BColorModifierSharedPtr(
+ new basegfx::BColorModifier_replace(
+ basegfx::BColor(0.0, 0.0, 0.0)))));
}
else // if(rPropertyHolders.Current().isRasterOpInvert())
{
// invert content
rTargetHolders.Current().append(
- new drawinglayer::primitive2d::InvertPrimitive2D(
- aSubContent));
+ new drawinglayer::primitive2d::InvertPrimitive2D(
+ aSubContent));
}
}
}
Modified: openoffice/branches/l10n40/main/drawinglayer/source/primitive2d/modifiedcolorprimitive2d.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/l10n40/main/drawinglayer/source/primitive2d/modifiedcolorprimitive2d.cxx?rev=1543609&r1=1543608&r2=1543609&view=diff
==============================================================================
--- openoffice/branches/l10n40/main/drawinglayer/source/primitive2d/modifiedcolorprimitive2d.cxx (original)
+++ openoffice/branches/l10n40/main/drawinglayer/source/primitive2d/modifiedcolorprimitive2d.cxx Tue Nov 19 22:39:40 2013
@@ -19,8 +19,6 @@
*
*************************************************************/
-
-
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_drawinglayer.hxx"
@@ -35,32 +33,42 @@ using namespace com::sun::star;
namespace drawinglayer
{
- namespace primitive2d
- {
- ModifiedColorPrimitive2D::ModifiedColorPrimitive2D(
- const Primitive2DSequence& rChildren,
- const basegfx::BColorModifier& rColorModifier)
- : GroupPrimitive2D(rChildren),
- maColorModifier(rColorModifier)
- {
- }
-
- bool ModifiedColorPrimitive2D::operator==(const BasePrimitive2D& rPrimitive) const
- {
- if(GroupPrimitive2D::operator==(rPrimitive))
- {
- const ModifiedColorPrimitive2D& rCompare = (ModifiedColorPrimitive2D&)rPrimitive;
-
- return (getColorModifier() == rCompare.getColorModifier());
- }
+ namespace primitive2d
+ {
+ ModifiedColorPrimitive2D::ModifiedColorPrimitive2D(
+ const Primitive2DSequence& rChildren,
+ const basegfx::BColorModifierSharedPtr& rColorModifier)
+ : GroupPrimitive2D(rChildren),
+ maColorModifier(rColorModifier)
+ {
+ }
+
+ bool ModifiedColorPrimitive2D::operator==(const BasePrimitive2D& rPrimitive) const
+ {
+ if(GroupPrimitive2D::operator==(rPrimitive))
+ {
+ const ModifiedColorPrimitive2D& rCompare = (ModifiedColorPrimitive2D&)rPrimitive;
+
+ if(getColorModifier().get() == rCompare.getColorModifier().get())
+ {
+ return true;
+ }
+
+ if(!getColorModifier().get() || !rCompare.getColorModifier().get())
+ {
+ return false;
+ }
+
+ return *getColorModifier().get() == *rCompare.getColorModifier().get();
+ }
- return false;
- }
+ return false;
+ }
- // provide unique ID
- ImplPrimitrive2DIDBlock(ModifiedColorPrimitive2D, PRIMITIVE2D_ID_MODIFIEDCOLORPRIMITIVE2D)
+ // provide unique ID
+ ImplPrimitrive2DIDBlock(ModifiedColorPrimitive2D, PRIMITIVE2D_ID_MODIFIEDCOLORPRIMITIVE2D)
- } // end of namespace primitive2d
+ } // end of namespace primitive2d
} // end of namespace drawinglayer
//////////////////////////////////////////////////////////////////////////////
Modified: openoffice/branches/l10n40/main/drawinglayer/source/primitive2d/shadowprimitive2d.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/l10n40/main/drawinglayer/source/primitive2d/shadowprimitive2d.cxx?rev=1543609&r1=1543608&r2=1543609&view=diff
==============================================================================
--- openoffice/branches/l10n40/main/drawinglayer/source/primitive2d/shadowprimitive2d.cxx (original)
+++ openoffice/branches/l10n40/main/drawinglayer/source/primitive2d/shadowprimitive2d.cxx Tue Nov 19 22:39:40 2013
@@ -77,17 +77,22 @@ namespace drawinglayer
{
Primitive2DSequence aRetval;
- if(getChildren().hasElements())
- {
- // create a modifiedColorPrimitive containing the shadow color and the content
- const basegfx::BColorModifier aBColorModifier(getShadowColor());
- const Primitive2DReference xRefA(new ModifiedColorPrimitive2D(getChildren(), aBColorModifier));
- const Primitive2DSequence aSequenceB(&xRefA, 1L);
-
- // build transformed primitiveVector with shadow offset and add to target
- const Primitive2DReference xRefB(new TransformPrimitive2D(getShadowTransform(), aSequenceB));
- aRetval = Primitive2DSequence(&xRefB, 1L);
- }
+ if(getChildren().hasElements())
+ {
+ // create a modifiedColorPrimitive containing the shadow color and the content
+ const basegfx::BColorModifierSharedPtr aBColorModifier(
+ new basegfx::BColorModifier_replace(
+ getShadowColor()));
+ const Primitive2DReference xRefA(
+ new ModifiedColorPrimitive2D(
+ getChildren(),
+ aBColorModifier));
+ const Primitive2DSequence aSequenceB(&xRefA, 1L);
+
+ // build transformed primitiveVector with shadow offset and add to target
+ const Primitive2DReference xRefB(new TransformPrimitive2D(getShadowTransform(), aSequenceB));
+ aRetval = Primitive2DSequence(&xRefB, 1L);
+ }
return aRetval;
}
Modified: openoffice/branches/l10n40/main/drawinglayer/source/primitive2d/texteffectprimitive2d.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/l10n40/main/drawinglayer/source/primitive2d/texteffectprimitive2d.cxx?rev=1543609&r1=1543608&r2=1543609&view=diff
==============================================================================
--- openoffice/branches/l10n40/main/drawinglayer/source/primitive2d/texteffectprimitive2d.cxx (original)
+++ openoffice/branches/l10n40/main/drawinglayer/source/primitive2d/texteffectprimitive2d.cxx Tue Nov 19 22:39:40 2013
@@ -88,29 +88,53 @@ namespace drawinglayer
aTransform *= aForwardTransform;
- if(bDefaultTextColor)
- {
- // emboss/engrave in black, original forced to white
- const basegfx::BColorModifier aBColorModifierToGray(basegfx::BColor(0.0));
- const Primitive2DReference xModifiedColor(new ModifiedColorPrimitive2D(getTextContent(), aBColorModifierToGray));
- aRetval[0] = Primitive2DReference(new TransformPrimitive2D(aTransform, Primitive2DSequence(&xModifiedColor, 1)));
-
- // add original, too
- const basegfx::BColorModifier aBColorModifierToWhite(basegfx::BColor(1.0));
- aRetval[1] = Primitive2DReference(new ModifiedColorPrimitive2D(getTextContent(), aBColorModifierToWhite));
- }
- else
- {
- // emboss/engrave in gray, keep original's color
- const basegfx::BColorModifier aBColorModifierToGray(basegfx::BColor(0.75)); // 192
- const Primitive2DReference xModifiedColor(new ModifiedColorPrimitive2D(getTextContent(), aBColorModifierToGray));
- aRetval[0] = Primitive2DReference(new TransformPrimitive2D(aTransform, Primitive2DSequence(&xModifiedColor, 1)));
-
- // add original, too
- aRetval[1] = Primitive2DReference(new GroupPrimitive2D(getTextContent()));
- }
-
- break;
+ if(bDefaultTextColor)
+ {
+ // emboss/engrave in black, original forced to white
+ const basegfx::BColorModifierSharedPtr aBColorModifierToGray(
+ new basegfx::BColorModifier_replace(
+ basegfx::BColor(0.0)));
+ const Primitive2DReference xModifiedColor(
+ new ModifiedColorPrimitive2D(
+ getTextContent(),
+ aBColorModifierToGray));
+
+ aRetval[0] = Primitive2DReference(
+ new TransformPrimitive2D(
+ aTransform,
+ Primitive2DSequence(&xModifiedColor, 1)));
+
+ // add original, too
+ const basegfx::BColorModifierSharedPtr aBColorModifierToWhite(
+ new basegfx::BColorModifier_replace(
+ basegfx::BColor(1.0)));
+
+ aRetval[1] = Primitive2DReference(
+ new ModifiedColorPrimitive2D(
+ getTextContent(),
+ aBColorModifierToWhite));
+ }
+ else
+ {
+ // emboss/engrave in gray, keep original's color
+ const basegfx::BColorModifierSharedPtr aBColorModifierToGray(
+ new basegfx::BColorModifier_replace(
+ basegfx::BColor(0.75))); // 192
+ const Primitive2DReference xModifiedColor(
+ new ModifiedColorPrimitive2D(
+ getTextContent(),
+ aBColorModifierToGray));
+
+ aRetval[0] = Primitive2DReference(
+ new TransformPrimitive2D(
+ aTransform,
+ Primitive2DSequence(&xModifiedColor, 1)));
+
+ // add original, too
+ aRetval[1] = Primitive2DReference(new GroupPrimitive2D(getTextContent()));
+ }
+
+ break;
}
case TEXTEFFECTSTYLE2D_OUTLINE:
{
@@ -150,9 +174,14 @@ namespace drawinglayer
aTransform.set(1, 2, -aDiagonalDistance.getY());
aRetval[7] = Primitive2DReference(new TransformPrimitive2D(aTransform, getTextContent()));
- // at last, place original over it, but force to white
- const basegfx::BColorModifier aBColorModifierToWhite(basegfx::BColor(1.0, 1.0, 1.0));
- aRetval[8] = Primitive2DReference(new ModifiedColorPrimitive2D(getTextContent(), aBColorModifierToWhite));
+ // at last, place original over it, but force to white
+ const basegfx::BColorModifierSharedPtr aBColorModifierToWhite(
+ new basegfx::BColorModifier_replace(
+ basegfx::BColor(1.0, 1.0, 1.0)));
+ aRetval[8] = Primitive2DReference(
+ new ModifiedColorPrimitive2D(
+ getTextContent(),
+ aBColorModifierToWhite));
break;
}
Modified: openoffice/branches/l10n40/main/drawinglayer/source/primitive3d/modifiedcolorprimitive3d.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/l10n40/main/drawinglayer/source/primitive3d/modifiedcolorprimitive3d.cxx?rev=1543609&r1=1543608&r2=1543609&view=diff
==============================================================================
--- openoffice/branches/l10n40/main/drawinglayer/source/primitive3d/modifiedcolorprimitive3d.cxx (original)
+++ openoffice/branches/l10n40/main/drawinglayer/source/primitive3d/modifiedcolorprimitive3d.cxx Tue Nov 19 22:39:40 2013
@@ -19,8 +19,6 @@
*
*************************************************************/
-
-
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_drawinglayer.hxx"
@@ -35,32 +33,42 @@ using namespace com::sun::star;
namespace drawinglayer
{
- namespace primitive3d
- {
- ModifiedColorPrimitive3D::ModifiedColorPrimitive3D(
- const Primitive3DSequence& rChildren,
- const basegfx::BColorModifier& rColorModifier)
- : GroupPrimitive3D(rChildren),
- maColorModifier(rColorModifier)
- {
- }
-
- bool ModifiedColorPrimitive3D::operator==(const BasePrimitive3D& rPrimitive) const
- {
- if(GroupPrimitive3D::operator==(rPrimitive))
- {
- const ModifiedColorPrimitive3D& rCompare = (ModifiedColorPrimitive3D&)rPrimitive;
-
- return (maColorModifier == rCompare.maColorModifier);
- }
+ namespace primitive3d
+ {
+ ModifiedColorPrimitive3D::ModifiedColorPrimitive3D(
+ const Primitive3DSequence& rChildren,
+ const basegfx::BColorModifierSharedPtr& rColorModifier)
+ : GroupPrimitive3D(rChildren),
+ maColorModifier(rColorModifier)
+ {
+ }
+
+ bool ModifiedColorPrimitive3D::operator==(const BasePrimitive3D& rPrimitive) const
+ {
+ if(GroupPrimitive3D::operator==(rPrimitive))
+ {
+ const ModifiedColorPrimitive3D& rCompare = (ModifiedColorPrimitive3D&)rPrimitive;
+
+ if(getColorModifier().get() == rCompare.getColorModifier().get())
+ {
+ return true;
+ }
+
+ if(!getColorModifier().get() || !rCompare.getColorModifier().get())
+ {
+ return false;
+ }
+
+ return *getColorModifier().get() == *rCompare.getColorModifier().get();
+ }
- return false;
- }
+ return false;
+ }
- // provide unique ID
- ImplPrimitrive3DIDBlock(ModifiedColorPrimitive3D, PRIMITIVE3D_ID_MODIFIEDCOLORPRIMITIVE3D)
+ // provide unique ID
+ ImplPrimitrive3DIDBlock(ModifiedColorPrimitive3D, PRIMITIVE3D_ID_MODIFIEDCOLORPRIMITIVE3D)
- } // end of namespace primitive3d
+ } // end of namespace primitive3d
} // end of namespace drawinglayer
//////////////////////////////////////////////////////////////////////////////
Modified: openoffice/branches/l10n40/main/drawinglayer/source/primitive3d/sdrdecompositiontools3d.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/l10n40/main/drawinglayer/source/primitive3d/sdrdecompositiontools3d.cxx?rev=1543609&r1=1543608&r2=1543609&view=diff
==============================================================================
--- openoffice/branches/l10n40/main/drawinglayer/source/primitive3d/sdrdecompositiontools3d.cxx (original)
+++ openoffice/branches/l10n40/main/drawinglayer/source/primitive3d/sdrdecompositiontools3d.cxx Tue Nov 19 22:39:40 2013
@@ -251,14 +251,19 @@ namespace drawinglayer
const Primitive3DReference xRef(pNewTexturePrimitive3D);
aRetval = Primitive3DSequence(&xRef, 1L);
- if(::com::sun::star::drawing::TextureKind2_LUMINANCE == aSdr3DObjectAttribute.getTextureKind())
- {
- // use modified color primitive to force textures to gray
- const basegfx::BColorModifier aBColorModifier(basegfx::BColor(), 0.0, basegfx::BCOLORMODIFYMODE_GRAY);
- const Primitive3DReference xRef2(new ModifiedColorPrimitive3D(aRetval, aBColorModifier));
- aRetval = Primitive3DSequence(&xRef2, 1L);
- }
- }
+ if(::com::sun::star::drawing::TextureKind2_LUMINANCE == aSdr3DObjectAttribute.getTextureKind())
+ {
+ // use modified color primitive to force textures to gray
+ const basegfx::BColorModifierSharedPtr aBColorModifier(
+ new basegfx::BColorModifier_gray());
+ const Primitive3DReference xRef2(
+ new ModifiedColorPrimitive3D(
+ aRetval,
+ aBColorModifier));
+
+ aRetval = Primitive3DSequence(&xRef2, 1L);
+ }
+ }
if(0.0 != rFill.getTransparence())
{
Modified: openoffice/branches/l10n40/main/drawinglayer/source/processor2d/vclprocessor2d.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/l10n40/main/drawinglayer/source/processor2d/vclprocessor2d.cxx?rev=1543609&r1=1543608&r2=1543609&view=diff
==============================================================================
--- openoffice/branches/l10n40/main/drawinglayer/source/processor2d/vclprocessor2d.cxx (original)
+++ openoffice/branches/l10n40/main/drawinglayer/source/processor2d/vclprocessor2d.cxx Tue Nov 19 22:39:40 2013
@@ -662,7 +662,7 @@ namespace drawinglayer
{
case GRAPHIC_GDIMETAFILE:
{
- // metafiles are potentially transparent, cannot optimize´, not done
+ // metafiles are potentially transparent, cannot optimize, not done
break;
}
case GRAPHIC_BITMAP:
@@ -674,9 +674,10 @@ namespace drawinglayer
if(nBColorModifierStackCount)
{
- const basegfx::BColorModifier& rTopmostModifier = maBColorModifierStack.getBColorModifier(nBColorModifierStackCount - 1);
+ const basegfx::BColorModifierSharedPtr& rTopmostModifier = maBColorModifierStack.getBColorModifier(nBColorModifierStackCount - 1);
+ const basegfx::BColorModifier_replace* pReplacer = dynamic_cast< const basegfx::BColorModifier_replace* >(rTopmostModifier.get());
- if(basegfx::BCOLORMODIFYMODE_REPLACE == rTopmostModifier.getMode())
+ if(pReplacer)
{
// the bitmap fill is in unified color, so we can replace it with
// a single polygon fill. The form of the fill depends on tiling
@@ -687,7 +688,7 @@ namespace drawinglayer
aLocalPolyPolygon.transform(maCurrentTransformation);
mpOutputDevice->SetLineColor();
- mpOutputDevice->SetFillColor(Color(rTopmostModifier.getBColor()));
+ mpOutputDevice->SetFillColor(Color(pReplacer->getBColor()));
mpOutputDevice->DrawPolyPolygon(aLocalPolyPolygon);
}
else
@@ -719,7 +720,7 @@ namespace drawinglayer
{
aTarget.transform(maCurrentTransformation);
mpOutputDevice->SetLineColor();
- mpOutputDevice->SetFillColor(Color(rTopmostModifier.getBColor()));
+ mpOutputDevice->SetFillColor(Color(pReplacer->getBColor()));
mpOutputDevice->DrawPolyPolygon(aTarget);
}
}
Modified: openoffice/branches/l10n40/main/drawinglayer/source/tools/converters.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/l10n40/main/drawinglayer/source/tools/converters.cxx?rev=1543609&r1=1543608&r2=1543609&view=diff
==============================================================================
--- openoffice/branches/l10n40/main/drawinglayer/source/tools/converters.cxx (original)
+++ openoffice/branches/l10n40/main/drawinglayer/source/tools/converters.cxx Tue Nov 19 22:39:40 2013
@@ -120,14 +120,12 @@ namespace drawinglayer
maContent.Erase();
// embed primitives to paint them black
- static basegfx::BColorModifyMode aMode = basegfx::BCOLORMODIFYMODE_REPLACE;
const primitive2d::Primitive2DReference xRef(
new primitive2d::ModifiedColorPrimitive2D(
aSequence,
- basegfx::BColorModifier(
- basegfx::BColor(0.0, 0.0, 0.0),
- 0.5,
- aMode)));
+ basegfx::BColorModifierSharedPtr(
+ new basegfx::BColorModifier_replace(
+ basegfx::BColor(0.0, 0.0, 0.0)))));
const primitive2d::Primitive2DSequence xSeq(&xRef, 1);
// render
Modified: openoffice/branches/l10n40/main/editeng/inc/editeng/AccessibleEditableTextPara.hxx
URL: http://svn.apache.org/viewvc/openoffice/branches/l10n40/main/editeng/inc/editeng/AccessibleEditableTextPara.hxx?rev=1543609&r1=1543608&r2=1543609&view=diff
==============================================================================
--- openoffice/branches/l10n40/main/editeng/inc/editeng/AccessibleEditableTextPara.hxx (original)
+++ openoffice/branches/l10n40/main/editeng/inc/editeng/AccessibleEditableTextPara.hxx Tue Nov 19 22:39:40 2013
@@ -373,6 +373,13 @@ namespace accessibility
/// Check whether 0<=nStart<=n and 0<=nEnd<=n
void CheckRange( sal_Int32 nStart, sal_Int32 nEnd ) SAL_THROW((::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException));
+//IAccessibility2 Implementation 2009-----
+ void _correctValues( const sal_Int32 nIndex, ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& rValues );
+ sal_Int32 SkipField(sal_Int32 nIndex, sal_Bool bForward);
+ // get overlapped field, extend return string. Only extend forward for now
+ sal_Bool ExtendByField( ::com::sun::star::accessibility::TextSegment& Segment );
+ String GetFieldTypeNameAtIndex(sal_Int32 nIndex);
+//-----IAccessibility2 Implementation 2009
// the paragraph index in the edit engine (guarded by solar mutex)
sal_Int32 mnParagraphIndex;
@@ -400,6 +407,14 @@ namespace accessibility
/// Our listeners (guarded by maMutex)
int mnNotifierClientId;
+ //IAccessibility2 Implementation 2009-----
+public:
+ void SetParagraphBackColorAccessible(const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > & ref)
+ { m_xAccInfo = ref ;}
+private:
+ ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > m_xAccInfo;
+ //virtual sal_Bool IsShapeParaFocusable( );
+ //-----IAccessibility2 Implementation 2009
// --> OD 2006-01-11 #i27138#
// the paragraph manager, which created this instance - is NULL, if
Modified: openoffice/branches/l10n40/main/editeng/inc/editeng/editdata.hxx
URL: http://svn.apache.org/viewvc/openoffice/branches/l10n40/main/editeng/inc/editeng/editdata.hxx?rev=1543609&r1=1543608&r2=1543609&view=diff
==============================================================================
--- openoffice/branches/l10n40/main/editeng/inc/editeng/editdata.hxx (original)
+++ openoffice/branches/l10n40/main/editeng/inc/editeng/editdata.hxx Tue Nov 19 22:39:40 2013
@@ -363,7 +363,10 @@ enum EENotifyType
EE_NOTIFY_INPUT_START,
/// Denotes the end of a high-level action triggered by a key press
- EE_NOTIFY_INPUT_END
+ EE_NOTIFY_INPUT_END,
+//IAccessibility2 Implementation 2009-----
+ EE_NOTIFY_TEXTVIEWSELECTIONCHANGED_ENDD_PARA
+//-----IAccessibility2 Implementation 2009
};
struct EENotify
Modified: openoffice/branches/l10n40/main/editeng/inc/editeng/editeng.hxx
URL: http://svn.apache.org/viewvc/openoffice/branches/l10n40/main/editeng/inc/editeng/editeng.hxx?rev=1543609&r1=1543608&r2=1543609&view=diff
==============================================================================
--- openoffice/branches/l10n40/main/editeng/inc/editeng/editeng.hxx (original)
+++ openoffice/branches/l10n40/main/editeng/inc/editeng/editeng.hxx Tue Nov 19 22:39:40 2013
@@ -108,6 +108,9 @@ const sal_uInt8 EditEngineAttribs_OnlyHa
#define GETATTRIBS_CHARATTRIBS (sal_uInt8)0x04
#define GETATTRIBS_ALL (sal_uInt8)0xFF
+//IAccessibility2 Implementation 2009-----
+class SdrObject;
+//-----IAccessibility2 Implementation 2009
class EDITENG_DLLPUBLIC EditEngine
{
friend class EditView;
@@ -145,6 +148,9 @@ public:
void SetUpdateMode( sal_Bool bUpdate );
sal_Bool GetUpdateMode() const;
+ //IAccessible2 migration fix
+ void SetUpdateModeForAcc( sal_Bool bUp);
+ sal_Bool GetUpdateModeForAcc( ) const;
void SetBackgroundColor( const Color& rColor );
Color GetBackgroundColor() const;
@@ -469,7 +475,9 @@ public:
static void ImportBulletItem( SvxNumBulletItem& rNumBullet, sal_uInt16 nLevel, const SvxBulletItem* pOldBullet, const SvxLRSpaceItem* pOldLRSpace );
static sal_Bool IsPrintable( sal_Unicode c ) { return ( ( c >= 32 ) && ( c != 127 ) ); }
static sal_Bool HasValidData( const ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::XTransferable >& rTransferable );
-
+ //IAccessibility2 Implementation 2009-----
+ virtual SdrObject* GetCurTextObj() { return NULL; }
+ //-----IAccessibility2 Implementation 2009
/** sets a link that is called at the beginning of a drag operation at an edit view */
void SetBeginDropHdl( const Link& rLink );
Link GetBeginDropHdl() const;
Modified: openoffice/branches/l10n40/main/editeng/inc/editeng/editrids.hrc
URL: http://svn.apache.org/viewvc/openoffice/branches/l10n40/main/editeng/inc/editeng/editrids.hrc?rev=1543609&r1=1543608&r2=1543609&view=diff
==============================================================================
--- openoffice/branches/l10n40/main/editeng/inc/editeng/editrids.hrc (original)
+++ openoffice/branches/l10n40/main/editeng/inc/editeng/editrids.hrc Tue Nov 19 22:39:40 2013
@@ -373,8 +373,10 @@
#define RID_STR_WORD (RID_EDIT_START + 313)
#define RID_SVXSTR_A11Y_IMAGEBULLET_DESCRIPTION (RID_EDIT_START + 314)
#define RID_SVXSTR_A11Y_IMAGEBULLET_NAME (RID_EDIT_START + 315)
+#define RID_SVXSTR_A11Y_PARAGRAPH_DESCRIPTION (RID_EDIT_START + 316)
+#define RID_SVXSTR_A11Y_PARAGRAPH_NAME (RID_EDIT_START + 317)
-#if 315 > (RID_EDIT_END-RID_EDIT_START)
+#if 317 > (RID_EDIT_END-RID_EDIT_START)
#error Resource-Ueberlauf in #line, #file
#endif
Modified: openoffice/branches/l10n40/main/editeng/inc/editeng/editview.hxx
URL: http://svn.apache.org/viewvc/openoffice/branches/l10n40/main/editeng/inc/editeng/editview.hxx?rev=1543609&r1=1543608&r2=1543609&view=diff
==============================================================================
--- openoffice/branches/l10n40/main/editeng/inc/editeng/editview.hxx (original)
+++ openoffice/branches/l10n40/main/editeng/inc/editeng/editview.hxx Tue Nov 19 22:39:40 2013
@@ -219,6 +219,10 @@ public:
sal_Bool IsCursorAtWrongSpelledWord( sal_Bool bMarkIfWrong = sal_False );
sal_Bool IsWrongSpelledWordAtPos( const Point& rPosPixel, sal_Bool bMarkIfWrong = sal_False );
+ //IAccessibility2 Implementation 2009-----
+ sal_Bool IsShapeParaFocusable( ) ;
+ sal_Bool WrongSpelledBreakPara(sal_Int32 nPara,sal_uInt16& nStartIndex, sal_uInt16& nEndIndex,sal_Int32 nIndex);
+ //-----IAccessibility2 Implementation 2009
void SpellIgnoreWord();
void ExecuteSpellPopup( const Point& rPosPixel, Link* pCallBack = 0 );
Modified: openoffice/branches/l10n40/main/editeng/inc/editeng/splwrap.hxx
URL: http://svn.apache.org/viewvc/openoffice/branches/l10n40/main/editeng/inc/editeng/splwrap.hxx?rev=1543609&r1=1543608&r2=1543609&view=diff
==============================================================================
--- openoffice/branches/l10n40/main/editeng/inc/editeng/splwrap.hxx (original)
+++ openoffice/branches/l10n40/main/editeng/inc/editeng/splwrap.hxx Tue Nov 19 22:39:40 2013
@@ -39,7 +39,8 @@ namespace com { namespace sun { namespac
}}}}
class Window;
-
+//IAccessibility2 Impplementaton 2009-----
+class SdrObject;
// misc functions ---------------------------------------------------------------
void EDITENG_DLLPUBLIC SvxPrepareAutoCorrect( String &rOldText, String &rNewText );
@@ -61,6 +62,8 @@ private:
::com::sun::star::linguistic2::XSpellChecker1 > xSpell;
::com::sun::star::uno::Reference<
::com::sun::star::linguistic2::XHyphenator > xHyph;
+//IAccessibility2 Impplementaton 2009-----
+ SdrObject* mpTextObj;
sal_uInt16 nOldLang; // Sprache merken, nur bei Aenderung SetLanguage rufen
sal_Bool bOtherCntnt : 1; // gesetzt => Sonderbereiche zunaechst pruefen
sal_Bool bDialog : 1; // Ist pWin der Svx...Dialog?
@@ -151,6 +154,10 @@ protected:
virtual void AutoCorrect( const String& rAktStr, const String& rNewStr );
virtual void InsertHyphen( const sal_uInt16 nPos ); // Hyphen einfuegen
+//IAccessibility2 Impplementaton 2009-----
+ void SetCurTextObj( SdrObject* pObj ) { mpTextObj = pObj; }
+ SdrObject* GetCurTextObj() { return mpTextObj; }
+//-----IAccessibility2 Impplementaton 2009
};
#endif
Modified: openoffice/branches/l10n40/main/editeng/inc/editeng/unoedhlp.hxx
URL: http://svn.apache.org/viewvc/openoffice/branches/l10n40/main/editeng/inc/editeng/unoedhlp.hxx?rev=1543609&r1=1543608&r2=1543609&view=diff
==============================================================================
--- openoffice/branches/l10n40/main/editeng/inc/editeng/unoedhlp.hxx (original)
+++ openoffice/branches/l10n40/main/editeng/inc/editeng/unoedhlp.hxx Tue Nov 19 22:39:40 2013
@@ -60,7 +60,17 @@ public:
void SetStartValue( sal_uLong n );
void SetEndValue( sal_uLong n );
};
-
+//IAccessibility2 Implementation 2009-----
+class SvxEditSourceHintEndPara :public SvxEditSourceHint
+{
+public:
+ TYPEINFO();
+ SvxEditSourceHintEndPara( sal_uInt32 nId )
+ :SvxEditSourceHint(nId) {}
+ SvxEditSourceHintEndPara( sal_uInt32 nId, sal_uInt32 nValue, sal_uInt32 nStart=0, sal_uInt32 nEnd=0 )
+ :SvxEditSourceHint(nId,nValue,nStart){ (void)nEnd; }
+};
+//-----IAccessibility2 Implementation 2009
/** Helper class for common functionality in edit sources
*/
class EDITENG_DLLPUBLIC SvxEditSourceHelper
@@ -97,7 +107,10 @@ public:
@return sal_True, if the range has been successfully determined
*/
- static sal_Bool GetAttributeRun( sal_uInt16& nStartIndex, sal_uInt16& nEndIndex, const EditEngine& rEE, sal_uInt16 nPara, sal_uInt16 nIndex );
+ //IAccessibility2 Implementation 2009-----
+ //static sal_Bool GetAttributeRun( USHORT& nStartIndex, USHORT& nEndIndex, const EditEngine& rEE, USHORT nPara, USHORT nIndex );
+ static sal_Bool GetAttributeRun( sal_uInt16& nStartIndex, sal_uInt16& nEndIndex, const EditEngine& rEE, sal_uInt16 nPara, sal_uInt16 nIndex, sal_Bool bInCell=sal_False );
+ //-----IAccessibility2 Implementation 2009
/** Convert point from edit engine to user coordinate space
Modified: openoffice/branches/l10n40/main/editeng/inc/editeng/unoedprx.hxx
URL: http://svn.apache.org/viewvc/openoffice/branches/l10n40/main/editeng/inc/editeng/unoedprx.hxx?rev=1543609&r1=1543608&r2=1543609&view=diff
==============================================================================
--- openoffice/branches/l10n40/main/editeng/inc/editeng/unoedprx.hxx (original)
+++ openoffice/branches/l10n40/main/editeng/inc/editeng/unoedprx.hxx Tue Nov 19 22:39:40 2013
@@ -74,9 +74,12 @@ public:
virtual OutputDevice* GetRefDevice() const;
virtual sal_Bool GetIndexAtPoint( const Point&, sal_uInt16& nPara, sal_uInt16& nIndex ) const;
virtual sal_Bool GetWordIndices( sal_uInt16 nPara, sal_uInt16 nIndex, sal_uInt16& nStart, sal_uInt16& nEnd ) const;
- virtual sal_Bool GetAttributeRun( sal_uInt16& nStartIndex, sal_uInt16& nEndIndex, sal_uInt16 nPara, sal_uInt16 nIndex ) const;
- virtual sal_uInt16 GetLineCount( sal_uInt16 nPara ) const;
- virtual sal_uInt16 GetLineLen( sal_uInt16 nPara, sal_uInt16 nLine ) const;
+ //IAccessibility2 Implementation 2009-----
+ virtual void SetUpdateModeForAcc( sal_Bool bUp);
+ virtual sal_Bool GetUpdateModeForAcc() const;
+ virtual sal_Bool GetAttributeRun( sal_uInt16& nStartIndex, sal_uInt16& nEndIndex, sal_uInt16 nPara, sal_uInt16 nIndex, sal_Bool bInCell = sal_False ) const;
+ virtual sal_uInt16 GetLineCount( sal_uInt16 nPara ) const;
+ virtual sal_uInt16 GetLineLen( sal_uInt16 nPara, sal_uInt16 nLine ) const;
virtual void GetLineBoundaries( /*out*/sal_uInt16 &rStart, /*out*/sal_uInt16 &rEnd, sal_uInt16 nParagraph, sal_uInt16 nLine ) const;
virtual sal_uInt16 GetLineNumberAtIndex( sal_uInt16 nPara, sal_uInt16 nIndex ) const;
Modified: openoffice/branches/l10n40/main/editeng/inc/editeng/unoedsrc.hxx
URL: http://svn.apache.org/viewvc/openoffice/branches/l10n40/main/editeng/inc/editeng/unoedsrc.hxx?rev=1543609&r1=1543608&r2=1543609&view=diff
==============================================================================
--- openoffice/branches/l10n40/main/editeng/inc/editeng/unoedsrc.hxx (original)
+++ openoffice/branches/l10n40/main/editeng/inc/editeng/unoedsrc.hxx Tue Nov 19 22:39:40 2013
@@ -219,7 +219,12 @@ public:
Index of paragraph to query bullet info on
*/
virtual EBulletInfo GetBulletInfo( sal_uInt16 nPara ) const = 0;
-
+//IAccessibility2 Implementation 2009-----
+ virtual String GetNumStr(sal_uInt16) const { return XubString();};
+ //IAccessible2 migration fix
+ virtual void SetUpdateModeForAcc( sal_Bool ) {};
+ virtual sal_Bool GetUpdateModeForAcc() const { return sal_True; };
+//-----IAccessibility2 Implementation 2009
/** Query the bounding rectangle of the given character
@param nPara[0 .. n]
@@ -331,7 +336,10 @@ public:
@return sal_True, if the range has been successfully determined
*/
- virtual sal_Bool GetAttributeRun( sal_uInt16& nStartIndex, sal_uInt16& nEndIndex, sal_uInt16 nPara, sal_uInt16 nIndex ) const = 0;
+ //IAccessibility2 Implementation 2009-----
+// virtual sal_Bool GetAttributeRun( sal_uInt16& nStartIndex, sal_uInt16& nEndIndex, sal_uInt16 nPara, sal_uInt16 nIndex ) const = 0;
+ virtual sal_Bool GetAttributeRun( sal_uInt16& nStartIndex, sal_uInt16& nEndIndex, sal_uInt16 nPara, sal_uInt16 nIndex, sal_Bool bInCell = sal_False ) const = 0;
+ //-----IAccessibility2 Implementation 2009
/** Query number of lines in the formatted paragraph
@@ -542,6 +550,11 @@ public:
*/
virtual sal_Bool Paste() = 0;
+//IAccessibility2 Implementation 2009-----
+ virtual sal_Bool IsWrongSpelledWordAtPos( sal_Int32, sal_Int32 ) { return sal_False; };
+ virtual sal_Bool IsShapeParaFocusable( ) { return sal_True; };
+ virtual sal_Bool BreakParaWrongList(sal_Int32, sal_uInt16&, sal_uInt16&, sal_Int32){ return sal_False; };
+//-----IAccessibility2 Implementation 2009
};
#endif
Modified: openoffice/branches/l10n40/main/editeng/inc/editeng/unofored.hxx
URL: http://svn.apache.org/viewvc/openoffice/branches/l10n40/main/editeng/inc/editeng/unofored.hxx?rev=1543609&r1=1543608&r2=1543609&view=diff
==============================================================================
--- openoffice/branches/l10n40/main/editeng/inc/editeng/unofored.hxx (original)
+++ openoffice/branches/l10n40/main/editeng/inc/editeng/unofored.hxx Tue Nov 19 22:39:40 2013
@@ -72,7 +72,10 @@ public:
virtual OutputDevice* GetRefDevice() const;
virtual sal_Bool GetIndexAtPoint( const Point&, sal_uInt16& nPara, sal_uInt16& nIndex ) const;
virtual sal_Bool GetWordIndices( sal_uInt16 nPara, sal_uInt16 nIndex, sal_uInt16& nStart, sal_uInt16& nEnd ) const;
- virtual sal_Bool GetAttributeRun( sal_uInt16& nStartIndex, sal_uInt16& nEndIndex, sal_uInt16 nPara, sal_uInt16 nIndex ) const;
+ //IAccessibility2 Implementation 2009-----
+// virtual sal_Bool GetAttributeRun( sal_uInt16& nStartIndex, sal_uInt16& nEndIndex, sal_uInt16 nPara, sal_uInt16 nIndex ) const;
+ virtual sal_Bool GetAttributeRun( sal_uInt16& nStartIndex, sal_uInt16& nEndIndex, sal_uInt16 nPara, sal_uInt16 nIndex, sal_Bool bInCell = sal_False ) const;
+ //-----IAccessibility2 Implementation 2009
virtual sal_uInt16 GetLineCount( sal_uInt16 nPara ) const;
virtual sal_uInt16 GetLineLen( sal_uInt16 nPara, sal_uInt16 nLine ) const;
virtual void GetLineBoundaries( /*out*/sal_uInt16 &rStart, /*out*/sal_uInt16 &rEnd, sal_uInt16 nParagraph, sal_uInt16 nLine ) const;
Modified: openoffice/branches/l10n40/main/editeng/inc/editeng/unoforou.hxx
URL: http://svn.apache.org/viewvc/openoffice/branches/l10n40/main/editeng/inc/editeng/unoforou.hxx?rev=1543609&r1=1543608&r2=1543609&view=diff
==============================================================================
--- openoffice/branches/l10n40/main/editeng/inc/editeng/unoforou.hxx (original)
+++ openoffice/branches/l10n40/main/editeng/inc/editeng/unoforou.hxx Tue Nov 19 22:39:40 2013
@@ -93,7 +93,10 @@ public:
virtual OutputDevice* GetRefDevice() const;
virtual sal_Bool GetIndexAtPoint( const Point&, sal_uInt16& nPara, sal_uInt16& nIndex ) const;
virtual sal_Bool GetWordIndices( sal_uInt16 nPara, sal_uInt16 nIndex, sal_uInt16& nStart, sal_uInt16& nEnd ) const;
- virtual sal_Bool GetAttributeRun( sal_uInt16& nStartIndex, sal_uInt16& nEndIndex, sal_uInt16 nPara, sal_uInt16 nIndex ) const;
+ //IAccessibility2 Implementation 2009-----
+// virtual sal_Bool GetAttributeRun( sal_uInt16& nStartIndex, sal_uInt16& nEndIndex, sal_uInt16 nPara, sal_uInt16 nIndex ) const;
+ virtual sal_Bool GetAttributeRun( sal_uInt16& nStartIndex, sal_uInt16& nEndIndex, sal_uInt16 nPara, sal_uInt16 nIndex, sal_Bool bInCell = sal_False ) const;
+ //-----IAccessibility2 Implementation 2009
virtual sal_uInt16 GetLineCount( sal_uInt16 nPara ) const;
virtual sal_uInt16 GetLineLen( sal_uInt16 nPara, sal_uInt16 nLine ) const;
virtual void GetLineBoundaries( /*out*/sal_uInt16 &rStart, /*out*/sal_uInt16 &rEnd, sal_uInt16 nPara, sal_uInt16 nLine ) const;
Modified: openoffice/branches/l10n40/main/editeng/inc/editeng/unotext.hxx
URL: http://svn.apache.org/viewvc/openoffice/branches/l10n40/main/editeng/inc/editeng/unotext.hxx?rev=1543609&r1=1543608&r2=1543609&view=diff
==============================================================================
--- openoffice/branches/l10n40/main/editeng/inc/editeng/unotext.hxx (original)
+++ openoffice/branches/l10n40/main/editeng/inc/editeng/unotext.hxx Tue Nov 19 22:39:40 2013
@@ -218,7 +218,10 @@ public:
virtual OutputDevice* GetRefDevice() const;
virtual sal_Bool GetIndexAtPoint( const Point&, sal_uInt16& nPara, sal_uInt16& nIndex ) const;
virtual sal_Bool GetWordIndices( sal_uInt16 nPara, sal_uInt16 nIndex, sal_uInt16& nStart, sal_uInt16& nEnd ) const;
- virtual sal_Bool GetAttributeRun( sal_uInt16& nStartIndex, sal_uInt16& nEndIndex, sal_uInt16 nPara, sal_uInt16 nIndex ) const;
+ //IAccessibility2 Implementation 2009-----
+// virtual sal_Bool GetAttributeRun( sal_uInt16& nStartIndex, sal_uInt16& nEndIndex, sal_uInt16 nPara, sal_uInt16 nIndex ) const;
+ virtual sal_Bool GetAttributeRun( sal_uInt16& nStartIndex, sal_uInt16& nEndIndex, sal_uInt16 nPara, sal_uInt16 nIndex, sal_Bool bInCell = sal_False ) const;
+ //-----IAccessibility2 Implementation 2009
virtual sal_uInt16 GetLineCount( sal_uInt16 nPara ) const;
virtual sal_uInt16 GetLineLen( sal_uInt16 nPara, sal_uInt16 nLine ) const;
virtual void GetLineBoundaries( /*out*/sal_uInt16 &rStart, /*out*/sal_uInt16 &rEnd, sal_uInt16 nParagraph, sal_uInt16 nLine ) const;