Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
core
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
LibreOffice
core
Commits
7de2366a
Kaydet (Commit)
7de2366a
authored
Agu 15, 2014
tarafından
David Tardon
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
use consistent style for writerperfect
Change-Id: I47089586094b58c39a128e44e2671d69c2d50177
üst
2c75925a
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
50 changed files
with
793 additions
and
674 deletions
+793
-674
README
writerperfect/README
+6
-0
astyle.options
writerperfect/astyle.options
+12
-0
WPXSvStreamTest.cxx
writerperfect/qa/unit/WPXSvStreamTest.cxx
+7
-7
WpftImportTestBase.cxx
writerperfect/qa/unit/WpftImportTestBase.cxx
+5
-5
WpftImportTestBase.hxx
writerperfect/qa/unit/WpftImportTestBase.hxx
+30
-8
ImportFilterBase.cxx
writerperfect/source/calc/ImportFilterBase.cxx
+25
-25
ImportFilterBase.hxx
writerperfect/source/calc/ImportFilterBase.hxx
+27
-17
MSWorksCalcImportFilter.cxx
writerperfect/source/calc/MSWorksCalcImportFilter.cxx
+13
-13
MSWorksCalcImportFilter.hxx
writerperfect/source/calc/MSWorksCalcImportFilter.hxx
+13
-13
MWAWCalcImportFilter.cxx
writerperfect/source/calc/MWAWCalcImportFilter.cxx
+14
-14
MWAWCalcImportFilter.hxx
writerperfect/source/calc/MWAWCalcImportFilter.hxx
+13
-13
wpftcalc_genericfilter.cxx
writerperfect/source/calc/wpftcalc_genericfilter.cxx
+19
-12
DirectoryStream.cxx
writerperfect/source/common/DirectoryStream.cxx
+5
-4
DocumentHandler.cxx
writerperfect/source/common/DocumentHandler.cxx
+13
-9
WPXSvInputStream.cxx
writerperfect/source/common/WPXSvInputStream.cxx
+16
-16
CDRImportFilter.cxx
writerperfect/source/draw/CDRImportFilter.cxx
+12
-12
CDRImportFilter.hxx
writerperfect/source/draw/CDRImportFilter.hxx
+12
-12
CMXImportFilter.cxx
writerperfect/source/draw/CMXImportFilter.cxx
+12
-12
CMXImportFilter.hxx
writerperfect/source/draw/CMXImportFilter.hxx
+12
-12
FreehandImportFilter.cxx
writerperfect/source/draw/FreehandImportFilter.cxx
+12
-12
FreehandImportFilter.hxx
writerperfect/source/draw/FreehandImportFilter.hxx
+12
-12
ImportFilterBase.cxx
writerperfect/source/draw/ImportFilterBase.cxx
+25
-25
ImportFilterBase.hxx
writerperfect/source/draw/ImportFilterBase.hxx
+27
-17
MSPUBImportFilter.cxx
writerperfect/source/draw/MSPUBImportFilter.cxx
+12
-12
MSPUBImportFilter.hxx
writerperfect/source/draw/MSPUBImportFilter.hxx
+12
-12
MWAWDrawImportFilter.cxx
writerperfect/source/draw/MWAWDrawImportFilter.cxx
+14
-14
MWAWDrawImportFilter.hxx
writerperfect/source/draw/MWAWDrawImportFilter.hxx
+13
-13
PageMakerImportFilter.cxx
writerperfect/source/draw/PageMakerImportFilter.cxx
+12
-12
PageMakerImportFilter.hxx
writerperfect/source/draw/PageMakerImportFilter.hxx
+12
-12
VisioImportFilter.cxx
writerperfect/source/draw/VisioImportFilter.cxx
+12
-12
VisioImportFilter.hxx
writerperfect/source/draw/VisioImportFilter.hxx
+12
-12
WPGImportFilter.cxx
writerperfect/source/draw/WPGImportFilter.cxx
+12
-12
WPGImportFilter.hxx
writerperfect/source/draw/WPGImportFilter.hxx
+12
-12
wpftdraw_genericfilter.cxx
writerperfect/source/draw/wpftdraw_genericfilter.cxx
+54
-35
KeynoteImportFilter.cxx
writerperfect/source/impress/KeynoteImportFilter.cxx
+0
-0
KeynoteImportFilter.hxx
writerperfect/source/impress/KeynoteImportFilter.hxx
+18
-18
wpftimpress_genericfilter.cxx
writerperfect/source/impress/wpftimpress_genericfilter.cxx
+14
-9
AbiWordImportFilter.cxx
writerperfect/source/writer/AbiWordImportFilter.cxx
+12
-12
AbiWordImportFilter.hxx
writerperfect/source/writer/AbiWordImportFilter.hxx
+12
-12
EBookImportFilter.cxx
writerperfect/source/writer/EBookImportFilter.cxx
+32
-32
EBookImportFilter.hxx
writerperfect/source/writer/EBookImportFilter.hxx
+12
-12
ImportFilterBase.cxx
writerperfect/source/writer/ImportFilterBase.cxx
+26
-26
ImportFilterBase.hxx
writerperfect/source/writer/ImportFilterBase.hxx
+27
-17
MSWorksImportFilter.cxx
writerperfect/source/writer/MSWorksImportFilter.cxx
+13
-13
MSWorksImportFilter.hxx
writerperfect/source/writer/MSWorksImportFilter.hxx
+13
-13
MWAWImportFilter.cxx
writerperfect/source/writer/MWAWImportFilter.cxx
+14
-14
MWAWImportFilter.hxx
writerperfect/source/writer/MWAWImportFilter.hxx
+13
-13
WordPerfectImportFilter.cxx
writerperfect/source/writer/WordPerfectImportFilter.cxx
+0
-0
WordPerfectImportFilter.hxx
writerperfect/source/writer/WordPerfectImportFilter.hxx
+34
-34
wpftwriter_genericfilter.cxx
writerperfect/source/writer/wpftwriter_genericfilter.cxx
+34
-21
No files found.
writerperfect/README
Dosyayı görüntüle @
7de2366a
...
...
@@ -4,3 +4,9 @@ This collection of filters is here in this folder in addition to the
WordPerfect filter that gave the module its (humorous) name "writerperfect"
because the libraries they use all have the same "style" of API and are
developed, at least partially, by the same person or group of persons.
This module uses astyle to keep consistent coding style. Please run
astyle --options=astyle.options \*.?xx
before committing.
writerperfect/astyle.options
0 → 100644
Dosyayı görüntüle @
7de2366a
# formatting options
style=allman
indent=spaces=4
align-pointer=name
break-closing-brackets
pad-header
unpad-paren
max-instatement-indent=120
# processing options
recursive
suffix=none
writerperfect/qa/unit/WPXSvStreamTest.cxx
Dosyayı görüntüle @
7de2366a
...
...
@@ -73,7 +73,7 @@ shared_ptr<RVNGInputStream> lcl_createStream()
{
using
comphelper
::
SequenceInputStream
;
const
css
::
uno
::
Sequence
<
sal_Int8
>
aData
(
reinterpret_cast
<
const
sal_Int8
*>
(
aText
),
sizeof
aText
);
const
css
::
uno
::
Sequence
<
sal_Int8
>
aData
(
reinterpret_cast
<
const
sal_Int8
*>
(
aText
),
sizeof
aText
);
const
uno
::
Reference
<
io
::
XInputStream
>
xInputStream
(
new
SequenceInputStream
(
aData
));
shared_ptr
<
RVNGInputStream
>
pInputStream
;
...
...
@@ -90,8 +90,8 @@ const shared_ptr<RVNGInputStream> lcl_createStreamForURL(const rtl::OUString &rU
const
Reference
<
uno
::
XComponentContext
>
xContext
(
comphelper
::
getProcessComponentContext
(),
UNO_QUERY_THROW
);
const
Reference
<
ucb
::
XSimpleFileAccess
>
xFileAccess
(
xContext
->
getServiceManager
()
->
createInstanceWithContext
(
"com.sun.star.ucb.SimpleFileAccess"
,
xContext
),
UNO_QUERY_THROW
);
xContext
->
getServiceManager
()
->
createInstanceWithContext
(
"com.sun.star.ucb.SimpleFileAccess"
,
xContext
),
UNO_QUERY_THROW
);
const
Reference
<
io
::
XInputStream
>
xInputStream
(
xFileAccess
->
openFileRead
(
rURL
),
UNO_QUERY_THROW
);
const
shared_ptr
<
RVNGInputStream
>
pInput
(
new
WPXSvInputStream
(
xInputStream
));
...
...
@@ -122,9 +122,9 @@ void WPXSvStreamTest::testRead()
const
unsigned
long
nLen
=
sizeof
aText
;
unsigned
long
nReadBytes
=
0
;
const
unsigned
char
*
pData
=
0
;
const
unsigned
char
*
const
pTextOrig
=
reinterpret_cast
<
const
unsigned
char
*>
(
aText
);
const
unsigned
char
*
pText
=
pTextOrig
;
const
unsigned
char
*
pData
=
0
;
const
unsigned
char
*
const
pTextOrig
=
reinterpret_cast
<
const
unsigned
char
*>
(
aText
);
const
unsigned
char
*
pText
=
pTextOrig
;
// reading by small pieces
pData
=
pInput
->
read
(
1UL
,
nReadBytes
);
...
...
@@ -176,7 +176,7 @@ void WPXSvStreamTest::testRead()
pData
=
pInput
->
read
(
0UL
,
nReadBytes
);
CPPUNIT_ASSERT_EQUAL
(
0UL
,
nReadBytes
);
CPPUNIT_ASSERT_EQUAL
(
0L
,
pInput
->
tell
());
CPPUNIT_ASSERT_EQUAL
(
pData
,
static_cast
<
const
unsigned
char
*>
(
0
));
CPPUNIT_ASSERT_EQUAL
(
pData
,
static_cast
<
const
unsigned
char
*>
(
0
));
CPPUNIT_ASSERT
(
!
pInput
->
isEnd
());
}
...
...
writerperfect/qa/unit/WpftImportTestBase.cxx
Dosyayı görüntüle @
7de2366a
...
...
@@ -60,8 +60,8 @@ void WpftImportTestBase::setUp()
m_xDesktop
=
frame
::
theDesktop
::
get
(
m_xContext
);
const
uno
::
Reference
<
document
::
XTypeDetection
>
xTypeDetection
(
m_xFactory
->
createInstanceWithContext
(
"com.sun.star.document.TypeDetection"
,
m_xContext
),
uno
::
UNO_QUERY_THROW
);
m_xFactory
->
createInstanceWithContext
(
"com.sun.star.document.TypeDetection"
,
m_xContext
),
uno
::
UNO_QUERY_THROW
);
m_xTypeMap
.
set
(
xTypeDetection
,
uno
::
UNO_QUERY_THROW
);
}
...
...
@@ -73,12 +73,12 @@ void WpftImportTestBase::tearDown()
}
bool
WpftImportTestBase
::
load
(
const
OUString
&
,
const
OUString
&
rURL
,
const
OUString
&
,
unsigned
int
,
unsigned
int
,
unsigned
int
)
unsigned
int
,
unsigned
int
,
unsigned
int
)
{
// create an empty frame
const
uno
::
Reference
<
lang
::
XComponent
>
xDoc
(
m_xDesktop
->
loadComponentFromURL
(
m_aFactoryURL
,
"_blank"
,
0
,
uno
::
Sequence
<
beans
::
PropertyValue
>
()),
uno
::
UNO_QUERY_THROW
);
m_xDesktop
->
loadComponentFromURL
(
m_aFactoryURL
,
"_blank"
,
0
,
uno
::
Sequence
<
beans
::
PropertyValue
>
()),
uno
::
UNO_QUERY_THROW
);
// Find the model and frame. We need them later.
uno
::
Reference
<
frame
::
XFrame
>
xFrame
(
xDoc
,
uno
::
UNO_QUERY
);
...
...
writerperfect/qa/unit/WpftImportTestBase.hxx
Dosyayı görüntüle @
7de2366a
...
...
@@ -19,13 +19,35 @@
#include <unotest/filters-test.hxx>
namespace
com
{
namespace
sun
{
namespace
star
{
namespace
beans
{
struct
PropertyValue
;
}
namespace
container
{
class
XNameAccess
;
}
namespace
document
{
class
XFilter
;
}
namespace
frame
{
class
XDesktop2
;
}
namespace
ucb
{
class
XSimpleFileAccess
;
}
}
}
}
namespace
com
{
namespace
sun
{
namespace
star
{
namespace
beans
{
struct
PropertyValue
;
}
namespace
container
{
class
XNameAccess
;
}
namespace
document
{
class
XFilter
;
}
namespace
frame
{
class
XDesktop2
;
}
namespace
ucb
{
class
XSimpleFileAccess
;
}
}
}
}
namespace
writerperfect
{
...
...
@@ -47,7 +69,7 @@ protected:
private
:
virtual
bool
load
(
const
OUString
&
,
const
OUString
&
rURL
,
const
OUString
&
,
unsigned
int
,
unsigned
int
,
unsigned
int
)
SAL_OVERRIDE
;
unsigned
int
,
unsigned
int
,
unsigned
int
)
SAL_OVERRIDE
;
void
impl_detectFilterName
(
com
::
sun
::
star
::
uno
::
Sequence
<
com
::
sun
::
star
::
beans
::
PropertyValue
>
&
rDescriptor
,
const
rtl
::
OUString
&
rTypeName
);
...
...
writerperfect/source/calc/ImportFilterBase.cxx
Dosyayı görüntüle @
7de2366a
...
...
@@ -50,8 +50,8 @@ using com::sun::star::xml::sax::XParser;
using
writerperfect
::
DocumentHandler
;
using
writerperfect
::
WPXSvInputStream
;
ImportFilterImpl
::
ImportFilterImpl
(
const
::
com
::
sun
::
star
::
uno
::
Reference
<
::
com
::
sun
::
star
::
uno
::
XComponentContext
>
&
rxContext
)
:
mxContext
(
rxContext
)
ImportFilterImpl
::
ImportFilterImpl
(
const
::
com
::
sun
::
star
::
uno
::
Reference
<
::
com
::
sun
::
star
::
uno
::
XComponentContext
>
&
rxContext
)
:
mxContext
(
rxContext
)
{
}
...
...
@@ -59,20 +59,20 @@ ImportFilterImpl::~ImportFilterImpl()
{
}
sal_Bool
SAL_CALL
ImportFilterImpl
::
filter
(
const
Sequence
<
::
com
::
sun
::
star
::
beans
::
PropertyValue
>&
aDescriptor
)
sal_Bool
SAL_CALL
ImportFilterImpl
::
filter
(
const
Sequence
<
::
com
::
sun
::
star
::
beans
::
PropertyValue
>
&
aDescriptor
)
throw
(
RuntimeException
,
std
::
exception
)
{
sal_Int32
nLength
=
aDescriptor
.
getLength
();
const
PropertyValue
*
pValue
=
aDescriptor
.
getConstArray
();
Reference
<
XInputStream
>
xInputStream
;
for
(
sal_Int32
i
=
0
;
i
<
nLength
;
i
++
)
for
(
sal_Int32
i
=
0
;
i
<
nLength
;
i
++
)
{
if
(
pValue
[
i
].
Name
==
"InputStream"
)
if
(
pValue
[
i
].
Name
==
"InputStream"
)
pValue
[
i
].
Value
>>=
xInputStream
;
}
if
(
!
xInputStream
.
is
()
)
if
(
!
xInputStream
.
is
()
)
{
OSL_ASSERT
(
false
);
OSL_ASSERT
(
false
);
return
sal_False
;
}
...
...
@@ -84,13 +84,13 @@ throw (RuntimeException, std::exception)
// The XImporter sets up an empty target document for XDocumentHandler to write to..
Reference
<
XImporter
>
xImporter
(
xInternalHandler
,
UNO_QUERY
);
xImporter
->
setTargetDocument
(
mxDoc
);
xImporter
->
setTargetDocument
(
mxDoc
);
// OO Graphics Handler: abstract class to handle document SAX messages, concrete implementation here
// writes to in-memory target doc
DocumentHandler
xHandler
(
xInternalHandler
);
WPXSvInputStream
input
(
xInputStream
);
WPXSvInputStream
input
(
xInputStream
);
OdsGenerator
exporter
;
exporter
.
addDocumentHandler
(
&
xHandler
,
ODF_FLAT_XML
);
...
...
@@ -100,45 +100,45 @@ throw (RuntimeException, std::exception)
return
doImportDocument
(
input
,
exporter
);
}
void
SAL_CALL
ImportFilterImpl
::
cancel
(
)
void
SAL_CALL
ImportFilterImpl
::
cancel
()
throw
(
RuntimeException
,
std
::
exception
)
{
}
// XImporter
void
SAL_CALL
ImportFilterImpl
::
setTargetDocument
(
const
Reference
<
::
com
::
sun
::
star
::
lang
::
XComponent
>&
xDoc
)
void
SAL_CALL
ImportFilterImpl
::
setTargetDocument
(
const
Reference
<
::
com
::
sun
::
star
::
lang
::
XComponent
>
&
xDoc
)
throw
(
::
com
::
sun
::
star
::
lang
::
IllegalArgumentException
,
RuntimeException
,
std
::
exception
)
{
mxDoc
=
xDoc
;
}
// XExtendedFilterDetection
OUString
SAL_CALL
ImportFilterImpl
::
detect
(
com
::
sun
::
star
::
uno
::
Sequence
<
PropertyValue
>&
Descriptor
)
throw
(
com
::
sun
::
star
::
uno
::
RuntimeException
,
std
::
exception
)
OUString
SAL_CALL
ImportFilterImpl
::
detect
(
com
::
sun
::
star
::
uno
::
Sequence
<
PropertyValue
>
&
Descriptor
)
throw
(
com
::
sun
::
star
::
uno
::
RuntimeException
,
std
::
exception
)
{
OUString
sTypeName
;
sal_Int32
nLength
=
Descriptor
.
getLength
();
sal_Int32
location
=
nLength
;
const
PropertyValue
*
pValue
=
Descriptor
.
getConstArray
();
Reference
<
XInputStream
>
xInputStream
;
for
(
sal_Int32
i
=
0
;
i
<
nLength
;
i
++
)
for
(
sal_Int32
i
=
0
;
i
<
nLength
;
i
++
)
{
if
(
pValue
[
i
].
Name
==
"TypeName"
)
if
(
pValue
[
i
].
Name
==
"TypeName"
)
location
=
i
;
else
if
(
pValue
[
i
].
Name
==
"InputStream"
)
else
if
(
pValue
[
i
].
Name
==
"InputStream"
)
pValue
[
i
].
Value
>>=
xInputStream
;
}
if
(
!
xInputStream
.
is
())
return
OUString
();
WPXSvInputStream
input
(
xInputStream
);
WPXSvInputStream
input
(
xInputStream
);
if
(
doDetectFormat
(
input
,
sTypeName
)
)
if
(
doDetectFormat
(
input
,
sTypeName
)
)
{
assert
(
!
sTypeName
.
isEmpty
());
assert
(
!
sTypeName
.
isEmpty
());
if
(
location
==
nLength
)
if
(
location
==
nLength
)
{
Descriptor
.
realloc
(
nLength
+
1
);
Descriptor
[
location
].
Name
=
"TypeName"
;
...
...
@@ -152,18 +152,18 @@ throw( com::sun::star::uno::RuntimeException, std::exception )
// XInitialization
void
SAL_CALL
ImportFilterImpl
::
initialize
(
const
Sequence
<
Any
>&
aArguments
)
void
SAL_CALL
ImportFilterImpl
::
initialize
(
const
Sequence
<
Any
>
&
aArguments
)
throw
(
Exception
,
RuntimeException
,
std
::
exception
)
{
Sequence
<
PropertyValue
>
aAnySeq
;
sal_Int32
nLength
=
aArguments
.
getLength
();
if
(
nLength
&&
(
aArguments
[
0
]
>>=
aAnySeq
)
)
if
(
nLength
&&
(
aArguments
[
0
]
>>=
aAnySeq
)
)
{
const
PropertyValue
*
pValue
=
aAnySeq
.
getConstArray
();
nLength
=
aAnySeq
.
getLength
();
for
(
sal_Int32
i
=
0
;
i
<
nLength
;
i
++
)
for
(
sal_Int32
i
=
0
;
i
<
nLength
;
i
++
)
{
if
(
pValue
[
i
].
Name
==
"Type"
)
if
(
pValue
[
i
].
Name
==
"Type"
)
{
pValue
[
i
].
Value
>>=
msFilterName
;
break
;
...
...
@@ -172,7 +172,7 @@ throw (Exception, RuntimeException, std::exception)
}
}
void
ImportFilterImpl
::
doRegisterHandlers
(
OdsGenerator
&
)
void
ImportFilterImpl
::
doRegisterHandlers
(
OdsGenerator
&
)
{
}
...
...
writerperfect/source/calc/ImportFilterBase.hxx
Dosyayı görüntüle @
7de2366a
...
...
@@ -20,24 +20,34 @@
#include <cppuhelper/implbase1.hxx>
#include <cppuhelper/implbase4.hxx>
namespace
com
{
namespace
sun
{
namespace
star
{
namespace
com
{
namespace
sun
{
namespace
star
{
namespace
beans
{
struct
PropertyValue
;
struct
PropertyValue
;
}
namespace
lang
{
class
XComponent
;
class
XComponent
;
}
namespace
uno
{
class
XComponentContext
;
class
XComponentContext
;
}
namespace
xml
{
namespace
sax
{
class
XDocumentHandler
;
}
}
}
namespace
xml
{
namespace
sax
{
class
XDocumentHandler
;
}
}
}
}
}
class
OdsGenerator
;
...
...
@@ -58,31 +68,31 @@ class ImportFilterImpl : public cppu::WeakImplHelper4
>
{
public
:
ImportFilterImpl
(
const
::
com
::
sun
::
star
::
uno
::
Reference
<
::
com
::
sun
::
star
::
uno
::
XComponentContext
>
&
rxContext
);
ImportFilterImpl
(
const
::
com
::
sun
::
star
::
uno
::
Reference
<
::
com
::
sun
::
star
::
uno
::
XComponentContext
>
&
rxContext
);
virtual
~
ImportFilterImpl
();
// XFilter
virtual
sal_Bool
SAL_CALL
filter
(
const
::
com
::
sun
::
star
::
uno
::
Sequence
<
::
com
::
sun
::
star
::
beans
::
PropertyValue
>&
aDescriptor
)
virtual
sal_Bool
SAL_CALL
filter
(
const
::
com
::
sun
::
star
::
uno
::
Sequence
<
::
com
::
sun
::
star
::
beans
::
PropertyValue
>
&
aDescriptor
)
throw
(
::
com
::
sun
::
star
::
uno
::
RuntimeException
,
std
::
exception
)
SAL_OVERRIDE
;
virtual
void
SAL_CALL
cancel
(
)
virtual
void
SAL_CALL
cancel
()
throw
(
::
com
::
sun
::
star
::
uno
::
RuntimeException
,
std
::
exception
)
SAL_OVERRIDE
;
// XImporter
virtual
void
SAL_CALL
setTargetDocument
(
const
::
com
::
sun
::
star
::
uno
::
Reference
<
::
com
::
sun
::
star
::
lang
::
XComponent
>&
xDoc
)
virtual
void
SAL_CALL
setTargetDocument
(
const
::
com
::
sun
::
star
::
uno
::
Reference
<
::
com
::
sun
::
star
::
lang
::
XComponent
>
&
xDoc
)
throw
(
::
com
::
sun
::
star
::
lang
::
IllegalArgumentException
,
::
com
::
sun
::
star
::
uno
::
RuntimeException
,
std
::
exception
)
SAL_OVERRIDE
;
//XExtendedFilterDetection
virtual
OUString
SAL_CALL
detect
(
com
::
sun
::
star
::
uno
::
Sequence
<
com
::
sun
::
star
::
beans
::
PropertyValue
>&
Descriptor
)
throw
(
com
::
sun
::
star
::
uno
::
RuntimeException
,
std
::
exception
)
SAL_OVERRIDE
;
virtual
OUString
SAL_CALL
detect
(
com
::
sun
::
star
::
uno
::
Sequence
<
com
::
sun
::
star
::
beans
::
PropertyValue
>
&
Descriptor
)
throw
(
com
::
sun
::
star
::
uno
::
RuntimeException
,
std
::
exception
)
SAL_OVERRIDE
;
// XInitialization
virtual
void
SAL_CALL
initialize
(
const
::
com
::
sun
::
star
::
uno
::
Sequence
<
::
com
::
sun
::
star
::
uno
::
Any
>&
aArguments
)
virtual
void
SAL_CALL
initialize
(
const
::
com
::
sun
::
star
::
uno
::
Sequence
<
::
com
::
sun
::
star
::
uno
::
Any
>
&
aArguments
)
throw
(
::
com
::
sun
::
star
::
uno
::
Exception
,
::
com
::
sun
::
star
::
uno
::
RuntimeException
,
std
::
exception
)
SAL_OVERRIDE
;
private
:
virtual
bool
doDetectFormat
(
librevenge
::
RVNGInputStream
&
rInput
,
OUString
&
rTypeName
)
=
0
;
virtual
bool
doImportDocument
(
librevenge
::
RVNGInputStream
&
rInput
,
librevenge
::
RVNGSpreadsheetInterface
&
rGenerator
)
=
0
;
virtual
void
doRegisterHandlers
(
OdsGenerator
&
rGenerator
);
virtual
bool
doDetectFormat
(
librevenge
::
RVNGInputStream
&
rInput
,
OUString
&
rTypeName
)
=
0
;
virtual
bool
doImportDocument
(
librevenge
::
RVNGInputStream
&
rInput
,
librevenge
::
RVNGSpreadsheetInterface
&
rGenerator
)
=
0
;
virtual
void
doRegisterHandlers
(
OdsGenerator
&
rGenerator
);
private
:
::
com
::
sun
::
star
::
uno
::
Reference
<
::
com
::
sun
::
star
::
uno
::
XComponentContext
>
mxContext
;
...
...
writerperfect/source/calc/MSWorksCalcImportFilter.cxx
Dosyayı görüntüle @
7de2366a
...
...
@@ -24,12 +24,12 @@ using com::sun::star::uno::Exception;
using
com
::
sun
::
star
::
uno
::
RuntimeException
;
using
com
::
sun
::
star
::
uno
::
XComponentContext
;
bool
MSWorksCalcImportFilter
::
doImportDocument
(
librevenge
::
RVNGInputStream
&
rInput
,
librevenge
::
RVNGSpreadsheetInterface
&
rGenerator
)
bool
MSWorksCalcImportFilter
::
doImportDocument
(
librevenge
::
RVNGInputStream
&
rInput
,
librevenge
::
RVNGSpreadsheetInterface
&
rGenerator
)
{
return
libwps
::
WPS_OK
==
libwps
::
WPSDocument
::
parse
(
&
rInput
,
&
rGenerator
);
}
bool
MSWorksCalcImportFilter
::
doDetectFormat
(
librevenge
::
RVNGInputStream
&
rInput
,
OUString
&
rTypeName
)
bool
MSWorksCalcImportFilter
::
doDetectFormat
(
librevenge
::
RVNGInputStream
&
rInput
,
OUString
&
rTypeName
)
{
libwps
::
WPSKind
kind
=
libwps
::
WPS_TEXT
;
const
libwps
::
WPSConfidence
confidence
=
libwps
::
WPSDocument
::
isFileFormatSupported
(
&
rInput
,
kind
);
...
...
@@ -43,17 +43,17 @@ bool MSWorksCalcImportFilter::doDetectFormat( librevenge::RVNGInputStream &rInpu
return
false
;
}
void
MSWorksCalcImportFilter
::
doRegisterHandlers
(
OdsGenerator
&
)
void
MSWorksCalcImportFilter
::
doRegisterHandlers
(
OdsGenerator
&
)
{
}
OUString
MSWorksCalcImportFilter_getImplementationName
()
OUString
MSWorksCalcImportFilter_getImplementationName
()
throw
(
RuntimeException
)
{
return
OUString
(
"com.sun.star.comp.Calc.MSWorksCalcImportFilter"
);
return
OUString
(
"com.sun.star.comp.Calc.MSWorksCalcImportFilter"
);
}
Sequence
<
OUString
>
SAL_CALL
MSWorksCalcImportFilter_getSupportedServiceNames
(
)
Sequence
<
OUString
>
SAL_CALL
MSWorksCalcImportFilter_getSupportedServiceNames
()
throw
(
RuntimeException
)
{
Sequence
<
OUString
>
aRet
(
2
);
...
...
@@ -65,24 +65,24 @@ throw (RuntimeException)
#undef SERVICE_NAME2
#undef SERVICE_NAME1
Reference
<
XInterface
>
SAL_CALL
MSWorksCalcImportFilter_createInstance
(
const
Reference
<
XComponentContext
>
&
rContext
)
throw
(
Exception
)
Reference
<
XInterface
>
SAL_CALL
MSWorksCalcImportFilter_createInstance
(
const
Reference
<
XComponentContext
>
&
rContext
)
throw
(
Exception
)
{
return
(
cppu
::
OWeakObject
*
)
new
MSWorksCalcImportFilter
(
rContext
);
return
(
cppu
::
OWeakObject
*
)
new
MSWorksCalcImportFilter
(
rContext
);
}
// XServiceInfo
OUString
SAL_CALL
MSWorksCalcImportFilter
::
getImplementationName
(
)
OUString
SAL_CALL
MSWorksCalcImportFilter
::
getImplementationName
()
throw
(
RuntimeException
,
std
::
exception
)
{
return
MSWorksCalcImportFilter_getImplementationName
();
}
sal_Bool
SAL_CALL
MSWorksCalcImportFilter
::
supportsService
(
const
OUString
&
rServiceName
)
sal_Bool
SAL_CALL
MSWorksCalcImportFilter
::
supportsService
(
const
OUString
&
rServiceName
)
throw
(
RuntimeException
,
std
::
exception
)
{
return
cppu
::
supportsService
(
this
,
rServiceName
);
return
cppu
::
supportsService
(
this
,
rServiceName
);
}
Sequence
<
OUString
>
SAL_CALL
MSWorksCalcImportFilter
::
getSupportedServiceNames
(
)
Sequence
<
OUString
>
SAL_CALL
MSWorksCalcImportFilter
::
getSupportedServiceNames
()
throw
(
RuntimeException
,
std
::
exception
)
{
return
MSWorksCalcImportFilter_getSupportedServiceNames
();
...
...
writerperfect/source/calc/MSWorksCalcImportFilter.hxx
Dosyayı görüntüle @
7de2366a
...
...
@@ -21,32 +21,32 @@
class
MSWorksCalcImportFilter
:
public
writerperfect
::
calc
::
ImportFilterBase
{
public
:
MSWorksCalcImportFilter
(
const
::
com
::
sun
::
star
::
uno
::
Reference
<
::
com
::
sun
::
star
::
uno
::
XComponentContext
>
&
rxContext
)
:
writerperfect
::
calc
::
ImportFilterBase
(
rxContext
)
{}
MSWorksCalcImportFilter
(
const
::
com
::
sun
::
star
::
uno
::
Reference
<
::
com
::
sun
::
star
::
uno
::
XComponentContext
>
&
rxContext
)
:
writerperfect
::
calc
::
ImportFilterBase
(
rxContext
)
{}
// XServiceInfo
virtual
OUString
SAL_CALL
getImplementationName
(
)
virtual
OUString
SAL_CALL
getImplementationName
()
throw
(
::
com
::
sun
::
star
::
uno
::
RuntimeException
,
std
::
exception
)
SAL_OVERRIDE
;
virtual
sal_Bool
SAL_CALL
supportsService
(
const
OUString
&
ServiceName
)
virtual
sal_Bool
SAL_CALL
supportsService
(
const
OUString
&
ServiceName
)
throw
(
::
com
::
sun
::
star
::
uno
::
RuntimeException
,
std
::
exception
)
SAL_OVERRIDE
;
virtual
::
com
::
sun
::
star
::
uno
::
Sequence
<
OUString
>
SAL_CALL
getSupportedServiceNames
(
)
virtual
::
com
::
sun
::
star
::
uno
::
Sequence
<
OUString
>
SAL_CALL
getSupportedServiceNames
()
throw
(
::
com
::
sun
::
star
::
uno
::
RuntimeException
,
std
::
exception
)
SAL_OVERRIDE
;
private
:
virtual
bool
doDetectFormat
(
librevenge
::
RVNGInputStream
&
rInput
,
OUString
&
rTypeName
)
SAL_OVERRIDE
;
virtual
bool
doImportDocument
(
librevenge
::
RVNGInputStream
&
rInput
,
librevenge
::
RVNGSpreadsheetInterface
&
rGenerator
)
SAL_OVERRIDE
;
virtual
void
doRegisterHandlers
(
OdsGenerator
&
rGenerator
)
SAL_OVERRIDE
;
virtual
bool
doDetectFormat
(
librevenge
::
RVNGInputStream
&
rInput
,
OUString
&
rTypeName
)
SAL_OVERRIDE
;
virtual
bool
doImportDocument
(
librevenge
::
RVNGInputStream
&
rInput
,
librevenge
::
RVNGSpreadsheetInterface
&
rGenerator
)
SAL_OVERRIDE
;
virtual
void
doRegisterHandlers
(
OdsGenerator
&
rGenerator
)
SAL_OVERRIDE
;
};
OUString
MSWorksCalcImportFilter_getImplementationName
()
throw
(
::
com
::
sun
::
star
::
uno
::
RuntimeException
);
throw
(
::
com
::
sun
::
star
::
uno
::
RuntimeException
);
::
com
::
sun
::
star
::
uno
::
Sequence
<
OUString
>
SAL_CALL
MSWorksCalcImportFilter_getSupportedServiceNames
(
)
throw
(
::
com
::
sun
::
star
::
uno
::
RuntimeException
);
::
com
::
sun
::
star
::
uno
::
Sequence
<
OUString
>
SAL_CALL
MSWorksCalcImportFilter_getSupportedServiceNames
()
throw
(
::
com
::
sun
::
star
::
uno
::
RuntimeException
);
::
com
::
sun
::
star
::
uno
::
Reference
<
::
com
::
sun
::
star
::
uno
::
XInterface
>
SAL_CALL
MSWorksCalcImportFilter_createInstance
(
const
::
com
::
sun
::
star
::
uno
::
Reference
<
::
com
::
sun
::
star
::
uno
::
XComponentContext
>
&
rContext
)
throw
(
::
com
::
sun
::
star
::
uno
::
Exception
);
SAL_CALL
MSWorksCalcImportFilter_createInstance
(
const
::
com
::
sun
::
star
::
uno
::
Reference
<
::
com
::
sun
::
star
::
uno
::
XComponentContext
>
&
rContext
)
throw
(
::
com
::
sun
::
star
::
uno
::
Exception
);
#endif
...
...
writerperfect/source/calc/MWAWCalcImportFilter.cxx
Dosyayı görüntüle @
7de2366a
...
...
@@ -39,12 +39,12 @@ static bool handleEmbeddedMWAWSpreadsheetObject(const librevenge::RVNGBinaryData
return
MWAWDocument
::
decodeSpreadsheet
(
data
,
&
exporter
);
}
bool
MWAWCalcImportFilter
::
doImportDocument
(
librevenge
::
RVNGInputStream
&
rInput
,
librevenge
::
RVNGSpreadsheetInterface
&
rGenerator
)
bool
MWAWCalcImportFilter
::
doImportDocument
(
librevenge
::
RVNGInputStream
&
rInput
,
librevenge
::
RVNGSpreadsheetInterface
&
rGenerator
)
{
return
MWAWDocument
::
MWAW_R_OK
==
MWAWDocument
::
parse
(
&
rInput
,
&
rGenerator
);
}
bool
MWAWCalcImportFilter
::
doDetectFormat
(
librevenge
::
RVNGInputStream
&
rInput
,
OUString
&
rTypeName
)
bool
MWAWCalcImportFilter
::
doDetectFormat
(
librevenge
::
RVNGInputStream
&
rInput
,
OUString
&
rTypeName
)
{
rTypeName
=
""
;
...
...
@@ -54,7 +54,7 @@ bool MWAWCalcImportFilter::doDetectFormat( librevenge::RVNGInputStream &rInput,
if
(
confidence
==
MWAWDocument
::
MWAW_C_EXCELLENT
)
{
if
(
docKind
==
MWAWDocument
::
MWAW_K_SPREADSHEET
||
docKind
==
MWAWDocument
::
MWAW_K_DATABASE
)
if
(
docKind
==
MWAWDocument
::
MWAW_K_SPREADSHEET
||
docKind
==
MWAWDocument
::
MWAW_K_DATABASE
)
{
switch
(
docType
)
{
...
...
@@ -143,19 +143,19 @@ bool MWAWCalcImportFilter::doDetectFormat( librevenge::RVNGInputStream &rInput,
return
!
rTypeName
.
isEmpty
();
}
void
MWAWCalcImportFilter
::
doRegisterHandlers
(
OdsGenerator
&
rGenerator
)
void
MWAWCalcImportFilter
::
doRegisterHandlers
(
OdsGenerator
&
rGenerator
)
{
rGenerator
.
registerEmbeddedObjectHandler
(
"image/mwaw-odg"
,
&
handleEmbeddedMWAWGraphicObject
);
rGenerator
.
registerEmbeddedObjectHandler
(
"image/mwaw-ods"
,
&
handleEmbeddedMWAWSpreadsheetObject
);
}
OUString
MWAWCalcImportFilter_getImplementationName
()
OUString
MWAWCalcImportFilter_getImplementationName
()
throw
(
RuntimeException
)
{
return
OUString
(
"com.sun.star.comp.Calc.MWAWCalcImportFilter"
);
return
OUString
(
"com.sun.star.comp.Calc.MWAWCalcImportFilter"
);
}
Sequence
<
OUString
>
SAL_CALL
MWAWCalcImportFilter_getSupportedServiceNames
(
)
Sequence
<
OUString
>
SAL_CALL
MWAWCalcImportFilter_getSupportedServiceNames
()
throw
(
RuntimeException
)
{
Sequence
<
OUString
>
aRet
(
2
);
...
...
@@ -165,24 +165,24 @@ throw (RuntimeException)
return
aRet
;
}
Reference
<
XInterface
>
SAL_CALL
MWAWCalcImportFilter_createInstance
(
const
Reference
<
XComponentContext
>
&
rContext
)
throw
(
Exception
)
Reference
<
XInterface
>
SAL_CALL
MWAWCalcImportFilter_createInstance
(
const
Reference
<
XComponentContext
>
&
rContext
)
throw
(
Exception
)
{
return
(
cppu
::
OWeakObject
*
)
new
MWAWCalcImportFilter
(
rContext
);
return
(
cppu
::
OWeakObject
*
)
new
MWAWCalcImportFilter
(
rContext
);
}
// XServiceInfo
OUString
SAL_CALL
MWAWCalcImportFilter
::
getImplementationName
(
)
OUString
SAL_CALL
MWAWCalcImportFilter
::
getImplementationName
()
throw
(
RuntimeException
,
std
::
exception
)
{
return
MWAWCalcImportFilter_getImplementationName
();
}
sal_Bool
SAL_CALL
MWAWCalcImportFilter
::
supportsService
(
const
OUString
&
rServiceName
)
sal_Bool
SAL_CALL
MWAWCalcImportFilter
::
supportsService
(
const
OUString
&
rServiceName
)
throw
(
RuntimeException
,
std
::
exception
)
{
return
cppu
::
supportsService
(
this
,
rServiceName
);
return
cppu
::
supportsService
(
this
,
rServiceName
);
}
Sequence
<
OUString
>
SAL_CALL
MWAWCalcImportFilter
::
getSupportedServiceNames
(
)
Sequence
<
OUString
>
SAL_CALL
MWAWCalcImportFilter
::
getSupportedServiceNames
()
throw
(
RuntimeException
,
std
::
exception
)
{
return
MWAWCalcImportFilter_getSupportedServiceNames
();
...
...
writerperfect/source/calc/MWAWCalcImportFilter.hxx
Dosyayı görüntüle @
7de2366a
...
...
@@ -21,32 +21,32 @@
class
MWAWCalcImportFilter
:
public
writerperfect
::
calc
::
ImportFilterBase
{
public
:
MWAWCalcImportFilter
(
const
::
com
::
sun
::
star
::
uno
::
Reference
<
::
com
::
sun
::
star
::
uno
::
XComponentContext
>
&
rxContext
)
:
writerperfect
::
calc
::
ImportFilterBase
(
rxContext
)
{}
MWAWCalcImportFilter
(
const
::
com
::
sun
::
star
::
uno
::
Reference
<
::
com
::
sun
::
star
::
uno
::
XComponentContext
>
&
rxContext
)
:
writerperfect
::
calc
::
ImportFilterBase
(
rxContext
)
{}
// XServiceInfo
virtual
OUString
SAL_CALL
getImplementationName
(
)
virtual
OUString
SAL_CALL
getImplementationName
()
throw
(
::
com
::
sun
::
star
::
uno
::
RuntimeException
,
std
::
exception
)
SAL_OVERRIDE
;
virtual
sal_Bool
SAL_CALL
supportsService
(
const
OUString
&
ServiceName
)
virtual
sal_Bool
SAL_CALL
supportsService
(
const
OUString
&
ServiceName
)
throw
(
::
com
::
sun
::
star
::
uno
::
RuntimeException
,
std
::
exception
)
SAL_OVERRIDE
;
virtual
::
com
::
sun
::
star
::
uno
::
Sequence
<
OUString
>
SAL_CALL
getSupportedServiceNames
(
)
virtual
::
com
::
sun
::
star
::
uno
::
Sequence
<
OUString
>
SAL_CALL
getSupportedServiceNames
()
throw
(
::
com
::
sun
::
star
::
uno
::
RuntimeException
,
std
::
exception
)
SAL_OVERRIDE
;
private
:
virtual
bool
doDetectFormat
(
librevenge
::
RVNGInputStream
&
rInput
,
OUString
&
rTypeName
)
SAL_OVERRIDE
;
virtual
bool
doImportDocument
(
librevenge
::
RVNGInputStream
&
rInput
,
librevenge
::
RVNGSpreadsheetInterface
&
rGenerator
)
SAL_OVERRIDE
;
virtual
void
doRegisterHandlers
(
OdsGenerator
&
rGenerator
)
SAL_OVERRIDE
;
virtual
bool
doDetectFormat
(
librevenge
::
RVNGInputStream
&
rInput
,
OUString
&
rTypeName
)
SAL_OVERRIDE
;
virtual
bool
doImportDocument
(
librevenge
::
RVNGInputStream
&
rInput
,
librevenge
::
RVNGSpreadsheetInterface
&
rGenerator
)
SAL_OVERRIDE
;
virtual
void
doRegisterHandlers
(
OdsGenerator
&
rGenerator
)
SAL_OVERRIDE
;
};
OUString
MWAWCalcImportFilter_getImplementationName
()
throw
(
::
com
::
sun
::
star
::
uno
::
RuntimeException
);
throw
(
::
com
::
sun
::
star
::
uno
::
RuntimeException
);
::
com
::
sun
::
star
::
uno
::
Sequence
<
OUString
>
SAL_CALL
MWAWCalcImportFilter_getSupportedServiceNames
(
)
throw
(
::
com
::
sun
::
star
::
uno
::
RuntimeException
);
::
com
::
sun
::
star
::
uno
::
Sequence
<
OUString
>
SAL_CALL
MWAWCalcImportFilter_getSupportedServiceNames
()
throw
(
::
com
::
sun
::
star
::
uno
::
RuntimeException
);
::
com
::
sun
::
star
::
uno
::
Reference
<
::
com
::
sun
::
star
::
uno
::
XInterface
>
SAL_CALL
MWAWCalcImportFilter_createInstance
(
const
::
com
::
sun
::
star
::
uno
::
Reference
<
::
com
::
sun
::
star
::
uno
::
XComponentContext
>
&
rContext
)
throw
(
::
com
::
sun
::
star
::
uno
::
Exception
);
SAL_CALL
MWAWCalcImportFilter_createInstance
(
const
::
com
::
sun
::
star
::
uno
::
Reference
<
::
com
::
sun
::
star
::
uno
::
XComponentContext
>
&
rContext
)
throw
(
::
com
::
sun
::
star
::
uno
::
Exception
);
#endif
...
...
writerperfect/source/calc/wpftcalc_genericfilter.cxx
Dosyayı görüntüle @
7de2366a
...
...
@@ -32,24 +32,31 @@
#include "MSWorksCalcImportFilter.hxx"
#include "MWAWCalcImportFilter.hxx"
namespace
{
namespace
{
static
cppu
::
ImplementationEntry
const
services
[]
=
{
{
&
MSWorksCalcImportFilter_createInstance
,
&
MSWorksCalcImportFilter_getImplementationName
,
&
MSWorksCalcImportFilter_getSupportedServiceNames
,
&
cppu
::
createSingleComponentFactory
,
0
,
0
},
{
&
MWAWCalcImportFilter_createInstance
,
&
MWAWCalcImportFilter_getImplementationName
,
&
MWAWCalcImportFilter_getSupportedServiceNames
,
&
cppu
::
createSingleComponentFactory
,
0
,
0
},
{
0
,
0
,
0
,
0
,
0
,
0
}
};
static
cppu
::
ImplementationEntry
const
services
[]
=
{
{
&
MSWorksCalcImportFilter_createInstance
,
&
MSWorksCalcImportFilter_getImplementationName
,
&
MSWorksCalcImportFilter_getSupportedServiceNames
,
&
cppu
::
createSingleComponentFactory
,
0
,
0