summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2014-08-05 08:59:37 +0200
committerStephan Bergmann <sbergman@redhat.com>2014-08-05 08:59:37 +0200
commit8d023edc181e040e290c0e42aa71191f567de8fe (patch)
tree9ded00360ee020de79e4f1a8a5906fc7a0764f05
parent5e2b4da10caaa15ee7e846c42ada2a20218d9591 (diff)
Consistency around SdrOnOffItem in svx/sdshitm.hxx
...similar to what has been done for svx/sdtmfitm.hxx in 6a2ea81ca1622d2c2ad55bea8ddc28167fcc2794 "Remove unused ctors" and 68969cc61adecac481ae9656978ef952f435b310 "Consistency around SdrMetricItem." Change-Id: Id712c222034ef807ea2d7bc459e78882e948aca6
-rw-r--r--cui/source/tabpages/tpshadow.cxx6
-rw-r--r--filter/source/msfilter/msdffimp.cxx2
-rw-r--r--include/svx/sdshitm.hxx11
-rw-r--r--sc/source/core/data/postit.cxx4
-rw-r--r--sc/source/core/tool/detfunc.cxx2
-rw-r--r--sc/source/filter/excel/xiescher.cxx2
-rw-r--r--sd/source/core/drawdoc4.cxx8
-rw-r--r--sd/source/core/stlpool.cxx2
-rw-r--r--svx/sdi/svx.sdi2
-rw-r--r--svx/sdi/svxitems.sdi2
-rw-r--r--svx/source/customshapes/EnhancedCustomShape2d.cxx6
-rw-r--r--svx/source/customshapes/EnhancedCustomShapeFontWork.cxx2
-rw-r--r--svx/source/engine3d/float3d.cxx2
-rw-r--r--svx/source/sdr/primitive2d/sdrattributecreator.cxx2
-rw-r--r--svx/source/svdraw/svdattr.cxx2
-rw-r--r--svx/source/svdraw/svdedtv2.cxx4
-rw-r--r--svx/source/svdraw/svdibrow.cxx2
-rw-r--r--svx/source/svdraw/svdoashp.cxx10
-rw-r--r--svx/source/svdraw/svdotext.cxx4
-rw-r--r--svx/source/svdraw/svdotxtr.cxx2
-rw-r--r--sw/source/filter/ww8/ww8graf.cxx4
21 files changed, 38 insertions, 43 deletions
diff --git a/cui/source/tabpages/tpshadow.cxx b/cui/source/tabpages/tpshadow.cxx
index d1dfe228d8c2..13dc14245baf 100644
--- a/cui/source/tabpages/tpshadow.cxx
+++ b/cui/source/tabpages/tpshadow.cxx
@@ -255,9 +255,9 @@ bool SvxShadowTabPage::FillItemSet( SfxItemSet* rAttrs )
TriState eState = m_pTsbShowShadow->GetState();
if( m_pTsbShowShadow->IsValueChangedFromSaved() )
{
- SdrShadowItem aItem( sal::static_int_cast< sal_Bool >( eState ) );
+ SdrOnOffItem aItem( makeSdrShadowItem(sal::static_int_cast< sal_Bool >( eState )) );
pOld = GetOldItem( *rAttrs, SDRATTR_SHADOW );
- if ( !pOld || !( *(const SdrShadowItem*)pOld == aItem ) )
+ if ( !pOld || !( *(const SdrOnOffItem*)pOld == aItem ) )
{
rAttrs->Put( aItem );
bModified = true;
@@ -366,7 +366,7 @@ void SvxShadowTabPage::Reset( const SfxItemSet* rAttrs )
{
m_pTsbShowShadow->EnableTriState( false );
- if( ( ( const SdrShadowItem& ) rAttrs->Get( SDRATTR_SHADOW ) ).GetValue() )
+ if( ( ( const SdrOnOffItem& ) rAttrs->Get( SDRATTR_SHADOW ) ).GetValue() )
m_pTsbShowShadow->SetState( TRISTATE_TRUE );
else
{
diff --git a/filter/source/msfilter/msdffimp.cxx b/filter/source/msfilter/msdffimp.cxx
index 73a73d72b7c6..f3105e7cf704 100644
--- a/filter/source/msfilter/msdffimp.cxx
+++ b/filter/source/msfilter/msdffimp.cxx
@@ -2628,7 +2628,7 @@ void DffPropertyReader::ApplyAttributes( SvStream& rIn, SfxItemSet& rSet, DffObj
}
if ( bHasShadow )
- rSet.Put( SdrShadowItem( bHasShadow ) );
+ rSet.Put( makeSdrShadowItem( bHasShadow ) );
}
ApplyLineAttributes( rSet, rObjData.eShapeType ); // #i28269#
ApplyFillAttributes( rIn, rSet, rObjData );
diff --git a/include/svx/sdshitm.hxx b/include/svx/sdshitm.hxx
index 7613870cabea..ab8a2b868a4d 100644
--- a/include/svx/sdshitm.hxx
+++ b/include/svx/sdshitm.hxx
@@ -22,14 +22,9 @@
#include <svx/sdooitm.hxx>
#include <svx/svddef.hxx>
-/*
- * class SdrShadowItem
- */
-class SdrShadowItem: public SdrOnOffItem {
-public:
- SdrShadowItem(bool bShadow=false): SdrOnOffItem(SDRATTR_SHADOW, bShadow) {}
- SdrShadowItem(SvStream& rIn): SdrOnOffItem(SDRATTR_SHADOW, rIn) {}
-};
+inline SdrOnOffItem makeSdrShadowItem(bool bShadow) {
+ return SdrOnOffItem(SDRATTR_SHADOW, bShadow);
+}
#endif
diff --git a/sc/source/core/data/postit.cxx b/sc/source/core/data/postit.cxx
index 673640f15f6f..433138ddfbba 100644
--- a/sc/source/core/data/postit.cxx
+++ b/sc/source/core/data/postit.cxx
@@ -123,7 +123,7 @@ void ScCaptionUtil::SetDefaultItems( SdrCaptionObj& rCaption, ScDocument& rDoc )
/* SdrShadowItem has sal_False, instead the shadow is set for the
rectangle only with SetSpecialTextBoxShadow() when the object is
created (item must be set to adjust objects from older files). */
- aItemSet.Put( SdrShadowItem( false ) );
+ aItemSet.Put( makeSdrShadowItem( false ) );
aItemSet.Put( SdrShadowXDistItem( 100 ) );
aItemSet.Put( SdrShadowYDistItem( 100 ) );
@@ -146,7 +146,7 @@ void ScCaptionUtil::SetCaptionItems( SdrCaptionObj& rCaption, const SfxItemSet&
// copy all items
rCaption.SetMergedItemSet( rItemSet );
// reset shadow items
- rCaption.SetMergedItem( SdrShadowItem( false ) );
+ rCaption.SetMergedItem( makeSdrShadowItem( false ) );
rCaption.SetMergedItem( SdrShadowXDistItem( 100 ) );
rCaption.SetMergedItem( SdrShadowYDistItem( 100 ) );
rCaption.SetSpecialTextBoxShadow();
diff --git a/sc/source/core/tool/detfunc.cxx b/sc/source/core/tool/detfunc.cxx
index 102155cc6eb8..6e12d9c31fd8 100644
--- a/sc/source/core/tool/detfunc.cxx
+++ b/sc/source/core/tool/detfunc.cxx
@@ -214,7 +214,7 @@ ScCommentData::ScCommentData( ScDocument& rDoc, SdrModel* pModel ) :
// SdrShadowItem has sal_False, instead the shadow is set for the rectangle
// only with SetSpecialTextBoxShadow when the object is created
// (item must be set to adjust objects from older files)
- aCaptionSet.Put( SdrShadowItem( false ) );
+ aCaptionSet.Put( makeSdrShadowItem( false ) );
aCaptionSet.Put( SdrShadowXDistItem( 100 ) );
aCaptionSet.Put( SdrShadowYDistItem( 100 ) );
diff --git a/sc/source/filter/excel/xiescher.cxx b/sc/source/filter/excel/xiescher.cxx
index b14ae22aa031..1791ef31b957 100644
--- a/sc/source/filter/excel/xiescher.cxx
+++ b/sc/source/filter/excel/xiescher.cxx
@@ -768,7 +768,7 @@ void XclImpDrawObjBase::ConvertFrameStyle( SdrObject& rSdrObj, sal_uInt16 nFrame
{
if( ::get_flag( nFrameFlags, EXC_OBJ_FRAME_SHADOW ) )
{
- rSdrObj.SetMergedItem( SdrShadowItem( true ) );
+ rSdrObj.SetMergedItem( makeSdrShadowItem( true ) );
rSdrObj.SetMergedItem( SdrShadowXDistItem( 35 ) );
rSdrObj.SetMergedItem( SdrShadowYDistItem( 35 ) );
rSdrObj.SetMergedItem( SdrShadowColorItem( GetPalette().GetColor( EXC_COLOR_WINDOWTEXT ) ) );
diff --git a/sd/source/core/drawdoc4.cxx b/sd/source/core/drawdoc4.cxx
index f15d1e5406d8..f4ba67f30864 100644
--- a/sd/source/core/drawdoc4.cxx
+++ b/sd/source/core/drawdoc4.cxx
@@ -175,7 +175,7 @@ void SdDrawDocument::CreateLayoutTemplates()
rISet.Put(XFillBitmapItem(pPool, Graphic(aNullBmp)));
// Shadow attributes (Drawing Engine)
- rISet.Put(SdrShadowItem(false));
+ rISet.Put(makeSdrShadowItem(false));
rISet.Put(SdrShadowColorItem(RGB_Color(COL_GRAY)));
rISet.Put(SdrShadowXDistItem(200)); // 3 mm Shadow distance
rISet.Put(SdrShadowYDistItem(200));
@@ -283,7 +283,7 @@ void SdDrawDocument::CreateLayoutTemplates()
pSheet->SetHelpId( aHelpFile, HID_POOLSHEET_OBJWITHSHADOW );
pISet = &pSheet->GetItemSet();
- pISet->Put(SdrShadowItem(true));
+ pISet->Put(makeSdrShadowItem(true));
pISet->Put(SdrShadowColorItem(RGB_Color(COL_GRAY)));
pISet->Put(SdrShadowXDistItem(200)); // 3 mm shadow distance
pISet->Put(SdrShadowYDistItem(200));
@@ -382,7 +382,7 @@ void SdDrawDocument::CreateLayoutTemplates()
pISet->Put(XFillStyleItem(drawing::FillStyle_SOLID));
pISet->Put(XFillColorItem(OUString(), RGB_Color(COL_CYAN)));
- pISet->Put(SdrShadowItem(true));
+ pISet->Put(makeSdrShadowItem(true));
pISet->Put(SdrShadowColorItem(RGB_Color(COL_GRAY)));
pISet->Put(SdrShadowXDistItem(200)); // 2 mm shadow distance
pISet->Put(SdrShadowYDistItem(200));
@@ -406,7 +406,7 @@ void SdDrawDocument::CreateLayoutTemplates()
Color aOrange4(255, 204, 153);
pISet->Put(XFillColorItem(OUString(), aOrange4));
- pISet->Put(SdrShadowItem(true));
+ pISet->Put(makeSdrShadowItem(true));
pISet->Put(SdrShadowColorItem(RGB_Color(COL_GRAY)));
pISet->Put(SdrShadowXDistItem(200)); // 2 mm shadow distance
pISet->Put(SdrShadowYDistItem(200));
diff --git a/sd/source/core/stlpool.cxx b/sd/source/core/stlpool.cxx
index 79475e5184be..824e05af097f 100644
--- a/sd/source/core/stlpool.cxx
+++ b/sd/source/core/stlpool.cxx
@@ -486,7 +486,7 @@ void SdStyleSheetPool::CreateLayoutStyleSheets(const OUString& rLayoutName, bool
pSheet->SetHelpId( aHelpFile, HID_PSEUDOSHEET_BACKGROUNDOBJECTS );
pSheet->SetParent( OUString() );
SfxItemSet& rBackgroundObjectsSet = pSheet->GetItemSet();
- rBackgroundObjectsSet.Put(SdrShadowItem(false));
+ rBackgroundObjectsSet.Put(makeSdrShadowItem(false));
rBackgroundObjectsSet.Put(SdrShadowColorItem(Color(COL_GRAY)));
rBackgroundObjectsSet.Put(SdrShadowXDistItem(200)); // 3 mm shadow distance
rBackgroundObjectsSet.Put(SdrShadowYDistItem(200));
diff --git a/svx/sdi/svx.sdi b/svx/sdi/svx.sdi
index 3673283f1f68..374c6fb525cb 100644
--- a/svx/sdi/svx.sdi
+++ b/svx/sdi/svx.sdi
@@ -10308,7 +10308,7 @@ SvxShadowItem BorderShadow SID_ATTR_BORDER_SHADOW
]
-SdrShadowItem FillShadow SID_ATTR_FILL_SHADOW
+SdrOnOffItem FillShadow SID_ATTR_FILL_SHADOW
[
/* flags: */
diff --git a/svx/sdi/svxitems.sdi b/svx/sdi/svxitems.sdi
index c59fa1642c43..cdfea2419f14 100644
--- a/svx/sdi/svxitems.sdi
+++ b/svx/sdi/svxitems.sdi
@@ -389,7 +389,7 @@ item BOOL SvxWordLineModeItem;
item SvxCellHorJustifyEnum SvxHorJustifyItem;
item SvxCellVerJustifyEnum SvxVerJustifyItem;
item SvxCellOrientationEnum SvxOrientationItem;
-item BOOL SdrShadowItem;
+item BOOL SdrOnOffItem;
item INT16 SdrTextFitToSizeTypeItem; // enum
item String SfxStringListItem; // serialized into one concatenated string
item double SvxDoubleItem;
diff --git a/svx/source/customshapes/EnhancedCustomShape2d.cxx b/svx/source/customshapes/EnhancedCustomShape2d.cxx
index 8d42e38b1ac9..8fee03473b8e 100644
--- a/svx/source/customshapes/EnhancedCustomShape2d.cxx
+++ b/svx/source/customshapes/EnhancedCustomShape2d.cxx
@@ -1987,7 +1987,7 @@ void EnhancedCustomShape2d::CreateSubPath( sal_uInt16& rSrcPt, sal_uInt16& rSegm
aClosedPolyPolygon.setClosed(true);
SdrPathObj* pFill = new SdrPathObj(OBJ_POLY, aClosedPolyPolygon, dBrightness);
SfxItemSet aTempSet(*this);
- aTempSet.Put(SdrShadowItem(false));
+ aTempSet.Put(makeSdrShadowItem(false));
aTempSet.Put(XLineStyleItem(XLINE_NONE));
pFill->SetMergedItemSet(aTempSet);
rObjectList.push_back(pFill);
@@ -2003,7 +2003,7 @@ void EnhancedCustomShape2d::CreateSubPath( sal_uInt16& rSrcPt, sal_uInt16& rSegm
aNewB2DPolyPolygon.isClosed() ? OBJ_POLY : OBJ_PLIN,
aNewB2DPolyPolygon, dBrightness);
SfxItemSet aTempSet(*this);
- aTempSet.Put(SdrShadowItem(false));
+ aTempSet.Put(makeSdrShadowItem(false));
aTempSet.Put(XFillStyleItem(drawing::FillStyle_NONE));
pStroke->SetMergedItemSet(aTempSet);
rObjectList.push_back(pStroke);
@@ -2013,7 +2013,7 @@ void EnhancedCustomShape2d::CreateSubPath( sal_uInt16& rSrcPt, sal_uInt16& rSegm
{
SdrPathObj* pObj = 0;
SfxItemSet aTempSet(*this);
- aTempSet.Put(SdrShadowItem(false));
+ aTempSet.Put(makeSdrShadowItem(false));
if(bNoFill)
{
diff --git a/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx b/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx
index 1371caaedbf5..f46a514946af 100644
--- a/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx
+++ b/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx
@@ -812,7 +812,7 @@ SdrObject* CreateSdrObjectFromParagraphOutlines( const FWData& rFWData, const Sd
SfxItemSet aSet( pCustomShape->GetMergedItemSet() );
aSet.ClearItem( SDRATTR_TEXTDIRECTION ); //SJ: vertical writing is not required, by removing this item no outliner is created
- aSet.Put(SdrShadowItem(false)); // #i37011# NO shadow for FontWork geometry
+ aSet.Put(makeSdrShadowItem(false)); // #i37011# NO shadow for FontWork geometry
pRet->SetMergedItemSet( aSet ); // * otherwise we would crash, because the outliner tries to create a Paraobject, but there is no model
}
return pRet;
diff --git a/svx/source/engine3d/float3d.cxx b/svx/source/engine3d/float3d.cxx
index 2c6cf4b82bd6..3b5f45fa2d7c 100644
--- a/svx/source/engine3d/float3d.cxx
+++ b/svx/source/engine3d/float3d.cxx
@@ -1871,7 +1871,7 @@ void Svx3DWin::GetAttr( SfxItemSet& rAttrs )
{
bool bValue = TRISTATE_TRUE == eState;
rAttrs.Put(Svx3DShadow3DItem(bValue));
- rAttrs.Put(SdrShadowItem(bValue));
+ rAttrs.Put(makeSdrShadowItem(bValue));
}
else
{
diff --git a/svx/source/sdr/primitive2d/sdrattributecreator.cxx b/svx/source/sdr/primitive2d/sdrattributecreator.cxx
index 858d1aa4569a..ac87b70dc334 100644
--- a/svx/source/sdr/primitive2d/sdrattributecreator.cxx
+++ b/svx/source/sdr/primitive2d/sdrattributecreator.cxx
@@ -335,7 +335,7 @@ namespace drawinglayer
attribute::SdrShadowAttribute createNewSdrShadowAttribute(const SfxItemSet& rSet)
{
- const bool bShadow(((SdrShadowItem&)rSet.Get(SDRATTR_SHADOW)).GetValue());
+ const bool bShadow(((SdrOnOffItem&)rSet.Get(SDRATTR_SHADOW)).GetValue());
if(bShadow)
{
diff --git a/svx/source/svdraw/svdattr.cxx b/svx/source/svdraw/svdattr.cxx
index 83460b717f69..df7399e8eb37 100644
--- a/svx/source/svdraw/svdattr.cxx
+++ b/svx/source/svdraw/svdattr.cxx
@@ -128,7 +128,7 @@ SdrItemPool::SdrItemPool(
}
// init own PoolDefaults
- mppLocalPoolDefaults[SDRATTR_SHADOW -SDRATTR_START]=new SdrShadowItem;
+ mppLocalPoolDefaults[SDRATTR_SHADOW -SDRATTR_START]=new SdrOnOffItem(SDRATTR_SHADOW, false);
mppLocalPoolDefaults[SDRATTR_SHADOWCOLOR -SDRATTR_START]=new SdrShadowColorItem(aNullCol);
mppLocalPoolDefaults[SDRATTR_SHADOWXDIST -SDRATTR_START]=new SdrShadowXDistItem;
mppLocalPoolDefaults[SDRATTR_SHADOWYDIST -SDRATTR_START]=new SdrShadowYDistItem;
diff --git a/svx/source/svdraw/svdedtv2.cxx b/svx/source/svdraw/svdedtv2.cxx
index cf03ff5de51b..1825434d9ea3 100644
--- a/svx/source/svdraw/svdedtv2.cxx
+++ b/svx/source/svdraw/svdedtv2.cxx
@@ -1541,11 +1541,11 @@ void SdrEditView::ImpDismantleOneObject(const SdrObject* pObj, SdrObjList& rOL,
DBG_ASSERT(pCandidate, "SdrEditView::ImpDismantleOneObject: Could not clone SdrObject (!)");
pCandidate->SetModel(pCustomShape->GetModel());
- if(((SdrShadowItem&)pCustomShape->GetMergedItem(SDRATTR_SHADOW)).GetValue())
+ if(((SdrOnOffItem&)pCustomShape->GetMergedItem(SDRATTR_SHADOW)).GetValue())
{
if(pReplacement->ISA(SdrObjGroup))
{
- pCandidate->SetMergedItem(SdrShadowItem(true));
+ pCandidate->SetMergedItem(makeSdrShadowItem(true));
}
}
diff --git a/svx/source/svdraw/svdibrow.cxx b/svx/source/svdraw/svdibrow.cxx
index 05de58c280bd..13f270303709 100644
--- a/svx/source/svdraw/svdibrow.cxx
+++ b/svx/source/svdraw/svdibrow.cxx
@@ -756,7 +756,7 @@ bool IsItemIneffective(sal_uInt16 nWhich, const SfxItemSet* pSet, sal_uInt16& rI
case SDRATTR_SHADOWPERSP : {
rIndent=1;
if (ImpGetItem(*pSet,SDRATTR_SHADOW,pItem)) {
- bool bShadow=((const SdrShadowItem*)pItem)->GetValue();
+ bool bShadow=((const SdrOnOffItem*)pItem)->GetValue();
if (!bShadow) return true;
}
} break;
diff --git a/svx/source/svdraw/svdoashp.cxx b/svx/source/svdraw/svdoashp.cxx
index 177771473fe7..bb6304b40a5b 100644
--- a/svx/source/svdraw/svdoashp.cxx
+++ b/svx/source/svdraw/svdoashp.cxx
@@ -206,7 +206,7 @@ static bool ImpVerticalSwitch( const SdrObjCustomShape& rCustoShape )
SdrObject* ImpCreateShadowObjectClone(const SdrObject& rOriginal, const SfxItemSet& rOriginalSet)
{
SdrObject* pRetval = 0L;
- const bool bShadow(((SdrShadowItem&)rOriginalSet.Get(SDRATTR_SHADOW)).GetValue());
+ const bool bShadow(((SdrOnOffItem&)rOriginalSet.Get(SDRATTR_SHADOW)).GetValue());
if(bShadow)
{
@@ -280,7 +280,7 @@ SdrObject* ImpCreateShadowObjectClone(const SdrObject& rOriginal, const SfxItemS
aTempSet.Put( SvxWritingModeItem( com::sun::star::text::WritingMode_LR_TB, SDRATTR_TEXTDIRECTION ) );
// no shadow
- aTempSet.Put(SdrShadowItem(false));
+ aTempSet.Put(makeSdrShadowItem(false));
aTempSet.Put(SdrShadowXDistItem(0L));
aTempSet.Put(SdrShadowYDistItem(0L));
@@ -456,7 +456,7 @@ const SdrObject* SdrObjCustomShape::GetSdrObjectShadowFromCustomShape() const
if(pSdrObject)
{
const SfxItemSet& rOriginalSet = GetObjectItemSet();
- const bool bShadow(((SdrShadowItem&)rOriginalSet.Get( SDRATTR_SHADOW )).GetValue());
+ const bool bShadow(((SdrOnOffItem&)rOriginalSet.Get( SDRATTR_SHADOW )).GetValue());
if(bShadow)
{
@@ -2906,10 +2906,10 @@ SdrObject* SdrObjCustomShape::DoConvertToPolyObj(bool bBezier, bool bAddText) co
if(pRetval)
{
- const bool bShadow(((SdrShadowItem&)GetMergedItem(SDRATTR_SHADOW)).GetValue());
+ const bool bShadow(((SdrOnOffItem&)GetMergedItem(SDRATTR_SHADOW)).GetValue());
if(bShadow)
{
- pRetval->SetMergedItem(SdrShadowItem(true));
+ pRetval->SetMergedItem(makeSdrShadowItem(true));
}
}
diff --git a/svx/source/svdraw/svdotext.cxx b/svx/source/svdraw/svdotext.cxx
index 225d0dd958bd..45860352dec5 100644
--- a/svx/source/svdraw/svdotext.cxx
+++ b/svx/source/svdraw/svdotext.cxx
@@ -618,7 +618,7 @@ void SdrTextObj::ImpSetContourPolygon( SdrOutliner& rOutliner, Rectangle& rAncho
// test if shadow needs to be avoided for TakeContour()
const SfxItemSet& rSet = GetObjectItemSet();
- bool bShadowOn = ((SdrShadowItem&)(rSet.Get(SDRATTR_SHADOW))).GetValue();
+ bool bShadowOn = ((SdrOnOffItem&)(rSet.Get(SDRATTR_SHADOW))).GetValue();
// #i33696#
// Remember TextObject currently set at the DrawOutliner, it WILL be
@@ -630,7 +630,7 @@ void SdrTextObj::ImpSetContourPolygon( SdrOutliner& rOutliner, Rectangle& rAncho
{
// force shadow off
SdrObject* pCopy = Clone();
- pCopy->SetMergedItem(SdrShadowItem(false));
+ pCopy->SetMergedItem(makeSdrShadowItem(false));
*pContourPolyPolygon = pCopy->TakeContour();
SdrObject::Free( pCopy );
}
diff --git a/svx/source/svdraw/svdotxtr.cxx b/svx/source/svdraw/svdotxtr.cxx
index 22bc44f4be8a..e4da47df32eb 100644
--- a/svx/source/svdraw/svdotxtr.cxx
+++ b/svx/source/svdraw/svdotxtr.cxx
@@ -372,7 +372,7 @@ SdrObject* SdrTextObj::ImpConvertContainedTextToSdrPathObjs(bool bToPoly) const
SdrPathObj* pPathObj = 0;
// always clear objectshadow; this is included in the extraction
- aAttributeSet.Put(SdrShadowItem(false));
+ aAttributeSet.Put(makeSdrShadowItem(false));
if(rCandidate.getIsFilled())
{
diff --git a/sw/source/filter/ww8/ww8graf.cxx b/sw/source/filter/ww8/ww8graf.cxx
index a488e494e386..1445ce55bad7 100644
--- a/sw/source/filter/ww8/ww8graf.cxx
+++ b/sw/source/filter/ww8/ww8graf.cxx
@@ -231,7 +231,7 @@ static void SetStdAttr( SfxItemSet& rSet, WW8_DP_LINETYPE& rL,
}
}
if( SVBT16ToShort( rSh.shdwpi ) ){ // shadow
- rSet.Put(SdrShadowItem(true));
+ rSet.Put(makeSdrShadowItem(true));
rSet.Put( SdrShadowXDistItem( SVBT16ToShort( rSh.xaOffset ) ) );
rSet.Put( SdrShadowYDistItem( SVBT16ToShort( rSh.yaOffset ) ) );
}
@@ -1694,7 +1694,7 @@ void SwWW8ImplReader::MatchSdrItemsIntoFlySet( SdrObject* pSdrObj,
rFlySet.Put( aBox );
// Schattenwurf der Box: SvxShadowItem
- if( WW8ITEMVALUE(rOldSet, SDRATTR_SHADOW, SdrShadowItem) )
+ if( WW8ITEMVALUE(rOldSet, SDRATTR_SHADOW, SdrOnOffItem) )
{
SvxShadowItem aShadow( RES_SHADOW );
2021-09-02external/cairo: Avoid UBSan invalid-null-argumentStephan Bergmann ...as seen during CppunitTest_sw_uiwriter4: > [_RUN_____] SwUiWriterTest4::testEmojiAutoCorrect cairo-surface.c:2852:28: runtime error: null pointer passed as argument 2, which is declared to never be null > /usr/include/string.h:44:28: note: nonnull attribute specified here > #0 in _cairo_surface_show_text_glyphs at workdir/UnpackedTarball/cairo/src/cairo-surface.c:2852:9 (instdir/program/libcairo.so.2 +0x9ac09e) > #1 in _cairo_gstate_show_text_glyphs at workdir/UnpackedTarball/cairo/src/cairo-gstate.c:2077:15 (instdir/program/libcairo.so.2 +0x65a4af) > #2 in _cairo_default_context_glyphs at workdir/UnpackedTarball/cairo/src/cairo-default-context.c:1315:12 (instdir/program/libcairo.so.2 +0x62404f) > #3 in cairo_show_glyphs at workdir/UnpackedTarball/cairo/src/cairo.c:3629:14 (instdir/program/libcairo.so.2 +0xa6c77f) > #4 in CairoTextRender::DrawTextLayout(GenericSalLayout const&, SalGraphics const&) at vcl/unx/generic/gdi/cairotextrender.cxx:265:9 (instdir/program/libvcllo.so +0xae46aa3) Change-Id: Ifa22046bb35a872c4db38130a7ae4c9b758ccbc6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121473 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com> 2021-09-01augment CFLAGS for cairo instead of overwritingCaolán McNamara so CFLAGS containing msan's -fsanitize=memory are not discarded Change-Id: Ib46d060b7542bc3e1b19cdef84ae3f8ea7099b14 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121440 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> 2021-08-31upgrade internal cairo and pixman to 1.17.4 and 0.40.0Caolán McNamara cairo.RGB24_888.patch is split out from the rest of the unrelated patchfile it was in, this was introduced originally as: commit 54596087e57ea533253e19eea594d9b6c06e8d26 Author: Ashod Nakashian <ashod.nakashian@collabora.co.uk> Date: Sat Dec 9 16:28:42 2017 -0500 vcl-svp: add 24-bit (3-byte) RGB surface support to Cairo drop parts of pixman-ubsan.patch that no longer apply, which maybe casts doubt over the parts that do apply if they are still necessary Change-Id: Id1e8f112b1121b892c97ea248b101f133f03ac48 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121234 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> 2021-06-03external/cairo: Fix previous -fsanitize=alignment fixStephan Bergmann 13f6d80330208eeb45fe9a03bb462941fb4eda2a "external/cairo: Support building with ASan/UBSan" had added the src/cairo-image-source.c blob to external/cairo/cairo/san.patch.0 to fix > > cairo-image-source.c:512:10: runtime error: load of misaligned address 0x6180037aee6f for type 'uint32_t' (aka 'unsigned int'), which requires 4 byte alignment > during UITest_writer_tests7 I had created that patch attempting to do a faithful emulation of the original code (which I had naively assumed to be correct, modulo the alignment issue), reading four consecutive bytes and interpreting them as an uint32_t in the system's byte order. I had not noticed back then that all that CAIRO_FORMAT_RGB24_888 was added by external/cairo/cairo/cairo-1.10.2.patch, introduced with 54596087e57ea533253e19eea594d9b6c06e8d26 "vcl-svp: add 24-bit (3-byte) RGB surface support to Cairo". Its > + * @CAIRO_FORMAT_RGB24_888: each pixel is a 24-bit quantity, > + * with Red, Green, Blue taking 8-bits each, in that order. (Since 1.1x) and > + * Need this until CAIRO_FORMAT_RGB24_888 is in some official release. > + * Otherwise we can't reliably check if this is available or we should > + * convert from 24-bit RGB to 32-bit RGB before passing to Cairo. comments make it sound as if this code might come from some official cairo upstream branch, but I cannot find anything at git.freedesktop.org/git/cairo. I have no idea about the provenance and quality of that code. However, I now (a) from the above comments naively assume that the intent of CAIRO_FORMAT_RGB24_888 is to store R, G, B in that order in three bytes with increasing addresses (i.e., independent of the system's byte order for larger- than-byte words); (b) thus consider the original src/cairo-image-source.c code in external/cairo/cairo/cairo-1.10.2.patch broken (as it attempts to read all three values in one read, in system byte order, which would fail for big endian); and (c) thus consider the faithful emulation code in external/cairo/cairo/san.patch.0 to be broken, too. Based on the above, I here fix at least the external/cairo/cairo/san.patch.0 code (which is applied unconditionally, even for non-ASan/UBSan builds, thus always overriding the original external/cairo/cairo/cairo-1.10.2.patch code). The following line > pixel &= 0x00ffffff; /* ignore next pixel bits */ should no longer be necessary now, and it is probably better to directly fix the original code in external/cairo/cairo/cairo-1.10.2.patch, but I'll leave that for a potential follow-up fix, once the provenance and assumed quality of that original CAIRO_FORMAT_RGB24_888 code is clarified. (I came across this code now with a --without-system-cairo ASan/UBSan Linux build, where JunitTest_toolkit_unoapi_1 failed with > ==1060406==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x60300146fb48 at pc 0x7fff9b45b338 bp 0x7ffffffef1d0 sp 0x7ffffffef1c8 > READ of size 1 at 0x60300146fb48 thread T0 > Detaching from process 1060652 > #0 in _pixel_to_solid at workdir/UnpackedTarball/cairo/src/cairo-image-source.c:515:207 > #1 in _pixman_image_for_surface at workdir/UnpackedTarball/cairo/src/cairo-image-source.c:1309:22 > #2 in _pixman_image_for_pattern at workdir/UnpackedTarball/cairo/src/cairo-image-source.c:1574:9 > #3 in _cairo_image_source_create_for_pattern at workdir/UnpackedTarball/cairo/src/cairo-image-source.c:1619:2 > #4 in composite_aligned_boxes at workdir/UnpackedTarball/cairo/src/cairo-spans-compositor.c:678:8 > #5 in clip_and_composite_boxes at workdir/UnpackedTarball/cairo/src/cairo-spans-compositor.c:882:11 > #6 in _cairo_spans_compositor_mask at workdir/UnpackedTarball/cairo/src/cairo-spans-compositor.c:999:14 > #7 in _cairo_compositor_mask at workdir/UnpackedTarball/cairo/src/cairo-compositor.c:106:11 > #8 in _cairo_image_surface_mask at workdir/UnpackedTarball/cairo/src/cairo-image-surface.c:952:12 > #9 in _cairo_surface_mask at workdir/UnpackedTarball/cairo/src/cairo-surface.c:2247:14 > #10 in _cairo_gstate_mask at workdir/UnpackedTarball/cairo/src/cairo-gstate.c:1136:11 > #11 in _cairo_default_context_mask at workdir/UnpackedTarball/cairo/src/cairo-default-context.c:993:12 > #12 in cairo_mask at workdir/UnpackedTarball/cairo/src/cairo.c:2283:14 > #13 in SvpSalGraphics::drawAlphaBitmap(SalTwoRect const&, SalBitmap const&, SalBitmap const&) at vcl/headless/svpgdi.cxx:745:5 > #14 in SalGraphics::DrawAlphaBitmap(SalTwoRect const&, SalBitmap const&, SalBitmap const&, OutputDevice const&) at vcl/source/gdi/salgdilayout.cxx:832:16 > #15 in OutputDevice::DrawDeviceAlphaBitmap(Bitmap const&, AlphaMask const&, Point const&, Size const&, Point const&, Size const&) at vcl/source/outdev/bitmap.cxx:704:29 > #16 in OutputDevice::DrawDeviceBitmap(Point const&, Size const&, Point const&, Size const&, BitmapEx&) at vcl/source/outdev/bitmap.cxx:516:9 > #17 in OutputDevice::DrawBitmapEx(Point const&, Size const&, Point const&, Size const&, BitmapEx const&, MetaActionType) at vcl/source/outdev/bitmap.cxx:391:9 > #18 in OutputDevice::DrawBitmapEx(Point const&, Size const&, BitmapEx const&) at vcl/source/outdev/bitmap.cxx:292:9 > #19 in OutputDevice::DrawTransformedBitmapEx(basegfx::B2DHomMatrix const&, BitmapEx const&, double) at vcl/source/outdev/bitmap.cxx:1315:9 > #20 in drawinglayer::processor2d::VclProcessor2D::RenderBitmapPrimitive2D(drawinglayer::primitive2d::BitmapPrimitive2D const&) at drawinglayer/source/processor2d/vclprocessor2d.cxx:394:21 > #21 in drawinglayer::processor2d::VclPixelProcessor2D::processBitmapPrimitive2D(drawinglayer::primitive2d::BitmapPrimitive2D const&) at drawinglayer/source/processor2d/vclpixelprocessor2d.cxx:524:5 > #22 in drawinglayer::processor2d::VclPixelProcessor2D::processBasePrimitive2D(drawinglayer::primitive2d::BasePrimitive2D const&) at drawinglayer/source/processor2d/vclpixelprocessor2d.cxx:252:13 > #23 in drawinglayer::processor2d::BaseProcessor2D::process(drawinglayer::primitive2d::Primitive2DContainer const&) at drawinglayer/source/processor2d/baseprocessor2d.cxx:69:25 > #24 in drawinglayer::processor2d::VclProcessor2D::RenderTransformPrimitive2D(drawinglayer::primitive2d::TransformPrimitive2D const&) at drawinglayer/source/processor2d/vclprocessor2d.cxx:912:5 > #25 in drawinglayer::processor2d::VclPixelProcessor2D::processBasePrimitive2D(drawinglayer::primitive2d::BasePrimitive2D const&) at drawinglayer/source/processor2d/vclpixelprocessor2d.cxx:317:13 > #26 in drawinglayer::processor2d::BaseProcessor2D::process(drawinglayer::primitive2d::Primitive2DContainer const&) at drawinglayer/source/processor2d/baseprocessor2d.cxx:69:25 > #27 in drawinglayer::processor2d::BaseProcessor2D::process(drawinglayer::primitive2d::BasePrimitive2D const&) at drawinglayer/source/processor2d/baseprocessor2d.cxx:46:13 > #28 in drawinglayer::processor2d::VclPixelProcessor2D::processBasePrimitive2D(drawinglayer::primitive2d::BasePrimitive2D const&) at drawinglayer/source/processor2d/vclpixelprocessor2d.cxx:434:13 > #29 in drawinglayer::processor2d::BaseProcessor2D::process(drawinglayer::primitive2d::Primitive2DContainer const&) at drawinglayer/source/processor2d/baseprocessor2d.cxx:69:25 > #30 in sdr::contact::ObjectContactOfPageView::DoProcessDisplay(sdr::contact::DisplayInfo&) at svx/source/sdr/contact/objectcontactofpageview.cxx:279:31 > #31 in sdr::contact::ObjectContactOfPageView::ProcessDisplay(sdr::contact::DisplayInfo&) at svx/source/sdr/contact/objectcontactofpageview.cxx:116:21 > #32 in SdrPageWindow::RedrawAll(sdr::contact::ViewObjectContactRedirector*) at svx/source/svdraw/sdrpagewindow.cxx:353:28 > #33 in SdrPageView::CompleteRedraw(SdrPaintWindow&, vcl::Region const&, sdr::contact::ViewObjectContactRedirector*) at svx/source/svdraw/svdpagv.cxx:239:18 > #34 in SdrPaintView::DoCompleteRedraw(SdrPaintWindow&, vcl::Region const&, sdr::contact::ViewObjectContactRedirector*) at svx/source/svdraw/svdpntv.cxx:606:21 > #35 in SdrPaintView::CompleteRedraw(OutputDevice*, vcl::Region const&, sdr::contact::ViewObjectContactRedirector*) at svx/source/svdraw/svdpntv.cxx:519:5 > #36 in sd::View::CompleteRedraw(OutputDevice*, vcl::Region const&, sdr::contact::ViewObjectContactRedirector*) at sd/source/ui/view/sdview.cxx:475:17 > #37 in sd::DrawView::CompleteRedraw(OutputDevice*, vcl::Region const&, sdr::contact::ViewObjectContactRedirector*) at sd/source/ui/view/drawview.cxx:520:21 > #38 in sd::DrawViewShell::Paint(tools::Rectangle const&, sd::Window*) at sd/source/ui/view/drviews5.cxx:420:17 > #39 in sd::Window::Paint(OutputDevice&, tools::Rectangle const&) at sd/source/ui/view/sdwindow.cxx:212:22 > #40 in PaintHelper::DoPaint(vcl::Region const*) at vcl/source/window/paint.cxx:313:20 > #41 in vcl::Window::ImplCallPaint(vcl::Region const*, ImplPaintFlags) at vcl/source/window/paint.cxx:616:17 > #42 in PaintHelper::~PaintHelper() at vcl/source/window/paint.cxx:552:30 > #43 in vcl::Window::ImplCallPaint(vcl::Region const*, ImplPaintFlags) at vcl/source/window/paint.cxx:622:1 > #44 in PaintHelper::~PaintHelper() at vcl/source/window/paint.cxx:552:30 > #45 in vcl::Window::ImplCallPaint(vcl::Region const*, ImplPaintFlags) at vcl/source/window/paint.cxx:622:1 > #46 in PaintHelper::~PaintHelper() at vcl/source/window/paint.cxx:552:30 > #47 in vcl::Window::ImplCallPaint(vcl::Region const*, ImplPaintFlags) at vcl/source/window/paint.cxx:622:1 > #48 in PaintHelper::~PaintHelper() at vcl/source/window/paint.cxx:552:30 > #49 in vcl::Window::ImplCallPaint(vcl::Region const*, ImplPaintFlags) at vcl/source/window/paint.cxx:622:1 > #50 in vcl::Window::PaintImmediately() at vcl/source/window/paint.cxx:1325:24 > #51 in vcl::Window::PaintImmediately() at vcl/source/window/paint.cxx:1269:39 > #52 in SvImpLBox::MyUserEvent(void*) at vcl/source/treelist/svimpbox.cxx:3063:18 > #53 in SvImpLBox::LinkStubMyUserEvent(void*, void*) at vcl/source/treelist/svimpbox.cxx:3057:1 > #54 in Link<void*, void>::Call(void*) const at include/tools/link.hxx:111:45 > #55 in ImplHandleUserEvent(ImplSVEvent*) at vcl/source/window/winproc.cxx:1991:30 > #56 in ImplWindowFrameProc(vcl::Window*, SalEvent, void const*) at vcl/source/window/winproc.cxx:2561:13 > #57 in SalFrame::CallCallback(SalEvent, void const*) const at vcl/inc/salframe.hxx:306:29 > #58 in SvpSalInstance::ProcessEvent(SalUserEventList::SalUserEvent) at vcl/headless/svpinst.cxx:312:22 > #59 in non-virtual thunk to SvpSalInstance::ProcessEvent(SalUserEventList::SalUserEvent) at vcl/headless/svpinst.cxx (instdir/program/libvcllo.so +0xae7a222) > #60 in SalUserEventList::DispatchUserEvents(bool)::$_0::operator()() const at vcl/source/app/salusereventlist.cxx:119:58 > #61 in SalUserEventList::DispatchUserEvents(bool) at vcl/source/app/salusereventlist.cxx:120:13 > #62 in SvpSalInstance::DoYield(bool, bool) at vcl/headless/svpinst.cxx:461:19 > #63 in ImplYield(bool, bool) at vcl/source/app/svapp.cxx:465:48 > #64 in Application::Yield() at vcl/source/app/svapp.cxx:532:5 > #65 in Application::Execute() at vcl/source/app/svapp.cxx:444:9 > #66 in desktop::Desktop::Main() at desktop/source/app/app.cxx:1587:13 > #67 in ImplSVMain() at vcl/source/app/svmain.cxx:198:35 > #68 in SVMain() at vcl/source/app/svmain.cxx:230:12 > #69 in soffice_main at desktop/source/app/sofficemain.cxx:98:12 > #70 in sal_main at desktop/source/app/main.c:49:15 > #71 in main at desktop/source/app/main.c:47:1 > #72 in __libc_start_main at /usr/src/debug/glibc-2.33-8.fc34.x86_64/csu/../csu/libc-start.c:332:16 > #73 in _start at <null> (instdir/program/soffice.bin +0x251acd) > > 0x60300146fb48 is located 0 bytes to the right of 24-byte region [0x60300146fb30,0x60300146fb48) > allocated by thread T0 here: > #0 in operator new[](unsigned long) at ~/github.com/llvm/llvm-project/compiler-rt/lib/asan/asan_new_delete.cpp:102:3 > #1 in ImplCreateDIB(Size const&, vcl::PixelFormat, BitmapPalette const&) at vcl/headless/svpbmp.cxx:126:24 > #2 in SvpSalBitmap::Create(Size const&, vcl::PixelFormat, BitmapPalette const&) at vcl/headless/svpbmp.cxx:156:13 > #3 in Bitmap::Bitmap(Size const&, vcl::PixelFormat, BitmapPalette const*) at vcl/source/bitmap/bitmap.cxx:135:15 > #4 in Bitmap::Crop(tools::Rectangle const&) at vcl/source/bitmap/bitmap.cxx:489:20 > #5 in BitmapEx::Crop(tools::Rectangle const&) at vcl/source/bitmap/BitmapEx.cxx:360:25 > #6 in drawinglayer::primitive2d::DiscreteShadow::getLeft() const at drawinglayer/source/primitive2d/discreteshadowprimitive2d.cxx:148:61 > #7 in drawinglayer::primitive2d::DiscreteShadowPrimitive2D::create2DDecomposition(drawinglayer::primitive2d::Primitive2DContainer&, drawinglayer::geometry::ViewInformation2D const&) const at drawinglayer/source/primitive2d/discreteshadowprimitive2d.cxx:251:72 > #8 in drawinglayer::primitive2d::BufferedDecompositionPrimitive2D::get2DDecomposition(drawinglayer::primitive2d::Primitive2DDecompositionVisitor&, drawinglayer::geometry::ViewInformation2D const&) const at drawinglayer/source/primitive2d/baseprimitive2d.cxx:122:9 > #9 in drawinglayer::primitive2d::DiscreteMetricDependentPrimitive2D::get2DDecomposition(drawinglayer::primitive2d::Primitive2DDecompositionVisitor&, drawinglayer::geometry::ViewInformation2D const&) const at drawinglayer/source/primitive2d/primitivetools2d.cxx:48:47 trying to read the fourth byte of a presumed uint32_t starting at offset 21 of a 24-byte buffer.) Change-Id: Ibe8bc39e3736c64ace61af2217100c9d8bb96d5c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116637 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com> 2021-06-01cairo: just register and use external fontconfigJan-Marek Glogowski Except for the pixman include, the ANDROID cairo external is the same then the other OS use. It also builds fontconfig, so there is really no need to depend on the source (ok, this way it can be a bit more parallel, if nothing is generated). But the build nevertheless always sets includes for fontconfig anyway. And the code implied you can build Android without --disable-dynloading. Change-Id: I9970dc5c052b6fa80588233244c6828079d8277e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116554 Tested-by: Jenkins Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de> 2021-06-01cairo: Drop config for WNT and MACOSX buildJan-Marek Glogowski It's not used on these platforms since a long time. Change-Id: Idac41f1be0a546fd8aa0dd88709ebfa3255a104e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116555 Tested-by: Jenkins Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de> 2021-05-05WASM: add initial support for Emscripten cross buildJan-Marek Glogowski - configure with: - --host=wasm64-local-emscripten - had to make a few externals optional, so adding: - --disable-nss - --disable-cmis - --disable-curl Change-Id: I48d1c73d2675ad2e2beaf2c341578199efbd24ee Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111130 Tested-by: Jenkins Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de> 2020-12-29external/cairo: Fix mask usage in image-compositorStephan Bergmann Change-Id: Id3d8e4715e295290e07146ef06898b313ead57a5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108449 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com> 2020-10-30external/cairo: Silence some more UBSan warningsStephan Bergmann ...seen when opening an Impress presentation on GNOME/X11: > cairo-xlib-source.c:570:26: runtime error: left shift of 191 by 24 places cannot be represented in type 'int' > cairo-xlib-render-compositor.c:1852:17: runtime error: left shift of negative value -186 > cairo-xlib-render-compositor.c:1853:17: runtime error: left shift of negative value -646 > cairo-xlib-surface-shm.c:1157:43: runtime error: member access within null pointer of type 'cairo_xlib_shm_surface_t' (aka 'struct _cairo_xlib_shm_surface') > cairo-fixed-private.h:252:8: runtime error: left shift of negative value -146048 Change-Id: I93a5706c2ec3f83bc56d75fc92817668eef57fdb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105074 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com> 2020-10-28external/cairo: Fix another UBSan invalid-shift-baseStephan Bergmann > pixman-utils.c:217:14: runtime error: left shift of 155 by 24 places cannot be represented in type 'int' ...which happened once while using the LO GUI Change-Id: I174a29e240f09576859308ada56fe240881f0dad Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104915 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com> 2020-10-20external/cairo: Support building with ASan/UBSanStephan Bergmann A full `make check screenshot` required lots of little "harmless" fixes in pixman and cairo to address: > cairo-image-compositor.c:133:34: runtime error: left shift of 255 by 24 places cannot be represented in type 'int' during CppunitTest_emfio_emf > pixman-fast-path.c:3089:23: runtime error: left shift of 255 by 24 places cannot be represented in type 'int' during CppunitTest_emfio_emf > pixman-sse2.c:5019:17: runtime error: load of misaligned address 0x7f99303dbac5 for type 'uint32_t' (aka 'unsigned int'), which requires 4 byte alignment during CppunitTest_emfio_emf > cairo-fixed-private.h:64:14: runtime error: left shift of negative value -8388608 during CppunitTest_emfio_wmf > pixman-sse2.c:6443:20: runtime error: left shift of 198 by 24 places cannot be represented in type 'int' during CppunitTest_filter_svg > pixman-sse2.c:5976:6: runtime error: load of misaligned address 0x629000163202 for type 'uint32_t' (aka 'unsigned int'), which requires 4 byte alignment during CppunitTest_filter_svg > pixman-sse2.c:3259:10: runtime error: load of misaligned address 0x606000c85761 for type 'uint32_t' (aka 'unsigned int'), which requires 4 byte alignment during CppunitTest_oox_vml > pixman-sse2.c:521:18: runtime error: load of misaligned address 0x607000ca9d41 for type 'const uint32_t' (aka 'const unsigned int'), which requires 4 byte alignment during CppunitTest_oox_vml > pixman-gradient-walker.c:196:14: runtime error: left shift of 255 by 24 places cannot be represented in type 'int' during CppunitTest_sc_tiledrendering > pixman-combine32.c:786:1: runtime error: left shift of 255 by 24 places cannot be represented in type 'int32_t' (aka 'int') during CppunitTest_vcl_backend_test > pixman-fast-path.c:2761:29: runtime error: left shift of negative value -99 during CppunitTest_xmloff_draw > pixman-bits-image.c:243:31: runtime error: left shift of negative value -99 during CppunitTest_xmloff_draw > pixman-bits-image.c:244:31: runtime error: left shift of negative value -9 during CppunitTest_sd_tiledrendering > pixman-fast-path.c:2762:29: runtime error: left shift of negative value -84 during CppunitTest_sw_rtfexport2 > cairo-gstate.c:2300:14: runtime error: null pointer passed as argument 1, which is declared to never be null during CppunitTest_sw_ooxmlexport8 > pixman-access.c:389:2: runtime error: left shift of 1 by 31 places cannot be represented in type 'int' during CppunitTest_sw_ooxmlexport15 > ERROR: AddressSanitizer: stack-use-after-scope on address 0x7ff264ae275c at pc 0x7ff238941795 bp 0x7fff6bbadb10 sp 0x7fff6bbadb08 > READ of size 4 at 0x7ff264ae275c thread T0 > #0 in _add_clipped_edge at workdir/UnpackedTarball/cairo/src/cairo-polygon.c:351:24 (instdir/program/libcairo.so.2 +0x88c794) during CppunitTest_sw_odfexport > cairo-tor-scan-converter.c:1619:34: runtime error: left shift of negative value -39 during CppunitTest_sw_odfexport > ERROR: AddressSanitizer: stack-use-after-scope on address 0x7fe6ca085750 at pc 0x000000325c3a bp 0x7fff899bedd0 sp 0x7fff899be580 > READ of size 16 at 0x7fe6ca085750 thread T0 > #0 in __asan_memcpy at /home/sbergman/github.com/llvm/llvm-project/compiler-rt/lib/asan/asan_interceptors_memintrinsics.cpp:22:3 (workdir/LinkTarget/Executable/cppunittester +0x325c39) during CppunitTest_sw_odfexport > pixman-sse2.c:3352:14: runtime error: left shift of 65535 by 16 places cannot be represented in type 'int' during CppunitTest_sw_odfexport > cairo-gstate.c:2355:14: runtime error: null pointer passed as argument 1, which is declared to never be null during CppunitTest_basctl_dialogs_test > pixman-sse2.c:3537:10: runtime error: load of misaligned address 0x615000167682 for type 'uint32_t' (aka 'unsigned int'), which requires 4 byte alignment during CppunitTest_sc_screenshots > cairo-image-source.c:512:10: runtime error: load of misaligned address 0x6180037aee6f for type 'uint32_t' (aka 'unsigned int'), which requires 4 byte alignment during UITest_writer_tests7 Change-Id: Icd2a211df4751d8dbfd5903bfba424b4c4672999 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104572 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com> 2020-09-25Related: tdf#136980 cairo: avoid linking to freetype-2.8-only ...Miklos Vajna ... FT_Get_Var_Design_Coordinates This is meant to help producing binaries which run on Ubuntu 16.04. Change-Id: I7fc965c265d2ac97a6836df0829d3d4cd0cc9333 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103392 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins 2020-09-25tdf#136980 cairo: avoid linking to freetype-2.8 symbolsMiklos Vajna This is meant to help producing binaries on CentOS 7 which run on Ubuntu 16.04, when using internal cairo. Change-Id: Ie4cd3fe707225a951ec8a5fb49a755064701dcfa Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103378 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins