diff options
Diffstat (limited to 'hwpfilter')
-rw-r--r-- | hwpfilter/CppunitTest_hwpfilter_test_hwpfilter.mk | 7 | ||||
-rw-r--r-- | hwpfilter/Library_hwp.mk | 7 | ||||
-rw-r--r-- | hwpfilter/prj/build.lst | 2 | ||||
-rw-r--r-- | hwpfilter/source/htags.cxx | 7 | ||||
-rw-r--r-- | hwpfilter/source/htags.h | 4 | ||||
-rw-r--r-- | hwpfilter/source/hwpreader.cxx | 5 | ||||
-rw-r--r-- | hwpfilter/source/hwpreader.hxx | 11 |
7 files changed, 22 insertions, 21 deletions
diff --git a/hwpfilter/CppunitTest_hwpfilter_test_hwpfilter.mk b/hwpfilter/CppunitTest_hwpfilter_test_hwpfilter.mk index 5e053286fc86..386e6fa04da3 100644 --- a/hwpfilter/CppunitTest_hwpfilter_test_hwpfilter.mk +++ b/hwpfilter/CppunitTest_hwpfilter_test_hwpfilter.mk @@ -46,10 +46,14 @@ $(eval $(call gb_CppunitTest_add_linked_libs,hwpfilter_test_hwpfilter, \ $(eval $(call gb_CppunitTest_set_include,hwpfilter_test_hwpfilter,\ $$(INCLUDE) \ - -I$(OUTDIR)/inc/offuh \ -I$(OUTDIR)/inc \ )) +$(eval $(call gb_CppunitTest_add_api,hwpfilter_test_hwpfilter,\ + offapi \ + udkapi \ +)) + $(eval $(call gb_CppunitTest_uses_ure,hwpfilter_test_hwpfilter)) $(eval $(call gb_CppunitTest_add_type_rdbs,hwpfilter_test_hwpfilter,\ @@ -63,6 +67,7 @@ $(eval $(call gb_CppunitTest_add_service_rdbs,hwpfilter_test_hwpfilter,\ $(eval $(call gb_CppunitTest_set_args,hwpfilter_test_hwpfilter,\ --headless \ --invisible \ + --protector unoexceptionprotector$(gb_Library_DLLEXT) unoexceptionprotector \ )) $(eval $(call gb_RdbTarget_RdbTarget,hwpfilter_test_hwpfilter)) diff --git a/hwpfilter/Library_hwp.mk b/hwpfilter/Library_hwp.mk index 87fef9fa66de..ee337a47a2a7 100644 --- a/hwpfilter/Library_hwp.mk +++ b/hwpfilter/Library_hwp.mk @@ -32,7 +32,11 @@ $(eval $(call gb_Library_add_precompiled_header,hwp,$(SRCDIR)/hwpfilter/inc/pch/ $(eval $(call gb_Library_set_include,hwp,\ $$(INCLUDE) \ -I$(realpath $(SRCDIR)/hwpfilter/inc/pch) \ - -I$(OUTDIR)/inc/offuh \ +)) + +$(eval $(call gb_Library_add_api,hwp,\ + offapi \ + udkapi \ )) $(eval $(call gb_Library_add_linked_libs,hwp,\ @@ -49,6 +53,7 @@ ifeq ($(OS),WNT) $(eval $(call gb_Library_add_linked_libs,hwp,\ ole32 \ + user32 \ uuid \ )) diff --git a/hwpfilter/prj/build.lst b/hwpfilter/prj/build.lst index 3fa47f767bfe..5eb79927bdd0 100644 --- a/hwpfilter/prj/build.lst +++ b/hwpfilter/prj/build.lst @@ -1,2 +1,2 @@ -hw hwpfilter : offuh cppuhelper ZLIB:zlib LIBXSLT:libxslt ucbhelper ucb ure NULL +hw hwpfilter : offapi cppuhelper ZLIB:zlib LIBXSLT:libxslt ucbhelper ucb ure test NULL hw hwpfilter\prj nmake - all hw_prj NULL diff --git a/hwpfilter/source/htags.cxx b/hwpfilter/source/htags.cxx index 30244a83f9b8..94cc05058d7c 100644 --- a/hwpfilter/source/htags.cxx +++ b/hwpfilter/source/htags.cxx @@ -59,9 +59,10 @@ bool HyperText::Read(HWPFile & hwpf) } -EmPicture::EmPicture(int tsize):size(tsize - 32) +EmPicture::EmPicture(size_t tsize) + : size(tsize >= 32 ? tsize - 32 : 0) { - if (size <= 0) + if (size == 0) data = 0; else data = new uchar[size]; @@ -82,7 +83,7 @@ EmPicture::~EmPicture(void) bool EmPicture::Read(HWPFile & hwpf) { - if (size <= 0) + if (size == 0) return false; hwpf.Read1b(name, 16); hwpf.Read1b(type, 16); diff --git a/hwpfilter/source/htags.h b/hwpfilter/source/htags.h index bb244c07dd59..21c610db4e9d 100644 --- a/hwpfilter/source/htags.h +++ b/hwpfilter/source/htags.h @@ -39,12 +39,12 @@ class HWPFile; */ struct EmPicture { - int size; + size_t size; char name[16]; char type[16]; uchar *data; - EmPicture(int size); + EmPicture(size_t size); ~EmPicture(void); bool Read(HWPFile& hwpf); diff --git a/hwpfilter/source/hwpreader.cxx b/hwpfilter/source/hwpreader.cxx index 47e8a50d5cbe..8bcef10460df 100644 --- a/hwpfilter/source/hwpreader.cxx +++ b/hwpfilter/source/hwpreader.cxx @@ -538,12 +538,13 @@ void HwpReader::makeDrawMiscStyle( HWPDrawingObject *hdo ) if( (fd = open( filename , O_CREAT | O_WRONLY , 0666)) >= 0 ) #endif { - write( fd, emp->data, emp->size ); + size_t nWritten = write(fd, emp->data, emp->size); + OSL_VERIFY(nWritten == emp->size); close(fd); } #ifdef _WIN32 int j; - for( j = 0 ; j < (int)strlen( dirname ) ; j++) + for(j = 0 ; j < (int)strlen( dirname ) ; j++) { if( dirname[j] == '\\' ) buf[j] = '/'; else buf[j] = dirname[j]; diff --git a/hwpfilter/source/hwpreader.hxx b/hwpfilter/source/hwpreader.hxx index 7676aafe0dc3..6a7ce4faa4de 100644 --- a/hwpfilter/source/hwpreader.hxx +++ b/hwpfilter/source/hwpreader.hxx @@ -338,19 +338,8 @@ Sequence< OUString> HwpImportFilter::getSupportedServiceNames() throw(::com::sun return aRet; } -///////////////////////////////////////////////////////////////////////////////////// -// The below three C functions are nessesary for this shared library is treaded as -// UNO component library. -///////////////////////////////////////////////////////////////////////////////////// extern "C" { - - SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnvironment( - const sal_Char ** ppEnvTypeName, uno_Environment ** ) - { - *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; - } - SAL_DLLPUBLIC_EXPORT void * SAL_CALL component_getFactory( const sal_Char * pImplName, void * pServiceManager, void * ) { void * pRet = 0; |