diff options
author | Bjoern Michaelsen <bjoern.michaelsen@canonical.com> | 2011-07-21 18:56:16 +0200 |
---|---|---|
committer | Bjoern Michaelsen <bjoern.michaelsen@canonical.com> | 2011-07-21 18:56:16 +0200 |
commit | a233dac0653f3f3054f7ad2da114ed989747e89a (patch) | |
tree | bf1e11438321c06125a94308649c496648061ccb | |
parent | acb6133d89abe071108577f821d7eaa381378879 (diff) | |
parent | e5647de7dd26775e45af24f11ac4f82a5518bd9e (diff) |
resyncing to master
662 files changed, 10722 insertions, 20409 deletions
diff --git a/basebmp/inc/basebmp/bitmapdevice.hxx b/basebmp/inc/basebmp/bitmapdevice.hxx index 488425cde4c0..0db4099213f4 100644 --- a/basebmp/inc/basebmp/bitmapdevice.hxx +++ b/basebmp/inc/basebmp/bitmapdevice.hxx @@ -67,6 +67,11 @@ typedef boost::shared_ptr< const std::vector<Color> > PaletteMemorySharedVecto struct ImplBitmapDevice; +class BitmapDeviceDamageTracker { + public: + virtual void damaged (const basegfx::B2IRange& rDamageRect) = 0; +}; + /** Definition of BitmapDevice interface Use the createBitmapDevice() factory method to create instances. @@ -115,6 +120,8 @@ public: */ RawMemorySharedArray getBuffer() const; + BitmapDeviceDamageTracker *getDamageTracker() const; + /** Get pointer to palette The returned pointer is const on purpose, since the @@ -548,7 +555,8 @@ protected: sal_Int32 nScanlineStride, sal_uInt8* pFirstScanline, const RawMemorySharedArray& rMem, - const PaletteMemorySharedVector& rPalette ); + const PaletteMemorySharedVector& rPalette, + BitmapDeviceDamageTracker* pDamage = NULL ); virtual ~BitmapDevice(); @@ -648,7 +656,8 @@ private: */ BASEBMP_DLLPUBLIC BitmapDeviceSharedPtr createBitmapDevice( const basegfx::B2IVector& rSize, bool bTopDown, - sal_Int32 nScanlineFormat ); + sal_Int32 nScanlineFormat, + BitmapDeviceDamageTracker* pDamage = NULL ); /** Factory method to create a BitmapDevice for given scanline format with the given palette diff --git a/basebmp/source/bitmapdevice.cxx b/basebmp/source/bitmapdevice.cxx index bf4cafd16cb2..a483197aa54d 100644 --- a/basebmp/source/bitmapdevice.cxx +++ b/basebmp/source/bitmapdevice.cxx @@ -273,6 +273,7 @@ namespace dest_iterator_type maBegin; typename accessor_traits::color_lookup maColorLookup; + BitmapDeviceDamageTracker *mpDamage; to_uint32_functor maToUInt32Converter; dest_accessor_type maAccessor; colorblend_accessor_type maColorBlendAccessor; @@ -288,6 +289,7 @@ namespace raw_maskedxor_accessor_type maRawMaskedXorAccessor; raw_maskedmask_accessor_type maRawMaskedMaskAccessor; + // ------------------------------------------------------- BitmapRenderer( const basegfx::B2IRange& rBounds, @@ -298,11 +300,14 @@ namespace raw_accessor_type rawAccessor, dest_accessor_type accessor, const RawMemorySharedArray& rMem, - const PaletteMemorySharedVector& rPalette ) : + const PaletteMemorySharedVector& rPalette, + BitmapDeviceDamageTracker* pDamage ) : BitmapDevice( rBounds, nScanlineFormat, - nScanlineStride, pFirstScanline, rMem, rPalette ), + nScanlineStride, pFirstScanline, rMem, rPalette, + pDamage ), maBegin( begin ), maColorLookup(), + mpDamage( pDamage ), maToUInt32Converter(), maAccessor( accessor ), maColorBlendAccessor( accessor ), @@ -320,6 +325,32 @@ namespace {} private: + + void damaged( const basegfx::B2IRange& rDamageRect ) const + { + if( mpDamage ) + mpDamage->damaged( rDamageRect ); + } + + void damagedPointSize( const basegfx::B2IPoint& rPoint, + const basegfx::B2IRange& rSize ) const + { + if( mpDamage ) { + basegfx::B2IPoint aLower( rPoint.getX() + rSize.getWidth(), + rPoint.getY() + rSize.getHeight() ); + damaged( basegfx::B2IRange( rPoint, aLower ) ); + } + } + + void damagedPixel( const basegfx::B2IPoint& rDamagePoint ) const + { + if( !mpDamage ) + return; + basegfx::B2IPoint aEnd( rDamagePoint.getX() + 1, + rDamagePoint.getY() + 1 ); + damaged( basegfx::B2IRange( rDamagePoint, aEnd ) ); + } + boost::shared_ptr<BitmapRenderer> getCompatibleBitmap( const BitmapDeviceSharedPtr& bmp ) const { return boost::dynamic_pointer_cast< BitmapRenderer >( bmp ); @@ -373,6 +404,7 @@ namespace maColorLookup( maAccessor, fillColor) ); + damaged( rBounds ); } virtual void setPixel_i( const basegfx::B2IPoint& rPt, @@ -388,6 +420,7 @@ namespace else maAccessor.set( pixelColor, pixel ); + damagedPixel(rPt); } virtual void setPixel_i( const basegfx::B2IPoint& rPt, @@ -411,6 +444,7 @@ namespace else maMaskedAccessor.set( pixelColor, aIter ); + damagedPixel(rPt); } virtual Color getPixel_i(const basegfx::B2IPoint& rPt ) @@ -443,6 +477,9 @@ namespace col, begin, rawAcc ); + // FIXME: perhaps this needs pushing up the stack a bit + // to make more complex polygons more efficient ... + damaged( basegfx::B2IRange( rPt1, rPt2 ) ); } template< typename Iterator, typename Accessor, typename RawAcc > @@ -593,6 +630,12 @@ namespace rBounds, aPoly, basegfx::FillRule_EVEN_ODD ); + + if( mpDamage ) + { + basegfx::B2DRange const aPolyBounds( basegfx::tools::getRange(aPoly) ); + damaged( basegfx::fround( aPolyBounds ) ); + } } virtual void fillPolyPolygon_i(const basegfx::B2DPolyPolygon& rPoly, @@ -648,6 +691,7 @@ namespace acc, rDstRect), rSrcBitmap.get() == this ); + damaged( rDstRect ); } template< typename Iterator, typename Acc > @@ -666,6 +710,7 @@ namespace destIterRange(begin, acc, rDstRect)); + damaged( rDstRect ); } virtual void drawBitmap_i(const BitmapDeviceSharedPtr& rSrcBitmap, @@ -695,6 +740,7 @@ namespace maBegin, maAccessor); } + damaged( rDstRect ); } virtual void drawBitmap_i(const BitmapDeviceSharedPtr& rSrcBitmap, @@ -725,6 +771,7 @@ namespace getMaskedIter(rClip), maMaskedAccessor); } + damaged( rDstRect ); } virtual void drawMaskedColor_i(Color aSrcColor, @@ -773,6 +820,7 @@ namespace maGenericColorBlendAccessor, rDstPoint) ); } + damagedPointSize( rDstPoint, rSrcRect ); } virtual void drawMaskedColor_i(Color aSrcColor, @@ -835,6 +883,7 @@ namespace maGenericMaskedColorBlendAccessor, rDstPoint) ); } + damagedPointSize( rDstPoint, rSrcRect ); } template< typename Iterator, typename Acc > @@ -865,6 +914,7 @@ namespace FastMask >::type(acc), rDstRect), rSrcBitmap.get() == this); + damaged( rDstRect ); } template< typename Iterator, typename Acc > @@ -898,6 +948,7 @@ namespace Masks::clipmask_polarity, NoFastMask >::type(acc), rDstRect)); + damaged( rDstRect ); } virtual void drawMaskedBitmap_i(const BitmapDeviceSharedPtr& rSrcBitmap, @@ -933,6 +984,7 @@ namespace maBegin, maAccessor); } + damaged( rDstRect ); } virtual void drawMaskedBitmap_i(const BitmapDeviceSharedPtr& rSrcBitmap, @@ -969,6 +1021,7 @@ namespace getMaskedIter(rClip), maMaskedAccessor); } + damaged( rDstRect ); } }; } // namespace @@ -981,6 +1034,8 @@ struct ImplBitmapDevice */ RawMemorySharedArray mpMem; + BitmapDeviceDamageTracker *mpDamage; + /// Palette memory plus deleter (might be NULL) PaletteMemorySharedVector mpPalette; @@ -1037,10 +1092,12 @@ BitmapDevice::BitmapDevice( const basegfx::B2IRange& rBounds, sal_Int32 nScanlineStride, sal_uInt8* pFirstScanline, const RawMemorySharedArray& rMem, - const PaletteMemorySharedVector& rPalette ) : + const PaletteMemorySharedVector& rPalette, + BitmapDeviceDamageTracker* pDamage ) : mpImpl( new ImplBitmapDevice ) { mpImpl->mpMem = rMem; + mpImpl->mpDamage = pDamage; mpImpl->mpPalette = rPalette; mpImpl->maBounds = rBounds; mpImpl->maLineClipRect = basegfx::B2IRange( rBounds.getMinX(), @@ -1059,7 +1116,6 @@ BitmapDevice::~BitmapDevice() basegfx::B2IVector BitmapDevice::getSize() const { - return basegfx::B2IVector( mpImpl->maBounds.getMaxX() - mpImpl->maBounds.getMinX(), mpImpl->maBounds.getMaxY() - mpImpl->maBounds.getMinY() ); @@ -1091,6 +1147,11 @@ PaletteMemorySharedVector BitmapDevice::getPalette() const return mpImpl->mpPalette; } +BitmapDeviceDamageTracker *BitmapDevice::getDamageTracker() const +{ + return mpImpl->mpDamage; +} + sal_Int32 BitmapDevice::getPaletteEntryCount() const { return mpImpl->mpPalette ? mpImpl->mpPalette->size() : 0; @@ -1641,8 +1702,8 @@ BitmapDeviceSharedPtr createRenderer( typename FormatTraits::accessor_selector::template wrap_accessor< typename FormatTraits::raw_accessor_type>::type const& rAccessor, boost::shared_array< sal_uInt8 > pMem, - const PaletteMemorySharedVector& pPal ) - + const PaletteMemorySharedVector& pPal, + BitmapDeviceDamageTracker* pDamage ) #else template< class FormatTraits, class MaskTraits, class Accessor > @@ -1654,7 +1715,8 @@ BitmapDeviceSharedPtr createRenderer( typename FormatTraits::raw_accessor_type const& rRawAccessor, Accessor const& rAccessor, boost::shared_array< sal_uInt8 > pMem, - const PaletteMemorySharedVector& pPal ) + const PaletteMemorySharedVector& pPal, + BitmapDeviceDamageTracker* pDamage ) #endif { @@ -1676,7 +1738,8 @@ BitmapDeviceSharedPtr createRenderer( rRawAccessor, rAccessor, pMem, - pPal )); + pPal, + pDamage )); } /// Create standard grey level palette @@ -1707,7 +1770,8 @@ BitmapDeviceSharedPtr createRenderer( sal_Int32 nScanlineStride, sal_uInt8* pFirstScanline, boost::shared_array< sal_uInt8 > pMem, - const PaletteMemorySharedVector& pPal ) + const PaletteMemorySharedVector& pPal, + BitmapDeviceDamageTracker* pDamage ) { return createRenderer<FormatTraits, MaskTraits>(rBounds, @@ -1719,7 +1783,8 @@ BitmapDeviceSharedPtr createRenderer( wrap_accessor< typename FormatTraits::raw_accessor_type>::type(), pMem, - pPal); + pPal, + pDamage); } template< class FormatTraits, class MaskTraits > @@ -1730,7 +1795,8 @@ BitmapDeviceSharedPtr createRenderer( sal_uInt8* pFirstScanline, boost::shared_array< sal_uInt8 > pMem, PaletteMemorySharedVector pPal, - int nBitsPerPixel ) + int nBitsPerPixel, + BitmapDeviceDamageTracker* pDamage ) { pPal = createStandardPalette(pPal, 1UL << nBitsPerPixel); @@ -1748,7 +1814,8 @@ BitmapDeviceSharedPtr createRenderer( &pPal->at(0), pPal->size()), pMem, - pPal); + pPal, + pDamage); } //---------------------------------------------------------------------------------- @@ -1784,7 +1851,8 @@ BitmapDeviceSharedPtr createBitmapDeviceImpl( const basegfx::B2IVector& r sal_Int32 nScanlineFormat, boost::shared_array< sal_uInt8 > pMem, PaletteMemorySharedVector pPal, - const basegfx::B2IRange* pSubset ) + const basegfx::B2IRange* pSubset, + BitmapDeviceDamageTracker* pDamage ) { if( nScanlineFormat <= Format::NONE || nScanlineFormat > Format::MAX ) @@ -1852,24 +1920,24 @@ BitmapDeviceSharedPtr createBitmapDeviceImpl( const basegfx::B2IVector& r case Format::ONE_BIT_MSB_GREY: return createRenderer<PixelFormatTraits_GREY1_MSB,StdMasks>( aBounds, nScanlineFormat, nScanlineStride, - pFirstScanline, pMem, pPal ); + pFirstScanline, pMem, pPal, pDamage ); case Format::ONE_BIT_LSB_GREY: return createRenderer<PixelFormatTraits_GREY1_LSB,StdMasks>( aBounds, nScanlineFormat, nScanlineStride, - pFirstScanline, pMem, pPal ); + pFirstScanline, pMem, pPal, pDamage ); case Format::ONE_BIT_MSB_PAL: return createRenderer<PixelFormatTraits_PAL1_MSB,StdMasks>( aBounds, nScanlineFormat, nScanlineStride, pFirstScanline, pMem, pPal, - bitsPerPixel[nScanlineFormat] ); + bitsPerPixel[nScanlineFormat], pDamage ); case Format::ONE_BIT_LSB_PAL: return createRenderer<PixelFormatTraits_PAL1_LSB,StdMasks>( aBounds, nScanlineFormat, nScanlineStride, pFirstScanline, pMem, pPal, - bitsPerPixel[nScanlineFormat] ); + bitsPerPixel[nScanlineFormat], pDamage ); // ---------------------------------------------------------------------- @@ -1878,24 +1946,24 @@ BitmapDeviceSharedPtr createBitmapDeviceImpl( const basegfx::B2IVector& r case Format::FOUR_BIT_MSB_GREY: return createRenderer<PixelFormatTraits_GREY4_MSB,StdMasks>( aBounds, nScanlineFormat, nScanlineStride, - pFirstScanline, pMem, pPal ); + pFirstScanline, pMem, pPal, pDamage ); case Format::FOUR_BIT_LSB_GREY: return createRenderer<PixelFormatTraits_GREY4_LSB,StdMasks>( aBounds, nScanlineFormat, nScanlineStride, - pFirstScanline, pMem, pPal ); + pFirstScanline, pMem, pPal, pDamage ); case Format::FOUR_BIT_MSB_PAL: return createRenderer<PixelFormatTraits_PAL4_MSB,StdMasks>( aBounds, nScanlineFormat, nScanlineStride, pFirstScanline, pMem, pPal, - bitsPerPixel[nScanlineFormat] ); + bitsPerPixel[nScanlineFormat], pDamage ); case Format::FOUR_BIT_LSB_PAL: return createRenderer<PixelFormatTraits_PAL4_LSB,StdMasks>( aBounds, nScanlineFormat, nScanlineStride, pFirstScanline, pMem, pPal, - bitsPerPixel[nScanlineFormat] ); + bitsPerPixel[nScanlineFormat], pDamage ); // ---------------------------------------------------------------------- @@ -1904,13 +1972,13 @@ BitmapDeviceSharedPtr createBitmapDeviceImpl( const basegfx::B2IVector& r case Format::EIGHT_BIT_GREY: return createRenderer<PixelFormatTraits_GREY8,StdMasks>( aBounds, nScanlineFormat, nScanlineStride, - pFirstScanline, pMem, pPal ); + pFirstScanline, pMem, pPal, pDamage ); case Format::EIGHT_BIT_PAL: return createRenderer<PixelFormatTraits_PAL8,StdMasks>( aBounds, nScanlineFormat, nScanlineStride, pFirstScanline, pMem, pPal, - bitsPerPixel[nScanlineFormat] ); + bitsPerPixel[nScanlineFormat], pDamage ); // ---------------------------------------------------------------------- @@ -1919,12 +1987,12 @@ BitmapDeviceSharedPtr createBitmapDeviceImpl( const basegfx::B2IVector& r case Format::SIXTEEN_BIT_LSB_TC_MASK: return createRenderer<PixelFormatTraits_RGB16_565_LSB,StdMasks>( aBounds, nScanlineFormat, nScanlineStride, - pFirstScanline, pMem, pPal ); + pFirstScanline, pMem, pPal, pDamage ); case Format::SIXTEEN_BIT_MSB_TC_MASK: return createRenderer<PixelFormatTraits_RGB16_565_MSB,StdMasks>( aBounds, nScanlineFormat, nScanlineStride, - pFirstScanline, pMem, pPal ); + pFirstScanline, pMem, pPal, pDamage ); // ---------------------------------------------------------------------- @@ -1932,7 +2000,7 @@ BitmapDeviceSharedPtr createBitmapDeviceImpl( const basegfx::B2IVector& r case Format::TWENTYFOUR_BIT_TC_MASK: return createRenderer<PixelFormatTraits_BGR24,StdMasks>( aBounds, nScanlineFormat, nScanlineStride, - pFirstScanline, pMem, pPal ); + pFirstScanline, pMem, pPal, pDamage ); // ---------------------------------------------------------------------- @@ -1941,12 +2009,12 @@ BitmapDeviceSharedPtr createBitmapDeviceImpl( const basegfx::B2IVector& r case Format::THIRTYTWO_BIT_TC_MASK: return createRenderer<PixelFormatTraits_RGB32_888,StdMasks>( aBounds, nScanlineFormat, nScanlineStride, - pFirstScanline, pMem, pPal ); + pFirstScanline, pMem, pPal, pDamage ); case Format::THIRTYTWO_BIT_TC_MASK_ARGB: return createRenderer<PixelFormatTraits_BGR32_888,StdMasks>( aBounds, nScanlineFormat, nScanlineStride, - pFirstScanline, pMem, pPal ); + pFirstScanline, pMem, pPal, pDamage ); } // TODO(F3): other formats not yet implemented @@ -1957,14 +2025,16 @@ BitmapDeviceSharedPtr createBitmapDeviceImpl( const basegfx::B2IVector& r BitmapDeviceSharedPtr createBitmapDevice( const basegfx::B2IVector& rSize, bool bTopDown, - sal_Int32 nScanlineFormat ) + sal_Int32 nScanlineFormat, + BitmapDeviceDamageTracker* pDamage ) { return createBitmapDeviceImpl( rSize, bTopDown, nScanlineFormat, boost::shared_array< sal_uInt8 >(), PaletteMemorySharedVector(), - NULL ); + NULL, + pDamage ); } BitmapDeviceSharedPtr createBitmapDevice( const basegfx::B2IVector& rSize, @@ -1977,6 +2047,7 @@ BitmapDeviceSharedPtr createBitmapDevice( const basegfx::B2IVector& rSize nScanlineFormat, boost::shared_array< sal_uInt8 >(), rPalette, + NULL, NULL ); } @@ -1991,6 +2062,7 @@ BitmapDeviceSharedPtr createBitmapDevice( const basegfx::B2IVector& rSize nScanlineFormat, rMem, rPalette, + NULL, NULL ); } @@ -2002,7 +2074,8 @@ BitmapDeviceSharedPtr subsetBitmapDevice( const BitmapDeviceSharedPtr& rProt rProto->getScanlineFormat(), rProto->getBuffer(), rProto->getPalette(), - &rSubset ); + &rSubset, + rProto->getDamageTracker() ); } BitmapDeviceSharedPtr cloneBitmapDevice( const basegfx::B2IVector& rSize, @@ -2013,7 +2086,8 @@ BitmapDeviceSharedPtr cloneBitmapDevice( const basegfx::B2IVector& rSize, rProto->getScanlineFormat(), boost::shared_array< sal_uInt8 >(), rProto->getPalette(), - NULL ); + NULL, + rProto->getDamageTracker() ); } //---------------------------------------------------------------------------------- diff --git a/basegfx/inc/basegfx/matrix/b3dhommatrix.hxx b/basegfx/inc/basegfx/matrix/b3dhommatrix.hxx index ccd4cfe707a8..a3eb8d311ec4 100644 --- a/basegfx/inc/basegfx/matrix/b3dhommatrix.hxx +++ b/basegfx/inc/basegfx/matrix/b3dhommatrix.hxx @@ -53,9 +53,6 @@ namespace basegfx B3DHomMatrix(const B3DHomMatrix& rMat); ~B3DHomMatrix(); - /// unshare this matrix with all internally shared instances - void makeUnique(); - double get(sal_uInt16 nRow, sal_uInt16 nColumn) const; void set(sal_uInt16 nRow, sal_uInt16 nColumn, double fValue); @@ -67,20 +64,12 @@ namespace basegfx /// Reset to the identity matrix void identity(); - bool isInvertible() const; /// Invert the matrix (if possible) bool invert(); - bool isNormalized() const; - /// Normalize (i.e. force w=1) the matrix - void normalize(); - /// Calc the matrix determinant double determinant() const; - /// Calc the matrix trace - double trace() const; - /// Transpose the matrix void transpose(); @@ -95,8 +84,6 @@ namespace basegfx // Shearing-Matrices void shearXY(double fSx, double fSy); - void shearYZ(double fSy, double fSz); - void shearXZ(double fSx, double fSz); // Projection matrices, used for converting between eye and // clip coordinates diff --git a/basegfx/inc/basegfx/point/b3dhompoint.hxx b/basegfx/inc/basegfx/point/b3dhompoint.hxx deleted file mode 100644 index 1b43afc03b38..000000000000 --- a/basegfx/inc/basegfx/point/b3dhompoint.hxx +++ /dev/null @@ -1,409 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -#ifndef _BGFX_POINT_B3DHOMPOINT_HXX -#define _BGFX_POINT_B3DHOMPOINT_HXX - -#include <basegfx/point/b3dpoint.hxx> -#include <basegfx/basegfxdllapi.h> - -namespace basegfx -{ - /** Basic homogen Point class with three double values and one homogen factor - - This class provides access to homogen coordinates in 3D. - For this purpose all the operators which need to do specific - action due to their homogenity are implemented here. - The only caveat are member methods which are declared as const - but do change the content. These are documented for that reason. - The class is designed to provide homogenous coordinates without - direct access to the homogen part (mfW). This is also the reason - for leaving out the [] operators which return references to members. - - @see B3DTuple - */ - class BASEGFX_DLLPUBLIC B3DHomPoint - { - protected: - /// This member contains the coordinate part of the point - ::basegfx::B3DTuple maTuple; - - /// This Member holds the homogenous part of the point - double mfW; - - /** Test if this homogen point does have a homogenous part - - @return Returns true if this point has no homogenous part - */ - bool implIsHomogenized() const - { - const double fOne(1.0); - return ::basegfx::fTools::equal(mfW, fOne); - } - - /** Remove homogenous part of this Point - - This method does necessary calculations to remove - the evtl. homogenous part of this Point. This may - change all members. - */ - void implHomogenize(); - - /** Test and on demand remove homogenous part - - This method tests if this Point does have a homogenous part - and then evtl. takes actions to remove that part. - - @attention Even when this method is const it may change all - members of this instance. This is due to the fact that changing - the homogenous part of a homogenous point does from a mathematical - point of view not change the point at all. - */ - void implTestAndHomogenize() const - { - if(!implIsHomogenized()) - ((B3DHomPoint*)this)->implHomogenize(); - } - - public: - /** Create a homogen point - - The point is initialized to (0.0, 0.0, 0.0) - */ - B3DHomPoint() - : maTuple(), - mfW(1.0) - {} - - /** Create a homogen point - - @param fX - This parameter is used to initialize the X-coordinate - of the Point. The homogenous part is initialized to 1.0. - - @param fY - This parameter is used to initialize the Y-coordinate - of the Point. The homogenous part is initialized to 1.0. - - @param fZ - This parameter is used to initialize the Z-coordinate - of the Point. The homogenous part is initialized to 1.0. - */ - B3DHomPoint(double fX, double fY, double fZ) - : maTuple(fX, fY, fZ), - mfW(1.0) - {} - - /** Create a copy of a 3D Point - - @param rVec - The 3D point which will be copied. The homogenous part - is initialized to 1.0. - */ - B3DHomPoint(const B3DPoint& rVec) - : maTuple(rVec), - mfW(1.0) - {} - - /** Create a copy of a homogen point - - @param rVec - The homogen point which will be copied. The homogenous part - is copied, too. - */ - B3DHomPoint(const B3DHomPoint& rVec) - : maTuple(rVec.maTuple.getX(), rVec.maTuple.getY(), rVec.maTuple.getZ()), - mfW(rVec.mfW) - {} - - ~B3DHomPoint() - {} - - /** get a 3D point from this homogenous point - - This method normalizes this homogen point if necessary and - returns the corresponding 3D point for this homogen point. - - @attention Even when this method is const it may change all - members of this instance. - */ - B3DPoint getB3DPoint() const - { - implTestAndHomogenize(); - return B3DPoint(maTuple.getX(), maTuple.getY(), maTuple.getZ()); - } - - /** get X-coordinate - - This method normalizes this homogen point if necessary and - returns the corresponding X-coordinate for this homogen point. - - @attention Even when this method is const it may change all - members of this instance. - */ - double getX() const - { - implTestAndHomogenize(); - return maTuple.getX(); - } - - /** get Y-coordinate - - This method normalizes this homogen point if necessary and - returns the corresponding Y-coordinate for this homogen point. - - @attention Even when this method is const it may change all - members of this instance. - */ - double getY() const - { - implTestAndHomogenize(); - return maTuple.getY(); - } - - /** get Z-coordinate - - This method normalizes this homogen point if necessary and - returns the corresponding Z-coordinate for this homogen point. - - @attention Even when this method is const it may change all - members of this instance. - */ - double getZ() const - { - implTestAndHomogenize(); - return maTuple.getY(); - } - - /** Set X-coordinate of the homogen point. - - This method sets the X-coordinate of the homogen point. If - the point does have a homogenous part this is taken into account. - - @param fX - The to-be-set X-coordinate without homogenous part. - */ - void setX(double fX) - { - maTuple.setX(implIsHomogenized() ? fX : fX * mfW ); - } - - /** Set Y-coordinate of the homogen point. - - This method sets the Y-coordinate of the homogen point. If - the point does have a homogenous part this is taken into account. - - @param fY - The to-be-set Y-coordinate without homogenous part. - */ - void setY(double fY) - { - maTuple.setY(implIsHomogenized() ? fY : fY * mfW ); - } - - /** Set Z-coordinate of the homogen point. - - This method sets the Z-coordinate of the homogen point. If - the point does have a homogenous part this is taken into account. - - @param fZ - The to-be-set Z-coordinate without homogenous part. - */ - void setZ(double fZ) - { - maTuple.setZ(implIsHomogenized() ? fZ : fZ * mfW ); - } - - // operators - ////////////////////////////////////////////////////////////////////// - - B3DHomPoint& operator+=( const B3DHomPoint& rPnt ) - { - maTuple.setX(getX() * rPnt.mfW + rPnt.getX() * mfW); - maTuple.setY(getY() * rPnt.mfW + rPnt.getY() * mfW); - maTuple.setZ(getZ() * rPnt.mfW + rPnt.getZ() * mfW); - mfW = mfW * rPnt.mfW; - - return *this; - } - - B3DHomPoint& operator-=( const B3DHomPoint& rPnt ) - { - maTuple.setX(getX() * rPnt.mfW - rPnt.getX() * mfW); - maTuple.setY(getY() * rPnt.mfW - rPnt.getY() * mfW); - maTuple.setZ(getZ() * rPnt.mfW - rPnt.getZ() * mfW); - mfW = mfW * rPnt.mfW; - - return *this; - } - - B3DHomPoint& operator*=(double t) - { - if(!::basegfx::fTools::equalZero(t)) - { - mfW /= t; - } - - return *this; - } - - B3DHomPoint& operator/=(double t) - { - mfW *= t; - return *this; - } - - B3DHomPoint& operator-(void) - { - mfW = -mfW; - return *this; - } - - bool operator==( const B3DHomPoint& rPnt ) const - { - implTestAndHomogenize(); - return (maTuple == rPnt.maTuple); - } - - bool operator!=( const B3DHomPoint& rPnt ) const - { - implTestAndHomogenize(); - return (maTuple != rPnt.maTuple); - } - - B3DHomPoint& operator=( const B3DHomPoint& rPnt ) - { - maTuple = rPnt.maTuple; - mfW = rPnt.mfW; - return *this; - } - }; - - // external operators - ////////////////////////////////////////////////////////////////////////// - - inline B3DHomPoint minimum(const B3DHomPoint& rVecA, const B3DHomPoint& rVecB) - { - B3DHomPoint aMin( - (rVecB.getX() < rVecA.getX()) ? rVecB.getX() : rVecA.getX(), - (rVecB.getY() < rVecA.getY()) ? rVecB.getY() : rVecA.getY(), - (rVecB.getZ() < rVecA.getZ()) ? rVecB.getZ() : rVecA.getZ()); - return aMin; - } - - inline B3DHomPoint maximum(const B3DHomPoint& rVecA, const B3DHomPoint& rVecB) - { - B3DHomPoint aMax( - (rVecB.getX() > rVecA.getX()) ? rVecB.getX() : rVecA.getX(), - (rVecB.getY() > rVecA.getY()) ? rVecB.getY() : rVecA.getY(), - (rVecB.getZ() > rVecA.getZ()) ? rVecB.getZ() : rVecA.getZ()); - return aMax; - } - - inline B3DHomPoint absolute(const B3DHomPoint& rVec) - { - B3DHomPoint aAbs( - (0.0 > rVec.getX()) ? -rVec.getX() : rVec.getX(), - (0.0 > rVec.getY()) ? -rVec.getY() : rVec.getY(), - (0.0 > rVec.getZ()) ? -rVec.getZ() : rVec.getZ()); - return aAbs; - } - - inline B3DHomPoint interpolate(B3DHomPoint& rOld1, B3DHomPoint& rOld2, double t) - { - B3DHomPoint aInt( - ((rOld2.getX() - rOld1.getX()) * t) + rOld1.getX(), - ((rOld2.getY() - rOld1.getY()) * t) + rOld1.getY(), - ((rOld2.getZ() - rOld1.getZ()) * t) + rOld1.getZ()); - return aInt; - } - - inline B3DHomPoint average(B3DHomPoint& rOld1, B3DHomPoint& rOld2) - { - B3DHomPoint aAvg( - (rOld1.getX() + rOld2.getX()) * 0.5, - (rOld1.getY() + rOld2.getY()) * 0.5, - (rOld1.getZ() + rOld2.getZ()) * 0.5); - return aAvg; - } - - inline B3DHomPoint average(B3DHomPoint& rOld1, B3DHomPoint& rOld2, B3DHomPoint& rOld3) - { - B3DHomPoint aAvg( - (rOld1.getX() + rOld2.getX() + rOld3.getX()) * (1.0 / 3.0), - (rOld1.getY() + rOld2.getY() + rOld3.getY()) * (1.0 / 3.0), - (rOld1.getZ() + rOld2.getZ() + rOld3.getZ()) * (1.0 / 3.0)); - return aAvg; - } - - inline B3DHomPoint operator+(const B3DHomPoint& rVecA, const B3DHomPoint& rVecB) - { - B3DHomPoint aSum(rVecA); - aSum += rVecB; - return aSum; - } - - inline B3DHomPoint operator-(const B3DHomPoint& rVecA, const B3DHomPoint& rVecB) - { - B3DHomPoint aSub(rVecA); - aSub -= rVecB; - return aSub; - } - - inline B3DHomPoint operator*(const B3DHomPoint& rVec, double t) - { - B3DHomPoint aNew(rVec); - aNew *= t; - return aNew; - } - - inline B3DHomPoint operator*(double t, const B3DHomPoint& rVec) - { - B3DHomPoint aNew(rVec); - aNew *= t; - return aNew; - } - - inline B3DHomPoint operator/(const B3DHomPoint& rVec, double t) - { - B3DHomPoint aNew(rVec); - aNew /= t; - return aNew; - } - - inline B3DHomPoint operator/(double t, const B3DHomPoint& rVec) - { - B3DHomPoint aNew(rVec); - aNew /= t; - return aNew; - } -} // end of namespace basegfx - -#endif /* _BGFX_POINT_B3DHOMPOINT_HXX */ - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/basegfx/inc/basegfx/tools/unotools.hxx b/basegfx/inc/basegfx/tools/unotools.hxx new file mode 100644 index 000000000000..e7bcc27fb561 --- /dev/null +++ b/basegfx/inc/basegfx/tools/unotools.hxx @@ -0,0 +1,55 @@ +/* + * Version: MPL 1.1 / GPLv3+ / LGPLv3+ + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License or as specified alternatively below. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Initial Developer of the Original Code is + * Thorsten Behrens <tbehrens@novell.com> + * Portions created by the Initial Developer are Copyright (C) 2011 the + * Initial Developer. All Rights Reserved. + * + * For minor contributions see the git repository. + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 3 or later (the "GPLv3+"), or + * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"), + * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable + * instead of those above. + */ + +#ifndef INCLUDED_BASEGFX_UNOTOOLS_HXX +#define INCLUDED_BASEGFX_UNOTOOLS_HXX + +#include <cppuhelper/basemutex.hxx> +#include <cppuhelper/compbase3.hxx> +#include <com/sun/star/lang/XServiceInfo.hpp> +#include <com/sun/star/rendering/FillRule.hpp> +#include <com/sun/star/rendering/XLinePolyPolygon2D.hpp> +#include <com/sun/star/rendering/XBezierPolyPolygon2D.hpp> +#include <basegfx/polygon/b2dpolypolygon.hxx> + + +namespace basegfx +{ +class B2DPolyPolygon; + +namespace unotools +{ + + B2DPolyPolygon polyPolygonBezierToB2DPolyPolygon(const ::com::sun::star::drawing::PolyPolygonBezierCoords& rSourcePolyPolygon) + throw( ::com::sun::star::lang::IllegalArgumentException ); + + void b2DPolyPolygonToPolyPolygonBezier( const B2DPolyPolygon& rPolyPoly, + ::com::sun::star::drawing::PolyPolygonBezierCoords& rRetval ); +} +} + +#endif /* INCLUDED_BASEGFX_UNOTOOLS_HXX */ diff --git a/basegfx/prj/build.lst b/basegfx/prj/build.lst index ed12d718c12d..ab5cf9bda8e4 100644 --- a/basegfx/prj/build.lst +++ b/basegfx/prj/build.lst @@ -1,3 +1,3 @@ -fx basegfx : o3tl sal offuh cppuhelper cppu CPPUNIT:cppunit NULL +fx basegfx : o3tl sal offapi comphelper cppuhelper cppu CPPUNIT:cppunit NULL fx basegfx\prj nmake - all fx_prj NULL diff --git a/basegfx/prj/d.lst b/basegfx/prj/d.lst index e69de29bb2d1..997a23399ff6 100644 --- a/basegfx/prj/d.lst +++ b/basegfx/prj/d.lst @@ -0,0 +1 @@ +..\inc\basegfx\tools\unotools.hxx %_DEST%\inc\basegfx\tools\unotools.hxx diff --git a/basegfx/source/matrix/b3dhommatrix.cxx b/basegfx/source/matrix/b3dhommatrix.cxx index e665b47d58a6..80a5024893b4 100644 --- a/basegfx/source/matrix/b3dhommatrix.cxx +++ b/basegfx/source/matrix/b3dhommatrix.cxx @@ -63,11 +63,6 @@ namespace basegfx return *this; } - void B3DHomMatrix::makeUnique() - { - mpImpl.make_unique(); - } - double B3DHomMatrix::get(sal_uInt16 nRow, sal_uInt16 nColumn) const { return mpImpl->get(nRow, nColumn); @@ -96,11 +91,6 @@ namespace basegfx mpImpl = IdentityMatrix::get(); } - bool B3DHomMatrix::isInvertible() const - { - return mpImpl->isInvertible(); - } - bool B3DHomMatrix::invert() { Impl3DHomMatrix aWork(*mpImpl); @@ -119,27 +109,11 @@ namespace basegfx return false; } - bool B3DHomMatrix::isNormalized() const - { - return mpImpl->isNormalized(); - } - - void B3DHomMatrix::normalize() - { - if(!const_cast<const B3DHomMatrix*>(this)->mpImpl->isNormalized()) - mpImpl->doNormalize(); - } - double B3DHomMatrix::determinant() const { return mpImpl->doDeterminant(); } - double B3DHomMatrix::trace() const - { - return mpImpl->doTrace(); - } - void B3DHomMatrix::transpose() { mpImpl->doTranspose(); @@ -290,34 +264,6 @@ namespace basegfx } } - void B3DHomMatrix::shearYZ(double fSy, double fSz) - { - // #i76239# do not test againt 1.0, but against 0.0. We are talking about a value not on the diagonal (!) - if(!fTools::equalZero(fSy) || !fTools::equalZero(fSz)) - { - Impl3DHomMatrix aShearYZMat; - - aShearYZMat.set(1, 0, fSy); - aShearYZMat.set(2, 0, fSz); - - mpImpl->doMulMatrix(aShearYZMat); - } - } - - void B3DHomMatrix::shearXZ(double fSx, double fSz) - { - // #i76239# do not test againt 1.0, but against 0.0. We are talking about a value not on the diagonal (!) - if(!fTools::equalZero(fSx) || !fTools::equalZero(fSz)) - { - Impl3DHomMatrix aShearXZMat; - - aShearXZMat.set(0, 1, fSx); - aShearXZMat.set(2, 1, fSz); - - mpImpl->doMulMatrix(aShearXZMat); - } - } - void B3DHomMatrix::frustum(double fLeft, double fRight, double fBottom, double fTop, double fNear, double fFar) { const double fZero(0.0); diff --git a/basegfx/source/polygon/b2dpolypolygon.cxx b/basegfx/source/polygon/b2dpolypolygon.cxx index 4c8ab7b44a45..b55af03e9575 100644 --- a/basegfx/source/polygon/b2dpolypolygon.cxx +++ b/basegfx/source/polygon/b2dpolypolygon.cxx @@ -93,21 +93,10 @@ public: void insert(sal_uInt32 nIndex, const basegfx::B2DPolyPolygon& rPolyPolygon) { - const sal_uInt32 nCount = rPolyPolygon.count(); - - if(nCount) - { - // add nCount polygons from rPolyPolygon - maPolygons.reserve(maPolygons.size() + nCount); - PolygonVector::iterator aIndex(maPolygons.begin()); - aIndex += nIndex; - - for(sal_uInt32 a(0L); a < nCount; a++) - { - aIndex = maPolygons.insert(aIndex, rPolyPolygon.getB2DPolygon(a)); - ++aIndex; - } - } + // add all polygons from rPolyPolygon + PolygonVector::iterator aIndex(maPolygons.begin()); + aIndex += nIndex; + maPolygons.insert(aIndex, rPolyPolygon.begin(), rPolyPolygon.end()); } void remove(sal_uInt32 nIndex, sal_uInt32 nCount) diff --git a/basegfx/source/polygon/b2dsvgpolypolygon.cxx b/basegfx/source/polygon/b2dsvgpolypolygon.cxx index 50a04dbaa075..074cfd9e25d5 100644 --- a/basegfx/source/polygon/b2dsvgpolypolygon.cxx +++ b/basegfx/source/polygon/b2dsvgpolypolygon.cxx @@ -787,10 +787,7 @@ namespace basegfx // (since // createPolygonFromEllipseSegment() // normalizes to e.g. cw arc) - const bool bLessThanPi(fmod(fTheta2+2*M_PI-fTheta1, - 2*M_PI)<M_PI); - const bool bFlipSegment( (bLargeArcFlag!=0) == bLessThanPi ); - if( bFlipSegment ) + if( !bSweepFlag ) std::swap(fTheta1,fTheta2); // finally, create bezier polygon from this @@ -812,7 +809,7 @@ namespace basegfx // always creates arcs that are // positively oriented - flip polygon // if we swapped angles above - if( bFlipSegment ) + if( !bSweepFlag ) aSegment.flip(); aCurrPoly.append(aSegment); } diff --git a/basegfx/source/tools/unotools.cxx b/basegfx/source/tools/unotools.cxx new file mode 100644 index 000000000000..710568b8d737 --- /dev/null +++ b/basegfx/source/tools/unotools.cxx @@ -0,0 +1,264 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * Portions Copright 2011 Thorsten Behrens <tbehrens@novell.com> + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +// MARKER(update_precomp.py): autogen include statement, do not remove +#include "precompiled_basegfx.hxx" + +#include <com/sun/star/drawing/PolyPolygonBezierCoords.hpp> +#include <com/sun/star/drawing/PointSequence.hpp> +#include <com/sun/star/drawing/FlagSequence.hpp> +#include <basegfx/polygon/b2dpolypolygontools.hxx> +#include <basegfx/polygon/b2dpolygontools.hxx> +#include <basegfx/polygon/b2dpolygon.hxx> +#include <basegfx/curve/b2dcubicbezier.hxx> + +#include <basegfx/tools/unotools.hxx> +#include <comphelper/sequence.hxx> + + +using namespace ::com::sun::star; + +namespace basegfx +{ +namespace unotools +{ + + B2DPolyPolygon polyPolygonBezierToB2DPolyPolygon(const drawing::PolyPolygonBezierCoords& rSourcePolyPolygon) + throw( lang::IllegalArgumentException ) + { + const sal_Int32 nOuterSequenceCount(rSourcePolyPolygon.Coordinates.getLength()); + B2DPolyPolygon aNewPolyPolygon; + + if(rSourcePolyPolygon.Flags.getLength() != nOuterSequenceCount) + throw lang::IllegalArgumentException(); + + // get pointers to inner sequence + const drawing::PointSequence* pInnerSequence = rSourcePolyPolygon.Coordinates.getConstArray(); + const drawing::FlagSequence* pInnerSequenceFlags = rSourcePolyPolygon.Flags.getConstArray(); + + for(sal_Int32 a(0); a < nOuterSequenceCount; a++) + { + const sal_Int32 nInnerSequenceCount(pInnerSequence->getLength()); + + if(pInnerSequenceFlags->getLength() != nInnerSequenceCount) + throw lang::IllegalArgumentException(); + + // prepare new polygon + basegfx::B2DPolygon aNewPolygon; + const awt::Point* pArray = pInnerSequence->getConstArray(); + const drawing::PolygonFlags* pArrayFlags = pInnerSequenceFlags->getConstArray(); + + // get first point and flag + basegfx::B2DPoint aNewCoordinatePair(pArray->X, pArray->Y); pArray++; + drawing::PolygonFlags ePolyFlag(*pArrayFlags); pArrayFlags++; + basegfx::B2DPoint aControlA; + basegfx::B2DPoint aControlB; + + // first point is not allowed to be a control point + if(drawing::PolygonFlags_CONTROL == ePolyFlag) + throw lang::IllegalArgumentException(); + + // add first point as start point + aNewPolygon.append(aNewCoordinatePair); + for(sal_Int32 b(1); b < nInnerSequenceCount;) + { + // prepare loop + bool bControlA(false); + bool bControlB(false); + + // get next point and flag + aNewCoordinatePair = basegfx::B2DPoint(pArray->X, pArray->Y); + ePolyFlag = *pArrayFlags; + pArray++; pArrayFlags++; b++; + + if(b < nInnerSequenceCount && drawing::PolygonFlags_CONTROL == ePolyFlag) + { + aControlA = aNewCoordinatePair; + bControlA = true; + + // get next point and flag + aNewCoordinatePair = basegfx::B2DPoint(pArray->X, pArray->Y); + ePolyFlag = *pArrayFlags; + pArray++; pArrayFlags++; b++; + } + + if(b < nInnerSequenceCount && drawing::PolygonFlags_CONTROL == ePolyFlag) + { + aControlB = aNewCoordinatePair; + bControlB = true; + + // get next point and flag + aNewCoordinatePair = basegfx::B2DPoint(pArray->X, pArray->Y); + ePolyFlag = *pArrayFlags; + pArray++; pArrayFlags++; b++; + } + + // two or no control points are consumed, another one would be an error. + // It's also an error if only one control point was read + if(drawing::PolygonFlags_CONTROL == ePolyFlag || bControlA != bControlB) + throw lang::IllegalArgumentException(); + + // the previous writes used the B2DPolyPoygon -> PolyPolygon converter + // which did not create minimal PolyPolygons, but created all control points + // as null vectors (identical points). Because of the former P(CA)(CB)-norm of + // B2DPolygon and it's unused sign of being the zero-vector and CA and CB being + // relative to P, an empty edge was exported as P == CA == CB. Luckily, the new + // export format can be read without errors by the old OOo-versions, so we need only + // to correct here at read and do not need to export a wrong but compatible version + // for the future. + if(bControlA + && aControlA.equal(aControlB) + && aControlA.equal(aNewPolygon.getB2DPoint(aNewPolygon.count() - 1))) + { + bControlA = bControlB = false; + } + + if(bControlA) + { + // add bezier edge + aNewPolygon.appendBezierSegment(aControlA, aControlB, aNewCoordinatePair); + } + else + { + // add edge + aNewPolygon.append(aNewCoordinatePair); + } + } + + // next sequence + pInnerSequence++; + pInnerSequenceFlags++; + + // #i72807# API import uses old line start/end-equal definition for closed, + // so we need to correct this to closed state here + basegfx::tools::checkClosed(aNewPolygon); + + // add new subpolygon + aNewPolyPolygon.append(aNewPolygon); + } + + return aNewPolyPolygon; + } + + ///////////////////////////////////////////////////////////////////////////////// + + void b2DPolyPolygonToPolyPolygonBezier( const basegfx::B2DPolyPolygon& rPolyPoly, + drawing::PolyPolygonBezierCoords& rRetval ) + { + rRetval.Coordinates.realloc(rPolyPoly.count()); + rRetval.Flags.realloc(rPolyPoly.count()); + + drawing::PointSequence* pOuterSequence = rRetval.Coordinates.getArray(); + drawing::FlagSequence* pOuterFlags = rRetval.Flags.getArray(); + + for(sal_uInt32 a=0;a<rPolyPoly.count();a++) + { + const B2DPolygon& rPoly = rPolyPoly.getB2DPolygon(a); + sal_uInt32 nCount(rPoly.count()); + const bool bClosed(rPoly.isClosed()); + + // calculate input vertex count + const sal_uInt32 nLoopCount(bClosed ? nCount : (nCount ? nCount - 1L : 0L )); + + std::vector<awt::Point> aPoints; aPoints.reserve(nLoopCount); + std::vector<drawing::PolygonFlags> aFlags; aFlags.reserve(nLoopCount); + + // prepare insert index and current point + basegfx::B2DCubicBezier aBezier; + aBezier.setStartPoint(rPoly.getB2DPoint(0)); + + for(sal_uInt32 b(0L); b<nLoopCount; b++) + { + // add current point (always) and remember StartPointIndex for evtl. later corrections + const awt::Point aStartPoint(fround(aBezier.getStartPoint().getX()), + fround(aBezier.getStartPoint().getY())); + const sal_uInt32 nStartPointIndex(aPoints.size()); + aPoints.push_back(aStartPoint); + aFlags.push_back(drawing::PolygonFlags_NORMAL); + + // prepare next segment + const sal_uInt32 nNextIndex((b + 1) % nCount); + aBezier.setEndPoint(rPoly.getB2DPoint(nNextIndex)); + aBezier.setControlPointA(rPoly.getNextControlPoint(b)); + aBezier.setControlPointB(rPoly.getPrevControlPoint(nNextIndex)); + + if(aBezier.isBezier()) + { + // if one is used, add always two control points due to the old schema + aPoints.push_back( awt::Point(fround(aBezier.getControlPointA().getX()), + fround(aBezier.getControlPointA().getY())) ); + aFlags.push_back(drawing::PolygonFlags_CONTROL); + + aPoints.push_back( awt::Point(fround(aBezier.getControlPointB().getX()), + fround(aBezier.getControlPointB().getY())) ); + aFlags.push_back(drawing::PolygonFlags_CONTROL); + } + + // test continuity with previous control point to set flag value + if(aBezier.getControlPointA() != aBezier.getStartPoint() && (bClosed || b)) + { + const basegfx::B2VectorContinuity eCont(rPoly.getContinuityInPoint(b)); + + if(basegfx::CONTINUITY_C1 == eCont) + { + aFlags[nStartPointIndex] = drawing::PolygonFlags_SMOOTH; + } + else if(basegfx::CONTINUITY_C2 == eCont) + { + aFlags[nStartPointIndex] = drawing::PolygonFlags_SYMMETRIC; + } + } + + // prepare next polygon step + aBezier.setStartPoint(aBezier.getEndPoint()); + } + + if(bClosed) + { + // add first point again as closing point due to old definition + aPoints.push_back( aPoints[0] ); + aFlags.push_back(drawing::PolygonFlags_NORMAL); + } + else + { + // add last point as closing point + const basegfx::B2DPoint aClosingPoint(rPoly.getB2DPoint(nCount - 1L)); + const awt::Point aEnd(fround(aClosingPoint.getX()), + fround(aClosingPoint.getY())); + aPoints.push_back(aEnd); + aFlags.push_back(drawing::PolygonFlags_NORMAL); + } + + *pOuterSequence++ = comphelper::containerToSequence(aPoints); + *pOuterFlags++ = comphelper::containerToSequence(aFlags); + } + } + +} +} diff --git a/basegfx/test/basegfx3d.cxx b/basegfx/test/basegfx3d.cxx index 5ac16fafc6a4..691b51a5f981 100644 --- a/basegfx/test/basegfx3d.cxx +++ b/basegfx/test/basegfx3d.cxx @@ -67,33 +67,6 @@ public: }; // class b3dhommatrix -class b3dhompoint : public CppUnit::TestFixture -{ -public: - // initialise your test code values here. - void setUp() - { - } - - void tearDown() - { - } - - // insert your test code here. - void EmptyMethod() - { - } - - // Change the following lines only, if you add, remove or rename - // member functions of the current class, - // because these macros are need by auto register mechanism. - - CPPUNIT_TEST_SUITE(b3dhompoint); - CPPUNIT_TEST(EmptyMethod); - CPPUNIT_TEST_SUITE_END(); -}; // class b3dhompoint - - class b3dpoint : public CppUnit::TestFixture { public: @@ -207,7 +180,6 @@ public: // ----------------------------------------------------------------------------- CPPUNIT_TEST_SUITE_REGISTRATION(basegfx3d::b3dhommatrix); -CPPUNIT_TEST_SUITE_REGISTRATION(basegfx3d::b3dhompoint); CPPUNIT_TEST_SUITE_REGISTRATION(basegfx3d::b3dpoint); CPPUNIT_TEST_SUITE_REGISTRATION(basegfx3d::b3drange); CPPUNIT_TEST_SUITE_REGISTRATION(basegfx3d::b3dtuple); diff --git a/canvas/prj/build.lst b/canvas/prj/build.lst index 79acfc94af5f..7d6a51be6a5f 100644 --- a/canvas/prj/build.lst +++ b/canvas/prj/build.lst @@ -1,3 +1,3 @@ -cv canvas : javaunohelper comphelper cppuhelper offuh unoil tools svtools vcl basegfx CAIRO:cairo LIBXSLT:libxslt NULL +cv canvas : javaunohelper comphelper cppuhelper offapi unoil tools svtools vcl basegfx CAIRO:cairo LIBXSLT:libxslt NULL cv canvas\prj nmake - all cv_prj NULL diff --git a/canvas/prj/d.lst b/canvas/prj/d.lst index e69de29bb2d1..cde5ebec26c2 100644 --- a/canvas/prj/d.lst +++ b/canvas/prj/d.lst @@ -0,0 +1 @@ +..\%__SRC%\lib\*.a %_DEST%\lib\*.a diff --git a/canvas/source/cairo/cairo_canvashelper.cxx b/canvas/source/cairo/cairo_canvashelper.cxx index 2f1e39b8a19e..ebf0e1aac3e4 100644 --- a/canvas/source/cairo/cairo_canvashelper.cxx +++ b/canvas/source/cairo/cairo_canvashelper.cxx @@ -128,13 +128,11 @@ namespace cairocanvas { if( rColor.getLength() > 3 ) { - const double alpha = rColor[3]; - cairo_set_source_rgba( pCairo, - alpha*rColor[0], - alpha*rColor[1], - alpha*rColor[2], - alpha ); + rColor[0], + rColor[1], + rColor[2], + rColor[3] ); } else if( rColor.getLength() == 3 ) cairo_set_source_rgb( pCairo, diff --git a/canvas/source/cairo/cairo_quartz_cairo.cxx b/canvas/source/cairo/cairo_quartz_cairo.cxx index e24ba9c3ab80..23702f64b3ac 100644 --- a/canvas/source/cairo/cairo_quartz_cairo.cxx +++ b/canvas/source/cairo/cairo_quartz_cairo.cxx @@ -29,9 +29,9 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_canvas.hxx" -#ifdef QUARTZ +#if defined QUARTZ || defined IOS /************************************************************************ - * Mac OS X/Quartz surface backend for OpenOffice.org Cairo Canvas * + * Mac OS X/Quartz and iOS surface backend for OpenOffice.org Cairo Canvas * ************************************************************************/ #include <osl/diagnose.h> @@ -205,13 +205,19 @@ namespace cairo CGContextRef mrContext = getCGContext(); if (!mrContext) return; - +#ifndef IOS [mpView lockFocus]; +#endif +#ifndef IOS /** * This code is using same screen update code as in VCL (esp. AquaSalGraphics::UpdateWindow() ) */ CGContextRef rViewContext = reinterpret_cast<CGContextRef>([[NSGraphicsContext currentContext] graphicsPort]); +#else + // Just guessing for now... + CGContextRef rViewContext = UIGraphicsGetCurrentContext(); +#endif CGImageRef xImage = CGBitmapContextCreateImage(mrContext); CGContextDrawImage(rViewContext, CGRectMake( 0, 0, @@ -220,8 +226,9 @@ namespace cairo xImage); CGImageRelease( xImage ); CGContextFlush( rViewContext ); - +#ifndef IOS [mpView unlockFocus]; +#endif } /** diff --git a/canvas/source/cairo/cairo_quartz_cairo.hxx b/canvas/source/cairo/cairo_quartz_cairo.hxx index 0c6a7d56db95..5d131d735ab9 100644 --- a/canvas/source/cairo/cairo_quartz_cairo.hxx +++ b/canvas/source/cairo/cairo_quartz_cairo.hxx @@ -32,7 +32,13 @@ #include "cairo_cairo.hxx" #include "premac.h" +#include <TargetConditionals.h> +#if !defined(TARGET_OS_IPHONE) || !TARGET_OS_IPHONE #include <Cocoa/Cocoa.h> +#else +#include <UIKit/UIKit.h> +#define NSView UIView +#endif #include <cairo-quartz.h> #include "postmac.h" diff --git a/canvas/source/cairo/cairo_spritecanvashelper.cxx b/canvas/source/cairo/cairo_spritecanvashelper.cxx index cdac16cbf8b7..75a8884df252 100644 --- a/canvas/source/cairo/cairo_spritecanvashelper.cxx +++ b/canvas/source/cairo/cairo_spritecanvashelper.cxx @@ -524,8 +524,8 @@ namespace cairocanvas ::cairo::SurfaceSharedPtr SpriteCanvasHelper::getCompositingSurface( const ::basegfx::B2ISize& rNeededSize ) { - if( rNeededSize.getX() < maCompositingSurfaceSize.getX() || - rNeededSize.getY() < maCompositingSurfaceSize.getY() ) + if( rNeededSize.getX() > maCompositingSurfaceSize.getX() || + rNeededSize.getY() > maCompositingSurfaceSize.getY() ) { // need to give buffer more size mpCompositingSurface.reset(); diff --git a/canvas/source/cairo/cairo_textlayout.cxx b/canvas/source/cairo/cairo_textlayout.cxx index 9c1501a8245b..eb5a3358b460 100644 --- a/canvas/source/cairo/cairo_textlayout.cxx +++ b/canvas/source/cairo/cairo_textlayout.cxx @@ -352,7 +352,7 @@ namespace cairocanvas **/ bool TextLayout::isCairoRenderable(SystemFontData aSysFontData) const { -#if defined UNX && !defined QUARTZ +#if defined UNX && !defined QUARTZ && !defined IOS // is font usable? if (!aSysFontData.nFontId) return false; #endif @@ -502,9 +502,14 @@ namespace cairocanvas cairo_font_face_t* font_face = NULL; #ifdef CAIRO_HAS_QUARTZ_SURFACE + + #ifdef QUARTZ // TODO: use cairo_quartz_font_face_create_for_cgfont(cgFont) // when CGFont (Mac OS X 10.5 API) is provided by the AQUA VCL backend. font_face = cairo_quartz_font_face_create_for_atsu_font_id((ATSUFontID) rSysFontData.aATSUFontID); + #else // iOS + font_face = cairo_quartz_font_face_create_for_cgfont( rSysFontData.rFont); + #endif #elif defined CAIRO_HAS_WIN32_SURFACE #if (OSL_DEBUG_LEVEL > 1) diff --git a/canvas/source/factory/cf_service.cxx b/canvas/source/factory/cf_service.cxx index e96f31f5ba7a..316c4b7aecff 100644 --- a/canvas/source/factory/cf_service.cxx +++ b/canvas/source/factory/cf_service.cxx @@ -527,12 +527,6 @@ const ::cppu::ImplementationEntry s_entries [] = { extern "C" { -SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnvironment( - const sal_Char ** ppEnvTypeName, uno_Environment ** /*ppEnv*/ ) -{ - *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; -} - SAL_DLLPUBLIC_EXPORT void * SAL_CALL component_getFactory( sal_Char const * pImplName, lang::XMultiServiceFactory * pServiceManager, diff --git a/comphelper/Library_comphelp.mk b/comphelper/Library_comphelp.mk index d00078860cc4..acacafccdf9b 100644 --- a/comphelper/Library_comphelp.mk +++ b/comphelper/Library_comphelp.mk @@ -37,7 +37,6 @@ $(eval $(call gb_Library_set_include,comphelper,\ -I$(realpath $(SRCDIR)/comphelper/inc/pch) \ -I$(realpath $(SRCDIR)/comphelper/source/inc) \ $$(INCLUDE) \ - -I$(OUTDIR)/inc/offuh \ )) $(eval $(call gb_Library_add_defs,comphelper,\ @@ -52,6 +51,11 @@ $(eval $(call gb_Library_add_linked_libs,comphelper,\ $(gb_STDLIBS) \ )) +$(eval $(call gb_Library_add_api,comphelper,\ + udkapi \ + offapi \ +)) + $(eval $(call gb_Library_add_exception_objects,comphelper,\ comphelper/source/compare/AnyCompareFactory \ comphelper/source/container/IndexedPropertyValuesContainer \ diff --git a/comphelper/inc/comphelper/componentmodule.hxx b/comphelper/inc/comphelper/componentmodule.hxx index 4bc917ef13d3..5893313c8497 100644 --- a/comphelper/inc/comphelper/componentmodule.hxx +++ b/comphelper/inc/comphelper/componentmodule.hxx @@ -270,103 +270,6 @@ namespace comphelper ) ); } - //========================================================================== - //= helpers - //========================================================================== - - //========================================================================== - // declaring a OModule for a component library - -#define DECLARE_COMPONENT_MODULE( ModuleClass, ClientClass ) \ - /* -------------------------------------------------------------------- */ \ - class ModuleClass : public ::comphelper::OModule \ - { \ - friend struct ModuleClass##Creator; \ - typedef ::comphelper::OModule BaseClass; \ - \ - public: \ - static ModuleClass& getInstance(); \ - \ - private: \ - ModuleClass(); \ - }; \ - \ - /* -------------------------------------------------------------------- */ \ - class ClientClass : public ::comphelper::OModuleClient \ - { \ - private: \ - typedef ::comphelper::OModuleClient BaseClass; \ - \ - public: \ - ClientClass() : BaseClass( ModuleClass::getInstance() ) \ - { \ - } \ - }; \ - \ - /* -------------------------------------------------------------------- */ \ - template < class TYPE > \ - class OAutoRegistration : public ::comphelper::OAutoRegistration< TYPE > \ - { \ - private: \ - typedef ::comphelper::OAutoRegistration< TYPE > BaseClass; \ - \ - public: \ - OAutoRegistration() : BaseClass( ModuleClass::getInstance() ) \ - { \ - } \ - }; \ - /* -------------------------------------------------------------------- */ \ - template < class TYPE > \ - class OSingletonRegistration : public ::comphelper::OSingletonRegistration< TYPE > \ - { \ - private: \ - typedef ::comphelper::OSingletonRegistration< TYPE > BaseClass; \ - \ - public: \ - OSingletonRegistration() : BaseClass( ModuleClass::getInstance() ) \ - { \ - } \ - }; - - //========================================================================== - //= implementing a OModule for a component library - -#define IMPLEMENT_COMPONENT_MODULE( ModuleClass ) \ - struct ModuleClass##Creator \ - { \ - ModuleClass m_aModuleClass; \ - }; \ - namespace \ - { \ - class the##ModuleClass##Instance : public rtl::Static<ModuleClass##Creator, the##ModuleClass##Instance> {}; \ - } \ - \ - ModuleClass::ModuleClass() \ - :BaseClass() \ - { \ - } \ - \ - ModuleClass& ModuleClass::getInstance() \ - { \ - return the##ModuleClass##Instance::get().m_aModuleClass; \ - } \ - - //========================================================================== - //= implementing the API of a component library (component_*) - -#define IMPLEMENT_COMPONENT_LIBRARY_API( module_class, initializer_function ) \ - extern "C" SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnvironment( \ - const sal_Char **ppEnvTypeName, uno_Environment ** /*ppEnv*/ ) \ - { \ - *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; \ - } \ - extern "C" SAL_DLLPUBLIC_EXPORT void* SAL_CALL component_getFactory( \ - const sal_Char* pImplementationName, void* pServiceManager, void* pRegistryKey ) \ - { \ - initializer_function(); \ - return module_class::getInstance().getComponentFactory( pImplementationName, pServiceManager, pRegistryKey ); \ - } - //........................................................................ } // namespace comphelper //........................................................................ diff --git a/comphelper/inc/comphelper/servicedecl.hxx b/comphelper/inc/comphelper/servicedecl.hxx index b025cc7ffdce..c5ab4b79f5f7 100644 --- a/comphelper/inc/comphelper/servicedecl.hxx +++ b/comphelper/inc/comphelper/servicedecl.hxx @@ -387,12 +387,6 @@ BOOST_PP_REPEAT_FROM_TO(1, COMPHELPER_SERVICEDECL_COMPONENT_HELPER_MAX_ARGS, #define COMPHELPER_SERVICEDECL_make_exports(varargs_ ) \ extern "C" \ { \ - SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnvironment( const sal_Char** ppEnvTypeName, \ - uno_Environment** /*ppEnv*/ ) \ - { \ - *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; \ - } \ - \ SAL_DLLPUBLIC_EXPORT void* SAL_CALL component_getFactory( sal_Char const* pImplName, \ ::com::sun::star::lang::XMultiServiceFactory* pServiceManager, \ ::com::sun::star::registry::XRegistryKey* pRegistryKey ) \ diff --git a/comphelper/inc/comphelper/storagehelper.hxx b/comphelper/inc/comphelper/storagehelper.hxx index 00da529ab967..078bfb81c885 100644 --- a/comphelper/inc/comphelper/storagehelper.hxx +++ b/comphelper/inc/comphelper/storagehelper.hxx @@ -128,14 +128,6 @@ public: const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& xStorage ) throw ( ::com::sun::star::uno::Exception ); - // The followin methods are related to creation of a storage of specified format - static ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage > - GetTemporaryStorageOfFormat( - const ::rtl::OUString& aFormat, - const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xFactory - = ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >() ) - throw ( ::com::sun::star::uno::Exception ); - static ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage > GetStorageOfFormatFromURL( const ::rtl::OUString& aFormat, diff --git a/comphelper/prj/build.lst b/comphelper/prj/build.lst index a828870f2dbf..7dde46c47c7e 100644 --- a/comphelper/prj/build.lst +++ b/comphelper/prj/build.lst @@ -1,2 +1,2 @@ -ph comphelper : cppuhelper ucbhelper offuh salhelper LIBXSLT:libxslt NULL +ph comphelper : cppuhelper ucbhelper offapi salhelper LIBXSLT:libxslt NULL ch comphelper\prj nmake - all ch_all NULL diff --git a/comphelper/source/inc/comphelper_module.hxx b/comphelper/source/inc/comphelper_module.hxx index 9f8e32656715..dfa364df1983 100644 --- a/comphelper/source/inc/comphelper_module.hxx +++ b/comphelper/source/inc/comphelper_module.hxx @@ -35,7 +35,55 @@ namespace comphelper { namespace module { //........................................................................ - DECLARE_COMPONENT_MODULE( ComphelperModule, ComphelperModuleClient ) + class ComphelperModule : public ::comphelper::OModule + { + friend struct ComphelperModuleCreator; + typedef ::comphelper::OModule BaseClass; + + public: + static ComphelperModule& getInstance(); + + private: + ComphelperModule(); + }; + + /* -------------------------------------------------------------------- */ + class ComphelperModuleClient : public ::comphelper::OModuleClient + { + private: + typedef ::comphelper::OModuleClient BaseClass; + + public: + ComphelperModuleClient() : BaseClass( ComphelperModule::getInstance() ) + { + } + }; + + /* -------------------------------------------------------------------- */ + template < class TYPE > + class OAutoRegistration : public ::comphelper::OAutoRegistration< TYPE > + { + private: + typedef ::comphelper::OAutoRegistration< TYPE > BaseClass; + + public: + OAutoRegistration() : BaseClass( ComphelperModule::getInstance() ) + { + } + }; + + /* -------------------------------------------------------------------- */ + template < class TYPE > + class OSingletonRegistration : public ::comphelper::OSingletonRegistration< TYPE > + { + private: + typedef ::comphelper::OSingletonRegistration< TYPE > BaseClass; + + public: + OSingletonRegistration() : BaseClass( ComphelperModule::getInstance() ) + { + } + }; //........................................................................ } } // namespace comphelper::module diff --git a/comphelper/source/misc/comphelper_module.cxx b/comphelper/source/misc/comphelper_module.cxx index 8b9ee4221dfc..b2bdad6665cb 100644 --- a/comphelper/source/misc/comphelper_module.cxx +++ b/comphelper/source/misc/comphelper_module.cxx @@ -35,7 +35,24 @@ namespace comphelper { namespace module { //........................................................................ - IMPLEMENT_COMPONENT_MODULE( ComphelperModule ); + struct ComphelperModuleCreator + { + ComphelperModule m_aComphelperModule; + }; + namespace + { + class theComphelperModuleInstance : public rtl::Static<ComphelperModuleCreator, theComphelperModuleInstance> {}; + } + + ComphelperModule::ComphelperModule() + :BaseClass() + { + } + + ComphelperModule& ComphelperModule::getInstance() + { + return theComphelperModuleInstance::get().m_aComphelperModule; + } //........................................................................ } } // namespace comphelper::module diff --git a/comphelper/source/misc/comphelper_services.cxx b/comphelper/source/misc/comphelper_services.cxx index 32d1c53aff93..ad5558fb8ee7 100644 --- a/comphelper/source/misc/comphelper_services.cxx +++ b/comphelper/source/misc/comphelper_services.cxx @@ -85,6 +85,11 @@ namespace comphelper { namespace module } } // namespace comphelper::module //........................................................................ -IMPLEMENT_COMPONENT_LIBRARY_API( ::comphelper::module::ComphelperModule, ::comphelper::module::initializeModule ) +extern "C" SAL_DLLPUBLIC_EXPORT void* SAL_CALL component_getFactory( + const sal_Char* pImplementationName, void* pServiceManager, void* pRegistryKey ) +{ + ::comphelper::module::initializeModule(); + return ::comphelper::module::ComphelperModule::getInstance().getComponentFactory( pImplementationName, pServiceManager, pRegistryKey ); +} /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/comphelper/source/misc/storagehelper.cxx b/comphelper/source/misc/storagehelper.cxx index 3441e0a1736f..70b7852b579a 100644 --- a/comphelper/source/misc/storagehelper.cxx +++ b/comphelper/source/misc/storagehelper.cxx @@ -314,23 +314,6 @@ sal_Int32 OStorageHelper::GetXStorageFormat( } // ---------------------------------------------------------------------- -uno::Reference< embed::XStorage > OStorageHelper::GetTemporaryStorageOfFormat( - const ::rtl::OUString& aFormat, - const uno::Reference< lang::XMultiServiceFactory >& xFactory ) - throw ( uno::Exception ) -{ - uno::Reference< lang::XMultiServiceFactory > xFactoryToUse = xFactory.is() ? xFactory : ::comphelper::getProcessServiceFactory(); - if ( !xFactoryToUse.is() ) - throw uno::RuntimeException(); - - uno::Reference< io::XStream > xTmpStream( - xFactoryToUse->createInstance( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.io.TempFile" ) ) ), - uno::UNO_QUERY_THROW ); - - return GetStorageOfFormatFromStream( aFormat, xTmpStream, embed::ElementModes::READWRITE, xFactoryToUse ); -} - -// ---------------------------------------------------------------------- uno::Reference< embed::XStorage > OStorageHelper::GetStorageOfFormatFromURL( const ::rtl::OUString& aFormat, const ::rtl::OUString& aURL, diff --git a/cppcanvas/prj/build.lst b/cppcanvas/prj/build.lst index 2e4230956e32..bab151c5c142 100644 --- a/cppcanvas/prj/build.lst +++ b/cppcanvas/prj/build.lst @@ -1,2 +1,2 @@ -cx cppcanvas : comphelper cppuhelper offuh tools vcl basegfx canvas NULL +cx cppcanvas : comphelper cppuhelper offapi tools vcl basegfx canvas NULL cx cppcanvas\prj nmake - all cx_prj NULL diff --git a/cppcanvas/source/uno/exports.dxp b/cppcanvas/source/uno/exports.dxp index f0e1c69934bc..70033078921a 100644 --- a/cppcanvas/source/uno/exports.dxp +++ b/cppcanvas/source/uno/exports.dxp @@ -1,2 +1 @@ -component_getImplementationEnvironment component_getFactory diff --git a/cppcanvas/source/uno/exports.map b/cppcanvas/source/uno/exports.map index a488d5d06a43..f1ded4b70d9a 100644 --- a/cppcanvas/source/uno/exports.map +++ b/cppcanvas/source/uno/exports.map @@ -1,7 +1,6 @@ UDK_3_0_0 { global: _ZTI*; _ZTS*; # weak RTTI symbols for C++ exceptions - component_getImplementationEnvironment; component_getFactory; local: *; diff --git a/dtrans/prj/build.lst b/dtrans/prj/build.lst index 6ee2b47d53af..519e1fda37c8 100644 --- a/dtrans/prj/build.lst +++ b/dtrans/prj/build.lst @@ -1,4 +1,4 @@ -dr dtrans : unotools offapi offuh rdbmaker stoc LIBXSLT:libxslt NULL +dr dtrans : unotools offapi DESKTOP:rdbmaker stoc LIBXSLT:libxslt NULL dr dtrans usr1 - all dr_mkout NULL dr dtrans\inc nmake - all dr_inc NULL dr dtrans\source\cnttype nmake - all dr_cnttype dr_generic dr_inc NULL diff --git a/dtrans/source/cnttype/exports.dxp b/dtrans/source/cnttype/exports.dxp index f0e1c69934bc..70033078921a 100644 --- a/dtrans/source/cnttype/exports.dxp +++ b/dtrans/source/cnttype/exports.dxp @@ -1,2 +1 @@ -component_getImplementationEnvironment component_getFactory diff --git a/dtrans/source/cnttype/mctfentry.cxx b/dtrans/source/cnttype/mctfentry.cxx index 5a4df1c21798..6b09a8e69ce6 100644 --- a/dtrans/source/cnttype/mctfentry.cxx +++ b/dtrans/source/cnttype/mctfentry.cxx @@ -83,23 +83,8 @@ namespace } } -//----------------------------------------------------------------------------------------------------------- -// the 3 important functions which will be exported -//----------------------------------------------------------------------------------------------------------- - extern "C" { - -//---------------------------------------------------------------------- -// component_getImplementationEnvironment -//---------------------------------------------------------------------- - -SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnvironment( - const sal_Char ** ppEnvTypeName, uno_Environment ** /*ppEnv*/ ) -{ - *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; -} - //---------------------------------------------------------------------- // component_getFactory // returns a factory to create XFilePicker-Services diff --git a/dtrans/source/generic/clipboardmanager.cxx b/dtrans/source/generic/clipboardmanager.cxx index 5fdc78b19f4a..d6dc32226037 100644 --- a/dtrans/source/generic/clipboardmanager.cxx +++ b/dtrans/source/generic/clipboardmanager.cxx @@ -219,8 +219,7 @@ void SAL_CALL ClipboardManager::dispose() xComponent->removeEventListener(static_cast < XEventListener * > (this)); xComponent->dispose(); } - - catch(Exception e) + catch (const Exception&) { // exceptions can be safely ignored here. } diff --git a/dtrans/source/generic/dtrans.cxx b/dtrans/source/generic/dtrans.cxx index 7a47d12920a6..c9295644ea80 100644 --- a/dtrans/source/generic/dtrans.cxx +++ b/dtrans/source/generic/dtrans.cxx @@ -46,14 +46,6 @@ extern "C" //================================================================================================== -SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnvironment(const sal_Char ** ppEnvTypeName, - uno_Environment ** /*ppEnv*/ ) -{ - *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; -} - -//================================================================================================== - SAL_DLLPUBLIC_EXPORT void * SAL_CALL component_getFactory( const sal_Char * pImplName, void * pServiceManager, diff --git a/dtrans/source/generic/exports.dxp b/dtrans/source/generic/exports.dxp index f0e1c69934bc..70033078921a 100644 --- a/dtrans/source/generic/exports.dxp +++ b/dtrans/source/generic/exports.dxp @@ -1,2 +1 @@ -component_getImplementationEnvironment component_getFactory diff --git a/dtrans/source/test/test_dtrans.cxx b/dtrans/source/test/test_dtrans.cxx index 3bb0966e286d..d1a2611ca93c 100644 --- a/dtrans/source/test/test_dtrans.cxx +++ b/dtrans/source/test/test_dtrans.cxx @@ -465,13 +465,13 @@ int SAL_CALL main( int argc, const char* argv[] ) xClipboardManager->getClipboard( OUString(RTL_CONSTASCII_USTRINGPARAM("generic")) ); TRACE( "FAILED\n" ); } - catch( NoSuchElementException e ) + catch (const NoSuchElementException&) { TRACE( "passed\n" ); } } - catch ( Exception aException ) + catch (const Exception&) { ENSURE( sal_False, "*** ERROR *** exception caught." ); } diff --git a/dtrans/source/win32/clipb/WinClipbImpl.cxx b/dtrans/source/win32/clipb/WinClipbImpl.cxx index e2755bcd8123..0387f54c676f 100644 --- a/dtrans/source/win32/clipb/WinClipbImpl.cxx +++ b/dtrans/source/win32/clipb/WinClipbImpl.cxx @@ -36,11 +36,11 @@ #include "WinClipbImpl.hxx" #include <systools/win32/comtools.hxx> -#include "..\..\inc\DtObjFactory.hxx" -#include "..\dtobj\APNDataObject.hxx" +#include "../../inc/DtObjFactory.hxx" +#include "../dtobj/APNDataObject.hxx" #include "WinClipboard.hxx" #include <com/sun/star/datatransfer/clipboard/RenderingCapabilities.hpp> -#include "..\dtobj\XNotifyingDataObject.hxx" +#include "../dtobj/XNotifyingDataObject.hxx" #if defined _MSC_VER #pragma warning(push,1) @@ -200,11 +200,11 @@ sal_Int8 SAL_CALL CWinClipbImpl::getRenderingCapabilities( ) throw( RuntimeExce void SAL_CALL CWinClipbImpl::flushClipboard( ) throw( RuntimeException ) { // sollte eigentlich hier stehen: ClearableMutexGuard aGuard( m_ClipContentMutex ); - // geht aber nicht, da FlushClipboard zurckruft und das DataObject - // freigibt und damit wrde es einen Deadlock in onReleaseDataObject geben - // FlushClipboard mu synchron sein, damit das runterfahren ggf. erst weitergeht, + // geht aber nicht, da FlushClipboard zurückruft und das DataObject + // freigibt und damit würde es einen Deadlock in onReleaseDataObject geben + // FlushClipboard muß synchron sein, damit das runterfahren ggf. erst weitergeht, // wenn alle Clipboard-Formate gerendert wurden - // die Abfrage ist ntig, damit nur geflusht wird, wenn wir wirklich Clipboardowner + // die Abfrage ist nötig, damit nur geflusht wird, wenn wir wirklich Clipboardowner // sind (ich weiss nicht genau was passiert, wenn man flusht und nicht Clipboard // owner ist). // eventuell kann man aber die Abfrage in den Clipboard STA Thread verlagern, indem diff --git a/dtrans/source/win32/clipb/WinClipbImpl.hxx b/dtrans/source/win32/clipb/WinClipbImpl.hxx index 97e7919ea174..aa7a98d62e00 100644 --- a/dtrans/source/win32/clipb/WinClipbImpl.hxx +++ b/dtrans/source/win32/clipb/WinClipbImpl.hxx @@ -39,7 +39,7 @@ #include <com/sun/star/datatransfer/XTransferable.hpp> #include <com/sun/star/datatransfer/clipboard/XClipboardListener.hpp> #include <com/sun/star/datatransfer/clipboard/XClipboardOwner.hpp> -#include "..\..\inc\MtaOleClipb.hxx" +#include "../../inc/MtaOleClipb.hxx" #if defined _MSC_VER #pragma warning(push,1) diff --git a/dtrans/source/win32/clipb/exports.dxp b/dtrans/source/win32/clipb/exports.dxp index 926e49f5f1a5..70033078921a 100644 --- a/dtrans/source/win32/clipb/exports.dxp +++ b/dtrans/source/win32/clipb/exports.dxp @@ -1,3 +1 @@ -component_getImplementationEnvironment component_getFactory - diff --git a/dtrans/source/win32/clipb/wcbentry.cxx b/dtrans/source/win32/clipb/wcbentry.cxx index cd0de3ebf9ff..5c61e6c3557f 100644 --- a/dtrans/source/win32/clipb/wcbentry.cxx +++ b/dtrans/source/win32/clipb/wcbentry.cxx @@ -81,23 +81,8 @@ namespace } } -//----------------------------------------------------------------------------------------------------------- -// the 3 important functions which will be exported -//----------------------------------------------------------------------------------------------------------- - extern "C" { - -//---------------------------------------------------------------------- -// component_getImplementationEnvironment -//---------------------------------------------------------------------- - -SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnvironment( - const sal_Char ** ppEnvTypeName, uno_Environment ** /*ppEnv*/ ) -{ - *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; -} - //---------------------------------------------------------------------- // component_getFactory // returns a factory to create XFilePicker-Services diff --git a/dtrans/source/win32/dnd/dndentry.cxx b/dtrans/source/win32/dnd/dndentry.cxx index b089f95b6472..e7b56fcc5cf7 100644 --- a/dtrans/source/win32/dnd/dndentry.cxx +++ b/dtrans/source/win32/dnd/dndentry.cxx @@ -64,16 +64,6 @@ sal_Bool SAL_CALL component_canUnload( TimeValue *pTime ) } //---------------------------------------------------------------------- -// component_getImplementationEnvironment -//---------------------------------------------------------------------- - -SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnvironment( - const sal_Char ** ppEnvTypeName, uno_Environment ** /*ppEnv*/ ) -{ - *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; -} - -//---------------------------------------------------------------------- // component_getFactory // returns a factory to create XFilePicker-Services //---------------------------------------------------------------------- diff --git a/dtrans/source/win32/dnd/exports.dxp b/dtrans/source/win32/dnd/exports.dxp index f0e1c69934bc..70033078921a 100644 --- a/dtrans/source/win32/dnd/exports.dxp +++ b/dtrans/source/win32/dnd/exports.dxp @@ -1,2 +1 @@ -component_getImplementationEnvironment component_getFactory diff --git a/dtrans/source/win32/dtobj/DOTransferable.cxx b/dtrans/source/win32/dtobj/DOTransferable.cxx index f63e13b59ae7..561204cc5c4c 100644 --- a/dtrans/source/win32/dtobj/DOTransferable.cxx +++ b/dtrans/source/win32/dtobj/DOTransferable.cxx @@ -36,10 +36,10 @@ #include <rtl/process.h> #include "DOTransferable.hxx" -#include "..\misc\ImplHelper.hxx" -#include "..\misc\WinClip.hxx" +#include "../misc/ImplHelper.hxx" +#include "../misc/WinClip.hxx" #include "DTransHelper.hxx" -#include "..\misc\ImplHelper.hxx" +#include "../misc/ImplHelper.hxx" #include "TxtCnvtHlp.hxx" #include "MimeAttrib.hxx" #include "FmtFilter.hxx" diff --git a/dtrans/source/win32/dtobj/DTransHelper.hxx b/dtrans/source/win32/dtobj/DTransHelper.hxx index 0e6003211f90..9b2db7fbec6d 100644 --- a/dtrans/source/win32/dtobj/DTransHelper.hxx +++ b/dtrans/source/win32/dtobj/DTransHelper.hxx @@ -41,7 +41,7 @@ #if defined _MSC_VER #pragma warning(pop) #endif -#include "..\misc\WinClip.hxx" +#include "../misc/WinClip.hxx" //------------------------------------------------------------------------ // defines diff --git a/dtrans/source/win32/dtobj/DataFmtTransl.cxx b/dtrans/source/win32/dtobj/DataFmtTransl.cxx index a1d56a562c53..98e4bf2f62e0 100644 --- a/dtrans/source/win32/dtobj/DataFmtTransl.cxx +++ b/dtrans/source/win32/dtobj/DataFmtTransl.cxx @@ -36,8 +36,8 @@ #include <rtl/string.hxx> #include <osl/diagnose.h> #include <rtl/tencinfo.h> -#include "..\misc\ImplHelper.hxx" -#include "..\misc\WinClip.hxx" +#include "../misc/ImplHelper.hxx" +#include "../misc/WinClip.hxx" #include "MimeAttrib.hxx" #include "DTransHelper.hxx" #include <rtl/string.h> diff --git a/dtrans/source/win32/dtobj/DtObjFactory.cxx b/dtrans/source/win32/dtobj/DtObjFactory.cxx index 0f69b389e8ce..c7cab6086195 100644 --- a/dtrans/source/win32/dtobj/DtObjFactory.cxx +++ b/dtrans/source/win32/dtobj/DtObjFactory.cxx @@ -32,7 +32,7 @@ //------------------------------------------------------------------------ // includes //------------------------------------------------------------------------ -#include "..\..\inc\DtObjFactory.hxx" +#include "../../inc/DtObjFactory.hxx" #include "XTDataObject.hxx" diff --git a/dtrans/source/win32/dtobj/Fetc.cxx b/dtrans/source/win32/dtobj/Fetc.cxx index f9bbe856436e..faa453569910 100644 --- a/dtrans/source/win32/dtobj/Fetc.cxx +++ b/dtrans/source/win32/dtobj/Fetc.cxx @@ -34,7 +34,7 @@ //------------------------------------------------------------------------ #include <osl/diagnose.h> #include "Fetc.hxx" -#include "..\misc\ImplHelper.hxx" +#include "../misc/ImplHelper.hxx" //------------------------------------------------------------------------ // diff --git a/dtrans/source/win32/dtobj/FetcList.cxx b/dtrans/source/win32/dtobj/FetcList.cxx index dec172f01d84..fdf8ac4487ac 100644 --- a/dtrans/source/win32/dtobj/FetcList.cxx +++ b/dtrans/source/win32/dtobj/FetcList.cxx @@ -39,8 +39,8 @@ #include <com/sun/star/datatransfer/XMimeContentType.hpp> #include "DataFmtTransl.hxx" -#include "..\misc\ImplHelper.hxx" -#include "..\misc\WinClip.hxx" +#include "../misc/ImplHelper.hxx" +#include "../misc/WinClip.hxx" #include <algorithm> diff --git a/dtrans/source/win32/dtobj/FmtFilter.cxx b/dtrans/source/win32/dtobj/FmtFilter.cxx index 677d382df729..099ee71d9263 100644 --- a/dtrans/source/win32/dtobj/FmtFilter.cxx +++ b/dtrans/source/win32/dtobj/FmtFilter.cxx @@ -36,9 +36,9 @@ #pragma warning(push,1) #pragma warning(disable:4917) #endif -#include <Shobjidl.h> +#include <shobjidl.h> #include <shlguid.h> -#include <ObjIdl.h> +#include <objidl.h> #include <shellapi.h> #if defined _MSC_VER #pragma warning(pop) diff --git a/dtrans/source/win32/dtobj/TxtCnvtHlp.cxx b/dtrans/source/win32/dtobj/TxtCnvtHlp.cxx index 669ee78eff6d..d11eec3cfbe2 100644 --- a/dtrans/source/win32/dtobj/TxtCnvtHlp.cxx +++ b/dtrans/source/win32/dtobj/TxtCnvtHlp.cxx @@ -35,7 +35,7 @@ #include <osl/diagnose.h> #include "TxtCnvtHlp.hxx" #include "DTransHelper.hxx" -#include "..\misc\ImplHelper.hxx" +#include "../misc/ImplHelper.hxx" using namespace ::com::sun::star::datatransfer; using namespace ::com::sun::star::uno; diff --git a/dtrans/source/win32/dtobj/XNotifyingDataObject.cxx b/dtrans/source/win32/dtobj/XNotifyingDataObject.cxx index e23ec150f1d4..fe0c9896fb08 100644 --- a/dtrans/source/win32/dtobj/XNotifyingDataObject.cxx +++ b/dtrans/source/win32/dtobj/XNotifyingDataObject.cxx @@ -30,9 +30,9 @@ #include "precompiled_dtrans.hxx" #include <osl/diagnose.h> #include "XNotifyingDataObject.hxx" -#include "..\clipb\WinClipbImpl.hxx" -#include "..\clipb\WinClipboard.hxx" -#include "..\..\inc\DtObjFactory.hxx" +#include "../clipb/WinClipbImpl.hxx" +#include "../clipb/WinClipboard.hxx" +#include "../../inc/DtObjFactory.hxx" #ifdef __MINGW32__ #define __uuidof(I) IID_##I diff --git a/dtrans/source/win32/dtobj/XTDataObject.cxx b/dtrans/source/win32/dtobj/XTDataObject.cxx index e263f7e58292..82b18dd3185f 100644 --- a/dtrans/source/win32/dtobj/XTDataObject.cxx +++ b/dtrans/source/win32/dtobj/XTDataObject.cxx @@ -36,7 +36,7 @@ #include "XTDataObject.hxx" #include <com/sun/star/datatransfer/DataFlavor.hpp> -#include "..\misc\ImplHelper.hxx" +#include "../misc/ImplHelper.hxx" #include "DTransHelper.hxx" #include "TxtCnvtHlp.hxx" #include <com/sun/star/datatransfer/clipboard/XClipboardEx.hpp> diff --git a/dtrans/source/win32/ftransl/exports.dxp b/dtrans/source/win32/ftransl/exports.dxp index f0e1c69934bc..70033078921a 100644 --- a/dtrans/source/win32/ftransl/exports.dxp +++ b/dtrans/source/win32/ftransl/exports.dxp @@ -1,2 +1 @@ -component_getImplementationEnvironment component_getFactory diff --git a/dtrans/source/win32/ftransl/ftransl.cxx b/dtrans/source/win32/ftransl/ftransl.cxx index 97bbe2b6634c..24e81e2b28a5 100644 --- a/dtrans/source/win32/ftransl/ftransl.cxx +++ b/dtrans/source/win32/ftransl/ftransl.cxx @@ -36,7 +36,7 @@ #include "ftransl.hxx" #include <com/sun/star/datatransfer/XMimeContentType.hpp> -#include "..\misc\ImplHelper.hxx" +#include "../misc/ImplHelper.hxx" #if defined _MSC_VER #pragma warning(push,1) diff --git a/dtrans/source/win32/ftransl/ftransl.hxx b/dtrans/source/win32/ftransl/ftransl.hxx index 7adbfdae61a2..a63d308bb93e 100644 --- a/dtrans/source/win32/ftransl/ftransl.hxx +++ b/dtrans/source/win32/ftransl/ftransl.hxx @@ -40,7 +40,7 @@ #include <com/sun/star/lang/XServiceInfo.hpp> #include <com/sun/star/datatransfer/XDataFormatTranslator.hpp> #include <com/sun/star/datatransfer/XMimeContentTypeFactory.hpp> -#include "..\misc\WinClip.hxx" +#include "../misc/WinClip.hxx" #include <vector> diff --git a/dtrans/source/win32/ftransl/ftranslentry.cxx b/dtrans/source/win32/ftransl/ftranslentry.cxx index fb0655ead9cd..e519b5361102 100644 --- a/dtrans/source/win32/ftransl/ftranslentry.cxx +++ b/dtrans/source/win32/ftransl/ftranslentry.cxx @@ -84,23 +84,8 @@ namespace } } -//----------------------------------------------------------------------------------------------------------- -// the 3 important functions which will be exported -//----------------------------------------------------------------------------------------------------------- - extern "C" { - -//---------------------------------------------------------------------- -// component_getImplementationEnvironment -//---------------------------------------------------------------------- - -SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnvironment( - const sal_Char ** ppEnvTypeName, uno_Environment ** /*ppEnv*/ ) -{ - *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; -} - //---------------------------------------------------------------------- // component_getFactory // returns a factory to create XFilePicker-Services diff --git a/dtrans/source/win32/misc/ImplHelper.cxx b/dtrans/source/win32/misc/ImplHelper.cxx index c0db923d55d4..0a189577d880 100644 --- a/dtrans/source/win32/misc/ImplHelper.cxx +++ b/dtrans/source/win32/misc/ImplHelper.cxx @@ -47,7 +47,7 @@ #pragma warning(pop) #endif #ifdef __MINGW32__ -#include <excpt.h> +#include <sehandler.hxx> #endif //------------------------------------------------------------------------ @@ -188,7 +188,7 @@ sal_Bool SAL_CALL IsOEMCP( sal_uInt32 codepage ) 869, 874, 932, 936, 949, 950, 1361 }; for ( sal_Int8 i = 0; i < ( sizeof( arrOEMCP )/sizeof( sal_uInt32 ) ); ++i ) - if ( arrOEMCP[i] == codepage ) + if ( (sal_uInt32) arrOEMCP[i] == codepage ) return sal_True; return sal_False; diff --git a/dtrans/source/win32/mtaole/MtaOleClipb.cxx b/dtrans/source/win32/mtaole/MtaOleClipb.cxx index ee6da2ee5628..89a41edb2300 100644 --- a/dtrans/source/win32/mtaole/MtaOleClipb.cxx +++ b/dtrans/source/win32/mtaole/MtaOleClipb.cxx @@ -50,7 +50,7 @@ //#define UNICODE #include <osl/diagnose.h> -#include "..\..\inc\MtaOleClipb.hxx" +#include "../../inc/MtaOleClipb.hxx" #include <osl/conditn.hxx> #include <wchar.h> diff --git a/dtrans/source/win32/workbench/XTDo.cxx b/dtrans/source/win32/workbench/XTDo.cxx index 050cc349a41d..e036d1732336 100644 --- a/dtrans/source/win32/workbench/XTDo.cxx +++ b/dtrans/source/win32/workbench/XTDo.cxx @@ -34,7 +34,7 @@ //------------------------------------------------------------------------ #include <osl/diagnose.h> -#include "..\DTransHelper.hxx" +#include "../DTransHelper.hxx" #include "XTDo.hxx" diff --git a/dtrans/source/win32/workbench/test_wincb.cxx b/dtrans/source/win32/workbench/test_wincb.cxx index c41d5a79153f..395865449c85 100644 --- a/dtrans/source/win32/workbench/test_wincb.cxx +++ b/dtrans/source/win32/workbench/test_wincb.cxx @@ -35,7 +35,7 @@ //_________________________________________________________________________________________________________________________ -#include "..\misc\ImplHelper.hxx" +#include "../misc/ImplHelper.hxx" //_________________________________________________________________________________________________________________________ // other includes diff --git a/dtrans/test/win32/dnd/transferable.hxx b/dtrans/test/win32/dnd/transferable.hxx index 315b3f55c9b2..cc2863e8c237 100644 --- a/dtrans/test/win32/dnd/transferable.hxx +++ b/dtrans/test/win32/dnd/transferable.hxx @@ -53,7 +53,7 @@ #include <process.h> -#include "..\..\source\win32\ImplHelper.hxx" +#include "../../source/win32/ImplHelper.hxx" //------------------------------------------------------------- diff --git a/dtrans/util/exports.dxp b/dtrans/util/exports.dxp index f0e1c69934bc..70033078921a 100644 --- a/dtrans/util/exports.dxp +++ b/dtrans/util/exports.dxp @@ -1,2 +1 @@ -component_getImplementationEnvironment component_getFactory diff --git a/i18npool/inc/i18npool/lang.h b/i18npool/inc/i18npool/lang.h index 1870a7b48351..0059a1b6978e 100644 --- a/i18npool/inc/i18npool/lang.h +++ b/i18npool/inc/i18npool/lang.h @@ -78,7 +78,7 @@ /* It must be safe to include this file in plain C code, so only C style * comments are used. Do NOT use // C++ style comments. */ -/* disable typedef for usage in svx/source/dialog/langtab.src */ +/* disable typedef for usage in svtools/source/misc/langtab.src */ #ifndef RSC_RESOURCE_USAGE typedef unsigned short LanguageType; #endif diff --git a/i18npool/inc/i18npool/mslangid.hxx b/i18npool/inc/i18npool/mslangid.hxx index b2a9e054482c..a38ccdfd68c1 100644 --- a/i18npool/inc/i18npool/mslangid.hxx +++ b/i18npool/inc/i18npool/mslangid.hxx @@ -75,9 +75,7 @@ public: special value. @descr: NOTE: The "system" values may be overridden by the - application's configuration. If you need to access the system - values use <method>getRealLanguageWithoutConfig()</method> - instead. + application's configuration. @returns case LANGUAGE_PROCESS_OR_USER_DEFAULT : configured or system language @@ -154,13 +152,6 @@ public: static ::com::sun::star::lang::Locale getFallbackLocale( const ::com::sun::star::lang::Locale & rLocale ); - - /** Get fall-back LanguageType for LanguageType, resolving LANGUAGE_SYSTEM. - Returns the same LanguageType if an exact match was found. - */ - static LanguageType getFallbackLanguage( LanguageType nLang ); - - // ----------------------------- // - ConvertLanguageToIsoNames - // ----------------------------- @@ -184,34 +175,9 @@ public: const rtl::OString& rCountry ); static LanguageType convertIsoStringToLanguage( const rtl::OUString& rString, sal_Unicode cSep = '-' ); - static LanguageType convertIsoByteStringToLanguage( - const rtl::OString& rString, sal_Char cSep = '-' ); static LanguageType convertUnxByteStringToLanguage( const rtl::OString& rString ); - - /** @short: A real language/locale if the nLang parameter designates some - special value. - - @descr: NOTE: This is a raw interface to the system and does not take - any application configuration into account. If that is wanted, - which is most likely, use <method>getRealLanguage()</method> - instead. - - @returns - case LANGUAGE_PROCESS_OR_USER_DEFAULT : getSystemLanguage() - case LANGUAGE_SYSTEM_DEFAULT : getSystemLanguage() - case LANGUAGE_SYSTEM : getSystemLanguage() - case LANGUAGE_NONE : getSystemUILanguage() - case LANGUAGE_DONTKNOW : LANGUAGE_ENGLISH_US - else: nLang - - In case getSystemLanguage() or getSystemUILanguage() returned - LANGUAGE_DONTKNOW, LANGUAGE_ENGLISH_US is returned instead. - */ - static LanguageType getRealLanguageWithoutConfig( LanguageType nLang ); - - static LanguageType resolveSystemLanguageByScriptType( LanguageType nLang, sal_Int16 nType ); diff --git a/i18npool/prj/build.lst b/i18npool/prj/build.lst index 3a2e0c2d2b9c..113a9fa6c111 100644 --- a/i18npool/prj/build.lst +++ b/i18npool/prj/build.lst @@ -1,4 +1,4 @@ -inp i18npool : bridges sax stoc comphelper CPPUNIT:cppunit ICU:icu i18nutil regexp cpputools LIBXSLT:libxslt NULL +inp i18npool : bridges sax stoc comphelper CPPUNIT:cppunit ICU:icu i18nutil regexp DESKTOP:cpputools LIBXSLT:libxslt NULL inp i18npool usr1 - all inp_mkout NULL inp i18npool\inc nmake - all inp_inc NULL inp i18npool\source\registerservices nmake - all inp_rserv inp_inc NULL diff --git a/i18npool/prj/d.lst b/i18npool/prj/d.lst index 71e0ae3b4758..d6fd70f9adf9 100644 --- a/i18npool/prj/d.lst +++ b/i18npool/prj/d.lst @@ -40,11 +40,13 @@ mkdir: %_DEST%\inc\i18npool ..\%__SRC%\bin\i18nisol*.dll %_DEST%\bin\i18nisol*.dll ..\%__SRC%\lib\libi18nisolang*.so %_DEST%\lib\libi18nisolang*.so ..\%__SRC%\lib\libi18nisolang*.dylib %_DEST%\lib\libi18nisolang*.dylib +..\%__SRC%\lib\libi18nisolang*.a %_DEST%\lib\libi18nisolang*.a ..\%__SRC%\lib\ii18npaper*.lib %_DEST%\lib\ii18npaper*.lib ..\%__SRC%\bin\i18npaper*.dll %_DEST%\bin\i18npaper*.dll ..\%__SRC%\lib\libi18npaper*.so %_DEST%\lib\libi18npaper*.so ..\%__SRC%\lib\libi18npaper*.dylib %_DEST%\lib\libi18npaper*.dylib +..\%__SRC%\lib\libi18npaper*.a %_DEST%\lib\libi18npaper*.a ..\%__SRC%\misc\i18npool.component %_DEST%\xml\i18npool.component ..\%__SRC%\misc\i18nsearch.component %_DEST%\xml\i18nsearch.component diff --git a/i18npool/qa/cppunit/test_breakiterator.cxx b/i18npool/qa/cppunit/test_breakiterator.cxx index fc81cc9860fb..7740cf9188f6 100644 --- a/i18npool/qa/cppunit/test_breakiterator.cxx +++ b/i18npool/qa/cppunit/test_breakiterator.cxx @@ -57,11 +57,13 @@ public: void testLineBreaking(); void testGraphemeIteration(); void testWeak(); + void testAsian(); CPPUNIT_TEST_SUITE(TestBreakIterator); CPPUNIT_TEST(testLineBreaking); CPPUNIT_TEST(testGraphemeIteration); CPPUNIT_TEST(testWeak); + CPPUNIT_TEST(testAsian); CPPUNIT_TEST_SUITE_END(); private: @@ -104,7 +106,7 @@ void TestBreakIterator::testGraphemeIteration() aLocale.Country = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("IN")); { - sal_Unicode BA_HALANT_LA[] = { 0x09AC, 0x09CD, 0x09AF }; + const sal_Unicode BA_HALANT_LA[] = { 0x09AC, 0x09CD, 0x09AF }; ::rtl::OUString aTest1(BA_HALANT_LA, SAL_N_ELEMENTS(BA_HALANT_LA)); sal_Int32 nDone=0; @@ -118,7 +120,7 @@ void TestBreakIterator::testGraphemeIteration() } { - sal_Unicode HA_HALANT_NA_VOWELSIGNI[] = { 0x09B9, 0x09CD, 0x09A3, 0x09BF }; + const sal_Unicode HA_HALANT_NA_VOWELSIGNI[] = { 0x09B9, 0x09CD, 0x09A3, 0x09BF }; ::rtl::OUString aTest1(HA_HALANT_NA_VOWELSIGNI, SAL_N_ELEMENTS(HA_HALANT_NA_VOWELSIGNI)); sal_Int32 nDone=0; @@ -132,7 +134,7 @@ void TestBreakIterator::testGraphemeIteration() } { - sal_Unicode TA_HALANT_MA_HALANT_YA [] = { 0x09A4, 0x09CD, 0x09AE, 0x09CD, 0x09AF }; + const sal_Unicode TA_HALANT_MA_HALANT_YA [] = { 0x09A4, 0x09CD, 0x09AE, 0x09CD, 0x09AF }; ::rtl::OUString aTest1(TA_HALANT_MA_HALANT_YA, SAL_N_ELEMENTS(TA_HALANT_MA_HALANT_YA)); sal_Int32 nDone=0; @@ -156,10 +158,12 @@ void TestBreakIterator::testWeak() aLocale.Country = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("US")); { - sal_Unicode WEAKS[] = + const sal_Unicode WEAKS[] = { 0x0001, 0x0002, 0x0020, 0x00A0, + 0x2150, 0x215F, //Number Forms, fractions + 0x2160, 0x2180, //Number Forms, roman numerals 0x2200, 0x22FF, //Mathematical Operators 0x27C0, 0x27EF, //Miscellaneous Mathematical Symbols-A 0x2980, 0x29FF, //Miscellaneous Mathematical Symbols-B @@ -184,6 +188,45 @@ void TestBreakIterator::testWeak() } } +//A test to ensure that certain ranges and codepoints that are categorized as +//asian remain as asian, so that existing docs that depend on this don't silently +//change font for those asian chars. +//See https://bugs.freedesktop.org/show_bug.cgi?id=38095 +void TestBreakIterator::testAsian() +{ + lang::Locale aLocale; + aLocale.Language = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("en")); + aLocale.Country = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("US")); + + { + const sal_Unicode ASIANS[] = + { + //some typical CJK chars + 0x4E00, 0x62FF, + //The full HalfWidth and FullWidth block has historically been + //designated as taking the CJK font :-( + //HalfWidth and FullWidth forms of ASCII 0-9, categorized under + //UAX24 as "Common" i.e. by that logic WEAK + 0xFF10, 0xFF19, + //HalfWidth and FullWidth forms of ASCII A-z, categorized under + //UAX25 as "Latin", i.e. by that logic LATIN + 0xFF21, 0xFF5A + }; + ::rtl::OUString aAsians(ASIANS, SAL_N_ELEMENTS(ASIANS)); + + for (sal_Int32 i = 0; i < aAsians.getLength(); ++i) + { + sal_Int16 nScript = m_xBreak->getScriptType(aAsians, i); + rtl::OStringBuffer aMsg; + aMsg.append(RTL_CONSTASCII_STRINGPARAM("Char 0x")); + aMsg.append(static_cast<sal_Int32>(aAsians.getStr()[i]), 16); + aMsg.append(RTL_CONSTASCII_STRINGPARAM(" should have been asian")); + CPPUNIT_ASSERT_MESSAGE(aMsg.getStr(), + nScript == i18n::ScriptType::ASIAN); + } + } +} + TestBreakIterator::TestBreakIterator() { m_xContext = cppu::defaultBootstrap_InitialComponentContext(); diff --git a/i18npool/source/breakiterator/breakiteratorImpl.cxx b/i18npool/source/breakiterator/breakiteratorImpl.cxx index 3cc974870c3d..e81bfff9452a 100644 --- a/i18npool/source/breakiterator/breakiteratorImpl.cxx +++ b/i18npool/source/breakiterator/breakiteratorImpl.cxx @@ -443,67 +443,155 @@ sal_Int16 SAL_CALL BreakIteratorImpl::getWordType( const OUString& /*Text*/, return 0; } -static sal_Int16 scriptTypes[] = { - ScriptType::WEAK, ScriptType::WEAK, ScriptType::COMPLEX, ScriptType::LATIN, ScriptType::COMPLEX, - ScriptType::ASIAN, ScriptType::LATIN, ScriptType::LATIN, ScriptType::LATIN, ScriptType::COMPLEX, - ScriptType::COMPLEX, ScriptType::COMPLEX, ScriptType::LATIN, ScriptType::LATIN, ScriptType::LATIN, -// 15 - ScriptType::COMPLEX, ScriptType::COMPLEX, ScriptType::ASIAN, ScriptType::ASIAN, ScriptType::COMPLEX, - ScriptType::ASIAN, ScriptType::COMPLEX, ScriptType::ASIAN, ScriptType::COMPLEX, ScriptType::COMPLEX, - ScriptType::LATIN, ScriptType::COMPLEX, ScriptType::COMPLEX, ScriptType::COMPLEX, ScriptType::LATIN, -// 30 - ScriptType::LATIN, ScriptType::COMPLEX, ScriptType::LATIN, ScriptType::COMPLEX, ScriptType::COMPLEX, - ScriptType::COMPLEX, ScriptType::COMPLEX, ScriptType::COMPLEX, ScriptType::COMPLEX, ScriptType::COMPLEX, - ScriptType::LATIN, ScriptType::ASIAN, ScriptType::COMPLEX, ScriptType::COMPLEX, ScriptType::COMPLEX, -// 45 - ScriptType::COMPLEX, ScriptType::LATIN, ScriptType::LATIN, ScriptType::COMPLEX, ScriptType::COMPLEX, - ScriptType::LATIN, ScriptType::LATIN, ScriptType::COMPLEX, ScriptType::COMPLEX, ScriptType::LATIN, - ScriptType::COMPLEX, ScriptType::LATIN, ScriptType::COMPLEX, ScriptType::COMPLEX, ScriptType::COMPLEX, -// 60 - ScriptType::COMPLEX, ScriptType::COMPLEX, ScriptType::COMPLEX, ScriptType::COMPLEX, ScriptType::COMPLEX, - ScriptType::COMPLEX, ScriptType::COMPLEX, ScriptType::LATIN, ScriptType::LATIN, ScriptType::COMPLEX, - ScriptType::COMPLEX, ScriptType::COMPLEX, ScriptType::COMPLEX, ScriptType::ASIAN, ScriptType::ASIAN, -// 75 - ScriptType::COMPLEX, ScriptType::LATIN, ScriptType::COMPLEX, ScriptType::COMPLEX, ScriptType::COMPLEX, - ScriptType::LATIN, ScriptType::LATIN, ScriptType::COMPLEX, ScriptType::COMPLEX, ScriptType::COMPLEX, - ScriptType::COMPLEX, ScriptType::COMPLEX, ScriptType::COMPLEX, ScriptType::COMPLEX, ScriptType::COMPLEX, -// 90 - ScriptType::COMPLEX, ScriptType::COMPLEX, ScriptType::COMPLEX, ScriptType::COMPLEX, ScriptType::COMPLEX, - ScriptType::COMPLEX, ScriptType::COMPLEX, ScriptType::COMPLEX, ScriptType::COMPLEX, ScriptType::COMPLEX, - ScriptType::COMPLEX, ScriptType::COMPLEX, ScriptType::WEAK, ScriptType::WEAK, ScriptType::COMPLEX, -// 105 - ScriptType::ASIAN, ScriptType::COMPLEX, ScriptType::COMPLEX, ScriptType::COMPLEX, ScriptType::COMPLEX, - ScriptType::COMPLEX, ScriptType::COMPLEX, ScriptType::COMPLEX, ScriptType::COMPLEX, ScriptType::COMPLEX, - ScriptType::COMPLEX, ScriptType::COMPLEX, ScriptType::COMPLEX, ScriptType::COMPLEX, ScriptType::ASIAN, -// 120 - ScriptType::COMPLEX, ScriptType::COMPLEX, ScriptType::COMPLEX, ScriptType::COMPLEX, ScriptType::COMPLEX, - ScriptType::COMPLEX, ScriptType::COMPLEX, ScriptType::COMPLEX, ScriptType::WEAK, ScriptType::WEAK, - ScriptType::COMPLEX, ScriptType::COMPLEX, ScriptType::COMPLEX, ScriptType::COMPLEX, ScriptType::COMPLEX, -// 135 - ScriptType::COMPLEX, ScriptType::COMPLEX, ScriptType::COMPLEX, ScriptType::COMPLEX, ScriptType::COMPLEX, - ScriptType::COMPLEX, ScriptType::COMPLEX, ScriptType::COMPLEX, ScriptType::COMPLEX, ScriptType::COMPLEX, - ScriptType::COMPLEX, - ScriptType::WEAK}; - -#define scriptListCount SAL_N_ELEMENTS(scriptTypes) +namespace +{ + //See unicode/uscript.h + static sal_Int16 scriptTypes[] = + { + ScriptType::WEAK, ScriptType::WEAK, ScriptType::COMPLEX, ScriptType::LATIN, ScriptType::COMPLEX, + ScriptType::ASIAN, ScriptType::LATIN, ScriptType::LATIN, ScriptType::LATIN, ScriptType::COMPLEX, + ScriptType::COMPLEX, ScriptType::COMPLEX, ScriptType::LATIN, ScriptType::LATIN, ScriptType::LATIN, + // 15 + ScriptType::COMPLEX, ScriptType::COMPLEX, ScriptType::ASIAN, ScriptType::ASIAN, ScriptType::COMPLEX, + ScriptType::ASIAN, ScriptType::COMPLEX, ScriptType::ASIAN, ScriptType::COMPLEX, ScriptType::COMPLEX, + ScriptType::LATIN, ScriptType::COMPLEX, ScriptType::COMPLEX, ScriptType::COMPLEX, ScriptType::LATIN, + // 30 + ScriptType::LATIN, ScriptType::COMPLEX, ScriptType::LATIN, ScriptType::COMPLEX, ScriptType::COMPLEX, + ScriptType::COMPLEX, ScriptType::COMPLEX, ScriptType::COMPLEX, ScriptType::COMPLEX, ScriptType::COMPLEX, + ScriptType::LATIN, ScriptType::ASIAN, ScriptType::COMPLEX, ScriptType::COMPLEX, ScriptType::COMPLEX, + // 45 + ScriptType::COMPLEX, ScriptType::LATIN, ScriptType::LATIN, ScriptType::COMPLEX, ScriptType::COMPLEX, + ScriptType::LATIN, ScriptType::LATIN, ScriptType::COMPLEX, ScriptType::COMPLEX, ScriptType::LATIN, + ScriptType::COMPLEX, ScriptType::LATIN, ScriptType::COMPLEX, ScriptType::COMPLEX, ScriptType::COMPLEX, + // 60 + ScriptType::COMPLEX, ScriptType::COMPLEX, ScriptType::COMPLEX, ScriptType::COMPLEX, ScriptType::COMPLEX, + ScriptType::COMPLEX, ScriptType::COMPLEX, ScriptType::LATIN, ScriptType::LATIN, ScriptType::COMPLEX, + ScriptType::COMPLEX, ScriptType::COMPLEX, ScriptType::COMPLEX, ScriptType::ASIAN, ScriptType::ASIAN, + // 75 + ScriptType::COMPLEX, ScriptType::LATIN, ScriptType::COMPLEX, ScriptType::COMPLEX, ScriptType::COMPLEX, + ScriptType::LATIN, ScriptType::LATIN, ScriptType::COMPLEX, ScriptType::COMPLEX, ScriptType::COMPLEX, + ScriptType::COMPLEX, ScriptType::COMPLEX, ScriptType::COMPLEX, ScriptType::COMPLEX, ScriptType::COMPLEX, + // 90 + ScriptType::COMPLEX, ScriptType::COMPLEX, ScriptType::COMPLEX, ScriptType::COMPLEX, ScriptType::COMPLEX, + ScriptType::COMPLEX, ScriptType::COMPLEX, ScriptType::COMPLEX, ScriptType::COMPLEX, ScriptType::COMPLEX, + ScriptType::COMPLEX, ScriptType::COMPLEX, ScriptType::WEAK, ScriptType::WEAK, ScriptType::COMPLEX, + // 105 + ScriptType::ASIAN, ScriptType::COMPLEX, ScriptType::COMPLEX, ScriptType::COMPLEX, ScriptType::COMPLEX, + ScriptType::COMPLEX, ScriptType::COMPLEX, ScriptType::COMPLEX, ScriptType::COMPLEX, ScriptType::COMPLEX, + ScriptType::COMPLEX, ScriptType::COMPLEX, ScriptType::COMPLEX, ScriptType::COMPLEX, ScriptType::ASIAN, + // 120 + ScriptType::COMPLEX, ScriptType::COMPLEX, ScriptType::COMPLEX, ScriptType::COMPLEX, ScriptType::COMPLEX, + ScriptType::COMPLEX, ScriptType::COMPLEX, ScriptType::COMPLEX, ScriptType::WEAK, ScriptType::WEAK, + ScriptType::COMPLEX, ScriptType::COMPLEX, ScriptType::COMPLEX, ScriptType::COMPLEX, ScriptType::COMPLEX, + // 135 + ScriptType::COMPLEX, ScriptType::COMPLEX, ScriptType::COMPLEX, ScriptType::COMPLEX, ScriptType::COMPLEX, + ScriptType::COMPLEX, ScriptType::COMPLEX, ScriptType::COMPLEX, ScriptType::COMPLEX, ScriptType::COMPLEX, + ScriptType::COMPLEX, + ScriptType::WEAK + }; + +# define scriptTypesCount SAL_N_ELEMENTS(scriptTypes) + + sal_Int16 getScriptClassByUAX24Script(sal_uInt32 currentChar) + { + sal_Int16 nRet; + int32_t script = u_getIntPropertyValue(currentChar, UCHAR_SCRIPT); + if (script < 0) + nRet = ScriptType::WEAK; + else if (static_cast<size_t>(script) >= SAL_N_ELEMENTS(scriptTypes)) + nRet = ScriptType::COMPLEX; // anything new is going to be pretty wild + else + nRet = scriptTypes[script]; + return nRet; + } + + struct UBlock2Script + { + UBlockCode from; + UBlockCode to; + sal_Int16 script; + }; + + static UBlock2Script scriptList[] = + { + {UBLOCK_NO_BLOCK, UBLOCK_NO_BLOCK, ScriptType::WEAK}, + {UBLOCK_BASIC_LATIN, UBLOCK_ARMENIAN, ScriptType::LATIN}, + {UBLOCK_HEBREW, UBLOCK_MYANMAR, ScriptType::COMPLEX}, + {UBLOCK_GEORGIAN, UBLOCK_GEORGIAN, ScriptType::LATIN}, + {UBLOCK_HANGUL_JAMO, UBLOCK_HANGUL_JAMO, ScriptType::ASIAN}, + {UBLOCK_ETHIOPIC, UBLOCK_ETHIOPIC, ScriptType::COMPLEX}, + {UBLOCK_CHEROKEE, UBLOCK_RUNIC, ScriptType::LATIN}, + {UBLOCK_KHMER, UBLOCK_MONGOLIAN, ScriptType::COMPLEX}, + {UBLOCK_LATIN_EXTENDED_ADDITIONAL, UBLOCK_GREEK_EXTENDED, ScriptType::LATIN}, + {UBLOCK_NUMBER_FORMS, UBLOCK_NUMBER_FORMS, ScriptType::WEAK}, + {UBLOCK_CJK_RADICALS_SUPPLEMENT, UBLOCK_HANGUL_SYLLABLES, ScriptType::ASIAN}, + {UBLOCK_CJK_COMPATIBILITY_IDEOGRAPHS, UBLOCK_CJK_COMPATIBILITY_IDEOGRAPHS, ScriptType::ASIAN}, + {UBLOCK_ARABIC_PRESENTATION_FORMS_A, UBLOCK_ARABIC_PRESENTATION_FORMS_A, ScriptType::COMPLEX}, + {UBLOCK_CJK_COMPATIBILITY_FORMS, UBLOCK_CJK_COMPATIBILITY_FORMS, ScriptType::ASIAN}, + {UBLOCK_ARABIC_PRESENTATION_FORMS_B, UBLOCK_ARABIC_PRESENTATION_FORMS_B, ScriptType::COMPLEX}, + {UBLOCK_HALFWIDTH_AND_FULLWIDTH_FORMS, UBLOCK_HALFWIDTH_AND_FULLWIDTH_FORMS, ScriptType::ASIAN}, + {UBLOCK_CJK_UNIFIED_IDEOGRAPHS_EXTENSION_B, UBLOCK_CJK_COMPATIBILITY_IDEOGRAPHS_SUPPLEMENT, ScriptType::ASIAN}, + {UBLOCK_CJK_STROKES, UBLOCK_CJK_STROKES, ScriptType::ASIAN}, + {UBLOCK_LATIN_EXTENDED_C, UBLOCK_LATIN_EXTENDED_D, ScriptType::LATIN} + }; + + #define scriptListCount SAL_N_ELEMENTS(scriptList) + + //always sets rScriptType + // + //returns true for characters historically explicitly assigned to + //latin/weak/asian + // + //returns false for characters that historically implicitly assigned to + //weak as unknown + bool getCompatibilityScriptClassByBlock(sal_uInt32 currentChar, sal_Int16 &rScriptType) + { + bool bKnown = true; + //handle specific characters always as weak: + // 0x01 - this breaks a word + // 0x02 - this can be inside a word + // 0x20 & 0xA0 - Bug 102975, declare western space and non-break space as WEAK char. + if( 0x01 == currentChar || 0x02 == currentChar || 0x20 == currentChar || 0xA0 == currentChar) + rScriptType = ScriptType::WEAK; + // workaround for Coptic + else if ( 0x2C80 <= currentChar && 0x2CE3 >= currentChar) + rScriptType = ScriptType::LATIN; + else + { + UBlockCode block=ublock_getCode(currentChar); + size_t i = 0; + while (i < scriptListCount) + { + if (block <= scriptList[i].to) + break; + ++i; + } + if (i < scriptListCount && block >= scriptList[i].from) + rScriptType = scriptList[i].script; + else + { + rScriptType = ScriptType::WEAK; + bKnown = false; + } + } + return bKnown; + } +} sal_Int16 BreakIteratorImpl::getScriptClass(sal_uInt32 currentChar) { - static sal_uInt32 lastChar = 0; - static sal_Int16 nRet = 0; + static sal_uInt32 lastChar = 0; + static sal_Int16 nRet = 0; - if (currentChar != lastChar) { - lastChar = currentChar; + if (currentChar != lastChar) + { + lastChar = currentChar; - int32_t script = u_getIntPropertyValue(currentChar, UCHAR_SCRIPT); - if (script < 0) - nRet = ScriptType::WEAK; - else if (static_cast<size_t>(script) >= SAL_N_ELEMENTS(scriptTypes)) - nRet = ScriptType::COMPLEX; // anything new is going to be pretty wild - else - nRet = scriptTypes[script]; - } - return nRet; + if (!getCompatibilityScriptClassByBlock(currentChar, nRet)) + nRet = getScriptClassByUAX24Script(currentChar); + } + + return nRet; } static inline sal_Bool operator == (const Locale& l1, const Locale& l2) { diff --git a/i18npool/source/breakiterator/data/makefile.mk b/i18npool/source/breakiterator/data/makefile.mk index 81bbbbd280e1..572446a80e15 100644 --- a/i18npool/source/breakiterator/data/makefile.mk +++ b/i18npool/source/breakiterator/data/makefile.mk @@ -34,7 +34,7 @@ LIBTARGET=NO .INCLUDE : settings.mk # Fix heap limit problem on MSC -.IF "$(OS)" == "WNT" +.IF "$(COM)" == "MSC" .IF "$(COMEX)" != "8" CDEFS+=-Zm300 .ENDIF diff --git a/i18npool/source/breakiterator/makefile.mk b/i18npool/source/breakiterator/makefile.mk index 434fdc9f5d88..961d7aa1ac6e 100644 --- a/i18npool/source/breakiterator/makefile.mk +++ b/i18npool/source/breakiterator/makefile.mk @@ -57,6 +57,8 @@ SLOFILES= \ $(SLO)/xdictionary.obj \ $(subst,$(MISC)/,$(SLO)/ $(MY_MISC_CXXFILES:s/.c/.obj/)) +.IF "$(CROSS_COMPILING)" != "YES" + OBJFILES = $(OBJ)/gendict.obj APP1TARGET = gendict @@ -67,6 +69,8 @@ APP1OBJS = $(DEPOBJFILES) APP1STDLIBS = $(SALLIB) +.ENDIF + # --- Targets ------------------------------------------------------ .IF "$(SYSTEM_ICU)" == "YES" diff --git a/i18npool/source/collator/data/makefile.mk b/i18npool/source/collator/data/makefile.mk index 59eb1a55f807..920e50609d8e 100644 --- a/i18npool/source/collator/data/makefile.mk +++ b/i18npool/source/collator/data/makefile.mk @@ -33,7 +33,7 @@ TARGET=collator_data .INCLUDE : settings.mk # Fix heap limit problem on MSC -.IF "$(OS)" == "WNT" +.IF "$(COM)" == "MSC" .IF "$(COMEX)" != "8" CDEFS+=-Zm300 .ENDIF diff --git a/i18npool/source/collator/makefile.mk b/i18npool/source/collator/makefile.mk index 654b857b7d25..b9be239a00e4 100644 --- a/i18npool/source/collator/makefile.mk +++ b/i18npool/source/collator/makefile.mk @@ -49,6 +49,8 @@ SLOFILES= \ $(SLO)$/chaptercollator.obj \ $(rules_obj) +.IF "$(CROSS_COMPILING)" != "YES" + APP1TARGET = gencoll_rule APP1RPATH = NONE @@ -61,6 +63,8 @@ APP1STDLIBS = $(SALLIB) \ $(ICUUCLIB) \ $(ICUDATALIB) +.ENDIF + # --- Targets ------------------------------------------------------ .INCLUDE : target.mk diff --git a/i18npool/source/indexentry/data/makefile.mk b/i18npool/source/indexentry/data/makefile.mk index 42378dab25bc..84d4281a3f53 100644 --- a/i18npool/source/indexentry/data/makefile.mk +++ b/i18npool/source/indexentry/data/makefile.mk @@ -34,7 +34,7 @@ LIBTARGET=NO .INCLUDE : settings.mk # Fix heap limit problem on MSC -.IF "$(OS)" == "WNT" +.IF "$(COM)" == "MSC" .IF "$(COMEX)" != "8" CDEFS+=-Zm300 .ENDIF diff --git a/i18npool/source/indexentry/makefile.mk b/i18npool/source/indexentry/makefile.mk index 6b4ea3ed5ff2..79e3eaf95c4e 100644 --- a/i18npool/source/indexentry/makefile.mk +++ b/i18npool/source/indexentry/makefile.mk @@ -37,7 +37,6 @@ ENABLE_EXCEPTIONS=TRUE .INCLUDE : settings.mk - # --- Files -------------------------------------------------------- SLOFILES= \ @@ -47,6 +46,8 @@ SLOFILES= \ $(SLO)$/indexentrysupplier_default.obj \ $(SLO)$/indexentrysupplier_common.obj +.IF "$(CROSS_COMPILING)" != "YES" + OBJFILES = $(OBJ)$/genindex_data.obj APP1TARGET = genindex_data @@ -60,6 +61,8 @@ APP1STDLIBS = $(SALLIB) \ $(ICUUCLIB) \ $(ICUDATALIB) +.ENDIF + # --- Targets ------------------------------------------------------ .INCLUDE : target.mk diff --git a/i18npool/source/isolang/isolang.cxx b/i18npool/source/isolang/isolang.cxx index a96f80719357..0a1d524d2cda 100644 --- a/i18npool/source/isolang/isolang.cxx +++ b/i18npool/source/isolang/isolang.cxx @@ -1012,26 +1012,6 @@ LanguageType MsLangId::convertIsoStringToLanguage( // ----------------------------------------------------------------------- -// static -LanguageType MsLangId::convertIsoByteStringToLanguage( - const rtl::OString& rString, sal_Char cSep ) -{ - rtl::OString aLang; - rtl::OString aCountry; - sal_Int32 nSepPos = rString.indexOf( cSep ); - if ( nSepPos >= 0 ) - { - aLang = rString.copy( 0, nSepPos ); - aCountry = rString.copy( nSepPos+1 ); - } - else - aLang = rString; - - return convertIsoNamesToLanguage( aLang, aCountry ); -} - -// ----------------------------------------------------------------------- - struct IsoLangGLIBCModifiersEntry { LanguageType mnLang; diff --git a/i18npool/source/isolang/makefile.mk b/i18npool/source/isolang/makefile.mk index b8f01460f67b..2ade308aa91c 100644 --- a/i18npool/source/isolang/makefile.mk +++ b/i18npool/source/isolang/makefile.mk @@ -43,7 +43,11 @@ SLOFILES= $(SLO)$/insys.obj \ $(SLO)$/mslangid.obj SHL1TARGET= $(ISOLANG_TARGET)$(ISOLANG_MAJOR)$(COMID) +.IF "$(COM)" == "MSC" SHL1IMPLIB= i$(ISOLANG_TARGET) +.ELSE +SHL1IMPLIB= $(ISOLANG_TARGET)$(ISOLANG_MAJOR)$(COMID) +.ENDIF DEF1DEPN= $(MISC)$/$(SHL1TARGET).flt SHL1DEF= $(MISC)$/$(SHL1TARGET).def diff --git a/i18npool/source/isolang/mslangid.cxx b/i18npool/source/isolang/mslangid.cxx index c11d4d6d1387..2b5c59e865a7 100644 --- a/i18npool/source/isolang/mslangid.cxx +++ b/i18npool/source/isolang/mslangid.cxx @@ -90,29 +90,6 @@ inline LanguageType MsLangId::simplifySystemLanguages( LanguageType nLang ) return nLang; } - -// static -LanguageType MsLangId::getRealLanguageWithoutConfig( LanguageType nLang ) -{ - switch (simplifySystemLanguages( nLang)) - { - case LANGUAGE_SYSTEM : - nLang = getSystemLanguage(); - break; - case LANGUAGE_NONE : - nLang = getSystemUILanguage(); - break; - default: - /* TODO: would this be useful here? */ - //nLang = MsLangId::getReplacementForObsoleteLanguage( nLang); - ; // nothing - } - if (nLang == LANGUAGE_DONTKNOW) - nLang = LANGUAGE_ENGLISH_US; - return nLang; -} - - // static LanguageType MsLangId::getRealLanguage( LanguageType nLang ) { @@ -252,14 +229,6 @@ LanguageType MsLangId::convertLocaleToLanguageWithFallback( return lookupFallbackLocale( rLocale); } - -// static -LanguageType MsLangId::getFallbackLanguage( LanguageType nLang ) -{ - return lookupFallbackLanguage( MsLangId::getRealLanguage( nLang)); -} - - // static bool MsLangId::isRightToLeft( LanguageType nLang ) { diff --git a/i18npool/source/localedata/LocaleNode.cxx b/i18npool/source/localedata/LocaleNode.cxx index 05f6156489a6..caa40746fd31 100644 --- a/i18npool/source/localedata/LocaleNode.cxx +++ b/i18npool/source/localedata/LocaleNode.cxx @@ -484,24 +484,24 @@ void LCCTYPENode::generateCode (const OFileWriter &of) const "DoubleQuotationEnd is an ASCII character but DoubleQuotationStart is not."); if (aQuoteStart.toChar() <= 127 && aQuoteEnd.toChar() <= 127) fprintf( stderr, "Warning: %s\n", - "QuotationStart and QuotationEnd are both ASCII characters. Not necessarily an error, but unusual."); + "QuotationStart and QuotationEnd are both ASCII characters. Not necessarily an issue, but unusual."); if (aDoubleQuoteStart.toChar() <= 127 && aDoubleQuoteEnd.toChar() <= 127) fprintf( stderr, "Warning: %s\n", - "DoubleQuotationStart and DoubleQuotationEnd are both ASCII characters. Not necessarily an error, but unusual."); + "DoubleQuotationStart and DoubleQuotationEnd are both ASCII characters. Not necessarily an issue, but unusual."); if (aQuoteStart == aQuoteEnd) fprintf( stderr, "Warning: %s\n", - "QuotationStart equals QuotationEnd. Not necessarily an error, but unusual."); + "QuotationStart equals QuotationEnd. Not necessarily an issue, but unusual."); if (aDoubleQuoteStart == aDoubleQuoteEnd) fprintf( stderr, "Warning: %s\n", - "DoubleQuotationStart equals DoubleQuotationEnd. Not necessarily an error, but unusual."); + "DoubleQuotationStart equals DoubleQuotationEnd. Not necessarily an issue, but unusual."); /* TODO: should equalness of single and double quotes be an error? Would * need to adapt quite some locales' data. */ if (aQuoteStart == aDoubleQuoteStart) fprintf( stderr, "Warning: %s\n", - "QuotationStart equals DoubleQuotationStart. Not necessarily an error, but unusual."); + "QuotationStart equals DoubleQuotationStart. Not necessarily an isue, but unusual."); if (aQuoteEnd == aDoubleQuoteEnd) fprintf( stderr, "Warning: %s\n", - "QuotationEnd equals DoubleQuotationEnd. Not necessarily an error, but unusual."); + "QuotationEnd equals DoubleQuotationEnd. Not necessarily an issue, but unusual."); // Known good values, exclude ASCII single (U+0027, ') and double (U+0022, ") quotes. int ic; switch (ic = aQuoteStart.toChar()) diff --git a/i18npool/source/localedata/data/gd_GB.xml b/i18npool/source/localedata/data/gd_GB.xml new file mode 100644 index 000000000000..0a1c64a0136d --- /dev/null +++ b/i18npool/source/localedata/data/gd_GB.xml @@ -0,0 +1,357 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE Locale SYSTEM "locale.dtd"> +<Locale versionDTD="2.0.3" allowUpdateFromCLDR="no" version="1.0"> +<LC_INFO> +<Language> +<LangID>gd</LangID> +<DefaultName>Gaelic, Scottish</DefaultName> +</Language> +<Country> +<CountryID>GB</CountryID> +<DefaultName>United Kingdom</DefaultName> +</Country> +</LC_INFO> +<LC_CTYPE unoid="generic"> +<Separators> +<DateSeparator>/</DateSeparator> +<ThousandSeparator>,</ThousandSeparator> +<DecimalSeparator>.</DecimalSeparator> +<TimeSeparator>:</TimeSeparator> +<Time100SecSeparator>.</Time100SecSeparator> +<ListSeparator>;</ListSeparator> +<LongDateDayOfWeekSeparator>, </LongDateDayOfWeekSeparator> +<LongDateDaySeparator>, </LongDateDaySeparator> +<LongDateMonthSeparator> </LongDateMonthSeparator> +<LongDateYearSeparator> </LongDateYearSeparator> +</Separators> +<Markers> +<QuotationStart>‘</QuotationStart> +<QuotationEnd>’</QuotationEnd> +<DoubleQuotationStart>“</DoubleQuotationStart> +<DoubleQuotationEnd>”</DoubleQuotationEnd> +</Markers> +<TimeAM>m</TimeAM> +<TimePM>f</TimePM> +<MeasurementSystem>metric</MeasurementSystem> +</LC_CTYPE> +<LC_FORMAT replaceFrom="[CURRENCY]" replaceTo="[$£-43C]"> +<FormatElement msgid="FixedFormatskey1" default="true" type="medium" usage="FIXED_NUMBER" formatindex="0"> +<FormatCode>General</FormatCode> +</FormatElement> +<FormatElement msgid="FixedFormatskey2" default="true" type="short" usage="FIXED_NUMBER" formatindex="1"> +<FormatCode>0</FormatCode> +</FormatElement> +<FormatElement msgid="FixedFormatskey3" default="false" type="medium" usage="FIXED_NUMBER" formatindex="2"> +<FormatCode>0.00</FormatCode> +</FormatElement> +<FormatElement msgid="FixedFormatskey4" default="false" type="short" usage="FIXED_NUMBER" formatindex="3"> +<FormatCode>#,##0</FormatCode> +</FormatElement> +<FormatElement msgid="FixedFormatskey5" default="false" type="medium" usage="FIXED_NUMBER" formatindex="4"> +<FormatCode>#,##0.00</FormatCode> +</FormatElement> +<FormatElement msgid="FixedFormatskey6" default="false" type="medium" usage="FIXED_NUMBER" formatindex="5"> +<FormatCode>#,###.00</FormatCode> +</FormatElement> +<FormatElement msgid="ScientificFormatskey1" default="true" type="medium" usage="SCIENTIFIC_NUMBER" formatindex="6"> +<FormatCode>0.00E+00</FormatCode> +</FormatElement> +<FormatElement msgid="ScientificFormatskey2" default="false" type="medium" usage="SCIENTIFIC_NUMBER" formatindex="7"> +<FormatCode>0.00E+000</FormatCode> +</FormatElement> +<FormatElement msgid="PercentFormatskey1" default="true" type="short" usage="PERCENT_NUMBER" formatindex="8"> +<FormatCode>0%</FormatCode> +</FormatElement> +<FormatElement msgid="PercentFormatskey2" default="true" type="long" usage="PERCENT_NUMBER" formatindex="9"> +<FormatCode>0.00%</FormatCode> +</FormatElement> +<FormatElement msgid="CurrencyFormatskey1" default="true" type="short" usage="CURRENCY" formatindex="12"> +<FormatCode>[CURRENCY]#,##0;-[CURRENCY]#,##0</FormatCode> +</FormatElement> +<FormatElement msgid="CurrencyFormatskey2" default="false" type="medium" usage="CURRENCY" formatindex="13"> +<FormatCode>[CURRENCY]#,##0.00;-[CURRENCY]#,##0.00</FormatCode> +</FormatElement> +<FormatElement msgid="CurrencyFormatskey3" default="false" type="medium" usage="CURRENCY" formatindex="14"> +<FormatCode>[CURRENCY]#,##0;[RED]-[CURRENCY]#,##0</FormatCode> +</FormatElement> +<FormatElement msgid="CurrencyFormatskey4" default="true" type="medium" usage="CURRENCY" formatindex="15"> +<FormatCode>[CURRENCY]#,##0.00;[RED]-[CURRENCY]#,##0.00</FormatCode> +</FormatElement> +<FormatElement msgid="CurrencyFormatskey5" default="false" type="medium" usage="CURRENCY" formatindex="16"> +<FormatCode>CCC#,##0.00</FormatCode> +</FormatElement> +<FormatElement msgid="CurrencyFormatskey6" default="false" type="medium" usage="CURRENCY" formatindex="17"> +<FormatCode>[CURRENCY]#,##0.--;[RED]-[CURRENCY]#,##0.--</FormatCode> +</FormatElement> +<FormatElement msgid="DateFormatskey11" default="true" type="short" usage="DATE" formatindex="18"> +<FormatCode>D/MM/YY</FormatCode> +</FormatElement> +<FormatElement msgid="DateFormatskey14" default="true" type="long" usage="DATE" formatindex="19"> +<FormatCode>NNNNDD, MMMM YYYY</FormatCode> +</FormatElement> +<FormatElement msgid="DateFormatskey6" default="true" type="medium" usage="DATE" formatindex="20"> +<FormatCode>DD/MM/YY</FormatCode> +</FormatElement> +<FormatElement msgid="DateFormatskey5" default="false" type="medium" usage="DATE" formatindex="21"> +<FormatCode>DD/MM/YYYY</FormatCode> +</FormatElement> +<FormatElement msgid="DateFormatskey15" default="false" type="long" usage="DATE" formatindex="22"> +<FormatCode>D, MMM YY</FormatCode> +</FormatElement> +<FormatElement msgid="DateFormatskey16" default="false" type="long" usage="DATE" formatindex="23"> +<FormatCode>D, MMM YYYY</FormatCode> +</FormatElement> +<FormatElement msgid="DateFormatskey21" default="false" type="long" usage="DATE" formatindex="24"> +<FormatCode>D, MMM YYYY</FormatCode> +</FormatElement> +<FormatElement msgid="DateFormatskey17" default="false" type="long" usage="DATE" formatindex="25"> +<FormatCode>D, MMMM YYYY</FormatCode> +</FormatElement> +<FormatElement msgid="DateFormatskey22" default="false" type="long" usage="DATE" formatindex="26"> +<FormatCode>D, MMMM YY</FormatCode> +</FormatElement> +<FormatElement msgid="DateFormatskey10" default="false" type="medium" usage="DATE" formatindex="27"> +<FormatCode>NN, DD/MMM/YY</FormatCode> +</FormatElement> +<FormatElement msgid="DateFormatskey18" default="false" type="long" usage="DATE" formatindex="28"> +<FormatCode>NN, D, MMM YY</FormatCode> +</FormatElement> +<FormatElement msgid="DateFormatskey19" default="false" type="long" usage="DATE" formatindex="29"> +<FormatCode>NN, D, MMMM YYYY</FormatCode> +</FormatElement> +<FormatElement msgid="DateFormatskey20" default="false" type="long" usage="DATE" formatindex="30"> +<FormatCode>NNNND, MMMM YYYY</FormatCode> +</FormatElement> +<FormatElement msgid="DateFormatskey12" default="false" type="short" usage="DATE" formatindex="31"> +<FormatCode>MM/DD</FormatCode> +</FormatElement> +<FormatElement msgid="DateFormatskey7" default="false" type="medium" usage="DATE" formatindex="32"> +<FormatCode>YY-MM-DD</FormatCode> +<DefaultName>ISO 8601</DefaultName> +</FormatElement> +<FormatElement msgid="DateFormatskey8" default="false" type="medium" usage="DATE" formatindex="33"> +<FormatCode>YYYY-MM-DD</FormatCode> +<DefaultName>ISO 8601</DefaultName> +</FormatElement> +<FormatElement msgid="DateFormatskey1" default="false" type="medium" usage="DATE" formatindex="34"> +<FormatCode>MM/YY</FormatCode> +</FormatElement> +<FormatElement msgid="DateFormatskey2" default="false" type="medium" usage="DATE" formatindex="35"> +<FormatCode>MMM/DD</FormatCode> +</FormatElement> +<FormatElement msgid="DateFormatskey3" default="false" type="medium" usage="DATE" formatindex="36"> +<FormatCode>MMMM</FormatCode> +</FormatElement> +<FormatElement msgid="DateFormatskey4" default="false" type="medium" usage="DATE" formatindex="37"> +<FormatCode>QQ YY</FormatCode> +</FormatElement> +<FormatElement msgid="DateFormatskey9" default="false" type="medium" usage="DATE" formatindex="38"> +<FormatCode>WW</FormatCode> +</FormatElement> +<FormatElement msgid="TimeFormatskey1" default="false" type="short" usage="TIME" formatindex="39"> +<FormatCode>HH:MM</FormatCode> +</FormatElement> +<FormatElement msgid="TimeFormatskey2" default="false" type="medium" usage="TIME" formatindex="40"> +<FormatCode>HH:MM:SS</FormatCode> +</FormatElement> +<FormatElement msgid="TimeFormatskey3" default="true" type="short" usage="TIME" formatindex="41"> +<FormatCode>HH:MM AM/PM</FormatCode> +</FormatElement> +<FormatElement msgid="TimeFormatskey4" default="true" type="medium" usage="TIME" formatindex="42"> +<FormatCode>HH:MM:SS AM/PM</FormatCode> +</FormatElement> +<FormatElement msgid="TimeFormatskey5" default="false" type="medium" usage="TIME" formatindex="43"> +<FormatCode>[HH]:MM:SS</FormatCode> +</FormatElement> +<FormatElement msgid="TimeFormatskey6" default="false" type="short" usage="TIME" formatindex="44"> +<FormatCode>MM:SS.00</FormatCode> +</FormatElement> +<FormatElement msgid="TimeFormatskey7" default="false" type="medium" usage="TIME" formatindex="45"> +<FormatCode>[HH]:MM:SS.00</FormatCode> +</FormatElement> +<FormatElement msgid="DateTimeFormatskey1" default="true" type="medium" usage="DATE_TIME" formatindex="46"> +<FormatCode>DD/MM/YY HH:MM</FormatCode> +</FormatElement> +<FormatElement msgid="DateTimeFormatskey2" default="false" type="medium" usage="DATE_TIME" formatindex="47"> +<FormatCode>DD/MM/YYYY HH:MM:SS AM/PM</FormatCode> +</FormatElement> +</LC_FORMAT> +<LC_COLLATION> +<Collator default="true" unoid="alphanumeric"/> +<CollationOptions> +<TransliterationModules>IGNORE_CASE</TransliterationModules> +</CollationOptions> +</LC_COLLATION> +<LC_SEARCH> +<SearchOptions> +<TransliterationModules>IGNORE_CASE</TransliterationModules> +</SearchOptions> +</LC_SEARCH> +<LC_INDEX> +<IndexKey phonetic="false" default="true" unoid="alphanumeric">AÀÁBCDEÈÉFGHIJKÌLMNOÒÓPQRSTUÙVWXYZ</IndexKey> +<UnicodeScript>0</UnicodeScript> +<UnicodeScript>1</UnicodeScript> +<FollowPageWord>td</FollowPageWord> +<FollowPageWord>td</FollowPageWord> +</LC_INDEX> +<LC_CALENDAR> +<Calendar unoid="gregorian" default="true"> +<DaysOfWeek> +<Day> +<DayID>sun</DayID> +<DefaultAbbrvName>DiD</DefaultAbbrvName> +<DefaultFullName>DiDòmhnaich</DefaultFullName> +</Day> +<Day> +<DayID>mon</DayID> +<DefaultAbbrvName>DiL</DefaultAbbrvName> +<DefaultFullName>DiLuain</DefaultFullName> +</Day> +<Day> +<DayID>tue</DayID> +<DefaultAbbrvName>DiM</DefaultAbbrvName> +<DefaultFullName>DiMàirt</DefaultFullName> +</Day> +<Day> +<DayID>wed</DayID> +<DefaultAbbrvName>DiC</DefaultAbbrvName> +<DefaultFullName>DiCiadain</DefaultFullName> +</Day> +<Day> +<DayID>thu</DayID> +<DefaultAbbrvName>Dia</DefaultAbbrvName> +<DefaultFullName>DiarDaoin</DefaultFullName> +</Day> +<Day> +<DayID>fri</DayID> +<DefaultAbbrvName>Dih</DefaultAbbrvName> +<DefaultFullName>DihAoine</DefaultFullName> +</Day> +<Day> +<DayID>sat</DayID> +<DefaultAbbrvName>DiS</DefaultAbbrvName> +<DefaultFullName>DiSathairne</DefaultFullName> +</Day> +</DaysOfWeek> +<MonthsOfYear> +<Month> +<MonthID>jan</MonthID> +<DefaultAbbrvName>Faoi</DefaultAbbrvName> +<DefaultFullName>Faoilleach</DefaultFullName> +</Month> +<Month> +<MonthID>feb</MonthID> +<DefaultAbbrvName>Gearr</DefaultAbbrvName> +<DefaultFullName>Gearran</DefaultFullName> +</Month> +<Month> +<MonthID>mar</MonthID> +<DefaultAbbrvName>Màrt</DefaultAbbrvName> +<DefaultFullName>Màrt</DefaultFullName> +</Month> +<Month> +<MonthID>apr</MonthID> +<DefaultAbbrvName>Gibl</DefaultAbbrvName> +<DefaultFullName>Giblean</DefaultFullName> +</Month> +<Month> +<MonthID>may</MonthID> +<DefaultAbbrvName>Cèit</DefaultAbbrvName> +<DefaultFullName>Cèitean</DefaultFullName> +</Month> +<Month> +<MonthID>jun</MonthID> +<DefaultAbbrvName>Ògmh</DefaultAbbrvName> +<DefaultFullName>Ògmhios</DefaultFullName> +</Month> +<Month> +<MonthID>jul</MonthID> +<DefaultAbbrvName>Iuch</DefaultAbbrvName> +<DefaultFullName>Iuchar</DefaultFullName> +</Month> +<Month> +<MonthID>aug</MonthID> +<DefaultAbbrvName>Lùna</DefaultAbbrvName> +<DefaultFullName>Lùnastal</DefaultFullName> +</Month> +<Month> +<MonthID>sep</MonthID> +<DefaultAbbrvName>Sult</DefaultAbbrvName> +<DefaultFullName>Sultain</DefaultFullName> +</Month> +<Month> +<MonthID>oct</MonthID> +<DefaultAbbrvName>Dàmh</DefaultAbbrvName> +<DefaultFullName>Dàmhair</DefaultFullName> +</Month> +<Month> +<MonthID>nov</MonthID> +<DefaultAbbrvName>Samh</DefaultAbbrvName> +<DefaultFullName>Samhain</DefaultFullName> +</Month> +<Month> +<MonthID>dec</MonthID> +<DefaultAbbrvName>Dùbh</DefaultAbbrvName> +<DefaultFullName>Dùbhlachd</DefaultFullName> +</Month> +</MonthsOfYear> +<Eras> +<Era> +<EraID>bc</EraID> +<DefaultAbbrvName>RC</DefaultAbbrvName> +<DefaultFullName>ro Chrìost</DefaultFullName> +</Era> +<Era> +<EraID>ad</EraID> +<DefaultAbbrvName>AD</DefaultAbbrvName> +<DefaultFullName>as dèidh Chrìost</DefaultFullName> +</Era> +</Eras> +<StartDayOfWeek> +<DayID>mon</DayID> +</StartDayOfWeek> +<MinimalDaysInFirstWeek>1</MinimalDaysInFirstWeek> +</Calendar> +</LC_CALENDAR> +<LC_CURRENCY> +<Currency default="true" usedInCompatibleFormatCodes="true"> +<CurrencyID>GBP</CurrencyID> +<CurrencySymbol>£</CurrencySymbol> +<BankSymbol>GBP</BankSymbol> +<CurrencyName>Punnd Sasannach</CurrencyName> +<DecimalPlaces>2</DecimalPlaces> +</Currency> +</LC_CURRENCY> +<LC_TRANSLITERATION> +<Transliteration unoid="LOWERCASE_UPPERCASE"/> +<Transliteration unoid="UPPERCASE_LOWERCASE"/> +<Transliteration unoid="IGNORE_CASE"/> +</LC_TRANSLITERATION> +<LC_MISC> +<ReservedWords> +<trueWord>Fìor</trueWord> +<falseWord>Breug</falseWord> +<quarter1Word>Ràithe 1</quarter1Word> +<quarter2Word>Ràithe 2</quarter2Word> +<quarter3Word>Ràithe 3</quarter3Word> +<quarter4Word>Ràithe 4</quarter4Word> +<aboveWord>Os cionn</aboveWord> +<belowWord>Fo</belowWord> +<quarter1Abbreviation>R 1</quarter1Abbreviation> +<quarter2Abbreviation>R 2</quarter2Abbreviation> +<quarter3Abbreviation>R 3</quarter3Abbreviation> +<quarter4Abbreviation>R 4</quarter4Abbreviation> +</ReservedWords> +</LC_MISC> +<LC_NumberingLevel> +<NumberingLevel NumType="4" Prefix=" " Suffix=")"/> +<NumberingLevel NumType="4" Prefix=" " Suffix="."/> +<NumberingLevel NumType="4" Prefix="(" Suffix=")"/> +<NumberingLevel NumType="2" Prefix=" " Suffix="."/> +<NumberingLevel NumType="0" Prefix=" " Suffix=")"/> +<NumberingLevel NumType="1" Prefix=" " Suffix=")"/> +<NumberingLevel NumType="1" Prefix="(" Suffix=")"/> +<NumberingLevel NumType="3" Prefix=" " Suffix="."/> +</LC_NumberingLevel> +<LC_OutLineNumberingLevel ref="en_US"/> +</Locale> diff --git a/i18npool/source/localedata/data/localedata_euro.map b/i18npool/source/localedata/data/localedata_euro.map index b9dd20c724d7..db16f9f7f35c 100644 --- a/i18npool/source/localedata/data/localedata_euro.map +++ b/i18npool/source/localedata/data/localedata_euro.map @@ -31,6 +31,7 @@ getAllCalendars_fr_MC; getAllCalendars_fur_IT; getAllCalendars_fy_NL; getAllCalendars_ga_IE; +getAllCalendars_gd_GB; getAllCalendars_gsc_FR; getAllCalendars_hr_HR; getAllCalendars_hsb_DE; @@ -102,6 +103,7 @@ getAllCurrencies_fr_MC; getAllCurrencies_fur_IT; getAllCurrencies_fy_NL; getAllCurrencies_ga_IE; +getAllCurrencies_gd_GB; getAllCurrencies_gsc_FR; getAllCurrencies_hr_HR; getAllCurrencies_hsb_DE; @@ -173,6 +175,7 @@ getAllFormats0_fr_MC; getAllFormats0_fur_IT; getAllFormats0_fy_NL; getAllFormats0_ga_IE; +getAllFormats0_gd_GB; getAllFormats0_gsc_FR; getAllFormats0_hr_HR; getAllFormats0_hsb_DE; @@ -244,6 +247,7 @@ getBreakIteratorRules_fr_MC; getBreakIteratorRules_fur_IT; getBreakIteratorRules_fy_NL; getBreakIteratorRules_ga_IE; +getBreakIteratorRules_gd_GB; getBreakIteratorRules_gsc_FR; getBreakIteratorRules_hr_HR; getBreakIteratorRules_hsb_DE; @@ -315,6 +319,7 @@ getCollationOptions_fr_MC; getCollationOptions_fur_IT; getCollationOptions_fy_NL; getCollationOptions_ga_IE; +getCollationOptions_gd_GB; getCollationOptions_gsc_FR; getCollationOptions_hr_HR; getCollationOptions_hsb_DE; @@ -386,6 +391,7 @@ getCollatorImplementation_fr_MC; getCollatorImplementation_fur_IT; getCollatorImplementation_fy_NL; getCollatorImplementation_ga_IE; +getCollatorImplementation_gd_GB; getCollatorImplementation_gsc_FR; getCollatorImplementation_hr_HR; getCollatorImplementation_hsb_DE; @@ -457,6 +463,7 @@ getContinuousNumberingLevels_fr_MC; getContinuousNumberingLevels_fur_IT; getContinuousNumberingLevels_fy_NL; getContinuousNumberingLevels_ga_IE; +getContinuousNumberingLevels_gd_GB; getContinuousNumberingLevels_gsc_FR; getContinuousNumberingLevels_hr_HR; getContinuousNumberingLevels_hsb_DE; @@ -528,6 +535,7 @@ getFollowPageWords_fr_MC; getFollowPageWords_fur_IT; getFollowPageWords_fy_NL; getFollowPageWords_ga_IE; +getFollowPageWords_gd_GB; getFollowPageWords_gsc_FR; getFollowPageWords_hr_HR; getFollowPageWords_hsb_DE; @@ -599,6 +607,7 @@ getForbiddenCharacters_fr_MC; getForbiddenCharacters_fur_IT; getForbiddenCharacters_fy_NL; getForbiddenCharacters_ga_IE; +getForbiddenCharacters_gd_GB; getForbiddenCharacters_gsc_FR; getForbiddenCharacters_hr_HR; getForbiddenCharacters_hsb_DE; @@ -670,6 +679,7 @@ getIndexAlgorithm_fr_MC; getIndexAlgorithm_fur_IT; getIndexAlgorithm_fy_NL; getIndexAlgorithm_ga_IE; +getIndexAlgorithm_gd_GB; getIndexAlgorithm_gsc_FR; getIndexAlgorithm_hr_HR; getIndexAlgorithm_hsb_DE; @@ -741,6 +751,7 @@ getLCInfo_fr_MC; getLCInfo_fur_IT; getLCInfo_fy_NL; getLCInfo_ga_IE; +getLCInfo_gd_GB; getLCInfo_gsc_FR; getLCInfo_hr_HR; getLCInfo_hsb_DE; @@ -812,6 +823,7 @@ getLocaleItem_fr_MC; getLocaleItem_fur_IT; getLocaleItem_fy_NL; getLocaleItem_ga_IE; +getLocaleItem_gd_GB; getLocaleItem_gsc_FR; getLocaleItem_hr_HR; getLocaleItem_hsb_DE; @@ -883,6 +895,7 @@ getOutlineNumberingLevels_fr_MC; getOutlineNumberingLevels_fur_IT; getOutlineNumberingLevels_fy_NL; getOutlineNumberingLevels_ga_IE; +getOutlineNumberingLevels_gd_GB; getOutlineNumberingLevels_gsc_FR; getOutlineNumberingLevels_hr_HR; getOutlineNumberingLevels_hsb_DE; @@ -954,6 +967,7 @@ getReservedWords_fr_MC; getReservedWords_fur_IT; getReservedWords_fy_NL; getReservedWords_ga_IE; +getReservedWords_gd_GB; getReservedWords_gsc_FR; getReservedWords_hr_HR; getReservedWords_hsb_DE; @@ -1025,6 +1039,7 @@ getSearchOptions_fr_MC; getSearchOptions_fur_IT; getSearchOptions_fy_NL; getSearchOptions_ga_IE; +getSearchOptions_gd_GB; getSearchOptions_gsc_FR; getSearchOptions_hr_HR; getSearchOptions_hsb_DE; @@ -1096,6 +1111,7 @@ getTransliterations_fr_MC; getTransliterations_fur_IT; getTransliterations_fy_NL; getTransliterations_ga_IE; +getTransliterations_gd_GB; getTransliterations_gsc_FR; getTransliterations_hr_HR; getTransliterations_hsb_DE; @@ -1167,6 +1183,7 @@ getUnicodeScripts_fr_MC; getUnicodeScripts_fur_IT; getUnicodeScripts_fy_NL; getUnicodeScripts_ga_IE; +getUnicodeScripts_gd_GB; getUnicodeScripts_gsc_FR; getUnicodeScripts_hr_HR; getUnicodeScripts_hsb_DE; diff --git a/i18npool/source/localedata/data/makefile.mk b/i18npool/source/localedata/data/makefile.mk index 38595ee538e8..c67e9082d7ce 100644 --- a/i18npool/source/localedata/data/makefile.mk +++ b/i18npool/source/localedata/data/makefile.mk @@ -36,7 +36,7 @@ LIBTARGET=NO debug!= .ENDIF -.IF "$(OS)" == "WNT" +.IF "$(OS_FOR_BUILD)" == "WNT" my_file = file:/// .ELSE my_file = file:// @@ -167,6 +167,7 @@ SHL3OBJS= \ $(SLO)$/localedata_fur_IT.obj \ $(SLO)$/localedata_fy_NL.obj \ $(SLO)$/localedata_ga_IE.obj \ + $(SLO)$/localedata_gd_GB.obj \ $(SLO)$/localedata_gsc_FR.obj \ $(SLO)$/localedata_hr_HR.obj \ $(SLO)$/localedata_hsb_DE.obj \ @@ -326,12 +327,20 @@ MY_MISC_CXXFILES := $(foreach,i,$(DEPOBJFILES) $(MISC)/$(i:b).cxx) .INCLUDE : target.mk -$(MY_MISC_CXXFILES) : $(OUT_FOR_BUILD)$/bin$/saxparser$(EXECPOST) $(MISC)/saxparser.rdb +$(MY_MISC_CXXFILES) : $(OUT_FOR_BUILD)$/bin$/saxparser$(EXECPOST_FOR_BUILD) $(MISC)/saxparser.rdb + +.IF "$(CROSS_COMPILING)" == "YES" +# Always cross-compiling from some Unix, +# so the BUILD platform's lib directory is correct +sharedlibdir=$(SOLARLIBDIR_FOR_BUILD) +.ELSE +sharedlibdir=$(SOLARSHAREDBIN) +.ENDIF $(MISC)$/localedata_%.cxx : %.xml $(AUGMENT_LIBRARY_PATH) $(WRAPCMD) $(OUT_FOR_BUILD)$/bin$/saxparser $* $< $@ \ $(my_file)$(PWD)/$(MISC_FOR_BUILD)/saxparser.rdb $(SOLARBINDIR)$/types.rdb \ - -env:OOO_INBUILD_SHAREDLIB_DIR=$(my_file)$(SOLARSHAREDBIN) + -env:OOO_INBUILD_SHAREDLIB_DIR=$(my_file)$(sharedlibdir) $(RM) $(BIN)$/$(@:b).rdb $(MISC)/saxparser.rdb .ERRREMOVE : $(SOLARENV)/bin/packcomponents.xslt \ diff --git a/i18npool/source/localedata/localedata.cxx b/i18npool/source/localedata/localedata.cxx index d011865a7e35..b6245fca6268 100644 --- a/i18npool/source/localedata/localedata.cxx +++ b/i18npool/source/localedata/localedata.cxx @@ -149,6 +149,7 @@ static const struct { { "eu", lcl_DATA_EURO }, { "fo_FO", lcl_DATA_EURO }, { "ga_IE", lcl_DATA_EURO }, + { "gd_GB", lcl_DATA_EURO }, { "ka_GE", lcl_DATA_EURO }, { "be_BY", lcl_DATA_EURO }, { "kl_GL", lcl_DATA_EURO }, diff --git a/i18npool/source/localedata/makefile.mk b/i18npool/source/localedata/makefile.mk index 9a671e8bcd6b..798b401d21f7 100644 --- a/i18npool/source/localedata/makefile.mk +++ b/i18npool/source/localedata/makefile.mk @@ -58,6 +58,8 @@ CDEFS+=-D__STD_LIMITS SLOFILES= $(SLO)$/localedata.obj +.IF "$(CROSS_COMPILING)" != "YES" + OBJFILES = \ $(OBJ)$/saxparser.obj \ $(OBJ)$/LocaleNode.obj \ @@ -78,6 +80,8 @@ DEPOBJFILES = \ $(OBJ)$/LocaleNode.obj \ $(OBJ)$/filewriter.obj +.ENDIF + # --- Targets ------------------------------------------------------ .INCLUDE : target.mk diff --git a/i18npool/source/paper/makefile.mk b/i18npool/source/paper/makefile.mk index fa05cc21f3f9..f0b9bc8b02f1 100644 --- a/i18npool/source/paper/makefile.mk +++ b/i18npool/source/paper/makefile.mk @@ -44,7 +44,11 @@ SLOFILES=$(SLO)$/paper.obj SHL1OBJS=$(SLOFILES) SHL1TARGET=$(TARGET)$(DLLPOSTFIX) +.IF "$(COM)" == "MSC" SHL1IMPLIB=i$(TARGET) +.ELSE +SHL1IMPLIB=$(TARGET)$(DLLPOSTFIX) +.ENDIF DEF1DEPN=$(MISC)$/$(SHL1TARGET).flt SHL1DEF=$(MISC)$/$(SHL1TARGET).def diff --git a/i18npool/source/paper/paper.cxx b/i18npool/source/paper/paper.cxx index 913cc7d834ed..fe376184edba 100644 --- a/i18npool/source/paper/paper.cxx +++ b/i18npool/source/paper/paper.cxx @@ -247,7 +247,7 @@ PaperInfo PaperInfo::getSystemDefaultPaper() // try user-defined locale setting xConfigNA->getByName( CREATE_OUSTRING( "ooSetupSystemLocale" ) ) >>= aLocaleStr; } - catch( Exception& ) + catch(const Exception&) { } @@ -377,7 +377,9 @@ PaperInfo PaperInfo::getSystemDefaultPaper() xConfigNA->getByName( CREATE_OUSTRING( "Locale" ) ) >>= aLocaleStr; } } - catch( Exception& ) {} + catch(const Exception&) + { + } if (aLocaleStr.getLength() == 0) aLocaleStr = CREATE_OUSTRING("en-US"); diff --git a/i18npool/source/registerservices/registerservices.cxx b/i18npool/source/registerservices/registerservices.cxx index fd08933af2fa..5df7bb931b7c 100644 --- a/i18npool/source/registerservices/registerservices.cxx +++ b/i18npool/source/registerservices/registerservices.cxx @@ -576,11 +576,6 @@ static const struct InstancesArray { extern "C" { -SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnvironment( const sal_Char** ppEnvTypeName, uno_Environment** /*ppEnv*/ ) -{ - *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; -} - SAL_DLLPUBLIC_EXPORT void* SAL_CALL component_getFactory( const sal_Char* sImplementationName, void* _pServiceManager, void* /*_pRegistryKey*/ ) { void* pRet = NULL; diff --git a/i18npool/source/search/textsearch.cxx b/i18npool/source/search/textsearch.cxx index 756d6c863ff9..f407a614ed1f 100644 --- a/i18npool/source/search/textsearch.cxx +++ b/i18npool/source/search/textsearch.cxx @@ -982,12 +982,6 @@ SAL_CALL TextSearch_CreateInstance( extern "C" { -SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnvironment( - const sal_Char** ppEnvTypeName, uno_Environment** /*ppEnv*/ ) -{ - *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; -} - SAL_DLLPUBLIC_EXPORT void* SAL_CALL component_getFactory( const sal_Char* sImplementationName, void* _pServiceManager, void* /*_pRegistryKey*/ ) { diff --git a/i18npool/source/textconversion/data/makefile.mk b/i18npool/source/textconversion/data/makefile.mk index 967b4f982ea2..6f54d2033f0b 100644 --- a/i18npool/source/textconversion/data/makefile.mk +++ b/i18npool/source/textconversion/data/makefile.mk @@ -34,7 +34,7 @@ LIBTARGET=NO .INCLUDE : settings.mk # Fix heap limit problem on MSC -.IF "$(OS)" == "WNT" +.IF "$(COM)" == "MSC" .IF "$(COMEX)" != "8" CDEFS+=-Zm300 .ENDIF diff --git a/i18npool/source/textconversion/makefile.mk b/i18npool/source/textconversion/makefile.mk index 2b91d964b2ad..dca748309ca7 100644 --- a/i18npool/source/textconversion/makefile.mk +++ b/i18npool/source/textconversion/makefile.mk @@ -44,6 +44,8 @@ SLOFILES= \ $(SLO)$/textconversion_ko.obj \ $(SLO)$/textconversion_zh.obj +.IF "$(CROSS_COMPILING)" != "YES" + OBJFILES = $(OBJ)$/genconv_dict.obj APP1TARGET = genconv_dict @@ -53,6 +55,8 @@ APP1OBJS = $(OBJ)$/genconv_dict.obj APP1STDLIBS = $(SALLIB) +.ENDIF + # --- Targets ------------------------------------------------------ .INCLUDE : target.mk diff --git a/i18nutil/inc/i18nutil/oneToOneMapping.hxx b/i18nutil/inc/i18nutil/oneToOneMapping.hxx index ff88b3e5410d..9ad5cb1256a2 100644 --- a/i18nutil/inc/i18nutil/oneToOneMapping.hxx +++ b/i18nutil/inc/i18nutil/oneToOneMapping.hxx @@ -57,10 +57,6 @@ public: oneToOneMapping( OneToOneMappingTable_t *rpTable, const size_t rnSize, const size_t rnUnitSize = sizeof(OneToOneMappingTable_t) ); virtual ~oneToOneMapping(); - // make index for fast search - // bluedawrf: not used -// void makeIndex(); - // binary search virtual sal_Unicode find( const sal_Unicode nKey ) const; diff --git a/i18nutil/inc/i18nutil/x_rtl_ustring.h b/i18nutil/inc/i18nutil/x_rtl_ustring.h index 3b94c697d7f9..330c6bce3d6b 100644 --- a/i18nutil/inc/i18nutil/x_rtl_ustring.h +++ b/i18nutil/inc/i18nutil/x_rtl_ustring.h @@ -49,14 +49,6 @@ inline void SAL_CALL x_rtl_uString_new_WithLength( rtl_uString ** newStr, sal_In *newStr = (rtl_uString*) rtl_allocateMemory ( sizeof(rtl_uString) + sizeof(sal_Unicode) * nLen); (*newStr)->refCount = _refCount; (*newStr)->length = nLen; - - // rtl_uString is defined in rtl/ustring.h as below: - //typedef struct _rtl_uString - //{ - // sal_Int32 refCount; - // sal_Int32 length; - // sal_Unicode buffer[1]; - //} rtl_uString; } inline rtl_uString * SAL_CALL x_rtl_uString_new_WithLength( sal_Int32 nLen, sal_Int32 _refCount = 0 ) @@ -76,6 +68,6 @@ inline void SAL_CALL x_rtl_uString_release( rtl_uString * value ) } -#endif // #ifndef _I18N_X_RTL_USTRING_H_ +#endif /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/i18nutil/prj/build.lst b/i18nutil/prj/build.lst index 311b6d572943..55c86ad3038f 100644 --- a/i18nutil/prj/build.lst +++ b/i18nutil/prj/build.lst @@ -1,3 +1,3 @@ -inu i18nutil : sal cppu offuh NULL +inu i18nutil : sal cppu offapi NULL inu i18nutil usr1 - all inu_mkout NULL inu i18nutil\source\utility nmake - all inu_utility NULL diff --git a/i18nutil/prj/d.lst b/i18nutil/prj/d.lst index fd6c2683cb35..72625de7e392 100644 --- a/i18nutil/prj/d.lst +++ b/i18nutil/prj/d.lst @@ -10,4 +10,5 @@ mkdir: %_DEST%\inc\i18nutil ..\%__SRC%\bin\i18nutil*.dll %_DEST%\bin\i18nutil*.dll ..\%__SRC%\lib\libi18nutil*.so %_DEST%\lib\libi18nutil*.so ..\%__SRC%\lib\libi18nutil*.dylib %_DEST%\lib\libi18nutil*.dylib +..\%__SRC%\lib\libi18nutil*.a %_DEST%\lib\libi18nutil*.a ..\%__SRC%\lib\ii18nutil.lib %_DEST%\lib\ii18nutil.lib diff --git a/i18nutil/source/utility/makefile.mk b/i18nutil/source/utility/makefile.mk index adfddd91db2d..cece2847e9b1 100644 --- a/i18nutil/source/utility/makefile.mk +++ b/i18nutil/source/utility/makefile.mk @@ -47,7 +47,11 @@ SLOFILES= \ # Unicode utilities SHL1TARGET= $(TARGET)$(COMID) +.IF "$(COM)" == "MSC" SHL1IMPLIB= i$(TARGET) +.ELSE +SHL1IMPLIB= $(TARGET)$(COMID) +.ENDIF DEF1DEPN= $(MISC)$/$(SHL1TARGET).flt SHL1DEF= $(MISC)$/$(SHL1TARGET).def diff --git a/l10ntools/inc/cfgmerge.hxx b/l10ntools/inc/cfgmerge.hxx index 9308d0c727a8..c8f3d99a7b14 100644 --- a/l10ntools/inc/cfgmerge.hxx +++ b/l10ntools/inc/cfgmerge.hxx @@ -33,8 +33,7 @@ #include <boost/unordered_map.hpp> #include <vector> -typedef boost::unordered_map<ByteString , ByteString , hashByteString,equalByteString> - ByteStringHashMap; +typedef boost::unordered_map<rtl::OString, rtl::OString, rtl::OStringHash> ByteStringHashMap; // diff --git a/l10ntools/inc/export.hxx b/l10ntools/inc/export.hxx index 0d707abe9898..c33960fa8468 100644 --- a/l10ntools/inc/export.hxx +++ b/l10ntools/inc/export.hxx @@ -84,8 +84,7 @@ class PFormEntrys; class MergeData; typedef std::set<ByteString , lessByteString > ByteStringSet; -typedef boost::unordered_map<ByteString , ByteString , hashByteString,equalByteString> - ByteStringHashMap; +typedef boost::unordered_map<rtl::OString, rtl::OString, rtl::OStringHash> ByteStringHashMap; typedef boost::unordered_map<ByteString , bool , hashByteString,equalByteString> ByteStringBoolHashMap; @@ -197,8 +196,8 @@ public: void addFallbackData( ByteString& sId , const ByteString& sText ); bool getFallbackData( ByteString& sId , ByteString& sText); - void addMergedLanguage( ByteString& sLang ); - bool isMerged( ByteString& sLang ); + void addMergedLanguage(rtl::OString& rLang); + bool isMerged(rtl::OString& rLang); ResData( const ByteString &rPF, const ByteString &rGId ) : nWidth( 0 ), @@ -307,7 +306,7 @@ private: sal_Bool bNextMustBeDefineEOL; // define but no \ at lineend sal_uLong nLevel; // res. recursiv? how deep? sal_uInt16 nList; // cur. res. is String- or FilterList - ByteString nListLang; + rtl::OString m_sListLang; sal_uLong nListIndex; sal_uLong nListLevel; bool bSkipFile; @@ -345,23 +344,17 @@ public: static void QuotHTML( ByteString &rString ); static bool CopyFile( const ByteString& source , const ByteString& dest ); - static void QuotHTMLXRM( ByteString &rString ); static void UnquotHTML( ByteString &rString ); static const char* GetEnv( const char *pVar ); - static int getCurrentDirectory( rtl::OUString& base_fqurl , rtl::OUString& base ); static bool isSourceLanguage( const ByteString &sLanguage ); static bool isAllowed( const ByteString &sLanguage ); - static bool LanguageAllowed( const ByteString &nLanguage ); static void Languages( std::vector<ByteString>::const_iterator& begin , std::vector<ByteString>::const_iterator& end ); static void getRandomName( const ByteString& sPrefix , ByteString& sRandStr , const ByteString& sPostfix ); - static void getRandomName( ByteString& sRandStr ); static void getCurrentDir( std::string& dir ); - static void replaceEncoding( ByteString& rString ); - static ByteString GetFallbackLanguage( const ByteString nLanguage ); static void FillInFallbacks( ResData *pResData ); static void FillInListFallbacks( ExportList *pList, const ByteString &nSource, const ByteString &nFallback ); @@ -377,8 +370,6 @@ private: static std::vector<ByteString> aLanguages; static std::vector<ByteString> aForcedLanguages; - sal_Bool ListExists( ResData *pResData, sal_uInt16 nLst ); - sal_Bool WriteData( ResData *pResData, sal_Bool bCreateNew = sal_False );// called befor dest. cur ResData sal_Bool WriteExportList( ResData *pResData, ExportList *pExportList, const ByteString &rTyp, sal_Bool bCreateNew = sal_False ); @@ -393,13 +384,12 @@ private: ByteString GetPairedListString ( const ByteString& sText ); ByteString StripList ( const ByteString& sText ); - void UnmergeUTF8( ByteString& sOrig ); void InsertListEntry( const ByteString &rText, const ByteString &rLine ); void CleanValue( ByteString &rValue ); ByteString GetText( const ByteString &rSource, int nToken ); - sal_Bool PrepareTextToMerge( ByteString &rText, sal_uInt16 nTyp, - ByteString &nLangIndex, ResData *pResData ); + sal_Bool PrepareTextToMerge(ByteString &rText, sal_uInt16 nTyp, + rtl::OString &rLangIndex, ResData *pResData); void MergeRest( ResData *pResData, sal_uInt16 nMode = MERGE_MODE_NORMAL ); void ConvertMergeContent( ByteString &rText ); @@ -490,7 +480,6 @@ public: MergeData( const ByteString &rTyp, const ByteString &rGID, const ByteString &rLID , const ByteString &rFilename ) : sTyp( rTyp ), sGID( rGID ), sLID( rLID ) , sFilename( rFilename ) {}; ~MergeData(); - PFormEntrys* InsertEntry( const ByteString &rPForm ); PFormEntrys* GetPFormEntrys( ResData *pResData ); void Insert( const ByteString& rPFO , PFormEntrys* pfEntrys ); @@ -525,8 +514,6 @@ class MergeDataFile const ByteString &sFilename, bool bCaseSensitive ); ByteString Dump(); - void WriteError( const ByteString &rLine ); - public: MergeDataFile( const ByteString &rFileName, const ByteString& rFile , sal_Bool bErrLog, CharSet aCharSet, bool bCaseSensitive = false ); ~MergeDataFile(); diff --git a/l10ntools/inc/helpmerge.hxx b/l10ntools/inc/helpmerge.hxx index e2ec54daa637..25536244e357 100644 --- a/l10ntools/inc/helpmerge.hxx +++ b/l10ntools/inc/helpmerge.hxx @@ -48,13 +48,13 @@ private: /// @PRECOND 0 < langIdx_in < MAX_IDX static void FillInFallbacks( LangHashMap& rElem_out, ByteString sLangIdx_in ); -/// Debugmethod, prints the content of the map to stdout - static void Dump( LangHashMap* rElem_in , const ByteString sKey_in ); - -/// Debugmethod, prints the content of the map to stdout - static void Dump( XMLHashMap* rElem_in ) ; - +#if OSL_DEBUG_LEVEL > 2 + /// Debugmethod, prints the content of the map to stdout + static void Dump(LangHashMap* rElem_in , const ByteString sKey_in); + /// Debugmethod, prints the content of the map to stdout + static void Dump(XMLHashMap* rElem_in); +#endif public: HelpParser( const ByteString &rHelpFile, bool bUTF8 , bool bHasInputList ); @@ -79,7 +79,6 @@ private: ByteString GetOutpath( const ByteString& rPathX , const ByteString& sCur , const ByteString& rPathY ); bool MergeSingleFile( XMLFile* file , MergeDataFile& aMergeDataFile , const ByteString& sLanguage , ByteString sPath ); - void Process( LangHashMap* aLangHM , const ByteString& sCur , ResData *pResData , MergeDataFile& aMergeDataFile ); void ProcessHelp( LangHashMap* aLangHM , const ByteString& sCur , ResData *pResData , MergeDataFile& aMergeDataFile ); void MakeDir( const ByteString& sPath ); }; diff --git a/l10ntools/inc/l10ntools/directory.hxx b/l10ntools/inc/l10ntools/directory.hxx index 30ceb3f664fc..34e4a3a0cc65 100644 --- a/l10ntools/inc/l10ntools/directory.hxx +++ b/l10ntools/inc/l10ntools/directory.hxx @@ -47,7 +47,6 @@ class Directory Directory( const rtl::OUString sFullPath ); Directory( const rtl::OUString sFullPath , const rtl::OUString sEntry ) ; - Directory( const ByteString sFullPath ); static bool lessDir ( const Directory& rKey1, const Directory& rKey2 ) ; }; diff --git a/l10ntools/inc/l10ntools/file.hxx b/l10ntools/inc/l10ntools/file.hxx index 9b90c2766500..fae252e5f926 100644 --- a/l10ntools/inc/l10ntools/file.hxx +++ b/l10ntools/inc/l10ntools/file.hxx @@ -14,7 +14,6 @@ class File rtl::OUString getFileName(){ return sFileName; } rtl::OUString getFullName(){ return sFullName; } - File( const rtl::OUString sFile ); File( const rtl::OUString sFullName , const rtl::OUString sFile ); static bool lessFile ( const File& rKey1, const File& rKey2 ); diff --git a/l10ntools/source/cfglex.l b/l10ntools/source/cfglex.l index a6f6b366a8d5..feb2882632d8 100644 --- a/l10ntools/source/cfglex.l +++ b/l10ntools/source/cfglex.l @@ -137,7 +137,7 @@ int yywrap(void) } /*****************************************************************************/ -void YYWarning( char *s ) +void YYWarning( const char *s ) /*****************************************************************************/ { /* write warning to stderr */ @@ -147,9 +147,9 @@ void YYWarning( char *s ) /*****************************************************************************/ #ifdef GCC -void yyerror ( char *s, ... ) +void yyerror ( const char *s, ... ) #else -void yyerror ( char *s ) +void yyerror ( const char *s ) #endif /*****************************************************************************/ { diff --git a/l10ntools/source/cfgmerge.cxx b/l10ntools/source/cfgmerge.cxx index c4f24edeb487..55aed2c4210c 100644 --- a/l10ntools/source/cfgmerge.cxx +++ b/l10ntools/source/cfgmerge.cxx @@ -394,13 +394,6 @@ void CfgParser::AddText( pStackData->sText[ rIsoLang ] = rText; } - -/*****************************************************************************/ -void CfgParser::WorkOnRessourceEnd() -/*****************************************************************************/ -{ -} - /*****************************************************************************/ int CfgParser::ExecuteAnalyzedToken( int nToken, char *pToken ) /*****************************************************************************/ @@ -651,13 +644,13 @@ void CfgExport::WorkOnRessourceEnd() /*****************************************************************************/ { if ( pOutputStream && bLocalize ) { - if (( pStackData->sText[ ByteString("en-US") ].Len() + if (( pStackData->sText[rtl::OString(RTL_CONSTASCII_STRINGPARAM("en-US"))].getLength() ) || ( bForce && - ( pStackData->sText[ ByteString("de") ].Len() || - pStackData->sText[ ByteString("en-US") ].Len() ))) + ( pStackData->sText[rtl::OString(RTL_CONSTASCII_STRINGPARAM("de"))].getLength() || + pStackData->sText[rtl::OString(RTL_CONSTASCII_STRINGPARAM("en-US"))].getLength() ))) { - ByteString sFallback = pStackData->sText[ ByteString("en-US") ]; + ByteString sFallback = pStackData->sText[rtl::OString(RTL_CONSTASCII_STRINGPARAM("en-US"))]; ByteString sLocalId = pStackData->sIdentifier; ByteString sGroupId; if ( aStack.size() == 1 ) { @@ -670,29 +663,29 @@ void CfgExport::WorkOnRessourceEnd() ByteString sTimeStamp( Export::GetTimeStamp()); - ByteString sCur; - for( unsigned int n = 0; n < aLanguages.size(); n++ ){ - sCur = aLanguages[ n ]; + for (size_t n = 0; n < aLanguages.size(); n++) + { + ByteString sCur = aLanguages[ n ]; - ByteString sText = pStackData->sText[ sCur ]; - if ( !sText.Len()) - sText = sFallback; + ByteString sText = pStackData->sText[ sCur ]; + if ( !sText.Len()) + sText = sFallback; - Export::UnquotHTML( sText ); + Export::UnquotHTML( sText ); - ByteString sOutput( sPrj ); sOutput += "\t"; - sOutput += sPath; - sOutput += "\t0\t"; - sOutput += pStackData->sResTyp; sOutput += "\t"; - sOutput += sGroupId; sOutput += "\t"; - sOutput += sLocalId; sOutput += "\t\t\t0\t"; - sOutput += sCur; - sOutput += "\t"; + ByteString sOutput( sPrj ); sOutput += "\t"; + sOutput += sPath; + sOutput += "\t0\t"; + sOutput += pStackData->sResTyp; sOutput += "\t"; + sOutput += sGroupId; sOutput += "\t"; + sOutput += sLocalId; sOutput += "\t\t\t0\t"; + sOutput += sCur; + sOutput += "\t"; - sOutput += sText; sOutput += "\t\t\t\t"; - sOutput += sTimeStamp; + sOutput += sText; sOutput += "\t\t\t\t"; + sOutput += sTimeStamp; - pOutputStream->WriteLine( sOutput ); + pOutputStream->WriteLine( sOutput ); } } } diff --git a/l10ntools/source/directory.cxx b/l10ntools/source/directory.cxx index 97be7c2332fb..a7cba91f526b 100644 --- a/l10ntools/source/directory.cxx +++ b/l10ntools/source/directory.cxx @@ -54,12 +54,6 @@ Directory::Directory( const rtl::OUString sFullPath , const rtl::OUString sEntry sDirectoryName = sEntry; } - -Directory::Directory( const ByteString sFullPath ) : bSkipLinks( false ) -{ - sDirectoryName = rtl::OUString( sFullPath.GetBuffer() , RTL_TEXTENCODING_UTF8 , sFullPath.Len() ); -} - bool Directory::lessDir ( const Directory& rKey1, const Directory& rKey2 ) { rtl::OUString sName1( ( static_cast< Directory >( rKey1 ) ).getDirectoryName() ); diff --git a/l10ntools/source/export.cxx b/l10ntools/source/export.cxx index 69f1e967b13c..94f1650ef4b0 100644 --- a/l10ntools/source/export.cxx +++ b/l10ntools/source/export.cxx @@ -35,9 +35,10 @@ #include "tokens.h" #include <iostream> #include <vector> +#include <rtl/strbuf.hxx> -extern "C" { int yyerror( char * ); } -extern "C" { int YYWarning( char * ); } +extern "C" { int yyerror( const char * ); } +extern "C" { int YYWarning( const char * ); } Export *pExport = 0L; @@ -363,11 +364,14 @@ bool ResData::getFallbackData( ByteString& sId_in , ByteString& sText_inout ){ return sText_inout.Len() > 0; } -void ResData::addMergedLanguage( ByteString& sLang ){ - aMergedLanguages[ sLang ]=ByteString("1"); +void ResData::addMergedLanguage(rtl::OString& rLang) +{ + aMergedLanguages[rLang] = rtl::OString(RTL_CONSTASCII_STRINGPARAM("1")); } -bool ResData::isMerged( ByteString& sLang ){ - return aMergedLanguages[ sLang ].Equals("1"); + +bool ResData::isMerged(rtl::OString& rLang) +{ + return aMergedLanguages[rLang].equalsL(RTL_CONSTASCII_STRINGPARAM("1")); } /*****************************************************************************/ @@ -379,10 +383,10 @@ sal_Bool ResData::SetId( const ByteString &rId, sal_uInt16 nLevel ) nIdLevel = nLevel; sId = rId; - if ( bChild && bChildWithText ) { - ByteString sError( "ResId after child definition" ); - yyerror( sError.GetBufferAccess()); - sError.ReleaseBufferAccess(); + if ( bChild && bChildWithText ) + { + rtl::OString sError(RTL_CONSTASCII_STRINGPARAM("ResId after child definition")); + yyerror(sError.getStr()); SetError(); } @@ -500,7 +504,7 @@ void Export::Init() bNextMustBeDefineEOL = sal_False; nLevel = 0; nList = LIST_NON; - nListLang = ByteString( String::CreateFromAscii(""),RTL_TEXTENCODING_ASCII_US ); + m_sListLang = ByteString( String::CreateFromAscii(""),RTL_TEXTENCODING_ASCII_US ); nListIndex = 0; for ( size_t i = 0, n = aResStack.size(); i < n; ++i ) delete aResStack[ i ]; @@ -789,21 +793,21 @@ int Export::Execute( int nToken, const char * pToken ) else if ( sKey == "STRINGLIST" ) { pResData->bList = sal_True; nList = LIST_STRING; - nListLang = SOURCE_LANGUAGE; + m_sListLang = SOURCE_LANGUAGE; nListIndex = 0; nListLevel = 0; } else if ( sKey == "FILTERLIST" ) { pResData->bList = sal_True; nList = LIST_FILTER; - nListLang = SOURCE_LANGUAGE; + m_sListLang = SOURCE_LANGUAGE; nListIndex = 0; nListLevel = 0; } else if ( sKey == "UIENTRIES" ) { pResData->bList = sal_True; nList = LIST_UIENTRIES; - nListLang = SOURCE_LANGUAGE; + m_sListLang = SOURCE_LANGUAGE; nListIndex = 0; nListLevel = 0; } @@ -830,14 +834,14 @@ int Export::Execute( int nToken, const char * pToken ) if ( sKey.ToUpperAscii() == "STRINGLIST" ) { pResData->bList = sal_True; nList = LIST_STRING; - nListLang = SOURCE_LANGUAGE; + m_sListLang = SOURCE_LANGUAGE; nListIndex = 0; nListLevel = 0; } else if ( sKey == "FILTERLIST" ) { pResData->bList = sal_True; nList = LIST_FILTER; - nListLang = SOURCE_LANGUAGE; + m_sListLang = SOURCE_LANGUAGE; nListIndex = 0; nListLevel = 0; } @@ -845,7 +849,7 @@ int Export::Execute( int nToken, const char * pToken ) else if ( sKey == "PAIREDLIST" ) { pResData->bList = sal_True; nList = LIST_PAIRED; - nListLang = SOURCE_LANGUAGE; + m_sListLang = SOURCE_LANGUAGE; nListIndex = 0; nListLevel = 0; } @@ -853,14 +857,14 @@ int Export::Execute( int nToken, const char * pToken ) else if ( sKey == "ITEMLIST" ) { pResData->bList = sal_True; nList = LIST_ITEM; - nListLang = SOURCE_LANGUAGE; + m_sListLang = SOURCE_LANGUAGE; nListIndex = 0; nListLevel = 0; } else if ( sKey == "UIENTRIES" ) { pResData->bList = sal_True; nList = LIST_UIENTRIES; - nListLang = SOURCE_LANGUAGE; + m_sListLang = SOURCE_LANGUAGE; nListIndex = 0; nListLevel = 0; } @@ -883,7 +887,7 @@ int Export::Execute( int nToken, const char * pToken ) if ( nList ) { ByteString sLang=sToken.GetToken( 1, '[' ).GetToken( 0, ']' ); CleanValue( sLang ); - nListLang = sLang; + m_sListLang = sLang; nListIndex = 0; nListLevel = 0; } @@ -902,8 +906,9 @@ int Export::Execute( int nToken, const char * pToken ) if ( sEntry == "\\\"" ) sEntry = "\""; InsertListEntry( sEntry, sOrig ); - if ( bMergeMode && ( sEntry != "\"" )) { - PrepareTextToMerge( sOrig, nList, nListLang, pResData ); + if ( bMergeMode && ( sEntry != "\"" )) + { + PrepareTextToMerge( sOrig, nList, m_sListLang, pResData ); } } } @@ -926,7 +931,7 @@ int Export::Execute( int nToken, const char * pToken ) sLang = sToken.GetToken( 0, '=' ).GetToken( 1, '[' ).GetToken( 0, ']' ); CleanValue( sLang ); } - ByteString nLangIndex = sLang; + rtl::OString sLangIndex = sLang; ByteString sOrigKey = sKey; if ( sText.Len() && sLang.Len() ) { if (( sKey.ToUpperAscii() == "TEXT" ) || @@ -936,69 +941,82 @@ int Export::Execute( int nToken, const char * pToken ) ( sKey == "UINAME" )) { SetChildWithText(); - if ( Export::isSourceLanguage( nLangIndex ) ) + if ( Export::isSourceLanguage( sLangIndex ) ) pResData->SetId( sText, ID_LEVEL_TEXT ); pResData->bText = sal_True; pResData->sTextTyp = sOrigKey; if ( bMergeMode ) { - PrepareTextToMerge( sOrig, STRING_TYP_TEXT, nLangIndex, pResData ); + PrepareTextToMerge( sOrig, STRING_TYP_TEXT, sLangIndex, pResData ); } - else { - if ( pResData->sText[ nLangIndex ].Len()) { - ByteString sError( "Language " ); - sError += nLangIndex; - sError += " defined twice"; + else + { + if (pResData->sText[ sLangIndex ].getLength()) + { + rtl::OStringBuffer sError(RTL_CONSTASCII_STRINGPARAM("Language ")); + sError.append(sLangIndex); + sError.append(RTL_CONSTASCII_STRINGPARAM("defined twice")); + yyerror(sError.getStr()); } - pResData->sText[ nLangIndex ] = sText; + pResData->sText[ sLangIndex ] = sText; } } else if ( sKey == "HELPTEXT" ) { SetChildWithText(); pResData->bHelpText = sal_True; - if ( bBreakWhenHelpText ) { - ByteString sError( "\"HelpText\" found in source\n" ); - YYWarning( sError.GetBufferAccess()); - sError.ReleaseBufferAccess(); + if ( bBreakWhenHelpText ) + { + rtl::OString sError( + RTL_CONSTASCII_STRINGPARAM("\"HelpText\" found in source\n")); + YYWarning(sError.getStr()); SetError(); } if ( bMergeMode ) - PrepareTextToMerge( sOrig, STRING_TYP_HELPTEXT, nLangIndex, pResData ); - else { - if ( pResData->sHelpText[ nLangIndex ].Len()) { - ByteString sError( "Language " ); - sError += nLangIndex; - sError += " defined twice"; + PrepareTextToMerge( sOrig, STRING_TYP_HELPTEXT, sLangIndex, pResData ); + else + { + if (pResData->sHelpText[ sLangIndex ].getLength()) + { + rtl::OStringBuffer sError(RTL_CONSTASCII_STRINGPARAM("Language ")); + sError.append(sLangIndex); + sError.append(" defined twice"); + YYWarning(sError.getStr()); } - pResData->sHelpText[ nLangIndex ] = sText; + pResData->sHelpText[ sLangIndex ] = sText; } } else if ( sKey == "QUICKHELPTEXT" ) { SetChildWithText(); pResData->bQuickHelpText = sal_True; if ( bMergeMode ) - PrepareTextToMerge( sOrig, STRING_TYP_QUICKHELPTEXT, nLangIndex, pResData ); - else { - if ( pResData->sQuickHelpText[ nLangIndex ].Len()) { - ByteString sError( "Language " ); - sError += nLangIndex; - sError += " defined twice"; + PrepareTextToMerge( sOrig, STRING_TYP_QUICKHELPTEXT, sLangIndex, pResData ); + else + { + if (pResData->sQuickHelpText[ sLangIndex ].getLength()) + { + rtl::OStringBuffer sError(RTL_CONSTASCII_STRINGPARAM("Language ")); + sError.append(sLangIndex); + sError.append(RTL_CONSTASCII_STRINGPARAM(" defined twice")); + YYWarning(sError.getStr()); } - pResData->sQuickHelpText[ nLangIndex ] = sText; + pResData->sQuickHelpText[ sLangIndex ] = sText; } } else if ( sKey == "TITLE" ) { SetChildWithText(); pResData->bTitle = sal_True; if ( bMergeMode ) - PrepareTextToMerge( sOrig, STRING_TYP_TITLE, nLangIndex, pResData ); - else { - if ( pResData->sTitle[ nLangIndex ].Len()) { - ByteString sError( "Language " ); - sError += nLangIndex; - sError += " defined twice"; + PrepareTextToMerge( sOrig, STRING_TYP_TITLE, sLangIndex, pResData ); + else + { + if ( pResData->sTitle[ sLangIndex ].getLength()) + { + rtl::OStringBuffer sError(RTL_CONSTASCII_STRINGPARAM("Language ")); + sError.append(sLangIndex); + sError.append(RTL_CONSTASCII_STRINGPARAM(" defined twice")); + YYWarning(sError.getStr()); } - pResData->sTitle[ nLangIndex ] = sText; + pResData->sTitle[ sLangIndex ] = sText; } } else if ( sKey == "ACCESSPATH" ) { @@ -1155,31 +1173,6 @@ void Export::CutComment( ByteString &rText ) } } -void Export::UnmergeUTF8( ByteString& sOrig ){ - sal_uInt16 nPos1 = sOrig.Search('\"'); - sal_uInt16 nPos2 = sOrig.SearchBackward('\"'); - if( nPos1 > 0 && nPos2 > 0 && nPos1 < nPos2){ - ByteString sPart = sOrig.Copy(nPos1+1 , nPos2-1); - ByteString sPartUTF8 = sPart; - sPartUTF8.Convert( RTL_TEXTENCODING_MS_1252 , RTL_TEXTENCODING_UTF8 ); - sOrig.SearchAndReplace( sPart , sPartUTF8 ); - } -} - -/*****************************************************************************/ -sal_Bool Export::ListExists( ResData *pResData, sal_uInt16 nLst ) -/*****************************************************************************/ -{ - switch ( nLst ) { - case LIST_STRING: return pResData->pStringList != NULL; - case LIST_FILTER: return pResData->pFilterList != NULL; - case LIST_ITEM: return pResData->pItemList != NULL; - case LIST_PAIRED: return pResData->pPairedList != NULL; - case LIST_UIENTRIES: return pResData->pUIEntries != NULL; - } - return sal_False; -} - /*****************************************************************************/ sal_Bool Export::WriteData( ResData *pResData, sal_Bool bCreateNew ) /*****************************************************************************/ @@ -1194,13 +1187,13 @@ sal_Bool Export::WriteData( ResData *pResData, sal_Bool bCreateNew ) // mandatory to export: en-US - if (( pResData->sText[ SOURCE_LANGUAGE ].Len()) + if (( pResData->sText[ SOURCE_LANGUAGE ].getLength()) || - ( pResData->sHelpText[ SOURCE_LANGUAGE ].Len()) + ( pResData->sHelpText[ SOURCE_LANGUAGE ].getLength()) || - ( pResData->sQuickHelpText[ SOURCE_LANGUAGE ].Len()) + ( pResData->sQuickHelpText[ SOURCE_LANGUAGE ].getLength()) || - ( pResData->sTitle[ SOURCE_LANGUAGE ].Len())) + ( pResData->sTitle[ SOURCE_LANGUAGE ].getLength())) { FillInFallbacks( pResData ); @@ -1223,35 +1216,35 @@ sal_Bool Export::WriteData( ResData *pResData, sal_Bool bCreateNew ) for( unsigned int n = 0; n < aLanguages.size(); n++ ){ sCur = aLanguages[ n ]; if ( !sCur.EqualsIgnoreCaseAscii("x-comment") ){ - if ( pResData->sText[ sCur ].Len()) + if (pResData->sText[ sCur ].getLength()) sXText = pResData->sText[ sCur ]; else { sXText = pResData->sText[ SOURCE_LANGUAGE ]; } - if ( pResData->sHelpText[ sCur ].Len()) + if (pResData->sHelpText[ sCur ].getLength()) sXHText = pResData->sHelpText[ sCur ]; else { sXHText = pResData->sHelpText[ SOURCE_LANGUAGE ]; } - if ( pResData->sQuickHelpText[ sCur ].Len()) + if (pResData->sQuickHelpText[ sCur ].getLength()) sXQHText = pResData->sQuickHelpText[ sCur ]; else { sXQHText = pResData->sQuickHelpText[ SOURCE_LANGUAGE ]; } - if ( pResData->sTitle[ sCur ].Len()) + if (pResData->sTitle[ sCur ].getLength()) sXTitle = pResData->sTitle[ sCur ]; - else { + else sXTitle = pResData->sTitle[ SOURCE_LANGUAGE ]; - } if ( !sXText.Len()) sXText = "-"; - if ( !sXHText.Len()) { - if ( pResData->sHelpText[ SOURCE_LANGUAGE ].Len()) + if ( !sXHText.Len()) + { + if (pResData->sHelpText[ SOURCE_LANGUAGE ].getLength()) sXHText = pResData->sHelpText[ SOURCE_LANGUAGE ]; } } @@ -1268,7 +1261,7 @@ sal_Bool Export::WriteData( ResData *pResData, sal_Bool bCreateNew ) sOutput += sLID; sOutput += "\t"; sOutput += pResData->sHelpId; sOutput += "\t"; sOutput += pResData->sPForm; sOutput += "\t"; - sOutput += ByteString::CreateFromInt64( pResData->nWidth ); sOutput += "\t"; + sOutput += ByteString(rtl::OString::valueOf(static_cast<sal_Int64>(pResData->nWidth))); sOutput += "\t"; sOutput += sCur; sOutput += "\t"; @@ -1369,45 +1362,48 @@ sal_Bool Export::WriteExportList( ResData *pResData, ExportList *pExportList, // ByteString a("Export::WriteExportList::pEntry"); // Export::DumpMap( a, *pEntry ); - ByteString sLID( ByteString::CreateFromInt64( i + 1 )); - for( unsigned int n = 0; n < aLanguages.size(); n++ ){ + ByteString sLID(rtl::OString::valueOf(static_cast<sal_Int64>(i + 1))); + for (unsigned int n = 0; n < aLanguages.size(); ++n) + { sCur = aLanguages[ n ]; - if ( (*pEntry)[ SOURCE_LANGUAGE ].Len() ) + if ((*pEntry)[ SOURCE_LANGUAGE ].getLength()) + { + if ( bEnableExport ) { - if ( bEnableExport ) + ByteString sText((*pEntry)[ SOURCE_LANGUAGE ] ); + + // Strip PairList Line String + if( rTyp.EqualsIgnoreCaseAscii("pairedlist") ) { - ByteString sText((*pEntry)[ SOURCE_LANGUAGE ] ); - - // Strip PairList Line String - if( rTyp.EqualsIgnoreCaseAscii("pairedlist") ){ - sLID = GetPairedListID( sText ); - if ((*pEntry)[ sCur ].Len()) - sText = (*pEntry)[ sCur ]; - sText = GetPairedListString( sText ); - } - else{ - sText = StripList( (*pEntry)[ sCur ] ); - if( sText == "\\\"" ) - sText = "\""; - } + sLID = GetPairedListID( sText ); + if ((*pEntry)[ sCur ].getLength()) + sText = (*pEntry)[ sCur ]; + sText = GetPairedListString( sText ); + } + else + { + sText = StripList( (*pEntry)[ sCur ] ); + if( sText == "\\\"" ) + sText = "\""; + } - ByteString sOutput( sProject ); sOutput += "\t"; - if ( sRoot.Len()) - sOutput += sActFileName; - sOutput += "\t0\t"; - sOutput += rTyp; sOutput += "\t"; - sOutput += sGID; sOutput += "\t"; - sOutput += sLID; sOutput += "\t\t"; - sOutput += pResData->sPForm; sOutput += "\t0\t"; - sOutput += sCur; sOutput += "\t"; + ByteString sOutput( sProject ); sOutput += "\t"; + if ( sRoot.Len()) + sOutput += sActFileName; + sOutput += "\t0\t"; + sOutput += rTyp; sOutput += "\t"; + sOutput += sGID; sOutput += "\t"; + sOutput += sLID; sOutput += "\t\t"; + sOutput += pResData->sPForm; sOutput += "\t0\t"; + sOutput += sCur; sOutput += "\t"; - sOutput += sText; sOutput += "\t\t\t\t"; - sOutput += sTimeStamp; + sOutput += sText; sOutput += "\t\t\t\t"; + sOutput += sTimeStamp; - aOutput.WriteLine( sOutput ); + aOutput.WriteLine( sOutput ); - } } + } } if ( bCreateNew ) delete [] pEntry; @@ -1433,11 +1429,11 @@ ByteString Export::FullId() } } } - if ( sFull.Len() > 255 ) { - ByteString sError( "GroupId > 255 chars" ); - printf("GroupID = %s\n",sFull.GetBuffer()); - yyerror( sError.GetBufferAccess()); - sError.ReleaseBufferAccess(); + if ( sFull.Len() > 255 ) + { + rtl::OString sError(RTL_CONSTASCII_STRINGPARAM("GroupId > 255 chars")); + printf("GroupID = %s\n", sFull.GetBuffer()); + yyerror(sError.getStr()); } return sFull; @@ -1493,21 +1489,22 @@ void Export::InsertListEntry( const ByteString &rText, const ByteString &rLine ) else return; - if ( nListIndex + 1 > pList->size()) { + if ( nListIndex + 1 > pList->size()) + { ExportListEntry *pNew = new ExportListEntry(); - (*pNew)[ LIST_REFID ] = ByteString::CreateFromInt32( REFID_NONE ); - pList->push_back( pNew ); + (*pNew)[LIST_REFID] = rtl::OString::valueOf(static_cast<sal_Int32>(REFID_NONE)); + pList->push_back(pNew); } ExportListEntry *pCurEntry = (*pList)[ nListIndex ]; // For paired list use the line to set proper lid if( nList == LIST_PAIRED ){ - (*pCurEntry)[ nListLang ] = rLine; + (*pCurEntry)[ m_sListLang ] = rLine; }else - (*pCurEntry)[ nListLang ] = rText; + (*pCurEntry)[ m_sListLang ] = rText; // Remember en-US fallback string, so each list has the same amount of elements - if ( Export::isSourceLanguage( nListLang ) ) { + if ( Export::isSourceLanguage( m_sListLang ) ) { if( nList == LIST_PAIRED ){ const ByteString sPlist("pairedlist"); ByteString sKey = MergeDataFile::CreateKey( sPlist , pResData->sId , GetPairedListID( rLine ) , sFilename ); @@ -1520,14 +1517,14 @@ void Export::InsertListEntry( const ByteString &rText, const ByteString &rLine ) a.Append( "." ); a.Append( pResData->sId ); sal_Int64 x = nListIndex+1; - ByteString b( ByteString::CreateFromInt64( x ) ); + ByteString b(rtl::OString::valueOf(x)); ByteString sKey = MergeDataFile::CreateKey( sPlist , a , b , sFilename ); pResData->addFallbackData( sKey , rText ); } // new fallback } - if ( Export::isSourceLanguage( nListLang ) ) { + if ( Export::isSourceLanguage( m_sListLang ) ) { if( nList == LIST_PAIRED ){ (*pCurEntry)[ SOURCE_LANGUAGE ] = rLine; } @@ -1537,7 +1534,7 @@ void Export::InsertListEntry( const ByteString &rText, const ByteString &rLine ) pList->NewSourceLanguageListEntry(); } - //printf("Export::InsertListEntry ResData.id = %s ResData.ListData = %s\n",pResData->sId.GetBuffer() ,(*pCurEntry)[ nListLang ].GetBuffer()); + //printf("Export::InsertListEntry ResData.id = %s ResData.ListData = %s\n",pResData->sId.GetBuffer() ,(*pCurEntry)[ m_sListLang ].GetBuffer()); nListIndex++; } @@ -1752,10 +1749,8 @@ void Export::ConvertMergeContent( ByteString &rText ) rText += "\""; } -/*****************************************************************************/ -sal_Bool Export::PrepareTextToMerge( ByteString &rText, sal_uInt16 nTyp, - ByteString &nLangIndex, ResData *pResData ) -/*****************************************************************************/ +sal_Bool Export::PrepareTextToMerge(ByteString &rText, sal_uInt16 nTyp, + rtl::OString &rLangIndex, ResData *pResData) { // position to merge in: sal_uInt16 nStart = 0; @@ -1805,13 +1800,14 @@ sal_Bool Export::PrepareTextToMerge( ByteString &rText, sal_uInt16 nTyp, break; } - if ( pList ) { + if (pList) + { ExportListEntry *pCurEntry = (*pList)[ nListIndex - 1 ]; - if ( pCurEntry ) { + if ( pCurEntry ) + { rText = (*pCurEntry)[ SOURCE_LANGUAGE ]; - if( nTyp == LIST_PAIRED ){ - pResData->addMergedLanguage( nLangIndex ); - } + if( nTyp == LIST_PAIRED ) + pResData->addMergedLanguage(rLangIndex); } } @@ -1843,7 +1839,7 @@ sal_Bool Export::PrepareTextToMerge( ByteString &rText, sal_uInt16 nTyp, if ( pResData->sResTyp.EqualsIgnoreCaseAscii( "pairedlist" ) ){ pResData->sId = GetPairedListID( sLastListLine ); } - else pResData->sId = ByteString::CreateFromInt32( nListIndex ); + else pResData->sId = rtl::OString::valueOf(static_cast<sal_Int32>(nListIndex)); if ( pResData->sGId.Len()) pResData->sGId += "."; @@ -1918,15 +1914,15 @@ sal_Bool Export::PrepareTextToMerge( ByteString &rText, sal_uInt16 nTyp, } ByteString sContent; - pEntrys->GetTransex3Text( sContent, nTyp, nLangIndex ); - if ( !sContent.Len() && ( ! Export::isSourceLanguage( nLangIndex ) )) { + pEntrys->GetTransex3Text(sContent, nTyp, rLangIndex); + if (!sContent.Len() && (!Export::isSourceLanguage(rLangIndex))) + { rText = sOrigText; return sal_False; // no data found } - if ( Export::isSourceLanguage( nLangIndex ) ) { + if (Export::isSourceLanguage(rLangIndex)) return sal_False; - } ByteString sPostFix( rText.Copy( ++nEnd )); rText.Erase( nStart ); @@ -2128,8 +2124,9 @@ void Export::MergeRest( ResData *pResData, sal_uInt16 nMode ) case LIST_ITEM : pResData->sResTyp = "itemlist"; pList = pResData->pItemList; bPairedList = false; break; case LIST_PAIRED : pResData->sResTyp = "pairedlist"; pList = pResData->pPairedList; bPairedList = true; break; } - ByteString sCur; - for( unsigned int n = 0; n < aLanguages.size(); n++ ){ + rtl::OString sCur; + for( unsigned int n = 0; n < aLanguages.size(); n++ ) + { sCur = aLanguages[ n ]; sal_uInt16 nIdx = 1; @@ -2155,46 +2152,65 @@ void Export::MergeRest( ResData *pResData, sal_uInt16 nMode ) bText = pEntrys->GetTransex3Text( sText , STRING_TYP_TEXT, SOURCE_LANGUAGE , sal_False ); // Use fallback, if data is missing in sdf file - if( !bText && bPairedList ){ - if( pResData->isMerged( sCur ) ) break; + if( !bText && bPairedList ) + { + if( pResData->isMerged( sCur ) ) + break; const ByteString sPlist("pairedlist"); ByteString sKey = MergeDataFile::CreateKey( sPlist , pResData->sGId , pResData->sId , sFilename ); bText = pResData->getFallbackData( sKey , sText ); - }else if ( !bText ){// new fallback + } + else if ( !bText ) // new fallback + { if( pResData->isMerged( sCur ) ) break; const ByteString sPlist("list"); ByteString sKey = MergeDataFile::CreateKey( sPlist , pResData->sGId , pResData->sId , sFilename ); bText = pResData->getFallbackData( sKey , sText ); } // new fallback - if ( bText && sText.Len()) { - if ( nIdx == 1 ) { - ByteString sHead; + if ( bText && sText.Len()) + { + if ( nIdx == 1 ) + { + rtl::OStringBuffer sHead; if ( bNextMustBeDefineEOL ) - sHead = "\\\n\t"; - sHead += sSpace; - switch ( nT ) { - case LIST_STRING : sHead += "StringList "; break; - case LIST_FILTER : sHead += "FilterList "; break; - case LIST_ITEM : sHead += "ItemList "; break; - case LIST_PAIRED : sHead += "PairedList "; break; - case LIST_UIENTRIES : sHead += "UIEntries "; break; + sHead.append(RTL_CONSTASCII_STRINGPARAM("\\\n\t")); + sHead.append(sSpace); + switch ( nT ) + { + case LIST_STRING: + sHead.append(RTL_CONSTASCII_STRINGPARAM("StringList ")); + break; + case LIST_FILTER: + sHead.append(RTL_CONSTASCII_STRINGPARAM("FilterList ")); + break; + case LIST_ITEM: + sHead.append(RTL_CONSTASCII_STRINGPARAM("ItemList ")); + break; + case LIST_PAIRED: + sHead.append(RTL_CONSTASCII_STRINGPARAM("PairedList ")); + break; + case LIST_UIENTRIES: + sHead.append(RTL_CONSTASCII_STRINGPARAM("UIEntries ")); + break; } - sHead += "[ "; - sHead += sCur; - sHead += " ] "; + sHead.append(RTL_CONSTASCII_STRINGPARAM("[ ")); + sHead.append(sCur); + sHead.append(RTL_CONSTASCII_STRINGPARAM(" ] ")); //} - if ( bDefine || bNextMustBeDefineEOL ) { - sHead += "= \\\n"; - sHead += sSpace; - sHead += "\t{\\\n\t"; + if ( bDefine || bNextMustBeDefineEOL ) + { + sHead.append(RTL_CONSTASCII_STRINGPARAM("= \\\n")); + sHead.append(sSpace); + sHead.append(RTL_CONSTASCII_STRINGPARAM("\t{\\\n\t")); } - else { - sHead += "= \n"; - sHead += sSpace; - sHead += "\t{\n\t"; + else + { + sHead.append(RTL_CONSTASCII_STRINGPARAM("= \n")); + sHead.append(sSpace); + sHead.append(RTL_CONSTASCII_STRINGPARAM("\t{\n\t")); } - WriteToMerged( sHead , true); + WriteToMerged(sHead.makeStringAndClear() , true); } ByteString sLine; if ( pList && (*pList)[ nLIndex ] ) @@ -2254,7 +2270,7 @@ void Export::MergeRest( ResData *pResData, sal_uInt16 nMode ) } } else - pResData->sId = ByteString::CreateFromInt32( ++nIdx ); + pResData->sId = rtl::OString::valueOf(static_cast<sal_Int32>(++nIdx)); } else break; @@ -2316,7 +2332,7 @@ void Export::MergeRest( ResData *pResData, sal_uInt16 nMode ) } } - while( PrepareTextToMerge( sLine, nList, nListLang, pResData ) && ( nListIndex <= nMaxIndex )) { + while( PrepareTextToMerge( sLine, nList, m_sListLang, pResData ) && ( nListIndex <= nMaxIndex )) { ByteString sText( "\t" ); sText += sLine; sText += " ;"; diff --git a/l10ntools/source/export2.cxx b/l10ntools/source/export2.cxx index 0b7fb44d8a95..d7d39a453511 100644 --- a/l10ntools/source/export2.cxx +++ b/l10ntools/source/export2.cxx @@ -140,75 +140,6 @@ std::vector<ByteString> Export::GetForcedLanguages(){ std::vector<ByteString> Export::aLanguages = std::vector<ByteString>(); std::vector<ByteString> Export::aForcedLanguages = std::vector<ByteString>(); - -/*****************************************************************************/ -void Export::QuotHTMLXRM( ByteString &rString ) -/*****************************************************************************/ -{ - ByteString sReturn; - for ( sal_uInt16 i = 0; i < rString.Len(); i++ ) { - ByteString sTemp = rString.Copy( i ); - if ( sTemp.Search( "<Arg n=" ) == 0 ) { - while ( i < rString.Len() && rString.GetChar( i ) != '>' ) { - sReturn += rString.GetChar( i ); - i++; - } - if ( rString.GetChar( i ) == '>' ) { - sReturn += ">"; - i++; - } - } - - if ( i < rString.Len()) { - switch ( rString.GetChar( i )) { - case '<': - if( i+2 < rString.Len() && - (rString.GetChar( i+1 ) == 'b' || rString.GetChar( i+1 ) == 'B') && - rString.GetChar( i+2 ) == '>' ) - { - sReturn +="<b>"; - i += 2; - } - else if( i+3 < rString.Len() && - rString.GetChar( i+1 ) == '/' && - (rString.GetChar( i+2 ) == 'b' || rString.GetChar( i+2 ) == 'B') && - rString.GetChar( i+3 ) == '>' ) - { - sReturn +="</b>"; - i += 3; - } - else - sReturn += "<"; - break; - - case '>': - sReturn += ">"; - break; - - case '\"': - sReturn += """; - break; - - case '\'': - sReturn += "'"; - break; - - case '&': - if ((( i + 4 ) < rString.Len()) && - ( rString.Copy( i, 5 ) == "&" )) - sReturn += rString.GetChar( i ); - else - sReturn += "&"; - break; - - default: - sReturn += rString.GetChar( i ); - break; - } - } - } - rString = sReturn; -} /*****************************************************************************/ void Export::QuotHTML( ByteString &rString ) /*****************************************************************************/ @@ -402,12 +333,6 @@ bool Export::isSourceLanguage( const ByteString &sLanguage ) bool Export::isAllowed( const ByteString &sLanguage ){ return ! ( sLanguage.EqualsIgnoreCaseAscii("en-US") ); } -/*****************************************************************************/ -bool Export::LanguageAllowed( const ByteString &nLanguage ) -/*****************************************************************************/ -{ - return std::find( aLanguages.begin() , aLanguages.end() , nLanguage ) != aLanguages.end(); -} bool Export::isInitialized = false; @@ -452,52 +377,31 @@ ByteString Export::GetFallbackLanguage( const ByteString nLanguage ) return sFallback; } -void Export::replaceEncoding( ByteString& rString ) -{ -// ™ -> \u2122 - - for( xub_StrLen idx = 0; idx <= rString.Len()-8 ; idx++ ) - { - if( rString.GetChar( idx ) == '&' && - rString.GetChar( idx+1 ) == '#' && - rString.GetChar( idx+2 ) == 'x' && - rString.GetChar( idx+7 ) == ';' ) - { - ByteString sTmp = rString.Copy( 0 , idx ); - sTmp.Append( "\\u" ); - sTmp.Append( rString.GetChar( idx+3 ) ); - sTmp.Append( rString.GetChar( idx+4 ) ); - sTmp.Append( rString.GetChar( idx+5 ) ); - sTmp.Append( rString.GetChar( idx+6 ) ); - sTmp.Append( rString.Copy( idx+8 , rString.Len() ) ); - rString = sTmp; - } - } -} - /*****************************************************************************/ void Export::FillInFallbacks( ResData *pResData ) /*****************************************************************************/ { - ByteString sCur; - for( unsigned int n = 0; n < aLanguages.size(); n++ ){ - sCur = aLanguages[ n ]; - if( isAllowed( sCur ) ){ + for (size_t n = 0; n < aLanguages.size(); ++n) + { + ByteString sCur = aLanguages[ n ]; + if (isAllowed(sCur)) + { ByteString nFallbackIndex = GetFallbackLanguage( sCur ); - if( nFallbackIndex.Len() ){ - if ( !pResData->sText[ sCur ].Len()) + if( nFallbackIndex.Len() ) + { + if (pResData->sText[ sCur ].isEmpty()) pResData->sText[ sCur ] = pResData->sText[ nFallbackIndex ]; - if ( !pResData->sHelpText[ sCur ].Len()) + if (pResData->sHelpText[ sCur ].isEmpty()) pResData->sHelpText[ sCur ] = pResData->sHelpText[ nFallbackIndex ]; - if ( !pResData->sQuickHelpText[ sCur ].Len()) + if (pResData->sQuickHelpText[ sCur ].isEmpty()) pResData->sQuickHelpText[ sCur ] = pResData->sQuickHelpText[ nFallbackIndex ]; - if ( !pResData->sTitle[ sCur ].Len()) + if (!pResData->sTitle[ sCur ].isEmpty()) pResData->sTitle[ sCur ] = pResData->sTitle[ nFallbackIndex ]; @@ -530,11 +434,12 @@ void Export::FillInListFallbacks( ExportList *pList, const ByteString &nSource, const ByteString &nFallback ) /*****************************************************************************/ { - - for ( size_t i = 0; i < pList->size(); i++ ) { + for (size_t i = 0; i < pList->size(); ++i) + { ExportListEntry *pEntry = (*pList)[ i ]; - if ( !( *pEntry )[ nSource ].Len()){ - ( *pEntry )[ nSource ] = ( *pEntry )[ nFallback ]; + if ( (*pEntry )[nSource].isEmpty() ) + { + ( *pEntry )[ nSource ] = ( *pEntry )[ nFallback ]; ByteString x = ( *pEntry )[ nSource ]; ByteString y = ( *pEntry )[ nFallback ]; } @@ -611,15 +516,6 @@ const char* Export::GetEnv( const char *pVar ) return pRet; } - -int Export::getCurrentDirectory( rtl::OUString& base_fqurl_out, rtl::OUString& base_out ) -{ - DirEntry aDir("."); - aDir.ToAbs(); - base_out = rtl::OUString( aDir.GetFull() ); - return osl::File::getFileURLFromSystemPath( base_out , base_fqurl_out ); -} - void Export::getCurrentDir( string& dir ) { char buffer[64000]; @@ -667,12 +563,6 @@ void Export::getRandomName( const ByteString& sPrefix , ByteString& sRandStr , c sRandStr.Append( sPostfix ); } -void Export::getRandomName( ByteString& sRandStr ) -{ - const ByteString sEmpty; - getRandomName( sEmpty , sRandStr , sEmpty ); -} - /*****************************************************************************/ DirEntry Export::GetTempFile() /*****************************************************************************/ diff --git a/l10ntools/source/file.cxx b/l10ntools/source/file.cxx index d57c20d92c04..f87c24f59598 100644 --- a/l10ntools/source/file.cxx +++ b/l10ntools/source/file.cxx @@ -34,11 +34,6 @@ namespace transex { -File::File( const rtl::OUString sFile ) -{ - sFileName = sFile; -} - File::File( const rtl::OUString sFullPath , const rtl::OUString sFile ) { sFileName = sFile; diff --git a/l10ntools/source/gsicheck.cxx b/l10ntools/source/gsicheck.cxx index 89fb66775d54..2fd8b8b540b1 100644 --- a/l10ntools/source/gsicheck.cxx +++ b/l10ntools/source/gsicheck.cxx @@ -32,7 +32,8 @@ #include <tools/fsys.hxx> #include <tools/stream.hxx> -// local includes +#include <rtl/strbuf.hxx> + #include "tagtest.hxx" #include "gsicheck.hxx" @@ -165,7 +166,10 @@ GSILine::GSILine( const ByteString &rLine, sal_uLong nLine ) // limit GID and LID to MAX_GID_LID_LEN chars each for database conformity, see #137575# if ( rLine.GetToken( 4, '\t' ).Len() > MAX_GID_LID_LEN || rLine.GetToken( 5, '\t' ).Len() > MAX_GID_LID_LEN ) { - PrintError( ByteString("GID and LID may only be ").Append( ByteString::CreateFromInt32(MAX_GID_LID_LEN) ).Append( " chars long each!" ), "Line format", aLangId, sal_True, GetLineNumber(), GetUniqId() ); + PrintError(rtl::OStringBuffer(RTL_CONSTASCII_STRINGPARAM("GID and LID may only be ")) + .append(static_cast<sal_Int32>(MAX_GID_LID_LEN)) + .append(RTL_CONSTASCII_STRINGPARAM(" chars long each!" )).getStr(), + "Line format", aLangId, sal_True, GetLineNumber(), GetUniqId()); NotOK(); } } @@ -521,7 +525,9 @@ sal_Bool GSIBlock::TestUTF8( GSILine* pTestee, sal_Bool bFixTags ) if ( !IsUTF8( pTestee->GetText(), bFixTags, nErrorPos, aErrorMsg, bHasBeenFixed, aFixed ) ) { ByteString aContext( pTestee->GetText().Copy( nErrorPos, 20 ) ); - PrintError( aErrorMsg.Append(" in Text at Position " ).Append( ByteString::CreateFromInt32( nErrorPos ) ), "Text format", aContext, pTestee->GetLineNumber(), pTestee->GetUniqId() ); + PrintError(rtl::OStringBuffer(aErrorMsg).append(RTL_CONSTASCII_STRINGPARAM(" in Text at Position ")) + .append(static_cast<sal_Int32>(nErrorPos)).getStr(), + "Text format", aContext, pTestee->GetLineNumber(), pTestee->GetUniqId()); bError = sal_True; if ( bHasBeenFixed ) { @@ -532,7 +538,9 @@ sal_Bool GSIBlock::TestUTF8( GSILine* pTestee, sal_Bool bFixTags ) if ( !IsUTF8( pTestee->GetQuickHelpText(), bFixTags, nErrorPos, aErrorMsg, bHasBeenFixed, aFixed ) ) { ByteString aContext( pTestee->GetQuickHelpText().Copy( nErrorPos, 20 ) ); - PrintError( aErrorMsg.Append(" in QuickHelpText at Position " ).Append( ByteString::CreateFromInt32( nErrorPos ) ), "Text format", aContext, pTestee->GetLineNumber(), pTestee->GetUniqId() ); + PrintError(rtl::OStringBuffer(aErrorMsg).append(RTL_CONSTASCII_STRINGPARAM(" in QuickHelpText at Position ")) + .append(static_cast<sal_Int32>(nErrorPos)).getStr(), + "Text format", aContext, pTestee->GetLineNumber(), pTestee->GetUniqId()); bError = sal_True; if ( bHasBeenFixed ) { @@ -543,7 +551,9 @@ sal_Bool GSIBlock::TestUTF8( GSILine* pTestee, sal_Bool bFixTags ) if ( !IsUTF8( pTestee->GetTitle(), bFixTags, nErrorPos, aErrorMsg, bHasBeenFixed, aFixed ) ) { ByteString aContext( pTestee->GetTitle().Copy( nErrorPos, 20 ) ); - PrintError( aErrorMsg.Append(" in Title at Position " ).Append( ByteString::CreateFromInt32( nErrorPos ) ), "Text format", aContext, pTestee->GetLineNumber(), pTestee->GetUniqId() ); + PrintError(rtl::OStringBuffer(aErrorMsg).append(RTL_CONSTASCII_STRINGPARAM(" in Title at Position ")) + .append(static_cast<sal_Int32>(nErrorPos)).getStr(), + "Text format", aContext, pTestee->GetLineNumber(), pTestee->GetUniqId()); bError = sal_True; if ( bHasBeenFixed ) { @@ -568,7 +578,9 @@ sal_Bool GSIBlock::HasSuspiciousChars( GSILine* pTestee, GSILine* pSource ) String aUTF8Tester = String( pTestee->GetText(), 0, nPos, RTL_TEXTENCODING_UTF8 ); sal_uInt16 nErrorPos = aUTF8Tester.Len(); ByteString aContext( pTestee->GetText().Copy( nPos, 20 ) ); - PrintError( ByteString("Found double questionmark in translation only. Looks like an encoding problem at Position " ).Append( ByteString::CreateFromInt32( nErrorPos ) ), "Text format", aContext, pTestee->GetLineNumber(), pTestee->GetUniqId() ); + PrintError(rtl::OStringBuffer(RTL_CONSTASCII_STRINGPARAM("Found double questionmark in translation only. Looks like an encoding problem at Position ")) + .append(static_cast<sal_Int32>(nErrorPos)).getStr(), + "Text format", aContext, pTestee->GetLineNumber(), pTestee->GetUniqId()); pTestee->NotOK(); return sal_True; } @@ -747,7 +759,8 @@ void Help() fprintf( stdout, "gsicheck checks the syntax of tags in GSI-Files and SDF-Files\n" ); fprintf( stdout, " checks for inconsistencies and malicious UTF8 encoding\n" ); fprintf( stdout, " checks tags in Online Help\n" ); - fprintf( stdout, " checks for *new* KeyIDs and relax GID/LID length to %s\n", ByteString::CreateFromInt32(MAX_GID_LID_LEN).GetBuffer() ); + fprintf( stdout, " checks for *new* KeyIDs and relax GID/LID length to %s\n", + rtl::OString::valueOf(static_cast<sal_Int32>(MAX_GID_LID_LEN)).getStr() ); fprintf( stdout, "\n" ); fprintf( stdout, "Syntax: gsicheck [ -c ] [-f] [ -we ] [ -wef ErrorFilename ] [ -wc ]\n" ); fprintf( stdout, " [ -wcf CorrectFilename ] [ -s | -t ] [ -l LanguageID ]\n" ); diff --git a/l10ntools/source/help/HelpCompiler.cxx b/l10ntools/source/help/HelpCompiler.cxx index df2093931126..a3f2cd193a19 100644 --- a/l10ntools/source/help/HelpCompiler.cxx +++ b/l10ntools/source/help/HelpCompiler.cxx @@ -351,7 +351,7 @@ void myparser::traverse( xmlNodePtr parentNode ) embedded = std::string((const char*)embeddedxml); xmlFree (embeddedxml); std::transform (embedded.begin(), embedded.end(), - embedded.begin(), tolower); + embedded.begin(), tocharlower); } bool isEmbedded = !embedded.empty() && embedded.compare("true") == 0; @@ -437,7 +437,7 @@ bool HelpCompiler::compile( void ) throw( HelpProcessingException ) if (modulename[0] == 'S') { modulename = modulename.substr(1); - std::transform(modulename.begin(), modulename.end(), modulename.begin(), tolower); + std::transform(modulename.begin(), modulename.end(), modulename.begin(), tocharlower); } if (modulename != "DEFAULT" && modulename != module) continue; diff --git a/l10ntools/source/help/HelpCompiler.hxx b/l10ntools/source/help/HelpCompiler.hxx index 016f7eefb8bc..6642d571c67b 100644 --- a/l10ntools/source/help/HelpCompiler.hxx +++ b/l10ntools/source/help/HelpCompiler.hxx @@ -108,7 +108,7 @@ namespace fs { ::rtl::OUString ustrSystemPath; osl::File::getSystemPathFromFileURL(data, ustrSystemPath); - return ustrSystemPath.getStr(); + return (wchar_t const *) ustrSystemPath.getStr(); } #endif std::string native_directory_string() const { return native_file_string(); } @@ -322,6 +322,11 @@ private: bool bExtensionMode; }; +inline char tocharlower(char c) +{ + return static_cast<char>(tolower(c)); +} + #endif /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/l10ntools/source/help/HelpLinker.cxx b/l10ntools/source/help/HelpLinker.cxx index 81a96ce37899..b1d7c1c2e849 100644 --- a/l10ntools/source/help/HelpLinker.cxx +++ b/l10ntools/source/help/HelpLinker.cxx @@ -351,7 +351,7 @@ void HelpLinker::addBookmark( DB* dbBase, FILE* pFile_DBHelp, std::string thishi size_t i = 0; dataB[i++] = static_cast<unsigned char>(fileLen); for (size_t j = 0; j < fileB.length(); ++j) - dataB[i++] = fileB[j]; + dataB[i++] = static_cast<unsigned char>(fileB[j]); if (!anchorB.empty()) { dataB[i++] = '#'; @@ -386,7 +386,7 @@ void HelpLinker::initIndexerPreProcessor() if( m_pIndexerPreProcessor ) delete m_pIndexerPreProcessor; std::string mod = module; - std::transform (mod.begin(), mod.end(), mod.begin(), tolower); + std::transform (mod.begin(), mod.end(), mod.begin(), tocharlower); m_pIndexerPreProcessor = new IndexerPreProcessor( mod, indexDirParentName, idxCaptionStylesheet, idxContentStylesheet ); } @@ -413,7 +413,7 @@ void HelpLinker::link() throw( HelpProcessingException ) #endif std::string mod = module; - std::transform (mod.begin(), mod.end(), mod.begin(), tolower); + std::transform (mod.begin(), mod.end(), mod.begin(), tocharlower); // do the work here // continue with introduction of the overall process thing into the @@ -666,7 +666,7 @@ void HelpLinker::link() throw( HelpProcessingException ) if (document) { std::string temp = module; - std::transform (temp.begin(), temp.end(), temp.begin(), tolower); + std::transform (temp.begin(), temp.end(), temp.begin(), tocharlower); m_pIndexerPreProcessor->processDocument(document, URLEncoder::encode(documentPath) ); } } diff --git a/l10ntools/source/helpmerge.cxx b/l10ntools/source/helpmerge.cxx index 9203fd94b5e7..ccb45e47105f 100644 --- a/l10ntools/source/helpmerge.cxx +++ b/l10ntools/source/helpmerge.cxx @@ -88,26 +88,29 @@ void HelpParser::FillInFallbacks( LangHashMap& rElem_out, ByteString sLangIdx_in } } -/*****************************************************************************/ -void HelpParser::Dump(XMLHashMap* rElem_in) { -/*****************************************************************************/ - for(XMLHashMap::iterator pos = rElem_in->begin();pos != rElem_in->end(); ++pos){ +#if OSL_DEBUG_LEVEL > 2 +void HelpParser::Dump(XMLHashMap* rElem_in) +{ + for(XMLHashMap::iterator pos = rElem_in->begin();pos != rElem_in->end(); ++pos) + { Dump(pos->second,pos->first); } } -/*****************************************************************************/ -void HelpParser::Dump(LangHashMap* rElem_in,const ByteString sKey_in) { -/*****************************************************************************/ + +void HelpParser::Dump(LangHashMap* rElem_in,const ByteString sKey_in) +{ ByteString x; OString y; fprintf(stdout,"+------------%s-----------+\n",sKey_in.GetBuffer() ); - for(LangHashMap::iterator posn=rElem_in->begin();posn!=rElem_in->end();++posn){ + for(LangHashMap::iterator posn=rElem_in->begin();posn!=rElem_in->end();++posn) + { x=posn->first; y=posn->second->ToOString(); fprintf(stdout,"key=%s value=%s\n",x.GetBuffer(),y.getStr()); } fprintf(stdout,"+--------------------------+\n"); } +#endif HelpParser::HelpParser( const ByteString &rHelpFile, bool rUTF8 , bool rHasInputList ) : sHelpFile( rHelpFile ), @@ -436,9 +439,11 @@ bool HelpParser::MergeSingleFile( XMLFile* file , MergeDataFile& aMergeDataFile { aLangHM = pos->second; - //printf("*********************DUMPING HASHMAP***************************************"); - //Dump( aXMLStrHM ); - //printf("DBG: sHelpFile = %s\n",sHelpFile.GetBuffer() ); +#if OSL_DEBUG_LEVEL > 2 + printf("*********************DUMPING HASHMAP***************************************"); + Dump(aXMLStrHM); + printf("DBG: sHelpFile = %s\n",sHelpFile.GetBuffer() ); +#endif pResData.sGId = pos->first; pResData.sFilename = sHelpFile; @@ -454,7 +459,7 @@ bool HelpParser::MergeSingleFile( XMLFile* file , MergeDataFile& aMergeDataFile static const ByteString INPATH = Export::GetEnv( "INPATH" ); Export::getRandomName( sPath , sTempFile , INPATH ); - Export::getRandomName( sPath , sTempFileCopy , INPATH ); + Export::getRandomName( sPath , sTempFileCopy , INPATH ); // Write in the temp file bool hasNoError = file->Write ( sTempFile ); if( !hasNoError ) @@ -628,77 +633,5 @@ void HelpParser::ProcessHelp( LangHashMap* aLangHM , const ByteString& sCur , Re } } -/* Process() Method merges */ -void HelpParser::Process( LangHashMap* aLangHM , const ByteString& sCur , ResData *pResData , MergeDataFile& aMergeDataFile ){ - - XMLElement* pXMLElement = NULL; - PFormEntrys *pEntrys = NULL; - XMLData *data = NULL; - XMLParentNode *parent = NULL; - XMLDefault *xmldefault = NULL; - - short curLang = 0; - String sNewdata; - bool isFallback = false; - ByteString sLId; - ByteString sGId; - - pEntrys = NULL; - -#ifdef MERGE_SOURCE_LANGUAGES - if( true ){ // Merge en-US! -#else - if( !sCur.EqualsIgnoreCaseAscii("en-US") ){ -#endif - pXMLElement = (*aLangHM)[ sCur ]; - if( pXMLElement == NULL ) - { - FillInFallbacks( *aLangHM , sCur ); - pXMLElement = ( *aLangHM )[ sCur ]; - isFallback = true; - } - if( pXMLElement != NULL ) - { - parent = pXMLElement->GetParent(); - sLId = pXMLElement->GetOldref(); - pResData->sId = sLId; - - pEntrys = aMergeDataFile.GetPFormEntrys( pResData ); - if( pEntrys != NULL) - { - ByteString sNewText; - pEntrys->GetText( sNewText, STRING_TYP_TEXT, sCur , true ); - sNewdata = String( sNewText , RTL_TEXTENCODING_UTF8 ); - if ( sNewdata.Len()) - { - printf("Entries found\n"); - if( pXMLElement != NULL ) - { - data = new XMLData( sNewdata , NULL , true ); // Add new one - if( pXMLElement->ToOUString().compareTo( OUString(data->GetData()) ) != 0 ) - { - pXMLElement->RemoveAndDeleteAllChilds(); - pXMLElement->AddChild( data ); - } - if( isFallback ) - { - xmldefault = new XMLDefault( String::CreateFromAscii("\n") , NULL ); - int pos = parent->GetPosition( pXMLElement->GetId() ); - if( pos != -1 ){ - parent->AddChild(xmldefault , pos+1 ); - parent->AddChild(pXMLElement , pos+2 ); - } - else fprintf(stdout,"ERROR: Can't find reference Element of id %s language %d\n",pXMLElement->GetId().GetBuffer(),curLang); - } - - aLangHM->erase( sCur ); - } - } - delete pResData; - }else if( pResData == NULL ){fprintf(stdout,"Can't find GID=%s LID=%s TYP=%s\n",pResData->sGId.GetBuffer(),pResData->sId.GetBuffer(),pResData->sResTyp.GetBuffer());} - } - - } -} /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/l10ntools/source/lngmerge.cxx b/l10ntools/source/lngmerge.cxx index e89640015773..7af3293775f7 100644 --- a/l10ntools/source/lngmerge.cxx +++ b/l10ntools/source/lngmerge.cxx @@ -316,10 +316,13 @@ sal_Bool LngParser::Merge( nPos++; } ByteString sCur; - if ( nLastLangPos ) { - for( unsigned int n = 0; n < aLanguages.size(); n++ ){ + if ( nLastLangPos ) + { + for(size_t n = 0; n < aLanguages.size(); ++n) + { sCur = aLanguages[ n ]; - if( !sCur.EqualsIgnoreCaseAscii("en-US") && !Text[ sCur ].Len() && pEntrys ) { + if( !sCur.EqualsIgnoreCaseAscii("en-US") && Text[sCur].isEmpty() && pEntrys ) + { ByteString sNewText; pEntrys->GetText( sNewText, STRING_TYP_TEXT, sCur, sal_True ); diff --git a/l10ntools/source/localize.cxx b/l10ntools/source/localize.cxx index a0c3775b9ee7..9cacee6bebd6 100644 --- a/l10ntools/source/localize.cxx +++ b/l10ntools/source/localize.cxx @@ -204,13 +204,6 @@ private: const ByteString &rCollectMode ); void WorkOnDirectory( const ByteString &rDirectory ); - sal_Bool ExecuteMerge(); - sal_Bool MergeSingleFile( - const ByteString &rPrj, - const ByteString &rFile, - const ByteString &rSDFFile - ); - public: SourceTreeLocalizer( const ByteString &rRoot, const ByteString &rVersion , bool bLocal , bool skip_links ); ~SourceTreeLocalizer(); @@ -221,7 +214,6 @@ public: { sLanguageRestriction = rRestrictions; } int getFileCnt(); sal_Bool Extract( const ByteString &rDestinationFile ); - sal_Bool Merge( const ByteString &rSourceFile , const ByteString &rOutput ); int GetFileCnt(); virtual void OnExecuteDirectory( const rtl::OUString &rDirectory ); }; @@ -563,257 +555,6 @@ sal_Bool SourceTreeLocalizer::Extract( const ByteString &rDestinationFile ) return bReturn; } -/*****************************************************************************/ -sal_Bool SourceTreeLocalizer::MergeSingleFile( - const ByteString &rPrj, - const ByteString &rFile, - const ByteString &rSDFFile -) -/*****************************************************************************/ -{ - //printf("MergeSingleFile(%s,%s,%s)",rPrj.GetBuffer(),rFile.GetBuffer(),rSDFFile.GetBuffer()); - if ( !rFile.Len()) - return sal_True; - - ByteString sRoot( Export::GetEnv( "SRC_ROOT" )); - DirEntry aEntry( String( sRoot, RTL_TEXTENCODING_ASCII_US )); - aEntry += DirEntry( String( rPrj, RTL_TEXTENCODING_ASCII_US )); - - ByteString sDelimiter( - DirEntry::GetAccessDelimiter(), RTL_TEXTENCODING_ASCII_US ); - - ByteString sCur( rFile ); - sCur.SearchAndReplaceAll( "\\", sDelimiter ); - sCur.SearchAndReplaceAll( "/", sDelimiter ); - - aEntry += DirEntry( String( sCur, RTL_TEXTENCODING_ASCII_US )); - ByteString sFile( aEntry.GetFull(), RTL_TEXTENCODING_ASCII_US ); - - ByteString sBCur( aEntry.GetFull(), RTL_TEXTENCODING_ASCII_US ); - - sal_uLong nIndex = 0; - ByteString sExtension( aEntry.GetExtension(), RTL_TEXTENCODING_ASCII_US ); - ByteString sCandidate( ExeTable[ nIndex ][ 0 ] ); - - while( !sCandidate.Equals ("NULL") && !sCandidate.Equals(sExtension) ) - sCandidate = ExeTable[ ++nIndex ][ 0 ]; - - if ( !sCandidate.Equals( "NULL" ) ) { - if( !aEntry.Exists()) { - DirEntryKind theDir=FSYS_KIND_FILE; - Dir myDir( aEntry.GetPath(), theDir); - DirEntry current; - sal_Bool found=sal_False; - for( sal_uInt16 x=0; x < myDir.Count() && !found;){ - current=myDir[x++]; - StringCompare result=current.GetName().CompareIgnoreCaseToAscii( aEntry.GetName() ); - if( result==COMPARE_EQUAL ){ - fprintf(stderr,"WARNING: %s not found\n", ByteString(aEntry.GetFull(),RTL_TEXTENCODING_ASCII_US).GetBuffer() ); - fprintf(stderr,"but use %s instead \n" , ByteString(current.GetFull(), RTL_TEXTENCODING_ASCII_US).GetBuffer() ); - aEntry=current; - found=sal_True; - } - } - if(!found) return sal_True; - - } - - DirEntry aOut( Export::GetTempFile() ); - ByteString sOutput; - if( sOutputFile.Len() == 0 ) - sOutput = ByteString ( aOut.GetFull(), RTL_TEXTENCODING_ASCII_US ); - else - sOutput = sOutputFile; - ByteString sCommand( ExeTable[ nIndex ][ 1 ] ); - sCommand += " -i "; - sCommand += ByteString( aEntry.GetName(), RTL_TEXTENCODING_ASCII_US ); - sCommand += " -m "; - sCommand += rSDFFile; - sCommand += " -o "; - sCommand += sOutput; - sCommand += " "; - sCommand += ByteString( ExeTable[ nIndex ][ 2 ] ); - if ( sLanguageRestriction.Len()) { - sCommand += " -l "; - sCommand += sLanguageRestriction; - } - - DirEntry aPath( aEntry.GetPath()); - DirEntry aOldCWD; - aPath.SetCWD(); - - if (system(sCommand.GetBuffer()) == -1) - fprintf(stderr, "%s failed\n", sCommand.GetBuffer()); - nFileCnt++; - printf("."); - SvFileStream aInStream( aOut.GetFull(), STREAM_READ ); - if ( !aInStream.IsOpen()) { - fprintf( stderr, - "ERROR: Unable to open file %s for reading!\n", - sOutput.GetBuffer()); - } - else { - FileStat::SetReadOnlyFlag( aEntry, sal_False ); - String myStr2(aEntry.GetFull()); - String aTemp22 = String::CreateFromAscii("_tmp"); - myStr2.Append(aTemp22); - - ByteString test(myStr2,RTL_TEXTENCODING_ASCII_US); - SvFileStream aOutStream( myStr2, STREAM_STD_WRITE | STREAM_TRUNC ); - if ( !aOutStream.IsOpen()) { - ByteString test2(myStr2,RTL_TEXTENCODING_ASCII_US); - fprintf( stderr,"ERROR: Unable to open file %s for modification!\n", test2.GetBuffer()); - aInStream.Close(); - } - - else { - ByteString sLine; - aOutStream.SetLineDelimiter( LINEEND_LF ); - - aInStream.ReadLine( sLine ); - while ( !aInStream.IsEof()) { - aOutStream.WriteLine( sLine ); - aInStream.ReadLine( sLine ); - } - aInStream.Close(); - aOutStream.Close(); - - - DirEntry myTempFile(ByteString(myStr2,RTL_TEXTENCODING_ASCII_US)); // xxx_tmp -> - DirEntry myFile(ByteString(aEntry.GetFull(),RTL_TEXTENCODING_ASCII_US));// xxx - - DirEntry oldFile(ByteString(aEntry.GetFull(),RTL_TEXTENCODING_ASCII_US)); - - if(oldFile.Kill()==ERRCODE_NONE){ - if(myTempFile.MoveTo(myFile)!=ERRCODE_NONE){ - fprintf( stderr, "ERROR: Can't rename file %s\n",ByteString(myStr2,RTL_TEXTENCODING_ASCII_US).GetBuffer()); - } - } - else{ - fprintf( stderr, "ERROR: Can't remove file %s\n",ByteString(aEntry.GetFull(),RTL_TEXTENCODING_ASCII_US).GetBuffer()); - } - } // else - - aOldCWD.SetCWD(); - aOut.Kill(); - } // else - } - return sal_True; -} -/*****************************************************************************/ -sal_Bool SourceTreeLocalizer::ExecuteMerge( ) -/*****************************************************************************/ -{ - DirEntry aEntry( Export::GetTempFile()); - sal_Bool bReturn = sal_True; - bool bMerged = false; - - ByteString sFileName; - ByteString sCurFile; - ByteString sLine; - ByteString sFileKey; - - SvFileStream aFile; - - ByteString sOutputFileName = sOutputFile; - ByteString sInpath("."); - sInpath += Export::GetEnv("INPATH"); - ByteString sBlank(""); - - sOutputFileName.SearchAndReplaceAll( sInpath , sBlank ); - - String sDel = DirEntry::GetAccessDelimiter(); - ByteString sBDel( sDel.GetBuffer() , sDel.Len() , RTL_TEXTENCODING_UTF8 ); - if( bLocal ){ - xub_StrLen nPos = sOutputFileName.SearchBackward( sBDel.GetChar(0) ); - sOutputFileName = sOutputFileName.Copy( nPos+1 , sOutputFileName.Len()-nPos-1 ); - } - ByteStringBoolHashMap aFileHM; - // Read all possible files - while ( !aSDF.IsEof()) { - aSDF.ReadLine( sLine ); - sFileName = sLine.GetToken( 0, '\t' ); - sFileName += "#"; - sFileName += sLine.GetToken( 1, '\t' ); - aFileHM[sFileName]=true; - } - - for( ByteStringBoolHashMap::iterator iter = aFileHM.begin(); iter != aFileHM.end(); ++iter ){ - sFileKey = iter->first; - aSDF.Seek( 0 ); - aFile.Open( aEntry.GetFull(), STREAM_STD_WRITE |STREAM_TRUNC ); - - while ( !aSDF.IsEof()) { - aSDF.ReadLine( sLine ); - sFileName = sLine.GetToken( 0, '\t' ); - sFileName += "#"; - sFileName += sLine.GetToken( 1, '\t' ); - if( sFileName.Len() && ( sFileName.CompareTo(sFileKey) == COMPARE_EQUAL ) ){ - if ( aFile.IsOpen() && sLine.Len()) - aFile.WriteLine( sLine ); - } - } - if ( aFile.IsOpen()) - aFile.Close(); - - ByteString sPrj( sFileKey.GetToken( 0, '#' )); - ByteString sFile( sFileKey.GetToken( 1, '#' )); - ByteString sSDFFile( aFile.GetFileName(), RTL_TEXTENCODING_ASCII_US ); - - //printf("localize test sPrj = %s , sFile = %s , sSDFFile = %s sOutputFileName = %s\n",sPrj.GetBuffer(), sFile.GetBuffer() , sSDFFile.GetBuffer() , sOutputFileName.GetBuffer() ); - - // Test - bLocal = true; - // Test - - if( bLocal ){ - sal_uInt16 nPos = sFile.SearchBackward( '\\' ); - ByteString sTmp = sFile.Copy( nPos+1 , sFile.Len()-nPos-1 ); - //printf("'%s'='%s'\n",sTmp.GetBuffer(), sOutputFileName.GetBuffer()); - if( sTmp.CompareTo(sOutputFileName) == COMPARE_EQUAL ){ - bMerged = true; - if ( !MergeSingleFile( sPrj, sFile, sSDFFile )) - bReturn = sal_False; - }else{ - bMerged = true; - //printf("MergeSingleFile('%s','%s','%s')\n",sPrj.GetBuffer(),sFile.GetBuffer(),sSDFFile.GetBuffer()); - if ( !MergeSingleFile( sPrj, sFile, sSDFFile )) - bReturn = sal_False; - } - } - } - aEntry.Kill(); - // If Outputfile not included in the SDF file copy it without merge - - if( bLocal && !bMerged ){ - DirEntry aSourceFile( sOutputFileName.GetBuffer() ); - FSysError aErr = aSourceFile.CopyTo( DirEntry ( sOutputFile.GetBuffer() ) , FSYS_ACTION_COPYFILE ); - if( aErr != FSYS_ERR_OK ){ - printf("ERROR: Can't copy file '%s' to '%s' %d\n",sOutputFileName.GetBuffer(),sOutputFile.GetBuffer(),sal::static_int_cast<int>(aErr)); - } - } - return bReturn; - -} - -/*****************************************************************************/ -sal_Bool SourceTreeLocalizer::Merge( const ByteString &rSourceFile , const ByteString &rOutput ) -/*****************************************************************************/ -{ - sOutputFile = rOutput; - nMode = LOCALIZE_MERGE; - aSDF.Open( String( rSourceFile, RTL_TEXTENCODING_ASCII_US ), - STREAM_STD_READ ); - - sal_Bool bReturn = aSDF.IsOpen(); - if ( bReturn ) { - bReturn = ExecuteMerge(); - } - aSDF.Close(); - nMode = LOCALIZE_NONE; - return bReturn; -} - } using namespace transex3; diff --git a/l10ntools/source/merge.cxx b/l10ntools/source/merge.cxx index 35a61211bdbb..12ce24323cb9 100644 --- a/l10ntools/source/merge.cxx +++ b/l10ntools/source/merge.cxx @@ -155,14 +155,6 @@ PFormEntrys* MergeData::GetPFObject( const ByteString& rPFO ){ return NULL; } - -PFormEntrys *MergeData::InsertEntry( const ByteString &rPForm ) -{ - PFormEntrys* pFEntrys = new PFormEntrys( rPForm ); - aMap.insert( PFormEntrysHashMap::value_type( rPForm , pFEntrys ) ); - return pFEntrys; -} - sal_Bool MergeData::operator==( ResData *pData ) { ByteString sResTyp_upper( pData->sResTyp ); @@ -269,18 +261,6 @@ ByteString MergeDataFile::Dump(){ return sRet; } -void MergeDataFile::WriteError( const ByteString &rLine ) -{ - if ( bErrorLog ) - { - if ( !aErrLog.IsOpen()) - aErrLog.Open( String( sErrorLog, RTL_TEXTENCODING_ASCII_US ), STREAM_STD_WRITE | STREAM_TRUNC ); - aErrLog.WriteLine( rLine ); - } - else - fprintf( stderr, "%s\n", rLine.GetBuffer()); -} - std::vector<ByteString> MergeDataFile::GetLanguages(){ return std::vector<ByteString>(aLanguageSet.begin(),aLanguageSet.end()); } diff --git a/l10ntools/source/tagtest.cxx b/l10ntools/source/tagtest.cxx index c3706aa4cd30..1389cfec4749 100644 --- a/l10ntools/source/tagtest.cxx +++ b/l10ntools/source/tagtest.cxx @@ -29,6 +29,7 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_l10ntools.hxx" #include <tools/string.hxx> +#include <rtl/strbuf.hxx> #include "tagtest.hxx" #if OSL_DEBUG_LEVEL > 1 @@ -1342,20 +1343,21 @@ void TokenParser::ParseError( sal_uInt16 nErrNr, ByteString aErrMsg, const Token ParserMessage::ParserMessage( sal_uInt16 PnErrorNr, ByteString PaErrorText, const TokenInfo &rTag ) : nErrorNr( PnErrorNr ) - , aErrorText( PaErrorText ) , nTagBegin( 0 ) , nTagLength( 0 ) { String aLexem( SimpleParser::GetLexem( rTag ) ); - aErrorText.Append(": "); - aErrorText += ByteString( aLexem, RTL_TEXTENCODING_UTF8 ); + rtl::OStringBuffer aErrorBuffer(PaErrorText); + aErrorBuffer.append(RTL_CONSTASCII_STRINGPARAM(": ")); + aErrorBuffer.append(rtl::OUStringToOString(aLexem, RTL_TEXTENCODING_UTF8)); if ( rTag.nId == TAG_NOMORETAGS ) - aErrorText.Append(" at end of line "); + aErrorBuffer.append(RTL_CONSTASCII_STRINGPARAM(" at end of line ")); else if ( rTag.nPos != TOK_INVALIDPOS ) { - aErrorText.Append(" at Position "); - aErrorText.Append( ByteString::CreateFromInt32( rTag.nPos ) ); + aErrorBuffer.append(RTL_CONSTASCII_STRINGPARAM(" at Position ")); + aErrorBuffer.append(static_cast<sal_Int32>(rTag.nPos)); } + aErrorText = aErrorBuffer.makeStringAndClear(); nTagBegin = rTag.nPos; nTagLength = aLexem.Len(); } diff --git a/l10ntools/source/xrmlex.l b/l10ntools/source/xrmlex.l index 6229525d7e84..034812cf61f5 100644 --- a/l10ntools/source/xrmlex.l +++ b/l10ntools/source/xrmlex.l @@ -144,7 +144,7 @@ int yywrap(void) } /*****************************************************************************/ -void YYWarning( char *s ) +void YYWarning( const char *s ) /*****************************************************************************/ { /* write warning to stderr */ @@ -154,9 +154,9 @@ void YYWarning( char *s ) /*****************************************************************************/ #ifdef GCC -void yyerror ( char *s, ... ) +void yyerror ( const char *s, ... ) #else -void yyerror ( char *s ) +void yyerror ( const char *s ) #endif /*****************************************************************************/ { diff --git a/l10ntools/source/xrmmerge.cxx b/l10ntools/source/xrmmerge.cxx index 875fd457cf93..064d908ae04f 100644 --- a/l10ntools/source/xrmmerge.cxx +++ b/l10ntools/source/xrmmerge.cxx @@ -526,14 +526,16 @@ void XRMResExport::WorkOnText( { ByteString sLang( GetAttribute( rOpenTag, "xml:lang" )); - if ( !pResData ) { - ByteString sPlatform( "" ); - pResData = new ResData( sPlatform, GetGID() ); - pResData->sId = GetLID(); - } + if ( !pResData ) + { + ByteString sPlatform( "" ); + pResData = new ResData( sPlatform, GetGID() ); + pResData->sId = GetLID(); + } - pResData->sText[ sLang ] = rText; - ConvertStringToDBFormat( pResData->sText[ sLang ] ); + ByteString sText(rText); + ConvertStringToDBFormat(sText); + pResData->sText[sLang] = sText; } /*****************************************************************************/ @@ -648,7 +650,6 @@ void XRMResMerge::WorkOnText( { rText = sContent; ConvertStringToXMLFormat( rText ); - //Export::QuotHTMLXRM( rText ); } } } diff --git a/padmin/Executable_spadmin.bin.mk b/padmin/Executable_spadmin.bin.mk index eef72e115054..6b44b64fa22f 100644 --- a/padmin/Executable_spadmin.bin.mk +++ b/padmin/Executable_spadmin.bin.mk @@ -30,13 +30,17 @@ $(eval $(call gb_Executable_Executable,spadmin.bin)) $(eval $(call gb_Executable_set_include,spadmin.bin,\ $$(INCLUDE) \ -I$(OUTDIR)/inc \ - -I$(OUTDIR)/inc/offuh \ )) $(eval $(call gb_Executable_add_linked_static_libs,spadmin.bin,\ vclmain \ )) +$(eval $(call gb_Executable_add_api,spadmin.bin,\ + udkapi \ + offapi \ +)) + $(eval $(call gb_Executable_add_linked_libs,spadmin.bin,\ spa \ svt \ diff --git a/padmin/Library_spa.mk b/padmin/Library_spa.mk index 8d19fe41248f..87b08acd45be 100644 --- a/padmin/Library_spa.mk +++ b/padmin/Library_spa.mk @@ -27,15 +27,15 @@ $(eval $(call gb_Library_Library,spa)) -$(eval $(call gb_Library_set_include,spa,\ - $$(INCLUDE) \ - -I$(OUTDIR)/inc/offuh \ -)) - $(eval $(call gb_Library_add_defs,spa,\ -DSPA_DLLIMPLEMENTATION \ )) +$(eval $(call gb_Library_add_api,spa,\ + udkapi \ + offapi \ +)) + $(eval $(call gb_Library_add_linked_libs,spa,\ svt \ vcl \ diff --git a/padmin/source/cmddlg.cxx b/padmin/source/cmddlg.cxx index be87417891f4..4303757628ba 100644 --- a/padmin/source/cmddlg.cxx +++ b/padmin/source/cmddlg.cxx @@ -129,11 +129,11 @@ void CommandStore::getStoredCommands( const char* pGroup, ::std::list< String >& { Config& rConfig( getPadminRC() ); rConfig.SetGroup( pGroup ); - int nKeys = rConfig.GetKeyCount(); + sal_Int32 nKeys = rConfig.GetKeyCount(); ::std::list< String >::const_iterator it; while( nKeys-- ) { - String aCommand( rConfig.ReadKey( ByteString::CreateFromInt32( nKeys ), RTL_TEXTENCODING_UTF8 ) ); + String aCommand( rConfig.ReadKey(rtl::OString::valueOf(nKeys), RTL_TEXTENCODING_UTF8 ) ); if( aCommand.Len() ) { for( it = rCommands.begin(); it != rCommands.end() && *it != aCommand; ++it ) @@ -156,7 +156,7 @@ void CommandStore::setCommands( ::std::list< String >::const_iterator it, loop; ::std::list< String > aWriteList; - int nWritten = 0; + sal_Int32 nWritten = 0; for( it = rCommands.begin(); it != rCommands.end(); ++it ) { if( it->Len() ) @@ -176,7 +176,7 @@ void CommandStore::setCommands( nWritten--; } for( nWritten = 0, it = aWriteList.begin(); it != aWriteList.end(); ++it, ++nWritten ) - rConfig.WriteKey( ByteString::CreateFromInt32( nWritten ), ByteString( *it, RTL_TEXTENCODING_UTF8 ) ); + rConfig.WriteKey( rtl::OString::valueOf(nWritten), ByteString( *it, RTL_TEXTENCODING_UTF8 ) ); } diff --git a/padmin/source/newppdlg.cxx b/padmin/source/newppdlg.cxx index 6382ae1359dd..0da40ce90f02 100644 --- a/padmin/source/newppdlg.cxx +++ b/padmin/source/newppdlg.cxx @@ -77,9 +77,9 @@ PPDImportDialog::PPDImportDialog( Window* pParent ) : Config& rConfig = getPadminRC(); rConfig.SetGroup( PPDIMPORT_GROUP ); m_aPathBox.SetText( String( rConfig.ReadKey( "LastDir" ), RTL_TEXTENCODING_UTF8 ) ); - for( int i = 0; i < 11; i++ ) + for (sal_Int32 i = 0; i < 11; ++i) { - ByteString aEntry( rConfig.ReadKey( ByteString::CreateFromInt32( i ) ) ); + ByteString aEntry(rConfig.ReadKey(rtl::OString::valueOf(i))); if( aEntry.Len() ) m_aPathBox.InsertEntry( String( aEntry, RTL_TEXTENCODING_UTF8 ) ); } @@ -117,10 +117,10 @@ void PPDImportDialog::Import() break; if( nEntries < 0 ) { - int nNextEntry = rConfig.ReadKey( "NextEntry" ).ToInt32(); - rConfig.WriteKey( ByteString::CreateFromInt32( nNextEntry ), ByteString( aImportPath, RTL_TEXTENCODING_UTF8 ) ); + sal_Int32 nNextEntry = rConfig.ReadKey( "NextEntry" ).ToInt32(); + rConfig.WriteKey( rtl::OString::valueOf(nNextEntry), ByteString( aImportPath, RTL_TEXTENCODING_UTF8 ) ); nNextEntry = nNextEntry < 10 ? nNextEntry+1 : 0; - rConfig.WriteKey( "NextEntry", ByteString::CreateFromInt32( nNextEntry ) ); + rConfig.WriteKey( "NextEntry", rtl::OString::valueOf(nNextEntry) ); m_aPathBox.InsertEntry( aImportPath ); } while( m_aDriverLB.GetEntryCount() ) diff --git a/regexp/prj/d.lst b/regexp/prj/d.lst index e69de29bb2d1..3f38fbeea4f7 100644 --- a/regexp/prj/d.lst +++ b/regexp/prj/d.lst @@ -0,0 +1 @@ +..\%__SRC%\lib\libi18nregexp*.dll.a %_DEST%\lib\libi18nregexp*.dll.a diff --git a/regexp/source/reclass.cxx b/regexp/source/reclass.cxx index a5015a8aeca2..c57632a5863b 100644 --- a/regexp/source/reclass.cxx +++ b/regexp/source/reclass.cxx @@ -1357,13 +1357,6 @@ Regexpr::regex_compile() case (sal_Unicode)')': goto normal_backslash; - // unreachable (after goto): -#if 0 - if (COMPILE_STACK_EMPTY) { - FREE_STACK_RETURN(REG_ERPAREN); - } -#endif - handle_close: if (fixup_alt_jump) { /* Push a dummy failure point at the end of the diff --git a/rsc/inc/rscclass.hxx b/rsc/inc/rscclass.hxx index 7dc3e95488ad..36bc5be7c4ca 100644 --- a/rsc/inc/rscclass.hxx +++ b/rsc/inc/rscclass.hxx @@ -118,15 +118,6 @@ public: RscTypCont * pTC, sal_uInt32, sal_Bool bExtra ); }; -class RscFirstSysDepend : public RscSysDepend -{ -public: - RscFirstSysDepend( Atom nId, sal_uInt32 nTypId, - RscTop * pSuper ); - ERRTYPE WriteRc( const RSCINST &, RscWriteRc & aMem, - RscTypCont * pTC, sal_uInt32, sal_Bool bExtra ); -}; - class RscTupel : public RscClass { public: diff --git a/rsc/inc/rscdb.hxx b/rsc/inc/rscdb.hxx index 54c386dab315..012c340bc42e 100644 --- a/rsc/inc/rscdb.hxx +++ b/rsc/inc/rscdb.hxx @@ -336,9 +336,6 @@ public: aBaseLst.push_back( pType ); } RscTop * SearchType( Atom nTypId ); - RscTop * Search( Atom typ ); - CLASS_DATA Search( Atom typ, const RscId & rId ); - void Delete( Atom typ, const RscId & rId ); // loescht alle Resourceobjekte diese Datei void Delete( sal_uLong lFileKey ); RscTop * GetRoot() { return( pRoot ); }; @@ -353,8 +350,6 @@ public: const ByteString & rHxxName ); void WriteSyntax( FILE * fOutput ); void WriteRcCtor( FILE * fOutput ); - void FillNameIdList( REResourceList * pList, sal_uLong lFileKey ); - sal_Bool MakeConsistent(); sal_uInt32 PutTranslatorKey( sal_uInt64 nKey ); void IncFilePos( sal_uLong nOffset ){ nFilePos += nOffset; } }; diff --git a/rsc/inc/rscdef.hxx b/rsc/inc/rscdef.hxx index 4ff5e2201dd6..6d335d5544b0 100644 --- a/rsc/inc/rscdef.hxx +++ b/rsc/inc/rscdef.hxx @@ -30,6 +30,7 @@ #include <tools/unqidx.hxx> #include <rsctree.hxx> +#include <rtl/strbuf.hxx> #include <vector> /****************** C L A S S E S ****************************************/ @@ -70,7 +71,7 @@ public: ((sal_Int32)aExp.aLong.nHi << 16); } sal_Bool Evaluate( sal_Int32 * pValue ) const; - void GetMacro( ByteString & ) const; + void AppendMacro( rtl::OStringBuffer & ) const; }; /*********** R s c I d ***************************************************/ @@ -102,11 +103,9 @@ public: RscId& operator = ( const RscId& rRscId ); - static sal_Bool IsSetNames(); static void SetNames( sal_Bool bSet = sal_True ); operator sal_Int32() const; // Gibt Nummer zurueck ByteString GetName() const; // Gibt den Namen des Defines zurueck - ByteString GetMacro() const; // Gibt das Macro zurueck sal_Bool operator < ( const RscId& rRscId ) const; sal_Bool operator > ( const RscId& rRscId ) const; sal_Bool operator == ( const RscId& rRscId ) const; @@ -141,8 +140,6 @@ protected: void DecRef(); void DefineToNumber(); void SetName( const ByteString & rNewName ){ aName = rNewName; } - void ChangeMacro( RscExpression * pExpression ); - void ChangeMacro( sal_Int32 lIdentifier ); using StringNode::Search; public: @@ -165,9 +162,6 @@ private: sal_Int32 lDefId, size_t lPos ); RscDefine * New( sal_uLong lFileKey, const ByteString & rDefName, RscExpression * pExpression, size_t lPos ); - sal_Bool Befor( const RscDefine * pFree, const RscDefine * pDepend ); - sal_Bool Remove( RscDefine * pDef ); - sal_Bool Remove( size_t nIndex ); sal_Bool Remove(); size_t GetPos( RscDefine* item ) { for ( size_t i = 0, n = maList.size(); i < n; ++i ) @@ -220,7 +214,6 @@ public: RscFile(); ~RscFile(); sal_Bool InsertDependFile( sal_uLong lDepFile, size_t lPos ); - void RemoveDependFile( sal_uLong lDepFile ); sal_Bool Depend( sal_uLong lDepend, sal_uLong lFree ); void SetIncFlag(){ bIncFile = sal_True; }; sal_Bool IsIncFile(){ return bIncFile; }; @@ -236,7 +229,6 @@ public: RscDefTree(){ pDefRoot = NULL; } ~RscDefTree(); void Remove(); - sal_Bool Evaluate(); RscDefine * Search( const char * pName ); void Insert( RscDefine * pDef ); void Remove( RscDefine * pDef ); @@ -251,7 +243,6 @@ public: RscDefine * FindDef( const char * ); RscDefine * FindDef( const ByteString& rStr ) { return FindDef( rStr.GetBuffer() ); } - RscDefine * FindDef( sal_uLong lKey, const ByteString & ); sal_Bool Depend( sal_uLong lDepend, sal_uLong lFree ); sal_Bool TestDef( sal_uLong lFileKey, size_t lPos, @@ -264,17 +255,8 @@ public: RscDefine * NewDef( sal_uLong lKey, const ByteString & rDefName, RscExpression *, sal_uLong lPos ); - sal_Bool ChangeDef( const ByteString & rDefName, sal_Int32 lId ); - sal_Bool ChangeDef( const ByteString & rDefName, RscExpression * ); - - sal_Bool IsDefUsed( const ByteString & ); - void DeleteDef( const ByteString & ); - sal_Bool ChangeDefName( const ByteString & rDefName, - const ByteString & rNewName ); - // Alle Defines die in dieser Datei Definiert sind loeschen void DeleteFileContext( sal_uLong lKey ); - void DeleteFile( sal_uLong lKey ); sal_uLong NewCodeFile( const ByteString & rName ); sal_uLong NewIncFile( const ByteString & rName, const ByteString & rPath ); RscFile * GetFile( sal_uLong lFileKey ){ return Get( lFileKey ); } diff --git a/rsc/inc/rscinst.hxx b/rsc/inc/rscinst.hxx index b64016bfac72..13535411c4bd 100644 --- a/rsc/inc/rscinst.hxx +++ b/rsc/inc/rscinst.hxx @@ -206,8 +206,6 @@ public: const ByteString & rMacro ); sal_Bool IsDefUsed( const ByteString & ); void DeleteDef( const ByteString & rMacroName ); - ERRTYPE ChangeDefName( const ByteString & rMacroName, - const ByteString & rNewName ); // Dateinamen-Instanz holen RscFile * GetFileStruct(); diff --git a/rsc/inc/rsckey.hxx b/rsc/inc/rsckey.hxx index dd99b68b0fae..65125c2904d1 100644 --- a/rsc/inc/rsckey.hxx +++ b/rsc/inc/rsckey.hxx @@ -48,11 +48,9 @@ public: ~RscNameTable(); void SetSort( sal_Bool bSorted = sal_True ); Atom Put( Atom nName, sal_uInt32 nTyp, long nValue ); - Atom Put( Atom nName, sal_uInt32 nTyp ); Atom Put( const char * pName, sal_uInt32 nTyp, long nValue ); Atom Put( const char * pName, sal_uInt32 nTyp ); Atom Put( Atom nName, sal_uInt32 nTyp, RscTop * pClass ); - Atom Put( const char * pName, sal_uInt32 nTyp, RscTop * pClass ); // sal_True, wurde gefunden sal_Bool Get( Atom nName, KEY_STRUCT * pEle ); diff --git a/rsc/inc/rscpar.hxx b/rsc/inc/rscpar.hxx index 69037ba8c027..779f2572afb7 100644 --- a/rsc/inc/rscpar.hxx +++ b/rsc/inc/rscpar.hxx @@ -62,8 +62,6 @@ public: void Init(); // ctor initialisieren RscFileInst( RscTypCont * pTC, sal_uLong lIndexSrc, sal_uLong lFileIndex, FILE * fFile ); - RscFileInst( RscTypCont * pTC, sal_uLong lIndexSrc, - sal_uLong lFileIndex, const ByteString & ); ~RscFileInst(); sal_Bool IsEof() const { return bEof; } void SetFileIndex( sal_uLong lFIndex ) { lFileIndex = lFIndex; } @@ -88,7 +86,6 @@ public: /******************* F u n c t i o n *************************************/ void IncludeParser( RscFileInst * pFileInst ); ERRTYPE parser( RscFileInst * pFileInst ); -RscExpression * MacroParser( RscFileInst & rFileInst ); #endif // _RSCPAR_HXX diff --git a/rsc/inc/rscrsc.hxx b/rsc/inc/rscrsc.hxx index 367118858918..aa7ee437643a 100644 --- a/rsc/inc/rscrsc.hxx +++ b/rsc/inc/rscrsc.hxx @@ -76,12 +76,10 @@ public: std::list<OutputFile> m_aOutputFiles; std::list< std::pair< rtl::OString, rtl::OString > > m_aReplacements; - RscCmdLine( int argc, char ** argv, RscError * pEH ); - RscCmdLine(); + RscCmdLine( int argc, char ** argv, RscError * pEH ); + ~RscCmdLine(); - ~RscCmdLine(); - - ::rtl::OString substitutePaths( const ::rtl::OString& rIn ); + ::rtl::OString substitutePaths( const ::rtl::OString& rIn ); }; /****************** R s c ************************************************/ @@ -97,7 +95,6 @@ private: void CreateResFile( const char * pRc ); void Append( const ByteString& rOutputSrs, const ByteString& rTmpFile ); - void OpenInput( const ByteString& rInput ); bool GetImageFilePath( const RscCmdLine::OutputFile& rOutputFile, const WriteRcContext& rContext, @@ -119,7 +116,6 @@ public: ~RscCompiler(); ERRTYPE Start(); - ByteString GetTmpFileName(); // Die Dateien werden geloescht // Include Statements lesen ERRTYPE IncludeParser( sal_uLong lFileKey ); diff --git a/rsc/inc/rsctools.hxx b/rsc/inc/rsctools.hxx index b65207dafac3..5792c1de8cff 100644 --- a/rsc/inc/rsctools.hxx +++ b/rsc/inc/rsctools.hxx @@ -51,7 +51,6 @@ enum RSCBYTEORDER_TYPE { RSC_BIGENDIAN, RSC_LITTLEENDIAN, RSC_SYSTEMENDIAN }; ByteString GetTmpFileName(); sal_Bool Append( ByteString aDestFile, ByteString aSourceFile ); sal_Bool Append( FILE * fDest, ByteString aSourceFile ); -ByteString InputFile ( const char * pInput, const char * pExt ); ByteString OutputFile( ByteString aInput, const char * ext ); char * ResponseFile( RscPtrPtr * ppCmd, char ** ppArgv, sal_uInt32 nArgc ); diff --git a/rsc/prj/build.lst b/rsc/prj/build.lst index a26b9a055b60..d9e775d28e66 100644 --- a/rsc/prj/build.lst +++ b/rsc/prj/build.lst @@ -6,4 +6,4 @@ r rsc\source\res nmake - all rsc_res NULL r rsc\source\parser nmake - all rsc_pars NULL r rsc\source\rsc nmake - all rsc_rsc NULL r rsc\source\rscpp nmake - all rsc_cpp NULL -r rsc\source\prj nmake - all rsc_sprj rsc_misc rsc_pars rsc_res rsc_rsc rsc_tool NULL +r rsc\source\prj nmake - all rsc_sprj rsc_cpp rsc_misc rsc_pars rsc_res rsc_rsc rsc_tool NULL diff --git a/rsc/prj/d.lst b/rsc/prj/d.lst index 984a109cf0a6..9c670b37b25c 100644 --- a/rsc/prj/d.lst +++ b/rsc/prj/d.lst @@ -1,9 +1,5 @@ ..\%__SRC%\bin\rsc.exe %_DEST%\bin\rsc.exe -..\%__SRC%\bin\rsc2.exe %_DEST%\bin\rsc2.exe ..\%__SRC%\bin\rsc %_DEST%\bin\rsc -..\%__SRC%\bin\rsc2 %_DEST%\bin\rsc2 -..\%__SRC%\bin\rscpp.exe %_DEST%\bin\rscpp.exe -..\%__SRC%\bin\rscpp %_DEST%\bin\rscpp mkdir: %_DEST%\inc\rsc ..\inc\rsc/rscsfx.hxx %_DEST%\inc\rsc\rscsfx.hxx diff --git a/rsc/source/misc/rscdbl.cxx b/rsc/source/misc/rscdbl.cxx index 5e6faeb47c22..8de91ae9dbbd 100644 --- a/rsc/source/misc/rscdbl.cxx +++ b/rsc/source/misc/rscdbl.cxx @@ -37,11 +37,6 @@ #include <rsctop.hxx> #include "rsclst.hxx" -/************************************************************************* -|* -|* RscTypCont::FillNameIdList() -|* -*************************************************************************/ REResourceList * InsertList( Atom nClassName, const RscId& rId, REResourceList * pList ) { REResourceList * pSubList; @@ -52,7 +47,7 @@ REResourceList * InsertList( Atom nClassName, const RscId& rId, if( pStrClass ) aStrClass = pStrClass; else - aStrClass = ByteString::CreateFromInt32( (long)nClassName ); + aStrClass = rtl::OString::valueOf(static_cast<sal_Int32>(nClassName)); pSubList = new REResourceList( pList, aStrClass, rId ); @@ -110,8 +105,4 @@ void FillList( RscTop * pRscTop, REResourceList * pList, sal_uLong lFileKey ){ }; } -void RscTypCont::FillNameIdList( REResourceList * pList, sal_uLong lFileKey ){ - FillList( pRoot, pList, lFileKey ); -} - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/rsc/source/parser/erscerr.cxx b/rsc/source/parser/erscerr.cxx index 23337514b2c5..d323e5229d7b 100644 --- a/rsc/source/parser/erscerr.cxx +++ b/rsc/source/parser/erscerr.cxx @@ -123,9 +123,9 @@ void RscError::WriteError( const ERRTYPE& rError, const char * pMessage ) case ERR_ERROR: { StdLstErr( "!! " ); if( 1 == nErrors ) - StdLstErr( ByteString::CreateFromInt32( nErrors ).GetBuffer() ); + StdLstErr(rtl::OString::valueOf(static_cast<sal_Int32>(nErrors )).getStr()); else - StdLstErr( ByteString::CreateFromInt32( (nErrors -1) ).GetBuffer() ); + StdLstErr(rtl::OString::valueOf(static_cast<sal_Int32>(nErrors -1)).getStr()); StdLstErr( " Error" ); StdLstErr( " found!!" ); } diff --git a/rsc/source/parser/rscdb.cxx b/rsc/source/parser/rscdb.cxx index a71b4a51eea2..1c7e544e18eb 100644 --- a/rsc/source/parser/rscdb.cxx +++ b/rsc/source/parser/rscdb.cxx @@ -315,56 +315,6 @@ RscTop * RscTypCont::SearchType( Atom nId ) /************************************************************************* |* -|* RscTypCont :: Search -|* -*************************************************************************/ -RscTop * RscTypCont :: Search( Atom nRT ){ - return( (RscTop *)pRoot->Search( nRT ) ); -} - -CLASS_DATA RscTypCont :: Search( Atom nRT, const RscId & rId ){ - ObjNode *pObjNode; - RscTop *pRscTop; - - if( NULL != (pRscTop = Search( nRT )) ){ - if( NULL != (pObjNode = pRscTop->GetObjNode( rId )) ){ - return( pObjNode->GetRscObj() ); - } - } - return( (CLASS_DATA)0 ); -} - -/************************************************************************* -|* -|* RscTypCont :: Delete() -|* -*************************************************************************/ -void RscTypCont :: Delete( Atom nRT, const RscId & rId ){ - ObjNode * pObjNode; - RscTop * pRscTop; - - if( NULL != (pRscTop = Search( nRT )) ){ - if( NULL != (pObjNode = pRscTop->GetObjNode()) ){ - pObjNode = pObjNode->Search( rId ); - - if( pObjNode ){ - //Objekt aus Baum entfernen - pRscTop->pObjBiTree = - (ObjNode *)pRscTop->pObjBiTree->Remove( pObjNode ); - - if( pObjNode->GetRscObj() ){ - pRscTop->Destroy( RSCINST( pRscTop, - pObjNode->GetRscObj() ) ); - rtl_freeMemory( pObjNode->GetRscObj() ); - } - delete pObjNode; - } - } - } -} - -/************************************************************************* -|* |* RscTypCont :: PutSysName() |* *************************************************************************/ @@ -969,11 +919,6 @@ void RscTypCont :: Delete( sal_uLong lFileKey ){ aFileTab.DeleteFileContext( lFileKey ); } -/************************************************************************* -|* -|* RscTypCont :: MakeConsistent() -|* -*************************************************************************/ sal_Bool IsInstConsistent( ObjNode * pObjNode, RscTop * pRscTop ) { sal_Bool bRet = sal_True; @@ -1021,10 +966,6 @@ sal_Bool MakeConsistent( RscTop * pRscTop ) return bRet; } -sal_Bool RscTypCont :: MakeConsistent(){ - return( ::MakeConsistent( pRoot ) ); -} - sal_uInt32 RscTypCont::PutTranslatorKey( sal_uInt64 nKey ) { aIdTranslator[ nKey ] = nFilePos; diff --git a/rsc/source/parser/rsckey.cxx b/rsc/source/parser/rsckey.cxx index 621ab4d69598..bdd21e89742f 100644 --- a/rsc/source/parser/rsckey.cxx +++ b/rsc/source/parser/rsckey.cxx @@ -122,11 +122,6 @@ Atom RscNameTable::Put( const char * pName, sal_uInt32 nTyp, long nValue ) return( Put( pHS->getID( pName ), nTyp, nValue ) ); }; -Atom RscNameTable::Put( Atom nName, sal_uInt32 nTyp ) -{ - return( Put( nName, nTyp, (long)nName ) ); -}; - Atom RscNameTable::Put( const char * pName, sal_uInt32 nTyp ) { Atom nId; @@ -140,11 +135,6 @@ Atom RscNameTable::Put( Atom nName, sal_uInt32 nTyp, RscTop * pClass ) return( Put( nName, nTyp, (long)pClass ) ); }; -Atom RscNameTable::Put( const char * pName, sal_uInt32 nTyp, RscTop * pClass ) -{ - return( Put( pHS->getID( pName ), nTyp, (long)pClass ) ); -}; - /************************************************************************* |* |* RscNameTable::Get() diff --git a/rsc/source/parser/rsclex.cxx b/rsc/source/parser/rsclex.cxx index 47be75549220..e9e4a0ebb9d0 100644 --- a/rsc/source/parser/rsclex.cxx +++ b/rsc/source/parser/rsclex.cxx @@ -413,38 +413,4 @@ ERRTYPE parser( RscFileInst * pFileInst ) return( aError ); } -RscExpression * MacroParser( RscFileInst & rFileInst ) -{ - ERRTYPE aError; - RscExpression * pExpression; - - InitParser( &rFileInst ); - - //Ziel auf macro_expression setzen - aKeyVal[ 0 ].nKeyWord = MACROTARGET; - bTargetDefined = sal_True; - aError = yyparse(); - - pExpression = pExp; - //EndParser() wuerde pExp loeschen - if( pExp ) - pExp = NULL; - - EndParser(); - - // yyparser gibt 0 zurueck, wenn erfolgreich - if( 0 == aError ) - aError.Clear(); - if( rFileInst.pTypCont->pEH->nErrors ) - aError = ERR_ERROR; - rFileInst.SetError( aError ); - - //im Fehlerfall pExpression loeschen - if( aError.IsError() && pExpression ){ - delete pExpression; - pExpression = NULL; - }; - return( pExpression ); -} - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/rsc/source/parser/rscpar.cxx b/rsc/source/parser/rscpar.cxx index fc3c44c8754d..d3dc291c5631 100644 --- a/rsc/source/parser/rscpar.cxx +++ b/rsc/source/parser/rscpar.cxx @@ -72,23 +72,6 @@ RscFileInst::RscFileInst( RscTypCont * pTC, sal_uLong lIndexSrc, pInput = (char *)rtl_allocateMemory( nInputBufLen ); } -RscFileInst::RscFileInst( RscTypCont * pTC, sal_uLong lIndexSrc, - sal_uLong lFIndex, const ByteString& rBuf ) -{ - pTypCont = pTC; - Init(); - lFileIndex = lFIndex; - lSrcIndex = lIndexSrc; - fInputFile = NULL; - nInputPos = 0; - nInputEndPos = rBuf.Len(); - - // Muss groesser sein wegen Eingabeende bei nInputBufLen < nInputEndPos - nInputBufLen = nInputEndPos +1; - pInput = (char *)rtl_allocateMemory( nInputBufLen +100 ); - memcpy( pInput, rBuf.GetBuffer(), nInputEndPos ); -} - /************************************************************************* |* |* RscFileInst::~RscFileInst() diff --git a/rsc/source/parser/rscyacc.cxx b/rsc/source/parser/rscyacc.cxx index c795abcc1fc9..f812523d9dc1 100644 --- a/rsc/source/parser/rscyacc.cxx +++ b/rsc/source/parser/rscyacc.cxx @@ -111,15 +111,16 @@ void SetString( const RSCINST & rInst, const char * pVarName, const char * pStr RscId MakeRscId( RscExpType aExpType ) { - if( !aExpType.IsNothing() ){ - sal_Int32 lValue; + if( !aExpType.IsNothing() ) + { + sal_Int32 lValue(0); if( !aExpType.Evaluate( &lValue ) ) pTC->pEH->Error( ERR_ZERODIVISION, NULL, RscId() ); if( lValue < 1 || lValue > (sal_Int32)0x7FFF ) { pTC->pEH->Error( ERR_IDRANGE, NULL, RscId(), - ByteString::CreateFromInt32( lValue ).GetBuffer() ); + rtl::OString::valueOf(lValue).getStr() ); } if( aExpType.IsDefinition() ) diff --git a/rsc/source/prj/gui.cxx b/rsc/source/prj/gui.cxx index 42d45caeb433..a25413492e1d 100644 --- a/rsc/source/prj/gui.cxx +++ b/rsc/source/prj/gui.cxx @@ -31,7 +31,6 @@ #include <stdlib.h> #include <stdio.h> -#include <sal/main.h> #include <rscrsc.hxx> #include <rscdb.hxx> @@ -66,7 +65,8 @@ RscVerbosity lcl_determineVerbosity( int argc, char ** argv ) return RscVerbosityNormal; } -SAL_IMPLEMENT_MAIN_WITH_ARGS(argc, argv) { +int rsc2_main( int argc, char **argv ) +{ #ifndef UNX atexit( ExitProgram ); #endif @@ -107,11 +107,4 @@ SAL_IMPLEMENT_MAIN_WITH_ARGS(argc, argv) { return( 1 ); } -void RscExit( sal_uInt32 nExit ) -{ - if( nExit ) - printf( "Program exit is %ud\n", (unsigned int)nExit ); - exit( nExit ); -} - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/rsc/source/prj/makefile.mk b/rsc/source/prj/makefile.mk index 9a504e3de78e..d496919cca23 100644 --- a/rsc/source/prj/makefile.mk +++ b/rsc/source/prj/makefile.mk @@ -45,22 +45,17 @@ OBJFILES= $(OBJ)$/gui.obj \ APP1TARGET= rsc APP1STDLIBS=$(TOOLSLIB) $(I18NISOLANGLIB) $(SALLIB) # $(RTLLIB) -APP1LIBS= $(LB)$/rsctoo.lib -APP1OBJS= $(OBJ)$/start.obj +APP1LIBS= $(LB)$/rscmis.lib \ + $(LB)$/rscpar.lib \ + $(LB)$/rscres.lib \ + $(LB)$/rscrsc.lib \ + $(LB)$/rscpp.lib \ + $(LB)$/rsctoo.lib +APP1OBJS= $(OBJ)$/start.obj \ + $(OBJ)$/gui.obj APP1STACK=64000 APP1RPATH=NONE -APP2TARGET= rsc2 -APP2STDLIBS=$(TOOLSLIB) $(I18NISOLANGLIB) $(SALLIB) # $(RTLLIB) -APP2LIBS= $(LB)$/rsctoo.lib \ - $(LB)$/rscres.lib \ - $(LB)$/rscpar.lib \ - $(LB)$/rscrsc.lib \ - $(LB)$/rscmis.lib -APP2OBJS= $(OBJ)$/gui.obj -APP2STACK=64000 -APP2RPATH=NONE - # --- Targets ------------------------------------------------------------ .INCLUDE : target.mk diff --git a/rsc/source/prj/start.cxx b/rsc/source/prj/start.cxx index 8a949546ce3a..be085254354f 100644 --- a/rsc/source/prj/start.cxx +++ b/rsc/source/prj/start.cxx @@ -50,39 +50,20 @@ #include <tools/fsys.hxx> /*************** C O D E ************************************************/ -/****************************************************************/ -/* */ -/* Function : fuer Ansi kompatibilitaet */ -/* */ -/****************************************************************/ -#ifdef UNX -#define P_WAIT 0 - int spawnvp( int, const char * cmdname, char *const* argv ){ - int rc(0); - - switch( fork() ){ - case -1: - return( -1 ); - case 0: - if( execvp( cmdname, argv ) == -1 ) - // an error occurs - return( -1 ); - break; - default: - if( -1 == wait( &rc ) ) - return( -1 ); - } - return( WEXITSTATUS( rc ) ); - } -#endif + +// Entry point declaration for modules rscpp and rsc2 +extern "C" +{ + int rscpp_main(int, char**); +} +int rsc2_main(int, char**); /************************************************************************* |* CallPrePro() |* |* Beschreibung *************************************************************************/ -static sal_Bool CallPrePro( const ByteString& rPrePro, - const ByteString& rInput, +static sal_Bool CallPrePro( const ByteString& rInput, const ByteString& rOutput, RscPtrPtr * pCmdLine, sal_Bool bResponse ) @@ -90,7 +71,7 @@ static sal_Bool CallPrePro( const ByteString& rPrePro, RscPtrPtr aNewCmdL; // Kommandozeile RscPtrPtr aRespCmdL; // Kommandozeile RscPtrPtr * pCmdL = &aNewCmdL; - int i, nExit; + int i, nRet; FILE* fRspFile = NULL; ByteString aRspFileName; @@ -101,7 +82,7 @@ static sal_Bool CallPrePro( const ByteString& rPrePro, } if( !fRspFile ) - aNewCmdL.Append( rsc_strdup( rPrePro.GetBuffer() ) ); + aNewCmdL.Append( rsc_strdup( "rscpp" ) ); bool bVerbose = false; for( i = 1; i < int(pCmdLine->GetCount() -1); i++ ) @@ -137,7 +118,7 @@ static sal_Bool CallPrePro( const ByteString& rPrePro, if( fRspFile ) { - aRespCmdL.Append( rsc_strdup( rPrePro.GetBuffer() ) ); + aRespCmdL.Append( rsc_strdup( "rscpp" ) ); ByteString aTmpStr( '@' ); aTmpStr += aRspFileName; aRespCmdL.Append( rsc_strdup( aTmpStr.GetBuffer() ) ); @@ -162,11 +143,7 @@ static sal_Bool CallPrePro( const ByteString& rPrePro, } } -#if defined UNX - nExit = spawnvp( P_WAIT, rPrePro.GetBuffer(), (char* const*)pCmdL->GetBlock() ); -#else - nExit = spawnvp( P_WAIT, (char*)rPrePro.GetBuffer(), (const char**)pCmdL->GetBlock() ); -#endif + nRet = rscpp_main( pCmdL->GetCount()-1, (char**)pCmdL->GetBlock() ); if ( fRspFile ) #if OSL_DEBUG_LEVEL > 5 @@ -174,7 +151,7 @@ static sal_Bool CallPrePro( const ByteString& rPrePro, #else unlink( aRspFileName.GetBuffer() ); #endif - if ( nExit ) + if ( nRet ) return sal_False; return sal_True; @@ -186,93 +163,65 @@ static sal_Bool CallPrePro( const ByteString& rPrePro, |* |* Beschreibung *************************************************************************/ -static sal_Bool CallRsc2( ByteString aRsc2Name, - RscStrList * pInputList, +static sal_Bool CallRsc2( RscStrList * pInputList, ByteString aSrsName, RscPtrPtr * pCmdLine ) { - int nExit; - ByteString* pString; - ByteString aRspFileName; // Response-Datei - FILE * fRspFile; // Response-Datei + int nRet; + ByteString* pString; + RscVerbosity eVerbosity = RscVerbosityNormal; - aRspFileName = ::GetTmpFileName(); - fRspFile = fopen( aRspFileName.GetBuffer(), "w" ); + RscPtrPtr aNewCmdL; + aNewCmdL.Append( rsc_strdup( "rsc2" ) ); - RscVerbosity eVerbosity = RscVerbosityNormal; - if( fRspFile ) + for (int i = 1; i < (int)(pCmdLine->GetCount() -1); ++i) { - for (int i = 1; i < (int)(pCmdLine->GetCount() -1); ++i) + if ( !rsc_stricmp( (char *)pCmdLine->GetEntry( i ), "-verbose" ) ) { - if ( !rsc_stricmp( (char *)pCmdLine->GetEntry( i ), "-verbose" ) ) - { - eVerbosity = RscVerbosityVerbose; - continue; - } - if ( !rsc_stricmp( (char *)pCmdLine->GetEntry( i ), "-quiet" ) ) - { - eVerbosity = RscVerbositySilent; - continue; - } - if( !rsc_strnicmp( (char *)pCmdLine->GetEntry( i ), "-fp=", 4 ) - || !rsc_strnicmp( (char *)pCmdLine->GetEntry( i ), "-fo=", 4 ) - || !rsc_strnicmp( (char *)pCmdLine->GetEntry( i ), "-pp=", 4 ) - || !rsc_strnicmp( (char *)pCmdLine->GetEntry( i ), "-rsc2=", 6 ) - || !rsc_strnicmp( (char *)pCmdLine->GetEntry( i ), "-presponse", 9 ) - || !rsc_strnicmp( (char *)pCmdLine->GetEntry( i ), "-rc", 3 ) - || !rsc_stricmp( (char *)pCmdLine->GetEntry( i ), "-+" ) - || !rsc_stricmp( (char *)pCmdLine->GetEntry( i ), "-br" ) - || !rsc_stricmp( (char *)pCmdLine->GetEntry( i ), "-bz" ) - || !rsc_stricmp( (char *)pCmdLine->GetEntry( i ), "-r" ) - // Am I the only one that thinks the following line inludes all the tests before? - || ( '-' != *(char *)pCmdLine->GetEntry( i ) ) ) - { - } - else - fprintf( fRspFile, "%s ", - (const char *)pCmdLine->GetEntry( i ) ); - }; - - fprintf( fRspFile, "%s", aSrsName.GetBuffer() ); - - for ( size_t i = 0, n = pInputList->size(); i < n; ++i ) + eVerbosity = RscVerbosityVerbose; + continue; + } + if ( !rsc_stricmp( (char *)pCmdLine->GetEntry( i ), "-quiet" ) ) { - pString = (*pInputList)[ i ]; - fprintf( fRspFile, " %s", pString->GetBuffer() ); - }; - - fclose( fRspFile ); + eVerbosity = RscVerbositySilent; + continue; + } + if( !rsc_strnicmp( (char *)pCmdLine->GetEntry( i ), "-fp=", 4 ) + || !rsc_strnicmp( (char *)pCmdLine->GetEntry( i ), "-fo=", 4 ) + || !rsc_strnicmp( (char *)pCmdLine->GetEntry( i ), "-presponse", 9 ) + || !rsc_strnicmp( (char *)pCmdLine->GetEntry( i ), "-rc", 3 ) + || !rsc_stricmp( (char *)pCmdLine->GetEntry( i ), "-+" ) + || !rsc_stricmp( (char *)pCmdLine->GetEntry( i ), "-br" ) + || !rsc_stricmp( (char *)pCmdLine->GetEntry( i ), "-bz" ) + || !rsc_stricmp( (char *)pCmdLine->GetEntry( i ), "-r" ) + || ( '-' != *(char *)pCmdLine->GetEntry( i ) ) ) + { + } + else + aNewCmdL.Append( rsc_strdup( (char *)pCmdLine->GetEntry( i ) ) ); }; - RscPtrPtr aNewCmdL; // Kommandozeile - aNewCmdL.Append( rsc_strdup( aRsc2Name.GetBuffer() ) ); - ByteString aTmpStr( '@' ); - aTmpStr += aRspFileName; - aNewCmdL.Append( rsc_strdup( aTmpStr.GetBuffer() ) ); - aNewCmdL.Append( (void *)0 ); + aNewCmdL.Append( rsc_strdup( aSrsName.GetBuffer() ) ); + + for ( size_t i = 0, n = pInputList->size(); i < n; ++i ) + { + pString = (*pInputList)[ i ]; + aNewCmdL.Append( rsc_strdup( pString->GetBuffer() ) ); + }; if ( eVerbosity >= RscVerbosityVerbose ) { printf( "Rsc2 commandline: " ); - printf( "%s", (const char *)aNewCmdL.GetEntry( 0 ) ); - printf( " " ); - printf( "%s", (const char *)aNewCmdL.GetEntry( 1 ) ); + for( size_t i = 0; i < (unsigned int)(aNewCmdL.GetCount() -1); i++ ) + { + printf( " %s", (const char *)aNewCmdL.GetEntry( i ) ); + } printf( "\n" ); } -#if defined UNX - nExit = spawnvp( P_WAIT, aRsc2Name.GetBuffer(), (char* const*)aNewCmdL.GetBlock() ); -#else - nExit = spawnvp( P_WAIT, (char*)aRsc2Name.GetBuffer(), (const char**)aNewCmdL.GetBlock() ); -#endif + nRet = rsc2_main( aNewCmdL.GetCount(), (char**)aNewCmdL.GetBlock() ); - if( fRspFile ) - #if OSL_DEBUG_LEVEL > 5 - fprintf( stderr, "leaving response file %s\n", aRspFileName.GetBuffer() ); - #else - unlink( aRspFileName.GetBuffer() ); - #endif - if( nExit ) + if( nRet ) return( sal_False ); return( sal_True ); } @@ -288,10 +237,6 @@ SAL_IMPLEMENT_MAIN_WITH_ARGS(argc, argv) sal_Bool bHelp = sal_False; sal_Bool bError = sal_False; sal_Bool bResponse = sal_False; - ByteString aSolarbin(getenv("SOLARBINDIR")); - ByteString aDelim("/"); - ByteString aPrePro; //( aSolarbin + aDelim + ByteString("rscpp")); - ByteString aRsc2Name; //( aSolarbin + aDelim + ByteString("rsc2")); ByteString aSrsName; ByteString aResName; RscStrList aInputList; @@ -302,14 +247,6 @@ SAL_IMPLEMENT_MAIN_WITH_ARGS(argc, argv) sal_uInt32 i; ByteString* pString; - aPrePro = aSolarbin; - aPrePro += aDelim; - aPrePro += ByteString("rscpp"); - - aRsc2Name = aSolarbin; - aRsc2Name += aDelim; - aRsc2Name += ByteString("rsc2"); - pStr = ::ResponseFile( &aCmdLine, argv, argc ); if( pStr ) { @@ -335,17 +272,9 @@ SAL_IMPLEMENT_MAIN_WITH_ARGS(argc, argv) bHelp = sal_True; } else if( !rsc_strnicmp( (*ppStr) + 1, "presponse", 9 ) ) - { // anderer Name fuer den Preprozessor + { // whether to use response file when parameterising preprocessor bResponse = sal_True; } - else if( !rsc_strnicmp( (*ppStr) + 1, "pp=", 3 ) ) - { // anderer Name fuer den Preprozessor - aPrePro = (*ppStr) + 4; - } - else if( !rsc_strnicmp( (*ppStr) + 1, "rsc2=", 5 ) ) - { // Accept alternate name for the rsc2 compiler - aRsc2Name = (*ppStr) + 6; - } else if( !rsc_strnicmp( (*ppStr) + 1, "fo=", 3 ) ) { // anderer Name fuer .res-file aResName = (*ppStr) + 4; @@ -387,7 +316,7 @@ SAL_IMPLEMENT_MAIN_WITH_ARGS(argc, argv) { pString = aInputList[ k ]; aTmpName = ::GetTmpFileName(); - if( !CallPrePro( aPrePro, *pString, aTmpName, &aCmdLine, bResponse ) ) + if( !CallPrePro( *pString, aTmpName, &aCmdLine, bResponse ) ) { printf( "Error starting preprocessor\n" ); bError = sal_True; @@ -399,8 +328,7 @@ SAL_IMPLEMENT_MAIN_WITH_ARGS(argc, argv) if( !bError ) { - if( !CallRsc2( aRsc2Name, bPrePro ? &aTmpList : &aInputList, - aSrsName, &aCmdLine ) ) + if( !CallRsc2( bPrePro ? &aTmpList : &aInputList, aSrsName, &aCmdLine ) ) { if( !bHelp ) { diff --git a/rsc/source/res/rscclass.cxx b/rsc/source/res/rscclass.cxx index 6f2939cd2fd2..8060c3271240 100644 --- a/rsc/source/res/rscclass.cxx +++ b/rsc/source/res/rscclass.cxx @@ -1124,33 +1124,6 @@ ERRTYPE RscSysDepend::WriteRc( const RSCINST & rInst, RscWriteRc & rMem, /************************************************************************* |* -|* RscFirstSysDepend::RscFirstSysDepend() -|* -|* Beschreibung -|* -*************************************************************************/ -RscFirstSysDepend::RscFirstSysDepend( Atom nId, sal_uInt32 nTypeId, - RscTop * pSuper ) - : RscSysDepend( nId, nTypeId, pSuper ) -{} - -/************************************************************************* -|* -|* RscFirstSysDepend::WriteRc() -|* -|* Beschreibung -|* -*************************************************************************/ -ERRTYPE RscFirstSysDepend::WriteRc( const RSCINST & rInst, RscWriteRc & rMem, - RscTypCont * pTC, sal_uInt32 nDeep, sal_Bool bExtra ) -{ - ERRTYPE aError = RscClass::WriteRc( rInst, rMem, pTC, nDeep, bExtra ); - aError = WriteSysDependRc( rInst, rMem, pTC, nDeep, bExtra, sal_True ); - return aError; -} - -/************************************************************************* -|* |* RscTupel::RscTupel() |* |* Beschreibung diff --git a/rsc/source/rsc/rsc.cxx b/rsc/source/rsc/rsc.cxx index f8e308a7a47f..6dbf71c3983c 100644 --- a/rsc/source/rsc/rsc.cxx +++ b/rsc/source/rsc/rsc.cxx @@ -113,18 +113,6 @@ void RscCmdLine::Init() |* Beschreibung Kommandozeile interpretierten |* *************************************************************************/ -RscCmdLine::RscCmdLine() -{ - Init(); -} - -/************************************************************************* -|* -|* RscCmdLine::RscCmdLine() -|* -|* Beschreibung Kommandozeile interpretierten -|* -*************************************************************************/ RscCmdLine::RscCmdLine( int argc, char ** argv, RscError * pEH ) { char * pStr; @@ -1048,39 +1036,6 @@ void RscCompiler::Append( const ByteString& rOutputSrs, } } -/********************************************************************/ -/* */ -/* Function : GetTmpFileName() */ -/* */ -/* Description : Packt einen Dateinamen in Tmp-Dateiliste. */ -/* */ -/********************************************************************/ -ByteString RscCompiler::GetTmpFileName() -{ - ByteString aFileName; - - aFileName = ::GetTmpFileName(); - return( aFileName ); -} - -/********************************************************************/ -/* */ -/* Function : sal_Bool openinput() */ -/* */ -/* Description : Check to see if the input file exists and can */ -/* be opened for reading. */ -/********************************************************************/ - -void RscCompiler::OpenInput( const ByteString& rInput ) -{ - FILE *fp; - /* try to open the input file */ - if( NULL == (fp = fopen( rInput.GetBuffer(), "r"))) - pTC->pEH->FatalError( ERR_OPENFILE, RscId(), rInput.GetBuffer() ); - - fclose( fp ); -} - /************************************************************************* |* |* GetImageFilePath() @@ -1248,7 +1203,7 @@ void RscCompiler::PreprocessSrsFile( const RscCmdLine::OutputFile& rOutputFile, sal_Int32 nNumber = atoi( aLine.GetBuffer() ); if( nNumber < 10000 ) - aBaseFileName += ByteString::CreateFromInt32( 0 ); + aBaseFileName += '0'; if( GetImageFilePath( rOutputFile, rContext, aBaseFileName += aLine , aFilePath, pSysListFile ) ) aEntryVector.push_back( ::std::pair< ByteString, sal_Int32 >( aFilePath, nNumber ) ); @@ -1276,14 +1231,15 @@ void RscCompiler::PreprocessSrsFile( const RscCmdLine::OutputFile& rOutputFile, for( sal_uInt32 i = 0; i < aEntryVector.size(); ++i ) { - ByteString aEntryString( "< \"" ); + rtl::OStringBuffer aEntryString( + RTL_CONSTASCII_STRINGPARAM("< \"")); - aEntryString += aEntryVector[ i ].first; - aEntryString += "\"; "; - aEntryString += ByteString::CreateFromInt32( aEntryVector[ i ].second ); - aEntryString += "; >;"; + aEntryString.append(aEntryVector[i].first); + aEntryString.append(RTL_CONSTASCII_STRINGPARAM("\"; ")); + aEntryString.append(static_cast<sal_Int32>(aEntryVector[ i ].second)); + aEntryString.append(RTL_CONSTASCII_STRINGPARAM("; >;")); - aOStm.WriteLine( aEntryString ); + aOStm.WriteLine(aEntryString.makeStringAndClear()); } aOStm.WriteLine( "};" ); diff --git a/rsc/source/rscpp/cpp.h b/rsc/source/rscpp/cpp.h index 8ec451ab9d3d..ddcecc8114c2 100644 --- a/rsc/source/rscpp/cpp.h +++ b/rsc/source/rscpp/cpp.h @@ -290,9 +290,9 @@ extern SIZES size_table[]; /* For #if sizeof sizes */ #ifdef NOMAIN /* BP */ #ifndef _NO_PROTO -int start_cpp( int argc, char *argv[] ); +int rscpp_main( int argc, char **argv ); #endif -#define MAIN start_cpp /* fuer die cpp.lib muss main() geandert werden */ +#define MAIN rscpp_main /* fuer die cpp.lib muss main() geandert werden */ #else #ifdef WNT #define MAIN __cdecl main diff --git a/rsc/source/rscpp/cpp1.c b/rsc/source/rscpp/cpp1.c index 378adaa17c5e..014a14b1e65d 100644 --- a/rsc/source/rscpp/cpp1.c +++ b/rsc/source/rscpp/cpp1.c @@ -26,6 +26,8 @@ * ************************************************************************/ +#define NOMAIN + #include <stdio.h> #include <ctype.h> #include "cppdef.h" diff --git a/rsc/source/rscpp/makefile.mk b/rsc/source/rscpp/makefile.mk index 2cec0885ffad..980ef451f542 100644 --- a/rsc/source/rscpp/makefile.mk +++ b/rsc/source/rscpp/makefile.mk @@ -57,13 +57,6 @@ OBJFILES= \ $(OBJ)$/cpp5.obj \ $(OBJ)$/cpp6.obj \ -.IF "$(cpp)" == "" -LIBSALCPPRT=$(0) -APP1TARGET= $(TARGET) -APP1LIBS=$(LB)$/$(TARGET).lib -APP1STACK=32768 -.ENDIF - .IF "$(GUI)"=="UNX" CDEFS+=-Dunix .ENDIF @@ -79,12 +72,3 @@ NOOPTFILES=$(OBJ)$/cpp6.obj # --- Targets ------------------------------------------------------ .INCLUDE : target.mk - -cpp1.c: cppdef.h cpp.h -cpp2.c: cppdef.h cpp.h -cpp3.c: cppdef.h cpp.h -cpp4.c: cppdef.h cpp.h -cpp5.c: cppdef.h cpp.h -cpp6.c: cppdef.h cpp.h - - diff --git a/rsc/source/tools/rscdef.cxx b/rsc/source/tools/rscdef.cxx index ad4bab1412a2..8f8754d1b205 100644 --- a/rsc/source/tools/rscdef.cxx +++ b/rsc/source/tools/rscdef.cxx @@ -44,7 +44,6 @@ sal_Bool RscId::bNames = sal_True; |* *************************************************************************/ void RscId::SetNames( sal_Bool bSet ) { bNames = bSet; } -sal_Bool RscId::IsSetNames() { return bNames; } /************************************************************************* |* @@ -170,34 +169,17 @@ RscId::operator sal_Int32() const *************************************************************************/ ByteString RscId::GetName() const { - ByteString aStr; + rtl::OStringBuffer aStr; if ( !aExp.IsNothing() ) { if( bNames ) - aExp.GetMacro( aStr ); + aExp.AppendMacro(aStr); else - aStr = ByteString::CreateFromInt32( GetNumber() ); + aStr.append(GetNumber()); } - return aStr; -} - -/************************************************************************* -|* -|* RscId::GetMacro() -|* -*************************************************************************/ -ByteString RscId::GetMacro() const -{ - ByteString aStr; - - if ( aExp.IsDefinition() ) - aStr = aExp.aExp.pDef->GetMacro(); - else - aExp.GetMacro( aStr ); - - return aStr; + return aStr.makeStringAndClear(); } /****************** R s c D e f i n e ************************************/ @@ -259,27 +241,7 @@ void RscDefine::DefineToNumber() if( pExp ) delete pExp; pExp = NULL; - SetName( ByteString::CreateFromInt32( lId ) ); -} - -/************************************************************************* -|* -|* RscDefine::ChangeMacro() -|* -*************************************************************************/ -void RscDefine::ChangeMacro( RscExpression * pExpression ){ - if( pExp ) - delete pExp; - pExp = pExpression; - pExp->Evaluate( &lId ); -} - -void RscDefine::ChangeMacro( sal_Int32 lIdentifier ){ - if( pExp ){ - delete pExp; - pExp = NULL; - } - lId = lIdentifier; + SetName(rtl::OString::valueOf(lId)); } /************************************************************************* @@ -314,7 +276,7 @@ ByteString RscDefine::GetMacro() { if( pExp ) return pExp->GetMacro(); - return ByteString::CreateFromInt32( lId ); + return rtl::OString::valueOf(lId); } /****************** R s c D e f i n e L i s t ****************************/ @@ -359,35 +321,6 @@ RscDefine * RscDefineList::New( sal_uLong lFileKey, const ByteString & rDefName, return pDef; } -/************************************************************************* -|* -|* RscDefineList::Remove() -|* -*************************************************************************/ -sal_Bool RscDefineList::Remove( RscDefine * pDef ) { - for ( RscSubDefList::iterator it = maList.begin(); it < maList.end(); ++it ) { - if ( *it == pDef ) { - (*it)->DefineToNumber(); - (*it)->DecRef(); - maList.erase( it ); - return sal_True; - } - } - return sal_False; -} - -sal_Bool RscDefineList::Remove( size_t lIndex ) { - if ( lIndex < maList.size() ) { - RscSubDefList::iterator it = maList.begin(); - ::std::advance( it, lIndex ); - (*it)->DefineToNumber(); - (*it)->DecRef(); - maList.erase( it ); - return sal_True; - } - return sal_False; -} - sal_Bool RscDefineList::Remove() { if ( maList.empty() ) return sal_False; @@ -400,29 +333,6 @@ sal_Bool RscDefineList::Remove() { /************************************************************************* |* -|* RscDefineList::Befor() -|* -*************************************************************************/ -sal_Bool RscDefineList::Befor( const RscDefine * pFree, - const RscDefine * pDepend ) -{ - size_t i = 0; - size_t n = maList.size(); - while ( i < n ) { - if ( maList[ i ] == pFree ) { - for ( ++i ; i < n ; ++i ) { - if ( maList[ i ] == pDepend ) { - return sal_True; - } - } - } - ++i; - } - return sal_False; -} - -/************************************************************************* -|* |* RscDefineList::WriteAll() |* *************************************************************************/ @@ -459,23 +369,14 @@ sal_Bool RscExpType::Evaluate( sal_Int32 * plValue ) const{ return sal_True; } -/************************************************************************* -|* -|* RscExpType::GetMacro() -|* -*************************************************************************/ -void RscExpType::GetMacro( ByteString & rStr ) const +void RscExpType::AppendMacro(rtl::OStringBuffer& rStr) const { - ByteString aStr; - if( IsDefinition() ) - { - rStr += aExp.pDef->GetName(); - } + rStr.append(aExp.pDef->GetName()); else if( IsExpression() ) - rStr += aExp.pExp->GetMacro(); + rStr.append(aExp.pExp->GetMacro()); else if( IsNumber() ) - rStr += ByteString::CreateFromInt32( GetLong() ); + rStr.append(GetLong()); } @@ -555,38 +456,38 @@ sal_Bool RscExpression::Evaluate( sal_Int32 * plValue ){ *************************************************************************/ ByteString RscExpression::GetMacro() { - ByteString aLeft; + rtl::OStringBuffer aLeft; // Ausgabeoptimierung if( aLeftExp.IsNothing() ) { if ( '-' == cOperation ) { - aLeft += '('; - aLeft += '-'; + aLeft.append('('); + aLeft.append('-'); } - aRightExp.GetMacro( aLeft ); + aRightExp.AppendMacro(aLeft); if( '-' == cOperation ) - aLeft += ')'; + aLeft.append(')'); } else if( aRightExp.IsNothing() ) - aLeftExp.GetMacro( aLeft ); + aLeftExp.AppendMacro(aLeft); else{ - aLeft += '('; + aLeft.append('('); // linken Zweig auswerten - aLeftExp.GetMacro( aLeft ); + aLeftExp.AppendMacro(aLeft); - aLeft += cOperation; + aLeft.append(cOperation); - aLeft += '('; + aLeft.append('('); // rechten Zweig auswerten - aRightExp.GetMacro( aLeft ); - aLeft += ')'; + aRightExp.AppendMacro(aLeft); + aLeft.append(')'); - aLeft += ')'; + aLeft.append(')'); } - return aLeft; + return aLeft.makeStringAndClear(); } /****************** R s c F i l e ****************************************/ @@ -672,25 +573,6 @@ sal_Bool RscFile :: InsertDependFile( sal_uLong lIncFile, size_t lPos ) return sal_True; } -/************************************************************************* -|* -|* RscFile::RemoveDependFile() -|* -*************************************************************************/ -void RscFile :: RemoveDependFile( sal_uLong lDepFile ) -{ - for ( size_t i = aDepLst.size(); i > 0; ) - { - RscDepend* pDep = aDepLst[ --i ]; - if( pDep->GetFileKey() == lDepFile ) { - RscDependList::iterator it = aDepLst.begin(); - ::std::advance( it, i ); - delete *it; - aDepLst.erase( it ); - } - } -} - /****************** R s c D e f T r e e **********************************/ /************************************************************************* |* @@ -767,10 +649,6 @@ sal_Bool RscDefTree::Evaluate( RscDefine * pDef ){ return sal_True; } -sal_Bool RscDefTree::Evaluate(){ - return Evaluate( pDefRoot ); -} - /****************** R s c F i l e T a b **********************************/ /************************************************************************* |* @@ -828,23 +706,6 @@ RscDefine * RscFileTab::FindDef( const char * pName ){ /************************************************************************* |* -|* RscFileTab::FindDef() -|* -*************************************************************************/ -RscDefine * RscFileTab::FindDef( sal_uLong lFileKey, const ByteString & rName ) -{ - RscDefine * pDef = FindDef( rName ); - - if( pDef ) - //befindet sich das DEFINE in einer Include-Datei in der - //Datei lFileKey - if( Depend( lFileKey, pDef->GetFileKey() ) ) - return pDef; - return NULL; -} - -/************************************************************************* -|* |* RscFileTab::Depend() |* *************************************************************************/ @@ -972,113 +833,6 @@ RscDefine * RscFileTab::NewDef( sal_uLong lFileKey, const ByteString & rDefName, /************************************************************************* |* -|* RscFileTab::IsDefUsed() -|* -*************************************************************************/ -sal_Bool RscFileTab::IsDefUsed( const ByteString & rDefName ) -{ - RscDefine * pDef = FindDef( rDefName ); - - if( pDef ) - return( pDef->GetRefCount() != 2 ); - - return sal_False; -} - -/************************************************************************* -|* -|* RscFileTab::DeleteDef() -|* -*************************************************************************/ -void RscFileTab::DeleteDef( const ByteString & rDefName ) -{ - RscDefine * pDef = FindDef( rDefName ); - RscFile * pFile; - - if( pDef ){ - pFile = GetFile( pDef->GetFileKey() ); - if( pFile ){ - aDefTree.Remove( pDef ); - pFile->aDefLst.Remove( pDef ); - } - }; -} - -/************************************************************************* -|* -|* RscFileTab::ChangeDef() -|* -*************************************************************************/ -sal_Bool RscFileTab::ChangeDef( const ByteString & rDefName, sal_Int32 lId ) -{ - RscDefine * pDef = FindDef( rDefName ); - - if( pDef ){ - pDef->ChangeMacro( lId ); - //alle Macros neu bewerten - return aDefTree.Evaluate(); - }; - return( sal_False ); -} - -/************************************************************************* -|* -|* RscFileTab::ChangeDef() -|* -*************************************************************************/ -sal_Bool RscFileTab::ChangeDef( const ByteString & rDefName, - RscExpression * pExp ) -{ - RscDefine * pDef = FindDef( rDefName ); - RscFile * pFile; - - if( pDef ) - { - pFile = GetFile( pDef->GetFileKey() ); - sal_uLong lPos = 0; - if( pFile ) - lPos = pFile->aDefLst.GetPos( pDef ); - //Macros in den Expressions sind definiert ? - if( TestDef( pDef->GetFileKey(), lPos, pExp ) ){ - pDef->ChangeMacro( pExp ); - //alle Macros neu bewerten - return aDefTree.Evaluate(); - } - }; - - // pExp wird immer Eigentum und muss, wenn es nicht benoetigt wird - // geloescht werden - delete pExp; - - return( sal_False ); -} - -/************************************************************************* -|* -|* RscFileTab::ChangeDefName() -|* -*************************************************************************/ -sal_Bool RscFileTab::ChangeDefName( const ByteString & rDefName, - const ByteString & rNewName ) -{ - RscDefine * pDef = FindDef( rDefName ); - - //Name gefunden ? - if( pDef ){ - // und neuer Name noch nicht bekannt ? - if( !FindDef( pDef->GetFileKey(), rNewName ) ){ - aDefTree.Remove( pDef ); - pDef->SetName( rNewName ); - aDefTree.Insert( pDef ); - return( sal_True ); - } - }; - - return( sal_False ); -} - -/************************************************************************* -|* |* RscFileTab::DeleteFileContext() |* *************************************************************************/ @@ -1099,29 +853,6 @@ void RscFileTab :: DeleteFileContext( sal_uLong lFileKey ){ /************************************************************************* |* -|* RscFileTab::DeleteFile() -|* -*************************************************************************/ -void RscFileTab :: DeleteFile( sal_uLong lFileKey ){ - RscFile * pFName; - - //Defines freigeben - DeleteFileContext( lFileKey ); - - //Schleife ueber alle Abhaengigkeiten - pFName = First(); - while( pFName ){ - pFName->RemoveDependFile( lFileKey ); - pFName = Next(); - }; - - pFName = Remove( lFileKey ); - if( pFName ) - delete pFName; -} - -/************************************************************************* -|* |* RscFileTab::NewCodeFile() |* *************************************************************************/ diff --git a/rsc/source/tools/rsctools.cxx b/rsc/source/tools/rsctools.cxx index ec0931607c44..006b225c04ae 100644 --- a/rsc/source/tools/rsctools.cxx +++ b/rsc/source/tools/rsctools.cxx @@ -177,29 +177,6 @@ sal_Bool Append( ByteString aOutputSrs, ByteString aTmpFile ) /************************************************************************* |* -|* InputFile -|* -|* Beschreibung Haengt Extension an, wenn keine da ist -|* Parameter: pInput, der Input-Dateiname. -|* pExt, die Extension des Ausgabenamens -|* -*************************************************************************/ -ByteString InputFile ( const char * pInput, const char * pExt ) -{ - UniString aUniInput( pInput, RTL_TEXTENCODING_ASCII_US ); - DirEntry aFileName( aUniInput ); - - if ( 0 == aFileName.GetExtension().Len() ) - { - UniString aExt( pExt, RTL_TEXTENCODING_ASCII_US ); - aFileName.SetExtension( aExt ); - } - - return ByteString( aFileName.GetFull(), RTL_TEXTENCODING_ASCII_US ); -} - -/************************************************************************* -|* |* OutputFile |* |* Beschreibung Ersetzt Extension durch eine andere diff --git a/sax/prj/build.lst b/sax/prj/build.lst index 0a8a3789e1d8..940ef70e585c 100644 --- a/sax/prj/build.lst +++ b/sax/prj/build.lst @@ -1,3 +1,4 @@ ax sax : offapi cppuhelper EXPAT:expat comphelper LIBXSLT:libxslt NULL ax sax\prj nmake - all ax_prj NULL +ax sax\test nmake - all ax_test NULL diff --git a/sax/prj/d.lst b/sax/prj/d.lst index 7416200538a6..54fab394e8fc 100644 --- a/sax/prj/d.lst +++ b/sax/prj/d.lst @@ -1 +1,2 @@ +..\%__SRC%\lib\*.a %_DEST%\lib\*.a ..\inc\sax\tools\documenthandleradapter.hxx %_DEST%\inc\sax\tools\documenthandleradapter.hxx diff --git a/sax/source/expatwrap/sax_expat.cxx b/sax/source/expatwrap/sax_expat.cxx index 06258510ceca..34df91a83a26 100644 --- a/sax/source/expatwrap/sax_expat.cxx +++ b/sax/source/expatwrap/sax_expat.cxx @@ -1029,12 +1029,6 @@ using namespace sax_expatwrap; extern "C" { -SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnvironment( - const sal_Char ** ppEnvTypeName, uno_Environment ** /*ppEnv*/ ) -{ - *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; -} - SAL_DLLPUBLIC_EXPORT void * SAL_CALL component_getFactory( const sal_Char * pImplName, void * pServiceManager, void * /*pRegistryKey*/ ) { diff --git a/sax/source/fastparser/facreg.cxx b/sax/source/fastparser/facreg.cxx index e4152cfc1b58..8352b0cf4824 100644 --- a/sax/source/fastparser/facreg.cxx +++ b/sax/source/fastparser/facreg.cxx @@ -35,12 +35,6 @@ Reference< XInterface > SAL_CALL FastSaxSerializer_CreateInstance( const Referen extern "C" { -SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnvironment( - const sal_Char ** ppEnvTypeName, uno_Environment ** /*ppEnv*/ ) -{ - *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; -} - SAL_DLLPUBLIC_EXPORT void * SAL_CALL component_getFactory( const sal_Char * pImplName, void * pServiceManager, void * /*pRegistryKey*/ ) { void * pRet = 0; diff --git a/sax/test/sax/exports.dxp b/sax/test/sax/exports.dxp index ce95ae0f8deb..86214860d555 100644 --- a/sax/test/sax/exports.dxp +++ b/sax/test/sax/exports.dxp @@ -1,3 +1,2 @@ -component_getImplementationEnvironment component_getFactory -component_writeInfo
\ No newline at end of file +component_writeInfo diff --git a/sax/test/sax/testsax.cxx b/sax/test/sax/testsax.cxx index db58f193088f..aad3b9ed5f7c 100644 --- a/sax/test/sax/testsax.cxx +++ b/sax/test/sax/testsax.cxx @@ -786,14 +786,6 @@ using namespace sax_test; extern "C" { - -SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnvironment( - const sal_Char ** ppEnvTypeName, uno_Environment ** ppEnv ) -{ - *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; -} - - sal_Bool SAL_CALL component_writeInfo( void * pServiceManager, void * pRegistryKey ) { diff --git a/sax/test/saxdemo.cxx b/sax/test/saxdemo.cxx index 6aedffcb42b6..b00eb0703672 100644 --- a/sax/test/saxdemo.cxx +++ b/sax/test/saxdemo.cxx @@ -36,6 +36,7 @@ #include <stdio.h> #include <vector> +#include <cstring> #include <com/sun/star/registry/XImplementationRegistration.hpp> #include <com/sun/star/lang/XComponent.hpp> @@ -92,7 +93,7 @@ public: { return readBytes( aData, nMaxBytesToRead ); } - virtual void SAL_CALL skipBytes( sal_Int32 nBytesToSkip ) + virtual void SAL_CALL skipBytes( sal_Int32 /* nBytesToSkip */ ) throw(NotConnectedException, BufferSizeExceededException, IOException, RuntimeException) { // not implemented @@ -107,8 +108,8 @@ public: { // not needed } - sal_Int32 nPos; Sequence< sal_Int8> m_seq; + sal_Int32 nPos; }; //------------------------------- @@ -155,11 +156,11 @@ public: // Error handler Reference < XInterface >() , aSAXParseException ); } - virtual void SAL_CALL fatalError(const Any& aSAXParseException) throw (SAXException, RuntimeException) + virtual void SAL_CALL fatalError(const Any& /* aSAXParseException */) throw (SAXException, RuntimeException) { printf( "Fatal Error !\n" ); } - virtual void SAL_CALL warning(const Any& aSAXParseException) throw (SAXException, RuntimeException) + virtual void SAL_CALL warning(const Any& /* aSAXParseException */) throw (SAXException, RuntimeException) { printf( "Warning !\n" ); } @@ -182,7 +183,7 @@ public: // ExtendedDocumentHandler m_iElementCount, m_iAttributeCount, m_iWhitespaceCount , m_iCharCount ); } - virtual void SAL_CALL startElement(const OUString& aName, + virtual void SAL_CALL startElement(const OUString& /* aName */, const Reference< XAttributeList > & xAttribs) throw (SAXException,RuntimeException) { @@ -190,7 +191,7 @@ public: // ExtendedDocumentHandler m_iAttributeCount += xAttribs->getLength(); } - virtual void SAL_CALL endElement(const OUString& aName) throw (SAXException,RuntimeException) + virtual void SAL_CALL endElement(const OUString& /* aName */) throw (SAXException,RuntimeException) { // ignored } @@ -204,12 +205,12 @@ public: // ExtendedDocumentHandler m_iWhitespaceCount += aWhitespaces.getLength(); } - virtual void SAL_CALL processingInstruction(const OUString& aTarget, const OUString& aData) throw (SAXException,RuntimeException) + virtual void SAL_CALL processingInstruction(const OUString& /* aTarget */, const OUString& /* aData */) throw (SAXException,RuntimeException) { // ignored } - virtual void SAL_CALL setDocumentLocator(const Reference< XLocator> & xLocator) + virtual void SAL_CALL setDocumentLocator(const Reference< XLocator> & /* xLocator */) throw (SAXException,RuntimeException) { // ignored @@ -218,7 +219,7 @@ public: // ExtendedDocumentHandler virtual InputSource SAL_CALL resolveEntity( const OUString& sPublicId, const OUString& sSystemId) - throw (SAXException,RuntimeException) + throw (RuntimeException) { InputSource source; source.sSystemId = sSystemId; @@ -233,13 +234,13 @@ public: // ExtendedDocumentHandler virtual void SAL_CALL startCDATA(void) throw (SAXException,RuntimeException) { } - virtual void SAL_CALL endCDATA(void) throw (SAXException,RuntimeException) + virtual void SAL_CALL endCDATA(void) throw (RuntimeException) { } - virtual void SAL_CALL comment(const OUString& sComment) throw (SAXException,RuntimeException) + virtual void SAL_CALL comment(const OUString& /* sComment */) throw (SAXException,RuntimeException) { } - virtual void SAL_CALL unknown(const OUString& sString) throw (SAXException,RuntimeException) + virtual void SAL_CALL unknown(const OUString& /* sString */) throw (SAXException,RuntimeException) { } @@ -289,13 +290,13 @@ private: struct TagAttribute { TagAttribute(){} - TagAttribute( const OUString &sName, - const OUString &sType , - const OUString &sValue ) + TagAttribute( const OUString &s_Name, + const OUString &s_Type , + const OUString &s_Value ) { - this->sName = sName; - this->sType = sType; - this->sValue = sValue; + this->sName = s_Name; + this->sType = s_Type; + this->sValue = s_Value; } OUString sName; @@ -329,7 +330,7 @@ AttributeListImpl::AttributeListImpl( const AttributeListImpl &r ) OUString AttributeListImpl::getNameByIndex(sal_Int16 i) throw (RuntimeException) { - if( i < m_pImpl->vecAttribute.size() ) { + if( i < sal::static_int_cast<sal_Int16>(m_pImpl->vecAttribute.size()) ) { return m_pImpl->vecAttribute[i].sName; } return OUString(); @@ -338,7 +339,7 @@ OUString AttributeListImpl::getNameByIndex(sal_Int16 i) throw (RuntimeException OUString AttributeListImpl::getTypeByIndex(sal_Int16 i) throw (RuntimeException) { - if( i < m_pImpl->vecAttribute.size() ) { + if( i < sal::static_int_cast<sal_Int16>(m_pImpl->vecAttribute.size()) ) { return m_pImpl->vecAttribute[i].sType; } return OUString(); @@ -346,7 +347,7 @@ OUString AttributeListImpl::getTypeByIndex(sal_Int16 i) throw (RuntimeException OUString AttributeListImpl::getValueByIndex(sal_Int16 i) throw (RuntimeException) { - if( i < m_pImpl->vecAttribute.size() ) { + if( i < sal::static_int_cast<sal_Int16>(m_pImpl->vecAttribute.size()) ) { return m_pImpl->vecAttribute[i].sValue; } return OUString(); @@ -418,11 +419,12 @@ void writeParagraphHelper( { int nMax = s.getLength(); int nStart = 0; + int n = 1; Sequence<sal_uInt16> seq( s.getLength() ); memcpy( seq.getArray() , s.getStr() , s.getLength() * sizeof( sal_uInt16 ) ); - for( int n = 1 ; n < nMax ; n++ ){ + for( n = 1 ; n < nMax ; n++ ){ if( 32 == seq.getArray()[n] ) { r->allowLineBreak(); r->characters( s.copy( nStart , n - nStart ) ); diff --git a/sax/test/testcomponent.cxx b/sax/test/testcomponent.cxx index e395add9f662..c3b3e0a77423 100644 --- a/sax/test/testcomponent.cxx +++ b/sax/test/testcomponent.cxx @@ -82,7 +82,8 @@ int main (int argc, char **argv) OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.registry.ImplementationRegistration")) ); xReg = Reference< XImplementationRegistration > ( x , UNO_QUERY ); } - catch( Exception & ) { + catch (const Exception&) + { printf( "Couldn't create ImplementationRegistration service\n" ); exit(1); } @@ -107,7 +108,8 @@ int main (int argc, char **argv) xSimpleReg ); } } - catch( Exception &e ) { + catch (const Exception &e) + { printf( "Couldn't reach dll %s\n" , szBuf ); printf( "%s\n" , OUStringToOString( e.Message , RTL_TEXTENCODING_ASCII_US ).getStr() ); @@ -134,7 +136,7 @@ int main (int argc, char **argv) aDllName, xSimpleReg ); } - catch( Exception & e ) + catch (const Exception&) { printf( "Couldn't reach dll %s\n" , szBuf ); exit(1); @@ -178,12 +180,13 @@ int main (int argc, char **argv) nNewHandle = xTest->test( OStringToOUString( argv[1] , RTL_TEXTENCODING_ASCII_US ) , x , nHandle ); } - catch( Exception & e ) { + catch (const Exception &e) + { OString o = OUStringToOString( e.Message, RTL_TEXTENCODING_ASCII_US ); printf( "testcomponent : uncaught exception %s\n" , o.getStr() ); exit(1); } - catch( ... ) + catch (...) { printf( "testcomponent : uncaught unknown exception\n" ); exit(1); @@ -195,7 +198,7 @@ int main (int argc, char **argv) Sequence<OUString> seqWarnings = xTest->getWarnings(); if( seqWarnings.getLength() > nWarningCount ) { - printf( "Warnings during test %d!\n" , nHandle ); + printf( "Warnings during test %" SAL_PRIxUINT32 "!\n" , nHandle ); for( ; nWarningCount < seqWarnings.getLength() ; nWarningCount ++ ) { OString o = OUStringToOString( @@ -206,7 +209,7 @@ int main (int argc, char **argv) if( seqErrors.getLength() > nErrorCount ) { - printf( "Errors during test %d!\n" , nHandle ); + printf( "Errors during test %" SAL_PRIxUINT32 "!\n" , nHandle ); for( ; nErrorCount < seqErrors.getLength() ; nErrorCount ++ ) { OString o = OUStringToOString( seqErrors.getArray()[nErrorCount], RTL_TEXTENCODING_ASCII_US ); diff --git a/sot/Library_sot.mk b/sot/Library_sot.mk index 79f94858a688..dc4d1912e2be 100644 --- a/sot/Library_sot.mk +++ b/sot/Library_sot.mk @@ -36,7 +36,11 @@ $(eval $(call gb_Library_set_componentfile,sot,sot/util/sot)) $(eval $(call gb_Library_set_include,sot,\ -I$(realpath $(SRCDIR)/sot/inc/pch) \ $$(INCLUDE) \ - -I$(OUTDIR)/inc/offuh \ +)) + +$(eval $(call gb_Library_add_api,sot,\ + udkapi \ + offapi \ )) $(eval $(call gb_Library_add_defs,sot,\ diff --git a/sot/inc/sot/stg.hxx b/sot/inc/sot/stg.hxx index 2d17974d0a2d..df43ca771e3c 100644 --- a/sot/inc/sot/stg.hxx +++ b/sot/inc/sot/stg.hxx @@ -262,7 +262,6 @@ protected: ~UCBStorageStream(); public: TYPEINFO(); - UCBStorageStream( const String& rName, StreamMode nMode, sal_Bool bDirect, const ByteString* pKey=0 ); UCBStorageStream( const String& rName, StreamMode nMode, sal_Bool bDirect, const ByteString* pKey, sal_Bool bRepair, ::com::sun::star::uno::Reference< ::com::sun::star::ucb::XProgressHandler > xProgress ); UCBStorageStream( UCBStorageStream_Impl* ); diff --git a/sot/inc/sot/storage.hxx b/sot/inc/sot/storage.hxx index e1ce95158b12..9913edaaa40f 100644 --- a/sot/inc/sot/storage.hxx +++ b/sot/inc/sot/storage.hxx @@ -208,9 +208,6 @@ public: SotStorageStream * OpenSotStream( const String & rEleName, StreamMode = STREAM_STD_READWRITE, StorageMode = 0 ); - SotStorageStream * OpenEncryptedSotStream( const String & rEleName, const ByteString& rKey, - StreamMode = STREAM_STD_READWRITE, - StorageMode = 0 ); SotStorage * OpenSotStorage( const String & rEleName, StreamMode = STREAM_STD_READWRITE, StorageMode = STORAGE_TRANSACTED ); @@ -242,9 +239,6 @@ public: static sal_Bool IsOLEStorage( const String & rFileName ); static sal_Bool IsOLEStorage( SvStream* pStream ); - // this is temporary HACK, _MUST_ be removed before release - ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage > - GetUNOAPIDuplicate( const String& rEleName, sal_Int32 nUNOStorageMode ); void RemoveUNOStorageHolder( UNOStorageHolder* pHolder ); static SotStorage* OpenOLEStorage( const com::sun::star::uno::Reference < com::sun::star::embed::XStorage >& xStorage, diff --git a/sot/source/base/factory.cxx b/sot/source/base/factory.cxx index 01d098e62a75..79393375138d 100644 --- a/sot/source/base/factory.cxx +++ b/sot/source/base/factory.cxx @@ -39,6 +39,7 @@ #include <sot/sotdata.hxx> #include <sot/clsids.hxx> #include <rtl/instance.hxx> +#include <rtl/strbuf.hxx> /************** class SotData_Impl *********************************************/ /************************************************************************* @@ -78,9 +79,9 @@ void SotFactory::DeInit() if( pSotData->nSvObjCount ) { #ifdef DBG_UTIL - ByteString aStr( "Objects alive: " ); - aStr.Append( ByteString::CreateFromInt32( pSotData->nSvObjCount ) ); - DBG_WARNING( aStr.GetBuffer() ); + rtl::OStringBuffer aStr(RTL_CONSTASCII_STRINGPARAM("Objects alive: ")); + aStr.append(static_cast<sal_Int32>(pSotData->nSvObjCount)); + DBG_WARNING(aStr.getStr()); #endif return; } diff --git a/sot/source/sdstor/stgdir.cxx b/sot/source/sdstor/stgdir.cxx index 4951daa70a6c..fc9610a6af3b 100644 --- a/sot/source/sdstor/stgdir.cxx +++ b/sot/source/sdstor/stgdir.cxx @@ -853,7 +853,10 @@ void StgDirStrm::SetupEntry( sal_Int32 n, StgDirEntry* pUpper ) } else { - rIo.SetError( SVSTREAM_CANNOT_MAKE ); + // bnc#682484: There are some really broken docs out there + // that contain duplicate entries in 'Directory' section + // so don't set the error flag here and just skip those + // (was: rIo.SetError( SVSTREAM_CANNOT_MAKE );) delete pCur; pCur = NULL; return; } diff --git a/sot/source/sdstor/stgstrms.cxx b/sot/source/sdstor/stgstrms.cxx index fe40be155b9e..48e8de3ede6d 100644 --- a/sot/source/sdstor/stgstrms.cxx +++ b/sot/source/sdstor/stgstrms.cxx @@ -798,7 +798,7 @@ void* StgDataStrm::GetPtr( sal_Int32 Pos, sal_Bool bForce, sal_Bool bDirty ) if( Pos2Page( Pos ) ) { StgPage* pPg = rIo.Get( nPage, bForce ); - if( pPg ) + if (pPg && nOffset < pPg->GetSize()) { pPg->SetOwner( pEntry ); if( bDirty ) diff --git a/sot/source/sdstor/storage.cxx b/sot/source/sdstor/storage.cxx index ef398d081904..50a30d89b45e 100644 --- a/sot/source/sdstor/storage.cxx +++ b/sot/source/sdstor/storage.cxx @@ -744,129 +744,6 @@ void SotStorage::RemoveUNOStorageHolder( UNOStorageHolder* pHolder ) } /************************************************************************* -|* SotStorage::GetUNOAPIDuplicate() -|* -|* Beschreibung -*************************************************************************/ -uno::Reference< embed::XStorage > SotStorage::GetUNOAPIDuplicate( const String& rEleName, sal_Int32 nUNOStorageMode ) -{ - // after we create a duplicate we will register wrapper - // for storage messages, the wrapper will control the real storage - // the real storage will be able to ask the duplicate to dispose if it's parent is disposed - - uno::Reference< embed::XStorage > xResult; - - UCBStorage* pStg = PTR_CAST( UCBStorage, m_pOwnStg ); - if ( !pStg ) - return xResult; - - UNOStorageHolderList* pUNOStorageHolderList = pStg->GetUNOStorageHolderList(); - if ( !pUNOStorageHolderList ) - return xResult; - - for ( UNOStorageHolderList::iterator aIter = pUNOStorageHolderList->begin(); - aIter != pUNOStorageHolderList->end(); ++aIter ) - if ( (*aIter) && (*aIter)->GetStorageName().Equals( rEleName ) ) - { - // the storage is already in use - return xResult; - } - - if ( IsStream( rEleName ) ) - return xResult; - - if ( GetError() == ERRCODE_NONE ) - { - StreamMode nMode = ( ( nUNOStorageMode & embed::ElementModes::WRITE ) == embed::ElementModes::WRITE ) ? - STREAM_WRITE : ( STREAM_READ | STREAM_NOCREATE ); - if ( nUNOStorageMode & embed::ElementModes::NOCREATE ) - nMode |= STREAM_NOCREATE; - - sal_Bool bStorageReady = !IsStorage( rEleName ); - SotStorageRef pChildStorage = OpenUCBStorage( rEleName, nMode, STORAGE_TRANSACTED ); - if ( pChildStorage->GetError() == ERRCODE_NONE && pChildStorage->m_pOwnStg ) - { - ::utl::TempFile* pTempFile = new ::utl::TempFile(); - if ( pTempFile->GetURL().Len() ) - { - if ( !bStorageReady ) - { - UCBStorage* pChildUCBStg = PTR_CAST( UCBStorage, pChildStorage->m_pOwnStg ); - if ( pChildUCBStg ) - { - UCBStorage* pTempStorage = new UCBStorage( pTempFile->GetURL(), STREAM_WRITE, sal_False, sal_True ); - if ( pTempStorage ) - { - pChildUCBStg->CopyTo( pTempStorage ); - - // CopyTo does not transport unknown media type - // just workaround it - uno::Any aMediaType; - - if ( pChildUCBStg->GetProperty( - ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("MediaType")), aMediaType ) ) - pTempStorage->SetProperty( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("MediaType")), aMediaType ); - - bStorageReady = !pChildUCBStg->GetError() && !pTempStorage->GetError() - && pTempStorage->Commit(); - - delete ((BaseStorage*)pTempStorage); - pTempStorage = NULL; - } - } - - OSL_ENSURE( bStorageReady, "Problem on storage copy!\n" ); - } - - if ( bStorageReady ) - { - try { - uno::Reference< lang::XSingleServiceFactory > xStorageFactory( - ::comphelper::getProcessServiceFactory()->createInstance( - ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.embed.StorageFactory")) ), - uno::UNO_QUERY ); - - OSL_ENSURE( xStorageFactory.is(), "Can't create storage factory!\n" ); - if ( xStorageFactory.is() ) - { - uno::Sequence< uno::Any > aArg( 2 ); - aArg[0] <<= ::rtl::OUString( pTempFile->GetURL() ); - aArg[1] <<= nUNOStorageMode; - uno::Reference< embed::XStorage > xDuplStorage( - xStorageFactory->createInstanceWithArguments( aArg ), - uno::UNO_QUERY ); - - OSL_ENSURE( xDuplStorage.is(), "Can't open storage!\n" ); - if ( xDuplStorage.is() ) - { - UNOStorageHolder* pHolder = - new UNOStorageHolder( *this, *pChildStorage, xDuplStorage, pTempFile ); - pHolder->acquire(); - pTempFile = NULL; - pUNOStorageHolderList->push_back( pHolder ); - xResult = xDuplStorage; - } - } - } - catch( uno::Exception& e ) - { - (void)e; - OSL_FAIL( ::rtl::OUStringToOString( e.Message, RTL_TEXTENCODING_ASCII_US ) ); - } - } - } - - if ( pTempFile != NULL ) - delete pTempFile; - } - else - SetError( pChildStorage->GetError() ); - } - - return xResult; -} - -/************************************************************************* |* SotStorage::CreateMemoryStream() |* |* Beschreibung @@ -1110,38 +987,6 @@ sal_Bool SotStorage::Revert() return SVSTREAM_OK == GetError(); } -/************************************************************************* -|* SotStorage::OpenStream() -|* -|* Beschreibung -*************************************************************************/ -SotStorageStream * SotStorage::OpenEncryptedSotStream( const String & rEleName, const ByteString& rKey, - StreamMode nMode, - StorageMode nStorageMode ) -{ - DBG_ASSERT( !nStorageMode, "StorageModes ignored" ); - SotStorageStream * pStm = NULL; - DBG_ASSERT( Owner(), "must be owner" ); - if( m_pOwnStg ) - { - // volle Ole-Patches einschalten - // egal was kommt, nur exclusiv gestattet - nMode |= STREAM_SHARE_DENYALL; - ErrCode nE = m_pOwnStg->GetError(); - BaseStorageStream* p = m_pOwnStg->OpenStream( rEleName, nMode, - (nStorageMode & STORAGE_TRANSACTED) ? sal_False : sal_True, &rKey ); - pStm = new SotStorageStream( p ); - - if( !nE ) - m_pOwnStg->ResetError(); // kein Fehler setzen - if( nMode & STREAM_TRUNC ) - pStm->SetSize( 0 ); - } - else - SetError( SVSTREAM_GENERALERROR ); - return pStm; -} - SotStorageStream * SotStorage::OpenSotStream( const String & rEleName, StreamMode nMode, StorageMode nStorageMode ) diff --git a/sot/source/sdstor/ucbstorage.cxx b/sot/source/sdstor/ucbstorage.cxx index 198a6572dec3..dfc5024889a3 100644 --- a/sot/source/sdstor/ucbstorage.cxx +++ b/sot/source/sdstor/ucbstorage.cxx @@ -1336,15 +1336,6 @@ void UCBStorageStream_Impl::PrepareCachedForReopen( StreamMode nMode ) } } -UCBStorageStream::UCBStorageStream( const String& rName, StreamMode nMode, sal_Bool bDirect, const ByteString* pKey ) -{ - // pImp must be initialized in the body, because otherwise the vtable of the stream is not initialized - // to class UCBStorageStream ! - pImp = new UCBStorageStream_Impl( rName, nMode, this, bDirect, pKey ); - pImp->AddRef(); // use direct refcounting because in header file only a pointer should be used - StorageBase::m_nMode = pImp->m_nMode; -} - UCBStorageStream::UCBStorageStream( const String& rName, StreamMode nMode, sal_Bool bDirect, const ByteString* pKey, sal_Bool bRepair, Reference< XProgressHandler > xProgress ) { // pImp must be initialized in the body, because otherwise the vtable of the stream is not initialized @@ -3275,7 +3266,7 @@ sal_Bool UCBStorage::IsStorageFile( SvStream* pFile ) return sal_False; pFile->Seek(0); - sal_uInt32 nBytes; + sal_uInt32 nBytes(0); *pFile >> nBytes; // search for the magic bytes @@ -3286,6 +3277,7 @@ sal_Bool UCBStorage::IsStorageFile( SvStream* pFile ) bRet = ( nBytes == 0x08074b50 ); if ( bRet ) { + nBytes = 0; *pFile >> nBytes; bRet = ( nBytes == 0x04034b50 ); } diff --git a/sot/source/unoolestorage/register.cxx b/sot/source/unoolestorage/register.cxx index 696e0cefed93..2738a8054af3 100644 --- a/sot/source/unoolestorage/register.cxx +++ b/sot/source/unoolestorage/register.cxx @@ -41,12 +41,7 @@ using namespace ::com::sun::star; extern "C" { -SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnvironment( const sal_Char ** ppEnvTypeName, uno_Environment ** /*ppEnv*/ ) -{ - *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; -} - -SAL_DLLPUBLIC_EXPORT void * SAL_CALL component_getFactory( const sal_Char * pImplName, void * pServiceManager, void * /*pRegistryKey*/ ) +SAL_DLLPUBLIC_EXPORT void * SAL_CALL sot_component_getFactory( const sal_Char * pImplName, void * pServiceManager, void * /*pRegistryKey*/ ) { void * pRet = 0; diff --git a/sot/util/sot.component b/sot/util/sot.component index 7d17c7d54475..44ca8cea7a9a 100644 --- a/sot/util/sot.component +++ b/sot/util/sot.component @@ -26,7 +26,7 @@ * **********************************************************************--> -<component loader="com.sun.star.loader.SharedLibrary" +<component loader="com.sun.star.loader.SharedLibrary" prefix="sot" xmlns="http://openoffice.org/2010/uno-components"> <implementation name="com.sun.star.comp.embed.OLESimpleStorage"> <service name="com.sun.star.embed.OLESimpleStorage"/> diff --git a/svl/Library_fsstorage.mk b/svl/Library_fsstorage.mk index 3e27ae8f4357..121049b9cff7 100644 --- a/svl/Library_fsstorage.mk +++ b/svl/Library_fsstorage.mk @@ -37,10 +37,14 @@ $(eval $(call gb_Library_set_include,fsstorage,\ -I$(realpath $(SRCDIR)/svl/inc/svl) \ -I$(realpath $(SRCDIR)/svl/source/inc) \ -I$(realpath $(SRCDIR)/svl/inc/pch) \ - -I$(OUTDIR)/inc/offuh \ -I$(OUTDIR)/inc \ )) +$(eval $(call gb_Library_add_api,fsstorage,\ + udkapi \ + offapi \ +)) + $(eval $(call gb_Library_add_linked_libs,fsstorage,\ comphelper \ cppu \ diff --git a/svl/Library_passwordcontainer.mk b/svl/Library_passwordcontainer.mk index 58b4b6edb6a7..3826dca597dd 100644 --- a/svl/Library_passwordcontainer.mk +++ b/svl/Library_passwordcontainer.mk @@ -37,10 +37,14 @@ $(eval $(call gb_Library_set_include,passwordcontainer,\ -I$(realpath $(SRCDIR)/svl/inc/svl) \ -I$(realpath $(SRCDIR)/svl/source/inc) \ -I$(realpath $(SRCDIR)/svl/inc/pch) \ - -I$(OUTDIR)/inc/offuh \ -I$(OUTDIR)/inc \ )) +$(eval $(call gb_Library_add_api,passwordcontainer,\ + udkapi \ + offapi \ +)) + $(eval $(call gb_Library_add_linked_libs,passwordcontainer,\ cppu \ cppuhelper \ diff --git a/svl/Library_svl.mk b/svl/Library_svl.mk index d1996dc0dc52..08988c41f681 100644 --- a/svl/Library_svl.mk +++ b/svl/Library_svl.mk @@ -37,7 +37,12 @@ $(eval $(call gb_Library_set_include,svl,\ $$(SOLARINC) \ -I$(realpath $(SRCDIR)/svl/source/inc) \ -I$(realpath $(SRCDIR)/svl/inc/pch) \ - -I$(OUTDIR)/inc/offuh \ + -I$(SRCDIR)/svl/inc/pch \ +)) + +$(eval $(call gb_Library_add_api,svl,\ + udkapi \ + offapi \ )) $(eval $(call gb_Library_add_defs,svl,\ diff --git a/svl/inc/svl/adrparse.hxx b/svl/inc/svl/adrparse.hxx index dbb671889ec3..e9f479af9e09 100644 --- a/svl/inc/svl/adrparse.hxx +++ b/svl/inc/svl/adrparse.hxx @@ -67,28 +67,6 @@ public: inline UniString const & GetEmailAddress(sal_Int32 nIndex) const; inline UniString const &GetRealName(sal_Int32 nIndex) const; - - /** Create an RFC 822 <mailbox> (i.e., 'e-mail address'). - - @param rPhrase Either an empty string (the <mailbox> will have no - <phrase> an will be of the form <addr-spec>), or some text that will - become the <phrase> part of a <phrase route-addr> form <mailbox>. Non - US-ASCII characters within the text are put into a <qouted-string> - verbatim, so the result may actually not be a valid RFC 822 <mailbox>, - but a more human-readable representation. - - @param rAddrSpec A valid RFC 822 <addr-spec>. (An RFC 822 <mailbox> - including a <route> cannot be created by this method.) - - @param rMailbox If this method returns true, this parameter returns - the created RFC 822 <mailbox> (rather, a more human-readable - representation thereof). Otherwise, this parameter is not modified. - - @return True, if rAddrSpec is a valid RFC 822 <addr-spec>. - */ - static bool createRFC822Mailbox(String const & rPhrase, - String const & rAddrSpec, - String & rMailbox); }; inline UniString const & SvAddressParser::GetEmailAddress(sal_Int32 nIndex) diff --git a/svl/inc/svl/httpcook.hxx b/svl/inc/svl/httpcook.hxx index 2d5d434592af..40bf4e408015 100644 --- a/svl/inc/svl/httpcook.hxx +++ b/svl/inc/svl/httpcook.hxx @@ -33,6 +33,7 @@ #include <tools/stream.hxx> #include <tools/string.hxx> #include <svl/poolitem.hxx> +#include <vector> /*======================================================================= * @@ -132,21 +133,28 @@ enum CntHTTPCookieRequestType CNTHTTP_COOKIE_REQUEST_SEND }; +typedef ::std::vector< CntHTTPCookie* > CntHTTPCookieList_impl; + struct CntHTTPCookieRequest { - const String& m_rURL; - List& m_rCookieList; - CntHTTPCookieRequestType m_eType; - sal_uInt16 m_nRet; + const String& m_rURL; + CntHTTPCookieList_impl& m_rCookieList; + CntHTTPCookieRequestType m_eType; + sal_uInt16 m_nRet; CntHTTPCookieRequest ( const String& rURL, - List& rCookieList, + CntHTTPCookieList_impl& rCookieList, CntHTTPCookieRequestType eType) : m_rURL (rURL), m_rCookieList (rCookieList), m_eType(eType), m_nRet (CNTHTTP_COOKIE_POLICY_BANNED) {} + ~CntHTTPCookieRequest() { + for ( size_t i = 0, n = m_rCookieList.size(); i < n; ++i ) { + delete m_rCookieList[ i ]; + } + } }; #endif // SVTOOLS_HTTPCOOK_HXX diff --git a/svl/inc/svl/ilstitem.hxx b/svl/inc/svl/ilstitem.hxx index a0527cec556c..2973c066c4d8 100644 --- a/svl/inc/svl/ilstitem.hxx +++ b/svl/inc/svl/ilstitem.hxx @@ -32,8 +32,7 @@ #include "svl/svldllapi.h" #include <svl/poolitem.hxx> #include <com/sun/star/uno/Sequence.hxx> - -class SvULongs; +#include <vector> class SVL_DLLPUBLIC SfxIntegerListItem : public SfxPoolItem { @@ -43,7 +42,8 @@ public: TYPEINFO(); SfxIntegerListItem(); - SfxIntegerListItem( sal_uInt16 nWhich, const SvULongs& rList ); + SfxIntegerListItem( sal_uInt16 nWhich, const ::std::vector < sal_Int32 >& rList ); + SfxIntegerListItem( sal_uInt16 nWhich, const ::com::sun::star::uno::Sequence < sal_Int32 >& rList ); SfxIntegerListItem( const SfxIntegerListItem& rItem ); ~SfxIntegerListItem(); @@ -52,7 +52,7 @@ public: ::com::sun::star::uno::Sequence < sal_Int32 > GetConstSequence() const { return SAL_CONST_CAST(SfxIntegerListItem *, this)->GetSequence(); } - void GetList( SvULongs& rList ) const; + void GetList( ::std::vector < sal_Int32 >& rList ) const; virtual int operator==( const SfxPoolItem& ) const; virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const; diff --git a/svl/inc/svl/inettype.hxx b/svl/inc/svl/inettype.hxx index 3abe09c0e37c..f88373dd5303 100644 --- a/svl/inc/svl/inettype.hxx +++ b/svl/inc/svl/inettype.hxx @@ -352,8 +352,6 @@ enum INetContentType class SVL_DLLPUBLIC INetContentTypes { public: - static void Uninitialize(); - static INetContentType RegisterContentType(UniString const & rTypeName, UniString const & rPresentation, @@ -369,8 +367,6 @@ public: static UniString GetPresentation(INetContentType eTypeID, const ::com::sun::star::lang::Locale& aLocale); - static UniString GetExtension(UniString const & rTypeName); - static INetContentType GetContentType4Extension(UniString const & rExtension); @@ -379,40 +375,6 @@ public: static bool GetExtensionFromURL(UniString const & rURL, UniString & rExtension); - static INetContentType MapStringToContentType(UniString const & - rPresentation); - - /** Parse the body of an RFC 2045 Content-Type header field. - - @param rMediaType The body of the Content-Type header field. It must - be of the form - - token "/" token *(";" token "=" (token / quoted-string)) - - with intervening linear white space and comments (cf. RFCs 822, 2045). - The RFC 2231 extension are supported. The encoding of rMediaType - should be US-ASCII, but any values in the range 0x80--0xFF are - interpretet 'as appropriate.' - - @param rType Returns the type (the first of the above tokens), in US- - ASCII encoding and converted to lower case. - - @param rSubType Returns the sub type (the second of the above - tokens), in US-ASCII encoding and converted to lower case. - - @param rParameters If not null, returns the parameters as a list of - INetContentTypeParameters (the attributes are in US-ASCII encoding and - converted to lower case, the values are in Unicode encoding). If - null, only the syntax of the parameters is checked, but they are not - returned. - - @return True if the syntax of the field body is correct. If false is - returned, none of the output parameters will be modified! - */ - static bool parse(ByteString const & rMediaType, ByteString & rType, - ByteString & rSubType, - INetContentTypeParameterList * pParameters = 0); - /** Parse the body of an RFC 2045 Content-Type header field. @param rMediaType The body of the Content-Type header field. It must @@ -443,42 +405,6 @@ public: static bool parse(UniString const & rMediaType, UniString & rType, UniString & rSubType, INetContentTypeParameterList * pParameters = 0); - - /** Append a parameter to the string representation of a MIME media type. - - @param rMediaType The string representation of a MIME media type. - - @param rAttribute The name of the parameter. Must be a valid RFC - 2045 token. - - @param rValue The value of the paramter. Must only consist of US- - ASCII characters. - - @return The string representation of rMediaType with the new - parameter appended. It is not checked whether a parameter with that - name already existed in rMediaType. - */ - static ByteString appendUSASCIIParameter(ByteString const & rMediaType, - ByteString const & rAttribute, - ByteString const & rValue); - - /** Append a parameter to the string representation of a MIME media type. - - @param rMediaType The string representation of a MIME media type. - - @param rAttribute The name of the parameter. Must be a valid RFC - 2045 token. - - @param rValue The value of the paramter. Must only consist of US- - ASCII characters. - - @return The string representation of rMediaType with the new - parameter appended. It is not checked whether a parameter with that - name already existed in rMediaType. - */ - static UniString appendUSASCIIParameter(UniString const & rMediaType, - UniString const & rAttribute, - UniString const & rValue); }; #endif // _INETTYPE_HXX diff --git a/svl/inc/svl/itempool.hxx b/svl/inc/svl/itempool.hxx index 3cec7f75dee2..bceedeee1591 100644 --- a/svl/inc/svl/itempool.hxx +++ b/svl/inc/svl/itempool.hxx @@ -266,7 +266,6 @@ public: sal_uInt16 GetFileFormatVersion() const { return _nFileFormatVersion; } void SetFileFormatVersion( sal_uInt16 nFileFormatVersion ); - sal_uInt16 GetLoadingVersion() const; bool IsCurrentVersionLoading() const; static int IsWhich(sal_uInt16 nId) { diff --git a/svl/inc/svl/ownlist.hxx b/svl/inc/svl/ownlist.hxx index 6bb9f311119b..ea1fc3842f4d 100644 --- a/svl/inc/svl/ownlist.hxx +++ b/svl/inc/svl/ownlist.hxx @@ -61,19 +61,6 @@ public: } const String & GetCommand() const { return aCommand; } const String & GetArgument() const { return aArgument; } - - friend SvStream& operator >> ( SvStream& rStm, SvCommand & rThis ) - { - rStm.ReadByteString( rThis.aCommand, gsl_getSystemTextEncoding() ); - rStm.ReadByteString( rThis.aArgument, gsl_getSystemTextEncoding() ); - return rStm; - } - friend SvStream& operator << ( SvStream& rStm, const SvCommand & rThis ) - { - rStm.WriteByteString( rThis.aCommand, gsl_getSystemTextEncoding() ); - rStm.WriteByteString( rThis.aArgument, gsl_getSystemTextEncoding() ); - return rStm; - } }; typedef ::std::vector< SvCommand > SvCommandList_impl; @@ -98,9 +85,6 @@ public: sal_Bool FillFromSequence( const com::sun::star::uno::Sequence < com::sun::star::beans::PropertyValue >& ); void FillSequence( com::sun::star::uno::Sequence < com::sun::star::beans::PropertyValue >& ); - SVL_DLLPUBLIC friend SvStream& operator >> ( SvStream& rStm, SvCommandList & ); - SVL_DLLPUBLIC friend SvStream& operator << ( SvStream&, const SvCommandList & ); - size_t size() const { return aCommandList.size(); } SvCommand operator[]( size_t i) { diff --git a/svl/inc/svl/style.hxx b/svl/inc/svl/style.hxx index 615d5d690aba..a6f0ca59cb2d 100644 --- a/svl/inc/svl/style.hxx +++ b/svl/inc/svl/style.hxx @@ -54,7 +54,7 @@ class SvStream; /* Everyone changing instances of SfxStyleSheetBasePool or SfxStyleSheetBase -mußt broadcast this using <SfxStyleSheetBasePool::GetBroadcaster()> broadcasten. +must broadcast this using <SfxStyleSheetBasePool::GetBroadcaster()> broadcasts. The class <SfxStyleSheetHint> is used for this, it contains an Action-Id and a pointer to the <SfxStyleSheetBase>. The actions are: diff --git a/svl/inc/svl/svstdarr.hxx b/svl/inc/svl/svstdarr.hxx index 0d46662237d4..bfeeb35d1c79 100644 --- a/svl/inc/svl/svstdarr.hxx +++ b/svl/inc/svl/svstdarr.hxx @@ -93,31 +93,11 @@ SV_DECL_PTRARR_VISIBILITY( SvByteStrings, ByteStringPtr, 1, 1, SVL_DLLPUBLIC ) #define _SVSTDARR_BYTESTRINGS_DECL #endif -#ifndef _SVSTDARR_BYTESTRINGSDTOR_DECL -SV_DECL_PTRARR_DEL_VISIBILITY( SvByteStringsDtor, ByteStringPtr, 1, 1, SVL_DLLPUBLIC ) -#define _SVSTDARR_BYTESTRINGSDTOR_DECL -#endif - -#ifndef _SVSTDARR_BYTESTRINGSSORT_DECL -SV_DECL_PTRARR_SORT_VISIBILITY( SvByteStringsSort, ByteStringPtr, 1, 1, SVL_DLLPUBLIC ) -#define _SVSTDARR_BYTESTRINGSSORT_DECL -#endif - #ifndef _SVSTDARR_BYTESTRINGSSORTDTOR_DECL SV_DECL_PTRARR_SORT_DEL_VISIBILITY( SvByteStringsSortDtor, ByteStringPtr, 1, 1, SVL_DLLPUBLIC ) #define _SVSTDARR_BYTESTRINGSSORTDTOR_DECL #endif -#ifndef _SVSTDARR_BYTESTRINGSISORT_DECL -SV_DECL_PTRARR_SORT_VISIBILITY( SvByteStringsISort, ByteStringPtr, 1, 1, SVL_DLLPUBLIC ) -#define _SVSTDARR_BYTESTRINGSISORT_DECL -#endif - -#ifndef _SVSTDARR_BYTESTRINGSISORTDTOR_DECL -SV_DECL_PTRARR_SORT_DEL_VISIBILITY( SvByteStringsISortDtor, ByteStringPtr, 1, 1, SVL_DLLPUBLIC ) -#define _SVSTDARR_BYTESTRINGSISORTDTOR_DECL -#endif - typedef std::deque< xub_StrLen > SvXub_StrLens; /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/inc/svl/urihelper.hxx b/svl/inc/svl/urihelper.hxx index 3baab37f7896..61be9f6c831d 100644 --- a/svl/inc/svl/urihelper.hxx +++ b/svl/inc/svl/urihelper.hxx @@ -42,7 +42,6 @@ namespace com { namespace sun { namespace star { namespace uri { class XUriReference; } } } } namespace rtl { class OUString; } -class ByteString; class CharClass; class UniString; @@ -64,33 +63,6 @@ namespace URIHelper { */ SVL_DLLPUBLIC UniString SmartRel2Abs(INetURLObject const & rTheBaseURIRef, - ByteString const & rTheRelURIRef, - Link const & rMaybeFileHdl = Link(), - bool bCheckFileExists = true, - bool bIgnoreFragment = false, - INetURLObject::EncodeMechanism eEncodeMechanism - = INetURLObject::WAS_ENCODED, - INetURLObject::DecodeMechanism eDecodeMechanism - = INetURLObject::DECODE_TO_IURI, - rtl_TextEncoding eCharset = RTL_TEXTENCODING_UTF8, - bool bRelativeNonURIs = false, - INetURLObject::FSysStyle eStyle = INetURLObject::FSYS_DETECT); - -/** - @ATT - Calling this function with defaulted arguments rMaybeFileHdl = Link() and - bCheckFileExists = true often leads to results that are not intended: - Whenever the given rTheBaseURIRef is a file URL, the given rTheRelURIRef is - relative, and rTheRelURIRef could also be smart-parsed as a non-file URL - (e.g., the relative URL "foo/bar" can be smart-parsed as "http://foo/bar"), - then SmartRel2Abs called with rMaybeFileHdl = Link() and bCheckFileExists = - true returns the non-file URL interpretation. To avoid this, either pass - some non-null rMaybeFileHdl if you want to check generated file URLs for - existence (see URIHelper::GetMaybeFileHdl), or use bCheckFileExists = false - if you want to generate file URLs without checking for their existence. -*/ -SVL_DLLPUBLIC UniString -SmartRel2Abs(INetURLObject const & rTheBaseURIRef, UniString const & rTheRelURIRef, Link const & rMaybeFileHdl = Link(), bool bCheckFileExists = true, @@ -205,32 +177,6 @@ removePassword(UniString const & rURI, INetURLObject::DecodeMechanism eDecodeMechanism = INetURLObject::DECODE_TO_IURI, rtl_TextEncoding eCharset = RTL_TEXTENCODING_UTF8); - -//============================================================================ -/** Query the notational conventions used in the file system provided by some - file content provider. - - @param rFileUrl This file URL determines which file content provider is - used to query the desired information. (The UCB's usual mapping from URLs - to content providers is used.) - - @param bAddConvenienceStyles If true, the return value contains not only - the style bit corresponding to the queried content provider's conventions, - but may also contain additional style bits that make using this function - more convenient in certain situations. Currently, the effect is that - FSYS_UNX is extended with FSYS_VOS, and both FSYS_DOS and FSYS_MAC are - extended with FSYS_VOS and FSYS_UNX (i.e., the---unambiguous---detection - of VOS style and Unix style file system paths is always enabled); also, in - case the content provider's conventions cannot be determined, FSYS_DETECT - is returned instead of FSysStyle(0). - - @return The style bit corresponding to the queried content provider's - conventions, or FSysStyle(0) if these cannot be determined. - */ -SVL_DLLPUBLIC INetURLObject::FSysStyle queryFSysStyle(UniString const & rFileUrl, - bool bAddConvenienceStyles = true) - throw (com::sun::star::uno::RuntimeException); - } #endif // SVTOOLS_URIHELPER_HXX diff --git a/svl/prj/build.lst b/svl/prj/build.lst index 67366a6aee68..5fc7d0e223a3 100644 --- a/svl/prj/build.lst +++ b/svl/prj/build.lst @@ -1,3 +1,3 @@ -sl svl : TRANSLATIONS:translations rsc offuh ucbhelper unotools cppu cppuhelper comphelper sal sot LIBXSLT:libxslt NULL +sl svl : TRANSLATIONS:translations DESKTOP:rsc offapi ucbhelper unotools cppu cppuhelper comphelper sal sot LIBXSLT:libxslt NULL sl svl\prj nmake - all svl_prj NULL # sl svl\qa\unit nmake - all svl_qa_cppunit svl_util NULL diff --git a/svl/qa/complex/ConfigItems/helper/ConfigItemTest.cxx b/svl/qa/complex/ConfigItems/helper/ConfigItemTest.cxx index 3172fd9322d6..a287fa499886 100644 --- a/svl/qa/complex/ConfigItems/helper/ConfigItemTest.cxx +++ b/svl/qa/complex/ConfigItems/helper/ConfigItemTest.cxx @@ -222,13 +222,6 @@ static ::cppu::ImplementationEntry const lRegEntries[] = }; //============================================================================= -extern "C" SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnvironment(const char** pEnvTypeName, - uno_Environment** ) -{ - *pEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; -} - -//============================================================================= extern "C" SAL_DLLPUBLIC_EXPORT void * SAL_CALL component_getFactory(const char* sImplName , void* pServiceManager, void* pRegistryKey ) diff --git a/svl/source/fsstor/fsfactory.cxx b/svl/source/fsstor/fsfactory.cxx index a641a5d80c04..61a8f7f15048 100644 --- a/svl/source/fsstor/fsfactory.cxx +++ b/svl/source/fsstor/fsfactory.cxx @@ -235,13 +235,7 @@ uno::Sequence< ::rtl::OUString > SAL_CALL FSStorageFactory::getSupportedServiceN extern "C" { -SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnvironment ( - const sal_Char ** ppEnvTypeName, uno_Environment ** /* ppEnv */) -{ - *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; -} - -SAL_DLLPUBLIC_EXPORT void * SAL_CALL component_getFactory ( +SAL_DLLPUBLIC_EXPORT void * SAL_CALL fsstorage_component_getFactory ( const sal_Char * pImplementationName, void * pServiceManager, void * /* pRegistryKey */) { void * pResult = 0; diff --git a/svl/source/fsstor/fsstorage.component b/svl/source/fsstor/fsstorage.component index 3ef0be825972..f9f08487b8a5 100644 --- a/svl/source/fsstor/fsstorage.component +++ b/svl/source/fsstor/fsstorage.component @@ -26,7 +26,7 @@ * **********************************************************************--> -<component loader="com.sun.star.loader.SharedLibrary" +<component loader="com.sun.star.loader.SharedLibrary" prefix="fsstorage" xmlns="http://openoffice.org/2010/uno-components"> <implementation name="com.sun.star.comp.embed.FileSystemStorageFactory"> <service name="com.sun.star.comp.embed.FileSystemStorageFactory"/> diff --git a/svl/source/items/ilstitem.cxx b/svl/source/items/ilstitem.cxx index f8d575b52175..dbf8825e90ba 100644 --- a/svl/source/items/ilstitem.cxx +++ b/svl/source/items/ilstitem.cxx @@ -35,20 +35,25 @@ #include <svl/ilstitem.hxx> -#define _SVSTDARR_ULONGS -#include <svl/svstdarr.hxx> - TYPEINIT1_AUTOFACTORY(SfxIntegerListItem, SfxPoolItem); SfxIntegerListItem::SfxIntegerListItem() { } -SfxIntegerListItem::SfxIntegerListItem( sal_uInt16 which, const SvULongs& rList ) +SfxIntegerListItem::SfxIntegerListItem( sal_uInt16 which, const ::std::vector < sal_Int32 >& rList ) + : SfxPoolItem( which ) +{ + m_aList.realloc( rList.size() ); + for ( sal_uInt16 n=0; n<rList.size(); ++n ) + m_aList[n] = rList[n]; +} + +SfxIntegerListItem::SfxIntegerListItem( sal_uInt16 which, const ::com::sun::star::uno::Sequence < sal_Int32 >& rList ) : SfxPoolItem( which ) { - m_aList.realloc( rList.Count() ); - for ( sal_uInt16 n=0; n<rList.Count(); n++ ) + m_aList.realloc( rList.getLength() ); + for ( sal_Int32 n=0; n<rList.getLength(); ++n ) m_aList[n] = rList[n]; } @@ -97,10 +102,11 @@ bool SfxIntegerListItem::QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 ) return true; } -void SfxIntegerListItem::GetList( SvULongs& rList ) const +void SfxIntegerListItem::GetList( ::std::vector< sal_Int32 >& rList ) const { - for ( sal_Int32 n=0; n<m_aList.getLength(); n++ ) - rList.Insert( m_aList[n], sal::static_int_cast< sal_uInt16 >(n) ); + rList.reserve( m_aList.getLength() ); + for ( sal_Int32 n=0; n<m_aList.getLength(); ++n ) + rList.push_back( m_aList[n] ); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/source/items/poolio.cxx b/svl/source/items/poolio.cxx index d75560f5a26d..4811340af938 100644 --- a/svl/source/items/poolio.cxx +++ b/svl/source/items/poolio.cxx @@ -1324,7 +1324,6 @@ void SfxItemPool::SetVersionMap <SfxItemPool::IsLoadingVersionCurrent()const> <SfxItemPool::GetNewWhich(sal_uInt16)> <SfxItemPool::GetVersion()const> - <SfxItemPool::GetLoadingVersion()const> */ { @@ -1381,7 +1380,6 @@ sal_uInt16 SfxItemPool::GetNewWhich <SfxItemPool::IsLoadingVersionCurrent()const> <SfxItemPool::SetVersionMap(sal_uInt16,sal_uInt16,sal_uInt16,sal_uInt16*)> <SfxItemPool::GetVersion()const> - <SfxItemPool::GetLoadingVersion()const> */ { @@ -1470,7 +1468,6 @@ bool SfxItemPool::IsCurrentVersionLoading() const <SfxItemPool::SetVersionMap(sal_uInt16,sal_uInt16,sal_uInt16,sal_uInt16*)> <SfxItemPool::GetNewWhich(sal_uInt16)const> <SfxItemPool::GetVersion()const> - <SfxItemPool::GetLoadingVersion()const> */ { @@ -1503,7 +1500,6 @@ sal_uInt16 SfxItemPool::GetVersion() const <SfxItemPool::IsLoadingVersionCurrent()const> <SfxItemPool::SetVersionMap(sal_uInt16,sal_uInt16,sal_uInt16,sal_uInt16*)> <SfxItemPool::GetNewWhich(sal_uInt16)const> - <SfxItemPool::GetLoadingVersion()const> */ { @@ -1512,36 +1508,6 @@ sal_uInt16 SfxItemPool::GetVersion() const // ----------------------------------------------------------------------- -sal_uInt16 SfxItemPool::GetLoadingVersion() const - -/* [Beschreibung] - - Diese Methode liefert die Versionsnummer des SfxItemPool-Aufbaus - (also des Which-Bereichs), die bei Laden vorgefunden wurde. - - Precondition: Pool mu\s geladen sein - Postcondition: unver"andert - Laufzeit: 2 - - - [Anmerkung] - - Achtung: Es mu\s ggf. die Versionsnummer von Sekund"arpools - ber"ucksichtigt werden. - - - [Querverweise] - - <SfxItemPool::IsLoadingVersionCurrent()const> - <SfxItemPool::SetVersionMap(sal_uInt16,sal_uInt16,sal_uInt16,sal_uInt16*)> - <SfxItemPool::GetNewWhich(sal_uInt16)const> - <SfxItemPool::GetVersion()const> -*/ - -{ - return pImp->nLoadingVersion; -} - //------------------------------------------------------------------------- bool SfxItemPool::IsVer2_Impl() const diff --git a/svl/source/items/style.cxx b/svl/source/items/style.cxx index 815247cb4724..2bfbfc40b269 100644 --- a/svl/source/items/style.cxx +++ b/svl/source/items/style.cxx @@ -1153,8 +1153,8 @@ sal_Bool SfxStyleSheetBasePool::Store( SvStream& rStream, sal_Bool bUsed ) sal_uInt16 nInsPos, nAdd = aSortConvNames.Count(); while( !aSortConvNames.Insert( pConvName, nInsPos ) ) - (pConvName->Append( '_' )).Append( - ByteString::CreateFromInt32( nAdd++ )); + (pConvName->Append( '_' )).Append(ByteString( + rtl::OString::valueOf(static_cast<sal_Int32>(nAdd++)))); aOrigNames.Insert( pName, nInsPos ); } } diff --git a/svl/source/items/whassert.hxx b/svl/source/items/whassert.hxx index 0fa492b19443..379d4794458d 100644 --- a/svl/source/items/whassert.hxx +++ b/svl/source/items/whassert.hxx @@ -29,7 +29,7 @@ #define _SFX_WHASSERT_HXX #include <tools/debug.hxx> -#include <tools/string.hxx> +#include <rtl/strbuf.hxx> //------------------------------------------------------------------------ @@ -40,10 +40,10 @@ { \ if ( !(bCondition) ) \ { \ - ByteString aMsg( sMessage ); \ - aMsg.Append(RTL_CONSTASCII_STRINGPARAM("\nwith Id/Pos: ")); \ - aMsg += ByteString::CreateFromInt32( nId ); \ - DbgError( aMsg.GetBuffer(), __FILE__, __LINE__); \ + rtl::OStringBuffer aMsg(sMessage); \ + aMsg.append(RTL_CONSTASCII_STRINGPARAM("\nwith Id/Pos: ")); \ + aMsg.append(static_cast<sal_Int32>(nId)); \ + DbgError(aMsg.getStr(), __FILE__, __LINE__); \ } \ } \ } diff --git a/svl/source/memtools/svarray.cxx b/svl/source/memtools/svarray.cxx index 43eb637ae991..4032800e0a8b 100644 --- a/svl/source/memtools/svarray.cxx +++ b/svl/source/memtools/svarray.cxx @@ -71,12 +71,8 @@ SV_IMPL_OP_PTRARR_SORT( SvStringsSort, StringPtr ) SV_IMPL_OP_PTRARR_SORT( SvStringsSortDtor, StringPtr ) SV_IMPL_PTRARR( SvByteStrings, ByteStringPtr ) -SV_IMPL_PTRARR( SvByteStringsDtor, ByteStringPtr ) -SV_IMPL_OP_PTRARR_SORT( SvByteStringsSort, ByteStringPtr ) SV_IMPL_OP_PTRARR_SORT( SvByteStringsSortDtor, ByteStringPtr ) - - // ---------------- strings ------------------------------------- // Array mit anderer Seek-Methode! @@ -171,97 +167,4 @@ sal_Bool SvStringsISortDtor::Seek_Entry( const StringPtr aE, sal_uInt16* pP ) co return sal_False; } -// ---------------- bytestrings ------------------------------------- - -// Array mit anderer Seek-Methode! -_SV_IMPL_SORTAR_ALG( SvByteStringsISort, ByteStringPtr ) -void SvByteStringsISort::DeleteAndDestroy( sal_uInt16 nP, sal_uInt16 nL ) -{ - if( nL ) - { - DBG_ASSERT( nP < nA && nP + nL <= nA, "ERR_VAR_DEL" ); - for( sal_uInt16 n=nP; n < nP + nL; n++ ) - delete *((ByteStringPtr*)pData+n); - SvPtrarr::Remove( nP, nL ); - } -} -sal_Bool SvByteStringsISort::Seek_Entry( const ByteStringPtr aE, sal_uInt16* pP ) const -{ - register sal_uInt16 nO = SvByteStringsISort_SAR::Count(), - nM, - nU = 0; - if( nO > 0 ) - { - nO--; - while( nU <= nO ) - { - nM = nU + ( nO - nU ) / 2; - StringCompare eCmp = (*((ByteStringPtr*)pData + nM))-> - CompareIgnoreCaseToAscii( *(aE) ); - if( COMPARE_EQUAL == eCmp ) - { - if( pP ) *pP = nM; - return sal_True; - } - else if( COMPARE_LESS == eCmp ) - nU = nM + 1; - else if( nM == 0 ) - { - if( pP ) *pP = nU; - return sal_False; - } - else - nO = nM - 1; - } - } - if( pP ) *pP = nU; - return sal_False; -} - - -// Array mit anderer Seek-Methode! -_SV_IMPL_SORTAR_ALG( SvByteStringsISortDtor, ByteStringPtr ) -void SvByteStringsISortDtor::DeleteAndDestroy( sal_uInt16 nP, sal_uInt16 nL ) -{ - if( nL ) - { - DBG_ASSERT( nP < nA && nP + nL <= nA, "ERR_VAR_DEL" ); - for( sal_uInt16 n=nP; n < nP + nL; n++ ) - delete *((ByteStringPtr*)pData+n); - SvPtrarr::Remove( nP, nL ); - } -} -sal_Bool SvByteStringsISortDtor::Seek_Entry( const ByteStringPtr aE, sal_uInt16* pP ) const -{ - register sal_uInt16 nO = SvByteStringsISortDtor_SAR::Count(), - nM, - nU = 0; - if( nO > 0 ) - { - nO--; - while( nU <= nO ) - { - nM = nU + ( nO - nU ) / 2; - StringCompare eCmp = (*((ByteStringPtr*)pData + nM))-> - CompareIgnoreCaseToAscii( *(aE) ); - if( COMPARE_EQUAL == eCmp ) - { - if( pP ) *pP = nM; - return sal_True; - } - else if( COMPARE_LESS == eCmp ) - nU = nM + 1; - else if( nM == 0 ) - { - if( pP ) *pP = nU; - return sal_False; - } - else - nO = nM - 1; - } - } - if( pP ) *pP = nU; - return sal_False; -} - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/source/misc/adrparse.cxx b/svl/source/misc/adrparse.cxx index e0087aa5220d..b6aa9d9e6ff2 100644 --- a/svl/source/misc/adrparse.cxx +++ b/svl/source/misc/adrparse.cxx @@ -780,142 +780,4 @@ SvAddressParser::~SvAddressParser() m_aRest.clear(); } -//============================================================================ -// static -bool SvAddressParser::createRFC822Mailbox(String const & rPhrase, - String const & rAddrSpec, - String & rMailbox) -{ - String aTheAddrSpec; - sal_Unicode const * p = rAddrSpec.GetBuffer(); - sal_Unicode const * pEnd = p + rAddrSpec.Len(); - {for (bool bSegment = false;;) - { - p = INetMIME::skipLinearWhiteSpaceComment(p, pEnd); - if (p == pEnd) - return false; - if (bSegment) - { - sal_Unicode c = *p++; - if (c == '@') - break; - else if (c != '.') - return false; - aTheAddrSpec += '.'; - p = INetMIME::skipLinearWhiteSpaceComment(p, pEnd); - if (p == pEnd) - return false; - } - else - bSegment = true; - if (*p == '"') - { - aTheAddrSpec += *p++; - for (;;) - { - if (INetMIME::startsWithLineFolding(p, pEnd)) - p += 2; - if (p == pEnd) - return false; - if (*p == '"') - break; - if (*p == '\x0D' || (*p == '\\' && ++p == pEnd) - || !INetMIME::isUSASCII(*p)) - return false; - if (INetMIME::needsQuotedStringEscape(*p)) - aTheAddrSpec += '\\'; - aTheAddrSpec += *p++; - } - aTheAddrSpec += *p++; - } - else if (INetMIME::isAtomChar(*p)) - while (p != pEnd && INetMIME::isAtomChar(*p)) - aTheAddrSpec += *p++; - else - return false; - }} - aTheAddrSpec += '@'; - {for (bool bSegment = false;;) - { - p = INetMIME::skipLinearWhiteSpaceComment(p, pEnd); - if (p == pEnd) - { - if (bSegment) - break; - else - return false; - } - if (bSegment) - { - if (*p++ != '.') - return false; - aTheAddrSpec += '.'; - p = INetMIME::skipLinearWhiteSpaceComment(p, pEnd); - if (p == pEnd) - return false; - } - else - bSegment = true; - if (*p == '[') - { - aTheAddrSpec += *p++; - for (;;) - { - if (INetMIME::startsWithLineFolding(p, pEnd)) - p += 2; - if (p == pEnd) - return false; - if (*p == ']') - break; - if (*p == '\x0D' || *p == '[' || (*p == '\\' && ++p == pEnd) - || !INetMIME::isUSASCII(*p)) - return false; - if (*p >= '[' && *p <= ']') - aTheAddrSpec += '\\'; - aTheAddrSpec += *p++; - } - aTheAddrSpec += *p++; - } - else if (INetMIME::isAtomChar(*p)) - while (p != pEnd && INetMIME::isAtomChar(*p)) - aTheAddrSpec += *p++; - else - return false; - }} - - if (rPhrase.Len() == 0) - rMailbox = aTheAddrSpec; - else - { - bool bQuotedString = false; - p = rPhrase.GetBuffer(); - pEnd = p + rPhrase.Len(); - for (;p != pEnd; ++p) - if (!(INetMIME::isAtomChar(*p))) - { - bQuotedString = true; - break; - } - String aTheMailbox; - if (bQuotedString) - { - aTheMailbox = '"'; - for (p = rPhrase.GetBuffer(); p != pEnd; ++p) - { - if (INetMIME::needsQuotedStringEscape(*p)) - aTheMailbox += '\\'; - aTheMailbox += *p; - } - aTheMailbox += '"'; - } - else - aTheMailbox = rPhrase; - aTheMailbox.AppendAscii(RTL_CONSTASCII_STRINGPARAM(" <")); - aTheMailbox += aTheAddrSpec; - aTheMailbox += '>'; - rMailbox = aTheMailbox; - } - return true; -} - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/source/misc/inethist.cxx b/svl/source/misc/inethist.cxx index eba1e4083d38..c52c03cf6cef 100644 --- a/svl/source/misc/inethist.cxx +++ b/svl/source/misc/inethist.cxx @@ -156,9 +156,6 @@ class INetURLHistory_Impl */ void initialize (void); - void downheap (hash_entry a[], sal_uInt16 n, sal_uInt16 k); - void heapsort (hash_entry a[], sal_uInt16 n); - /** capacity. */ sal_uInt16 capacity (void) const @@ -258,42 +255,6 @@ void INetURLHistory_Impl::initialize (void) } /* - * downheap. - */ -void INetURLHistory_Impl::downheap (hash_entry a[], sal_uInt16 n, sal_uInt16 k) -{ - hash_entry h = a[k]; - while (k < n / 2) - { - sal_uInt16 i = k + k + 1; - if (((i + 1) < n) && (a[i] < a[i + 1])) i++; - if (!(h < a[i])) break; - a[k] = a[i]; - k = i; - } - a[k] = h; -} - -/* - * heapsort. - */ -void INetURLHistory_Impl::heapsort (hash_entry a[], sal_uInt16 n) -{ - hash_entry h; - - for (sal_uInt16 k = (n - 1) / 2 + 1; k > 0; k--) - downheap (a, n, k - 1); - - while (n > 0) - { - h = a[0 ]; - a[0 ] = a[n - 1]; - a[n - 1] = h; - downheap (a, --n, 0); - } -} - -/* * find. */ sal_uInt16 INetURLHistory_Impl::find (sal_uInt32 nHash) const diff --git a/svl/source/misc/inettype.cxx b/svl/source/misc/inettype.cxx index cb16349ab487..6234bc0dbe02 100644 --- a/svl/source/misc/inettype.cxx +++ b/svl/source/misc/inettype.cxx @@ -116,8 +116,6 @@ public: static UniString GetPresentation(INetContentType eTypeID); - static UniString GetExtension(const UniString & rTypeName); - static INetContentType GetContentType4Extension(UniString const & rExtension); @@ -768,24 +766,6 @@ UniString Registration::GetPresentation(INetContentType eTypeID) //============================================================================ // static -UniString Registration::GetExtension(UniString const & rTypeName) -{ - if (!m_pRegistration) - m_pRegistration = new Registration; - - UniString aTheTypeName = rTypeName; - aTheTypeName.ToLowerAscii(); - sal_uInt16 nPos; - return m_pRegistration->m_aTypeNameMap.Seek_Entry(&aTheTypeName, &nPos) ? - static_cast< TypeNameMapEntry * >(m_pRegistration-> - m_aTypeNameMap. - GetObject(nPos))-> - m_aExtension : - UniString(); -} - -//============================================================================ -// static INetContentType Registration::GetContentType4Extension(UniString const & rExtension) { @@ -848,19 +828,6 @@ MediaTypeEntry const * seekEntry(UniString const & rTypeName, } -//============================================================================ -// -// INetContentTypes -// -//============================================================================ - -//static -void INetContentTypes::Uninitialize() -{ - Registration::deinitialize(); -} - -//============================================================================ //static INetContentType INetContentTypes::RegisterContentType(UniString const & rTypeName, @@ -970,25 +937,6 @@ UniString INetContentTypes::GetPresentation(INetContentType eTypeID, //============================================================================ //static -UniString INetContentTypes::GetExtension(UniString const & rTypeName) -{ - MediaTypeEntry const * pEntry = seekEntry(rTypeName, aStaticTypeNameMap, - CONTENT_TYPE_LAST + 1); - if (pEntry) - return UniString::CreateFromAscii(pEntry->m_pExtension); - - UniString aExtension = Registration::GetExtension(rTypeName); - if (aExtension.Len() != 0) - return aExtension; - // special handling of text types, which come in uncounted variations: - return rTypeName.EqualsIgnoreCaseAscii("text", 0, - RTL_CONSTASCII_LENGTH("text")) ? - UniString::CreateFromAscii(RTL_CONSTASCII_STRINGPARAM("txt")) : - UniString::CreateFromAscii(RTL_CONSTASCII_STRINGPARAM("tmp")); -} - -//============================================================================ -//static INetContentType INetContentTypes::GetContentType4Extension(UniString const & rExtension) { @@ -1136,63 +1084,6 @@ bool INetContentTypes::GetExtensionFromURL(UniString const & rURL, } //============================================================================ -//static -INetContentType INetContentTypes::MapStringToContentType(UniString const & - rPresentation) -{ - MediaTypeEntry const * pEntry = seekEntry(rPresentation, - aStaticPresentationMap, - sizeof aStaticPresentationMap - / sizeof (MediaTypeEntry)); - return pEntry ? pEntry->m_eTypeID : CONTENT_TYPE_UNKNOWN; -} - -//============================================================================ -// static -bool INetContentTypes::parse(ByteString const & rMediaType, - ByteString & rType, ByteString & rSubType, - INetContentTypeParameterList * pParameters) -{ - sal_Char const * p = rMediaType.GetBuffer(); - sal_Char const * pEnd = p + rMediaType.Len(); - - p = INetMIME::skipLinearWhiteSpaceComment(p, pEnd); - sal_Char const * pToken = p; - bool bDowncase = false; - while (p != pEnd && INetMIME::isTokenChar(*p)) - { - bDowncase = bDowncase || INetMIME::isUpperCase(*p); - ++p; - } - if (p == pToken) - return false; - rType = ByteString(pToken, sal::static_int_cast< xub_StrLen >(p - pToken)); - if (bDowncase) - rType.ToLowerAscii(); - - p = INetMIME::skipLinearWhiteSpaceComment(p, pEnd); - if (p == pEnd || *p++ != '/') - return false; - - p = INetMIME::skipLinearWhiteSpaceComment(p, pEnd); - pToken = p; - bDowncase = false; - while (p != pEnd && INetMIME::isTokenChar(*p)) - { - bDowncase = bDowncase || INetMIME::isUpperCase(*p); - ++p; - } - if (p == pToken) - return false; - rSubType = ByteString( - pToken, sal::static_int_cast< xub_StrLen >(p - pToken)); - if (bDowncase) - rSubType.ToLowerAscii(); - - return INetMIME::scanParameters(p, pEnd, pParameters) == pEnd; -} - -//============================================================================ // static bool INetContentTypes::parse(UniString const & rMediaType, UniString & rType, UniString & rSubType, @@ -1237,116 +1128,4 @@ bool INetContentTypes::parse(UniString const & rMediaType, return INetMIME::scanParameters(p, pEnd, pParameters) == pEnd; } -//============================================================================ -// static -ByteString INetContentTypes::appendUSASCIIParameter(ByteString const & - rMediaType, - ByteString const & - rAttribute, - ByteString const & rValue) -{ - ByteString aResult = rMediaType; - aResult.Append(RTL_CONSTASCII_STRINGPARAM("; ")); - aResult += rAttribute; - aResult += '='; - bool bQuote = false; - for (xub_StrLen i = 0; i < rValue.Len(); ++i) - { - // When the value contains any ' characters, use a quoted string - // instead of a token, in order to avoid confusion with RFC 2231 - // extensions: - sal_uInt32 nChar = sal_uChar(rValue.GetChar(i)); - DBG_ASSERT(INetMIME::isUSASCII(nChar), - "INetContentTypes::appendUSASCIIParameter(): Bad value"); - if (!INetMIME::isTokenChar(nChar) || nChar == '\'') - { - bQuote = true; - break; - } - } - if (bQuote) - { - aResult += '"'; - for (xub_StrLen i = 0; i < rValue.Len(); ++i) - { - // Escape LF as well as CR to avoid confusion with line folding: - sal_uInt32 nChar = sal_uChar(rValue.GetChar(i)); - DBG_ASSERT(INetMIME::isUSASCII(nChar), - "INetContentTypes::appendUSASCIIParameter():" - " Bad value"); - switch (nChar) - { - case 0x0A: // LF - case 0x0D: // CR - case '"': - case '\\': - aResult += '\\'; - default: - aResult += static_cast< char >(nChar); - break; - } - } - aResult += '"'; - } - else - aResult += rValue; - return aResult; -} - -//============================================================================ -// static -UniString INetContentTypes::appendUSASCIIParameter(UniString const & - rMediaType, - UniString const & - rAttribute, - UniString const & rValue) -{ - UniString aResult = rMediaType; - aResult.AppendAscii(RTL_CONSTASCII_STRINGPARAM("; ")); - aResult += rAttribute; - aResult += '='; - bool bQuote = false; - for (xub_StrLen i = 0; i < rValue.Len(); ++i) - { - // When the value contains any ' characters, use a quoted string - // instead of a token, in order to avoid confusion with RFC 2231 - // extensions: - sal_uInt32 nChar = rValue.GetChar(i); - DBG_ASSERT(INetMIME::isUSASCII(nChar), - "INetContentTypes::appendUSASCIIParameter(): Bad value"); - if (!INetMIME::isTokenChar(nChar) || nChar == '\'') - { - bQuote = true; - break; - } - } - if (bQuote) - { - aResult += '"'; - for (xub_StrLen i = 0; i < rValue.Len(); ++i) - { - // Escape LF as well as CR to avoid confusion with line folding: - sal_uInt32 nChar = rValue.GetChar(i); - DBG_ASSERT(INetMIME::isUSASCII(nChar), - "INetContentTypes::appendUSASCIIParameter():" - " Bad value"); - switch (nChar) - { - case 0x0A: // LF - case 0x0D: // CR - case '"': - case '\\': - aResult += '\\'; - default: - aResult += sal_Unicode(nChar); - break; - } - } - aResult += '"'; - } - else - aResult += rValue; - return aResult; -} - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/source/misc/ownlist.cxx b/svl/source/misc/ownlist.cxx index 0e3fae02ff8e..bb018ba85782 100644 --- a/svl/source/misc/ownlist.cxx +++ b/svl/source/misc/ownlist.cxx @@ -166,64 +166,6 @@ SvCommand & SvCommandList::Append return aCommandList.back(); } -//========================================================================= -SvStream & operator >> -( - SvStream & rStm, /* Stream aus dem gelesen wird */ - SvCommandList & rThis /* Die zu f"ullende Liste */ -) -/* [Beschreibung] - - Die Liste mit ihren Elementen wird gelesen. Das Format ist: - 1. Anzahl der Elemente - 2. Alle Elemente - - [R"uckgabewert] - - SvStream & Der "ubergebene Stream. -*/ -{ - sal_uInt32 nCount = 0; - rStm >> nCount; - if( !rStm.GetError() ) - { - while( nCount-- ) - { - SvCommand aCmd; - rStm >> aCmd; - rThis.aCommandList.push_back( aCmd ); - } - } - return rStm; -} - -//========================================================================= -SvStream & operator << -( - SvStream & rStm, /* Stream in den geschrieben wird */ - const SvCommandList & rThis /* Die zu schreibende Liste */ -) -/* [Beschreibung] - - Die Liste mit ihren Elementen wir geschrieben. Das Format ist: - 1. Anzahl der Elemente - 2. Alle Elemente - - [R"uckgabewert] - - SvStream & Der "ubergebene Stream. -*/ -{ - sal_uInt32 nCount = rThis.aCommandList.size(); - rStm << nCount; - - for( sal_uInt32 i = 0; i < nCount; i++ ) - { - rStm << rThis.aCommandList[ i ]; - } - return rStm; -} - sal_Bool SvCommandList::FillFromSequence( const com::sun::star::uno::Sequence < com::sun::star::beans::PropertyValue >& aCommandSequence ) { const sal_Int32 nCount = aCommandSequence.getLength(); diff --git a/svl/source/misc/strmadpt.cxx b/svl/source/misc/strmadpt.cxx index d7905f470290..79adbb551d02 100644 --- a/svl/source/misc/strmadpt.cxx +++ b/svl/source/misc/strmadpt.cxx @@ -178,7 +178,7 @@ ErrCode SvOutputStreamOpenLockBytes::Flush() const { m_xOutputStream->flush(); } - catch (io::IOException) + catch (const io::IOException&) { return ERRCODE_IO_CANTWRITE; } @@ -223,7 +223,7 @@ ErrCode SvOutputStreamOpenLockBytes::FillAppend(void const * pBuffer, writeBytes(uno::Sequence< sal_Int8 >( static_cast< sal_Int8 const * >(pBuffer), nCount)); } - catch (io::IOException) + catch (const io::IOException&) { return ERRCODE_IO_CANTWRITE; } @@ -252,11 +252,15 @@ sal_uLong SvOutputStreamOpenLockBytes::Seek(sal_uLong) void SvOutputStreamOpenLockBytes::Terminate() { if (m_xOutputStream.is()) + { try { m_xOutputStream->closeOutput(); } - catch (io::IOException) {} + catch (const io::IOException&) + { + } + } } //============================================================================ @@ -492,7 +496,7 @@ sal_uLong SvInputStream::GetData(void * pData, sal_uLong nSize) { m_xSeekable->seek(m_nSeekedFrom); } - catch (io::IOException) + catch (const io::IOException&) { SetError(ERRCODE_IO_CANTREAD); return 0; @@ -513,7 +517,7 @@ sal_uLong SvInputStream::GetData(void * pData, sal_uLong nSize) { nCount = m_xStream->readBytes(aBuffer, nRemain); } - catch (io::IOException) + catch (const io::IOException&) { SetError(ERRCODE_IO_CANTREAD); return nRead; @@ -550,7 +554,7 @@ sal_uLong SvInputStream::GetData(void * pData, sal_uLong nSize) { nCount = m_xStream->readBytes(aBuffer, nRemain); } - catch (io::IOException) + catch (const io::IOException&) { SetError(ERRCODE_IO_CANTREAD); break; @@ -604,7 +608,9 @@ sal_uLong SvInputStream::SeekPos(sal_uLong nPos) return sal_uLong(nLength); } } - catch (io::IOException) {} + catch (const io::IOException&) + { + } else return Tell(); //@@@ } @@ -617,13 +623,17 @@ sal_uLong SvInputStream::SeekPos(sal_uLong nPos) return nPos; } else if (m_xSeekable.is()) + { try { m_xSeekable->seek(nPos); m_nSeekedFrom = STREAM_SEEK_TO_END; return nPos; } - catch (io::IOException) {} + catch (const io::IOException&) + { + } + } else if (m_pPipe->setReadPosition(nPos) == SvDataPipe_Impl::SEEK_OK) { m_nSeekedFrom = STREAM_SEEK_TO_END; @@ -658,11 +668,15 @@ SvInputStream::SvInputStream( SvInputStream::~SvInputStream() { if (m_xStream.is()) + { try { m_xStream->closeInput(); } - catch (io::IOException) {} + catch (const io::IOException&) + { + } + } delete m_pPipe; } @@ -727,7 +741,7 @@ sal_uLong SvOutputStream::PutData(void const * pData, sal_uLong nSize) + nWritten, nRemain)); } - catch (io::IOException) + catch (const io::IOException&) { SetError(ERRCODE_IO_CANTWRITE); break; @@ -758,7 +772,9 @@ void SvOutputStream::FlushData() { m_xStream->flush(); } - catch (io::IOException) {} + catch (const io::IOException&) + { + } } //============================================================================ @@ -781,11 +797,15 @@ SvOutputStream::SvOutputStream(uno::Reference< io::XOutputStream > const & SvOutputStream::~SvOutputStream() { if (m_xStream.is()) + { try { m_xStream->closeOutput(); } - catch (io::IOException) {} + catch (const io::IOException&) + { + } + } } //============================================================================ diff --git a/svl/source/misc/urihelper.cxx b/svl/source/misc/urihelper.cxx index ac70f8a6e467..1bef290f3dfd 100644 --- a/svl/source/misc/urihelper.cxx +++ b/svl/source/misc/urihelper.cxx @@ -65,10 +65,6 @@ #include <unotools/charclass.hxx> #include "rtl/instance.hxx" -namespace unnamed_svl_urihelper {} -using namespace unnamed_svl_urihelper; - // unnamed namespaces don't work well yet... - namespace css = com::sun::star; using namespace com::sun::star; @@ -78,7 +74,7 @@ using namespace com::sun::star; // //============================================================================ -namespace unnamed_svl_urihelper { +namespace { inline UniString toUniString(ByteString const & rString) { @@ -152,24 +148,6 @@ inline UniString SmartRel2Abs_Impl(INetURLObject const & rTheBaseURIRef, UniString URIHelper::SmartRel2Abs(INetURLObject const & rTheBaseURIRef, - ByteString const & rTheRelURIRef, - Link const & rMaybeFileHdl, - bool bCheckFileExists, - bool bIgnoreFragment, - INetURLObject::EncodeMechanism eEncodeMechanism, - INetURLObject::DecodeMechanism eDecodeMechanism, - rtl_TextEncoding eCharset, - bool bRelativeNonURIs, - INetURLObject::FSysStyle eStyle) -{ - return SmartRel2Abs_Impl(rTheBaseURIRef, rTheRelURIRef, rMaybeFileHdl, - bCheckFileExists, bIgnoreFragment, - eEncodeMechanism, eDecodeMechanism, eCharset, - bRelativeNonURIs, eStyle); -} - -UniString -URIHelper::SmartRel2Abs(INetURLObject const & rTheBaseURIRef, UniString const & rTheRelURIRef, Link const & rMaybeFileHdl, bool bCheckFileExists, @@ -422,7 +400,7 @@ rtl::OUString URIHelper::simpleNormalizedMakeRelative( // //============================================================================ -namespace unnamed_svl_urihelper { +namespace { inline xub_StrLen nextChar(UniString const & rStr, xub_StrLen nPos) { @@ -887,65 +865,4 @@ URIHelper::removePassword(UniString const & rURI, String(aObj.GetURLNoPass(eDecodeMechanism, eCharset)); } -//============================================================================ -// -// queryFSysStyle -// -//============================================================================ - -INetURLObject::FSysStyle URIHelper::queryFSysStyle(UniString const & rFileUrl, - bool bAddConvenienceStyles) - throw (uno::RuntimeException) -{ - ::ucbhelper::ContentBroker const * pBroker = ::ucbhelper::ContentBroker::get(); - uno::Reference< ucb::XContentProviderManager > xManager; - if (pBroker) - xManager = pBroker->getContentProviderManagerInterface(); - uno::Reference< beans::XPropertySet > xProperties; - if (xManager.is()) - xProperties - = uno::Reference< beans::XPropertySet >( - xManager->queryContentProvider(rFileUrl), uno::UNO_QUERY); - sal_Int32 nNotation = ucb::FileSystemNotation::UNKNOWN_NOTATION; - if (xProperties.is()) - try - { - xProperties->getPropertyValue(rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM( - "FileSystemNotation"))) - >>= nNotation; - } - catch (beans::UnknownPropertyException const &) {} - catch (lang::WrappedTargetException const &) {} - - // The following code depends on the fact that the - // com::sun::star::ucb::FileSystemNotation constants range from UNKNOWN to - // MAC, without any holes. The table below has two entries per notation, - // the first is used if bAddConvenienceStyles == false, while the second - // is used if bAddConvenienceStyles == true: - static INetURLObject::FSysStyle const aMap[][2] - = { { INetURLObject::FSysStyle(0), - INetURLObject::FSYS_DETECT }, - // UNKNOWN - { INetURLObject::FSYS_UNX, - INetURLObject::FSysStyle(INetURLObject::FSYS_VOS - | INetURLObject::FSYS_UNX) }, - // UNIX - { INetURLObject::FSYS_DOS, - INetURLObject::FSysStyle(INetURLObject::FSYS_VOS - | INetURLObject::FSYS_UNX - | INetURLObject::FSYS_DOS) }, - // DOS - { INetURLObject::FSYS_MAC, - INetURLObject::FSysStyle(INetURLObject::FSYS_VOS - | INetURLObject::FSYS_UNX - | INetURLObject::FSYS_MAC) } }; - return aMap[nNotation < ucb::FileSystemNotation::UNKNOWN_NOTATION - || nNotation > ucb::FileSystemNotation::MAC_NOTATION ? - 0 : - nNotation - - ucb::FileSystemNotation::UNKNOWN_NOTATION] - [bAddConvenienceStyles]; -} - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/source/numbers/zforlist.cxx b/svl/source/numbers/zforlist.cxx index ffdb583261f7..8ff4867274c0 100644 --- a/svl/source/numbers/zforlist.cxx +++ b/svl/source/numbers/zforlist.cxx @@ -57,6 +57,7 @@ #include <unotools/digitgroupingiterator.hxx> #include <rtl/logfile.hxx> #include <rtl/instance.hxx> +#include <rtl/strbuf.hxx> #include <math.h> #include <limits> @@ -99,26 +100,28 @@ static sal_uInt32 theIndexTable[NF_INDEX_TABLE_ENTRIES]; also handles one instance of the SysLocale options */ +typedef ::std::vector< SvNumberFormatter* > SvNumberFormatterList_impl; + class SvNumberFormatterRegistry_Impl : public utl::ConfigurationListener { - List aFormatters; - SvtSysLocaleOptions aSysLocaleOptions; - LanguageType eSysLanguage; + SvNumberFormatterList_impl aFormatters; + SvtSysLocaleOptions aSysLocaleOptions; + LanguageType eSysLanguage; public: SvNumberFormatterRegistry_Impl(); virtual ~SvNumberFormatterRegistry_Impl(); - void Insert( SvNumberFormatter* pThis ) - { aFormatters.Insert( pThis, LIST_APPEND ); } - SvNumberFormatter* Remove( SvNumberFormatter* pThis ) - { return (SvNumberFormatter*)aFormatters.Remove( pThis ); } - sal_uInt32 Count() - { return aFormatters.Count(); } + void Insert( SvNumberFormatter* pThis ) + { aFormatters.push_back( pThis ); } - virtual void ConfigurationChanged( utl::ConfigurationBroadcaster*, sal_uInt32 ); -}; + SvNumberFormatter* Remove( SvNumberFormatter* pThis ); + size_t Count() + { return aFormatters.size(); } + + virtual void ConfigurationChanged( utl::ConfigurationBroadcaster*, sal_uInt32 ); +}; SvNumberFormatterRegistry_Impl::SvNumberFormatterRegistry_Impl() { @@ -133,26 +136,37 @@ SvNumberFormatterRegistry_Impl::~SvNumberFormatterRegistry_Impl() } -void SvNumberFormatterRegistry_Impl::ConfigurationChanged( utl::ConfigurationBroadcaster*, sal_uInt32 nHint ) +SvNumberFormatter* SvNumberFormatterRegistry_Impl::Remove( SvNumberFormatter* pThis ) { + for( + SvNumberFormatterList_impl::iterator it = aFormatters.begin(); + it < aFormatters.end(); + ++it + ) { + if ( *it == pThis ) { + aFormatters.erase( it ); + break; + } + } + return pThis; +} + +void SvNumberFormatterRegistry_Impl::ConfigurationChanged( + utl::ConfigurationBroadcaster*, + sal_uInt32 nHint +) { if ( nHint & SYSLOCALEOPTIONS_HINT_LOCALE ) { ::osl::MutexGuard aGuard( SvNumberFormatter::GetMutex() ); - for ( SvNumberFormatter* p = (SvNumberFormatter*)aFormatters.First(); - p; p = (SvNumberFormatter*)aFormatters.Next() ) - { - p->ReplaceSystemCL( eSysLanguage ); - } + for( size_t i = 0, n = aFormatters.size(); i < n; ++i ) + aFormatters[ i ]->ReplaceSystemCL( eSysLanguage ); eSysLanguage = MsLangId::getRealLanguage( LANGUAGE_SYSTEM ); } if ( nHint & SYSLOCALEOPTIONS_HINT_CURRENCY ) { ::osl::MutexGuard aGuard( SvNumberFormatter::GetMutex() ); - for ( SvNumberFormatter* p = (SvNumberFormatter*)aFormatters.First(); - p; p = (SvNumberFormatter*)aFormatters.Next() ) - { - p->ResetDefaultSystemCurrency(); - } + for( size_t i = 0, n = aFormatters.size(); i < n; ++i ) + aFormatters[ i ]->ResetDefaultSystemCurrency(); } } @@ -2091,8 +2105,9 @@ sal_Int32 SvNumberFormatter::ImpAdjustFormatCodeDefault( if ( !nCnt ) return -1; if (bCheckCorrectness && LocaleDataWrapper::areChecksEnabled()) - { // check the locale data for correctness - ByteString aMsg; + { + // check the locale data for correctness + rtl::OStringBuffer aMsg; sal_Int32 nElem, nShort, nMedium, nLong, nShortDef, nMediumDef, nLongDef; nShort = nMedium = nLong = nShortDef = nMediumDef = nLongDef = -1; for ( nElem = 0; nElem < nCnt; nElem++ ) @@ -2109,7 +2124,7 @@ sal_Int32 SvNumberFormatter::ImpAdjustFormatCodeDefault( nLong = nElem; break; default: - aMsg = "unknown type"; + aMsg.append(RTL_CONSTASCII_STRINGPARAM("unknown type")); } if ( pFormatArr[nElem].Default ) { @@ -2117,47 +2132,44 @@ sal_Int32 SvNumberFormatter::ImpAdjustFormatCodeDefault( { case i18n::KNumberFormatType::SHORT : if ( nShortDef != -1 ) - aMsg = "dupe short type default"; + aMsg.append(RTL_CONSTASCII_STRINGPARAM("dupe short type default")); nShortDef = nElem; break; case i18n::KNumberFormatType::MEDIUM : if ( nMediumDef != -1 ) - aMsg = "dupe medium type default"; + aMsg.append(RTL_CONSTASCII_STRINGPARAM("dupe medium type default")); nMediumDef = nElem; break; case i18n::KNumberFormatType::LONG : if ( nLongDef != -1 ) - aMsg = "dupe long type default"; + aMsg.append(RTL_CONSTASCII_STRINGPARAM("dupe long type default")); nLongDef = nElem; break; } } - if ( aMsg.Len() ) + if (aMsg.getLength()) { - aMsg.Insert( "SvNumberFormatter::ImpAdjustFormatCodeDefault: ", 0 ); - aMsg += "\nXML locale data FormatElement formatindex: "; - aMsg += ByteString::CreateFromInt32( pFormatArr[nElem].Index ); - String aUMsg( aMsg, RTL_TEXTENCODING_ASCII_US); - LocaleDataWrapper::outputCheckMessage( - xLocaleData->appendLocaleInfo( aUMsg)); - aMsg.Erase(); + aMsg.insert(0, RTL_CONSTASCII_STRINGPARAM("SvNumberFormatter::ImpAdjustFormatCodeDefault: ")); + aMsg.append(RTL_CONSTASCII_STRINGPARAM("\nXML locale data FormatElement formatindex: ")); + aMsg.append(static_cast<sal_Int32>(pFormatArr[nElem].Index)); + rtl::OUString aUMsg(rtl::OStringToOUString(aMsg.makeStringAndClear(), + RTL_TEXTENCODING_ASCII_US)); + LocaleDataWrapper::outputCheckMessage(xLocaleData->appendLocaleInfo(aUMsg)); } } if ( nShort != -1 && nShortDef == -1 ) - aMsg += "no short type default "; + aMsg.append(RTL_CONSTASCII_STRINGPARAM("no short type default ")); if ( nMedium != -1 && nMediumDef == -1 ) - aMsg += "no medium type default "; + aMsg.append(RTL_CONSTASCII_STRINGPARAM("no medium type default ")); if ( nLong != -1 && nLongDef == -1 ) - aMsg += "no long type default "; - if ( aMsg.Len() ) + aMsg.append(RTL_CONSTASCII_STRINGPARAM("no long type default ")); + if (aMsg.getLength()) { - aMsg.Insert( "SvNumberFormatter::ImpAdjustFormatCodeDefault: ", 0 ); - aMsg += "\nXML locale data FormatElement group of: "; - String aUMsg( aMsg, RTL_TEXTENCODING_ASCII_US); - aUMsg += String( pFormatArr[0].NameID ); + aMsg.insert(0, RTL_CONSTASCII_STRINGPARAM("SvNumberFormatter::ImpAdjustFormatCodeDefault: ")); + aMsg.append(RTL_CONSTASCII_STRINGPARAM("\nXML locale data FormatElement group of: ")); + rtl::OUString aUMsg(rtl::OStringToOUString(aMsg.makeStringAndClear(), RTL_TEXTENCODING_ASCII_US)); LocaleDataWrapper::outputCheckMessage( - xLocaleData->appendLocaleInfo( aUMsg)); - aMsg.Erase(); + xLocaleData->appendLocaleInfo(aUMsg + pFormatArr[0].NameID)); } } // find the default (medium preferred, then long) and reset all other defaults @@ -2749,7 +2761,6 @@ void SvNumberFormatter::GenerateFormat(String& sString, const String& rThSep = GetNumThousandSep(); SvNumberformat* pFormat = (SvNumberformat*) aFTable.Get(nIndex); - sal_Bool insertBrackets = pFormat->IsNegativeInBracket(); if (nAnzLeading == 0) { @@ -2843,36 +2854,42 @@ void SvNumberFormatter::GenerateFormat(String& sString, sString += ';'; sString += sNegStr; } - if ( (IsRed || insertBrackets ) && eType != NUMBERFORMAT_CURRENCY) + if (eType != NUMBERFORMAT_CURRENCY) { - String sTmpStr = sString; - - if ( pFormat->HasPositiveBracketPlaceholder() ) + bool insertBrackets = false; + if ( eType != NUMBERFORMAT_UNDEFINED) + insertBrackets = pFormat->IsNegativeInBracket(); + if (IsRed || insertBrackets) { - sTmpStr += '_'; - sTmpStr += ')'; - } - sTmpStr += ';'; + String sTmpStr = sString; - if (IsRed) - { - sTmpStr += '['; - sTmpStr += pFormatScanner->GetRedString(); - sTmpStr += ']'; - } + if ( pFormat->HasPositiveBracketPlaceholder() ) + { + sTmpStr += '_'; + sTmpStr += ')'; + } + sTmpStr += ';'; - if (insertBrackets) - { - sTmpStr += '('; - sTmpStr += sString; - sTmpStr += ')'; - } - else - { - sTmpStr += '-'; - sTmpStr +=sString; - } - sString = sTmpStr; + if (IsRed) + { + sTmpStr += '['; + sTmpStr += pFormatScanner->GetRedString(); + sTmpStr += ']'; + } + + if (insertBrackets) + { + sTmpStr += '('; + sTmpStr += sString; + sTmpStr += ')'; + } + else + { + sTmpStr += '-'; + sTmpStr +=sString; + } + sString = sTmpStr; + } } } @@ -3533,21 +3550,12 @@ void SvNumberFormatter::GetCompatibilityCurrency( String& rSymbol, String& rAbbr void lcl_CheckCurrencySymbolPosition( const NfCurrencyEntry& rCurr ) { - short nPos = -1; // -1:=unknown, 0:=vorne, 1:=hinten - short nNeg = -1; switch ( rCurr.GetPositiveFormat() ) { case 0: // $1 - nPos = 0; - break; case 1: // 1$ - nPos = 1; - break; case 2: // $ 1 - nPos = 0; - break; case 3: // 1 $ - nPos = 1; break; default: LocaleDataWrapper::outputCheckMessage( @@ -3557,75 +3565,27 @@ void lcl_CheckCurrencySymbolPosition( const NfCurrencyEntry& rCurr ) switch ( rCurr.GetNegativeFormat() ) { case 0: // ($1) - nNeg = 0; - break; case 1: // -$1 - nNeg = 0; - break; case 2: // $-1 - nNeg = 0; - break; case 3: // $1- - nNeg = 0; - break; case 4: // (1$) - nNeg = 1; - break; case 5: // -1$ - nNeg = 1; - break; case 6: // 1-$ - nNeg = 1; - break; case 7: // 1$- - nNeg = 1; - break; case 8: // -1 $ - nNeg = 1; - break; case 9: // -$ 1 - nNeg = 0; - break; case 10: // 1 $- - nNeg = 1; - break; case 11: // $ -1 - nNeg = 0; - break; case 12 : // $ 1- - nNeg = 0; - break; case 13 : // 1- $ - nNeg = 1; - break; case 14 : // ($ 1) - nNeg = 0; - break; case 15 : // (1 $) - nNeg = 1; break; default: LocaleDataWrapper::outputCheckMessage( "lcl_CheckCurrencySymbolPosition: unknown NegativeFormat"); break; } - if ( nPos >= 0 && nNeg >= 0 && nPos != nNeg ) - { - ByteString aStr( "positions of currency symbols differ\nLanguage: " ); - aStr += ByteString::CreateFromInt32( rCurr.GetLanguage() ); - aStr += " <"; - aStr += ByteString( rCurr.GetSymbol(), RTL_TEXTENCODING_UTF8 ); - aStr += "> positive: "; - aStr += ByteString::CreateFromInt32( rCurr.GetPositiveFormat() ); - aStr += ( nPos ? " (postfix)" : " (prefix)" ); - aStr += ", negative: "; - aStr += ByteString::CreateFromInt32( rCurr.GetNegativeFormat() ); - aStr += ( nNeg ? " (postfix)" : " (prefix)" ); -#if 0 -// seems that there really are some currencies which differ, e.g. YugoDinar - DBG_ERRORFILE( aStr.GetBuffer() ); -#endif - } } diff --git a/svl/source/numbers/zformat.cxx b/svl/source/numbers/zformat.cxx index 00ebf41a3dd7..cfc916993885 100644 --- a/svl/source/numbers/zformat.cxx +++ b/svl/source/numbers/zformat.cxx @@ -2007,15 +2007,7 @@ sal_Bool SvNumberformat::GetOutputString(String& sString, } return sal_False; } -/* -void SvNumberformat::GetNextFareyNumber(sal_uLong nPrec, sal_uLong x0, sal_uLong x1, - sal_uLong y0, sal_uLong y1, - sal_uLong& x2,sal_uLong& y2) -{ - x2 = ((y0+nPrec)/y1)*x1 - x0; - y2 = ((y0+nPrec)/y1)*y1 - y0; -} -*/ + sal_uLong SvNumberformat::ImpGGT(sal_uLong x, sal_uLong y) { if (y == 0) @@ -2417,7 +2409,6 @@ sal_Bool SvNumberformat::GetOutputString(double fNumber, { sal_uLong x2 = ((y0+nBasis)/y1)*x1 - x0; // naechste Farey-Zahl sal_uLong y2 = ((y0+nBasis)/y1)*y1 - y0; -// GetNextFareyNumber(nBasis, x0, x1, y0, y1, x2, y2); x0 = x1; y0 = y1; x1 = x2; @@ -2446,11 +2437,6 @@ sal_Bool SvNumberformat::GetOutputString(double fNumber, else // grosse Nenner { // 0,1234->123/1000 sal_uLong nGgt; -/* - nDiv = nBasis+1; - nFrac = ((sal_uLong)floor(0.5 + fNumber * - pow(10.0,rInfo.nCntExp))); -*/ nDiv = 10000000; nFrac = ((sal_uLong)floor(0.5 + fNumber * 10000000.0)); nGgt = ImpGGT(nDiv, nFrac); @@ -4421,7 +4407,6 @@ String SvNumberformat::GetMappedFormatstring( case NF_SYMBOLTYPE_CALDEL : if ( pStr[j+1].EqualsAscii("buddhist") ) { - //aStr.InsertAscii( "[$-", aStr.Len() ); aStr.InsertAscii( "[$-", 0 ); if ( rNum.IsSet() && rNum.GetNatNum() == 1 && MsLangId::getRealLanguage( rNum.GetLang() ) == diff --git a/svl/source/passwordcontainer/passwordcontainer.component b/svl/source/passwordcontainer/passwordcontainer.component index 42eb47cf14dd..3fc55af1861e 100644 --- a/svl/source/passwordcontainer/passwordcontainer.component +++ b/svl/source/passwordcontainer/passwordcontainer.component @@ -26,7 +26,7 @@ * **********************************************************************--> -<component loader="com.sun.star.loader.SharedLibrary" +<component loader="com.sun.star.loader.SharedLibrary" prefix="passwordcontainer" xmlns="http://openoffice.org/2010/uno-components"> <implementation name="stardiv.svl.PasswordContainer"> <service name="com.sun.star.task.PasswordContainer"/> diff --git a/svl/source/passwordcontainer/passwordcontainer.cxx b/svl/source/passwordcontainer/passwordcontainer.cxx index 6e922ea29cd7..86c72fb3619b 100644 --- a/svl/source/passwordcontainer/passwordcontainer.cxx +++ b/svl/source/passwordcontainer/passwordcontainer.cxx @@ -1538,13 +1538,7 @@ MasterPasswordRequest_Impl::MasterPasswordRequest_Impl( PasswordRequestMode Mode extern "C" { -SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnvironment ( - const sal_Char ** ppEnvTypeName, uno_Environment ** /* ppEnv */) -{ - *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; -} - -SAL_DLLPUBLIC_EXPORT void * SAL_CALL component_getFactory ( +SAL_DLLPUBLIC_EXPORT void * SAL_CALL passwordcontainer_component_getFactory ( const sal_Char * pImplementationName, void * pServiceManager, void * /* pRegistryKey */) { void * pResult = 0; diff --git a/svl/source/svdde/ddesvr.cxx b/svl/source/svdde/ddesvr.cxx index 99b8cce0ae71..08894db00556 100644 --- a/svl/source/svdde/ddesvr.cxx +++ b/svl/source/svdde/ddesvr.cxx @@ -88,7 +88,6 @@ HDDEDATA CALLBACK _export DdeInternal::SvrCallback( { int nTopics = 0; -#if 1 TCHAR chTopicBuf[250]; if( hText1 ) DdeQueryString( pInst->hDdeInstSvr, hText1, chTopicBuf, @@ -117,20 +116,6 @@ HDDEDATA CALLBACK _export DdeInternal::SvrCallback( } } -#else - for( pService = rAll.First();pService;pService = rAll.Next() ) - { - if ( !hText2 || ( *pService->pName == hText2 ) ) - { - std::vector<DdeTopic*>::const_iterator iter; - for (iter = pService->aTopics.begin(); iter != pService->aTopics.end(); ++iter) - { - if ( !hText1 || iter->pName == hText1 ) - nTopics++; - } - } - } -#endif if( !nTopics ) return (HDDEDATA)NULL; @@ -143,18 +128,6 @@ HDDEDATA CALLBACK _export DdeInternal::SvrCallback( { if ( !hText2 || (*pService->pName == hText2 ) ) { -#if 0 - for ( pTopic = pService->aTopics.First(); pTopic; - pTopic = pService->aTopics.Next() ) - { - if ( !hText1 || (*pTopic->pName == hText1) ) - { - q->hszSvc = *pService->pName; - q->hszTopic = *pTopic->pName; - q++; - } - } -#else String sTopics( pService->Topics() ); sal_uInt16 n = 0; while( STRING_NOTFOUND != n ) @@ -173,8 +146,6 @@ HDDEDATA CALLBACK _export DdeInternal::SvrCallback( } } } - -#endif } } diff --git a/svl/source/uno/registerservices.cxx b/svl/source/uno/registerservices.cxx index 5caca580694f..d001c73da633 100644 --- a/svl/source/uno/registerservices.cxx +++ b/svl/source/uno/registerservices.cxx @@ -55,13 +55,7 @@ DECLARE_CREATEINSTANCE( PathService ) extern "C" { -SVL_DLLPUBLIC void SAL_CALL component_getImplementationEnvironment ( - const sal_Char ** ppEnvTypeName, uno_Environment ** /* ppEnv */) -{ - *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; -} - -SVL_DLLPUBLIC void* SAL_CALL component_getFactory ( +SVL_DLLPUBLIC void* SAL_CALL svl_component_getFactory ( const sal_Char * pImplementationName, void * _pServiceManager, void * /* _pRegistryKey*/) { void * pResult = 0; diff --git a/svl/util/svl.component b/svl/util/svl.component index 4af1a31f5782..78fc22928ac5 100644 --- a/svl/util/svl.component +++ b/svl/util/svl.component @@ -26,7 +26,7 @@ * **********************************************************************--> -<component loader="com.sun.star.loader.SharedLibrary" +<component loader="com.sun.star.loader.SharedLibrary" prefix="svl" xmlns="http://openoffice.org/2010/uno-components"> <implementation name="com.sun.star.comp.svl.PathService"> <service name="com.sun.star.config.SpecialConfigManager"/> diff --git a/svtools/CppunitTest_svtools_filters_test.mk b/svtools/CppunitTest_svtools_filters_test.mk new file mode 100755 index 000000000000..d091ede3f2f9 --- /dev/null +++ b/svtools/CppunitTest_svtools_filters_test.mk @@ -0,0 +1,69 @@ +#************************************************************************* +# Version: MPL 1.1 / GPLv3+ / LGPLv3+ +# +# The contents of this file are subject to the Mozilla Public License Version +# 1.1 (the "License"); you may not use this file except in compliance with +# the License or as specified alternatively below. You may obtain a copy of +# the License at http://www.mozilla.org/MPL/ +# +# Software distributed under the License is distributed on an "AS IS" basis, +# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License +# for the specific language governing rights and limitations under the +# License. +# +# The Initial Developer of the Original Code is +# Caolán McNamara, Red Hat, Inc. <caolanm@redhat.com> +# Portions created by the Initial Developer are Copyright (C) 2011 the +# Initial Developer. All Rights Reserved. +# +# Major Contributor(s): +# +# For minor contributions see the git repository. +# +# Alternatively, the contents of this file may be used under the terms of +# either the GNU General Public License Version 3 or later (the "GPLv3+"), or +# the GNU Lesser General Public License Ve |