summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
authorMuhammet Kara <muhammet.kara@collabora.com>2019-01-22 01:00:39 +0300
committerMuhammet Kara <muhammet.kara@collabora.com>2019-06-17 21:20:48 +0200
commit4a48d383aa97635a34c954fee4fcce058420707f (patch)
tree909a5ed886d24be4f6bf2a8d74891007ba416be2 /sfx2
parentefd8813bb88ff3f3fd8c523d2f39ae595292163e (diff)
Add Redaction Toolbar
* Consists of .uno:Rect, .uno:LineToolbox, and .uno:ExportDirectToPDF * Automatically shown when we are in the redaction process * Customizes the rectangle tool for our needs Also: * Adds new parameters to the SID_DRAW_RECT (.uno:Rect) to be able to set transparancy, fill color, and line/border style, and to make our button sticky/permanent Known problem: Button's icon is not shown after adding the parameters Change-Id: I7928264415769f7e0a4ded171b864adb99aed442 Reviewed-on: https://gerrit.libreoffice.org/66706 Tested-by: Jenkins Reviewed-by: Muhammet Kara <muhammet.kara@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/74198 Tested-by: Muhammet Kara <muhammet.kara@collabora.com>
Diffstat (limited to 'sfx2')
-rw-r--r--sfx2/source/doc/objserv.cxx31
1 files changed, 31 insertions, 0 deletions
diff --git a/sfx2/source/doc/objserv.cxx b/sfx2/source/doc/objserv.cxx
index 53ce5ad2f03e..c2162b6a473f 100644
--- a/sfx2/source/doc/objserv.cxx
+++ b/sfx2/source/doc/objserv.cxx
@@ -107,6 +107,9 @@
#include <com/sun/star/drawing/XDrawPagesSupplier.hpp>
#include <com/sun/star/drawing/XDrawPageSupplier.hpp>
+#include <com/sun/star/frame/XDesktop2.hpp>
+#include <com/sun/star/frame/Desktop.hpp>
+#include <com/sun/star/frame/XLayoutManager.hpp>
#include <guisaveas.hxx>
#include <saveastemplatedlg.hxx>
@@ -640,6 +643,34 @@ void SfxObjectShell::ExecFile_Impl(SfxRequest &rReq)
uno::Reference< drawing::XDrawPage > xPage( xDrawPages->getByIndex( 0 ), uno::UNO_QUERY_THROW );
xDrawPages->remove( xPage );
+ // Show the Redaction toolbar
+ SfxViewFrame* pViewFrame = SfxViewFrame::Current();
+ if (pViewFrame)
+ {
+ Reference<frame::XFrame> xFrame = pViewFrame->GetFrame().GetFrameInterface();
+ Reference<css::beans::XPropertySet> xPropSet( xFrame, UNO_QUERY );
+ Reference<css::frame::XLayoutManager> xLayoutManager;
+
+ if ( xPropSet.is() )
+ {
+ try
+ {
+ Any aValue = xPropSet->getPropertyValue( "LayoutManager" );
+ aValue >>= xLayoutManager;
+ xLayoutManager->createElement( "private:resource/toolbar/redactionbar" );
+ xLayoutManager->showElement("private:resource/toolbar/redactionbar");
+ }
+ catch ( const css::uno::RuntimeException& )
+ {
+ throw;
+ }
+ catch ( css::uno::Exception& )
+ {
+ SAL_WARN( "sfx.doc", "Exception while trying to show the Redaction Toolbar!");
+ }
+ }
+ }
+
return;
}