diff --git a/sw/sdi/_textsh.sdi b/sw/sdi/_textsh.sdi index 6ea824eab6cf..841fe76300ba 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 9571e6645580..e0fd62e5a9df 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 c3e8248a5578..d7a291ceae4f 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);