summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArmin Le Grand <Armin.Le.Grand@cib.de>2016-07-08 13:14:24 +0200
committerArmin Le Grand <Armin.Le.Grand@cib.de>2016-07-08 13:14:24 +0200
commit475695250f4929af8fdbd290aba31841fe95eca3 (patch)
tree3a827e31996f2beffdf0e76308d048734c447b4e
parent7304a1278f50fcc95f7bd31cc137de7292bd55a9 (diff)
Adaptions for packport to libreoffice-5-0
Change-Id: I36899154cacc334920b25fba39cc641d04600fbc
-rw-r--r--drawinglayer/source/primitive2d/patternfillprimitive2d.cxx6
-rw-r--r--svgio/source/svgreader/svgstyleattributes.cxx15
-rw-r--r--sw/inc/ndole.hxx4
-rw-r--r--sw/source/core/doc/notxtfrm.cxx4
-rw-r--r--sw/source/core/ole/ndole.cxx16
-rw-r--r--vcl/win/source/gdi/gdiimpl.cxx132
6 files changed, 80 insertions, 97 deletions
diff --git a/drawinglayer/source/primitive2d/patternfillprimitive2d.cxx b/drawinglayer/source/primitive2d/patternfillprimitive2d.cxx
index 225cb2fd8084..e82a7c8f9e49 100644
--- a/drawinglayer/source/primitive2d/patternfillprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/patternfillprimitive2d.cxx
@@ -133,7 +133,7 @@ namespace drawinglayer
}
}
- if(aContent.empty())
+ if (0 == aContent.getLength())
{
// buffering was not tried or did fail - reset remembered buffered size
// in any case
@@ -145,7 +145,7 @@ namespace drawinglayer
// check if content needs to be clipped
const basegfx::B2DRange aUnitRange(0.0, 0.0, 1.0, 1.0);
- const basegfx::B2DRange aContentRange(getChildren().getB2DRange(rViewInformation));
+ const basegfx::B2DRange aContentRange(getB2DRangeFromPrimitive2DSequence(getChildren(), rViewInformation));
if(!aUnitRange.isInside(aContentRange))
{
@@ -309,7 +309,7 @@ namespace drawinglayer
PatternFillPrimitive2D* pThat = const_cast< PatternFillPrimitive2D* >(this);
pThat->mnDiscreteWidth = nW;
pThat->mnDiscreteHeight = nH;
- pThat->setBuffered2DDecomposition(Primitive2DContainer());
+ pThat->setBuffered2DDecomposition(Primitive2DSequence());
}
// call parent
diff --git a/svgio/source/svgreader/svgstyleattributes.cxx b/svgio/source/svgreader/svgstyleattributes.cxx
index fc373da232ab..0a01778ca810 100644
--- a/svgio/source/svgreader/svgstyleattributes.cxx
+++ b/svgio/source/svgreader/svgstyleattributes.cxx
@@ -701,18 +701,6 @@ namespace svgio
aDashArray = solveSvgNumberVector(getStrokeDasharray(), mrOwner);
}
- // convert svg:stroke-miterlimit to LineAttrute:mfMiterMinimumAngle
- // The default needs to be set explicitely, because svg default <> Draw default
- double fMiterMinimumAngle;
- if (getStrokeMiterLimit().isSet())
- {
- fMiterMinimumAngle = 2.0 * asin(1.0/getStrokeMiterLimit().getNumber());
- }
- else
- {
- fMiterMinimumAngle = 2.0 * asin(0.25); // 1.0/default 4.0
- }
-
// todo: Handle getStrokeDashOffset()
// prepare line attribute
@@ -720,8 +708,7 @@ namespace svgio
pStroke ? *pStroke : basegfx::BColor(0.0, 0.0, 0.0),
fStrokeWidth,
aB2DLineJoin,
- aLineCap,
- fMiterMinimumAngle);
+ aLineCap);
if(aDashArray.empty())
{
diff --git a/sw/inc/ndole.hxx b/sw/inc/ndole.hxx
index 785cde78649e..2f34af132ad8 100644
--- a/sw/inc/ndole.hxx
+++ b/sw/inc/ndole.hxx
@@ -43,7 +43,7 @@ class SW_DLLPUBLIC SwOLEObj
OUString aName;
// eventually buffered data if it is a chart OLE
- drawinglayer::primitive2d::Primitive2DContainer m_aPrimitive2DSequence;
+ drawinglayer::primitive2d::Primitive2DSequence m_aPrimitive2DSequence;
basegfx::B2DRange m_aRange;
class DeflateData* m_pDeflateData;
@@ -71,7 +71,7 @@ public:
// try to get OLE visualization in form of a Primitive2DSequence
// and the corresponding B2DRange. This data may be locally buffered
- drawinglayer::primitive2d::Primitive2DContainer tryToGetChartContentAsPrimitive2DSequence(
+ drawinglayer::primitive2d::Primitive2DSequence tryToGetChartContentAsPrimitive2DSequence(
basegfx::B2DRange& rRange,
bool bSynchron);
void resetBufferedData();
diff --git a/sw/source/core/doc/notxtfrm.cxx b/sw/source/core/doc/notxtfrm.cxx
index 6d6f3940cdd3..bc3b330f92af 100644
--- a/sw/source/core/doc/notxtfrm.cxx
+++ b/sw/source/core/doc/notxtfrm.cxx
@@ -999,12 +999,12 @@ void SwNoTextFrm::PaintPicture( vcl::RenderContext* pOut, const SwRect &rGrfArea
if(bIsChart)
{
basegfx::B2DRange aSourceRange;
- const drawinglayer::primitive2d::Primitive2DContainer aSequence(
+ const drawinglayer::primitive2d::Primitive2DSequence aSequence(
pOLENd->GetOLEObj().tryToGetChartContentAsPrimitive2DSequence(
aSourceRange,
bPrn));
- if(!aSequence.empty() && !aSourceRange.isEmpty())
+ if (0 != aSequence.getLength() && !aSourceRange.isEmpty())
{
const basegfx::B2DRange aTargetRange(
aAlignedGrfArea.Left(), aAlignedGrfArea.Top(),
diff --git a/sw/source/core/ole/ndole.cxx b/sw/source/core/ole/ndole.cxx
index 2538036617c2..00819be6e116 100644
--- a/sw/source/core/ole/ndole.cxx
+++ b/sw/source/core/ole/ndole.cxx
@@ -683,7 +683,7 @@ private:
friend class SwOLEObj;
uno::Reference< frame::XModel > maXModel;
- drawinglayer::primitive2d::Primitive2DContainer maPrimitive2DSequence;
+ drawinglayer::primitive2d::Primitive2DSequence maPrimitive2DSequence;
basegfx::B2DRange maRange;
// set from the WorkerThread when done
@@ -704,7 +704,7 @@ public:
{
}
- const drawinglayer::primitive2d::Primitive2DContainer& getSequence() const
+ const drawinglayer::primitive2d::Primitive2DSequence& getSequence() const
{
return maPrimitive2DSequence;
}
@@ -778,7 +778,7 @@ private:
SwOLEObj::SwOLEObj( const svt::EmbeddedObjectRef& xObj ) :
pOLENd( 0 ),
pListener( 0 ),
- xOLERef( xObj )
+ xOLERef( xObj ),
m_aPrimitive2DSequence(),
m_aRange(),
m_pDeflateData(nullptr)
@@ -795,7 +795,7 @@ SwOLEObj::SwOLEObj( const svt::EmbeddedObjectRef& xObj ) :
SwOLEObj::SwOLEObj( const OUString &rString, sal_Int64 nAspect ) :
pOLENd( 0 ),
pListener( 0 ),
- aName( rString )
+ aName( rString ),
m_aPrimitive2DSequence(),
m_aRange(),
m_pDeflateData(nullptr)
@@ -1053,7 +1053,7 @@ OUString SwOLEObj::GetDescription()
return SW_RESSTR(STR_OLE);
}
-drawinglayer::primitive2d::Primitive2DContainer SwOLEObj::tryToGetChartContentAsPrimitive2DSequence(
+drawinglayer::primitive2d::Primitive2DSequence SwOLEObj::tryToGetChartContentAsPrimitive2DSequence(
basegfx::B2DRange& rRange,
bool bSynchron)
{
@@ -1076,7 +1076,7 @@ drawinglayer::primitive2d::Primitive2DContainer SwOLEObj::tryToGetChartContentAs
}
}
- if(m_aPrimitive2DSequence.empty() && m_aRange.isEmpty() && xOLERef.is() && xOLERef.IsChart())
+ if (0 == m_aPrimitive2DSequence.getLength() && m_aRange.isEmpty() && xOLERef.is() && xOLERef.IsChart())
{
const uno::Reference< frame::XModel > aXModel(xOLERef->getComponent(), uno::UNO_QUERY);
@@ -1113,7 +1113,7 @@ drawinglayer::primitive2d::Primitive2DContainer SwOLEObj::tryToGetChartContentAs
}
}
- if(!m_aPrimitive2DSequence.empty() && !m_aRange.isEmpty())
+ if (0 != m_aPrimitive2DSequence.getLength() && !m_aRange.isEmpty())
{
// when we have data, also copy the buffered Range data as output
rRange = m_aRange;
@@ -1124,7 +1124,7 @@ drawinglayer::primitive2d::Primitive2DContainer SwOLEObj::tryToGetChartContentAs
void SwOLEObj::resetBufferedData()
{
- m_aPrimitive2DSequence = drawinglayer::primitive2d::Primitive2DContainer();
+ m_aPrimitive2DSequence = drawinglayer::primitive2d::Primitive2DSequence();
m_aRange.reset();
if(m_pDeflateData)
diff --git a/vcl/win/source/gdi/gdiimpl.cxx b/vcl/win/source/gdi/gdiimpl.cxx
index 621b90030aa2..a36420c34d4d 100644
--- a/vcl/win/source/gdi/gdiimpl.cxx
+++ b/vcl/win/source/gdi/gdiimpl.cxx
@@ -1921,7 +1921,7 @@ bool WinSalGraphicsImpl::drawPolyPolygonBezier( sal_uInt32 nPoly, const sal_uInt
}
void impAddB2DPolygonToGDIPlusGraphicsPathReal(
- Gdiplus::GpPath *pPath,
+ Gdiplus::GraphicsPath& rGraphicsPath,
const basegfx::B2DPolygon& rPolygon,
bool bNoLineJoin,
const basegfx::B2DVector* pLineWidths)
@@ -1966,12 +1966,11 @@ void impAddB2DPolygonToGDIPlusGraphicsPathReal(
aCb = aNext + ((aCa - aNext) * 0.3);
}
- Gdiplus::DllExports::GdipAddPathBezier(
- pPath,
- aCurr.getX(), aCurr.getY(),
- aCa.getX(), aCa.getY(),
- aCb.getX(), aCb.getY(),
- aNext.getX(), aNext.getY());
+ rGraphicsPath.AddBezier(
+ static_cast< Gdiplus::REAL >(aCurr.getX()), static_cast< Gdiplus::REAL >(aCurr.getY()),
+ static_cast< Gdiplus::REAL >(aCa.getX()), static_cast< Gdiplus::REAL >(aCa.getY()),
+ static_cast< Gdiplus::REAL >(aCb.getX()), static_cast< Gdiplus::REAL >(aCb.getY()),
+ static_cast< Gdiplus::REAL >(aNext.getX()), static_cast< Gdiplus::REAL >(aNext.getY()));
}
else
{
@@ -1983,25 +1982,22 @@ void impAddB2DPolygonToGDIPlusGraphicsPathReal(
// based on line width to have something relative to current metrics
if (!basegfx::fTools::equalZero(pLineWidths->getX()))
{
- Gdiplus::DllExports::GdipAddPathLine(
- pPath,
- aCurr.getX(), aCurr.getY(),
- aNext.getX() + (pLineWidths->getX() * 0.1), aNext.getY());
+ rGraphicsPath.AddLine(
+ static_cast< Gdiplus::REAL >(aCurr.getX()), static_cast< Gdiplus::REAL >(aCurr.getY()),
+ static_cast< Gdiplus::REAL >(aNext.getX() + (pLineWidths->getX() * 0.1)), static_cast< Gdiplus::REAL >(aNext.getY()));
}
else
{
- Gdiplus::DllExports::GdipAddPathLine(
- pPath,
- aCurr.getX(), aCurr.getY(),
- aNext.getX(), aNext.getY() + (pLineWidths->getY() * 0.1));
+ rGraphicsPath.AddLine(
+ static_cast< Gdiplus::REAL >(aCurr.getX()), static_cast< Gdiplus::REAL >(aCurr.getY()),
+ static_cast< Gdiplus::REAL >(aNext.getX()), static_cast< Gdiplus::REAL >(aNext.getY() + (pLineWidths->getY() * 0.1)));
}
}
else
{
- Gdiplus::DllExports::GdipAddPathLine(
- pPath,
- aCurr.getX(), aCurr.getY(),
- aNext.getX(), aNext.getY());
+ rGraphicsPath.AddLine(
+ static_cast< Gdiplus::REAL >(aCurr.getX()), static_cast< Gdiplus::REAL >(aCurr.getY()),
+ static_cast< Gdiplus::REAL >(aNext.getX()), static_cast< Gdiplus::REAL >(aNext.getY()));
}
}
@@ -2011,7 +2007,7 @@ void impAddB2DPolygonToGDIPlusGraphicsPathReal(
if (bNoLineJoin)
{
- Gdiplus::DllExports::GdipStartPathFigure(pPath);
+ rGraphicsPath.StartFigure();
}
}
}
@@ -2039,8 +2035,8 @@ bool WinSalGraphicsImpl::drawPolyPolygon(const basegfx::B2DPolyPolygon& rPolyPol
aGraphicsPath.StartFigure();
}
- impAddB2DPolygonToGDIPlusGraphicsPathReal(pPath, rPolyPolygon.getB2DPolygon(a), false, 0);
- Gdiplus::DllExports::GdipClosePathFigure(pPath);
+ impAddB2DPolygonToGDIPlusGraphicsPathReal(aGraphicsPath, rPolyPolygon.getB2DPolygon(a), false, 0);
+ aGraphicsPath.CloseFigure();
}
if (mrParent.getAntiAliasB2DDraw())
@@ -2098,60 +2094,60 @@ bool WinSalGraphicsImpl::drawPolyLine(
switch (eLineJoin)
{
- case basegfx::B2DLineJoin::NONE:
- {
- if (basegfx::fTools::more(rLineWidths.getX(), 0.0))
+ case basegfx::B2DLineJoin::B2DLINEJOIN_NONE:
{
- bNoLineJoin = true;
+ if (basegfx::fTools::more(rLineWidths.getX(), 0.0))
+ {
+ bNoLineJoin = true;
+ }
+ break;
+ }
+ case basegfx::B2DLineJoin::B2DLINEJOIN_BEVEL:
+ {
+ aPen.SetLineJoin(Gdiplus::LineJoinBevel);
+ break;
+ }
+ case basegfx::B2DLineJoin::B2DLINEJOIN_MITER:
+ {
+ const Gdiplus::REAL aMiterLimit(15.0);
+
+ aPen.SetMiterLimit(aMiterLimit);
+ // tdf#99165 MS's LineJoinMiter creates non standard conform miter additional
+ // graphics, somewhere clipped in some distance from the edge point, dependent
+ // of MiterLimit. The more default-like option is LineJoinMiterClipped, so use
+ // that instead
+ aPen.SetLineJoin(Gdiplus::LineJoinMiterClipped);
+ break;
+ }
+ case basegfx::B2DLineJoin::B2DLINEJOIN_ROUND:
+ {
+ aPen.SetLineJoin(Gdiplus::LineJoinRound);
+ break;
}
- break;
- }
- case basegfx::B2DLineJoin::Bevel:
- {
- aPen.SetLineJoin(Gdiplus::LineJoinBevel);
- break;
- }
- case basegfx::B2DLineJoin::Miter:
- {
- const Gdiplus::REAL aMiterLimit(15.0);
-
- aPen.SetMiterLimit(aMiterLimit);
- // tdf#99165 MS's LineJoinMiter creates non standard conform miter additional
- // graphics, somewhere clipped in some distance from the edge point, dependent
- // of MiterLimit. The more default-like option is LineJoinMiterClipped, so use
- // that instead
- aPen.SetLineJoin(Gdiplus::LineJoinMiterClipped);
- break;
- }
- case basegfx::B2DLineJoin::Round:
- {
- aPen.SetLineJoin(Gdiplus::LineJoinRound);
- break;
- }
}
switch (eLineCap)
{
- default: /*css::drawing::LineCap_BUTT*/
- {
- // nothing to do
- break;
- }
- case css::drawing::LineCap_ROUND:
- {
- aPen.SetStartCap(Gdiplus::LineCapRound);
- aPen.SetEndCap(Gdiplus::LineCapRound);
- break;
- }
- case css::drawing::LineCap_SQUARE:
- {
- aPen.SetStartCap(Gdiplus::LineCapSquare);
- aPen.SetEndCap(Gdiplus::LineCapSquare);
- break;
- }
+ default: /*css::drawing::LineCap_BUTT*/
+ {
+ // nothing to do
+ break;
+ }
+ case css::drawing::LineCap_ROUND:
+ {
+ aPen.SetStartCap(Gdiplus::LineCapRound);
+ aPen.SetEndCap(Gdiplus::LineCapRound);
+ break;
+ }
+ case css::drawing::LineCap_SQUARE:
+ {
+ aPen.SetStartCap(Gdiplus::LineCapSquare);
+ aPen.SetEndCap(Gdiplus::LineCapSquare);
+ break;
+ }
}
- impAddB2DPolygonToGDIPlusGraphicsPathReal(pPath, rPolygon, bNoLineJoin, &rLineWidths);
+ impAddB2DPolygonToGDIPlusGraphicsPathReal(aGraphicsPath, rPolygon, bNoLineJoin, &rLineWidths);
if (rPolygon.isClosed() && !bNoLineJoin)
{