summaryrefslogtreecommitdiff
path: root/sw/source/uibase
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2016-09-27 09:11:25 +0200
committerMiklos Vajna <vmiklos@collabora.co.uk>2016-09-27 11:00:42 +0200
commitd378cd2f766eeb1fd1c98f62c9ae6b5b59fd00f1 (patch)
treef5a131942180636d8c6b801cdf6d238140c9dd89 /sw/source/uibase
parentbae1e2aa636f144fe01cb8d9721e54525fed8b2c (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/source/uibase')
-rw-r--r--sw/source/uibase/shells/txtattr.cxx37
1 files changed, 37 insertions, 0 deletions
diff --git a/sw/source/uibase/shells/txtattr.cxx b/sw/source/uibase/shells/txtattr.cxx
index 64d6370f4751..17b3df9a6fca 100644
--- a/sw/source/uibase/shells/txtattr.cxx
+++ b/sw/source/uibase/shells/txtattr.cxx
@@ -37,6 +37,7 @@
#include <sfx2/htmlmode.hxx>
#include <editeng/scripttypeitem.hxx>
#include <editeng/frmdiritem.hxx>
+#include <editeng/cmapitem.hxx>
#include "paratr.hxx"
#include <fmtinfmt.hxx>
@@ -130,6 +131,32 @@ void SwTextShell::ExecCharAttr(SfxRequest &rReq)
}
break;
+ case FN_SET_SMALL_CAPS:
+ {
+ SvxCaseMap eCaseMap = SVX_CASEMAP_KAPITAELCHEN;
+ switch (eState)
+ {
+ case STATE_TOGGLE:
+ {
+ SvxCaseMap eTmpCaseMap = static_cast<const SvxCaseMapItem&>(aSet.Get(RES_CHRATR_CASEMAP)).GetCaseMap();
+ if (eTmpCaseMap == SVX_CASEMAP_KAPITAELCHEN)
+ eCaseMap = SVX_CASEMAP_NOT_MAPPED;
+ }
+ break;
+ case STATE_ON:
+ // Nothing to do, already set.
+ break;
+ case STATE_OFF:
+ eCaseMap = SVX_CASEMAP_NOT_MAPPED;
+ break;
+ }
+ SvxCaseMapItem aCaseMap(eCaseMap, RES_CHRATR_CASEMAP);
+ rSh.SetAttrItem(aCaseMap);
+ rReq.AppendItem(aCaseMap);
+ rReq.Done();
+ }
+ break;
+
case FN_UPDATE_STYLE_BY_EXAMPLE:
rSh.QuickUpdateStyle();
rReq.Done();
@@ -550,6 +577,13 @@ void SwTextShell::GetAttrState(SfxItemSet &rSet)
nLineSpace = static_cast<const SvxLineSpacingItem* >(pItem)->GetPropLineSpace();
}
+ SvxCaseMap eCaseMap = SVX_CASEMAP_NOT_MAPPED;
+ eState = aCoreSet.GetItemState(RES_CHRATR_CASEMAP, false, &pItem);
+ if (eState == SfxItemState::DEFAULT)
+ pItem = &rPool.GetDefaultItem(RES_CHRATR_CASEMAP);
+ if (eState >= SfxItemState::DEFAULT)
+ eCaseMap = static_cast<const SvxCaseMapItem*>(pItem)->GetCaseMap();
+
while (nSlot)
{
switch(nSlot)
@@ -560,6 +594,9 @@ void SwTextShell::GetAttrState(SfxItemSet &rSet)
case FN_SET_SUB_SCRIPT:
bFlag = 0 > nEsc;
break;
+ case FN_SET_SMALL_CAPS:
+ bFlag = eCaseMap == SVX_CASEMAP_KAPITAELCHEN;
+ break;
case SID_ATTR_PARA_ADJUST_LEFT:
if (eAdjust == -1)
{