summaryrefslogtreecommitdiff
path: root/cui
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.com>2019-08-15 15:47:42 +0200
committerMiklos Vajna <vmiklos@collabora.com>2019-08-15 16:45:23 +0200
commitbdfa6b678bc0cc22f983a0c23187a8ba9d2e6730 (patch)
treea0bc4fa9969178014dd5f266fa53be1cfe6a1ca1 /cui
parent0a66deda5d37907068331efe4d611f73fc46ff91 (diff)
embeddedobj: allow controlling if PDF documents are converted to Draw or not
This is a bit custom, since it's not a Microsoft filter. At the moment this affects only Insert -> Object -> OLE Object -> from file. Change-Id: If79602742a533db1b04e11a90890f8768186046d Reviewed-on: https://gerrit.libreoffice.org/77520 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
Diffstat (limited to 'cui')
-rw-r--r--cui/inc/strings.hrc1
-rw-r--r--cui/source/options/optfltr.cxx26
-rw-r--r--cui/source/options/optfltr.hxx3
3 files changed, 28 insertions, 2 deletions
diff --git a/cui/inc/strings.hrc b/cui/inc/strings.hrc
index e6edf6cca478..9b70cbf55301 100644
--- a/cui/inc/strings.hrc
+++ b/cui/inc/strings.hrc
@@ -257,6 +257,7 @@
#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_CHG_PDF NC_("RID_SVXSTR_CHG_PDF", "PDF 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 925c0c7981d4..85abc803b07e 100644
--- a/cui/source/options/optfltr.cxx
+++ b/cui/source/options/optfltr.cxx
@@ -35,6 +35,7 @@ enum class MSFltrPg2_CheckBoxEntries {
Impress,
SmartArt,
Visio,
+ PDF,
InvalidCBEntry
};
@@ -134,6 +135,7 @@ OfaMSFilterTabPage2::OfaMSFilterTabPage2(TabPageParent pParent, const SfxItemSet
, sChgToFromImpress(CuiResId(RID_SVXSTR_CHG_IMPRESS))
, sChgToFromSmartArt(CuiResId(RID_SVXSTR_CHG_SMARTART))
, sChgToFromVisio(CuiResId(RID_SVXSTR_CHG_VISIO))
+ , sChgToFromPDF(CuiResId(RID_SVXSTR_CHG_PDF))
, m_xCheckLB(m_xBuilder->weld_tree_view("checklbcontainer"))
, m_xHighlightingRB(m_xBuilder->weld_radio_button("highlighting"))
, m_xShadingRB(m_xBuilder->weld_radio_button("shading"))
@@ -209,6 +211,15 @@ bool OfaMSFilterTabPage2::FillItemSet( SfxItemSet* )
bFirstCol = !bFirstCol;
}
}
+ int nPDFEntry = GetEntry4Type(MSFltrPg2_CheckBoxEntries::PDF);
+ bool bPDFCheck = m_xCheckLB->get_toggle(nPDFEntry, 0);
+ if (bPDFCheck != officecfg::Office::Common::Filter::Adobe::Import::PDFToDraw::get())
+ {
+ std::shared_ptr<comphelper::ConfigurationChanges> pBatch(
+ comphelper::ConfigurationChanges::create());
+ officecfg::Office::Common::Filter::Adobe::Import::PDFToDraw::set(bPDFCheck, pBatch);
+ pBatch->commit();
+ }
if( m_xHighlightingRB->get_state_changed_from_saved() )
{
@@ -246,7 +257,10 @@ void OfaMSFilterTabPage2::Reset( const SfxItemSet* )
InsertEntry( sChgToFromImpress, MSFltrPg2_CheckBoxEntries::Impress );
InsertEntry( sChgToFromSmartArt, MSFltrPg2_CheckBoxEntries::SmartArt, false );
if (aModuleOpt.IsModuleInstalled(SvtModuleOptions::EModule::DRAW))
+ {
InsertEntry(sChgToFromVisio, MSFltrPg2_CheckBoxEntries::Visio, false);
+ InsertEntry(sChgToFromPDF, MSFltrPg2_CheckBoxEntries::PDF, false);
+ }
static struct ChkCBoxEntries{
MSFltrPg2_CheckBoxEntries eType;
@@ -262,6 +276,7 @@ void OfaMSFilterTabPage2::Reset( const SfxItemSet* )
{ MSFltrPg2_CheckBoxEntries::Impress, &SvtFilterOptions::IsImpress2PowerPoint },
{ MSFltrPg2_CheckBoxEntries::SmartArt, &SvtFilterOptions::IsSmartArt2Shape },
{ MSFltrPg2_CheckBoxEntries::Visio, &SvtFilterOptions::IsVisio2Draw },
+ { MSFltrPg2_CheckBoxEntries::PDF, nullptr },
};
bool bFirstCol = true;
@@ -275,7 +290,16 @@ void OfaMSFilterTabPage2::Reset( const SfxItemSet* )
int nEntry = GetEntry4Type( rArr.eType );
if (nEntry != -1)
{
- bool bCheck = (rOpt.*rArr.FnIs)();
+ bool bCheck = false;
+ if (rArr.eType != MSFltrPg2_CheckBoxEntries::PDF)
+ {
+ bCheck = (rOpt.*rArr.FnIs)();
+ }
+ else
+ {
+ bCheck = officecfg::Office::Common::Filter::Adobe::Import::PDFToDraw::get();
+ nCol = 0;
+ }
m_xCheckLB->set_toggle(nEntry, bCheck ? TRISTATE_TRUE : TRISTATE_FALSE, nCol);
}
if (rArr.eType == MSFltrPg2_CheckBoxEntries::SmartArt)
diff --git a/cui/source/options/optfltr.hxx b/cui/source/options/optfltr.hxx
index 0495b8c49514..db954aa4684b 100644
--- a/cui/source/options/optfltr.hxx
+++ b/cui/source/options/optfltr.hxx
@@ -56,7 +56,8 @@ class OfaMSFilterTabPage2 : public SfxTabPage
sChgToFromCalc,
sChgToFromImpress,
sChgToFromSmartArt,
- sChgToFromVisio;
+ sChgToFromVisio,
+ sChgToFromPDF;
std::unique_ptr<weld::TreeView> m_xCheckLB;
std::unique_ptr<weld::RadioButton> m_xHighlightingRB;