diff options
-rw-r--r-- | sw/inc/editsh.hxx | 1 | ||||
-rw-r--r-- | sw/sdi/_textsh.sdi | 18 | ||||
-rwxr-xr-x | sw/sdi/annotsh.sdi | 21 | ||||
-rw-r--r-- | sw/sdi/drwtxtsh.sdi | 18 | ||||
-rw-r--r-- | sw/source/core/edit/editsh.cxx | 26 | ||||
-rwxr-xr-x | sw/source/ui/shells/annotsh.cxx | 10 | ||||
-rw-r--r-- | sw/source/ui/shells/drwtxtsh.cxx | 10 | ||||
-rw-r--r-- | sw/source/ui/shells/textsh.cxx | 12 | ||||
-rw-r--r-- | sw/uiconfig/sglobal/menubar/menubar.xml | 5 | ||||
-rw-r--r-- | sw/uiconfig/sweb/menubar/menubar.xml | 5 | ||||
-rw-r--r-- | sw/uiconfig/swform/menubar/menubar.xml | 5 | ||||
-rw-r--r-- | sw/uiconfig/swreport/menubar/menubar.xml | 5 | ||||
-rw-r--r-- | sw/uiconfig/swriter/menubar/menubar.xml | 5 | ||||
-rw-r--r-- | sw/uiconfig/swxform/menubar/menubar.xml | 5 |
14 files changed, 139 insertions, 7 deletions
diff --git a/sw/inc/editsh.hxx b/sw/inc/editsh.hxx index 83b0e5242a9e..020a0c52c486 100644 --- a/sw/inc/editsh.hxx +++ b/sw/inc/editsh.hxx @@ -201,6 +201,7 @@ public: // change text to Upper/Lower/Hiragana/Katagana/... void TransliterateText( sal_uInt32 nType ); + void TransliterateText( const String& rModuleName ); // count words in current selection void CountWords( SwDocStat& rStat ) const; diff --git a/sw/sdi/_textsh.sdi b/sw/sdi/_textsh.sdi index 3ce311a4d7c2..cd07a642c05d 100644 --- a/sw/sdi/_textsh.sdi +++ b/sw/sdi/_textsh.sdi @@ -1483,6 +1483,24 @@ interface BaseText DisableFlags="SW_DISABLE_ON_PROTECTED_CURSOR"; ] + SID_TRANSLITERATE_SENTENCE_CASE + [ + ExecMethod = ExecTransliteration; + StateMethod = NoState ; + DisableFlags="SW_DISABLE_ON_PROTECTED_CURSOR"; + ] + SID_TRANSLITERATE_TITLE_CASE + [ + ExecMethod = ExecTransliteration; + StateMethod = NoState ; + DisableFlags="SW_DISABLE_ON_PROTECTED_CURSOR"; + ] + SID_TRANSLITERATE_TOGGLE_CASE + [ + ExecMethod = ExecTransliteration; + StateMethod = NoState ; + DisableFlags="SW_DISABLE_ON_PROTECTED_CURSOR"; + ] SID_TRANSLITERATE_UPPER [ ExecMethod = ExecTransliteration; diff --git a/sw/sdi/annotsh.sdi b/sw/sdi/annotsh.sdi index c3693daf6c19..591373d034c6 100755 --- a/sw/sdi/annotsh.sdi +++ b/sw/sdi/annotsh.sdi @@ -181,6 +181,27 @@ interface Annotation : _Annotation DisableFlags="SW_DISABLE_ON_PROTECTED_CURSOR"; ] + SID_TRANSLITERATE_SENTENCE_CASE + [ + ExecMethod = ExecTransliteration; + StateMethod = NoState ; + DisableFlags="SW_DISABLE_ON_PROTECTED_CURSOR"; + ] + + SID_TRANSLITERATE_TITLE_CASE + [ + ExecMethod = ExecTransliteration; + StateMethod = NoState ; + DisableFlags="SW_DISABLE_ON_PROTECTED_CURSOR"; + ] + + SID_TRANSLITERATE_TOGGLE_CASE + [ + ExecMethod = ExecTransliteration; + StateMethod = NoState ; + DisableFlags="SW_DISABLE_ON_PROTECTED_CURSOR"; + ] + SID_TRANSLITERATE_UPPER [ ExecMethod = ExecTransliteration; diff --git a/sw/sdi/drwtxtsh.sdi b/sw/sdi/drwtxtsh.sdi index 8f6eb837af86..4bba952eead3 100644 --- a/sw/sdi/drwtxtsh.sdi +++ b/sw/sdi/drwtxtsh.sdi @@ -483,6 +483,24 @@ interface TextDrawText [ StateMethod = StateInsert ; ] + SID_TRANSLITERATE_SENTENCE_CASE + [ + ExecMethod = ExecTransliteration; + StateMethod = NoState ; + DisableFlags="SW_DISABLE_ON_PROTECTED_CURSOR"; + ] + SID_TRANSLITERATE_TITLE_CASE + [ + ExecMethod = ExecTransliteration; + StateMethod = NoState ; + DisableFlags="SW_DISABLE_ON_PROTECTED_CURSOR"; + ] + SID_TRANSLITERATE_TOGGLE_CASE + [ + ExecMethod = ExecTransliteration; + StateMethod = NoState ; + DisableFlags="SW_DISABLE_ON_PROTECTED_CURSOR"; + ] SID_TRANSLITERATE_UPPER [ ExecMethod = ExecTransliteration; diff --git a/sw/source/core/edit/editsh.cxx b/sw/source/core/edit/editsh.cxx index 0035a8880ba9..3bfea5fa6290 100644 --- a/sw/source/core/edit/editsh.cxx +++ b/sw/source/core/edit/editsh.cxx @@ -1182,6 +1182,32 @@ void SwEditShell::TransliterateText( sal_uInt32 nType ) EndAllAction(); } +void SwEditShell::TransliterateText( const String& rModuleName ) +{ + utl::TransliterationWrapper aTrans(::comphelper::getProcessServiceFactory(), 0 ); + aTrans.loadModuleByImplName( rModuleName, LANGUAGE_SYSTEM ); + StartAllAction(); + SET_CURR_SHELL( this ); + + SwPaM* pCrsr = GetCrsr(); + if( pCrsr->GetNext() != pCrsr ) + { + GetDoc()->StartUndo(UNDO_EMPTY, NULL); + FOREACHPAM_START( this ) + + if( PCURCRSR->HasMark() ) + GetDoc()->TransliterateText( *PCURCRSR, aTrans ); + + FOREACHPAM_END() + GetDoc()->EndUndo(UNDO_EMPTY, NULL); + } + else + GetDoc()->TransliterateText( *pCrsr, aTrans ); + + EndAllAction(); +} + + void SwEditShell::CountWords( SwDocStat& rStat ) const { FOREACHPAM_START( this ) diff --git a/sw/source/ui/shells/annotsh.cxx b/sw/source/ui/shells/annotsh.cxx index 054220be6707..2e5a54076d7e 100755 --- a/sw/source/ui/shells/annotsh.cxx +++ b/sw/source/ui/shells/annotsh.cxx @@ -34,6 +34,7 @@ #include <tools/shl.hxx> #include <com/sun/star/i18n/TransliterationModules.hpp> +#include <com/sun/star/i18n/TransliterationModulesExtra.hpp> #include <com/sun/star/i18n/TextConversionOption.hpp> #include <com/sun/star/ui/dialogs/XExecutableDialog.hpp> #include <com/sun/star/lang/XInitialization.hpp> @@ -1286,6 +1287,15 @@ void SwAnnotationShell::ExecTransliteration(SfxRequest &rReq) switch( rReq.GetSlot() ) { + case SID_TRANSLITERATE_SENTENCE_CASE: + nMode = TransliterationModulesExtra::SENTENCE_CASE; + break; + case SID_TRANSLITERATE_TITLE_CASE: + nMode = TransliterationModulesExtra::TITLE_CASE; + break; + case SID_TRANSLITERATE_TOGGLE_CASE: + nMode = TransliterationModulesExtra::TOGGLE_CASE; + break; case SID_TRANSLITERATE_UPPER: nMode = TransliterationModules_LOWERCASE_UPPERCASE; break; diff --git a/sw/source/ui/shells/drwtxtsh.cxx b/sw/source/ui/shells/drwtxtsh.cxx index 99a2bf71bca7..2b3d07d83b7d 100644 --- a/sw/source/ui/shells/drwtxtsh.cxx +++ b/sw/source/ui/shells/drwtxtsh.cxx @@ -55,6 +55,7 @@ #include <svx/svdoutl.hxx> #include <unoobj.hxx> #include <com/sun/star/i18n/TransliterationModules.hpp> +#include <com/sun/star/i18n/TransliterationModulesExtra.hpp> #include <com/sun/star/i18n/TextConversionOption.hpp> #include <com/sun/star/ui/dialogs/XExecutableDialog.hpp> #include <com/sun/star/lang/XInitialization.hpp> @@ -723,6 +724,15 @@ void SwDrawTextShell::ExecTransliteration( SfxRequest & rReq ) switch( rReq.GetSlot() ) { + case SID_TRANSLITERATE_SENTENCE_CASE: + nMode = TransliterationModulesExtra::SENTENCE_CASE; + break; + case SID_TRANSLITERATE_TITLE_CASE: + nMode = TransliterationModulesExtra::TITLE_CASE; + break; + case SID_TRANSLITERATE_TOGGLE_CASE: + nMode = TransliterationModulesExtra::TOGGLE_CASE; + break; case SID_TRANSLITERATE_UPPER: nMode = TransliterationModules_LOWERCASE_UPPERCASE; break; diff --git a/sw/source/ui/shells/textsh.cxx b/sw/source/ui/shells/textsh.cxx index 742e93b646c2..a16c8dc81616 100644 --- a/sw/source/ui/shells/textsh.cxx +++ b/sw/source/ui/shells/textsh.cxx @@ -67,7 +67,8 @@ #include <svx/htmlmode.hxx> #include <svx/pfiledlg.hxx> #include <svx/htmlcfg.hxx> -#include <com/sun/star/i18n/TransliterationModules.hdl> +#include <com/sun/star/i18n/TransliterationModules.hpp> +#include <com/sun/star/i18n/TransliterationModulesExtra.hpp> #include <sot/clsids.hxx> #include <svx/acorrcfg.hxx> @@ -1029,6 +1030,15 @@ void SwTextShell::ExecTransliteration( SfxRequest & rReq ) switch( rReq.GetSlot() ) { + case SID_TRANSLITERATE_SENTENCE_CASE: + nMode = TransliterationModulesExtra::SENTENCE_CASE; + break; + case SID_TRANSLITERATE_TITLE_CASE: + nMode = TransliterationModulesExtra::TITLE_CASE; + break; + case SID_TRANSLITERATE_TOGGLE_CASE: + nMode = TransliterationModulesExtra::TOGGLE_CASE; + break; case SID_TRANSLITERATE_UPPER: nMode = TransliterationModules_LOWERCASE_UPPERCASE; break; diff --git a/sw/uiconfig/sglobal/menubar/menubar.xml b/sw/uiconfig/sglobal/menubar/menubar.xml index 4b46f4d46a2a..e35a7d825418 100644 --- a/sw/uiconfig/sglobal/menubar/menubar.xml +++ b/sw/uiconfig/sglobal/menubar/menubar.xml @@ -216,8 +216,11 @@ <menu:menuseparator/> <menu:menu menu:id=".uno:TransliterateMenu"> <menu:menupopup> - <menu:menuitem menu:id=".uno:ChangeCaseToUpper"/> + <menu:menuitem menu:id=".uno:ChangeCaseToSentenceCase"/> <menu:menuitem menu:id=".uno:ChangeCaseToLower"/> + <menu:menuitem menu:id=".uno:ChangeCaseToUpper"/> + <menu:menuitem menu:id=".uno:ChangeCaseToTitleCase"/> + <menu:menuitem menu:id=".uno:ChangeCaseToToggleCase"/> <menu:menuitem menu:id=".uno:ChangeCaseToHalfWidth"/> <menu:menuitem menu:id=".uno:ChangeCaseToFullWidth"/> <menu:menuitem menu:id=".uno:ChangeCaseToHiragana"/> diff --git a/sw/uiconfig/sweb/menubar/menubar.xml b/sw/uiconfig/sweb/menubar/menubar.xml index 4be8c6f8e791..45d9bebbc7b5 100644 --- a/sw/uiconfig/sweb/menubar/menubar.xml +++ b/sw/uiconfig/sweb/menubar/menubar.xml @@ -164,8 +164,11 @@ <menu:menuseparator/> <menu:menu menu:id=".uno:TransliterateMenu"> <menu:menupopup> - <menu:menuitem menu:id=".uno:ChangeCaseToUpper"/> + <menu:menuitem menu:id=".uno:ChangeCaseToSentenceCase"/> <menu:menuitem menu:id=".uno:ChangeCaseToLower"/> + <menu:menuitem menu:id=".uno:ChangeCaseToUpper"/> + <menu:menuitem menu:id=".uno:ChangeCaseToTitleCase"/> + <menu:menuitem menu:id=".uno:ChangeCaseToToggleCase"/> <menu:menuitem menu:id=".uno:ChangeCaseToHalfWidth"/> <menu:menuitem menu:id=".uno:ChangeCaseToFullWidth"/> <menu:menuitem menu:id=".uno:ChangeCaseToHiragana"/> diff --git a/sw/uiconfig/swform/menubar/menubar.xml b/sw/uiconfig/swform/menubar/menubar.xml index 13448e424754..7adebe218a31 100644 --- a/sw/uiconfig/swform/menubar/menubar.xml +++ b/sw/uiconfig/swform/menubar/menubar.xml @@ -216,8 +216,11 @@ <menu:menuseparator/> <menu:menu menu:id=".uno:TransliterateMenu"> <menu:menupopup> - <menu:menuitem menu:id=".uno:ChangeCaseToUpper"/> + <menu:menuitem menu:id=".uno:ChangeCaseToSentenceCase"/> <menu:menuitem menu:id=".uno:ChangeCaseToLower"/> + <menu:menuitem menu:id=".uno:ChangeCaseToUpper"/> + <menu:menuitem menu:id=".uno:ChangeCaseToTitleCase"/> + <menu:menuitem menu:id=".uno:ChangeCaseToToggleCase"/> <menu:menuitem menu:id=".uno:ChangeCaseToHalfWidth"/> <menu:menuitem menu:id=".uno:ChangeCaseToFullWidth"/> <menu:menuitem menu:id=".uno:ChangeCaseToHiragana"/> diff --git a/sw/uiconfig/swreport/menubar/menubar.xml b/sw/uiconfig/swreport/menubar/menubar.xml index 1f94b7ced1c3..95316fad4be0 100644 --- a/sw/uiconfig/swreport/menubar/menubar.xml +++ b/sw/uiconfig/swreport/menubar/menubar.xml @@ -216,8 +216,11 @@ <menu:menuseparator/> <menu:menu menu:id=".uno:TransliterateMenu"> <menu:menupopup> - <menu:menuitem menu:id=".uno:ChangeCaseToUpper"/> + <menu:menuitem menu:id=".uno:ChangeCaseToSentenceCase"/> <menu:menuitem menu:id=".uno:ChangeCaseToLower"/> + <menu:menuitem menu:id=".uno:ChangeCaseToUpper"/> + <menu:menuitem menu:id=".uno:ChangeCaseToTitleCase"/> + <menu:menuitem menu:id=".uno:ChangeCaseToToggleCase"/> <menu:menuitem menu:id=".uno:ChangeCaseToHalfWidth"/> <menu:menuitem menu:id=".uno:ChangeCaseToFullWidth"/> <menu:menuitem menu:id=".uno:ChangeCaseToHiragana"/> diff --git a/sw/uiconfig/swriter/menubar/menubar.xml b/sw/uiconfig/swriter/menubar/menubar.xml index 7c44f84982a9..c675168efa8f 100644 --- a/sw/uiconfig/swriter/menubar/menubar.xml +++ b/sw/uiconfig/swriter/menubar/menubar.xml @@ -219,8 +219,11 @@ <menu:menuseparator/> <menu:menu menu:id=".uno:TransliterateMenu"> <menu:menupopup> - <menu:menuitem menu:id=".uno:ChangeCaseToUpper"/> + <menu:menuitem menu:id=".uno:ChangeCaseToSentenceCase"/> <menu:menuitem menu:id=".uno:ChangeCaseToLower"/> + <menu:menuitem menu:id=".uno:ChangeCaseToUpper"/> + <menu:menuitem menu:id=".uno:ChangeCaseToTitleCase"/> + <menu:menuitem menu:id=".uno:ChangeCaseToToggleCase"/> <menu:menuitem menu:id=".uno:ChangeCaseToHalfWidth"/> <menu:menuitem menu:id=".uno:ChangeCaseToFullWidth"/> <menu:menuitem menu:id=".uno:ChangeCaseToHiragana"/> diff --git a/sw/uiconfig/swxform/menubar/menubar.xml b/sw/uiconfig/swxform/menubar/menubar.xml index b37a8e14d232..7af7d4ccf2a8 100644 --- a/sw/uiconfig/swxform/menubar/menubar.xml +++ b/sw/uiconfig/swxform/menubar/menubar.xml @@ -217,8 +217,11 @@ <menu:menuseparator/> <menu:menu menu:id=".uno:TransliterateMenu"> <menu:menupopup> - <menu:menuitem menu:id=".uno:ChangeCaseToUpper"/> + <menu:menuitem menu:id=".uno:ChangeCaseToSentenceCase"/> <menu:menuitem menu:id=".uno:ChangeCaseToLower"/> + <menu:menuitem menu:id=".uno:ChangeCaseToUpper"/> + <menu:menuitem menu:id=".uno:ChangeCaseToTitleCase"/> + <menu:menuitem menu:id=".uno:ChangeCaseToToggleCase"/> <menu:menuitem menu:id=".uno:ChangeCaseToHalfWidth"/> <menu:menuitem menu:id=".uno:ChangeCaseToFullWidth"/> <menu:menuitem menu:id=".uno:ChangeCaseToHiragana"/> |