[Libreoffice-commits] core.git: sw/source
Stephan Bergmann
sbergman at redhat.com
Thu Feb 1 19:52:36 UTC 2018
sw/source/core/layout/pagechg.cxx | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
New commits:
commit 4a61006255c67bb6f9ac99107093a424a9de441e
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Thu Feb 1 15:12:26 2018 +0100
Remove < USHRT_MAX check that is presumably no longer needed
The check was like this ever since 84a3db80b4fd66c6854b3135b5f69b61fd828e62
"initial import" (and SwRootFrame::mnBrowseWidth---which the nWidth here is
ultimately assigned to---was also of type long back then). But the only use
of SwRootFrame::mnBrowseWidth, in the call to SwRootFrame::GetBrowseWidth at
> long nWidth = GetUpper() ? static_cast<SwRootFrame*>(GetUpper())->GetBrowseWidth() : 0;
in SwPageFrame::MakeAll (sw/source/core/layout/calcmove.cxx), assigns it to a
long nWidth that doesn't appear to be used in a context where it needs to be
restricted to USHORT values (at least not any longer?), so assume that initial
check against USHRT_MAX-2000 is no longer needed.
Change-Id: Ibac19ab9d3f5499e817cae0fed79c11a452314f4
Reviewed-on: https://gerrit.libreoffice.org/49096
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Stephan Bergmann <sbergman at redhat.com>
diff --git a/sw/source/core/layout/pagechg.cxx b/sw/source/core/layout/pagechg.cxx
index 58ffeed1a424..b6bbc0c90ff6 100644
--- a/sw/source/core/layout/pagechg.cxx
+++ b/sw/source/core/layout/pagechg.cxx
@@ -1761,10 +1761,10 @@ void SwRootFrame::ImplCalcBrowseWidth()
SwBorderAttrAccess aAccess( SwFrame::GetCache(), pFrame );
const SwBorderAttrs &rAttrs = *aAccess.Get();
const SwFormatHoriOrient &rHori = rAttrs.GetAttrSet().GetHoriOrient();
- long nWidth = rAttrs.GetSize().Width();
- if ( nWidth < USHRT_MAX-2000 && //-2k, because USHRT_MAX gets missing while trying to resize!
- text::HoriOrientation::FULL != rHori.GetHoriOrient() )
+ if ( text::HoriOrientation::FULL != rHori.GetHoriOrient() )
{
+ long nWidth = rAttrs.GetSize().Width();
+
const SwHTMLTableLayout *pLayoutInfo =
static_cast<const SwTabFrame *>(pFrame)->GetTable()
->GetHTMLTableLayout();
More information about the Libreoffice-commits
mailing list