diff options
author | Mathias Bauer <mba@openoffice.org> | 2009-11-23 17:39:22 +0100 |
---|---|---|
committer | Mathias Bauer <mba@openoffice.org> | 2009-11-23 17:39:22 +0100 |
commit | 9edc763c5ec6d909a8080d30b5ab029c8d0779ba (patch) | |
tree | 07b94867f33b51218bc177a1de445254fe56152d /sfx2 | |
parent | a4d4ea40f2e8b5a3b3ea469bfa36104d751b6d96 (diff) | |
parent | b4083630cb439a9f54340db6840e8bc6cfcc42c8 (diff) |
merge commit for m65
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/inc/sfx2/passwd.hxx | 4 | ||||
-rw-r--r-- | sfx2/source/appl/newhelp.cxx | 6 | ||||
-rw-r--r-- | sfx2/source/dialog/dockwin.cxx | 3 | ||||
-rw-r--r-- | sfx2/source/dialog/passwd.cxx | 28 | ||||
-rw-r--r-- | sfx2/source/dialog/templdlg.cxx | 4 | ||||
-rw-r--r-- | sfx2/source/doc/docvor.cxx | 6 | ||||
-rw-r--r-- | sfx2/source/menu/mnuitem.cxx | 4 | ||||
-rw-r--r-- | sfx2/source/menu/virtmenu.cxx | 6 | ||||
-rw-r--r-- | sfx2/source/toolbox/imgmgr.cxx | 4 | ||||
-rw-r--r-- | sfx2/source/toolbox/tbxitem.cxx | 6 |
10 files changed, 47 insertions, 24 deletions
diff --git a/sfx2/inc/sfx2/passwd.hxx b/sfx2/inc/sfx2/passwd.hxx index bb4e1b8c1561..bfe8debecca1 100644 --- a/sfx2/inc/sfx2/passwd.hxx +++ b/sfx2/inc/sfx2/passwd.hxx @@ -68,10 +68,9 @@ private: USHORT mnMinLen; USHORT mnExtras; -//#if 0 // _SOLAR__PRIVATE + bool mbAsciiOnly; DECL_DLLPRIVATE_LINK( EditModifyHdl, Edit* ); DECL_DLLPRIVATE_LINK( OKHdl, OKButton* ); -//#endif public: SfxPasswordDialog( Window* pParent, const String* pGroupText = NULL ); @@ -84,6 +83,7 @@ public: void SetMaxLen( USHORT Len ); void SetEditHelpId( ULONG nId ) { maPasswordED.SetHelpId( nId ); } void ShowExtras( USHORT nExtras ) { mnExtras = nExtras; } + void AllowAsciiOnly( bool i_bAsciiOnly = true ) { mbAsciiOnly = i_bAsciiOnly; } virtual short Execute(); }; diff --git a/sfx2/source/appl/newhelp.cxx b/sfx2/source/appl/newhelp.cxx index 2472a1ceca34..c5412f35d0f6 100644 --- a/sfx2/source/appl/newhelp.cxx +++ b/sfx2/source/appl/newhelp.cxx @@ -296,7 +296,7 @@ ContentListBox_Impl::ContentListBox_Impl( Window* pParent, const ResId& rResId ) aDocumentImage ( SfxResId( IMG_HELP_CONTENT_DOC ) ) { - if ( GetSettings().GetStyleSettings().GetWindowColor().IsDark() ) + if ( GetSettings().GetStyleSettings().GetHighContrastMode() ) { aOpenBookImage = Image( SfxResId( IMG_HELP_CONTENT_BOOK_OPEN_HC ) ); aClosedBookImage = Image( SfxResId( IMG_HELP_CONTENT_BOOK_CLOSED_HC ) ); @@ -2178,7 +2178,7 @@ sal_Bool SfxHelpTextWindow_Impl::HasSelection() const void SfxHelpTextWindow_Impl::InitToolBoxImages() { sal_Bool bLarge = SvtMiscOptions().AreCurrentSymbolsLarge(); - sal_Bool bHiContrast = GetBackground().GetColor().IsDark(); + sal_Bool bHiContrast = GetSettings().GetStyleSettings().GetHighContrastMode(); aIndexOnImage = Image( SfxResId( bLarge ? bHiContrast ? IMG_HELP_TOOLBOX_HCL_INDEX_ON : IMG_HELP_TOOLBOX_L_INDEX_ON @@ -2584,7 +2584,7 @@ long SfxHelpTextWindow_Impl::PreNotify( NotifyEvent& rNEvt ) if ( pCmdEvt->GetCommand() == COMMAND_CONTEXTMENU && pCmdWin != this && pCmdWin != &aToolBox ) { - sal_Bool bHiContrast = GetSettings().GetStyleSettings().GetMenuColor().IsDark(); + sal_Bool bHiContrast = GetSettings().GetStyleSettings().GetHighContrastMode(); Point aPos; if ( pCmdEvt->IsMouseEvent() ) aPos = pCmdEvt->GetMousePosPixel(); diff --git a/sfx2/source/dialog/dockwin.cxx b/sfx2/source/dialog/dockwin.cxx index fb31ab3dc252..0b278a55872b 100644 --- a/sfx2/source/dialog/dockwin.cxx +++ b/sfx2/source/dialog/dockwin.cxx @@ -236,7 +236,8 @@ SfxDockingWrapper::SfxDockingWrapper( Window* pParentWnd , } Window* pContentWindow = VCLUnoHelper::GetWindow(xWindow); - pContentWindow->SetStyle( pContentWindow->GetStyle() | WB_DIALOGCONTROL | WB_CHILDDLGCTRL ); + if ( pContentWindow ) + pContentWindow->SetStyle( pContentWindow->GetStyle() | WB_DIALOGCONTROL | WB_CHILDDLGCTRL ); pTitleDockWindow->SetWrappedWindow(pContentWindow); } diff --git a/sfx2/source/dialog/passwd.cxx b/sfx2/source/dialog/passwd.cxx index cbe47d39b704..981657d476fa 100644 --- a/sfx2/source/dialog/passwd.cxx +++ b/sfx2/source/dialog/passwd.cxx @@ -43,10 +43,35 @@ #include "dialog.hrc" #include "passwd.hrc" +#include "vcl/sound.hxx" + // ----------------------------------------------------------------------- IMPL_LINK_INLINE_START( SfxPasswordDialog, EditModifyHdl, Edit *, EMPTYARG ) { + if( mbAsciiOnly ) + { + rtl::OUString aTest( maPasswordED.GetText() ); + const sal_Unicode* pTest = aTest.getStr(); + sal_Int32 nLen = aTest.getLength(); + rtl::OUStringBuffer aFilter( nLen ); + bool bReset = false; + for( sal_Int32 i = 0; i < nLen; i++ ) + { + if( *pTest > 0x007f ) + bReset = true; + else + aFilter.append( *pTest ); + pTest++; + } + if( bReset ) + { + Sound::Beep( SOUND_ERROR ); + maPasswordED.SetSelection( Selection( 0, nLen ) ); + maPasswordED.ReplaceSelected( aFilter.makeStringAndClear() ); + } + + } maOKBtn.Enable( maPasswordED.GetText().Len() >= mnMinLen ); return 0; } @@ -88,7 +113,8 @@ SfxPasswordDialog::SfxPasswordDialog( Window* pParent, const String* pGroupText maConfirmStr ( SfxResId( STR_PASSWD_CONFIRM ) ), mnMinLen ( 5 ), - mnExtras ( 0 ) + mnExtras ( 0 ), + mbAsciiOnly ( false ) { FreeResource(); diff --git a/sfx2/source/dialog/templdlg.cxx b/sfx2/source/dialog/templdlg.cxx index c5fcba6dc686..584dd488da56 100644 --- a/sfx2/source/dialog/templdlg.cxx +++ b/sfx2/source/dialog/templdlg.cxx @@ -2407,7 +2407,7 @@ void SfxTemplateDialog_Impl::updateFamilyImages() return; // let the families collection update the images - sal_Bool bIsHighContrast = m_pFloat->GetDisplayBackground().GetColor().IsDark(); + sal_Bool bIsHighContrast = m_pFloat->GetSettings().GetStyleSettings().GetHighContrastMode(); pStyleFamilies->updateImages( *m_pStyleFamiliesId, bIsHighContrast ? BMP_COLOR_HIGHCONTRAST : BMP_COLOR_NORMAL ); // and set the new images on our toolbox @@ -2424,7 +2424,7 @@ void SfxTemplateDialog_Impl::updateFamilyImages() void SfxTemplateDialog_Impl::updateNonFamilyImages() { m_aActionTbR.SetImageList( ImageList( SfxResId( - m_pFloat->GetDisplayBackground().GetColor().IsDark() ? IMG_LST_STYLE_DESIGNER_HC + m_pFloat->GetSettings().GetStyleSettings().GetHighContrastMode() ? IMG_LST_STYLE_DESIGNER_HC : DLG_STYLE_DESIGNER ) ) ); } diff --git a/sfx2/source/doc/docvor.cxx b/sfx2/source/doc/docvor.cxx index c761ac94c510..86a86ccb61b4 100644 --- a/sfx2/source/doc/docvor.cxx +++ b/sfx2/source/doc/docvor.cxx @@ -1188,7 +1188,7 @@ void SfxOrganizeListBox_Impl::RequestingChilds( SvLBoxEntry* pEntry ) // einfuegen BmpColorMode eColorMode = BMP_COLOR_NORMAL; - if ( GetDisplayBackground().GetColor().IsDark() ) + if ( GetSettings().GetStyleSettings().GetHighContrastMode() ) eColorMode = BMP_COLOR_HIGHCONTRAST; @@ -1480,7 +1480,7 @@ const Image &SfxOrganizeListBox_Impl::GetClosedBmp(USHORT nLevel) const */ { - BOOL bHC = GetBackground().GetColor().IsDark(); + BOOL bHC = GetSettings().GetStyleSettings().GetHighContrastMode(); const Image* pRet = NULL; switch( nLevel ) @@ -1514,7 +1514,7 @@ const Image &SfxOrganizeListBox_Impl::GetOpenedBmp(USHORT nLevel) const */ { - BOOL bHC = GetBackground().GetColor().IsDark(); + BOOL bHC = GetSettings().GetStyleSettings().GetHighContrastMode(); const Image* pRet = NULL; switch( nLevel ) diff --git a/sfx2/source/menu/mnuitem.cxx b/sfx2/source/menu/mnuitem.cxx index 8e403c6bb353..a9d654e7af52 100644 --- a/sfx2/source/menu/mnuitem.cxx +++ b/sfx2/source/menu/mnuitem.cxx @@ -451,7 +451,7 @@ SfxAppMenuControl_Impl::SfxAppMenuControl_Impl( // Determine the current background color setting for menus const StyleSettings& rSettings = Application::GetSettings().GetStyleSettings(); m_nSymbolsStyle = rSettings.GetSymbolsStyle(); - m_bWasHiContrastMode = rSettings.GetMenuColor().IsDark(); + m_bWasHiContrastMode = rSettings.GetHighContrastMode(); m_bShowMenuImages = rSettings.GetUseImagesInMenus(); Reference<com::sun::star::lang::XMultiServiceFactory> aXMultiServiceFactory(::comphelper::getProcessServiceFactory()); @@ -477,7 +477,7 @@ IMPL_LINK( SfxAppMenuControl_Impl, Activate, Menu *, pActMenu ) { const StyleSettings& rSettings = Application::GetSettings().GetStyleSettings(); ULONG nSymbolsStyle = rSettings.GetSymbolsStyle(); - BOOL bIsHiContrastMode = rSettings.GetMenuColor().IsDark(); + BOOL bIsHiContrastMode = rSettings.GetHighContrastMode(); BOOL bShowMenuImages = rSettings.GetUseImagesInMenus(); if (( nSymbolsStyle != m_nSymbolsStyle ) || diff --git a/sfx2/source/menu/virtmenu.cxx b/sfx2/source/menu/virtmenu.cxx index 850f1bd40e7e..9ef69de172a3 100644 --- a/sfx2/source/menu/virtmenu.cxx +++ b/sfx2/source/menu/virtmenu.cxx @@ -336,11 +336,7 @@ SfxVirtualMenu::~SfxVirtualMenu() BOOL SfxVirtualMenu::IsHiContrastMode() const { const StyleSettings& rSettings = Application::GetSettings().GetStyleSettings(); - Color aMenuColor = rSettings.GetMenuColor(); - if ( aMenuColor.IsDark() ) - return TRUE; - else - return FALSE; + return rSettings.GetHighContrastMode(); } //-------------------------------------------------------------------- diff --git a/sfx2/source/toolbox/imgmgr.cxx b/sfx2/source/toolbox/imgmgr.cxx index fd14b2da4b6f..eb9305fc0e49 100644 --- a/sfx2/source/toolbox/imgmgr.cxx +++ b/sfx2/source/toolbox/imgmgr.cxx @@ -229,7 +229,7 @@ void SfxImageManager_Impl::SetSymbolsSize_Impl( sal_Int16 nNewSymbolsSize ) if ( pInf->nFlags & SFX_TOOLBOX_CHANGESYMBOLSET ) { ToolBox *pBox = pInf->pToolBox; - BOOL bHiContrast = pBox->GetBackground().GetColor().IsDark(); + BOOL bHiContrast = pBox->GetSettings().GetStyleSettings().GetHighContrastMode(); USHORT nCount = pBox->GetItemCount(); for ( USHORT nPos=0; nPos<nCount; nPos++ ) { @@ -424,6 +424,6 @@ void SfxImageManager::SetImagesForceSize( ToolBox& rToolBox, BOOL bHiContrast, B void SfxImageManager::SetImages( ToolBox& rToolBox ) { BOOL bLarge = ( pImp->m_nSymbolsSize == SFX_SYMBOLS_SIZE_LARGE ); - BOOL bHiContrast = rToolBox.GetBackground().GetColor().IsDark(); + BOOL bHiContrast = rToolBox.GetSettings().GetStyleSettings().GetHighContrastMode(); SetImagesForceSize( rToolBox, bHiContrast, bLarge ); } diff --git a/sfx2/source/toolbox/tbxitem.cxx b/sfx2/source/toolbox/tbxitem.cxx index d65d7022f1df..29e6b85d67d2 100644 --- a/sfx2/source/toolbox/tbxitem.cxx +++ b/sfx2/source/toolbox/tbxitem.cxx @@ -1529,7 +1529,7 @@ SfxAppToolBoxControl_Impl::SfxAppToolBoxControl_Impl( USHORT nSlotId, USHORT nId // Determine the current background color of the menus const StyleSettings& rSettings = Application::GetSettings().GetStyleSettings(); m_nSymbolsStyle = rSettings.GetSymbolsStyle(); - m_bWasHiContrastMode = rSettings.GetMenuColor().IsDark(); + m_bWasHiContrastMode = rSettings.GetHighContrastMode(); m_bShowMenuImages = rSettings.GetUseImagesInMenus(); SetImage( String() ); @@ -1654,7 +1654,7 @@ void SfxAppToolBoxControl_Impl::SetImage( const String &rURL ) aURL = sFallback; BOOL bBig = SvtMiscOptions().AreCurrentSymbolsLarge(); - BOOL bHC = GetToolBox().GetBackground().GetColor().IsDark(); + BOOL bHC = GetToolBox().GetSettings().GetStyleSettings().GetHighContrastMode(); Image aImage = SvFileInformationManager::GetImageNoDefault( INetURLObject( aURL ), bBig, bHC ); if ( !aImage ) aImage = !!aMenuImage ? aMenuImage : @@ -1805,7 +1805,7 @@ IMPL_LINK( SfxAppToolBoxControl_Impl, Activate, Menu *, pActMenu ) { const StyleSettings& rSettings = Application::GetSettings().GetStyleSettings(); ULONG nSymbolsStyle = rSettings.GetSymbolsStyle(); - BOOL bIsHiContrastMode = rSettings.GetMenuColor().IsDark(); + BOOL bIsHiContrastMode = rSettings.GetHighContrastMode(); BOOL bShowMenuImages = rSettings.GetUseImagesInMenus(); if (( nSymbolsStyle != m_nSymbolsStyle ) || |