[Libreoffice-commits] core.git: sc/inc sc/source
Eike Rathke
erack at redhat.com
Wed Apr 19 19:35:37 UTC 2017
sc/inc/address.hxx | 2 ++
sc/source/ui/app/inputhdl.cxx | 6 ++++--
sc/source/ui/formdlg/formula.cxx | 6 +++++-
3 files changed, 11 insertions(+), 3 deletions(-)
New commits:
commit ca8f4a66e44aed731646066241cf2225bb9f8c2a
Author: Eike Rathke <erack at redhat.com>
Date: Wed Apr 19 21:23:37 2017 +0200
Resolves: tdf#90799 generate absolute sheet for pointer-selected references
In the assumption that users who more use a pointer device to enter
references are also likely less familiar with the difference between
relative and absolute sheet references and its implication when copying
sheets, which some other spreadsheet software doesn't offer.
Change-Id: Ia1e16d1fef47429d4f4c100cac699bbc446ba6c9
diff --git a/sc/inc/address.hxx b/sc/inc/address.hxx
index f2ac3595b6c7..9203eec2928e 100644
--- a/sc/inc/address.hxx
+++ b/sc/inc/address.hxx
@@ -158,6 +158,8 @@ enum class ScRefFlags : sal_uInt16
TAB2_VALID = 0x4000,
VALID = 0x8000,
+ TAB_ABS_3D = TAB_ABS | TAB_3D,
+
ADDR_ABS = VALID | COL_ABS | ROW_ABS | TAB_ABS,
RANGE_ABS = ADDR_ABS | COL2_ABS | ROW2_ABS | TAB2_ABS,
diff --git a/sc/source/ui/app/inputhdl.cxx b/sc/source/ui/app/inputhdl.cxx
index 5e53c347a843..787835b0a4f5 100644
--- a/sc/source/ui/app/inputhdl.cxx
+++ b/sc/source/ui/app/inputhdl.cxx
@@ -3071,7 +3071,8 @@ void ScInputHandler::SetReference( const ScRange& rRef, ScDocument* pDoc )
// Reference to other document
OSL_ENSURE(rRef.aStart.Tab()==rRef.aEnd.Tab(), "nStartTab!=nEndTab");
- OUString aTmp(rRef.Format(ScRefFlags::VALID|ScRefFlags::TAB_3D, pDoc, aAddrDetails)); // Always 3D
+ // Always 3D and absolute.
+ OUString aTmp(rRef.Format( ScRefFlags::VALID | ScRefFlags::TAB_ABS_3D, pDoc, aAddrDetails));
SfxObjectShell* pObjSh = pDoc->GetDocumentShell();
// #i75893# convert escaped URL of the document to something user friendly
@@ -3095,7 +3096,8 @@ void ScInputHandler::SetReference( const ScRange& rRef, ScDocument* pDoc )
{
if ( rRef.aStart.Tab() != aCursorPos.Tab() ||
rRef.aStart.Tab() != rRef.aEnd.Tab() )
- aRefStr = rRef.Format(ScRefFlags::VALID|ScRefFlags::TAB_3D, pDoc, aAddrDetails);
+ // pointer-selected => absolute sheet reference
+ aRefStr = rRef.Format(ScRefFlags::VALID | ScRefFlags::TAB_ABS_3D, pDoc, aAddrDetails);
else
aRefStr = rRef.Format(ScRefFlags::VALID, pDoc, aAddrDetails);
}
diff --git a/sc/source/ui/formdlg/formula.cxx b/sc/source/ui/formdlg/formula.cxx
index b1d4dcebfe3c..9491ee964788 100644
--- a/sc/source/ui/formdlg/formula.cxx
+++ b/sc/source/ui/formdlg/formula.cxx
@@ -400,7 +400,8 @@ void ScFormulaDlg::SetReference( const ScRange& rRef, ScDocument* pRefDoc )
OSL_ENSURE(rRef.aStart.Tab()==rRef.aEnd.Tab(), "nStartTab!=nEndTab");
- OUString aTmp(rRef.Format(ScRefFlags::VALID|ScRefFlags::TAB_3D, pRefDoc)); // immer 3d
+ // Always 3D and absolute.
+ OUString aTmp( rRef.Format( ScRefFlags::VALID | ScRefFlags::TAB_ABS_3D, pRefDoc));
SfxObjectShell* pObjSh = pRefDoc->GetDocumentShell();
@@ -420,7 +421,10 @@ void ScFormulaDlg::SetReference( const ScRange& rRef, ScDocument* pRefDoc )
aRefData.InitRangeRel(rRef, m_CursorPos);
bool bSingle = aRefData.Ref1 == aRefData.Ref2;
if (m_CursorPos.Tab() != rRef.aStart.Tab())
+ {
aRefData.Ref1.SetFlag3D(true);
+ aRefData.Ref1.SetTabRel(false); // pointer-selected => absolute sheet reference
+ }
if (bSingle)
aArray.AddSingleReference(aRefData.Ref1);
else
More information about the Libreoffice-commits
mailing list