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

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


 sc/sdi/cellsh.sdi             |    1 +
 sc/source/ui/inc/cellsh.hxx   |    3 +++
 sc/source/ui/view/cellsh.cxx  |    3 ++-
 sc/source/ui/view/cellsh1.cxx |   30 ++++++++++++++++++++++++++++++
 4 files changed, 36 insertions(+), 1 deletion(-)

New commits:
commit 0f3f608ea064d00ffea9c14e7e366615871b208b
Author: Dózsa Bálint <dozsa at linux-dugf.site>
Date:   Mon Mar 21 12:10:06 2011 +0000

    FIX BUG 32559 - calc

diff --git a/sc/sdi/cellsh.sdi b/sc/sdi/cellsh.sdi
index b4bd228..9ad0621 100644
--- a/sc/sdi/cellsh.sdi
+++ b/sc/sdi/cellsh.sdi
@@ -197,6 +197,7 @@ interface CellSelection
     SID_TRANSLITERATE_SENTENCE_CASE [ ExecMethod = ExecuteTrans; StateMethod = GetBlockState; ]
     SID_TRANSLITERATE_TITLE_CASE    [ ExecMethod = ExecuteTrans; StateMethod = GetBlockState; ]
     SID_TRANSLITERATE_TOGGLE_CASE   [ ExecMethod = ExecuteTrans; StateMethod = GetBlockState; ]
+    SID_TRANSLITERATE_ROTATE_CASE   [ ExecMethod = ExecuteRotateTrans; StateMethod = GetBlockState; ]
     SID_TRANSLITERATE_UPPER		[ ExecMethod = ExecuteTrans; StateMethod = GetBlockState; ]
     SID_TRANSLITERATE_LOWER		[ ExecMethod = ExecuteTrans; StateMethod = GetBlockState; ]
     SID_TRANSLITERATE_HALFWIDTH	[ ExecMethod = ExecuteTrans; StateMethod = GetBlockState; ]
diff --git a/sc/source/ui/inc/cellsh.hxx b/sc/source/ui/inc/cellsh.hxx
index 4c87cba..6129fcf 100644
--- a/sc/source/ui/inc/cellsh.hxx
+++ b/sc/source/ui/inc/cellsh.hxx
@@ -71,6 +71,8 @@ private:
     DECL_LINK( ClipboardChanged, TransferableDataHelper* );
     DECL_LINK( DialogClosed, AbstractScLinkedAreaDlg* );
 
+    sal_uInt32  nF3ShiftCounter;
+
 public:
 
     TYPEINFO();
@@ -84,6 +86,7 @@ public:
 
     void		ExecuteEdit( SfxRequest& rReq );
     void		ExecuteTrans( SfxRequest& rReq );
+    void                ExecuteRotateTrans( SfxRequest& rReq );
 
     void		GetBlockState( SfxItemSet& rSet );
     void		GetCellState( SfxItemSet& rSet );
diff --git a/sc/source/ui/view/cellsh.cxx b/sc/source/ui/view/cellsh.cxx
index 5d6c875..53be26f 100644
--- a/sc/source/ui/view/cellsh.cxx
+++ b/sc/source/ui/view/cellsh.cxx
@@ -86,7 +86,8 @@ SFX_IMPL_INTERFACE(ScCellShell, ScFormatShell , ScResId(SCSTR_CELLSHELL) )
 ScCellShell::ScCellShell(ScViewData* pData) :
     ScFormatShell(pData),
     pImpl( new CellShell_Impl() ),
-    bPastePossible(false)
+    bPastePossible(false),
+    nF3ShiftCounter(0)
 {
     SetHelpId(HID_SCSHELL_CELLSH);
     SetName(String::CreateFromAscii(RTL_CONSTASCII_STRINGPARAM("Cell")));
diff --git a/sc/source/ui/view/cellsh1.cxx b/sc/source/ui/view/cellsh1.cxx
index d64010a..c65c54e 100644
--- a/sc/source/ui/view/cellsh1.cxx
+++ b/sc/source/ui/view/cellsh1.cxx
@@ -112,6 +112,8 @@
 #include <com/sun/star/beans/PropertyValue.hpp>
 #include <com/sun/star/beans/XPropertySet.hpp>
 #include <cppuhelper/bootstrap.hxx>
+#include <com/sun/star/i18n/TransliterationModules.hpp>
+#include <com/sun/star/i18n/TransliterationModulesExtra.hpp>
 
 #include <boost/scoped_ptr.hpp>
 
@@ -2088,6 +2090,34 @@ void ScCellShell::ExecuteTrans( SfxRequest& rReq )
     }
 }
 
+void ScCellShell::ExecuteRotateTrans( 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 )
+                GetViewData()->GetView()->TransliterateText( nMode );
+
+            nF3ShiftCounter++;
+        }
+    }
+}
+
 void ScCellShell::ExecuteExternalSource(
     const String& _rFile, const String& _rFilter, const String& _rOptions,
     const String& _rSource, sal_uLong _nRefresh, SfxRequest& _rRequest )


More information about the Libreoffice-commits mailing list