summaryrefslogtreecommitdiff
path: root/cui/source/dialogs/screenshotannotationdlg.cxx
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2023-04-02 01:18:42 +0300
committerMike Kaganski <mike.kaganski@collabora.com>2023-04-02 18:46:47 +0200
commit116b9d6ddf2b61186b29f0370234eec9c1bbe306 (patch)
tree7f90a12333274086e33c4e0fabfd96a8e54e6b6c /cui/source/dialogs/screenshotannotationdlg.cxx
parentd7ba78e9c7be835a1e2ecdacd25995663e96862f (diff)
Avoid conversions between OUString and OString in VCL
Standardize on OUString, which is the main internal string class. Convert from/to OUString only when communicating with respective external APIs. Removes about 200 conversions from the code. Change-Id: I96ecee7c6fd271bb76639220e96d69d2964bed26 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149930 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'cui/source/dialogs/screenshotannotationdlg.cxx')
-rw-r--r--cui/source/dialogs/screenshotannotationdlg.cxx11
1 files changed, 4 insertions, 7 deletions
diff --git a/cui/source/dialogs/screenshotannotationdlg.cxx b/cui/source/dialogs/screenshotannotationdlg.cxx
index c23146f91fbd..fca03c02d42d 100644
--- a/cui/source/dialogs/screenshotannotationdlg.cxx
+++ b/cui/source/dialogs/screenshotannotationdlg.cxx
@@ -252,7 +252,7 @@ ScreenshotAnnotationDlg_Impl::ScreenshotAnnotationDlg_Impl(
if (mxText)
{
mxText->set_size_request(400, mxText->get_height_rows(10));
- OUString aHelpId = OStringToOUString( mrParentDialog.get_help_id(), RTL_TEXTENCODING_UTF8 );
+ OUString aHelpId = mrParentDialog.get_help_id();
Size aSizeCm = Application::GetDefaultDevice()->PixelToLogic(maParentDialogSize, MapMode(MapUnit::MapCM));
maMainMarkupText = lcl_ParagraphWithImage( aHelpId, aSizeCm );
mxText->set_text( maMainMarkupText );
@@ -276,7 +276,7 @@ IMPL_LINK_NOARG(ScreenshotAnnotationDlg_Impl, saveButtonHandler, weld::Button&,
// 'save screenshot...' pressed, offer to save maParentDialogBitmap
// as PNG image, use *.id file name as screenshot file name offering
// get a suggestion for the filename from buildable name
- OString aDerivedFileName = mrParentDialog.get_buildable_name();
+ OUString aDerivedFileName = mrParentDialog.get_buildable_name();
auto xFileDlg = std::make_unique<sfx2::FileDialogHelper>(ui::dialogs::TemplateDescription::FILESAVE_AUTOEXTENSION,
FileDialogFlags::NONE, mpParentWindow);
@@ -293,7 +293,7 @@ IMPL_LINK_NOARG(ScreenshotAnnotationDlg_Impl, saveButtonHandler, weld::Button&,
xFilePicker->appendFilter("*.png", "*.png");
xFilePicker->setCurrentFilter("*.png");
- xFilePicker->setDefaultName(OStringToOUString(aDerivedFileName, RTL_TEXTENCODING_UTF8));
+ xFilePicker->setDefaultName(aDerivedFileName);
xFilePicker->setMultiSelectionMode(false);
if (xFilePicker->execute() != ui::dialogs::ExecutableDialogResults::OK)
@@ -546,10 +546,7 @@ bool ScreenshotAnnotationDlg_Impl::MouseButtonUp()
OUStringBuffer aBookmarks(maMainMarkupText);
for (auto&& rCandidate : maSelected)
- {
- OUString aHelpId = OStringToOUString( rCandidate->GetHelpId(), RTL_TEXTENCODING_UTF8 );
- aBookmarks.append(lcl_Bookmark( aHelpId ));
- }
+ aBookmarks.append(lcl_Bookmark(rCandidate->GetHelpId()));
mxText->set_text( aBookmarks.makeStringAndClear() );
bRepaint = true;