summaryrefslogtreecommitdiffstats
path: root/include/xmloff
diff options
context:
space:
mode:
authorTomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>2018-07-09 00:47:07 +0200
committerTomaž Vajngerl <quikee@gmail.com>2018-07-10 16:15:12 +0200
commit3bc3ddc11fd94877d9c5d2b8313ab53150818236 (patch)
tree02d505a21705c00f454144b4f8654d46d3b13f73 /include/xmloff
parent[API CHANGE] tdf#65353 Add more doc. settings more embedding fonts (diff)
downloadcore-3bc3ddc11fd94877d9c5d2b8313ab53150818236.tar.gz
core-3bc3ddc11fd94877d9c5d2b8313ab53150818236.zip
tdf#65353 filter fonts when embedding (unused, font script)
When embedding, the fonts are gathered and added to the ODF document. This change in addition adds the functionallity to embed used fonts only and filtering out of font scripts. When embedding used fonts only, they are filtered depending on if the style (referencing the font) is in use and in addition if the font is used in direct formatting. Change-Id: I1ba0066b1eb34bdde7247eeb63c1be5a91db984d Reviewed-on: https://gerrit.libreoffice.org/57168 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Diffstat (limited to 'include/xmloff')
-rw-r--r--include/xmloff/AutoStyleEntry.hxx32
-rw-r--r--include/xmloff/XMLFontAutoStylePool.hxx4
-rw-r--r--include/xmloff/txtparae.hxx2
-rw-r--r--include/xmloff/xmlaustp.hxx3
4 files changed, 40 insertions, 1 deletions
diff --git a/include/xmloff/AutoStyleEntry.hxx b/include/xmloff/AutoStyleEntry.hxx
new file mode 100644
index 000000000000..c313aac15313
--- /dev/null
+++ b/include/xmloff/AutoStyleEntry.hxx
@@ -0,0 +1,32 @@
+/* -*- 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/.
+ *
+ */
+
+#ifndef INCLUDED_XMLOFF_AUTOSTYLEENTRY_HXX
+#define INCLUDED_XMLOFF_AUTOSTYLEENTRY_HXX
+
+#include <sal/config.h>
+#include <xmloff/dllapi.h>
+#include <memory>
+
+namespace xmloff
+{
+struct XMLOFF_DLLPUBLIC AutoStyleEntry
+{
+ sal_Int32 m_nFamily;
+ OUString m_aParentName;
+ OUString m_aName;
+ std::vector<std::pair<OUString, css::uno::Any>> m_aXmlProperties;
+};
+
+} // end xmloff
+
+#endif // INCLUDED_XMLOFF_AUTOSTYLEENTRY_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/xmloff/XMLFontAutoStylePool.hxx b/include/xmloff/XMLFontAutoStylePool.hxx
index 3380fc96d532..2354bcf8ce7d 100644
--- a/include/xmloff/XMLFontAutoStylePool.hxx
+++ b/include/xmloff/XMLFontAutoStylePool.hxx
@@ -26,6 +26,7 @@
#include <tools/fontenum.hxx>
#include <salhelper/simplereferenceobject.hxx>
#include <set>
+#include <unordered_set>
#include <unordered_map>
#include <memory>
@@ -44,6 +45,8 @@ private:
OUString embedFontFile(OUString const & rFileUrl, OUString const & rFamilyName);
+ std::unordered_set<OUString> getUsedFontList();
+
protected:
bool m_bEmbedUsedOnly;
bool m_bEmbedLatinScript;
@@ -53,7 +56,6 @@ protected:
SvXMLExport& GetExport() { return rExport; }
public:
-
XMLFontAutoStylePool( SvXMLExport& rExport, bool tryToEmbedFonts = false );
virtual ~XMLFontAutoStylePool() override;
diff --git a/include/xmloff/txtparae.hxx b/include/xmloff/txtparae.hxx
index d06a335f1f83..7bf35536156f 100644
--- a/include/xmloff/txtparae.hxx
+++ b/include/xmloff/txtparae.hxx
@@ -111,6 +111,8 @@ class XMLOFF_DLLPUBLIC XMLTextParagraphExport : public XMLStyleExport
XMLTextListsHelper* mpTextListsHelper;
::std::vector< std::unique_ptr<XMLTextListsHelper> > maTextListsHelperStack;
+ bool mbCollected;
+
enum class FrameType { Text, Graphic, Embedded, Shape };
public:
diff --git a/include/xmloff/xmlaustp.hxx b/include/xmloff/xmlaustp.hxx
index 7b270ce09724..1d708ad12806 100644
--- a/include/xmloff/xmlaustp.hxx
+++ b/include/xmloff/xmlaustp.hxx
@@ -24,6 +24,7 @@
#include <xmloff/dllapi.h>
#include <com/sun/star/xml/sax/XDocumentHandler.hpp>
#include <xmloff/xmlprmap.hxx>
+#include <xmloff/AutoStyleEntry.hxx>
#include <salhelper/simplereferenceobject.hxx>
#include <memory>
@@ -116,6 +117,8 @@ public:
void exportXML( sal_Int32 nFamily ) const;
void ClearEntries();
+
+ std::vector<xmloff::AutoStyleEntry> GetAutoStyleEntries() const;
};
#endif // INCLUDED_XMLOFF_XMLAUSTP_HXX