summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOliver Bolte <obo@openoffice.org>2009-03-04 14:16:02 +0000
committerOliver Bolte <obo@openoffice.org>2009-03-04 14:16:02 +0000
commit75cd27aef3bfa19c93d54d8536ac92aac6f34802 (patch)
tree223ab1e4daa4607fec63aa55e7dad11bcb58f54f
parent99c3f97c8377d6406ee02b196e80ff4c071d3105 (diff)
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
-rw-r--r--basegfx/inc/basegfx/polygon/b2dpolygontools.hxx14
-rw-r--r--basegfx/source/polygon/b2dpolygontools.cxx60
-rw-r--r--svtools/inc/svtools/itempool.hxx21
-rw-r--r--svtools/inc/svtools/optionsdrawinglayer.hxx6
-rw-r--r--svtools/source/config/optionsdrawinglayer.cxx144
-rw-r--r--svtools/source/items/style.cxx5
-rw-r--r--svtools/source/items1/itempool.cxx44
-rw-r--r--vcl/inc/vcl/outdev.hxx1
-rw-r--r--vcl/source/gdi/outdev.cxx42
-rw-r--r--vcl/source/gdi/outdev6.cxx18
10 files changed, 325 insertions, 30 deletions
diff --git a/basegfx/inc/basegfx/polygon/b2dpolygontools.hxx b/basegfx/inc/basegfx/polygon/b2dpolygontools.hxx
index 45423ace62c6..5eff6b0b9cc1 100644
--- a/basegfx/inc/basegfx/polygon/b2dpolygontools.hxx
+++ b/basegfx/inc/basegfx/polygon/b2dpolygontools.hxx
@@ -574,6 +574,20 @@ namespace basegfx
bool equal(const B2DPolygon& rCandidateA, const B2DPolygon& rCandidateB, const double& rfSmallValue);
bool equal(const B2DPolygon& rCandidateA, const B2DPolygon& rCandidateB);
+ /** snap some polygon coordinates to discrete coordinates
+
+ This method allows to snap some polygon points to discrete (integer) values
+ which equals e.g. a snap to discrete coordinates. It will snap points of
+ horizontal and vertical edges
+
+ @param rCandidate
+ The source polygon
+
+ @return
+ The modified version of the source polygon
+ */
+ B2DPolygon snapPointsOfHorizontalOrVerticalEdges(const B2DPolygon& rCandidate);
+
} // end of namespace tools
} // end of namespace basegfx
diff --git a/basegfx/source/polygon/b2dpolygontools.cxx b/basegfx/source/polygon/b2dpolygontools.cxx
index f4d1f992ad6b..c1e5dc80d8c4 100644
--- a/basegfx/source/polygon/b2dpolygontools.cxx
+++ b/basegfx/source/polygon/b2dpolygontools.cxx
@@ -3553,6 +3553,66 @@ namespace basegfx
return equal(rCandidateA, rCandidateB, fSmallValue);
}
+ // snap points of horizontal or vertical edges to discrete values
+ B2DPolygon snapPointsOfHorizontalOrVerticalEdges(const B2DPolygon& rCandidate)
+ {
+ const sal_uInt32 nPointCount(rCandidate.count());
+
+ if(nPointCount > 1)
+ {
+ // Start by copying the source polygon to get a writeable copy. The closed state is
+ // copied by aRetval's initialisation, too, so no need to copy it in this method
+ B2DPolygon aRetval(rCandidate);
+
+ // prepare geometry data. Get rounded from original
+ B2ITuple aPrevTuple(basegfx::fround(rCandidate.getB2DPoint(nPointCount - 1)));
+ B2DPoint aCurrPoint(rCandidate.getB2DPoint(0));
+ B2ITuple aCurrTuple(basegfx::fround(aCurrPoint));
+
+ // loop over all points. This will also snap the implicit closing edge
+ // even when not closed, but that's no problem here
+ for(sal_uInt32 a(0); a < nPointCount; a++)
+ {
+ // get next point. Get rounded from original
+ const bool bLastRun(a + 1 == nPointCount);
+ const sal_uInt32 nNextIndex(bLastRun ? 0 : a + 1);
+ const B2DPoint aNextPoint(rCandidate.getB2DPoint(nNextIndex));
+ const B2ITuple aNextTuple(basegfx::fround(aNextPoint));
+
+ // get the states
+ const bool bPrevVertical(aPrevTuple.getX() == aCurrTuple.getX());
+ const bool bNextVertical(aNextTuple.getX() == aCurrTuple.getX());
+ const bool bPrevHorizontal(aPrevTuple.getY() == aCurrTuple.getY());
+ const bool bNextHorizontal(aNextTuple.getY() == aCurrTuple.getY());
+ const bool bSnapX(bPrevVertical || bNextVertical);
+ const bool bSnapY(bPrevHorizontal || bNextHorizontal);
+
+ if(bSnapX || bSnapY)
+ {
+ const B2DPoint aSnappedPoint(
+ bSnapX ? aCurrTuple.getX() : aCurrPoint.getX(),
+ bSnapY ? aCurrTuple.getY() : aCurrPoint.getY());
+
+ aRetval.setB2DPoint(a, aSnappedPoint);
+ }
+
+ // prepare next point
+ if(!bLastRun)
+ {
+ aPrevTuple = aCurrTuple;
+ aCurrPoint = aNextPoint;
+ aCurrTuple = aNextTuple;
+ }
+ }
+
+ return aRetval;
+ }
+ else
+ {
+ return rCandidate;
+ }
+ }
+
} // end of namespace tools
} // end of namespace basegfx
diff --git a/svtools/inc/svtools/itempool.hxx b/svtools/inc/svtools/itempool.hxx
index 3b08b44aece5..81407cee2d0c 100644
--- a/svtools/inc/svtools/itempool.hxx
+++ b/svtools/inc/svtools/itempool.hxx
@@ -41,6 +41,7 @@
#include <tools/string.hxx>
#include <svtools/svarray.hxx>
#include <svtools/poolitem.hxx>
+#include <vector>
class SvStream;
class SfxBroadcaster;
@@ -80,6 +81,15 @@ struct SfxItemInfo
class SfxStyleSheetIterator;
struct SfxPoolItemArray_Impl;
+class SfxItemPool;
+
+class SVL_DLLPUBLIC SfxItemPoolUser
+{
+public:
+ virtual void ObjectInDestruction(const SfxItemPool& rSfxItemPool) = 0;
+};
+
+typedef ::std::vector< SfxItemPoolUser* > SfxItemPoolUserVector;
class SVL_DLLPUBLIC SfxItemPool
@@ -116,6 +126,14 @@ class SVL_DLLPUBLIC SfxItemPool
USHORT* _pPoolRanges;
FASTBOOL bPersistentRefCounts;
+private:
+ // ObjectUser section
+ SfxItemPoolUserVector maSfxItemPoolUsers;
+
+public:
+ void AddSfxItemPoolUser(SfxItemPoolUser& rNewUser);
+ void RemoveSfxItemPoolUser(SfxItemPoolUser& rOldUser);
+
//---------------------------------------------------------------------
#ifndef _SFXITEMS_HXX
@@ -156,7 +174,10 @@ public:
USHORT *pSlotIds = 0,
#endif
FASTBOOL bLoadRefCounts = TRUE );
+protected:
virtual ~SfxItemPool();
+public:
+ static void Free(SfxItemPool* pPool);
SfxBroadcaster& BC();
diff --git a/svtools/inc/svtools/optionsdrawinglayer.hxx b/svtools/inc/svtools/optionsdrawinglayer.hxx
index 4e97de7d6792..e0b287002f34 100644
--- a/svtools/inc/svtools/optionsdrawinglayer.hxx
+++ b/svtools/inc/svtools/optionsdrawinglayer.hxx
@@ -175,12 +175,18 @@ class SVL_DLLPUBLIC SvtOptionsDrawinglayer
// primitives
sal_Bool IsAntiAliasing() const;
+ sal_Bool IsSnapHorVerLinesToDiscrete() const;
sal_Bool IsSolidDragCreate() const;
+ sal_Bool IsRenderDecoratedTextDirect() const;
+ sal_Bool IsRenderSimpleTextDirect() const;
sal_uInt32 GetQuadratic3DRenderLimit() const;
sal_uInt32 GetQuadraticFormControlRenderLimit() const;
void SetAntiAliasing( sal_Bool bState );
+ void SetSnapHorVerLinesToDiscrete( sal_Bool bState );
void SetSolidDragCreate( sal_Bool bState );
+ void SetRenderDecoratedTextDirect( sal_Bool bState );
+ void SetRenderSimpleTextDirect( sal_Bool bState );
void SetQuadratic3DRenderLimit(sal_uInt32 nNew);
void SetQuadraticFormControlRenderLimit(sal_uInt32 nNew);
diff --git a/svtools/source/config/optionsdrawinglayer.cxx b/svtools/source/config/optionsdrawinglayer.cxx
index c63dc2154c55..125827d17faf 100644
--- a/svtools/source/config/optionsdrawinglayer.cxx
+++ b/svtools/source/config/optionsdrawinglayer.cxx
@@ -85,7 +85,10 @@ using namespace ::com::sun::star::uno ;
// primitives
#define DEFAULT_ANTIALIASING sal_True
+#define DEFAULT_SNAPHORVERLINESTODISCRETE sal_True
#define DEFAULT_SOLIDDRAGCREATE sal_True
+#define DEFAULT_RENDERDECORATEDTEXTDIRECT sal_True
+#define DEFAULT_RENDERSIMPLETEXTDIRECT sal_True
#define DEFAULT_QUADRATIC3DRENDERLIMIT 1000000
#define DEFAULT_QUADRATICFORMCONTROLRENDERLIMIT 45000
@@ -115,7 +118,10 @@ using namespace ::com::sun::star::uno ;
// primitives
#define PROPERTYNAME_ANTIALIASING OUString(RTL_CONSTASCII_USTRINGPARAM("AntiAliasing"))
+#define PROPERTYNAME_SNAPHORVERLINESTODISCRETE OUString(RTL_CONSTASCII_USTRINGPARAM("SnapHorVerLinesToDiscrete"))
#define PROPERTYNAME_SOLIDDRAGCREATE OUString(RTL_CONSTASCII_USTRINGPARAM("SolidDragCreate"))
+#define PROPERTYNAME_RENDERDECORATEDTEXTDIRECT OUString(RTL_CONSTASCII_USTRINGPARAM("RenderDecoratedTextDirect"))
+#define PROPERTYNAME_RENDERSIMPLETEXTDIRECT OUString(RTL_CONSTASCII_USTRINGPARAM("RenderSimpleTextDirect"))
#define PROPERTYNAME_QUADRATIC3DRENDERLIMIT OUString(RTL_CONSTASCII_USTRINGPARAM("Quadratic3DRenderLimit"))
#define PROPERTYNAME_QUADRATICFORMCONTROLRENDERLIMIT OUString(RTL_CONSTASCII_USTRINGPARAM("QuadraticFormControlRenderLimit"))
@@ -145,11 +151,14 @@ using namespace ::com::sun::star::uno ;
// primitives
#define PROPERTYHANDLE_ANTIALIASING 17
-#define PROPERTYHANDLE_SOLIDDRAGCREATE 18
-#define PROPERTYHANDLE_QUADRATIC3DRENDERLIMIT 19
-#define PROPERTYHANDLE_QUADRATICFORMCONTROLRENDERLIMIT 20
+#define PROPERTYHANDLE_SNAPHORVERLINESTODISCRETE 18
+#define PROPERTYHANDLE_SOLIDDRAGCREATE 19
+#define PROPERTYHANDLE_RENDERDECORATEDTEXTDIRECT 20
+#define PROPERTYHANDLE_RENDERSIMPLETEXTDIRECT 21
+#define PROPERTYHANDLE_QUADRATIC3DRENDERLIMIT 22
+#define PROPERTYHANDLE_QUADRATICFORMCONTROLRENDERLIMIT 23
-#define PROPERTYCOUNT 21
+#define PROPERTYCOUNT 24
class SvtOptionsDrawinglayer_Impl : public ConfigItem
{
@@ -224,12 +233,18 @@ public:
// primitives
sal_Bool IsAntiAliasing() const;
+ sal_Bool IsSnapHorVerLinesToDiscrete() const;
sal_Bool IsSolidDragCreate() const;
+ sal_Bool IsRenderDecoratedTextDirect() const;
+ sal_Bool IsRenderSimpleTextDirect() const;
sal_uInt32 GetQuadratic3DRenderLimit() const;
sal_uInt32 GetQuadraticFormControlRenderLimit() const;
void SetAntiAliasing( sal_Bool bState );
+ void SetSnapHorVerLinesToDiscrete( sal_Bool bState );
void SetSolidDragCreate( sal_Bool bState );
+ void SetRenderDecoratedTextDirect( sal_Bool bState );
+ void SetRenderSimpleTextDirect( sal_Bool bState );
void SetQuadratic3DRenderLimit(sal_uInt32 nNew);
void SetQuadraticFormControlRenderLimit(sal_uInt32 nNew);
@@ -273,7 +288,10 @@ private:
// primitives
sal_Bool m_bAntiAliasing;
+ sal_Bool m_bSnapHorVerLinesToDiscrete;
sal_Bool m_bSolidDragCreate;
+ sal_Bool m_bRenderDecoratedTextDirect;
+ sal_Bool m_bRenderSimpleTextDirect;
sal_uInt32 m_nQuadratic3DRenderLimit;
sal_uInt32 m_nQuadraticFormControlRenderLimit;
@@ -317,7 +335,10 @@ SvtOptionsDrawinglayer_Impl::SvtOptionsDrawinglayer_Impl() :
// primitives
m_bAntiAliasing(DEFAULT_ANTIALIASING),
+ m_bSnapHorVerLinesToDiscrete(DEFAULT_SNAPHORVERLINESTODISCRETE),
m_bSolidDragCreate(DEFAULT_SOLIDDRAGCREATE),
+ m_bRenderDecoratedTextDirect(DEFAULT_RENDERDECORATEDTEXTDIRECT),
+ m_bRenderSimpleTextDirect(DEFAULT_RENDERSIMPLETEXTDIRECT),
m_nQuadratic3DRenderLimit(DEFAULT_QUADRATIC3DRENDERLIMIT),
m_nQuadraticFormControlRenderLimit(DEFAULT_QUADRATICFORMCONTROLRENDERLIMIT),
@@ -474,6 +495,14 @@ SvtOptionsDrawinglayer_Impl::SvtOptionsDrawinglayer_Impl() :
}
break;
+ // primitives
+ case PROPERTYHANDLE_SNAPHORVERLINESTODISCRETE:
+ {
+ DBG_ASSERT(!(seqValues[nProperty].getValueTypeClass()!=TypeClass_BOOLEAN), "SvtOptionsDrawinglayer_Impl::SvtOptionsDrawinglayer_Impl()\nWho has changed the value type of \"Office.Common\\Drawinglayer\\SnapHorVerLinesToDiscrete\"?" );
+ seqValues[nProperty] >>= m_bSnapHorVerLinesToDiscrete;
+ }
+ break;
+
case PROPERTYHANDLE_SOLIDDRAGCREATE:
{
DBG_ASSERT(!(seqValues[nProperty].getValueTypeClass()!=TypeClass_BOOLEAN), "SvtOptionsDrawinglayer_Impl::SvtOptionsDrawinglayer_Impl()\nWho has changed the value type of \"Office.Common\\Drawinglayer\\SolidDragCreate\"?" );
@@ -481,6 +510,20 @@ SvtOptionsDrawinglayer_Impl::SvtOptionsDrawinglayer_Impl() :
}
break;
+ case PROPERTYHANDLE_RENDERDECORATEDTEXTDIRECT:
+ {
+ DBG_ASSERT(!(seqValues[nProperty].getValueTypeClass()!=TypeClass_BOOLEAN), "SvtOptionsDrawinglayer_Impl::SvtOptionsDrawinglayer_Impl()\nWho has changed the value type of \"Office.Common\\Drawinglayer\\RenderDecoratedTextDirect\"?" );
+ seqValues[nProperty] >>= m_bRenderDecoratedTextDirect;
+ }
+ break;
+
+ case PROPERTYHANDLE_RENDERSIMPLETEXTDIRECT:
+ {
+ DBG_ASSERT(!(seqValues[nProperty].getValueTypeClass()!=TypeClass_BOOLEAN), "SvtOptionsDrawinglayer_Impl::SvtOptionsDrawinglayer_Impl()\nWho has changed the value type of \"Office.Common\\Drawinglayer\\RenderSimpleTextDirect\"?" );
+ seqValues[nProperty] >>= m_bRenderSimpleTextDirect;
+ }
+ break;
+
case PROPERTYHANDLE_QUADRATIC3DRENDERLIMIT:
{
DBG_ASSERT(!(seqValues[nProperty].getValueTypeClass()!=TypeClass_LONG), "SvtOptionsDrawinglayer_Impl::SvtOptionsDrawinglayer_Impl()\nWho has changed the value type of \"Office.Common\\Drawinglayer\\Quadratic3DRenderLimit\"?" );
@@ -595,10 +638,22 @@ void SvtOptionsDrawinglayer_Impl::Commit()
aSeqValues[nProperty] <<= m_bAntiAliasing;
break;
+ case PROPERTYHANDLE_SNAPHORVERLINESTODISCRETE:
+ aSeqValues[nProperty] <<= m_bSnapHorVerLinesToDiscrete;
+ break;
+
case PROPERTYHANDLE_SOLIDDRAGCREATE:
aSeqValues[nProperty] <<= m_bSolidDragCreate;
break;
+ case PROPERTYHANDLE_RENDERDECORATEDTEXTDIRECT:
+ aSeqValues[nProperty] <<= m_bRenderDecoratedTextDirect;
+ break;
+
+ case PROPERTYHANDLE_RENDERSIMPLETEXTDIRECT:
+ aSeqValues[nProperty] <<= m_bRenderSimpleTextDirect;
+ break;
+
case PROPERTYHANDLE_QUADRATIC3DRENDERLIMIT:
aSeqValues[nProperty] <<= m_nQuadratic3DRenderLimit;
break;
@@ -917,11 +972,26 @@ sal_Bool SvtOptionsDrawinglayer_Impl::IsAntiAliasing() const
return m_bAntiAliasing;
}
+sal_Bool SvtOptionsDrawinglayer_Impl::IsSnapHorVerLinesToDiscrete() const
+{
+ return m_bSnapHorVerLinesToDiscrete;
+}
+
sal_Bool SvtOptionsDrawinglayer_Impl::IsSolidDragCreate() const
{
return m_bSolidDragCreate;
}
+sal_Bool SvtOptionsDrawinglayer_Impl::IsRenderDecoratedTextDirect() const
+{
+ return m_bRenderDecoratedTextDirect;
+}
+
+sal_Bool SvtOptionsDrawinglayer_Impl::IsRenderSimpleTextDirect() const
+{
+ return m_bRenderSimpleTextDirect;
+}
+
sal_uInt32 SvtOptionsDrawinglayer_Impl::GetQuadratic3DRenderLimit() const
{
return m_nQuadratic3DRenderLimit;
@@ -941,6 +1011,15 @@ void SvtOptionsDrawinglayer_Impl::SetAntiAliasing( sal_Bool bState )
}
}
+void SvtOptionsDrawinglayer_Impl::SetSnapHorVerLinesToDiscrete( sal_Bool bState )
+{
+ if(m_bSnapHorVerLinesToDiscrete != bState)
+ {
+ m_bSnapHorVerLinesToDiscrete = bState;
+ SetModified();
+ }
+}
+
void SvtOptionsDrawinglayer_Impl::SetSolidDragCreate( sal_Bool bState )
{
if(m_bSolidDragCreate != bState)
@@ -950,6 +1029,24 @@ void SvtOptionsDrawinglayer_Impl::SetSolidDragCreate( sal_Bool bState )
}
}
+void SvtOptionsDrawinglayer_Impl::SetRenderDecoratedTextDirect( sal_Bool bState )
+{
+ if(m_bRenderDecoratedTextDirect != bState)
+ {
+ m_bRenderDecoratedTextDirect = bState;
+ SetModified();
+ }
+}
+
+void SvtOptionsDrawinglayer_Impl::SetRenderSimpleTextDirect( sal_Bool bState )
+{
+ if(m_bRenderSimpleTextDirect != bState)
+ {
+ m_bRenderSimpleTextDirect = bState;
+ SetModified();
+ }
+}
+
void SvtOptionsDrawinglayer_Impl::SetQuadratic3DRenderLimit(sal_uInt32 nNew)
{
if(m_nQuadratic3DRenderLimit != nNew)
@@ -1002,7 +1099,10 @@ Sequence< OUString > SvtOptionsDrawinglayer_Impl::impl_GetPropertyNames()
// primitives
PROPERTYNAME_ANTIALIASING,
+ PROPERTYNAME_SNAPHORVERLINESTODISCRETE,
PROPERTYNAME_SOLIDDRAGCREATE,
+ PROPERTYNAME_RENDERDECORATEDTEXTDIRECT,
+ PROPERTYNAME_RENDERSIMPLETEXTDIRECT,
PROPERTYNAME_QUADRATIC3DRENDERLIMIT,
PROPERTYNAME_QUADRATICFORMCONTROLRENDERLIMIT
};
@@ -1308,12 +1408,30 @@ sal_Bool SvtOptionsDrawinglayer::IsAntiAliasing() const
return m_pDataContainer->IsAntiAliasing() && IsAAPossibleOnThisSystem();
}
+sal_Bool SvtOptionsDrawinglayer::IsSnapHorVerLinesToDiscrete() const
+{
+ MutexGuard aGuard( GetOwnStaticMutex() );
+ return m_pDataContainer->IsAntiAliasing() && m_pDataContainer->IsSnapHorVerLinesToDiscrete();
+}
+
sal_Bool SvtOptionsDrawinglayer::IsSolidDragCreate() const
{
MutexGuard aGuard( GetOwnStaticMutex() );
return m_pDataContainer->IsSolidDragCreate();
}
+sal_Bool SvtOptionsDrawinglayer::IsRenderDecoratedTextDirect() const
+{
+ MutexGuard aGuard( GetOwnStaticMutex() );
+ return m_pDataContainer->IsRenderDecoratedTextDirect();
+}
+
+sal_Bool SvtOptionsDrawinglayer::IsRenderSimpleTextDirect() const
+{
+ MutexGuard aGuard( GetOwnStaticMutex() );
+ return m_pDataContainer->IsRenderSimpleTextDirect();
+}
+
sal_uInt32 SvtOptionsDrawinglayer::GetQuadratic3DRenderLimit() const
{
MutexGuard aGuard( GetOwnStaticMutex() );
@@ -1332,12 +1450,30 @@ void SvtOptionsDrawinglayer::SetAntiAliasing( sal_Bool bState )
m_pDataContainer->SetAntiAliasing( bState );
}
+void SvtOptionsDrawinglayer::SetSnapHorVerLinesToDiscrete( sal_Bool bState )
+{
+ MutexGuard aGuard( GetOwnStaticMutex() );
+ m_pDataContainer->SetSnapHorVerLinesToDiscrete( bState );
+}
+
void SvtOptionsDrawinglayer::SetSolidDragCreate( sal_Bool bState )
{
MutexGuard aGuard( GetOwnStaticMutex() );
m_pDataContainer->SetSolidDragCreate( bState );
}
+void SvtOptionsDrawinglayer::SetRenderDecoratedTextDirect( sal_Bool bState )
+{
+ MutexGuard aGuard( GetOwnStaticMutex() );
+ m_pDataContainer->SetRenderDecoratedTextDirect( bState );
+}
+
+void SvtOptionsDrawinglayer::SetRenderSimpleTextDirect( sal_Bool bState )
+{
+ MutexGuard aGuard( GetOwnStaticMutex() );
+ m_pDataContainer->SetRenderSimpleTextDirect( bState );
+}
+
void SvtOptionsDrawinglayer::SetQuadratic3DRenderLimit(sal_uInt32 nNew)
{
MutexGuard aGuard( GetOwnStaticMutex() );
diff --git a/svtools/source/items/style.cxx b/svtools/source/items/style.cxx
index 26ef160ffb93..ad11f1527ce7 100644
--- a/svtools/source/items/style.cxx
+++ b/svtools/source/items/style.cxx
@@ -180,11 +180,12 @@ SfxStyleSheetBase::SfxStyleSheetBase( const SfxStyleSheetBase& r )
static SfxStyleSheetBasePool& implGetStaticPool()
{
static SfxStyleSheetBasePool* pSheetPool = 0;
+ static SfxItemPool* pBasePool = 0;
if( !pSheetPool )
{
UniString aName;
- static SfxItemPool aPool( aName, 0, 0, 0 );
- pSheetPool = new SfxStyleSheetBasePool( aPool );
+ pBasePool = new SfxItemPool( aName, 0, 0, 0 );
+ pSheetPool = new SfxStyleSheetBasePool(*pBasePool);
}
return *pSheetPool;
}
diff --git a/svtools/source/items1/itempool.cxx b/svtools/source/items1/itempool.cxx
index f6a48b51019f..e54bca8d3c19 100644
--- a/svtools/source/items1/itempool.cxx
+++ b/svtools/source/items1/itempool.cxx
@@ -41,6 +41,7 @@
#include <svtools/brdcst.hxx>
#include <svtools/smplhint.hxx>
#include "poolio.hxx"
+#include <algorithm>
// STATIC DATA -----------------------------------------------------------
@@ -52,6 +53,20 @@ SV_IMPL_PTRARR( SfxPoolVersionArr_Impl, SfxPoolVersion_Impl* );
//========================================================================
+void SfxItemPool::AddSfxItemPoolUser(SfxItemPoolUser& rNewUser)
+{
+ maSfxItemPoolUsers.push_back(&rNewUser);
+}
+
+void SfxItemPool::RemoveSfxItemPoolUser(SfxItemPoolUser& rOldUser)
+{
+ const SfxItemPoolUserVector::iterator aFindResult = ::std::find(maSfxItemPoolUsers.begin(), maSfxItemPoolUsers.end(), &rOldUser);
+ if(aFindResult != maSfxItemPoolUsers.end())
+ {
+ maSfxItemPoolUsers.erase(aFindResult);
+ }
+}
+
const SfxPoolItem* SfxItemPool::GetPoolDefaultItem( USHORT nWhich ) const
{
DBG_CHKTHIS(SfxItemPool, 0);
@@ -162,7 +177,8 @@ SfxItemPool::SfxItemPool
pSecondary(0),
pMaster(this),
_pPoolRanges( 0 ),
- bPersistentRefCounts(bLoadRefCounts)
+ bPersistentRefCounts(bLoadRefCounts),
+ maSfxItemPoolUsers()
{
DBG_CTOR(SfxItemPool, 0);
DBG_ASSERT(nStart, "Start-Which-Id must be greater 0" );
@@ -222,7 +238,8 @@ SfxItemPool::SfxItemPool
pSecondary(0),
pMaster(this),
_pPoolRanges( 0 ),
- bPersistentRefCounts(rPool.bPersistentRefCounts )
+ bPersistentRefCounts(rPool.bPersistentRefCounts ),
+ maSfxItemPoolUsers()
{
DBG_CTOR(SfxItemPool, 0);
pImp->eDefMetric = rPool.pImp->eDefMetric;
@@ -387,6 +404,29 @@ SfxItemPool::~SfxItemPool()
delete[] _pPoolRanges;
delete pImp;
}
+
+void SfxItemPool::Free(SfxItemPool* pPool)
+{
+ if(pPool)
+ {
+ // tell all the registered SfxItemPoolUsers that the pool is in destruction
+ SfxItemPoolUserVector aListCopy(pPool->maSfxItemPoolUsers.begin(), pPool->maSfxItemPoolUsers.end());
+ for(SfxItemPoolUserVector::iterator aIterator = aListCopy.begin(); aIterator != aListCopy.end(); aIterator++)
+ {
+ SfxItemPoolUser* pSfxItemPoolUser = *aIterator;
+ DBG_ASSERT(pSfxItemPoolUser, "corrupt SfxItemPoolUser list (!)");
+ pSfxItemPoolUser->ObjectInDestruction(*pPool);
+ }
+
+ // Clear the vector. This means that user do not need to call RemoveSfxItemPoolUser()
+ // when they get called from ObjectInDestruction().
+ pPool->maSfxItemPoolUsers.clear();
+
+ // delete pool
+ delete pPool;
+ }
+}
+
// -----------------------------------------------------------------------
diff --git a/vcl/inc/vcl/outdev.hxx b/vcl/inc/vcl/outdev.hxx
index 0736a83d2c72..c0bcfa35fae5 100644
--- a/vcl/inc/vcl/outdev.hxx
+++ b/vcl/inc/vcl/outdev.hxx
@@ -252,6 +252,7 @@ struct KerningPair
// Antialiasing
#define ANTIALIASING_DISABLE_TEXT ((USHORT)0x0001)
#define ANTIALIASING_ENABLE_B2DDRAW ((USHORT)0x0002)
+#define ANTIALIASING_PIXELSNAPHAIRLINE ((USHORT)0x0004)
// AddFontSubstitute
#define FONT_SUBSTITUTE_ALWAYS ((USHORT)0x0001)
diff --git a/vcl/source/gdi/outdev.cxx b/vcl/source/gdi/outdev.cxx
index 4f8003722f15..0e9da9f81136 100644
--- a/vcl/source/gdi/outdev.cxx
+++ b/vcl/source/gdi/outdev.cxx
@@ -67,6 +67,7 @@
#include <basegfx/polygon/b2dpolygon.hxx>
#include <basegfx/polygon/b2dpolypolygon.hxx>
#include <basegfx/matrix/b2dhommatrix.hxx>
+#include <basegfx/polygon/b2dpolygontools.hxx>
#include <com/sun/star/awt/XGraphics.hpp>
#include <com/sun/star/uno/Sequence.hxx>
@@ -2444,13 +2445,19 @@ void OutputDevice::DrawPolyLine( const Polygon& rPoly )
ImplInitLineColor();
// use b2dpolygon drawing if possible
- if( (mnAntialiasing & ANTIALIASING_ENABLE_B2DDRAW) != 0
- && mpGraphics->supportsOperation( OutDevSupport_B2DDraw ) )
+ if((mnAntialiasing & ANTIALIASING_ENABLE_B2DDRAW) && mpGraphics->supportsOperation(OutDevSupport_B2DDraw))
{
::basegfx::B2DPolygon aB2DPolyLine = rPoly.getB2DPolygon();
const ::basegfx::B2DHomMatrix aTransform = ImplGetDeviceTransformation();
aB2DPolyLine.transform( aTransform );
const ::basegfx::B2DVector aB2DLineWidth( 1.0, 1.0 );
+
+ if((mnAntialiasing & ANTIALIASING_ENABLE_B2DDRAW) && (mnAntialiasing & ANTIALIASING_PIXELSNAPHAIRLINE))
+ {
+ // #i98289#
+ aB2DPolyLine = basegfx::tools::snapPointsOfHorizontalOrVerticalEdges(aB2DPolyLine);
+ }
+
if( mpGraphics->DrawPolyLine( aB2DPolyLine, aB2DLineWidth, basegfx::B2DLINEJOIN_ROUND, this ) )
return;
}
@@ -2591,8 +2598,7 @@ void OutputDevice::DrawPolygon( const Polygon& rPoly )
ImplInitFillColor();
// use b2dpolygon drawing if possible
- if( (mnAntialiasing & ANTIALIASING_ENABLE_B2DDRAW) != 0
- && mpGraphics->supportsOperation( OutDevSupport_B2DDraw ) )
+ if((mnAntialiasing & ANTIALIASING_ENABLE_B2DDRAW) && mpGraphics->supportsOperation(OutDevSupport_B2DDraw))
{
::basegfx::B2DPolyPolygon aB2DPolyPolygon( rPoly.getB2DPolygon() );
const ::basegfx::B2DHomMatrix aTransform = ImplGetDeviceTransformation();
@@ -2655,8 +2661,7 @@ void OutputDevice::DrawPolyPolygon( const PolyPolygon& rPolyPoly )
ImplInitFillColor();
// use b2dpolygon drawing if possible
- if( (mnAntialiasing & ANTIALIASING_ENABLE_B2DDRAW) != 0
- && mpGraphics->supportsOperation( OutDevSupport_B2DDraw ) )
+ if((mnAntialiasing & ANTIALIASING_ENABLE_B2DDRAW) && mpGraphics->supportsOperation(OutDevSupport_B2DDraw))
{
::basegfx::B2DPolyPolygon aB2DPolyPolygon = rPolyPoly.getB2DPolyPolygon();
const ::basegfx::B2DHomMatrix aTransform = ImplGetDeviceTransformation();
@@ -2743,8 +2748,7 @@ void OutputDevice::DrawPolyPolygon( const basegfx::B2DPolyPolygon& rB2DPolyPoly
if( mbInitFillColor )
ImplInitFillColor();
- if( (mnAntialiasing & ANTIALIASING_ENABLE_B2DDRAW) != 0
- && mpGraphics->supportsOperation( OutDevSupport_B2DDraw ) )
+ if((mnAntialiasing & ANTIALIASING_ENABLE_B2DDRAW) && mpGraphics->supportsOperation(OutDevSupport_B2DDraw))
{
const ::basegfx::B2DHomMatrix aTransform = ImplGetDeviceTransformation();
::basegfx::B2DPolyPolygon aB2DPP = rB2DPolyPoly;
@@ -2804,23 +2808,29 @@ void OutputDevice::DrawPolyLine(
if( mbInitLineColor )
ImplInitLineColor();
- if(mnAntialiasing & ANTIALIASING_ENABLE_B2DDRAW)
+ // #i98289# use b2dpolygon drawing if possible
+ if((mnAntialiasing & ANTIALIASING_ENABLE_B2DDRAW) && mpGraphics->supportsOperation(OutDevSupport_B2DDraw))
{
-#ifdef UNX // b2dpolygon support not implemented yet on non-UNX platforms
const ::basegfx::B2DHomMatrix aTransform = ImplGetDeviceTransformation();
- // transform the line width
- ::basegfx::B2DVector aB2DLineWidth;
- if( fLineWidth == 0.0 ) // hairline?
- aB2DLineWidth = ::basegfx::B2DVector( 1.0, 1.0 );
- else
+ ::basegfx::B2DVector aB2DLineWidth(1.0, 1.0);
+
+ // transform the line width if used
+ if( fLineWidth != 0.0 )
aB2DLineWidth = aTransform * ::basegfx::B2DVector( fLineWidth, fLineWidth );
+
// transform the polygon
::basegfx::B2DPolygon aB2DPL = rB2DPolygon;
aB2DPL.transform( aTransform );
+
+ if((mnAntialiasing & ANTIALIASING_ENABLE_B2DDRAW) && (mnAntialiasing & ANTIALIASING_PIXELSNAPHAIRLINE))
+ {
+ // #i98289#
+ aB2DPL = basegfx::tools::snapPointsOfHorizontalOrVerticalEdges(aB2DPL);
+ }
+
// draw the polyline
if( mpGraphics->DrawPolyLine( aB2DPL, aB2DLineWidth, eLineJoin, this ) )
return;
-#endif
}
// fallback to old polygon drawing if needed
diff --git a/vcl/source/gdi/outdev6.cxx b/vcl/source/gdi/outdev6.cxx
index f76aa6b1dd55..cee4f475a577 100644
--- a/vcl/source/gdi/outdev6.cxx
+++ b/vcl/source/gdi/outdev6.cxx
@@ -185,8 +185,7 @@ void OutputDevice::DrawTransparent( const basegfx::B2DPolyPolygon& rB2DPolyPoly,
if( mbInitFillColor )
ImplInitFillColor();
- if( (mnAntialiasing & ANTIALIASING_ENABLE_B2DDRAW) != 0
- && mpGraphics->supportsOperation( OutDevSupport_B2DDraw ) )
+ if((mnAntialiasing & ANTIALIASING_ENABLE_B2DDRAW) && mpGraphics->supportsOperation(OutDevSupport_B2DDraw))
{
// b2dpolygon support not implemented yet on non-UNX platforms
const ::basegfx::B2DHomMatrix aTransform = ImplGetDeviceTransformation();
@@ -407,10 +406,17 @@ void OutputDevice::DrawTransparent( const PolyPolygon& rPolyPoly,
Rectangle aPixelRect( ImplLogicToDevicePixel( aLogicPolyRect ) );
if( !mbOutputClipped )
- bDrawn = mpGraphics->DrawAlphaRect( aPixelRect.Left(), aPixelRect.Top(),
- aPixelRect.GetWidth(), aPixelRect.GetHeight(),
- sal::static_int_cast<sal_uInt8>(nTransparencePercent),
- this );
+ {
+ bDrawn = mpGraphics->DrawAlphaRect(
+ aPixelRect.Left(), aPixelRect.Top(),
+ // #i98405# use methods with small g, else one pixel too much will be painted.
+ // This is because the source is a polygon which when painted would not paint
+ // the rightmost and lowest pixel line(s), so use one pixel less for the
+ // rectangle, too.
+ aPixelRect.getWidth(), aPixelRect.getHeight(),
+ sal::static_int_cast<sal_uInt8>(nTransparencePercent),
+ this );
+ }
else
bDrawn = true;
}