summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorabdulmajeed ahmed <aalabdulrazzaq@kacst.edu.sa>2013-05-27 23:50:52 +0200
committerabdulmajeed ahmed <aalabdulrazzaq@kacst.edu.sa>2013-06-15 13:48:45 +0000
commit296834c2da5c5a9e733b209d68cdb831441e8a64 (patch)
tree8b1663245637ae5d02d9c0d78bbbc8d37d6e4daf /sc
parent846818afec377b5827fbdf8959ee2f1cf617e44d (diff)
prevent increase indent from running outside the cell
i have used ColWidth- SC_INDENT_STEP value to keep at lesat one letter inside the cell Change-Id: I08e121623ed1a55f6002a6a38586ab3d4fb8b850 Change-Id: I8d4518845f64044dea2f4ecd393cc625eebc6302 Reviewed-on: https://gerrit.libreoffice.org/4030 Reviewed-by: abdulmajeed ahmed <aalabdulrazzaq@kacst.edu.sa> Tested-by: abdulmajeed ahmed <aalabdulrazzaq@kacst.edu.sa>
Diffstat (limited to 'sc')
-rw-r--r--sc/source/core/data/attarray.cxx6
1 files changed, 4 insertions, 2 deletions
diff --git a/sc/source/core/data/attarray.cxx b/sc/source/core/data/attarray.cxx
index 074424739a31..631874b41631 100644
--- a/sc/source/core/data/attarray.cxx
+++ b/sc/source/core/data/attarray.cxx
@@ -1657,12 +1657,14 @@ void ScAttrArray::ChangeIndent( SCROW nStartRow, SCROW nEndRow, bool bIncrement
((const SvxHorJustifyItem*)pItem)->GetValue() != SVX_HOR_JUSTIFY_RIGHT ));
sal_uInt16 nOldValue = ((const SfxUInt16Item&)rOldSet.Get( ATTR_INDENT )).GetValue();
sal_uInt16 nNewValue = nOldValue;
+ //to keep Increment indent from running outside the cell1659
+ long nColWidth = (long)pDocument->GetColWidth(nCol,nTab);
if ( bIncrement )
{
- if ( nNewValue < SC_MAX_INDENT )
+ if ( nNewValue < nColWidth-SC_INDENT_STEP )
{
nNewValue += SC_INDENT_STEP;
- if ( nNewValue > SC_MAX_INDENT ) nNewValue = SC_MAX_INDENT;
+ if ( nNewValue > nColWidth-SC_INDENT_STEP ) nNewValue = nColWidth-SC_INDENT_STEP;
}
}
else