diff options
author | Dózsa Bálint <dozsa@linux-dugf.site> | 2011-03-21 12:07:52 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2011-03-21 12:07:52 +0000 |
commit | 2a7e89bbaff1cab66a853e44389e9f6fcebd9606 (patch) | |
tree | 679f0f242e326bf853d0350cca659b1816328cb5 | |
parent | 63ea9a18366dae59141cc710cf79176e04e37e9e (diff) |
FIX BUG 32559
-rw-r--r-- | sw/sdi/_textsh.sdi | 6 | ||||
-rw-r--r-- | sw/source/ui/inc/textsh.hxx | 2 | ||||
-rw-r--r-- | sw/source/ui/shells/textsh.cxx | 30 |
3 files changed, 37 insertions, 1 deletions
diff --git a/sw/sdi/_textsh.sdi b/sw/sdi/_textsh.sdi index 519215c36e..490b7ac9b7 100644 --- a/sw/sdi/_textsh.sdi +++ b/sw/sdi/_textsh.sdi @@ -1497,6 +1497,12 @@ interface BaseText StateMethod = NoState ; DisableFlags="SW_DISABLE_ON_PROTECTED_CURSOR"; ] + SID_TRANSLITERATE_ROTATE_CASE + [ + ExecMethod = ExecRotateTransliteration; + StateMethod = NoState ; + DisableFlags="SW_DISABLE_ON_PROTECTED_CURSOR"; + ] SID_TRANSLITERATE_UPPER [ ExecMethod = ExecTransliteration; diff --git a/sw/source/ui/inc/textsh.hxx b/sw/source/ui/inc/textsh.hxx index 337c4aead5..86edca3a04 100644 --- a/sw/source/ui/inc/textsh.hxx +++ b/sw/source/ui/inc/textsh.hxx @@ -38,6 +38,7 @@ class SvxHyperlinkItem; class SwTextShell: public SwBaseShell { SwFldMgr* pPostItFldMgr; + sal_uInt32 nF3ShiftCounter; void InsertSymbol( SfxRequest& ); void InsertHyperlink(const SvxHyperlinkItem& rHlnkItem); @@ -77,6 +78,7 @@ public: void ExecAttr(SfxRequest &); void ExecDB(SfxRequest &); void ExecTransliteration(SfxRequest &); + void ExecRotateTransliteration(SfxRequest &); void GetAttrState(SfxItemSet &); diff --git a/sw/source/ui/shells/textsh.cxx b/sw/source/ui/shells/textsh.cxx index 93c297dd8d..548ec4f0d7 100644 --- a/sw/source/ui/shells/textsh.cxx +++ b/sw/source/ui/shells/textsh.cxx @@ -998,8 +998,36 @@ void SwTextShell::ExecTransliteration( SfxRequest & rReq ) } } +void SwTextShell::ExecRotateTransliteration( SfxRequest & rReq ) +{ + using namespace ::com::sun::star::i18n; + { + sal_uInt32 nMode = 0; + + if( rReq.GetSlot() == SID_TRANSLITERATE_ROTATE_CASE ) { + switch ( nF3ShiftCounter ) { + case 0: + nMode = TransliterationModulesExtra::TITLE_CASE; + break; + case 1: + nMode = TransliterationModules_LOWERCASE_UPPERCASE; + break; + case 2: + nMode = TransliterationModules_UPPERCASE_LOWERCASE; + nF3ShiftCounter = -1; + break; + } + + if ( nMode ) + GetShell().TransliterateText( nMode ); + + nF3ShiftCounter++; + } + } +} + SwTextShell::SwTextShell(SwView &_rView) : - SwBaseShell(_rView), pPostItFldMgr( 0 ) + SwBaseShell(_rView), pPostItFldMgr( 0 ), nF3ShiftCounter(0) { SetName(String::CreateFromAscii("Text")); SetHelpId(SW_TEXTSHELL); |