diff options
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/dinfdlg.cxx | 14 | ||||
-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/SfxDocumentMetaData.cxx | 66 | ||||
-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 |
12 files changed, 100 insertions, 51 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 5051f71ab78e..df47180c9f77 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/dinfdlg.cxx b/sfx2/source/dialog/dinfdlg.cxx index 484e953f1cf4..e0a57c2e5e9e 100644 --- a/sfx2/source/dialog/dinfdlg.cxx +++ b/sfx2/source/dialog/dinfdlg.cxx @@ -269,8 +269,12 @@ SfxDocumentInfoItem::SfxDocumentInfoItem( const String& rFile, for ( sal_Int32 i = 0; i < nCount; ++i ) { // "fix" property? => not a custom property => ignore it! - if ( !(pProps[i].Attributes & ::com::sun::star::beans::PropertyAttribute::REMOVABLE) ) + if (!(pProps[i].Attributes & + ::com::sun::star::beans::PropertyAttribute::REMOVABLE)) + { + DBG_ASSERT(false, "non-removable user-defined property?"); continue; + } uno::Any aValue = xSet->getPropertyValue(pProps[i].Name); CustomProperty* pProp = new CustomProperty( pProps[i].Name, aValue ); @@ -424,7 +428,13 @@ void SfxDocumentInfoItem::UpdateDocumentInfo( const beans::Property* pProps = lProps.getConstArray(); sal_Int32 nCount = lProps.getLength(); for ( sal_Int32 j = 0; j < nCount; ++j ) - xContainer->removeProperty( pProps[j].Name ); + { + if ((pProps[j].Attributes & + ::com::sun::star::beans::PropertyAttribute::REMOVABLE)) + { + xContainer->removeProperty( pProps[j].Name ); + } + } for ( sal_uInt32 k = 0; k < m_aCustomProperties.size(); ++k ) { diff --git a/sfx2/source/dialog/dockwin.cxx b/sfx2/source/dialog/dockwin.cxx index f31ed1724907..cf7d04ef0875 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 706739cd0571..fb21ff8463a1 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/SfxDocumentMetaData.cxx b/sfx2/source/doc/SfxDocumentMetaData.cxx index 1423e712242e..ef36831ab681 100644 --- a/sfx2/source/doc/SfxDocumentMetaData.cxx +++ b/sfx2/source/doc/SfxDocumentMetaData.cxx @@ -79,6 +79,7 @@ #include "comphelper/storagehelper.hxx" #include "comphelper/mediadescriptor.hxx" #include "comphelper/sequenceasvector.hxx" +#include "comphelper/stlunosequence.hxx" #include "sot/storage.hxx" #include "sfx2/docfile.hxx" #include "sax/tools/converter.hxx" @@ -322,7 +323,7 @@ private: /// standard meta data (multiple occurrences) std::map< ::rtl::OUString, std::vector<css::uno::Reference<css::xml::dom::XNode> > > m_metaList; - /// user-defined meta data (meta:user-defined) + /// user-defined meta data (meta:user-defined) @ATTENTION may be null! css::uno::Reference<css::beans::XPropertyContainer> m_xUserDefined; // now for some meta-data attributes; these are not updated directly in the // DOM because updates (detecting "empty" elements) would be quite messy @@ -998,9 +999,12 @@ SfxDocumentMetaData::updateElement(const char *i_name, void SAL_CALL SfxDocumentMetaData::updateUserDefinedAndAttributes() { createUserDefined(); - css::uno::Reference<css::beans::XPropertySet> xPSet(m_xUserDefined,css::uno::UNO_QUERY_THROW); - std::pair<css::uno::Sequence< ::rtl::OUString>, AttrVector> udStringsAttrs = propsToStrings(xPSet); - (void) setMetaList("meta:user-defined", udStringsAttrs.first,&udStringsAttrs.second); + const css::uno::Reference<css::beans::XPropertySet> xPSet(m_xUserDefined, + css::uno::UNO_QUERY_THROW); + const std::pair<css::uno::Sequence< ::rtl::OUString>, AttrVector> + udStringsAttrs( propsToStrings(xPSet) ); + (void) setMetaList("meta:user-defined", udStringsAttrs.first, + &udStringsAttrs.second); // update elements with attributes std::vector<std::pair<const char *, ::rtl::OUString> > attributes; @@ -1217,15 +1221,13 @@ void SAL_CALL SfxDocumentMetaData::init( std::vector<css::uno::Reference<css::xml::dom::XNode> > & vec = m_metaList[::rtl::OUString::createFromAscii("meta:user-defined")]; - // user-defined meta data: create PropertyBag which only accepts property - // values of allowed types + m_xUserDefined.clear(); // #i105826#: reset (may be re-initialization) if ( !vec.empty() ) { createUserDefined(); } // user-defined meta data: initialize PropertySet from DOM nodes - for (std::vector<css::uno::Reference<css::xml::dom::XNode> >::iterator it = vec.begin(); it != vec.end(); ++it) { css::uno::Reference<css::xml::dom::XElement> xElem(*it, @@ -1301,10 +1303,14 @@ void SAL_CALL SfxDocumentMetaData::init( //////////////////////////////////////////////////////////////////////////// SfxDocumentMetaData::SfxDocumentMetaData( - css::uno::Reference< css::uno::XComponentContext > const & context) : - BaseMutex(), SfxDocumentMetaData_Base(m_aMutex), - m_xContext(context), m_NotifyListeners(m_aMutex), - m_isInitialized(false), m_isModified(false) + css::uno::Reference< css::uno::XComponentContext > const & context) + : BaseMutex() + , SfxDocumentMetaData_Base(m_aMutex) + , m_xContext(context) + , m_NotifyListeners(m_aMutex) + , m_isInitialized(false) + , m_isModified(false) + , m_AutoloadSecs(0) { DBG_ASSERT(context.is(), "SfxDocumentMetaData: context is null"); DBG_ASSERT(context->getServiceManager().is(), @@ -2168,7 +2174,7 @@ void SAL_CALL SfxDocumentMetaData::setModified( ::sal_Bool bModified ) ::osl::MutexGuard g(m_aMutex); checkInit(); m_isModified = bModified; - if ( !bModified ) + if ( !bModified && m_xUserDefined.is() ) { xMB.set(m_xUserDefined, css::uno::UNO_QUERY); DBG_ASSERT(xMB.is(), @@ -2241,6 +2247,8 @@ void SAL_CALL SfxDocumentMetaData::serialize( void SfxDocumentMetaData::createUserDefined() { + // user-defined meta data: create PropertyBag which only accepts property + // values of allowed types if ( !m_xUserDefined.is() ) { css::uno::Sequence<css::uno::Type> types(10); @@ -2258,29 +2266,37 @@ void SfxDocumentMetaData::createUserDefined() args[0] <<= css::beans::NamedValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("AllowedTypes")), css::uno::makeAny(types)); - // #i94175#: ODF 1.1 allows empty user-defined property names! - args[1] <<= css::beans::NamedValue( - ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("AllowEmptyPropertyName")), + // #i94175#: ODF allows empty user-defined property names! + args[1] <<= css::beans::NamedValue( ::rtl::OUString( + RTL_CONSTASCII_USTRINGPARAM("AllowEmptyPropertyName")), css::uno::makeAny(sal_True)); - css::uno::Reference<css::lang::XMultiComponentFactory> xMsf (m_xContext->getServiceManager()); + const css::uno::Reference<css::lang::XMultiComponentFactory> xMsf( + m_xContext->getServiceManager()); m_xUserDefined.set( - xMsf->createInstanceWithContext(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.beans.PropertyBag")), m_xContext), + xMsf->createInstanceWithContext( + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( + "com.sun.star.beans.PropertyBag")), m_xContext), css::uno::UNO_QUERY_THROW); - css::uno::Reference<css::lang::XInitialization> xInit(m_xUserDefined, - css::uno::UNO_QUERY); + const css::uno::Reference<css::lang::XInitialization> xInit( + m_xUserDefined, css::uno::UNO_QUERY); if (xInit.is()) { xInit->initialize(args); } - css::uno::Reference<css::util::XModifyBroadcaster> xMB(m_xUserDefined,css::uno::UNO_QUERY); + const css::uno::Reference<css::util::XModifyBroadcaster> xMB( + m_xUserDefined, css::uno::UNO_QUERY); if (xMB.is()) { - css::uno::Sequence< css::uno::Reference< css::uno::XInterface > > aListener = m_NotifyListeners.getElements(); - const css::uno::Reference< css::uno::XInterface >* pIter = aListener.getConstArray(); - const css::uno::Reference< css::uno::XInterface >* pEnd = pIter + aListener.getLength(); - for(;pIter != pEnd;++pIter ) - xMB->addModifyListener(css::uno::Reference< css::util::XModifyListener >(*pIter,css::uno::UNO_QUERY)); + const css::uno::Sequence<css::uno::Reference<css::uno::XInterface> > + listeners(m_NotifyListeners.getElements()); + for (css::uno::Reference< css::uno::XInterface > const * iter = + ::comphelper::stl_begin(listeners); + iter != ::comphelper::stl_end(listeners); ++iter) { + xMB->addModifyListener( + css::uno::Reference< css::util::XModifyListener >(*iter, + css::uno::UNO_QUERY)); + } } } } diff --git a/sfx2/source/doc/docvor.cxx b/sfx2/source/doc/docvor.cxx index e70824869070..d0c10556abd3 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 988bbf3b4118..6619c17d3077 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 88c9ba8aa757..e0b6f6f32bf2 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 6f00ae5b7681..0d659826d453 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 6a776f6a211e..b6e69156214d 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 ) || |