Kaydet (Commit) 5dfb3365 authored tarafından Matteo Casalin's avatar Matteo Casalin

Group more code in local helper function and simplify it

Change-Id: I1d5c07bd9c67243cf22405fb4f6edb9202291091
üst aaca2deb
...@@ -76,20 +76,33 @@ using namespace nsSwDocInfoSubType; ...@@ -76,20 +76,33 @@ using namespace nsSwDocInfoSubType;
extern bool bNoInterrupt; // in mainwn.cxx extern bool bNoInterrupt; // in mainwn.cxx
static OUString& lcl_AppendRedlineStr( OUString& rStr, sal_uInt16 nRedlId ) static OUString lcl_BuildTitleWithRedline( const SwRangeRedline *pRedline )
{ {
const OUString sTitle(SW_RESSTR(STR_REDLINE_COMMENT));
sal_uInt16 nResId = 0; sal_uInt16 nResId = 0;
switch( nRedlId ) switch( pRedline->GetType() )
{ {
case nsRedlineType_t::REDLINE_INSERT: nResId = STR_REDLINE_INSERTED; break; case nsRedlineType_t::REDLINE_INSERT:
case nsRedlineType_t::REDLINE_DELETE: nResId = STR_REDLINE_DELETED; break; nResId = STR_REDLINE_INSERTED;
case nsRedlineType_t::REDLINE_FORMAT: nResId = STR_REDLINE_FORMATED; break; break;
case nsRedlineType_t::REDLINE_TABLE: nResId = STR_REDLINE_TABLECHG; break; case nsRedlineType_t::REDLINE_DELETE:
case nsRedlineType_t::REDLINE_FMTCOLL: nResId = STR_REDLINE_FMTCOLLSET; break; nResId = STR_REDLINE_DELETED;
break;
case nsRedlineType_t::REDLINE_FORMAT:
nResId = STR_REDLINE_FORMATED;
break;
case nsRedlineType_t::REDLINE_TABLE:
nResId = STR_REDLINE_TABLECHG;
break;
case nsRedlineType_t::REDLINE_FMTCOLL:
nResId = STR_REDLINE_FMTCOLLSET;
break;
default:
return sTitle;
} }
if( nResId )
rStr += SW_RESSTR( nResId ); return sTitle + SW_RESSTR( nResId );
return rStr;
} }
void SwTextShell::ExecField(SfxRequest &rReq) void SwTextShell::ExecField(SfxRequest &rReq)
...@@ -478,10 +491,7 @@ void SwTextShell::ExecField(SfxRequest &rReq) ...@@ -478,10 +491,7 @@ void SwTextShell::ExecField(SfxRequest &rReq)
assert(pDlg && "Dialog creation failed!"); assert(pDlg && "Dialog creation failed!");
pDlg->HideAuthor(); pDlg->HideAuthor();
OUString sTitle(SW_RES(STR_REDLINE_COMMENT)); pDlg->SetText(lcl_BuildTitleWithRedline(pRedline));
::lcl_AppendRedlineStr( sTitle, pRedline->GetType() );
pDlg->SetText(sTitle);
if (bTravel) if (bTravel)
{ {
...@@ -874,10 +884,7 @@ IMPL_LINK( SwTextShell, RedlineNextHdl, AbstractSvxPostItDialog *, pBtn ) ...@@ -874,10 +884,7 @@ IMPL_LINK( SwTextShell, RedlineNextHdl, AbstractSvxPostItDialog *, pBtn )
GetAppLangDateTimeString( GetAppLangDateTimeString(
pRedline->GetRedlineData().GetTimeStamp() )); pRedline->GetRedlineData().GetTimeStamp() ));
OUString sTitle(SW_RES(STR_REDLINE_COMMENT)); pDlg->SetText(lcl_BuildTitleWithRedline(pRedline));
::lcl_AppendRedlineStr( sTitle, pRedline->GetType() );
pDlg->SetText(sTitle);
} }
return 0; return 0;
...@@ -921,10 +928,7 @@ IMPL_LINK( SwTextShell, RedlinePrevHdl, AbstractSvxPostItDialog *, pBtn ) ...@@ -921,10 +928,7 @@ IMPL_LINK( SwTextShell, RedlinePrevHdl, AbstractSvxPostItDialog *, pBtn )
GetAppLangDateTimeString( GetAppLangDateTimeString(
pRedline->GetRedlineData().GetTimeStamp() )); pRedline->GetRedlineData().GetTimeStamp() ));
OUString sTitle(SW_RES(STR_REDLINE_COMMENT)); pDlg->SetText(lcl_BuildTitleWithRedline(pRedline));
::lcl_AppendRedlineStr( sTitle, pRedline->GetType() );
pDlg->SetText(sTitle);
} }
return 0; return 0;
......
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