diff options
author | Niklas Nebel <nn@openoffice.org> | 2011-03-04 15:03:24 +0100 |
---|---|---|
committer | Niklas Nebel <nn@openoffice.org> | 2011-03-04 15:03:24 +0100 |
commit | 54a19cdfff9b344fb94ccef6e98bf0ca7a62b1f3 (patch) | |
tree | db94b83a649a7ecc1bf200dae3b9f710c6e3b429 | |
parent | 4f24ef15969c9c062f6ed60d0f2848608cee079e (diff) | |
parent | 4fba42e5f98fcc0fa9addf41a793c1d7f11602c8 (diff) |
calc66: merge
108 files changed, 1832 insertions, 1166 deletions
diff --git a/avmedia/prj/build.lst b/avmedia/prj/build.lst index 2348b606dcab..7d9343b916fd 100644 --- a/avmedia/prj/build.lst +++ b/avmedia/prj/build.lst @@ -1,4 +1,4 @@ -av avmedia : l10n tools sfx2 LIBXSLT:libxslt NULL +av avmedia : L10N:l10n tools sfx2 LIBXSLT:libxslt NULL av avmedia usr1 - all av_mkout NULL av avmedia\prj get - all av_prj NULL av avmedia\inc get - all av_inv NULL diff --git a/basic/inc/basic/sbstar.hxx b/basic/inc/basic/sbstar.hxx index 9eeee5f71d7c..5b00fe68a421 100644 --- a/basic/inc/basic/sbstar.hxx +++ b/basic/inc/basic/sbstar.hxx @@ -48,6 +48,7 @@ class BasicLibInfo; // info block for basic manager class SbTextPortions; class SbMethod; class BasicManager; +class DocBasicItem; class StarBASICImpl; @@ -57,6 +58,7 @@ class StarBASIC : public SbxObject friend class SbiExpression; // Access to RTL friend class SbiInstance; friend class SbiRuntime; + friend class DocBasicItem; StarBASICImpl* mpStarBASICImpl; diff --git a/basic/inc/basic/vbahelper.hxx b/basic/inc/basic/vbahelper.hxx new file mode 100644 index 000000000000..0d99387965fe --- /dev/null +++ b/basic/inc/basic/vbahelper.hxx @@ -0,0 +1,86 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef BASIC_VBAHELPR_HXX +#define BASIC_VBAHELPR_HXX + +#include <com/sun/star/frame/XModel.hpp> + +namespace basic { +namespace vba { + +/* This header contains public helper functions for VBA used from this module + and from other VBA implementation modules such as vbahelper. + */ + +// ============================================================================ + +/** Locks or unlocks the controllers of all documents that have the same type + as the specified document. + + First, the global module manager (com.sun.star.frame.ModuleManager) is + asked for the type of the passed model, and all open documents with the + same type will be locked or unlocked. + + @param rxModel + A document model determining the type of the documents to be locked or + unlocked. + + @param bLockControllers + Passing true will lock all controllers, passing false will unlock them. + */ +void lockControllersOfAllDocuments( + const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >& rxModel, + sal_Bool bLockControllers ); + +// ============================================================================ + +/** Enables or disables the container windows of all controllers of all + documents that have the same type as the specified document. + + First, the global module manager (com.sun.star.frame.ModuleManager) is + asked for the type of the passed model, and the container windows of all + open documents with the same type will be enabled or disabled. + + @param rxModel + A document model determining the type of the documents to be enabled or + disabled. + + @param bEnableWindows + Passing true will enable all container windows of all controllers, + passing false will disable them. + */ +void enableContainerWindowsOfAllDocuments( + const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >& rxModel, + sal_Bool bEnableWindows ); + +// ============================================================================ + +} // namespace vba +} // namespace basic + +#endif diff --git a/basic/prj/build.lst b/basic/prj/build.lst index 8eab007313ec..17a34fa5bd9f 100644 --- a/basic/prj/build.lst +++ b/basic/prj/build.lst @@ -1,4 +1,4 @@ -sb basic : l10n offuh oovbaapi svtools xmlscript framework salhelper LIBXSLT:libxslt NULL +sb basic : L10N:l10n offuh oovbaapi svtools xmlscript framework salhelper LIBXSLT:libxslt NULL sb basic usr1 - all sb_mkout NULL sb basic\inc nmake - all sb_inc NULL sb basic\source\app nmake - all sb_app sb_class sb_inc NULL diff --git a/basic/source/basmgr/makefile.mk b/basic/source/basmgr/makefile.mk index e08e9cc753bd..615a8e8465ef 100644 --- a/basic/source/basmgr/makefile.mk +++ b/basic/source/basmgr/makefile.mk @@ -39,7 +39,8 @@ ENABLE_EXCEPTIONS=TRUE SLOFILES= \ $(SLO)$/basmgr.obj \ - $(SLO)$/basicmanagerrepository.obj + $(SLO)$/basicmanagerrepository.obj\ + $(SLO)$/vbahelper.obj # --- Targets ------------------------------------------------------------- diff --git a/basic/source/basmgr/vbahelper.cxx b/basic/source/basmgr/vbahelper.cxx new file mode 100644 index 000000000000..a09446f2e40b --- /dev/null +++ b/basic/source/basmgr/vbahelper.cxx @@ -0,0 +1,212 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +// MARKER(update_precomp.py): autogen include statement, do not remove +#include "precompiled_basic.hxx" + +#include "basic/vbahelper.hxx" +#include <com/sun/star/container/XEnumeration.hpp> +#include <com/sun/star/frame/XDesktop.hpp> +#include <com/sun/star/frame/XModel2.hpp> +#include <com/sun/star/frame/XModuleManager.hpp> +#include <com/sun/star/lang/XMultiServiceFactory.hpp> +#include <comphelper/processfactory.hxx> + +namespace basic { +namespace vba { + +using namespace ::com::sun::star; + +// ============================================================================ + +namespace { + +/** Creates the global module manager needed to identify the type of documents. + */ +uno::Reference< frame::XModuleManager > lclCreateModuleManager() +{ + uno::Reference< frame::XModuleManager > xModuleManager; + try + { + uno::Reference< lang::XMultiServiceFactory > xFactory( ::comphelper::getProcessServiceFactory(), uno::UNO_SET_THROW ); + xModuleManager.set( xFactory->createInstance( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.frame.ModuleManager" ) ) ), uno::UNO_QUERY ); + } + catch( uno::Exception& ) + { + } + OSL_ENSURE( xModuleManager.is(), "::basic::vba::lclCreateModuleManager - cannot create module manager" ); + return xModuleManager; +} + +// ---------------------------------------------------------------------------- + +/** Returns the document service name of the specified document. + */ +::rtl::OUString lclIdentifyDocument( const uno::Reference< frame::XModuleManager >& rxModuleManager, const uno::Reference< frame::XModel >& rxModel ) +{ + ::rtl::OUString aServiceName; + if( rxModuleManager.is() ) + { + try + { + aServiceName = rxModuleManager->identify( rxModel ); + } + catch( uno::Exception& ) + { + } + OSL_ENSURE( aServiceName.getLength() > 0, "::basic::vba::lclIdentifyDocument - cannot identify document" ); + } + return aServiceName; +} + +// ---------------------------------------------------------------------------- + +/** Returns an enumeration of all open documents. + */ +uno::Reference< container::XEnumeration > lclCreateDocumentEnumeration() +{ + uno::Reference< container::XEnumeration > xEnumeration; + try + { + uno::Reference< lang::XMultiServiceFactory > xFactory( ::comphelper::getProcessServiceFactory(), uno::UNO_SET_THROW ); + uno::Reference< frame::XDesktop > xDesktop( xFactory->createInstance( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.frame.Desktop" ) ) ), uno::UNO_QUERY_THROW ); + uno::Reference< container::XEnumerationAccess > xComponentsEA( xDesktop->getComponents(), uno::UNO_SET_THROW ); + xEnumeration = xComponentsEA->createEnumeration(); + + } + catch( uno::Exception& ) + { + } + OSL_ENSURE( xEnumeration.is(), "::basic::vba::lclCreateDocumentEnumeration - cannot create enumeration of all documents" ); + return xEnumeration; +} + +// ---------------------------------------------------------------------------- + +/** Locks or unlocks the controllers of the specified document model. + */ +void lclLockControllers( const uno::Reference< frame::XModel >& rxModel, sal_Bool bLockControllers ) +{ + if( rxModel.is() ) try + { + if( bLockControllers ) + rxModel->lockControllers(); + else + rxModel->unlockControllers(); + } + catch( uno::Exception& ) + { + } +} + +// ---------------------------------------------------------------------------- + +/** Enables or disables the container windows of all controllers of the + specified document model. + */ +void lclEnableContainerWindows( const uno::Reference< frame::XModel >& rxModel, sal_Bool bEnableWindows ) +{ + try + { + uno::Reference< frame::XModel2 > xModel2( rxModel, uno::UNO_QUERY_THROW ); + uno::Reference< container::XEnumeration > xControllersEnum( xModel2->getControllers(), uno::UNO_SET_THROW ); + // iterate over all controllers + while( xControllersEnum->hasMoreElements() ) + { + try + { + uno::Reference< frame::XController > xController( xControllersEnum->nextElement(), uno::UNO_QUERY_THROW ); + uno::Reference< frame::XFrame > xFrame( xController->getFrame(), uno::UNO_SET_THROW ); + uno::Reference< awt::XWindow > xWindow( xFrame->getContainerWindow(), uno::UNO_SET_THROW ); + xWindow->setEnable( bEnableWindows ); + } + catch( uno::Exception& ) + { + } + } + } + catch( uno::Exception& ) + { + } +} + +// ---------------------------------------------------------------------------- + +typedef void (*ModifyDocumentFunc)( const uno::Reference< frame::XModel >&, sal_Bool ); + +/** Implementation iterating over all documents that have the same type as the + specified model, and calling the passed functor. + */ +void lclIterateDocuments( ModifyDocumentFunc pModifyDocumentFunc, const uno::Reference< frame::XModel >& rxModel, sal_Bool bModificator ) +{ + uno::Reference< frame::XModuleManager > xModuleManager = lclCreateModuleManager(); + uno::Reference< container::XEnumeration > xDocumentsEnum = lclCreateDocumentEnumeration(); + ::rtl::OUString aIdentifier = lclIdentifyDocument( xModuleManager, rxModel ); + if( xModuleManager.is() && xDocumentsEnum.is() && (aIdentifier.getLength() > 0) ) + { + // iterate over all open documents + while( xDocumentsEnum->hasMoreElements() ) + { + try + { + uno::Reference< frame::XModel > xCurrModel( xDocumentsEnum->nextElement(), uno::UNO_QUERY_THROW ); + ::rtl::OUString aCurrIdentifier = lclIdentifyDocument( xModuleManager, xCurrModel ); + if( aCurrIdentifier == aIdentifier ) + pModifyDocumentFunc( xCurrModel, bModificator ); + } + catch( uno::Exception& ) + { + } + } + } + else + { + // no module manager, no documents enumeration, no identifier -> at least process the passed document + pModifyDocumentFunc( rxModel, bModificator ); + } +} + +} // namespace + +// ============================================================================ + +void lockControllersOfAllDocuments( const uno::Reference< frame::XModel >& rxModel, sal_Bool bLockControllers ) +{ + lclIterateDocuments( &lclLockControllers, rxModel, bLockControllers ); +} + +// ============================================================================ + +void enableContainerWindowsOfAllDocuments( const uno::Reference< frame::XModel >& rxModel, sal_Bool bEnableWindows ) +{ + lclIterateDocuments( &lclEnableContainerWindows, rxModel, bEnableWindows ); +} + +// ============================================================================ + +} // namespace vba +} // namespace basic diff --git a/basic/source/classes/sb.cxx b/basic/source/classes/sb.cxx index e2f53dd8ed8e..f8ffa46d48a5 100644 --- a/basic/source/classes/sb.cxx +++ b/basic/source/classes/sb.cxx @@ -55,8 +55,12 @@ #include "sb.hrc" #include <basrid.hxx> #include <vos/mutex.hxx> +#include <cppuhelper/implbase1.hxx> #include <com/sun/star/lang/XMultiServiceFactory.hpp> +#include <com/sun/star/util/XCloseBroadcaster.hpp> +#include <com/sun/star/util/XCloseListener.hpp> #include "errobject.hxx" +#include <map> #include <hash_map> #include <com/sun/star/script/ModuleType.hpp> @@ -80,6 +84,143 @@ using com::sun::star::lang::XMultiServiceFactory; const static String aThisComponent( RTL_CONSTASCII_USTRINGPARAM("ThisComponent") ); const static String aVBAHook( RTL_CONSTASCII_USTRINGPARAM( "VBAGlobals" ) ); +// ============================================================================ + +class DocBasicItem : public ::cppu::WeakImplHelper1< util::XCloseListener > +{ +public: + explicit DocBasicItem( StarBASIC& rDocBasic ); + virtual ~DocBasicItem(); + + inline const SbxObjectRef& getClassModules() const { return mxClassModules; } + inline bool isDocClosed() const { return mbDocClosed; } + + void clearDependingVarsOnDelete( StarBASIC& rDeletedBasic ); + + void startListening(); + void stopListening(); + + virtual void SAL_CALL queryClosing( const lang::EventObject& rSource, sal_Bool bGetsOwnership ) throw (util::CloseVetoException, uno::RuntimeException); + virtual void SAL_CALL notifyClosing( const lang::EventObject& rSource ) throw (uno::RuntimeException); + virtual void SAL_CALL disposing( const lang::EventObject& rSource ) throw (uno::RuntimeException); + +private: + StarBASIC& mrDocBasic; + SbxObjectRef mxClassModules; + bool mbDocClosed; + bool mbDisposed; +}; + +// ---------------------------------------------------------------------------- + +DocBasicItem::DocBasicItem( StarBASIC& rDocBasic ) : + mrDocBasic( rDocBasic ), + mxClassModules( new SbxObject( String() ) ), + mbDocClosed( false ), + mbDisposed( false ) +{ +} + +DocBasicItem::~DocBasicItem() +{ + stopListening(); +} + +void DocBasicItem::clearDependingVarsOnDelete( StarBASIC& rDeletedBasic ) +{ + mrDocBasic.implClearDependingVarsOnDelete( &rDeletedBasic ); +} + +void DocBasicItem::startListening() +{ + Any aThisComp; + mrDocBasic.GetUNOConstant( "ThisComponent", aThisComp ); + Reference< util::XCloseBroadcaster > xCloseBC( aThisComp, UNO_QUERY ); + if( xCloseBC.is() ) + try { xCloseBC->addCloseListener( this ); } catch( uno::Exception& ) {} +} + +void DocBasicItem::stopListening() +{ + if( mbDisposed ) return; + mbDisposed = true; + Any aThisComp; + mrDocBasic.GetUNOConstant( "ThisComponent", aThisComp ); + Reference< util::XCloseBroadcaster > xCloseBC( aThisComp, UNO_QUERY ); + if( xCloseBC.is() ) + try { xCloseBC->removeCloseListener( this ); } catch( uno::Exception& ) {} +} + +void SAL_CALL DocBasicItem::queryClosing( const lang::EventObject& /*rSource*/, sal_Bool /*bGetsOwnership*/ ) throw (util::CloseVetoException, uno::RuntimeException) +{ +} + +void SAL_CALL DocBasicItem::notifyClosing( const lang::EventObject& /*rEvent*/ ) throw (uno::RuntimeException) +{ + stopListening(); + mbDocClosed = true; +} + +void SAL_CALL DocBasicItem::disposing( const lang::EventObject& /*rEvent*/ ) throw (uno::RuntimeException) +{ + stopListening(); +} + +// ---------------------------------------------------------------------------- + +namespace { + +typedef ::rtl::Reference< DocBasicItem > DocBasicItemRef; +typedef std::map< const StarBASIC*, DocBasicItemRef > DocBasicItemMap; +static DocBasicItemMap GaDocBasicItems; + +const DocBasicItem* lclFindDocBasicItem( const StarBASIC* pDocBasic ) +{ + DocBasicItemMap::iterator it = GaDocBasicItems.find( pDocBasic ); + return (it != GaDocBasicItems.end()) ? it->second.get() : 0; +} + +void lclInsertDocBasicItem( StarBASIC& rDocBasic ) +{ + DocBasicItemRef& rxDocBasicItem = GaDocBasicItems[ &rDocBasic ]; + rxDocBasicItem.set( new DocBasicItem( rDocBasic ) ); + rxDocBasicItem->startListening(); +} + +void lclRemoveDocBasicItem( StarBASIC& rDocBasic ) +{ + DocBasicItemMap::iterator it = GaDocBasicItems.find( &rDocBasic ); + if( it != GaDocBasicItems.end() ) + { + it->second->stopListening(); + GaDocBasicItems.erase( it ); + } + DocBasicItemMap::iterator it_end = GaDocBasicItems.end(); + for( it = GaDocBasicItems.begin(); it != it_end; ++it ) + it->second->clearDependingVarsOnDelete( rDocBasic ); +} + +StarBASIC* lclGetDocBasicForModule( SbModule* pModule ) +{ + StarBASIC* pRetBasic = NULL; + SbxObject* pCurParent = pModule; + while( pCurParent->GetParent() != NULL ) + { + pCurParent = pCurParent->GetParent(); + StarBASIC* pDocBasic = PTR_CAST( StarBASIC, pCurParent ); + if( pDocBasic != NULL && pDocBasic->IsDocBasic() ) + { + pRetBasic = pDocBasic; + break; + } + } + return pRetBasic; +} + +} // namespace + +// ============================================================================ + SbxObject* StarBASIC::getVBAGlobals( ) { if ( !pVBAGlobals ) @@ -461,6 +602,7 @@ SbxObject* createUserTypeImpl( const String& rClassName ) return pRetObj; } + TYPEINIT1(SbClassModuleObject,SbModule) SbClassModuleObject::SbClassModuleObject( SbModule* pClassModule ) @@ -610,8 +752,12 @@ SbClassModuleObject::SbClassModuleObject( SbModule* pClassModule ) SbClassModuleObject::~SbClassModuleObject() { + // do not trigger termination event when document is already closed if( StarBASIC::IsRunning() ) - triggerTerminateEvent(); + if( StarBASIC* pDocBasic = lclGetDocBasicForModule( this ) ) + if( const DocBasicItem* pDocBasicItem = lclFindDocBasicItem( pDocBasic ) ) + if( !pDocBasicItem->isDocClosed() ) + triggerTerminateEvent(); // Must be deleted by base class dtor because this data // is not owned by the SbClassModuleObject object @@ -699,8 +845,14 @@ SbClassFactory::~SbClassFactory() void SbClassFactory::AddClassModule( SbModule* pClassModule ) { + SbxObjectRef xToUseClassModules = xClassModules; + + if( StarBASIC* pDocBasic = lclGetDocBasicForModule( pClassModule ) ) + if( const DocBasicItem* pDocBasicItem = lclFindDocBasicItem( pDocBasic ) ) + xToUseClassModules = pDocBasicItem->getClassModules(); + SbxObject* pParent = pClassModule->GetParent(); - xClassModules->Insert( pClassModule ); + xToUseClassModules->Insert( pClassModule ); pClassModule->SetParent( pParent ); } @@ -717,12 +869,19 @@ SbxBase* SbClassFactory::Create( sal_uInt16, sal_uInt32 ) SbxObject* SbClassFactory::CreateObject( const String& rClassName ) { - SbxVariable* pVar = xClassModules->Find( rClassName, SbxCLASS_DONTCARE ); + SbxObjectRef xToUseClassModules = xClassModules; + + if( SbModule* pMod = pMOD ) + if( StarBASIC* pDocBasic = lclGetDocBasicForModule( pMod ) ) + if( const DocBasicItem* pDocBasicItem = lclFindDocBasicItem( pDocBasic ) ) + xToUseClassModules = pDocBasicItem->getClassModules(); + + SbxVariable* pVar = xToUseClassModules->Find( rClassName, SbxCLASS_OBJECT ); SbxObject* pRet = NULL; if( pVar ) { - SbModule* pMod = (SbModule*)pVar; - pRet = new SbClassModuleObject( pMod ); + SbModule* pVarMod = (SbModule*)pVar; + pRet = new SbClassModuleObject( pVarMod ); } return pRet; } @@ -734,9 +893,6 @@ SbModule* SbClassFactory::FindClass( const String& rClassName ) return pMod; } -typedef std::vector< StarBASIC* > DocBasicVector; -static DocBasicVector GaDocBasics; - StarBASIC::StarBASIC( StarBASIC* p, sal_Bool bIsDocBasic ) : SbxObject( String( RTL_CONSTASCII_USTRINGPARAM("StarBASIC") ) ), bDocBasic( bIsDocBasic ) { @@ -768,7 +924,7 @@ StarBASIC::StarBASIC( StarBASIC* p, sal_Bool bIsDocBasic ) bQuit = sal_False; if( bDocBasic ) - GaDocBasics.push_back( this ); + lclInsertDocBasicItem( *this ); } // #51727 Override SetModified so that the modified state @@ -780,6 +936,9 @@ void StarBASIC::SetModified( sal_Bool b ) StarBASIC::~StarBASIC() { + // Needs to be first action as it can trigger events + disposeComVariablesForBasic( this ); + if( !--GetSbData()->nInst ) { RemoveFactory( pSBFAC ); @@ -812,20 +971,7 @@ StarBASIC::~StarBASIC() { SbxError eOld = SbxBase::GetError(); - DocBasicVector::iterator it; - for( it = GaDocBasics.begin() ; it != GaDocBasics.end() ; ++it ) - { - if( *it == this ) - { - GaDocBasics.erase( it ); - break; - } - } - for( it = GaDocBasics.begin() ; it != GaDocBasics.end() ; ++it ) - { - StarBASIC* pBasic = *it; - pBasic->implClearDependingVarsOnDelete( this ); - } + lclRemoveDocBasicItem( *this ); SbxBase::ResetError(); if( eOld != SbxERR_OK ) @@ -845,7 +991,6 @@ StarBASIC::~StarBASIC() } clearUnoMethodsForBasic( this ); - disposeComVariablesForBasic( this ); } // Override new() operator, so that everyone can create a new instance diff --git a/basic/source/classes/sbxmod.cxx b/basic/source/classes/sbxmod.cxx index a268568a410d..592d69c514a0 100755 --- a/basic/source/classes/sbxmod.cxx +++ b/basic/source/classes/sbxmod.cxx @@ -54,11 +54,15 @@ #include <basic/basrdll.hxx> #include <vos/mutex.hxx> #include <basic/sbobjmod.hxx> -#include <cppuhelper/implbase2.hxx> +#include <basic/vbahelper.hxx> +#include <cppuhelper/implbase3.hxx> +#include <unotools/eventcfg.hxx> #include <com/sun/star/lang/XServiceInfo.hpp> #include <com/sun/star/script/ModuleType.hpp> #include <com/sun/star/script/vba/XVBACompatibility.hpp> #include <com/sun/star/beans/XPropertySet.hpp> +#include <com/sun/star/document/XEventBroadcaster.hpp> +#include <com/sun/star/document/XEventListener.hpp> using namespace com::sun::star; @@ -496,24 +500,18 @@ IMPL_LINK( AsyncQuitHandler, OnAsyncQuit, void*, /*pNull*/ ) return 0L; } -bool VBAUnlockControllers( StarBASIC* pBasic ) +void VBAUnlockDocuments( StarBASIC* pBasic ) { - bool bRes = false; if ( pBasic && pBasic->IsDocBasic() ) { SbUnoObject* pGlobs = dynamic_cast< SbUnoObject* >( pBasic->Find( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ThisComponent" ) ), SbxCLASS_DONTCARE ) ); - if ( pGlobs ) try - { - uno::Reference< frame::XModel > xModel( pGlobs->getUnoAny(), uno::UNO_QUERY_THROW ); - if ( xModel->hasControllersLocked() ) - xModel->unlockControllers(); - bRes = true; - } - catch( uno::Exception& ) + if ( pGlobs ) { + uno::Reference< frame::XModel > xModel( pGlobs->getUnoAny(), uno::UNO_QUERY ); + ::basic::vba::lockControllersOfAllDocuments( xModel, sal_False ); + ::basic::vba::enableContainerWindowsOfAllDocuments( xModel, sal_True ); } } - return bRes; } ///////////////////////////////////////////////////////////////////////////// @@ -1182,7 +1180,7 @@ sal_uInt16 SbModule::Run( SbMethod* pMeth ) // VBA always ensures screenupdating is enabled after completing if ( mbVBACompat ) - VBAUnlockControllers( PTR_CAST( StarBASIC, GetParent() ) ); + VBAUnlockDocuments( PTR_CAST( StarBASIC, GetParent() ) ); #ifdef DBG_TRACE_BASIC dbg_DeInitTrace(); @@ -2162,22 +2160,27 @@ void SbObjModule::SFX_NOTIFY( SfxBroadcaster& rBC, const TypeId& rBCType, } -typedef ::cppu::WeakImplHelper2< awt::XTopWindowListener, awt::XWindowListener > FormObjEventListener_BASE; +typedef ::cppu::WeakImplHelper3< + awt::XTopWindowListener, + awt::XWindowListener, + document::XEventListener > FormObjEventListener_BASE; class FormObjEventListenerImpl : public FormObjEventListener_BASE { SbUserFormModule* mpUserForm; uno::Reference< lang::XComponent > mxComponent; + uno::Reference< frame::XModel > mxModel; bool mbDisposed; sal_Bool mbOpened; sal_Bool mbActivated; sal_Bool mbShowing; - FormObjEventListenerImpl(); // not defined + FormObjEventListenerImpl(const FormObjEventListenerImpl&); // not defined + FormObjEventListenerImpl& operator=(const FormObjEventListenerImpl&); // not defined public: - FormObjEventListenerImpl( SbUserFormModule* pUserForm, const uno::Reference< lang::XComponent >& xComponent ) : - mpUserForm( pUserForm ), mxComponent( xComponent) , + FormObjEventListenerImpl( SbUserFormModule* pUserForm, const uno::Reference< lang::XComponent >& xComponent, const uno::Reference< frame::XModel >& xModel ) : + mpUserForm( pUserForm ), mxComponent( xComponent), mxModel( xModel ), mbDisposed( false ), mbOpened( sal_False ), mbActivated( sal_False ), mbShowing( sal_False ) { if ( mxComponent.is() ) @@ -2194,6 +2197,15 @@ public: } catch( uno::Exception& ) {} } + + if ( mxModel.is() ) + { + try + { + uno::Reference< document::XEventBroadcaster >( mxModel, uno::UNO_QUERY_THROW )->addEventListener( this ); + } + catch( uno::Exception& ) {} + } } virtual ~FormObjEventListenerImpl() @@ -2220,6 +2232,16 @@ public: catch( uno::Exception& ) {} } mxComponent.clear(); + + if ( mxModel.is() && !mbDisposed ) + { + try + { + uno::Reference< document::XEventBroadcaster >( mxModel, uno::UNO_QUERY_THROW )->removeEventListener( this ); + } + catch( uno::Exception& ) {} + } + mxModel.clear(); } virtual void SAL_CALL windowOpened( const lang::EventObject& /*e*/ ) throw (uno::RuntimeException) @@ -2327,13 +2349,25 @@ public: { } + virtual void SAL_CALL notifyEvent( const document::EventObject& rEvent ) throw (uno::RuntimeException) + { + // early dosposing on document event "OnUnload", to be sure Basic still exists when calling VBA "UserForm_Terminate" + if( rEvent.EventName == GlobalEventConfig::GetEventName( STR_EVENT_CLOSEDOC ) ) + { + removeListener(); + mbDisposed = true; + if ( mpUserForm ) + mpUserForm->ResetApiObj(); // will trigger "UserForm_Terminate" + } + } + virtual void SAL_CALL disposing( const lang::EventObject& /*Source*/ ) throw (uno::RuntimeException) { OSL_TRACE("** Userform/Dialog disposing"); + removeListener(); mbDisposed = true; - mxComponent.clear(); if ( mpUserForm ) - mpUserForm->ResetApiObj(); + mpUserForm->ResetApiObj( false ); // pass false (too late to trigger VBA events here) } }; @@ -2567,30 +2601,27 @@ void SbUserFormModule::InitObject() aArgs[ 2 ] <<= m_xModel; aArgs[ 3 ] <<= rtl::OUString( GetParent()->GetName() ); pDocObject = new SbUnoObject( GetName(), uno::makeAny( xVBAFactory->createInstanceWithArguments( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ooo.vba.msforms.UserForm")), aArgs ) ) ); - uno::Reference< lang::XComponent > xComponent( aArgs[ 1 ], uno::UNO_QUERY_THROW ); + + uno::Reference< lang::XComponent > xComponent( m_xDialog, uno::UNO_QUERY_THROW ); // the dialog must be disposed at the end! - if( xComponent.is() ) + StarBASIC* pParentBasic = NULL; + SbxObject* pCurObject = this; + do { - StarBASIC* pParentBasic = NULL; - SbxObject* pCurObject = this; - do - { - SbxObject* pObjParent = pCurObject->GetParent(); - pParentBasic = PTR_CAST( StarBASIC, pObjParent ); - pCurObject = pObjParent; - } - while( pParentBasic == NULL && pCurObject != NULL ); - - OSL_ASSERT( pParentBasic != NULL ); - registerComponentToBeDisposedForBasic( xComponent, pParentBasic ); + SbxObject* pObjParent = pCurObject->GetParent(); + pParentBasic = PTR_CAST( StarBASIC, pObjParent ); + pCurObject = pObjParent; } + while( pParentBasic == NULL && pCurObject != NULL ); + OSL_ASSERT( pParentBasic != NULL ); + registerComponentToBeDisposedForBasic( xComponent, pParentBasic ); - // remove old listener if it exists - if ( m_DialogListener.get() ) + // if old listener object exists, remove it from dialog and document model + if( m_DialogListener.is() ) m_DialogListener->removeListener(); - m_DialogListener = new FormObjEventListenerImpl( this, xComponent ); + m_DialogListener.set( new FormObjEventListenerImpl( this, xComponent, m_xModel ) ); triggerInitializeEvent(); } diff --git a/basic/source/comp/scanner.cxx b/basic/source/comp/scanner.cxx index e518779b78d5..ad94bbe842c8 100644 --- a/basic/source/comp/scanner.cxx +++ b/basic/source/comp/scanner.cxx @@ -152,6 +152,16 @@ static SbxDataType GetSuffixType( sal_Unicode c ) // Returnwert ist sal_False bei EOF oder Fehlern #define BUF_SIZE 80 +namespace { + +/** Returns true, if the passed character is a white space character. */ +inline bool lclIsWhitespace( sal_Unicode cChar ) +{ + return (cChar == ' ') || (cChar == '\t') || (cChar == '\f'); +} + +} // namespace + sal_Bool SbiScanner::NextSym() { // Fuer den EOLN-Fall merken @@ -177,7 +187,11 @@ sal_Bool SbiScanner::NextSym() p2 += n; while( ( n < nLen ) && ( *p2 != '\n' ) && ( *p2 != '\r' ) ) p2++, n++; - aLine = aBuf.copy( nBufPos, n - nBufPos ); + // #163944# ignore trailing whitespace + sal_Int32 nCopyEndPos = n; + while( (nBufPos < nCopyEndPos) && lclIsWhitespace( aBuf[ nCopyEndPos - 1 ] ) ) + --nCopyEndPos; + aLine = aBuf.copy( nBufPos, nCopyEndPos - nBufPos ); if( n < nLen ) { if( *p2 == '\r' && *( p2+1 ) == '\n' ) @@ -193,7 +207,7 @@ sal_Bool SbiScanner::NextSym() } // Leerstellen weg: - while( *pLine && (( *pLine == ' ' ) || ( *pLine == '\t' ) || ( *pLine == '\f' )) ) + while( lclIsWhitespace( *pLine ) ) pLine++, nCol++, bSpaces = sal_True; nCol1 = nCol; @@ -230,7 +244,7 @@ sal_Bool SbiScanner::NextSym() { const sal_Unicode* pTestLine = pLine; short nTestCol = nCol; - while( *pTestLine && (( *pTestLine == ' ' ) || ( *pTestLine == '\t' )) ) + while( lclIsWhitespace( *pTestLine ) ) { pTestLine++; nTestCol++; diff --git a/configmgr/source/access.cxx b/configmgr/source/access.cxx index 933a414d331c..2548643c7ce1 100644 --- a/configmgr/source/access.cxx +++ b/configmgr/source/access.cxx @@ -1993,45 +1993,83 @@ rtl::Reference< ChildAccess > Access::getUnmodifiedChild( } rtl::Reference< ChildAccess > Access::getSubChild(rtl::OUString const & path) { - rtl::OUString name; - bool setElement; - rtl::OUString templateName; - sal_Int32 i = Data::parseSegment( - path, 0, &name, &setElement, &templateName); - if (i == -1 || (i != path.getLength() && path[i] != '/')) { - return rtl::Reference< ChildAccess >(); - } - rtl::Reference< ChildAccess > child(getChild(name)); - if (!child.is()) { - return rtl::Reference< ChildAccess >(); - } - if (setElement) { - rtl::Reference< Node > p(getNode()); - switch (p->kind()) { - case Node::KIND_LOCALIZED_PROPERTY: - if (!Components::allLocales(getRootAccess()->getLocale()) || - templateName.getLength() != 0) - { + sal_Int32 i = 0; + // For backwards compatibility, allow absolute paths where meaningful: + if (path.getLength() != 0 && path[0] == '/') { + ++i; + if (!getRootAccess().is()) { + return rtl::Reference< ChildAccess >(); + } + Path abs(getAbsolutePath()); + for (Path::iterator j(abs.begin()); j != abs.end(); ++j) { + rtl::OUString name1; + bool setElement1; + rtl::OUString templateName1; + i = Data::parseSegment( + path, i, &name1, &setElement1, &templateName1); + if (i == -1 || (i != path.getLength() && path[i] != '/')) { return rtl::Reference< ChildAccess >(); } - break; - case Node::KIND_SET: - if (templateName.getLength() != 0 && - !dynamic_cast< SetNode * >(p.get())->isValidTemplate( - templateName)) + rtl::OUString name2; + bool setElement2; + rtl::OUString templateName2; + Data::parseSegment(*j, 0, &name2, &setElement2, &templateName2); + if (name1 != name2 || setElement1 != setElement2 || + (setElement1 && + !Data::equalTemplateNames(templateName1, templateName2))) { return rtl::Reference< ChildAccess >(); } - break; - default: + if (i != path.getLength()) { + ++i; + } + } + } + for (rtl::Reference< Access > parent(this);;) { + rtl::OUString name; + bool setElement; + rtl::OUString templateName; + i = Data::parseSegment(path, i, &name, &setElement, &templateName); + if (i == -1 || (i != path.getLength() && path[i] != '/')) { return rtl::Reference< ChildAccess >(); } + rtl::Reference< ChildAccess > child(parent->getChild(name)); + if (!child.is()) { + return rtl::Reference< ChildAccess >(); + } + if (setElement) { + rtl::Reference< Node > p(parent->getNode()); + switch (p->kind()) { + case Node::KIND_LOCALIZED_PROPERTY: + if (!Components::allLocales(getRootAccess()->getLocale()) || + templateName.getLength() != 0) + { + return rtl::Reference< ChildAccess >(); + } + break; + case Node::KIND_SET: + if (templateName.getLength() != 0 && + !dynamic_cast< SetNode * >(p.get())->isValidTemplate( + templateName)) + { + return rtl::Reference< ChildAccess >(); + } + break; + default: + return rtl::Reference< ChildAccess >(); + } + } + // For backwards compatibility, ignore a final slash after non-value + // nodes: + if (child->isValue()) { + return i == path.getLength() + ? child : rtl::Reference< ChildAccess >(); + } else if (i >= path.getLength() - 1) { + return child; + } + ++i; + parent = child.get(); } - // For backwards compatibility, ignore a final slash after non-value nodes: - return child->isValue() - ? (i == path.getLength() ? child : rtl::Reference< ChildAccess >()) - : (i >= path.getLength() - 1 - ? child : child->getSubChild(path.copy(i + 1))); } bool Access::setChildProperty( diff --git a/configmgr/source/xcuparser.cxx b/configmgr/source/xcuparser.cxx index 1a9575bb6726..dc5d08cb4e08 100644 --- a/configmgr/source/xcuparser.cxx +++ b/configmgr/source/xcuparser.cxx @@ -1099,17 +1099,25 @@ void XcuParser::handleSetNode(xmlreader::XmlReader & reader, SetNode * set) { } break; case OPERATION_REMOVE: - // Ignore removal of unknown members, members finalized in a lower - // layer, and members made mandatory in this or a lower layer: - if (i != set->getMembers().end() && !state_.top().locked && - finalizedLayer >= valueParser_.getLayer() && - mandatoryLayer > valueParser_.getLayer()) { - set->getMembers().erase(i); + // Ignore removal of unknown members, members finalized in a lower + // layer, and members made mandatory in this or a lower layer; + // forget about user-layer removals that no longer remove anything + // (so that paired additions/removals in the user layer do not grow + // registrymodifications.xcu unbounded): + bool known = i != set->getMembers().end(); + if (known && !state_.top().locked && + finalizedLayer >= valueParser_.getLayer() && + mandatoryLayer > valueParser_.getLayer()) + { + set->getMembers().erase(i); + } + state_.push(State(true)); + if (known) { + recordModification(false); + } + break; } - state_.push(State(true)); - recordModification(false); - break; } } diff --git a/connectivity/prj/build.lst b/connectivity/prj/build.lst index 8d16197961fa..509b61cc6f9a 100644 --- a/connectivity/prj/build.lst +++ b/connectivity/prj/build.lst @@ -1,4 +1,4 @@ -cn connectivity : shell l10n comphelper MOZ:moz SO:moz_prebuilt svl UNIXODBC:unixODBC unoil javaunohelper HSQLDB:hsqldb qadevOOo officecfg NSS:nss LIBXSLT:libxslt NULL +cn connectivity : shell L10N:l10n comphelper MOZ:moz SO:moz_prebuilt svl UNIXODBC:unixODBC unoil javaunohelper HSQLDB:hsqldb qadevOOo officecfg NSS:nss LIBXSLT:libxslt NULL cn connectivity usr1 - all cn_mkout NULL cn connectivity\inc nmake - all cn_inc NULL cn connectivity\com\sun\star\sdbcx\comp\hsqldb nmake - all cn_jhsqldbdb cn_hsqldb cn_inc NULL diff --git a/desktop/prj/build.lst b/desktop/prj/build.lst index 146579cab8bc..fc782c35a71b 100644 --- a/desktop/prj/build.lst +++ b/desktop/prj/build.lst @@ -1,4 +1,4 @@ -dt desktop : l10n sfx2 stoc BERKELEYDB:berkeleydb sysui SO:sysui_so BOOST:boost svx xmlhelp sal unoil officecfg offuh filter LIBXSLT:libxslt NULL +dt desktop : L10N:l10n sfx2 stoc BERKELEYDB:berkeleydb sysui SO:sysui_so BOOST:boost svx xmlhelp sal unoil officecfg offuh filter LIBXSLT:libxslt NULL dt desktop usr1 - all dt_mkout NULL dt desktop\inc nmake - all dt_inc NULL dt desktop\prj get - all dt_prj NULL diff --git a/editeng/inc/editeng/editrids.hrc b/editeng/inc/editeng/editrids.hrc index dcef661d01b8..209d284a7fde 100644 --- a/editeng/inc/editeng/editrids.hrc +++ b/editeng/inc/editeng/editrids.hrc @@ -240,45 +240,6 @@ #define RID_SVXITEMS_WEIGHT_ULTRABOLD (RID_EDIT_START + 167) #define RID_SVXITEMS_WEIGHT_BLACK (RID_EDIT_START + 168) -// paper formats -#define RID_SVXSTR_PAPER_A0 (RID_SVX_START + 169) -#define RID_SVXSTR_PAPER_A1 (RID_SVX_START + 170) -#define RID_SVXSTR_PAPER_A2 (RID_SVX_START + 171) -#define RID_SVXSTR_PAPER_A3 (RID_SVX_START + 172) -#define RID_SVXSTR_PAPER_A4 (RID_SVX_START + 173) -#define RID_SVXSTR_PAPER_A5 (RID_SVX_START + 174) -#define RID_SVXSTR_PAPER_B4_ISO (RID_SVX_START + 175) -#define RID_SVXSTR_PAPER_B5_ISO (RID_SVX_START + 176) -#define RID_SVXSTR_PAPER_LETTER (RID_SVX_START + 177) -#define RID_SVXSTR_PAPER_LEGAL (RID_SVX_START + 178) -#define RID_SVXSTR_PAPER_TABLOID (RID_SVX_START + 179) -#define RID_SVXSTR_PAPER_USER (RID_SVX_START + 180) -#define RID_SVXSTR_PAPER_B6_ISO (RID_SVX_START + 181) -#define RID_SVXSTR_PAPER_C4 (RID_SVX_START + 182) -#define RID_SVXSTR_PAPER_C5 (RID_SVX_START + 183) -#define RID_SVXSTR_PAPER_C6 (RID_SVX_START + 184) -#define RID_SVXSTR_PAPER_C65 (RID_SVX_START + 185) -#define RID_SVXSTR_PAPER_DL (RID_SVX_START + 186) -#define RID_SVXSTR_PAPER_DIA (RID_SVX_START + 187) -#define RID_SVXSTR_PAPER_SCREEN (RID_SVX_START + 188) -#define RID_SVXSTR_PAPER_C (RID_SVX_START + 189) -#define RID_SVXSTR_PAPER_D (RID_SVX_START + 190) -#define RID_SVXSTR_PAPER_E (RID_SVX_START + 191) -#define RID_SVXSTR_PAPER_EXECUTIVE (RID_SVX_START + 192) -#define RID_SVXSTR_PAPER_LEGAL2 (RID_SVX_START + 193) -#define RID_SVXSTR_PAPER_MONARCH (RID_SVX_START + 194) -#define RID_SVXSTR_PAPER_COM675 (RID_SVX_START + 195) -#define RID_SVXSTR_PAPER_COM9 (RID_SVX_START + 196) -#define RID_SVXSTR_PAPER_COM10 (RID_SVX_START + 197) -#define RID_SVXSTR_PAPER_COM11 (RID_SVX_START + 198) -#define RID_SVXSTR_PAPER_COM12 (RID_SVX_START + 199) -#define RID_SVXSTR_PAPER_KAI16 (RID_SVX_START + 200) -#define RID_SVXSTR_PAPER_KAI32 (RID_SVX_START + 201) -#define RID_SVXSTR_PAPER_KAI32BIG (RID_SVX_START + 202) -#define RID_SVXSTR_PAPER_B4_JIS (RID_SVX_START + 203) -#define RID_SVXSTR_PAPER_B5_JIS (RID_SVX_START + 204) -#define RID_SVXSTR_PAPER_B6_JIS (RID_SVX_START + 205) - // enum FontItalic ------------------------------------------------------- #define RID_SVXITEMS_ITALIC_BEGIN (RID_EDIT_START + 206) #define RID_SVXITEMS_ITALIC_NONE (RID_EDIT_START + 206) diff --git a/editeng/prj/build.lst b/editeng/prj/build.lst index 3c714c6dac25..bba7f2666744 100644 --- a/editeng/prj/build.lst +++ b/editeng/prj/build.lst @@ -1,3 +1,3 @@ -ed editeng : l10n svtools xmloff linguistic NULL +ed editeng : L10N:l10n svtools xmloff linguistic NULL ed editeng\prj nmake - all ed_prj NULL diff --git a/editeng/source/items/page.src b/editeng/source/items/page.src index 9fe7f3013ce6..c528dc8b0bd0 100644 --- a/editeng/source/items/page.src +++ b/editeng/source/items/page.src @@ -29,154 +29,6 @@ #include <editeng/editrids.hrc> -String RID_SVXSTR_PAPER_A0 -{ - Text = "A0" ; -}; -String RID_SVXSTR_PAPER_A1 -{ - Text = "A1" ; -}; -String RID_SVXSTR_PAPER_A2 -{ - Text = "A2" ; -}; -String RID_SVXSTR_PAPER_A3 -{ - Text = "A3" ; -}; -String RID_SVXSTR_PAPER_A4 -{ - Text = "A4" ; -}; -String RID_SVXSTR_PAPER_A5 -{ - Text = "A5" ; -}; -String RID_SVXSTR_PAPER_B4_ISO -{ - Text = "B4 (ISO)" ; -}; -String RID_SVXSTR_PAPER_B5_ISO -{ - Text = "B5 (ISO)" ; -}; -String RID_SVXSTR_PAPER_LETTER -{ - Text = "Letter" ; -}; -String RID_SVXSTR_PAPER_LEGAL -{ - Text = "Legal" ; -}; -String RID_SVXSTR_PAPER_TABLOID -{ - Text = "Tabloid" ; -}; -String RID_SVXSTR_PAPER_USER -{ - Text [ en-US ] = "User Defined" ; -}; -String RID_SVXSTR_PAPER_B6_ISO -{ - Text = "B6 (ISO)" ; -}; -String RID_SVXSTR_PAPER_C4 -{ - Text = "C4 Envelope" ; -}; -String RID_SVXSTR_PAPER_C5 -{ - Text = "C5 Envelope" ; -}; -String RID_SVXSTR_PAPER_C6 -{ - Text = "C6 Envelope" ; -}; -String RID_SVXSTR_PAPER_C65 -{ - Text = "C6/5 Envelope" ; -}; -String RID_SVXSTR_PAPER_DL -{ - Text = "DL Envelope" ; -}; -String RID_SVXSTR_PAPER_DIA -{ - Text = "Dia Slide" ; -}; -String RID_SVXSTR_PAPER_SCREEN -{ - Text [ en-US ] = "Screen" ; -}; -String RID_SVXSTR_PAPER_C -{ - Text = "C" ; -}; -String RID_SVXSTR_PAPER_D -{ - Text = "D" ; -}; -String RID_SVXSTR_PAPER_E -{ - Text = "E" ; -}; -String RID_SVXSTR_PAPER_EXECUTIVE -{ - Text = "Executive" ; -}; -String RID_SVXSTR_PAPER_LEGAL2 -{ - Text = "Long Bond" ; -}; -String RID_SVXSTR_PAPER_MONARCH -{ - Text = "#8 (Monarch) Envelope" ; -}; -String RID_SVXSTR_PAPER_COM675 -{ - Text = "#6 3/4 (Personal) Envelope" ; -}; -String RID_SVXSTR_PAPER_COM9 -{ - Text = "#9 Envelope" ; -}; -String RID_SVXSTR_PAPER_COM10 -{ - Text = "#10 Envelope" ; -}; -String RID_SVXSTR_PAPER_COM11 -{ - Text = "#11 Envelope" ; -}; -String RID_SVXSTR_PAPER_COM12 -{ - Text = "#12 Envelope" ; -}; -String RID_SVXSTR_PAPER_KAI16 -{ - Text = "16 Kai" ; -}; -String RID_SVXSTR_PAPER_KAI32 -{ - Text = "32 Kai" ; -}; -String RID_SVXSTR_PAPER_KAI32BIG -{ - Text = "Big 32 Kai" ; -}; -String RID_SVXSTR_PAPER_B4_JIS -{ - Text = "B4 (JIS)" ; -}; -String RID_SVXSTR_PAPER_B5_JIS -{ - Text = "B5 (JIS)" ; -}; -String RID_SVXSTR_PAPER_B6_JIS -{ - Text = "B6 (JIS)" ; -}; String RID_SVXSTR_PAPERBIN { Text [ en-US ] = "Paper tray" ; diff --git a/editeng/source/items/paperinf.cxx b/editeng/source/items/paperinf.cxx index 3d79b980ec1d..8ba97193c3bc 100644 --- a/editeng/source/items/paperinf.cxx +++ b/editeng/source/items/paperinf.cxx @@ -135,51 +135,7 @@ Size SvxPaperInfo::GetDefaultPaperSize( MapUnit eUnit ) String SvxPaperInfo::GetName( Paper ePaper ) { - sal_uInt16 nResId = 0; - - switch ( ePaper ) - { - case PAPER_A0: nResId = RID_SVXSTR_PAPER_A0; break; - case PAPER_A1: nResId = RID_SVXSTR_PAPER_A1; break; - case PAPER_A2: nResId = RID_SVXSTR_PAPER_A2; break; - case PAPER_A3: nResId = RID_SVXSTR_PAPER_A3; break; - case PAPER_A4: nResId = RID_SVXSTR_PAPER_A4; break; - case PAPER_A5: nResId = RID_SVXSTR_PAPER_A5; break; - case PAPER_B4_ISO: nResId = RID_SVXSTR_PAPER_B4_ISO; break; - case PAPER_B5_ISO: nResId = RID_SVXSTR_PAPER_B5_ISO; break; - case PAPER_LETTER: nResId = RID_SVXSTR_PAPER_LETTER; break; - case PAPER_LEGAL: nResId = RID_SVXSTR_PAPER_LEGAL; break; - case PAPER_TABLOID: nResId = RID_SVXSTR_PAPER_TABLOID; break; - case PAPER_USER: nResId = RID_SVXSTR_PAPER_USER; break; - case PAPER_B6_ISO: nResId = RID_SVXSTR_PAPER_B6_ISO; break; - case PAPER_ENV_C4: nResId = RID_SVXSTR_PAPER_C4; break; - case PAPER_ENV_C5: nResId = RID_SVXSTR_PAPER_C5; break; - case PAPER_ENV_C6: nResId = RID_SVXSTR_PAPER_C6; break; - case PAPER_ENV_C65: nResId = RID_SVXSTR_PAPER_C65; break; - case PAPER_ENV_DL: nResId = RID_SVXSTR_PAPER_DL; break; - case PAPER_SLIDE_DIA: nResId = RID_SVXSTR_PAPER_DIA; break; - case PAPER_SCREEN: nResId = RID_SVXSTR_PAPER_SCREEN; break; - case PAPER_C: nResId = RID_SVXSTR_PAPER_C; break; - case PAPER_D: nResId = RID_SVXSTR_PAPER_D; break; - case PAPER_E: nResId = RID_SVXSTR_PAPER_E; break; - case PAPER_EXECUTIVE: nResId = RID_SVXSTR_PAPER_EXECUTIVE;break; - case PAPER_FANFOLD_LEGAL_DE: nResId = RID_SVXSTR_PAPER_LEGAL2; break; - case PAPER_ENV_MONARCH: nResId = RID_SVXSTR_PAPER_MONARCH; break; - case PAPER_ENV_PERSONAL: nResId = RID_SVXSTR_PAPER_COM675; break; - case PAPER_ENV_9: nResId = RID_SVXSTR_PAPER_COM9; break; - case PAPER_ENV_10: nResId = RID_SVXSTR_PAPER_COM10; break; - case PAPER_ENV_11: nResId = RID_SVXSTR_PAPER_COM11; break; - case PAPER_ENV_12: nResId = RID_SVXSTR_PAPER_COM12; break; - case PAPER_KAI16: nResId = RID_SVXSTR_PAPER_KAI16; break; - case PAPER_KAI32: nResId = RID_SVXSTR_PAPER_KAI32; break; - case PAPER_KAI32BIG: nResId = RID_SVXSTR_PAPER_KAI32BIG; break; - case PAPER_B4_JIS: nResId = RID_SVXSTR_PAPER_B4_JIS; break; - case PAPER_B5_JIS: nResId = RID_SVXSTR_PAPER_B5_JIS; break; - case PAPER_B6_JIS: nResId = RID_SVXSTR_PAPER_B6_JIS; break; - default: DBG_ERRORFILE( "unknown papersize" ); - } - - return ( nResId > 0 ) ? String( EditResId( nResId ) ) : String(); + return String( Printer::GetPaperName( ePaper ) ); } diff --git a/formula/source/ui/dlg/formula.cxx b/formula/source/ui/dlg/formula.cxx index 54d1c102d5be..d782f0ee8dcd 100644 --- a/formula/source/ui/dlg/formula.cxx +++ b/formula/source/ui/dlg/formula.cxx @@ -313,6 +313,11 @@ FormulaDlg_Impl::FormulaDlg_Impl(Dialog* pParent aRefBtn.Hide(); pMEdit = aMEFormula.GetEdit(); + //IAccessibility2 Implementation 2009----- + aMEFormula.SetAccessibleName(aFtFormula.GetText()); + if (pMEdit) + pMEdit->SetAccessibleName(aFtFormula.GetText()); + //-----IAccessibility2 Implementation 2009 m_aEditHelpId = pMEdit->GetHelpId(); pMEdit->SetUniqueId( m_aEditHelpId ); diff --git a/formula/source/ui/dlg/parawin.cxx b/formula/source/ui/dlg/parawin.cxx index e51f9dc8a9c8..3a21a99b0da7 100644 --- a/formula/source/ui/dlg/parawin.cxx +++ b/formula/source/ui/dlg/parawin.cxx @@ -56,24 +56,24 @@ ParaWin::ParaWin(Window* pParent,IControlReferenceHandler* _pDlg,Point aPos): aFtArgName ( this, ModuleRes( FT_PARNAME ) ), aFtArgDesc ( this, ModuleRes( FT_PARDESC ) ), + aBtnFx1 ( this, ModuleRes( BTN_FX1 ) ), aFtArg1 ( this, ModuleRes( FT_ARG1 ) ), - aFtArg2 ( this, ModuleRes( FT_ARG2 ) ), - aFtArg3 ( this, ModuleRes( FT_ARG3 ) ), - aFtArg4 ( this, ModuleRes( FT_ARG4 ) ), + aEdArg1 ( this, ModuleRes( ED_ARG1 ) ), + aRefBtn1 ( this, ModuleRes( RB_ARG1 ) ), - aBtnFx1 ( this, ModuleRes( BTN_FX1 ) ), aBtnFx2 ( this, ModuleRes( BTN_FX2 ) ), - aBtnFx3 ( this, ModuleRes( BTN_FX3 ) ), - aBtnFx4 ( this, ModuleRes( BTN_FX4 ) ), - - aEdArg1 ( this, ModuleRes( ED_ARG1 ) ), + aFtArg2 ( this, ModuleRes( FT_ARG2 ) ), aEdArg2 ( this, ModuleRes( ED_ARG2 ) ), - aEdArg3 ( this, ModuleRes( ED_ARG3 ) ), - aEdArg4 ( this, ModuleRes( ED_ARG4 ) ), - - aRefBtn1 ( this, ModuleRes( RB_ARG1 ) ), aRefBtn2 ( this, ModuleRes( RB_ARG2 ) ), + + aBtnFx3 ( this, ModuleRes( BTN_FX3 ) ), + aFtArg3 ( this, ModuleRes( FT_ARG3 ) ), + aEdArg3 ( this, ModuleRes( ED_ARG3 ) ), aRefBtn3 ( this, ModuleRes( RB_ARG3 ) ), + + aBtnFx4 ( this, ModuleRes( BTN_FX4 ) ), + aFtArg4 ( this, ModuleRes( FT_ARG4 ) ), + aEdArg4 ( this, ModuleRes( ED_ARG4 ) ), aRefBtn4 ( this, ModuleRes( RB_ARG4 ) ), aSlider ( this, ModuleRes( WND_SLIDER ) ), diff --git a/formula/source/ui/dlg/parawin.hxx b/formula/source/ui/dlg/parawin.hxx index 990eafd28ba2..55c2bd7204b8 100644 --- a/formula/source/ui/dlg/parawin.hxx +++ b/formula/source/ui/dlg/parawin.hxx @@ -68,25 +68,25 @@ private: FixedText aFtArgName; FixedInfo aFtArgDesc; + ImageButton aBtnFx1; FixedText aFtArg1; - FixedText aFtArg2; - FixedText aFtArg3; - FixedText aFtArg4; + ArgEdit aEdArg1; + RefButton aRefBtn1; - ImageButton aBtnFx1; ImageButton aBtnFx2; - ImageButton aBtnFx3; - ImageButton aBtnFx4; - - ArgEdit aEdArg1; + FixedText aFtArg2; ArgEdit aEdArg2; + RefButton aRefBtn2; + + ImageButton aBtnFx3; + FixedText aFtArg3; ArgEdit aEdArg3; - ArgEdit aEdArg4; + RefButton aRefBtn3; - RefButton aRefBtn1; - RefButton aRefBtn2; - RefButton aRefBtn3; - RefButton aRefBtn4; + ImageButton aBtnFx4; + FixedText aFtArg4; + ArgEdit aEdArg4; + RefButton aRefBtn4; ScrollBar aSlider; String m_sOptional; diff --git a/fpicker/prj/build.lst b/fpicker/prj/build.lst index 52d99ec0759a..1be09c5d8fd1 100644 --- a/fpicker/prj/build.lst +++ b/fpicker/prj/build.lst @@ -1,4 +1,4 @@ -fp fpicker : LIBXSLT:libxslt l10n rdbmaker svtools NULL +fp fpicker : LIBXSLT:libxslt L10N:l10n rdbmaker svtools NULL fp fpicker\inc nmake - all fp_inc NULL fp fpicker\source\generic nmake - all fp_generic fp_inc NULL fp fpicker\source\office nmake - all fp_office fp_inc NULL diff --git a/fpicker/source/office/iodlg.cxx b/fpicker/source/office/iodlg.cxx index 355203dbe767..13f427351411 100644 --- a/fpicker/source/office/iodlg.cxx +++ b/fpicker/source/office/iodlg.cxx @@ -3015,6 +3015,7 @@ void SvtFileDialog::AddControls_Impl( ) _pPrevBmp = new FixedBitmap( this, WinBits( WB_BORDER ) ); _pPrevBmp->SetBackground( Wallpaper( Color( COL_WHITE ) ) ); _pPrevBmp->Show(); + _pPrevBmp->SetAccessibleName(SvtResId(STR_PREVIEW)); } if ( _nExtraBits & SFX_EXTRA_AUTOEXTENSION ) diff --git a/fpicker/source/office/iodlg.hrc b/fpicker/source/office/iodlg.hrc index b87082b56cbd..42b235ee31af 100644 --- a/fpicker/source/office/iodlg.hrc +++ b/fpicker/source/office/iodlg.hrc @@ -70,6 +70,7 @@ #define STR_PATHSELECT 5 #define STR_BUTTONSELECT 6 #define STR_ACTUALVERSION 7 +#define STR_PREVIEW 8 // DLG_SVT_QUERYFOLDERNAME ----------------------- diff --git a/fpicker/source/office/iodlg.src b/fpicker/source/office/iodlg.src index da2d1cd926b6..2a460797fe56 100644 --- a/fpicker/source/office/iodlg.src +++ b/fpicker/source/office/iodlg.src @@ -251,6 +251,10 @@ ModalDialog DLG_SVT_EXPLORERFILE { Text [ en-US ] = "Current version"; }; + String STR_PREVIEW + { + Text [ en-US ] = "File Preview"; + }; }; // QueryFolderNameDialog ---------------------------------------------------------- diff --git a/framework/prj/build.lst b/framework/prj/build.lst index 2c847918fee4..8fe5b3b2f0ef 100644 --- a/framework/prj/build.lst +++ b/framework/prj/build.lst @@ -1,2 +1,2 @@ -fr framework : LIBXSLT:libxslt l10n svtools NULL +fr framework : LIBXSLT:libxslt L10N:l10n svtools NULL fr framework\prj nmake - all fr_all NULL diff --git a/framework/source/classes/fwktabwindow.cxx b/framework/source/classes/fwktabwindow.cxx index d7868a3a0857..b41797e63595 100644 --- a/framework/source/classes/fwktabwindow.cxx +++ b/framework/source/classes/fwktabwindow.cxx @@ -45,6 +45,7 @@ #include <comphelper/processfactory.hxx> #include <toolkit/helper/vclunohelper.hxx> #include <tools/stream.hxx> +#include <tools/diagnose_ex.h> #include <vcl/bitmap.hxx> #include <vcl/image.hxx> #include <vcl/msgbox.hxx> @@ -156,7 +157,7 @@ sal_Bool FwkTabPage::CallMethod( const rtl::OUString& rMethod ) } catch ( uno::Exception& ) { - DBG_ERRORFILE( "FwkTabPage::CallMethod(): exception of XDialogEventHandler::callHandlerMethod()" ); + DBG_UNHANDLED_EXCEPTION(); } } return bRet; diff --git a/framework/util/fwk.component b/framework/util/fwk.component index e6ceb91e8090..c460ecbccd70 100644 --- a/framework/util/fwk.component +++ b/framework/util/fwk.component @@ -139,4 +139,7 @@ <implementation name="com.sun.star.comp.framework.jobs.JobDispatch"> <service name="com.sun.star.frame.ProtocolHandler"/> </implementation> + <implementation name="com.sun.star.comp.framework.TabWindowService"> + <service name="com.sun.star.ui.dialogs.TabContainerWindow"/> + </implementation> </component> diff --git a/framework/util/fwl.component b/framework/util/fwl.component index aa124d1cdc4b..99c5ca7213e6 100644 --- a/framework/util/fwl.component +++ b/framework/util/fwl.component @@ -85,9 +85,6 @@ <implementation name="com.sun.star.comp.framework.SimpleTextStatusbarController"> <service name="com.sun.star.frame.StatusbarController"/> </implementation> - <implementation name="com.sun.star.comp.framework.TabWindowService"> - <service name="com.sun.star.ui.dialogs.TabContainerWindow"/> - </implementation> <implementation name="com.sun.star.comp.framework.ToolBarsMenuController"> <service name="com.sun.star.frame.PopupMenuController"/> </implementation> diff --git a/officecfg/prj/build.lst b/officecfg/prj/build.lst index 04d2cfd87aef..b07a34aee982 100644 --- a/officecfg/prj/build.lst +++ b/officecfg/prj/build.lst @@ -1,4 +1,4 @@ -oc officecfg : l10n soltools solenv LIBXSLT:libxslt NULL +oc officecfg : L10N:l10n soltools solenv LIBXSLT:libxslt NULL oc officecfg usr1 - all oc_mkout NULL oc officecfg\registry\schema nmake - all oc_reg_schema NULL oc officecfg\registry nmake - all oc_reg NULL diff --git a/officecfg/registry/data/org/openoffice/Office/UI/CalcCommands.xcu b/officecfg/registry/data/org/openoffice/Office/UI/CalcCommands.xcu index 5c72d948436f..a30d746d5043 100644 --- a/officecfg/registry/data/org/openoffice/Office/UI/CalcCommands.xcu +++ b/officecfg/registry/data/org/openoffice/Office/UI/CalcCommands.xcu @@ -170,7 +170,7 @@ </node> <node oor:name=".uno:DataPilotFilter" oor:op="replace"> <prop oor:name="Label" oor:type="xs:string"> - <value xml:lang="en-US">DataPilot Filter</value> + <value xml:lang="en-US">Pivot Table Filter</value> </prop> </node> <node oor:name=".uno:NextPage" oor:op="replace"> @@ -323,10 +323,10 @@ </node> <node oor:name=".uno:DataDataPilotRun" oor:op="replace"> <prop oor:name="Label" oor:type="xs:string"> - <value xml:lang="en-US">~Start DataPilot...</value> + <value xml:lang="en-US">~Create Pivot Table...</value> </prop> <prop oor:name="ContextLabel" oor:type="xs:string"> - <value xml:lang="en-US">~Start...</value> + <value xml:lang="en-US">~Create...</value> </prop> <prop oor:name="Properties" oor:type="xs:int"> <value>1</value> @@ -1131,7 +1131,7 @@ </node> <node oor:name=".uno:RecalcPivotTable" oor:op="replace"> <prop oor:name="Label" oor:type="xs:string"> - <value xml:lang="en-US">~Refresh DataPilot</value> + <value xml:lang="en-US">~Refresh Pivot Table</value> </prop> <prop oor:name="ContextLabel" oor:type="xs:string"> <value xml:lang="en-US">~Refresh</value> @@ -1139,7 +1139,7 @@ </node> <node oor:name=".uno:DeletePivotTable" oor:op="replace"> <prop oor:name="Label" oor:type="xs:string"> - <value xml:lang="en-US">~Delete DataPilot</value> + <value xml:lang="en-US">~Delete Pivot Table</value> </prop> <prop oor:name="ContextLabel" oor:type="xs:string"> <value xml:lang="en-US">~Delete</value> @@ -1532,7 +1532,7 @@ </node> <node oor:name=".uno:DataPilotMenu" oor:op="replace"> <prop oor:name="Label" oor:type="xs:string"> - <value xml:lang="en-US">Data~Pilot</value> + <value xml:lang="en-US">~Pivot Table</value> </prop> </node> <node oor:name=".uno:EditSheetMenu" oor:op="replace"> diff --git a/officecfg/registry/schema/org/openoffice/Office/Calc.xcs b/officecfg/registry/schema/org/openoffice/Office/Calc.xcs index 913902731f29..aeddefb763c2 100644 --- a/officecfg/registry/schema/org/openoffice/Office/Calc.xcs +++ b/officecfg/registry/schema/org/openoffice/Office/Calc.xcs @@ -1039,7 +1039,7 @@ with no exception.</desc> <label>QuotedFieldAsText</label> </info> - <value>true</value> + <value>false</value> </prop> <prop oor:name="DetectSpecialNumbers" oor:type="xs:boolean"> <info> diff --git a/officecfg/util/makefile.mk b/officecfg/util/makefile.mk index 332ac90fe2ea..c1fa54277141 100644 --- a/officecfg/util/makefile.mk +++ b/officecfg/util/makefile.mk @@ -37,7 +37,6 @@ TARGET=util $(MISC)$/$(TARGET)_delzip : -$(RM) $(BIN)$/registry_{$(alllangiso)}.zip - -$(RM) $(COMMON_OUTPUT)$/bin$/registry_{$(alllangiso)}.zip $(BIN)$/registry_{$(alllangiso)}.zip : $(MISC)$/$(TARGET)_delzip cd $(MISC)$/registry$/res$/$(@:b:s/registry_//) && zip -ru ..$/..$/..$/..$/bin$/registry_$(@:b:s/registry_//).zip org/* diff --git a/readlicense_oo/prj/build.lst b/readlicense_oo/prj/build.lst index 987672db4ebe..bf438e28fe1d 100644 --- a/readlicense_oo/prj/build.lst +++ b/readlicense_oo/prj/build.lst @@ -1,4 +1,4 @@ -ro readlicense_oo : l10n solenv LIBXSLT:libxslt NULL +ro readlicense_oo : L10N:l10n solenv LIBXSLT:libxslt NULL ro readlicense_oo usr1 - all ro_root NULL ro readlicense_oo\docs\readme nmake - all ro_readme NULL ro readlicense_oo\html nmake - all ro_html NULL diff --git a/sfx2/inc/sfx2/dinfdlg.hxx b/sfx2/inc/sfx2/dinfdlg.hxx index 8cf17e3f6e4f..61e972c99278 100644 --- a/sfx2/inc/sfx2/dinfdlg.hxx +++ b/sfx2/inc/sfx2/dinfdlg.hxx @@ -552,9 +552,9 @@ public: class SfxCustomPropertiesPage : public SfxTabPage { private: - FixedText m_aPropertiesFT; CustomPropertiesControl m_aPropertiesCtrl; PushButton m_aAddBtn; + FixedText m_aPropertiesFT; // Sym2_5121----, Moved by Steve Yin DECL_LINK( AddHdl, PushButton* ); diff --git a/sfx2/inc/sfx2/mgetempl.hxx b/sfx2/inc/sfx2/mgetempl.hxx index 60375f5272c0..a599163116e5 100644 --- a/sfx2/inc/sfx2/mgetempl.hxx +++ b/sfx2/inc/sfx2/mgetempl.hxx @@ -70,9 +70,9 @@ class SfxManageStyleSheetPage : public SfxTabPage FixedText aFilterFt; ListBox aFilterLb; + FixedLine aDescGb; FixedInfo aDescFt; MultiLineEdit aDescED; - FixedLine aDescGb; SfxStyleSheetBase *pStyle; SfxStyleFamilies *pFamilies; diff --git a/sfx2/inc/sfx2/sfx.hrc b/sfx2/inc/sfx2/sfx.hrc index ca1d3eb6b8a4..dfa3cc8593ec 100755 --- a/sfx2/inc/sfx2/sfx.hrc +++ b/sfx2/inc/sfx2/sfx.hrc @@ -253,6 +253,9 @@ #define STR_ERRUNOEVENTBINDUNG (RID_SFX_START+119) #define STR_SHARED (RID_SFX_START+120) #define RID_XMLSEC_DOCUMENTSIGNED (RID_SFX_START+121) +// IAccessibility2 implementation 2009. ------ +#define STR_ACCTITLE_PRODUCTIVITYTOOLS (RID_SFX_START+157) +// ------ IAccessibility2 implementation 2009. //========================================================================= diff --git a/sfx2/prj/build.lst b/sfx2/prj/build.lst index ca582c0aaf12..f25e991f84f4 100644 --- a/sfx2/prj/build.lst +++ b/sfx2/prj/build.lst @@ -1,3 +1,3 @@ -sf sfx2 : l10n idl basic xmlscript framework readlicense_oo shell setup_native sax SYSTRAY_GTK:libegg LIBXML2:libxml2 LIBXSLT:libxslt NULL +sf sfx2 : L10N:l10n idl basic xmlscript framework readlicense_oo shell setup_native sax SYSTRAY_GTK:libegg LIBXML2:libxml2 LIBXSLT:libxslt NULL sf sfx2\prj nmake - all sf_prj NULL diff --git a/sfx2/source/appl/sfx.src b/sfx2/source/appl/sfx.src index c3b734e327de..3bca517c5fd5 100644 --- a/sfx2/source/appl/sfx.src +++ b/sfx2/source/appl/sfx.src @@ -40,3 +40,8 @@ String STR_STYLE_FILTER_ALL Text [ en-US ] = "All Styles" ; }; +String STR_ACCTITLE_PRODUCTIVITYTOOLS +{ + Text [ en-US ] = "%PRODUCTNAME"; +}; + diff --git a/sfx2/source/dialog/dinfdlg.cxx b/sfx2/source/dialog/dinfdlg.cxx index b8c2bec4ba5a..2d5c383f8b89 100644 --- a/sfx2/source/dialog/dinfdlg.cxx +++ b/sfx2/source/dialog/dinfdlg.cxx @@ -828,6 +828,7 @@ SfxDocumentPage::SfxDocumentPage( Window* pParent, const SfxItemSet& rItemSet ) bHandleDelete ( sal_False ) { + aNameED.SetAccessibleName(String(SfxResId(EDIT_FILE_NAME))); FreeResource(); ImplUpdateSignatures(); @@ -1818,6 +1819,11 @@ CustomPropertiesWindow::CustomPropertiesWindow( Window* pParent, const ResId& rR m_aEditLoseFocusTimer.SetTimeoutHdl( LINK( this, CustomPropertiesWindow, EditTimeoutHdl ) ); m_aBoxLoseFocusTimer.SetTimeout( 300 ); m_aBoxLoseFocusTimer.SetTimeoutHdl( LINK( this, CustomPropertiesWindow, BoxTimeoutHdl ) ); + + ResMgr* pResMgr = rResId.GetResMgr(); + m_aNameBox.SetAccessibleName( String( ResId( STR_HEADER_NAME, *pResMgr ) ) ); + m_aTypeBox.SetAccessibleName( String( ResId( STR_HEADER_TYPE, *pResMgr ) ) ); + m_aValueEdit.SetAccessibleName( String( ResId( STR_HEADER_VALUE, *pResMgr ) ) ); } CustomPropertiesWindow::~CustomPropertiesWindow() @@ -2064,6 +2070,11 @@ void CustomPropertiesWindow::AddLine( const ::rtl::OUString& sName, Any& rAny ) //add lose focus handlers of date/time fields pNewLine->m_aTypeBox.SetLoseFocusHdl( LINK( this, CustomPropertiesWindow, BoxLoseFocusHdl ) ); + + pNewLine->m_aNameBox.SetAccessibleName(m_aNameBox.GetAccessibleName()); + pNewLine->m_aTypeBox.SetAccessibleName(m_aTypeBox.GetAccessibleName()); + pNewLine->m_aValueEdit.SetAccessibleName(m_aValueEdit.GetAccessibleName()); + long nPos = GetVisibleLineCount() * GetLineHeight(); m_aCustomPropertiesLines.push_back( pNewLine ); Window* pWindows[] = { &m_aNameBox, &m_aTypeBox, &m_aValueEdit, @@ -2384,9 +2395,9 @@ void CustomPropertiesControl::AddLine( const ::rtl::OUString& sName, Any& rAny, SfxCustomPropertiesPage::SfxCustomPropertiesPage( Window* pParent, const SfxItemSet& rItemSet ) : SfxTabPage( pParent, SfxResId( TP_CUSTOMPROPERTIES ), rItemSet ), - m_aPropertiesFT ( this, SfxResId( FT_PROPERTIES ) ), m_aPropertiesCtrl ( this, SfxResId( CTRL_PROPERTIES ) ), - m_aAddBtn ( this, SfxResId( BTN_ADD ) ) + m_aAddBtn ( this, SfxResId( BTN_ADD ) ), + m_aPropertiesFT ( this, SfxResId( FT_PROPERTIES ) ) { FreeResource(); diff --git a/sfx2/source/dialog/dinfdlg.hrc b/sfx2/source/dialog/dinfdlg.hrc index 5453e3606026..43bd848844a0 100644 --- a/sfx2/source/dialog/dinfdlg.hrc +++ b/sfx2/source/dialog/dinfdlg.hrc @@ -153,6 +153,10 @@ #define STR_HEADER_VALUE 92 #define STR_HEADER_ACTION 93 +//IAccessibility2 Implementation 2009----- +#define EDIT_FILE_NAME 94 +//-----IAccessibility2 Implementation 2009 + #define PB_OK 100 #define PB_CANCEL 101 #define PB_HELP 102 diff --git a/sfx2/source/dialog/dinfdlg.src b/sfx2/source/dialog/dinfdlg.src index c78347e3dba3..eaa24105bb17 100644 --- a/sfx2/source/dialog/dinfdlg.src +++ b/sfx2/source/dialog/dinfdlg.src @@ -303,6 +303,10 @@ TabPage TP_DOCINFODOC { Text [ en-US ] = "unknown" ; }; + String EDIT_FILE_NAME + { + Text [ en-US ] = "File Name" ; + }; }; // TP_DOCINFOUSER -------------------------------------------------------- diff --git a/sfx2/source/dialog/mgetempl.cxx b/sfx2/source/dialog/mgetempl.cxx index 454c42896cfe..5cac88236f4a 100644 --- a/sfx2/source/dialog/mgetempl.cxx +++ b/sfx2/source/dialog/mgetempl.cxx @@ -77,9 +77,9 @@ SfxManageStyleSheetPage::SfxManageStyleSheetPage( Window* pParent, const SfxItem aFilterFt ( this, SfxResId( FT_REGION ) ), aFilterLb ( this, SfxResId( LB_REGION ) ), + aDescGb ( this, SfxResId( GB_DESC ) ), aDescFt ( this, SfxResId( FT_DESC ) ), aDescED ( this, SfxResId( ED_DESC ) ), - aDescGb ( this, SfxResId( GB_DESC ) ), pStyle( &( (SfxStyleDialog*)pParent->GetParent() )->GetStyleSheet() ), diff --git a/sfx2/source/dialog/newstyle.cxx b/sfx2/source/dialog/newstyle.cxx index 8235333857d5..17bbee8c126f 100644 --- a/sfx2/source/dialog/newstyle.cxx +++ b/sfx2/source/dialog/newstyle.cxx @@ -91,6 +91,7 @@ SfxNewStyleDlg::SfxNewStyleDlg( Window* pParent, SfxStyleSheetBasePool& rInPool aOKBtn.SetClickHdl(LINK(this, SfxNewStyleDlg, OKHdl)); aColBox.SetModifyHdl(LINK(this, SfxNewStyleDlg, ModifyHdl)); aColBox.SetDoubleClickHdl(LINK(this, SfxNewStyleDlg, OKHdl)); + aColBox.SetAccessibleName(SfxResId(FL_COL)); SfxStyleSheetBase *pStyle = rPool.First(); while ( pStyle ) diff --git a/sfx2/source/dialog/passwd.cxx b/sfx2/source/dialog/passwd.cxx index d9c1ea80636d..47af8e61d81b 100644 --- a/sfx2/source/dialog/passwd.cxx +++ b/sfx2/source/dialog/passwd.cxx @@ -125,6 +125,7 @@ SfxPasswordDialog::SfxPasswordDialog( Window* pParent, const String* pGroupText mbAsciiOnly ( false ) { + maPasswordED.SetAccessibleName(String(SfxResId(TEXT_PASSWD))); FreeResource(); // setup layout diff --git a/sfx2/source/dialog/passwd.hrc b/sfx2/source/dialog/passwd.hrc index 5c9b07c7a130..dd35a6449dd8 100644 --- a/sfx2/source/dialog/passwd.hrc +++ b/sfx2/source/dialog/passwd.hrc @@ -46,6 +46,9 @@ #define FT_PASSWD_CONFIRM2 27 #define ED_PASSWD_CONFIRM2 28 +//IAccessibility2 Implementation 2009----- +#define TEXT_PASSWD 31 +//-----IAccessibility2 Implementation 2009 #endif // ******************************************************************* EOF diff --git a/sfx2/source/dialog/passwd.src b/sfx2/source/dialog/passwd.src index 426fb9986d5a..beb2f96a5e21 100644 --- a/sfx2/source/dialog/passwd.src +++ b/sfx2/source/dialog/passwd.src @@ -129,37 +129,10 @@ ModalDialog DLG_PASSWD Pos = MAP_APPFONT( 144, 43 ); Size = MAP_APPFONT( 50, 14 ); }; -}; - -// ********************************************************************** EOF - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + String TEXT_PASSWD + { + Text [ en-US ] = "Password" ; + }; +}; diff --git a/sfx2/source/dialog/tabdlg.cxx b/sfx2/source/dialog/tabdlg.cxx index e9c66e2a5f13..35a5fb766b97 100644 --- a/sfx2/source/dialog/tabdlg.cxx +++ b/sfx2/source/dialog/tabdlg.cxx @@ -697,6 +697,11 @@ void SfxTabDialog::Init_Impl( sal_Bool bFmtFlag, const String* pUserButtonText ) pExampleSet = new SfxItemSet( *pSet ); pOutSet = new SfxItemSet( *pSet->GetPool(), pSet->GetRanges() ); } + + aOKBtn.SetAccessibleRelationMemberOf( &aOKBtn ); + aCancelBtn.SetAccessibleRelationMemberOf( &aCancelBtn ); + aHelpBtn.SetAccessibleRelationMemberOf( &aHelpBtn ); + aResetBtn.SetAccessibleRelationMemberOf( &aResetBtn ); } // ----------------------------------------------------------------------- diff --git a/sfx2/source/dialog/templdlg.cxx b/sfx2/source/dialog/templdlg.cxx index 54df29e63e4a..d8ea47baf32d 100644 --- a/sfx2/source/dialog/templdlg.cxx +++ b/sfx2/source/dialog/templdlg.cxx @@ -778,6 +778,7 @@ SfxCommonTemplateDialog_Impl::SfxCommonTemplateDialog_Impl( SfxBindings* pB, Sfx bHierarchical ( sal_False ), bBindingUpdate ( sal_True ) { + aFmtLb.SetAccessibleName(SfxResId(STR_STYLE_ELEMTLIST)); aFmtLb.SetHelpId( HID_TEMPLATE_FMT ); aFilterLb.SetHelpId( HID_TEMPLATE_FILTER ); aFmtLb.SetStyle( aFmtLb.GetStyle() | WB_SORT | WB_HIDESELECTION ); @@ -1792,6 +1793,7 @@ IMPL_LINK( SfxCommonTemplateDialog_Impl, FilterSelectHdl, ListBox *, pBox ) FillTreeBox(); SelectStyle(aSelectEntry); + pTreeBox->SetAccessibleName(SfxResId(STR_STYLE_ELEMTLIST)); pTreeBox->Show(); } } diff --git a/sfx2/source/dialog/templdlg.hrc b/sfx2/source/dialog/templdlg.hrc index 58563fb9c160..e39108ce57a9 100644 --- a/sfx2/source/dialog/templdlg.hrc +++ b/sfx2/source/dialog/templdlg.hrc @@ -49,4 +49,7 @@ #define BT_VLIST 9 #define BT_TOOL 10 +//IAccessibility2 Implementation 2009----- +#define STR_STYLE_ELEMTLIST 18 +//-----IAccessibility2 Implementation 2009 diff --git a/sfx2/source/dialog/templdlg.src b/sfx2/source/dialog/templdlg.src index 60979450d9f6..ff2661181434 100644 --- a/sfx2/source/dialog/templdlg.src +++ b/sfx2/source/dialog/templdlg.src @@ -143,6 +143,10 @@ ModalDialog RID_STYLECATALOG }; }; // Strings --------------------------------------------------------------- +String STR_STYLE_ELEMTLIST +{ + Text [ en-US ] = "Style List" ; +}; String STR_STYLE_FILTER_HIERARCHICAL { Text [ en-US ] = "Hierarchical" ; diff --git a/shell/prj/build.lst b/shell/prj/build.lst index ad157a677bff..abf9af0c0c8e 100755 --- a/shell/prj/build.lst +++ b/shell/prj/build.lst @@ -1,4 +1,4 @@ -sl shell : l10n offuh rdbmaker tools sal EXPAT:expat LIBXSLT:libxslt NULL +sl shell : L10N:l10n offuh rdbmaker tools sal EXPAT:expat LIBXSLT:libxslt NULL sl shell\inc nmake - all sl_inc NULL sl shell\source\win32 nmake - w sl_win32 sl_inc NULL sl shell\source\win32\simplemail nmake - w sl_win32_simplemail sl_inc NULL diff --git a/svx/inc/float3d.hrc b/svx/inc/float3d.hrc index 259317275e8b..06b640ebff0e 100644 --- a/svx/inc/float3d.hrc +++ b/svx/inc/float3d.hrc @@ -181,4 +181,6 @@ #define BMP_TEX_CIRCLE_H 159 #define BMP_TEX_FILTER_H 160 #define BMP_COLORDLG_H 161 - +// IAccessibility2 implementation 2009. ------ +#define STR_COLOR_LIGHT_PRE 162 +// ------ IAccessibility2 implementation 2009. diff --git a/svx/inc/svx/bmpmask.hxx b/svx/inc/svx/bmpmask.hxx index 39ae551db3dd..ae0ac7b9d630 100644 --- a/svx/inc/svx/bmpmask.hxx +++ b/svx/inc/svx/bmpmask.hxx @@ -96,6 +96,9 @@ class SVX_DLLPUBLIC SvxBmpMask : public SfxDockingWindow PushButton aBtnExec; FixedLine aGrpQ; + FixedText aFt1; + FixedText aFt2; + FixedText aFt3; CheckBox aCbx1; MaskSet* pQSet1; MetricField aSp1; @@ -119,9 +122,7 @@ class SVX_DLLPUBLIC SvxBmpMask : public SfxDockingWindow MaskData* pData; CheckBox aCbxTrans; ColorLB aLbColorTrans; - FixedText aFt1; - FixedText aFt2; - FixedText aFt3; + const XColorTable* pColTab; Color aPipetteColor; SvxBmpMaskSelectItem aSelItem; diff --git a/svx/inc/svx/chrtitem.hxx b/svx/inc/svx/chrtitem.hxx index bc68bf1df705..ce1f5ea0753f 100644 --- a/svx/inc/svx/chrtitem.hxx +++ b/svx/inc/svx/chrtitem.hxx @@ -114,21 +114,6 @@ enum SvxChartDataDescr #define CHDESCR_COUNT (CHDESCR_TEXTANDVALUE + 1) -enum SvxChartLegendPos -{ - CHLEGEND_NONE, - CHLEGEND_LEFT, - CHLEGEND_TOP, - CHLEGEND_RIGHT, - CHLEGEND_BOTTOM, - CHLEGEND_NONE_TOP, - CHLEGEND_NONE_LEFT, - CHLEGEND_NONE_RIGHT, - CHLEGEND_NONE_BOTTOM -}; - -#define CHLEGEND_COUNT (CHLEGEND_BOTTOM + 1) - enum SvxChartTextOrder { CHTXTORDER_SIDEBYSIDE, @@ -243,25 +228,6 @@ public: //------------------------------------------------------------------ -class SVX_DLLPUBLIC SvxChartLegendPosItem : public SfxEnumItem -{ -public: - TYPEINFO(); - SvxChartLegendPosItem(SvxChartLegendPos eLegendPos /*= CHLEGEND_NONE*/, - sal_uInt16 nId ); - SvxChartLegendPosItem(SvStream& rIn, - sal_uInt16 nId ); - - virtual SfxPoolItem* Clone(SfxItemPool* pPool = 0) const; - virtual SfxPoolItem* Create(SvStream& rIn, sal_uInt16 nVer) const; - - sal_uInt16 GetValueCount() const { return CHLEGEND_COUNT; } - SvxChartLegendPos GetValue() const - { return (SvxChartLegendPos)SfxEnumItem::GetValue(); } -}; - -//------------------------------------------------------------------ - class SVX_DLLPUBLIC SvxChartTextOrderItem : public SfxEnumItem { public: diff --git a/svx/inc/svx/dialogs.hrc b/svx/inc/svx/dialogs.hrc index b28b150bd487..3bca44105edd 100755 --- a/svx/inc/svx/dialogs.hrc +++ b/svx/inc/svx/dialogs.hrc @@ -52,6 +52,14 @@ #define RID_SVXSTR_LINESTYLE (RID_SVX_START + 173) #define RID_SVXSTR_FIELDUNIT_TABLE (RID_SVX_START + 311) #define RID_SVXSTR_COLOR_USER (RID_SVX_START + 250) +//IAccessibility2 Implementation 2009----- +#define RID_SVXSTR_GALLERYPROPS_GALTHEME (RID_SVX_START + 251) +#define RID_SVXSTR_GALLERY_THEMEITEMS (RID_SVX_START + 252) +#define RID_SVXSTR_GALLERY_THEMENAME (RID_SVX_START + 253) +#define RID_SVXSTR_GALLERY_FILESFOUND (RID_SVX_START + 254) +#define RID_SVXSTR_GALLERY_PREVIEW (RID_SVX_START + 255) +//-----IAccessibility2 Implementation 2009 + // factory IDs of tabpages implemented in CUI #define RID_SVXPAGE_CHAR_TWOLINES (RID_SVX_START + 242) @@ -956,6 +964,9 @@ #define RID_SVXSTR_NEXTFREE (RID_SVX_START + 1191) +//IAccessibility2 Implementation 2009----- +#define RID_SVXSTR_TEXTCOLOR (RID_SVX_START + 1178) +//-----IAccessibility2 Implementation 2009 // ---------------------------------------------------------------------------- // if we have _a_lot_ time, we should group the resource ids by type, instead // of grouping them by semantics. The reason is that resource ids have to be @@ -1049,5 +1060,10 @@ #define OFA_TP_TABPROPERTIES_TEXT (RID_OFA_START + 245) #define OFA_TP_HELPERPROG (RID_OFA_START + 249) +// IAccessibility2 implementation 2009. ------ +#define STR_COLORTABLE (RID_OFA_START + 257) +#define STR_SWITCH (RID_OFA_START + 258) +// ------ IAccessibility2 implementation 2009. + #endif diff --git a/svx/inc/svx/float3d.hxx b/svx/inc/svx/float3d.hxx index 13eb8a697de0..8ad3d618d271 100644 --- a/svx/inc/svx/float3d.hxx +++ b/svx/inc/svx/float3d.hxx @@ -84,6 +84,7 @@ private: ImageButton aBtnUpdate; ImageButton aBtnAssign; + FixedLine aFLGeometrie; // Geometrie FixedText aFtPercentDiagonal; MetricField aMtrPercentDiagonal; @@ -93,36 +94,35 @@ private: MetricField aMtrEndAngle; FixedText aFtDepth; MetricField aMtrDepth; - FixedLine aFLGeometrie; + FixedLine aFLSegments; FixedText aFtHorizontal; NumericField aNumHorizontal; FixedText aFtVertical; NumericField aNumVertical; - FixedLine aFLSegments; + FixedLine aFLNormals; ImageButton aBtnNormalsObj; ImageButton aBtnNormalsFlat; ImageButton aBtnNormalsSphere; ImageButton aBtnNormalsInvert; ImageButton aBtnTwoSidedLighting; - FixedLine aFLNormals; ImageButton aBtnDoubleSided; - + FixedLine aFLRepresentation; // Darstellung FixedText aFtShademode; ListBox aLbShademode; + FixedLine aFLShadow; ImageButton aBtnShadow3d; FixedText aFtSlant; MetricField aMtrSlant; - FixedLine aFLShadow; FixedText aFtDistance; MetricField aMtrDistance; FixedText aFtFocalLeng; MetricField aMtrFocalLength; FixedLine aFLCamera; - FixedLine aFLRepresentation; + FixedLine aFLLight; // Beleuchtung ImageButton aBtnLight1; @@ -133,6 +133,7 @@ private: ImageButton aBtnLight6; ImageButton aBtnLight7; ImageButton aBtnLight8; + FixedText aFTLightsource; ColorLB aLbLight1; ColorLB aLbLight2; ColorLB aLbLight3; @@ -143,7 +144,6 @@ private: ColorLB aLbLight8; ImageButton aBtnLightColor; - FixedText aFTLightsource; // #99694# Keyboard shortcuts activate the next control, so the // order needed to be changed here @@ -151,7 +151,7 @@ private: ColorLB aLbAmbientlight; // ListBox ImageButton aBtnAmbientColor; // color button - FixedLine aFLLight; + FixedLine aFLTexture; // Texturen FixedText aFtTexKind; @@ -171,9 +171,9 @@ private: ImageButton aBtnTexCircleY; FixedText aFtTexFilter; ImageButton aBtnTexFilter; - FixedLine aFLTexture; // Material + FixedLine aFLMaterial; // Materialeditor FixedText aFtMatFavorites; ListBox aLbMatFavorites; @@ -183,20 +183,20 @@ private: FixedText aFtMatEmission; ColorLB aLbMatEmission; ImageButton aBtnEmissionColor; + FixedLine aFLMatSpecular; FixedText aFtMatSpecular; ColorLB aLbMatSpecular; ImageButton aBtnSpecularColor; FixedText aFtMatSpecularIntensity; MetricField aMtrMatSpecularIntensity; - FixedLine aFLMatSpecular; - FixedLine aFLMaterial; + + Svx3DPreviewControl aCtlPreview; + SvxLightCtl3D aCtlLightPreview; // Unterer Teil ImageButton aBtnConvertTo3D; ImageButton aBtnLatheObject; ImageButton aBtnPerspective; - Svx3DPreviewControl aCtlPreview; - SvxLightCtl3D aCtlLightPreview; // der Rest ... Image aImgLightOn; diff --git a/svx/inc/svx/fontworkgallery.hxx b/svx/inc/svx/fontworkgallery.hxx index 36502ccecca5..53c5b9b7bf38 100644 --- a/svx/inc/svx/fontworkgallery.hxx +++ b/svx/inc/svx/fontworkgallery.hxx @@ -91,8 +91,8 @@ public: class SVX_DLLPUBLIC FontWorkGalleryDialog : public ModalDialog { - ValueSet maCtlFavorites; FixedLine maFLFavorites; + ValueSet maCtlFavorites; OKButton maOKButton; CancelButton maCancelButton; HelpButton maHelpButton; diff --git a/svx/inc/svx/hdft.hxx b/svx/inc/svx/hdft.hxx index adc4745ace83..d30189ce81a0 100644 --- a/svx/inc/svx/hdft.hxx +++ b/svx/inc/svx/hdft.hxx @@ -70,6 +70,7 @@ protected: SvxHFPage( Window* pParent, sal_uInt16 nResId, const SfxItemSet& rSet, sal_uInt16 nSetId ); + FixedLine aFrm; CheckBox aTurnOnBox; CheckBox aCntSharedBox; FixedText aLMLbl; @@ -82,7 +83,6 @@ protected: FixedText aHeightFT; MetricField aHeightEdit; CheckBox aHeightDynBtn; - FixedLine aFrm; SvxPageWindow aBspWin; PushButton aBackgroundBtn; diff --git a/svx/inc/svx/svdstr.hrc b/svx/inc/svx/svdstr.hrc index d778bf40326b..2049bc4c3fdc 100644 --- a/svx/inc/svx/svdstr.hrc +++ b/svx/inc/svx/svdstr.hrc @@ -185,8 +185,12 @@ #define STR_ObjNameSingulMEDIA (STR_ObjNameBegin + 143) #define STR_ObjNamePluralMEDIA (STR_ObjNameBegin + 144) -#define STR_ObjNameEnd (STR_ObjNamePluralMEDIA) - +//#define STR_ObjNameEnd (STR_ObjNamePluralMEDIA) +//IAccessibility2 Implementation 2009----- +#define STR_ObjNameSingulFONTWORK (STR_ObjNameBegin+145) +#define STR_ObjNamePluralFONTWORK (STR_ObjNameBegin+146) +#define STR_ObjNameEnd (STR_ObjNamePluralFONTWORK) +//-----IAccessibility2 Implementation 2009 #define STR_EditBegin (STR_ObjNameEnd+1) #define STR_EditWithCopy (STR_EditBegin + 0) #define STR_EditPosSize (STR_EditBegin + 1) diff --git a/svx/prj/build.lst b/svx/prj/build.lst index 7b541b2d77c4..641f4e528793 100644 --- a/svx/prj/build.lst +++ b/svx/prj/build.lst @@ -1,2 +1,2 @@ -sx svx : sfx2 l10n oovbaapi connectivity xmloff linguistic jvmfwk avmedia drawinglayer editeng LIBXSLT:libxslt NULL +sx svx : sfx2 L10N:l10n oovbaapi connectivity xmloff linguistic jvmfwk avmedia drawinglayer editeng LIBXSLT:libxslt NULL sx svx\prj nmake - all sx_prj NULL diff --git a/svx/source/dialog/_bmpmask.cxx b/svx/source/dialog/_bmpmask.cxx index 9c2a5fc9a3bb..b6b8ca387969 100644 --- a/svx/source/dialog/_bmpmask.cxx +++ b/svx/source/dialog/_bmpmask.cxx @@ -417,6 +417,10 @@ SvxBmpMask::SvxBmpMask( SfxBindings *pBindinx, aBtnExec ( this, BMP_RESID( BTN_EXEC ) ), aGrpQ ( this, BMP_RESID( GRP_Q ) ), + aFt1 ( this, BMP_RESID ( FT_1 ) ), + aFt2 ( this, BMP_RESID ( FT_2 ) ), + aFt3 ( this, BMP_RESID ( FT_3 ) ), + aCbx1 ( this, BMP_RESID( CBX_1 ) ), pQSet1 ( new MaskSet( this, BMP_RESID( QCOL_1 ) ) ), aSp1 ( this, BMP_RESID( SP_1 ) ), @@ -440,9 +444,6 @@ SvxBmpMask::SvxBmpMask( SfxBindings *pBindinx, pData ( new MaskData( this, *pBindinx ) ), aCbxTrans ( this, BMP_RESID( CBX_TRANS ) ), aLbColorTrans ( this, BMP_RESID ( LB_TRANS ) ), - aFt1 ( this, BMP_RESID ( FT_1 ) ), - aFt2 ( this, BMP_RESID ( FT_2 ) ), - aFt3 ( this, BMP_RESID ( FT_3 ) ), pColTab ( NULL ), aPipetteColor ( COL_WHITE ), aSelItem ( SID_BMPMASK_EXEC, *this, *pBindinx ), @@ -508,6 +509,42 @@ SvxBmpMask::SvxBmpMask( SfxBindings *pBindinx, pQSet2->Show(); pQSet3->Show(); pQSet4->Show(); + + aCbx1.SetAccessibleRelationMemberOf( &aGrpQ ); + pQSet1->SetAccessibleRelationMemberOf( &aGrpQ ); + aSp1.SetAccessibleRelationMemberOf( &aGrpQ ); + aLbColor1.SetAccessibleRelationMemberOf( &aGrpQ ); + aCbx1.SetAccessibleRelationLabeledBy( &aFt1 ); + pQSet1->SetAccessibleRelationLabeledBy( &aFt1 ); + aSp1.SetAccessibleRelationLabeledBy( &aFt2 ); + aLbColor1.SetAccessibleRelationLabeledBy( &aFt3 ); + aCbx2.SetAccessibleRelationMemberOf( &aGrpQ ); + pQSet2->SetAccessibleRelationMemberOf( &aGrpQ ); + aSp2.SetAccessibleRelationMemberOf( &aGrpQ ); + aLbColor2.SetAccessibleRelationMemberOf( &aGrpQ ); + aCbx2.SetAccessibleRelationLabeledBy( &aFt1 ); + pQSet2->SetAccessibleRelationLabeledBy( &aFt1 ); + aSp2.SetAccessibleRelationLabeledBy( &aFt2 ); + aLbColor2.SetAccessibleRelationLabeledBy( &aFt3 ); + aCbx3.SetAccessibleRelationMemberOf( &aGrpQ ); + pQSet3->SetAccessibleRelationMemberOf( &aGrpQ ); + aSp3.SetAccessibleRelationMemberOf( &aGrpQ ); + aLbColor3.SetAccessibleRelationMemberOf( &aGrpQ ); + aCbx3.SetAccessibleRelationLabeledBy( &aFt1 ); + pQSet3->SetAccessibleRelationLabeledBy( &aFt1 ); + aSp3.SetAccessibleRelationLabeledBy( &aFt2 ); + aLbColor3.SetAccessibleRelationLabeledBy( &aFt3 ); + aCbx4.SetAccessibleRelationMemberOf( &aGrpQ ); + pQSet4->SetAccessibleRelationMemberOf( &aGrpQ ); + aSp4.SetAccessibleRelationMemberOf( &aGrpQ ); + aLbColor4.SetAccessibleRelationMemberOf( &aGrpQ ); + aCbx4.SetAccessibleRelationLabeledBy( &aFt1 ); + pQSet4->SetAccessibleRelationLabeledBy( &aFt1 ); + aSp4.SetAccessibleRelationLabeledBy( &aFt2 ); + aLbColor4.SetAccessibleRelationLabeledBy( &aFt3 ); + aLbColorTrans.SetAccessibleRelationLabeledBy( &aCbxTrans ); + aLbColorTrans.SetAccessibleRelationMemberOf( &aGrpQ ); + aCbxTrans.SetAccessibleRelationMemberOf( &aGrpQ ); } //------------------------------------------------------------------------- diff --git a/svx/source/dialog/bmpmask.hrc b/svx/source/dialog/bmpmask.hrc index 99c9eab04b7b..42fcc244c3f7 100644 --- a/svx/source/dialog/bmpmask.hrc +++ b/svx/source/dialog/bmpmask.hrc @@ -27,7 +27,11 @@ #define RID_SVXDLG_BMPMASK (RID_SVX_BMPMASK_START) #define RID_SVXDLG_BMPMASK_STR_TRANSP (RID_SVX_BMPMASK_START + 1) #define RID_SVXDLG_BMPMASK_STR_SOURCECOLOR (RID_SVX_BMPMASK_START + 2) - +/*IAccessibility2 Implementation 2009-----*/ +#define RID_SVXDLG_BMPMASK_STR_PALETTE (RID_SVX_BMPMASK_START + 3) +#define RID_SVXDLG_BMPMASK_STR_TOLERANCE (RID_SVX_BMPMASK_START + 4) +#define RID_SVXDLG_BMPMASK_STR_REPLACEWITH (RID_SVX_BMPMASK_START + 5) +/*-----IAccessibility2 Implementation 2009*/ #define GRP_Q 1 #define CTR_PIPETTE 1 #define CBX_1 1 diff --git a/svx/source/dialog/bmpmask.src b/svx/source/dialog/bmpmask.src index 7823007dbe7c..b221f633283a 100644 --- a/svx/source/dialog/bmpmask.src +++ b/svx/source/dialog/bmpmask.src @@ -327,47 +327,16 @@ String RID_SVXDLG_BMPMASK_STR_SOURCECOLOR Text [ en-US ] = "Source Color"; }; - // ********************************************************************** EOF - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +String RID_SVXDLG_BMPMASK_STR_PALETTE +{ + Text [ en-US ] = "Color Palette"; +}; +String RID_SVXDLG_BMPMASK_STR_TOLERANCE +{ + Text [ en-US ] = "Tolerance"; +}; +String RID_SVXDLG_BMPMASK_STR_REPLACEWITH +{ + Text [ en-US ] = "Replace with"; +}; diff --git a/svx/source/dialog/ctredlin.cxx b/svx/source/dialog/ctredlin.cxx index c3f1f0b17a52..d8adc0560625 100644 --- a/svx/source/dialog/ctredlin.cxx +++ b/svx/source/dialog/ctredlin.cxx @@ -634,6 +634,7 @@ SvxTPView::SvxTPView( Window * pParent) aTitle5 ( SVX_RES( STR_TITLE5 ) ), aStrMyName ( SVX_RES( STR_VIEW) ) { + aViewData.SetAccessibleName(String(SVX_RES(STR_TREE))); FreeResource(); aViewData.SetHelpId(HID_REDLINING_VIEW_DG_VIEW_TABLE); @@ -826,6 +827,14 @@ SvxTPFilter::SvxTPFilter( Window * pParent) aStrMyName ( SVX_RES( STR_FILTER) ), bModified (sal_False) { + aLbDate.SetAccessibleName( String( SVX_RES( STR_DATE_COMBOX) ) ); + aDfDate.SetAccessibleName( String( SVX_RES( STR_DATE_SPIN) ) ); + aTfDate.SetAccessibleName( String( SVX_RES( STR_DATE_TIME_SPIN) ) ); + aDfDate2.SetAccessibleName( String( SVX_RES( STR_DATE_SPIN1) ) ); + aTfDate2.SetAccessibleName( String( SVX_RES( STR_DATE_TIME_SPIN1) ) ); + aLbAuthor.SetAccessibleName(aCbAuthor.GetText()); + aLbAction.SetAccessibleName( String( SVX_RES( STR_ACTION) ) ); + aEdComment.SetAccessibleName(aCbComment.GetText()); Image aImgTimeHC( SVX_RES( IMG_TIME_H ) ); FreeResource(); @@ -874,6 +883,15 @@ SvxTPFilter::SvxTPFilter( Window * pParent) HideRange(); ShowAction(); bModified=sal_False; + + aLbDate.SetAccessibleRelationLabeledBy(&aCbDate); + aLbAuthor.SetAccessibleRelationLabeledBy(&aCbAuthor); + aLbAction.SetAccessibleRelationLabeledBy(&aCbRange); + aEdRange.SetAccessibleRelationLabeledBy(&aCbRange); + aBtnRange.SetAccessibleRelationLabeledBy(&aCbRange); + aEdComment.SetAccessibleRelationLabeledBy(&aCbComment); + aDfDate2.SetAccessibleRelationLabeledBy(&aDfDate2); + aTfDate2.SetAccessibleRelationLabeledBy(&aTfDate2); } void SvxTPFilter::SetRedlinTable(SvxRedlinTable* pTable) diff --git a/svx/source/dialog/ctredlin.hrc b/svx/source/dialog/ctredlin.hrc index 23cc504c0573..772d985ae8c0 100644 --- a/svx/source/dialog/ctredlin.hrc +++ b/svx/source/dialog/ctredlin.hrc @@ -66,5 +66,12 @@ #define STR_TITLE3 3 #define STR_TITLE4 4 #define STR_TITLE5 5 -// +//IAccessibility2 Implementation 2009----- +#define STR_DATE_COMBOX 6 +#define STR_DATE_SPIN 7 +#define STR_DATE_SPIN1 8 +#define STR_DATE_TIME_SPIN 9 +#define STR_DATE_TIME_SPIN1 10 +#define STR_TREE 11 +//-----IAccessibility2 Implementation 2009 diff --git a/svx/source/dialog/ctredlin.src b/svx/source/dialog/ctredlin.src index e617607ebfad..284ed97ed54e 100644 --- a/svx/source/dialog/ctredlin.src +++ b/svx/source/dialog/ctredlin.src @@ -114,7 +114,10 @@ TabPage SID_REDLIN_FILTER_PAGE ImageBitmap = Bitmap { File = "time.bmp" ; }; MASKCOLOR }; - QuickHelpText [ en-US ] = "Set Date/Time" ; + // IAccessibility2 implementation 2009. ------ + //QuickHelpText [ en-US ] = "Set Date/Time" ; + QuickHelpText [ en-US ] = "Set Start Date/Time" ; + // ------ IAccessibility2 implementation 2009. }; FixedText FT_DATE2 { @@ -170,7 +173,10 @@ TabPage SID_REDLIN_FILTER_PAGE ImageBitmap = Bitmap { File = "time.bmp" ; }; MASKCOLOR }; - QuickHelpText [ en-US ] = "Set Date/Time" ; + // IAccessibility2 implementation 2009. ------ + //QuickHelpText [ en-US ] = "Set Date/Time" ; + QuickHelpText [ en-US ] = "Set End Date/Time" ; + // ------ IAccessibility2 implementation 2009. }; CheckBox CB_AUTOR { @@ -254,6 +260,32 @@ TabPage SID_REDLIN_FILTER_PAGE ImageBitmap = Bitmap { File = "time_h.bmp" ; }; MASKCOLOR }; + /*IAccessibility2 Implementation 2009-----*/ + String STR_DATE_COMBOX + { + Text [ en-US ] = "Date Condition" ; + }; + String STR_DATE_SPIN + { + Text [ en-US ] = "Start Date" ; + }; + String STR_DATE_SPIN1 + { + Text [ en-US ] = "End Date" ; + }; + String STR_DATE_TIME_SPIN + { + Text [ en-US ] = "Start Time" ; + }; + String STR_DATE_TIME_SPIN1 + { + Text [ en-US ] = "End Time" ; + }; + String STR_TREE + { + Text [ en-US ] = "Changes" ; + }; + /*-----IAccessibility2 Implementation 2009*/ }; TabPage SID_REDLIN_VIEW_PAGE { diff --git a/svx/source/dialog/dlgctl3d.cxx b/svx/source/dialog/dlgctl3d.cxx index 5f05d360007c..ee59f6ce924d 100644 --- a/svx/source/dialog/dlgctl3d.cxx +++ b/svx/source/dialog/dlgctl3d.cxx @@ -45,6 +45,7 @@ #include <svx/xlnwtit.hxx> #include "helpid.hrc" #include <algorithm> +#include <svx/dialmgr.hxx> ////////////////////////////////////////////////////////////////////////////// @@ -1012,6 +1013,7 @@ void SvxLightCtl3D::Init() maHorScroller.SetHelpId(HID_CTRL3D_HSCROLL); maVerScroller.SetHelpId(HID_CTRL3D_VSCROLL); maSwitcher.SetHelpId(HID_CTRL3D_SWITCHER); + maSwitcher.SetAccessibleName(String(SVX_RES(STR_SWITCH))); // Light preview maLightControl.Show(); diff --git a/svx/source/dialog/dlgctrl.src b/svx/source/dialog/dlgctrl.src index 2da544673c65..e5962dcef059 100644 --- a/svx/source/dialog/dlgctrl.src +++ b/svx/source/dialog/dlgctrl.src @@ -31,4 +31,9 @@ Bitmap RID_SVXCTRL_RECTBTNS { File = "rectbtns.bmp" ; }; - +/*IAccessibility2 Implementation 2009-----*/ +String STR_SWITCH +{ + Text [ en-US ] = "Switch" ; +}; +/*-----IAccessibility2 Implementation 2009*/ diff --git a/svx/source/dialog/hdft.cxx b/svx/source/dialog/hdft.cxx index 67e34801ca34..b4debaa4eaa4 100644 --- a/svx/source/dialog/hdft.cxx +++ b/svx/source/dialog/hdft.cxx @@ -146,6 +146,7 @@ SvxHFPage::SvxHFPage( Window* pParent, sal_uInt16 nResId, const SfxItemSet& rAtt SfxTabPage( pParent, SVX_RES( nResId ), rAttr ), + aFrm ( this, SVX_RES( FL_FRAME ) ), aTurnOnBox ( this, SVX_RES( CB_TURNON ) ), aCntSharedBox ( this, SVX_RES( CB_SHARED ) ), aLMLbl ( this, SVX_RES( FT_LMARGIN ) ), @@ -158,7 +159,6 @@ SvxHFPage::SvxHFPage( Window* pParent, sal_uInt16 nResId, const SfxItemSet& rAtt aHeightFT ( this, SVX_RES( FT_HEIGHT ) ), aHeightEdit ( this, SVX_RES( ED_HEIGHT ) ), aHeightDynBtn ( this, SVX_RES( CB_HEIGHT_DYN ) ), - aFrm ( this, SVX_RES( FL_FRAME ) ), aBspWin ( this, SVX_RES( WN_BSP ) ), aBackgroundBtn ( this, SVX_RES( BTN_EXTRAS ) ), @@ -182,6 +182,20 @@ SvxHFPage::SvxHFPage( Window* pParent, sal_uInt16 nResId, const SfxItemSet& rAtt SetFieldUnit( aHeightEdit, eFUnit ); SetFieldUnit( aLMEdit, eFUnit ); SetFieldUnit( aRMEdit, eFUnit ); + + aTurnOnBox.SetAccessibleRelationMemberOf( &aFrm ); + aCntSharedBox.SetAccessibleRelationMemberOf( &aFrm ); + aLMLbl.SetAccessibleRelationMemberOf( &aFrm ); + aLMEdit.SetAccessibleRelationMemberOf( &aFrm ); + aRMLbl.SetAccessibleRelationMemberOf( &aFrm ); + aRMEdit.SetAccessibleRelationMemberOf( &aFrm ); + aDistFT.SetAccessibleRelationMemberOf( &aFrm ); + aDistEdit.SetAccessibleRelationMemberOf( &aFrm ); + aDynSpacingCB.SetAccessibleRelationMemberOf( &aFrm ); + aHeightFT.SetAccessibleRelationMemberOf( &aFrm ); + aHeightEdit.SetAccessibleRelationMemberOf( &aFrm ); + aHeightDynBtn.SetAccessibleRelationMemberOf( &aFrm ); + aBackgroundBtn.SetAccessibleRelationMemberOf(&aFrm); } // ----------------------------------------------------------------------- diff --git a/svx/source/dialog/optgrid.cxx b/svx/source/dialog/optgrid.cxx index 83d8206111f8..a3b367ad878c 100644 --- a/svx/source/dialog/optgrid.cxx +++ b/svx/source/dialog/optgrid.cxx @@ -248,6 +248,17 @@ SvxGridTabPage::SvxGridTabPage( Window* pParent, const SfxItemSet& rCoreSet) : LINK( this, SvxGridTabPage, ChangeDivisionHdl_Impl ) ); aNumFldDivisionY.SetModifyHdl( LINK( this, SvxGridTabPage, ChangeDivisionHdl_Impl ) ); + + ::rtl::OUString sFlResolution( aFlResolution.GetDisplayText() ); + ::rtl::OUString sFtDrawX(aFtDrawX.GetDisplayText()); + ::rtl::OUString sFtDrawY(aFtDrawY.GetDisplayText()); + aMtrFldDrawX.SetAccessibleName( sFtDrawX + sFlResolution ); + aMtrFldDrawY.SetAccessibleName( sFtDrawY + sFlResolution ); + ::rtl::OUString sFlDivision( aFlDivision.GetDisplayText() ); + ::rtl::OUString sFtDivisionX(aFtDivisionX.GetDisplayText()); + ::rtl::OUString sFtDivisionY(aFtDivisionY.GetDisplayText()); + aNumFldDivisionX.SetAccessibleName( sFtDivisionX + sFlDivision ); + aNumFldDivisionY.SetAccessibleName( sFtDivisionY + sFlDivision ); } //------------------------------------------------------------------------ diff --git a/svx/source/dialog/rubydialog.cxx b/svx/source/dialog/rubydialog.cxx index a85fc023eca5..3185263b4fe4 100644 --- a/svx/source/dialog/rubydialog.cxx +++ b/svx/source/dialog/rubydialog.cxx @@ -277,6 +277,14 @@ SvxRubyDialog::SvxRubyDialog( SfxBindings *pBind, SfxChildWindow *pCW, } UpdateColors(); + + String leftLabelName = aLeftFT.GetText(), rightLabelName = aRightFT.GetText(); + aLeft2ED.SetAccessibleName(leftLabelName); + aLeft3ED.SetAccessibleName(leftLabelName); + aLeft4ED.SetAccessibleName(leftLabelName); + aRight2ED.SetAccessibleName(rightLabelName); + aRight3ED.SetAccessibleName(rightLabelName); + aRight4ED.SetAccessibleName(rightLabelName); } /* -----------------------------09.01.01 17:17-------------------------------- diff --git a/svx/source/dialog/sdstring.src b/svx/source/dialog/sdstring.src index 4b70dda6a151..44982cee0751 100644 --- a/svx/source/dialog/sdstring.src +++ b/svx/source/dialog/sdstring.src @@ -1187,103 +1187,26 @@ String RID_SVXSTR_COLOR_USER Text [ en-US ] = "User" ; }; +String RID_SVXSTR_GALLERYPROPS_GALTHEME +{ + Text [ en-US ] = "Gallery Theme" ; +}; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +//IAccessibility2 Implementation 2009----- +String RID_SVXSTR_GALLERY_THEMEITEMS +{ + Text [ en-US ] = "Theme Items"; +}; +String RID_SVXSTR_GALLERY_THEMENAME +{ + Text [ en-US ] = "Theme Name"; +}; +String RID_SVXSTR_GALLERY_FILESFOUND +{ + Text [ en-US ] = "Files Found"; +}; +String RID_SVXSTR_GALLERY_PREVIEW +{ + Text [ en-US ] = "Preview"; +}; +//-----IAccessibility2 Implementation 2009 diff --git a/svx/source/dialog/srchdlg.cxx b/svx/source/dialog/srchdlg.cxx index 5f91c6dabacb..97dc2cfaf76d 100644 --- a/svx/source/dialog/srchdlg.cxx +++ b/svx/source/dialog/srchdlg.cxx @@ -494,6 +494,14 @@ void SvxSearchDialog::Construct_Impl() { aJapMatchFullHalfWidthCB.Hide(); } + + aSimilarityBtn.SetAccessibleRelationLabeledBy(&aSimilarityBox); + aSimilarityBtn.SetAccessibleRelationMemberOf(&aOptionsFL); + aJapOptionsBtn.SetAccessibleRelationLabeledBy(&aJapOptionsCB); + aJapOptionsBtn.SetAccessibleRelationMemberOf(&aOptionsFL); + aRowsBtn.SetAccessibleRelationMemberOf(&aCalcSearchDirFT); + aColumnsBtn.SetAccessibleRelationMemberOf(&aCalcSearchDirFT); + //component extension - show component search buttons if the commands // vnd.sun.star::SearchViaComponent1 and 2 are supported const uno::Reference< frame::XFrame >xFrame = rBindings.GetActiveFrame(); diff --git a/svx/source/engine3d/float3d.cxx b/svx/source/engine3d/float3d.cxx index ea33f2089ed0..f1766f01c3ea 100644 --- a/svx/source/engine3d/float3d.cxx +++ b/svx/source/engine3d/float3d.cxx @@ -119,6 +119,7 @@ __EXPORT Svx3DWin::Svx3DWin( SfxBindings* pInBindings, aBtnMaterial ( this, SVX_RES( BTN_MATERIAL ) ), aBtnUpdate ( this, SVX_RES( BTN_UPDATE ) ), aBtnAssign ( this, SVX_RES( BTN_ASSIGN ) ), + aFLGeometrie ( this, SVX_RES( FL_GEOMETRIE ) ), // Geometrie aFtPercentDiagonal ( this, SVX_RES( FT_PERCENT_DIAGONAL ) ), @@ -129,36 +130,36 @@ __EXPORT Svx3DWin::Svx3DWin( SfxBindings* pInBindings, aMtrEndAngle ( this, SVX_RES( MTR_END_ANGLE ) ), aFtDepth ( this, SVX_RES( FT_DEPTH ) ), aMtrDepth ( this, SVX_RES( MTR_DEPTH ) ), - aFLGeometrie ( this, SVX_RES( FL_GEOMETRIE ) ), + aFLSegments ( this, SVX_RES( FL_SEGMENTS ) ), aFtHorizontal ( this, SVX_RES( FT_HORIZONTAL ) ), aNumHorizontal ( this, SVX_RES( NUM_HORIZONTAL ) ), aFtVertical ( this, SVX_RES( FT_VERTICAL ) ), aNumVertical ( this, SVX_RES( NUM_VERTICAL ) ), - aFLSegments ( this, SVX_RES( FL_SEGMENTS ) ), + aFLNormals ( this, SVX_RES( FL_NORMALS ) ), aBtnNormalsObj ( this, SVX_RES( BTN_NORMALS_OBJ ) ), aBtnNormalsFlat ( this, SVX_RES( BTN_NORMALS_FLAT ) ), aBtnNormalsSphere ( this, SVX_RES( BTN_NORMALS_SPHERE ) ), aBtnNormalsInvert ( this, SVX_RES( BTN_NORMALS_INVERT ) ), aBtnTwoSidedLighting( this, SVX_RES( BTN_TWO_SIDED_LIGHTING ) ), - aFLNormals ( this, SVX_RES( FL_NORMALS ) ), aBtnDoubleSided ( this, SVX_RES( BTN_DOUBLE_SIDED ) ), // Darstellung + aFLRepresentation ( this, SVX_RES( FL_REPRESENTATION ) ), aFtShademode ( this, SVX_RES( FT_SHADEMODE ) ), aLbShademode ( this, SVX_RES( LB_SHADEMODE ) ), + aFLShadow ( this, SVX_RES( FL_SHADOW ) ), aBtnShadow3d ( this, SVX_RES( BTN_SHADOW_3D ) ), aFtSlant ( this, SVX_RES( FT_SLANT ) ), aMtrSlant ( this, SVX_RES( MTR_SLANT ) ), - aFLShadow ( this, SVX_RES( FL_SHADOW ) ), aFtDistance ( this, SVX_RES( FT_DISTANCE ) ), aMtrDistance ( this, SVX_RES( MTR_DISTANCE ) ), aFtFocalLeng ( this, SVX_RES( FT_FOCAL_LENGTH ) ), aMtrFocalLength ( this, SVX_RES( MTR_FOCAL_LENGTH ) ), aFLCamera ( this, SVX_RES( FL_CAMERA ) ), - aFLRepresentation ( this, SVX_RES( FL_REPRESENTATION ) ), + aFLLight ( this, SVX_RES( FL_LIGHT ) ), // Beleuchtung aBtnLight1 ( this, SVX_RES( BTN_LIGHT_1 ) ), @@ -169,6 +170,7 @@ __EXPORT Svx3DWin::Svx3DWin( SfxBindings* pInBindings, aBtnLight6 ( this, SVX_RES( BTN_LIGHT_6 ) ), aBtnLight7 ( this, SVX_RES( BTN_LIGHT_7 ) ), aBtnLight8 ( this, SVX_RES( BTN_LIGHT_8 ) ), + aFTLightsource ( this, SVX_RES( FT_LIGHTSOURCE ) ), aLbLight1 ( this, SVX_RES( LB_LIGHT_1 ) ), aLbLight2 ( this, SVX_RES( LB_LIGHT_2 ) ), aLbLight3 ( this, SVX_RES( LB_LIGHT_3 ) ), @@ -179,15 +181,13 @@ __EXPORT Svx3DWin::Svx3DWin( SfxBindings* pInBindings, aLbLight8 ( this, SVX_RES( LB_LIGHT_8 ) ), aBtnLightColor ( this, SVX_RES( BTN_LIGHT_COLOR ) ), - aFTLightsource ( this, SVX_RES( FT_LIGHTSOURCE ) ), // #99694# Keyboard shortcuts activate the next control, so the // order needed to be changed here aFTAmbientlight ( this, SVX_RES( FT_AMBIENTLIGHT ) ), // Text label aLbAmbientlight ( this, SVX_RES( LB_AMBIENTLIGHT ) ), // ListBox aBtnAmbientColor ( this, SVX_RES( BTN_AMBIENT_COLOR ) ), // color button - - aFLLight ( this, SVX_RES( FL_LIGHT ) ), + aFLTexture ( this, SVX_RES( FL_TEXTURE ) ), // Texturen aFtTexKind ( this, SVX_RES( FT_TEX_KIND ) ), @@ -207,7 +207,7 @@ __EXPORT Svx3DWin::Svx3DWin( SfxBindings* pInBindings, aBtnTexCircleY ( this, SVX_RES( BTN_TEX_CIRCLE_Y ) ), aFtTexFilter ( this, SVX_RES( FT_TEX_FILTER ) ), aBtnTexFilter ( this, SVX_RES( BTN_TEX_FILTER ) ), - aFLTexture ( this, SVX_RES( FL_TEXTURE ) ), + aFLMaterial ( this, SVX_RES( FL_MATERIAL ) ), // Material aFtMatFavorites ( this, SVX_RES( FT_MAT_FAVORITES ) ), @@ -218,20 +218,19 @@ __EXPORT Svx3DWin::Svx3DWin( SfxBindings* pInBindings, aFtMatEmission ( this, SVX_RES( FT_MAT_EMISSION ) ), aLbMatEmission ( this, SVX_RES( LB_MAT_EMISSION ) ), aBtnEmissionColor ( this, SVX_RES( BTN_EMISSION_COLOR ) ), + aFLMatSpecular ( this, SVX_RES( FL_MAT_SPECULAR ) ), aFtMatSpecular ( this, SVX_RES( FT_MAT_SPECULAR ) ), aLbMatSpecular ( this, SVX_RES( LB_MAT_SPECULAR ) ), aBtnSpecularColor ( this, SVX_RES( BTN_SPECULAR_COLOR ) ), aFtMatSpecularIntensity( this, SVX_RES( FT_MAT_SPECULAR_INTENSITY ) ), aMtrMatSpecularIntensity( this, SVX_RES( MTR_MAT_SPECULAR_INTENSITY ) ), - aFLMatSpecular ( this, SVX_RES( FL_MAT_SPECULAR ) ), - aFLMaterial ( this, SVX_RES( FL_MATERIAL ) ), + aCtlPreview ( this, SVX_RES( CTL_PREVIEW ) ), + aCtlLightPreview ( this, SVX_RES( CTL_LIGHT_PREVIEW ) ), // Unterer Bereich aBtnConvertTo3D ( this, SVX_RES( BTN_CHANGE_TO_3D ) ), aBtnLatheObject ( this, SVX_RES( BTN_LATHE_OBJ ) ), aBtnPerspective ( this, SVX_RES( BTN_PERSPECTIVE ) ), - aCtlPreview ( this, SVX_RES( CTL_PREVIEW ) ), - aCtlLightPreview ( this, SVX_RES( CTL_LIGHT_PREVIEW ) ), aImgLightOn ( SVX_RES( RID_SVXIMAGE_LIGHT_ON ) ), aImgLightOff ( SVX_RES( RID_SVXIMAGE_LIGHT_OFF ) ), @@ -255,6 +254,11 @@ __EXPORT Svx3DWin::Svx3DWin( SfxBindings* pInBindings, mpRemember2DAttributes(NULL), bOnly3DChanged ( sal_False ) { + String accname(SVX_RES(STR_COLOR_LIGHT_PRE)); + aCtlLightPreview.SetAccessibleName(accname); + aCtlPreview.SetAccessibleName(accname); + aLbAmbientlight.SetAccessibleName(aFTAmbientlight.GetDisplayText()); + SETHCIMAGE( aBtnGeo, BMP_GEO_H ); SETHCIMAGE( aBtnRepresentation, BMP_REPRESENTATION_H ); SETHCIMAGE( aBtnLight, BMP_3DLIGHT_H ); @@ -416,6 +420,86 @@ __EXPORT Svx3DWin::Svx3DWin( SfxBindings* pInBindings, } Reset(); + + aBtnNormalsObj.SetAccessibleRelationMemberOf( &aFLNormals ); + aBtnNormalsFlat.SetAccessibleRelationMemberOf( &aFLNormals ); + aBtnNormalsSphere.SetAccessibleRelationMemberOf( &aFLNormals ); + aBtnNormalsInvert.SetAccessibleRelationMemberOf( &aFLNormals ); + aBtnTwoSidedLighting.SetAccessibleRelationMemberOf( &aFLNormals ); + aBtnDoubleSided.SetAccessibleRelationMemberOf( &aFLNormals ); + + aBtnLight1.SetAccessibleRelationMemberOf( &aFLLight ); + aBtnLight2.SetAccessibleRelationMemberOf( &aFLLight ); + aBtnLight3.SetAccessibleRelationMemberOf( &aFLLight ); + aBtnLight4.SetAccessibleRelationMemberOf( &aFLLight ); + aBtnLight5.SetAccessibleRelationMemberOf( &aFLLight ); + aBtnLight6.SetAccessibleRelationMemberOf( &aFLLight ); + aBtnLight7.SetAccessibleRelationMemberOf( &aFLLight ); + aBtnLight8.SetAccessibleRelationMemberOf( &aFLLight ); + + aBtnLight1.SetAccessibleRelationLabeledBy( &aFTLightsource ); + aBtnLight2.SetAccessibleRelationLabeledBy( &aFTLightsource ); + aBtnLight3.SetAccessibleRelationLabeledBy( &aFTLightsource ); + aBtnLight4.SetAccessibleRelationLabeledBy( &aFTLightsource ); + aBtnLight5.SetAccessibleRelationLabeledBy( &aFTLightsource ); + aBtnLight6.SetAccessibleRelationLabeledBy( &aFTLightsource ); + aBtnLight7.SetAccessibleRelationLabeledBy( &aFTLightsource ); + aBtnLight8.SetAccessibleRelationLabeledBy( &aFTLightsource ); + aBtnLightColor.SetAccessibleRelationMemberOf( &aFLLight ); + aBtnLightColor.SetAccessibleRelationLabeledBy( &aFTLightsource ); + aBtnAmbientColor.SetAccessibleRelationMemberOf( &aFLLight ); + aBtnAmbientColor.SetAccessibleRelationLabeledBy( &aFTAmbientlight ); + + aBtnSpecularColor.SetAccessibleRelationLabeledBy( &aFtMatSpecular ); + aBtnMatColor.SetAccessibleRelationLabeledBy( &aFtMatColor ); + aBtnEmissionColor.SetAccessibleRelationLabeledBy( &aFtMatEmission ); + aBtnTexLuminance.SetAccessibleRelationLabeledBy( &aFtTexKind ); + aBtnTexColor.SetAccessibleRelationLabeledBy( &aFtTexKind ); + aBtnTexReplace.SetAccessibleRelationLabeledBy( &aFtTexMode ); + aBtnTexModulate.SetAccessibleRelationLabeledBy( &aFtTexMode ); + aBtnTexBlend.SetAccessibleRelationLabeledBy( &aFtTexMode ); + aBtnTexObjectX.SetAccessibleRelationLabeledBy( &aFtTexProjectionX ); + aBtnTexParallelX.SetAccessibleRelationLabeledBy( &aFtTexProjectionX ); + aBtnTexCircleX.SetAccessibleRelationLabeledBy( &aFtTexProjectionX ); + aBtnTexObjectY.SetAccessibleRelationLabeledBy( &aFtTexProjectionY ); + aBtnTexParallelY.SetAccessibleRelationLabeledBy( &aFtTexProjectionY ); + aBtnTexCircleY.SetAccessibleRelationLabeledBy( &aFtTexProjectionY ); + aBtnTexFilter.SetAccessibleRelationLabeledBy( &aFtTexFilter ); + aCtlLightPreview.SetAccessibleRelationLabeledBy( &aCtlLightPreview ); + aBtnNormalsObj.SetAccessibleRelationMemberOf(&aFLNormals); + aBtnNormalsFlat.SetAccessibleRelationMemberOf(&aFLNormals); + aBtnNormalsSphere.SetAccessibleRelationMemberOf(&aFLNormals); + aBtnNormalsInvert.SetAccessibleRelationMemberOf(&aFLNormals); + aBtnTwoSidedLighting.SetAccessibleRelationMemberOf(&aFLNormals); + + aBtnShadow3d.SetAccessibleRelationMemberOf(&aFLShadow); + + aBtnLight1.SetAccessibleRelationMemberOf(&aFLLight); + aBtnLight2.SetAccessibleRelationMemberOf(&aFLLight); + aBtnLight3.SetAccessibleRelationMemberOf(&aFLLight); + aBtnLight4.SetAccessibleRelationMemberOf(&aFLLight); + aBtnLight5.SetAccessibleRelationMemberOf(&aFLLight); + aBtnLight6.SetAccessibleRelationMemberOf(&aFLLight); + aBtnLight7.SetAccessibleRelationMemberOf(&aFLLight); + aBtnLight8.SetAccessibleRelationMemberOf(&aFLLight); + + aBtnTexLuminance.SetAccessibleRelationMemberOf(&aFLTexture); + aBtnTexColor.SetAccessibleRelationMemberOf(&aFLTexture); + aBtnTexReplace.SetAccessibleRelationMemberOf(&aFLTexture); + aBtnTexModulate.SetAccessibleRelationMemberOf(&aFLTexture); + aBtnTexBlend.SetAccessibleRelationMemberOf(&aFLTexture); + aBtnTexObjectX.SetAccessibleRelationMemberOf(&aFLTexture); + aBtnTexParallelX.SetAccessibleRelationMemberOf(&aFLTexture); + aBtnTexCircleX.SetAccessibleRelationMemberOf(&aFLTexture); + aBtnTexObjectY.SetAccessibleRelationMemberOf(&aFLTexture); + aBtnTexParallelY.SetAccessibleRelationMemberOf(&aFLTexture); + aBtnTexCircleY.SetAccessibleRelationMemberOf(&aFLTexture); + aBtnTexFilter.SetAccessibleRelationMemberOf(&aFLTexture); + + aBtnMatColor.SetAccessibleRelationMemberOf(&aFLMaterial); + aBtnEmissionColor.SetAccessibleRelationMemberOf(&aFLMaterial); + + aBtnSpecularColor.SetAccessibleRelationMemberOf(&aFLMatSpecular); } // ----------------------------------------------------------------------- diff --git a/svx/source/engine3d/float3d.src b/svx/source/engine3d/float3d.src index 1947fead5556..c75ab16e19c2 100644 --- a/svx/source/engine3d/float3d.src +++ b/svx/source/engine3d/float3d.src @@ -1438,53 +1438,10 @@ String RID_SVXFLOAT3D_FIX_B Text [ en-US ] = "B:"; }; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +// IAccessibility2 implementation 2009. ------ +String STR_COLOR_LIGHT_PRE +{ + Text [ en-US ] = "Color Light Preview"; +}; +// ------ IAccessibility2 implementation 2009. diff --git a/svx/source/fmcomp/fmgridif.cxx b/svx/source/fmcomp/fmgridif.cxx index 47aeceda995b..0dce12e13cfb 100644 --- a/svx/source/fmcomp/fmgridif.cxx +++ b/svx/source/fmcomp/fmgridif.cxx @@ -365,7 +365,8 @@ Reference< XInterface > SAL_CALL FmXGridControl_NewInstance_Impl(const Reference DBG_NAME(FmXGridControl ) //------------------------------------------------------------------------------ FmXGridControl::FmXGridControl(const Reference< XMultiServiceFactory >& _rxFactory) - :m_aModifyListeners(*this, GetMutex()) + :UnoControl( _rxFactory) + ,m_aModifyListeners(*this, GetMutex()) ,m_aUpdateListeners(*this, GetMutex()) ,m_aContainerListeners(*this, GetMutex()) ,m_aSelectionListeners(*this, GetMutex()) diff --git a/svx/source/form/formcontroller.cxx b/svx/source/form/formcontroller.cxx index 528661d2abe4..6f6cdbf9c2a6 100644 --- a/svx/source/form/formcontroller.cxx +++ b/svx/source/form/formcontroller.cxx @@ -479,7 +479,10 @@ class FmXAutoControl: public UnoControl friend Reference< XInterface > SAL_CALL FmXAutoControl_NewInstance_Impl(); public: - FmXAutoControl(){} + FmXAutoControl( const ::comphelper::ComponentContext& i_context ) + :UnoControl( i_context.getLegacyServiceFactory() ) + { + } virtual ::rtl::OUString GetComponentServiceName() {return ::rtl::OUString::createFromAscii("Edit");} virtual void SAL_CALL createPeer( const Reference< XToolkit > & rxToolkit, const Reference< XWindowPeer > & rParentPeer ) throw( RuntimeException ); @@ -1451,7 +1454,7 @@ void FormController::toggleAutoFields(sal_Bool bAutoFields) && ::comphelper::getBOOL( xField->getPropertyValue( FM_PROP_AUTOINCREMENT ) ) ) { - replaceControl( xControl, new FmXAutoControl ); + replaceControl( xControl, new FmXAutoControl( m_aContext ) ); } } } diff --git a/svx/source/gallery2/galbrws1.cxx b/svx/source/gallery2/galbrws1.cxx index dfa4eaad4a9d..3704262833ed 100644 --- a/svx/source/gallery2/galbrws1.cxx +++ b/svx/source/gallery2/galbrws1.cxx @@ -41,6 +41,8 @@ #include <com/sun/star/util/DateTime.hpp> #include "gallery.hrc" #include <algorithm> +#include <svx/dialogs.hrc> +#include <svx/dialmgr.hxx> #include <svx/svxdlg.hxx> //CHINA001 //CHINA001 #include <svx/dialogs.hrc> //CHINA001 @@ -162,6 +164,7 @@ GalleryBrowser1::GalleryBrowser1( GalleryBrowser* pParent, const ResId& rResId, mpThemes->SetHelpId( HID_GALLERY_THEMELIST ); mpThemes->SetSelectHdl( LINK( this, GalleryBrowser1, SelectThemeHdl ) ); + mpThemes->SetAccessibleName(String(SVX_RES( RID_SVXSTR_GALLERYPROPS_GALTHEME ) ) ); for( sal_uIntPtr i = 0, nCount = mpGallery->GetThemeCount(); i < nCount; i++ ) ImplInsertThemeEntry( mpGallery->GetThemeInfo( i ) ); diff --git a/svx/source/gallery2/galbrws2.cxx b/svx/source/gallery2/galbrws2.cxx index 98e4d69ee84e..2fff76ba0c76 100644 --- a/svx/source/gallery2/galbrws2.cxx +++ b/svx/source/gallery2/galbrws2.cxx @@ -54,8 +54,9 @@ #include "gallery.hrc" #include <vcl/svapp.hxx> #include <svx/fmmodel.hxx> -#include <svx/svxdlg.hxx> //CHINA001 -//CHINA001 #include <svx/dialogs.hrc> //CHINA001 +#include <svx/dialmgr.hxx> +#include <svx/svxdlg.hxx> +#include <svx/dialogs.hrc> // ----------- // - Defines - @@ -338,6 +339,9 @@ GalleryBrowser2::GalleryBrowser2( GalleryBrowser* pParent, const ResId& rResId, maViewBox.SetSelectHdl( LINK( this, GalleryBrowser2, SelectTbxHdl ) ); maViewBox.Show(); + mpIconView->SetAccessibleName(String( SVX_RES( RID_SVXSTR_GALLERY_THEMEITEMS ) )); + mpListView->SetAccessibleName(String( SVX_RES( RID_SVXSTR_GALLERY_THEMEITEMS ) )); + maInfoBar.Show(); maSeparator.Show(); @@ -347,6 +351,12 @@ GalleryBrowser2::GalleryBrowser2( GalleryBrowser* pParent, const ResId& rResId, InitSettings(); SetMode( ( GALLERYBROWSERMODE_PREVIEW != GalleryBrowser2::meInitMode ) ? GalleryBrowser2::meInitMode : GALLERYBROWSERMODE_ICON ); + + if(maInfoBar.GetText().Len() == 0) + mpIconView->SetAccessibleRelationLabeledBy(mpIconView); + else + mpIconView->SetAccessibleRelationLabeledBy(&maInfoBar); + mpIconView->SetAccessibleRelationMemberOf(mpIconView); } // ----------------------------------------------------------------------------- @@ -641,6 +651,10 @@ void GalleryBrowser2::SelectTheme( const String& rThemeName ) mpListView = new GalleryListView( this, mpCurTheme ); mpPreview = new GalleryPreview( this, mpCurTheme ); + mpIconView->SetAccessibleName(String( SVX_RES( RID_SVXSTR_GALLERY_THEMEITEMS ) )); + mpListView->SetAccessibleName(String( SVX_RES( RID_SVXSTR_GALLERY_THEMEITEMS ) )); + mpPreview->SetAccessibleName(String( SVX_RES( RID_SVXSTR_GALLERY_PREVIEW ) )); + const Link aSelectHdl( LINK( this, GalleryBrowser2, SelectObjectHdl ) ); mpIconView->SetSelectHdl( aSelectHdl ); @@ -655,6 +669,12 @@ void GalleryBrowser2::SelectTheme( const String& rThemeName ) maViewBox.EnableItem( TBX_ID_ICON, sal_True ); maViewBox.EnableItem( TBX_ID_LIST, sal_True ); maViewBox.CheckItem( ( GALLERYBROWSERMODE_ICON == GetMode() ) ? TBX_ID_ICON : TBX_ID_LIST, sal_True ); + + if(maInfoBar.GetText().Len() == 0) + mpIconView->SetAccessibleRelationLabeledBy(mpIconView); + else + mpIconView->SetAccessibleRelationLabeledBy(&maInfoBar); + mpIconView->SetAccessibleRelationMemberOf(mpIconView); } // ----------------------------------------------------------------------------- diff --git a/svx/source/gallery2/gallery.src b/svx/source/gallery2/gallery.src index 39ee6e0e6b1b..8179367cd53d 100644 --- a/svx/source/gallery2/gallery.src +++ b/svx/source/gallery2/gallery.src @@ -409,85 +409,3 @@ Menu RID_SVXMN_GALLERY2 }; }; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/svx/source/items/chrtitem.cxx b/svx/source/items/chrtitem.cxx index 114ce405bb69..944a520eb648 100644 --- a/svx/source/items/chrtitem.cxx +++ b/svx/source/items/chrtitem.cxx @@ -52,7 +52,6 @@ using namespace ::com::sun::star; TYPEINIT1_FACTORY(SvxChartStyleItem, SfxEnumItem, new SvxChartStyleItem(CHSTYLE_2D_LINE, 0)); TYPEINIT1(SvxChartDataDescrItem, SfxEnumItem); -TYPEINIT1(SvxChartLegendPosItem, SfxEnumItem); TYPEINIT1(SvxChartTextOrderItem, SfxEnumItem); TYPEINIT1(SvxChartTextOrientItem, SfxEnumItem); TYPEINIT1(SvxChartIndicateItem, SfxEnumItem); @@ -127,39 +126,6 @@ SfxPoolItem* SvxChartDataDescrItem::Create(SvStream& rIn, sal_uInt16 /*nVer*/) c /************************************************************************* |* -|* SvxChartLegendPosItem -|* -*************************************************************************/ - -SvxChartLegendPosItem::SvxChartLegendPosItem(SvxChartLegendPos eLegendPos, - sal_uInt16 nId) : - SfxEnumItem(nId, (sal_uInt16)eLegendPos) -{ -} - -// ----------------------------------------------------------------------- - -SvxChartLegendPosItem::SvxChartLegendPosItem(SvStream& rIn, sal_uInt16 nId) : - SfxEnumItem(nId, rIn) -{ -} - -// ----------------------------------------------------------------------- - -SfxPoolItem* SvxChartLegendPosItem::Clone(SfxItemPool* /*pPool*/) const -{ - return new SvxChartLegendPosItem(*this); -} - -// ----------------------------------------------------------------------- - -SfxPoolItem* SvxChartLegendPosItem::Create(SvStream& rIn, sal_uInt16 /*nVer*/) const -{ - return new SvxChartLegendPosItem(rIn, Which()); -} - -/************************************************************************* -|* |* SvxChartTextOrderItem |* *************************************************************************/ diff --git a/svx/source/svdraw/svdstr.src b/svx/source/svdraw/svdstr.src index 6690d4a7618b..6c80ba2c383a 100644 --- a/svx/source/svdraw/svdstr.src +++ b/svx/source/svdraw/svdstr.src @@ -2865,76 +2865,14 @@ Bitmap SIP_SA_ACCESSIBILITY_CROP_MARKERS File = "cropmarkersACC.bmp"; }; -// ******************************************************************* EOF - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +//IAccessibility2 Implementation 2009----- +String STR_ObjNameSingulFONTWORK +{ + Text [ en-US ] = "font work" ; +}; +String STR_ObjNamePluralFONTWORK +{ + Text [ en-US ] = "font works" ; +}; +//-----IAccessibility2 Implementation 2009 diff --git a/svx/source/tbxctrls/colrctrl.cxx b/svx/source/tbxctrls/colrctrl.cxx index b712bcfe04d2..884a1ac14d3c 100644 --- a/svx/source/tbxctrls/colrctrl.cxx +++ b/svx/source/tbxctrls/colrctrl.cxx @@ -113,6 +113,7 @@ SvxColorValueSet::SvxColorValueSet( Window* _pParent, WinBits nWinStyle ) : DragSourceHelper( this ), bLeft (sal_True) { + SetAccessibleName(String( SVX_RES( STR_COLORTABLE ) ) ); } /************************************************************************* @@ -126,6 +127,7 @@ SvxColorValueSet::SvxColorValueSet( Window* _pParent, const ResId& rResId ) : DragSourceHelper( this ), bLeft (sal_True) { + SetAccessibleName(String( SVX_RES( STR_COLORTABLE ) )); } /************************************************************************* diff --git a/svx/source/tbxctrls/colrctrl.src b/svx/source/tbxctrls/colrctrl.src index 023c271c5455..1fdd6df6a39b 100644 --- a/svx/source/tbxctrls/colrctrl.src +++ b/svx/source/tbxctrls/colrctrl.src @@ -53,32 +53,11 @@ DockingWindow RID_SVXCTRL_COLOR Border = FALSE ; }; }; - // ********************************************************************** EOF - - - - - - - - - - - - - - - - - - - - - - - - - - +// IAccessibility2 implementation 2009. ------ +String STR_COLORTABLE +{ + Text [ en-US ] = "Color Palette" ; +}; +// ------ IAccessibility2 implementation 2009. diff --git a/svx/source/tbxctrls/fontworkgallery.cxx b/svx/source/tbxctrls/fontworkgallery.cxx index 416dc09ca157..403ef97f6319 100644 --- a/svx/source/tbxctrls/fontworkgallery.cxx +++ b/svx/source/tbxctrls/fontworkgallery.cxx @@ -83,8 +83,8 @@ const int nLineCount = 4; \************************************************************************/ FontWorkGalleryDialog::FontWorkGalleryDialog( SdrView* pSdrView, Window* pParent, sal_uInt16 /*nSID*/ ) : ModalDialog( pParent, SVX_RES( RID_SVX_MDLG_FONTWORK_GALLERY ) ), - maCtlFavorites ( this, SVX_RES( CTL_FAVORITES ) ), maFLFavorites ( this, SVX_RES( FL_FAVORITES ) ), + maCtlFavorites ( this, SVX_RES( CTL_FAVORITES ) ), maOKButton ( this, SVX_RES( BTN_OK ) ), maCancelButton ( this, SVX_RES( BTN_CANCEL ) ), maHelpButton ( this, SVX_RES( BTN_HELP ) ), diff --git a/svx/source/tbxctrls/tbcontrl.cxx b/svx/source/tbxctrls/tbcontrl.cxx index 5a4362592738..ad97a61900fa 100644 --- a/svx/source/tbxctrls/tbcontrl.cxx +++ b/svx/source/tbxctrls/tbcontrl.cxx @@ -856,6 +856,7 @@ SvxColorWindow_Impl::SvxColorWindow_Impl( const OUString& rCommand, { aColorSet.SetStyle( aColorSet.GetStyle() | WB_NONEFIELD ); aColorSet.SetText( SVX_RESSTR( RID_SVXSTR_TRANSPARENT ) ); + aColorSet.SetAccessibleName( SVX_RESSTR( RID_SVXSTR_BACKGROUND ) ); } else if ( SID_ATTR_CHAR_COLOR == theSlotId || SID_ATTR_CHAR_COLOR2 == theSlotId || SID_EXTRUSION_3D_COLOR == theSlotId ) { @@ -870,8 +871,13 @@ SvxColorWindow_Impl::SvxColorWindow_Impl( const OUString& rCommand, { aColorSet.SetStyle( aColorSet.GetStyle() | WB_NONEFIELD ); aColorSet.SetText( SVX_RESSTR( RID_SVXSTR_AUTOMATIC ) ); + aColorSet.SetAccessibleName( SVX_RESSTR( RID_SVXSTR_TEXTCOLOR ) ); } } + else + { + aColorSet.SetAccessibleName( SVX_RESSTR( RID_SVXSTR_FRAME_COLOR ) ); + } if ( pColorTable ) { @@ -1092,6 +1098,7 @@ SvxFrameWindow_Impl::SvxFrameWindow_Impl( sal_uInt16 nId, const Reference< XFram SetHelpId( HID_POPUP_FRAME ); SetText( SVX_RESSTR(RID_SVXSTR_FRAME) ); + aFrameSet.SetAccessibleName( SVX_RESSTR(RID_SVXSTR_FRAME) ); aFrameSet.Show(); } /*-- 22.09.2004 12:27:50--------------------------------------------------- @@ -1348,6 +1355,7 @@ SvxLineWindow_Impl::SvxLineWindow_Impl( sal_uInt16 nId, const Reference< XFrame aLineSet.SetSelectHdl( LINK( this, SvxLineWindow_Impl, SelectHdl ) ); aLineSet.SetText( SVX_RESSTR(STR_NONE) ); + aLineSet.SetAccessibleName( SVX_RESSTR(RID_SVXSTR_FRAME_STYLE) ); lcl_CalcSizeValueSet( *this, aLineSet, aBmpSize ); SetHelpId( HID_POPUP_LINE ); diff --git a/svx/source/tbxctrls/tbcontrl.src b/svx/source/tbxctrls/tbcontrl.src index f3e068f56226..f49966e9ae17 100644 --- a/svx/source/tbxctrls/tbcontrl.src +++ b/svx/source/tbxctrls/tbcontrl.src @@ -185,5 +185,11 @@ String RID_SVXSTR_MORE Text [ en-US ] = "More..."; }; +//IAccessibility2 Implementation 2009----- +String RID_SVXSTR_TEXTCOLOR +{ + Text [ en-US ] = "Font color"; +}; +//-----IAccessibility2 Implementation 2009 // ********************************************************************** EOF diff --git a/sysui/prj/build.lst b/sysui/prj/build.lst index 1530997a3ec3..b5f26eb936b9 100644 --- a/sysui/prj/build.lst +++ b/sysui/prj/build.lst @@ -1,4 +1,4 @@ -su sysui : l10n offapi xml2cmp rdbmaker l10ntools setup_native NULL +su sysui : L10N:l10n offapi xml2cmp rdbmaker l10ntools setup_native NULL su sysui\source\win32\QuickStart nmake - w su_win32_quickstart NULL su sysui\source\win32\QuickStart\so nmake - w su_win32_quickstart_so su_win32_quickstart.w NULL su sysui\desktop\icons nmake - w su_iconsw NULL diff --git a/ucb/source/ucp/tdoc/tdoc_docmgr.cxx b/ucb/source/ucp/tdoc/tdoc_docmgr.cxx index 46aa1ae69ec3..5bd774d618d5 100644 --- a/ucb/source/ucp/tdoc/tdoc_docmgr.cxx +++ b/ucb/source/ucp/tdoc/tdoc_docmgr.cxx @@ -27,14 +27,11 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_ucb.hxx" + /************************************************************************** TODO ************************************************************************** - - filter unwanted models notified by global document event broadcaster - - help documents - - others, which I don't know yet - *************************************************************************/ #include "osl/diagnose.h" @@ -44,12 +41,13 @@ #include "comphelper/namedvaluecollection.hxx" #include "comphelper/documentinfo.hxx" +#include "com/sun/star/awt/XTopWindow.hpp" #include "com/sun/star/beans/XPropertySet.hpp" #include "com/sun/star/container/XEnumerationAccess.hpp" +#include "com/sun/star/document/XStorageBasedDocument.hpp" #include "com/sun/star/frame/XStorable.hpp" #include "com/sun/star/lang/DisposedException.hpp" -#include "com/sun/star/document/XStorageBasedDocument.hpp" -#include "com/sun/star/awt/XTopWindow.hpp" +#include "com/sun/star/util/XCloseBroadcaster.hpp" #include "tdoc_docmgr.hxx" @@ -60,6 +58,53 @@ using ::comphelper::DocumentInfo; //========================================================================= //========================================================================= // +// OfficeDocumentsCloseListener Implementation. +// +//========================================================================= +//========================================================================= + +//========================================================================= +// +// util::XCloseListener +// +//========================================================================= + +// virtual +void SAL_CALL OfficeDocumentsManager::OfficeDocumentsCloseListener::queryClosing( + const lang::EventObject& /*Source*/, sal_Bool /*GetsOwnership*/ ) + throw ( util::CloseVetoException, + uno::RuntimeException ) +{ +} + +//========================================================================= +void SAL_CALL OfficeDocumentsManager::OfficeDocumentsCloseListener::notifyClosing( + const lang::EventObject& Source ) + throw ( uno::RuntimeException ) +{ + document::EventObject aDocEvent; + aDocEvent.Source = Source.Source; + aDocEvent.EventName = rtl::OUString( + RTL_CONSTASCII_USTRINGPARAM( "OfficeDocumentsListener::notifyClosing" ) ); + m_pManager->notifyEvent( aDocEvent ); +} + +//========================================================================= +// +// lang::XEventListener (base of util::XCloseListener) +// +//========================================================================= + +// virtual +void SAL_CALL OfficeDocumentsManager::OfficeDocumentsCloseListener::disposing( + const lang::EventObject& /*Source*/ ) + throw ( uno::RuntimeException ) +{ +} + +//========================================================================= +//========================================================================= +// // OfficeDocumentsManager Implementation. // //========================================================================= @@ -70,7 +115,8 @@ OfficeDocumentsManager::OfficeDocumentsManager( OfficeDocumentsEventListener * pDocEventListener ) : m_xSMgr( xSMgr ), m_xDocEvtNotifier( createDocumentEventNotifier( xSMgr ) ), - m_pDocEventListener( pDocEventListener ) + m_pDocEventListener( pDocEventListener ), + m_xDocCloseListener( new OfficeDocumentsCloseListener( this ) ) { if ( m_xDocEvtNotifier.is() ) { @@ -188,10 +234,19 @@ void SAL_CALL OfficeDocumentsManager::notifyEvent( OSL_ENSURE( xStorage.is(), "Got no document storage!" ); rtl:: OUString aDocId = getDocumentId( Event.Source ); - rtl:: OUString aTitle = DocumentInfo::getDocumentTitle( uno::Reference< frame::XModel >( Event.Source, uno::UNO_QUERY ) ); + rtl:: OUString aTitle = DocumentInfo::getDocumentTitle( + uno::Reference< frame::XModel >( Event.Source, uno::UNO_QUERY ) ); m_aDocs[ aDocId ] = StorageInfo( aTitle, xStorage, xModel ); + uno::Reference< util::XCloseBroadcaster > xCloseBroadcaster( + Event.Source, uno::UNO_QUERY ); + OSL_ENSURE( xCloseBroadcaster.is(), + "OnLoadFinished/OnCreate event: got no close broadcaster!" ); + + if ( xCloseBroadcaster.is() ) + xCloseBroadcaster->addCloseListener( m_xDocCloseListener ); + // Propagate document closure. OSL_ENSURE( m_pDocEventListener, "OnLoadFinished/OnCreate event: no owner for insert event propagation!" ); @@ -202,12 +257,18 @@ void SAL_CALL OfficeDocumentsManager::notifyEvent( } } else if ( Event.EventName.equalsAsciiL( - RTL_CONSTASCII_STRINGPARAM( "OnUnload" ) ) ) + RTL_CONSTASCII_STRINGPARAM( "OfficeDocumentsListener::notifyClosing" ) ) ) { if ( isOfficeDocument( Event.Source ) ) { // Document has been closed (unloaded) + // #163732# - Official event "OnUnload" does not work here. Event + // gets fired to early. Other OnUnload listeners called after this + // listener may still need TDOC access to the document. Remove the + // document from TDOC docs list on XCloseListener::notifyClosing. + // See OfficeDocumentsManager::OfficeDocumentsListener::notifyClosing. + osl::MutexGuard aGuard( m_aMtx ); uno::Reference< frame::XModel > @@ -228,8 +289,6 @@ void SAL_CALL OfficeDocumentsManager::notifyEvent( rtl::OUString aDocId( (*it).first ); m_pDocEventListener->notifyDocumentClosed( aDocId ); } - - break; } ++it; @@ -238,8 +297,18 @@ void SAL_CALL OfficeDocumentsManager::notifyEvent( OSL_ENSURE( it != m_aDocs.end(), "OnUnload event notified for unknown document!" ); - if( it != m_aDocs.end() ) + if ( it != m_aDocs.end() ) + { + uno::Reference< util::XCloseBroadcaster > xCloseBroadcaster( + Event.Source, uno::UNO_QUERY ); + OSL_ENSURE( xCloseBroadcaster.is(), + "OnUnload event: got no XCloseBroadcaster from XModel" ); + + if ( xCloseBroadcaster.is() ) + xCloseBroadcaster->removeCloseListener( m_xDocCloseListener ); + m_aDocs.erase( it ); + } } } else if ( Event.EventName.equalsAsciiL( @@ -307,7 +376,7 @@ void SAL_CALL OfficeDocumentsManager::notifyEvent( (*it).second.xStorage = xStorage; // Adjust title. - (*it).second.aTitle = DocumentInfo::getDocumentTitle( uno::Reference< frame::XModel >( Event.Source, uno::UNO_QUERY ) ); + (*it).second.aTitle = DocumentInfo::getDocumentTitle( xModel ); break; } ++it; @@ -334,7 +403,7 @@ void SAL_CALL OfficeDocumentsManager::notifyEvent( if ( (*it).second.xModel == xModel ) { // Adjust title. - rtl:: OUString aTitle = DocumentInfo::getDocumentTitle( uno::Reference< frame::XModel >( Event.Source, uno::UNO_QUERY ) ); + rtl:: OUString aTitle = DocumentInfo::getDocumentTitle( xModel ); (*it).second.aTitle = aTitle; // Adjust storage. @@ -475,6 +544,14 @@ void OfficeDocumentsManager::buildDocumentsList() m_aDocs[ aDocId ] = StorageInfo( aTitle, xStorage, xModel ); + + uno::Reference< util::XCloseBroadcaster > xCloseBroadcaster( + xModel, uno::UNO_QUERY ); + OSL_ENSURE( xCloseBroadcaster.is(), + "buildDocumentsList: got no close broadcaster!" ); + + if ( xCloseBroadcaster.is() ) + xCloseBroadcaster->addCloseListener( m_xDocCloseListener ); } } } diff --git a/ucb/source/ucp/tdoc/tdoc_docmgr.hxx b/ucb/source/ucp/tdoc/tdoc_docmgr.hxx index 8f8b2fc117f0..b1c0ed41d9d9 100644 --- a/ucb/source/ucp/tdoc/tdoc_docmgr.hxx +++ b/ucb/source/ucp/tdoc/tdoc_docmgr.hxx @@ -39,6 +39,7 @@ #include "com/sun/star/embed/XStorage.hpp" #include "com/sun/star/frame/XModel.hpp" #include "com/sun/star/frame/XModuleManager.hpp" +#include "com/sun/star/util/XCloseListener.hpp" namespace tdoc_ucp { @@ -88,6 +89,33 @@ namespace tdoc_ucp { class OfficeDocumentsManager : public cppu::WeakImplHelper1< com::sun::star::document::XEventListener > { + class OfficeDocumentsCloseListener : + public cppu::WeakImplHelper1< com::sun::star::util::XCloseListener > + + { + public: + OfficeDocumentsCloseListener( OfficeDocumentsManager * pMgr ) + : m_pManager( pMgr ) {}; + + // util::XCloseListener + virtual void SAL_CALL queryClosing( + const ::com::sun::star::lang::EventObject& Source, + ::sal_Bool GetsOwnership ) + throw (::com::sun::star::util::CloseVetoException, + ::com::sun::star::uno::RuntimeException); + + virtual void SAL_CALL notifyClosing( + const ::com::sun::star::lang::EventObject& Source ) + throw (::com::sun::star::uno::RuntimeException); + + // lang::XEventListener (base of util::XCloseListener) + virtual void SAL_CALL disposing( + const com::sun::star::lang::EventObject & Source ) + throw ( com::sun::star::uno::RuntimeException ); + private: + OfficeDocumentsManager * m_pManager; + }; + public: OfficeDocumentsManager( const com::sun::star::uno::Reference< @@ -131,7 +159,9 @@ namespace tdoc_ucp { createDocumentEventNotifier( const com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory >& rXSMgr ); + void buildDocumentsList(); + bool isOfficeDocument( const com::sun::star::uno::Reference< @@ -163,9 +193,11 @@ namespace tdoc_ucp { com::sun::star::uno::Reference< com::sun::star::document::XEventBroadcaster > m_xDocEvtNotifier; com::sun::star::uno::Reference< - com::sun::star::frame::XModuleManager > m_xModuleMgr; + com::sun::star::frame::XModuleManager > m_xModuleMgr; DocumentList m_aDocs; OfficeDocumentsEventListener * m_pDocEventListener; + com::sun::star::uno::Reference< + com::sun::star::util::XCloseListener > m_xDocCloseListener; }; } // namespace tdoc_ucp diff --git a/uui/prj/build.lst b/uui/prj/build.lst index 6816f8416bdf..b4a009cd0b9e 100644 --- a/uui/prj/build.lst +++ b/uui/prj/build.lst @@ -1,4 +1,4 @@ -uu uui : l10n vcl svtools LIBXSLT:libxslt NULL +uu uui : L10N:l10n vcl svtools LIBXSLT:libxslt NULL uu uui usr1 - all uu_mkout NULL uu uui\source nmake - all uu_source NULL uu uui\util nmake - all uu_util uu_source NULL diff --git a/vbahelper/source/vbahelper/vbaapplicationbase.cxx b/vbahelper/source/vbahelper/vbaapplicationbase.cxx index bddd756f6836..54d280094f2c 100644 --- a/vbahelper/source/vbahelper/vbaapplicationbase.cxx +++ b/vbahelper/source/vbahelper/vbaapplicationbase.cxx @@ -50,6 +50,7 @@ #include <basic/sbuno.hxx> #include <basic/sbmeth.hxx> #include <basic/sbmod.hxx> +#include <basic/vbahelper.hxx> #include "vbacommandbars.hxx" @@ -200,10 +201,8 @@ void SAL_CALL VbaApplicationBase::setScreenUpdating(sal_Bool bUpdate) throw (uno::RuntimeException) { uno::Reference< frame::XModel > xModel( getCurrentDocument(), uno::UNO_QUERY_THROW ); - if (bUpdate) - xModel->unlockControllers(); - else - xModel->lockControllers(); + // #163808# use helper from module "basic" to lock all documents of this application + ::basic::vba::lockControllersOfAllDocuments( xModel, !bUpdate ); } sal_Bool SAL_CALL @@ -262,10 +261,8 @@ void SAL_CALL VbaApplicationBase::setInteractive( ::sal_Bool bInteractive ) throw (uno::RuntimeException) { uno::Reference< frame::XModel > xModel( getCurrentDocument(), uno::UNO_QUERY_THROW ); - uno::Reference< frame::XFrame > xFrame( xModel->getCurrentController()->getFrame(), uno::UNO_QUERY_THROW ); - uno::Reference< awt::XWindow > xWindow( xFrame->getContainerWindow(), uno::UNO_SET_THROW ); - - xWindow->setEnable( bInteractive ); + // #163808# use helper from module "basic" to enable/disable all container windows of all documents of this application + ::basic::vba::enableContainerWindowsOfAllDocuments( xModel, bInteractive ); } sal_Bool SAL_CALL VbaApplicationBase::getVisible() throw (uno::RuntimeException) diff --git a/vbahelper/source/vbahelper/vbadocumentbase.cxx b/vbahelper/source/vbahelper/vbadocumentbase.cxx index 0df38b003556..087e7188c8f6 100644 --- a/vbahelper/source/vbahelper/vbadocumentbase.cxx +++ b/vbahelper/source/vbahelper/vbadocumentbase.cxx @@ -86,11 +86,14 @@ VbaDocumentBase::getName() throw (uno::RuntimeException) ::rtl::OUString VbaDocumentBase::getPath() throw (uno::RuntimeException) { - INetURLObject aURL( getModel()->getURL() ); - rtl::OUString sURL( aURL.GetMainURL( INetURLObject::DECODE_TO_IURI ) ); - sURL = sURL.copy( 0, sURL.getLength() - aURL.GetLastName().getLength() - 1 ); - rtl::OUString sPath; - ::osl::File::getSystemPathFromFileURL( sURL, sPath ); + INetURLObject aURL( getModel()->getURL() ); + rtl::OUString sURL = aURL.GetMainURL( INetURLObject::DECODE_TO_IURI ); + rtl::OUString sPath; + if( sURL.getLength() > 0 ) + { + sURL = sURL.copy( 0, sURL.getLength() - aURL.GetLastName().getLength() - 1 ); + ::osl::File::getSystemPathFromFileURL( sURL, sPath ); + } return sPath; } diff --git a/vbahelper/source/vbahelper/vbadocumentsbase.cxx b/vbahelper/source/vbahelper/vbadocumentsbase.cxx index f2b70ab231c7..b65a58542b92 100644 --- a/vbahelper/source/vbahelper/vbadocumentsbase.cxx +++ b/vbahelper/source/vbahelper/vbadocumentsbase.cxx @@ -24,7 +24,9 @@ * for a copy of the LGPLv3 License. * ************************************************************************/ -#include <vbahelper/vbadocumentsbase.hxx> + +#include "vbahelper/vbadocumentsbase.hxx" + #include <comphelper/mediadescriptor.hxx> #include <comphelper/processfactory.hxx> #include <cppuhelper/implbase1.hxx> @@ -49,10 +51,12 @@ #include <com/sun/star/lang/XServiceInfo.hpp> #include <sfx2/objsh.hxx> #include <tools/urlobj.hxx> -#include <vbahelper/vbahelper.hxx> #include <hash_map> #include <osl/file.hxx> +#include "vbahelper/vbahelper.hxx" +#include "vbahelper/vbaapplicationbase.hxx" + using namespace ::ooo::vba; using namespace ::com::sun::star; @@ -213,8 +217,39 @@ VbaDocumentsBase::VbaDocumentsBase( const uno::Reference< XHelperInterface >& xP { } +namespace { + +void lclSetupComponent( const uno::Reference< lang::XComponent >& rxComponent, sal_Bool bScreenUpdating, sal_Bool bInteractive ) +{ + if( !bScreenUpdating ) try + { + uno::Reference< frame::XModel >( rxComponent, uno::UNO_QUERY_THROW )->lockControllers(); + } + catch( uno::Exception& ) + { + } + + if( !bInteractive ) try + { + uno::Reference< frame::XModel > xModel( rxComponent, uno::UNO_QUERY_THROW ); + uno::Reference< frame::XController > xController( xModel->getCurrentController(), uno::UNO_SET_THROW ); + uno::Reference< frame::XFrame > xFrame( xController->getFrame(), uno::UNO_SET_THROW ); + uno::Reference< awt::XWindow >( xFrame->getContainerWindow(), uno::UNO_SET_THROW )->setEnable( sal_False ); + } + catch( uno::Exception& ) + { + } +} + +} // namespace + uno::Any VbaDocumentsBase::createDocument() throw (uno::RuntimeException) { + // #163808# determine state of Application.ScreenUpdating and Application.Interactive symbols (before new document is opened) + uno::Reference< XApplicationBase > xApplication( Application(), uno::UNO_QUERY ); + sal_Bool bScreenUpdating = !xApplication.is() || xApplication->getScreenUpdating(); + sal_Bool bInteractive = !xApplication.is() || xApplication->getInteractive(); + uno::Reference< lang::XMultiComponentFactory > xSMgr( mxContext->getServiceManager(), uno::UNO_QUERY_THROW ); @@ -240,6 +275,10 @@ uno::Any VbaDocumentsBase::createDocument() throw (uno::RuntimeException) sURL , rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("_blank") ), 0, aMediaDesc.getAsConstPropertyValueList() ); + + // #163808# lock document controllers and container window if specified by application + lclSetupComponent( xComponent, bScreenUpdating, bInteractive ); + return uno::makeAny( xComponent ); } @@ -259,6 +298,11 @@ void VbaDocumentsBase::closeDocuments() throw (uno::RuntimeException) // #TODO# #FIXME# can any of the unused params below be used? uno::Any VbaDocumentsBase::openDocument( const rtl::OUString& rFileName, const uno::Any& ReadOnly, const uno::Sequence< beans::PropertyValue >& rProps ) throw (uno::RuntimeException) { + // #163808# determine state of Application.ScreenUpdating and Application.Interactive symbols (before new document is opened) + uno::Reference< XApplicationBase > xApplication( Application(), uno::UNO_QUERY ); + sal_Bool bScreenUpdating = !xApplication.is() || xApplication->getScreenUpdating(); + sal_Bool bInteractive = !xApplication.is() || xApplication->getInteractive(); + // we need to detect if this is a URL, if not then assume its a file path rtl::OUString aURL; INetURLObject aObj; @@ -282,19 +326,16 @@ uno::Any VbaDocumentsBase::openDocument( const rtl::OUString& rFileName, const u uno::Sequence< beans::PropertyValue > sProps( rProps ); sProps.realloc( sProps.getLength() + 1 ); sProps[ sProps.getLength() - 1 ].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("MacroExecutionMode") ); - sProps[ sProps.getLength() - 1 ].Value <<= uno::makeAny( document::MacroExecMode::ALWAYS_EXECUTE_NO_WARN ); - - sal_Int32 nIndex = sProps.getLength() - 1; + sProps[ sProps.getLength() - 1 ].Value <<= document::MacroExecMode::ALWAYS_EXECUTE_NO_WARN; if ( ReadOnly.hasValue() ) { sal_Bool bIsReadOnly = sal_False; ReadOnly >>= bIsReadOnly; if ( bIsReadOnly ) { - static const rtl::OUString sReadOnly( RTL_CONSTASCII_USTRINGPARAM("ReadOnly") ); sProps.realloc( sProps.getLength() + 1 ); - sProps[ nIndex ].Name = sReadOnly; - sProps[ nIndex++ ].Value = uno::makeAny( (sal_Bool)sal_True ); + sProps[ sProps.getLength() - 1 ].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ReadOnly") ); + sProps[ sProps.getLength() - 1 ].Value <<= true; } } @@ -302,6 +343,10 @@ uno::Any VbaDocumentsBase::openDocument( const rtl::OUString& rFileName, const u rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("_default") ), frame::FrameSearchFlag::CREATE, sProps); + + // #163808# lock document controllers and container window if specified by application + lclSetupComponent( xComponent, bScreenUpdating, bInteractive ); + return uno::makeAny( xComponent ); } diff --git a/xmloff/Library_xo.mk b/xmloff/Library_xo.mk index 9576341f0ffb..0544171dbfbd 100644 --- a/xmloff/Library_xo.mk +++ b/xmloff/Library_xo.mk @@ -69,8 +69,10 @@ $(eval $(call gb_Library_add_exception_objects,xo,\ xmloff/source/chart/SchXMLAxisContext \ xmloff/source/chart/SchXMLCalculationSettingsContext \ xmloff/source/chart/SchXMLChartContext \ + xmloff/source/chart/SchXMLEnumConverter \ xmloff/source/chart/SchXMLExport \ xmloff/source/chart/SchXMLImport \ + xmloff/source/chart/SchXMLLegendContext \ xmloff/source/chart/SchXMLParagraphContext \ xmloff/source/chart/SchXMLPlotAreaContext \ xmloff/source/chart/SchXMLSeries2Context \ diff --git a/xmloff/inc/SchXMLImport.hxx b/xmloff/inc/SchXMLImport.hxx index 936217fb8dc5..6b11e885f72e 100644 --- a/xmloff/inc/SchXMLImport.hxx +++ b/xmloff/inc/SchXMLImport.hxx @@ -127,14 +127,6 @@ enum SchXMLPlotAreaAttrTokenMap XML_TOK_PA_LIGHTING_MODE }; -enum SchXMLLegendAttrMap -{ - XML_TOK_LEGEND_POSITION, - XML_TOK_LEGEND_X, - XML_TOK_LEGEND_Y, - XML_TOK_LEGEND_STYLE_NAME -}; - enum SchXMLAutoStyleAttrMap { XML_TOK_AS_FAMILY, diff --git a/xmloff/inc/xmloff/SchXMLImportHelper.hxx b/xmloff/inc/xmloff/SchXMLImportHelper.hxx index a618d363137f..afc637aead74 100644 --- a/xmloff/inc/xmloff/SchXMLImportHelper.hxx +++ b/xmloff/inc/xmloff/SchXMLImportHelper.hxx @@ -83,7 +83,6 @@ private: SvXMLTokenMap* mpChartAttrTokenMap; SvXMLTokenMap* mpPlotAreaAttrTokenMap; - SvXMLTokenMap* mpLegendAttrTokenMap; SvXMLTokenMap* mpAutoStyleAttrTokenMap; SvXMLTokenMap* mpCellAttrTokenMap; SvXMLTokenMap* mpSeriesAttrTokenMap; @@ -124,7 +123,6 @@ public: const SvXMLTokenMap& GetChartAttrTokenMap(); const SvXMLTokenMap& GetPlotAreaAttrTokenMap(); - const SvXMLTokenMap& GetLegendAttrTokenMap(); const SvXMLTokenMap& GetAutoStyleAttrTokenMap(); const SvXMLTokenMap& GetCellAttrTokenMap(); const SvXMLTokenMap& GetSeriesAttrTokenMap(); diff --git a/xmloff/inc/xmloff/xmltoken.hxx b/xmloff/inc/xmloff/xmltoken.hxx index ecadbbdc196f..ca321245fdb2 100644 --- a/xmloff/inc/xmloff/xmltoken.hxx +++ b/xmloff/inc/xmloff/xmltoken.hxx @@ -3113,6 +3113,12 @@ namespace xmloff { namespace token { XML_OUTSIDE_MINIMUM,//#i114142# XML_OUTSIDE_MAXIMUM,//#i114142# + XML_LEGEND_EXPANSION, //#i28760# + XML_LEGEND_EXPANSION_ASPECT_RATIO, //#i28760# + XML_BALANCED, //#i28760# + XML_HIGH, //#i28760# + XML_WIDE, //#i28760# + XML_AXIS_TYPE, //#i25706# XML_DATE_SCALE, XML_BASE_TIME_UNIT, diff --git a/xmloff/source/chart/SchXMLChartContext.cxx b/xmloff/source/chart/SchXMLChartContext.cxx index 6b42b2e629df..9f9d1cf2bb1d 100644 --- a/xmloff/source/chart/SchXMLChartContext.cxx +++ b/xmloff/source/chart/SchXMLChartContext.cxx @@ -30,6 +30,7 @@ #include "SchXMLChartContext.hxx" #include "SchXMLImport.hxx" +#include "SchXMLLegendContext.hxx" #include "SchXMLPlotAreaContext.hxx" #include "SchXMLParagraphContext.hxx" #include "SchXMLTableContext.hxx" @@ -52,7 +53,6 @@ #include <com/sun/star/chart/XChartDocument.hpp> #include <com/sun/star/chart/XDiagram.hpp> #include <com/sun/star/xml/sax/XAttributeList.hpp> -#include <com/sun/star/chart/ChartLegendPosition.hpp> #include <com/sun/star/util/XStringMapping.hpp> #include <com/sun/star/drawing/XDrawPageSupplier.hpp> #include <com/sun/star/drawing/XDrawPage.hpp> @@ -60,7 +60,6 @@ #include <com/sun/star/awt/PosSize.hpp> #include <com/sun/star/embed/Aspects.hpp> #include <com/sun/star/embed/XVisualObject.hpp> -#include <com/sun/star/drawing/FillStyle.hpp> #include <com/sun/star/chart2/XChartDocument.hpp> #include <com/sun/star/chart2/data/XDataSink.hpp> @@ -234,19 +233,6 @@ uno::Sequence< sal_Int32 > lcl_getNumberSequenceFromString( const ::rtl::OUStrin } // anonymous namespace -static __FAR_DATA SvXMLEnumMapEntry aXMLLegendAlignmentMap[] = -{ -// { XML_LEFT, chart::ChartLegendPosition_LEFT }, - // #i35421# - { XML_START, chart::ChartLegendPosition_LEFT }, - { XML_TOP, chart::ChartLegendPosition_TOP }, -// { XML_RIGHT, chart::ChartLegendPosition_RIGHT }, - // #i35421# - { XML_END, chart::ChartLegendPosition_RIGHT }, - { XML_BOTTOM, chart::ChartLegendPosition_BOTTOM }, - { XML_TOKEN_INVALID, 0 } -}; - // ---------------------------------------- SchXMLChartContext::SchXMLChartContext( SchXMLImportHelper& rImpHelper, @@ -1273,115 +1259,3 @@ SvXMLImportContext* SchXMLTitleContext::CreateChildContext( } // ---------------------------------------- - -SchXMLLegendContext::SchXMLLegendContext( SchXMLImportHelper& rImpHelper, - SvXMLImport& rImport, const rtl::OUString& rLocalName ) : - SvXMLImportContext( rImport, XML_NAMESPACE_CHART, rLocalName ), - mrImportHelper( rImpHelper ) -{ -} - -void SchXMLLegendContext::StartElement( const uno::Reference< xml::sax::XAttributeList >& xAttrList ) -{ - uno::Reference< chart::XChartDocument > xDoc = mrImportHelper.GetChartDocument(); - if( ! xDoc.is()) - return; - - // turn on legend - uno::Reference< beans::XPropertySet > xDocProp( xDoc, uno::UNO_QUERY ); - if( xDocProp.is()) - { - uno::Any aTrueBool; - aTrueBool <<= (sal_Bool)(sal_True); - try - { - xDocProp->setPropertyValue( rtl::OUString::createFromAscii( "HasLegend" ), aTrueBool ); - } - catch( beans::UnknownPropertyException ) - { - DBG_ERROR( "Property HasLegend not found" ); - } - } - - // parse attributes - sal_Int16 nAttrCount = xAttrList.is()? xAttrList->getLength(): 0; - const SvXMLTokenMap& rAttrTokenMap = mrImportHelper.GetLegendAttrTokenMap(); - - awt::Point aLegendPos; - bool bHasXPosition=false; - bool bHasYPosition=false; - - rtl::OUString sAutoStyleName; - - for( sal_Int16 i = 0; i < nAttrCount; i++ ) - { - rtl::OUString sAttrName = xAttrList->getNameByIndex( i ); - rtl::OUString aLocalName; - rtl::OUString aValue = xAttrList->getValueByIndex( i ); - sal_uInt16 nPrefix = GetImport().GetNamespaceMap().GetKeyByAttrName( sAttrName, &aLocalName ); - - switch( rAttrTokenMap.Get( nPrefix, aLocalName )) - { - case XML_TOK_LEGEND_POSITION: - { - // set anchor position - uno::Reference< beans::XPropertySet > xProp( xDoc->getLegend(), uno::UNO_QUERY ); - if( xProp.is()) - { - try - { - sal_uInt16 nEnumVal; - if( GetImport().GetMM100UnitConverter().convertEnum( nEnumVal, aValue, aXMLLegendAlignmentMap )) - { - uno::Any aAny; - aAny <<= (chart::ChartLegendPosition)(nEnumVal); - xProp->setPropertyValue( rtl::OUString::createFromAscii( "Alignment" ), aAny ); - } - } - catch( beans::UnknownPropertyException ) - { - DBG_ERROR( "Property Alignment (legend) not found" ); - } - } - } - break; - - case XML_TOK_LEGEND_X: - GetImport().GetMM100UnitConverter().convertMeasure( aLegendPos.X, aValue ); - bHasXPosition = true; - break; - case XML_TOK_LEGEND_Y: - GetImport().GetMM100UnitConverter().convertMeasure( aLegendPos.Y, aValue ); - bHasYPosition = true; - break; - case XML_TOK_LEGEND_STYLE_NAME: - sAutoStyleName = aValue; - } - } - - uno::Reference< drawing::XShape > xLegendShape( xDoc->getLegend(), uno::UNO_QUERY ); - if( xLegendShape.is() && bHasXPosition && bHasYPosition ) - xLegendShape->setPosition( aLegendPos ); - - // set auto-styles for Legend - uno::Reference< beans::XPropertySet > xProp( xLegendShape, uno::UNO_QUERY ); - if( xProp.is()) - { - // the fill style has the default "none" in XML, but "solid" in the model. - xProp->setPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "FillStyle" )), - uno::makeAny( drawing::FillStyle_NONE )); - const SvXMLStylesContext* pStylesCtxt = mrImportHelper.GetAutoStylesContext(); - if( pStylesCtxt ) - { - const SvXMLStyleContext* pStyle = pStylesCtxt->FindStyleChildContext( - mrImportHelper.GetChartFamilyID(), sAutoStyleName ); - - if( pStyle && pStyle->ISA( XMLPropStyleContext )) - (( XMLPropStyleContext* )pStyle )->FillPropertySet( xProp ); - } - } -} - -SchXMLLegendContext::~SchXMLLegendContext() -{ -} diff --git a/xmloff/source/chart/SchXMLChartContext.hxx b/xmloff/source/chart/SchXMLChartContext.hxx index 41f84f783a67..e34b50c4f62d 100644 --- a/xmloff/source/chart/SchXMLChartContext.hxx +++ b/xmloff/source/chart/SchXMLChartContext.hxx @@ -171,19 +171,4 @@ public: const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList >& xAttrList ); }; -// ---------------------------------------- - -class SchXMLLegendContext : public SvXMLImportContext -{ -private: - SchXMLImportHelper& mrImportHelper; - -public: - SchXMLLegendContext( SchXMLImportHelper& rImpHelper, - SvXMLImport& rImport, const rtl::OUString& rLocalName ); - virtual ~SchXMLLegendContext(); - - virtual void StartElement( const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList >& xAttrList ); -}; - #endif // _SCH_XMLCHARTCONTEXT_HXX_ diff --git a/xmloff/source/chart/SchXMLEnumConverter.cxx b/xmloff/source/chart/SchXMLEnumConverter.cxx new file mode 100644 index 000000000000..fd4d7914a2fe --- /dev/null +++ b/xmloff/source/chart/SchXMLEnumConverter.cxx @@ -0,0 +1,104 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +// MARKER(update_precomp.py): autogen include statement, do not remove +#include "precompiled_xmloff.hxx" +#include "SchXMLEnumConverter.hxx" + +#include <com/sun/star/chart/ChartLegendPosition.hpp> +#include <com/sun/star/chart/ChartLegendExpansion.hpp> +#include <com/sun/star/uno/Any.hxx> + +// header for rtl::Static +#include <rtl/instance.hxx> + +using ::rtl::OUString; +using namespace ::xmloff::token; +using namespace ::com::sun::star; + +namespace +{ +//----------------------------------------------------------------------- + +SvXMLEnumMapEntry aXMLLegendPositionEnumMap[] = +{ + { XML_START, chart::ChartLegendPosition_LEFT }, + { XML_TOP, chart::ChartLegendPosition_TOP }, + { XML_END, chart::ChartLegendPosition_RIGHT }, + { XML_BOTTOM, chart::ChartLegendPosition_BOTTOM }, + { XML_TOKEN_INVALID, 0 } +}; + +class XMLLegendPositionPropertyHdl : public XMLEnumPropertyHdl +{ +public: + XMLLegendPositionPropertyHdl() + : XMLEnumPropertyHdl( aXMLLegendPositionEnumMap, ::getCppuType((const chart::ChartLegendPosition*)0) ) {} + virtual ~XMLLegendPositionPropertyHdl() {}; +}; + +struct TheLegendPositionPropertyHdl : public rtl::Static< XMLLegendPositionPropertyHdl, TheLegendPositionPropertyHdl > +{ +}; + +//----------------------------------------------------------------------- + +SvXMLEnumMapEntry aXMLLegendExpansionEnumMap[] = +{ + { XML_WIDE, chart::ChartLegendExpansion_WIDE }, + { XML_HIGH, chart::ChartLegendExpansion_HIGH }, + { XML_BALANCED, chart::ChartLegendExpansion_BALANCED }, + { XML_CUSTOM, chart::ChartLegendExpansion_CUSTOM }, + { XML_TOKEN_INVALID, 0 } +}; + +class XMLLegendExpansionPropertyHdl : public XMLEnumPropertyHdl +{ +public: + XMLLegendExpansionPropertyHdl() + : XMLEnumPropertyHdl( aXMLLegendExpansionEnumMap, ::getCppuType((const chart::ChartLegendExpansion*)0) ) {} + virtual ~XMLLegendExpansionPropertyHdl() {}; +}; + +struct TheLegendExpansionPropertyHdl : public rtl::Static< XMLLegendExpansionPropertyHdl, TheLegendExpansionPropertyHdl > +{ +}; + +//----------------------------------------------------------------------- + +}//end anonymous namespace + +//----------------------------------------------------------------------- + +XMLEnumPropertyHdl& SchXMLEnumConverter::getLegendPositionConverter() +{ + return TheLegendPositionPropertyHdl::get(); +} +XMLEnumPropertyHdl& SchXMLEnumConverter::getLegendExpansionConverter() +{ + return TheLegendExpansionPropertyHdl::get(); +} diff --git a/xmloff/source/chart/SchXMLEnumConverter.hxx b/xmloff/source/chart/SchXMLEnumConverter.hxx new file mode 100644 index 000000000000..63a9fb7ffb95 --- /dev/null +++ b/xmloff/source/chart/SchXMLEnumConverter.hxx @@ -0,0 +1,39 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ +#ifndef _XML_CHART_ENUM_CONVERTER_HXX_ +#define _XML_CHART_ENUM_CONVERTER_HXX_ + +#include <xmloff/EnumPropertyHdl.hxx> + +class SchXMLEnumConverter +{ +public: + static XMLEnumPropertyHdl& getLegendPositionConverter();//returns a singleton + static XMLEnumPropertyHdl& getLegendExpansionConverter();//returns a singleton +}; + +#endif // _XML_CHART_ENUM_CONVERTER_HXX_ diff --git a/xmloff/source/chart/SchXMLExport.cxx b/xmloff/source/chart/SchXMLExport.cxx index cc13eb2de733..c74abe953d2f 100644 --- a/xmloff/source/chart/SchXMLExport.cxx +++ b/xmloff/source/chart/SchXMLExport.cxx @@ -35,6 +35,8 @@ #include "SchXMLSeriesHelper.hxx" #include "ColorPropertySet.hxx" #include "SchXMLTools.hxx" +#include "SchXMLEnumConverter.hxx" + #include <tools/debug.hxx> #include <rtl/logfile.hxx> #include <comphelper/processfactory.hxx> @@ -68,6 +70,7 @@ #include <com/sun/star/chart/XAxisSupplier.hpp> #include <com/sun/star/chart/XChartDocument.hpp> #include <com/sun/star/chart/ChartLegendPosition.hpp> +#include <com/sun/star/chart/ChartLegendExpansion.hpp> #include <com/sun/star/chart/ChartDataRowSource.hpp> #include <com/sun/star/chart/ChartAxisAssign.hpp> #include <com/sun/star/chart/ChartAxisType.hpp> @@ -245,8 +248,8 @@ public: void addPosition( const ::com::sun::star::awt::Point & rPosition ); void addPosition( com::sun::star::uno::Reference< com::sun::star::drawing::XShape > xShape ); /// add svg size as attribute for current element - void addSize( const ::com::sun::star::awt::Size & rSize ); - void addSize( com::sun::star::uno::Reference< com::sun::star::drawing::XShape > xShape ); + void addSize( const ::com::sun::star::awt::Size & rSize, bool bIsOOoNamespace = false ); + void addSize( com::sun::star::uno::Reference< com::sun::star::drawing::XShape > xShape, bool bIsOOoNamespace = false ); /// fills the member msString with the appropriate String (i.e. "A3") void getCellAddress( sal_Int32 nCol, sal_Int32 nRow ); /// exports a string as a paragraph element @@ -1427,51 +1430,50 @@ void SchXMLExportHelper_Impl::parseDocument( Reference< chart::XChartDocument >& Reference< beans::XPropertySet > xProp( rChartDoc->getLegend(), uno::UNO_QUERY ); if( xProp.is()) { - chart::ChartLegendPosition aLegendPos = chart::ChartLegendPosition_NONE; + // export legend anchor position try { - Any aAny( xProp->getPropertyValue( - OUString( RTL_CONSTASCII_USTRINGPARAM( "Alignment" )))); - aAny >>= aLegendPos; + Any aAny( xProp->getPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "Alignment" )))); + if( SchXMLEnumConverter::getLegendPositionConverter().exportXML( msString, aAny, mrExport.GetMM100UnitConverter() ) ) + mrExport.AddAttribute( XML_NAMESPACE_CHART, XML_LEGEND_POSITION, msString ); } catch( beans::UnknownPropertyException & ) { DBG_WARNING( "Property Align not found in ChartLegend" ); } - switch( aLegendPos ) + // export absolute legend position + Reference< drawing::XShape > xLegendShape( xProp, uno::UNO_QUERY ); + addPosition( xLegendShape ); + + // export legend size + const SvtSaveOptions::ODFDefaultVersion nCurrentODFVersion( SvtSaveOptions().GetODFDefaultVersion() ); + if( xLegendShape.is() && nCurrentODFVersion >= SvtSaveOptions::ODFVER_012 && nCurrentODFVersion == SvtSaveOptions::ODFVER_LATEST )//do not export legend-expansion to ODF 1.0 and export size only if extensions are enabled //#i28670# todo: change this dependent on fileformat evolution { - case chart::ChartLegendPosition_LEFT: -// msString = GetXMLToken(XML_LEFT); - // #i35421# change left->start (not clear why this was done) - msString = GetXMLToken(XML_START); - break; - case chart::ChartLegendPosition_RIGHT: -// msString = GetXMLToken(XML_RIGHT); - // #i35421# change right->end (not clear why this was done) - msString = GetXMLToken(XML_END); - break; - case chart::ChartLegendPosition_TOP: - msString = GetXMLToken(XML_TOP); - break; - case chart::ChartLegendPosition_BOTTOM: - msString = GetXMLToken(XML_BOTTOM); - break; - case chart::ChartLegendPosition_NONE: - case chart::ChartLegendPosition_MAKE_FIXED_SIZE: - // nothing - break; + try + { + chart::ChartLegendExpansion nLegendExpansion = chart::ChartLegendExpansion_HIGH; + OUString aExpansionString; + Any aAny( xProp->getPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "Expansion" )))); + bool bHasExpansion = (aAny >>= nLegendExpansion); + if( bHasExpansion && SchXMLEnumConverter::getLegendExpansionConverter().exportXML( aExpansionString, aAny, mrExport.GetMM100UnitConverter() ) ) + { + mrExport.AddAttribute( XML_NAMESPACE_STYLE, XML_LEGEND_EXPANSION, aExpansionString ); + if( nLegendExpansion == chart::ChartLegendExpansion_CUSTOM) + { + awt::Size aSize( xLegendShape->getSize() ); + addSize( aSize, true ); + rtl::OUStringBuffer aAspectRatioString; + SvXMLUnitConverter::convertDouble(aAspectRatioString, double(aSize.Width)/double(aSize.Height)); + mrExport.AddAttribute( XML_NAMESPACE_STYLE, XML_LEGEND_EXPANSION_ASPECT_RATIO, aAspectRatioString.makeStringAndClear() ); + } + } + } + catch( beans::UnknownPropertyException & ) + { + DBG_WARNING( "Property Expansion not found in ChartLegend" ); + } } - - // export anchor position - if( msString.getLength()) - mrExport.AddAttribute( XML_NAMESPACE_CHART, XML_LEGEND_POSITION, msString ); - - // export absolute position - msString = OUString(); - Reference< drawing::XShape > xShape( xProp, uno::UNO_QUERY ); - if( xShape.is()) - addPosition( xShape ); } // write style name @@ -3535,21 +3537,22 @@ void SchXMLExportHelper_Impl::addPosition( Reference< drawing::XShape > xShape ) addPosition( xShape->getPosition()); } -void SchXMLExportHelper_Impl::addSize( const awt::Size & rSize ) +void SchXMLExportHelper_Impl::addSize( const awt::Size & rSize, bool bIsOOoNamespace) { mrExport.GetMM100UnitConverter().convertMeasure( msStringBuffer, rSize.Width ); msString = msStringBuffer.makeStringAndClear(); - mrExport.AddAttribute( XML_NAMESPACE_SVG, XML_WIDTH, msString ); + mrExport.AddAttribute( bIsOOoNamespace ? XML_NAMESPACE_CHART_EXT : XML_NAMESPACE_SVG , XML_WIDTH, msString ); + - mrExport.GetMM100UnitConverter().convertMeasure( msStringBuffer, rSize.Height ); + mrExport.GetMM100UnitConverter().convertMeasure( msStringBuffer, rSize.Height); msString = msStringBuffer.makeStringAndClear(); - mrExport.AddAttribute( XML_NAMESPACE_SVG, XML_HEIGHT, msString ); + mrExport.AddAttribute( bIsOOoNamespace ? XML_NAMESPACE_CHART_EXT : XML_NAMESPACE_SVG, XML_HEIGHT, msString ); } -void SchXMLExportHelper_Impl::addSize( Reference< drawing::XShape > xShape ) +void SchXMLExportHelper_Impl::addSize( Reference< drawing::XShape > xShape, bool bIsOOoNamespace ) { if( xShape.is()) - addSize( xShape->getSize() ); + addSize( xShape->getSize(), bIsOOoNamespace ); } awt::Size SchXMLExportHelper_Impl::getPageSize( const Reference< chart2::XChartDocument > & xChartDoc ) const diff --git a/xmloff/source/chart/SchXMLImport.cxx b/xmloff/source/chart/SchXMLImport.cxx index a033dcb60e7d..12bea7e50e1b 100644 --- a/xmloff/source/chart/SchXMLImport.cxx +++ b/xmloff/source/chart/SchXMLImport.cxx @@ -146,7 +146,6 @@ SchXMLImportHelper::SchXMLImportHelper() : mpChartAttrTokenMap( 0 ), mpPlotAreaAttrTokenMap( 0 ), - mpLegendAttrTokenMap( 0 ), mpAutoStyleAttrTokenMap( 0 ), mpCellAttrTokenMap( 0 ), mpSeriesAttrTokenMap( 0 ), @@ -172,8 +171,6 @@ SchXMLImportHelper::~SchXMLImportHelper() delete mpChartAttrTokenMap; if( mpPlotAreaAttrTokenMap ) delete mpPlotAreaAttrTokenMap; - if( mpLegendAttrTokenMap ) - delete mpLegendAttrTokenMap; if( mpAutoStyleAttrTokenMap ) delete mpAutoStyleAttrTokenMap; if( mpCellAttrTokenMap ) @@ -371,25 +368,6 @@ const SvXMLTokenMap& SchXMLImportHelper::GetPlotAreaAttrTokenMap() return *mpPlotAreaAttrTokenMap; } -const SvXMLTokenMap& SchXMLImportHelper::GetLegendAttrTokenMap() -{ - if( ! mpLegendAttrTokenMap ) - { - static __FAR_DATA SvXMLTokenMapEntry aLegendAttrTokenMap[] = -{ - { XML_NAMESPACE_CHART, XML_LEGEND_POSITION, XML_TOK_LEGEND_POSITION }, - { XML_NAMESPACE_SVG, XML_X, XML_TOK_LEGEND_X }, - { XML_NAMESPACE_SVG, XML_Y, XML_TOK_LEGEND_Y }, - { XML_NAMESPACE_CHART, XML_STYLE_NAME, XML_TOK_LEGEND_STYLE_NAME }, - XML_TOKEN_MAP_END -}; - - mpLegendAttrTokenMap = new SvXMLTokenMap( aLegendAttrTokenMap ); - } // if( ! mpLegendAttrTokenMap ) - - return *mpLegendAttrTokenMap; -} - const SvXMLTokenMap& SchXMLImportHelper::GetAutoStyleAttrTokenMap() { if( ! mpAutoStyleAttrTokenMap ) diff --git a/xmloff/source/chart/SchXMLLegendContext.cxx b/xmloff/source/chart/SchXMLLegendContext.cxx new file mode 100644 index 000000000000..6220fdfca46a --- /dev/null +++ b/xmloff/source/chart/SchXMLLegendContext.cxx @@ -0,0 +1,229 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +// MARKER(update_precomp.py): autogen include statement, do not remove +#include "precompiled_xmloff.hxx" +#include "SchXMLLegendContext.hxx" +#include "SchXMLEnumConverter.hxx" + +#include <xmloff/xmlnmspe.hxx> +#include <xmloff/xmlement.hxx> +#include <xmloff/prstylei.hxx> +#include <xmloff/nmspmap.hxx> +#include <xmloff/xmluconv.hxx> + +#include <tools/debug.hxx> + +#include <com/sun/star/chart/ChartLegendPosition.hpp> +#include <com/sun/star/chart/ChartLegendExpansion.hpp> +#include <com/sun/star/drawing/FillStyle.hpp> + +using namespace ::xmloff::token; +using namespace com::sun::star; + +using rtl::OUString; +using com::sun::star::uno::Reference; + +//---------------------------------------- + +namespace +{ + +enum LegendAttributeTokens +{ + XML_TOK_LEGEND_POSITION, + XML_TOK_LEGEND_X, + XML_TOK_LEGEND_Y, + XML_TOK_LEGEND_STYLE_NAME, + XML_TOK_LEGEND_EXPANSION, + XML_TOK_LEGEND_EXPANSION_ASPECT_RATIO, + XML_TOK_LEGEND_WIDTH, + XML_TOK_LEGEND_WIDTH_EXT, + XML_TOK_LEGEND_HEIGHT, + XML_TOK_LEGEND_HEIGHT_EXT +}; + +SvXMLTokenMapEntry aLegendAttributeTokenMap[] = +{ + { XML_NAMESPACE_CHART, XML_LEGEND_POSITION, XML_TOK_LEGEND_POSITION }, + { XML_NAMESPACE_SVG, XML_X, XML_TOK_LEGEND_X }, + { XML_NAMESPACE_SVG, XML_Y, XML_TOK_LEGEND_Y }, + { XML_NAMESPACE_CHART, XML_STYLE_NAME, XML_TOK_LEGEND_STYLE_NAME }, + { XML_NAMESPACE_STYLE, XML_LEGEND_EXPANSION, XML_TOK_LEGEND_EXPANSION }, + { XML_NAMESPACE_STYLE, XML_LEGEND_EXPANSION_ASPECT_RATIO, XML_TOK_LEGEND_EXPANSION_ASPECT_RATIO }, + { XML_NAMESPACE_SVG, XML_WIDTH, XML_TOK_LEGEND_WIDTH }, + { XML_NAMESPACE_CHART_EXT, XML_WIDTH, XML_TOK_LEGEND_WIDTH_EXT }, + { XML_NAMESPACE_SVG, XML_HEIGHT, XML_TOK_LEGEND_HEIGHT }, + { XML_NAMESPACE_CHART_EXT, XML_HEIGHT, XML_TOK_LEGEND_HEIGHT_EXT }, + XML_TOKEN_MAP_END +}; + +class LegendAttributeTokenMap : public SvXMLTokenMap +{ +public: + LegendAttributeTokenMap(): SvXMLTokenMap( aLegendAttributeTokenMap ) {} + virtual ~LegendAttributeTokenMap() {} +}; + +//a LegendAttributeTokenMap Singleton +struct theLegendAttributeTokenMap : public rtl::Static< LegendAttributeTokenMap, theLegendAttributeTokenMap > {}; + +}//end anonymous namespace + +//---------------------------------------- + +SchXMLLegendContext::SchXMLLegendContext( SchXMLImportHelper& rImpHelper, SvXMLImport& rImport, const rtl::OUString& rLocalName ) : + SvXMLImportContext( rImport, XML_NAMESPACE_CHART, rLocalName ), + mrImportHelper( rImpHelper ) +{ +} + +void SchXMLLegendContext::StartElement( const uno::Reference< xml::sax::XAttributeList >& xAttrList ) +{ + uno::Reference< chart::XChartDocument > xDoc = mrImportHelper.GetChartDocument(); + if( !xDoc.is() ) + return; + + // turn on legend + uno::Reference< beans::XPropertySet > xDocProp( xDoc, uno::UNO_QUERY ); + if( xDocProp.is() ) + { + try + { + xDocProp->setPropertyValue( rtl::OUString::createFromAscii( "HasLegend" ), uno::makeAny( sal_True ) ); + } + catch( beans::UnknownPropertyException ) + { + DBG_ERROR( "Property HasLegend not found" ); + } + } + + uno::Reference< drawing::XShape > xLegendShape( xDoc->getLegend(), uno::UNO_QUERY ); + uno::Reference< beans::XPropertySet > xLegendProps( xLegendShape, uno::UNO_QUERY ); + if( !xLegendShape.is() || !xLegendProps.is() ) + { + DBG_ERROR( "legend could not be created" ); + return; + } + + // parse attributes + sal_Int16 nAttrCount = xAttrList.is()? xAttrList->getLength(): 0; + const SvXMLTokenMap& rAttrTokenMap = theLegendAttributeTokenMap::get(); + + awt::Point aLegendPos; + bool bHasXPosition=false; + bool bHasYPosition=false; + awt::Size aLegendSize; + bool bHasWidth=false; + bool bHasHeight=false; + chart::ChartLegendExpansion nLegendExpansion = chart::ChartLegendExpansion_HIGH; + bool bHasExpansion=false; + + rtl::OUString sAutoStyleName; + uno::Any aAny; + + for( sal_Int16 i = 0; i < nAttrCount; i++ ) + { + rtl::OUString sAttrName = xAttrList->getNameByIndex( i ); + rtl::OUString aLocalName; + rtl::OUString aValue = xAttrList->getValueByIndex( i ); + sal_uInt16 nPrefix = GetImport().GetNamespaceMap().GetKeyByAttrName( sAttrName, &aLocalName ); + + switch( rAttrTokenMap.Get( nPrefix, aLocalName )) + { + case XML_TOK_LEGEND_POSITION: + { + try + { + if( SchXMLEnumConverter::getLegendPositionConverter().importXML( aValue, aAny, GetImport().GetMM100UnitConverter() ) ) + xLegendProps->setPropertyValue( rtl::OUString::createFromAscii( "Alignment" ), aAny ); + } + catch( beans::UnknownPropertyException ) + { + DBG_ERROR( "Property Alignment (legend) not found" ); + } + } + break; + + case XML_TOK_LEGEND_X: + GetImport().GetMM100UnitConverter().convertMeasure( aLegendPos.X, aValue ); + bHasXPosition = true; + break; + case XML_TOK_LEGEND_Y: + GetImport().GetMM100UnitConverter().convertMeasure( aLegendPos.Y, aValue ); + bHasYPosition = true; + break; + case XML_TOK_LEGEND_STYLE_NAME: + sAutoStyleName = aValue; + break; + case XML_TOK_LEGEND_EXPANSION: + SchXMLEnumConverter::getLegendPositionConverter().importXML( aValue, aAny, GetImport().GetMM100UnitConverter() ); + bHasExpansion = (aAny>>=nLegendExpansion); + break; + case XML_TOK_LEGEND_EXPANSION_ASPECT_RATIO: + break; + case XML_TOK_LEGEND_WIDTH: + case XML_TOK_LEGEND_WIDTH_EXT: + GetImport().GetMM100UnitConverter().convertMeasure( aLegendSize.Width, aValue ); + bHasWidth = true; + break; + case XML_TOK_LEGEND_HEIGHT: + case XML_TOK_LEGEND_HEIGHT_EXT: + GetImport().GetMM100UnitConverter().convertMeasure( aLegendSize.Height, aValue ); + bHasHeight = true; + break; + default: + break; + } + } + + if( bHasXPosition && bHasYPosition ) + xLegendShape->setPosition( aLegendPos ); + + if( bHasExpansion && nLegendExpansion!= chart::ChartLegendExpansion_CUSTOM ) + xLegendProps->setPropertyValue( rtl::OUString::createFromAscii( "Expansion" ), uno::makeAny(nLegendExpansion) ); + else if( bHasHeight && bHasWidth ) + xLegendShape->setSize( aLegendSize ); + + // the fill style has the default "none" in XML, but "solid" in the model. + xLegendProps->setPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "FillStyle" )), uno::makeAny( drawing::FillStyle_NONE )); + + // set auto-styles for Legend + const SvXMLStylesContext* pStylesCtxt = mrImportHelper.GetAutoStylesContext(); + if( pStylesCtxt ) + { + const SvXMLStyleContext* pStyle = pStylesCtxt->FindStyleChildContext( + mrImportHelper.GetChartFamilyID(), sAutoStyleName ); + + if( pStyle && pStyle->ISA( XMLPropStyleContext )) + (( XMLPropStyleContext* )pStyle )->FillPropertySet( xLegendProps ); + } +} + +SchXMLLegendContext::~SchXMLLegendContext() +{ +} diff --git a/xmloff/source/chart/SchXMLLegendContext.hxx b/xmloff/source/chart/SchXMLLegendContext.hxx new file mode 100644 index 000000000000..1841b0cef24b --- /dev/null +++ b/xmloff/source/chart/SchXMLLegendContext.hxx @@ -0,0 +1,46 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ +#ifndef _SCH_XMLLEGENDCONTEXT_HXX_ +#define _SCH_XMLLEGENDCONTEXT_HXX_ + +#include "SchXMLImport.hxx" + +// ---------------------------------------- + +class SchXMLLegendContext : public SvXMLImportContext +{ +public: + SchXMLLegendContext( SchXMLImportHelper& rImpHelper, SvXMLImport& rImport, const rtl::OUString& rLocalName ); + virtual ~SchXMLLegendContext(); + + virtual void StartElement( const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList >& xAttrList ); + +private: + SchXMLImportHelper& mrImportHelper; +}; + +#endif // _SCH_XMLLEGENDCONTEXT_HXX_ diff --git a/xmloff/source/chart/makefile.mk b/xmloff/source/chart/makefile.mk index 2f61a3d6f0e5..3151d633d13f 100644 --- a/xmloff/source/chart/makefile.mk +++ b/xmloff/source/chart/makefile.mk @@ -45,12 +45,14 @@ SLOFILES = $(SLO)$/ColorPropertySet.obj \ $(SLO)$/contexts.obj \ $(SLO)$/SchXMLTableContext.obj \ $(SLO)$/SchXMLChartContext.obj \ + $(SLO)$/SchXMLLegendContext.obj \ $(SLO)$/SchXMLPlotAreaContext.obj \ $(SLO)$/SchXMLAxisContext.obj \ $(SLO)$/SchXMLParagraphContext.obj \ $(SLO)$/SchXMLTextListContext.obj \ $(SLO)$/SchXMLSeriesHelper.obj \ $(SLO)$/SchXMLSeries2Context.obj \ + $(SLO)$/SchXMLEnumConverter.obj \ $(SLO)$/PropertyMaps.obj \ $(SLO)$/XMLChartStyleContext.obj \ $(SLO)$/XMLErrorIndicatorPropertyHdl.obj \ diff --git a/xmloff/source/core/xmltoken.cxx b/xmloff/source/core/xmltoken.cxx index 824d28a51a5c..bc1e40114c5f 100644 --- a/xmloff/source/core/xmltoken.cxx +++ b/xmloff/source/core/xmltoken.cxx @@ -3113,6 +3113,12 @@ namespace xmloff { namespace token { TOKEN( "outside-minimum", XML_OUTSIDE_MINIMUM ), TOKEN( "outside-maximum", XML_OUTSIDE_MAXIMUM ), + TOKEN( "legend-expansion", XML_LEGEND_EXPANSION), + TOKEN( "legend-expansion-aspect-ratio", XML_LEGEND_EXPANSION_ASPECT_RATIO), + TOKEN( "balanced", XML_BALANCED), + TOKEN( "high", XML_HIGH), + TOKEN( "wide", XML_WIDE), + TOKEN( "axis-type", XML_AXIS_TYPE ), //#i25706# TOKEN( "date-scale", XML_DATE_SCALE ), TOKEN( "base-time-unit", XML_BASE_TIME_UNIT ), |