svx/source/svdraw/svdotext.cxx | 14 ++--------- vcl/source/gdi/metaact.cxx | 51 +++++++++++++++++++++-------------------- 2 files changed, 30 insertions(+), 35 deletions(-)
New commits: commit 4ceb287c6d42940adf887f36c4f88abae44e0022 Author: Caolán McNamara <caol...@redhat.com> AuthorDate: Thu Mar 30 21:16:43 2023 +0100 Commit: Caolán McNamara <caol...@redhat.com> CommitDate: Thu Mar 30 22:02:31 2023 +0000 cid#1524600 Logically dead code since: commit 628275acb1b9652e65b8c5c013549dce5ad6f5bf Date: Thu Mar 23 11:24:30 2023 +0900 tdf#90407 Change the auto-fit alg. to match better with OOXML Change-Id: Ib315d7543229b6ddae0e3282be8cfdfb3f1bad13 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149776 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caol...@redhat.com> diff --git a/svx/source/svdraw/svdotext.cxx b/svx/source/svdraw/svdotext.cxx index 65f1dab7db65..52bf41312eed 100644 --- a/svx/source/svdraw/svdotext.cxx +++ b/svx/source/svdraw/svdotext.cxx @@ -1290,17 +1290,9 @@ void SdrTextObj::ImpAutoFitText(SdrOutliner& rOutliner, const Size& rTextSize, { const Size aCurrTextSize = rOutliner.CalcTextSizeNTP(); double fFactor = 1.0; - if( bIsVerticalWriting ) - { - if (aCurrTextSize.Width() != 0) - { - fFactor = double(rTextSize.Width())/aCurrTextSize.Width(); - } - } - else if (aCurrTextSize.Height() != 0) - { - fFactor = double(rTextSize.Height())/aCurrTextSize.Height(); - } + if (aCurrTextSize.Width() != 0) + fFactor = double(rTextSize.Width())/aCurrTextSize.Width(); + // fFactor scales in both x and y directions // - this is fine for bulleted words // - but it scales too much for a long paragraph commit 5af55a4b4ce86c61cb227822c016f0d51e03c009 Author: Caolán McNamara <caol...@redhat.com> AuthorDate: Thu Mar 30 21:10:40 2023 +0100 Commit: Caolán McNamara <caol...@redhat.com> CommitDate: Thu Mar 30 22:02:23 2023 +0000 ofz#57483 Out-of-memory Change-Id: Id5e920c16f005512a14e41d453f435826a9e7053 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149775 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caol...@redhat.com> diff --git a/vcl/source/gdi/metaact.cxx b/vcl/source/gdi/metaact.cxx index 2b8f0809b9fa..d410dfe35181 100644 --- a/vcl/source/gdi/metaact.cxx +++ b/vcl/source/gdi/metaact.cxx @@ -463,8 +463,35 @@ MetaPolyLineAction::MetaPolyLineAction( tools::Polygon aPoly, LineInfo aLineInfo maPoly (std::move( aPoly )) {} +static bool AllowDim(tools::Long nDim) +{ + static bool bFuzzing = utl::ConfigManager::IsFuzzing(); + if (bFuzzing) + { + if (nDim > 0x20000000 || nDim < -0x20000000) + { + SAL_WARN("vcl", "skipping huge dimension: " << nDim); + return false; + } + } + return true; +} + +static bool AllowPoint(const Point& rPoint) +{ + return AllowDim(rPoint.X()) && AllowDim(rPoint.Y()); +} + +static bool AllowRect(const tools::Rectangle& rRect) +{ + return AllowPoint(rRect.TopLeft()) && AllowPoint(rRect.BottomRight()); +} + void MetaPolyLineAction::Execute( OutputDevice* pOut ) { + if (!AllowRect(pOut->LogicToPixel(maPoly.GetBoundRect()))) + return; + if( maLineInfo.IsDefault() ) pOut->DrawPolyLine( maPoly ); else @@ -570,30 +597,6 @@ MetaTextAction::MetaTextAction( const Point& rPt, OUString aStr, mnLen ( nLen ) {} -static bool AllowDim(tools::Long nDim) -{ - static bool bFuzzing = utl::ConfigManager::IsFuzzing(); - if (bFuzzing) - { - if (nDim > 0x20000000 || nDim < -0x20000000) - { - SAL_WARN("vcl", "skipping huge dimension: " << nDim); - return false; - } - } - return true; -} - -static bool AllowPoint(const Point& rPoint) -{ - return AllowDim(rPoint.X()) && AllowDim(rPoint.Y()); -} - -static bool AllowRect(const tools::Rectangle& rRect) -{ - return AllowPoint(rRect.TopLeft()) && AllowPoint(rRect.BottomRight()); -} - void MetaTextAction::Execute( OutputDevice* pOut ) { if (!AllowDim(pOut->LogicToPixel(maPt).Y()))