diff options
Diffstat (limited to 'cui/source/customize')
-rw-r--r-- | cui/source/customize/acccfg.cxx | 273 | ||||
-rw-r--r-- | cui/source/customize/acccfg.hrc | 2 | ||||
-rw-r--r-- | cui/source/customize/acccfg.src | 14 | ||||
-rw-r--r-- | cui/source/customize/cfg.cxx | 793 | ||||
-rw-r--r-- | cui/source/customize/cfg.hrc | 5 | ||||
-rw-r--r-- | cui/source/customize/cfg.src | 27 | ||||
-rw-r--r-- | cui/source/customize/cfgutil.cxx | 608 | ||||
-rw-r--r-- | cui/source/customize/eventdlg.cxx | 23 | ||||
-rw-r--r-- | cui/source/customize/eventdlg.hxx | 4 | ||||
-rw-r--r-- | cui/source/customize/eventdlg.src | 3 | ||||
-rw-r--r-- | cui/source/customize/macropg.cxx | 57 | ||||
-rw-r--r-- | cui/source/customize/macropg.src | 6 | ||||
-rw-r--r-- | cui/source/customize/macropg_impl.hxx | 4 | ||||
-rw-r--r-- | cui/source/customize/selector.cxx | 105 |
14 files changed, 597 insertions, 1327 deletions
diff --git a/cui/source/customize/acccfg.cxx b/cui/source/customize/acccfg.cxx index 13d5bff7e580..4b955b653cd4 100644 --- a/cui/source/customize/acccfg.cxx +++ b/cui/source/customize/acccfg.cxx @@ -34,10 +34,10 @@ #include <dialmgr.hxx> #include <sfx2/msg.hxx> -#include <sfx2/macrconf.hxx> #include <sfx2/app.hxx> #include <sfx2/filedlghelper.hxx> #include <sfx2/minfitem.hxx> +#include <sfx2/sfxresid.hxx> #include <svl/stritem.hxx> #include <sal/macros.h> @@ -109,7 +109,7 @@ static ::rtl::OUString MEDIATYPE_PROPNAME (RTL_CONSTASCII_USTRINGP static ::rtl::OUString MEDIATYPE_UICONFIG (RTL_CONSTASCII_USTRINGPARAM("application/vnd.sun.xml.ui.configuration" )); //----------------------------------------------- -static USHORT KEYCODE_ARRAY[] = +static sal_uInt16 KEYCODE_ARRAY[] = { KEY_F1 , KEY_F2 , @@ -616,7 +616,7 @@ static USHORT KEYCODE_ARRAY[] = KEY_DELETE | KEY_SHIFT | KEY_MOD1 | KEY_MOD2 }; -static USHORT KEYCODE_ARRAY_SIZE = SAL_N_ELEMENTS(KEYCODE_ARRAY); +static sal_uInt16 KEYCODE_ARRAY_SIZE = SAL_N_ELEMENTS(KEYCODE_ARRAY); //----------------------------------------------- // seems to be needed to layout the list box, which shows all @@ -633,20 +633,20 @@ class SfxAccCfgLBoxString_Impl : public SvLBoxString { public: SfxAccCfgLBoxString_Impl( SvLBoxEntry* pEntry, - USHORT nFlags, + sal_uInt16 nFlags, const String& sText ); virtual ~SfxAccCfgLBoxString_Impl(); virtual void Paint(const Point& aPos , SvLBox& rDevice, - USHORT nFlags , + sal_uInt16 nFlags , SvLBoxEntry* pEntry ); }; //----------------------------------------------- SfxAccCfgLBoxString_Impl::SfxAccCfgLBoxString_Impl( SvLBoxEntry* pEntry, - USHORT nFlags, + sal_uInt16 nFlags, const String& sText ) : SvLBoxString(pEntry, nFlags, sText) { @@ -660,7 +660,7 @@ SfxAccCfgLBoxString_Impl::~SfxAccCfgLBoxString_Impl() //----------------------------------------------- void SfxAccCfgLBoxString_Impl::Paint(const Point& aPos , SvLBox& rDevice, - USHORT /*nFlags*/, + sal_uInt16 /*nFlags*/, SvLBoxEntry* pEntry ) { @@ -695,8 +695,8 @@ void SfxAccCfgTabListBox_Impl::InitEntry( SvLBoxEntry* pEntry , void SfxAccCfgTabListBox_Impl::KeyInput(const KeyEvent& aKey) { KeyCode aCode1 = aKey.GetKeyCode(); - USHORT nCode1 = aCode1.GetCode(); - USHORT nMod1 = aCode1.GetModifier(); + sal_uInt16 nCode1 = aCode1.GetCode(); + sal_uInt16 nMod1 = aCode1.GetModifier(); // is it related to our list box ? if ( @@ -714,8 +714,8 @@ void SfxAccCfgTabListBox_Impl::KeyInput(const KeyEvent& aKey) TAccInfo* pUserData = (TAccInfo*)pEntry->GetUserData(); if (pUserData) { - USHORT nCode2 = pUserData->m_aKey.GetCode(); - USHORT nMod2 = pUserData->m_aKey.GetModifier(); + sal_uInt16 nCode2 = pUserData->m_aKey.GetCode(); + sal_uInt16 nMod2 = pUserData->m_aKey.GetModifier(); if ( (nCode1 == nCode2) && (nMod1 == nMod2 ) @@ -759,7 +759,6 @@ SfxAcceleratorConfigPage::SfxAcceleratorConfigPage( Window* pParent, const SfxIt , aResetButton (this , CUI_RES(BTN_RESET )) , aLoadAccelConfigStr ( CUI_RES( STR_LOADACCELCONFIG ) ) , aSaveAccelConfigStr ( CUI_RES( STR_SAVEACCELCONFIG ) ) - , aFilterAllStr ( CUI_RES( STR_SFX_FILTERNAME_ALL ) ) , aFilterCfgStr ( CUI_RES( STR_FILTERNAME_CFG ) ) , m_bStylesInfoInitialized(sal_False) , m_xGlobal () @@ -768,6 +767,8 @@ SfxAcceleratorConfigPage::SfxAcceleratorConfigPage( Window* pParent, const SfxIt { FreeResource(); + aFilterAllStr = String( SfxResId( STR_SFX_FILTERNAME_ALL ) ); + // install handler functions aChangeButton.SetClickHdl( LINK( this, SfxAcceleratorConfigPage, ChangeHdl )); aRemoveButton.SetClickHdl( LINK( this, SfxAcceleratorConfigPage, RemoveHdl )); @@ -782,7 +783,7 @@ SfxAcceleratorConfigPage::SfxAcceleratorConfigPage( Window* pParent, const SfxIt aModuleButton.SetClickHdl( LINK( this, SfxAcceleratorConfigPage, RadioHdl )); // initialize Entriesbox - aEntriesBox.SetWindowBits(WB_HSCROLL|WB_CLIPCHILDREN); + aEntriesBox.SetStyle(aEntriesBox.GetStyle()|WB_HSCROLL|WB_CLIPCHILDREN); aEntriesBox.SetSelectionMode(SINGLE_SELECTION); aEntriesBox.SetTabs(&AccCfgTabs[0], MAP_APPFONT); aEntriesBox.Resize(); // OS: Hack for right selection @@ -791,7 +792,7 @@ SfxAcceleratorConfigPage::SfxAcceleratorConfigPage( Window* pParent, const SfxIt // detect max keyname width long nMaxWidth = 0; - for ( USHORT i = 0; i < KEYCODE_ARRAY_SIZE; ++i ) + for ( sal_uInt16 i = 0; i < KEYCODE_ARRAY_SIZE; ++i ) { long nTmp = GetTextWidth( KeyCode( KEYCODE_ARRAY[i] ).GetName() ); if ( nTmp > nMaxWidth ) @@ -806,7 +807,7 @@ SfxAcceleratorConfigPage::SfxAcceleratorConfigPage( Window* pParent, const SfxIt pGroupLBox->SetFunctionListBox(pFunctionBox); // initialize KeyBox - aKeyBox.SetWindowBits(WB_CLIPCHILDREN|WB_HSCROLL|WB_SORT); + aKeyBox.SetStyle(aKeyBox.GetStyle()|WB_CLIPCHILDREN|WB_HSCROLL|WB_SORT); } //----------------------------------------------- @@ -924,9 +925,9 @@ void SfxAcceleratorConfigPage::Init(const css::uno::Reference< css::ui::XAcceler // Insert all editable accelerators into list box. It is possible // that some accelerators are not mapped on the current system/keyboard // but we don't want to lose these mappings. - USHORT c1 = KEYCODE_ARRAY_SIZE; - USHORT i1 = 0; - USHORT nListPos = 0; + sal_uInt16 c1 = KEYCODE_ARRAY_SIZE; + sal_uInt16 i1 = 0; + sal_uInt16 nListPos = 0; for (i1=0; i1<c1; ++i1) { KeyCode aKey = KEYCODE_ARRAY[i1]; @@ -942,7 +943,7 @@ void SfxAcceleratorConfigPage::Init(const css::uno::Reference< css::ui::XAcceler css::uno::Sequence< css::awt::KeyEvent > lKeys = xAccMgr->getAllKeyEvents(); sal_Int32 c2 = lKeys.getLength(); sal_Int32 i2 = 0; - USHORT nCol = aEntriesBox.TabCount()-1; + sal_uInt16 nCol = aEntriesBox.TabCount()-1; for (i2=0; i2<c2; ++i2) { @@ -950,7 +951,7 @@ void SfxAcceleratorConfigPage::Init(const css::uno::Reference< css::ui::XAcceler ::rtl::OUString sCommand = xAccMgr->getCommandByKeyEvent(aAWTKey); String sLabel = GetLabel4Command(sCommand); KeyCode aKeyCode = ::svt::AcceleratorExecute::st_AWTKey2VCLKey(aAWTKey); - USHORT nPos = MapKeyCodeToPos(aKeyCode); + sal_uInt16 nPos = MapKeyCodeToPos(aKeyCode); if (nPos == LISTBOX_ENTRY_NOTFOUND) continue; @@ -966,12 +967,12 @@ void SfxAcceleratorConfigPage::Init(const css::uno::Reference< css::ui::XAcceler } // Map the VCL hardcoded key codes and mark them as not changeable - ULONG c3 = Application::GetReservedKeyCodeCount(); - ULONG i3 = 0; + sal_uLong c3 = Application::GetReservedKeyCodeCount(); + sal_uLong i3 = 0; for (i3=0; i3<c3; ++i3) { const KeyCode* pKeyCode = Application::GetReservedKeyCode(i3); - USHORT nPos = MapKeyCodeToPos(*pKeyCode); + sal_uInt16 nPos = MapKeyCodeToPos(*pKeyCode); if (nPos == LISTBOX_ENTRY_NOTFOUND) continue; @@ -1051,10 +1052,10 @@ IMPL_LINK(SfxAcceleratorConfigPage, Default, PushButton*, EMPTYARG) if (xReset.is()) xReset->reset(); - aEntriesBox.SetUpdateMode(FALSE); + aEntriesBox.SetUpdateMode(sal_False); ResetConfig(); Init(m_xAct); - aEntriesBox.SetUpdateMode(TRUE); + aEntriesBox.SetUpdateMode(sal_True); aEntriesBox.Invalidate(); aEntriesBox.Select(aEntriesBox.GetEntry(0, 0)); @@ -1064,7 +1065,7 @@ IMPL_LINK(SfxAcceleratorConfigPage, Default, PushButton*, EMPTYARG) //----------------------------------------------- IMPL_LINK( SfxAcceleratorConfigPage, ChangeHdl, Button*, EMPTYARG ) { - USHORT nPos = (USHORT) aEntriesBox.GetModel()->GetRelPos( aEntriesBox.FirstSelected() ); + sal_uInt16 nPos = (sal_uInt16) aEntriesBox.GetModel()->GetRelPos( aEntriesBox.FirstSelected() ); TAccInfo* pEntry = (TAccInfo*)aEntriesBox.GetEntry(0, nPos)->GetUserData(); String sNewCommand = pFunctionBox->GetCurCommand(); String sLabel = pFunctionBox->GetCurLabel(); @@ -1072,7 +1073,7 @@ IMPL_LINK( SfxAcceleratorConfigPage, ChangeHdl, Button*, EMPTYARG ) sLabel = GetLabel4Command(sNewCommand); pEntry->m_sCommand = sNewCommand; - USHORT nCol = aEntriesBox.TabCount() - 1; + sal_uInt16 nCol = aEntriesBox.TabCount() - 1; aEntriesBox.SetEntryText(sLabel, nPos, nCol); ((Link &) pFunctionBox->GetSelectHdl()).Call( pFunctionBox ); @@ -1083,11 +1084,11 @@ IMPL_LINK( SfxAcceleratorConfigPage, ChangeHdl, Button*, EMPTYARG ) IMPL_LINK( SfxAcceleratorConfigPage, RemoveHdl, Button *, EMPTYARG ) { // get selected entry - USHORT nPos = (USHORT) aEntriesBox.GetModel()->GetRelPos( aEntriesBox.FirstSelected() ); + sal_uInt16 nPos = (sal_uInt16) aEntriesBox.GetModel()->GetRelPos( aEntriesBox.FirstSelected() ); TAccInfo* pEntry = (TAccInfo*)aEntriesBox.GetEntry(0, nPos)->GetUserData(); // remove function name from selected entry - USHORT nCol = aEntriesBox.TabCount() - 1; + sal_uInt16 nCol = aEntriesBox.TabCount() - 1; aEntriesBox.SetEntryText( String(), nPos, nCol ); pEntry->m_sCommand = ::rtl::OUString(); @@ -1102,17 +1103,17 @@ IMPL_LINK( SfxAcceleratorConfigPage, SelectHdl, Control*, pListBox ) Help::ShowBalloon( this, Point(), String() ); if ( pListBox == &aEntriesBox ) { - USHORT nPos = (USHORT) aEntriesBox.GetModel()->GetRelPos( aEntriesBox.FirstSelected() ); + sal_uInt16 nPos = (sal_uInt16) aEntriesBox.GetModel()->GetRelPos( aEntriesBox.FirstSelected() ); TAccInfo* pEntry = (TAccInfo*)aEntriesBox.GetEntry(0, nPos)->GetUserData(); ::rtl::OUString sPossibleNewCommand = pFunctionBox->GetCurCommand(); - aRemoveButton.Enable( FALSE ); - aChangeButton.Enable( FALSE ); + aRemoveButton.Enable( sal_False ); + aChangeButton.Enable( sal_False ); if (pEntry->m_bIsConfigurable) { if (pEntry->isConfigured()) - aRemoveButton.Enable( TRUE ); + aRemoveButton.Enable( sal_True ); aChangeButton.Enable( pEntry->m_sCommand != sPossibleNewCommand ); } } @@ -1120,25 +1121,25 @@ IMPL_LINK( SfxAcceleratorConfigPage, SelectHdl, Control*, pListBox ) { pGroupLBox->GroupSelected(); if ( !pFunctionBox->FirstSelected() ) - aChangeButton.Enable( FALSE ); + aChangeButton.Enable( sal_False ); } else if ( pListBox == pFunctionBox ) { - aRemoveButton.Enable( FALSE ); - aChangeButton.Enable( FALSE ); + aRemoveButton.Enable( sal_False ); + aChangeButton.Enable( sal_False ); // #i36994 First selected can return zero! SvLBoxEntry* pLBEntry = aEntriesBox.FirstSelected(); if ( pLBEntry != 0 ) { - USHORT nPos = (USHORT) aEntriesBox.GetModel()->GetRelPos( pLBEntry ); + sal_uInt16 nPos = (sal_uInt16) aEntriesBox.GetModel()->GetRelPos( pLBEntry ); TAccInfo* pEntry = (TAccInfo*)aEntriesBox.GetEntry(0, nPos)->GetUserData(); ::rtl::OUString sPossibleNewCommand = pFunctionBox->GetCurCommand(); if (pEntry->m_bIsConfigurable) { if (pEntry->isConfigured()) - aRemoveButton.Enable( TRUE ); + aRemoveButton.Enable( sal_True ); aChangeButton.Enable( pEntry->m_sCommand != sPossibleNewCommand ); } @@ -1151,9 +1152,9 @@ IMPL_LINK( SfxAcceleratorConfigPage, SelectHdl, Control*, pListBox ) if ( pUserData && pUserData->m_sCommand == sPossibleNewCommand ) { TAccInfo* pU1 = new TAccInfo(-1, -1, pUserData->m_aKey); - SvLBoxEntry* pE1 = aKeyBox.InsertEntry( pUserData->m_aKey.GetName(), 0L, TRUE, LIST_APPEND ); + SvLBoxEntry* pE1 = aKeyBox.InsertEntry( pUserData->m_aKey.GetName(), 0L, sal_True, LIST_APPEND ); pE1->SetUserData(pU1); - pE1->EnableChildsOnDemand( FALSE ); + pE1->EnableChildsOnDemand( sal_False ); } pIt = aEntriesBox.Next(pIt); } @@ -1164,7 +1165,7 @@ IMPL_LINK( SfxAcceleratorConfigPage, SelectHdl, Control*, pListBox ) // goto selected "key" entry of the key box SvLBoxEntry* pE2 = 0; TAccInfo* pU2 = 0; - USHORT nP2 = LISTBOX_ENTRY_NOTFOUND; + sal_uInt16 nP2 = LISTBOX_ENTRY_NOTFOUND; SvLBoxEntry* pE3 = 0; pE2 = aKeyBox.FirstSelected(); @@ -1198,10 +1199,10 @@ IMPL_LINK( SfxAcceleratorConfigPage, RadioHdl, RadioButton *, EMPTYARG ) if ( m_xAct.is() && ( xOld == m_xAct ) ) return 0; - aEntriesBox.SetUpdateMode( FALSE ); + aEntriesBox.SetUpdateMode( sal_False ); ResetConfig(); Init(m_xAct); - aEntriesBox.SetUpdateMode( TRUE ); + aEntriesBox.SetUpdateMode( sal_True ); aEntriesBox.Invalidate(); pGroupLBox->Init(m_xSMGR, m_xFrame, m_sModuleLongName); @@ -1270,10 +1271,10 @@ IMPL_LINK( SfxAcceleratorConfigPage, LoadHdl, sfx2::FileDialogHelper*, EMPTYARG // open the configuration and update our UI css::uno::Reference< css::ui::XAcceleratorConfiguration > xTempAccMgr(xCfgMgr->getShortCutManager(), css::uno::UNO_QUERY_THROW); - aEntriesBox.SetUpdateMode(FALSE); + aEntriesBox.SetUpdateMode(sal_False); ResetConfig(); Init(xTempAccMgr); - aEntriesBox.SetUpdateMode(TRUE); + aEntriesBox.SetUpdateMode(sal_True); aEntriesBox.Invalidate(); aEntriesBox.Select(aEntriesBox.GetEntry(0, 0)); @@ -1404,134 +1405,6 @@ IMPL_LINK( SfxAcceleratorConfigPage, SaveHdl, sfx2::FileDialogHelper*, EMPTYARG return 0; } -::rtl::OUString RetrieveLabelFromCommand( const ::rtl::OUString& aCmdURL ) -{ - ::rtl::OUString aLabel; - if ( aCmdURL.getLength() ) - { - try - { - uno::Reference< container::XNameAccess > xNameAccess( ::comphelper::getProcessServiceFactory()->createInstance( - rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.frame.UICommandDescription") ) ), uno::UNO_QUERY ); - if ( xNameAccess.is() ) - { - uno::Reference< container::XNameAccess > xUICommandLabels; - const ::rtl::OUString aModule( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.text.TextDocument" ) ); - uno::Any a = xNameAccess->getByName( aModule ); - uno::Reference< container::XNameAccess > xUICommands; - a >>= xUICommandLabels; - rtl::OUString aStr; - uno::Sequence< beans::PropertyValue > aPropSeq; - a = xUICommandLabels->getByName( aCmdURL ); - if ( a >>= aPropSeq ) - { - for ( sal_Int32 i = 0; i < aPropSeq.getLength(); ++i ) - { - if ( aPropSeq[i].Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "Name" ) )) - { - aPropSeq[i].Value >>= aStr; - break; - } - } - } - aLabel = aStr; - } - } - catch ( uno::Exception& ) - { - } - } - - return aLabel; -} - - -//----------------------------------------------- -String SfxAcceleratorConfigPage::GetFunctionName(KeyFuncType eType) const -{ - ::rtl::OUStringBuffer sName(256); - sName.appendAscii("\""); - switch(eType) - { - case KEYFUNC_NEW : - sName.append( RetrieveLabelFromCommand( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(".uno:NewDoc") ) ) ); - break; - - case KEYFUNC_OPEN : - sName.append( RetrieveLabelFromCommand( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(".uno:Open") ) ) ); - break; - - case KEYFUNC_SAVE : - sName.append( RetrieveLabelFromCommand( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(".uno:Save") ) ) ); - break; - - case KEYFUNC_SAVEAS : - sName.append( RetrieveLabelFromCommand( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(".uno:SaveAs") ) ) ); - break; - - case KEYFUNC_PRINT : - sName.append( RetrieveLabelFromCommand( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(".uno:Print") ) ) ); - break; - - case KEYFUNC_CLOSE : - sName.append( RetrieveLabelFromCommand( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(".uno:Close") ) ) ); - break; - - case KEYFUNC_QUIT : - sName.append( RetrieveLabelFromCommand( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(".uno:Quit") ) ) ); - break; - - case KEYFUNC_CUT : - sName.append( RetrieveLabelFromCommand( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(".uno:Cut") ) ) ); - break; - - case KEYFUNC_COPY : - sName.append( RetrieveLabelFromCommand( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(".uno:Copy") ) ) ); - break; - - case KEYFUNC_PASTE : - sName.append( RetrieveLabelFromCommand( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(".uno:Paste") ) ) ); - break; - - case KEYFUNC_UNDO : - sName.append( RetrieveLabelFromCommand( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(".uno:Undo") ) ) ); - break; - - case KEYFUNC_REDO : - sName.append( RetrieveLabelFromCommand( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(".uno:Redo") ) ) ); - break; - - case KEYFUNC_DELETE : - sName.append( RetrieveLabelFromCommand( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(".uno:Delete") ) ) ); - break; - - case KEYFUNC_REPEAT : - sName.append( RetrieveLabelFromCommand( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(".uno:Repeat") ) ) ); - break; - - case KEYFUNC_FIND : - sName.append( RetrieveLabelFromCommand( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(".uno:Search") ) ) ); - break; - - case KEYFUNC_FINDBACKWARD : - sName.append( RetrieveLabelFromCommand( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(".uno:SearchBackwards") ) ) ); - break; - - case KEYFUNC_PROPERTIES : - sName.append( RetrieveLabelFromCommand( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(".uno:Options") ) ) ); - break; - - case KEYFUNC_FRONT : - sName.append( RetrieveLabelFromCommand( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(".uno:ToFront") ) ) ); - break; - - default: - break; - } - sName.appendAscii("\""); - return String(sName.makeStringAndClear()); -} - //----------------------------------------------- void SfxAcceleratorConfigPage::StartFileDialog( WinBits nBits, const String& rTitle ) { @@ -1552,7 +1425,7 @@ void SfxAcceleratorConfigPage::StartFileDialog( WinBits nBits, const String& rTi } //----------------------------------------------- -BOOL SfxAcceleratorConfigPage::FillItemSet( SfxItemSet& ) +sal_Bool SfxAcceleratorConfigPage::FillItemSet( SfxItemSet& ) { Apply(m_xAct); try @@ -1562,9 +1435,9 @@ BOOL SfxAcceleratorConfigPage::FillItemSet( SfxItemSet& ) catch(const css::uno::RuntimeException& exRun) { throw exRun; } catch(const css::uno::Exception&) - { return FALSE; } + { return sal_False; } - return TRUE; + return sal_True; } //----------------------------------------------- @@ -1592,7 +1465,7 @@ void SfxAcceleratorConfigPage::Reset( const SfxItemSet& rSet ) RadioHdl(0); const SfxPoolItem* pMacroItem=0; - if( SFX_ITEM_SET == rSet.GetItemState( SID_MACROINFO, TRUE, &pMacroItem ) ) + if( SFX_ITEM_SET == rSet.GetItemState( SID_MACROINFO, sal_True, &pMacroItem ) ) { m_pMacroInfoItem = PTR_CAST( SfxMacroInfoItem, pMacroItem ); pGroupLBox->SelectMacro( m_pMacroInfoItem ); @@ -1600,62 +1473,28 @@ void SfxAcceleratorConfigPage::Reset( const SfxItemSet& rSet ) else { const SfxPoolItem* pStringItem=0; - if( SFX_ITEM_SET == rSet.GetItemState( SID_CHARMAP, TRUE, &pStringItem ) ) + if( SFX_ITEM_SET == rSet.GetItemState( SID_CHARMAP, sal_True, &pStringItem ) ) m_pStringItem = PTR_CAST( SfxStringItem, pStringItem ); const SfxPoolItem* pFontItem=0; - if( SFX_ITEM_SET == rSet.GetItemState( SID_ATTR_SPECIALCHAR, TRUE, &pFontItem ) ) + if( SFX_ITEM_SET == rSet.GetItemState( SID_ATTR_SPECIALCHAR, sal_True, &pFontItem ) ) m_pFontItem = PTR_CAST( SfxStringItem, pFontItem ); - - if ( m_pStringItem ) - pGroupLBox->AddAndSelect( m_pStringItem, m_pFontItem ); - } -} - -//----------------------------------------------- -void SfxAcceleratorConfigPage::SelectMacro(const SfxMacroInfoItem *pItem) -{ - m_pMacroInfoItem = pItem; - pGroupLBox->SelectMacro( pItem ); -} - -//----------------------------------------------- -void SfxAcceleratorConfigPage::CopySource2Target(const css::uno::Reference< css::ui::XAcceleratorConfiguration >& xSourceAccMgr, - const css::uno::Reference< css::ui::XAcceleratorConfiguration >& xTargetAccMgr) -{ - const css::uno::Sequence< css::awt::KeyEvent > lKeys = xSourceAccMgr->getAllKeyEvents(); - sal_Int32 c = lKeys.getLength(); - sal_Int32 i = 0; - for (i=0; i<c; ++i) - { - const css::awt::KeyEvent& rKey = lKeys[i]; - ::rtl::OUString sCommand = xSourceAccMgr->getCommandByKeyEvent(rKey); - xTargetAccMgr->setKeyEvent(rKey, sCommand); } } //----------------------------------------------- -KeyCode SfxAcceleratorConfigPage::MapPosToKeyCode(USHORT nPos) const -{ - TAccInfo* pEntry = (TAccInfo*)aEntriesBox.GetEntry(0, nPos)->GetUserData(); - KeyCode aCode(KEYCODE_ARRAY[pEntry->m_nKeyPos] & 0xFFF , - KEYCODE_ARRAY[pEntry->m_nKeyPos] & (KEY_SHIFT | KEY_MOD2)); - return aCode; -} - -//----------------------------------------------- -USHORT SfxAcceleratorConfigPage::MapKeyCodeToPos(const KeyCode& aKey) const +sal_uInt16 SfxAcceleratorConfigPage::MapKeyCodeToPos(const KeyCode& aKey) const { - USHORT nCode1 = aKey.GetCode()+aKey.GetModifier(); + sal_uInt16 nCode1 = aKey.GetCode()+aKey.GetModifier(); SvLBoxEntry* pEntry = aEntriesBox.First(); - USHORT i = 0; + sal_uInt16 i = 0; while (pEntry) { TAccInfo* pUserData = (TAccInfo*)pEntry->GetUserData(); if (pUserData) { - USHORT nCode2 = pUserData->m_aKey.GetCode()+pUserData->m_aKey.GetModifier(); + sal_uInt16 nCode2 = pUserData->m_aKey.GetCode()+pUserData->m_aKey.GetModifier(); if (nCode1 == nCode2) return i; } diff --git a/cui/source/customize/acccfg.hrc b/cui/source/customize/acccfg.hrc index ccc583d62037..eaa39b11e97b 100644 --- a/cui/source/customize/acccfg.hrc +++ b/cui/source/customize/acccfg.hrc @@ -59,7 +59,7 @@ #define STR_PDF_EXPORT_SEND 59 #define STR_RECHECK_DOCUMENT 60 #define IMG_INFO 61 -#define STR_BASICNAME 62 + // FREE #define BMP_COLLAPSED 63 #define BMP_EXPANDED 64 #define STR_BASICMACROS 67 diff --git a/cui/source/customize/acccfg.src b/cui/source/customize/acccfg.src index c993aca90b90..7e8322fc6eef 100644 --- a/cui/source/customize/acccfg.src +++ b/cui/source/customize/acccfg.src @@ -67,18 +67,21 @@ TabPage RID_SVXPAGE_KEYBOARD Size = MAP_APPFONT ( 273 , 258 ) ; RadioButton RB_OFFICE { + HelpID = "cui:RadioButton:RID_SVXPAGE_KEYBOARD:RB_OFFICE"; Pos = MAP_APPFONT ( 192 , 6 ) ; Size = MAP_APPFONT ( 75 , 10 ) ; Text = "%PRODUCTNAME" ; }; RadioButton RB_MODULE { + HelpID = "cui:RadioButton:RID_SVXPAGE_KEYBOARD:RB_MODULE"; Pos = MAP_APPFONT ( 192 , 19 ) ; Size = MAP_APPFONT ( 75 , 10 ) ; Text = "$(MODULE)" ; }; PushButton BTN_ACC_CHANGE { + HelpID = "cui:PushButton:RID_SVXPAGE_KEYBOARD:BTN_ACC_CHANGE"; Pos = MAP_APPFONT ( 192 , 35 ) ; Size = MAP_APPFONT ( 75 , 14 ) ; TabStop = TRUE ; @@ -86,6 +89,7 @@ TabPage RID_SVXPAGE_KEYBOARD }; PushButton BTN_ACC_REMOVE { + HelpID = "cui:PushButton:RID_SVXPAGE_KEYBOARD:BTN_ACC_REMOVE"; Pos = MAP_APPFONT ( 192 , 52 ) ; Size = MAP_APPFONT ( 75 , 14 ) ; TabStop = TRUE ; @@ -162,6 +166,7 @@ TabPage RID_SVXPAGE_KEYBOARD }; PushButton BTN_LOAD { + HelpID = "cui:PushButton:RID_SVXPAGE_KEYBOARD:BTN_LOAD"; Pos = MAP_APPFONT ( 192 , 86 ) ; Size = MAP_APPFONT ( 75 , 14 ) ; TabStop = TRUE ; @@ -170,6 +175,7 @@ TabPage RID_SVXPAGE_KEYBOARD }; PushButton BTN_SAVE { + HelpID = "cui:PushButton:RID_SVXPAGE_KEYBOARD:BTN_SAVE"; Pos = MAP_APPFONT ( 192 , 103 ) ; Size = MAP_APPFONT ( 75 , 14 ) ; TabStop = TRUE ; @@ -178,6 +184,7 @@ TabPage RID_SVXPAGE_KEYBOARD }; PushButton BTN_RESET { + HelpID = "cui:PushButton:RID_SVXPAGE_KEYBOARD:BTN_RESET"; Pos = MAP_APPFONT ( 192 , 120 ) ; Size = MAP_APPFONT ( 75 , 14 ) ; TabStop = TRUE ; @@ -192,10 +199,6 @@ TabPage RID_SVXPAGE_KEYBOARD { Text [ en-US ] = "Save Keyboard Configuration" ; }; - String STR_SFX_FILTERNAME_ALL - { - Text [ en-US ] = "All files (*.*)" ; - }; String STR_FILTERNAME_CFG { Text [ en-US ] = "Configuration" ; @@ -248,9 +251,6 @@ Resource RID_SVXPAGE_CONFIGGROUPBOX ImageBitmap = Bitmap { File = "im30826.png"; }; MASKCOLOR }; - String STR_BASICNAME - { - Text = "%PRODUCTNAME Basic" ; }; Image BMP_COLLAPSED { diff --git a/cui/source/customize/cfg.cxx b/cui/source/customize/cfg.cxx index 99cb2445acc7..7ab975de6ce2 100644 --- a/cui/source/customize/cfg.cxx +++ b/cui/source/customize/cfg.cxx @@ -42,7 +42,6 @@ #include <sfx2/msg.hxx> #include <sfx2/msgpool.hxx> #include <sfx2/mnumgr.hxx> -#include <sfx2/macrconf.hxx> #include <sfx2/minfitem.hxx> #include <sfx2/objsh.hxx> #include <sfx2/request.hxx> @@ -95,7 +94,6 @@ #define ENTRY_HEIGHT 16 static const char ITEM_DESCRIPTOR_COMMANDURL[] = "CommandURL"; -static const char ITEM_DESCRIPTOR_HELPURL[] = "HelpURL"; static const char ITEM_DESCRIPTOR_CONTAINER[] = "ItemDescriptorContainer"; static const char ITEM_DESCRIPTOR_LABEL[] = "Label"; static const char ITEM_DESCRIPTOR_TYPE[] = "Type"; @@ -127,6 +125,8 @@ namespace container = com::sun::star::container; namespace beans = com::sun::star::beans; namespace graphic = com::sun::star::graphic; +#if OSL_DEBUG_LEVEL > 1 + void printPropertySet( const OUString& prefix, const uno::Reference< beans::XPropertySet >& xPropSet ) @@ -191,6 +191,8 @@ void printEntries(SvxEntries* entries) } } +#endif + OUString stripHotKey( const OUString& str ) { @@ -407,9 +409,9 @@ SvxConfigPage::CanConfig( const OUString& aModuleId ) || aModuleId.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "com.sun.star.frame.Bibliography" ) ) ) { - return FALSE; + return sal_False; } - return TRUE; + return sal_True; } OUString GetModuleName( const OUString& aModuleId ) @@ -490,7 +492,6 @@ bool GetMenuItemData( const uno::Reference< container::XIndexAccess >& rItemContainer, sal_Int32 nIndex, OUString& rCommandURL, - OUString& rHelpURL, OUString& rLabel, sal_uInt16& rType, uno::Reference< container::XIndexAccess >& rSubMenu ) @@ -506,10 +507,6 @@ bool GetMenuItemData( { aProp[i].Value >>= rCommandURL; } - else if ( aProp[i].Name.equalsAscii( ITEM_DESCRIPTOR_HELPURL )) - { - aProp[i].Value >>= rHelpURL; - } else if ( aProp[i].Name.equalsAscii( ITEM_DESCRIPTOR_CONTAINER )) { aProp[i].Value >>= rSubMenu; @@ -524,21 +521,20 @@ bool GetMenuItemData( } } - return TRUE; + return sal_True; } } catch ( ::com::sun::star::lang::IndexOutOfBoundsException& ) { } - return FALSE; + return sal_False; } bool GetToolbarItemData( const uno::Reference< container::XIndexAccess >& rItemContainer, sal_Int32 nIndex, OUString& rCommandURL, - OUString& rHelpURL, OUString& rLabel, sal_uInt16& rType, sal_Bool& rIsVisible, @@ -560,10 +556,6 @@ bool GetToolbarItemData( { aProp[i].Value >>= rStyle; } - else if ( aProp[i].Name.equalsAscii( ITEM_DESCRIPTOR_HELPURL )) - { - aProp[i].Value >>= rHelpURL; - } else if (aProp[i].Name.equalsAscii(ITEM_DESCRIPTOR_CONTAINER)) { aProp[i].Value >>= rSubMenu; @@ -606,13 +598,10 @@ ConvertSvxConfigEntry( static const OUString aDescriptorLabel( RTL_CONSTASCII_USTRINGPARAM( ITEM_DESCRIPTOR_LABEL ) ); - static const OUString aDescriptorHelpURL( - RTL_CONSTASCII_USTRINGPARAM( ITEM_DESCRIPTOR_HELPURL ) ); - static const OUString aDescriptorContainer( RTL_CONSTASCII_USTRINGPARAM( ITEM_DESCRIPTOR_CONTAINER ) ); - uno::Sequence< beans::PropertyValue > aPropSeq( 4 ); + uno::Sequence< beans::PropertyValue > aPropSeq( 3 ); aPropSeq[0].Name = aDescriptorCommandURL; aPropSeq[0].Value <<= rtl::OUString( pEntry->GetCommand() ); @@ -625,9 +614,9 @@ ConvertSvxConfigEntry( // as an empty string. // It will be initialised again later using the command to label map. aPropSeq[2].Name = aDescriptorLabel; - if ( pEntry->HasChangedName() == FALSE && pEntry->GetCommand().getLength() ) + if ( pEntry->HasChangedName() == sal_False && pEntry->GetCommand().getLength() ) { - BOOL isDefaultName = FALSE; + sal_Bool isDefaultName = sal_False; try { uno::Any a( xCommandToLabelMap->getByName( pEntry->GetCommand() ) ); @@ -643,7 +632,7 @@ ConvertSvxConfigEntry( if ( tmpLabel.equals( pEntry->GetName() ) ) { - isDefaultName = TRUE; + isDefaultName = sal_True; } break; @@ -670,9 +659,6 @@ ConvertSvxConfigEntry( aPropSeq[2].Value <<= rtl::OUString( pEntry->GetName() ); } - aPropSeq[3].Name = aDescriptorHelpURL; - aPropSeq[3].Value <<= rtl::OUString( pEntry->GetHelpURL() ); - return aPropSeq; } @@ -690,16 +676,13 @@ ConvertToolbarEntry( static const OUString aDescriptorLabel( RTL_CONSTASCII_USTRINGPARAM( ITEM_DESCRIPTOR_LABEL ) ); - static const OUString aDescriptorHelpURL( - RTL_CONSTASCII_USTRINGPARAM( ITEM_DESCRIPTOR_HELPURL ) ); - static const OUString aDescriptorContainer( RTL_CONSTASCII_USTRINGPARAM( ITEM_DESCRIPTOR_CONTAINER ) ); static const OUString aIsVisible( RTL_CONSTASCII_USTRINGPARAM( ITEM_DESCRIPTOR_ISVISIBLE ) ); - uno::Sequence< beans::PropertyValue > aPropSeq( 5 ); + uno::Sequence< beans::PropertyValue > aPropSeq( 4 ); aPropSeq[0].Name = aDescriptorCommandURL; aPropSeq[0].Value <<= rtl::OUString( pEntry->GetCommand() ); @@ -712,9 +695,9 @@ ConvertToolbarEntry( // as an empty string. // It will be initialised again later using the command to label map. aPropSeq[2].Name = aDescriptorLabel; - if ( pEntry->HasChangedName() == FALSE && pEntry->GetCommand().getLength() ) + if ( pEntry->HasChangedName() == sal_False && pEntry->GetCommand().getLength() ) { - BOOL isDefaultName = FALSE; + sal_Bool isDefaultName = sal_False; try { uno::Any a( xCommandToLabelMap->getByName( pEntry->GetCommand() ) ); @@ -730,7 +713,7 @@ ConvertToolbarEntry( if ( tmpLabel.equals( pEntry->GetName() ) ) { - isDefaultName = TRUE; + isDefaultName = sal_True; } break; @@ -757,11 +740,8 @@ ConvertToolbarEntry( aPropSeq[2].Value <<= rtl::OUString( pEntry->GetName() ); } - aPropSeq[3].Name = aDescriptorHelpURL; - aPropSeq[3].Value <<= rtl::OUString( pEntry->GetHelpURL() ); - - aPropSeq[4].Name = aIsVisible; - aPropSeq[4].Value <<= pEntry->IsVisible(); + aPropSeq[3].Name = aIsVisible; + aPropSeq[3].Value <<= pEntry->IsVisible(); return aPropSeq; } @@ -867,7 +847,7 @@ short SvxConfigDialog::Ok() return SfxTabDialog::Ok(); } -void SvxConfigDialog::PageCreated( USHORT nId, SfxTabPage& rPage ) +void SvxConfigDialog::PageCreated( sal_uInt16 nId, SfxTabPage& rPage ) { (void)rPage; @@ -890,11 +870,6 @@ void SvxConfigDialog::PageCreated( USHORT nId, SfxTabPage& rPage ) } } -void SvxConfigDialog::ActivateTabPage( USHORT nSlotId ) -{ - (void)nSlotId; -} - /****************************************************************************** * * The SaveInData class is used to hold data for entries in the Save In @@ -911,9 +886,9 @@ SaveInData::SaveInData( const OUString& aModuleId, bool isDocConfig ) : - bModified( FALSE ), + bModified( sal_False ), bDocConfig( isDocConfig ), - bReadOnly( FALSE ), + bReadOnly( sal_False ), m_xCfgMgr( xCfgMgr ), m_xParentCfgMgr( xParentCfgMgr ) { @@ -1035,7 +1010,7 @@ Image SaveInData::GetImage( const OUString& rCommandURL ) bool SaveInData::PersistChanges( const uno::Reference< uno::XInterface >& xManager ) { - bool result = TRUE; + bool result = sal_True; try { @@ -1052,7 +1027,7 @@ bool SaveInData::PersistChanges( } catch ( com::sun::star::io::IOException& ) { - result = FALSE; + result = sal_False; } return result; @@ -1115,7 +1090,7 @@ MenuSaveInData::GetEntries() if ( pRootEntry == NULL ) { pRootEntry = new SvxConfigEntry( - String::CreateFromAscii("MainMenus"), String(), TRUE ); + String::CreateFromAscii("MainMenus"), String(), sal_True ); if ( m_xMenuSettings.is() ) { @@ -1159,14 +1134,13 @@ bool MenuSaveInData::LoadSubMenus( { uno::Reference< container::XIndexAccess > xSubMenu; OUString aCommandURL; - OUString aHelpURL; OUString aLabel; - bool bIsUserDefined = TRUE; + bool bIsUserDefined = sal_True; sal_uInt16 nType( css::ui::ItemType::DEFAULT ); bool bItem = GetMenuItemData( xMenuSettings, nIndex, - aCommandURL, aHelpURL, aLabel, nType, xSubMenu ); + aCommandURL, aLabel, nType, xSubMenu ); if ( bItem ) { @@ -1176,11 +1150,11 @@ bool MenuSaveInData::LoadSubMenus( try { a = m_xCommandToLabelMap->getByName( aCommandURL ); - bIsUserDefined = FALSE; + bIsUserDefined = sal_False; } catch ( container::NoSuchElementException& ) { - bIsUserDefined = TRUE; + bIsUserDefined = sal_True; } // If custom label not set retrieve it from the command @@ -1205,10 +1179,9 @@ bool MenuSaveInData::LoadSubMenus( { // popup menu SvxConfigEntry* pEntry = new SvxConfigEntry( - aLabel, aCommandURL, TRUE ); + aLabel, aCommandURL, sal_True ); pEntry->SetUserDefined( bIsUserDefined ); - pEntry->SetHelpURL( aHelpURL ); pEntries->push_back( pEntry ); @@ -1221,7 +1194,7 @@ bool MenuSaveInData::LoadSubMenus( } else { - pEntry->SetMain( TRUE ); + pEntry->SetMain( sal_True ); } subMenuTitle += stripHotKey( aLabel ); @@ -1231,9 +1204,8 @@ bool MenuSaveInData::LoadSubMenus( else { SvxConfigEntry* pEntry = new SvxConfigEntry( - aLabel, aCommandURL, FALSE ); + aLabel, aCommandURL, sal_False ); pEntry->SetUserDefined( bIsUserDefined ); - pEntry->SetHelpURL( aHelpURL ); pEntries->push_back( pEntry ); } } @@ -1250,7 +1222,7 @@ bool MenuSaveInData::LoadSubMenus( bool MenuSaveInData::Apply() { - bool result = FALSE; + bool result = sal_False; if ( IsModified() ) { @@ -1292,7 +1264,7 @@ bool MenuSaveInData::Apply() OSL_TRACE("caught some other exception saving settings"); } - SetModified( FALSE ); + SetModified( sal_False ); result = PersistChanges( GetConfigManager() ); } @@ -1408,7 +1380,7 @@ public: ~PopupPainter() { } void Paint( const Point& rPos, SvLBox& rOutDev, - USHORT nViewDataEntryFlags, SvLBoxEntry* pEntry ) + sal_uInt16 nViewDataEntryFlags, SvLBoxEntry* pEntry ) { SvLBoxString::Paint( rPos, rOutDev, nViewDataEntryFlags, pEntry ); @@ -1462,9 +1434,9 @@ SvxMenuEntriesListBox::SvxMenuEntriesListBox( Window* pParent, const ResId& rResId) : SvTreeListBox( pParent, rResId ) , pPage( (SvxMenuConfigPage*) pParent ) - , m_bIsInternalDrag( FALSE ) + , m_bIsInternalDrag( sal_False ) { - SetWindowBits( + SetStyle( GetStyle() | WB_CLIPCHILDREN | WB_HSCROLL | WB_HIDESELECTION ); SetSpaceBetweenEntries( 3 ); @@ -1491,14 +1463,14 @@ DragDropMode SvxMenuEntriesListBox::NotifyStartDrag( (void)aTransferDataContainer; (void)pEntry; - m_bIsInternalDrag = TRUE; + m_bIsInternalDrag = sal_True; return GetDragDropMode(); } void SvxMenuEntriesListBox::DragFinished( sal_Int8 nDropAction ) { (void)nDropAction; - m_bIsInternalDrag = FALSE; + m_bIsInternalDrag = sal_False; } sal_Int8 SvxMenuEntriesListBox::AcceptDrop( const AcceptDropEvent& rEvt ) @@ -1518,27 +1490,27 @@ sal_Int8 SvxMenuEntriesListBox::AcceptDrop( const AcceptDropEvent& rEvt ) return SvTreeListBox::AcceptDrop( aNewAcceptDropEvent ); } -BOOL SvxMenuEntriesListBox::NotifyAcceptDrop( SvLBoxEntry* ) +sal_Bool SvxMenuEntriesListBox::NotifyAcceptDrop( SvLBoxEntry* ) { - return TRUE; + return sal_True; } -BOOL SvxMenuEntriesListBox::NotifyMoving( +sal_Bool SvxMenuEntriesListBox::NotifyMoving( SvLBoxEntry* pTarget, SvLBoxEntry* pSource, - SvLBoxEntry*& rpNewParent, ULONG& rNewChildPos) + SvLBoxEntry*& rpNewParent, sal_uLong& rNewChildPos) { // only try to do a move if we are dragging within the list box if ( m_bIsInternalDrag ) { - if ( pPage->MoveEntryData( pSource, pTarget ) == TRUE ) + if ( pPage->MoveEntryData( pSource, pTarget ) == sal_True ) { SvTreeListBox::NotifyMoving( pTarget, pSource, rpNewParent, rNewChildPos ); - return TRUE; + return sal_True; } else { - return FALSE; + return sal_False; } } else @@ -1547,9 +1519,9 @@ BOOL SvxMenuEntriesListBox::NotifyMoving( } } -BOOL SvxMenuEntriesListBox::NotifyCopying( +sal_Bool SvxMenuEntriesListBox::NotifyCopying( SvLBoxEntry* pTarget, SvLBoxEntry* pSource, - SvLBoxEntry*& rpNewParent, ULONG& rNewChildPos) + SvLBoxEntry*& rpNewParent, sal_uLong& rNewChildPos) { (void)pSource; (void)rpNewParent; @@ -1562,11 +1534,11 @@ BOOL SvxMenuEntriesListBox::NotifyCopying( // AddFunction already adds the listbox entry so return FALSE // to stop another listbox entry being added - return FALSE; + return sal_False; } // Copying is only allowed from external controls, not within the listbox - return FALSE; + return sal_False; } void SvxMenuEntriesListBox::KeyInput( const KeyEvent& rKeyEvent ) @@ -1581,11 +1553,11 @@ void SvxMenuEntriesListBox::KeyInput( const KeyEvent& rKeyEvent ) // support CTRL+UP and CTRL+DOWN for moving selected entries else if ( keycode.GetCode() == KEY_UP && keycode.IsMod1() ) { - pPage->MoveEntry( TRUE ); + pPage->MoveEntry( sal_True ); } else if ( keycode.GetCode() == KEY_DOWN && keycode.IsMod1() ) { - pPage->MoveEntry( FALSE ); + pPage->MoveEntry( sal_False ); } else { @@ -1643,7 +1615,7 @@ SvxConfigPage::SvxConfigPage( Window *pParent, const SfxItemSet& rSet ) : SfxTabPage( pParent, CUI_RES( RID_SVXPAGE_MENUS ), rSet ), - bInitialised( FALSE ), + bInitialised( sal_False ), pCurrentSaveInData( 0 ), aTopLevelSeparator( this, CUI_RES( GRP_MENUS ) ), aTopLevelLabel( this, CUI_RES( FT_MENUS ) ), @@ -1664,8 +1636,17 @@ SvxConfigPage::SvxConfigPage( pSelectorDlg( 0 ) { aDescriptionField.SetControlBackground( GetSettings().GetStyleSettings().GetDialogColor() ); - aDescriptionField.SetAutoScroll( TRUE ); - aDescriptionField.EnableCursor( FALSE ); + aDescriptionField.SetAutoScroll( sal_True ); + aDescriptionField.EnableCursor( sal_False ); + + aMoveUpButton.SetAccessibleName(String(CUI_RES(BUTTON_STR_UP))); + aMoveDownButton.SetAccessibleName(String(CUI_RES(BUTTON_STR_DOWN))); + aMoveUpButton.SetAccessibleRelationMemberOf(&aContentsSeparator); + aMoveDownButton.SetAccessibleRelationMemberOf(&aContentsSeparator); + aNewTopLevelButton.SetAccessibleRelationMemberOf(&aTopLevelSeparator); + aModifyTopLevelButton.SetAccessibleRelationMemberOf(&aTopLevelSeparator); + aAddCommandsButton.SetAccessibleRelationMemberOf(&aContentsSeparator); + aModifyCommandButton.SetAccessibleRelationMemberOf(&aContentsSeparator); } SvxConfigPage::~SvxConfigPage() @@ -1682,7 +1663,7 @@ void SvxConfigPage::Reset( const SfxItemSet& ) // all other open documents of the same module type if ( !bInitialised ) { - USHORT nPos = 0; + sal_uInt16 nPos = 0; uno::Reference < css::ui::XUIConfigurationManager > xCfgMgr; uno::Reference < css::ui::XUIConfigurationManager > xDocCfgMgr; @@ -1728,7 +1709,7 @@ void SvxConfigPage::Reset( const SfxItemSet& ) pModuleData = CreateSaveInData( xCfgMgr, uno::Reference< css::ui::XUIConfigurationManager >(), aModuleId, - FALSE ); + sal_False ); } catch ( container::NoSuchElementException& ) { @@ -1769,7 +1750,7 @@ void SvxConfigPage::Reset( const SfxItemSet& ) SaveInData* pDocData = NULL; if ( xDocCfgMgr.is() ) { - pDocData = CreateSaveInData( xDocCfgMgr, xCfgMgr, aModuleId, TRUE ); + pDocData = CreateSaveInData( xDocCfgMgr, xCfgMgr, aModuleId, sal_True ); if ( !pDocData->IsReadOnly() ) { @@ -1780,35 +1761,35 @@ void SvxConfigPage::Reset( const SfxItemSet& ) // if an item to select has been passed in (eg. the ResourceURL for a // toolbar) then try to select the SaveInData entry that has that item - bool bURLToSelectFound = FALSE; + bool bURLToSelectFound = sal_False; if ( m_aURLToSelect.getLength() != 0 ) { if ( pDocData != NULL && pDocData->HasURL( m_aURLToSelect ) ) { - aSaveInListBox.SelectEntryPos( nPos, TRUE ); + aSaveInListBox.SelectEntryPos( nPos, sal_True ); pCurrentSaveInData = pDocData; - bURLToSelectFound = TRUE; + bURLToSelectFound = sal_True; } else if ( pModuleData->HasURL( m_aURLToSelect ) ) { - aSaveInListBox.SelectEntryPos( 0, TRUE ); + aSaveInListBox.SelectEntryPos( 0, sal_True ); pCurrentSaveInData = pModuleData; - bURLToSelectFound = TRUE; + bURLToSelectFound = sal_True; } } - if ( bURLToSelectFound == FALSE ) + if ( bURLToSelectFound == sal_False ) { // if the document has menu configuration settings select it // it the SaveIn listbox, otherwise select the module data if ( pDocData != NULL && pDocData->HasSettings() ) { - aSaveInListBox.SelectEntryPos( nPos, TRUE ); + aSaveInListBox.SelectEntryPos( nPos, sal_True ); pCurrentSaveInData = pDocData; } else { - aSaveInListBox.SelectEntryPos( 0, TRUE ); + aSaveInListBox.SelectEntryPos( 0, sal_True ); pCurrentSaveInData = pModuleData; } } @@ -1884,7 +1865,7 @@ void SvxConfigPage::Reset( const SfxItemSet& ) if ( xDocCfgMgr.is() ) { - pData = CreateSaveInData( xDocCfgMgr, xCfgMgr, aModuleId, TRUE ); + pData = CreateSaveInData( xDocCfgMgr, xCfgMgr, aModuleId, sal_True ); if ( pData && !pData->IsReadOnly() ) { @@ -1900,7 +1881,7 @@ void SvxConfigPage::Reset( const SfxItemSet& ) aSaveInListBox.SetSelectHdl( LINK( this, SvxConfigPage, SelectSaveInLocation ) ); - bInitialised = TRUE; + bInitialised = sal_True; Init(); } @@ -1971,11 +1952,11 @@ void SvxConfigPage::Reset( const SfxItemSet& ) return sModuleID; } -BOOL SvxConfigPage::FillItemSet( SfxItemSet& ) +sal_Bool SvxConfigPage::FillItemSet( SfxItemSet& ) { - bool result = FALSE; + bool result = sal_False; - for ( USHORT i = 0 ; i < aSaveInListBox.GetEntryCount(); ++i ) + for ( sal_uInt16 i = 0 ; i < aSaveInListBox.GetEntryCount(); ++i ) { SaveInData* pData = (SaveInData*) aSaveInListBox.GetEntryData( i ); @@ -2027,7 +2008,7 @@ IMPL_LINK( SvxConfigPage, SelectSaveInLocation, ListBox *, pBox ) void SvxConfigPage::ReloadTopLevelListBox( SvxConfigEntry* pToSelect ) { - USHORT nSelectionPos = aTopLevelListBox.GetSelectEntryPos(); + sal_uInt16 nSelectionPos = aTopLevelListBox.GetSelectEntryPos(); aTopLevelListBox.Clear(); if ( GetSaveInData() && GetSaveInData()->GetEntries() ) @@ -2038,7 +2019,7 @@ void SvxConfigPage::ReloadTopLevelListBox( SvxConfigEntry* pToSelect ) for ( ; iter != end; ++iter ) { SvxConfigEntry* pEntryData = *iter; - USHORT nPos = aTopLevelListBox.InsertEntry( stripHotKey( pEntryData->GetName() ) ); + sal_uInt16 nPos = aTopLevelListBox.InsertEntry( stripHotKey( pEntryData->GetName() ) ); aTopLevelListBox.SetEntryData( nPos, pEntryData ); if ( pEntryData == pToSelect ) @@ -2059,7 +2040,7 @@ void SvxConfigPage::ReloadTopLevelListBox( SvxConfigEntry* pToSelect ) nSelectionPos = nSelectionPos < aTopLevelListBox.GetEntryCount() ? nSelectionPos : aTopLevelListBox.GetEntryCount() - 1; - aTopLevelListBox.SelectEntryPos( nSelectionPos, TRUE ); + aTopLevelListBox.SelectEntryPos( nSelectionPos, sal_True ); aTopLevelListBox.GetSelectHdl().Call( this ); } @@ -2079,7 +2060,7 @@ void SvxConfigPage::AddSubMenusToUI( subMenuTitle += OUString::createFromAscii( pMenuSeparatorStr ); subMenuTitle += stripHotKey( pEntryData->GetName() ); - USHORT nPos = aTopLevelListBox.InsertEntry( subMenuTitle ); + sal_uInt16 nPos = aTopLevelListBox.InsertEntry( subMenuTitle ); aTopLevelListBox.SetEntryData( nPos, pEntryData ); AddSubMenusToUI( subMenuTitle, pEntryData ); @@ -2128,9 +2109,8 @@ SvLBoxEntry* SvxConfigPage::AddFunction( } SvxConfigEntry* pNewEntryData = - new SvxConfigEntry( aDisplayName, aURL, FALSE ); - pNewEntryData->SetUserDefined( TRUE ); - pNewEntryData->SetHelpURL( aURL ); + new SvxConfigEntry( aDisplayName, aURL, sal_False ); + pNewEntryData->SetUserDefined( sal_True ); // check that this function is not already in the menu SvxConfigEntry* pParent = GetTopLevelSelection(); @@ -2190,7 +2170,7 @@ SvLBoxEntry* SvxConfigPage::InsertEntry( SvxEntries::const_iterator end = pEntries->end(); // Advance the iterator to the data for currently selected entry - USHORT nPos = 0; + sal_uInt16 nPos = 0; while (*iter != pEntryData && ++iter != end) { ++nPos; @@ -2213,14 +2193,14 @@ SvLBoxEntry* SvxConfigPage::InsertEntry( aContentsListBox->Select( pNewEntry ); aContentsListBox->MakeVisible( pNewEntry ); - GetSaveInData()->SetModified( TRUE ); + GetSaveInData()->SetModified( sal_True ); } return pNewEntry; } SvLBoxEntry* SvxConfigPage::InsertEntryIntoUI( - SvxConfigEntry* pNewEntryData, ULONG nPos ) + SvxConfigEntry* pNewEntryData, sal_uLong nPos ) { SvLBoxEntry* pNewEntry = NULL; @@ -2228,7 +2208,7 @@ SvLBoxEntry* SvxConfigPage::InsertEntryIntoUI( { pNewEntry = aContentsListBox->InsertEntry( String::CreateFromAscii( pSeparatorStr ), - 0, FALSE, nPos, pNewEntryData ); + 0, sal_False, nPos, pNewEntryData ); } else { @@ -2240,12 +2220,12 @@ SvLBoxEntry* SvxConfigPage::InsertEntryIntoUI( if ( !!aImage ) { pNewEntry = aContentsListBox->InsertEntry( - aName, aImage, aImage, 0, FALSE, nPos, pNewEntryData ); + aName, aImage, aImage, 0, sal_False, nPos, pNewEntryData ); } else { pNewEntry = aContentsListBox->InsertEntry( - aName, 0, FALSE, nPos, pNewEntryData ); + aName, 0, sal_False, nPos, pNewEntryData ); } if ( pNewEntryData->IsPopup() || @@ -2318,7 +2298,7 @@ bool SvxConfigPage::MoveEntryData( //modified by shizhoubo for issue53677 if ( NULL == pSourceEntry || NULL == pTargetEntry ) { - return FALSE; + return sal_False; } // Grab the entries list for the currently selected menu @@ -2333,9 +2313,9 @@ bool SvxConfigPage::MoveEntryData( pEntries->insert( pEntries->begin(), pSourceData ); - GetSaveInData()->SetModified( TRUE ); + GetSaveInData()->SetModified( sal_True ); - return TRUE; + return sal_True; } else { @@ -2356,13 +2336,13 @@ bool SvxConfigPage::MoveEntryData( // insert the source entry at the position after the target pEntries->insert( ++iter, pSourceData ); - GetSaveInData()->SetModified( TRUE ); + GetSaveInData()->SetModified( sal_True ); - return TRUE; + return sal_True; } } - return FALSE; + return sal_False; } SvxMenuConfigPage::SvxMenuConfigPage( @@ -2417,13 +2397,13 @@ void SvxMenuConfigPage::Init() ReloadTopLevelListBox(); - aTopLevelListBox.SelectEntryPos(0, TRUE); + aTopLevelListBox.SelectEntryPos(0, sal_True); aTopLevelListBox.GetSelectHdl().Call(this); } SvxMenuConfigPage::~SvxMenuConfigPage() { - for ( USHORT i = 0 ; i < aSaveInListBox.GetEntryCount(); ++i ) + for ( sal_uInt16 i = 0 ; i < aSaveInListBox.GetEntryCount(); ++i ) { MenuSaveInData* pData = (MenuSaveInData*) aSaveInListBox.GetEntryData( i ); @@ -2457,12 +2437,12 @@ void SvxMenuConfigPage::UpdateButtonStates() if ( aContentsListBox->GetEntryCount() == 0 || selection == NULL ) { - aMoveUpButton.Enable( FALSE ); - aMoveDownButton.Enable( FALSE ); + aMoveUpButton.Enable( sal_False ); + aMoveDownButton.Enable( sal_False ); - pPopup->EnableItem( ID_BEGIN_GROUP, TRUE ); - pPopup->EnableItem( ID_RENAME, FALSE ); - pPopup->EnableItem( ID_DELETE, FALSE ); + pPopup->EnableItem( ID_BEGIN_GROUP, sal_True ); + pPopup->EnableItem( ID_RENAME, sal_False ); + pPopup->EnableItem( ID_DELETE, sal_False ); aDescriptionField.Clear(); @@ -2480,17 +2460,17 @@ void SvxMenuConfigPage::UpdateButtonStates() if ( pEntryData->IsSeparator() ) { - pPopup->EnableItem( ID_DELETE, TRUE ); - pPopup->EnableItem( ID_BEGIN_GROUP, FALSE ); - pPopup->EnableItem( ID_RENAME, FALSE ); + pPopup->EnableItem( ID_DELETE, sal_True ); + pPopup->EnableItem( ID_BEGIN_GROUP, sal_False ); + pPopup->EnableItem( ID_RENAME, sal_False ); aDescriptionField.Clear(); } else { - pPopup->EnableItem( ID_BEGIN_GROUP, TRUE ); - pPopup->EnableItem( ID_DELETE, TRUE ); - pPopup->EnableItem( ID_RENAME, TRUE ); + pPopup->EnableItem( ID_BEGIN_GROUP, sal_True ); + pPopup->EnableItem( ID_DELETE, sal_True ); + pPopup->EnableItem( ID_RENAME, sal_True ); aDescriptionField.SetNewText( pEntryData->GetHelpText() ); } @@ -2508,7 +2488,7 @@ void SvxMenuConfigPage::DeleteSelectedTopLevel() ReloadTopLevelListBox(); - GetSaveInData()->SetModified( TRUE ); + GetSaveInData()->SetModified( sal_True ); } bool SvxMenuConfigPage::DeleteSelectedContent() @@ -2539,11 +2519,11 @@ bool SvxMenuConfigPage::DeleteSelectedContent() // delete data for menu entry delete pMenuEntry; - GetSaveInData()->SetModified( TRUE ); + GetSaveInData()->SetModified( sal_True ); - return TRUE; + return sal_True; } - return FALSE; + return sal_False; } short SvxMenuConfigPage::QueryReset() @@ -2619,7 +2599,7 @@ IMPL_LINK( SvxMenuConfigPage, MenuSelectHdl, MenuButton *, pButton ) ReloadTopLevelListBox(); - GetSaveInData()->SetModified( TRUE ); + GetSaveInData()->SetModified( sal_True ); } // #i68101# Memory leak (!) @@ -2643,7 +2623,7 @@ IMPL_LINK( SvxMenuConfigPage, MenuSelectHdl, MenuButton *, pButton ) ReloadTopLevelListBox( pDialog->GetSelectedEntry() ); - GetSaveInData()->SetModified( TRUE ); + GetSaveInData()->SetModified( sal_True ); } delete pDialog; @@ -2651,9 +2631,9 @@ IMPL_LINK( SvxMenuConfigPage, MenuSelectHdl, MenuButton *, pButton ) break; } default: - return FALSE; + return sal_False; } - return TRUE; + return sal_True; } IMPL_LINK( SvxMenuConfigPage, EntrySelectHdl, MenuButton *, pButton ) @@ -2675,14 +2655,14 @@ IMPL_LINK( SvxMenuConfigPage, EntrySelectHdl, MenuButton *, pButton ) pNameDialog->GetName(aNewName); SvxConfigEntry* pNewEntryData = - new SvxConfigEntry( aNewName, aNewName, TRUE ); - pNewEntryData->SetUserDefined( TRUE ); + new SvxConfigEntry( aNewName, aNewName, sal_True ); + pNewEntryData->SetUserDefined( sal_True ); InsertEntry( pNewEntryData ); ReloadTopLevelListBox(); - GetSaveInData()->SetModified( TRUE ); + GetSaveInData()->SetModified( sal_True ); } delete pNameDialog; @@ -2692,7 +2672,7 @@ IMPL_LINK( SvxMenuConfigPage, EntrySelectHdl, MenuButton *, pButton ) case ID_BEGIN_GROUP: { SvxConfigEntry* pNewEntryData = new SvxConfigEntry; - pNewEntryData->SetUserDefined( TRUE ); + pNewEntryData->SetUserDefined( sal_True ); InsertEntry( pNewEntryData ); break; @@ -2723,7 +2703,7 @@ IMPL_LINK( SvxMenuConfigPage, EntrySelectHdl, MenuButton *, pButton ) pEntry->SetName( aNewName ); aContentsListBox->SetEntryText( pActEntry, aNewName ); - GetSaveInData()->SetModified( TRUE ); + GetSaveInData()->SetModified( sal_True ); } delete pNameDialog; @@ -2732,7 +2712,7 @@ IMPL_LINK( SvxMenuConfigPage, EntrySelectHdl, MenuButton *, pButton ) } default: { - return FALSE; + return sal_False; } } @@ -2741,7 +2721,7 @@ IMPL_LINK( SvxMenuConfigPage, EntrySelectHdl, MenuButton *, pButton ) UpdateButtonStates(); } - return TRUE; + return sal_True; } IMPL_LINK( SvxMenuConfigPage, AddFunctionHdl, @@ -2760,7 +2740,7 @@ IMPL_LINK( SvxMenuConfigPage, NewMenuHdl, Button *, pButton ) SvxMainMenuOrganizerDialog* pDialog = new SvxMainMenuOrganizerDialog( 0, - GetSaveInData()->GetEntries(), NULL, TRUE ); + GetSaveInData()->GetEntries(), NULL, sal_True ); bool ret = pDialog->Execute(); @@ -2768,7 +2748,7 @@ IMPL_LINK( SvxMenuConfigPage, NewMenuHdl, Button *, pButton ) { GetSaveInData()->SetEntries( pDialog->GetEntries() ); ReloadTopLevelListBox( pDialog->GetSelectedEntry() ); - GetSaveInData()->SetModified( TRUE ); + GetSaveInData()->SetModified( sal_True ); } delete pDialog; @@ -2783,7 +2763,7 @@ IMPL_LINK( SvxMenuConfigPage, AddCommandsHdl, Button *, pButton ) if ( pSelectorDlg == NULL ) { // Create Script Selector which also shows builtin commands - pSelectorDlg = new SvxScriptSelectorDialog( this, TRUE, m_xFrame ); + pSelectorDlg = new SvxScriptSelectorDialog( this, sal_True, m_xFrame ); pSelectorDlg->SetAddHdl( LINK( this, SvxMenuConfigPage, AddFunctionHdl ) ); @@ -2827,7 +2807,7 @@ SvxMainMenuOrganizerDialog::SvxMainMenuOrganizerDialog( aOKButton( this, CUI_RES( BTN_MENU_ADD ) ), aCloseButton( this, CUI_RES( BTN_MENU_CLOSE ) ), aHelpButton( this, CUI_RES( BTN_MENU_HELP ) ), - bModified( FALSE ) + bModified( sal_False ) { FreeResource(); @@ -2866,9 +2846,9 @@ SvxMainMenuOrganizerDialog::SvxMainMenuOrganizerDialog( OUString newurl = generateCustomMenuURL( pEntries ); SvxConfigEntry* pNewEntryData = - new SvxConfigEntry( newname, newurl, TRUE ); - pNewEntryData->SetUserDefined( TRUE ); - pNewEntryData->SetMain( TRUE ); + new SvxConfigEntry( newname, newurl, sal_True ); + pNewEntryData->SetUserDefined( sal_True ); + pNewEntryData->SetMain( sal_True ); pNewMenuEntry = aMenuListBox.InsertEntry( stripHotKey( pNewEntryData->GetName() ) ); @@ -2925,6 +2905,9 @@ SvxMainMenuOrganizerDialog::SvxMainMenuOrganizerDialog( LINK( this, SvxMainMenuOrganizerDialog, MoveHdl) ); aMoveDownButton.SetClickHdl ( LINK( this, SvxMainMenuOrganizerDialog, MoveHdl) ); + + aMoveUpButton.SetAccessibleName(String(CUI_RES(BUTTON_STR_UP))); + aMoveDownButton.SetAccessibleName(String(CUI_RES(BUTTON_STR_DOWN))); } IMPL_LINK(SvxMainMenuOrganizerDialog, ModifyHdl, Edit*, pEdit) @@ -3012,7 +2995,7 @@ IMPL_LINK( SvxMainMenuOrganizerDialog, MoveHdl, Button *, pButton ) aMenuListBox.GetModel()->Move( pSourceEntry, pTargetEntry ); aMenuListBox.MakeVisible( pSourceEntry ); - bModified = TRUE; + bModified = sal_True; } } @@ -3034,203 +3017,31 @@ SvxConfigEntry* SvxMainMenuOrganizerDialog::GetSelectedEntry() return (SvxConfigEntry*)aMenuListBox.FirstSelected()->GetUserData(); } -SvxConfigEntry::SvxConfigEntry( - const uno::Sequence< beans::PropertyValue >& rProperties, - const uno::Reference< container::XNameAccess >& rCommandToLabelMap ) - : - nId( 1 ), - bPopUp( FALSE ), - bStrEdited( FALSE ), - bIsUserDefined( FALSE ), - bIsMain( FALSE ), - bIsParentData( FALSE ), - bIsVisible( TRUE ), - nStyle( 0 ), - pEntries( 0 ) -{ - sal_uInt16 nType( css::ui::ItemType::DEFAULT ); - OUString aHelpURL_; - - for ( sal_Int32 i = 0; i < rProperties.getLength(); ++i ) - { - if ( rProperties[i].Name.equalsAscii( ITEM_DESCRIPTOR_COMMANDURL )) - { - rProperties[i].Value >>= aCommand; - } - else if ( rProperties[i].Name.equalsAscii( ITEM_DESCRIPTOR_HELPURL )) - { - rProperties[i].Value >>= aHelpURL_; - } - else if ( rProperties[i].Name.equalsAscii( ITEM_DESCRIPTOR_LABEL )) - { - rProperties[i].Value >>= aLabel; - } - else if ( rProperties[i].Name.equalsAscii( ITEM_DESCRIPTOR_TYPE )) - { - rProperties[i].Value >>= nType; - } - } - - if ( nType == css::ui::ItemType::DEFAULT ) - { - uno::Any a; - try - { - a = rCommandToLabelMap->getByName( aCommand ); - bIsUserDefined = FALSE; - } - catch ( container::NoSuchElementException& ) - { - bIsUserDefined = TRUE; - } - - // If custom label not set retrieve it from the command to info service - if ( aLabel.equals( OUString() ) ) - { - uno::Sequence< beans::PropertyValue > aPropSeq; - if ( a >>= aPropSeq ) - { - for ( sal_Int32 i = 0; i < aPropSeq.getLength(); ++i ) - { - if ( aPropSeq[i].Name.equalsAscii( ITEM_DESCRIPTOR_LABEL ) ) - { - aPropSeq[i].Value >>= aLabel; - break; - } - } - } - } - } -} - const OUString& SvxConfigEntry::GetHelpText() { if ( aHelpText.getLength() == 0 ) { - OUString helpid(RTL_CONSTASCII_USTRINGPARAM( "helpid:" )); - if ( aHelpURL.indexOf( helpid ) != -1 ) - { - aHelpURL = aHelpURL.copy( helpid.getLength() ); - } - - Help* pHelp = Application::GetHelp(); - if ( aHelpURL.toInt32() != 0 ) + if ( aCommand.getLength() ) { - aHelpText = pHelp->GetHelpText( aHelpURL.toInt32(), NULL ); - } - - if ( aHelpText.getLength() == 0 && aCommand.getLength() != 0 ) - { - aHelpText = pHelp->GetHelpText( aCommand, NULL ); + aHelpText = Application::GetHelp()->GetHelpText( aCommand, NULL ); } } return aHelpText; } -uno::Sequence< beans::PropertyValue > -SvxConfigEntry::GetProperties( - const uno::Reference< container::XNameAccess >& rCommandToLabelMap ) -{ - if ( IsSeparator() ) - { - uno::Sequence< beans::PropertyValue > aPropSeq( 1 ); - - aPropSeq[0].Name = OUString( - RTL_CONSTASCII_USTRINGPARAM( ITEM_DESCRIPTOR_TYPE ) ); - aPropSeq[0].Value <<= css::ui::ItemType::SEPARATOR_LINE; - - return aPropSeq; - } - - static const OUString aDescriptorCommandURL ( - RTL_CONSTASCII_USTRINGPARAM( ITEM_DESCRIPTOR_COMMANDURL ) ); - - static const OUString aDescriptorType( - RTL_CONSTASCII_USTRINGPARAM( ITEM_DESCRIPTOR_TYPE ) ); - - static const OUString aDescriptorLabel( - RTL_CONSTASCII_USTRINGPARAM( ITEM_DESCRIPTOR_LABEL ) ); - - static const OUString aDescriptorHelpURL( - RTL_CONSTASCII_USTRINGPARAM( ITEM_DESCRIPTOR_HELPURL ) ); - - uno::Sequence< beans::PropertyValue > aPropSeq( 4 ); - - aPropSeq[0].Name = aDescriptorCommandURL; - aPropSeq[0].Value <<= rtl::OUString( GetCommand() ); - - aPropSeq[1].Name = aDescriptorType; - aPropSeq[1].Value <<= css::ui::ItemType::DEFAULT; - - // If the name has not been changed and the name is the same as - // in the default command to label map then the label can be stored - // as an empty string. - // It will be initialised again later using the command to label map. - aPropSeq[2].Name = aDescriptorLabel; - if ( HasChangedName() == FALSE && GetCommand().getLength() ) - { - BOOL isDefaultName = FALSE; - try - { - uno::Any a( rCommandToLabelMap->getByName( GetCommand() ) ); - uno::Sequence< beans::PropertyValue > tmpPropSeq; - if ( a >>= tmpPropSeq ) - { - for ( sal_Int32 i = 0; i < tmpPropSeq.getLength(); ++i ) - { - if ( tmpPropSeq[i].Name.equals( aDescriptorLabel ) ) - { - OUString tmpLabel; - tmpPropSeq[i].Value >>= tmpLabel; - - if ( tmpLabel.equals( GetName() ) ) - { - isDefaultName = TRUE; - } - - break; - } - } - } - } - catch ( container::NoSuchElementException& ) - { - // isDefaultName is left as FALSE - } - - if ( isDefaultName ) - { - aPropSeq[2].Value <<= rtl::OUString(); - } - else - { - aPropSeq[2].Value <<= rtl::OUString( GetName() ); - } - } - else - { - aPropSeq[2].Value <<= rtl::OUString( GetName() ); - } - - aPropSeq[3].Name = aDescriptorHelpURL; - aPropSeq[3].Value <<= rtl::OUString( GetHelpURL() ); - - return aPropSeq; -} - SvxConfigEntry::SvxConfigEntry( const OUString& rDisplayName, const OUString& rCommandURL, bool bPopup, bool bParentData ) : nId( 1 ) , aLabel(rDisplayName) , aCommand(rCommandURL) , bPopUp(bPopup) - , bStrEdited( FALSE ) - , bIsUserDefined( FALSE ) - , bIsMain( FALSE ) + , bStrEdited( sal_False ) + , bIsUserDefined( sal_False ) + , bIsMain( sal_False ) , bIsParentData( bParentData ) - , bIsVisible( TRUE ) + , bIsVisible( sal_True ) , nStyle( 0 ) , pEntries( 0 ) { @@ -3258,27 +3069,27 @@ bool SvxConfigEntry::IsMovable() { if ( IsPopup() && !IsMain() ) { - return FALSE; + return sal_False; } - return TRUE; + return sal_True; } bool SvxConfigEntry::IsDeletable() { if ( IsMain() && !IsUserDefined() ) { - return FALSE; + return sal_False; } - return TRUE; + return sal_True; } bool SvxConfigEntry::IsRenamable() { if ( IsMain() && !IsUserDefined() ) { - return FALSE; + return sal_False; } - return TRUE; + return sal_True; } SvxToolbarConfigPage::SvxToolbarConfigPage( @@ -3323,8 +3134,8 @@ SvxToolbarConfigPage::SvxToolbarConfigPage( aMoveDownButton.SetClickHdl ( LINK( this, SvxToolbarConfigPage, MoveHdl) ); // Always enable Up and Down buttons // added for issue i53677 by shizhoubo - aMoveDownButton.Enable( TRUE ); - aMoveUpButton.Enable( TRUE ); + aMoveDownButton.Enable( sal_True ); + aMoveUpButton.Enable( sal_True ); PopupMenu* pMenu = new PopupMenu( CUI_RES( MODIFY_TOOLBAR ) ); pMenu->SetMenuFlags( @@ -3378,7 +3189,7 @@ SvxToolbarConfigPage::SvxToolbarConfigPage( SvxToolbarConfigPage::~SvxToolbarConfigPage() { - for ( USHORT i = 0 ; i < aSaveInListBox.GetEntryCount(); ++i ) + for ( sal_uInt16 i = 0 ; i < aSaveInListBox.GetEntryCount(); ++i ) { ToolbarSaveInData* pData = (ToolbarSaveInData*) aSaveInListBox.GetEntryData( i ); @@ -3397,7 +3208,7 @@ SvxToolbarConfigPage::~SvxToolbarConfigPage() void SvxToolbarConfigPage::DeleteSelectedTopLevel() { - USHORT nSelectionPos = aTopLevelListBox.GetSelectEntryPos(); + sal_uInt16 nSelectionPos = aTopLevelListBox.GetSelectEntryPos(); ToolbarSaveInData* pSaveInData = (ToolbarSaveInData*) GetSaveInData(); pSaveInData->RemoveToolbar( GetTopLevelSelection() ); @@ -3408,11 +3219,11 @@ void SvxToolbarConfigPage::DeleteSelectedTopLevel() // subtract one from the entry count if ( nSelectionPos != aTopLevelListBox.GetEntryCount() - 1 ) { - aTopLevelListBox.SelectEntryPos( nSelectionPos + 1, TRUE ); + aTopLevelListBox.SelectEntryPos( nSelectionPos + 1, sal_True ); } else { - aTopLevelListBox.SelectEntryPos( nSelectionPos - 1, TRUE ); + aTopLevelListBox.SelectEntryPos( nSelectionPos - 1, sal_True ); } aTopLevelListBox.GetSelectHdl().Call( this ); @@ -3464,10 +3275,10 @@ bool SvxToolbarConfigPage::DeleteSelectedContent() } } - return TRUE; + return sal_True; } - return FALSE; + return sal_False; } IMPL_LINK( SvxToolbarConfigPage, MoveHdl, Button *, pButton ) @@ -3493,7 +3304,7 @@ void SvxToolbarConfigPage::MoveEntry( bool bMoveUp ) IMPL_LINK( SvxToolbarConfigPage, ToolbarSelectHdl, MenuButton *, pButton ) { - USHORT nSelectionPos = aTopLevelListBox.GetSelectEntryPos(); + sal_uInt16 nSelectionPos = aTopLevelListBox.GetSelectEntryPos(); SvxConfigEntry* pToolbar = (SvxConfigEntry*)aTopLevelListBox.GetEntryData( nSelectionPos ); @@ -3588,7 +3399,7 @@ IMPL_LINK( SvxToolbarConfigPage, ToolbarSelectHdl, MenuButton *, pButton ) IMPL_LINK( SvxToolbarConfigPage, EntrySelectHdl, MenuButton *, pButton ) { - bool bNeedsApply = FALSE; + bool bNeedsApply = sal_False; // get currently selected toolbar SvxConfigEntry* pToolbar = GetTopLevelSelection(); @@ -3616,7 +3427,7 @@ IMPL_LINK( SvxToolbarConfigPage, EntrySelectHdl, MenuButton *, pButton ) pEntry->SetName( aNewName ); aContentsListBox->SetEntryText( pActEntry, aNewName ); - bNeedsApply = TRUE; + bNeedsApply = sal_True; } delete pNameDialog; @@ -3628,10 +3439,10 @@ IMPL_LINK( SvxToolbarConfigPage, EntrySelectHdl, MenuButton *, pButton ) SvxConfigEntry* pEntry = (SvxConfigEntry*) pActEntry->GetUserData(); - USHORT nSelectionPos = 0; + sal_uInt16 nSelectionPos = 0; // find position of entry within the list - for ( USHORT i = 0; i < aContentsListBox->GetEntryCount(); ++i ) + for ( sal_uInt16 i = 0; i < aContentsListBox->GetEntryCount(); ++i ) { if ( aContentsListBox->GetEntry( 0, i ) == pActEntry ) { @@ -3651,7 +3462,7 @@ IMPL_LINK( SvxToolbarConfigPage, EntrySelectHdl, MenuButton *, pButton ) pEntry->SetName( aSystemName ); aContentsListBox->SetEntryText( pActEntry, stripHotKey( aSystemName ) ); - bNeedsApply = TRUE; + bNeedsApply = sal_True; } uno::Sequence< OUString > aURLSeq( 1 ); @@ -3681,7 +3492,7 @@ IMPL_LINK( SvxToolbarConfigPage, EntrySelectHdl, MenuButton *, pButton ) aContentsListBox->Select( pNewLBEntry ); aContentsListBox->MakeVisible( pNewLBEntry ); - bNeedsApply = TRUE; + bNeedsApply = sal_True; } catch ( uno::Exception& ) { @@ -3692,14 +3503,14 @@ IMPL_LINK( SvxToolbarConfigPage, EntrySelectHdl, MenuButton *, pButton ) case ID_BEGIN_GROUP: { SvxConfigEntry* pNewEntryData = new SvxConfigEntry; - pNewEntryData->SetUserDefined( TRUE ); + pNewEntryData->SetUserDefined( sal_True ); SvLBoxEntry* pNewLBEntry = InsertEntry( pNewEntryData ); aContentsListBox->SetCheckButtonState( pNewLBEntry, SV_BUTTON_TRISTATE ); - bNeedsApply = TRUE; + bNeedsApply = sal_True; break; } case ID_DELETE: @@ -3725,10 +3536,10 @@ IMPL_LINK( SvxToolbarConfigPage, EntrySelectHdl, MenuButton *, pButton ) SvxConfigEntry* pEntry = (SvxConfigEntry*) pActEntry->GetUserData(); - USHORT nSelectionPos = 0; + sal_uInt16 nSelectionPos = 0; // find position of entry within the list - for ( USHORT i = 0; i < aContentsListBox->GetEntryCount(); ++i ) + for ( sal_uInt16 i = 0; i < aContentsListBox->GetEntryCount(); ++i ) { if ( aContentsListBox->GetEntry( 0, i ) == pActEntry ) { @@ -3808,10 +3619,10 @@ IMPL_LINK( SvxToolbarConfigPage, EntrySelectHdl, MenuButton *, pButton ) SvxConfigEntry* pEntry = (SvxConfigEntry*) pActEntry->GetUserData(); - USHORT nSelectionPos = 0; + sal_uInt16 nSelectionPos = 0; // find position of entry within the list - for ( USHORT i = 0; i < aContentsListBox->GetEntryCount(); ++i ) + for ( sal_uInt16 i = 0; i < aContentsListBox->GetEntryCount(); ++i ) { if ( aContentsListBox->GetEntry( 0, i ) == pActEntry ) { @@ -3863,7 +3674,7 @@ IMPL_LINK( SvxToolbarConfigPage, EntrySelectHdl, MenuButton *, pButton ) } } - if ( bNeedsApply == TRUE ) + if ( bNeedsApply == sal_True ) { (( ToolbarSaveInData* ) GetSaveInData())->ApplyToolbar( pToolbar ); UpdateButtonStates(); @@ -3880,10 +3691,10 @@ void SvxToolbarConfigPage::Init() ReloadTopLevelListBox(); - USHORT nPos = 0; + sal_uInt16 nPos = 0; if ( m_aURLToSelect.getLength() != 0 ) { - for ( USHORT i = 0 ; i < aTopLevelListBox.GetEntryCount(); ++i ) + for ( sal_uInt16 i = 0 ; i < aTopLevelListBox.GetEntryCount(); ++i ) { SvxConfigEntry* pData = (SvxConfigEntry*) aTopLevelListBox.GetEntryData( i ); @@ -3900,7 +3711,7 @@ void SvxToolbarConfigPage::Init() m_aURLToSelect += OUString(RTL_CONSTASCII_USTRINGPARAM( "standardbar" )); } - aTopLevelListBox.SelectEntryPos(nPos, TRUE); + aTopLevelListBox.SelectEntryPos(nPos, sal_True); aTopLevelListBox.GetSelectHdl().Call(this); } @@ -4149,7 +3960,7 @@ SvxEntries* ToolbarSaveInData::GetEntries() { pRootEntry = new SvxConfigEntry( - String::CreateFromAscii("MainToolbars"), String(), TRUE ); + String::CreateFromAscii("MainToolbars"), String(), sal_True ); uno::Sequence< uno::Sequence < beans::PropertyValue > > info = GetConfigManager()->getUIElementsInfo( @@ -4193,9 +4004,9 @@ SvxEntries* ToolbarSaveInData::GetEntries() } SvxConfigEntry* pEntry = new SvxConfigEntry( - uiname, url, TRUE ); + uiname, url, sal_True ); - pEntry->SetMain( TRUE ); + pEntry->SetMain( sal_True ); pEntry->SetStyle( GetSystemStyle( url ) ); @@ -4205,11 +4016,11 @@ SvxEntries* ToolbarSaveInData::GetEntries() OUString custom(RTL_CONSTASCII_USTRINGPARAM(CUSTOM_TOOLBAR_STR)); if ( systemname.indexOf( custom ) == 0 ) { - pEntry->SetUserDefined( TRUE ); + pEntry->SetUserDefined( sal_True ); } else { - pEntry->SetUserDefined( FALSE ); + pEntry->SetUserDefined( sal_False ); } pRootEntry->GetEntries()->push_back( pEntry ); @@ -4281,18 +4092,18 @@ SvxEntries* ToolbarSaveInData::GetEntries() } SvxConfigEntry* pEntry = new SvxConfigEntry( - uiname, url, TRUE, TRUE ); + uiname, url, sal_True, sal_True ); - pEntry->SetMain( TRUE ); + pEntry->SetMain( sal_True ); pEntry->SetStyle( GetSystemStyle( url ) ); if ( systemname.indexOf( custom ) == 0 ) { - pEntry->SetUserDefined( TRUE ); + pEntry->SetUserDefined( sal_True ); } else { - pEntry->SetUserDefined( FALSE ); + pEntry->SetUserDefined( sal_False ); } pRootEntry->GetEntries()->push_back( pEntry ); @@ -4339,14 +4150,14 @@ ToolbarSaveInData::HasURL( const OUString& rURL ) if ( pEntry->GetCommand().equals( rURL ) ) { if ( pEntry->IsParentData() ) - return FALSE; + return sal_False; else - return TRUE; + return sal_True; } ++iter; } - return FALSE; + return sal_False; } bool ToolbarSaveInData::HasSettings() @@ -4354,9 +4165,9 @@ bool ToolbarSaveInData::HasSettings() // return true if there is at least one toolbar entry if ( GetEntries()->size() > 0 ) { - return TRUE; + return sal_True; } - return FALSE; + return sal_False; } void ToolbarSaveInData::Reset() @@ -4404,7 +4215,7 @@ void ToolbarSaveInData::Reset() bool ToolbarSaveInData::Apply() { // toolbar changes are instantly applied - return FALSE; + return sal_False; } void ToolbarSaveInData::ApplyToolbar( @@ -4638,51 +4449,6 @@ void ToolbarSaveInData::RestoreToolbar( SvxConfigEntry* pToolbar ) } } -void ToolbarSaveInData::ReloadToolbar( const OUString& rResourceURL ) -{ - SvxEntries::const_iterator iter = GetEntries()->begin(); - SvxConfigEntry* pToolbar = NULL; - - for ( ; iter != GetEntries()->end(); ++iter ) - { - SvxConfigEntry* pEntry = *iter; - - if ( pEntry->GetCommand().equals( rResourceURL ) ) - { - pToolbar = pEntry; - break; - } - } - - if ( pToolbar != NULL ) - { - delete pToolbar->GetEntries(); - - try - { - uno::Reference< container::XIndexAccess > xToolbarSettings; - - if ( pToolbar->IsParentData() ) - { - xToolbarSettings = GetParentConfigManager()->getSettings( - pToolbar->GetCommand(), sal_False); - } - else - { - xToolbarSettings = GetConfigManager()->getSettings( - pToolbar->GetCommand(), sal_False); - } - - LoadToolbar( xToolbarSettings, pToolbar ); - } - catch ( container::NoSuchElementException& ) - { - // toolbar not found for some reason - // it will not appear in the toolbar list - } - } -} - bool ToolbarSaveInData::LoadToolbar( const uno::Reference< container::XIndexAccess >& xToolbarSettings, SvxConfigEntry* pParentData ) @@ -4693,16 +4459,15 @@ bool ToolbarSaveInData::LoadToolbar( { uno::Reference< container::XIndexAccess > xSubMenu; OUString aCommandURL; - OUString aHelpURL; OUString aLabel; - bool bIsUserDefined = TRUE; + bool bIsUserDefined = sal_True; sal_Bool bIsVisible; sal_Int32 nStyle; sal_uInt16 nType( css::ui::ItemType::DEFAULT ); bool bItem = GetToolbarItemData( xToolbarSettings, nIndex, aCommandURL, - aHelpURL, aLabel, nType, bIsVisible, nStyle, xSubMenu ); + aLabel, nType, bIsVisible, nStyle, xSubMenu ); if ( bItem ) { @@ -4712,11 +4477,11 @@ bool ToolbarSaveInData::LoadToolbar( try { a = m_xCommandToLabelMap->getByName( aCommandURL ); - bIsUserDefined = FALSE; + bIsUserDefined = sal_False; } catch ( container::NoSuchElementException& ) { - bIsUserDefined = TRUE; + bIsUserDefined = sal_True; } // If custom label not set retrieve it from the command @@ -4740,10 +4505,9 @@ bool ToolbarSaveInData::LoadToolbar( if ( xSubMenu.is() ) { SvxConfigEntry* pEntry = new SvxConfigEntry( - aLabel, aCommandURL, TRUE ); + aLabel, aCommandURL, sal_True ); pEntry->SetUserDefined( bIsUserDefined ); - pEntry->SetHelpURL( aHelpURL ); pEntry->SetVisible( bIsVisible ); pEntries->push_back( pEntry ); @@ -4753,9 +4517,8 @@ bool ToolbarSaveInData::LoadToolbar( else { SvxConfigEntry* pEntry = new SvxConfigEntry( - aLabel, aCommandURL, FALSE ); + aLabel, aCommandURL, sal_False ); pEntry->SetUserDefined( bIsUserDefined ); - pEntry->SetHelpURL( aHelpURL ); pEntry->SetVisible( bIsVisible ); pEntry->SetStyle( nStyle ); pEntries->push_back( pEntry ); @@ -4783,15 +4546,15 @@ IMPL_LINK( SvxToolbarConfigPage, SelectToolbarEntry, Control *, pBox ) void SvxToolbarConfigPage::UpdateButtonStates() { PopupMenu* pPopup = aModifyCommandButton.GetPopupMenu(); - pPopup->EnableItem( ID_RENAME, FALSE ); - pPopup->EnableItem( ID_DELETE, FALSE ); - pPopup->EnableItem( ID_BEGIN_GROUP, FALSE ); - pPopup->EnableItem( ID_DEFAULT_COMMAND, FALSE ); - pPopup->EnableItem( ID_ICON_ONLY, FALSE ); - pPopup->EnableItem( ID_ICON_AND_TEXT, FALSE ); - pPopup->EnableItem( ID_TEXT_ONLY, FALSE ); - pPopup->EnableItem( ID_CHANGE_SYMBOL, FALSE ); - pPopup->EnableItem( ID_RESET_SYMBOL, FALSE ); + pPopup->EnableItem( ID_RENAME, sal_False ); + pPopup->EnableItem( ID_DELETE, sal_False ); + pPopup->EnableItem( ID_BEGIN_GROUP, sal_False ); + pPopup->EnableItem( ID_DEFAULT_COMMAND, sal_False ); + pPopup->EnableItem( ID_ICON_ONLY, sal_False ); + pPopup->EnableItem( ID_ICON_AND_TEXT, sal_False ); + pPopup->EnableItem( ID_TEXT_ONLY, sal_False ); + pPopup->EnableItem( ID_CHANGE_SYMBOL, sal_False ); + pPopup->EnableItem( ID_RESET_SYMBOL, sal_False ); aDescriptionField.Clear(); @@ -4803,22 +4566,22 @@ void SvxToolbarConfigPage::UpdateButtonStates() SvxConfigEntry* pEntryData = (SvxConfigEntry*) selection->GetUserData(); if ( pEntryData->IsSeparator() ) - pPopup->EnableItem( ID_DELETE, TRUE ); + pPopup->EnableItem( ID_DELETE, sal_True ); else { - pPopup->EnableItem( ID_BEGIN_GROUP, TRUE ); - pPopup->EnableItem( ID_DELETE, TRUE ); - pPopup->EnableItem( ID_RENAME, TRUE ); - pPopup->EnableItem( ID_ICON_ONLY, TRUE ); - pPopup->EnableItem( ID_ICON_AND_TEXT, TRUE ); - pPopup->EnableItem( ID_TEXT_ONLY, TRUE ); - pPopup->EnableItem( ID_CHANGE_SYMBOL, TRUE ); + pPopup->EnableItem( ID_BEGIN_GROUP, sal_True ); + pPopup->EnableItem( ID_DELETE, sal_True ); + pPopup->EnableItem( ID_RENAME, sal_True ); + pPopup->EnableItem( ID_ICON_ONLY, sal_True ); + pPopup->EnableItem( ID_ICON_AND_TEXT, sal_True ); + pPopup->EnableItem( ID_TEXT_ONLY, sal_True ); + pPopup->EnableItem( ID_CHANGE_SYMBOL, sal_True ); if ( !pEntryData->IsUserDefined() ) - pPopup->EnableItem( ID_DEFAULT_COMMAND, TRUE ); + pPopup->EnableItem( ID_DEFAULT_COMMAND, sal_True ); if ( pEntryData->IsIconModified() ) - pPopup->EnableItem( ID_RESET_SYMBOL, TRUE ); + pPopup->EnableItem( ID_RESET_SYMBOL, sal_True ); aDescriptionField.SetNewText( pEntryData->GetHelpText() ); } @@ -4848,16 +4611,16 @@ IMPL_LINK( SvxToolbarConfigPage, SelectToolbar, ListBox *, pBox ) SvxConfigEntry* pToolbar = GetTopLevelSelection(); if ( pToolbar == NULL ) { - aModifyTopLevelButton.Enable( FALSE ); - aModifyCommandButton.Enable( FALSE ); - aAddCommandsButton.Enable( FALSE ); + aModifyTopLevelButton.Enable( sal_False ); + aModifyCommandButton.Enable( sal_False ); + aAddCommandsButton.Enable( sal_False ); return 0; } - aModifyTopLevelButton.Enable( TRUE ); - aModifyCommandButton.Enable( TRUE ); - aAddCommandsButton.Enable( TRUE ); + aModifyTopLevelButton.Enable( sal_True ); + aModifyCommandButton.Enable( sal_True ); + aAddCommandsButton.Enable( sal_True ); PopupMenu* pPopup = aModifyTopLevelButton.GetPopupMenu(); @@ -4925,8 +4688,8 @@ IMPL_LINK( SvxToolbarConfigPage, NewToolbarHdl, Button *, pButton ) SvxNewToolbarDialog* pNameDialog = new SvxNewToolbarDialog( 0, aNewName ); - USHORT nInsertPos; - for ( USHORT i = 0 ; i < aSaveInListBox.GetEntryCount(); ++i ) + sal_uInt16 nInsertPos; + for ( sal_uInt16 i = 0 ; i < aSaveInListBox.GetEntryCount(); ++i ) { SaveInData* pData = (SaveInData*) aSaveInListBox.GetEntryData( i ); @@ -4938,7 +4701,7 @@ IMPL_LINK( SvxToolbarConfigPage, NewToolbarHdl, Button *, pButton ) } pNameDialog->aSaveInListBox.SelectEntryPos( - aSaveInListBox.GetSelectEntryPos(), TRUE ); + aSaveInListBox.GetSelectEntryPos(), sal_True ); bool ret = pNameDialog->Execute(); if ( ret == RET_OK ) @@ -4952,24 +4715,24 @@ IMPL_LINK( SvxToolbarConfigPage, NewToolbarHdl, Button *, pButton ) if ( GetSaveInData() != pData ) { - aSaveInListBox.SelectEntryPos( nInsertPos, TRUE ); + aSaveInListBox.SelectEntryPos( nInsertPos, sal_True ); aSaveInListBox.GetSelectHdl().Call(this); } SvxConfigEntry* pToolbar = - new SvxConfigEntry( aNewName, aNewURL, TRUE ); + new SvxConfigEntry( aNewName, aNewURL, sal_True ); - pToolbar->SetUserDefined( TRUE ); - pToolbar->SetMain( TRUE ); + pToolbar->SetUserDefined( sal_True ); + pToolbar->SetMain( sal_True ); pData->CreateToolbar( pToolbar ); nInsertPos = aTopLevelListBox.InsertEntry( pToolbar->GetName() ); aTopLevelListBox.SetEntryData( nInsertPos, pToolbar ); - aTopLevelListBox.SelectEntryPos( nInsertPos, TRUE ); + aTopLevelListBox.SelectEntryPos( nInsertPos, sal_True ); aTopLevelListBox.GetSelectHdl().Call(this); - pData->SetModified( TRUE ); + pData->SetModified( sal_True ); } delete pNameDialog; @@ -4984,7 +4747,7 @@ IMPL_LINK( SvxToolbarConfigPage, AddCommandsHdl, Button *, pButton ) if ( pSelectorDlg == NULL ) { // Create Script Selector which shows slot commands - pSelectorDlg = new SvxScriptSelectorDialog( this, TRUE, m_xFrame ); + pSelectorDlg = new SvxScriptSelectorDialog( this, sal_True, m_xFrame ); // Position the Script Selector over the Add button so it is // beside the menu contents list and does not obscure it @@ -5021,7 +4784,7 @@ SvLBoxEntry* SvxToolbarConfigPage::AddFunction( if ( pEntry->IsBinding() ) { - pEntry->SetVisible( TRUE ); + pEntry->SetVisible( sal_True ); aContentsListBox->SetCheckButtonState( pNewLBEntry, SV_BUTTON_CHECKED ); } @@ -5103,8 +4866,8 @@ Image SvxToolbarEntriesListBox::GetSizedImage( // Position image at the center of (width-2),(height) rectangle. // We need 2 pixels to have a bigger border to the next button image - USHORT nPosX = std::max( (USHORT) (((( aNewSize.Width() - 2 ) - aImage.GetSizePixel().Width() ) / 2 ) - 1), (USHORT) 0 ); - USHORT nPosY = std::max( (USHORT) (((( aNewSize.Height() - 2 ) - aImage.GetSizePixel().Height() ) / 2 ) + 1), (USHORT) 0 ); + sal_uInt16 nPosX = std::max( (sal_uInt16) (((( aNewSize.Width() - 2 ) - aImage.GetSizePixel().Width() ) / 2 ) - 1), (sal_uInt16) 0 ); + sal_uInt16 nPosY = std::max( (sal_uInt16) (((( aNewSize.Height() - 2 ) - aImage.GetSizePixel().Height() ) / 2 ) + 1), (sal_uInt16) 0 ); Point aPos( nPosX > 0 ? nPosX : 0, nPosY > 0 ? nPosY : 0 ); aDev.SetFillColor( aFillColor ); aDev.SetLineColor( aFillColor ); @@ -5177,14 +4940,14 @@ void SvxToolbarEntriesListBox::KeyInput( const KeyEvent& rKeyEvent ) } } -BOOL SvxToolbarEntriesListBox::NotifyMoving( +sal_Bool SvxToolbarEntriesListBox::NotifyMoving( SvLBoxEntry* pTarget, SvLBoxEntry* pSource, - SvLBoxEntry*& rpNewParent, ULONG& rNewChildPos) + SvLBoxEntry*& rpNewParent, sal_uLong& rNewChildPos) { bool result = SvxMenuEntriesListBox::NotifyMoving( pTarget, pSource, rpNewParent, rNewChildPos ); - if ( result == TRUE ) + if ( result == sal_True ) { // Instant Apply changes to UI SvxConfigEntry* pToolbar = pPage->GetTopLevelSelection(); @@ -5199,11 +4962,11 @@ BOOL SvxToolbarEntriesListBox::NotifyMoving( return result; } -BOOL SvxToolbarEntriesListBox::NotifyCopying( +sal_Bool SvxToolbarEntriesListBox::NotifyCopying( SvLBoxEntry* pTarget, SvLBoxEntry* pSource, SvLBoxEntry*& rpNewParent, - ULONG& rNewChildPos) + sal_uLong& rNewChildPos) { (void)pSource; (void)rpNewParent; @@ -5225,11 +4988,11 @@ BOOL SvxToolbarEntriesListBox::NotifyCopying( // AddFunction already adds the listbox entry so return FALSE // to stop another listbox entry being added - return FALSE; + return sal_False; } // Copying is only allowed from external controls, not within the listbox - return FALSE; + return sal_False; } SvxNewToolbarDialog::SvxNewToolbarDialog( @@ -5292,7 +5055,7 @@ SvxIconSelectorDialog::SvxIconSelectorDialog( Window *pWindow, ::rtl::OUStringHash, ::std::equal_to< ::rtl::OUString > > ImageInfo; - aTbSymbol.SetPageScroll( TRUE ); + aTbSymbol.SetPageScroll( sal_True ); bool bLargeIcons = GetImageType() & css::ui::ImageType::SIZE_LARGE; m_nExpectedSize = bLargeIcons ? 26 : 16; @@ -5315,7 +5078,7 @@ SvxIconSelectorDialog::SvxIconSelectorDialog( Window *pWindow, if ( !m_xGraphProvider.is() ) { - aBtnImport.Enable( FALSE ); + aBtnImport.Enable( sal_False ); } uno::Reference< beans::XPropertySet > xPropSet( @@ -5340,7 +5103,7 @@ SvxIconSelectorDialog::SvxIconSelectorDialog( Window *pWindow, } else { - aBtnImport.Enable( FALSE ); + aBtnImport.Enable( sal_False ); } aDirectory += ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "soffice.cfg/import" ) ); @@ -5381,7 +5144,7 @@ SvxIconSelectorDialog::SvxIconSelectorDialog( Window *pWindow, for ( sal_Int32 n = 0; n < names.getLength(); ++n ) mImageInfo.insert( ImageInfo::value_type( names[n], false )); } - USHORT nId = 1; + sal_uInt16 nId = 1; ImageInfo::const_iterator pConstIter = mImageInfo.begin(); uno::Sequence< OUString > name( 1 ); while ( pConstIter != mImageInfo.end() ) @@ -5461,7 +5224,7 @@ SvxIconSelectorDialog::SvxIconSelectorDialog( Window *pWindow, ++pConstIter; } - aBtnDelete.Enable( FALSE ); + aBtnDelete.Enable( sal_False ); aTbSymbol.SetSelectHdl( LINK(this, SvxIconSelectorDialog, SelectHdl) ); aBtnImport.SetClickHdl( LINK(this, SvxIconSelectorDialog, ImportHdl) ); aBtnDelete.SetClickHdl( LINK(this, SvxIconSelectorDialog, DeleteHdl) ); @@ -5471,11 +5234,11 @@ SvxIconSelectorDialog::SvxIconSelectorDialog( Window *pWindow, SvxIconSelectorDialog::~SvxIconSelectorDialog() { - USHORT nCount = aTbSymbol.GetItemCount(); + sal_uInt16 nCount = aTbSymbol.GetItemCount(); - for (USHORT n = 0; n < nCount; ++n) + for (sal_uInt16 n = 0; n < nCount; ++n ) { - USHORT nId = aTbSymbol.GetItemId(n); + sal_uInt16 nId = aTbSymbol.GetItemId(n); uno::XInterface* xi = static_cast< uno::XInterface* >( aTbSymbol.GetItemData( nId ) ); @@ -5491,8 +5254,8 @@ uno::Reference< graphic::XGraphic> SvxIconSelectorDialog::GetSelectedIcon() { uno::Reference< graphic::XGraphic > result; - USHORT nId; - for ( USHORT n = 0; n < aTbSymbol.GetItemCount(); ++n ) + sal_uInt16 nId; + for ( sal_uInt16 n = 0; n < aTbSymbol.GetItemCount(); ++n ) { nId = aTbSymbol.GetItemId( n ); if ( aTbSymbol.IsItemChecked( nId ) ) @@ -5510,29 +5273,29 @@ IMPL_LINK( SvxIconSelectorDialog, SelectHdl, ToolBox *, pToolBox ) { (void)pToolBox; - USHORT nCount = aTbSymbol.GetItemCount(); + sal_uInt16 nCount = aTbSymbol.GetItemCount(); - for (USHORT n = 0; n < nCount; ++n) + for (sal_uInt16 n = 0; n < nCount; ++n ) { - USHORT nId = aTbSymbol.GetItemId( n ); + sal_uInt16 nId = aTbSymbol.GetItemId( n ); if ( aTbSymbol.IsItemChecked( nId ) ) { - aTbSymbol.CheckItem( nId, FALSE ); + aTbSymbol.CheckItem( nId, sal_False ); } } - USHORT nId = aTbSymbol.GetCurItemId(); + sal_uInt16 nId = aTbSymbol.GetCurItemId(); aTbSymbol.CheckItem( nId ); ::rtl::OUString aSelImageText = aTbSymbol.GetItemText( nId ); if ( m_xImportedImageManager->hasImage( GetImageType(), aSelImageText ) ) { - aBtnDelete.Enable( TRUE ); + aBtnDelete.Enable( sal_True ); } else { - aBtnDelete.Enable( FALSE ); + aBtnDelete.Enable( sal_False ); } return 0; @@ -5577,11 +5340,11 @@ IMPL_LINK( SvxIconSelectorDialog, DeleteHdl, PushButton *, pButton ) if ( ret == RET_OK ) { - USHORT nCount = aTbSymbol.GetItemCount(); + sal_uInt16 nCount = aTbSymbol.GetItemCount(); - for (USHORT n = 0; n < nCount; ++n) + for (sal_uInt16 n = 0; n < nCount; ++n ) { - USHORT nId = aTbSymbol.GetItemId( n ); + sal_uInt16 nId = aTbSymbol.GetItemId( n ); if ( aTbSymbol.IsItemChecked( nId ) ) { @@ -5617,7 +5380,7 @@ bool SvxIconSelectorDialog::ReplaceGraphicItem( aMediaProps[0].Value <<= aURL; com::sun::star::awt::Size aSize; - bool bOK = FALSE; + bool bOK = sal_False; try { xGraphic = m_xGraphProvider->queryGraphic( aMediaProps ); @@ -5628,9 +5391,9 @@ bool SvxIconSelectorDialog::ReplaceGraphicItem( OUString(RTL_CONSTASCII_USTRINGPARAM("SizePixel")) ); a >>= aSize; if (0 == aSize.Width || 0 == aSize.Height) - return FALSE; + return sal_False; else - bOK = TRUE; + bOK = sal_True; } catch ( uno::Exception& ) { @@ -5638,10 +5401,10 @@ bool SvxIconSelectorDialog::ReplaceGraphicItem( } bool bResult( false ); - USHORT nCount = aTbSymbol.GetItemCount(); - for (USHORT n = 0; n < nCount; ++n) + sal_uInt16 nCount = aTbSymbol.GetItemCount(); + for (sal_uInt16 n = 0; n < nCount; ++n ) { - USHORT nId = aTbSymbol.GetItemId( n ); + sal_uInt16 nId = aTbSymbol.GetItemId( n ); if ( OUString( aTbSymbol.GetItemText( nId ) ) == aURL ) { @@ -5686,7 +5449,7 @@ void SvxIconSelectorDialog::ImportGraphics( uno::Sequence< OUString > rejected( rPaths.getLength() ); sal_Int32 rejectedCount = 0; - USHORT ret = 0; + sal_uInt16 ret = 0; sal_Int32 aIndex; OUString aIconName; uno::Sequence< OUString > URLs(1); @@ -5710,7 +5473,7 @@ void SvxIconSelectorDialog::ImportGraphics( } else { - if ( ImportGraphic( rPaths[0] ) == FALSE ) + if ( ImportGraphic( rPaths[0] ) == sal_False ) { rejected[0] = rPaths[0]; rejectedCount = 1; @@ -5730,7 +5493,7 @@ void SvxIconSelectorDialog::ImportGraphics( { aIndex = rPaths[i].lastIndexOf( '/' ); aIconName = rPaths[i].copy( aIndex+1 ); - ret = SvxIconReplacementDialog( this, aIconName, TRUE ).ShowDialog(); + ret = SvxIconReplacementDialog( this, aIconName, sal_True ).ShowDialog(); if ( ret == 2 ) { ReplaceGraphicItem( aPath ); @@ -5745,7 +5508,7 @@ void SvxIconSelectorDialog::ImportGraphics( if ( !bHasReplaced ) { bool result = ImportGraphic( aPath ); - if ( result == FALSE ) + if ( result == sal_False ) { rejected[ rejectedCount ] = rPaths[i]; ++rejectedCount; @@ -5758,7 +5521,7 @@ void SvxIconSelectorDialog::ImportGraphics( else { bool result = ImportGraphic( aSourcePath + rPaths[i] ); - if ( result == FALSE ) + if ( result == sal_False ) { rejected[ rejectedCount ] = rPaths[i]; ++rejectedCount; @@ -5787,9 +5550,9 @@ void SvxIconSelectorDialog::ImportGraphics( bool SvxIconSelectorDialog::ImportGraphic( const OUString& aURL ) { - bool result = FALSE; + bool result = sal_False; - USHORT nId = m_nNextId; + sal_uInt16 nId = m_nNextId; ++m_nNextId; uno::Sequence< beans::PropertyValue > aMediaProps( 1 ); @@ -5797,7 +5560,7 @@ bool SvxIconSelectorDialog::ImportGraphic( const OUString& aURL ) uno::Reference< graphic::XGraphic > xGraphic; com::sun::star::awt::Size aSize; - bool bOK = TRUE; + bool bOK = sal_True; aMediaProps[0].Value <<= aURL; try { @@ -5812,7 +5575,7 @@ bool SvxIconSelectorDialog::ImportGraphic( const OUString& aURL ) { a >>= aSize; if ( 0 == aSize.Width || 0 == aSize.Height ) - bOK = FALSE; + bOK = sal_False; Image aImage( xGraphic ); @@ -5844,7 +5607,7 @@ bool SvxIconSelectorDialog::ImportGraphic( const OUString& aURL ) xConfigPersistence->store(); } - result = TRUE; + result = sal_True; } else { @@ -5906,7 +5669,7 @@ rtl::OUString SvxIconReplacementDialog :: ReplaceIconName( const OUString& rMess return name; } -USHORT SvxIconReplacementDialog :: ShowDialog() +sal_uInt16 SvxIconReplacementDialog :: ShowDialog() { this->Execute(); return ( this->GetCurButtonId() ); @@ -5928,8 +5691,8 @@ SvxIconChangeDialog::SvxIconChangeDialog( FreeResource(); aFImageInfo.SetImage(InfoBox::GetStandardImage()); aLineEditDescription.SetControlBackground( GetSettings().GetStyleSettings().GetDialogColor() ); - aLineEditDescription.SetAutoScroll( TRUE ); - aLineEditDescription.EnableCursor( FALSE ); + aLineEditDescription.SetAutoScroll( sal_True ); + aLineEditDescription.EnableCursor( sal_False ); aLineEditDescription.SetText(aMessage); } diff --git a/cui/source/customize/cfg.hrc b/cui/source/customize/cfg.hrc index 74d7804dce8e..302f226623a3 100644 --- a/cui/source/customize/cfg.hrc +++ b/cui/source/customize/cfg.hrc @@ -103,3 +103,8 @@ #define EDT_ADDR (121 + CFG_OFFSET) #define MD_BTN_OK (122 + CFG_OFFSET) #define FI_INFO (123 + CFG_OFFSET) + +//IAccessibility2 Implementation 2009----- +#define BUTTON_STR_UP (130 + CFG_OFFSET) +#define BUTTON_STR_DOWN (131 + CFG_OFFSET) +//-----IAccessibility2 Implementation 2009 diff --git a/cui/source/customize/cfg.src b/cui/source/customize/cfg.src index 0b2489557053..66ac237a523b 100644 --- a/cui/source/customize/cfg.src +++ b/cui/source/customize/cfg.src @@ -136,6 +136,7 @@ TabPage RID_SVXPAGE_MENUS }; ListBox LB_MENUS { + HelpID = "cui:ListBox:RID_SVXPAGE_MENUS:LB_MENUS"; Border = TRUE ; Pos = MAP_APPFONT ( 64 , 22 ) ; Size = MAP_APPFONT ( 108 , 108 ) ; @@ -143,6 +144,7 @@ TabPage RID_SVXPAGE_MENUS }; PushButton BTN_NEW { + HelpID = "cui:PushButton:RID_SVXPAGE_MENUS:BTN_NEW"; Pos = MAP_APPFONT ( 192 , 22 ) ; Size = MAP_APPFONT ( 75 , 14 ) ; TabStop = TRUE ; @@ -151,6 +153,7 @@ TabPage RID_SVXPAGE_MENUS }; MenuButton BTN_CHANGE { + HelpID = "cui:MenuButton:RID_SVXPAGE_MENUS:BTN_CHANGE"; Pos = MAP_APPFONT ( 192 , 39 ) ; Size = MAP_APPFONT ( 75 , 14 ) ; TabStop = TRUE ; @@ -181,6 +184,7 @@ TabPage RID_SVXPAGE_MENUS }; PushButton BTN_ADD_COMMANDS { + HelpID = "cui:PushButton:RID_SVXPAGE_MENUS:BTN_ADD_COMMANDS"; Pos = MAP_APPFONT ( 192 , 67 ) ; Size = MAP_APPFONT ( 75 , 14 ) ; TabStop = TRUE ; @@ -189,6 +193,7 @@ TabPage RID_SVXPAGE_MENUS }; MenuButton BTN_CHANGE_ENTRY { + HelpID = "cui:MenuButton:RID_SVXPAGE_MENUS:BTN_CHANGE_ENTRY"; Pos = MAP_APPFONT ( 192 , 84 ) ; Size = MAP_APPFONT ( 75 , 14 ) ; TabStop = TRUE ; @@ -197,6 +202,7 @@ TabPage RID_SVXPAGE_MENUS }; ImageButton BTN_UP { + HelpID = "cui:ImageButton:RID_SVXPAGE_MENUS:BTN_UP"; Pos = MAP_APPFONT ( 175 , 102 ) ; Size = MAP_APPFONT ( 14 , 14 ) ; TabStop = TRUE ; @@ -205,6 +211,7 @@ TabPage RID_SVXPAGE_MENUS }; ImageButton BTN_DOWN { + HelpID = "cui:ImageButton:RID_SVXPAGE_MENUS:BTN_DOWN"; Pos = MAP_APPFONT ( 175 , 119 ) ; Size = MAP_APPFONT ( 14 , 14 ) ; TabStop = TRUE ; @@ -220,6 +227,7 @@ TabPage RID_SVXPAGE_MENUS }; ListBox LB_SAVEIN { + HelpID = "cui:ListBox:RID_SVXPAGE_MENUS:LB_SAVEIN"; Border = TRUE ; Pos = MAP_APPFONT ( 64 , 188 ) ; Size = MAP_APPFONT ( 108 , 53 ) ; @@ -234,6 +242,7 @@ TabPage RID_SVXPAGE_MENUS }; MultiLineEdit ED_DESCRIPTION { + HelpID = "cui:MultiLineEdit:RID_SVXPAGE_MENUS:ED_DESCRIPTION"; Pos = MAP_APPFONT ( 6 , 216 ) ; Size = MAP_APPFONT ( 261 , 36 ) ; Border = TRUE; @@ -493,6 +502,7 @@ ModalDialog MD_MENU_ORGANISER }; Edit EDIT_MENU_NAME { + HelpID = "cui:Edit:MD_MENU_ORGANISER:EDIT_MENU_NAME"; Border = TRUE ; Pos = MAP_APPFONT ( 6 , 19 ) ; Size = MAP_APPFONT ( 93 , 12 ) ; @@ -517,6 +527,7 @@ ModalDialog MD_MENU_ORGANISER }; ImageButton BTN_MENU_UP { + HelpID = "cui:ImageButton:MD_MENU_ORGANISER:BTN_MENU_UP"; Pos = MAP_APPFONT ( 102 , 80 ) ; Size = MAP_APPFONT ( 14 , 14 ) ; TabStop = TRUE ; @@ -524,6 +535,7 @@ ModalDialog MD_MENU_ORGANISER }; ImageButton BTN_MENU_DOWN { + HelpID = "cui:ImageButton:MD_MENU_ORGANISER:BTN_MENU_DOWN"; Pos = MAP_APPFONT ( 102 , 97 ) ; Size = MAP_APPFONT ( 14 , 14 ) ; TabStop = TRUE ; @@ -550,6 +562,7 @@ ModalDialog MD_MENU_ORGANISER // MD_NEW_TOOLBAR ------------------------------------------------- ModalDialog MD_NEW_TOOLBAR { + HelpID = "cui:ModalDialog:MD_NEW_TOOLBAR"; OutputSize = TRUE ; SvLook = TRUE ; Size = MAP_APPFONT ( 165 , 63 ) ; @@ -565,6 +578,7 @@ ModalDialog MD_NEW_TOOLBAR }; Edit EDT_STRING { + HelpID = "cui:Edit:MD_NEW_TOOLBAR:EDT_STRING"; Border = TRUE ; Pos = MAP_APPFONT ( 6 , 17 ) ; Size = MAP_APPFONT ( 97 , 12 ) ; @@ -579,6 +593,7 @@ ModalDialog MD_NEW_TOOLBAR }; ListBox LB_SAVEIN { + HelpID = "cui:ListBox:MD_NEW_TOOLBAR:LB_SAVEIN"; Border = TRUE ; Pos = MAP_APPFONT ( 6 , 43 ) ; Size = MAP_APPFONT ( 97 , 53 ) ; @@ -654,6 +669,7 @@ ModalDialog MD_ICONSELECTOR }; PushButton BTN_IMPORT { + HelpID = "cui:PushButton:MD_ICONSELECTOR:BTN_IMPORT"; Pos = MAP_APPFONT ( 184 , 7 ) ; Size = MAP_APPFONT ( 50 , 14 ) ; TabStop = TRUE ; @@ -662,6 +678,7 @@ ModalDialog MD_ICONSELECTOR }; PushButton BTN_DELETE { + HelpID = "cui:PushButton:MD_ICONSELECTOR:BTN_DELETE"; Pos = MAP_APPFONT ( 184 , 24 ) ; Size = MAP_APPFONT ( 50 , 14 ) ; TabStop = TRUE ; @@ -691,6 +708,7 @@ ModalDialog MD_ICONSELECTOR //added for issue83555 ModalDialog MD_ICONCHANGE { + HelpID = "cui:ModalDialog:MD_ICONCHANGE"; OutputSize = TRUE ; SVLook = TRUE ; Size = MAP_APPFONT ( 200 , 150 ) ; @@ -714,6 +732,7 @@ ModalDialog MD_ICONCHANGE MultiLineEdit EDT_ADDR { + HelpID = "cui:MultiLineEdit:MD_ICONCHANGE:EDT_ADDR"; Pos = MAP_APPFONT ( 30 , 38) ; Size = MAP_APPFONT ( 140 , 83 ) ; Border = TRUE; @@ -869,4 +888,12 @@ String RID_SVXSTR_RENAME_TOOLBAR Text [ en-US ] = "Rename Toolbar"; }; +String BUTTON_STR_UP +{ + Text [ en-US ] = "Up"; +}; +String BUTTON_STR_DOWN +{ + Text [ en-US ] = "Down"; +}; diff --git a/cui/source/customize/cfgutil.cxx b/cui/source/customize/cfgutil.cxx index 18f1fa122562..6ae157ad4426 100644 --- a/cui/source/customize/cfgutil.cxx +++ b/cui/source/customize/cfgutil.cxx @@ -57,7 +57,6 @@ #include <tools/urlobj.hxx> #include "cuires.hrc" #include <sfx2/app.hxx> -#include <sfx2/macrconf.hxx> #include <sfx2/minfitem.hxx> #include <unotools/processfactory.hxx> #include <comphelper/documentinfo.hxx> @@ -276,7 +275,7 @@ SfxConfigFunctionListBox_Impl::SfxConfigFunctionListBox_Impl( Window* pParent, c , pCurEntry( 0 ) , pStylesInfo( 0 ) { - SetWindowBits( GetStyle() | WB_CLIPCHILDREN | WB_HSCROLL | WB_SORT ); + SetStyle( GetStyle() | WB_CLIPCHILDREN | WB_HSCROLL | WB_SORT ); GetModel()->SetSortMode( SortAscending ); // Timer for the BallonHelp @@ -311,21 +310,18 @@ void SfxConfigFunctionListBox_Impl::ClearAll() vorhandenen MacroInfos. */ { - USHORT nCount = aArr.Count(); - for ( USHORT i=0; i<nCount; ++i ) + sal_uInt16 nCount = aArr.Count(); + for ( sal_uInt16 i=0; i<nCount; ++i ) { SfxGroupInfo_Impl *pData = aArr[i]; - if ( pData->nKind == SFX_CFGFUNCTION_MACRO || - pData->nKind == SFX_CFGFUNCTION_SCRIPT ) + if ( pData->nKind == SFX_CFGFUNCTION_SCRIPT ) { - SfxMacroInfo *pInfo = (SfxMacroInfo*) pData->pObject; - SFX_APP()->GetMacroConfig()->ReleaseSlotId( pInfo->GetSlotId() ); - delete pInfo; + String* pScriptURI = (String*)pData->pObject; + delete pScriptURI; } if ( pData->nKind == SFX_CFGGROUP_SCRIPTCONTAINER - || pData->nKind == SFX_CFGGROUP_DOCBASICMGR ) { XInterface* xi = static_cast<XInterface *>(pData->pObject); @@ -342,55 +338,16 @@ void SfxConfigFunctionListBox_Impl::ClearAll() Clear(); } -SvLBoxEntry* SfxConfigFunctionListBox_Impl::GetEntry_Impl( const String& rName ) -/* Beschreibung - Ermittelt den SvLBoxEntry zu einem "ubergebenen String. Das setzt voraus, da\s - die Namen eindeutig sind. -*/ -{ - SvLBoxEntry *pEntry = First(); - while ( pEntry ) - { - if ( GetEntryText( pEntry ) == rName ) - return pEntry; - pEntry = Next( pEntry ); - } - - return NULL; -} - -SvLBoxEntry* SfxConfigFunctionListBox_Impl::GetEntry_Impl( USHORT nId ) -/* Beschreibung - Ermittelt den SvLBoxEntry zu einer "ubergebenen Id. -*/ -{ - SvLBoxEntry *pEntry = First(); - while ( pEntry ) - { - SfxGroupInfo_Impl *pData = (SfxGroupInfo_Impl*) pEntry->GetUserData(); - if ( pData && pData->nOrd == nId ) - return pEntry; - pEntry = Next( pEntry ); - } - - return NULL; -} - -SfxMacroInfo* SfxConfigFunctionListBox_Impl::GetMacroInfo() -/* Beschreibung - Gibt die MacroInfo des selektierten Entry zur"uck ( sofern vorhanden ). -*/ +String SfxConfigFunctionListBox_Impl::GetSelectedScriptURI() { SvLBoxEntry *pEntry = FirstSelected(); if ( pEntry ) { SfxGroupInfo_Impl *pData = (SfxGroupInfo_Impl*) pEntry->GetUserData(); - if ( pData && ( pData->nKind == SFX_CFGFUNCTION_MACRO || - pData->nKind == SFX_CFGFUNCTION_SCRIPT ) ) - return (SfxMacroInfo*) pData->pObject; + if ( pData && ( pData->nKind == SFX_CFGFUNCTION_SCRIPT ) ) + return *(String*)pData->pObject; } - - return 0; + return String(); } String SfxConfigFunctionListBox_Impl::GetCurCommand() @@ -417,18 +374,6 @@ String SfxConfigFunctionListBox_Impl::GetCurLabel() return pData->sCommand; } -USHORT SfxConfigFunctionListBox_Impl::GetId( SvLBoxEntry *pEntry ) -/* Beschreibung - Gibt die Ordnungsnummer ( SlotId oder Macro-Nummer ) des Eintrags zur"uck. -*/ -{ - SfxGroupInfo_Impl *pData = pEntry ? - (SfxGroupInfo_Impl*) pEntry->GetUserData() : 0; - if ( pData ) - return pData->nOrd; - return 0; -} - void SfxConfigFunctionListBox_Impl::FunctionSelected() /* Beschreibung Setzt die Balloonhelp zur"uck, da diese immer den Helptext des selektierten @@ -454,7 +399,6 @@ struct SvxConfigGroupBoxResource_Impl : public Resource String m_sDlgMacros; String m_aHumanAppName; String m_aStrGroupStyles; - String m_aScriptType; Image m_collapsedImage; Image m_expandedImage; @@ -473,7 +417,6 @@ SvxConfigGroupBoxResource_Impl::SvxConfigGroupBoxResource_Impl() : m_sDlgMacros(String(CUI_RES(STR_DLG_MACROS))), m_aHumanAppName(String(CUI_RES(STR_HUMAN_APPNAME))), m_aStrGroupStyles(String(CUI_RES(STR_GROUP_STYLES))), - m_aScriptType(String(CUI_RES(STR_BASICNAME))), m_collapsedImage(CUI_RES(BMP_COLLAPSED)), m_expandedImage(CUI_RES(BMP_EXPANDED)) { @@ -481,41 +424,12 @@ SvxConfigGroupBoxResource_Impl::SvxConfigGroupBoxResource_Impl() : } SfxConfigGroupListBox_Impl::SfxConfigGroupListBox_Impl( - Window* pParent, const ResId& rResId, ULONG nConfigMode ) + Window* pParent, const ResId& rResId, sal_uLong nConfigMode ) : SvTreeListBox( pParent, rResId ) - , pImp(new SvxConfigGroupBoxResource_Impl()), pFunctionListBox(0), nMode( nConfigMode ), bShowSF( FALSE ), bShowBasic( TRUE ), pStylesInfo(0) + , pImp(new SvxConfigGroupBoxResource_Impl()), pFunctionListBox(0), nMode( nConfigMode ), pStylesInfo(0) { - SetWindowBits( GetStyle() | WB_CLIPCHILDREN | WB_HSCROLL | WB_HASBUTTONS | WB_HASLINES | WB_HASLINESATROOT | WB_HASBUTTONSATROOT ); + SetStyle( GetStyle() | WB_CLIPCHILDREN | WB_HSCROLL | WB_HASBUTTONS | WB_HASLINES | WB_HASLINESATROOT | WB_HASBUTTONSATROOT ); SetNodeBitmaps( pImp->m_collapsedImage, pImp->m_expandedImage ); - - // Check configuration to see whether only Basic macros, - // only Scripting Framework scripts, or both should be listed - Any value; - sal_Bool tmp = false; - - value = ::utl::ConfigManager::GetConfigManager().GetLocalProperty( - ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "Office.Scripting/ScriptDisplaySettings/ShowBasic" ) ) ); - - value >>= tmp; - - if (tmp == sal_True) { - bShowBasic = TRUE; - } - else { - bShowBasic = FALSE; - } - - value = ::utl::ConfigManager::GetConfigManager().GetLocalProperty( - ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Office.Scripting/ScriptDisplaySettings/ShowSF" ) ) ); - - value >>= tmp; - - if (tmp == sal_True) { - bShowSF = TRUE; - } - else { - bShowSF = FALSE; - } } @@ -526,12 +440,11 @@ SfxConfigGroupListBox_Impl::~SfxConfigGroupListBox_Impl() void SfxConfigGroupListBox_Impl::ClearAll() { - USHORT nCount = aArr.Count(); - for ( USHORT i=0; i<nCount; ++i ) + sal_uInt16 nCount = aArr.Count(); + for ( sal_uInt16 i=0; i<nCount; ++i ) { SfxGroupInfo_Impl *pData = aArr[i]; if ( pData->nKind == SFX_CFGGROUP_SCRIPTCONTAINER - || pData->nKind == SFX_CFGGROUP_DOCBASICMGR ) { XInterface* xi = static_cast<XInterface *>(pData->pObject); @@ -547,33 +460,6 @@ void SfxConfigGroupListBox_Impl::ClearAll() Clear(); } -void SfxConfigGroupListBox_Impl::SetScriptType( const String& rScriptType ) -{ - pImp->m_aScriptType = rScriptType; - ULONG nPos=0; - SvLBoxEntry *pEntry = (SvLBoxEntry*) GetModel()->GetEntryAtAbsPos( nPos ); - ++nPos; - while ( pEntry ) - { - SfxGroupInfo_Impl *pInfo = (SfxGroupInfo_Impl*) pEntry->GetUserData(); - if ( pInfo->nKind == SFX_CFGGROUP_BASICLIB && ( IsExpanded( pEntry ) || pInfo->bWasOpened ) ) - { - Collapse( pEntry ); - SvLBoxEntry *pChild = FirstChild( pEntry ); - while (pChild) - { - GetModel()->Remove( pChild ); - pChild = FirstChild( pEntry ); - } - - Expand( pEntry ); - } - - pEntry = (SvLBoxEntry*) GetModel()->GetEntryAtAbsPos( nPos ); - ++nPos; - } -} - void SfxConfigGroupListBox_Impl::SetStylesInfo(SfxStylesInfo_Impl* pStyles) { pStylesInfo = pStyles; @@ -592,18 +478,6 @@ String SfxConfigGroupListBox_Impl::GetGroup() if ( pInfo->nKind == SFX_CFGGROUP_FUNCTION ) return GetEntryText( pEntry ); - if ( pInfo->nKind == SFX_CFGGROUP_BASICMGR ) - { - BasicManager *pMgr = (BasicManager*) pInfo->pObject; - return pMgr->GetName(); - } - - if ( pInfo->nKind == SFX_CFGGROUP_DOCBASICMGR ) - { - Reference< XModel > xDoc( static_cast< XModel* >( pInfo->pObject ) ); - return ::comphelper::DocumentInfo::getDocumentTitle( xDoc ); - } - pEntry = GetParent( pEntry ); } @@ -611,27 +485,6 @@ String SfxConfigGroupListBox_Impl::GetGroup() } //----------------------------------------------- -BasicManager* SfxConfigGroupListBox_Impl::GetBasicManager( const SvLBoxEntry& _rEntry ) -{ - BasicManager* pBasMgr = NULL; - - SfxGroupInfo_Impl* pInfo = (SfxGroupInfo_Impl*) _rEntry.GetUserData(); - switch ( pInfo->nKind ) - { - case SFX_CFGGROUP_BASICMGR : - pBasMgr = (BasicManager*) pInfo->pObject; - break; - case SFX_CFGGROUP_DOCBASICMGR : - { - Reference< XModel > xDoc( static_cast< XModel* >( pInfo->pObject ) ); - pBasMgr = ::basic::BasicManagerRepository::getDocumentBasicManager( xDoc ); - } - break; - } - return pBasMgr; -} - -//----------------------------------------------- void SfxConfigGroupListBox_Impl::InitModule() { try @@ -735,7 +588,7 @@ void SfxConfigGroupListBox_Impl::Init(const css::uno::Reference< css::lang::XMul const css::uno::Reference< css::frame::XFrame >& xFrame , const ::rtl::OUString& sModuleLongName) { - SetUpdateMode(FALSE); + SetUpdateMode(sal_False); ClearAll(); // Remove all old entries from treelist box m_xFrame = xFrame; @@ -753,192 +606,139 @@ void SfxConfigGroupListBox_Impl::Init(const css::uno::Reference< css::lang::XMul InitStyles(); } - SfxApplication *pSfxApp = SFX_APP(); - if ( bShowBasic ) + OSL_TRACE("** ** About to initialise SF Scripts"); + // Add Scripting Framework entries + Reference< browse::XBrowseNode > rootNode; + Reference< XComponentContext > xCtx; + try { - // Basics einsammeln - pSfxApp->EnterBasicCall(); - String aMacroName(' '); - aMacroName += pImp->m_sDlgMacros; - - // Zuerst AppBasic - BasicManager *pAppBasicMgr = pSfxApp->GetBasicManager(); - BOOL bInsert = TRUE; - - if ( bInsert ) - { - pAppBasicMgr->SetName( pSfxApp->GetName() ); - if ( pAppBasicMgr->GetLibCount() ) - { - // Nur einf"ugen, wenn Bibliotheken vorhanden - String aAppBasTitle( pImp->m_aHumanAppName ); - aAppBasTitle += aMacroName; - SvLBoxEntry *pEntry = InsertEntry( aAppBasTitle, 0 ); - SfxGroupInfo_Impl *pInfo = new SfxGroupInfo_Impl( SFX_CFGGROUP_BASICMGR, 0, pAppBasicMgr ); - pEntry->SetUserData( pInfo ); - pEntry->EnableChildsOnDemand( TRUE ); - } - } - - Reference< XModel > xDoc( lcl_getScriptableDocument_nothrow( m_xFrame ) ); - if ( xDoc.is() ) - { - BasicManager* pBasicMgr = ::basic::BasicManagerRepository::getDocumentBasicManager( xDoc ); - if ( pBasicMgr != pAppBasicMgr && pBasicMgr->GetLibCount() ) - { - String sDocTitle( ::comphelper::DocumentInfo::getDocumentTitle( xDoc ) ); - pBasicMgr->SetName( sDocTitle ); - - // Nur einf"ugen, wenn eigenes Basic mit Bibliotheken - SvLBoxEntry *pEntry = InsertEntry( sDocTitle.Append( aMacroName ), NULL ); - xDoc->acquire(); - SfxGroupInfo_Impl *pInfo = - new SfxGroupInfo_Impl( SFX_CFGGROUP_DOCBASICMGR, 0, xDoc.get() ); - pEntry->SetUserData( pInfo ); - pEntry->EnableChildsOnDemand( TRUE ); - } - } - - pSfxApp->LeaveBasicCall(); + Reference < beans::XPropertySet > xProps( + ::comphelper::getProcessServiceFactory(), UNO_QUERY_THROW ); + xCtx.set( xProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "DefaultContext" ))), UNO_QUERY_THROW ); + Reference< browse::XBrowseNodeFactory > xFac( xCtx->getValueByName( + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "/singletons/com.sun.star.script.browse.theBrowseNodeFactory") ) ), UNO_QUERY_THROW ); + rootNode.set( xFac->createView( browse::BrowseNodeFactoryViewTypes::MACROSELECTOR ) ); + } + catch( Exception& e ) + { + OSL_TRACE(" Caught some exception whilst retrieving browse nodes from factory... Exception: %s", + ::rtl::OUStringToOString( e.Message , RTL_TEXTENCODING_ASCII_US ).pData->buffer ); + // TODO exception handling } - OSL_TRACE("** ** About to initialise SF Scripts"); - if ( bShowSF ) + + if ( rootNode.is() ) { - OSL_TRACE("** ** bShowSF"); - // Add Scripting Framework entries - Reference< browse::XBrowseNode > rootNode; - Reference< XComponentContext > xCtx; - try + if ( nMode ) { - Reference < beans::XPropertySet > xProps( - ::comphelper::getProcessServiceFactory(), UNO_QUERY_THROW ); - xCtx.set( xProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "DefaultContext" ))), UNO_QUERY_THROW ); - Reference< browse::XBrowseNodeFactory > xFac( xCtx->getValueByName( - ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "/singletons/com.sun.star.script.browse.theBrowseNodeFactory") ) ), UNO_QUERY_THROW ); - rootNode.set( xFac->createView( browse::BrowseNodeFactoryViewTypes::MACROSELECTOR ) ); + //We call acquire on the XBrowseNode so that it does not + //get autodestructed and become invalid when accessed later. + rootNode->acquire(); + + SfxGroupInfo_Impl *pInfo = + new SfxGroupInfo_Impl( SFX_CFGGROUP_SCRIPTCONTAINER, 0, + static_cast<void *>(rootNode.get())); + + String aTitle(pImp->m_sDlgMacros); + SvLBoxEntry *pNewEntry = InsertEntry( aTitle, NULL ); + pNewEntry->SetUserData( pInfo ); + pNewEntry->EnableChildsOnDemand( sal_True ); + aArr.Insert( pInfo, aArr.Count() ); } - catch( Exception& e ) + else { - OSL_TRACE(" Caught some exception whilst retrieving browse nodes from factory... Exception: %s", - ::rtl::OUStringToOString( e.Message , RTL_TEXTENCODING_ASCII_US ).pData->buffer ); - // TODO exception handling - } - + //We are only showing scripts not slot APIs so skip + //Root node and show location nodes + try { + if ( rootNode->hasChildNodes() ) + { + Sequence< Reference< browse::XBrowseNode > > children = + rootNode->getChildNodes(); + sal_Bool bIsRootNode = sal_False; - if ( rootNode.is() ) - { - if ( nMode ) - { - //We call acquire on the XBrowseNode so that it does not - //get autodestructed and become invalid when accessed later. - rootNode->acquire(); - - SfxGroupInfo_Impl *pInfo = - new SfxGroupInfo_Impl( SFX_CFGGROUP_SCRIPTCONTAINER, 0, - static_cast<void *>(rootNode.get())); - - String aTitle(pImp->m_sDlgMacros); - SvLBoxEntry *pNewEntry = InsertEntry( aTitle, NULL ); - pNewEntry->SetUserData( pInfo ); - pNewEntry->EnableChildsOnDemand( TRUE ); - aArr.Insert( pInfo, aArr.Count() ); - } - else - { - //We are only showing scripts not slot APIs so skip - //Root node and show location nodes - try { - if ( rootNode->hasChildNodes() ) + ::rtl::OUString user( RTL_CONSTASCII_USTRINGPARAM("user") ); + ::rtl::OUString share( RTL_CONSTASCII_USTRINGPARAM("share") ); + if ( rootNode->getName().equals(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Root") ) ) ) { - Sequence< Reference< browse::XBrowseNode > > children = - rootNode->getChildNodes(); - BOOL bIsRootNode = FALSE; - - ::rtl::OUString user( RTL_CONSTASCII_USTRINGPARAM("user") ); - ::rtl::OUString share( RTL_CONSTASCII_USTRINGPARAM("share") ); - if ( rootNode->getName().equals(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Root") ) ) ) - { - bIsRootNode = TRUE; - } + bIsRootNode = sal_True; + } - //To mimic current starbasic behaviour we - //need to make sure that only the current document - //is displayed in the config tree. Tests below - //set the bDisplay flag to FALSE if the current - //node is a first level child of the Root and is NOT - //either the current document, user or share - ::rtl::OUString currentDocTitle; - Reference< XModel > xDocument( lcl_getScriptableDocument_nothrow( m_xFrame ) ); - if ( xDocument.is() ) - { - currentDocTitle = ::comphelper::DocumentInfo::getDocumentTitle( xDocument ); - } + //To mimic current starbasic behaviour we + //need to make sure that only the current document + //is displayed in the config tree. Tests below + //set the bDisplay flag to FALSE if the current + //node is a first level child of the Root and is NOT + //either the current document, user or share + ::rtl::OUString currentDocTitle; + Reference< XModel > xDocument( lcl_getScriptableDocument_nothrow( m_xFrame ) ); + if ( xDocument.is() ) + { + currentDocTitle = ::comphelper::DocumentInfo::getDocumentTitle( xDocument ); + } - for ( sal_Int32 n = 0; n < children.getLength(); ++n ) + for ( sal_Int32 n = 0; n < children.getLength(); ++n ) + { + Reference< browse::XBrowseNode >& theChild = children[n]; + sal_Bool bDisplay = sal_True; + ::rtl::OUString uiName = theChild->getName(); + if ( bIsRootNode ) { - Reference< browse::XBrowseNode >& theChild = children[n]; - BOOL bDisplay = TRUE; - ::rtl::OUString uiName = theChild->getName(); - if ( bIsRootNode ) + if ( ! ((theChild->getName().equals( user ) || theChild->getName().equals( share ) || + theChild->getName().equals( currentDocTitle ) ) ) ) + { + bDisplay=sal_False; + } + else { - if ( ! ((theChild->getName().equals( user ) || theChild->getName().equals( share ) || - theChild->getName().equals( currentDocTitle ) ) ) ) + if ( uiName.equals( user ) ) { - bDisplay=FALSE; + uiName = pImp->m_sMyMacros; } - else + else if ( uiName.equals( share ) ) { - if ( uiName.equals( user ) ) - { - uiName = pImp->m_sMyMacros; - } - else if ( uiName.equals( share ) ) - { - uiName = pImp->m_sProdMacros; - } + uiName = pImp->m_sProdMacros; } } - if (children[n]->getType() != browse::BrowseNodeTypes::SCRIPT && bDisplay ) - { + } + if (children[n]->getType() != browse::BrowseNodeTypes::SCRIPT && bDisplay ) + { // We call acquire on the XBrowseNode so that it does not // get autodestructed and become invalid when accessed later. - theChild->acquire(); + theChild->acquire(); - SfxGroupInfo_Impl* pInfo = - new SfxGroupInfo_Impl(SFX_CFGGROUP_SCRIPTCONTAINER, - 0, static_cast<void *>( theChild.get())); + SfxGroupInfo_Impl* pInfo = + new SfxGroupInfo_Impl(SFX_CFGGROUP_SCRIPTCONTAINER, + 0, static_cast<void *>( theChild.get())); - Image aImage = GetImage( theChild, xCtx, bIsRootNode ); - SvLBoxEntry* pNewEntry = - InsertEntry( uiName, NULL); - SetExpandedEntryBmp( pNewEntry, aImage ); - SetCollapsedEntryBmp( pNewEntry, aImage ); + Image aImage = GetImage( theChild, xCtx, bIsRootNode ); + SvLBoxEntry* pNewEntry = + InsertEntry( uiName, NULL); + SetExpandedEntryBmp( pNewEntry, aImage ); + SetCollapsedEntryBmp( pNewEntry, aImage ); - pNewEntry->SetUserData( pInfo ); - aArr.Insert( pInfo, aArr.Count() ); + pNewEntry->SetUserData( pInfo ); + aArr.Insert( pInfo, aArr.Count() ); - if ( children[n]->hasChildNodes() ) - { - Sequence< Reference< browse::XBrowseNode > > grandchildren = - children[n]->getChildNodes(); + if ( children[n]->hasChildNodes() ) + { + Sequence< Reference< browse::XBrowseNode > > grandchildren = + children[n]->getChildNodes(); - for ( sal_Int32 m = 0; m < grandchildren.getLength(); ++m ) + for ( sal_Int32 m = 0; m < grandchildren.getLength(); ++m ) + { + if ( grandchildren[m]->getType() == browse::BrowseNodeTypes::CONTAINER ) { - if ( grandchildren[m]->getType() == browse::BrowseNodeTypes::CONTAINER ) - { - pNewEntry->EnableChildsOnDemand( TRUE ); - m = grandchildren.getLength(); - } + pNewEntry->EnableChildsOnDemand( sal_True ); + m = grandchildren.getLength(); } } } } } } - catch (RuntimeException&) { - // do nothing, the entry will not be displayed in the UI - } + } + catch (RuntimeException&) { + // do nothing, the entry will not be displayed in the UI } } } @@ -951,11 +751,11 @@ void SfxConfigGroupListBox_Impl::Init(const css::uno::Reference< css::lang::XMul SfxGroupInfo_Impl *pInfo = new SfxGroupInfo_Impl( SFX_CFGGROUP_STYLES, 0, 0 ); // TODO last parameter should contain user data aArr.Insert( pInfo, aArr.Count() ); pEntry->SetUserData( pInfo ); - pEntry->EnableChildsOnDemand( TRUE ); + pEntry->EnableChildsOnDemand( sal_True ); } MakeVisible( GetEntry( 0,0 ) ); - SetUpdateMode( TRUE ); + SetUpdateMode( sal_True ); } Image SfxConfigGroupListBox_Impl::GetImage( Reference< browse::XBrowseNode > node, @@ -1066,25 +866,6 @@ SfxConfigGroupListBox_Impl::getDocumentModel( Reference< XComponentContext >& xC return xModel; } -::rtl::OUString SfxConfigGroupListBox_Impl::parseLocationName( const ::rtl::OUString& location ) -{ - // strip out the last leaf of location name - // e.g. file://dir1/dir2/Blah.sxw - > Blah.sxw - ::rtl::OUString temp = location; - sal_Int32 lastSlashIndex = temp.lastIndexOf( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "/" ) ) ); - - if ( ( lastSlashIndex + 1 ) < temp.getLength() ) - { - temp = temp.copy( lastSlashIndex + 1 ); - } - // maybe we should throw here!!! - else - { - OSL_TRACE("Something wrong with name, perhaps we should throw an exception"); - } - return temp; -} - //----------------------------------------------- ::rtl::OUString SfxConfigGroupListBox_Impl::MapCommand2UIName(const ::rtl::OUString& sCommand) { @@ -1122,14 +903,13 @@ void SfxConfigGroupListBox_Impl::GroupSelected() { SvLBoxEntry *pEntry = FirstSelected(); SfxGroupInfo_Impl *pInfo = (SfxGroupInfo_Impl*) pEntry->GetUserData(); - pFunctionListBox->SetUpdateMode(FALSE); + pFunctionListBox->SetUpdateMode(sal_False); pFunctionListBox->ClearAll(); if ( pInfo->nKind != SFX_CFGGROUP_FUNCTION && - pInfo->nKind != SFX_CFGGROUP_BASICMOD && pInfo->nKind != SFX_CFGGROUP_SCRIPTCONTAINER && pInfo->nKind != SFX_CFGGROUP_STYLES ) { - pFunctionListBox->SetUpdateMode(TRUE); + pFunctionListBox->SetUpdateMode(sal_True); return; } @@ -1137,7 +917,7 @@ void SfxConfigGroupListBox_Impl::GroupSelected() { case SFX_CFGGROUP_FUNCTION : { - USHORT nGroup = pInfo->nOrd; + sal_uInt16 nGroup = pInfo->nUniqueID; css::uno::Reference< css::frame::XDispatchInformationProvider > xProvider (m_xFrame, css::uno::UNO_QUERY_THROW); css::uno::Sequence< css::frame::DispatchInformation > lCommands = xProvider->getConfigurableDispatchInformation(nGroup); sal_Int32 c = lCommands.getLength(); @@ -1157,45 +937,6 @@ void SfxConfigGroupListBox_Impl::GroupSelected() break; } - case SFX_CFGGROUP_BASICMOD : - { - SvLBoxEntry *pLibEntry = GetParent( pEntry ); - SfxGroupInfo_Impl *pLibInfo = - (SfxGroupInfo_Impl*) pLibEntry->GetUserData(); - SvLBoxEntry *pBasEntry = GetParent( pLibEntry ); - SfxGroupInfo_Impl *pBasInfo = - (SfxGroupInfo_Impl*) pBasEntry->GetUserData(); - - StarBASIC *pLib = (StarBASIC*) pLibInfo->pObject; - Reference< XModel > xDoc; - if ( pBasInfo->nKind == SFX_CFGGROUP_DOCBASICMGR ) - xDoc = static_cast< XModel* >( pBasInfo->pObject ); - - SbModule *pMod = (SbModule*) pInfo->pObject; - for ( USHORT nMeth=0; nMeth < pMod->GetMethods()->Count(); ++nMeth ) - { - SbxMethod *pMeth = (SbxMethod*)pMod->GetMethods()->Get(nMeth); - SfxMacroInfoPtr pInf = new SfxMacroInfo( !xDoc.is(), - pLib->GetName(), - pMod->GetName(), - pMeth->GetName()); - if ( pMeth->GetInfo() ) - pInf->SetHelpText( pMeth->GetInfo()->GetComment() ); - USHORT nId = SFX_APP()->GetMacroConfig()->GetSlotId( pInf ); - if ( !nId ) - break; // Kein Slot mehr frei - - SvLBoxEntry* pFuncEntry = - pFunctionListBox->InsertEntry( pMeth->GetName(), NULL ); - SfxGroupInfo_Impl *pGrpInfo = - new SfxGroupInfo_Impl( SFX_CFGFUNCTION_MACRO, nId, pInf ); - pFunctionListBox->aArr.Insert( pGrpInfo, pFunctionListBox->aArr.Count() ); - pFuncEntry->SetUserData( pGrpInfo ); - } - - break; - } - case SFX_CFGGROUP_SCRIPTCONTAINER: { if ( !GetChildCount( pEntry ) ) @@ -1225,13 +966,8 @@ void SfxConfigGroupListBox_Impl::GroupSelected() xPropSet->getPropertyValue( String::CreateFromAscii( "URI" ) ); value >>= uri; - SfxMacroInfo* aInfo = new SfxMacroInfo( (String)uri ); - aInfo->SetHelpText( uri ); - SFX_APP()->GetMacroConfig()->GetSlotId( aInfo ); - - SfxGroupInfo_Impl* pGrpInfo = - new SfxGroupInfo_Impl(SFX_CFGFUNCTION_SCRIPT, - aInfo->GetSlotId(), aInfo); + String* pScriptURI = new String( uri ); + SfxGroupInfo_Impl* pGrpInfo = new SfxGroupInfo_Impl( SFX_CFGFUNCTION_SCRIPT, 0, pScriptURI ); Image aImage = GetImage( children[n], Reference< XComponentContext >(), sal_False ); SvLBoxEntry* pNewEntry = @@ -1287,31 +1023,31 @@ void SfxConfigGroupListBox_Impl::GroupSelected() if ( pFunctionListBox->GetEntryCount() ) pFunctionListBox->Select( pFunctionListBox->GetEntry( 0, 0 ) ); - pFunctionListBox->SetUpdateMode(TRUE); + pFunctionListBox->SetUpdateMode(sal_True); } -BOOL SfxConfigGroupListBox_Impl::Expand( SvLBoxEntry* pParent ) +sal_Bool SfxConfigGroupListBox_Impl::Expand( SvLBoxEntry* pParent ) { - BOOL bRet = SvTreeListBox::Expand( pParent ); + sal_Bool bRet = SvTreeListBox::Expand( pParent ); if ( bRet ) { // Wieviele Entries k"onnen angezeigt werden ? - ULONG nEntries = GetOutputSizePixel().Height() / GetEntryHeight(); + sal_uLong nEntries = GetOutputSizePixel().Height() / GetEntryHeight(); // Wieviele Kinder sollen angezeigt werden ? - ULONG nChildCount = GetVisibleChildCount( pParent ); + sal_uLong nChildCount = GetVisibleChildCount( pParent ); // Passen alle Kinder und der parent gleichzeitig in die View ? if ( nChildCount+1 > nEntries ) { // Wenn nicht, wenigstens parent ganz nach oben schieben - MakeVisible( pParent, TRUE ); + MakeVisible( pParent, sal_True ); } else { // An welcher relativen ViewPosition steht der aufzuklappende parent SvLBoxEntry *pEntry = GetFirstEntryInView(); - ULONG nParentPos = 0; + sal_uLong nParentPos = 0; while ( pEntry && pEntry != pParent ) { ++nParentPos; @@ -1333,69 +1069,9 @@ void SfxConfigGroupListBox_Impl::RequestingChilds( SvLBoxEntry *pEntry ) */ { SfxGroupInfo_Impl *pInfo = (SfxGroupInfo_Impl*) pEntry->GetUserData(); - pInfo->bWasOpened = TRUE; + pInfo->bWasOpened = sal_True; switch ( pInfo->nKind ) { - case SFX_CFGGROUP_BASICMGR : - case SFX_CFGGROUP_DOCBASICMGR : - { - if ( !GetChildCount( pEntry ) ) - { - // Erstmaliges "Offnen - BasicManager* pMgr( GetBasicManager( *pEntry ) ); - - SvLBoxEntry *pLibEntry = 0; - for ( USHORT nLib=0; nLib<pMgr->GetLibCount(); ++nLib ) - { - StarBASIC* pLib = pMgr->GetLib( nLib ); - pLibEntry = InsertEntry( pMgr->GetLibName( nLib ), pEntry ); - SfxGroupInfo_Impl *pGrpInfo = new SfxGroupInfo_Impl( SFX_CFGGROUP_BASICLIB, nLib, pLib ); - aArr.Insert( pGrpInfo, aArr.Count() ); - pLibEntry->SetUserData( pGrpInfo ); - pLibEntry->EnableChildsOnDemand( TRUE ); - } - } - - break; - } - - case SFX_CFGGROUP_BASICLIB : - { - if ( !GetChildCount( pEntry ) ) - { - // Erstmaliges "Offnen - StarBASIC *pLib = (StarBASIC*) pInfo->pObject; - if ( !pLib ) - { - // Lib mu\s nachgeladen werden - SvLBoxEntry *pParent = GetParent( pEntry ); - BasicManager *pMgr( GetBasicManager( *pParent ) ); - - if ( pMgr->LoadLib( pInfo->nOrd ) ) - pInfo->pObject = pLib = pMgr->GetLib( pInfo->nOrd ); - else - break; - } - - SvLBoxEntry *pModEntry = 0; - for ( USHORT nMod=0; nMod<pLib->GetModules()->Count(); ++nMod ) - { - SbModule* pMod = (SbModule*)pLib->GetModules()->Get( nMod ); - - BOOL bIsStarScript = FALSE; - BOOL bWantsStarScript = pImp->m_aScriptType.EqualsAscii("StarScript"); - if ( bIsStarScript != bWantsStarScript ) - continue; - pModEntry = InsertEntry( pMod->GetName(), pEntry ); - SfxGroupInfo_Impl *pGrpInfo = new SfxGroupInfo_Impl( SFX_CFGGROUP_BASICMOD, 0, pMod ); - aArr.Insert( pGrpInfo, aArr.Count() ); - pModEntry->SetUserData( pGrpInfo ); - } - } - - break; - } - case SFX_CFGGROUP_SCRIPTCONTAINER: { if ( !GetChildCount( pEntry ) ) @@ -1408,19 +1084,19 @@ void SfxConfigGroupListBox_Impl::RequestingChilds( SvLBoxEntry *pEntry ) { Sequence< Reference< browse::XBrowseNode > > children = rootNode->getChildNodes(); - BOOL bIsRootNode = FALSE; + sal_Bool bIsRootNode = sal_False; ::rtl::OUString user( RTL_CONSTASCII_USTRINGPARAM("user") ); ::rtl::OUString share( RTL_CONSTASCII_USTRINGPARAM("share" )); if ( rootNode->getName().equals(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Root") ) ) ) { - bIsRootNode = TRUE; + bIsRootNode = sal_True; } /* To mimic current starbasic behaviour we need to make sure that only the current document is displayed in the config tree. Tests below - set the bDisplay flag to FALSE if the current + set the bDisplay flag to sal_False if the current node is a first level child of the Root and is NOT either the current document, user or share */ ::rtl::OUString currentDocTitle; @@ -1435,11 +1111,11 @@ void SfxConfigGroupListBox_Impl::RequestingChilds( SvLBoxEntry *pEntry ) { Reference< browse::XBrowseNode >& theChild = children[n]; ::rtl::OUString aName( theChild->getName() ); - BOOL bDisplay = TRUE; + sal_Bool bDisplay = sal_True; if ( bIsRootNode ) { if ( !( (aName.equals(user) || aName.equals(share) || aName.equals(currentDocTitle) ) ) ) - bDisplay=FALSE; + bDisplay=sal_False; } if ( children[n].is() && children[n]->getType() != browse::BrowseNodeTypes::SCRIPT && bDisplay ) { @@ -1472,7 +1148,7 @@ void SfxConfigGroupListBox_Impl::RequestingChilds( SvLBoxEntry *pEntry ) { if ( grandchildren[m]->getType() == browse::BrowseNodeTypes::CONTAINER ) { - pNewEntry->EnableChildsOnDemand( TRUE ); + pNewEntry->EnableChildsOnDemand( sal_True ); m = grandchildren.getLength(); } } @@ -1503,7 +1179,7 @@ void SfxConfigGroupListBox_Impl::RequestingChilds( SvLBoxEntry *pEntry ) SfxGroupInfo_Impl *pGrpInfo = new SfxGroupInfo_Impl( SFX_CFGGROUP_STYLES, 0, pFamily ); aArr.Insert( pGrpInfo, aArr.Count() ); pStyleEntry->SetUserData( pGrpInfo ); - pStyleEntry->EnableChildsOnDemand( FALSE ); + pStyleEntry->EnableChildsOnDemand( sal_False ); } } break; @@ -1515,10 +1191,6 @@ void SfxConfigGroupListBox_Impl::RequestingChilds( SvLBoxEntry *pEntry ) } } -void SfxConfigGroupListBox_Impl::AddAndSelect( const SfxStringItem* , const SfxStringItem* ) -{ -} - void SfxConfigGroupListBox_Impl::SelectMacro( const SfxMacroInfoItem *pItem ) { SelectMacro( pItem->GetBasicManager()->GetName(), @@ -1532,7 +1204,7 @@ void SfxConfigGroupListBox_Impl::SelectMacro( const String& rBasic, aBasicName += ' '; aBasicName += pImp->m_sMacros; String aLib, aModule, aMethod; - USHORT nCount = rMacro.GetTokenCount('.'); + sal_uInt16 nCount = rMacro.GetTokenCount('.'); aMethod = rMacro.GetToken( nCount-1, '.' ); if ( nCount > 2 ) { diff --git a/cui/source/customize/eventdlg.cxx b/cui/source/customize/eventdlg.cxx index 02383fc0b3bf..7b4c04edbae6 100644 --- a/cui/source/customize/eventdlg.cxx +++ b/cui/source/customize/eventdlg.cxx @@ -41,7 +41,6 @@ #include <sfx2/viewfrm.hxx> #include <sfx2/evntconf.hxx> -#include <sfx2/macrconf.hxx> #include <sfx2/minfitem.hxx> #include <sfx2/app.hxx> #include <sfx2/objsh.hxx> @@ -69,7 +68,7 @@ SvxEventConfigPage::SvxEventConfigPage( Window *pParent, const SfxItemSet& rSet, _SvxMacroTabPage( pParent, CUI_RES(RID_SVXPAGE_EVENTS), rSet ), aSaveInText( this, CUI_RES( TXT_SAVEIN ) ), aSaveInListBox( this, CUI_RES( LB_SAVEIN ) ), - bAppConfig ( TRUE ) + bAppConfig ( sal_True ) { mpImpl->pStrEvent = new String( CUI_RES( STR_EVENT )); mpImpl->pAssignedMacro = new String( CUI_RES( STR_ASSMACRO )); @@ -98,7 +97,7 @@ SvxEventConfigPage::SvxEventConfigPage( Window *pParent, const SfxItemSet& rSet, "com.sun.star.frame.GlobalEventBroadcaster" )) ), uno::UNO_QUERY ); - USHORT nPos(0); + sal_uInt16 nPos(0); if ( xSupplier.is() ) { m_xAppEvents = xSupplier->getEvents(); @@ -107,7 +106,7 @@ SvxEventConfigPage::SvxEventConfigPage( Window *pParent, const SfxItemSet& rSet, utl::ConfigManager::PRODUCTNAME ) >>= label; nPos = aSaveInListBox.InsertEntry( label ); aSaveInListBox.SetEntryData( nPos, new bool(true) ); - aSaveInListBox.SelectEntryPos( nPos, TRUE ); + aSaveInListBox.SelectEntryPos( nPos, sal_True ); } } @@ -163,10 +162,10 @@ void SvxEventConfigPage::ImplInitDocument() m_xDocumentModifiable = m_xDocumentModifiable.query( xModel ); OUString aTitle = ::comphelper::DocumentInfo::getDocumentTitle( xModel ); - USHORT nPos = aSaveInListBox.InsertEntry( aTitle ); + sal_uInt16 nPos = aSaveInListBox.InsertEntry( aTitle ); aSaveInListBox.SetEntryData( nPos, new bool(false) ); - aSaveInListBox.SelectEntryPos( nPos, TRUE ); + aSaveInListBox.SelectEntryPos( nPos, sal_True ); bAppConfig = false; } @@ -186,16 +185,16 @@ IMPL_LINK( SvxEventConfigPage, SelectHdl_Impl, ListBox *, pBox ) bool* bApp = (bool*) aSaveInListBox.GetEntryData( aSaveInListBox.GetSelectEntryPos()); - mpImpl->pEventLB->SetUpdateMode( FALSE ); + mpImpl->pEventLB->SetUpdateMode( sal_False ); bAppConfig = *bApp; if ( *bApp ) { - SetReadOnly( FALSE ); + SetReadOnly( sal_False ); _SvxMacroTabPage::DisplayAppEvents( true ); } else { - bool isReadonly = FALSE; + bool isReadonly = sal_False; uno::Reference< frame::XFramesSupplier > xFramesSupplier( ::comphelper::getProcessServiceFactory()->createInstance( @@ -222,13 +221,13 @@ IMPL_LINK( SvxEventConfigPage, SelectHdl_Impl, ListBox *, pBox ) _SvxMacroTabPage::DisplayAppEvents( false ); } - mpImpl->pEventLB->SetUpdateMode( TRUE ); - return TRUE; + mpImpl->pEventLB->SetUpdateMode( sal_True ); + return sal_True; } // ----------------------------------------------------------------------- -BOOL SvxEventConfigPage::FillItemSet( SfxItemSet& rSet ) +sal_Bool SvxEventConfigPage::FillItemSet( SfxItemSet& rSet ) { return _SvxMacroTabPage::FillItemSet( rSet ); } diff --git a/cui/source/customize/eventdlg.hxx b/cui/source/customize/eventdlg.hxx index c25fe2ae8d74..bbd839b7e2aa 100644 --- a/cui/source/customize/eventdlg.hxx +++ b/cui/source/customize/eventdlg.hxx @@ -49,7 +49,7 @@ class SvxEventConfigPage : public _SvxMacroTabPage ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameReplace > m_xDocumentEvents; ::com::sun::star::uno::Reference< ::com::sun::star::util::XModifiable > m_xDocumentModifiable; - BOOL bAppConfig; + sal_Bool bAppConfig; DECL_LINK( SelectHdl_Impl, ListBox* ); @@ -66,7 +66,7 @@ public: void LateInit( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& _rxFrame ); protected: - virtual BOOL FillItemSet( SfxItemSet& ); + virtual sal_Bool FillItemSet( SfxItemSet& ); virtual void Reset( const SfxItemSet& ); using _SvxMacroTabPage::Reset; diff --git a/cui/source/customize/eventdlg.src b/cui/source/customize/eventdlg.src index b121caca1420..c4ef082b286d 100644 --- a/cui/source/customize/eventdlg.src +++ b/cui/source/customize/eventdlg.src @@ -63,6 +63,7 @@ TabPage RID_SVXPAGE_EVENTS }; ListBox LB_SAVEIN { + HelpID = "cui:ListBox:RID_SVXPAGE_EVENTS:LB_SAVEIN"; Border = TRUE ; Pos = MAP_APPFONT ( 54 , 238 ) ; Size = MAP_APPFONT ( 132 , 53 ) ; @@ -76,6 +77,7 @@ TabPage RID_SVXPAGE_EVENTS }; PushButton PB_ASSIGN { + HelpID = "cui:PushButton:RID_SVXPAGE_EVENTS:PB_ASSIGN"; Pos = MAP_APPFONT ( 217 , ROW0A ) ; Size = MAP_APPFONT ( 50 , 14 ) ; Disable = TRUE ; @@ -83,6 +85,7 @@ TabPage RID_SVXPAGE_EVENTS }; PushButton PB_DELETE { + HelpID = "cui:PushButton:RID_SVXPAGE_EVENTS:PB_DELETE"; Pos = MAP_APPFONT ( 217 , ROW0A+RSC_CD_PUSHBUTTON_HEIGHT+12 ) ; Size = MAP_APPFONT ( 50 , 14 ) ; Disable = TRUE ; diff --git a/cui/source/customize/macropg.cxx b/cui/source/customize/macropg.cxx index 3f26f09d9761..62731acc4b68 100644 --- a/cui/source/customize/macropg.cxx +++ b/cui/source/customize/macropg.cxx @@ -37,7 +37,6 @@ #include <tools/diagnose_ex.h> #include <sfx2/app.hxx> #include <sfx2/objsh.hxx> -#include <sfx2/macrconf.hxx> #include <sfx2/sfxdefs.hxx> #include <com/sun/star/container/NoSuchElementException.hpp> #include <com/sun/star/lang/IllegalArgumentException.hpp> @@ -71,11 +70,11 @@ _SvxMacroTabPage_Impl::_SvxMacroTabPage_Impl( const SfxItemSet& rAttrSet ) : pStrEvent( NULL ), pAssignedMacro( NULL ), pEventLB( NULL ), - bReadOnly( FALSE ), - bIDEDialogMode( FALSE ) + bReadOnly( sal_False ), + bIDEDialogMode( sal_False ) { const SfxPoolItem* pItem; - if ( SFX_ITEM_SET == rAttrSet.GetItemState( SID_ATTR_MACROITEM, FALSE, &pItem ) ) + if ( SFX_ITEM_SET == rAttrSet.GetItemState( SID_ATTR_MACROITEM, sal_False, &pItem ) ) bIDEDialogMode = ((const SfxBoolItem*)pItem)->GetValue(); } @@ -121,7 +120,7 @@ IMPL_LINK( _HeaderTabListBox, HeaderEndDrag_Impl, HeaderBar*, pBar ) if( !maHeaderBar.IsItemMode() ) { Size aSz; - USHORT _nTabs = maHeaderBar.GetItemCount(); + sal_uInt16 _nTabs = maHeaderBar.GetItemCount(); long nWidth = maHeaderBar.GetItemSize( ITEMID_EVENT ); long nBarWidth = maHeaderBar.GetSizePixel().Width(); @@ -132,7 +131,7 @@ IMPL_LINK( _HeaderTabListBox, HeaderEndDrag_Impl, HeaderBar*, pBar ) { long _nWidth, nTmpSz = 0; - for( USHORT i = 1 ; i < _nTabs ; ++i ) + for( sal_uInt16 i = 1 ; i < _nTabs ; ++i ) { _nWidth = maHeaderBar.GetItemSize( i ); aSz.Width() = _nWidth + nTmpSz; @@ -189,7 +188,7 @@ void _HeaderTabListBox::ConnectElements( void ) maListBox.InitHeaderBar( &maHeaderBar ); } -void _HeaderTabListBox::Show( BOOL bVisible, USHORT nFlags ) +void _HeaderTabListBox::Show( sal_Bool bVisible, sal_uInt16 nFlags ) { maListBox.Show( bVisible, nFlags ); maHeaderBar.Show( bVisible, nFlags ); @@ -204,7 +203,7 @@ void _HeaderTabListBox::Enable( bool bEnable, bool bChild ) // assign button ("Add Command") is enabled only if it is not read only // delete button ("Remove Command") is enabled if a current binding exists // and it is not read only -void _SvxMacroTabPage::EnableButtons( const String& /*rLangName*/ ) +void _SvxMacroTabPage::EnableButtons() { const SvLBoxEntry* pE = mpImpl->pEventLB->GetListBox().FirstSelected(); if ( pE ) @@ -329,7 +328,7 @@ void _SvxMacroTabPage::InitResources() // the following method is called when the user clicks OK // We use the contents of the hashes to replace the settings -BOOL _SvxMacroTabPage::FillItemSet( SfxItemSet& /*rSet*/ ) +sal_Bool _SvxMacroTabPage::FillItemSet( SfxItemSet& /*rSet*/ ) { try { @@ -380,7 +379,7 @@ BOOL _SvxMacroTabPage::FillItemSet( SfxItemSet& /*rSet*/ ) { } // what is the return value about?? - return FALSE; + return sal_False; } // the following method clears the bindings in the hashes for both doc & app @@ -427,12 +426,12 @@ void _SvxMacroTabPage::Reset() DisplayAppEvents(bAppEvents); } -void _SvxMacroTabPage::SetReadOnly( BOOL bSet ) +void _SvxMacroTabPage::SetReadOnly( sal_Bool bSet ) { mpImpl->bReadOnly = bSet; } -BOOL _SvxMacroTabPage::IsReadOnly() const +sal_Bool _SvxMacroTabPage::IsReadOnly() const { return mpImpl->bReadOnly; } @@ -445,13 +444,13 @@ class IconLBoxString : public SvLBoxString int m_nxImageOffset; public: - IconLBoxString( SvLBoxEntry* pEntry, USHORT nFlags, const String& sText, + IconLBoxString( SvLBoxEntry* pEntry, sal_uInt16 nFlags, const String& sText, Image* pMacroImg, Image* pComponentImg ); - virtual void Paint(const Point& aPos, SvLBox& aDevice, USHORT nFlags, SvLBoxEntry* pEntry ); + virtual void Paint(const Point& aPos, SvLBox& aDevice, sal_uInt16 nFlags, SvLBoxEntry* pEntry ); }; -IconLBoxString::IconLBoxString( SvLBoxEntry* pEntry, USHORT nFlags, const String& sText, +IconLBoxString::IconLBoxString( SvLBoxEntry* pEntry, sal_uInt16 nFlags, const String& sText, Image* pMacroImg, Image* pComponentImg ) : SvLBoxString( pEntry, nFlags, sText ) , m_pMacroImg( pMacroImg ) @@ -462,7 +461,7 @@ IconLBoxString::IconLBoxString( SvLBoxEntry* pEntry, USHORT nFlags, const String //=============================================== void IconLBoxString::Paint( const Point& aPos, SvLBox& aDevice, - USHORT /*nFlags*/, SvLBoxEntry* /*pEntry*/ ) + sal_uInt16 /*nFlags*/, SvLBoxEntry* /*pEntry*/ ) { String aTxt( GetText() ); if( aTxt.Len() ) @@ -500,7 +499,7 @@ void _SvxMacroTabPage::DisplayAppEvents( bool appEvents) bAppEvents = appEvents; SvHeaderTabListBox& rListBox = mpImpl->pEventLB->GetListBox(); - mpImpl->pEventLB->SetUpdateMode( FALSE ); + mpImpl->pEventLB->SetUpdateMode( sal_False ); rListBox.Clear(); SvLBoxEntry* pE = rListBox.GetEntry( 0 ); EventsHash* eventsHash; @@ -568,8 +567,8 @@ void _SvxMacroTabPage::DisplayAppEvents( bool appEvents) rListBox.MakeVisible( pE ); } - rListBox.SetUpdateMode( TRUE ); - EnableButtons( String() ); + rListBox.SetUpdateMode( sal_True ); + EnableButtons(); } // select event handler on the listbox @@ -578,7 +577,7 @@ IMPL_STATIC_LINK( _SvxMacroTabPage, SelectEvent_Impl, SvTabListBox*, EMPTYARG ) _SvxMacroTabPage_Impl* pImpl = pThis->mpImpl; SvHeaderTabListBox& rListBox = pImpl->pEventLB->GetListBox(); SvLBoxEntry* pE = rListBox.FirstSelected(); - ULONG nPos; + sal_uLong nPos; if( !pE || LISTBOX_ENTRY_NOTFOUND == ( nPos = rListBox.GetModel()->GetAbsPos( pE ) ) ) @@ -587,7 +586,7 @@ IMPL_STATIC_LINK( _SvxMacroTabPage, SelectEvent_Impl, SvTabListBox*, EMPTYARG ) return 0; } - pThis->EnableButtons( String() ); + pThis->EnableButtons(); return 0; } @@ -607,7 +606,7 @@ long _SvxMacroTabPage::GenericHandler_Impl( _SvxMacroTabPage* pThis, PushButton* _SvxMacroTabPage_Impl* pImpl = pThis->mpImpl; SvHeaderTabListBox& rListBox = pImpl->pEventLB->GetListBox(); SvLBoxEntry* pE = rListBox.FirstSelected(); - ULONG nPos; + sal_uLong nPos; if( !pE || LISTBOX_ENTRY_NOTFOUND == ( nPos = rListBox.GetModel()->GetAbsPos( pE ) ) ) { @@ -615,7 +614,7 @@ long _SvxMacroTabPage::GenericHandler_Impl( _SvxMacroTabPage* pThis, PushButton* return 0; } - const BOOL bAssEnabled = pBtn != pImpl->pDeletePB && pImpl->pAssignPB->IsEnabled(); + const sal_Bool bAssEnabled = pBtn != pImpl->pDeletePB && pImpl->pAssignPB->IsEnabled(); ::rtl::OUString* pEventName = (::rtl::OUString*)pE->GetUserData(); @@ -673,7 +672,7 @@ long _SvxMacroTabPage::GenericHandler_Impl( _SvxMacroTabPage* pThis, PushButton* else if( bAssEnabled ) { // assign pressed - SvxScriptSelectorDialog* pDlg = new SvxScriptSelectorDialog( pThis, FALSE, pThis->GetFrame() ); + SvxScriptSelectorDialog* pDlg = new SvxScriptSelectorDialog( pThis, sal_False, pThis->GetFrame() ); if( pDlg ) { short ret = pDlg->Execute(); @@ -702,16 +701,16 @@ long _SvxMacroTabPage::GenericHandler_Impl( _SvxMacroTabPage* pThis, PushButton* } // update the listbox entry - pImpl->pEventLB->SetUpdateMode( FALSE ); + pImpl->pEventLB->SetUpdateMode( sal_False ); pE->ReplaceItem( new IconLBoxString( pE, 0, sEventURL, pImpl->pMacroImg, pImpl->pComponentImg ), LB_MACROS_ITEMPOS ); rListBox.GetModel()->InvalidateEntry( pE ); rListBox.Select( pE ); rListBox.MakeVisible( pE ); - rListBox.SetUpdateMode( TRUE ); + rListBox.SetUpdateMode( sal_True ); - pThis->EnableButtons( String() ); + pThis->EnableButtons(); return 0; } @@ -749,7 +748,7 @@ void _SvxMacroTabPage::InitAndSetHandler( Reference< container::XNameReplace> xA mpImpl->pEventLB->GetListBox().SetEntryHeight( sal::static_int_cast< short >(nMinLineHeight) ); - mpImpl->pEventLB->Enable( TRUE ); + mpImpl->pEventLB->Enable( sal_True ); if(!m_xAppEvents.is()) { @@ -854,7 +853,7 @@ SvxMacroTabPage::SvxMacroTabPage( Window* pParent, const Reference< frame::XFram InitAndSetHandler( xNameReplace, Reference< container::XNameReplace>(0), Reference< util::XModifiable >(0)); DisplayAppEvents(true); SvHeaderTabListBox& rListBox = mpImpl->pEventLB->GetListBox(); - SvLBoxEntry* pE = rListBox.GetEntry( (ULONG)nSelectedIndex ); + SvLBoxEntry* pE = rListBox.GetEntry( (sal_uLong)nSelectedIndex ); if( pE ) rListBox.Select(pE); } diff --git a/cui/source/customize/macropg.src b/cui/source/customize/macropg.src index 248a612dbefe..6de18774547c 100644 --- a/cui/source/customize/macropg.src +++ b/cui/source/customize/macropg.src @@ -36,6 +36,7 @@ TabPage RID_SVXPAGE_MACROASSIGN { + HelpID = "cui:TabPage:RID_SVXPAGE_MACROASSIGN" ; Hide = TRUE ; OutputSize = TRUE ; SVLook = TRUE ; @@ -65,6 +66,7 @@ TabPage RID_SVXPAGE_MACROASSIGN }; PushButton PB_ASSIGN { + HelpID = "cui:PushButton:RID_SVXPAGE_MACROASSIGN:PB_ASSIGN"; Pos = MAP_APPFONT ( COL4 , ROW0A ) ; Size = MAP_APPFONT ( RSC_CD_PUSHBUTTON_WIDTH , RSC_CD_PUSHBUTTON_HEIGHT ) ; Text [ en-US ] = "M~acro..." ; @@ -73,6 +75,7 @@ TabPage RID_SVXPAGE_MACROASSIGN }; PushButton PB_ASSIGN_COMPONENT { + HelpID = "cui:PushButton:RID_SVXPAGE_MACROASSIGN:PB_ASSIGN_COMPONENT"; Pos = MAP_APPFONT ( COL4 , ROW2 ) ; Size = MAP_APPFONT ( RSC_CD_PUSHBUTTON_WIDTH , RSC_CD_PUSHBUTTON_HEIGHT ) ; Disable = TRUE ; @@ -81,6 +84,7 @@ TabPage RID_SVXPAGE_MACROASSIGN }; PushButton PB_DELETE { + HelpID = "cui:PushButton:RID_SVXPAGE_MACROASSIGN:PB_DELETE"; Pos = MAP_APPFONT ( COL4 , ROW5_REMOVE ) ; Size = MAP_APPFONT ( RSC_CD_PUSHBUTTON_WIDTH , RSC_CD_PUSHBUTTON_HEIGHT ) ; Text [ en-US ] = "~Remove" ; @@ -101,6 +105,7 @@ TabPage RID_SVXPAGE_MACROASSIGN ModalDialog RID_SVXDLG_ASSIGNCOMPONENT { + HelpID = "cui:ModalDialog:RID_SVXDLG_ASSIGNCOMPONENT"; OutputSize = TRUE ; SVLook = TRUE ; Size = MAP_APPFONT ( COMP_WIDTH , COMP_HEIGHT ) ; @@ -133,6 +138,7 @@ ModalDialog RID_SVXDLG_ASSIGNCOMPONENT }; Edit EDIT_METHOD { + HelpID = "cui:Edit:RID_SVXDLG_ASSIGNCOMPONENT:EDIT_METHOD"; Border = TRUE ; Pos = MAP_APPFONT ( COMP_COL0 , COMP_ROWEDIT ) ; Size = MAP_APPFONT ( COMP_EDIT_WIDTH , RSC_CD_TEXTBOX_HEIGHT ) ; diff --git a/cui/source/customize/macropg_impl.hxx b/cui/source/customize/macropg_impl.hxx index c6501e4b30a1..c79b91f50fff 100644 --- a/cui/source/customize/macropg_impl.hxx +++ b/cui/source/customize/macropg_impl.hxx @@ -44,8 +44,8 @@ public: String* pStrEvent; String* pAssignedMacro; _HeaderTabListBox* pEventLB; - BOOL bReadOnly; - BOOL bIDEDialogMode; + sal_Bool bReadOnly; + sal_Bool bIDEDialogMode; }; class AssignComponentDialog : public ModalDialog diff --git a/cui/source/customize/selector.cxx b/cui/source/customize/selector.cxx index 6fee34f67ca6..0900a1ff4847 100644 --- a/cui/source/customize/selector.cxx +++ b/cui/source/customize/selector.cxx @@ -38,7 +38,6 @@ #include <sfx2/app.hxx> #include <sfx2/msg.hxx> #include <sfx2/msgpool.hxx> -#include <sfx2/macrconf.hxx> #include <sfx2/minfitem.hxx> #include <sfx2/objsh.hxx> #include <sfx2/dispatch.hxx> @@ -89,7 +88,7 @@ SvxConfigFunctionListBox_Impl::SvxConfigFunctionListBox_Impl( Window* pParent, c , pCurEntry( 0 ) , m_pDraggingEntry( 0 ) { - SetWindowBits( GetStyle() | WB_CLIPCHILDREN | WB_HSCROLL | WB_SORT ); + SetStyle( GetStyle() | WB_CLIPCHILDREN | WB_HSCROLL | WB_SORT ); GetModel()->SetSortMode( SortAscending ); // Timer for the BallonHelp @@ -142,8 +141,8 @@ IMPL_LINK( SvxConfigFunctionListBox_Impl, TimerHdl, Timer*, EMPTYARG) void SvxConfigFunctionListBox_Impl::ClearAll() { - USHORT nCount = aArr.Count(); - for ( USHORT i=0; i<nCount; ++i ) + sal_uInt16 nCount = aArr.Count(); + for ( sal_uInt16 i=0; i<nCount; ++i ) { SvxGroupInfo_Impl *pData = aArr[i]; delete pData; @@ -153,42 +152,6 @@ void SvxConfigFunctionListBox_Impl::ClearAll() Clear(); } -SvLBoxEntry* SvxConfigFunctionListBox_Impl::GetEntry_Impl( const String& rName ) -{ - SvLBoxEntry *pEntry = First(); - while ( pEntry ) - { - if ( GetEntryText( pEntry ) == rName ) - return pEntry; - pEntry = Next( pEntry ); - } - - return NULL; -} - -SvLBoxEntry* SvxConfigFunctionListBox_Impl::GetEntry_Impl( USHORT nId ) -{ - SvLBoxEntry *pEntry = First(); - while ( pEntry ) - { - SvxGroupInfo_Impl *pData = (SvxGroupInfo_Impl*) pEntry->GetUserData(); - if ( pData && pData->nOrd == nId ) - return pEntry; - pEntry = Next( pEntry ); - } - - return NULL; -} - -USHORT SvxConfigFunctionListBox_Impl::GetId( SvLBoxEntry *pEntry ) -{ - SvxGroupInfo_Impl *pData = pEntry ? - (SvxGroupInfo_Impl*) pEntry->GetUserData() : 0; - if ( pData ) - return pData->nOrd; - return 0; -} - String SvxConfigFunctionListBox_Impl::GetHelpText( SvLBoxEntry *pEntry ) { // Information zum selektierten Entry aus den Userdaten holen @@ -257,7 +220,7 @@ SvxConfigGroupListBox_Impl::SvxConfigGroupListBox_Impl( m_xFrame.set( xFrame ); } - SetWindowBits( GetStyle() | WB_CLIPCHILDREN | WB_HSCROLL | WB_HASBUTTONS | WB_HASLINES | WB_HASLINESATROOT | WB_HASBUTTONSATROOT ); + SetStyle( GetStyle() | WB_CLIPCHILDREN | WB_HSCROLL | WB_HASBUTTONS | WB_HASLINES | WB_HASLINESATROOT | WB_HASBUTTONSATROOT ); ImageList aNavigatorImages( SVX_RES( RID_SVXIMGLIST_FMEXPL ) ); @@ -275,8 +238,8 @@ SvxConfigGroupListBox_Impl::~SvxConfigGroupListBox_Impl() void SvxConfigGroupListBox_Impl::ClearAll() { - USHORT nCount = aArr.Count(); - for ( USHORT i=0; i<nCount; ++i ) + sal_uInt16 nCount = aArr.Count(); + for ( sal_uInt16 i=0; i<nCount; ++i ) { SvxGroupInfo_Impl *pData = aArr[i]; delete pData; @@ -353,12 +316,12 @@ void SvxConfigGroupListBox_Impl::fillScriptList( const Reference< browse::XBrows Sequence< Reference< browse::XBrowseNode > > children = _rxRootNode->getChildNodes(); - BOOL bIsRootNode = _rxRootNode->getName().equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("Root")); + sal_Bool bIsRootNode = _rxRootNode->getName().equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("Root")); /* To mimic current starbasic behaviour we need to make sure that only the current document is displayed in the config tree. Tests below - set the bDisplay flag to FALSE if the current + set the bDisplay flag to sal_False if the current node is a first level child of the Root and is NOT either the current document, user or share */ OUString sCurrentDocTitle; @@ -375,7 +338,7 @@ void SvxConfigGroupListBox_Impl::fillScriptList( const Reference< browse::XBrows if ( !theChild.is() ) continue; ::rtl::OUString sUIName = theChild->getName(); - BOOL bDisplay = TRUE; + sal_Bool bDisplay = sal_True; if ( bIsRootNode || ( m_bShowSlots && _pParentEntry && ( GetModel()->GetDepth( _pParentEntry ) == 0 ) ) @@ -395,7 +358,7 @@ void SvxConfigGroupListBox_Impl::fillScriptList( const Reference< browse::XBrows } else if ( !sUIName.equals( sCurrentDocTitle ) ) { - bDisplay = FALSE; + bDisplay = sal_False; } } @@ -423,7 +386,7 @@ void SvxConfigGroupListBox_Impl::fillScriptList( const Reference< browse::XBrows * way to determine if a basic lib had children * without having to ask for them (which forces * the library to be loaded */ - pNewEntry->EnableChildsOnDemand( TRUE ); + pNewEntry->EnableChildsOnDemand( sal_True ); } else { @@ -436,7 +399,7 @@ void SvxConfigGroupListBox_Impl::fillScriptList( const Reference< browse::XBrows { if ( grandchildren[m]->getType() == browse::BrowseNodeTypes::CONTAINER ) { - pNewEntry->EnableChildsOnDemand( TRUE ); + pNewEntry->EnableChildsOnDemand( sal_True ); break; } } @@ -452,7 +415,7 @@ void SvxConfigGroupListBox_Impl::fillScriptList( const Reference< browse::XBrows void SvxConfigGroupListBox_Impl::Init() { - SetUpdateMode(FALSE); + SetUpdateMode(sal_False); ClearAll(); Reference< XComponentContext > xContext; @@ -602,7 +565,7 @@ void SvxConfigGroupListBox_Impl::Init() SvLBoxEntry *pNewEntry = InsertEntry( aTitle, NULL ); pNewEntry->SetUserData( pInfo ); - pNewEntry->EnableChildsOnDemand( TRUE ); + pNewEntry->EnableChildsOnDemand( sal_True ); aArr.Insert( pInfo, aArr.Count() ); } else @@ -612,7 +575,7 @@ void SvxConfigGroupListBox_Impl::Init() } } MakeVisible( GetEntry( 0,0 ) ); - SetUpdateMode( TRUE ); + SetUpdateMode( sal_True ); } Image SvxConfigGroupListBox_Impl::GetImage( @@ -723,12 +686,12 @@ void SvxConfigGroupListBox_Impl::GroupSelected() { SvLBoxEntry *pEntry = FirstSelected(); SvxGroupInfo_Impl *pInfo = (SvxGroupInfo_Impl*) pEntry->GetUserData(); - pFunctionListBox->SetUpdateMode(FALSE); + pFunctionListBox->SetUpdateMode(sal_False); pFunctionListBox->ClearAll(); if ( pInfo->nKind != SVX_CFGGROUP_FUNCTION && pInfo->nKind != SVX_CFGGROUP_SCRIPTCONTAINER ) { - pFunctionListBox->SetUpdateMode(TRUE); + pFunctionListBox->SetUpdateMode(sal_True); return; } @@ -896,31 +859,31 @@ void SvxConfigGroupListBox_Impl::GroupSelected() if ( pFunctionListBox->GetEntryCount() ) pFunctionListBox->Select( pFunctionListBox->GetEntry( 0, 0 ) ); - pFunctionListBox->SetUpdateMode(TRUE); + pFunctionListBox->SetUpdateMode(sal_True); } -BOOL SvxConfigGroupListBox_Impl::Expand( SvLBoxEntry* pParent ) +sal_Bool SvxConfigGroupListBox_Impl::Expand( SvLBoxEntry* pParent ) { - BOOL bRet = SvTreeListBox::Expand( pParent ); + sal_Bool bRet = SvTreeListBox::Expand( pParent ); if ( bRet ) { // Wieviele Entries k"onnen angezeigt werden ? - ULONG nEntries = GetOutputSizePixel().Height() / GetEntryHeight(); + sal_uLong nEntries = GetOutputSizePixel().Height() / GetEntryHeight(); // Wieviele Kinder sollen angezeigt werden ? - ULONG nChildCount = GetVisibleChildCount( pParent ); + sal_uLong nChildCount = GetVisibleChildCount( pParent ); // Passen alle Kinder und der parent gleichzeitig in die View ? if ( nChildCount+1 > nEntries ) { // Wenn nicht, wenigstens parent ganz nach oben schieben - MakeVisible( pParent, TRUE ); + MakeVisible( pParent, sal_True ); } else { // An welcher relativen ViewPosition steht der aufzuklappende parent SvLBoxEntry *pEntry = GetFirstEntryInView(); - ULONG nParentPos = 0; + sal_uLong nParentPos = 0; while ( pEntry && pEntry != pParent ) { ++nParentPos; @@ -939,7 +902,7 @@ BOOL SvxConfigGroupListBox_Impl::Expand( SvLBoxEntry* pParent ) void SvxConfigGroupListBox_Impl::RequestingChilds( SvLBoxEntry *pEntry ) { SvxGroupInfo_Impl *pInfo = (SvxGroupInfo_Impl*) pEntry->GetUserData(); - pInfo->bWasOpened = TRUE; + pInfo->bWasOpened = sal_True; switch ( pInfo->nKind ) { case SVX_CFGGROUP_SCRIPTCONTAINER: @@ -966,7 +929,7 @@ void SvxConfigGroupListBox_Impl::RequestingChilds( SvLBoxEntry *pEntry ) */ SvxScriptSelectorDialog::SvxScriptSelectorDialog( - Window* pParent, BOOL bShowSlots, const Reference< frame::XFrame >& xFrame ) + Window* pParent, sal_Bool bShowSlots, const Reference< frame::XFrame >& xFrame ) : ModelessDialog( pParent, CUI_RES( RID_DLG_SCRIPTSELECTOR ) ), aDialogDescription( this, CUI_RES( TXT_SELECTOR_DIALOG_DESCRIPTION ) ), @@ -1022,7 +985,7 @@ void SvxScriptSelectorDialog::ResizeControls() Size s, news; long gap; - USHORT style = TEXT_DRAW_MULTILINE | TEXT_DRAW_TOP | + sal_uInt16 style = TEXT_DRAW_MULTILINE | TEXT_DRAW_TOP | TEXT_DRAW_LEFT | TEXT_DRAW_WORDBREAK; // get dimensions of dialog instructions control @@ -1115,12 +1078,12 @@ SvxScriptSelectorDialog::UpdateUI() aCommands.GetHelpText( aCommands.FirstSelected() ); aDescriptionText.SetText( rMessage ); - aOKButton.Enable( TRUE ); + aOKButton.Enable( sal_True ); } else { aDescriptionText.SetText( String() ); - aOKButton.Enable( FALSE ); + aOKButton.Enable( sal_False ); } } @@ -1130,7 +1093,7 @@ IMPL_LINK( SvxScriptSelectorDialog, ClickHdl, Button *, pButton ) { // If we are displaying Slot API commands then the dialog is being // run from Tools/Configure and we should not close it, just hide it - if ( m_bShowSlots == FALSE ) + if ( m_bShowSlots == sal_False ) { EndDialog( RET_CANCEL ); } @@ -1145,7 +1108,7 @@ IMPL_LINK( SvxScriptSelectorDialog, ClickHdl, Button *, pButton ) // If we are displaying Slot API commands then this the dialog is being // run from Tools/Configure and we should not close it - if ( m_bShowSlots == FALSE ) + if ( m_bShowSlots == sal_False ) { EndDialog( RET_OK ); } @@ -1177,12 +1140,6 @@ SvxScriptSelectorDialog::SetDialogDescription( const String& rDescription ) aDialogDescription.SetText( rDescription ); } -USHORT -SvxScriptSelectorDialog::GetSelectedId() -{ - return aCommands.GetId( aCommands.GetLastSelectedEntry() ); -} - String SvxScriptSelectorDialog::GetScriptURL() const { |