summaryrefslogtreecommitdiff
path: root/cui/source/dialogs/screenshotannotationdlg.cxx
diff options
context:
space:
mode:
authorKatarina Behrens <Katarina.Behrens@cib.de>2016-10-20 20:31:40 +0200
committerKatarina Behrens <Katarina.Behrens@cib.de>2016-10-24 11:01:19 +0200
commitee8b4060ec737d1f658dc8c3638a0bc1324cb36b (patch)
treeb5519560add427b616520f3e8a75bd074786bbb4 /cui/source/dialogs/screenshotannotationdlg.cxx
parent7c1cfa76871be9527dc9c2070d5dbdc1b55adbe5 (diff)
screenshot annotation: insert markup for annotated widgets
Change-Id: I82b8c541239271e3acfa6d8ad45b752fa1554931
Diffstat (limited to 'cui/source/dialogs/screenshotannotationdlg.cxx')
-rw-r--r--cui/source/dialogs/screenshotannotationdlg.cxx23
1 files changed, 22 insertions, 1 deletions
diff --git a/cui/source/dialogs/screenshotannotationdlg.cxx b/cui/source/dialogs/screenshotannotationdlg.cxx
index 2f7c2d6a058a..ca56d1ffb9fe 100644
--- a/cui/source/dialogs/screenshotannotationdlg.cxx
+++ b/cui/source/dialogs/screenshotannotationdlg.cxx
@@ -78,6 +78,15 @@ namespace
OUString("</paragraph>");
return aRet;
}
+
+ 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;
+ }
}
class ControlDataEntry
@@ -93,6 +102,8 @@ public:
return maB2IRange;
}
+ const OString GetHelpId() const { return mrControl.GetHelpId(); }
+
private:
basegfx::B2IRange maB2IRange;
};
@@ -156,6 +167,7 @@ private:
// save as text
OUString maSaveAsText;
+ OUString maMainMarkupText;
// folder URL
static OUString maLastFolderURL;
@@ -237,7 +249,8 @@ ScreenshotAnnotationDlg_Impl::ScreenshotAnnotationDlg_Impl(
if (mpText)
{
OUString aHelpId = OStringToOUString( mrParentDialog.GetHelpId(), RTL_TEXTENCODING_UTF8 );
- mpText->SetText( lcl_ParagraphWithImage( aHelpId) );
+ maMainMarkupText = lcl_ParagraphWithImage( aHelpId);
+ mpText->SetText( maMainMarkupText );
mpText->SetReadOnly(true);
}
@@ -572,6 +585,14 @@ IMPL_LINK(ScreenshotAnnotationDlg_Impl, pictureFrameListener, VclWindowEvent&, r
maSelected.insert(mpHilighted);
}
+ OUString aBookmarks;
+ for (auto&& rCandidate : maSelected)
+ {
+ OUString aHelpId = OStringToOUString( rCandidate->GetHelpId(), RTL_TEXTENCODING_UTF8 );
+ aBookmarks += lcl_Bookmark( aHelpId );
+ }
+
+ mpText->SetText( maMainMarkupText + aBookmarks );
bRepaint = true;
}
break;