Kaydet (Commit) 066f5649 authored tarafından Noel Grandin's avatar Noel Grandin

convert sw/source/ui/inc/view.hxx from String to OUString

Change-Id: Id0f752b5c652e24b0a011c6fe69cba81c1e64b47
üst 6ada8423
...@@ -176,8 +176,8 @@ class SW_DLLPUBLIC SwView: public SfxViewShell ...@@ -176,8 +176,8 @@ class SW_DLLPUBLIC SwView: public SfxViewShell
SvxHtmlOptions m_aHTMLOpt; SvxHtmlOptions m_aHTMLOpt;
Timer m_aTimer; // for delayed ChgLnks during an action Timer m_aTimer; // for delayed ChgLnks during an action
String m_aPageStr; // status view, current page OUString m_aPageStr; // status view, current page
String m_sSwViewData, OUString m_sSwViewData,
//and the new cursor position if the user double click in the PagePreView //and the new cursor position if the user double click in the PagePreView
m_sNewCrsrPos; m_sNewCrsrPos;
// to support keyboard the number of the page to go to can be set too // to support keyboard the number of the page to go to can be set too
...@@ -229,13 +229,13 @@ class SW_DLLPUBLIC SwView: public SfxViewShell ...@@ -229,13 +229,13 @@ class SW_DLLPUBLIC SwView: public SfxViewShell
static const int m_nMASTERENUMCOMMANDS = 6; static const int m_nMASTERENUMCOMMANDS = 6;
String m_aCurrShapeEnumCommand[ m_nMASTERENUMCOMMANDS ]; OUString m_aCurrShapeEnumCommand[ m_nMASTERENUMCOMMANDS ];
sal_uInt16 m_nPageCnt; sal_uInt16 m_nPageCnt;
// current draw mode // current draw mode
sal_uInt16 m_nDrawSfxId; sal_uInt16 m_nDrawSfxId;
String m_sDrawCustom; //some drawing types are marked with strings! OUString m_sDrawCustom; //some drawing types are marked with strings!
sal_uInt16 m_nFormSfxId; sal_uInt16 m_nFormSfxId;
sal_uInt16 m_nLastPasteDestination; sal_uInt16 m_nLastPasteDestination;
...@@ -424,7 +424,7 @@ public: ...@@ -424,7 +424,7 @@ public:
// (this code has special handling for "in word" character) // (this code has special handling for "in word" character)
void InsertThesaurusSynonym( const OUString &rSynonmText, const OUString &rLookUpText, bool bValidSelection ); void InsertThesaurusSynonym( const OUString &rSynonmText, const OUString &rLookUpText, bool bValidSelection );
bool IsValidSelectionForThesaurus() const; bool IsValidSelectionForThesaurus() const;
String GetThesaurusLookUpText( bool bSelection ) const; OUString GetThesaurusLookUpText( bool bSelection ) const;
// immediately switch shell -> for GetSelectionObject // immediately switch shell -> for GetSelectionObject
void StopShellTimer(); void StopShellTimer();
...@@ -560,7 +560,7 @@ public: ...@@ -560,7 +560,7 @@ public:
inline void FlipDrawSelMode() { m_bDrawSelMode = !m_bDrawSelMode; } inline void FlipDrawSelMode() { m_bDrawSelMode = !m_bDrawSelMode; }
void NoRotate(); // turn off rotate mode void NoRotate(); // turn off rotate mode
sal_Bool EnterDrawTextMode(const Point& aDocPos); sal_Bool EnterDrawTextMode(const Point& aDocPos);
void LeaveDrawCreate() { m_nDrawSfxId = m_nFormSfxId = USHRT_MAX; m_sDrawCustom.Erase();} void LeaveDrawCreate() { m_nDrawSfxId = m_nFormSfxId = USHRT_MAX; m_sDrawCustom = "";}
sal_Bool IsDrawMode() { return (m_nDrawSfxId != USHRT_MAX || m_nFormSfxId != USHRT_MAX); } sal_Bool IsDrawMode() { return (m_nDrawSfxId != USHRT_MAX || m_nFormSfxId != USHRT_MAX); }
bool IsFormMode() const; bool IsFormMode() const;
bool IsBezierEditMode(); bool IsBezierEditMode();
...@@ -584,9 +584,9 @@ public: ...@@ -584,9 +584,9 @@ public:
void InsertCaption(const InsCaptionOpt *pOpt); void InsertCaption(const InsCaptionOpt *pOpt);
// Async call by Core // Async call by Core
void UpdatePageNums(sal_uInt16 nPhyNum, sal_uInt16 nVirtNum, const String& rPgStr); void UpdatePageNums(sal_uInt16 nPhyNum, sal_uInt16 nVirtNum, const OUString& rPgStr);
String GetPageStr(sal_uInt16 nPhyNum, sal_uInt16 nVirtNum, const String& rPgStr); OUString GetPageStr(sal_uInt16 nPhyNum, sal_uInt16 nVirtNum, const OUString& rPgStr);
// hand over Shell // hand over Shell
SfxShell *GetCurShell() { return m_pShell; } SfxShell *GetCurShell() { return m_pShell; }
...@@ -608,10 +608,10 @@ public: ...@@ -608,10 +608,10 @@ public:
sal_Bool IsCrsrAtTop() const { return m_bTopCrsr; } sal_Bool IsCrsrAtTop() const { return m_bTopCrsr; }
sal_Bool IsCrsrAtCenter() const { return m_bCenterCrsr; } sal_Bool IsCrsrAtCenter() const { return m_bCenterCrsr; }
bool JumpToSwMark( const String& rMark ); bool JumpToSwMark( const OUString& rMark );
long InsertDoc( sal_uInt16 nSlotId, const String& rFileName, long InsertDoc( sal_uInt16 nSlotId, const OUString& rFileName,
const String& rFilterName, sal_Int16 nVersion = 0 ); const OUString& rFilterName, sal_Int16 nVersion = 0 );
void ExecuteInsertDoc( SfxRequest& rRequest, const SfxPoolItem* pItem ); void ExecuteInsertDoc( SfxRequest& rRequest, const SfxPoolItem* pItem );
long InsertMedium( sal_uInt16 nSlotId, SfxMedium* pMedium, sal_Int16 nVersion ); long InsertMedium( sal_uInt16 nSlotId, SfxMedium* pMedium, sal_Int16 nVersion );
...@@ -647,7 +647,7 @@ public: ...@@ -647,7 +647,7 @@ public:
void StateFormatPaintbrush(SfxItemSet &); void StateFormatPaintbrush(SfxItemSet &);
//public fuer D&D //public fuer D&D
int InsertGraphic( const String &rPath, const String &rFilter, int InsertGraphic( const OUString &rPath, const OUString &rFilter,
sal_Bool bLink = sal_True, GraphicFilter *pFlt = 0, sal_Bool bLink = sal_True, GraphicFilter *pFlt = 0,
Graphic* pPreviewGrf = 0, Graphic* pPreviewGrf = 0,
sal_Bool bRule = sal_False ); sal_Bool bRule = sal_False );
......
...@@ -790,7 +790,7 @@ SwView::SwView( SfxViewFrame *_pFrame, SfxViewShell* pOldSh ) ...@@ -790,7 +790,7 @@ SwView::SwView( SfxViewFrame *_pFrame, SfxViewShell* pOldSh )
m_sNewCrsrPos = ((SwPagePreView*)pExistingSh)->GetNewCrsrPos(); m_sNewCrsrPos = ((SwPagePreView*)pExistingSh)->GetNewCrsrPos();
m_nNewPage = ((SwPagePreView*)pExistingSh)->GetNewPage(); m_nNewPage = ((SwPagePreView*)pExistingSh)->GetNewPage();
m_bOldShellWasPagePreView = sal_True; m_bOldShellWasPagePreView = sal_True;
m_bIsPreviewDoubleClick = m_sNewCrsrPos.Len() > 0 || m_nNewPage != USHRT_MAX; m_bIsPreviewDoubleClick = !m_sNewCrsrPos.isEmpty() || m_nNewPage != USHRT_MAX;
} }
else if( pExistingSh->IsA( TYPE( SwSrcView ) ) ) else if( pExistingSh->IsA( TYPE( SwSrcView ) ) )
bOldShellWasSrcView = sal_True; bOldShellWasSrcView = sal_True;
...@@ -1212,10 +1212,10 @@ void SwView::ReadUserData( const OUString &rUserData, bool bBrowse ) ...@@ -1212,10 +1212,10 @@ void SwView::ReadUserData( const OUString &rUserData, bool bBrowse )
} }
//apply information from print preview - if available //apply information from print preview - if available
if( m_sNewCrsrPos.Len() ) if( !m_sNewCrsrPos.isEmpty() )
{ {
long nXTmp = m_sNewCrsrPos.GetToken( 0, ';' ).ToInt32(), long nXTmp = m_sNewCrsrPos.getToken( 0, ';' ).toInt32(),
nYTmp = m_sNewCrsrPos.GetToken( 1, ';' ).ToInt32(); nYTmp = m_sNewCrsrPos.getToken( 1, ';' ).toInt32();
Point aCrsrPos2( nXTmp, nYTmp ); Point aCrsrPos2( nXTmp, nYTmp );
bSelectObj = m_pWrtShell->IsObjSelectable( aCrsrPos2 ); bSelectObj = m_pWrtShell->IsObjSelectable( aCrsrPos2 );
...@@ -1226,7 +1226,7 @@ void SwView::ReadUserData( const OUString &rUserData, bool bBrowse ) ...@@ -1226,7 +1226,7 @@ void SwView::ReadUserData( const OUString &rUserData, bool bBrowse )
m_pWrtShell->EnterSelFrmMode( &aCrsrPos2 ); m_pWrtShell->EnterSelFrmMode( &aCrsrPos2 );
} }
m_pWrtShell->MakeSelVisible(); m_pWrtShell->MakeSelVisible();
m_sNewCrsrPos.Erase(); m_sNewCrsrPos = "";
} }
else if(USHRT_MAX != m_nNewPage) else if(USHRT_MAX != m_nNewPage)
{ {
......
...@@ -75,10 +75,10 @@ void SwView::Activate(sal_Bool bMDIActivate) ...@@ -75,10 +75,10 @@ void SwView::Activate(sal_Bool bMDIActivate)
{ {
m_pWrtShell->ShGetFcs(sal_False); // Selections visible m_pWrtShell->ShGetFcs(sal_False); // Selections visible
if( m_sSwViewData.Len() ) if( !m_sSwViewData.isEmpty() )
{ {
ReadUserData(m_sSwViewData, false); ReadUserData(m_sSwViewData, false);
m_sSwViewData.Erase(); m_sSwViewData = "";
} }
AttrChangedNotify(m_pWrtShell); AttrChangedNotify(m_pWrtShell);
......
...@@ -179,27 +179,27 @@ static void lcl_SetAllTextToDefaultLanguage( SwWrtShell &rWrtSh, sal_uInt16 nWhi ...@@ -179,27 +179,27 @@ static void lcl_SetAllTextToDefaultLanguage( SwWrtShell &rWrtSh, sal_uInt16 nWhi
} }
/* Create string for showing of page in statusbar */ /* Create string for showing of page in statusbar */
String SwView::GetPageStr( sal_uInt16 nPg, sal_uInt16 nLogPg, OUString SwView::GetPageStr( sal_uInt16 nPg, sal_uInt16 nLogPg,
const String& rDisplay ) const OUString& rDisplay )
{ {
String aStr( m_aPageStr ); OUString aStr( m_aPageStr );
if( rDisplay.Len() ) if( !rDisplay.isEmpty() )
aStr += rDisplay; aStr += rDisplay;
else else
aStr += OUString::number(nLogPg); aStr += OUString::number(nLogPg);
if( nLogPg && nLogPg != nPg ) if( nLogPg && nLogPg != nPg )
{ {
aStr.AppendAscii( RTL_CONSTASCII_STRINGPARAM(" ")); aStr += " ";
aStr += OUString::number(nPg); aStr += OUString::number(nPg);
} }
aStr.AppendAscii( RTL_CONSTASCII_STRINGPARAM(" / ")); aStr += " / ";
aStr += OUString::number( GetWrtShell().GetPageCnt() ); aStr += OUString::number( GetWrtShell().GetPageCnt() );
return aStr; return aStr;
} }
int SwView::InsertGraphic( const String &rPath, const String &rFilter, int SwView::InsertGraphic( const OUString &rPath, const OUString &rFilter,
sal_Bool bLink, GraphicFilter *pFilter, sal_Bool bLink, GraphicFilter *pFilter,
Graphic* pPreviewGrf, sal_Bool bRule ) Graphic* pPreviewGrf, sal_Bool bRule )
{ {
...@@ -1206,7 +1206,7 @@ void SwView::Execute(SfxRequest &rReq) ...@@ -1206,7 +1206,7 @@ void SwView::Execute(SfxRequest &rReq)
} }
/// invalidate page numbering field /// invalidate page numbering field
void SwView::UpdatePageNums(sal_uInt16 nPhyNum, sal_uInt16 nVirtNum, const String& rPgStr) void SwView::UpdatePageNums(sal_uInt16 nPhyNum, sal_uInt16 nVirtNum, const OUString& rPgStr)
{ {
String sTemp(GetPageStr( nPhyNum, nVirtNum, rPgStr )); String sTemp(GetPageStr( nPhyNum, nVirtNum, rPgStr ));
const SfxStringItem aTmp( FN_STAT_PAGE, sTemp ); const SfxStringItem aTmp( FN_STAT_PAGE, sTemp );
...@@ -1839,10 +1839,10 @@ void SwView::EditLinkDlg() ...@@ -1839,10 +1839,10 @@ void SwView::EditLinkDlg()
} }
} }
bool SwView::JumpToSwMark( const String& rMark ) bool SwView::JumpToSwMark( const OUString& rMark )
{ {
bool bRet = false; bool bRet = false;
if( rMark.Len() ) if( !rMark.isEmpty() )
{ {
// place bookmark at top-center // place bookmark at top-center
sal_Bool bSaveCC = IsCrsrAtCenter(); sal_Bool bSaveCC = IsCrsrAtCenter();
...@@ -2022,12 +2022,12 @@ void SwView::ExecuteInsertDoc( SfxRequest& rRequest, const SfxPoolItem* pItem ) ...@@ -2022,12 +2022,12 @@ void SwView::ExecuteInsertDoc( SfxRequest& rRequest, const SfxPoolItem* pItem )
} }
} }
long SwView::InsertDoc( sal_uInt16 nSlotId, const String& rFileName, const String& rFilterName, sal_Int16 nVersion ) long SwView::InsertDoc( sal_uInt16 nSlotId, const OUString& rFileName, const OUString& rFilterName, sal_Int16 nVersion )
{ {
SfxMedium* pMed = 0; SfxMedium* pMed = 0;
SwDocShell* pDocSh = GetDocShell(); SwDocShell* pDocSh = GetDocShell();
if( rFileName.Len() ) if( !rFileName.isEmpty() )
{ {
SfxObjectFactory& rFact = pDocSh->GetFactory(); SfxObjectFactory& rFact = pDocSh->GetFactory();
const SfxFilter* pFilter = rFact.GetFilterContainer()->GetFilter4FilterName( rFilterName ); const SfxFilter* pFilter = rFact.GetFilterContainer()->GetFilter4FilterName( rFilterName );
......
...@@ -262,7 +262,7 @@ void SwView::ExecDraw(SfxRequest& rReq) ...@@ -262,7 +262,7 @@ void SwView::ExecDraw(SfxRequest& rReq)
case SID_DRAW_SELECT: case SID_DRAW_SELECT:
pFuncPtr = new DrawSelection(m_pWrtShell, m_pEditWin, this); pFuncPtr = new DrawSelection(m_pWrtShell, m_pEditWin, this);
m_nDrawSfxId = m_nFormSfxId = SID_OBJECT_SELECT; m_nDrawSfxId = m_nFormSfxId = SID_OBJECT_SELECT;
m_sDrawCustom.Erase(); m_sDrawCustom = "";
break; break;
case SID_DRAW_LINE: case SID_DRAW_LINE:
...@@ -275,7 +275,7 @@ void SwView::ExecDraw(SfxRequest& rReq) ...@@ -275,7 +275,7 @@ void SwView::ExecDraw(SfxRequest& rReq)
case SID_DRAW_CAPTION_VERTICAL: case SID_DRAW_CAPTION_VERTICAL:
pFuncPtr = new ConstRectangle(m_pWrtShell, m_pEditWin, this); pFuncPtr = new ConstRectangle(m_pWrtShell, m_pEditWin, this);
m_nDrawSfxId = nSlotId; m_nDrawSfxId = nSlotId;
m_sDrawCustom.Erase(); m_sDrawCustom = "";
break; break;
case SID_DRAW_POLYGON_NOFILL: case SID_DRAW_POLYGON_NOFILL:
...@@ -283,7 +283,7 @@ void SwView::ExecDraw(SfxRequest& rReq) ...@@ -283,7 +283,7 @@ void SwView::ExecDraw(SfxRequest& rReq)
case SID_DRAW_FREELINE_NOFILL: case SID_DRAW_FREELINE_NOFILL:
pFuncPtr = new ConstPolygon(m_pWrtShell, m_pEditWin, this); pFuncPtr = new ConstPolygon(m_pWrtShell, m_pEditWin, this);
m_nDrawSfxId = nSlotId; m_nDrawSfxId = nSlotId;
m_sDrawCustom.Erase(); m_sDrawCustom = "";
break; break;
case SID_DRAW_ARC: case SID_DRAW_ARC:
...@@ -291,7 +291,7 @@ void SwView::ExecDraw(SfxRequest& rReq) ...@@ -291,7 +291,7 @@ void SwView::ExecDraw(SfxRequest& rReq)
case SID_DRAW_CIRCLECUT: case SID_DRAW_CIRCLECUT:
pFuncPtr = new ConstArc(m_pWrtShell, m_pEditWin, this); pFuncPtr = new ConstArc(m_pWrtShell, m_pEditWin, this);
m_nDrawSfxId = nSlotId; m_nDrawSfxId = nSlotId;
m_sDrawCustom.Erase(); m_sDrawCustom = "";
break; break;
case SID_FM_CREATE_CONTROL: case SID_FM_CREATE_CONTROL:
...@@ -630,7 +630,7 @@ void SwView::SetDrawFuncPtr(SwDrawBase* pFuncPtr) ...@@ -630,7 +630,7 @@ void SwView::SetDrawFuncPtr(SwDrawBase* pFuncPtr)
void SwView::SetSelDrawSlot() void SwView::SetSelDrawSlot()
{ {
m_nDrawSfxId = SID_OBJECT_SELECT; m_nDrawSfxId = SID_OBJECT_SELECT;
m_sDrawCustom.Erase(); m_sDrawCustom = "";
} }
bool SwView::AreOnlyFormsSelected() const bool SwView::AreOnlyFormsSelected() const
......
...@@ -492,7 +492,7 @@ bool SwView::IsValidSelectionForThesaurus() const ...@@ -492,7 +492,7 @@ bool SwView::IsValidSelectionForThesaurus() const
return !bMultiSel && (!bSelection || m_pWrtShell->IsSelOnePara() ); return !bMultiSel && (!bSelection || m_pWrtShell->IsSelOnePara() );
} }
String SwView::GetThesaurusLookUpText( bool bSelection ) const OUString SwView::GetThesaurusLookUpText( bool bSelection ) const
{ {
return bSelection ? m_pWrtShell->GetSelTxt() : m_pWrtShell->GetCurWord(); return bSelection ? m_pWrtShell->GetSelTxt() : m_pWrtShell->GetCurWord();
} }
......
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