summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
Diffstat (limited to 'sc')
-rw-r--r--sc/inc/document.hxx22
-rw-r--r--sc/inc/unonames.hxx6
-rw-r--r--sc/qa/unit/ucalc.cxx6
-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
7 files changed, 83 insertions, 23 deletions
diff --git a/sc/inc/document.hxx b/sc/inc/document.hxx
index 07e16a8388de..f2ee35bc693a 100644
--- a/sc/inc/document.hxx
+++ b/sc/inc/document.hxx
@@ -523,7 +523,12 @@ private:
std::set<ScFormulaCell*> maSubTotalCells;
- bool mbUseEmbedFonts;
+
+ bool mbEmbedFonts : 1;
+ bool mbEmbedUsedFontsOnly : 1;
+ bool mbEmbedFontScriptLatin : 1;
+ bool mbEmbedFontScriptAsian : 1;
+ bool mbEmbedFontScriptComplex : 1;
std::unique_ptr<sc::IconSetBitmapMap> m_pIconSetBitmapMap;
@@ -535,8 +540,19 @@ private:
public:
bool IsCellInChangeTrack(const ScAddress &cell,Color *pColCellBorder);
void GetCellChangeTrackNote(const ScAddress &cell, OUString &strTrackText, bool &pbLeftEdge);
- bool IsUsingEmbededFonts() { return mbUseEmbedFonts; }
- void SetIsUsingEmbededFonts( bool bUse ) { mbUseEmbedFonts = bUse; }
+
+ bool IsEmbedFonts() { return mbEmbedFonts; }
+ bool IsEmbedUsedFontsOnly() { return mbEmbedUsedFontsOnly; }
+ bool IsEmbedFontScriptLatin() { return mbEmbedFontScriptLatin; }
+ bool IsEmbedFontScriptAsian() { return mbEmbedFontScriptAsian; }
+ bool IsEmbedFontScriptComplex() { return mbEmbedFontScriptComplex; }
+
+ void SetEmbedFonts(bool bUse) { mbEmbedFonts = bUse; }
+ void SetEmbedUsedFontsOnly(bool bUse) { mbEmbedUsedFontsOnly = bUse; }
+ void SetEmbedFontScriptLatin(bool bUse) { mbEmbedFontScriptLatin = bUse; }
+ void SetEmbedFontScriptAsian(bool bUse) { mbEmbedFontScriptAsian = bUse; }
+ void SetEmbedFontScriptComplex(bool bUse) { mbEmbedFontScriptComplex = bUse; }
+
SC_DLLPUBLIC sal_uLong GetCellCount() const; // all cells
SC_DLLPUBLIC sal_uLong GetFormulaGroupCount() const; // all cells
sal_uLong GetCodeCount() const; // RPN-Code in formulas
diff --git a/sc/inc/unonames.hxx b/sc/inc/unonames.hxx
index 07d2864ed4fd..d90c4a510a3a 100644
--- a/sc/inc/unonames.hxx
+++ b/sc/inc/unonames.hxx
@@ -691,7 +691,11 @@
// Named ranges
#define SC_UNO_MODIFY_BROADCAST "ModifyAndBroadcast"
-#define SC_UNO_EMBED_FONTS "EmbedFonts"
+#define SC_UNO_EMBED_FONTS "EmbedFonts"
+#define SC_UNO_EMBED_ONLY_USED_FONTS "EmbedOnlyUsedFonts"
+#define SC_UNO_EMBED_FONT_SCRIPT_LATIN "EmbedLatinScriptFonts"
+#define SC_UNO_EMBED_FONT_SCRIPT_ASIAN "EmbedAsianScriptFonts"
+#define SC_UNO_EMBED_FONT_SCRIPT_COMPLEX "EmbedComplexScriptFonts"
#define SC_UNO_ODS_LOCK_SOLAR_MUTEX "ODSLockSolarMutex"
#define SC_UNO_ODS_IMPORT_STYLES "ODSImportStyles"
diff --git a/sc/qa/unit/ucalc.cxx b/sc/qa/unit/ucalc.cxx
index 6db74263c27b..826f846279f2 100644
--- a/sc/qa/unit/ucalc.cxx
+++ b/sc/qa/unit/ucalc.cxx
@@ -6521,7 +6521,11 @@ void Test::testEmptyCalcDocDefaults()
CPPUNIT_ASSERT_EQUAL( false, m_pDoc->HasNotes() );
CPPUNIT_ASSERT_EQUAL( false, m_pDoc->IsCutMode() );
- CPPUNIT_ASSERT_EQUAL( false, m_pDoc->IsUsingEmbededFonts() );
+ CPPUNIT_ASSERT_EQUAL( false, m_pDoc->IsEmbedFonts() );
+ CPPUNIT_ASSERT_EQUAL( false, m_pDoc->IsEmbedUsedFontsOnly() );
+ CPPUNIT_ASSERT_EQUAL( true, m_pDoc->IsEmbedFontScriptLatin() );
+ CPPUNIT_ASSERT_EQUAL( true, m_pDoc->IsEmbedFontScriptAsian() );
+ CPPUNIT_ASSERT_EQUAL( true, m_pDoc->IsEmbedFontScriptComplex() );
CPPUNIT_ASSERT_EQUAL( false, m_pDoc->IsEmbedded() );
CPPUNIT_ASSERT_EQUAL( true, m_pDoc->IsDocEditable() );
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();