summaryrefslogtreecommitdiffstats
path: root/sfx2
diff options
context:
space:
mode:
authorMuhammet Kara <muhammet.kara@collabora.com>2019-01-22 01:00:39 +0300
committerAndras Timar <andras.timar@collabora.com>2019-03-27 21:41:25 +0100
commit6f3359112ed46ca74e3217fb3f8d9fb224aa228b (patch)
tree5f3e2010fb38b2d38dd658de3ded6403d30a56e2 /sfx2
parentRedaction: Adjust offset for multiple Calc pages (diff)
downloadcore-6f3359112ed46ca74e3217fb3f8d9fb224aa228b.tar.gz
core-6f3359112ed46ca74e3217fb3f8d9fb224aa228b.zip
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/69816 Reviewed-by: Andras Timar <andras.timar@collabora.com> Tested-by: Andras Timar <andras.timar@collabora.com>
Diffstat (limited to 'sfx2')
-rw-r--r--sfx2/source/doc/objserv.cxx32
1 files changed, 32 insertions, 0 deletions
diff --git a/sfx2/source/doc/objserv.cxx b/sfx2/source/doc/objserv.cxx
index ee8d25987845..776e4c7b997a 100644
--- a/sfx2/source/doc/objserv.cxx
+++ b/sfx2/source/doc/objserv.cxx
@@ -109,6 +109,10 @@
#include <helpids.h>
+#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 <sfx2/saveastemplatedlg.hxx>
#include <memory>
@@ -625,6 +629,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;
}