2010-10-12 15:57:08 +02:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
2012-07-11 19:49:09 +01:00
|
|
|
/*
|
|
|
|
* 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 .
|
|
|
|
*/
|
2006-09-25 12:30:32 +00:00
|
|
|
#if defined(_MSC_VER) && (_MSC_VER > 1310)
|
|
|
|
#pragma warning(disable : 4917 4555)
|
|
|
|
#endif
|
2003-03-05 14:50:11 +00:00
|
|
|
|
|
|
|
#include "common.h"
|
|
|
|
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
|
|
|
|
#include <com/sun/star/container/XNameAccess.hpp>
|
|
|
|
|
2003-04-02 14:44:52 +00:00
|
|
|
::rtl::OUString getStorageTypeFromGUID_Impl( GUID* guid )
|
|
|
|
{
|
|
|
|
if ( *guid == OID_WriterTextServer )
|
|
|
|
return ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( "soffice.StarWriterDocument.6" ) );
|
|
|
|
|
2005-01-18 14:12:32 +00:00
|
|
|
if ( *guid == OID_WriterOASISTextServer )
|
2012-05-31 18:13:22 +02:00
|
|
|
return ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( "LibreOffice.WriterDocument.1" ) );
|
2005-01-18 14:12:32 +00:00
|
|
|
|
2003-04-02 14:44:52 +00:00
|
|
|
if ( *guid == OID_CalcServer )
|
|
|
|
return ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( "soffice.StarCalcDocument.6" ) );
|
|
|
|
|
2005-01-18 14:12:32 +00:00
|
|
|
if ( *guid == OID_CalcOASISServer )
|
2012-05-31 18:13:22 +02:00
|
|
|
return ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( "LibreOffice.CalcDocument.1" ) );
|
2005-01-18 14:12:32 +00:00
|
|
|
|
2003-04-02 14:44:52 +00:00
|
|
|
if ( *guid == OID_DrawingServer )
|
|
|
|
return ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( "soffice.StarDrawDocument.6" ) );
|
|
|
|
|
2005-01-18 14:12:32 +00:00
|
|
|
if ( *guid == OID_DrawingOASISServer )
|
2012-05-31 18:13:22 +02:00
|
|
|
return ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( "LibreOffice.DrawDocument.1" ) );
|
2005-01-18 14:12:32 +00:00
|
|
|
|
2003-04-02 14:44:52 +00:00
|
|
|
if ( *guid == OID_PresentationServer )
|
|
|
|
return ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( "soffice.StarImpressDocument.6" ) );
|
|
|
|
|
2005-01-18 14:12:32 +00:00
|
|
|
if ( *guid == OID_PresentationOASISServer )
|
2012-05-31 18:13:22 +02:00
|
|
|
return ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( "LibreOffice.ImpressDocument.1" ) );
|
2005-01-18 14:12:32 +00:00
|
|
|
|
2003-04-02 14:44:52 +00:00
|
|
|
if ( *guid == OID_MathServer )
|
|
|
|
return ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( "soffice.StarMathDocument.6" ) );
|
|
|
|
|
2005-01-18 14:12:32 +00:00
|
|
|
if ( *guid == OID_MathOASISServer )
|
2012-05-31 18:13:22 +02:00
|
|
|
return ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( "LibreOffice.MathDocument.1" ) );
|
2005-01-18 14:12:32 +00:00
|
|
|
|
2003-04-02 14:44:52 +00:00
|
|
|
return ::rtl::OUString();
|
|
|
|
}
|
2003-03-05 14:50:11 +00:00
|
|
|
|
|
|
|
::rtl::OUString getServiceNameFromGUID_Impl( GUID* guid )
|
|
|
|
{
|
|
|
|
if ( *guid == OID_WriterTextServer )
|
|
|
|
return ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( "com.sun.star.comp.Writer.TextDocument" ) );
|
|
|
|
|
2005-01-18 14:12:32 +00:00
|
|
|
if ( *guid == OID_WriterOASISTextServer )
|
|
|
|
return ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( "com.sun.star.comp.Writer.TextDocument" ) );
|
|
|
|
|
2003-03-05 14:50:11 +00:00
|
|
|
if ( *guid == OID_CalcServer )
|
|
|
|
return ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( "com.sun.star.comp.Calc.SpreadsheetDocument" ) );
|
|
|
|
|
2005-01-18 14:12:32 +00:00
|
|
|
if ( *guid == OID_CalcOASISServer )
|
|
|
|
return ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( "com.sun.star.comp.Calc.SpreadsheetDocument" ) );
|
|
|
|
|
2003-03-05 14:50:11 +00:00
|
|
|
if ( *guid == OID_DrawingServer )
|
|
|
|
return ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( "com.sun.star.comp.Draw.DrawingDocument" ) );
|
|
|
|
|
2005-01-18 14:12:32 +00:00
|
|
|
if ( *guid == OID_DrawingOASISServer )
|
|
|
|
return ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( "com.sun.star.comp.Draw.DrawingDocument" ) );
|
|
|
|
|
2003-03-05 14:50:11 +00:00
|
|
|
if ( *guid == OID_PresentationServer )
|
|
|
|
return ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( "com.sun.star.comp.Draw.PresentationDocument" ) );
|
|
|
|
|
2005-01-18 14:12:32 +00:00
|
|
|
if ( *guid == OID_PresentationOASISServer )
|
|
|
|
return ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( "com.sun.star.comp.Draw.PresentationDocument" ) );
|
|
|
|
|
2003-03-05 14:50:11 +00:00
|
|
|
if ( *guid == OID_MathServer )
|
|
|
|
return ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( "com.sun.star.comp.Math.FormulaDocument" ) );
|
|
|
|
|
2005-01-18 14:12:32 +00:00
|
|
|
if ( *guid == OID_MathOASISServer )
|
|
|
|
return ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( "com.sun.star.comp.Math.FormulaDocument" ) );
|
|
|
|
|
2003-03-05 14:50:11 +00:00
|
|
|
return ::rtl::OUString();
|
|
|
|
}
|
|
|
|
|
|
|
|
::rtl::OUString getFilterNameFromGUID_Impl( GUID* guid )
|
|
|
|
{
|
|
|
|
if ( *guid == OID_WriterTextServer )
|
|
|
|
return ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( "StarOffice XML (Writer)" ) );
|
|
|
|
|
2005-01-18 14:12:32 +00:00
|
|
|
if ( *guid == OID_WriterOASISTextServer )
|
|
|
|
return ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( "writer8" ) );
|
|
|
|
|
2003-03-05 14:50:11 +00:00
|
|
|
if ( *guid == OID_CalcServer )
|
|
|
|
return ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( "StarOffice XML (Calc)" ) );
|
|
|
|
|
2005-01-18 14:12:32 +00:00
|
|
|
if ( *guid == OID_CalcOASISServer )
|
|
|
|
return ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( "calc8" ) );
|
|
|
|
|
2003-03-05 14:50:11 +00:00
|
|
|
if ( *guid == OID_DrawingServer )
|
|
|
|
return ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( "StarOffice XML (Draw)" ) );
|
|
|
|
|
2005-01-18 14:12:32 +00:00
|
|
|
if ( *guid == OID_DrawingOASISServer )
|
|
|
|
return ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( "draw8" ) );
|
|
|
|
|
2003-03-05 14:50:11 +00:00
|
|
|
if ( *guid == OID_PresentationServer )
|
|
|
|
return ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( "StarOffice XML (Impress)" ) );
|
|
|
|
|
2005-01-18 14:12:32 +00:00
|
|
|
if ( *guid == OID_PresentationOASISServer )
|
|
|
|
return ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( "impress8" ) );
|
|
|
|
|
2003-03-05 14:50:11 +00:00
|
|
|
if ( *guid == OID_MathServer )
|
|
|
|
return ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( "StarOffice XML (Math)" ) );
|
|
|
|
|
2005-01-18 14:12:32 +00:00
|
|
|
if ( *guid == OID_MathOASISServer )
|
|
|
|
return ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( "math8" ) );
|
|
|
|
|
2003-03-05 14:50:11 +00:00
|
|
|
return ::rtl::OUString();
|
|
|
|
}
|
|
|
|
|
2003-03-17 10:03:28 +00:00
|
|
|
::rtl::OUString getTestFileURLFromGUID_Impl( GUID* guid )
|
|
|
|
{
|
|
|
|
if ( *guid == OID_WriterTextServer )
|
|
|
|
return ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( "file:///d:/OLE_TEST/test.sxw" ) );
|
|
|
|
|
2005-01-18 14:12:32 +00:00
|
|
|
if ( *guid == OID_WriterOASISTextServer )
|
|
|
|
return ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( "file:///d:/OLE_TEST/test.odt" ) );
|
|
|
|
|
2003-03-17 10:03:28 +00:00
|
|
|
if ( *guid == OID_CalcServer )
|
|
|
|
return ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( "file:///d:/OLE_TEST/test.sxc" ) );
|
|
|
|
|
2005-01-18 14:12:32 +00:00
|
|
|
if ( *guid == OID_CalcOASISServer )
|
|
|
|
return ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( "file:///d:/OLE_TEST/test.ods" ) );
|
|
|
|
|
2003-03-17 10:03:28 +00:00
|
|
|
if ( *guid == OID_DrawingServer )
|
|
|
|
return ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( "file:///d:/OLE_TEST/test.sxd" ) );
|
|
|
|
|
2005-01-18 14:12:32 +00:00
|
|
|
if ( *guid == OID_DrawingOASISServer )
|
|
|
|
return ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( "file:///d:/OLE_TEST/test.odg" ) );
|
|
|
|
|
2003-03-17 10:03:28 +00:00
|
|
|
if ( *guid == OID_PresentationServer )
|
|
|
|
return ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( "file:///d:/OLE_TEST/test.sxi" ) );
|
|
|
|
|
2005-01-18 14:12:32 +00:00
|
|
|
if ( *guid == OID_PresentationOASISServer )
|
|
|
|
return ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( "file:///d:/OLE_TEST/test.odp" ) );
|
|
|
|
|
2003-03-17 10:03:28 +00:00
|
|
|
if ( *guid == OID_MathServer )
|
|
|
|
return ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( "file:///d:/OLE_TEST/test.sxm" ) );
|
|
|
|
|
2005-01-18 14:12:32 +00:00
|
|
|
if ( *guid == OID_MathOASISServer )
|
|
|
|
return ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( "file:///d:/OLE_TEST/test.odf" ) );
|
|
|
|
|
2003-03-17 10:03:28 +00:00
|
|
|
return ::rtl::OUString();
|
|
|
|
}
|
|
|
|
|
2006-06-20 04:40:39 +00:00
|
|
|
// Fix strange warnings about some
|
|
|
|
// ATL::CAxHostWindow::QueryInterface|AddRef|Releae functions.
|
|
|
|
// warning C4505: 'xxx' : unreferenced local function has been removed
|
|
|
|
#if defined(_MSC_VER)
|
|
|
|
#pragma warning(disable: 4505)
|
|
|
|
#endif
|
2010-10-12 15:57:08 +02:00
|
|
|
|
|
|
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|