summaryrefslogtreecommitdiff
path: root/cui/source/dialogs/linkdlg.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'cui/source/dialogs/linkdlg.cxx')
-rw-r--r--cui/source/dialogs/linkdlg.cxx124
1 files changed, 65 insertions, 59 deletions
diff --git a/cui/source/dialogs/linkdlg.cxx b/cui/source/dialogs/linkdlg.cxx
index eb1fe3432895..9d9b2cece04d 100644
--- a/cui/source/dialogs/linkdlg.cxx
+++ b/cui/source/dialogs/linkdlg.cxx
@@ -72,27 +72,28 @@ static long nTabs[] =
};
-SvBaseLinksDlg::SvBaseLinksDlg( Window * pParent, LinkManager* pMgr, BOOL bHtml )
+SvBaseLinksDlg::SvBaseLinksDlg( Window * pParent, LinkManager* pMgr, sal_Bool bHtml )
: ModalDialog( pParent, CUI_RES( MD_UPDATE_BASELINKS ) ),
aFtFiles( this, CUI_RES( FT_FILES ) ),
aFtLinks( this, CUI_RES( FT_LINKS ) ),
aFtType( this, CUI_RES( FT_TYPE ) ),
aFtStatus( this, CUI_RES( FT_STATUS ) ),
- aCancelButton1( this, CUI_RES( 1 ) ),
- aHelpButton1( this, CUI_RES( 1 ) ),
- aPbUpdateNow( this, CUI_RES( PB_UPDATE_NOW ) ),
- aPbOpenSource( this, CUI_RES( PB_OPEN_SOURCE ) ),
- aPbChangeSource( this, CUI_RES( PB_CHANGE_SOURCE ) ),
- aPbBreakLink( this, CUI_RES( PB_BREAK_LINK ) ),
+ aTbLinks( this, CUI_RES(TB_LINKS ) ),
aFtFiles2( this, CUI_RES( FT_FILES2 ) ),
+ aFtFullFileName( this, CUI_RES( FT_FULL_FILE_NAME ) ),
aFtSource2( this, CUI_RES( FT_SOURCE2 ) ),
+ aFtFullSourceName( this, CUI_RES( FT_FULL_SOURCE_NAME ) ),
aFtType2( this, CUI_RES( FT_TYPE2 ) ),
+ aFtFullTypeName( this, CUI_RES( FT_FULL_TYPE_NAME ) ),
aFtUpdate( this, CUI_RES( FT_UPDATE ) ),
aRbAutomatic( this, CUI_RES( RB_AUTOMATIC ) ),
aRbManual( this, CUI_RES( RB_MANUAL ) ),
- aFtFullFileName( this, CUI_RES( FT_FULL_FILE_NAME ) ),
- aFtFullSourceName( this, CUI_RES( FT_FULL_SOURCE_NAME ) ),
- aFtFullTypeName( this, CUI_RES( FT_FULL_TYPE_NAME ) ),
+ aCancelButton1( this, CUI_RES( 1 ) ),
+ aHelpButton1( this, CUI_RES( 1 ) ),
+ aPbUpdateNow( this, CUI_RES( PB_UPDATE_NOW ) ),
+ aPbOpenSource( this, CUI_RES( PB_OPEN_SOURCE ) ),
+ aPbChangeSource( this, CUI_RES( PB_CHANGE_SOURCE ) ),
+ aPbBreakLink( this, CUI_RES( PB_BREAK_LINK ) ),
aStrAutolink( CUI_RES( STR_AUTOLINK ) ),
aStrManuallink( CUI_RES( STR_MANUALLINK ) ),
aStrBrokenlink( CUI_RES( STR_BROKENLINK ) ),
@@ -102,8 +103,7 @@ SvBaseLinksDlg::SvBaseLinksDlg( Window * pParent, LinkManager* pMgr, BOOL bHtml
aStrCloselinkmsgMulti( CUI_RES( STR_CLOSELINKMSG_MULTI ) ),
aStrWaitinglink( CUI_RES( STR_WAITINGLINK ) ),
pLinkMgr( NULL ),
- bHtmlMode(bHtml),
- aTbLinks( this, CUI_RES(TB_LINKS ) )
+ bHtmlMode(bHtml)
{
FreeResource();
@@ -115,6 +115,12 @@ SvBaseLinksDlg::SvBaseLinksDlg( Window * pParent, LinkManager* pMgr, BOOL bHtml
// UpdateTimer fuer DDE-/Grf-Links, auf die gewarted wird
aUpdateTimer.SetTimeoutHdl( LINK( this, SvBaseLinksDlg, UpdateWaitingHdl ) );
aUpdateTimer.SetTimeout( 1000 );
+ //IAccessibility2 Implementation 2009-----
+ // Set the ZOrder, and accessible name to the dialog's title
+ aTbLinks.SetZOrder(0, WINDOW_ZORDER_FIRST);
+ aTbLinks.SetAccessibleName(this->GetText());
+ aTbLinks.SetAccessibleRelationLabeledBy(&aFtFiles);
+ //-----IAccessibility2 Implementation 2009
OpenSource().Hide();
@@ -141,8 +147,8 @@ SvBaseLinksDlg::~SvBaseLinksDlg()
*************************************************************************/
IMPL_LINK( SvBaseLinksDlg, LinksSelectHdl, SvTabListBox *, pSvTabListBox )
{
- USHORT nSelectionCount = pSvTabListBox ?
- (USHORT)pSvTabListBox->GetSelectionCount() : 0;
+ sal_uInt16 nSelectionCount = pSvTabListBox ?
+ (sal_uInt16)pSvTabListBox->GetSelectionCount() : 0;
if(nSelectionCount > 1)
{
//bei Mehrfachselektion ggf. alte Eintraege deselektieren
@@ -150,16 +156,16 @@ IMPL_LINK( SvBaseLinksDlg, LinksSelectHdl, SvTabListBox *, pSvTabListBox )
SvBaseLink* pLink = 0;
pEntry = pSvTabListBox->GetHdlEntry();
pLink = (SvBaseLink*)pEntry->GetUserData();
- USHORT nObjectType = pLink->GetObjType();
+ sal_uInt16 nObjectType = pLink->GetObjType();
if((OBJECT_CLIENT_FILE & nObjectType) != OBJECT_CLIENT_FILE)
{
- pSvTabListBox->SelectAll(FALSE);
+ pSvTabListBox->SelectAll(sal_False);
pSvTabListBox->Select(pEntry);
nSelectionCount = 1;
}
else
{
- for( USHORT i = 0; i < nSelectionCount; i++)
+ for( sal_uInt16 i = 0; i < nSelectionCount; i++)
{
pEntry = i == 0 ? pSvTabListBox->FirstSelected() :
pSvTabListBox->NextSelected(pEntry);
@@ -167,7 +173,7 @@ IMPL_LINK( SvBaseLinksDlg, LinksSelectHdl, SvTabListBox *, pSvTabListBox )
pLink = (SvBaseLink*)pEntry->GetUserData();
DBG_ASSERT(pLink, "Wo ist der Link?");
if( (OBJECT_CLIENT_FILE & pLink->GetObjType()) != OBJECT_CLIENT_FILE )
- pSvTabListBox->Select( pEntry, FALSE );
+ pSvTabListBox->Select( pEntry, sal_False );
}
}
@@ -180,7 +186,7 @@ IMPL_LINK( SvBaseLinksDlg, LinksSelectHdl, SvTabListBox *, pSvTabListBox )
}
else
{
- USHORT nPos;
+ sal_uInt16 nPos;
SvBaseLink* pLink = GetSelEntry( &nPos );
if( !pLink )
return 0;
@@ -232,7 +238,7 @@ IMPL_LINK_INLINE_START( SvBaseLinksDlg, AutomaticClickHdl, RadioButton *, pRadio
{
(void)pRadioButton;
- USHORT nPos;
+ sal_uInt16 nPos;
SvBaseLink* pLink = GetSelEntry( &nPos );
if( pLink && !( FILEOBJECT & pLink->GetObjType() ) &&
LINKUPDATE_ALWAYS != pLink->GetUpdateMode() )
@@ -245,7 +251,7 @@ IMPL_LINK_INLINE_START( SvBaseLinksDlg, ManualClickHdl, RadioButton *, pRadioBut
{
(void)pRadioButton;
- USHORT nPos;
+ sal_uInt16 nPos;
SvBaseLink* pLink = GetSelEntry( &nPos );
if( pLink && !( FILEOBJECT & pLink->GetObjType() ) &&
LINKUPDATE_ONCALL != pLink->GetUpdateMode())
@@ -257,17 +263,17 @@ IMPL_LINK_INLINE_END( SvBaseLinksDlg, ManualClickHdl, RadioButton *, pRadioButto
IMPL_LINK( SvBaseLinksDlg, UpdateNowClickHdl, PushButton *, EMPTYARG )
{
SvTabListBox& rListBox = Links();
- USHORT nSelCnt = (USHORT)rListBox.GetSelectionCount();
+ sal_uInt16 nSelCnt = (sal_uInt16)rListBox.GetSelectionCount();
if( 255 < nSelCnt )
nSelCnt = 255;
std::vector< SvBaseLink* > aLnkArr;
- std::vector< USHORT > aPosArr;
+ std::vector< sal_uInt16 > aPosArr;
SvLBoxEntry* pE = rListBox.FirstSelected();
while( pE )
{
- USHORT nFndPos = (USHORT)rListBox.GetModel()->GetAbsPos( pE );
+ sal_uInt16 nFndPos = (sal_uInt16)rListBox.GetModel()->GetAbsPos( pE );
if( LISTBOX_ENTRY_NOTFOUND != nFndPos )
{
aLnkArr.push_back( static_cast< SvBaseLink* >( pE->GetUserData() ) );
@@ -278,17 +284,17 @@ IMPL_LINK( SvBaseLinksDlg, UpdateNowClickHdl, PushButton *, EMPTYARG )
if( !aLnkArr.empty() )
{
- for( USHORT n = 0; n < aLnkArr.size(); ++n )
+ for( sal_uInt16 n = 0; n < aLnkArr.size(); ++n )
{
SvBaseLinkRef xLink = aLnkArr[ n ];
// suche erstmal im Array nach dem Eintrag
- for( USHORT i = 0; i < pLinkMgr->GetLinks().Count(); ++i )
+ for( sal_uInt16 i = 0; i < pLinkMgr->GetLinks().Count(); ++i )
if( &xLink == *pLinkMgr->GetLinks()[ i ] )
{
- xLink->SetUseCache( FALSE );
+ xLink->SetUseCache( sal_False );
SetType( *xLink, aPosArr[ n ], xLink->GetUpdateMode() );
- xLink->SetUseCache( TRUE );
+ xLink->SetUseCache( sal_True );
break;
}
}
@@ -319,7 +325,7 @@ IMPL_LINK( SvBaseLinksDlg, UpdateNowClickHdl, PushButton *, EMPTYARG )
{
SvLBoxEntry* pSelEntry = rListBox.FirstSelected();
if( pE != pSelEntry )
- rListBox.Select( pSelEntry, FALSE );
+ rListBox.Select( pSelEntry, sal_False );
rListBox.Select( pE );
rListBox.MakeVisible( pE );
}
@@ -333,7 +339,7 @@ IMPL_LINK( SvBaseLinksDlg, ChangeSourceClickHdl, PushButton *, pPushButton )
{
(void)pPushButton;
- USHORT nSelectionCount = (USHORT)Links().GetSelectionCount();
+ sal_uInt16 nSelectionCount = (sal_uInt16)Links().GetSelectionCount();
if(nSelectionCount > 1)
{
PathDialog aPathDlg( this );
@@ -354,7 +360,7 @@ IMPL_LINK( SvBaseLinksDlg, ChangeSourceClickHdl, PushButton *, pPushButton )
{
String aPath = aPathDlg.GetPath();
- for( USHORT i = 0; i < nSelectionCount; i++)
+ for( sal_uInt16 i = 0; i < nSelectionCount; i++)
{
pEntry = i==0 ?
Links().FirstSelected() :
@@ -381,7 +387,7 @@ IMPL_LINK( SvBaseLinksDlg, ChangeSourceClickHdl, PushButton *, pPushButton )
}
else
{
- USHORT nPos;
+ sal_uInt16 nPos;
SvBaseLink* pLink = GetSelEntry( &nPos );
if ( pLink && (pLink->GetLinkSourceName().Len() != 0) )
pLink->Edit( this, LINK( this, SvBaseLinksDlg, EndEditHdl ) );
@@ -393,10 +399,10 @@ IMPL_LINK( SvBaseLinksDlg, BreakLinkClickHdl, PushButton *, pPushButton )
{
(void)pPushButton;
- BOOL bModified = FALSE;
+ sal_Bool bModified = sal_False;
if(Links().GetSelectionCount() <= 1)
{
- USHORT nPos;
+ sal_uInt16 nPos;
SvBaseLinkRef xLink = GetSelEntry( &nPos );
if( !xLink.Is() )
return 0;
@@ -408,7 +414,7 @@ IMPL_LINK( SvBaseLinksDlg, BreakLinkClickHdl, PushButton *, pPushButton )
Links().GetModel()->Remove( Links().GetEntry( nPos ) );
// falls Object noch vorhanden, dann das schliessen
- BOOL bNewLnkMgr = OBJECT_CLIENT_FILE == xLink->GetObjType();
+ sal_Bool bNewLnkMgr = OBJECT_CLIENT_FILE == xLink->GetObjType();
// dem Link sagen, das er aufgeloest wird!
xLink->Closed();
@@ -427,7 +433,7 @@ IMPL_LINK( SvBaseLinksDlg, BreakLinkClickHdl, PushButton *, pPushButton )
if( pEntry )
Links().SetCurEntry( pEntry );
}
- bModified = TRUE;
+ bModified = sal_True;
}
}
else
@@ -447,7 +453,7 @@ IMPL_LINK( SvBaseLinksDlg, BreakLinkClickHdl, PushButton *, pPushButton )
pEntry = Links().NextSelected(pEntry);
}
Links().RemoveSelection();
- for( ULONG i = 0; i < aLinkList.Count(); i++ )
+ for( sal_uLong i = 0; i < aLinkList.Count(); i++ )
{
SvBaseLinkRef xLink = aLinkList.GetObject( i );
// dem Link sagen, das er aufgeloest wird!
@@ -455,7 +461,7 @@ IMPL_LINK( SvBaseLinksDlg, BreakLinkClickHdl, PushButton *, pPushButton )
// falls einer vergessen hat sich auszutragen
pLinkMgr->Remove( &xLink );
- bModified = TRUE;
+ bModified = sal_True;
}
//Danach alle selektierten Eintraege entfernen
}
@@ -485,8 +491,8 @@ IMPL_LINK( SvBaseLinksDlg, UpdateWaitingHdl, Timer*, pTimer )
{
(void)pTimer;
- Links().SetUpdateMode(FALSE);
- for( ULONG nPos = Links().GetEntryCount(); nPos; )
+ Links().SetUpdateMode(sal_False);
+ for( sal_uLong nPos = Links().GetEntryCount(); nPos; )
{
SvLBoxEntry* pBox = Links().GetEntry( --nPos );
SvBaseLinkRef xLink( (SvBaseLink*)pBox->GetUserData() );
@@ -498,13 +504,13 @@ IMPL_LINK( SvBaseLinksDlg, UpdateWaitingHdl, Timer*, pTimer )
Links().SetEntryText( sCur, pBox, 3 );
}
}
- Links().SetUpdateMode(TRUE);
+ Links().SetUpdateMode(sal_True);
return 0;
}
IMPL_LINK( SvBaseLinksDlg, EndEditHdl, sfx2::SvBaseLink*, _pLink )
{
- USHORT nPos;
+ sal_uInt16 nPos;
GetSelEntry( &nPos );
if( _pLink && _pLink->WasLastEditOK() )
@@ -513,23 +519,23 @@ IMPL_LINK( SvBaseLinksDlg, EndEditHdl, sfx2::SvBaseLink*, _pLink )
// also suche den Link im Manager, wenn der nicht mehr existiert,
// dann setze fuelle die Liste komplett neu. Ansonsten braucht
// nur der editierte Linkt aktualisiert werden.
- BOOL bLinkFnd = FALSE;
- for( USHORT n = pLinkMgr->GetLinks().Count(); n; )
+ sal_Bool bLinkFnd = sal_False;
+ for( sal_uInt16 n = pLinkMgr->GetLinks().Count(); n; )
if( _pLink == &(*pLinkMgr->GetLinks()[ --n ]) )
{
- bLinkFnd = TRUE;
+ bLinkFnd = sal_True;
break;
}
if( bLinkFnd )
{
- Links().SetUpdateMode(FALSE);
+ Links().SetUpdateMode(sal_False);
Links().GetModel()->Remove( Links().GetEntry( nPos ) );
SvLBoxEntry* pToUnselect = Links().FirstSelected();
InsertEntry( *_pLink, nPos, sal_True );
if(pToUnselect)
- Links().Select(pToUnselect, FALSE);
- Links().SetUpdateMode(TRUE);
+ Links().Select(pToUnselect, sal_False);
+ Links().SetUpdateMode(sal_True);
}
else
{
@@ -568,7 +574,7 @@ void SvBaseLinksDlg::SetManager( LinkManager* pNewMgr )
if( pNewMgr )
// Update muss vor Clear gestoppt werden
- Links().SetUpdateMode( FALSE );
+ Links().SetUpdateMode( sal_False );
Links().Clear();
pLinkMgr = pNewMgr;
@@ -576,7 +582,7 @@ void SvBaseLinksDlg::SetManager( LinkManager* pNewMgr )
if( pLinkMgr )
{
SvBaseLinks& rLnks = (SvBaseLinks&)pLinkMgr->GetLinks();
- for( USHORT n = 0; n < rLnks.Count(); ++n )
+ for( sal_uInt16 n = 0; n < rLnks.Count(); ++n )
{
SvBaseLinkRef* pLinkRef = rLnks[ n ];
if( !pLinkRef->Is() )
@@ -596,13 +602,13 @@ void SvBaseLinksDlg::SetManager( LinkManager* pNewMgr )
Links().Select( pEntry );
LinksSelectHdl( 0 );
}
- Links().SetUpdateMode( TRUE );
+ Links().SetUpdateMode( sal_True );
Links().Invalidate();
}
}
-void SvBaseLinksDlg::InsertEntry( const SvBaseLink& rLink, USHORT nPos, sal_Bool bSelect )
+void SvBaseLinksDlg::InsertEntry( const SvBaseLink& rLink, sal_uInt16 nPos, sal_Bool bSelect )
{
String aEntry, sFileNm, sLinkNm, sTypeNm, sFilter;
@@ -640,12 +646,12 @@ void SvBaseLinksDlg::InsertEntry( const SvBaseLink& rLink, USHORT nPos, sal_Bool
Links().Select(pE);
}
-SvBaseLink* SvBaseLinksDlg::GetSelEntry( USHORT* pPos )
+SvBaseLink* SvBaseLinksDlg::GetSelEntry( sal_uInt16* pPos )
{
SvLBoxEntry* pE = Links().FirstSelected();
- USHORT nPos;
+ sal_uInt16 nPos;
if( pE && LISTBOX_ENTRY_NOTFOUND !=
- ( nPos = (USHORT)Links().GetModel()->GetAbsPos( pE ) ) )
+ ( nPos = (sal_uInt16)Links().GetModel()->GetAbsPos( pE ) ) )
{
DBG_ASSERT( pE, "wo kommt der leere Eintrag her?" );
@@ -657,8 +663,8 @@ SvBaseLink* SvBaseLinksDlg::GetSelEntry( USHORT* pPos )
}
void SvBaseLinksDlg::SetType( SvBaseLink& rLink,
- USHORT nSelPos,
- USHORT nType )
+ sal_uInt16 nSelPos,
+ sal_uInt16 nType )
{
rLink.SetUpdateMode( nType );
rLink.Update();
@@ -673,8 +679,8 @@ void SvBaseLinksDlg::SetActLink( SvBaseLink * pLink )
if( pLinkMgr )
{
const SvBaseLinks& rLnks = pLinkMgr->GetLinks();
- USHORT nSelect = 0;
- for( USHORT n = 0; n < rLnks.Count(); ++n )
+ sal_uInt16 nSelect = 0;
+ for( sal_uInt16 n = 0; n < rLnks.Count(); ++n )
{
SvBaseLinkRef* pLinkRef = rLnks[ n ];
// #109573# only visible links have been inserted into the TreeListBox,