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-01-25 12:47:58 +0100
commitd051eef1119832ea35cf76a3d4472cb653b73e86 (patch)
tree7f3c72d9d0ba1f1276319d666423d19aeef0a2cd /sfx2
parent5cdb0821d2b59145cf83ea3652a5df72a6a3c8c8 (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>
Diffstat (limited to 'sfx2')
-rw-r--r--sfx2/source/doc/objserv.cxx29
1 files changed, 29 insertions, 0 deletions
diff --git a/sfx2/source/doc/objserv.cxx b/sfx2/source/doc/objserv.cxx
index defa5ea0e483..2d202cc79376 100644
--- a/sfx2/source/doc/objserv.cxx
+++ b/sfx2/source/doc/objserv.cxx
@@ -109,6 +109,7 @@
#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>
@@ -642,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;
}