diff options
author | Miklos Vajna <vmiklos@collabora.com> | 2019-08-15 10:55:53 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.com> | 2019-08-15 11:42:55 +0200 |
commit | 5827e30109b683cb74efa21d154e5219fe9e2a0c (patch) | |
tree | 7a1557f85069e434393228f0be75a4266022eddc /cui | |
parent | bb9bad31b9e9f741fed91b2a4b3043814cb07f13 (diff) |
embeddedobj: allow controlling if Visio documents are converted to Draw or not
At the moment this affects only Insert -> Object -> OLE Object -> from
file.
Change-Id: I8d1c6456481610491916e3be3766b0bb04dfa296
Reviewed-on: https://gerrit.libreoffice.org/77489
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins
Diffstat (limited to 'cui')
-rw-r--r-- | cui/inc/strings.hrc | 1 | ||||
-rw-r--r-- | cui/source/options/optfltr.cxx | 23 | ||||
-rw-r--r-- | cui/source/options/optfltr.hxx | 3 |
3 files changed, 22 insertions, 5 deletions
diff --git a/cui/inc/strings.hrc b/cui/inc/strings.hrc index 3833d157adff..e6edf6cca478 100644 --- a/cui/inc/strings.hrc +++ b/cui/inc/strings.hrc @@ -256,6 +256,7 @@ #define RID_SVXSTR_CHG_CALC NC_("RID_SVXSTR_CHG_CALC", "Excel to %PRODUCTNAME Calc or reverse") #define RID_SVXSTR_CHG_IMPRESS NC_("RID_SVXSTR_CHG_IMPRESS", "PowerPoint to %PRODUCTNAME Impress or reverse") #define RID_SVXSTR_CHG_SMARTART NC_("RID_SVXSTR_CHG_SMARTART", "SmartArt to %PRODUCTNAME shapes or reverse") +#define RID_SVXSTR_CHG_VISIO NC_("RID_SVXSTR_CHG_VISIO", "Visio to %PRODUCTNAME Draw or reverse") #define RID_SVXSTR_OPT_DOUBLE_DICTS NC_("RID_SVXSTR_OPT_DOUBLE_DICTS", "The specified name already exists.\nPlease enter a new name.") #define RID_SVXSTR_OPT_INVALID_DICT_NAME NC_("RID_SVXSTR_OPT_INVALID_DICT_NAME", "The specified name is invalid.\nPlease enter a new name.") diff --git a/cui/source/options/optfltr.cxx b/cui/source/options/optfltr.cxx index 731cab79d50e..925c0c7981d4 100644 --- a/cui/source/options/optfltr.cxx +++ b/cui/source/options/optfltr.cxx @@ -34,6 +34,7 @@ enum class MSFltrPg2_CheckBoxEntries { Calc, Impress, SmartArt, + Visio, InvalidCBEntry }; @@ -132,6 +133,7 @@ OfaMSFilterTabPage2::OfaMSFilterTabPage2(TabPageParent pParent, const SfxItemSet , sChgToFromCalc(CuiResId(RID_SVXSTR_CHG_CALC)) , sChgToFromImpress(CuiResId(RID_SVXSTR_CHG_IMPRESS)) , sChgToFromSmartArt(CuiResId(RID_SVXSTR_CHG_SMARTART)) + , sChgToFromVisio(CuiResId(RID_SVXSTR_CHG_VISIO)) , m_xCheckLB(m_xBuilder->weld_tree_view("checklbcontainer")) , m_xHighlightingRB(m_xBuilder->weld_radio_button("highlighting")) , m_xShadingRB(m_xBuilder->weld_radio_button("shading")) @@ -183,14 +185,16 @@ bool OfaMSFilterTabPage2::FillItemSet( SfxItemSet* ) &SvtFilterOptions::SetImpress2PowerPoint }, { MSFltrPg2_CheckBoxEntries::SmartArt, &SvtFilterOptions::IsSmartArt2Shape, &SvtFilterOptions::SetSmartArt2Shape }, + { MSFltrPg2_CheckBoxEntries::Visio, &SvtFilterOptions::IsVisio2Draw, + &SvtFilterOptions::SetVisio2Draw }, }; bool bFirstCol = true; for( const ChkCBoxEntries & rEntry : aChkArr ) { // we loop through the list, alternating reading the first/second column, - // each row appears twice in the list (except for smartart, which is import - // only + // each row appears twice in the list (except for smartart and later entries, which are + // import only) sal_uInt16 nCol = bFirstCol ? 0 : 1; bFirstCol = !bFirstCol; int nEntry = GetEntry4Type(rEntry.eType); @@ -200,6 +204,10 @@ bool OfaMSFilterTabPage2::FillItemSet( SfxItemSet* ) if( bCheck != (rOpt.*rEntry.FnIs)() ) (rOpt.*rEntry.FnSet)( bCheck ); } + if (rEntry.eType == MSFltrPg2_CheckBoxEntries::SmartArt) + { + bFirstCol = !bFirstCol; + } } if( m_xHighlightingRB->get_state_changed_from_saved() ) @@ -237,6 +245,8 @@ void OfaMSFilterTabPage2::Reset( const SfxItemSet* ) if ( aModuleOpt.IsModuleInstalled( SvtModuleOptions::EModule::IMPRESS ) ) InsertEntry( sChgToFromImpress, MSFltrPg2_CheckBoxEntries::Impress ); InsertEntry( sChgToFromSmartArt, MSFltrPg2_CheckBoxEntries::SmartArt, false ); + if (aModuleOpt.IsModuleInstalled(SvtModuleOptions::EModule::DRAW)) + InsertEntry(sChgToFromVisio, MSFltrPg2_CheckBoxEntries::Visio, false); static struct ChkCBoxEntries{ MSFltrPg2_CheckBoxEntries eType; @@ -251,14 +261,15 @@ void OfaMSFilterTabPage2::Reset( const SfxItemSet* ) { MSFltrPg2_CheckBoxEntries::Impress, &SvtFilterOptions::IsPowerPoint2Impress }, { MSFltrPg2_CheckBoxEntries::Impress, &SvtFilterOptions::IsImpress2PowerPoint }, { MSFltrPg2_CheckBoxEntries::SmartArt, &SvtFilterOptions::IsSmartArt2Shape }, + { MSFltrPg2_CheckBoxEntries::Visio, &SvtFilterOptions::IsVisio2Draw }, }; bool bFirstCol = true; for( const ChkCBoxEntries & rArr : aChkArr ) { // we loop through the list, alternating reading the first/second column, - // each row appears twice in the list (except for smartart, which is import - // only + // each row appears twice in the list (except for smartart and later entries, which are + // import only) sal_uInt16 nCol = bFirstCol ? 0 : 1; bFirstCol = !bFirstCol; int nEntry = GetEntry4Type( rArr.eType ); @@ -267,6 +278,10 @@ void OfaMSFilterTabPage2::Reset( const SfxItemSet* ) bool bCheck = (rOpt.*rArr.FnIs)(); m_xCheckLB->set_toggle(nEntry, bCheck ? TRISTATE_TRUE : TRISTATE_FALSE, nCol); } + if (rArr.eType == MSFltrPg2_CheckBoxEntries::SmartArt) + { + bFirstCol = !bFirstCol; + } } m_xCheckLB->thaw(); diff --git a/cui/source/options/optfltr.hxx b/cui/source/options/optfltr.hxx index 2076a7fd13b9..0495b8c49514 100644 --- a/cui/source/options/optfltr.hxx +++ b/cui/source/options/optfltr.hxx @@ -55,7 +55,8 @@ class OfaMSFilterTabPage2 : public SfxTabPage sChgToFromWriter, sChgToFromCalc, sChgToFromImpress, - sChgToFromSmartArt; + sChgToFromSmartArt, + sChgToFromVisio; std::unique_ptr<weld::TreeView> m_xCheckLB; std::unique_ptr<weld::RadioButton> m_xHighlightingRB; |