-- cgit v1.2.3 From f351e9aa30010fec27deb0ad705fd35744675c5b Mon Sep 17 00:00:00 2001 From: Thomas Lange Date: Thu, 17 Sep 2009 07:30:11 +0000 Subject: #i1601# Sentence case, Title case, and Toggle case transliteration added --- sd/sdi/_drvwsh.sdi | 15 +++++++++++++++ sd/sdi/outlnvsh.sdi | 15 +++++++++++++++ sd/source/ui/view/drviewse.cxx | 15 ++++++++++++++- sd/source/ui/view/drviewsf.cxx | 3 +++ sd/source/ui/view/outlnvsh.cxx | 18 +++++++++++++++++- sd/uiconfig/sdraw/menubar/menubar.xml | 5 ++++- sd/uiconfig/simpress/menubar/menubar.xml | 5 ++++- 7 files changed, 72 insertions(+), 4 deletions(-) diff --git a/sd/sdi/_drvwsh.sdi b/sd/sdi/_drvwsh.sdi index 8f758dda5858..4284594241fc 100644 --- a/sd/sdi/_drvwsh.sdi +++ b/sd/sdi/_drvwsh.sdi @@ -2176,6 +2176,21 @@ interface DrawView ExecMethod = FuSupport ; StateMethod = GetCtrlState ; ] + SID_TRANSLITERATE_SENTENCE_CASE // ole : no, status : ? + [ + ExecMethod = FuSupport ; + StateMethod = GetCtrlState ; + ] + SID_TRANSLITERATE_TITLE_CASE // ole : no, status : ? + [ + ExecMethod = FuSupport ; + StateMethod = GetCtrlState ; + ] + SID_TRANSLITERATE_TOGGLE_CASE // ole : no, status : ? + [ + ExecMethod = FuSupport ; + StateMethod = GetCtrlState ; + ] SID_TRANSLITERATE_LOWER // ole : no, status : ? [ ExecMethod = FuSupport ; diff --git a/sd/sdi/outlnvsh.sdi b/sd/sdi/outlnvsh.sdi index 3b0c49af6901..2b865562ed75 100644 --- a/sd/sdi/outlnvsh.sdi +++ b/sd/sdi/outlnvsh.sdi @@ -436,6 +436,21 @@ interface OutlineView ExecMethod = FuSupport ; StateMethod = GetMenuState ; ] + SID_TRANSLITERATE_SENTENCE_CASE // ole : no, status : ? + [ + ExecMethod = FuSupport ; + StateMethod = GetCtrlState ; + ] + SID_TRANSLITERATE_TITLE_CASE // ole : no, status : ? + [ + ExecMethod = FuSupport ; + StateMethod = GetCtrlState ; + ] + SID_TRANSLITERATE_TOGGLE_CASE // ole : no, status : ? + [ + ExecMethod = FuSupport ; + StateMethod = GetCtrlState ; + ] SID_TRANSLITERATE_UPPER // ole : no, status : ? [ ExecMethod = FuSupport ; diff --git a/sd/source/ui/view/drviewse.cxx b/sd/source/ui/view/drviewse.cxx index 0b3ecf1af6e7..3693b114a862 100644 --- a/sd/source/ui/view/drviewse.cxx +++ b/sd/source/ui/view/drviewse.cxx @@ -34,7 +34,8 @@ #include #include #include -#include +#include +#include #include @@ -1386,6 +1387,9 @@ void DrawViewShell::FuSupport(SfxRequest& rReq) } break; + case SID_TRANSLITERATE_SENTENCE_CASE: + case SID_TRANSLITERATE_TITLE_CASE: + case SID_TRANSLITERATE_TOGGLE_CASE: case SID_TRANSLITERATE_UPPER: case SID_TRANSLITERATE_LOWER: case SID_TRANSLITERATE_HALFWIDTH: @@ -1401,6 +1405,15 @@ void DrawViewShell::FuSupport(SfxRequest& rReq) switch( nSId ) { + case SID_TRANSLITERATE_SENTENCE_CASE: + nType = TransliterationModulesExtra::SENTENCE_CASE; + break; + case SID_TRANSLITERATE_TITLE_CASE: + nType = TransliterationModulesExtra::TITLE_CASE; + break; + case SID_TRANSLITERATE_TOGGLE_CASE: + nType = TransliterationModulesExtra::TOGGLE_CASE; + break; case SID_TRANSLITERATE_UPPER: nType = TransliterationModules_LOWERCASE_UPPERCASE; break; diff --git a/sd/source/ui/view/drviewsf.cxx b/sd/source/ui/view/drviewsf.cxx index 2b1b7518666c..09e0a3692f5d 100644 --- a/sd/source/ui/view/drviewsf.cxx +++ b/sd/source/ui/view/drviewsf.cxx @@ -254,6 +254,9 @@ void DrawViewShell::GetCtrlState(SfxItemSet &rSet) GetViewFrame()->GetBindings().SetVisibleState( SID_TRANSLITERATE_KATAGANA, sal_True ); } + rSet.DisableItem( SID_TRANSLITERATE_SENTENCE_CASE ); + rSet.DisableItem( SID_TRANSLITERATE_TITLE_CASE ); + rSet.DisableItem( SID_TRANSLITERATE_TOGGLE_CASE ); rSet.DisableItem( SID_TRANSLITERATE_UPPER ); rSet.DisableItem( SID_TRANSLITERATE_LOWER ); rSet.DisableItem( SID_TRANSLITERATE_HALFWIDTH ); diff --git a/sd/source/ui/view/outlnvsh.cxx b/sd/source/ui/view/outlnvsh.cxx index e4eb22af0552..9c0a42534cf1 100644 --- a/sd/source/ui/view/outlnvsh.cxx +++ b/sd/source/ui/view/outlnvsh.cxx @@ -63,7 +63,8 @@ #include #include #include -#include +#include +#include #include #include #include @@ -532,6 +533,9 @@ void OutlineViewShell::FuSupport(SfxRequest &rReq) std::auto_ptr< OutlineViewModelChangeGuard > aGuard; if( pOlView && ( + (nSlot == SID_TRANSLITERATE_SENTENCE_CASE) || + (nSlot == SID_TRANSLITERATE_TITLE_CASE) || + (nSlot == SID_TRANSLITERATE_TOGGLE_CASE) || (nSlot == SID_TRANSLITERATE_UPPER) || (nSlot == SID_TRANSLITERATE_LOWER) || (nSlot == SID_TRANSLITERATE_HALFWIDTH) || @@ -665,6 +669,9 @@ void OutlineViewShell::FuSupport(SfxRequest &rReq) } break; + case SID_TRANSLITERATE_SENTENCE_CASE: + case SID_TRANSLITERATE_TITLE_CASE: + case SID_TRANSLITERATE_TOGGLE_CASE: case SID_TRANSLITERATE_UPPER: case SID_TRANSLITERATE_LOWER: case SID_TRANSLITERATE_HALFWIDTH: @@ -680,6 +687,15 @@ void OutlineViewShell::FuSupport(SfxRequest &rReq) switch( nSlot ) { + case SID_TRANSLITERATE_SENTENCE_CASE: + nType = TransliterationModulesExtra::SENTENCE_CASE; + break; + case SID_TRANSLITERATE_TITLE_CASE: + nType = TransliterationModulesExtra::TITLE_CASE; + break; + case SID_TRANSLITERATE_TOGGLE_CASE: + nType = TransliterationModulesExtra::TOGGLE_CASE; + break; case SID_TRANSLITERATE_UPPER: nType = TransliterationModules_LOWERCASE_UPPERCASE; break; diff --git a/sd/uiconfig/sdraw/menubar/menubar.xml b/sd/uiconfig/sdraw/menubar/menubar.xml index e34baec0f29c..560714b115b4 100644 --- a/sd/uiconfig/sdraw/menubar/menubar.xml +++ b/sd/uiconfig/sdraw/menubar/menubar.xml @@ -183,8 +183,11 @@ - + + + + diff --git a/sd/uiconfig/simpress/menubar/menubar.xml b/sd/uiconfig/simpress/menubar/menubar.xml index ece53ad4c918..8fdb862a081c 100644 --- a/sd/uiconfig/simpress/menubar/menubar.xml +++ b/sd/uiconfig/simpress/menubar/menubar.xml @@ -201,8 +201,11 @@ - + + + + -- cgit v1.2.3 From 26999baa19f28e4916df28bc8c2eca2f88b70cbd Mon Sep 17 00:00:00 2001 From: Thomas Lange Date: Wed, 25 Nov 2009 16:50:53 +0000 Subject: #i51258# thesaurus for right click context menu --- sd/sdi/drtxtob.sdi | 6 ++++++ sd/source/ui/view/drtxtob.cxx | 29 +++++++++++++++++++++++++++++ sd/source/ui/view/drtxtob1.cxx | 16 ++++++++++++++++ sd/uiconfig/sdraw/menubar/menubar.xml | 2 +- sd/uiconfig/simpress/menubar/menubar.xml | 2 +- 5 files changed, 53 insertions(+), 2 deletions(-) diff --git a/sd/sdi/drtxtob.sdi b/sd/sdi/drtxtob.sdi index 4e2ca49c0b82..f4133f0f4643 100644 --- a/sd/sdi/drtxtob.sdi +++ b/sd/sdi/drtxtob.sdi @@ -202,5 +202,11 @@ shell TextObjectBar ExecMethod = Execute; StateMethod = GetAttrState; ] + SID_THES + [ + ExecMethod = Execute ; + StateMethod = GetAttrState ; + ] + } diff --git a/sd/source/ui/view/drtxtob.cxx b/sd/source/ui/view/drtxtob.cxx index 55980ff02050..7e3e48b7a59d 100644 --- a/sd/source/ui/view/drtxtob.cxx +++ b/sd/source/ui/view/drtxtob.cxx @@ -33,14 +33,21 @@ #include "TextObjectBar.hxx" +#include +#include #include #include #include +#include +#include +#include +#include #include #include #include #include +#include #include #include #include @@ -73,6 +80,8 @@ using namespace sd; +using namespace ::com::sun::star; + #define TextObjectBar #include "sdslots.hxx" @@ -373,6 +382,26 @@ void TextObjectBar::GetAttrState( SfxItemSet& rSet ) } break; + case SID_THES: + { + EditView & rEditView = mpView->GetTextEditOutlinerView()->GetEditView();; + String aStatusVal; + LanguageType nLang = LANGUAGE_NONE; + bool bIsLookUpWord = GetStatusValueForThesaurusFromContext( aStatusVal, nLang, rEditView ); + rSet.Put( SfxStringItem( SID_THES, aStatusVal ) ); + + // disable "Thesaurus" context menu entry if there is nothing to look up + lang::Locale aLocale( SvxCreateLocale( nLang ) ); + uno::Reference< linguistic2::XThesaurus > xThes( LinguMgr::GetThesaurus() ); + if (!bIsLookUpWord || + !xThes.is() || nLang == LANGUAGE_NONE || !xThes->hasLocale( aLocale )) + rSet.DisableItem( SID_THES ); + + //! avoid puting the same item as SfxBoolItem at the end of this function + nSlotId = 0; + } + break; + default: break; } diff --git a/sd/source/ui/view/drtxtob1.cxx b/sd/source/ui/view/drtxtob1.cxx index 9c2733c933dd..b128472ac61c 100644 --- a/sd/source/ui/view/drtxtob1.cxx +++ b/sd/source/ui/view/drtxtob1.cxx @@ -33,6 +33,12 @@ #include "TextObjectBar.hxx" +#include + +//#include +#include +#include +#include #include #ifndef _ULSPITEM_HXX @@ -341,6 +347,16 @@ void TextObjectBar::Execute( SfxRequest &rReq ) } break; + case SID_THES: + { + String aReplaceText; + SFX_REQUEST_ARG( rReq, pItem2, SfxStringItem, SID_THES, sal_False ); + if (pItem2) + aReplaceText = pItem2->GetValue(); + if (aReplaceText.Len() > 0) + ReplaceTextWithSynonym( pOLV->GetEditView(), aReplaceText ); + } + break; default: { diff --git a/sd/uiconfig/sdraw/menubar/menubar.xml b/sd/uiconfig/sdraw/menubar/menubar.xml index 04e085c6050f..a7ce6d3f76cb 100644 --- a/sd/uiconfig/sdraw/menubar/menubar.xml +++ b/sd/uiconfig/sdraw/menubar/menubar.xml @@ -214,7 +214,7 @@ - + diff --git a/sd/uiconfig/simpress/menubar/menubar.xml b/sd/uiconfig/simpress/menubar/menubar.xml index 2483b61bd01e..fd565d5d7c8c 100644 --- a/sd/uiconfig/simpress/menubar/menubar.xml +++ b/sd/uiconfig/simpress/menubar/menubar.xml @@ -242,7 +242,7 @@ - + -- cgit v1.2.3