diff options
author | Muhammet Kara <muhammet.kara@collabora.com> | 2019-06-12 21:21:26 +0300 |
---|---|---|
committer | Muhammet Kara <muhammet.kara@collabora.com> | 2019-06-13 07:35:20 +0200 |
commit | b26489a8a30f2c3e299ef45f17ef4fc64102a0c7 (patch) | |
tree | e97f371872b7f435949740cdcc88f0e796b66d95 /sfx2/inc | |
parent | 41a644dae966ecb958d1fe56cb14f3c091b0eceb (diff) |
Auto redaction dialog 6th iteration
* Binds everything together.
* The auto redaction process works end to end now.
* Only for case sensitive text content (no regex support yet)
Change-Id: I6edd67472d376e2c0d91ac4b1ff90d98c49b13ac
Reviewed-on: https://gerrit.libreoffice.org/73908
Tested-by: Jenkins
Reviewed-by: Muhammet Kara <muhammet.kara@collabora.com>
Diffstat (limited to 'sfx2/inc')
-rw-r--r-- | sfx2/inc/SfxRedactionHelper.hxx | 14 | ||||
-rw-r--r-- | sfx2/inc/autoredactdialog.hxx | 13 |
2 files changed, 19 insertions, 8 deletions
diff --git a/sfx2/inc/SfxRedactionHelper.hxx b/sfx2/inc/SfxRedactionHelper.hxx index 44a78ab9b877..9be54ca8ac22 100644 --- a/sfx2/inc/SfxRedactionHelper.hxx +++ b/sfx2/inc/SfxRedactionHelper.hxx @@ -31,6 +31,7 @@ class SfxStringItem; class GDIMetaFile; class DocumentToGraphicRenderer; class SfxViewFrame; +struct RedactionTarget; struct PageMargins { @@ -66,10 +67,12 @@ public: * Creates one shape and one draw page for each gdimetafile, * and inserts the shapes into the newly created draw pages. * */ - static void addPagesToDraw(uno::Reference<XComponent>& xComponent, const sal_Int32& nPages, - const std::vector<GDIMetaFile>& aMetaFiles, - const std::vector<::Size>& aPageSizes, - const PageMargins& aPageMargins); + static void + addPagesToDraw(uno::Reference<XComponent>& xComponent, const sal_Int32& nPages, + const std::vector<GDIMetaFile>& aMetaFiles, + const std::vector<::Size>& aPageSizes, const PageMargins& aPageMargins, + const std::vector<std::pair<RedactionTarget*, OUString>>& r_aTableTargets, + const bool& bIsAutoRedact); /* * Makes the Redaction toolbar visible to the user. * Meant to be called after converting a document to a Draw doc @@ -104,7 +107,8 @@ public: * 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, + static void autoRedactPage(const RedactionTarget* pRedactionTarget, + const GDIMetaFile& rGDIMetaFile, uno::Reference<drawing::XDrawPage>& xPage, uno::Reference<XComponent>& xComponent); }; diff --git a/sfx2/inc/autoredactdialog.hxx b/sfx2/inc/autoredactdialog.hxx index 2336d66c4063..bab00cf536a3 100644 --- a/sfx2/inc/autoredactdialog.hxx +++ b/sfx2/inc/autoredactdialog.hxx @@ -105,6 +105,7 @@ class SFX2_DLLPUBLIC SfxAutoRedactDialog : public SfxDialogController SfxObjectShellLock m_xDocShell; std::vector<std::pair<RedactionTarget*, OUString>> m_aTableTargets; std::unique_ptr<sfx2::FileDialogHelper> m_pFileDlg; + bool m_bIsValidState; std::unique_ptr<weld::Label> m_xRedactionTargetsLabel; std::unique_ptr<TargetsTable> m_xTargetsBox; @@ -133,10 +134,16 @@ public: SfxAutoRedactDialog(weld::Window* pParent); virtual ~SfxAutoRedactDialog() override; - /* - * Check if the dialog has any valid redaction targets. - */ + /// Check if the dialog has any valid redaction targets. bool hasTargets() const; + /// Check if the dialog is in a valid state. + bool isValidState() const { return m_bIsValidState; } + /** Literally moves targets into the given vector. + * At the end of the operation, m_aTableTargets vector becomes empty. + * The contents of the given vector will be erased before being filled in. + * Returns true if successfull. + */ + bool moveTargets(std::vector<std::pair<RedactionTarget*, OUString>>& r_aTargets); // TODO: Some method(s) to check emptiness/validity // TODO: Some method(s) to get the search params/objects |