From 4632afbd9ecdf85f3980b41fa9d58b6099aa2d81 Mon Sep 17 00:00:00 2001 From: Markus Mohrhard Date: Thu, 29 Nov 2018 20:34:56 +0100 Subject: tdf#93005, tdf#100611, remove the incomplete ODC export feature Change-Id: I96a3882cd412ea5d993971df7e20b1fd8da73642 Reviewed-on: https://gerrit.libreoffice.org/64283 Tested-by: Jenkins Reviewed-by: Markus Mohrhard (cherry picked from commit d543e8dfd3d8ae718e29304a155e1cf70d08325d) Reviewed-on: https://gerrit.libreoffice.org/64311 --- filter/source/config/fragments/filters/chart8.xcu | 2 +- include/sfx2/objsh.hxx | 2 +- include/svx/svxids.hrc | 1 - .../org/openoffice/Office/UI/GenericCommands.xcu | 8 ---- sc/Library_sc.mk | 1 - sc/sdi/tabvwsh.sdi | 1 - sc/source/filter/chart/chart_imp.cxx | 32 -------------- sc/source/ui/docshell/docsh.cxx | 39 ++--------------- sc/source/ui/drawfunc/fuins2.cxx | 37 ---------------- sc/source/ui/inc/docsh.hxx | 2 - sc/source/ui/inc/fuinsert.hxx | 7 ---- sc/source/ui/view/tabvwshb.cxx | 19 --------- sc/uiconfig/scalc/menubar/menubar.xml | 1 - sfx2/source/doc/guisaveas.cxx | 21 ---------- sfx2/source/doc/objstor.cxx | 49 +++------------------- svx/sdi/svx.sdi | 19 --------- 16 files changed, 10 insertions(+), 231 deletions(-) delete mode 100644 sc/source/filter/chart/chart_imp.cxx diff --git a/filter/source/config/fragments/filters/chart8.xcu b/filter/source/config/fragments/filters/chart8.xcu index 3c33792476fe..6bcfbd88dc18 100644 --- a/filter/source/config/fragments/filters/chart8.xcu +++ b/filter/source/config/fragments/filters/chart8.xcu @@ -16,7 +16,7 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . --> - IMPORT EXPORT OWN DEFAULT PREFERRED ENCRYPTION + IMPORT EXPORT OWN DEFAULT NOTINFILEDIALOG NOTINCHOOSER PREFERRED ENCRYPTION com.sun.star.comp.chart2.XMLFilter XML diff --git a/include/sfx2/objsh.hxx b/include/sfx2/objsh.hxx index af6c050c1dc8..0f2c09aeef82 100644 --- a/include/sfx2/objsh.hxx +++ b/include/sfx2/objsh.hxx @@ -604,7 +604,7 @@ public: */ void SetupStorage( const css::uno::Reference< css::embed::XStorage >& xStorage, - sal_Int32 nVersion, bool bTemplate, bool bChart = false ) const; + sal_Int32 nVersion, bool bTemplate ) const; css::uno::Reference< css::embed::XStorage > const & GetStorage(); diff --git a/include/svx/svxids.hrc b/include/svx/svxids.hrc index acd2df632a1a..5ccb79dcf527 100644 --- a/include/svx/svxids.hrc +++ b/include/svx/svxids.hrc @@ -267,7 +267,6 @@ class SfxStringItem; #define SID_OBJECT_ALIGN_UP ( SID_SVX_START + 134 ) #define SID_OBJECT_ALIGN_MIDDLE ( SID_SVX_START + 135 ) #define SID_OBJECT_ALIGN_DOWN ( SID_SVX_START + 136 ) -#define SID_INSERT_DIAGRAM_FROM_FILE ( SID_SVX_START + 139 ) #define SID_INSERT_DIAGRAM ( SID_SVX_START + 140 ) #define SID_INSERT_TABLE ( SID_SVX_START + 141 ) #define SID_ATTRIBUTES_AREA ( SID_SVX_START + 142 ) diff --git a/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu b/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu index 69856aa6362e..e13acb9d192f 100644 --- a/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu +++ b/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu @@ -2549,14 +2549,6 @@ 1 - - - Chart from File... - - - 1 - - Bullets diff --git a/sc/Library_sc.mk b/sc/Library_sc.mk index fe0e4368379b..82bd3ba17691 100644 --- a/sc/Library_sc.mk +++ b/sc/Library_sc.mk @@ -349,7 +349,6 @@ $(eval $(call gb_Library_add_exception_objects,sc,\ sc/source/filter/xml/xmltabi \ sc/source/filter/xml/xmltransformationi \ sc/source/filter/xml/xmlwrap \ - sc/source/filter/chart/chart_imp \ sc/source/filter/importfilterdata \ sc/source/ui/Accessibility/AccessibilityHints \ sc/source/ui/Accessibility/AccessibleCell \ diff --git a/sc/sdi/tabvwsh.sdi b/sc/sdi/tabvwsh.sdi index 7f33a247a394..4f9b451b05e2 100644 --- a/sc/sdi/tabvwsh.sdi +++ b/sc/sdi/tabvwsh.sdi @@ -125,7 +125,6 @@ interface BaseSelection SID_FM_CREATE_CONTROL [ ExecMethod = ExecDraw ; ] SID_LINKS [ ExecMethod = ExecDrawIns; StateMethod = GetDrawInsState; ] SID_DRAW_CHART [ ExecMethod = ExecDraw; StateMethod = GetDrawState; ] - SID_INSERT_DIAGRAM_FROM_FILE [ ExecMethod = ExecDrawIns; StateMethod = GetDrawState; ] SID_FM_CREATE_FIELDCONTROL [ ExecMethod = ExecDrawIns ; ] // } insert objects diff --git a/sc/source/filter/chart/chart_imp.cxx b/sc/source/filter/chart/chart_imp.cxx deleted file mode 100644 index da76b4a4a233..000000000000 --- a/sc/source/filter/chart/chart_imp.cxx +++ /dev/null @@ -1,32 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - */ - -#include -#include - -#include -#include - -using namespace com::sun::star; - -ScXMLChartExportWrapper::ScXMLChartExportWrapper( css::uno::Reference< css::frame::XModel > const & xModel, SfxMedium& rMed ): - mxModel(xModel), - mrMedium(rMed) -{ - -} - -void ScXMLChartExportWrapper::Export() -{ - if ( !mxStorage.is() ) - mxStorage = mrMedium.GetOutputStorage(); - - uno::Reference< document::XStorageBasedDocument>(mxModel, uno::UNO_QUERY_THROW)->storeToStorage(mxStorage, uno::Sequence< beans::PropertyValue >() ); -} -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/docshell/docsh.cxx b/sc/source/ui/docshell/docsh.cxx index 6e6589068747..608e995cf19a 100644 --- a/sc/source/ui/docshell/docsh.cxx +++ b/sc/source/ui/docshell/docsh.cxx @@ -580,28 +580,6 @@ bool ScDocShell::SaveXML( SfxMedium* pSaveMedium, const css::uno::Reference< css return bRet; } -bool ScDocShell::SaveCurrentChart( SfxMedium& rMedium ) -{ - try - { - - uno::Reference< lang::XComponent > xCurrentComponent = frame::Desktop::create( comphelper::getProcessComponentContext() )->getCurrentComponent(); - - uno::Reference< frame::XStorable2 > xStorable( xCurrentComponent, uno::UNO_QUERY_THROW ); - - uno::Reference< frame::XModel > xChartDoc ( xCurrentComponent, uno::UNO_QUERY_THROW ); - - ScXMLChartExportWrapper aExport( xChartDoc, rMedium ); - aExport.Export(); - return true; - } - catch(...) - { - SAL_WARN("sc", "exception thrown while saving chart. Bug!!!"); - return false; - } -} - bool ScDocShell::Load( SfxMedium& rMedium ) { LoadMediumGuard aLoadGuard(&m_aDocument); @@ -1846,21 +1824,10 @@ bool ScDocShell::SaveAs( SfxMedium& rMedium ) PrepareSaveGuard aPrepareGuard( *this); - OUString aFltName = rMedium.GetFilter()->GetFilterName(); - bool bChartExport = aFltName.indexOf("chart8") != -1; - // wait cursor is handled with progress bar - bool bRet = false; - if(!bChartExport) - { - bRet = SfxObjectShell::SaveAs( rMedium ); - if (bRet) - bRet = SaveXML( &rMedium, nullptr ); - } - else - { - bRet = SaveCurrentChart( rMedium ); - } + bool bRet = SfxObjectShell::SaveAs( rMedium ); + if (bRet) + bRet = SaveXML( &rMedium, nullptr ); return bRet; } diff --git a/sc/source/ui/drawfunc/fuins2.cxx b/sc/source/ui/drawfunc/fuins2.cxx index cebad75e887f..dc01065c8942 100644 --- a/sc/source/ui/drawfunc/fuins2.cxx +++ b/sc/source/ui/drawfunc/fuins2.cxx @@ -733,41 +733,4 @@ FuInsertChart::FuInsertChart(ScTabViewShell& rViewSh, vcl::Window* pWin, ScDrawV // BM/IHA -- } -FuInsertChartFromFile::FuInsertChartFromFile(ScTabViewShell& rViewSh, vcl::Window* pWin, ScDrawView* pViewP, - SdrModel* pDoc, const SfxRequest& rReq, const OUString& rURL): - FuPoor(rViewSh, pWin, pViewP, pDoc, rReq) -{ - uno::Reference< io::XInputStream > xStorage = comphelper::OStorageHelper::GetInputStreamFromURL( - rURL, comphelper::getProcessComponentContext()); - - comphelper::EmbeddedObjectContainer& rObjContainer = - rViewShell.GetObjectShell()->GetEmbeddedObjectContainer(); - - OUString aName; - uno::Reference< embed::XEmbeddedObject > xObj = rObjContainer.InsertEmbeddedObject( xStorage, aName ); - - const sal_Int64 nAspect = embed::Aspects::MSOLE_CONTENT; - awt::Size aSz = xObj->getVisualAreaSize( nAspect ); - Size aSize( aSz.Width, aSz.Height ); - - ScRange aPositionRange = rViewSh.GetViewData().GetCurPos(); - Point aStart = rViewSh.GetChartInsertPos( aSize, aPositionRange ); - tools::Rectangle aRect (aStart, aSize); - SdrOle2Obj* pObj = new SdrOle2Obj( - *pDoc, // TTTT should be reference - svt::EmbeddedObjectRef(xObj, nAspect), - aName, - aRect); - - SdrPageView* pPV = pView->GetSdrPageView(); - - // use the page instead of the view to insert, so no undo action is created yet - SdrPage* pInsPage = pPV->GetPage(); - pInsPage->InsertObject( pObj ); - pView->UnmarkAllObj(); - pView->MarkObj( pObj, pPV ); - - rViewShell.ActivateObject(pObj, embed::EmbedVerbs::MS_OLEVERB_SHOW); -} - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/docsh.hxx b/sc/source/ui/inc/docsh.hxx index 2870fc38927c..b6c523958c5f 100644 --- a/sc/source/ui/inc/docsh.hxx +++ b/sc/source/ui/inc/docsh.hxx @@ -137,8 +137,6 @@ class SC_DLLPUBLIC ScDocShell final: public SfxObjectShell, public SfxListener SAL_DLLPRIVATE bool SaveXML( SfxMedium* pMedium, const css::uno::Reference< css::embed::XStorage >& ); SAL_DLLPRIVATE SCTAB GetSaveTab(); - SAL_DLLPRIVATE static bool SaveCurrentChart( SfxMedium& rMedium ); - SAL_DLLPRIVATE ErrCode DBaseImport( const OUString& rFullFileName, rtl_TextEncoding eCharSet, std::map& aColWidthParam, ScFlatBoolRowSegments& rRowHeightsRecalc ); SAL_DLLPRIVATE ErrCode DBaseExport( diff --git a/sc/source/ui/inc/fuinsert.hxx b/sc/source/ui/inc/fuinsert.hxx index 31a1cb0a7a58..863aa6d88cb1 100644 --- a/sc/source/ui/inc/fuinsert.hxx +++ b/sc/source/ui/inc/fuinsert.hxx @@ -45,13 +45,6 @@ public: SdrModel* pDoc, SfxRequest& rReq); }; -class FuInsertChartFromFile : public FuPoor -{ -public: - FuInsertChartFromFile(ScTabViewShell& rViewSh, vcl::Window* pWin, ScDrawView* pView, - SdrModel* pDoc, const SfxRequest& rReq, const OUString& rURL); -}; - class FuInsertMedia : public FuPoor { public: diff --git a/sc/source/ui/view/tabvwshb.cxx b/sc/source/ui/view/tabvwshb.cxx index 80984cfa0656..5ea064f7fdd3 100644 --- a/sc/source/ui/view/tabvwshb.cxx +++ b/sc/source/ui/view/tabvwshb.cxx @@ -369,25 +369,6 @@ void ScTabViewShell::ExecDrawIns(SfxRequest& rReq) break; } - case SID_INSERT_DIAGRAM_FROM_FILE: - try - { - sfx2::FileDialogHelper aDlg(ui::dialogs::TemplateDescription::FILEOPEN_SIMPLE, - FileDialogFlags::NONE, "com.sun.star.chart2.ChartDocument", - SfxFilterFlags::NONE, SfxFilterFlags::NONE, pWin ? pWin->GetFrameWeld() : nullptr); - if(aDlg.Execute() == ERRCODE_NONE ) - { - INetURLObject aURLObj( aDlg.GetPath() ); - OUString aURL = aURLObj.GetURLNoPass(); - FuInsertChartFromFile(*this, pWin, pView, pDrModel, rReq, aURL); - } - } - catch (const uno::Exception& e) - { - SAL_WARN( "sc", "Cannot Insert Chart: " << e); - } - break; - case SID_OBJECTRESIZE: { // the server would like to change the client size diff --git a/sc/uiconfig/scalc/menubar/menubar.xml b/sc/uiconfig/scalc/menubar/menubar.xml index 046e6e16cb5d..dd6d9a9af667 100644 --- a/sc/uiconfig/scalc/menubar/menubar.xml +++ b/sc/uiconfig/scalc/menubar/menubar.xml @@ -217,7 +217,6 @@ - diff --git a/sfx2/source/doc/guisaveas.cxx b/sfx2/source/doc/guisaveas.cxx index 1f75ff2dc1fa..c9692ca90d8c 100644 --- a/sfx2/source/doc/guisaveas.cxx +++ b/sfx2/source/doc/guisaveas.cxx @@ -355,27 +355,6 @@ ModelData_Impl::ModelData_Impl( SfxStoringHelper& aOwner, , m_bRecommendReadOnly( false ) { CheckInteractionHandler(); - try - { - uno::Reference< lang::XComponent > xCurrentComponent = frame::Desktop::create( comphelper::getProcessComponentContext() )->getCurrentComponent(); - if (aOwner.GetModuleManager()->identify(xCurrentComponent) == "com.sun.star.chart2.ChartDocument") - { - // let us switch the model and set the xStorable and - // XStorable2 to the old model. - // This is an ugly hack because we have no SfxObjectShell for chart2 yet. - // We need SfxObjectShell for the heavy work around ODF document creation - // because chart2 only writes the basic stream out. - // In future in might make sense to implement a full scale object shell in - // chart2 and make chart2 an own program. - m_xModel.set(xCurrentComponent, uno::UNO_QUERY_THROW ); - m_xStorable.set(xModel, uno::UNO_QUERY_THROW ); - m_xStorable2.set(xModel, uno::UNO_QUERY_THROW ); - } - } - catch(...) - { - // we don't want to pass on any errors; - } } diff --git a/sfx2/source/doc/objstor.cxx b/sfx2/source/doc/objstor.cxx index 78f00adceb57..f1ae5b009231 100644 --- a/sfx2/source/doc/objstor.cxx +++ b/sfx2/source/doc/objstor.cxx @@ -300,38 +300,9 @@ SvGlobalName const & SfxObjectShell::GetClassName() const return GetFactory().GetClassId(); } -namespace { - -/** - * Chart2 does not have an Object shell, so handle this here for now - * If we ever implement a full scale object shell in chart2 move it there - */ -SotClipboardFormatId GetChartVersion( sal_Int32 nVersion, bool bTemplate ) -{ - if( nVersion == SOFFICE_FILEFORMAT_60) - { - return SotClipboardFormatId::STARCHART_60; - } - else if( nVersion == SOFFICE_FILEFORMAT_8) - { - if (bTemplate) - { - SAL_WARN("sfx.doc", "no chart template support yet"); - return SotClipboardFormatId::STARCHART_8; - } - else - return SotClipboardFormatId::STARCHART_8; - } - - SAL_WARN("sfx.doc", "unsupported version"); - return SotClipboardFormatId::NONE; -} - -} - void SfxObjectShell::SetupStorage( const uno::Reference< embed::XStorage >& xStorage, - sal_Int32 nVersion, bool bTemplate, bool bChart ) const + sal_Int32 nVersion, bool bTemplate ) const { uno::Reference< beans::XPropertySet > xProps( xStorage, uno::UNO_QUERY ); @@ -339,14 +310,9 @@ void SfxObjectShell::SetupStorage( const uno::Reference< embed::XStorage >& xSto { SotClipboardFormatId nClipFormat = SotClipboardFormatId::NONE; - if(!bChart) - { - SvGlobalName aName; - OUString aFullTypeName, aShortTypeName, aAppName; - FillClass( &aName, &nClipFormat, &aAppName, &aFullTypeName, &aShortTypeName, nVersion, bTemplate ); - } - else - nClipFormat = GetChartVersion(nVersion, bTemplate); + SvGlobalName aName; + OUString aFullTypeName, aShortTypeName, aAppName; + FillClass( &aName, &nClipFormat, &aAppName, &aFullTypeName, &aShortTypeName, nVersion, bTemplate ); if ( nClipFormat != SotClipboardFormatId::NONE ) { @@ -3069,12 +3035,7 @@ bool SfxObjectShell::SaveAsOwnFormat( SfxMedium& rMedium ) const bool bTemplate = rMedium.GetFilter()->IsOwnTemplateFormat() && nVersion > SOFFICE_FILEFORMAT_60; - std::shared_ptr pFilter = rMedium.GetFilter(); - bool bChart = false; - if(pFilter->GetName() == "chart8") - bChart = true; - - SetupStorage( xStorage, nVersion, bTemplate, bChart ); + SetupStorage( xStorage, nVersion, bTemplate ); #if HAVE_FEATURE_SCRIPTING if ( HasBasic() ) { diff --git a/svx/sdi/svx.sdi b/svx/sdi/svx.sdi index d38f9d78a69e..bf58e9ec9e50 100644 --- a/svx/sdi/svx.sdi +++ b/svx/sdi/svx.sdi @@ -4789,25 +4789,6 @@ SfxVoidItem InsertObjectChart SID_INSERT_DIAGRAM ] -SfxVoidItem InsertObjectChartFromFile SID_INSERT_DIAGRAM_FROM_FILE -() -[ - AutoUpdate = FALSE, - FastCall = FALSE, - ReadOnlyDoc = FALSE, - Toggle = FALSE, - Container = FALSE, - RecordAbsolute = FALSE, - RecordPerSet; - Asynchron; - - AccelConfig = TRUE, - MenuConfig = TRUE, - ToolBoxConfig = TRUE, - GroupId = SfxGroupId::Insert; -] - - SfxVoidItem InsertSymbol SID_CHARMAP (SfxStringItem Symbols SID_CHARMAP, SfxStringItem FontName SID_ATTR_SPECIALCHAR) [ -- cgit