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
a516ac45
Kaydet (Commit)
a516ac45
authored
Eyl 20, 2013
tarafından
Miklos Vajna
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
fdo#37606 testcase
Change-Id: I60d34906a90a5143163e516f618648cf7178430e
üst
7794ae34
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
77 additions
and
1 deletion
+77
-1
CppunitTest_sw_odfimport.mk
sw/CppunitTest_sw_odfimport.mk
+5
-0
fdo37606.odt
sw/qa/extras/odfimport/data/fdo37606.odt
+0
-0
odfimport.cxx
sw/qa/extras/odfimport/odfimport.cxx
+71
-0
swdtflvr.hxx
sw/source/ui/inc/swdtflvr.hxx
+1
-1
No files found.
sw/CppunitTest_sw_odfimport.mk
Dosyayı görüntüle @
a516ac45
...
...
@@ -20,6 +20,7 @@ $(eval $(call gb_CppunitTest_use_libraries,sw_odfimport, \
cppu \
cppuhelper \
sal \
svt \
sw \
test \
unotest \
...
...
@@ -36,6 +37,7 @@ $(eval $(call gb_CppunitTest_use_externals,sw_odfimport,\
$(eval $(call gb_CppunitTest_set_include,sw_odfimport,\
-I$(SRCDIR)/sw/inc \
-I$(SRCDIR)/sw/source/core/inc \
-I$(SRCDIR)/sw/source/ui/inc \
-I$(SRCDIR)/sw/qa/extras/inc \
$$(INCLUDE) \
))
...
...
@@ -71,6 +73,9 @@ $(eval $(call gb_CppunitTest_use_components,sw_odfimport,\
unotools/util/utl \
unoxml/source/service/unoxml \
uui/util/uui \
$(if $(filter-out MACOSX WNT,$(OS)), \
vcl/vcl.unx \
) \
$(if $(filter DESKTOP,$(BUILD_TYPE)),xmlhelp/util/ucpchelp1) \
xmloff/util/xo \
))
...
...
sw/qa/extras/odfimport/data/fdo37606.odt
0 → 100644
Dosyayı görüntüle @
a516ac45
File added
sw/qa/extras/odfimport/odfimport.cxx
Dosyayı görüntüle @
a516ac45
...
...
@@ -12,6 +12,12 @@
#include <com/sun/star/text/XTextTable.hpp>
#include <swmodeltestbase.hxx>
#include <wrtsh.hxx>
#include <ndtxt.hxx>
#include <swdtflvr.hxx>
#include <view.hxx>
#include <edtwin.hxx>
typedef
std
::
map
<
OUString
,
com
::
sun
::
star
::
uno
::
Sequence
<
com
::
sun
::
star
::
table
::
BorderLine
>
>
AllBordersMap
;
typedef
std
::
pair
<
OUString
,
com
::
sun
::
star
::
uno
::
Sequence
<
com
::
sun
::
star
::
table
::
BorderLine
>
>
StringSequencePair
;
...
...
@@ -28,6 +34,8 @@ public:
void
testFdo56272
();
void
testFdo55814
();
void
testFdo68839
();
void
testFdo37606
();
void
testFdo37606Copy
();
CPPUNIT_TEST_SUITE
(
Test
);
#if !defined(MACOSX) && !defined(WNT)
...
...
@@ -52,6 +60,8 @@ void Test::run()
{
"fdo56272.odt"
,
&
Test
::
testFdo56272
},
{
"fdo55814.odt"
,
&
Test
::
testFdo55814
},
{
"fdo68839.odt"
,
&
Test
::
testFdo68839
},
{
"fdo37606.odt"
,
&
Test
::
testFdo37606
},
{
"fdo37606.odt"
,
&
Test
::
testFdo37606Copy
},
};
header
();
for
(
unsigned
int
i
=
0
;
i
<
SAL_N_ELEMENTS
(
aMethods
);
++
i
)
...
...
@@ -354,6 +364,67 @@ void Test::testFdo68839()
getProperty
<
OUString
>
(
xFrame2
,
"ChainNextName"
));
}
void
Test
::
testFdo37606
()
{
SwXTextDocument
*
pTxtDoc
=
dynamic_cast
<
SwXTextDocument
*>
(
mxComponent
.
get
());
SwWrtShell
*
pWrtShell
=
pTxtDoc
->
GetDocShell
()
->
GetWrtShell
();
SwShellCrsr
*
pShellCrsr
=
pWrtShell
->
getShellCrsr
(
false
);
{
pWrtShell
->
SelAll
();
SwTxtNode
&
rStart
=
dynamic_cast
<
SwTxtNode
&>
(
pShellCrsr
->
Start
()
->
nNode
.
GetNode
());
CPPUNIT_ASSERT_EQUAL
(
OUString
(
"A1"
),
rStart
.
GetTxt
());
SwTxtNode
&
rEnd
=
dynamic_cast
<
SwTxtNode
&>
(
pShellCrsr
->
End
()
->
nNode
.
GetNode
());
// This was "A1", i.e. Ctrl-A only selected the A1 cell of the table, not the whole document.
CPPUNIT_ASSERT_EQUAL
(
OUString
(
"Hello."
),
rEnd
.
GetTxt
());
}
{
pWrtShell
->
SttEndDoc
(
false
);
// Go to the end of the doc.
pWrtShell
->
SelAll
();
// And now that we're outside of the table, try Ctrl-A again.
SwTxtNode
&
rStart
=
dynamic_cast
<
SwTxtNode
&>
(
pShellCrsr
->
Start
()
->
nNode
.
GetNode
());
// This was "Hello", i.e. Ctrl-A did not select the starting table.
CPPUNIT_ASSERT_EQUAL
(
OUString
(
"A1"
),
rStart
.
GetTxt
());
SwTxtNode
&
rEnd
=
dynamic_cast
<
SwTxtNode
&>
(
pShellCrsr
->
End
()
->
nNode
.
GetNode
());
CPPUNIT_ASSERT_EQUAL
(
OUString
(
"Hello."
),
rEnd
.
GetTxt
());
}
{
pWrtShell
->
Delete
();
// Delete the selection
// And make sure the table got deleted as well.
SwNodes
&
rNodes
=
pWrtShell
->
GetDoc
()
->
GetNodes
();
SwNodeIndex
nNode
(
rNodes
.
GetEndOfExtras
());
SwCntntNode
*
pCntntNode
=
rNodes
.
GoNext
(
&
nNode
);
// First content node was in a table -> table wasn't deleted.
CPPUNIT_ASSERT
(
!
pCntntNode
->
FindTableNode
());
}
}
void
Test
::
testFdo37606Copy
()
{
SwXTextDocument
*
pTxtDoc
=
dynamic_cast
<
SwXTextDocument
*>
(
mxComponent
.
get
());
SwWrtShell
*
pWrtShell
=
pTxtDoc
->
GetDocShell
()
->
GetWrtShell
();
// Ctrl-A
pWrtShell
->
SelAll
();
// Ctrl-C
SwTransferable
*
pTransferable
=
new
SwTransferable
(
*
pWrtShell
);
uno
::
Reference
<
datatransfer
::
XTransferable
>
xTransferable
(
pTransferable
);
pTransferable
->
Copy
();
pWrtShell
->
SttEndDoc
(
false
);
// Go to the end of the doc.
// Ctrl-V
TransferableDataHelper
aDataHelper
(
TransferableDataHelper
::
CreateFromSystemClipboard
(
&
pWrtShell
->
GetView
().
GetEditWin
()));
SwTransferable
::
Paste
(
*
pWrtShell
,
aDataHelper
);
// Previously copy&paste failed to copy the table in case it was the document-starting one.
uno
::
Reference
<
text
::
XTextTablesSupplier
>
xTablesSupplier
(
mxComponent
,
uno
::
UNO_QUERY
);
uno
::
Reference
<
container
::
XIndexAccess
>
xTables
(
xTablesSupplier
->
getTextTables
(),
uno
::
UNO_QUERY
);
CPPUNIT_ASSERT_EQUAL
(
sal_Int32
(
2
),
xTables
->
getCount
());
}
CPPUNIT_TEST_SUITE_REGISTRATION
(
Test
);
...
...
sw/source/ui/inc/swdtflvr.hxx
Dosyayı görüntüle @
a516ac45
...
...
@@ -53,7 +53,7 @@ namespace nsTransferBufferType
}
class
SwTransferable
:
public
TransferableHelper
class
S
W_DLLPUBLIC
S
wTransferable
:
public
TransferableHelper
{
friend
class
SwView_Impl
;
SfxObjectShellLock
aDocShellRef
;
...
...
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