diff options
author | Norbert Thiebaud <nthiebaud@gmail.com> | 2015-08-16 16:45:12 -0500 |
---|---|---|
committer | Norbert Thiebaud <nthiebaud@gmail.com> | 2015-08-17 02:07:43 +0000 |
commit | ef46917ff3163d3fdd5152bda5d16c4503b6ab69 (patch) | |
tree | 73271cd339b19964bc91157207565595774e98b5 /sw | |
parent | 2ce903c7b2d67a46c2fe2755cfaa66d98f2eddf2 (diff) |
Put Polygon from tools under tools:: namespace
Polygon is one of these names that Clash with some system objects
A similar work has been done earlier with PolyPolygon.
Change-Id: Icf2217cb2906292b7275760f1a16be0e150312f5
Reviewed-on: https://gerrit.libreoffice.org/17789
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Norbert Thiebaud <nthiebaud@gmail.com>
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/core/docnode/ndnotxt.cxx | 9 | ||||
-rw-r--r-- | sw/source/core/layout/fly.cxx | 2 | ||||
-rw-r--r-- | sw/source/core/layout/paintfrm.cxx | 12 | ||||
-rw-r--r-- | sw/source/core/unocore/unoframe.cxx | 4 | ||||
-rw-r--r-- | sw/source/filter/ww8/docxsdrexport.cxx | 2 | ||||
-rw-r--r-- | sw/source/filter/ww8/rtfattributeoutput.cxx | 2 | ||||
-rw-r--r-- | sw/source/filter/ww8/writerhelper.cxx | 10 | ||||
-rw-r--r-- | sw/source/filter/ww8/writerhelper.hxx | 4 | ||||
-rw-r--r-- | sw/source/filter/ww8/wrtw8esh.cxx | 2 | ||||
-rw-r--r-- | sw/source/filter/ww8/ww8graf.cxx | 2 | ||||
-rw-r--r-- | sw/source/filter/ww8/ww8par.cxx | 2 | ||||
-rw-r--r-- | sw/source/ui/envelp/labfmt.cxx | 2 |
12 files changed, 25 insertions, 28 deletions
diff --git a/sw/source/core/docnode/ndnotxt.cxx b/sw/source/core/docnode/ndnotxt.cxx index 4c891ce2bfaf..9b108233d2a3 100644 --- a/sw/source/core/docnode/ndnotxt.cxx +++ b/sw/source/core/docnode/ndnotxt.cxx @@ -116,7 +116,6 @@ const tools::PolyPolygon *SwNoTextNode::HasContour() const const MapMode aContourMap( bPixelGrf ? MAP_PIXEL : MAP_100TH_MM ); if( bPixelGrf ? !bPixelContour : aGrfMap != aContourMap ) { - // #i102238# double nGrfDPIx = 0.0; double nGrfDPIy = 0.0; { @@ -147,7 +146,7 @@ const tools::PolyPolygon *SwNoTextNode::HasContour() const sal_uInt16 nPolyCount = pContour->Count(); for( sal_uInt16 j=0; j<nPolyCount; j++ ) { - Polygon& rPoly = (*pContour)[j]; + tools::Polygon& rPoly = (*pContour)[j]; sal_uInt16 nCount = rPoly.GetSize(); for( sal_uInt16 i=0 ; i<nCount; i++ ) @@ -158,7 +157,7 @@ const tools::PolyPolygon *SwNoTextNode::HasContour() const else if( bPixelContour ) { rPoly[i] = pOutDev->PixelToLogic( rPoly[i], aGrfMap ); - // #i102238# + if ( nGrfDPIx != 0 && nGrfDPIy != 0 ) { rPoly[i] = Point( rPoly[i].getX() * pOutDev->GetDPIX() / nGrfDPIx, @@ -214,9 +213,7 @@ bool SwNoTextNode::GetContourAPI( tools::PolyPolygon &rContour ) const sal_uInt16 nPolyCount = rContour.Count(); for( sal_uInt16 j=0; j<nPolyCount; j++ ) { - // --> OD #i102238# - use the right <tools::PolyPolygon> instance - Polygon& rPoly = rContour[j]; - // <-- + tools::Polygon& rPoly = rContour[j]; sal_uInt16 nCount = rPoly.GetSize(); for( sal_uInt16 i=0 ; i<nCount; i++ ) diff --git a/sw/source/core/layout/fly.cxx b/sw/source/core/layout/fly.cxx index b2f98f11a927..1d054b95ebcd 100644 --- a/sw/source/core/layout/fly.cxx +++ b/sw/source/core/layout/fly.cxx @@ -2532,7 +2532,7 @@ bool SwFlyFrm::GetContour( tools::PolyPolygon& rContour, for ( sal_uInt16 j = 0, nPolyCount = rContour.Count(); j < nPolyCount; j++ ) { - Polygon& rPoly = rContour[ j ]; + tools::Polygon& rPoly = rContour[ j ]; for ( sal_uInt16 i = 0, nCount = rPoly.GetSize(); i < nCount; i++ ) { diff --git a/sw/source/core/layout/paintfrm.cxx b/sw/source/core/layout/paintfrm.cxx index aa562093383a..dc5847df166a 100644 --- a/sw/source/core/layout/paintfrm.cxx +++ b/sw/source/core/layout/paintfrm.cxx @@ -1929,10 +1929,10 @@ bool DrawFillAttributes( tools::PolyPolygon tempRegion; for (size_t i = 0; i < rPaintRegion.size(); ++i) { - tempRegion.Insert(Polygon(rPaintRegion[i].SVRect())); + tempRegion.Insert( tools::Polygon(rPaintRegion[i].SVRect())); } - basegfx::B2DPolyPolygon const maskRegion( - tempRegion.getB2DPolyPolygon()); + basegfx::B2DPolyPolygon const maskRegion( tempRegion.getB2DPolyPolygon()); + primitives.realloc(1); primitives[0] = new drawinglayer::primitive2d::MaskPrimitive2D( maskRegion, rSequence); @@ -2259,7 +2259,7 @@ void DrawGraphic( aTmpGrf.Intersection( rOut ); if ( aTmpGrf.HasArea() ) { - Polygon aGrfPoly( aTmpGrf.SVRect() ); + tools::Polygon aGrfPoly( aTmpGrf.SVRect() ); aDrawPoly.Insert( aGrfPoly ); } } @@ -6344,8 +6344,8 @@ static void lcl_paintBitmapExToRect(vcl::RenderContext *pOut, const Point& aPoin /*static*/ void SwPageFrm::PaintNotesSidebarArrows(const Point &aMiddleFirst, const Point &aMiddleSecond, SwViewShell* _pViewShell, const Color& rColorUp, const Color& rColorDown) { - Polygon aTriangleUp(3); - Polygon aTriangleDown(3); + tools::Polygon aTriangleUp(3); + tools::Polygon aTriangleDown(3); aTriangleUp.SetPoint(aMiddleFirst + Point(0,_pViewShell->GetOut()->PixelToLogic(Size(0,-3)).Height()),0); aTriangleUp.SetPoint(aMiddleFirst + Point(_pViewShell->GetOut()->PixelToLogic(Size(-3,0)).Width(),_pViewShell->GetOut()->PixelToLogic(Size(0,3)).Height()),1); diff --git a/sw/source/core/unocore/unoframe.cxx b/sw/source/core/unocore/unoframe.cxx index eb204b90888b..1c0335b0d153 100644 --- a/sw/source/core/unocore/unoframe.cxx +++ b/sw/source/core/unocore/unoframe.cxx @@ -1474,7 +1474,7 @@ void SwXFrame::setPropertyValue(const :: OUString& rPropertyName, const :: uno:: const :: drawing::PointSequence* pPointSeq = aParam.getConstArray(); sal_Int32 nPoints = pPointSeq[i].getLength(); const :: awt::Point* pPoints = pPointSeq[i].getConstArray(); - Polygon aSet( (sal_uInt16)nPoints ); + tools::Polygon aSet( (sal_uInt16)nPoints ); for(sal_Int32 j = 0; j < nPoints; j++) { Point aPoint(pPoints[j].X, pPoints[j].Y); @@ -2038,7 +2038,7 @@ uno::Any SwXFrame::getPropertyValue(const OUString& rPropertyName) drawing::PointSequence* pPSeq = aPtSeq.getArray(); for(sal_uInt16 i = 0; i < aContour.Count(); i++) { - const Polygon& rPoly = aContour.GetObject(i); + const tools::Polygon& rPoly = aContour.GetObject(i); pPSeq[i].realloc(rPoly.GetSize()); awt::Point* pPoints = pPSeq[i].getArray(); for(sal_uInt16 j = 0; j < rPoly.GetSize(); j++) diff --git a/sw/source/filter/ww8/docxsdrexport.cxx b/sw/source/filter/ww8/docxsdrexport.cxx index 3d89f7c9bde4..ebbd6f4e5b84 100644 --- a/sw/source/filter/ww8/docxsdrexport.cxx +++ b/sw/source/filter/ww8/docxsdrexport.cxx @@ -684,7 +684,7 @@ void DocxSdrExport::startDMLAnchorInline(const SwFrameFormat* pFrameFormat, cons m_pImpl->m_pSerializer->startElementNS(XML_wp, XML_wrapPolygon, XML_edited, "0", FSEND); - Polygon aPoly = sw::util::CorrectWordWrapPolygonForExport(*pPolyPoly, pNd); + tools::Polygon aPoly = sw::util::CorrectWordWrapPolygonForExport(*pPolyPoly, pNd); for (sal_uInt16 i = 0; i < aPoly.GetSize(); ++i) m_pImpl->m_pSerializer->singleElementNS(XML_wp, (i == 0 ? XML_start : XML_lineTo), XML_x, OString::number(aPoly[i].X()), diff --git a/sw/source/filter/ww8/rtfattributeoutput.cxx b/sw/source/filter/ww8/rtfattributeoutput.cxx index f2416b47948d..72edde6d85f0 100644 --- a/sw/source/filter/ww8/rtfattributeoutput.cxx +++ b/sw/source/filter/ww8/rtfattributeoutput.cxx @@ -3803,7 +3803,7 @@ void RtfAttributeOutput::FlyFrameGraphic(const SwFlyFrameFormat* pFlyFrameFormat const tools::PolyPolygon* pPolyPoly = pNd->HasContour(); if (pPolyPoly && pPolyPoly->Count()) { - Polygon aPoly = sw::util::CorrectWordWrapPolygonForExport(*pPolyPoly, pNd); + tools::Polygon aPoly = sw::util::CorrectWordWrapPolygonForExport(*pPolyPoly, pNd); OStringBuffer aVerticies; for (sal_uInt16 i = 0; i < aPoly.GetSize(); ++i) aVerticies.append(";(").append(aPoly[i].X()).append(",").append(aPoly[i].Y()).append(")"); diff --git a/sw/source/filter/ww8/writerhelper.cxx b/sw/source/filter/ww8/writerhelper.cxx index e8db7a7a6092..f7a48f0c17b9 100644 --- a/sw/source/filter/ww8/writerhelper.cxx +++ b/sw/source/filter/ww8/writerhelper.cxx @@ -637,7 +637,7 @@ namespace sw return false; } - Polygon PolygonFromPolyPolygon(const tools::PolyPolygon &rPolyPoly) + tools::Polygon PolygonFromPolyPolygon(const tools::PolyPolygon &rPolyPoly) { if(1 == rPolyPoly.Count()) { @@ -663,12 +663,12 @@ namespace sw nPointCount = 0x0000ffff; } - Polygon aRetval((sal_uInt16)nPointCount); + tools::Polygon aRetval((sal_uInt16)nPointCount); sal_uInt32 nAppendIndex(0L); for(a = 0; a < rPolyPoly.Count(); a++) { - const Polygon& rCandidate = rPolyPoly[a]; + const tools::Polygon& rCandidate = rPolyPoly[a]; for(sal_uInt16 b(0); nAppendIndex <= nPointCount && b < rCandidate.GetSize(); b++) { @@ -680,9 +680,9 @@ namespace sw } } - Polygon CorrectWordWrapPolygonForExport(const tools::PolyPolygon& rPolyPoly, const SwNoTextNode* pNd) + tools::Polygon CorrectWordWrapPolygonForExport(const tools::PolyPolygon& rPolyPoly, const SwNoTextNode* pNd) { - Polygon aPoly(PolygonFromPolyPolygon(rPolyPoly)); + tools::Polygon aPoly(PolygonFromPolyPolygon(rPolyPoly)); const Size &rOrigSize = pNd->GetGraphic().GetPrefSize(); Fraction aMapPolyX(ww::nWrap100Percent, rOrigSize.Width()); Fraction aMapPolyY(ww::nWrap100Percent, rOrigSize.Height()); diff --git a/sw/source/filter/ww8/writerhelper.hxx b/sw/source/filter/ww8/writerhelper.hxx index c80e11990325..c4c9c922d77a 100644 --- a/sw/source/filter/ww8/writerhelper.hxx +++ b/sw/source/filter/ww8/writerhelper.hxx @@ -743,10 +743,10 @@ namespace sw @author <a href="mailto:cmc@openoffice.org">Caolán McNamara</a> */ - Polygon PolygonFromPolyPolygon(const tools::PolyPolygon &rPolyPoly); + tools::Polygon PolygonFromPolyPolygon(const tools::PolyPolygon &rPolyPoly); /// Undo all scaling / move tricks of the wrap polygon done during import. - Polygon CorrectWordWrapPolygonForExport(const tools::PolyPolygon& rPolyPoly, const SwNoTextNode* pNd); + tools::Polygon CorrectWordWrapPolygonForExport(const tools::PolyPolygon& rPolyPoly, const SwNoTextNode* pNd); /** Make setting a drawing object's layer in a Writer document easy diff --git a/sw/source/filter/ww8/wrtw8esh.cxx b/sw/source/filter/ww8/wrtw8esh.cxx index cfd231058376..763fb44b9287 100644 --- a/sw/source/filter/ww8/wrtw8esh.cxx +++ b/sw/source/filter/ww8/wrtw8esh.cxx @@ -2127,7 +2127,7 @@ sal_Int32 SwEscherEx::WriteFlyFrameAttr(const SwFrameFormat& rFormat, MSO_SPT eS const tools::PolyPolygon *pPolyPoly = pNd->HasContour(); if (pPolyPoly && pPolyPoly->Count()) { - Polygon aPoly = CorrectWordWrapPolygonForExport(*pPolyPoly, pNd); + tools::Polygon aPoly = CorrectWordWrapPolygonForExport(*pPolyPoly, pNd); SvMemoryStream aPolyDump; aPolyDump.SetEndian(SvStreamEndian::LITTLE); diff --git a/sw/source/filter/ww8/ww8graf.cxx b/sw/source/filter/ww8/ww8graf.cxx index c1200bd39f57..39b301eb55d2 100644 --- a/sw/source/filter/ww8/ww8graf.cxx +++ b/sw/source/filter/ww8/ww8graf.cxx @@ -424,7 +424,7 @@ SdrObject* SwWW8ImplReader::ReadPolyLine(WW8_DPHEAD* pHd, SfxAllItemSet &rSet) if (!bCouldRead) return 0; - Polygon aP( nCount ); + tools::Polygon aP( nCount ); Point aPt; for (sal_uInt16 i=0; i<nCount; ++i) { diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx index 7898e2da6a51..ca9008218a62 100644 --- a/sw/source/filter/ww8/ww8par.cxx +++ b/sw/source/filter/ww8/ww8par.cxx @@ -1071,7 +1071,7 @@ SdrObject* SwMSDffManager::ProcessObj(SvStream& rSt, } if (bOk) { - pImpRec->pWrapPolygon = new Polygon(nNumElemVert); + pImpRec->pWrapPolygon = new tools::Polygon(nNumElemVert); for (sal_uInt16 i = 0; i < nNumElemVert; ++i) { sal_Int32 nX(0), nY(0); diff --git a/sw/source/ui/envelp/labfmt.cxx b/sw/source/ui/envelp/labfmt.cxx index 2c7ff9b353cb..0d21573cf127 100644 --- a/sw/source/ui/envelp/labfmt.cxx +++ b/sw/source/ui/envelp/labfmt.cxx @@ -77,7 +77,7 @@ void DrawArrow(vcl::RenderContext& rRenderContext, const Point &rP1, const Point const Color& rFieldTextColor = SwViewOption::GetFontColor(); rRenderContext.SetFillColor(rFieldTextColor); - rRenderContext.DrawPolygon(Polygon(3, aArr)); + rRenderContext.DrawPolygon( tools::Polygon(3, aArr)); } else { |