sc/source/ui/view/output.cxx |   21 +++++++++++++++------
 1 file changed, 15 insertions(+), 6 deletions(-)

New commits:
commit 2255516e0e5f70a4c293cb468902f2b84cc93a60
Author:     Armin Le Grand <armin.le.gr...@cib.de>
AuthorDate: Thu Apr 19 18:56:55 2018 +0200
Commit:     Thorsten Behrens <thorsten.behr...@cib.de>
CommitDate: Sat Sep 1 01:30:29 2018 +0200

    tdf#115582 Correct coordinate usage for sc's ::Array
    
    In ScOutputData::SetCellRotations() eventually existing
    CellRotations are added to the svx::frame::Array data
    that gets created for repaint. This used the wrong coordinate
    calculation, thus in some cases the repaint of rotated
    Cells failed.
    
    Reviewed-on: https://gerrit.libreoffice.org/53171
    Tested-by: Jenkins <c...@libreoffice.org>
    Reviewed-by: Armin Le Grand <armin.le.gr...@cib.de>
    (cherry picked from commit 0185e65bcd73dbad2205a39369e1e06b33a2ca51)
    Reviewed-on: https://gerrit.libreoffice.org/54922
    (cherry picked from commit 08e45e11a0e74cdb4a17ec29df9d03ad03b7f7c0)
    
     Conflicts:
            sc/source/ui/view/output.cxx
    
    Change-Id: Ib5df8576e8c9404d717d5dcc5662aa04b82cf959
    Reviewed-on: https://gerrit.libreoffice.org/59874
    Reviewed-by: Thorsten Behrens <thorsten.behr...@cib.de>
    Tested-by: Thorsten Behrens <thorsten.behr...@cib.de>

diff --git a/sc/source/ui/view/output.cxx b/sc/source/ui/view/output.cxx
index b19182317874..3c5c9360e09c 100644
--- a/sc/source/ui/view/output.cxx
+++ b/sc/source/ui/view/output.cxx
@@ -642,13 +642,22 @@ void ScOutputData::SetCellRotations()
                         // Needed for CellInfo internal decisions (bg fill, 
...)
                         pInfo->nRotateDir = nDir;
 
-                        // add rotation info to Array information
-                        const long 
nAttrRotate(pPattern->GetRotateVal(pCondSet));
-                        const SvxRotateMode 
eRotMode((SvxRotateMode)static_cast<const 
SvxRotateModeItem&>(pPattern->GetItem(ATTR_ROTATE_MODE, pCondSet)).GetValue());
-                        const double fOrient((bLayoutRTL ? -1.0 : 1.0) * 
nAttrRotate * F_PI18000); // 1/100th degrees -> [0..2PI]
-                        svx::frame::Array& rArray = mrTabInfo.maArray;
+                        // create target coordinates
+                        const SCCOL nTargetX(nX - nVisX1 + 1);
+                        const SCROW nTargetY(nY - nVisY1 + 1);
 
-                        rArray.SetCellRotation(nY+1, nX+1, eRotMode, fOrient);
+                        // Check for values - below in SetCellRotation these 
will
+                        // be converted to size_t and thus may not be negative
+                        if(nTargetX >= 0 && nTargetY >= 0)
+                        {
+                            // add rotation info to Array information
+                            const long 
nAttrRotate(pPattern->GetRotateVal(pCondSet));
+                            const SvxRotateMode 
eRotMode((SvxRotateMode)static_cast<const 
SvxRotateModeItem&>(pPattern->GetItem(ATTR_ROTATE_MODE, pCondSet)).GetValue());
+                            const double fOrient((bLayoutRTL ? -1.0 : 1.0) * 
nAttrRotate * F_PI18000); // 1/100th degrees -> [0..2PI]
+                            svx::frame::Array& rArray = mrTabInfo.maArray;
+
+                            rArray.SetCellRotation(nTargetX, nTargetY, 
eRotMode, fOrient);
+                        }
                     }
                 }
             }
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to