Kaydet (Commit) 4a2a2831 authored tarafından Noel Grandin's avatar Noel Grandin

convert vcl/sttus.hxx from XubString to OUString

Change-Id: I173179068d59e0fbdae66186df1e2e010ecb6112
üst 55528ca8
...@@ -75,7 +75,7 @@ class VCL_DLLPUBLIC StatusBar : public Window ...@@ -75,7 +75,7 @@ class VCL_DLLPUBLIC StatusBar : public Window
private: private:
ImplStatusItemList* mpItemList; ImplStatusItemList* mpItemList;
ImplData* mpImplData; ImplData* mpImplData;
XubString maPrgsTxt; OUString maPrgsTxt;
Point maPrgsTxtPos; Point maPrgsTxtPos;
Rectangle maPrgsFrameRect; Rectangle maPrgsFrameRect;
long mnPrgsSize; long mnPrgsSize;
...@@ -158,8 +158,8 @@ public: ...@@ -158,8 +158,8 @@ public:
long GetItemOffset( sal_uInt16 nItemId ) const; long GetItemOffset( sal_uInt16 nItemId ) const;
void SetItemText( sal_uInt16 nItemId, const XubString& rText ); void SetItemText( sal_uInt16 nItemId, const OUString& rText );
const XubString& GetItemText( sal_uInt16 nItemId ) const; const OUString& GetItemText( sal_uInt16 nItemId ) const;
void SetItemData( sal_uInt16 nItemId, void* pNewData ); void SetItemData( sal_uInt16 nItemId, void* pNewData );
void* GetItemData( sal_uInt16 nItemId ) const; void* GetItemData( sal_uInt16 nItemId ) const;
...@@ -167,18 +167,18 @@ public: ...@@ -167,18 +167,18 @@ public:
void SetItemCommand( sal_uInt16 nItemId, const OUString& rCommand ); void SetItemCommand( sal_uInt16 nItemId, const OUString& rCommand );
const OUString GetItemCommand( sal_uInt16 nItemId ); const OUString GetItemCommand( sal_uInt16 nItemId );
void SetHelpText( sal_uInt16 nItemId, const XubString& rText ); void SetHelpText( sal_uInt16 nItemId, const OUString& rText );
const XubString& GetHelpText( sal_uInt16 nItemId ) const; const OUString& GetHelpText( sal_uInt16 nItemId ) const;
using Window::SetQuickHelpText; using Window::SetQuickHelpText;
void SetQuickHelpText( sal_uInt16 nItemId, const XubString& rText ); void SetQuickHelpText( sal_uInt16 nItemId, const OUString& rText );
using Window::GetQuickHelpText; using Window::GetQuickHelpText;
const XubString& GetQuickHelpText( sal_uInt16 nItemId ) const; const OUString& GetQuickHelpText( sal_uInt16 nItemId ) const;
void SetHelpId( sal_uInt16 nItemId, const OString& rHelpId ); void SetHelpId( sal_uInt16 nItemId, const OString& rHelpId );
OString GetHelpId( sal_uInt16 nItemId ) const; OString GetHelpId( sal_uInt16 nItemId ) const;
void StartProgressMode( const XubString& rText ); void StartProgressMode( const OUString& rText );
void SetProgressValue( sal_uInt16 nPercent ); void SetProgressValue( sal_uInt16 nPercent );
void EndProgressMode(); void EndProgressMode();
sal_Bool IsProgressMode() const { return mbProgressMode; } sal_Bool IsProgressMode() const { return mbProgressMode; }
...@@ -203,9 +203,9 @@ public: ...@@ -203,9 +203,9 @@ public:
const Link& GetDoubleClickHdl() const { return maDoubleClickHdl; } const Link& GetDoubleClickHdl() const { return maDoubleClickHdl; }
using Window::SetAccessibleName; using Window::SetAccessibleName;
void SetAccessibleName( sal_uInt16 nItemId, const XubString& rName ); void SetAccessibleName( sal_uInt16 nItemId, const OUString& rName );
using Window::GetAccessibleName; using Window::GetAccessibleName;
const XubString& GetAccessibleName( sal_uInt16 nItemId ) const; const OUString& GetAccessibleName( sal_uInt16 nItemId ) const;
}; };
#endif // _SV_STATUS_HXX #endif // _SV_STATUS_HXX
......
...@@ -101,7 +101,7 @@ void SdTemplateControl::Paint( const UserDrawEvent& ) ...@@ -101,7 +101,7 @@ void SdTemplateControl::Paint( const UserDrawEvent& )
void SdTemplateControl::Command( const CommandEvent& rCEvt ) void SdTemplateControl::Command( const CommandEvent& rCEvt )
{ {
if ( rCEvt.GetCommand() == COMMAND_CONTEXTMENU && GetStatusBar().GetItemText( GetId() ).Len() ) if ( rCEvt.GetCommand() == COMMAND_CONTEXTMENU && !GetStatusBar().GetItemText( GetId() ).isEmpty() )
{ {
SfxViewFrame* pViewFrame = SfxViewFrame::Current(); SfxViewFrame* pViewFrame = SfxViewFrame::Current();
......
...@@ -73,7 +73,7 @@ void SvxInsertStatusBarControl::StateChanged( sal_uInt16 , SfxItemState eState, ...@@ -73,7 +73,7 @@ void SvxInsertStatusBarControl::StateChanged( sal_uInt16 , SfxItemState eState,
void SvxInsertStatusBarControl::Click() void SvxInsertStatusBarControl::Click()
{ {
if ( !GetStatusBar().GetItemText( GetId() ).Len() ) if ( GetStatusBar().GetItemText( GetId() ).isEmpty() )
return; return;
bInsert = !bInsert; bInsert = !bInsert;
SfxBoolItem aIns( GetSlotId(), bInsert ); SfxBoolItem aIns( GetSlotId(), bInsert );
......
...@@ -89,7 +89,7 @@ void SwBookmarkControl::Paint( const UserDrawEvent& ) ...@@ -89,7 +89,7 @@ void SwBookmarkControl::Paint( const UserDrawEvent& )
void SwBookmarkControl::Command( const CommandEvent& rCEvt ) void SwBookmarkControl::Command( const CommandEvent& rCEvt )
{ {
if ( rCEvt.GetCommand() == COMMAND_CONTEXTMENU && if ( rCEvt.GetCommand() == COMMAND_CONTEXTMENU &&
GetStatusBar().GetItemText( GetId() ).Len() ) !GetStatusBar().GetItemText( GetId() ).isEmpty() )
{ {
CaptureMouse(); CaptureMouse();
BookmarkPopup_Impl aPop; BookmarkPopup_Impl aPop;
......
...@@ -90,7 +90,7 @@ void SwTemplateControl::Paint( const UserDrawEvent& ) ...@@ -90,7 +90,7 @@ void SwTemplateControl::Paint( const UserDrawEvent& )
void SwTemplateControl::Command( const CommandEvent& rCEvt ) void SwTemplateControl::Command( const CommandEvent& rCEvt )
{ {
if ( rCEvt.GetCommand() == COMMAND_CONTEXTMENU && if ( rCEvt.GetCommand() == COMMAND_CONTEXTMENU &&
GetStatusBar().GetItemText( GetId() ).Len() ) !GetStatusBar().GetItemText( GetId() ).isEmpty() )
{ {
CaptureMouse(); CaptureMouse();
SwTemplatePopup_Impl aPop; SwTemplatePopup_Impl aPop;
......
...@@ -73,14 +73,14 @@ struct ImplStatusItem ...@@ -73,14 +73,14 @@ struct ImplStatusItem
long mnOffset; long mnOffset;
long mnExtraWidth; long mnExtraWidth;
long mnX; long mnX;
XubString maText; OUString maText;
XubString maHelpText; OUString maHelpText;
XubString maQuickHelpText; OUString maQuickHelpText;
OString maHelpId; OString maHelpId;
void* mpUserData; void* mpUserData;
sal_Bool mbVisible; sal_Bool mbVisible;
XubString maAccessibleName; OUString maAccessibleName;
XubString maCommand; OUString maCommand;
}; };
// ======================================================================= // =======================================================================
...@@ -1259,7 +1259,7 @@ long StatusBar::GetItemOffset( sal_uInt16 nItemId ) const ...@@ -1259,7 +1259,7 @@ long StatusBar::GetItemOffset( sal_uInt16 nItemId ) const
// ----------------------------------------------------------------------- // -----------------------------------------------------------------------
void StatusBar::SetItemText( sal_uInt16 nItemId, const XubString& rText ) void StatusBar::SetItemText( sal_uInt16 nItemId, const OUString& rText )
{ {
sal_uInt16 nPos = GetItemPos( nItemId ); sal_uInt16 nPos = GetItemPos( nItemId );
...@@ -1296,14 +1296,13 @@ void StatusBar::SetItemText( sal_uInt16 nItemId, const XubString& rText ) ...@@ -1296,14 +1296,13 @@ void StatusBar::SetItemText( sal_uInt16 nItemId, const XubString& rText )
// ----------------------------------------------------------------------- // -----------------------------------------------------------------------
const XubString& StatusBar::GetItemText( sal_uInt16 nItemId ) const const OUString& StatusBar::GetItemText( sal_uInt16 nItemId ) const
{ {
sal_uInt16 nPos = GetItemPos( nItemId ); sal_uInt16 nPos = GetItemPos( nItemId );
if ( nPos != STATUSBAR_ITEM_NOTFOUND ) assert( nPos != STATUSBAR_ITEM_NOTFOUND );
return (*mpItemList)[ nPos ]->maText;
return ImplGetSVEmptyStr(); return (*mpItemList)[ nPos ]->maText;
} }
// ----------------------------------------------------------------------- // -----------------------------------------------------------------------
...@@ -1386,7 +1385,7 @@ void StatusBar::RedrawItem( sal_uInt16 nItemId ) ...@@ -1386,7 +1385,7 @@ void StatusBar::RedrawItem( sal_uInt16 nItemId )
// ----------------------------------------------------------------------- // -----------------------------------------------------------------------
void StatusBar::SetHelpText( sal_uInt16 nItemId, const XubString& rText ) void StatusBar::SetHelpText( sal_uInt16 nItemId, const OUString& rText )
{ {
sal_uInt16 nPos = GetItemPos( nItemId ); sal_uInt16 nPos = GetItemPos( nItemId );
...@@ -1396,34 +1395,31 @@ void StatusBar::SetHelpText( sal_uInt16 nItemId, const XubString& rText ) ...@@ -1396,34 +1395,31 @@ void StatusBar::SetHelpText( sal_uInt16 nItemId, const XubString& rText )
// ----------------------------------------------------------------------- // -----------------------------------------------------------------------
const XubString& StatusBar::GetHelpText( sal_uInt16 nItemId ) const const OUString& StatusBar::GetHelpText( sal_uInt16 nItemId ) const
{ {
sal_uInt16 nPos = GetItemPos( nItemId ); sal_uInt16 nPos = GetItemPos( nItemId );
if ( nPos != STATUSBAR_ITEM_NOTFOUND ) assert ( nPos != STATUSBAR_ITEM_NOTFOUND );
ImplStatusItem* pItem = (*mpItemList)[ nPos ];
if ( pItem->maHelpText.isEmpty() && ( !pItem->maHelpId.isEmpty() || !pItem->maCommand.isEmpty() ))
{ {
ImplStatusItem* pItem = (*mpItemList)[ nPos ]; Help* pHelp = Application::GetHelp();
if ( !pItem->maHelpText.Len() && ( !pItem->maHelpId.isEmpty() || pItem->maCommand.Len() )) if ( pHelp )
{ {
Help* pHelp = Application::GetHelp(); if ( !pItem->maCommand.isEmpty() )
if ( pHelp ) pItem->maHelpText = pHelp->GetHelpText( pItem->maCommand, this );
{ if ( pItem->maHelpText.isEmpty() && !pItem->maHelpId.isEmpty() )
if ( pItem->maCommand.Len() ) pItem->maHelpText = pHelp->GetHelpText( OStringToOUString( pItem->maHelpId, RTL_TEXTENCODING_UTF8 ), this );
pItem->maHelpText = pHelp->GetHelpText( pItem->maCommand, this );
if ( !pItem->maHelpText.Len() && !pItem->maHelpId.isEmpty() )
pItem->maHelpText = pHelp->GetHelpText( OStringToOUString( pItem->maHelpId, RTL_TEXTENCODING_UTF8 ), this );
}
} }
return pItem->maHelpText;
} }
else
return ImplGetSVEmptyStr(); return pItem->maHelpText;
} }
// ----------------------------------------------------------------------- // -----------------------------------------------------------------------
void StatusBar::SetQuickHelpText( sal_uInt16 nItemId, const XubString& rText ) void StatusBar::SetQuickHelpText( sal_uInt16 nItemId, const OUString& rText )
{ {
sal_uInt16 nPos = GetItemPos( nItemId ); sal_uInt16 nPos = GetItemPos( nItemId );
...@@ -1433,17 +1429,14 @@ void StatusBar::SetQuickHelpText( sal_uInt16 nItemId, const XubString& rText ) ...@@ -1433,17 +1429,14 @@ void StatusBar::SetQuickHelpText( sal_uInt16 nItemId, const XubString& rText )
// ----------------------------------------------------------------------- // -----------------------------------------------------------------------
const XubString& StatusBar::GetQuickHelpText( sal_uInt16 nItemId ) const const OUString& StatusBar::GetQuickHelpText( sal_uInt16 nItemId ) const
{ {
sal_uInt16 nPos = GetItemPos( nItemId ); sal_uInt16 nPos = GetItemPos( nItemId );
if ( nPos != STATUSBAR_ITEM_NOTFOUND ) assert ( nPos != STATUSBAR_ITEM_NOTFOUND );
{
ImplStatusItem* pItem = (*mpItemList)[ nPos ];
return pItem->maQuickHelpText;
}
return ImplGetSVEmptyStr(); ImplStatusItem* pItem = (*mpItemList)[ nPos ];
return pItem->maQuickHelpText;
} }
// ----------------------------------------------------------------------- // -----------------------------------------------------------------------
...@@ -1475,7 +1468,7 @@ OString StatusBar::GetHelpId( sal_uInt16 nItemId ) const ...@@ -1475,7 +1468,7 @@ OString StatusBar::GetHelpId( sal_uInt16 nItemId ) const
return aRet; return aRet;
} }
void StatusBar::StartProgressMode( const XubString& rText ) void StatusBar::StartProgressMode( const OUString& rText )
{ {
DBG_ASSERT( !mbProgressMode, "StatusBar::StartProgressMode(): progress mode is active" ); DBG_ASSERT( !mbProgressMode, "StatusBar::StartProgressMode(): progress mode is active" );
...@@ -1527,7 +1520,7 @@ void StatusBar::EndProgressMode() ...@@ -1527,7 +1520,7 @@ void StatusBar::EndProgressMode()
DBG_ASSERT( mbProgressMode, "StatusBar::EndProgressMode(): no progress mode" ); DBG_ASSERT( mbProgressMode, "StatusBar::EndProgressMode(): no progress mode" );
mbProgressMode = sal_False; mbProgressMode = sal_False;
maPrgsTxt.Erase(); maPrgsTxt = "";
// Paint neu ausloesen um StatusBar wieder herzustellen // Paint neu ausloesen um StatusBar wieder herzustellen
SetFillColor( GetSettings().GetStyleSettings().GetFaceColor() ); SetFillColor( GetSettings().GetStyleSettings().GetFaceColor() );
...@@ -1633,7 +1626,7 @@ Size StatusBar::CalcWindowSizePixel() const ...@@ -1633,7 +1626,7 @@ Size StatusBar::CalcWindowSizePixel() const
// ----------------------------------------------------------------------- // -----------------------------------------------------------------------
void StatusBar::SetAccessibleName( sal_uInt16 nItemId, const XubString& rName ) void StatusBar::SetAccessibleName( sal_uInt16 nItemId, const OUString& rName )
{ {
sal_uInt16 nPos = GetItemPos( nItemId ); sal_uInt16 nPos = GetItemPos( nItemId );
...@@ -1651,14 +1644,13 @@ void StatusBar::SetAccessibleName( sal_uInt16 nItemId, const XubString& rName ) ...@@ -1651,14 +1644,13 @@ void StatusBar::SetAccessibleName( sal_uInt16 nItemId, const XubString& rName )
// ----------------------------------------------------------------------- // -----------------------------------------------------------------------
const XubString& StatusBar::GetAccessibleName( sal_uInt16 nItemId ) const const OUString& StatusBar::GetAccessibleName( sal_uInt16 nItemId ) const
{ {
sal_uInt16 nPos = GetItemPos( nItemId ); sal_uInt16 nPos = GetItemPos( nItemId );
if ( nPos != STATUSBAR_ITEM_NOTFOUND ) assert ( nPos != STATUSBAR_ITEM_NOTFOUND );
return (*mpItemList)[ nPos ]->maAccessibleName;
return ImplGetSVEmptyStr(); return (*mpItemList)[ nPos ]->maAccessibleName;
} }
// ----------------------------------------------------------------------- // -----------------------------------------------------------------------
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment