diff options
author | Kohei Yoshida <kohei.yoshida@gmail.com> | 2013-07-15 22:51:29 -0400 |
---|---|---|
committer | Kohei Yoshida <kohei.yoshida@gmail.com> | 2013-07-24 23:29:22 -0400 |
commit | c54616f62bc70a9d39abf8837a9d7c3031c80a41 (patch) | |
tree | ee05fa09b4d5769a9e4c0e056df3617907c46a7d /sc/source/core/tool/refdata.cxx | |
parent | f9856df0c9f16cd80a3a6f93f744d4df44457611 (diff) |
Start replacing CalcAbsIfRel() with toAbs().
To avoid changing the state of reference just to get absolute reference
position with respect to the base position.
I'm not finished with it yet.
Change-Id: I4a9db6dbf74aefb0a77de927a933cf4dab94bfd5
Diffstat (limited to 'sc/source/core/tool/refdata.cxx')
-rw-r--r-- | sc/source/core/tool/refdata.cxx | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/sc/source/core/tool/refdata.cxx b/sc/source/core/tool/refdata.cxx index fa479d04a441..aaca90361d7b 100644 --- a/sc/source/core/tool/refdata.cxx +++ b/sc/source/core/tool/refdata.cxx @@ -43,6 +43,24 @@ ScAddress ScSingleRefData::toAbs( const ScAddress& rPos ) const return ScAddress(nRetCol, nRetRow, nRetTab); } +void ScSingleRefData::SetAddress( const ScAddress& rAddr, const ScAddress& rPos ) +{ + if (Flags.bColRel) + nRelCol = rAddr.Col() - rPos.Col(); + else + nCol = rAddr.Col(); + + if (Flags.bRowRel) + nRelRow = rAddr.Row() - rPos.Row(); + else + nRow = rAddr.Row(); + + if (Flags.bTabRel) + nRelTab = rAddr.Tab() - rPos.Tab(); + else + nTab = rAddr.Tab(); +} + void ScSingleRefData::CalcAbsIfRel( const ScAddress& rPos ) { if ( Flags.bColRel ) |