summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2015-06-30 12:42:06 +0200
committerEike Rathke <erack@redhat.com>2015-06-30 12:49:56 +0200
commit0ccefa0cb62da893556893bec2414c22cb2ad7b8 (patch)
treef92c2354d5cf17ccf082f9490b582f6a91c7ad2c
parentf43058753b6d9850261ab050d14de7b9e4ec8a37 (diff)
tdf#92427 entire column/row reference also if both sticky parts are relative
For example, convert A1:A1048576 to A:A but not A$1:A1048576 or A1:A$1048576 Change-Id: I7845134f79a04f7c031896d515ea1cb8050bd454
-rw-r--r--sc/source/core/tool/address.cxx19
1 files changed, 19 insertions, 0 deletions
diff --git a/sc/source/core/tool/address.cxx b/sc/source/core/tool/address.cxx
index 60d6d2e080db..0af90d6e838a 100644
--- a/sc/source/core/tool/address.cxx
+++ b/sc/source/core/tool/address.cxx
@@ -1502,6 +1502,25 @@ static sal_uInt16 lcl_ScRange_Parse_OOo( ScRange& rRange,
nRes2 |= SCA_COL_ABSOLUTE;
}
}
+ else if ((nRes1 & SCA_VALID) && (nRes2 & SCA_VALID))
+ {
+ // Flag entire column/row references so they can be displayed
+ // as such. If the sticky reference parts are not both
+ // absolute or relative, assume that the user thought about
+ // something we should not touch.
+ if (rRange.aStart.Row() == 0 && rRange.aEnd.Row() == MAXROW &&
+ ((nRes1 & SCA_ROW_ABSOLUTE) == 0) && ((nRes2 & SCA_ROW_ABSOLUTE) == 0))
+ {
+ nRes1 |= SCA_ROW_ABSOLUTE;
+ nRes2 |= SCA_ROW_ABSOLUTE;
+ }
+ else if (rRange.aStart.Col() == 0 && rRange.aEnd.Col() == MAXCOL &&
+ ((nRes1 & SCA_COL_ABSOLUTE) == 0) && ((nRes2 & SCA_COL_ABSOLUTE) == 0))
+ {
+ nRes1 |= SCA_COL_ABSOLUTE;
+ nRes2 |= SCA_COL_ABSOLUTE;
+ }
+ }
if (nRes1 && nRes2)
{
// PutInOrder / Justify