diff options
author | Vladimir Glazunov <vg@openoffice.org> | 2010-05-20 10:00:35 +0200 |
---|---|---|
committer | Vladimir Glazunov <vg@openoffice.org> | 2010-05-20 10:00:35 +0200 |
commit | 1d15c3a838d15ef78d0ff1ae777907aada6337c5 (patch) | |
tree | 2774bedb22e2d0269cd780d069e46251a377f5c6 | |
parent | 2f4bff8415b28e36346872157104eb71322a743a (diff) | |
parent | 0232e02afea27519ca969ddec8113a21ea313df4 (diff) |
CWS-TOOLING: integrate CWS sdfindall
-rw-r--r-- | framework/source/uielement/langselectionmenucontroller.cxx | 10 | ||||
-rw-r--r-- | framework/source/uielement/langselectionstatusbarcontroller.cxx | 21 | ||||
-rw-r--r-- | framework/source/uielement/menubarmanager.cxx | 11 | ||||
-rw-r--r-- | framework/source/xml/menudocumenthandler.cxx | 14 | ||||
-rw-r--r-- | svx/source/dialog/srchdlg.cxx | 14 |
5 files changed, 55 insertions, 15 deletions
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/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/svx/source/dialog/srchdlg.cxx b/svx/source/dialog/srchdlg.cxx index 5f3aa24394a3..01dc2c0591cc 100644 --- a/svx/source/dialog/srchdlg.cxx +++ b/svx/source/dialog/srchdlg.cxx @@ -831,6 +831,18 @@ void SvxSearchDialog::CalculateDelta_Impl() pMoreBtn->AddWindow( &aNoFormatBtn ); } + if (bDrawApp || bImpressApp) + { + // "Find All" button is hidden--align "Find" vertically to the + // search listbox + Point aNewPt(aSearchBtn.GetPosPixel()); + const Size aBtnSz(aSearchBtn.GetSizePixel()); + const Size aLBSz(aSearchLB.GetSizePixel()); + const int nOff((aLBSz.Height() - aBtnSz.Height()) / 2); + aNewPt.Y() = aSearchLB.GetPosPixel().Y() + nOff; + aSearchBtn.SetPosPixel(aNewPt); + } + if ( bDrawApp ) { // Draw App: "Regular expressions" and "Search for Styles" check boxes are hidden @@ -1016,6 +1028,8 @@ void SvxSearchDialog::Init_Impl( int bSearchPattern ) if ( pSearchItem->GetAppFlag() == SVX_SEARCHAPP_DRAW ) { + aSearchAllBtn.Hide(); + aRegExpBtn.Hide(); aLayoutBtn.Hide(); |