diff options
author | Katarina Behrens <Katarina.Behrens@cib.de> | 2016-10-20 20:31:40 +0200 |
---|---|---|
committer | Katarina Behrens <Katarina.Behrens@cib.de> | 2016-10-25 11:26:48 +0200 |
commit | dcbfb99fc5755c63f6619c8668c28c314953da6e (patch) | |
tree | e58798413ad5942b4bd8cb35e780c4c9a9684bce /cui | |
parent | 3298e8b8ec18a8aa76c7d0410d2b18d35471aec9 (diff) |
screenshot annotation: insert markup for annotated widgets
Change-Id: I82b8c541239271e3acfa6d8ad45b752fa1554931
Diffstat (limited to 'cui')
-rw-r--r-- | cui/source/dialogs/screenshotannotationdlg.cxx | 23 |
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; |