summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Meeks <michael.meeks@suse.com>2012-06-08 14:33:52 +0100
committerMichael Meeks <michael.meeks@suse.com>2012-06-08 14:43:46 +0100
commit1227034d594cbe141738bdf9922319643ad869ff (patch)
tree3fef9c5249de4ef636dde0a0976b1b15f17ecbb6
parent25dd603fe2044f35341fe0c6d0b632c9295a824e (diff)
targetted revert of OLE2 object save in writer context menu
Change-Id: I7efe4af8fc305e786fb1856c200d9db8320df948
-rw-r--r--sw/inc/cmdid.h4
-rw-r--r--sw/inc/swcommands.h2
-rw-r--r--sw/sdi/_frmsh.sdi14
-rw-r--r--sw/sdi/swriter.sdi48
-rw-r--r--sw/source/ui/app/mn.src27
-rw-r--r--sw/source/ui/shells/frmsh.cxx151
6 files changed, 0 insertions, 246 deletions
diff --git a/sw/inc/cmdid.h b/sw/inc/cmdid.h
index ca5a87296f86..3a6f80ccdde1 100644
--- a/sw/inc/cmdid.h
+++ b/sw/inc/cmdid.h
@@ -641,10 +641,6 @@ included in c-context files, so c++ style stuff will cause problems.
#define FN_NUMBER_CURRENCY (FN_FORMAT2 + 127)
#define FN_NUMBER_PERCENT (FN_FORMAT2 + 128)
-#define FN_EXPORT_OLE (FN_FORMAT2 + 129) /* Export menu item */
-#define FN_EXPORT_OLE_AS_PDF (FN_FORMAT2 + 130) /* Export as PDF */
-#define FN_EXPORT_OLE_AS_GRAPHIC (FN_FORMAT2 + 131) /* Export as JPG */
-
#define FN_FRAME_CHAIN (FN_FORMAT2 + 136)
#define FN_FRAME_UNCHAIN (FN_FORMAT2 + 137)
diff --git a/sw/inc/swcommands.h b/sw/inc/swcommands.h
index 411ec5c76621..d9f614898acb 100644
--- a/sw/inc/swcommands.h
+++ b/sw/inc/swcommands.h
@@ -165,8 +165,6 @@
#define CMD_FN_FORMAT_GRAFIC_DLG ".uno:GraphicDialog"
#define CMD_FN_SAVE_GRAPHIC ".uno:SaveGraphic"
#define CMD_FN_EXTERNAL_EDIT ".uno:ExternalEdit"
-#define CMD_FN_EXPORT_OLE_AS_PDF ".uno:ExportOleAsPDF"
-#define CMD_FN_EXPORT_OLE_AS_GRAPHIC ".uno:ExportOleAsGraphic"
#define CMD_FN_GROW_FONT_SIZE ".uno:Grow"
#define CMD_FN_HSCROLLBAR ".uno:HScroll"
#define CMD_SID_HTML_MODE ".uno:HtmlMode"
diff --git a/sw/sdi/_frmsh.sdi b/sw/sdi/_frmsh.sdi
index de898acb3522..d7ea07918b89 100644
--- a/sw/sdi/_frmsh.sdi
+++ b/sw/sdi/_frmsh.sdi
@@ -173,20 +173,6 @@ interface BaseTextFrame
DisableFlags="SW_DISABLE_ON_PROTECTED_CURSOR";
]
- FN_EXPORT_OLE_AS_PDF // status(final|play)
- [
- ExecMethod = Execute ;
- StateMethod = GetState ;
- DisableFlags="SW_DISABLE_ON_PROTECTED_CURSOR";
- ]
-
- FN_EXPORT_OLE_AS_GRAPHIC // status(final|play)
- [
- ExecMethod = Execute ;
- StateMethod = GetState ;
- DisableFlags="SW_DISABLE_ON_PROTECTED_CURSOR";
- ]
-
SID_FRAME_LINESTYLE // status()
[
ExecMethod = ExecFrameStyle ;
diff --git a/sw/sdi/swriter.sdi b/sw/sdi/swriter.sdi
index 89e1530ca803..bab0c1b7442f 100644
--- a/sw/sdi/swriter.sdi
+++ b/sw/sdi/swriter.sdi
@@ -2034,54 +2034,6 @@ SfxVoidItem FormatColumns FN_FORMAT_COLUMN
GroupId = GID_FORMAT;
]
-SfxVoidItem ExportPDF FN_EXPORT_OLE_AS_PDF
-()
-[
- /* flags: */
- AutoUpdate = FALSE,
- Cachable = Cachable,
- FastCall = FALSE,
- HasCoreId = FALSE,
- HasDialog = FALSE,
- ReadOnlyDoc = FALSE,
- Toggle = FALSE,
- Container = FALSE,
- RecordAbsolute = FALSE,
- RecordPerItem;
- Asynchron;
-
- /* config: */
- AccelConfig = TRUE,
- MenuConfig = TRUE,
- StatusBarConfig = FALSE,
- ToolBoxConfig = TRUE,
- GroupId = GID_FRAME;
-]
-
-SfxVoidItem ExportGraphic FN_EXPORT_OLE_AS_GRAPHIC
-()
-[
- /* flags: */
- AutoUpdate = FALSE,
- Cachable = Cachable,
- FastCall = FALSE,
- HasCoreId = FALSE,
- HasDialog = FALSE,
- ReadOnlyDoc = FALSE,
- Toggle = FALSE,
- Container = FALSE,
- RecordAbsolute = FALSE,
- RecordPerItem;
- Asynchron;
-
- /* config: */
- AccelConfig = TRUE,
- MenuConfig = TRUE,
- StatusBarConfig = FALSE,
- ToolBoxConfig = TRUE,
- GroupId = GID_FRAME;
-]
-
//--------------------------------------------------------------------------
SwFmtDrop FormatDropcap FN_FORMAT_DROPCAPS
diff --git a/sw/source/ui/app/mn.src b/sw/source/ui/app/mn.src
index db394cb489bb..deed82e7c615 100644
--- a/sw/source/ui/app/mn.src
+++ b/sw/source/ui/app/mn.src
@@ -1307,30 +1307,6 @@ String MN_OLE_POPUPMENU
Text [ en-US ] = "Object" ;
};
-#define MN_OLE_EXPORT \
- MenuItem\
- {\
- Text [ en-US ] = "Export..." ; \
- SubMenu = Menu\
- {\
- ItemList = \
- {\
- MenuItem\
- {\
- Identifier = FN_EXPORT_OLE_AS_PDF ;\
- HelpID = CMD_FN_EXPORT_OLE_AS_PDF ; \
- Text [ en-US ] = "Export as P~DF..." ; \
- };\
- MenuItem\
- {\
- Identifier = FN_EXPORT_OLE_AS_GRAPHIC ;\
- HelpID = CMD_FN_EXPORT_OLE_AS_GRAPHIC ; \
- Text [ en-US ] = "Export as JPG..." ; \
- };\
- };\
- };\
- };
-
Menu MN_OLE_POPUPMENU
{
ItemList =
@@ -1346,9 +1322,6 @@ Menu MN_OLE_POPUPMENU
HelpId = CMD_FN_FORMAT_FRAME_DLG ;
Text [ en-US ] = "Object..." ;
};
- SEPARATOR ;
- MN_OLE_EXPORT
- SEPARATOR ;
MN_FRM_CAPTION_ITEM
};
};
diff --git a/sw/source/ui/shells/frmsh.cxx b/sw/source/ui/shells/frmsh.cxx
index 504efda20739..e62b21389903 100644
--- a/sw/source/ui/shells/frmsh.cxx
+++ b/sw/source/ui/shells/frmsh.cxx
@@ -85,14 +85,6 @@
#include "misc.hrc"
// #i73249#
#include <svx/dialogs.hrc>
-
-#include <sfx2/filedlghelper.hxx>
-#include <com/sun/star/ui/dialogs/TemplateDescription.hpp>
-#include <com/sun/star/beans/PropertyValues.hpp>
-#include <com/sun/star/uno/Reference.h>
-#include <com/sun/star/frame/XStorable.hpp>
-#include <com/sun/star/uno/Any.h>
-
#include <wordcountdialog.hxx>
using ::editeng::SvxBorderLine;
@@ -123,10 +115,6 @@ SFX_IMPL_INTERFACE(SwFrameShell, SwBaseShell, SW_RES(STR_SHELLNAME_FRAME))
SFX_OBJECTBAR_REGISTRATION(SFX_OBJECTBAR_OBJECT, SW_RES(RID_FRAME_TOOLBOX));
}
-#include <com/sun/star/frame/XComponentLoader.hpp>
-#include <com/sun/star/frame/XDesktop.hpp>
-#include <com/sun/star/frame/XDispatchHelper.hpp>
-
void SwFrameShell::Execute(SfxRequest &rReq)
{
//Erstmal die, die keinen FrmMgr benoetigen.
@@ -138,135 +126,6 @@ void SwFrameShell::Execute(SfxRequest &rReq)
switch ( nSlot )
{
- case FN_EXPORT_OLE_AS_GRAPHIC:
- {
- const int nSel = rSh.GetSelectionType();
- if (nSel & nsSelectionType::SEL_OLE)
- {
- sfx2::FileDialogHelper aDlgHelper( ::ui::dialogs::TemplateDescription::FILESAVE_AUTOEXTENSION, 0 );
- aDlgHelper.SetTitle(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "Export as JPG" )));
- String aExt(RTL_CONSTASCII_USTRINGPARAM("*.jpg"));
- aDlgHelper.AddFilter( aExt, aExt );
- aDlgHelper.SetCurrentFilter( aExt );
- if( aDlgHelper.Execute() == ERRCODE_NONE )
- {
- String aFile(aDlgHelper.GetPath());
- // copy the object
- uno::Reference< frame::XController > xController = rSh.GetView().GetViewFrame()->GetFrame().GetFrameInterface()->getController();
- uno::Reference< frame::XFrame > xFrame = xController->getFrame();
- uno::Reference< frame::XDispatchHelper > xDispatchHelper(::comphelper::getProcessServiceFactory()->createInstance(
- ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.frame.DispatchHelper" )) ),
- uno::UNO_QUERY );
- uno::Reference< frame::XDispatchProvider > xDispatchProvider(xFrame,UNO_QUERY);
- xDispatchHelper->executeDispatch(xDispatchProvider, ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(".uno:Copy")),
- ::rtl::OUString(), 0,
- Sequence < ::com::sun::star::beans::PropertyValue >());
- // create new draw document
- ::beans::PropertyValues aPropertyValue(1);
- aPropertyValue[0].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "Hidden" ) );
- aPropertyValue[0].Value <<= sal_Bool(sal_False);
-
- uno::Reference< ::frame::XComponentLoader > xLoader(xFrame, UNO_QUERY);
- uno::Reference< ::lang::XComponent > xDrawComponent( xLoader->loadComponentFromURL(
- ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "private:factory/sdraw" ) ),
- ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "_blank" ) ), 0,
- aPropertyValue));
-
- // paste it into draw
- uno::Reference< frame::XModel > xDrawModel(xDrawComponent, UNO_QUERY);
- xController = xDrawModel->getCurrentController();
- xFrame = xController->getFrame();
- uno::Reference< frame::XDispatchProvider > xDrawDispatchProvider(xFrame,UNO_QUERY);
-
- xDispatchHelper->executeDispatch(xDrawDispatchProvider,
- ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(".uno:Paste")),
- ::rtl::OUString(), 0,
- Sequence < ::com::sun::star::beans::PropertyValue >());
- xDispatchHelper->executeDispatch(xDrawDispatchProvider,
- ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(".uno:AlignUp")),
- ::rtl::OUString(), 0,
- Sequence < ::com::sun::star::beans::PropertyValue >());
- xDispatchHelper->executeDispatch(xDrawDispatchProvider,
- ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(".uno:AlignCenter")),
- ::rtl::OUString(), 0,
- Sequence < ::com::sun::star::beans::PropertyValue >());
- // export as jpeg
- xController = xFrame->getController();
- aPropertyValue[0].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "FilterName" ) );
- aPropertyValue[0].Value <<= ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "draw_jpg_Export" ) );
- uno::Reference< frame::XStorable > xStorable(xController->getModel(), uno::UNO_QUERY );
- xStorable->storeToURL(aFile, aPropertyValue);
-
- // destroy draw document
- xDrawComponent->dispose();
- }
- }
- rReq.Ignore();
- }
- break;
- case FN_EXPORT_OLE_AS_PDF:
- {
- const int nSel = rSh.GetSelectionType();
- if (nSel & nsSelectionType::SEL_OLE)
- {
- sfx2::FileDialogHelper aDlgHelper( ::ui::dialogs::TemplateDescription::FILESAVE_AUTOEXTENSION, 0 );
- aDlgHelper.SetTitle(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "Export as PDF" )));
- String aExt(RTL_CONSTASCII_USTRINGPARAM("*.pdf"));
- aDlgHelper.AddFilter( aExt, aExt );
- aDlgHelper.SetCurrentFilter( aExt );
- if( aDlgHelper.Execute() == ERRCODE_NONE )
- {
- String aFile(aDlgHelper.GetPath());
- Reference< frame::XController > xController = rSh.GetView().GetViewFrame()->GetFrame().GetFrameInterface()->getController();
- ::beans::PropertyValues aPropertyValue(3);
- aPropertyValue[0].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "FilterName" ) );
- aPropertyValue[0].Value <<= rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "writer_pdf_Export" ) );
- Sequence< ::beans::PropertyValue > aSequence(10);
- ::beans::PropertyValue aValue;
- aValue.Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "UseLosslessCompression" ));
- aValue.Value <<= sal_Bool(sal_False);
- aSequence[0] = aValue;
- aValue.Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "Quality" ));
- aValue.Value <<= sal_Int32(90);
- aSequence[1] = aValue;
- aValue.Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "ReduceImageResolution" ));
- aValue.Value <<= sal_Bool(sal_False);
- aSequence[2] = aValue;
- aValue.Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "MaxImageResolution" ));
- aValue.Value <<= sal_Int32(300);
- aSequence[3] = aValue;
- aValue.Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "UseTaggedPDF" ));
- aValue.Value <<= sal_Bool(sal_False);
- aSequence[4] = aValue;
- aValue.Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "ExportNotes" ));
- aValue.Value <<= sal_Bool(sal_False);
- aSequence[5] = aValue;
- aValue.Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "UseTransitionEffects" ));
- aValue.Value <<= sal_Bool(sal_True);
- aSequence[6] = aValue;
- aValue.Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "FormsType" ));
- aValue.Value <<= sal_Int32(0);
- aSequence[7] = aValue;
- uno::Any aAny;
- Reference< view::XSelectionSupplier > xView( xController, UNO_QUERY );
- xView->getSelection() >>= aAny;
- aValue.Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "Selection" ));
- aValue.Value <<= aAny;
- aSequence[8] = aValue;
- aValue.Name = rtl::OUString();
- aValue.Value <<= sal_Int32(0);
- aSequence[9] = aValue;
- aPropertyValue[1].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "FilterData" ) );
- aPropertyValue[1].Value <<= aSequence;
- aPropertyValue[2].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "Selection" ) );
- aPropertyValue[2].Value <<= sal_Bool(sal_True);
- Reference< frame::XStorable > xStorable(xController->getModel(), uno::UNO_QUERY );
- xStorable->storeToURL(aFile, aPropertyValue);
- }
- }
- rReq.Ignore();
- }
- break;
case FN_FRAME_TO_ANCHOR:
if ( rSh.IsFrmSelected() )
{
@@ -853,16 +712,6 @@ void SwFrameShell::GetState(SfxItemSet& rSet)
rSet.DisableItem( nWhich );
break;
- case FN_EXPORT_OLE:
- case FN_EXPORT_OLE_AS_PDF:
- case FN_EXPORT_OLE_AS_GRAPHIC:
- {
- SvtMiscOptions aMiscOptions;
- if ( !aMiscOptions.IsExperimentalMode() )
- rSet.DisableItem( nWhich );
- break;
- }
-
case SID_OBJECT_ALIGN_UP :
case SID_OBJECT_ALIGN_MIDDLE :
case SID_OBJECT_ALIGN_DOWN :