? new_translations.patch ? unxlngppc.pro ? inc/translations.patch Index: inc/globlmn.hrc =================================================================== RCS file: /cvs/graphics/svx/inc/globlmn.hrc,v retrieving revision 1.125 diff -u -r1.125 globlmn.hrc --- inc/globlmn.hrc 25 Sep 2003 10:39:23 -0000 1.125 +++ inc/globlmn.hrc 16 Dec 2003 13:10:00 -0000 @@ -561,6 +561,40 @@ Text[ hindi ] = "परिमाण"; \ Text[ slovak ] = "Veľkosť"; +#define ITEM_FORMAT_ATTR_CHAR_LANGUAGE \ + Identifier = SID_ATTR_CHAR_LANGUAGE ; \ + Command = ".uno:Language" ; \ + HelpID = SID_ATTR_CHAR_LANGUAGE ; \ + Text = "Language" ; \ + Text [ ENGLISH ] = "~Language" ; \ + Text [ norwegian ] = "~Language" ; \ + Text [ italian ] = "~Lingua" ; \ + Text [ portuguese_brazilian ] = "Idio~ma" ; \ + Text [ portuguese ] = "~Lngua" ; \ + Text [ finnish ] = "~Kieli" ; \ + Text [ danish ] = "Sprog" ; \ + Text [ french ] = "~Langue" ; \ + Text [ swedish ] = "~Sprk" ; \ + Text [ dutch ] = "Taa~l" ; \ + Text [ spanish ] = "~Idioma" ; \ + Text [ english_us ] = "~Language" ; \ + Text[ chinese_simplified ] = "语言(~L)" ; \ + Text[ russian ] = "" ; \ + Text[ polish ] = "~Jzyk" ; \ + Text[ japanese ] = "言語(~L)" ; \ + Text[ chinese_traditional ] = "語言(~L)" ; \ + Text[ arabic ] = "" ; \ + Text[ greek ] = "" ; \ + Text[ korean ] = "언어(~L)" ; \ + Text[ turkish ] = "~Dil" ; \ + Text[ language_user1 ] = " " ; \ + Text[ catalan ] = "~Idioma" ; \ + Text[ thai ] = "~ภาษา" ; \ + Text[ czech ] = "Jazyk" ; \ + Text[ hebrew ] = "‮שפה‬" ; \ + Text[ hindi ] = "~भाषा" ; \ + Text[ slovak ] = "~Jazyk" ; + #define ITEM_FORMAT_ATTR_CHAR_WEIGHT \ Identifier = SID_ATTR_CHAR_WEIGHT ; \ Command = ".uno:Bold" ; \ Index: inc/tbcontrl.hxx =================================================================== RCS file: /cvs/graphics/svx/inc/tbcontrl.hxx,v retrieving revision 1.5 diff -u -r1.5 tbcontrl.hxx --- inc/tbcontrl.hxx 17 Sep 2002 06:56:12 -0000 1.5 +++ inc/tbcontrl.hxx 16 Dec 2003 13:10:00 -0000 @@ -206,6 +206,7 @@ class SvxBoxInfoItem; class SvxFontItem; class SvxFontHeightItem; +class SvxLanguageItem; class SfxStyleControllerItem_Impl; class SfxStyleSheetBasePool; class SfxTemplateItem; @@ -308,6 +309,24 @@ }; #endif // ITEMID_FONTHEIGHT + +//======================================================================== +// class SvxLanguageToolBoxControl --------------------------------------- +//======================================================================== +#ifdef ITEMID_LANGUAGE + +class SvxLanguageToolBoxControl : public SfxToolBoxControl +{ +public: + SFX_DECL_TOOLBOX_CONTROL(); + SvxLanguageToolBoxControl( USHORT nId, ToolBox& rTbx, SfxBindings& rBindings ); + + virtual void StateChanged ( USHORT nSID, SfxItemState eState, + const SfxPoolItem* pState ); + virtual Window* CreateItemWindow ( Window *pParent ); +}; + +#endif // ITEMID_LANGUAGE //======================================================================== // class SvxFontColorToolBoxControl -------------------------------------- Index: sdi/svx.sdi =================================================================== RCS file: /cvs/graphics/svx/sdi/svx.sdi,v retrieving revision 1.41 diff -u -r1.41 svx.sdi --- sdi/svx.sdi 20 Oct 2003 14:15:23 -0000 1.41 +++ sdi/svx.sdi 16 Dec 2003 13:10:06 -0000 @@ -6092,8 +6092,8 @@ /* config: */ AccelConfig = FALSE, MenuConfig = FALSE, - StatusBarConfig = FALSE, - ToolBoxConfig = FALSE, + StatusBarConfig = TRUE, + ToolBoxConfig = TRUE, GroupId = GID_FORMAT; ] Index: sdi/svxslots.src =================================================================== RCS file: /cvs/graphics/svx/sdi/svxslots.src,v retrieving revision 1.96 diff -u -r1.96 svxslots.src --- sdi/svxslots.src 25 Sep 2003 10:39:45 -0000 1.96 +++ sdi/svxslots.src 16 Dec 2003 13:10:17 -0000 @@ -634,6 +634,38 @@ SlotName[ hindi ] = "फ़ॉन्ट का परिमाण"; SlotName[ slovak ] = "Veľkosť písma"; }; +SfxSlotInfo SID_ATTR_CHAR_LANGUAGE +{ + SlotName = "Language"; + SlotName[ ENGLISH ] = "~Language" ; + SlotName[ norwegian ] = "~Language" ; + SlotName[ italian ] = "~Lingua" ; + SlotName[ portuguese_brazilian ] = "Idio~ma" ; + SlotName[ portuguese ] = "~Lngua" ; + SlotName[ finnish ] = "~Kieli" ; + SlotName[ danish ] = "Sprog" ; + SlotName[ french ] = "~Langue" ; + SlotName[ swedish ] = "~Sprk" ; + SlotName[ dutch ] = "Taa~l" ; + SlotName[ spanish ] = "~Idioma" ; + SlotName[ english_us ] = "~Language" ; + SlotName[ chinese_simplified ] = "语言(~L)"; + SlotName[ russian ] = ""; + SlotName[ polish ] = "~Jzyk"; + SlotName[ japanese ] = "言語(~L)"; + SlotName[ chinese_traditional ] = "語言(~L)"; + SlotName[ arabic ] = ""; + SlotName[ greek ] = ""; + SlotName[ korean ] = "언어(~L)"; + SlotName[ turkish ] = "~Dil"; + SlotName[ language_user1 ] = " "; + SlotName[ catalan ] = "~Idioma"; + SlotName[ thai ] = "~ภาษา"; + SlotName[ czech ] = "Jazyk"; + SlotName[ hebrew ] = "‮שפה‬"; + SlotName[ hindi ] = "~भाषा"; + SlotName[ slovak ] = "~Jazyk"; +}; SfxSlotInfo SID_ATTR_CHAR_POSTURE { SlotName = "Kursiv"; Index: source/tbxctrls/tbcontrl.cxx =================================================================== RCS file: /cvs/graphics/svx/source/tbxctrls/tbcontrl.cxx,v retrieving revision 1.44 diff -u -r1.44 tbcontrl.cxx --- source/tbxctrls/tbcontrl.cxx 1 Dec 2003 18:15:52 -0000 1.44 +++ source/tbxctrls/tbcontrl.cxx 16 Dec 2003 13:10:21 -0000 @@ -127,6 +127,7 @@ #define ITEMID_FONTLIST SID_ATTR_CHAR_FONTLIST #define ITEMID_FONT SID_ATTR_CHAR_FONT #define ITEMID_FONTHEIGHT SID_ATTR_CHAR_FONTHEIGHT +#define ITEMID_LANGUAGE SID_ATTR_CHAR_LANGUAGE #define ITEMID_COLOR SID_ATTR_CHAR_COLOR #define ITEMID_BRUSH SID_ATTR_BRUSH #define ITEMID_BOX SID_ATTR_BORDER_OUTER @@ -137,6 +138,7 @@ #include "xtable.hxx" #include "fontitem.hxx" #include "fhgtitem.hxx" +#include "langitem.hxx" #include "brshitem.hxx" #include "boxitem.hxx" #include "colritem.hxx" @@ -146,6 +148,7 @@ #include "tbcontrl.hxx" #include "dlgutil.hxx" #include "dialmgr.hxx" +#include "langbox.hxx" // ------------------------------------------------------------------------ @@ -166,6 +169,7 @@ SFX_IMPL_TOOLBOX_CONTROL( SvxStyleToolBoxControl, SfxTemplateItem ); SFX_IMPL_TOOLBOX_CONTROL( SvxFontNameToolBoxControl, SvxFontItem ); SFX_IMPL_TOOLBOX_CONTROL( SvxFontHeightToolBoxControl, SvxFontHeightItem ); +SFX_IMPL_TOOLBOX_CONTROL( SvxLanguageToolBoxControl, SvxLanguageItem ); SFX_IMPL_TOOLBOX_CONTROL( SvxFontColorToolBoxControl, SvxColorItem ); SFX_IMPL_TOOLBOX_CONTROL( SvxFontColorExtToolBoxControl, SvxColorItem ); SFX_IMPL_TOOLBOX_CONTROL( SvxColorToolBoxControl, SvxColorItem ); @@ -282,6 +286,35 @@ }; //======================================================================== +// class SvxLanguageBox_Impl --------------------------------------------- +//======================================================================== + +class SvxLanguageToolBoxControl; + +class SvxLanguageBox_Impl : public SvxLanguageBox +{ +private: + SvxLanguageToolBoxControl* pCtrl; + BOOL bRelease; + SfxBindings& rBindings; + Size aControlSize; + + void ReleaseFocus_Impl(); + +protected: + virtual void Select(); + virtual void DataChanged( const DataChangedEvent& rDCEvt ); + +public: + SvxLanguageBox_Impl( Window* pParent,SvxLanguageToolBoxControl& rCtrl, SfxBindings& rBind ); + + void StateChanged_Impl( SfxItemState eState,const SfxPoolItem* pState ); + void Update( const SvxLanguageItem& rLanguageItem ); + + virtual long Notify( NotifyEvent& rNEvt ); +}; + +//======================================================================== // class SvxColorWindow_Impl -------------------------------------------------- //======================================================================== @@ -1002,6 +1035,134 @@ } //======================================================================== +// class SvxLanguageBox_Impl -------------------------------------------------- +//======================================================================== + +SvxLanguageBox_Impl::SvxLanguageBox_Impl( Window* pParent, SvxLanguageToolBoxControl &rCtrl, SfxBindings& rBind ) : + SvxLanguageBox( pParent, WinBits(WB_DROPDOWN) ), + pCtrl ( &rCtrl ), + bRelease ( TRUE ), + rBindings ( rBind ) +{ + SvxLanguageBox::SetLanguageList( LANG_LIST_ALL, TRUE, FALSE, TRUE ); + + aControlSize = CalcMinimumSize(); + aControlSize.setWidth( aControlSize.getWidth() * 0.8 ); + SetSizePixel( aControlSize ); + SvxLanguageBox::SetDropDownLineCount( 20 ); +} + +// ----------------------------------------------------------------------- + +void SvxLanguageBox_Impl::ReleaseFocus_Impl() +{ + if ( !bRelease ) + { + bRelease = TRUE; + return; + } + + SfxViewShell* pCurSh = SfxViewShell::Current(); + + if ( pCurSh ) + { + Window* pShellWnd = pCurSh->GetWindow(); + + if ( pShellWnd ) + pShellWnd->GrabFocus(); + } +} + +// ----------------------------------------------------------------------- + +void SvxLanguageBox_Impl::Select() +{ + SvxLanguageBox::Select(); + + if ( !IsTravelSelect() ) + { + SvxLanguageItem aLanguageItem( SvxLanguageBox::GetSelectLanguage() ); + rBindings.GetDispatcher()->Execute( + SID_ATTR_CHAR_LANGUAGE, SFX_CALLMODE_RECORD, &aLanguageItem, 0L ); + ReleaseFocus_Impl(); + } +} +// ----------------------------------------------------------------------- + +void SvxLanguageBox_Impl::StateChanged_Impl( SfxItemState eState, const SfxPoolItem* pState ) +{ +} + +// ----------------------------------------------------------------------- + +void SvxLanguageBox_Impl::Update( const SvxLanguageItem& rLanguageItem ) +{ + SvxLanguageBox::SetLanguageList( LANG_LIST_ALL, TRUE, FALSE, TRUE ); + + LanguageType eLangType = (LanguageType)rLanguageItem.GetValue(); + if ( eLangType != LANGUAGE_DONTKNOW ) + { + for ( USHORT i = 0; i < GetEntryCount(); ++i ) + { + if ( (LanguageType)(ULONG)GetEntryData(i) == eLangType ) + { + SelectEntryPos(i); + break; + } + } + } +} + +// ----------------------------------------------------------------------- + +long SvxLanguageBox_Impl::Notify( NotifyEvent& rNEvt ) +{ + long nHandled = 0; + +#if 0 + if ( rNEvt.GetType() == EVENT_KEYINPUT ) + { + USHORT nCode = rNEvt.GetKeyEvent()->GetKeyCode().GetCode(); + + switch ( nCode ) + { + case KEY_RETURN: + case KEY_TAB: + { + if ( KEY_TAB == nCode ) + bRelease = FALSE; + else + nHandled = 1; + Select(); + break; + } + + case KEY_ESCAPE: + SetText( aCurText ); + ReleaseFocus_Impl(); + nHandled = 1; + break; + } + } + else if(EVENT_LOSEFOCUS == rNEvt.GetType()) + { + Window* pFocusWin = Application::GetFocusWindow(); + if(!HasFocus() && GetSubEdit() != pFocusWin) + SetText(GetSavedValue()); + } +#endif + + return nHandled ? nHandled : SvxLanguageBox::Notify( rNEvt ); +} +/* -----------------------------08.03.2002 13:24------------------------------ + + ---------------------------------------------------------------------------*/ +void SvxLanguageBox_Impl::DataChanged( const DataChangedEvent& rDCEvt ) +{ + SvxLanguageBox::DataChanged( rDCEvt ); +} + +//======================================================================== // class SvxColorWindow_Impl -------------------------------------------------- //======================================================================== #ifndef WB_NO_DIRECTSELECT @@ -2436,6 +2597,64 @@ Window* SvxFontHeightToolBoxControl::CreateItemWindow( Window *pParent ) { pBox = new SvxFontSizeBox_Impl( pParent, *this, GetBindings() ); + return pBox; +} + +//======================================================================== +// class SvxLanguageToolBoxControl --------------------------------------- +//======================================================================== + +SvxLanguageToolBoxControl::SvxLanguageToolBoxControl( + USHORT nId, + ToolBox& rTbx , + SfxBindings& rBindings) + : SfxToolBoxControl( nId, rTbx, rBindings ) +{ +} + +// ----------------------------------------------------------------------- + +void SvxLanguageToolBoxControl::StateChanged( + USHORT nSID, SfxItemState eState, const SfxPoolItem* pState ) +{ + USHORT nId = GetId(); + ToolBox& rTbx = GetToolBox(); + SvxLanguageBox_Impl* pBox = (SvxLanguageBox_Impl*)(rTbx.GetItemWindow( nId )); + + DBG_ASSERT( pBox, "Control not found!" ); + + if ( SFX_ITEM_DISABLED == eState ) + { + pBox->Disable(); + pBox->Update( NULL ); + } + else + { + pBox->Enable(); + + if ( SFX_ITEM_AVAILABLE == eState ) + { + SvxLanguageItem *pLangItem = (eState == SFX_ITEM_AVAILABLE) ? (SvxLanguageItem*)pState : NULL; + + if( ! pLangItem->ISA(SvxLanguageItem) ) + fprintf( stderr, "SvxLanguageToolBoxControl::StateChanged() - bad ItemType, expected SvxLanguageItem" ); + + if ( pLangItem ) + pBox->Update( *pLangItem ); + } + else + pBox->SelectLanguage( LANGUAGE_DONTKNOW ); + pBox->SaveValue(); + } + + rTbx.EnableItem( nId, SFX_ITEM_DISABLED != eState ); +} + +// ----------------------------------------------------------------------- + +Window* SvxLanguageToolBoxControl::CreateItemWindow( Window *pParent ) +{ + SvxLanguageBox_Impl* pBox = new SvxLanguageBox_Impl( pParent, *this, GetBindings() ); return pBox; }