CWS-TOOLING: integrate CWS sdfindall
This commit is contained in:
commit
1d15c3a838
5 changed files with 55 additions and 15 deletions
|
@ -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);
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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() )
|
||||
|
|
|
@ -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 );
|
||||
|
|
|
@ -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();
|
||||
|
||||
|
|
Loading…
Reference in a new issue