Commits

Anonymous committed 0c13175

gnumake4: #i117845#: sw: do not link objects into two libraries

Comments (0)

Files changed (6)

 	svt \
 	svx \
 	svxcore \
+	swd \
 	tk \
 	tl \
 	ucbhelper \
 	sw/source/filter/ascii/wrtasc \
 	sw/source/filter/basflt/docfact \
 	sw/source/filter/basflt/fltini \
-	sw/source/filter/basflt/iodetect \
 	sw/source/filter/basflt/shellio \
 	sw/source/filter/html/SwAppletImpl \
 	sw/source/filter/html/css1atr \

sw/Library_swd.mk

 	-I$(OUTDIR)/inc/offuh \
 ))
 
+$(eval $(call gb_Library_add_defs,swd,\
+	-DSWD_DLLIMPLEMENTATION \
+))
+
 $(eval $(call gb_Library_add_linked_libs,swd,\
 	comphelper \
 	cppu \
 ))
 
 $(eval $(call gb_Library_add_exception_objects,swd,\
-	sw/source/core/except/errhdl \
 	sw/source/filter/basflt/iodetect \
 	sw/source/ui/uno/detreg \
 	sw/source/ui/uno/swdet2 \

sw/Library_swui.mk

 	svx \
 	svxcore \
 	sw \
+	swd \
 	tk \
 	tl \
 	ucbhelper \

sw/inc/iodetect.hxx

 #include <osl/endian.h>
 #include <errhdl.hxx>		// for ASSERT
 #include <tools/string.hxx>
-#include <swdllapi.h>
+#include <swddllapi.h>
 
 #define FILTER_RTF      "RTF"       // RTF-Filter
 #define sRtfWH          "WH_RTF"
     MAXFILTER
 };
 
-extern SwIoDetect aFilterDetect[];
+extern SWD_DLLPUBLIC SwIoDetect aFilterDetect[];
 
 // Die folgende Klasse ist ein Wrappe fuer die Basic-I/O-Funktionen
 // des Writer 3.0. Alles ist statisch. Alle u.a. Filternamen sind die
 {
 public:
     // suche ueber den internen FormatNamen den Filtereintrag
-    SW_DLLPUBLIC static const SfxFilter* GetFilterOfFormat( const String& rFormat,
+    SWD_DLLPUBLIC static const SfxFilter*
+        GetFilterOfFormat( const String& rFormat,
             const SfxFilterContainer* pCnt = 0 );
 
     // Feststellen des zu verwendenden Filters fuer die uebergebene
     // Datei. Der Filtername wird zurueckgeliefert. Konnte kein Filter
     // zurueckgeliefert werden, wird der Name des ASCII-Filters geliefert!
-    static const SfxFilter* GetFileFilter( const String& rFileName,
+    SWD_DLLPUBLIC static const SfxFilter*
+        GetFileFilter( const String& rFileName,
             const String& rPrefFltName,
             SfxMedium* pMedium = 0 );
 
     static sal_Bool IsValidStgFilter( SotStorage& , const SfxFilter& );
     static sal_Bool IsValidStgFilter( const com::sun::star::uno::Reference < com::sun::star::embed::XStorage >& rStg, const SfxFilter& rFilter);
 
-    static bool IsDetectableText( const sal_Char* pBuf, sal_uLong &rLen, 
+    SWD_DLLPUBLIC static bool
+        IsDetectableText( const sal_Char* pBuf, sal_uLong &rLen,
             CharSet *pCharSet=0, bool *pSwap=0, LineEnd *pLineEnd=0, bool bEncodedFilter = false );
     //    static bool IsDetectableW4W(const String& rFileName, const String& rUserData);
 
     static const SfxFilter* GetTextFilter( const sal_Char* pBuf, sal_uLong nLen );
 
-    static const String GetSubStorageName( const SfxFilter& rFltr );
+    SWD_DLLPUBLIC static const String
+        GetSubStorageName( const SfxFilter& rFltr );
 };
 
 #endif

sw/inc/swddllapi.h

+#ifndef INCLUDED_SWDDLLAPI_H
+#define INCLUDED_SWDDLLAPI_H
+
+#include "sal/types.h"
+
+#if defined(SWD_DLLIMPLEMENTATION)
+#define SWD_DLLPUBLIC  SAL_DLLPUBLIC_EXPORT
+#else
+#define SWD_DLLPUBLIC  SAL_DLLPUBLIC_IMPORT
+#endif
+#define SWD_DLLPRIVATE SAL_DLLPRIVATE
+
+#endif /* INCLUDED_SWDDLLAPI_H */

sw/source/filter/basflt/iodetect.cxx

 
 void TerminateBuffer(sal_Char *pBuffer, sal_uLong nBytesRead, sal_uLong nBufferLen)
 {
-    ASSERT(nBytesRead <= nBufferLen - 2,
+    OSL_ENSURE(nBytesRead <= nBufferLen - 2,
             "what you read must be less than the max + null termination");
-    ASSERT(!(nBufferLen & 0x00000001), "nMaxReadBuf must be an even number");
+    OSL_ENSURE(!(nBufferLen & 0x00000001),"nMaxReadBuf must be an even number");
     if (nBytesRead <= nBufferLen - 2)
     {
         pBuffer[nBytesRead] = '\0';