diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2016-09-27 09:11:25 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2016-09-27 11:00:42 +0200 |
commit | d378cd2f766eeb1fd1c98f62c9ae6b5b59fd00f1 (patch) | |
tree | f5a131942180636d8c6b801cdf6d238140c9dd89 /sw/qa/extras | |
parent | bae1e2aa636f144fe01cb8d9721e54525fed8b2c (diff) |
tdf#87914 sw: add an initial .uno:SmallCaps command
- handle it in SwTextShell (for normal Writer text)
- simple icon in the galaxy theme
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 d6deb9d231b9..6792919e0591 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> @@ -199,6 +200,7 @@ public: void testTdf88453(); void testTdf88453Table(); void testClassificationPaste(); + void testSmallCaps(); void testTdf98987(); void testTdf99004(); void testTdf84695(); @@ -307,6 +309,7 @@ public: CPPUNIT_TEST(testTdf88453); CPPUNIT_TEST(testTdf88453Table); CPPUNIT_TEST(testClassificationPaste); + CPPUNIT_TEST(testSmallCaps); CPPUNIT_TEST(testTdf98987); CPPUNIT_TEST(testTdf99004); CPPUNIT_TEST(testTdf84695); @@ -3710,6 +3713,23 @@ void SwUiWriterTest::testClassificationPaste() xSourceComponent->dispose(); } +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"); |