summaryrefslogtreecommitdiff
path: root/svx/source/core/graphichelper.cxx
diff options
context:
space:
mode:
authorMarco Cecchetti <marco.cecchetti@collabora.com>2017-07-03 16:33:36 +0200
committerMarco Cecchetti <mrcekets@gmail.com>2017-07-04 10:28:35 +0200
commitdd74a659c60c1f0e7733d4244e808865377c6316 (patch)
tree402e767710ede69c40de175d26b3e2e8d3f57ac1 /svx/source/core/graphichelper.cxx
parentabc440a691efb872afac385ce5ed28cd5db56c8c (diff)
support for saving a modified image instead of original version
Normally when you save an image through the "Save..." entry in the context menu for an image, the saved image is the original one more eventually applied filters (which are not removeable). Further applied transformations like rotations, cropping, color effects are not included in the saved image. This patch offers the user to choose if saving the original image (with filters) or the modified version through a pop-up dialog. The new feature is available in Writer, Draw and Calc. Change-Id: I4f983e3a5e8a6839fa5789a96c4d8c44477c1fd7 Reviewed-on: https://gerrit.libreoffice.org/39480 Reviewed-by: Marco Cecchetti <mrcekets@gmail.com> Tested-by: Marco Cecchetti <mrcekets@gmail.com>
Diffstat (limited to 'svx/source/core/graphichelper.cxx')
-rw-r--r--svx/source/core/graphichelper.cxx9
1 files changed, 9 insertions, 0 deletions
diff --git a/svx/source/core/graphichelper.cxx b/svx/source/core/graphichelper.cxx
index 86b1025e18f7..3a6df2b9e7f5 100644
--- a/svx/source/core/graphichelper.cxx
+++ b/svx/source/core/graphichelper.cxx
@@ -26,6 +26,8 @@
#include <svx/graphichelper.hxx>
#include <svx/dialogs.hrc>
+#include <vcl/layout.hxx>
+
#include <cppuhelper/exc_hlp.hxx>
#include <comphelper/anytostring.hxx>
#include <comphelper/processfactory.hxx>
@@ -284,4 +286,11 @@ void GraphicHelper::SaveShapeAsGraphic( const Reference< drawing::XShape >& xSha
}
}
+short GraphicHelper::HasToSaveTransformedImage(vcl::Window* pWin)
+{
+ OUString aMsg(SvxResId(RID_SVXSTR_SAVE_MODIFIED_IMAGE));
+ ScopedVclPtrInstance< MessageDialog > aBox(pWin, aMsg, VclMessageType::Question, VclButtonsType::YesNo);
+ return aBox->Execute();
+}
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */