[Libreoffice-commits] .: sw/sdi sw/source

Caolán McNamara caolan at kemper.freedesktop.org
Mon Mar 21 06:37:26 PDT 2011


 sw/sdi/_textsh.sdi             |    6 ++++++
 sw/source/ui/inc/textsh.hxx    |    2 ++
 sw/source/ui/shells/textsh.cxx |   30 +++++++++++++++++++++++++++++-
 3 files changed, 37 insertions(+), 1 deletion(-)

New commits:
commit 2a7e89bbaff1cab66a853e44389e9f6fcebd9606
Author: Dózsa Bálint <dozsa at linux-dugf.site>
Date:   Mon Mar 21 12:07:52 2011 +0000

    FIX BUG 32559

diff --git a/sw/sdi/_textsh.sdi b/sw/sdi/_textsh.sdi
index 519215c..490b7ac 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 337c4ae..86edca3 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 93c297d..548ec4f 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);


More information about the Libreoffice-commits mailing list