diff options
author | Caolán McNamara <caolanm@redhat.com> | 2017-11-30 15:55:00 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2017-11-30 21:25:57 +0100 |
commit | 36818bbfa985032f8e86f347e791fb52952971fd (patch) | |
tree | 10962d210fe434eb3d03dfc8722d51af4462df8a /sc | |
parent | 19b86af070453bb8671aefe7472012d19580dd81 (diff) |
ofz#4406 limit escher object cell area to calc's limits
Change-Id: I9b9b198f1f96c952692d052a9a527086e453779f
Reviewed-on: https://gerrit.libreoffice.org/45605
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/filter/excel/xlescher.cxx | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/sc/source/filter/excel/xlescher.cxx b/sc/source/filter/excel/xlescher.cxx index 8f2919b2f72b..eb70bc590ce7 100644 --- a/sc/source/filter/excel/xlescher.cxx +++ b/sc/source/filter/excel/xlescher.cxx @@ -146,10 +146,10 @@ tools::Rectangle XclObjAnchor::GetRect( const XclRoot& rRoot, SCTAB nScTab, MapU ScDocument& rDoc = rRoot.GetDoc(); double fScale = lclGetTwipsScale( eMapUnit ); tools::Rectangle aRect( - lclGetXFromCol( rDoc, nScTab, maFirst.mnCol, mnLX, fScale ), - lclGetYFromRow( rDoc, nScTab, maFirst.mnRow, mnTY, fScale ), - lclGetXFromCol( rDoc, nScTab, maLast.mnCol, mnRX + 1, fScale ), - lclGetYFromRow( rDoc, nScTab, maLast.mnRow, mnBY, fScale ) ); + lclGetXFromCol(rDoc, nScTab, std::min<SCCOL>(maFirst.mnCol, MAXCOL), mnLX, fScale), + lclGetYFromRow(rDoc, nScTab, std::min<SCROW>(maFirst.mnRow, MAXROW), mnTY, fScale), + lclGetXFromCol(rDoc, nScTab, std::min<SCCOL>(maLast.mnCol, MAXCOL), mnRX + 1, fScale), + lclGetYFromRow(rDoc, nScTab, std::min<SCROW>(maLast.mnRow, MAXROW), mnBY, fScale)); // adjust coordinates in mirrored sheets if( rDoc.IsLayoutRTL( nScTab ) ) |