Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
core
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
LibreOffice
core
Commits
4f94e6c2
Kaydet (Commit)
4f94e6c2
authored
Ara 11, 2013
tarafından
Kohei Yoshida
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Fix paste as link, and a test case to catch it in the future.
Change-Id: I55fd3fabb7594ee2c635cc0b02dbf506bd5ab3df
üst
77e7301a
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
42 additions
and
2 deletions
+42
-2
ucalc.cxx
sc/qa/unit/ucalc.cxx
+38
-0
ucalc.hxx
sc/qa/unit/ucalc.hxx
+3
-1
column3.cxx
sc/source/core/data/column3.cxx
+1
-1
No files found.
sc/qa/unit/ucalc.cxx
Dosyayı görüntüle @
4f94e6c2
...
...
@@ -3171,6 +3171,44 @@ void Test::testCopyPaste()
m_pDoc
->
DeleteTab
(
0
);
}
void
Test
::
testCopyPasteAsLink
()
{
sc
::
AutoCalcSwitch
aACSwitch
(
*
m_pDoc
,
true
);
// Turn on auto calc.
m_pDoc
->
InsertTab
(
0
,
"Sheet1"
);
m_pDoc
->
InsertTab
(
1
,
"Sheet2"
);
m_pDoc
->
SetValue
(
ScAddress
(
0
,
0
,
0
),
1
);
// A1
m_pDoc
->
SetValue
(
ScAddress
(
0
,
1
,
0
),
2
);
// A2
m_pDoc
->
SetValue
(
ScAddress
(
0
,
2
,
0
),
3
);
// A3
ScRange
aRange
(
0
,
0
,
0
,
0
,
2
,
0
);
// Copy A1:A3 to clip.
ScDocument
aClipDoc
(
SCDOCMODE_CLIP
);
copyToClip
(
m_pDoc
,
aRange
,
&
aClipDoc
);
aRange
=
ScRange
(
1
,
1
,
1
,
1
,
3
,
1
);
// Paste to B2:B4 on Sheet2.
ScMarkData
aMark
;
aMark
.
SetMarkArea
(
aRange
);
// Paste range as link.
m_pDoc
->
CopyFromClip
(
aRange
,
aMark
,
IDF_CONTENTS
,
NULL
,
&
aClipDoc
,
true
,
true
);
// Check pasted content to make sure they reference the correct cells.
ScFormulaCell
*
pFC
=
m_pDoc
->
GetFormulaCell
(
ScAddress
(
1
,
1
,
1
));
CPPUNIT_ASSERT_MESSAGE
(
"This should be a formula cell."
,
pFC
);
CPPUNIT_ASSERT_EQUAL
(
1.0
,
pFC
->
GetValue
());
pFC
=
m_pDoc
->
GetFormulaCell
(
ScAddress
(
1
,
2
,
1
));
CPPUNIT_ASSERT_MESSAGE
(
"This should be a formula cell."
,
pFC
);
CPPUNIT_ASSERT_EQUAL
(
2.0
,
pFC
->
GetValue
());
pFC
=
m_pDoc
->
GetFormulaCell
(
ScAddress
(
1
,
3
,
1
));
CPPUNIT_ASSERT_MESSAGE
(
"This should be a formula cell."
,
pFC
);
CPPUNIT_ASSERT_EQUAL
(
3.0
,
pFC
->
GetValue
());
m_pDoc
->
DeleteTab
(
1
);
m_pDoc
->
DeleteTab
(
0
);
}
void
Test
::
testCopyPasteTranspose
()
{
...
...
sc/qa/unit/ucalc.hxx
Dosyayı görüntüle @
4f94e6c2
...
...
@@ -220,6 +220,7 @@ public:
void
testDataArea
();
void
testAutofilter
();
void
testCopyPaste
();
void
testCopyPasteAsLink
();
void
testCopyPasteTranspose
();
void
testMoveBlock
();
void
testCopyPasteRelativeFormula
();
...
...
@@ -362,8 +363,9 @@ public:
CPPUNIT_TEST
(
testToggleRefFlag
);
CPPUNIT_TEST
(
testAutofilter
);
CPPUNIT_TEST
(
testCopyPaste
);
CPPUNIT_TEST
(
test
MoveBloc
k
);
CPPUNIT_TEST
(
test
CopyPasteAsLin
k
);
CPPUNIT_TEST
(
testCopyPasteTranspose
);
CPPUNIT_TEST
(
testMoveBlock
);
CPPUNIT_TEST
(
testCopyPasteRelativeFormula
);
CPPUNIT_TEST
(
testMergedCells
);
CPPUNIT_TEST
(
testUpdateReference
);
...
...
sc/source/core/data/column3.cxx
Dosyayı görüntüle @
4f94e6c2
...
...
@@ -690,7 +690,7 @@ class CopyCellsFromClipHandler
void
insertRefCell
(
SCROW
nSrcRow
,
SCROW
nDestRow
)
{
ScAddress
aSrcPos
(
mn
Col
,
nSrcRow
,
mn
Tab
);
ScAddress
aSrcPos
(
mn
SrcCol
,
nSrcRow
,
mnSrc
Tab
);
ScAddress
aDestPos
(
mnCol
,
nDestRow
,
mnTab
);
ScSingleRefData
aRef
;
aRef
.
InitAddress
(
aSrcPos
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment