Bugzilla – Attachment 157133 Details for
Bug 121074
Missing images in an XLSX on Linux and macOS (OK on Windows)
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
A sketch of possible fix
tdf121074.diff (text/plain), 2.89 KB, created by
Mike Kaganski
on 2020-01-13 22:17:49 UTC
(
hide
)
Description:
A sketch of possible fix
Filename:
MIME Type:
Creator:
Mike Kaganski
Created:
2020-01-13 22:17:49 UTC
Size:
2.89 KB
patch
obsolete
>diff --git a/sc/source/ui/unoobj/cellsuno.cxx b/sc/source/ui/unoobj/cellsuno.cxx >index 8920c1503765..89654004b9fe 100644 >--- a/sc/source/ui/unoobj/cellsuno.cxx >+++ b/sc/source/ui/unoobj/cellsuno.cxx >@@ -5721,6 +5721,40 @@ void ScCellRangeObj::SetOnePropertyValue( const SfxItemPropertySimpleEntry* pEnt > ScCellRangesBase::SetOnePropertyValue( pEntry, aValue ); > } > >+template <typename TTo, typename TFrom> struct RangeTTo_GE_RangeTFrom >+{ >+ static constexpr bool val >+ = std::numeric_limits<TTo>::min() <= std::numeric_limits<TFrom>::min() >+ && std::numeric_limits<TTo>::max() >= std::numeric_limits<TFrom>::max(); >+ static constexpr bool notval = !val; >+}; >+ >+template <typename TTo, typename TFrom> >+static constexpr std::enable_if_t<RangeTTo_GE_RangeTFrom<TTo, TFrom>::notval, TTo> LimitTo(TFrom x) >+{ >+ constexpr TFrom clampMin = std::numeric_limits<TTo>::min(); >+ constexpr TFrom clampMax = std::numeric_limits<TTo>::max(); >+ return std::clamp(x, clampMin, clampMax); >+} >+ >+template <typename TTo, typename TFrom> >+static constexpr std::enable_if_t<RangeTTo_GE_RangeTFrom<TTo, TFrom>::val, TTo> LimitTo(TFrom x) >+{ >+ return x; >+} >+ >+static css::awt::Point Point2AwtPoint(const Point& pt) >+{ >+ return css::awt::Point(LimitTo<decltype(css::awt::Point::X)>(pt.X()), >+ LimitTo<decltype(css::awt::Point::Y)>(pt.Y())); >+} >+ >+static css::awt::Size Size2AwtSize(const Size& sz) >+{ >+ return css::awt::Size(LimitTo<decltype(css::awt::Size::Width)>(sz.Width()), >+ LimitTo<decltype(css::awt::Size::Height)>(sz.Height())); >+} >+ > void ScCellRangeObj::GetOnePropertyValue( const SfxItemPropertySimpleEntry* pEntry, uno::Any& rAny ) > { > if ( pEntry ) >@@ -5734,8 +5768,7 @@ void ScCellRangeObj::GetOnePropertyValue( const SfxItemPropertySimpleEntry* pEnt > tools::Rectangle aMMRect(pDocSh->GetDocument().GetMMRect( > aRange.aStart.Col(), aRange.aStart.Row(), > aRange.aEnd.Col(), aRange.aEnd.Row(), aRange.aStart.Tab() )); >- awt::Point aPos( aMMRect.Left(), aMMRect.Top() ); >- rAny <<= aPos; >+ rAny <<= Point2AwtPoint(aMMRect.TopLeft()); > } > } > else if ( pEntry->nWID == SC_WID_UNO_SIZE ) >@@ -5747,9 +5780,7 @@ void ScCellRangeObj::GetOnePropertyValue( const SfxItemPropertySimpleEntry* pEnt > tools::Rectangle aMMRect = pDocSh->GetDocument().GetMMRect( > aRange.aStart.Col(), aRange.aStart.Row(), > aRange.aEnd.Col(), aRange.aEnd.Row(), aRange.aStart.Tab() ); >- Size aSize(aMMRect.GetSize()); >- awt::Size aAwtSize( aSize.Width(), aSize.Height() ); >- rAny <<= aAwtSize; >+ rAny <<= Size2AwtSize(aMMRect.GetSize()); > } > } > else
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 121074
:
146185
|
146186
|
146187
|
146216
|
146230
| 157133