[Libreoffice-commits] core.git: sc/inc sc/source
Eike Rathke
erack at redhat.com
Fri Jun 26 11:08:53 PDT 2015
sc/inc/refdata.hxx | 14 ++++++++++++++
sc/source/core/tool/compiler.cxx | 8 ++++----
2 files changed, 18 insertions(+), 4 deletions(-)
New commits:
commit dcbceb945b7a282c1a1309cf07e62ecc925e98f6
Author: Eike Rathke <erack at redhat.com>
Date: Fri Jun 26 20:05:54 2015 +0200
use ScComplexRefData::IsEntireCol() and IsEntireRow()
Change-Id: I4287019f5492825f6d295c4e364405f0d7329eb7
diff --git a/sc/inc/refdata.hxx b/sc/inc/refdata.hxx
index e0d9b80..c49682f 100644
--- a/sc/inc/refdata.hxx
+++ b/sc/inc/refdata.hxx
@@ -146,6 +146,20 @@ struct ScComplexRefData
tab if one sheet, or >=0 if more than one sheets. */
bool ValidExternal() const;
+ /** Whether this references entire columns, A:A */
+ inline bool IsEntireCol() const
+ {
+ // Both row anchors must be absolute.
+ return Ref1.Row() == 0 && Ref2.Row() == MAXROW && !Ref1.IsRowRel() && !Ref2.IsRowRel();
+ }
+
+ /** Whether this references entire rows, 1:1 */
+ inline bool IsEntireRow() const
+ {
+ // Both column anchors must be absolute.
+ return Ref1.Col() == 0 && Ref2.Col() == MAXCOL && !Ref1.IsColRel() && !Ref2.IsColRel();
+ }
+
SC_DLLPUBLIC ScRange toAbs( const ScAddress& rPos ) const;
void SetRange( const ScRange& rRange, const ScAddress& rPos );
diff --git a/sc/source/core/tool/compiler.cxx b/sc/source/core/tool/compiler.cxx
index 9251731..e75bce8 100644
--- a/sc/source/core/tool/compiler.cxx
+++ b/sc/source/core/tool/compiler.cxx
@@ -829,12 +829,12 @@ struct ConventionOOO_A1 : public Convention_A1
!ValidCol(rAbs2.Col()) || rRef.Ref2.IsColDeleted() || !ValidRow(rAbs2.Row()) || rRef.Ref2.IsRowDeleted())
return SINGLETON_NONE;
- // A:A or $A:$A or A:$A or $A:A, both row anchors must be absolute.
- if (rAbs1.Row() == 0 && rAbs2.Row() == MAXROW && !rRef.Ref1.IsRowRel() && !rRef.Ref2.IsRowRel())
+ // A:A or $A:$A or A:$A or $A:A
+ if (rRef.IsEntireCol())
return SINGLETON_COL;
- // 1:1 or $1:$1 or 1:$1 or $1:1, both column anchors must be absolute.
- if (rAbs1.Col() == 0 && rAbs2.Col() == MAXCOL && !rRef.Ref1.IsColRel() && !rRef.Ref2.IsColRel())
+ // 1:1 or $1:$1 or 1:$1 or $1:1
+ if (rRef.IsEntireRow())
return SINGLETON_ROW;
return SINGLETON_NONE;
More information about the Libreoffice-commits
mailing list