diff options
author | Thomas Lange [tl] <tl@openoffice.org> | 2010-06-03 14:05:19 +0200 |
---|---|---|
committer | Thomas Lange [tl] <tl@openoffice.org> | 2010-06-03 14:05:19 +0200 |
commit | 59f61e9e122c701441c181f5b50adf2604971682 (patch) | |
tree | dad7d399656f199b902bf4a4ca25574992f7bcb8 /framework | |
parent | b1ec4b2cd5a9e6ece0e2a928cc0a11fef6bbe818 (diff) | |
parent | f8e7afbac976ca862a801b9648fd95b2107757b2 (diff) |
cws tl78: merge with DEV300_m80
Diffstat (limited to 'framework')
21 files changed, 218 insertions, 295 deletions
diff --git a/framework/inc/classes/xmlnamespaces.hxx b/framework/inc/classes/xmlnamespaces.hxx deleted file mode 100644 index 60a3de4b68ba..000000000000 --- a/framework/inc/classes/xmlnamespaces.hxx +++ /dev/null @@ -1,65 +0,0 @@ -/************************************************************************* - * - * 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 __FRAMEWORK_CLASSES_XMLNAMESPACES_HXX_ -#define __FRAMEWORK_CLASSES_XMLNAMESPACES_HXX_ - -#include <com/sun/star/xml/sax/SAXException.hpp> - -#include <map> - -namespace framework -{ - -class XMLNamespaces -{ - public: - XMLNamespaces(); - XMLNamespaces( const XMLNamespaces& ); - virtual ~XMLNamespaces(); - - void addNamespace( const ::rtl::OUString& aName, const ::rtl::OUString& aValue ) - throw( ::com::sun::star::xml::sax::SAXException ); - - ::rtl::OUString applyNSToAttributeName( const ::rtl::OUString& ) const - throw( ::com::sun::star::xml::sax::SAXException ); - ::rtl::OUString applyNSToElementName( const ::rtl::OUString& ) const - throw( ::com::sun::star::xml::sax::SAXException ); - - private: - typedef ::std::map< ::rtl::OUString, ::rtl::OUString > NamespaceMap; - - ::rtl::OUString getNamespaceValue( const ::rtl::OUString& aNamespace ) const - throw( ::com::sun::star::xml::sax::SAXException ); - - ::rtl::OUString m_aDefaultNamespace; - NamespaceMap m_aNamespaceMap; -}; - -} - -#endif // __FRAMEWORK_XMLNAMESPACES_HXX_ diff --git a/framework/inc/framework.hrc b/framework/inc/framework.hrc index e49192aa7c33..eea91edeaa07 100644 --- a/framework/inc/framework.hrc +++ b/framework/inc/framework.hrc @@ -51,19 +51,10 @@ #define STR_BACKING_CREATE 3 #define STR_BACKING_TEMPLATE 4 #define STR_BACKING_FILE 5 -#define BMP_BACKING_WRITER 6 -#define BMP_BACKING_CALC 7 -#define BMP_BACKING_IMPRESS 8 -#define BMP_BACKING_DRAW 9 -#define BMP_BACKING_DATABASE 10 -#define BMP_BACKING_FORMULA 11 -#define BMP_BACKING_OPENFILE 12 -#define BMP_BACKING_OPENTEMPLATE 13 -#define STR_BACKING_EXTHELP 15 -#define STR_BACKING_REGHELP 17 -#define STR_BACKING_INFOHELP 19 -#define STR_BACKING_TPLREP 21 -#define BMP_BACKING_FOLDER 22 +#define STR_BACKING_EXTHELP 6 +#define STR_BACKING_REGHELP 7 +#define STR_BACKING_INFOHELP 8 +#define STR_BACKING_TPLREP 9 #define RES_BACKING_IMAGES (DLG_BACKING+1) #define RES_BACKING_IMAGES_HC (DLG_BACKING+2) @@ -77,6 +68,14 @@ #define BMP_BACKING_REG 7 #define BMP_BACKING_INFO 8 #define BMP_BACKING_TPLREP 9 +#define BMP_BACKING_WRITER 10 +#define BMP_BACKING_CALC 11 +#define BMP_BACKING_IMPRESS 12 +#define BMP_BACKING_DRAW 13 +#define BMP_BACKING_DATABASE 14 +#define BMP_BACKING_FORMULA 15 +#define BMP_BACKING_OPENFILE 16 +#define BMP_BACKING_OPENTEMPLATE 17 // Ids of TabWindow #define WIN_TABWINDOW (RID_FWK_DIALOG_START+101) diff --git a/framework/inc/properties.h b/framework/inc/properties.h index f0358ef6f1a0..5a32a42a28cc 100644 --- a/framework/inc/properties.h +++ b/framework/inc/properties.h @@ -217,6 +217,14 @@ namespace framework{ #define UICOMMANDDESCRIPTION_NAMEACCESS_COMMANDROTATEIMAGELIST "private:resource/image/commandrotateimagelist" #define UICOMMANDDESCRIPTION_NAMEACCESS_COMMANDMIRRORIMAGELIST "private:resource/image/commandmirrorimagelist" +#define UICOMMANDDESCRIPTION_PROPNAME_PROPERTIES "Properties" +#define UICOMMANDDESCRIPTION_PROPNAME_POPUP "Popup" + +#define UICOMMANDDESCRIPTION_PROPERTIES_IMAGE 1 +#define UICOMMANDDESCRIPTION_PROPERTIES_IMAGE_MIRRORED 2 +#define UICOMMANDDESCRIPTION_PROPERTIES_IMAGE_ROTATED 4 +#define UICOMMANDDESCRIPTION_PROPERTIES_TOGGLEBUTTON 8 + //_______________________________________________ /** properties for "AutoRecovery" class */ diff --git a/framework/inc/uielement/toolbarmanager.hxx b/framework/inc/uielement/toolbarmanager.hxx index 98894b623aea..1be8579a4112 100644 --- a/framework/inc/uielement/toolbarmanager.hxx +++ b/framework/inc/uielement/toolbarmanager.hxx @@ -179,6 +179,8 @@ class ToolBarManager : public ::com::sun::star::frame::XFrameActionListener void RemoveControllers(); rtl::OUString RetrieveLabelFromCommand( const rtl::OUString& aCmdURL ); + sal_Int32 RetrievePropertiesFromCommand( const rtl::OUString& aCmdURL ); + ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > GetPropsForCommand( const ::rtl::OUString& rCmdURL ); void CreateControllers(); void UpdateControllers(); void AddFrameActionListener(); diff --git a/framework/inc/uielement/uicommanddescription.hxx b/framework/inc/uielement/uicommanddescription.hxx index d9f8e461c5b5..dd95981bba90 100644 --- a/framework/inc/uielement/uicommanddescription.hxx +++ b/framework/inc/uielement/uicommanddescription.hxx @@ -109,7 +109,7 @@ public: ModuleToCommandFileMap m_aModuleToCommandFileMap; UICommandsHashMap m_aUICommandsHashMap; ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > m_xGenericUICommands; - ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModuleManager > m_xModuleManager; + ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModuleManager > m_xModuleManager; }; } // namespace framework diff --git a/framework/inc/xml/toolboxlayoutdocumenthandler.hxx b/framework/inc/xml/toolboxlayoutdocumenthandler.hxx deleted file mode 100644 index 71a7843a0a9e..000000000000 --- a/framework/inc/xml/toolboxlayoutdocumenthandler.hxx +++ /dev/null @@ -1,59 +0,0 @@ -/************************************************************************* - * - * 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 __FRAMEWORK_XML_TOOLBOXLAYOUTDOCUMENTHANDLER_HXX_ -#define __FRAMEWORK_XML_TOOLBOXLAYOUTDOCUMENTHANDLER_HXX_ - -#include <xml/toolboxconfiguration.hxx> - -//_________________________________________________________________________________________________________________ -// interface includes -//_________________________________________________________________________________________________________________ - -#ifndef __COM_SUN_STAR_XML_SAX_XDOCUMENTHANDLER_HPP_ -#include <com/sun/star/xml/sax/XDocumentHandler.hpp> -#endif - -//_________________________________________________________________________________________________________________ -// other includes -//_________________________________________________________________________________________________________________ -#include <threadhelp/threadhelpbase.hxx> -#include <rtl/ustring.hxx> -#include <cppuhelper/weak.hxx> - -#include <hash_map> -#include <stdtypes.h> - -//_________________________________________________________________________________________________________________ -// namespace -//_________________________________________________________________________________________________________________ - -namespace framework{ - -} // namespace framework - -#endif diff --git a/framework/qa/unoapi/knownissues.xcl b/framework/qa/unoapi/knownissues.xcl index f939efcca412..40f1965de639 100755 --- a/framework/qa/unoapi/knownissues.xcl +++ b/framework/qa/unoapi/knownissues.xcl @@ -54,3 +54,6 @@ fwk.Frame ### i90345 ### fwk.URLTransformer::com::sun::star::util::XURLTransformer + +### i111180 ### +fwk.Desktop::com::sun::star::frame::XComponentLoader diff --git a/framework/source/services/backingwindow.cxx b/framework/source/services/backingwindow.cxx index 21c62fd89a54..e4d37d1fe059 100644 --- a/framework/source/services/backingwindow.cxx +++ b/framework/source/services/backingwindow.cxx @@ -133,7 +133,8 @@ BackingWindow::BackingWindow( Window* i_pParent ) : mbInitControls( false ), mnLayoutStyle( 0 ), mpAccExec( NULL ), - mnBtnPos( 120 ) + mnBtnPos( 120 ), + mnBtnTop( 150 ) { mnColumnWidth[0] = mnColumnWidth[1] = 0; mnTextColumnWidth[0] = mnTextColumnWidth[1] = 0; @@ -163,16 +164,6 @@ BackingWindow::BackingWindow( Window* i_pParent ) : { } - // get icon images from vcl resource and set them on the appropriate buttons - loadImage( FwkResId( BMP_BACKING_WRITER ), maWriterButton ); - loadImage( FwkResId( BMP_BACKING_CALC ), maCalcButton ); - loadImage( FwkResId( BMP_BACKING_IMPRESS ), maImpressButton ); - loadImage( FwkResId( BMP_BACKING_DRAW ), maDrawButton ); - loadImage( FwkResId( BMP_BACKING_DATABASE ), maDBButton ); - loadImage( FwkResId( BMP_BACKING_FORMULA ), maMathButton ); - loadImage( FwkResId( BMP_BACKING_FOLDER ), maOpenButton ); - loadImage( FwkResId( BMP_BACKING_FOLDER ), maTemplateButton ); - String aExtHelpText( FwkResId( STR_BACKING_EXTHELP ) ); String aRegHelpText( FwkResId( STR_BACKING_REGHELP ) ); String aInfoHelpText( FwkResId( STR_BACKING_INFOHELP ) ); @@ -187,10 +178,6 @@ BackingWindow::BackingWindow( Window* i_pParent ) : SetStyle( GetStyle() | WB_DIALOGCONTROL ); - // add some breathing space for the images - maButtonImageSize.Width() += 12; - maButtonImageSize.Height() += 12; - // force tab cycling in toolbox maToolbox.SetStyle( maToolbox.GetStyle() | WB_FORCETABCYCLE ); @@ -236,6 +223,11 @@ BackingWindow::BackingWindow( Window* i_pParent ) : // init background initBackground(); + + // add some breathing space for the images + maButtonImageSize.Width() += 12; + maButtonImageSize.Height() += 12; + } @@ -324,6 +316,17 @@ void BackingWindow::initBackground() else mnBtnPos = maBackgroundLeft.GetSizePixel().Width() + 40; } + + // get icon images from fwk resource and set them on the appropriate buttons + loadImage( FwkResId( BMP_BACKING_WRITER ), maWriterButton ); + loadImage( FwkResId( BMP_BACKING_CALC ), maCalcButton ); + loadImage( FwkResId( BMP_BACKING_IMPRESS ), maImpressButton ); + loadImage( FwkResId( BMP_BACKING_DRAW ), maDrawButton ); + loadImage( FwkResId( BMP_BACKING_DATABASE ), maDBButton ); + loadImage( FwkResId( BMP_BACKING_FORMULA ), maMathButton ); + loadImage( FwkResId( BMP_BACKING_OPENFILE ), maOpenButton ); + loadImage( FwkResId( BMP_BACKING_OPENTEMPLATE ), maTemplateButton ); + } void BackingWindow::initControls() @@ -550,7 +553,7 @@ void BackingWindow::layoutButton( long nTextWidth = i_rBtn.GetTextWidth( i_rBtn.GetText() ); - nTextWidth += maButtonImageSize.Width(); + nTextWidth += maButtonImageSize.Width() + 8; // add some fuzz to be on the safe side if( nColumn >= 0 && nColumn < static_cast<int>(sizeof(mnColumnWidth)/sizeof(mnColumnWidth[0])) ) { if( nTextWidth > mnColumnWidth[nColumn] ) @@ -733,6 +736,9 @@ void BackingWindow::Resize() nYPos += nWDelta/2 - nDiff; + if( mnLayoutStyle != 1 ) + nYPos = maControlRect.Top() + mnBtnTop; + maWriterButton.SetPosSizePixel( Point( maControlRect.Left() + mnBtnPos, nYPos ), Size( mnTextColumnWidth[0], maButtonImageSize.Height() ) ); maDrawButton.SetPosSizePixel( Point( maControlRect.Left() + mnBtnPos + mnColumnWidth[0], nYPos ), Size( mnTextColumnWidth[1], maButtonImageSize.Height() ) ); nYPos += nBDelta - nDiff; diff --git a/framework/source/services/backingwindow.hxx b/framework/source/services/backingwindow.hxx index 76a12a48b816..c4d4c9b0b76b 100644 --- a/framework/source/services/backingwindow.hxx +++ b/framework/source/services/backingwindow.hxx @@ -121,6 +121,7 @@ namespace framework sal_Int32 mnLayoutStyle; svt::AcceleratorExecute* mpAccExec; long mnBtnPos; + long mnBtnTop; static const int nItemId_Extensions = 1; static const int nItemId_Reg = 2; diff --git a/framework/source/services/fwk_services.src b/framework/source/services/fwk_services.src index 7e2ee3253e71..7ad8b4c3cede 100644 --- a/framework/source/services/fwk_services.src +++ b/framework/source/services/fwk_services.src @@ -53,34 +53,6 @@ Window DLG_BACKING { Text [ en-US ] = "~Open a document..."; }; - Bitmap BMP_BACKING_WRITER - { - File = "odt_32.png"; - }; - Bitmap BMP_BACKING_CALC - { - File = "ods_32.png"; - }; - Bitmap BMP_BACKING_IMPRESS - { - File = "odp_32.png"; - }; - Bitmap BMP_BACKING_DRAW - { - File = "odg_32.png"; - }; - Bitmap BMP_BACKING_DATABASE - { - File = "odb_32.png"; - }; - Bitmap BMP_BACKING_FORMULA - { - File = "odf_32.png"; - }; - Bitmap BMP_BACKING_FOLDER - { - File = "folder_32.png"; - }; String STR_BACKING_EXTHELP { Text [ en-US ] = "Add new features to %PRODUCTNAME"; @@ -137,6 +109,38 @@ Resource RES_BACKING_IMAGES { File = "addtemplate_32.png"; }; + Bitmap BMP_BACKING_WRITER + { + File = "odt_32.png"; + }; + Bitmap BMP_BACKING_CALC + { + File = "ods_32.png"; + }; + Bitmap BMP_BACKING_IMPRESS + { + File = "odp_32.png"; + }; + Bitmap BMP_BACKING_DRAW + { + File = "odg_32.png"; + }; + Bitmap BMP_BACKING_DATABASE + { + File = "odb_32.png"; + }; + Bitmap BMP_BACKING_FORMULA + { + File = "odf_32.png"; + }; + Bitmap BMP_BACKING_OPENFILE + { + File = "folder_32.png"; + }; + Bitmap BMP_BACKING_OPENTEMPLATE + { + File = "templates_32.png"; + }; }; Resource RES_BACKING_IMAGES_HC @@ -177,6 +181,38 @@ Resource RES_BACKING_IMAGES_HC { File = "template_hc.png"; }; + Bitmap BMP_BACKING_WRITER + { + File = "odt_32_hc.png"; + }; + Bitmap BMP_BACKING_CALC + { + File = "ods_32_hc.png"; + }; + Bitmap BMP_BACKING_IMPRESS + { + File = "odp_32_hc.png"; + }; + Bitmap BMP_BACKING_DRAW + { + File = "odg_32_hc.png"; + }; + Bitmap BMP_BACKING_DATABASE + { + File = "odb_32_hc.png"; + }; + Bitmap BMP_BACKING_FORMULA + { + File = "odf_32_hc.png"; + }; + Bitmap BMP_BACKING_OPENFILE + { + File = "folder_32_hc.png"; + }; + Bitmap BMP_BACKING_OPENTEMPLATE + { + File = "templates_32_hc.png"; + }; }; Window WIN_TABWINDOW diff --git a/framework/source/uielement/langselectionmenucontroller.cxx b/framework/source/uielement/langselectionmenucontroller.cxx index 9c8e68e24734..f2c905f237e8 100644 --- a/framework/source/uielement/langselectionmenucontroller.cxx +++ b/framework/source/uielement/langselectionmenucontroller.cxx @@ -344,6 +344,9 @@ void LanguageSelectionMenuController::fillPopupMenu( Reference< css::awt::XPopup std::map< sal_Int16, ::rtl::OUString > LangTable; const ::rtl::OUString sAsterix(RTL_CONSTASCII_USTRINGPARAM("*")); + bool bMultipleLanguages = (eMode != MODE_SetLanguageSelectionMenu) || m_aCurLang.compareToAscii( "*" ) == 0; + bool bNothingSelected = true; + MenuItemBits nItemBits = !bMultipleLanguages ? MIB_RADIOCHECK : 0; for(std::map< ::rtl::OUString, ::rtl::OUString >::const_iterator it = LangItems.begin(); it != LangItems.end(); ++it) { if(it->first != ::rtl::OUString( aLangTable.GetString( LANGUAGE_NONE ) )&& @@ -351,12 +354,13 @@ void LanguageSelectionMenuController::fillPopupMenu( Reference< css::awt::XPopup it->first.getLength()) { ++nItemId; - pPopupMenu->InsertItem( nItemId,it->first); + pPopupMenu->InsertItem( nItemId,it->first,nItemBits ); LangTable[nItemId] = it->first; if(it->first == m_aCurLang && eMode == MODE_SetLanguageSelectionMenu ) { //make a sign for the current language pPopupMenu->CheckItem(nItemId,TRUE); + bNothingSelected = false; } aCmd=aCmd_Language; aCmd+=(String)it->first; @@ -366,7 +370,9 @@ void LanguageSelectionMenuController::fillPopupMenu( Reference< css::awt::XPopup //7--none nItemId++; - pPopupMenu->InsertItem( nItemId, String(FwlResId( STR_LANGSTATUS_NONE )) ); + pPopupMenu->InsertItem( nItemId, String(FwlResId( STR_LANGSTATUS_NONE )), nItemBits ); + if (bNothingSelected && !bMultipleLanguages) + pPopupMenu->CheckItem(nItemId,TRUE); aCmd=aCmd_Language; aCmd+=String::CreateFromAscii("LANGUAGE_NONE"); pPopupMenu->SetItemCommand(nItemId,aCmd); diff --git a/framework/source/uielement/langselectionstatusbarcontroller.cxx b/framework/source/uielement/langselectionstatusbarcontroller.cxx index 953470314785..544597261852 100644 --- a/framework/source/uielement/langselectionstatusbarcontroller.cxx +++ b/framework/source/uielement/langselectionstatusbarcontroller.cxx @@ -272,6 +272,9 @@ void LangSelectionStatusbarController::LangMenu()throw (::com::sun::star::uno::R } } std::map< sal_Int16, ::rtl::OUString > LangTable; + bool bMultipleLanguages = m_aCurLang.compareToAscii( "*" ) == 0; + bool bNothingSelected = true; + sal_Int16 nMenuItemStyle = !bMultipleLanguages ? css::awt::MenuItemStyle::RADIOCHECK : 0; for( std::set< ::rtl::OUString >::const_iterator it = LangItems.begin(); it != LangItems.end(); ++it ) { @@ -281,22 +284,26 @@ void LangSelectionStatusbarController::LangMenu()throw (::com::sun::star::uno::R { //nItemId = xPopupMenu->getItemCount()+1; nItemId++; - xPopupMenu->insertItem( nItemId, *it, css::awt::MenuItemStyle::RADIOCHECK, nItemId ); + xPopupMenu->insertItem( nItemId, *it, nMenuItemStyle, nItemId ); LangTable[nItemId]=*it; if( *it == m_aCurLang ) { //make a sign for the current language xPopupMenu->checkItem( nItemId, TRUE ); + bNothingSelected = false; } } } //7--none nItemId++; - xPopupMenu->insertItem( nItemId, String( FwkResId( STR_LANGSTATUS_NONE )), css::awt::MenuItemStyle::RADIOCHECK, nItemId ); + xPopupMenu->insertItem( nItemId, String( FwkResId( STR_LANGSTATUS_NONE )), nMenuItemStyle, nItemId ); + if (bNothingSelected && !bMultipleLanguages) + xPopupMenu->checkItem( nItemId, TRUE ); + //More... nItemId++; - xPopupMenu->insertItem( nItemId, String( FwkResId( STR_LANGSTATUS_MORE )), css::awt::MenuItemStyle::RADIOCHECK, nItemId ); + xPopupMenu->insertItem( nItemId, String( FwkResId( STR_LANGSTATUS_MORE )), 0, nItemId ); for( ::std::set< ::rtl::OUString >::const_iterator it = LangItems.begin(); it != LangItems.end(); ++it ) { @@ -305,22 +312,22 @@ void LangSelectionStatusbarController::LangMenu()throw (::com::sun::star::uno::R *it != ::rtl::OUString::createFromAscii( "" )) { nItemId++; - subPopupMenu->insertItem( nItemId, *it, css::awt::MenuItemStyle::RADIOCHECK, nItemId ); + subPopupMenu->insertItem( nItemId, *it, 0, nItemId ); LangTable[nItemId]=*it; } } //7--none nItemId++; - subPopupMenu->insertItem( nItemId, String( FwkResId( STR_LANGSTATUS_NONE )), css::awt::MenuItemStyle::RADIOCHECK, nItemId ); + subPopupMenu->insertItem( nItemId, String( FwkResId( STR_LANGSTATUS_NONE )), 0, nItemId ); //More nItemId++; - subPopupMenu->insertItem( nItemId, String( FwkResId( STR_LANGSTATUS_MORE )), css::awt::MenuItemStyle::RADIOCHECK, nItemId ); + subPopupMenu->insertItem( nItemId, String( FwkResId( STR_LANGSTATUS_MORE )), 0, nItemId ); nItemId++; xPopupMenu->insertSeparator(nItemId); nItemId++; - xPopupMenu->insertItem( nItemId, String( FwkResId( STR_SET_LANGUAGE_FOR_PARAGRAPH )), css::awt::MenuItemStyle::RADIOCHECK, nItemId ); + xPopupMenu->insertItem( nItemId, String( FwkResId( STR_SET_LANGUAGE_FOR_PARAGRAPH )), 0, nItemId ); xPopupMenu->setPopupMenu( nItemId, subPopupMenu ); //display the popup menu and execute every command diff --git a/framework/source/uielement/menubarmanager.cxx b/framework/source/uielement/menubarmanager.cxx index 9fbdf87336cc..9d8aa9205c90 100644 --- a/framework/source/uielement/menubarmanager.cxx +++ b/framework/source/uielement/menubarmanager.cxx @@ -548,11 +548,14 @@ throw ( RuntimeException ) if ( Event.State >>= bCheckmark ) { - // Checkmark + // Checkmark or RadioButton m_pVCLMenu->ShowItem( pMenuItemHandler->nItemId, TRUE ); m_pVCLMenu->CheckItem( pMenuItemHandler->nItemId, bCheckmark ); - m_pVCLMenu->SetItemBits( pMenuItemHandler->nItemId, - m_pVCLMenu->GetItemBits( pMenuItemHandler->nItemId ) | MIB_CHECKABLE ); + + MenuItemBits nBits = m_pVCLMenu->GetItemBits( pMenuItemHandler->nItemId ); + //If not already designated RadioButton set as CheckMark + if (!(nBits & MIB_RADIOCHECK)) + m_pVCLMenu->SetItemBits( pMenuItemHandler->nItemId, nBits | MIB_CHECKABLE ); } else if ( Event.State >>= aItemText ) { @@ -1805,6 +1808,8 @@ void MenuBarManager::FillMenu( nBits |= MIB_ICON; if ( nStyle & ::com::sun::star::ui::ItemStyle::TEXT ) nBits |= MIB_TEXT; + if ( nStyle & ::com::sun::star::ui::ItemStyle::RADIO_CHECK ) + nBits |= MIB_RADIOCHECK; pMenu->SetItemBits( nId, nBits ); } if ( xIndexContainer.is() ) diff --git a/framework/source/uielement/rootitemcontainer.cxx b/framework/source/uielement/rootitemcontainer.cxx index e67b734730e5..8c81f31f2394 100644 --- a/framework/source/uielement/rootitemcontainer.cxx +++ b/framework/source/uielement/rootitemcontainer.cxx @@ -127,7 +127,6 @@ RootItemContainer::RootItemContainer( const Reference< XIndexAccess >& rSourceCo Reference< XPropertySet > xPropSet( rSourceContainer, UNO_QUERY ); if ( xPropSet.is() ) { - rtl::OUString aUIName; xPropSet->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "UIName" ))) >>= m_aUIName; } } diff --git a/framework/source/uielement/toolbarmanager.cxx b/framework/source/uielement/toolbarmanager.cxx index d89b81c0f9b6..9b0ffa9ce993 100644 --- a/framework/source/uielement/toolbarmanager.cxx +++ b/framework/source/uielement/toolbarmanager.cxx @@ -112,6 +112,7 @@ using namespace ::com::sun::star::util; using namespace ::com::sun::star::container; using namespace ::com::sun::star::frame; using namespace ::com::sun::star::ui; +using namespace ::com::sun::star; namespace framework { @@ -803,17 +804,18 @@ void ToolBarManager::RemoveControllers() m_aControllerMap.clear(); } -::rtl::OUString ToolBarManager::RetrieveLabelFromCommand( const ::rtl::OUString& aCmdURL ) +uno::Sequence< beans::PropertyValue > ToolBarManager::GetPropsForCommand( const ::rtl::OUString& rCmdURL ) { - ::rtl::OUString aLabel; + Sequence< PropertyValue > aPropSeq; - // Retrieve popup menu labels - if ( !m_bModuleIdentified ) + // Retrieve properties for command + try { - Reference< XModuleManager > xModuleManager( m_xServiceManager->createInstance( SERVICENAME_MODULEMANAGER ), UNO_QUERY_THROW ); - Reference< XInterface > xIfac( m_xFrame, UNO_QUERY ); - try + if ( !m_bModuleIdentified ) { + Reference< XModuleManager > xModuleManager( m_xServiceManager->createInstance( SERVICENAME_MODULEMANAGER ), UNO_QUERY_THROW ); + Reference< XInterface > xIfac( m_xFrame, UNO_QUERY ); + m_bModuleIdentified = sal_True; m_aModuleIdentifier = xModuleManager->identify( xIfac ); @@ -821,44 +823,57 @@ void ToolBarManager::RemoveControllers() { Reference< XNameAccess > xNameAccess( m_xServiceManager->createInstance( SERVICENAME_UICOMMANDDESCRIPTION ), UNO_QUERY ); if ( xNameAccess.is() ) - { xNameAccess->getByName( m_aModuleIdentifier ) >>= m_xUICommandLabels; - } } } - catch ( Exception& ) + + if ( m_xUICommandLabels.is() ) { + if ( rCmdURL.getLength() > 0 ) + m_xUICommandLabels->getByName( rCmdURL ) >>= aPropSeq; } } + catch ( Exception& ) + { + } - if ( m_xUICommandLabels.is() ) + return aPropSeq; +} + +::rtl::OUString ToolBarManager::RetrieveLabelFromCommand( const ::rtl::OUString& aCmdURL ) +{ + ::rtl::OUString aLabel; + Sequence< PropertyValue > aPropSeq; + + // Retrieve popup menu labels + aPropSeq = GetPropsForCommand( aCmdURL ); + for ( sal_Int32 i = 0; i < aPropSeq.getLength(); i++ ) { - try + if ( aPropSeq[i].Name.equalsAscii( "Name" )) { - if ( aCmdURL.getLength() > 0 ) - { - rtl::OUString aStr; - Sequence< PropertyValue > aPropSeq; - if ( m_xUICommandLabels->getByName( aCmdURL ) >>= aPropSeq ) - { - for ( sal_Int32 i = 0; i < aPropSeq.getLength(); i++ ) - { - if ( aPropSeq[i].Name.equalsAscii( "Name" )) - { - aPropSeq[i].Value >>= aStr; - break; - } - } - } - aLabel = aStr; - } + aPropSeq[i].Value >>= aLabel; + break; } - catch ( com::sun::star::uno::Exception& ) + } + return aLabel; +} + +sal_Int32 ToolBarManager::RetrievePropertiesFromCommand( const ::rtl::OUString& aCmdURL ) +{ + sal_Int32 nProperties(0); + Sequence< PropertyValue > aPropSeq; + + // Retrieve popup menu labels + aPropSeq = GetPropsForCommand( aCmdURL ); + for ( sal_Int32 i = 0; i < aPropSeq.getLength(); i++ ) + { + if ( aPropSeq[i].Name.equalsAscii( "Properties" )) { + aPropSeq[i].Value >>= nProperties; + break; } } - - return aLabel; + return nProperties; } void ToolBarManager::CreateControllers() @@ -969,8 +984,15 @@ void ToolBarManager::CreateControllers() { MenuDescriptionMap::iterator it = m_aMenuMap.find( nId ); if ( it == m_aMenuMap.end() ) - xController = Reference< XStatusListener >( - new GenericToolbarController( m_xServiceManager, m_xFrame, m_pToolBar, nId, aCommandURL )); + { + xController = Reference< XStatusListener >( + new GenericToolbarController( m_xServiceManager, m_xFrame, m_pToolBar, nId, aCommandURL )); + + // Accessibility support: Set toggle button role for specific commands + sal_Int32 nProps = RetrievePropertiesFromCommand( aCommandURL ); + if ( nProps & UICOMMANDDESCRIPTION_PROPERTIES_TOGGLEBUTTON ) + m_pToolBar->SetItemBits( nId, m_pToolBar->GetItemBits( nId ) | TIB_CHECKABLE ); + } else xController = Reference< XStatusListener >( new MenuToolbarController( m_xServiceManager, m_xFrame, m_pToolBar, nId, aCommandURL, m_aModuleIdentifier, m_aMenuMap[ nId ] )); @@ -1530,7 +1552,11 @@ IMPL_LINK( ToolBarManager, DropdownClick, ToolBox*, EMPTYARG ) Reference< XToolbarController > xController( pIter->second, UNO_QUERY ); if ( xController.is() ) - xController->createPopupWindow(); + { + Reference< XWindow > xWin = xController->createPopupWindow(); + if ( xWin.is() ) + xWin->setFocus(); + } } return 1; } diff --git a/framework/source/uielement/uicommanddescription.cxx b/framework/source/uielement/uicommanddescription.cxx index fdcd08f221fd..0d50aa4c36d4 100644 --- a/framework/source/uielement/uicommanddescription.cxx +++ b/framework/source/uielement/uicommanddescription.cxx @@ -340,7 +340,7 @@ Any ConfigurationAccess_UICommand::getSequenceFromCache( const ::rtl::OUString& if ( !pIter->second.bCommandNameCreated ) fillInfoFromResult( pIter->second, pIter->second.aLabel ); - Sequence< PropertyValue > aPropSeq( 3 ); + Sequence< PropertyValue > aPropSeq( 4 ); aPropSeq[0].Name = m_aPropLabel; aPropSeq[0].Value = pIter->second.aContextLabel.getLength() ? makeAny( pIter->second.aContextLabel ): makeAny( pIter->second.aLabel ); @@ -348,6 +348,8 @@ Any ConfigurationAccess_UICommand::getSequenceFromCache( const ::rtl::OUString& aPropSeq[1].Value <<= pIter->second.aCommandName; aPropSeq[2].Name = m_aPropPopup; aPropSeq[2].Value <<= pIter->second.bPopup; + aPropSeq[3].Name = m_aPropProperties; + aPropSeq[3].Value <<= pIter->second.nProperties; return makeAny( aPropSeq ); } diff --git a/framework/source/xml/makefile.mk b/framework/source/xml/makefile.mk index dd40af0cbe05..a4f18a555ab3 100644 --- a/framework/source/xml/makefile.mk +++ b/framework/source/xml/makefile.mk @@ -47,7 +47,6 @@ SLOFILES= \ $(SLO)$/statusbardocumenthandler.obj \ $(SLO)$/toolboxconfiguration.obj \ $(SLO)$/toolboxdocumenthandler.obj \ - $(SLO)$/toolboxlayoutdocumenthandler.obj \ $(SLO)$/saxnamespacefilter.obj \ $(SLO)$/xmlnamespaces.obj \ $(SLO)$/acceleratorconfigurationreader.obj \ diff --git a/framework/source/xml/menudocumenthandler.cxx b/framework/source/xml/menudocumenthandler.cxx index 90f5fb25dec3..3fc5d1775be4 100644 --- a/framework/source/xml/menudocumenthandler.cxx +++ b/framework/source/xml/menudocumenthandler.cxx @@ -94,6 +94,7 @@ #define ATTRIBUTE_ITEMSTYLE_TEXT "text" #define ATTRIBUTE_ITEMSTYLE_IMAGE "image" +#define ATTRIBUTE_ITEMSTYLE_RADIO "radio" // Property names of a menu/menu item ItemDescriptor static const char ITEM_DESCRIPTOR_COMMANDURL[] = "CommandURL"; @@ -134,6 +135,7 @@ struct MenuStyleItem MenuStyleItem MenuItemStyles[ ] = { { ::com::sun::star::ui::ItemStyle::ICON, ATTRIBUTE_ITEMSTYLE_IMAGE }, { ::com::sun::star::ui::ItemStyle::TEXT, ATTRIBUTE_ITEMSTYLE_TEXT }, + { ::com::sun::star::ui::ItemStyle::RADIO_CHECK, ATTRIBUTE_ITEMSTYLE_RADIO } }; @@ -437,8 +439,10 @@ throw( SAXException, RuntimeException ) { if ( aToken.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ATTRIBUTE_ITEMSTYLE_TEXT ) ) ) nItemBits |= ::com::sun::star::ui::ItemStyle::TEXT; - if ( aToken.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ATTRIBUTE_ITEMSTYLE_IMAGE ) ) ) + else if ( aToken.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ATTRIBUTE_ITEMSTYLE_IMAGE ) ) ) nItemBits |= ::com::sun::star::ui::ItemStyle::ICON; + else if ( aToken.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ATTRIBUTE_ITEMSTYLE_RADIO ) ) ) + nItemBits |= ::com::sun::star::ui::ItemStyle::RADIO_CHECK; } } while ( nIndex >= 0 ); @@ -670,8 +674,10 @@ throw( SAXException, RuntimeException ) { if ( aToken.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ATTRIBUTE_ITEMSTYLE_TEXT ) ) ) nItemBits |= ::com::sun::star::ui::ItemStyle::TEXT; - if ( aToken.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ATTRIBUTE_ITEMSTYLE_IMAGE ) ) ) + else if ( aToken.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ATTRIBUTE_ITEMSTYLE_IMAGE ) ) ) nItemBits |= ::com::sun::star::ui::ItemStyle::ICON; + else if ( aToken.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ATTRIBUTE_ITEMSTYLE_RADIO ) ) ) + nItemBits |= ::com::sun::star::ui::ItemStyle::RADIO_CHECK; } } while ( nIndex >= 0 ); @@ -725,8 +731,10 @@ throw( SAXException, RuntimeException ) { if ( aToken.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ATTRIBUTE_ITEMSTYLE_TEXT ) ) ) nItemBits |= ::com::sun::star::ui::ItemStyle::TEXT; - if ( aToken.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ATTRIBUTE_ITEMSTYLE_IMAGE ) ) ) + else if ( aToken.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ATTRIBUTE_ITEMSTYLE_IMAGE ) ) ) nItemBits |= ::com::sun::star::ui::ItemStyle::ICON; + else if ( aToken.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ATTRIBUTE_ITEMSTYLE_RADIO ) ) ) + nItemBits |= ::com::sun::star::ui::ItemStyle::RADIO_CHECK; } } while ( nIndex >= 0 ); diff --git a/framework/source/xml/toolboxconfiguration.cxx b/framework/source/xml/toolboxconfiguration.cxx index 9cd1f25c3df5..9d1c91aa6849 100644 --- a/framework/source/xml/toolboxconfiguration.cxx +++ b/framework/source/xml/toolboxconfiguration.cxx @@ -30,7 +30,6 @@ #include "precompiled_framework.hxx" #include <xml/toolboxconfiguration.hxx> #include <xml/toolboxdocumenthandler.hxx> -#include <xml/toolboxlayoutdocumenthandler.hxx> #include <xml/saxnamespacefilter.hxx> #include <services.h> diff --git a/framework/source/xml/toolboxlayoutdocumenthandler.cxx b/framework/source/xml/toolboxlayoutdocumenthandler.cxx deleted file mode 100644 index 645750dc3f51..000000000000 --- a/framework/source/xml/toolboxlayoutdocumenthandler.cxx +++ /dev/null @@ -1,58 +0,0 @@ -/************************************************************************* - * - * 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_framework.hxx" - -#include <stdio.h> - -//_________________________________________________________________________________________________________________ -// my own includes -//_________________________________________________________________________________________________________________ - -#include <threadhelp/resetableguard.hxx> -#include <xml/toolboxlayoutdocumenthandler.hxx> -#include <macros/debug.hxx> -#include <xml/toolboxconfigurationdefines.hxx> - -//_________________________________________________________________________________________________________________ -// interface includes -//_________________________________________________________________________________________________________________ - -#ifndef __COM_SUN_STAR_XML_SAX_XEXTENDEDDOCUMENTHANDLER_HPP_ -#include <com/sun/star/xml/sax/XExtendedDocumentHandler.hpp> -#endif - -//_________________________________________________________________________________________________________________ -// other includes -//_________________________________________________________________________________________________________________ -#include <vcl/svapp.hxx> -#include <vcl/toolbox.hxx> - -//_________________________________________________________________________________________________________________ -// namespace -//_________________________________________________________________________________________________________________ diff --git a/framework/util/makefile.mk b/framework/util/makefile.mk index 82dfaf502ac2..afca19eef954 100644 --- a/framework/util/makefile.mk +++ b/framework/util/makefile.mk @@ -79,7 +79,6 @@ LIB2OBJFILES= \ $(SLO)$/statusbardocumenthandler.obj \ $(SLO)$/toolboxconfiguration.obj \ $(SLO)$/toolboxdocumenthandler.obj \ - $(SLO)$/toolboxlayoutdocumenthandler.obj \ $(SLO)$/imagesconfiguration.obj \ $(SLO)$/imagesdocumenthandler.obj \ $(SLO)$/xmlnamespaces.obj \ |