summaryrefslogtreecommitdiff
path: root/cui/source/customize/cfg.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'cui/source/customize/cfg.cxx')
-rw-r--r--cui/source/customize/cfg.cxx793
1 files changed, 278 insertions, 515 deletions
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);
}