crashtesting: avoid eventual assert when double inf is cast to sal_Int32
seen on loading forum-mso-en4-604220.xlsx and asserting on export to ods lets assume that an infinite Y position equates to ALIGN_BOTTOM which is the case seen in this example, and assume the same for infinite X and ALIGN_RIGHT if it arises Change-Id: I009a9cd94b7bd9ed66e18f8dbbb9eb91d37eaa65 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168892 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
This commit is contained in:
parent
4890e08519
commit
64da52a947
1 changed files with 14 additions and 0 deletions
|
@ -1119,6 +1119,20 @@ std::shared_ptr<VTitle> lcl_createTitle( TitleHelper::eTitleType eType
|
|||
aNewPosition = RelativePositionHelper::getCenterOfAnchoredObject(
|
||||
awt::Point(static_cast<sal_Int32>(fX),static_cast<sal_Int32>(fY))
|
||||
, aTitleUnrotatedSize, aRelativePosition.Anchor, fAnglePi );
|
||||
|
||||
const bool bInfiniteY = std::isinf(aRelativePosition.Secondary);
|
||||
if (bInfiniteY)
|
||||
{
|
||||
SAL_WARN("chart2", "infinite aRelativePosition.Secondary position, using ALIGN_BOTTOM");
|
||||
aNewPosition.Y = rRemainingSpace.Y + rRemainingSpace.Height - aTitleSize.Height/2 - nYDistance;
|
||||
}
|
||||
|
||||
const bool bInfiniteX = std::isinf(aRelativePosition.Primary);
|
||||
if (bInfiniteX)
|
||||
{
|
||||
SAL_WARN("chart2", "infinite aRelativePosition.Primary position, using ALIGN_RIGHT");
|
||||
aNewPosition.X = rRemainingSpace.X + rRemainingSpace.Width - aTitleSize.Width/2 - nXDistance;
|
||||
}
|
||||
}
|
||||
else //auto position
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue