diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 09:06:44 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 09:06:44 +0000 |
commit | ed5640d8b587fbcfed7dd7967f3de04b37a76f26 (patch) | |
tree | 7a5f7c6c9d02226d7471cb3cc8fbbf631b415303 /embedserv/source/embed/guid.cxx | |
parent | Initial commit. (diff) | |
download | libreoffice-cb75148ebd0135178ff46f89a30139c44f8d2040.tar.xz libreoffice-cb75148ebd0135178ff46f89a30139c44f8d2040.zip |
Adding upstream version 4:7.4.7.upstream/4%7.4.7upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'embedserv/source/embed/guid.cxx')
-rw-r--r-- | embedserv/source/embed/guid.cxx | 131 |
1 files changed, 131 insertions, 0 deletions
diff --git a/embedserv/source/embed/guid.cxx b/embedserv/source/embed/guid.cxx new file mode 100644 index 000000000..5b284a8a9 --- /dev/null +++ b/embedserv/source/embed/guid.cxx @@ -0,0 +1,131 @@ +/* -*- 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/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#include <common.h> +#include <com/sun/star/lang/XMultiServiceFactory.hpp> +#include <com/sun/star/container/XNameAccess.hpp> + +#include "guid.hxx" + +wchar_t const * getStorageTypeFromGUID_Impl( GUID const * guid ) +{ + if ( *guid == OID_WriterTextServer ) + return L"soffice.StarWriterDocument.6"; + + if ( *guid == OID_WriterOASISTextServer ) + return L"LibreOffice.WriterDocument.1"; + + if ( *guid == OID_CalcServer ) + return L"soffice.StarCalcDocument.6"; + + if ( *guid == OID_CalcOASISServer ) + return L"LibreOffice.CalcDocument.1"; + + if ( *guid == OID_DrawingServer ) + return L"soffice.StarDrawDocument.6"; + + if ( *guid == OID_DrawingOASISServer ) + return L"LibreOffice.DrawDocument.1"; + + if ( *guid == OID_PresentationServer ) + return L"soffice.StarImpressDocument.6"; + + if ( *guid == OID_PresentationOASISServer ) + return L"LibreOffice.ImpressDocument.1"; + + if ( *guid == OID_MathServer ) + return L"soffice.StarMathDocument.6"; + + if ( *guid == OID_MathOASISServer ) + return L"LibreOffice.MathDocument.1"; + + return L""; +} + +std::u16string_view getServiceNameFromGUID_Impl( GUID const * guid ) +{ + if ( *guid == OID_WriterTextServer ) + return u"com.sun.star.comp.Writer.TextDocument"; + + if ( *guid == OID_WriterOASISTextServer ) + return u"com.sun.star.comp.Writer.TextDocument"; + + if ( *guid == OID_CalcServer ) + return u"com.sun.star.comp.Calc.SpreadsheetDocument"; + + if ( *guid == OID_CalcOASISServer ) + return u"com.sun.star.comp.Calc.SpreadsheetDocument"; + + if ( *guid == OID_DrawingServer ) + return u"com.sun.star.comp.Draw.DrawingDocument"; + + if ( *guid == OID_DrawingOASISServer ) + return u"com.sun.star.comp.Draw.DrawingDocument"; + + if ( *guid == OID_PresentationServer ) + return u"com.sun.star.comp.Draw.PresentationDocument"; + + if ( *guid == OID_PresentationOASISServer ) + return u"com.sun.star.comp.Draw.PresentationDocument"; + + if ( *guid == OID_MathServer ) + return u"com.sun.star.comp.Math.FormulaDocument"; + + if ( *guid == OID_MathOASISServer ) + return u"com.sun.star.comp.Math.FormulaDocument"; + + return u""; +} + +OUString getFilterNameFromGUID_Impl( GUID const * guid ) +{ + if ( *guid == OID_WriterTextServer ) + return "StarOffice XML (Writer)"; + + if ( *guid == OID_WriterOASISTextServer ) + return "writer8"; + + if ( *guid == OID_CalcServer ) + return "StarOffice XML (Calc)"; + + if ( *guid == OID_CalcOASISServer ) + return "calc8"; + + if ( *guid == OID_DrawingServer ) + return "StarOffice XML (Draw)"; + + if ( *guid == OID_DrawingOASISServer ) + return "draw8"; + + if ( *guid == OID_PresentationServer ) + return "StarOffice XML (Impress)"; + + if ( *guid == OID_PresentationOASISServer ) + return "impress8"; + + if ( *guid == OID_MathServer ) + return "StarOffice XML (Math)"; + + if ( *guid == OID_MathOASISServer ) + return "math8"; + + return OUString(); +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |