summaryrefslogtreecommitdiff
path: root/writerperfect/source/impress/MWAWPresentationImportFilter.cxx
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2018-04-20 09:07:25 +0200
committerMiklos Vajna <vmiklos@collabora.co.uk>2018-04-20 11:16:34 +0200
commitac4ea366ec040cdb68f93d42045cba5780852d9f (patch)
tree5be6a2ecac320004551fd4bd50b66271cf5322a9 /writerperfect/source/impress/MWAWPresentationImportFilter.cxx
parent66c02d16dd078613e754dcc775f366413fad13f0 (diff)
writerperfect: astyle -> clang-format
< vmiklos> dtardon: are you strongly attached to astyle usage in core.git writerperfect/? my problem is that 1) when less regular contributors touch it, they don't run astyle 2) core.git has git hooks in place to enforce consistent style for selected files, but that uses clang-format. i wonder if switching to the standard core.git clang-format would be an option to stop this reformat game <@dtardon> vmiklos, clang-format is okay. we started to use astyle years ago, before there were even any serious talk about automatic formatting for the whole libreoffice Change-Id: I844fc9c2e8560e54a49f26064cc0b3c55a5f034c Reviewed-on: https://gerrit.libreoffice.org/53184 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
Diffstat (limited to 'writerperfect/source/impress/MWAWPresentationImportFilter.cxx')
-rw-r--r--writerperfect/source/impress/MWAWPresentationImportFilter.cxx62
1 files changed, 34 insertions, 28 deletions
diff --git a/writerperfect/source/impress/MWAWPresentationImportFilter.cxx b/writerperfect/source/impress/MWAWPresentationImportFilter.cxx
index 5fe085548364..cd35fb6f275c 100644
--- a/writerperfect/source/impress/MWAWPresentationImportFilter.cxx
+++ b/writerperfect/source/impress/MWAWPresentationImportFilter.cxx
@@ -16,19 +16,23 @@
#include "MWAWPresentationImportFilter.hxx"
-using com::sun::star::uno::Sequence;
-using com::sun::star::uno::XInterface;
using com::sun::star::uno::RuntimeException;
+using com::sun::star::uno::Sequence;
using com::sun::star::uno::XComponentContext;
+using com::sun::star::uno::XInterface;
-static bool handleEmbeddedMWAWGraphicObject(const librevenge::RVNGBinaryData &data, OdfDocumentHandler *pHandler, const OdfStreamType streamType)
+static bool handleEmbeddedMWAWGraphicObject(const librevenge::RVNGBinaryData& data,
+ OdfDocumentHandler* pHandler,
+ const OdfStreamType streamType)
{
OdgGenerator exporter;
exporter.addDocumentHandler(pHandler, streamType);
return MWAWDocument::decodeGraphic(data, &exporter);
}
-static bool handleEmbeddedMWAWSpreadsheetObject(const librevenge::RVNGBinaryData &data, OdfDocumentHandler *pHandler, const OdfStreamType streamType)
+static bool handleEmbeddedMWAWSpreadsheetObject(const librevenge::RVNGBinaryData& data,
+ OdfDocumentHandler* pHandler,
+ const OdfStreamType streamType)
{
OdsGenerator exporter;
exporter.registerEmbeddedObjectHandler("image/mwaw-odg", &handleEmbeddedMWAWGraphicObject);
@@ -36,18 +40,21 @@ static bool handleEmbeddedMWAWSpreadsheetObject(const librevenge::RVNGBinaryData
return MWAWDocument::decodeSpreadsheet(data, &exporter);
}
-bool MWAWPresentationImportFilter::doImportDocument(librevenge::RVNGInputStream &rInput, OdpGenerator &rGenerator, utl::MediaDescriptor &)
+bool MWAWPresentationImportFilter::doImportDocument(librevenge::RVNGInputStream& rInput,
+ OdpGenerator& rGenerator, utl::MediaDescriptor&)
{
return MWAWDocument::MWAW_R_OK == MWAWDocument::parse(&rInput, &rGenerator);
}
-bool MWAWPresentationImportFilter::doDetectFormat(librevenge::RVNGInputStream &rInput, OUString &rTypeName)
+bool MWAWPresentationImportFilter::doDetectFormat(librevenge::RVNGInputStream& rInput,
+ OUString& rTypeName)
{
rTypeName.clear();
MWAWDocument::Type docType = MWAWDocument::MWAW_T_UNKNOWN;
MWAWDocument::Kind docKind = MWAWDocument::MWAW_K_UNKNOWN;
- const MWAWDocument::Confidence confidence = MWAWDocument::isFileFormatSupported(&rInput, docType, docKind);
+ const MWAWDocument::Confidence confidence
+ = MWAWDocument::isFileFormatSupported(&rInput, docType, docKind);
if (confidence == MWAWDocument::MWAW_C_EXCELLENT)
{
@@ -55,15 +62,15 @@ bool MWAWPresentationImportFilter::doDetectFormat(librevenge::RVNGInputStream &r
{
switch (docType)
{
- case MWAWDocument::MWAW_T_CLARISWORKS:
- rTypeName = "impress_ClarisWorks";
- break;
- case MWAWDocument::MWAW_T_RESERVED8:
- rTypeName = "impress_PowerPoint3";
- break;
- default:
- rTypeName = "MWAW_Presentation";
- break;
+ case MWAWDocument::MWAW_T_CLARISWORKS:
+ rTypeName = "impress_ClarisWorks";
+ break;
+ case MWAWDocument::MWAW_T_RESERVED8:
+ rTypeName = "impress_PowerPoint3";
+ break;
+ default:
+ rTypeName = "MWAW_Presentation";
+ break;
}
}
}
@@ -71,10 +78,11 @@ bool MWAWPresentationImportFilter::doDetectFormat(librevenge::RVNGInputStream &r
return !rTypeName.isEmpty();
}
-void MWAWPresentationImportFilter::doRegisterHandlers(OdpGenerator &rGenerator)
+void MWAWPresentationImportFilter::doRegisterHandlers(OdpGenerator& rGenerator)
{
rGenerator.registerEmbeddedObjectHandler("image/mwaw-odg", &handleEmbeddedMWAWGraphicObject);
- rGenerator.registerEmbeddedObjectHandler("image/mwaw-ods", &handleEmbeddedMWAWSpreadsheetObject);
+ rGenerator.registerEmbeddedObjectHandler("image/mwaw-ods",
+ &handleEmbeddedMWAWSpreadsheetObject);
}
// XServiceInfo
@@ -82,24 +90,22 @@ OUString SAL_CALL MWAWPresentationImportFilter::getImplementationName()
{
return OUString("com.sun.star.comp.Impress.MWAWPresentationImportFilter");
}
-sal_Bool SAL_CALL MWAWPresentationImportFilter::supportsService(const OUString &rServiceName)
+sal_Bool SAL_CALL MWAWPresentationImportFilter::supportsService(const OUString& rServiceName)
{
return cppu::supportsService(this, rServiceName);
}
-Sequence< OUString > SAL_CALL MWAWPresentationImportFilter::getSupportedServiceNames()
+Sequence<OUString> SAL_CALL MWAWPresentationImportFilter::getSupportedServiceNames()
{
- Sequence < OUString > aRet(2);
- OUString *pArray = aRet.getArray();
- pArray[0] = "com.sun.star.document.ImportFilter";
- pArray[1] = "com.sun.star.document.ExtendedTypeDetection";
+ Sequence<OUString> aRet(2);
+ OUString* pArray = aRet.getArray();
+ pArray[0] = "com.sun.star.document.ImportFilter";
+ pArray[1] = "com.sun.star.document.ExtendedTypeDetection";
return aRet;
}
-extern "C"
-SAL_DLLPUBLIC_EXPORT css::uno::XInterface *
+extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
com_sun_star_comp_Impress_MWAWPresentationImportFilter_get_implementation(
- css::uno::XComponentContext *const context,
- const css::uno::Sequence<css::uno::Any> &)
+ css::uno::XComponentContext* const context, const css::uno::Sequence<css::uno::Any>&)
{
return cppu::acquire(new MWAWPresentationImportFilter(context));
}