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
2c5be961
Kaydet (Commit)
2c5be961
authored
May 07, 2015
tarafından
Henry Castro
Kaydeden (comit)
Markus Mohrhard
May 13, 2015
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Unit test for tdf#83366
Change-Id: If0bea3c3a2b0d098e82fd54c069f99041e6ace81
üst
12fd50bf
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
85 additions
and
0 deletions
+85
-0
CppunitTest_sc_subsequent_filters_test.mk
sc/CppunitTest_sc_subsequent_filters_test.mk
+1
-0
subsequent_filters-test.cxx
sc/qa/unit/subsequent_filters-test.cxx
+84
-0
No files found.
sc/CppunitTest_sc_subsequent_filters_test.mk
Dosyayı görüntüle @
2c5be961
...
...
@@ -98,6 +98,7 @@ $(eval $(call gb_CppunitTest_use_components,sc_subsequent_filters_test,\
sfx2/util/sfx \
sot/util/sot \
svl/util/svl \
svl/source/fsstor/fsstorage \
svtools/util/svt \
toolkit/util/tk \
ucb/source/core/ucb1 \
...
...
sc/qa/unit/subsequent_filters-test.cxx
Dosyayı görüntüle @
2c5be961
...
...
@@ -50,6 +50,7 @@
#include "cellvalue.hxx"
#include "attrib.hxx"
#include "dpshttab.hxx"
#include "tabvwsh.hxx"
#include <scopetools.hxx>
#include <columnspanset.hxx>
#include <tokenstringcontext.hxx>
...
...
@@ -63,7 +64,9 @@
#include <com/sun/star/sheet/DataPilotFieldGroupBy.hpp>
#include <com/sun/star/sheet/GeneralFunction.hpp>
#include <com/sun/star/container/XIndexAccess.hpp>
#include <com/sun/star/frame/Desktop.hpp>
#include <com/sun/star/frame/XModel.hpp>
#include <com/sun/star/frame/XModel2.hpp>
#include <com/sun/star/text/textfield/Type.hpp>
#include <com/sun/star/chart2/XChartDocument.hpp>
#include <com/sun/star/chart2/data/XDataReceiver.hpp>
...
...
@@ -191,6 +194,7 @@ public:
void
testVBAUserFunctionXLSM
();
void
testEmbeddedImageXLS
();
void
testEditEngStrikeThroughXLSX
();
void
testCopyPasteXLS
();
CPPUNIT_TEST_SUITE
(
ScFiltersTest
);
CPPUNIT_TEST
(
testBooleanFormatXLSX
);
...
...
@@ -280,6 +284,7 @@ public:
CPPUNIT_TEST
(
testEmbeddedImageXLS
);
CPPUNIT_TEST
(
testErrorOnExternalReferences
);
CPPUNIT_TEST
(
testEditEngStrikeThroughXLSX
);
CPPUNIT_TEST
(
testCopyPasteXLS
);
CPPUNIT_TEST_SUITE_END
();
private
:
...
...
@@ -2936,6 +2941,85 @@ void ScFiltersTest::testEditEngStrikeThroughXLSX()
}
}
// tdf#83366
void
ScFiltersTest
::
testCopyPasteXLS
()
{
uno
::
Reference
<
frame
::
XDesktop2
>
xDesktop
=
frame
::
Desktop
::
create
(
::
comphelper
::
getProcessComponentContext
());
CPPUNIT_ASSERT
(
xDesktop
.
is
()
);
// create a frame
Reference
<
frame
::
XFrame
>
xTargetFrame
=
xDesktop
->
findFrame
(
OUString
(
"_blank"
),
0
);
CPPUNIT_ASSERT
(
xTargetFrame
.
is
()
);
// 1. Open the document
ScDocShellRef
xDocSh
=
loadDoc
(
"chartx."
,
XLS
);
CPPUNIT_ASSERT_MESSAGE
(
"Failed to load chartx.xls."
,
xDocSh
.
Is
());
uno
::
Reference
<
frame
::
XModel2
>
xModel2
(
xDocSh
->
GetModel
(),
UNO_QUERY
);
CPPUNIT_ASSERT
(
xModel2
.
is
()
);
Reference
<
frame
::
XController2
>
xController
(
xModel2
->
createDefaultViewController
(
xTargetFrame
),
UNO_QUERY
);
CPPUNIT_ASSERT
(
xController
.
is
()
);
// introduce model/view/controller to each other
xController
->
attachModel
(
xModel2
.
get
()
);
xModel2
->
connectController
(
xController
.
get
()
);
xTargetFrame
->
setComponent
(
xController
->
getComponentWindow
(),
xController
.
get
()
);
xController
->
attachFrame
(
xTargetFrame
);
xModel2
->
setCurrentController
(
xController
.
get
()
);
ScDocument
&
rDoc
=
xDocSh
->
GetDocument
();
// Get the document controller
ScTabViewShell
*
pViewShell
=
xDocSh
->
GetBestViewShell
(
false
);
CPPUNIT_ASSERT
(
pViewShell
!=
NULL
);
// 2. Highlight B2:C5
ScRange
aSrcRange
;
sal_uInt16
nRes
=
aSrcRange
.
Parse
(
"B2:C5"
,
&
rDoc
,
rDoc
.
GetAddressConvention
());
CPPUNIT_ASSERT_MESSAGE
(
"Failed to parse."
,
(
nRes
&
SCA_VALID
)
!=
0
);
ScMarkData
aMark
;
aMark
.
SetMarkArea
(
aSrcRange
);
pViewShell
->
GetViewData
().
GetMarkData
().
SetMarkArea
(
aSrcRange
);
// 3. Copy
ScDocument
aClipDoc
(
SCDOCMODE_CLIP
);
pViewShell
->
GetViewData
().
GetView
()
->
CopyToClip
(
&
aClipDoc
,
false
,
false
,
false
,
false
);
// 4. Close the document (Ctrl-W)
xDocSh
->
DoClose
();
// 5. Create a new Spreadsheet
Sequence
<
beans
::
PropertyValue
>
args
(
1
);
args
[
0
].
Name
=
"Hidden"
;
args
[
0
].
Value
<<=
sal_True
;
uno
::
Reference
<
lang
::
XComponent
>
xComponent
=
xDesktop
->
loadComponentFromURL
(
OUString
(
"private:factory/scalc"
),
OUString
(
"_blank"
),
0
,
args
);
CPPUNIT_ASSERT
(
xComponent
.
is
()
);
// Get the document model
SfxObjectShell
*
pFoundShell
=
SfxObjectShell
::
GetShellFromComponent
(
xComponent
);
CPPUNIT_ASSERT_MESSAGE
(
"Failed to access document shell"
,
pFoundShell
);
xDocSh
=
dynamic_cast
<
ScDocShell
*>
(
pFoundShell
);
CPPUNIT_ASSERT
(
xDocSh
!=
NULL
);
// Get the document controller
pViewShell
=
xDocSh
->
GetBestViewShell
(
false
);
CPPUNIT_ASSERT
(
pViewShell
!=
NULL
);
// 6. Paste
pViewShell
->
GetViewData
().
GetView
()
->
PasteFromClip
(
IDF_ALL
,
&
aClipDoc
);
xDocSh
->
DoClose
();
}
ScFiltersTest
::
ScFiltersTest
()
:
ScBootstrapFixture
(
"/sc/qa/unit/data"
)
{
...
...
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