Kaydet (Commit) b56479e8 authored tarafından Caolán McNamara's avatar Caolán McNamara

ofz#4211 Integer-overflow

Change-Id: I4e0f2c16d47639362d28d126a399b52d5180f16a
Reviewed-on: https://gerrit.libreoffice.org/44741Reviewed-by: 's avatarCaolán McNamara <caolanm@redhat.com>
Tested-by: 's avatarCaolán McNamara <caolanm@redhat.com>
üst 27e4a3c4
...@@ -413,7 +413,7 @@ void GetTextAreaOutline( const FWData& rFWData, const SdrObject* pCustomShape, F ...@@ -413,7 +413,7 @@ void GetTextAreaOutline( const FWData& rFWData, const SdrObject* pCustomShape, F
} }
} }
void GetFontWorkOutline( FWData& rFWData, const SdrObject* pCustomShape ) bool GetFontWorkOutline(FWData& rFWData, const SdrObject* pCustomShape)
{ {
SdrTextHorzAdjust eHorzAdjust( static_cast<const SdrTextHorzAdjustItem&>(pCustomShape->GetMergedItem( SDRATTR_TEXT_HORZADJUST )).GetValue() ); SdrTextHorzAdjust eHorzAdjust( static_cast<const SdrTextHorzAdjustItem&>(pCustomShape->GetMergedItem( SDRATTR_TEXT_HORZADJUST )).GetValue() );
drawing::TextFitToSizeType const eFTS( static_cast<const SdrTextFitToSizeTypeItem&>(pCustomShape->GetMergedItem( SDRATTR_TEXT_FITTOSIZE )).GetValue() ); drawing::TextFitToSizeType const eFTS( static_cast<const SdrTextFitToSizeTypeItem&>(pCustomShape->GetMergedItem( SDRATTR_TEXT_FITTOSIZE )).GetValue() );
...@@ -424,6 +424,9 @@ void GetFontWorkOutline( FWData& rFWData, const SdrObject* pCustomShape ) ...@@ -424,6 +424,9 @@ void GetFontWorkOutline( FWData& rFWData, const SdrObject* pCustomShape )
rFWData.nSingleLineHeight = (sal_Int32)( ( (double)pCustomShape->GetLogicRect().GetHeight() rFWData.nSingleLineHeight = (sal_Int32)( ( (double)pCustomShape->GetLogicRect().GetHeight()
/ rFWData.nMaxParagraphsPerTextArea ) * rFWData.fHorizontalTextScaling ); / rFWData.nMaxParagraphsPerTextArea ) * rFWData.fHorizontalTextScaling );
if (rFWData.nSingleLineHeight == SAL_MIN_INT32)
return false;
bool bSameLetterHeights = false; bool bSameLetterHeights = false;
const SdrCustomShapeGeometryItem& rGeometryItem = static_cast<const SdrCustomShapeGeometryItem&>(pCustomShape->GetMergedItem( SDRATTR_CUSTOMSHAPE_GEOMETRY )); const SdrCustomShapeGeometryItem& rGeometryItem = static_cast<const SdrCustomShapeGeometryItem&>(pCustomShape->GetMergedItem( SDRATTR_CUSTOMSHAPE_GEOMETRY ));
const css::uno::Any* pAny = rGeometryItem.GetPropertyValueByName( "TextPath", "SameLetterHeights" ); const css::uno::Any* pAny = rGeometryItem.GetPropertyValueByName( "TextPath", "SameLetterHeights" );
...@@ -507,6 +510,8 @@ void GetFontWorkOutline( FWData& rFWData, const SdrObject* pCustomShape ) ...@@ -507,6 +510,8 @@ void GetFontWorkOutline( FWData& rFWData, const SdrObject* pCustomShape )
} }
++aTextAreaIter; ++aTextAreaIter;
} }
return true;
} }
basegfx::B2DPolyPolygon GetOutlinesFromShape2d( const SdrObject* pShape2d ) basegfx::B2DPolyPolygon GetOutlinesFromShape2d( const SdrObject* pShape2d )
...@@ -867,8 +872,8 @@ SdrObject* EnhancedCustomShapeFontWork::CreateFontWork( const SdrObject* pShape2 ...@@ -867,8 +872,8 @@ SdrObject* EnhancedCustomShapeFontWork::CreateFontWork( const SdrObject* pShape2
CalculateHorizontalScalingFactor( pCustomShape, aFWData, aOutlines2d ); CalculateHorizontalScalingFactor( pCustomShape, aFWData, aOutlines2d );
/* retrieving the Outlines for the each Paragraph. */ /* retrieving the Outlines for the each Paragraph. */
if (!GetFontWorkOutline(aFWData, pCustomShape))
GetFontWorkOutline( aFWData, pCustomShape ); return nullptr;
FitTextOutlinesToShapeOutlines( aOutlines2d, aFWData ); FitTextOutlinesToShapeOutlines( aOutlines2d, aFWData );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment