Kaydet (Commit) 85c70f37 authored tarafından Oliver Bolte's avatar Oliver Bolte

CWS-TOOLING: integrate CWS aw063

2009-02-12 13:10:24 +0100 aw  r267649 : #i99123# when a primitive is invisible, it is not sufficient to produce no output when decomposing, but to add invisible data using HitTestPrimitive2D. This is needed for the slideshow which relies on geometry data in MetaFiles when painting invisible objects
2009-02-12 13:08:39 +0100 aw  r267648 : #i99123# do not ignore HitTestPrimitive2D, but draw empty rectangles instead. This is needed since Slideshow is based on getting MetaFile content when painting invisible objects
2009-02-11 16:04:28 +0100 aw  r267620 : #i98788# made SfxItemPool destructor protected, added static ::Free method
2009-02-11 16:04:10 +0100 aw  r267619 : #i98788# made SfxItemPool destructor protected, added static ::Free method
2009-02-11 16:03:56 +0100 aw  r267618 : #i98788# made SfxItemPool destructor protected, added static ::Free method
2009-02-11 16:03:39 +0100 aw  r267617 : #i98788# made SfxItemPool destructor protected, added static ::Free method
2009-02-11 16:03:21 +0100 aw  r267615 : #i98788# made SfxItemPool destructor protected, added static ::Free method
2009-02-11 16:02:48 +0100 aw  r267614 : #i98788# made SfxItemPool destructor protected, added static ::Free method
2009-02-11 16:02:24 +0100 aw  r267613 : #i98788# made SfxItemPool destructor protected, added static ::Free method
2009-02-11 16:02:01 +0100 aw  r267612 : #i98788# made SfxItemPool destructor protected, added static ::Free method
2009-02-11 16:01:32 +0100 aw  r267611 : #i98788# made SfxItemPool destructor protected, added static ::Free method
2009-02-11 16:01:05 +0100 aw  r267610 : #i98788# made SfxItemPool destructor protected, added static ::Free method
2009-02-11 16:00:15 +0100 aw  r267608 : #i98788# made SfxItemPool destructor protected, added static ::Free method
2009-02-11 11:27:33 +0100 aw  r267585 : #i98788# added missing include for STL
2009-02-10 17:46:50 +0100 aw  r267570 : #i98788# added reaction on pool destruction
2009-02-10 17:11:58 +0100 aw  r267562 : #i98788# added messaging mechanism to register for pool destruction
2009-02-10 13:35:35 +0100 aw  r267549 : #i98788# removing changes, too complicated and risky for 3.1
2009-02-10 12:13:48 +0100 aw  r267546 : #i98788# 4th round
2009-02-10 12:13:37 +0100 aw  r267545 : #i98788# 4th round
2009-02-10 12:13:26 +0100 aw  r267544 : #i98788# 4th round
2009-02-10 12:13:14 +0100 aw  r267543 : #i98788# 4th round
2009-02-10 12:13:03 +0100 aw  r267542 : #i98788# 4th round
2009-02-10 12:12:50 +0100 aw  r267541 : #i98788# 4th round
2009-02-10 12:12:37 +0100 aw  r267540 : #i98788# 4th round
2009-02-08 14:38:22 +0100 aw  r267495 : #i98788# 3rd round of changes to SfxItemPool handling
2009-02-08 14:38:06 +0100 aw  r267494 : #i98788# 3rd round of changes to SfxItemPool handling
2009-02-08 14:37:48 +0100 aw  r267493 : #i98788# 3rd round of changes to SfxItemPool handling
2009-02-08 14:37:17 +0100 aw  r267492 : #i98788# 3rd round of changes to SfxItemPool handling
2009-02-08 14:36:56 +0100 aw  r267491 : #i98788# 3rd round of changes to SfxItemPool handling
2009-02-08 14:36:44 +0100 aw  r267490 : #i98788# 3rd round of changes to SfxItemPool handling
2009-02-08 14:36:29 +0100 aw  r267489 : #i98788# 3rd round of changes to SfxItemPool handling
2009-02-08 14:36:16 +0100 aw  r267488 : #i98788# 3rd round of changes to SfxItemPool handling
2009-02-08 14:36:02 +0100 aw  r267487 : #i98788# 3rd round of changes to SfxItemPool handling
2009-02-08 14:35:46 +0100 aw  r267486 : #i98788# 3rd round of changes to SfxItemPool handling
2009-02-05 12:20:39 +0100 aw  r267415 : #i98788# 2nd batch of adaptions for SfxItemPoolHolder addition
2009-02-04 15:12:54 +0100 aw  r267385 : #i98788# added newline at EOF
2009-02-04 13:26:04 +0100 aw  r267379 : #i98788# make SfxItemPool holdable
2009-02-04 13:25:40 +0100 aw  r267378 : #i98788# make SfxItemPool holdable
2009-02-04 13:25:08 +0100 aw  r267377 : #i98788# make SfxItemPool holdable
2009-02-04 13:24:42 +0100 aw  r267376 : #i98788# make SfxItemPool holdable
2009-02-04 13:23:14 +0100 aw  r267375 : #i98788# make SfxItemPool holdable
2009-02-04 13:23:02 +0100 aw  r267374 : #i98788# make SfxItemPool holdable
2009-01-29 17:08:31 +0100 aw  r267159 : #i97628# completed the fix
2009-01-29 17:08:15 +0100 aw  r267158 : #i97628# completed the fix
2009-01-29 14:09:07 +0100 aw  r267132 : #i97628# Corrected usage of ParagraphData in headers
2009-01-29 14:06:58 +0100 iha  r267131 : #i98344# incorrect font size in charts
2009-01-29 12:13:46 +0100 aw  r267115 : #i97628# back to old state; triggers too many errors in other modules
2009-01-29 12:03:51 +0100 aw  r267114 : #i97628# enabled exceptions due to STL vector include
2009-01-29 11:21:37 +0100 aw  r267107 : #i97628# added needed include
2009-01-28 17:58:29 +0100 aw  r267077 : #i97628# first version of newly implemented OutlinerParaObject and adaptions
2009-01-28 17:58:12 +0100 aw  r267076 : #i97628# first version of newly implemented OutlinerParaObject and adaptions
2009-01-28 17:57:51 +0100 aw  r267074 : #i97628# first version of newly implemented OutlinerParaObject and adaptions
2009-01-28 17:57:21 +0100 aw  r267073 : #i97628# first version of newly implemented OutlinerParaObject and adaptions
2009-01-27 17:07:33 +0100 aw  r267011 : #i98402# added support for ViewRange when exporting MetaFiles in ObjectContactOfPageView::DoProcessDisplay to avoid to paint too much
2009-01-27 11:45:48 +0100 aw  r266973 : #i98404# Added a warning to a place where a conversion to rectangle should not be copied from
2009-01-26 21:44:36 +0100 iha  r266949 : #i98497# 3D charts are rendered with wrong size
2009-01-26 20:47:07 +0100 aw  r266947 : #i98404# handle BackgroundColorPrimitive2D directly in PixelRenderers and avoid AA under all circumstances
2009-01-26 14:50:36 +0100 aw  r266926 : #i98386# secured cloning of SdrObject in IMapUserData by boost::shared_prt usage
2009-01-26 12:51:30 +0100 aw  r266916 : #i96581# added separated FontStretching and fallback for small X!=Y scale differences
2009-01-23 16:14:55 +0100 aw  r266834 : #i96475# added missing implementation of TextDecoratedPortionPrimitive2D::getB2DRange
2009-01-23 15:24:34 +0100 aw  r266826 : #i98405# fixed fallback to DrawAlphaRect to use the correctly sized rectangle
2009-01-23 13:34:43 +0100 aw  r266813 : #i96474# fixed impSplitSingleWords for an unexpected case
2009-01-23 10:47:31 +0100 aw  r266786 : #i98289#,#i96474# tooling and new flags for tasks
2009-01-23 10:47:20 +0100 aw  r266785 : #i98289#,#i96474# tooling and new flags for tasks
2009-01-23 10:47:09 +0100 aw  r266783 : #i98289#,#i96474# tooling and new flags for tasks
2009-01-23 10:46:58 +0100 aw  r266782 : #i98289#,#i96474# tooling and new flags for tasks
2009-01-23 10:46:48 +0100 aw  r266781 : #i98289#,#i96474# tooling and new flags for tasks
üst d76a0073
......@@ -89,18 +89,19 @@
#define PRIMITIVE2D_ID_TEXTHIERARCHYLINEPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 38)
#define PRIMITIVE2D_ID_TEXTHIERARCHYPARAGRAPHPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 39)
#define PRIMITIVE2D_ID_TEXTHIERARCHYBLOCKPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 40)
#define PRIMITIVE2D_ID_POLYGONWAVEPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 41)
#define PRIMITIVE2D_ID_WRONGSPELLPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 42)
#define PRIMITIVE2D_ID_TEXTEFFECTPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 43)
#define PRIMITIVE2D_ID_TEXTHIERARCHYBULLETPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 44)
#define PRIMITIVE2D_ID_POLYPOLYGONHAIRLINEPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 45)
#define PRIMITIVE2D_ID_EXECUTEPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 46)
#define PRIMITIVE2D_ID_PAGEPREVIEWPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 47)
#define PRIMITIVE2D_ID_CHARTPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 48)
#define PRIMITIVE2D_ID_STRUCTURETAGRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 49)
#define PRIMITIVE2D_ID_BORDERLINEPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 50)
#define PRIMITIVE2D_ID_POLYPOLYGONMARKERPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 51)
#define PRIMITIVE2D_ID_HITTESTPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 51)
#define PRIMITIVE2D_ID_TEXTHIERARCHYEDITPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 41)
#define PRIMITIVE2D_ID_POLYGONWAVEPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 42)
#define PRIMITIVE2D_ID_WRONGSPELLPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 43)
#define PRIMITIVE2D_ID_TEXTEFFECTPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 44)
#define PRIMITIVE2D_ID_TEXTHIERARCHYBULLETPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 45)
#define PRIMITIVE2D_ID_POLYPOLYGONHAIRLINEPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 46)
#define PRIMITIVE2D_ID_EXECUTEPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 47)
#define PRIMITIVE2D_ID_PAGEPREVIEWPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 48)
#define PRIMITIVE2D_ID_CHARTPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 49)
#define PRIMITIVE2D_ID_STRUCTURETAGRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 50)
#define PRIMITIVE2D_ID_BORDERLINEPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 51)
#define PRIMITIVE2D_ID_POLYPOLYGONMARKERPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 52)
#define PRIMITIVE2D_ID_HITTESTPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 53)
//////////////////////////////////////////////////////////////////////////////
......
......@@ -198,6 +198,9 @@ namespace drawinglayer
// compare operator
virtual bool operator==( const BasePrimitive2D& rPrimitive ) const;
// get range
virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const;
// provide unique ID
DeclPrimitrive2DIDBlock()
};
......
......@@ -164,6 +164,31 @@ namespace drawinglayer
//////////////////////////////////////////////////////////////////////////////
namespace drawinglayer
{
namespace primitive2d
{
// #i97628#
// Primitive to encapsulate text from an active text edit; some
// renderers need to suppress this output due to painting the
// edited text in e.g. an OutlinerEditView. It's derived from
// GroupPrimitive2D, so the implicit decomposition will use the
// content. To suppress, this primitive needs to be parsed by
// the renderer without taking any action
class TextHierarchyEditPrimitive2D : public GroupPrimitive2D
{
private:
public:
TextHierarchyEditPrimitive2D(const Primitive2DSequence& rChildren);
// provide unique ID
DeclPrimitrive2DIDBlock()
};
} // end of namespace primitive2d
} // end of namespace drawinglayer
//////////////////////////////////////////////////////////////////////////////
#endif //INCLUDED_DRAWINGLAYER_PRIMITIVE2D_TEXTHIERARCHYPRIMITIVE2D_HXX
//////////////////////////////////////////////////////////////////////////////
......
......@@ -96,7 +96,7 @@ namespace drawinglayer
// common VCL rendering support
void RenderTextSimpleOrDecoratedPortionPrimitive2D(const primitive2d::TextSimplePortionPrimitive2D& rTextCandidate);
void RenderPolygonHairlinePrimitive2D(const primitive2d::PolygonHairlinePrimitive2D& rPolygonCandidate);
void RenderPolygonHairlinePrimitive2D(const primitive2d::PolygonHairlinePrimitive2D& rPolygonCandidate, bool bPixelBased);
void RenderBitmapPrimitive2D(const primitive2d::BitmapPrimitive2D& rBitmapCandidate);
void RenderFillBitmapPrimitive2D(const primitive2d::FillBitmapPrimitive2D& rFillBitmapCandidate);
void RenderPolyPolygonGradientPrimitive2D(const primitive2d::PolyPolygonGradientPrimitive2D& rPolygonCandidate);
......
......@@ -186,7 +186,7 @@ namespace drawinglayer
if(bWaveLine)
{
eLineJoin = basegfx::B2DLINEJOIN_ROUND;
fLineHeight *= 0.5;
fLineHeight *= 0.25;
}
// prepare Line and Stroke Attributes
......@@ -215,7 +215,7 @@ namespace drawinglayer
if(bWaveLine)
{
double fWaveWidth(4.0 * fLineHeight);
double fWaveWidth(10.6 * fLineHeight);
if(FONT_UNDERLINE_SMALLWAVE == eLineStyle)
{
......@@ -227,7 +227,7 @@ namespace drawinglayer
fWaveWidth *= 2.0;
}
aNewPrimitive = Primitive2DReference(new PolygonWavePrimitive2D(aLine, aLineAttribute, aStrokeAttribute, fWaveWidth, 0.5 * fWaveWidth));
aNewPrimitive = Primitive2DReference(new PolygonWavePrimitive2D(aLine, aLineAttribute, aStrokeAttribute, fWaveWidth, fWaveWidth * 0.5));
}
else
{
......@@ -241,7 +241,13 @@ namespace drawinglayer
{
// double line, create 2nd primitive with offset using TransformPrimitive based on
// already created NewPrimitive
const double fLineDist((bWaveLine ? 3.0 : 2.0) * fLineHeight);
double fLineDist(2.3 * fLineHeight);
if(bWaveLine)
{
fLineDist = 6.3 * fLineHeight;
}
basegfx::B2DHomMatrix aTransform;
// move base point of text to 0.0 and de-rotate
......@@ -482,6 +488,16 @@ namespace drawinglayer
// init word iterator, get first word and truncate to possibilities
::com::sun::star::i18n::Boundary aNextWordBoundary(xLocalBreakIterator->getWordBoundary(
getText(), getTextPosition(), getLocale(), ::com::sun::star::i18n::WordType::ANYWORD_IGNOREWHITESPACES, sal_True));
if(aNextWordBoundary.endPos == getTextPosition() && getTextLength() > 0)
{
// #i96474#
// a word before was found (this can happen when search starts on a whitespace and a word
// in front of it exists), force to look one position further
aNextWordBoundary = xLocalBreakIterator->getWordBoundary(
getText(), getTextPosition() + 1, getLocale(), ::com::sun::star::i18n::WordType::ANYWORD_IGNOREWHITESPACES, sal_True);
}
impCorrectTextBoundary(aNextWordBoundary);
// prepare new font attributes WITHOUT outline
......@@ -791,6 +807,33 @@ namespace drawinglayer
return false;
}
// #i96475#
// Added missing implementation. Decorations may (will) stick out of the text's
// inking area, so add them if needed
basegfx::B2DRange TextDecoratedPortionPrimitive2D::getB2DRange(const geometry::ViewInformation2D& rViewInformation) const
{
const bool bDecoratedIsNeeded(
FONT_UNDERLINE_NONE != getFontOverline()
|| FONT_UNDERLINE_NONE != getFontUnderline()
|| FONT_STRIKEOUT_NONE != getFontStrikeout()
|| FONT_EMPHASISMARK_NONE != getFontEmphasisMark()
|| FONT_RELIEF_NONE != getFontRelief()
|| getShadow());
if(bDecoratedIsNeeded)
{
// decoration is used, fallback to BasePrimitive2D::getB2DRange which uses
// the own local decomposition for computation and thus creates all necessary
// geometric objects
return BasePrimitive2D::getB2DRange(rViewInformation);
}
else
{
// no relevant decoration used, fallback to TextSimplePortionPrimitive2D::getB2DRange
return TextSimplePortionPrimitive2D::getB2DRange(rViewInformation);
}
}
// provide unique ID
ImplPrimitrive2DIDBlock(TextDecoratedPortionPrimitive2D, PRIMITIVE2D_ID_TEXTDECORATEDPORTIONPRIMITIVE2D)
......
......@@ -145,5 +145,22 @@ namespace drawinglayer
} // end of namespace primitive2d
} // end of namespace drawinglayer
//////////////////////////////////////////////////////////////////////////////
namespace drawinglayer
{
namespace primitive2d
{
TextHierarchyEditPrimitive2D::TextHierarchyEditPrimitive2D(const Primitive2DSequence& rChildren)
: GroupPrimitive2D(rChildren)
{
}
// provide unique ID
ImplPrimitrive2DIDBlock(TextHierarchyEditPrimitive2D, PRIMITIVE2D_ID_TEXTHIERARCHYEDITPRIMITIVE2D)
} // end of namespace primitive2d
} // end of namespace drawinglayer
//////////////////////////////////////////////////////////////////////////////
// eof
......@@ -73,6 +73,7 @@
#include <basegfx/polygon/b2dpolygontools.hxx>
#include <drawinglayer/primitive2d/pagepreviewprimitive2d.hxx>
#include <helperchartrenderer.hxx>
#include <drawinglayer/primitive2d/hittestprimitive2d.hxx>
//////////////////////////////////////////////////////////////////////////////
// for PDFExtOutDevData Graphic support
......@@ -983,7 +984,7 @@ namespace drawinglayer
SvtGraphicStroke* pSvtGraphicStroke = impTryToCreateSvtGraphicStroke(rHairlinePrimitive.getB2DPolygon(), &aLineColor, 0, 0, 0, 0);
impStartSvtGraphicStroke(pSvtGraphicStroke);
RenderPolygonHairlinePrimitive2D(static_cast< const primitive2d::PolygonHairlinePrimitive2D& >(rCandidate));
RenderPolygonHairlinePrimitive2D(static_cast< const primitive2d::PolygonHairlinePrimitive2D& >(rCandidate), false);
impEndSvtGraphicStroke(pSvtGraphicStroke);
break;
}
......@@ -1652,6 +1653,27 @@ namespace drawinglayer
break;
}
case PRIMITIVE2D_ID_HITTESTPRIMITIVE2D :
{
// #i99123#
// invisible primitive; to rebuilt the old MetaFile creation, it is necessary to
// not ignore them (as it was thought), but to add a MetaFile entry for them.
basegfx::B2DRange aInvisibleRange(rCandidate.getB2DRange(getViewInformation2D()));
if(!aInvisibleRange.isEmpty())
{
aInvisibleRange.transform(maCurrentTransformation);
const Rectangle aRectLogic(
(sal_Int32)floor(aInvisibleRange.getMinX()), (sal_Int32)floor(aInvisibleRange.getMinY()),
(sal_Int32)ceil(aInvisibleRange.getMaxX()), (sal_Int32)ceil(aInvisibleRange.getMaxY()));
mpOutputDevice->SetFillColor();
mpOutputDevice->SetLineColor();
mpOutputDevice->DrawRect(aRectLogic);
}
break;
}
default :
{
// process recursively
......
......@@ -65,6 +65,7 @@
#include <tools/diagnose_ex.h>
#include <com/sun/star/awt/PosSize.hpp>
#include <cstdio>
#include <drawinglayer/primitive2d/backgroundcolorprimitive2d.hxx>
//////////////////////////////////////////////////////////////////////////////
......@@ -139,13 +140,13 @@ namespace drawinglayer
case PRIMITIVE2D_ID_TEXTSIMPLEPORTIONPRIMITIVE2D :
{
// directdraw of text simple portion; added test possibility to check text decompose
static bool bHandleSimpleTextDirectly(true);
static bool bForceSimpleTextDecomposition(false);
// Adapt evtl. used special DrawMode
const sal_uInt32 nOriginalDrawMode(mpOutputDevice->GetDrawMode());
adaptTextToFillDrawMode();
if(bHandleSimpleTextDirectly)
if(!bForceSimpleTextDecomposition && getOptionsDrawinglayer().IsRenderSimpleTextDirect())
{
RenderTextSimpleOrDecoratedPortionPrimitive2D(static_cast< const primitive2d::TextSimplePortionPrimitive2D& >(rCandidate));
}
......@@ -162,13 +163,13 @@ namespace drawinglayer
case PRIMITIVE2D_ID_TEXTDECORATEDPORTIONPRIMITIVE2D :
{
// directdraw of text simple portion; added test possibility to check text decompose
static bool bHandleComplexTextDirectly(false);
static bool bForceComplexTextDecomposition(false);
// Adapt evtl. used special DrawMode
const sal_uInt32 nOriginalDrawMode(mpOutputDevice->GetDrawMode());
adaptTextToFillDrawMode();
if(bHandleComplexTextDirectly)
if(!bForceComplexTextDecomposition && getOptionsDrawinglayer().IsRenderDecoratedTextDirect())
{
RenderTextSimpleOrDecoratedPortionPrimitive2D(static_cast< const primitive2d::TextSimplePortionPrimitive2D& >(rCandidate));
}
......@@ -185,7 +186,7 @@ namespace drawinglayer
case PRIMITIVE2D_ID_POLYGONHAIRLINEPRIMITIVE2D :
{
// direct draw of hairline
RenderPolygonHairlinePrimitive2D(static_cast< const primitive2d::PolygonHairlinePrimitive2D& >(rCandidate));
RenderPolygonHairlinePrimitive2D(static_cast< const primitive2d::PolygonHairlinePrimitive2D& >(rCandidate), true);
break;
}
case PRIMITIVE2D_ID_BITMAPPRIMITIVE2D :
......@@ -224,8 +225,23 @@ namespace drawinglayer
}
case PRIMITIVE2D_ID_METAFILEPRIMITIVE2D :
{
// #i98289#
const bool bForceLineSnap(getOptionsDrawinglayer().IsAntiAliasing() && getOptionsDrawinglayer().IsSnapHorVerLinesToDiscrete());
const sal_uInt16 nOldAntiAliase(mpOutputDevice->GetAntialiasing());
if(bForceLineSnap)
{
mpOutputDevice->SetAntialiasing(nOldAntiAliase | ANTIALIASING_PIXELSNAPHAIRLINE);
}
// direct draw of MetaFile
RenderMetafilePrimitive2D(static_cast< const primitive2d::MetafilePrimitive2D& >(rCandidate));
if(bForceLineSnap)
{
mpOutputDevice->SetAntialiasing(nOldAntiAliase);
}
break;
}
case PRIMITIVE2D_ID_MASKPRIMITIVE2D :
......@@ -479,6 +495,43 @@ namespace drawinglayer
}
break;
}
case PRIMITIVE2D_ID_BACKGROUNDCOLORPRIMITIVE2D :
{
// #i98404# Handle directly, especially when AA is active
const primitive2d::BackgroundColorPrimitive2D& rPrimitive = static_cast< const primitive2d::BackgroundColorPrimitive2D& >(rCandidate);
const sal_uInt16 nOriginalAA(mpOutputDevice->GetAntialiasing());
// switch AA off in all cases
mpOutputDevice->SetAntialiasing(mpOutputDevice->GetAntialiasing() & ~ANTIALIASING_ENABLE_B2DDRAW);
// create color for fill
const basegfx::BColor aPolygonColor(maBColorModifierStack.getModifiedColor(rPrimitive.getBColor()));
mpOutputDevice->SetFillColor(Color(aPolygonColor));
mpOutputDevice->SetLineColor();
// create rectangle for fill
const basegfx::B2DRange& aViewport(getViewInformation2D().getDiscreteViewport());
const Rectangle aRectangle(
(sal_Int32)floor(aViewport.getMinX()), (sal_Int32)floor(aViewport.getMinY()),
(sal_Int32)ceil(aViewport.getMaxX()), (sal_Int32)ceil(aViewport.getMaxY()));
mpOutputDevice->DrawRect(aRectangle);
// restore AA setting
mpOutputDevice->SetAntialiasing(nOriginalAA);
break;
}
case PRIMITIVE2D_ID_TEXTHIERARCHYEDITPRIMITIVE2D :
{
// #i97628#
// This primitive means that the content is derived from an active text edit,
// not from model data itself. Some renderers need to suppress this content, e.g.
// the pixel renderer used for displaying the edit view (like this one). It's
// not to be suppressed by the MetaFile renderers, so that the edited text is
// part of the MetaFile, e.g. needed for presentation previews.
// Action: Ignore here, do nothing.
break;
}
default :
{
// process recursively
......
......@@ -66,6 +66,7 @@
#include <vcl/svapp.hxx>
#include <drawinglayer/primitive2d/pagepreviewprimitive2d.hxx>
#include <tools/diagnose_ex.h>
#include <vcl/metric.hxx>
//////////////////////////////////////////////////////////////////////////////
// control support
......@@ -158,9 +159,42 @@ namespace drawinglayer
if(basegfx::fTools::more(aScale.getX(), 0.0) && basegfx::fTools::more(aScale.getY(), 0.0))
{
// prepare everything that is not sheared and mirrored
// #i96581# Get the font forced without FontStretching (use FontHeight as FontWidth)
Font aFont(primitive2d::getVclFontFromFontAttributes(
rTextCandidate.getFontAttributes(), aScale.getX(), aScale.getY(), fRotate, *mpOutputDevice));
rTextCandidate.getFontAttributes(),
aScale.getY(),
aScale.getY(),
fRotate,
*mpOutputDevice));
if(!basegfx::fTools::equal(aScale.getX(), aScale.getY()))
{
// #i96581# font stretching is needed; examine how big the difference between X and Y scaling is
const double fPercent(fabs(1.0 - (aScale.getX() / aScale.getY())));
static double fMaximumAcceptedPercent(0.05);
static bool bForceAdaption(false);
if(bForceAdaption || fPercent > fMaximumAcceptedPercent)
{
// #i96581# Need to adapt to a FontStretching bigger than acceptable maximum.
// Get font's real width using FontMetric and adapt font to stretched
// font
const FontMetric aFontMetric(mpOutputDevice->GetFontMetric(aFont));
const double fRealFontWidth(aFontMetric.GetWidth());
aFont = primitive2d::getVclFontFromFontAttributes(
rTextCandidate.getFontAttributes(),
fRealFontWidth,
aScale.getY(),
fRotate,
*mpOutputDevice);
}
else
{
// #i96581# less than allowed maximum (probably SC's generated MapModes). React
// pragmatically by ignoring the stretching up to this point
}
}
// handle additional font attributes
const primitive2d::TextDecoratedPortionPrimitive2D* pTCPP =
......@@ -317,7 +351,7 @@ namespace drawinglayer
}
// direct draw of hairline
void VclProcessor2D::RenderPolygonHairlinePrimitive2D(const primitive2d::PolygonHairlinePrimitive2D& rPolygonCandidate)
void VclProcessor2D::RenderPolygonHairlinePrimitive2D(const primitive2d::PolygonHairlinePrimitive2D& rPolygonCandidate, bool bPixelBased)
{
const basegfx::BColor aHairlineColor(maBColorModifierStack.getModifiedColor(rPolygonCandidate.getBColor()));
mpOutputDevice->SetLineColor(Color(aHairlineColor));
......@@ -325,6 +359,17 @@ namespace drawinglayer
basegfx::B2DPolygon aLocalPolygon(rPolygonCandidate.getB2DPolygon());
aLocalPolygon.transform(maCurrentTransformation);
if(bPixelBased && getOptionsDrawinglayer().IsAntiAliasing() && getOptionsDrawinglayer().IsSnapHorVerLinesToDiscrete())
{
// #i98289#
// when a Hairline is painted and AntiAliasing is on the option SnapHorVerLinesToDiscrete
// allows to suppress AntiAliasing for pure horizontal or vertical lines. This is done since
// not-AntiAliased such lines look more pleasing to the eye (e.g. 2D chart content). This
// NEEDS to be done in discrete coordinates, so only useful for pixel based rendering.
aLocalPolygon = basegfx::tools::snapPointsOfHorizontalOrVerticalEdges(aLocalPolygon);
}
mpOutputDevice->DrawPolyLine(aLocalPolygon, 0.0);
}
......@@ -623,6 +668,8 @@ namespace drawinglayer
// units e.g. when creating a new MetaFile, but since much huger value ranges are used
// there typically will be okay for this compromize.
Rectangle aDestRectView(
// !!CAUTION!! Here, ceil and floor are exchanged BY PURPOSE, do NOT copy when
// looking for a standard conversion to rectangle (!)
(sal_Int32)ceil(aOutlineRange.getMinX()), (sal_Int32)ceil(aOutlineRange.getMinY()),
(sal_Int32)floor(aOutlineRange.getMaxX()), (sal_Int32)floor(aOutlineRange.getMaxY()));
......
......@@ -1106,6 +1106,46 @@ Dymamic border coloring means that when the mouse is hovered over a control, and
</info>
<value>true</value>
</prop>
<prop oor:name="SnapHorVerLinesToDiscrete" oor:type="xs:boolean">
<info>
<author>AW</author>
<desc>
This switch allows to enhance visualisation of graphics which use Horizontal or Vertical Hairlines
combined with AntiAliased mode (e.g. in 2D charts). When not used, those lines will be AntiAliased
as everything else. Since this is not pleasing for the eye, this option allows to force those lines
to snap to discrete points (pixels) when activated and thus avoids AntiAliasing of pure Horizontal or
Vertical Hairlines.
</desc>
<label>Determines if Horizontal and Vertical HairLines in AntiAliased mode are snapped to discrete pixles to enhance visualisation</label>
</info>
<value>true</value>
</prop>
<prop oor:name="RenderDecoratedTextDirect" oor:type="xs:boolean">
<info>
<author>AW</author>
<desc>
This switch determines if the decorations of decorated text portions (e.g. underline, strike through)
are rendered using VCL direct rendering or if the primitive is decomposed into simple text and the
corresponding geometrical representations of the decorations. Default is true since VCL's usage
of the diverse System's hinting possibilities for decorations is useful.
</desc>
<label>Determines if decorated texts are decomposed at render time or directly rendered using VCL</label>
</info>
<value>true</value>
</prop>
<prop oor:name="RenderSimpleTextDirect" oor:type="xs:boolean">
<info>
<author>AW</author>
<desc>
This switch determines if simple text is directly rendered using VCL or not. If not, the simple text
is decomposed into PolyPolygons which will be painted then. Default is true, since VCL will use the
hinting for font rendering on the diverse supported systems, which gives better quality than rendering
the text as Polygons.
</desc>
<label>Determines if simple texts are decomposed at render time or directly rendered using VCL</label>
</info>
<value>true</value>
</prop>
<prop oor:name="SolidDragCreate" oor:type="xs:boolean">
<info>
<author>AW</author>
......
......@@ -89,6 +89,7 @@ class SvxForbiddenCharactersTable;
#include <vos/ref.hxx>
#include <svx/svxfont.hxx>
#include <svx/eedata.hxx>
#include <svx/paragraphdata.hxx>
class SvxFieldData;
//////////////////////////////////////////////////////////////////////////////
......@@ -122,25 +123,6 @@ namespace basegfx { class B2DPolyPolygon; }
// #define OLUNDO_MOVEPARAGRAPHS EDITUNDO_USER+7
#define OLUNDO_CHECKPARA EDITUNDO_USER+8
// MT 07/00: Only for internal use, oder some kind like hPara for the few
// functions where you need it outside ( eg. moving paragraphs... )
class ParagraphData
{
friend class Paragraph;
friend class OutlinerParaObject;
protected:
sal_Int16 nDepth;
sal_Int16 mnNumberingStartValue;
sal_Bool mbParaIsNumberingRestart;
public:
ParagraphData( const ParagraphData& );
ParagraphData();
ParagraphData& operator=( const ParagraphData& );
};
class Paragraph : protected ParagraphData
{
private:
......
......@@ -31,61 +31,66 @@
#ifndef _OUTLOBJ_HXX
#define _OUTLOBJ_HXX
//////////////////////////////////////////////////////////////////////////////
#include <tools/solar.h>
#include <tools/string.hxx>
#include <rsc/rscsfx.hxx>
#include <svtools/itemset.hxx>
#include <svx/paragraphdata.hxx>
#include "svx/svxdllapi.h"
#include <svx/eeitem.hxx>
class Outliner;
class EditTextObject;
class SvStream;
class SfxItemPool;
class SfxStyleSheetPool;
class ParagraphData;
class ImplOutlinerParaObject;
//////////////////////////////////////////////////////////////////////////////
class SVX_DLLPUBLIC OutlinerParaObject
{
friend class Outliner;
private:
ImplOutlinerParaObject* mpImplOutlinerParaObject;
EditTextObject* pText;
ParagraphData* pParagraphDataArr;
sal_uInt32 nCount;
BOOL bIsEditDoc;
OutlinerParaObject( USHORT nParaCount );
void ImplMakeUnique();
public:
OutlinerParaObject( const OutlinerParaObject& );
OutlinerParaObject( const EditTextObject& rTObj );
~OutlinerParaObject();
// constructors/destructor
OutlinerParaObject(
const EditTextObject& rEditTextObject,
const ParagraphDataVector& rParagraphDataVector = ParagraphDataVector(),
bool bIsEditDoc = true);
OutlinerParaObject(const OutlinerParaObject& rCandidate);
~OutlinerParaObject();
OutlinerParaObject* Clone() const;
// assignment operator
OutlinerParaObject& operator=(const OutlinerParaObject& rCandidate);
USHORT GetOutlinerMode() const;
void SetOutlinerMode( USHORT n );
// compare operator
bool operator==(const OutlinerParaObject& rCandidate) const;
bool operator!=(const OutlinerParaObject& rCandidate) const { return !operator==(rCandidate); }
BOOL IsVertical() const;
void SetVertical( BOOL bVertical );
// outliner mode access
sal_uInt16 GetOutlinerMode() const;
void SetOutlinerMode(sal_uInt16 nNew);
sal_uInt32 Count() const { return nCount; }
sal_Int16 GetDepth( USHORT nPara ) const;
const EditTextObject& GetTextObject() const { return *pText; }
void ClearPortionInfo();
BOOL IsEditDoc() const { return bIsEditDoc; }
void Store( SvStream& ) const;
static OutlinerParaObject* Create( SvStream&, SfxItemPool* pTextObjectPool = 0 );
// vertical access
bool IsVertical() const;
void SetVertical(bool bNew);
BOOL ChangeStyleSheets( const XubString& rOldName, SfxStyleFamily eOldFamily,
const XubString& rNewName, SfxStyleFamily eNewFamily );
void ChangeStyleSheetName( SfxStyleFamily eFamily, const XubString& rOldName, const XubString& rNewName );
void SetStyleSheets( USHORT nLevel, const XubString rNewName, const SfxStyleFamily& rNewFamily );
// data read access
sal_uInt32 Count() const;
sal_Int16 GetDepth(sal_uInt16 nPara) const;
const EditTextObject& GetTextObject() const;
bool IsEditDoc() const;
const ParagraphData& GetParagraphData(sal_uInt32 nIndex) const;
BOOL RemoveCharAttribs( USHORT nWhich = 0 );
BOOL RemoveParaAttribs( USHORT nWhich = 0 );
// portion info support
void ClearPortionInfo();
void MergeParaAttribs( const SfxItemSet& rAttribs, USHORT nStart = EE_CHAR_START, USHORT nEnd = EE_CHAR_END );
// StyleSheet support
bool ChangeStyleSheets(const XubString& rOldName, SfxStyleFamily eOldFamily, const XubString& rNewName, SfxStyleFamily eNewFamily);
void ChangeStyleSheetName(SfxStyleFamily eFamily, const XubString& rOldName, const XubString& rNewName);
void SetStyleSheets(sal_uInt16 nLevel, const XubString rNewName, const SfxStyleFamily& rNewFamily);
};
//////////////////////////////////////////////////////////////////////////////
#endif
/*************************************************************************
*
* 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: outlobj.hxx,v $
* $Revision: 1.5.78.1 $
*
* 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 _PARAGRAPH_DATA_HXX
#define _PARAGRAPH_DATA_HXX
#include <tools/solar.h>
#include <vector>
//////////////////////////////////////////////////////////////////////////////
// MT 07/00: Only for internal use, oder some kind like hPara for the few
// functions where you need it outside ( eg. moving paragraphs... )
//
// AW: Unfortunately NOT only local (formally in outliner.hxx), but also
// used in outlobj.hxx. Moved to own header
class ParagraphData
{