summaryrefslogtreecommitdiff
path: root/writerperfect/source/common
diff options
context:
space:
mode:
authorDavid Tardon <dtardon@redhat.com>2014-04-24 14:02:23 +0200
committerDavid Tardon <dtardon@redhat.com>2014-04-24 16:27:43 +0200
commitb7fa9950a9ef68bf2652b8c93887b6d531866471 (patch)
treeddcf32f5578ba7630bee02d1652aaf04c57ce1af /writerperfect/source/common
parente6b142a06833404d8b8a5be0501fd4751df60f35 (diff)
change libwriterperfect to shared library
There are already 3 libs linking with it and there will be another one in near future. It is time to stop the duplication :-) Change-Id: Ia7d24882c37a8bf49fa031b73fa1bd5296f78820
Diffstat (limited to 'writerperfect/source/common')
-rw-r--r--writerperfect/source/common/DirectoryStream.cxx4
-rw-r--r--writerperfect/source/common/DirectoryStream.hxx48
-rw-r--r--writerperfect/source/common/DocumentHandler.cxx12
-rw-r--r--writerperfect/source/common/DocumentHandler.hxx48
-rw-r--r--writerperfect/source/common/WPXSvInputStream.cxx (renamed from writerperfect/source/common/WPXSvStream.cxx)10
-rw-r--r--writerperfect/source/common/WPXSvStream.hxx50
6 files changed, 22 insertions, 150 deletions
diff --git a/writerperfect/source/common/DirectoryStream.cxx b/writerperfect/source/common/DirectoryStream.cxx
index 90aeb597c991..c12569491940 100644
--- a/writerperfect/source/common/DirectoryStream.cxx
+++ b/writerperfect/source/common/DirectoryStream.cxx
@@ -35,8 +35,8 @@
#include <ucbhelper/content.hxx>
-#include "DirectoryStream.hxx"
-#include "WPXSvStream.hxx"
+#include <writerperfect/DirectoryStream.hxx>
+#include <writerperfect/WPXSvInputStream.hxx>
namespace io = com::sun::star::io;
namespace sdbc = com::sun::star::sdbc;
diff --git a/writerperfect/source/common/DirectoryStream.hxx b/writerperfect/source/common/DirectoryStream.hxx
deleted file mode 100644
index ab10bbfea762..000000000000
--- a/writerperfect/source/common/DirectoryStream.hxx
+++ /dev/null
@@ -1,48 +0,0 @@
-/* -*- 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 DIRECTORYSTREAM_H_INCLUDED
-#define DIRECTORYSTREAM_H_INCLUDED
-
-#include <libwpd-stream/libwpd-stream.h>
-
-#include <com/sun/star/uno/Reference.h>
-
-namespace com { namespace sun { namespace star { namespace ucb {
- class XContent;
-} } } }
-
-namespace writerperfect
-{
-
-class DirectoryStream : public WPXInputStream
-{
- struct Impl;
-
-public:
- explicit DirectoryStream(const com::sun::star::uno::Reference<com::sun::star::ucb::XContent> &xContent);
- virtual ~DirectoryStream();
-
- virtual bool isOLEStream() SAL_OVERRIDE;
- virtual WPXInputStream *getDocumentOLEStream(const char *pName) SAL_OVERRIDE;
-
- virtual const unsigned char *read(unsigned long nNumBytes, unsigned long &nNumBytesRead) SAL_OVERRIDE;
- virtual int seek(long nOffset, WPX_SEEK_TYPE eSeekType) SAL_OVERRIDE;
- virtual long tell() SAL_OVERRIDE;
- virtual bool atEOS() SAL_OVERRIDE;
-
-private:
- Impl *m_pImpl;
-};
-
-}
-
-#endif // DIRECTORYSTREAM_H_INCLUDED
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/writerperfect/source/common/DocumentHandler.cxx b/writerperfect/source/common/DocumentHandler.cxx
index 073b9429571b..239f20ec7055 100644
--- a/writerperfect/source/common/DocumentHandler.cxx
+++ b/writerperfect/source/common/DocumentHandler.cxx
@@ -6,15 +6,23 @@
*
* For further information visit http://libwpd.sourceforge.net
*/
-#include "DocumentHandler.hxx"
+
+#include <writerperfect/DocumentHandler.hxx>
#include <string.h>
+
+#include <com/sun/star/uno/Reference.hxx>
#include <com/sun/star/xml/sax/XDocumentHandler.hpp>
#include <com/sun/star/xml/sax/XAttributeList.hpp>
#include <xmloff/attrlist.hxx>
+namespace writerperfect
+{
+
+using com::sun::star::uno::Reference;
using com::sun::star::xml::sax::XAttributeList;
+using com::sun::star::xml::sax::XDocumentHandler;
DocumentHandler::DocumentHandler(Reference < XDocumentHandler > &xHandler) :
mxHandler(xHandler)
@@ -63,4 +71,6 @@ void DocumentHandler::characters(const WPXString &sCharacters)
mxHandler->characters(sCharU16);
}
+}
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/writerperfect/source/common/DocumentHandler.hxx b/writerperfect/source/common/DocumentHandler.hxx
deleted file mode 100644
index dad1e0f61d0e..000000000000
--- a/writerperfect/source/common/DocumentHandler.hxx
+++ /dev/null
@@ -1,48 +0,0 @@
-/* -*- 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 .
- */
-
-#ifndef _DOCUMENTHANDLER_HXX_
-#define _DOCUMENTHANDLER_HXX_
-
-#include <com/sun/star/xml/sax/XDocumentHandler.hpp>
-
-#include <libwpd/libwpd.h>
-
-#include <libodfgen/libodfgen.hxx>
-
-using com::sun::star::uno::Reference;
-using com::sun::star::xml::sax::XDocumentHandler;
-
-class DocumentHandler: public OdfDocumentHandler
-{
-public:
- DocumentHandler(Reference < XDocumentHandler > &xHandler);
- void startDocument() SAL_OVERRIDE;
- void endDocument() SAL_OVERRIDE;
- void startElement(const char *psName, const WPXPropertyList &xPropList) SAL_OVERRIDE;
- void endElement(const char *psName) SAL_OVERRIDE;
- void characters(const WPXString &sCharacters) SAL_OVERRIDE;
-
-private:
- Reference < XDocumentHandler > mxHandler;
-};
-
-#endif // _DOCUMENTHANDLER_HXX_
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/writerperfect/source/common/WPXSvStream.cxx b/writerperfect/source/common/WPXSvInputStream.cxx
index 818830df9050..b2ad2a8a5d64 100644
--- a/writerperfect/source/common/WPXSvStream.cxx
+++ b/writerperfect/source/common/WPXSvInputStream.cxx
@@ -7,7 +7,7 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
-#include "WPXSvStream.hxx"
+#include <writerperfect/WPXSvInputStream.hxx>
#include <com/sun/star/packages/zip/XZipFileAccess2.hpp>
#include <com/sun/star/uno/Any.hxx>
@@ -16,6 +16,9 @@
#include <comphelper/seekableinput.hxx>
#include <rtl/string.hxx>
+
+#include <sot/storage.hxx>
+
#include <tools/stream.hxx>
#include <unotools/streamwrap.hxx>
#include <unotools/ucbstreamhelper.hxx>
@@ -27,6 +30,9 @@
#include <boost/scoped_ptr.hpp>
#include <boost/unordered_map.hpp>
+namespace writerperfect
+{
+
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::io;
@@ -950,4 +956,6 @@ WPXInputStream *WPXSvInputStream::getDocumentOLEStream(const char *name)
return getSubStreamByName(name);
}
+}
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/writerperfect/source/common/WPXSvStream.hxx b/writerperfect/source/common/WPXSvStream.hxx
deleted file mode 100644
index 337bf16b51fb..000000000000
--- a/writerperfect/source/common/WPXSvStream.hxx
+++ /dev/null
@@ -1,50 +0,0 @@
-/* -*- 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 WPXSVSTREAM_H
-#define WPXSVSTREAM_H
-
-#include <sot/storage.hxx>
-#include <com/sun/star/io/XInputStream.hpp>
-#include <com/sun/star/io/XSeekable.hpp>
-
-#include <libwpd-stream/libwpd-stream.h>
-
-class WPXSvInputStreamImpl;
-
-class WPXSvInputStream : public WPXInputStream
-{
-public:
- WPXSvInputStream( ::com::sun::star::uno::Reference<
- ::com::sun::star::io::XInputStream > xStream );
- virtual ~WPXSvInputStream();
-
- virtual bool isStructured();
- virtual unsigned subStreamCount();
- virtual const char * subStreamName(unsigned id);
- virtual bool existsSubStream(const char *name);
- virtual WPXInputStream * getSubStreamByName(const char *name);
- virtual WPXInputStream * getSubStreamById(unsigned id);
-
- virtual const unsigned char *read(unsigned long numBytes, unsigned long &numBytesRead) SAL_OVERRIDE;
- virtual int seek(long offset, WPX_SEEK_TYPE seekType) SAL_OVERRIDE;
- virtual long tell() SAL_OVERRIDE;
- virtual bool isEnd();
-
- virtual bool isOLEStream() SAL_OVERRIDE;
- virtual WPXInputStream * getDocumentOLEStream(const char *name) SAL_OVERRIDE;
- virtual bool atEOS() SAL_OVERRIDE;
-
-private:
- WPXSvInputStreamImpl *mpImpl;
-};
-
-#endif
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */