summaryrefslogtreecommitdiff
path: root/sc/source
diff options
context:
space:
mode:
Diffstat (limited to 'sc/source')
-rw-r--r--sc/source/core/data/documen2.cxx6
-rw-r--r--sc/source/filter/xml/xmlfonte.cxx13
-rw-r--r--sc/source/filter/xml/xmlimprt.cxx4
-rw-r--r--sc/source/ui/unoobj/confuno.cxx49
4 files changed, 54 insertions, 18 deletions
diff --git a/sc/source/core/data/documen2.cxx b/sc/source/core/data/documen2.cxx
index 81ce2170d02d..b39d0866be24 100644
--- a/sc/source/core/data/documen2.cxx
+++ b/sc/source/core/data/documen2.cxx
@@ -221,7 +221,11 @@ ScDocument::ScDocument( ScDocumentMode eMode, SfxObjectShell* pDocShell ) :
mbStreamValidLocked( false ),
mbUserInteractionEnabled(true),
mnNamedRangesLockCount(0),
- mbUseEmbedFonts(false),
+ mbEmbedFonts(false),
+ mbEmbedUsedFontsOnly(false),
+ mbEmbedFontScriptLatin(true),
+ mbEmbedFontScriptAsian(true),
+ mbEmbedFontScriptComplex(true),
mbTrackFormulasPending(false),
mbFinalTrackFormulas(false),
mnMutationGuardFlags(0)
diff --git a/sc/source/filter/xml/xmlfonte.cxx b/sc/source/filter/xml/xmlfonte.cxx
index b8446e40606c..b4c7e7a8808c 100644
--- a/sc/source/filter/xml/xmlfonte.cxx
+++ b/sc/source/filter/xml/xmlfonte.cxx
@@ -39,7 +39,7 @@ private:
void AddFontItems(const sal_uInt16* pWhichIds, sal_uInt8 nIdCount, const SfxItemPool* pItemPool, const bool bExportDefaults);
public:
- ScXMLFontAutoStylePool_Impl( ScXMLExport& rExport, bool bBlockFontEmbedding );
+ ScXMLFontAutoStylePool_Impl( ScXMLExport& rExport, bool bEmbedFonts);
virtual ~ScXMLFontAutoStylePool_Impl() override;
};
@@ -70,8 +70,8 @@ void ScXMLFontAutoStylePool_Impl::AddFontItems(const sal_uInt16* pWhichIds, sal_
}
}
-ScXMLFontAutoStylePool_Impl::ScXMLFontAutoStylePool_Impl(ScXMLExport& rExportP, bool bBlockFontEmbedding)
- : XMLFontAutoStylePool(rExportP, bBlockFontEmbedding)
+ScXMLFontAutoStylePool_Impl::ScXMLFontAutoStylePool_Impl(ScXMLExport& rExportP, bool bEmbedFonts)
+ : XMLFontAutoStylePool(rExportP, bEmbedFonts)
, mpEditEnginePool(nullptr)
{
sal_uInt16 const aWhichIds[] { ATTR_FONT, ATTR_CJK_FONT,
@@ -88,6 +88,11 @@ ScXMLFontAutoStylePool_Impl::ScXMLFontAutoStylePool_Impl(ScXMLExport& rExportP,
std::shared_ptr<SfxStyleSheetIterator> pItr = rExportP.GetDocument()->GetStyleSheetPool()->CreateIterator(SfxStyleFamily::Page, SfxStyleSearchBits::All);
+ m_bEmbedUsedOnly = rExportP.GetDocument()->IsEmbedUsedFontsOnly();
+ m_bEmbedLatinScript = rExportP.GetDocument()->IsEmbedFontScriptLatin();
+ m_bEmbedAsianScript = rExportP.GetDocument()->IsEmbedFontScriptAsian();
+ m_bEmbedComplexScript = rExportP.GetDocument()->IsEmbedFontScriptComplex();
+
if(pItr)
{
SfxStyleSheetBase* pStyle(pItr->First());
@@ -157,7 +162,7 @@ XMLFontAutoStylePool* ScXMLExport::CreateFontAutoStylePool()
// the embedding only in one of them.
if(!( getExportFlags() & SvXMLExportFlags::CONTENT ))
blockFontEmbedding = true;
- if( !GetDocument()->IsUsingEmbededFonts())
+ if (!GetDocument()->IsEmbedFonts())
blockFontEmbedding = true;
return new ScXMLFontAutoStylePool_Impl( *this, !blockFontEmbedding );
}
diff --git a/sc/source/filter/xml/xmlimprt.cxx b/sc/source/filter/xml/xmlimprt.cxx
index 36f3c3f8baa9..20ba58d3c216 100644
--- a/sc/source/filter/xml/xmlimprt.cxx
+++ b/sc/source/filter/xml/xmlimprt.cxx
@@ -2012,8 +2012,8 @@ const ScXMLEditAttributeMap& ScXMLImport::GetEditAttributeMap() const
void ScXMLImport::NotifyEmbeddedFontRead()
{
- if ( pDoc )
- pDoc->SetIsUsingEmbededFonts( true );
+ if (pDoc)
+ pDoc->SetEmbedFonts(true);
}
ScMyImpDetectiveOpArray* ScXMLImport::GetDetectiveOpArray()
diff --git a/sc/source/ui/unoobj/confuno.cxx b/sc/source/ui/unoobj/confuno.cxx
index 9e3ae551e22c..a7d6599aef6c 100644
--- a/sc/source/ui/unoobj/confuno.cxx
+++ b/sc/source/ui/unoobj/confuno.cxx
@@ -84,7 +84,11 @@ static const SfxItemPropertyMapEntry* lcl_GetConfigPropertyMap()
{OUString(SC_UNO_LOADREADONLY), 0, cppu::UnoType<bool>::get(), 0, 0},
{OUString(SC_UNO_SHAREDOC), 0, cppu::UnoType<bool>::get(), 0, 0},
{OUString(SC_UNO_MODIFYPASSWORDINFO), 0, cppu::UnoType<uno::Sequence< beans::PropertyValue >>::get(), 0, 0},
- {OUString(SC_UNO_EMBED_FONTS), 0, cppu::UnoType<bool>::get(), 0, 0},
+ {OUString(SC_UNO_EMBED_FONTS), 0, cppu::UnoType<bool>::get(), 0, 0},
+ {OUString(SC_UNO_EMBED_ONLY_USED_FONTS), 0, cppu::UnoType<bool>::get(), 0, 0},
+ {OUString(SC_UNO_EMBED_FONT_SCRIPT_LATIN), 0, cppu::UnoType<bool>::get(), 0, 0},
+ {OUString(SC_UNO_EMBED_FONT_SCRIPT_ASIAN), 0, cppu::UnoType<bool>::get(), 0, 0},
+ {OUString(SC_UNO_EMBED_FONT_SCRIPT_COMPLEX), 0, cppu::UnoType<bool>::get(), 0, 0},
{OUString(SC_UNO_SYNTAXSTRINGREF), 0, cppu::UnoType<sal_Int16>::get(), 0, 0},
{ OUString(), 0, css::uno::Type(), 0, 0 }
};
@@ -337,13 +341,30 @@ void SAL_CALL ScDocumentConfiguration::setPropertyValue(
throw beans::PropertyVetoException(
"The hash is not allowed to be changed now!" );
}
- else if ( aPropertyName == SC_UNO_EMBED_FONTS )
+ else if (aPropertyName == SC_UNO_EMBED_FONTS)
{
- bool bVal = false;
- if ( aValue >>=bVal )
- {
- rDoc.SetIsUsingEmbededFonts(bVal);
- }
+ bool bVal = aValue.has<bool>() && aValue.get<bool>();
+ rDoc.SetEmbedFonts(bVal);
+ }
+ else if (aPropertyName == SC_UNO_EMBED_ONLY_USED_FONTS)
+ {
+ bool bVal = aValue.has<bool>() && aValue.get<bool>();
+ rDoc.SetEmbedUsedFontsOnly(bVal);
+ }
+ else if (aPropertyName == SC_UNO_EMBED_FONT_SCRIPT_LATIN)
+ {
+ bool bVal = aValue.has<bool>() && aValue.get<bool>();
+ rDoc.SetEmbedFontScriptLatin(bVal);
+ }
+ else if (aPropertyName == SC_UNO_EMBED_FONT_SCRIPT_ASIAN)
+ {
+ bool bVal = aValue.has<bool>() && aValue.get<bool>();
+ rDoc.SetEmbedFontScriptAsian(bVal);
+ }
+ else if (aPropertyName == SC_UNO_EMBED_FONT_SCRIPT_COMPLEX)
+ {
+ bool bVal = aValue.has<bool>() && aValue.get<bool>();
+ rDoc.SetEmbedFontScriptComplex(bVal);
}
else if ( aPropertyName == SC_UNO_SYNTAXSTRINGREF )
{
@@ -524,10 +545,16 @@ uno::Any SAL_CALL ScDocumentConfiguration::getPropertyValue( const OUString& aPr
}
else if ( aPropertyName == SC_UNO_MODIFYPASSWORDINFO )
aRet <<= pDocShell->GetModifyPasswordInfo();
- else if ( aPropertyName == SC_UNO_EMBED_FONTS )
- {
- aRet <<= rDoc.IsUsingEmbededFonts();
- }
+ else if (aPropertyName == SC_UNO_EMBED_FONTS)
+ aRet <<= rDoc.IsEmbedFonts();
+ else if (aPropertyName == SC_UNO_EMBED_ONLY_USED_FONTS)
+ aRet <<= rDoc.IsEmbedUsedFontsOnly();
+ else if (aPropertyName == SC_UNO_EMBED_FONT_SCRIPT_LATIN)
+ aRet <<= rDoc.IsEmbedFontScriptLatin();
+ else if (aPropertyName == SC_UNO_EMBED_FONT_SCRIPT_ASIAN)
+ aRet <<= rDoc.IsEmbedFontScriptAsian();
+ else if (aPropertyName == SC_UNO_EMBED_FONT_SCRIPT_COMPLEX)
+ aRet <<= rDoc.IsEmbedFontScriptComplex();
else if ( aPropertyName == SC_UNO_SYNTAXSTRINGREF )
{
ScCalcConfig aCalcConfig = rDoc.GetCalcConfig();