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
61150f1c
Kaydet (Commit)
61150f1c
authored
Şub 08, 2018
tarafından
Serge Krot
Kaydeden (comit)
Thorsten Behrens
Şub 19, 2018
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
tdf#101856 odt: write/read new bookmark attributes: unit test
Change-Id: I094f91c2af2d171067e3c37a8d52276835d36e9c
üst
c347e008
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
46 additions
and
0 deletions
+46
-0
tdf101856.odt
sw/qa/extras/odfexport/data/tdf101856.odt
+0
-0
odfexport.cxx
sw/qa/extras/odfexport/odfexport.cxx
+46
-0
No files found.
sw/qa/extras/odfexport/data/tdf101856.odt
0 → 100755
Dosyayı görüntüle @
61150f1c
File added
sw/qa/extras/odfexport/odfexport.cxx
Dosyayı görüntüle @
61150f1c
...
...
@@ -966,5 +966,51 @@ DECLARE_ODFEXPORT_TEST(testImageMimetype, "image-mimetype.odt")
#endif
// MAILMERGE Add conditional to expand / collapse bookmarks
DECLARE_ODFEXPORT_TEST
(
tdf101856
,
"tdf101856.odt"
)
{
// get bookmark interface
uno
::
Reference
<
text
::
XBookmarksSupplier
>
xBookmarksSupplier
(
mxComponent
,
uno
::
UNO_QUERY
);
uno
::
Reference
<
container
::
XIndexAccess
>
xBookmarksByIdx
(
xBookmarksSupplier
->
getBookmarks
(),
uno
::
UNO_QUERY
);
uno
::
Reference
<
container
::
XNameAccess
>
xBookmarksByName
(
xBookmarksSupplier
->
getBookmarks
(),
uno
::
UNO_QUERY
);
// check: we have 2 bookmarks
CPPUNIT_ASSERT_EQUAL
(
static_cast
<
sal_Int32
>
(
5
),
xBookmarksByIdx
->
getCount
());
CPPUNIT_ASSERT
(
xBookmarksByName
->
hasByName
(
"BookmarkVisible"
));
CPPUNIT_ASSERT
(
xBookmarksByName
->
hasByName
(
"BookmarkHidden"
));
CPPUNIT_ASSERT
(
xBookmarksByName
->
hasByName
(
"BookmarkVisibleWithCondition"
));
CPPUNIT_ASSERT
(
xBookmarksByName
->
hasByName
(
"BookmarkNotHiddenWithCondition"
));
CPPUNIT_ASSERT
(
xBookmarksByName
->
hasByName
(
"BookmarkHiddenWithCondition"
));
// <text:bookmark-start text:name="BookmarkVisible"/>
uno
::
Reference
<
beans
::
XPropertySet
>
xBookmark1
(
xBookmarksByName
->
getByName
(
"BookmarkVisible"
),
uno
::
UNO_QUERY
);
CPPUNIT_ASSERT_EQUAL
(
OUString
(
""
),
getProperty
<
OUString
>
(
xBookmark1
,
UNO_NAME_BOOKMARK_CONDITION
));
CPPUNIT_ASSERT_EQUAL
(
false
,
getProperty
<
bool
>
(
xBookmark1
,
UNO_NAME_BOOKMARK_HIDDEN
));
// <text:bookmark-start text:name="BookmarkHidden" loext:condition="" loext:hidden="true"/>
uno
::
Reference
<
beans
::
XPropertySet
>
xBookmark2
(
xBookmarksByName
->
getByName
(
"BookmarkHidden"
),
uno
::
UNO_QUERY
);
CPPUNIT_ASSERT_EQUAL
(
OUString
(
""
),
getProperty
<
OUString
>
(
xBookmark2
,
UNO_NAME_BOOKMARK_CONDITION
));
CPPUNIT_ASSERT_EQUAL
(
true
,
getProperty
<
bool
>
(
xBookmark2
,
UNO_NAME_BOOKMARK_HIDDEN
));
// <text:bookmark-start text:name="BookmarkVisibleWithCondition" loext:condition="0==1" loext:hidden="true"/>
uno
::
Reference
<
beans
::
XPropertySet
>
xBookmark3
(
xBookmarksByName
->
getByName
(
"BookmarkVisibleWithCondition"
),
uno
::
UNO_QUERY
);
CPPUNIT_ASSERT_EQUAL
(
OUString
(
"0==1"
),
getProperty
<
OUString
>
(
xBookmark3
,
UNO_NAME_BOOKMARK_CONDITION
));
CPPUNIT_ASSERT_EQUAL
(
true
,
getProperty
<
bool
>
(
xBookmark3
,
UNO_NAME_BOOKMARK_HIDDEN
));
// <text:bookmark-start text:name="BookmarkNotHiddenWithCondition" loext:condition="1==1" loext:hidden="false"/>
//
// The following test doesn't work, while during output in the case of loext:hidden="false".
// no additional parameters are written. Implementation should be reviewed.
//
// uno::Reference<beans::XPropertySet> xBookmark4(xBookmarksByName->getByName("BookmarkNotHiddenWithCondition"), uno::UNO_QUERY);
// CPPUNIT_ASSERT_EQUAL(OUString("1==1"), getProperty<OUString>(xBookmark4, UNO_NAME_BOOKMARK_CONDITION));
// CPPUNIT_ASSERT_EQUAL(false, getProperty<bool>(xBookmark4, UNO_NAME_BOOKMARK_HIDDEN));
// <text:bookmark-start text:name="BookmarkHiddenWithCondition" loext:condition="1==1" loext:hidden="true"/>
uno
::
Reference
<
beans
::
XPropertySet
>
xBookmark5
(
xBookmarksByName
->
getByName
(
"BookmarkHiddenWithCondition"
),
uno
::
UNO_QUERY
);
CPPUNIT_ASSERT_EQUAL
(
OUString
(
"1==1"
),
getProperty
<
OUString
>
(
xBookmark5
,
UNO_NAME_BOOKMARK_CONDITION
));
CPPUNIT_ASSERT_EQUAL
(
true
,
getProperty
<
bool
>
(
xBookmark5
,
UNO_NAME_BOOKMARK_HIDDEN
));
}
CPPUNIT_PLUGIN_IMPLEMENT
();
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
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