diff options
author | Katarina Behrens <Katarina.Behrens@cib.de> | 2016-10-24 21:58:38 +0200 |
---|---|---|
committer | Katarina Behrens <Katarina.Behrens@cib.de> | 2016-10-25 11:26:49 +0200 |
commit | fab262f115e5c0e6d43b65e376241152ddff82b3 (patch) | |
tree | 7e8bb65d6ba1164db893fb74843152e75b1452f7 /cui | |
parent | ae3fb69ebca4e253959cdf9bf620296e7797a501 (diff) |
screenshot annotation: More readable markup
this should placate clang too
Change-Id: Ida2cceebd5870b5896fb125e51e4cb67ad253d92
Diffstat (limited to 'cui')
-rw-r--r-- | cui/source/dialogs/screenshotannotationdlg.cxx | 47 |
1 files changed, 27 insertions, 20 deletions
diff --git a/cui/source/dialogs/screenshotannotationdlg.cxx b/cui/source/dialogs/screenshotannotationdlg.cxx index 53a0cc94e298..cd0591d26166 100644 --- a/cui/source/dialogs/screenshotannotationdlg.cxx +++ b/cui/source/dialogs/screenshotannotationdlg.cxx @@ -54,38 +54,45 @@ namespace OUString lcl_AltDescr() { - OUString aRet = OUString("<alt xml-lang=en-US ") + OUString("id=") + lcl_genRandom("alt_id") + OUString(">") + - OUString(" ") + //FIXME real dialog title or something - OUString("</alt>"); - return aRet; + OUString aTempl = OUString("<alt xml-lang=en-US id=%1>" + " " //FIXME real dialog title or something + "</alt>"); + aTempl = aTempl.replaceFirst( "%1", lcl_genRandom("alt_id") ); + + return aTempl; } OUString lcl_Image( const OUString& rScreenshotId ) { - OUString aRet = OUString("<image id=") + lcl_genRandom( "img_id" ) + - OUString(" src=media/screenshots/") + rScreenshotId + OUString(".png") - + OUString(">") + //FIXME width + height - lcl_AltDescr() + - OUString("</image>"); - return aRet; + OUString aTempl = OUString("<image id=%1 src=media/screenshots/%2.png>" //FIXME width + height + "%3" + "</image>"); + aTempl = aTempl.replaceFirst( "%1", lcl_genRandom("img_id") ); + aTempl = aTempl.replaceFirst( "%2", rScreenshotId ); + aTempl = aTempl.replaceFirst( "%3", lcl_AltDescr() ); + + return aTempl; } OUString lcl_ParagraphWithImage( const OUString& rScreenshotId ) { - OUString aRet = OUString("<paragraph id=") + lcl_genRandom( "par_id" ) + - OUString(" role=\"paragraph\" xml-lang=en-US>") + - lcl_Image( rScreenshotId ) + - OUString("</paragraph>"); - return aRet; + OUString aTempl = OUString( "<paragraph id=%1 role=\"paragraph\" xml-lang=en-US>%2" + "</paragraph>" SAL_NEWLINE_STRING ); + aTempl = aTempl.replaceFirst( "%1", lcl_genRandom("par_id") ); + aTempl = aTempl.replaceFirst( "%2", lcl_Image(rScreenshotId) ); + + return aTempl; } OUString lcl_Bookmark( const OUString& rWidgetId ) { - OUString aRet = "<!-- Bookmark for widget " + rWidgetId + " -->" + SAL_NEWLINE_STRING; - aRet += OUString("<bookmark xml-lang=en-US branch=hid/") + rWidgetId + OUString(" ") + - lcl_genRandom( "bm_id" ) + OUString(" localize=false") + - OUString("</bookmark>") + SAL_NEWLINE_STRING; - return aRet; + OUString aTempl = "<!-- Bookmark for widget %1 -->" SAL_NEWLINE_STRING + "<bookmark xml-lang=en-US branch=hid/%2 %3 localize=false </bookmark>" SAL_NEWLINE_STRING; + aTempl = aTempl.replaceFirst( "%1", rWidgetId ); + aTempl = aTempl.replaceFirst( "%2", rWidgetId ); + aTempl = aTempl.replaceFirst( "%3", lcl_genRandom("bm_id") ); + + return aTempl; } } |