summaryrefslogtreecommitdiff
path: root/cui
diff options
context:
space:
mode:
authorKatarina Behrens <Katarina.Behrens@cib.de>2016-11-15 11:57:30 +0100
committerKatarina Behrens <Katarina.Behrens@cib.de>2016-11-15 20:08:49 +0000
commit81f6384a50bfde0439ae0af00fed29d231e8196a (patch)
tree99a76a072c8cc9ce1e58e146079a641abaddb486 /cui
parentff08ee6ab2e11360f9260462b15f5ca133007101 (diff)
screenshotannotation: include image size in XML markup
Change-Id: I1c02055280b929ddd3ad12e6f6562c95bfe2a48a Reviewed-on: https://gerrit.libreoffice.org/30870 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Katarina Behrens <Katarina.Behrens@cib.de>
Diffstat (limited to 'cui')
-rw-r--r--cui/source/dialogs/screenshotannotationdlg.cxx19
1 files changed, 12 insertions, 7 deletions
diff --git a/cui/source/dialogs/screenshotannotationdlg.cxx b/cui/source/dialogs/screenshotannotationdlg.cxx
index cd0591d26166..c45913bddf76 100644
--- a/cui/source/dialogs/screenshotannotationdlg.cxx
+++ b/cui/source/dialogs/screenshotannotationdlg.cxx
@@ -62,24 +62,27 @@ namespace
return aTempl;
}
- OUString lcl_Image( const OUString& rScreenshotId )
+ OUString lcl_Image( const OUString& rScreenshotId, const Size& rSize )
{
- OUString aTempl = OUString("<image id=%1 src=media/screenshots/%2.png>" //FIXME width + height
- "%3"
+ OUString aTempl = OUString("<image id=%1 src=media/screenshots/%2.png"
+ " width=%3cm height=%4cm>"
+ "%5"
"</image>");
aTempl = aTempl.replaceFirst( "%1", lcl_genRandom("img_id") );
aTempl = aTempl.replaceFirst( "%2", rScreenshotId );
- aTempl = aTempl.replaceFirst( "%3", lcl_AltDescr() );
+ aTempl = aTempl.replaceFirst( "%3", OUString::number( rSize.Width() ) );
+ aTempl = aTempl.replaceFirst( "%4", OUString::number( rSize.Height() ) );
+ aTempl = aTempl.replaceFirst( "%5", lcl_AltDescr() );
return aTempl;
}
- OUString lcl_ParagraphWithImage( const OUString& rScreenshotId )
+ OUString lcl_ParagraphWithImage( const OUString& rScreenshotId, const Size& rSize )
{
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) );
+ aTempl = aTempl.replaceFirst( "%2", lcl_Image(rScreenshotId, rSize) );
return aTempl;
}
@@ -260,7 +263,9 @@ ScreenshotAnnotationDlg_Impl::ScreenshotAnnotationDlg_Impl(
if (mpText)
{
OUString aHelpId = OStringToOUString( mrParentDialog.GetHelpId(), RTL_TEXTENCODING_UTF8 );
- maMainMarkupText = lcl_ParagraphWithImage( aHelpId);
+
+ Size aSizeCm = mrParentDialog.PixelToLogic( maParentDialogSize, MapUnit::MapCM );
+ maMainMarkupText = lcl_ParagraphWithImage( aHelpId, aSizeCm );
mpText->SetText( maMainMarkupText );
mpText->SetReadOnly();
}