[Libreoffice-commits] .: 3 commits - sc/qa sc/source
Markus Mohrhard
mmohrhard at kemper.freedesktop.org
Tue Dec 20 16:51:17 PST 2011
sc/qa/unit/ucalc.cxx | 4 ++--
sc/source/core/data/cell.cxx | 6 +++++-
sc/source/core/tool/token.cxx | 8 +++-----
sc/source/ui/namedlg/namedefdlg.cxx | 7 ++++---
4 files changed, 14 insertions(+), 11 deletions(-)
New commits:
commit 1623b021cf580d3f84d562b638cb034847792401
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date: Wed Dec 21 01:21:50 2011 +0100
set focus to Name Edit Line in Define Names dialog
diff --git a/sc/source/ui/namedlg/namedefdlg.cxx b/sc/source/ui/namedlg/namedefdlg.cxx
index 9f87047..1f33565 100644
--- a/sc/source/ui/namedlg/namedefdlg.cxx
+++ b/sc/source/ui/namedlg/namedefdlg.cxx
@@ -115,10 +115,11 @@ ScNameDefDlg::ScNameDefDlg( SfxBindings* pB, SfxChildWindow* pCW, Window* pParen
aRange.Format( aAreaStr, ABS_DREF3D, mpDoc,
ScAddress::Details(mpDoc->GetAddressConvention(), 0, 0) );
- Selection aCurSel = Selection( 0, SELECTION_MAX );
- maEdRange.GrabFocus();
maEdRange.SetText( aAreaStr );
- maEdRange.SetSelection( aCurSel );
+
+ Selection aCurSel = Selection( 0, SELECTION_MAX );
+ maEdName.GrabFocus();
+ maEdName.SetSelection( aCurSel );
}
void ScNameDefDlg::CancelPushed()
commit 16af1bd2094c38ab2bbf070340717ba8405abbb5
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date: Wed Dec 21 00:29:34 2011 +0100
full absolute refs in range names should be treated like normal abs refs
diff --git a/sc/source/core/tool/token.cxx b/sc/source/core/tool/token.cxx
index 50b3433..dcc08d4 100644
--- a/sc/source/core/tool/token.cxx
+++ b/sc/source/core/tool/token.cxx
@@ -1868,11 +1868,9 @@ bool SkipReference(ScToken* pToken, const ScAddress& rPos, const ScDocument* pOl
break;
}
}
- else
- {
- if (IsInCopyRange(aRange, pOldDoc))
- return true;
- }
+
+ if (IsInCopyRange(aRange, pOldDoc))
+ return true;
return false;
}
commit 64e416d42af6e315bd9e06ab638294a906cae219
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date: Tue Dec 20 23:55:43 2011 +0100
fix small problem with range names in copy/paste
diff --git a/sc/qa/unit/ucalc.cxx b/sc/qa/unit/ucalc.cxx
index c3d47ef..f98195d 100644
--- a/sc/qa/unit/ucalc.cxx
+++ b/sc/qa/unit/ucalc.cxx
@@ -184,7 +184,7 @@ public:
CPPUNIT_TEST(testFunctionLists);
CPPUNIT_TEST(testToggleRefFlag);
CPPUNIT_TEST(testAutofilter);
- //CPPUNIT_TEST(testCopyPaste);
+ CPPUNIT_TEST(testCopyPaste);
CPPUNIT_TEST(testMergedCells);
CPPUNIT_TEST(testUpdateReference);
CPPUNIT_TEST_SUITE_END();
@@ -2738,8 +2738,8 @@ void Test::testCopyPaste()
//check values after copying
rtl::OUString aString;
m_pDoc->GetValue(1,1,1, aValue);
- CPPUNIT_ASSERT_MESSAGE("copied formula should return 2", aValue == 2);
m_pDoc->GetFormula(1,1,1, aString);
+ CPPUNIT_ASSERT_MESSAGE("copied formula should return 2", aValue == 2);
CPPUNIT_ASSERT_MESSAGE("formula string was not copied correctly", aString == aFormulaString);
m_pDoc->GetValue(0,1,1, aValue);
CPPUNIT_ASSERT_MESSAGE("copied value should be 1", aValue == 1);
diff --git a/sc/source/core/data/cell.cxx b/sc/source/core/data/cell.cxx
index a5d6df4..f7ea541 100644
--- a/sc/source/core/data/cell.cxx
+++ b/sc/source/core/data/cell.cxx
@@ -180,7 +180,11 @@ void adjustRangeName(ScToken* pToken, ScDocument& rNewDoc, const ScDocument* pOl
bNewGlobal = bOldGlobal;
pRangeData = new ScRangeData(*pOldRangeData, &rNewDoc);
ScTokenArray* pRangeNameToken = pRangeData->GetCode();
- pRangeNameToken->ReadjusteAbsolute3DReferences(pOldDoc, &rNewDoc, pRangeData->GetPos(), true);
+ if (rNewDoc.GetPool() != const_cast<ScDocument*>(pOldDoc)->GetPool())
+ {
+ pRangeNameToken->ReadjusteAbsolute3DReferences(pOldDoc, &rNewDoc, pRangeData->GetPos(), true);
+ }
+
bool bInserted;
if (bNewGlobal)
bInserted = rNewDoc.GetRangeName()->insert(pRangeData);
More information about the Libreoffice-commits
mailing list