diff options
Diffstat (limited to 'cui/source/dialogs/screenshotannotationdlg.cxx')
-rw-r--r-- | cui/source/dialogs/screenshotannotationdlg.cxx | 31 |
1 files changed, 13 insertions, 18 deletions
diff --git a/cui/source/dialogs/screenshotannotationdlg.cxx b/cui/source/dialogs/screenshotannotationdlg.cxx index 4f02452a8ad7..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> @@ -200,11 +200,9 @@ ScreenshotAnnotationDlg_Impl::ScreenshotAnnotationDlg_Impl( : mpParentWindow(pParent), mrParentDialog(rParentDialog), mxVirtualBufferDevice(nullptr), - maAllChildren(), mpHilighted(nullptr), - maSelected(), maPicture(this), - maSaveAsText(CuiResId(RID_SVXSTR_SAVE_SCREENSHOT_AS)) + maSaveAsText(CuiResId(RID_CUISTR_SAVE_SCREENSHOT_AS)) { VclPtr<VirtualDevice> xParentDialogSurface(rParentDialog.screenshot()); maParentDialogSize = xParentDialogSurface->GetOutputSizePixel(); @@ -234,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); @@ -254,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 ); @@ -278,10 +276,11 @@ 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); + xFileDlg->SetContext(sfx2::FileDialogHelper::ScreenshotAnnotation); const uno::Reference< ui::dialogs::XFilePicker3 > xFilePicker = xFileDlg->GetFilePicker(); @@ -294,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) @@ -342,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) @@ -439,10 +438,9 @@ void ScreenshotAnnotationDlg_Impl::RepaintToBuffer( bUseDimmed ? maDimmedDialogBitmap : maParentDialogBitmap); // get various options - const SvtOptionsDrawinglayer aSvtOptionsDrawinglayer; - const Color aHilightColor(aSvtOptionsDrawinglayer.getHilightColor()); - const double fTransparence(aSvtOptionsDrawinglayer.GetTransparentSelectionPercent() * 0.01); - const bool bIsAntiAliasing(aSvtOptionsDrawinglayer.IsAntiAliasing()); + const Color aHilightColor(SvtOptionsDrawinglayer::getHilightColor()); + const double fTransparence(SvtOptionsDrawinglayer::GetTransparentSelectionPercent() * 0.01); + const bool bIsAntiAliasing(SvtOptionsDrawinglayer::IsAntiAliasing()); const AntialiasingFlags nOldAA(mxVirtualBufferDevice->GetAntialiasing()); if (bIsAntiAliasing) @@ -548,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; |