summaryrefslogtreecommitdiffstats
path: root/oox/source/core/fragmenthandler2.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'oox/source/core/fragmenthandler2.cxx')
-rw-r--r--oox/source/core/fragmenthandler2.cxx15
1 files changed, 14 insertions, 1 deletions
diff --git a/oox/source/core/fragmenthandler2.cxx b/oox/source/core/fragmenthandler2.cxx
index 2d3f239966e0..79b58ce70f0e 100644
--- a/oox/source/core/fragmenthandler2.cxx
+++ b/oox/source/core/fragmenthandler2.cxx
@@ -26,6 +26,7 @@
namespace oox {
namespace core {
+using namespace ::com::sun::star;
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::xml::sax;
@@ -72,14 +73,26 @@ bool FragmentHandler2::prepareMceContext( sal_Int32 nElement, const AttributeLis
// is long gone. For now let's decide depending on a list of supported
// namespaces like we do in writerfilter
- static std::vector<OUString> aSupportedNS =
+ std::vector<OUString> aSupportedNS =
{
+ "a14", // Impress needs this to import math formulas.
"p14",
"p15",
"x12ac",
"v",
};
+ uno::Reference<lang::XServiceInfo> xModel(getFilter().getModel(), uno::UNO_QUERY);
+ if (xModel.is() && xModel->supportsService("com.sun.star.sheet.SpreadsheetDocument"))
+ {
+ // No a14 for Calc documents, it would cause duplicated shapes as-is.
+ auto it = std::find(aSupportedNS.begin(), aSupportedNS.end(), "a14");
+ if (it != aSupportedNS.end())
+ {
+ aSupportedNS.erase(it);
+ }
+ }
+
if (std::find(aSupportedNS.begin(), aSupportedNS.end(), aRequires) != aSupportedNS.end())
aMceState.back() = MCE_STATE::FoundChoice;
else