summaryrefslogtreecommitdiff
path: root/sfx2/inc/SfxRedactionHelper.hxx
diff options
context:
space:
mode:
authorMuhammet Kara <muhammet.kara@collabora.com>2019-03-01 21:56:31 +0300
committerMuhammet Kara <muhammet.kara@collabora.com>2019-05-13 12:48:38 +0200
commit57667603c52e7d6bb82f5040151c8b7defcc6f8a (patch)
treeabf5cd5a2d23f1e27760131cd311ccd8944df616 /sfx2/inc/SfxRedactionHelper.hxx
parentfaecfd43646d9910e0409a39fecfd8816fe16cc9 (diff)
Auto-redact - First stab
Add a SfxRedactionHelper::autoRedactPage method which searches for the given term through the gdimetafile which has the whole content of an xPage (a Draw page), and draws redaction rectangles at proper positions with proper sizes. The search is case sensitive, and finds only the first occurences on a line. Will switch to a proper search provider via a follow-up patch. Change-Id: If3db62e50994670143785b6727fdcf1ccd4c6f8e Reviewed-on: https://gerrit.libreoffice.org/68597 Tested-by: Jenkins Reviewed-by: Muhammet Kara <muhammet.kara@collabora.com>
Diffstat (limited to 'sfx2/inc/SfxRedactionHelper.hxx')
-rw-r--r--sfx2/inc/SfxRedactionHelper.hxx20
1 files changed, 20 insertions, 0 deletions
diff --git a/sfx2/inc/SfxRedactionHelper.hxx b/sfx2/inc/SfxRedactionHelper.hxx
index ac15bb790fe9..44a78ab9b877 100644
--- a/sfx2/inc/SfxRedactionHelper.hxx
+++ b/sfx2/inc/SfxRedactionHelper.hxx
@@ -14,6 +14,7 @@
#include <com/sun/star/lang/XComponent.hpp>
#include <com/sun/star/frame/XModel.hpp>
#include <com/sun/star/beans/XPropertySet.hpp>
+#include <com/sun/star/drawing/XDrawPage.hpp>
#include <sal/types.h>
#include <rtl/ustring.hxx>
@@ -87,6 +88,25 @@ public:
* pages inserted into Draw for redaction.
* */
static PageMargins getPageMarginsForCalc(css::uno::Reference<css::frame::XModel>& xModel);
+
+ static void searchInMetaFile(const OUString& sSearchTerm, const GDIMetaFile& rMtf,
+ std::vector<tools::Rectangle>& aRedactionRectangles,
+ uno::Reference<XComponent>& xComponent);
+
+ /*
+ * Draws a redaction rectangle on the draw page referenced with its page number (0-based)
+ * */
+ static void addRedactionRectToPage(uno::Reference<XComponent>& xComponent,
+ uno::Reference<drawing::XDrawPage>& xPage,
+ const std::vector<tools::Rectangle>& aNewRectangles);
+
+ /*
+ * Search for the given term through the gdimetafile, which has the whole content of a draw page,
+ * and draw redaction rectangles to the appropriate positions with suitable sizes.
+ * */
+ static void autoRedactPage(const OUString& sRedactionTerm, const GDIMetaFile& rGDIMetaFile,
+ uno::Reference<drawing::XDrawPage>& xPage,
+ uno::Reference<XComponent>& xComponent);
};
#endif // INCLUDED_CUI_SOURCE_INC_SFXREDACTIONHELPER_HXX