diff options
Diffstat (limited to 'cui/source/dialogs/screenshotannotationdlg.cxx')
-rw-r--r-- | cui/source/dialogs/screenshotannotationdlg.cxx | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/cui/source/dialogs/screenshotannotationdlg.cxx b/cui/source/dialogs/screenshotannotationdlg.cxx index 802453d2206c..fca03c02d42d 100644 --- a/cui/source/dialogs/screenshotannotationdlg.cxx +++ b/cui/source/dialogs/screenshotannotationdlg.cxx @@ -35,7 +35,7 @@ #include <vcl/bitmapex.hxx> #include <vcl/customweld.hxx> #include <vcl/event.hxx> -#include <vcl/pngwrite.hxx> +#include <vcl/filter/PngImageWriter.hxx> #include <vcl/svapp.hxx> #include <vcl/salgtype.hxx> #include <vcl/virdev.hxx> @@ -202,7 +202,7 @@ ScreenshotAnnotationDlg_Impl::ScreenshotAnnotationDlg_Impl( mxVirtualBufferDevice(nullptr), mpHilighted(nullptr), maPicture(this), - maSaveAsText(CuiResId(RID_SVXSTR_SAVE_SCREENSHOT_AS)) + maSaveAsText(CuiResId(RID_CUISTR_SAVE_SCREENSHOT_AS)) { VclPtr<VirtualDevice> xParentDialogSurface(rParentDialog.screenshot()); maParentDialogSize = xParentDialogSurface->GetOutputSizePixel(); @@ -232,7 +232,7 @@ ScreenshotAnnotationDlg_Impl::ScreenshotAnnotationDlg_Impl( maDimmedDialogBitmap.Adjust(-15, 0, 0, 0, 0); // init paint buffering VirtualDevice - mxVirtualBufferDevice = VclPtr<VirtualDevice>::Create(*Application::GetDefaultDevice(), DeviceFormat::DEFAULT); + mxVirtualBufferDevice = VclPtr<VirtualDevice>::Create(*Application::GetDefaultDevice(), DeviceFormat::WITHOUT_ALPHA); mxVirtualBufferDevice->SetOutputSizePixel(maParentDialogSize); mxVirtualBufferDevice->SetFillColor(COL_TRANSPARENT); @@ -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) @@ -341,8 +341,8 @@ IMPL_LINK_NOARG(ScreenshotAnnotationDlg_Impl, saveButtonHandler, weld::Button&, mxVirtualBufferDevice->GetOutputSizePixel())); // write as PNG - vcl::PNGWriter aPNGWriter(aTargetBitmap); - aPNGWriter.Write(aNew); + vcl::PngImageWriter aPNGWriter(aNew); + aPNGWriter.write(aTargetBitmap); } weld::ScreenShotEntry* ScreenshotAnnotationDlg_Impl::CheckHit(const basegfx::B2IPoint& rPosition) @@ -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; |