summaryrefslogtreecommitdiff
path: root/drawinglayer
diff options
context:
space:
mode:
authorRĂ¼diger Timm <rt@openoffice.org>2009-02-20 16:53:09 +0000
committerRĂ¼diger Timm <rt@openoffice.org>2009-02-20 16:53:09 +0000
commit6dd5fa4a48346ea9b7ff330204feb4f9817dca80 (patch)
treed27d85e19d059c9542c8764dda0126b7d38f428f /drawinglayer
parentd298d8fa1794ce97c4505d15cc7e06dc5d25f144 (diff)
CWS-TOOLING: integrate CWS aw063_OOO310
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
Diffstat (limited to 'drawinglayer')
-rw-r--r--drawinglayer/inc/drawinglayer/primitive2d/drawinglayer_primitivetypes2d.hxx25
-rw-r--r--drawinglayer/inc/drawinglayer/primitive2d/textdecoratedprimitive2d.hxx3
-rw-r--r--drawinglayer/inc/drawinglayer/primitive2d/texthierarchyprimitive2d.hxx25
-rw-r--r--drawinglayer/inc/drawinglayer/processor2d/vclprocessor2d.hxx2
-rw-r--r--drawinglayer/source/primitive2d/textdecoratedprimitive2d.cxx51
-rw-r--r--drawinglayer/source/primitive2d/texthierarchyprimitive2d.cxx17
-rw-r--r--drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx24
-rw-r--r--drawinglayer/source/processor2d/vclpixelprocessor2d.cxx63
-rw-r--r--drawinglayer/source/processor2d/vclprocessor2d.cxx53
9 files changed, 237 insertions, 26 deletions
diff --git a/drawinglayer/inc/drawinglayer/primitive2d/drawinglayer_primitivetypes2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/drawinglayer_primitivetypes2d.hxx
index a54fe3bb7b..44223c3ac3 100644
--- a/drawinglayer/inc/drawinglayer/primitive2d/drawinglayer_primitivetypes2d.hxx
+++ b/drawinglayer/inc/drawinglayer/primitive2d/drawinglayer_primitivetypes2d.hxx
@@ -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)
//////////////////////////////////////////////////////////////////////////////
diff --git a/drawinglayer/inc/drawinglayer/primitive2d/textdecoratedprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/textdecoratedprimitive2d.hxx
index c4c0fa09b3..6585e62178 100644
--- a/drawinglayer/inc/drawinglayer/primitive2d/textdecoratedprimitive2d.hxx
+++ b/drawinglayer/inc/drawinglayer/primitive2d/textdecoratedprimitive2d.hxx
@@ -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()
};
diff --git a/drawinglayer/inc/drawinglayer/primitive2d/texthierarchyprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/texthierarchyprimitive2d.hxx
index b554107196..685d3af57e 100644
--- a/drawinglayer/inc/drawinglayer/primitive2d/texthierarchyprimitive2d.hxx
+++ b/drawinglayer/inc/drawinglayer/primitive2d/texthierarchyprimitive2d.hxx
@@ -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
//////////////////////////////////////////////////////////////////////////////
diff --git a/drawinglayer/inc/drawinglayer/processor2d/vclprocessor2d.hxx b/drawinglayer/inc/drawinglayer/processor2d/vclprocessor2d.hxx
index 1ad23644d9..fcf8766dbf 100644
--- a/drawinglayer/inc/drawinglayer/processor2d/vclprocessor2d.hxx
+++ b/drawinglayer/inc/drawinglayer/processor2d/vclprocessor2d.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);
diff --git a/drawinglayer/source/primitive2d/textdecoratedprimitive2d.cxx b/drawinglayer/source/primitive2d/textdecoratedprimitive2d.cxx
index a253c81b17..b397314aee 100644
--- a/drawinglayer/source/primitive2d/textdecoratedprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/textdecoratedprimitive2d.cxx
@@ -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)
diff --git a/drawinglayer/source/primitive2d/texthierarchyprimitive2d.cxx b/drawinglayer/source/primitive2d/texthierarchyprimitive2d.cxx
index e782bfd252..ff5caffb91 100644
--- a/drawinglayer/source/primitive2d/texthierarchyprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/texthierarchyprimitive2d.cxx
@@ -146,4 +146,21 @@ namespace drawinglayer
} // 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
diff --git a/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx b/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx
index 723155a18b..d3e7ea172c 100644
--- a/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx
+++ b/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx
@@ -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
diff --git a/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx b/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx
index f4474f235d..5754e5a29c 100644
--- a/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx
+++ b/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx
@@ -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
diff --git a/drawinglayer/source/processor2d/vclprocessor2d.cxx b/drawinglayer/source/processor2d/vclprocessor2d.cxx
index 3d45998672..31e4919103 100644
--- a/drawinglayer/source/processor2d/vclprocessor2d.cxx
+++ b/drawinglayer/source/processor2d/vclprocessor2d.cxx
@@ -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()));