diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2016-09-27 09:11:25 +0200 |
---|---|---|
committer | Andras Timar <andras.timar@collabora.com> | 2016-10-27 20:45:41 +0200 |
commit | 7acac0db1b4971cd3c3de59bc661e3a8554d1d86 (patch) | |
tree | 45b7504928f422b0cb4205450a24c0d9d6f3c2cf /sw/qa/extras | |
parent | 6b4663e55cacf854f12a64c7949e29990302e623 (diff) |
tdf#87914 sw: add an initial .uno:SmallCaps command
- handle it in SwTextShell (for normal Writer text)
- simple icon in the galaxy theme
(cherry picked from commit d378cd2f766eeb1fd1c98f62c9ae6b5b59fd00f1)
Change-Id: Ib8f11dbca28b19a2fc0411c92d9f0b4b052277bb
Diffstat (limited to 'sw/qa/extras')
-rw-r--r-- | sw/qa/extras/uiwriter/uiwriter.cxx | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/sw/qa/extras/uiwriter/uiwriter.cxx b/sw/qa/extras/uiwriter/uiwriter.cxx index 208efa49b429..f2c42630d2f4 100644 --- a/sw/qa/extras/uiwriter/uiwriter.cxx +++ b/sw/qa/extras/uiwriter/uiwriter.cxx @@ -11,6 +11,7 @@ #include <com/sun/star/drawing/GraphicExportFilter.hpp> #include <com/sun/star/i18n/TextConversionOption.hpp> #include <com/sun/star/frame/DispatchHelper.hpp> +#include <com/sun/star/style/CaseMap.hpp> #include <tools/errcode.hxx> #include <swmodeltestbase.hxx> #include <ndtxt.hxx> @@ -186,6 +187,7 @@ public: void testTdf96961(); void testTdf88453(); void testTdf88453Table(); + void testSmallCaps(); void testTdf98987(); void testTdf99004(); void testTdf84695(); @@ -283,6 +285,7 @@ public: CPPUNIT_TEST(testTdf96961); CPPUNIT_TEST(testTdf88453); CPPUNIT_TEST(testTdf88453Table); + CPPUNIT_TEST(testSmallCaps); CPPUNIT_TEST(testTdf98987); CPPUNIT_TEST(testTdf99004); CPPUNIT_TEST(testTdf84695); @@ -3182,6 +3185,23 @@ void SwUiWriterTest::testTdf88453Table() CPPUNIT_ASSERT_EQUAL(3, getPages()); } +void SwUiWriterTest::testSmallCaps() +{ + // Create a document, add some characters and select them. + createDoc(); + SwDoc* pDoc = createDoc(); + SwDocShell* pDocShell = pDoc->GetDocShell(); + SwWrtShell* pWrtShell = pDocShell->GetWrtShell(); + pWrtShell->Insert("text"); + pWrtShell->SelAll(); + + // Dispatch the command to make them formatted small capitals. + lcl_dispatchCommand(mxComponent, ".uno:SmallCaps", {}); + + // This was css::style::CaseMap::NONE as the shell didn't handle the command. + CPPUNIT_ASSERT_EQUAL(css::style::CaseMap::SMALLCAPS, getProperty<sal_Int16>(getRun(getParagraph(1), 1), "CharCaseMap")); +} + void SwUiWriterTest::testTdf98987() { createDoc("tdf98987.docx"); |