summaryrefslogtreecommitdiff
path: root/sfx2/inc
diff options
context:
space:
mode:
authorMuhammet Kara <muhammet.kara@collabora.com>2019-05-07 22:03:25 +0300
committerMuhammet Kara <muhammet.kara@collabora.com>2019-05-08 13:25:29 +0200
commit141e33bc1d56f7b7af5037988eeb5ca36864a511 (patch)
tree5ea183262170cfbf296557be736b6390e1fff1c4 /sfx2/inc
parentd3581eb79e204419a6906004c199512c1fa48a2c (diff)
Respect page margins of the source doc during redaction
Change-Id: Ieaa50a2eba17145180ddd5d2bfc77add4801c43a Reviewed-on: https://gerrit.libreoffice.org/71929 Tested-by: Jenkins Reviewed-by: Muhammet Kara <muhammet.kara@collabora.com>
Diffstat (limited to 'sfx2/inc')
-rw-r--r--sfx2/inc/SfxRedactionHelper.hxx26
1 files changed, 25 insertions, 1 deletions
diff --git a/sfx2/inc/SfxRedactionHelper.hxx b/sfx2/inc/SfxRedactionHelper.hxx
index 8b1bdd57e247..ac15bb790fe9 100644
--- a/sfx2/inc/SfxRedactionHelper.hxx
+++ b/sfx2/inc/SfxRedactionHelper.hxx
@@ -12,6 +12,8 @@
#include <com/sun/star/uno/Reference.hxx>
#include <com/sun/star/lang/XComponent.hpp>
+#include <com/sun/star/frame/XModel.hpp>
+#include <com/sun/star/beans/XPropertySet.hpp>
#include <sal/types.h>
#include <rtl/ustring.hxx>
@@ -29,6 +31,15 @@ class GDIMetaFile;
class DocumentToGraphicRenderer;
class SfxViewFrame;
+struct PageMargins
+{
+ // Page margins in mm100th
+ sal_Int32 nTop;
+ sal_Int32 nBottom;
+ sal_Int32 nLeft;
+ sal_Int32 nRight;
+};
+
/*
* Mostly a bunch of static methods to handle the redaction functionality at
* different points of the process.
@@ -56,13 +67,26 @@ public:
* */
static void addPagesToDraw(uno::Reference<XComponent>& xComponent, const sal_Int32& nPages,
const std::vector<GDIMetaFile>& aMetaFiles,
- const std::vector<::Size>& aPageSizes);
+ const std::vector<::Size>& aPageSizes,
+ const PageMargins& aPageMargins);
/*
* Makes the Redaction toolbar visible to the user.
* Meant to be called after converting a document to a Draw doc
* for redaction purposes.
* */
static void showRedactionToolbar(SfxViewFrame* pViewFrame);
+
+ /*
+ * Used to get the page margins from the original/source Writer document. Then we apply these values to the
+ * pages inserted into Draw for redaction.
+ * */
+ static PageMargins getPageMarginsForWriter(css::uno::Reference<css::frame::XModel>& xModel);
+
+ /*
+ * Used to get the page margins from the original/source Calc document. Then we apply these values to the
+ * pages inserted into Draw for redaction.
+ * */
+ static PageMargins getPageMarginsForCalc(css::uno::Reference<css::frame::XModel>& xModel);
};
#endif // INCLUDED_CUI_SOURCE_INC_SFXREDACTIONHELPER_HXX